// JavaScript Document
function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}


function pageload(pagelocation)
{
	var box=document.getElementById("mainContent");
  box.innerHTML="<div id='loadingimage'><img src='images/loading.gif' /></div>";
	xmlHttp=GetXmlHttpObject();
  xmlHttp.onreadystatechange=function()
    {
   if(xmlHttp.readyState==4)
      {
      box.innerHTML=xmlHttp.responseText;
      }
    }
  xmlHttp.open("GET",pagelocation,true);
  xmlHttp.send(null);
}


function pollvote()
{
	var voteoption;
	xmlHttp=GetXmlHttpObject();	
	for(i=0;i<document.pollform.polloptions.length;i++)
	{
		if(document.pollform.polloptions[i].checked)
			voteoption=document.pollform.polloptions[i].value;
	}
	var pollid=document.pollform.pollid.value;
	var box=document.getElementById("poll");
  xmlHttp.onreadystatechange=function()
    {
   		if(xmlHttp.readyState==4)
      {
      box.innerHTML="<img src='../images/poll_01.gif' alt='' /><br />"+xmlHttp.responseText+"<br /><img src='../images/poll_03.gif' alt='' />";
      }
    }
  xmlHttp.open("GET","poll.php?option="+voteoption+"&pollid="+pollid,true);
  xmlHttp.send(null);
} 
