var req;
try{	
	req=new XMLHttpRequest();    
} catch (e){    
	try{        
		req=new ActiveXObject("Microsoft.XMLHTTP");        
	} catch (e){
	}        
}

function callForm(id,url){
	/*
	*	Doet een Ajax call
	*/
	try {
		req.open('GET',url,true);		
		req.onreadystatechange=function(){
			if(req.readyState==4){
				if (req.responseText)
					document.getElementById(id).innerHTML = req.responseText;
			}
		}
		req.send(null);		
	} catch (e){
		alert(e);
		return null;	
	}
}

function getForm(form){
		/*
		*	Formulier ophalen
		*/	
		callForm('form','/ajax.php?action=get'+form+'&taalcode='+taalcode);	
//		AjaxCookie('display_'+id,'none',7);			
}
function lists(obj,to){
		/*
		*	Menu ophalen
		*/	
		//callForm('ajaxlists','/ajax.php?action=menulists&intent='+to);
		/*
		*	Markeer geselecteerde menuitem
		*/		
		window.location.href = '/catalogue/'+taalcode+'/'+to+'/';
}
function showhide(obj,id){
	if (document.getElementById(id).style.display == 'none'){
		document.getElementById(id).style.display = 'block';
		obj.src = '/images/min.gif';
		obj.alt = 'collapse';		
	} else {
		document.getElementById(id).style.display = 'none';
		obj.src = '/images/plus.gif';		
		obj.alt = 'expand';
	}
}
function catShow(slug){
	var taalcode = document.getElementById('taalcode').value;
	var division = document.getElementById('division').value;
	var intent = document.getElementById('intent').value;	
	//alert('/catalogue/'+taalcode+'/'+intent+'/'+division+'/category/'+slug);
	window.location.href = '/catalogue/'+taalcode+'/'+intent+'/'+division+'/category/'+slug;
}	
function manufShow(slug){
	var taalcode = document.getElementById('taalcode').value;
	var division = document.getElementById('division').value;
	var intent = document.getElementById('intent').value;	
	//alert('/catalogue/'+taalcode+'/'+intent+'/'+division+'/category/'+slug);
	window.location.href = '/catalogue/'+taalcode+'/'+intent+'/'+division+'/manufacturer/'+slug;
}

function AjaxCookie(cookieName,cookieValue,nDays) {
	var today = new Date();
	var expire = new Date();
	if (nDays==null || nDays==0) nDays=1;
	expire.setTime(today.getTime() + 3600000*24*nDays);
	document.cookie = cookieName+"="+escape(cookieValue)
				 + ";expires="+expire.toGMTString();
}