	
	
	function state_ChangeHelp()
	{
		// if xmlhttp shows "loaded"		
		if (xmlhttp.readyState==4)
  		{
	  		// if "OK"
	  		if (xmlhttp.status==200)
	    	{
	    		//alert("XML data OK" +  xmlhttp.responseText);
				document.getElementById("bloccontent").innerHTML =  xmlhttp.responseText;
				self.scroll(0,0);
			}
	  		else
	    	{
	    		alert("Problem retrieving data");
	    	}
  		}	
	}
	
	function state_ChangeComp()
	{
		// if xmlhttp shows "loaded"		
		if (xmlhttp.readyState==4)
  		{
	  		// if "OK"
	  		if (xmlhttp.status==200)
	    	{
	    		document.getElementById("bloccontent").innerHTML = xmlhttp.responseText;
				self.scroll(0,0);
				//alert("XML data OK" +  xmlhttp.responseText);
			}
	  		else
	    	{
	    		alert("Problem retrieving data");
	    	}
  		}	
	}	
	
	function getCompetence(type,key)
	{
		var lang;
		url = "getcontent.asp";
		params = "?submit=submit&Type="+type;
		if (key != "") {
			params = params + "&SearchName="+key;
		}
		lang = document.getElementById("lang").href;
		len = lang.length-1;
		last = lang.substr(len);		
		if (lang.match("/fr/")) {
			lang = "../../fr/competences/index.asp" + params;
		} else {
			lang = "../../nl/competences/index.asp" + params;
		}		
		document.getElementById("lang").href = lang;
		url=url+params;
		//alert(url);
		xmlhttp=null;
		// code for Mozilla, etc.
		if (window.XMLHttpRequest)
	  	{
	  		xmlhttp=new XMLHttpRequest();
	  	}
		// code for IE
		else if (window.ActiveXObject)
	  	{
	  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  	}
		if (xmlhttp!=null)
	  	{
	  		xmlhttp.onreadystatechange=state_ChangeComp;
	  		xmlhttp.open("GET",url,true);
	  		xmlhttp.send(null);
	  	}
		else
	  	{
	  		alert("Your browser does not support XMLHTTP.");
	  	}
	}
	
	function getList(type,cat,sub,key)
	{
		var lang;
		url = "getcontent.asp";
		params = "?submit=submit&Type="+type;
		if (key != "") {
			params = params + "&SearchName="+key;
		}
		if (cat != "") {
			params = params + "&SearchCategory="+cat;
		}
		if (sub != "") {
			params = params + "&SearchSubCategory="+sub;
		}
		lang = document.getElementById("lang").href;
		len = lang.length-1;
		last = lang.substr(len);
		if (last != "?") {
			if (lang.match("/fr/")) {
				lang = "../../fr/competences/index.asp" + params;
			} else {
				lang = "../../nl/competences/index.asp" + params;
			}			
		} else {			
			lang = lang + params.substr(len-1);
		}
		document.getElementById("lang").href = lang;
		url=url+params;
		//alert(url);
		xmlhttp=null;
		// code for Mozilla, etc.
		if (window.XMLHttpRequest)
	  	{
	  		xmlhttp=new XMLHttpRequest();
	  	}
		// code for IE
		else if (window.ActiveXObject)
	  	{
	  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  	}
		if (xmlhttp!=null)
	  	{
	  		xmlhttp.onreadystatechange=state_ChangeComp;
	  		xmlhttp.open("GET",url,true);
	  		xmlhttp.send(null);
	  	}
		else
	  	{
	  		alert("Your browser does not support XMLHTTP.");
	  	}
	}
	
	function getCompetPost(Type,category,keyword)
	{
		var lang;
		url = "getcontent.asp";
		params = "Submit=submit&Type="+Type+"&SearchCategory="+category+"&Keyword="+keyword;
		xmlhttp=null;
		lang = document.getElementById("lang").href;
		len = lang.length-1;
		last = lang.substr(len);
		if (last != "?") {
			if (lang.match("/fr/")) {
				lang = "../../fr/competences/index.asp?" + params;
			} else {
				lang = "../../nl/competences/index.asp?" + params;
			}			
		} else {			
			lang = lang + params;
		}
		document.getElementById("lang").href = lang;
		// code for Mozilla, etc.
		if (window.XMLHttpRequest)
	  	{
	  		xmlhttp=new XMLHttpRequest();
	  	}
		// code for IE
		else if (window.ActiveXObject)
	  	{
	  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  	}
		if (xmlhttp!=null)
	  	{
	  		xmlhttp.onreadystatechange=state_ChangeComp;
	  		xmlhttp.open("POST",url,true);
			xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			xmlhttp.setRequestHeader("Content-length", params.length);
			xmlhttp.setRequestHeader("Connection", "close");
	  		xmlhttp.send(params);
	  	}
		else
	  	{
	  		alert("Your browser does not support XMLHTTP.");
	  	}
	}
	
	function getcompetence()
	{
		getCompetence('home','');
		setSubSection("0_menu");
	}
	
	function getguichet() 
	{
		getCompetence('guichet','');
		setSubSection("1_menu");
	}
	
	function getfonctionnement()
	{
		getCompetence('fonctionnement','');	
		setSubSection("2_menu");
	}
	
	function getchart()
	{
		getCompetence('chart','');
		setSubSection("sub");
		unsetSubSections();
		unsetSubCategory();
		setSubCategory("0_subM");
	}
	
	function getdesignation()
	{
		getCompetence('designation','');
		unsetSubCategory();
		setSubCategory("1_subM");
	}
	
	function getcompetences()
	{
		getCompetence('competences','');
		unsetSubCategory();
		setSubCategory("2_subM");
	}
	
	function getprocedure()
	{
		getCompetence('procedure','');
		unsetSubCategory();
		setSubCategory("3_subM");
	}
	
	function getregles()
	{
		getCompetence('regles','');
		setSubSection("3_menu");
	}
	
	function getSearchHelp (typehlp) {
			
		var lang;
		url = "gethelp.asp";
		params = "?submit=help&type="+typehlp;
		lang = document.getElementById("lang").href;
		len = lang.length-1;
		last = lang.substr(len);
		if (last != "?") {
			if (lang.match("/fr/")) {
				lang = "../../fr/competences/index.asp" + params;
			} else {
				lang = "../../nl/competences/index.asp" + params;
			}			
		} else {			
			lang = lang + params;
		}
		document.getElementById("lang").href = lang;
		url=url+params;
		//alert(url);
		xmlhttp=null;
		// code for Mozilla, etc.
		if (window.XMLHttpRequest)
	  	{
	  		xmlhttp=new XMLHttpRequest();
	  	}
		// code for IE
		else if (window.ActiveXObject)
	  	{
	  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  	}
		if (xmlhttp!=null)
	  	{
	  		xmlhttp.onreadystatechange=state_ChangeHelp;
	  		xmlhttp.open("GET",url,true);
	  		xmlhttp.send(null);
	  	}
		else
	  	{
	  		alert("Your browser does not support XMLHTTP.");
	  	}
		
	}
	
	function Search(type)
	{
		key = document.getElementById('Keyword').value;
		cat = 0;	
		getCompetPost(type,cat,key);	
	}
	
	function getsearch(type,cat,sub,key)
	{
		getList(type,cat,sub,key);	
	}
	
	function getanswer(type,id,cat,sub,key)
	{
		getAnsCompet(type,id,cat,sub,key);	
	}
	
	function getAnsCompet(type,id,cat,sub,key)
	{
		var lang;
		url = "getanswer.asp";
		params = "?submit=submit&Type="+type;
		if (key != "") {
			params = params + "&SearchName="+key;
		}
		if (id != "") {
			params = params + "&id_faq="+id;
		}		
		if (cat != "") {
			params = params + "&SearchCategory="+cat;
		}
		if (sub != "") {
			params = params + "&SearchSubCategory="+sub;
		}
		lang = document.getElementById("lang").href;
		len = lang.length-1;
		last = lang.substr(len);
		if (last != "?") {
			if (lang.match("/fr/")) {
				lang = "../../fr/competences/index.asp" + params;
			} else {
				lang = "../../nl/competences/index.asp" + params;
			}			
		} else {			
			lang = lang + params;
		}
		document.getElementById("lang").href = lang;
		url=url+params;
		//alert(url);
		xmlhttp=null;
		// code for Mozilla, etc.
		if (window.XMLHttpRequest)
	  	{
	  		xmlhttp=new XMLHttpRequest();
	  	}
		// code for IE
		else if (window.ActiveXObject)
	  	{
	  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  	}
		if (xmlhttp!=null)
	  	{
	  		xmlhttp.onreadystatechange=state_ChangeComp;
	  		xmlhttp.open("GET",url,true);
	  		xmlhttp.send(null);
	  	}
		else
	  	{
	  		alert("Your browser does not support XMLHTTP.");
	  	}
	}
	
	
	function checkInCom() {
		if (document.getElementById("typIn") != null) {
			if (document.getElementById("subhlp") != null) {				
				getSearchHelp(document.getElementById("typIn").value);
			} else {
				if (document.getElementById("id_faqIn") != null) {
					if (document.getElementById("subcatIn") != null) {
						if (document.getElementById("keyIn") != null) {
							getAnsCompet(document.getElementById("typIn").value,document.getElementById("id_faqIn").value,document.getElementById("catIn").value,document.getElementById("subcatIn").value,document.getElementById("keyIn").value);
						} else {
							getAnsCompet(document.getElementById("typIn").value,document.getElementById("id_faqIn").value,document.getElementById("catIn").value,document.getElementById("subcatIn").value,'');
						}
					} else {
						if (document.getElementById("keyIn") != null) {
							getAnsCompet(document.getElementById("typIn").value,document.getElementById("id_faqIn").value,'0','',document.getElementById("keyIn"));
						} else {
							getAnsCompet(document.getElementById("typIn").value,document.getElementById("id_faqIn").value,'0','','');
						}				
					}
				} else {
					if (document.getElementById("catIn") != null) {
						if (document.getElementById("subcatIn") != null) {
							if (document.getElementById("keyIn") != null) {
								getList(document.getElementById("typIn").value,document.getElementById("catIn").value,document.getElementById("subcatIn"),document.getElementById("id_faqIn").value,document.getElementById("keyIn").value);
							} else {
								getList(document.getElementById("typIn").value,document.getElementById("catIn").value,document.getElementById("subcatIn").value,'');
							}
						} else {
							if (document.getElementById("keyIn") != null) {
								getCompetPost(document.getElementById("typIn").value,document.getElementById("catIn").value,document.getElementById("keyIn").value);
							} else {
								getCompetPost(document.getElementById("typIn").value,document.getElementById("catIn").value,'');
							}					
						}
					} else {
						getCompetence(document.getElementById("typIn").value,'');
						checkTyp(document.getElementById("typIn").value);
					}	
				}
			}
		}
	}
	
	function checkTyp(typ) {
		
		if (typ.match('home')) {
			setSubSection("0_menu");
		} else {
			if (typ.match('chart')) {
				setSubSection("sub");
				unsetSubSections();
				unsetSubCategory();
				setSubCategory("0_subM");
			} else {
				if (typ.match('guichet')) {
					setSubSection("1_menu");
				} else {
					if (typ.match('fonctionnement')) {
						setSubSection("2_menu");
					} else {
						if (typ.match('designation')) {
							setSubSection("sub");
							unsetSubSections();
							unsetSubCategory();
							setSubCategory("1_subM");
						} else {
							if (typ.match('competences')) {
								setSubSection("sub");
								unsetSubSections();
								unsetSubCategory();
								setSubCategory("2_subM");
							} else {
								if (typ.match('procedure')) {
									setSubSection("sub");
									unsetSubSections();
									unsetSubCategory();
									setSubCategory("3_subM");
								} else {
									if (typ.match('regles')) {
										setSubSection("3_menu");
									}
								}
							}
						}
					}
				}
			}
		}							
	}
	
