function ajaxit(token, pid) {
	if (pid != "") { resultsend("token=" + token + "&co=" + encodeURI(pid) + "&ms="+new Date().getTime()); }
}


function resultsend(str)

    {
var url = "save.php";
// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	{
		xmlhttp22=new XMLHttpRequest();
		xmlhttp22.onreadystatechange = resChange;
		xmlhttp22.open("POST", url, true);
		xmlhttp22.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
		xmlhttp22.send(str);
	}
	// code for IE
	else if (window.ActiveXObject)
	{
		xmlhttp22=new ActiveXObject("Microsoft.XMLHTTP");
		if (xmlhttp22)
		{
			xmlhttp22.onreadystatechange = resChange;
			xmlhttp22.open("POST", url, true);
			xmlhttp22.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
			xmlhttp22.send(str);
		}
	}
      
    }

function resChange()
{

if (xmlhttp22.readyState==4)
  {
  if (xmlhttp22.status==200)
    {
data = xmlhttp22.responseText;
if (parseInt(data) == 1) {
	document.getElementById("stato").innerHTML = "<b>Your graphic is ready!</b><br /><br /><a style=\"font-size:16px\" href=\"done.php?token=" + atoken + "\">Click here to continue</a>";
}
	}
  }
}

function hover(nr) {
	var z = 1;
	while (z  <= nr) {
		var dd = document.getElementById("star_" + z);
		dd.src = "http://www.pazoen.com/images/star.png";
	z++;	
	}
	var left = 5-nr;
		var z = 1;
	while (z  <= left) {
		var dd = document.getElementById("star_" + (6-z));
		dd.src = "http://www.pazoen.com/images/stare.png";
	z++;	
	}
	
}

function sendvote(score, token) {
var url = "http://www.pazoen.com/sendvote.php";
var str = "score=" + score + "&token=" + token;
// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	{
		xmlhttp23=new XMLHttpRequest();
		xmlhttp23.onreadystatechange = vChange;
		xmlhttp23.open("POST", url, true);
		xmlhttp23.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
		xmlhttp23.send(str);
	}
	// code for IE
	else if (window.ActiveXObject)
	{
		xmlhttp23=new ActiveXObject("Microsoft.XMLHTTP");
		if (xmlhttp23)
		{
			xmlhttp23.onreadystatechange = vChange;
			xmlhttp23.open("POST", url, true);
			xmlhttp23.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
			xmlhttp23.send(str);
		}
	}	
	
}
function vChange()
{

if (xmlhttp23.readyState==4)
  {
  if (xmlhttp23.status==200)
    {
data = xmlhttp23.responseText;
if (parseInt(data) == 1) {
	document.getElementById("ratev").innerHTML = "<b>Thank you for voting</b>";
}
	}
  }
}