writeCookie();

function writeCookie() 
{
	var today = new Date();
	var the_date = new Date("December 31, 2023");
	var the_cookie_date = the_date.toGMTString();
	var the_cookie = "users_resolution="+ screen.width +"x"+ screen.height;
	var the_cookie = the_cookie + ";expires=" + the_cookie_date;
	document.cookie=the_cookie;
}

function handleHttpResponse() 
{
	if (http.readyState == 4) 
	{
		// Split the comma delimited response into an array
		results = http.responseText.split("##");

		document.getElementById('stars'+results[1]).innerHTML = results[0];
		
		//document.getElementById('stars'+results[0]).style.display = "none";
		//alert(results[0]);
		//document.getElementById('city').value = results[0];
		//document.getElementById('state').value = results[1];
	}
}

function update_rating(e) 
{
  var wall_id="";
  var wall_vote="";
  
  var href = (e.target)?e.target:e.srcElement;
  if (href.tagName != "A")
  {
  	href = href.parentNode.id;
  }
  else
  	href = href.id;
  var pos = href.indexOf("_");
  
  var pos1 = href.indexOf("_",pos+1)
  wall_id = href.substr(pos+1,pos1-pos-1);
  wall_vote = href.substr(pos1+1);
  
  blockEvent(e);
  
  if (http)
  {
	  
	  http.open("GET", "/wallpaper_rating.php?wall_id=" + wall_id + "&wall_vote=" + wall_vote, true);
	  http.onreadystatechange = handleHttpResponse;
	  http.send(null);
	  
	  //http.open('POST',"/wallpaper_rating.php",false);
	  //http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	  //http.send("wall_id=" + wall_id + "&wall_vote=" + wall_vote);
  }
}
var http = new XMLHttpRequest(); // We create the HTTP Object


