function pausecomp(millis)
{
	var date = new Date();
	var curDate = null;
	
	do { curDate = new Date(); }
	while(curDate-date < millis);
} 

function ajaxFunction()
{
	document.getElementById('toPrint').innerHTML="<br /><b> Calculating... </b><br /> <img id='progInd' src='images/ajax-loader.gif'> ";

	setTimeout("ajaxFunction2()",1250);

}





function ajaxFunction2()
{
	var xmlHttp;
	try
	{
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	}
	catch (e)
  	{
  		// Internet Explorer
  		try
	   	{
	    	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	    }
	  	catch (e)
	    {
	    	try
	      	{
	      		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	      	}
	    	catch (e)
	      	{
	      	alert("Your browser does not support AJAX!");
	      	return false;
	   		}
	 	}
	}
  	xmlHttp.onreadystatechange=function()
    {
	    if(xmlHttp.readyState==4)
	    {
	    	//document.myForm.time.value=xmlHttp.responseText;
	    	document.getElementById('toPrint').innerHTML=xmlHttp.responseText;
	  	}
    }
    // this set the values of the form inputs to variables  
	var gpa = document.getElementById('gpa').value;
	var act = document.getElementById('act').value;
	  
	var params = "?gpa=" + gpa + "&act=" + act; // this organises the variables into a parameter string. 
	xmlHttp.open("GET","PHP/calc_scholarship.php" + params, true);
	xmlHttp.send(null);
}
