
function GetXmlHttpObject(handler)
{var objXMLHttp=null
if(window.XMLHttpRequest)
{objXMLHttp=new XMLHttpRequest()}
else if(window.ActiveXObject)
{objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")}
return objXMLHttp}
function htmlData(url,qstring,div)
{if(url.length==0)
{document.getElementById(div).innerHTML="";return;}
xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request");return;}
xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{
document.getElementById(div).innerHTML=xmlHttp.responseText;
}
else
{document.getElementById(div).innerHTML="Loading....";}}
if(qstring!='')
url=url+qstring;xmlHttp.open("GET",url,true);xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=ISO-8859-1");xmlHttp.send(null);}
function makePOSTRequest(url,parameters,div){http_request=false;if(window.XMLHttpRequest){http_request=new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType('text/html');}}else if(window.ActiveXObject){try{http_request=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{http_request=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}
if(!http_request){alert('Cannot create XMLHTTP instance');return false;}
http_request.onreadystatechange=function(){
	if(http_request.readyState==4){
		if(http_request.status==200){
			result=http_request.responseText;document.getElementById(div).innerHTML=result;
		}
	}else{document.getElementById(div).innerHTML='<img src="/images/loading.gif" border=0>';}}
http_request.open('POST',url,true);http_request.setRequestHeader("Content-type","application/x-www-form-urlencoded");http_request.setRequestHeader("Content-length",parameters.length);http_request.setRequestHeader("Connection","close");http_request.send(parameters);}
function get(obj){cnt=document.getElementById('cnt').value;pststr="";for(i=1;i<=cnt;i++)
{ans=document.getElementById('pollcnt'+i);if(ans.checked)
{pststr+="&poll_ans[]="+ans.value;}}
var poststr="poll_id="+encodeURI(document.getElementById("poll_id").value)+"&poll="+encodeURI(document.getElementById("poll").value+pststr);makePOSTRequest('/poll.php',poststr,'myspan');}
