// view_pi.js
// 
// S:I - 12/24/2007

var xmlhttp;

// Will log a hit to the server for each time a planning idea is viewed
function pingServer(url)
{
	xmlhttp=null;
	// code for Mozilla, etc; then IE.
	if (window.XMLHttpRequest) {
	  xmlhttp=new XMLHttpRequest();
	} else if (window.ActiveXObject) {
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	if (xmlhttp!=null) {
	  xmlhttp.onreadystatechange=state_Change;
	  xmlhttp.open("GET",url,true);
	  xmlhttp.send(null);
	}	else {
		alert("Update failed (server ping).");
	}
}

function state_Change() {
	// if xmlhttp shows "loaded"
	if (xmlhttp.readyState==4)
	  {
	  // if "OK"
	  if (xmlhttp.status==200)
    {
    // ...SUCCESS
    }
  }
}