//url where the script is located to process the db actions
var script_path = "http://localhost:81/rating/db.php";

//funtion for xmlHTTPRequest object - multiple browser support
function getHTTPObject(){
	if(typeof XMLHttpRequest != 'undefined'){return new XMLHttpRequest();}
	try{
		return new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
		try{
			return new ActiveXObject("Microsoft.XMLHTTP");
		}catch(e){}
	}
	return false;
}

//create a var for object, instantiate, and once the object is ready setup the element from the parent
var xmlHttp = getHTTPObject();

//open the XML Request object
xmlHttp.open("GET", script_path, true);
xmlHttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");

//check the object, if its ready get the response text
xmlHttp.onreadystatechange=function(){
	if(xmlHttp.readyState==4){
		if(xmlHttp.status == 200 || xmlHttp.status == 304){
			var divId = document.getElementById('webguild_rating');
			divId.innerHTML = xmlHttp.responseText;
		}
	}
}
//set var to null to exit
xmlHttp.send(null);

//write the styles needed to the page
document.write ('<style type=\"text/css\"> \
				.votes{display:block;font:14px verdana;width:120px;min-height:100px;height:auto !important;height:100px;background:url(\'i/rating.gif\') top left no-repeat;} \
				.votes span{width:50px;display:block;position:relative;text-align:center;top:38px;right:12px;float:right;color:#664e0b;z-index:50;background-color:transparent;} \
				.votes a{display:block;width:120px;min-height:100px;height:auto !important;height:100px;text-decoration:none;font:20px verdana;z-index:5;} \
				</style>');
