﻿var xmlHttp
var ax = window.screen.availWidth
var xa = window.screen.availHeight - window.screenTop -25
function getCourse(str)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		  alert ("Your browser does not support AJAX!");
		  return;
	} 
	var url="Ajx.asp";
	url=url+"?cou="+str+"&ax="+ax+"&xa="+xa;
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChanged() 
{ 
	if (xmlHttp.readyState==4)	{ 
		document.getElementById('displaybox').style.height = '';
		if(document.getElementById('displaybox').style.display == 'none'){
			document.getElementById('displaybox').style.display = '';
			document.getElementById('displaybox').innerHTML = xmlHttp.responseText;
			document.getElementById('displaybox').style.height = "100%";
			/*if(eval(document.getElementById('displaybox').clientHeight) < 1305){
			document.getElementById('displaybox').style.height = "1305px";
			}
			else{
				document.getElementById("displaybox").style.height = eval(document.getElementById("displaybox").clientHeight);
			}*/
		}
		else{
		document.getElementById("displaybox").style.display = "none";
		document.getElementById("displaybox").innerHTML = '';
		document.getElementById("displaybox").style.height = "0px";
	}
	return false;
	}
}function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	  // Internet Explorer
	try
    {
    	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
	catch (e)
    {
    	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
}
return xmlHttp;
}

