var xmlHttp

function showHint(cid) {

	xmlHttp=GetXmlHttpObject();
	var url="gethint.php";
	url=url+"?t=1&cid"+cid;
	url=url+"&sid="+Math.random();
	//alert(url);
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 

function badCode(cid) {

	xmlHttp=GetXmlHttpObject();
	var url="gethint.php";
	url=url+"?t=2&cid="+cid;
	url=url+"&sid="+Math.random();
	//alert(url);
	//xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 

function goodCode(cid) {

	xmlHttp=GetXmlHttpObject();
	var url="gethint.php";
	url=url+"?t=1&cid="+cid;
	url=url+"&sid="+Math.random();
	//alert(url);
	//xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 

function stateChanged() { 
	if (xmlHttp.readyState==4) { 
		var byid;
		//alert(document.secretform.whichtopopulate.value);
		byid = "txtHint_"+document.secretform.whichtopopulate.value;
		document.getElementById(byid).innerHTML=xmlHttp.responseText;
	}
}

	function stateChanged2() { 
	if (xmlHttp.readyState==4) { 
		var byid;
		//alert(document.secretform.whichtopopulate.value);
		byid = "txtHint_"+document.secretform.whichtopopulate.value;
		document.getElementById(byid).innerHTML="Thanks for letting us know!";
	}
}

	function updateLink() { 
	if (xmlHttp.readyState==4) { 
		var byid;
		//alert(document.secretform.whichtopopulate.value);
		document.linkmaster.thelink.value = xmlHttp.responseText;
	}
}

	function returnResults() { 
	if (xmlHttp.readyState==4) { 
		document.getElementById('results').innerHTML = xmlHttp.responseText;
	}
}
	function fillSpan() { 
	if (xmlHttp.readyState==4) { 
		document.getElementById('fillin').innerHTML = xmlHttp.responseText;
	}
}

	function thanksdude() { 
	if (xmlHttp.readyState==4) { 
		var byid;
		//alert(document.secretform.whichtopopulate.value);
		document.getElementById("helpus").innerHTML="We appreciate your feedback!";
	}
}


	function recalculated() { 
	if (xmlHttp.readyState==4) {
			var thediv;
			thediv = "success"+document.topop.todo.value;
		document.getElementById(thediv).innerHTML = xmlHttp.responseText;
	}
}

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;
}
