var xmlHttp

function bookmarksite(title, url){
	if (document.all)
	window.external.AddFavorite(url, title);
	else if (window.sidebar)
	window.sidebar.addPanel(title, url, '')
}

function vote(voto,game){ 
	xmlHttp=GetXmlHttpObject()
	var url="functions.php"
	url=url+"?a=Vote&v="+voto+"&g="+game
	xmlHttp.onreadystatechange= function(){ stateChanged("vote") }
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	document.getElementById("voted").innerHTML="Your Vote: <img src='http://www.lorenzgames.com/gif/vote"+voto+".gif' alt='My Vote' width='14' height='14' />"
}

function addLink(u,t,e){
	xmlHttp=GetXmlHttpObject()
	var url="functions.php"
	url=url+"?a=addLink&u="+u+"&t="+t+"&e="+e
	xmlHttp.onreadystatechange= function(){ stateChanged("addLink") }
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function contact(e,m){
	xmlHttp=GetXmlHttpObject()
	var url="functions.php"
	url=url+"?a=Contact&e="+e+"&m="+m
	xmlHttp.onreadystatechange= function(){ stateChanged("Contact") }
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChanged(obj){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		if(obj=="addLink"){
			if(xmlHttp.responseText=="ok"){document.getElementById("submitLink").innerHTML="<div class='panna'>Your link as been added to our DataBase, you have one week to activate it by linking to us on your site.<br />You will see it on this list when it will be activated by the first click from your site.</div>"}
			if(xmlHttp.responseText=="no"){document.getElementById("error").innerHTML="Fill the fields correctly!"}		
		}
		if(obj=="Contact"){
			if(xmlHttp.responseText=="ok"){document.getElementById("Contact").innerHTML="<div class='panna'>The E-Mail has been sent!<br />Our staff will answer you shortly...</div>"}
			if(xmlHttp.responseText=="no"){document.getElementById("error").innerHTML="Fill the fields correctly!"}		
		}
	} 
}

function GetXmlHttpObject(){var xmlHttp=null;
try {xmlHttp=new XMLHttpRequest();}
catch (e) {try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}
return xmlHttp;}