        var url1 = ""; // The server-side script 
        var url2 = ""; // The server-side script 
		
		var tid1= "";
		var tid2= "";
		var taal2 = "";

       function handleHttpResponse1() {    
        if (http1.readyState == 4) { 
              if(http1.status==200) { 
			  
                var results=http1.responseText;
				
				document.getElementById(tid1).innerHTML = results;
				tid1 = "";
				  				  
				  
					  } 
              } 
        } 	

       function handleHttpResponse2() {    
        if (http2.readyState == 4) { 
              if(http2.status==200) { 
			  
                var results=http2.responseText;
				
				//alert(results);
				
				document.getElementById(tid2).innerHTML = results;
				tid2 = "";
				  				  
				  
					  } 
              } 
        } 	
		
		
		 function handleHttpResponse3() {    
        if (http1.readyState == 4) { 
              if(http1.status==200) { 
			  
                var results=unescape(http1.responseText);
				document.location.href='index.php?rid=28&sid=65&id=&taal='+taal2;
				MM_nbGroup('down','group1','login','images/contact_click.gif','home','images/home.gif',1);				
				
				alert(results);
				
				  
					  } 
              } 
        } 	


		
			
	   function getSubmenu(rid,taal) 
	   { 
			/*url1 = "submenu.php?rid="+rid+"&taal="+taal;
			tid1 = "submenu";
			
			http1.open("GET",url1, true);
			http1.onreadystatechange = handleHttpResponse1; 
			
			http1.send(null); */
		} 
		
		function getPage(taal,pagina,sid) {   
			url2 =  "page.php?taal="+taal+"&page="+pagina+"&sid="+sid;
			tid2 = "content";
			
            http2.open("GET",url2, true);
			 
            http2.onreadystatechange = handleHttpResponse2; 
            http2.send(null); 
        } 	
		
		function getPage2(taal,pagina,sid,extraParam,extraValue) {   
			url2 =  "page.php?taal="+taal+"&page="+pagina+"&sid="+sid+"&"+extraParam+"="+extraValue;
			tid2 = "content";
			
            http2.open("GET",url2, true);
			 
            http2.onreadystatechange = handleHttpResponse2; 
            http2.send(null); 
        } 			
		
		function getSPage(taal,pagina,sid,id) {   
			url2 =  "page.php?taal="+taal+"&page="+pagina+"&sid="+sid+"&id="+id;
			tid2 = "content";
			http2.open("GET",url2, true);
			http2.onreadystatechange = handleHttpResponse2; 
			http2.send(null); 
		} 
		
		function getMeerInformatie(soort,info,id,taal,sid)
		{
			taal2 = taal;
			//alert(sid);
			if(soort == "product")
			{
			url2 = "include.php?id="+id+"&taal="+taal+"&sid="+sid+"&minfo="+info;
			}
			else
			{
			url2 = "include.php?id="+id+"&taal="+taal+"&sid="+sid+"&pagina="+info;
			}
			tid2 = "content";
		
			http2.open("GET",url2, true);
			http2.onreadystatechange = handleHttpResponse2; 
			
			http2.send(null); 		
		}
		
	   function getContent(id,taal,sid,rid) 
	   { 
	  // document.location.href="?rid="+rid+"&sid="+sid+"&id="+id+"&taal="+taal;
			/*url2 = "include.php?id="+id+"&taal="+taal+"&sid="+sid;
			tid2 = "content";
		
			http2.open("GET",url2, true);
			http2.onreadystatechange = handleHttpResponse2; 
			
			http2.send(null); */
		} 	
		
		function getContact(taal) 
	   { 
			var parameters = "";
			
			taal2= taal;
			
			var naam = "";
			var adres = "";
			var plaats= "";
			var postcode= "";
			var telefoon = "";
			var email = "";
			var bericht = "";
			
			//alert("sadsddsa");
			
			var naam = document.getElementById('naam').value;
			var adres = document.getElementById('adres').value;
			var plaats= document.getElementById('plaats').value;
			var postcode= document.getElementById('postcode').value;
			var telefoon = document.getElementById('telefoon').value;
			var email = document.getElementById('email').value;
			var bericht = document.getElementById('bericht').value;			
						
			//omschrijving = document.getElementById("omschrijving_nr"+id).value;
			url =  "verstuurEmail.php";
			parameters = "taal="+taal+"&naam="+naam+"&adres="+adres+"&"+postcode+"&plaats="+plaats+"&postcode="+postcode+"&telefoon="+telefoon+"&email="+email+"&bericht="+bericht;
			
	
			var opt = "";
			if(taal == "nederlands" || taal == "duits")
			{
			opt = multipleOption("meerInfo");
			}
			
			parameters = parameters+"&"+opt;
			
			//alert(url+" - "+parameters);
			
			http1.open("POST",url, true);
            
            http1.onreadystatechange = handleHttpResponse3; 
			
			http1.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			http1.setRequestHeader("Content-length", parameters.length);
			http1.setRequestHeader("Connection", "close");
			http1.send(parameters); 
			} 	
			
	function multipleOption(id) 
			{ 
				var post_data = ""; 
				
				idx = 0; 
				elem = document.getElementsByName(id);
				optLength = elem.length; 
				
				//alert("length: "+optLength);

			
				
				for(pms = 0; pms < optLength; pms++) 
				{ 
				
					if (elem[pms].checked == true) 
					{ 
						if (elem[pms].value != "nothing_selected") 
						{ 
							if(pms+1 == optLength)
							{
								post_data +='meerInfo[' + idx  + ']' + '=' + elem[pms].value; 
							}
							else
							{
								post_data +='meerInfo[' + idx  + ']' + '=' + elem[pms].value + '&'; 
							}
						idx++; 
						} 
					} 
				}
				var v = "";
				
				if(document.getElementById('meerInfoExtra').value != "geen")
				{
				v = document.getElementById('meerInfoExtra').value;
				}
				
				if(v != "")
				{
					idx++
					
					if(idx == 1)
					{
						post_data +='meerInfo[' + idx  + ']' + '=' + v; 
					}
					else
					{
						post_data +='&meerInfo[' + idx  + ']' + '=' + v; 
					}
				}
				//alert(alert_post_data);
				
				return post_data;
				
			} 			


		function getHTTPObject() { 
		  var xmlhttp; 
		
		  if(window.XMLHttpRequest){ 
			xmlhttp = new XMLHttpRequest(); 
		  } 
		  else if (window.ActiveXObject){ 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
			if (!xmlhttp){ 
				xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
			} 
		} 
		  return xmlhttp; 
		} 
var http1 = getHTTPObject(); // We create the HTTP Object 
var http2 = getHTTPObject(); // We create the HTTP Object 



function changeMenu(menu,element,cur,cells)
{
	var i=1;
	for (var i=1; i<=cells; i++)
	{
		if (document.getElementById(element+'_'+i))
		{
			if (document.getElementById(element+'_'+i).id==(element+'_'+cur))
			{
				if(document.getElementById(element+'_'+i).style.display == "none")
				{
				document.getElementById(element+'_'+i).style.display="block";
				}
				else
				{
				document.getElementById(element+'_'+i).style.display="none";
				}
			}
			else
			{
				document.getElementById(element+'_'+i).style.display="none";
			}
		}
	}
}

function changeSStle(id)
{
	
	if(document.getElementById('c'+id).className == "platte")
	{
	document.getElementById('c'+id).className='platteWitBruin';
	}
	else
	{
	document.getElementById('c'+id).className = 'platte';
	}
}




