var xmlhttp;
var divLoc;
function loadXMLDoc(url,loc){
	xmlhttp=null;
	divLoc=loc;
	if (window.XMLHttpRequest){	// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else{	// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=state_Change;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
}

function state_Change(){
	if (xmlhttp.readyState==4){	// 4 = "loaded"
		if (xmlhttp.status==200){	// 200 = "OK"
			document.getElementById(divLoc).innerHTML=xmlhttp.responseText;
			showhide(divLoc);
		}
		else{
			alert("Problem retrieving data:" + xmlhttp.statusText);
		}
	}
}
function showhide(layer_ref) {
	$("#"+layer_ref).slideToggle();
/*
	var divstyle = document.getElementById(layer_ref).style.display;
	if(divstyle.toLowerCase()=="block" || divstyle == ""){
		state = "none";
	}
	else{
		state = "block";
	}
	if (document.all) { //IS IE 4 or 5 (or 6 beta) 
		eval( "document.all." + layer_ref + ".style.display = state"); 
	} 
	if (document.layers) { //IS NETSCAPE 4 or below 
		document.layers[layer_ref].display = state; 
	} 
	if (document.getElementById &&!document.all) { 
		hza = document.getElementById(layer_ref); 
		hza.style.display = state; 
	} 
*/
} 

