var pxmlHttp
var idnum

function wp(id)
{

pxmlHttp=GetXmlHttpObject()
idnum = id

if (pxmlHttp==null)
  {
  alert ("Browser does not support AJAX.  You need an AJAX capable browser to vote.  Try downloading Mozilla Firefox.")
  return
  } 
var url="phrasevote.php"
url=url+"?id="+idnum
url=url+"&wd=w"
pxmlHttp.onreadystatechange=pStateChanged
pxmlHttp.open("GET",url,true)
pxmlHttp.send(null)
} 

function dp(id)
{

pxmlHttp=GetXmlHttpObject()
idnum = id

if (pxmlHttp==null)
  {
  alert ("Browser does not support AJAX.  You need an AJAX capable browser to vote.  Try downloading Mozilla Firefox.")
  return
  } 
var url="phrasevote.php"
url=url+"?id="+idnum
url=url+"&wd=d"
pxmlHttp.onreadystatechange=pStateChanged
pxmlHttp.open("GET",url,true)
pxmlHttp.send(null)
} 

function pStateChanged() 
{ 
if (pxmlHttp.readyState==4 || pxmlHttp.readyState=="complete")
 { 
	document.getElementById("wise").disabled=true
	document.getElementById("dum").disabled=true

	document.getElementById("rp").innerHTML = pxmlHttp.responseText
 } 
}

function GetXmlHttpObject()
{
var pxmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 pxmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  pxmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  pxmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return pxmlHttp;
}

