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;
/*jQuery(document).ready(function($)
{$('a[rel*=facebox]').facebox()})*/
}
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 htmlDataForVFR(url,qstring,div)
{if(url.length==0)
{document.getElementById(div).innerHTML="";return;}
xmlHttpVFR=GetXmlHttpObject()
if(xmlHttpVFR==null)
{alert("Browser does not support HTTP Request");return;}
xmlHttpVFR.onreadystatechange=function()
{if(xmlHttpVFR.readyState==4||xmlHttpVFR.readyState=="complete")
{document.getElementById(div).innerHTML=xmlHttpVFR.responseText;
jQuery(document).ready(function($)
{$('a[rel*=facebox]').facebox()})
}
else
{document.getElementById(div).innerHTML="Loading....";}}
if(qstring!='')
url=url+qstring;xmlHttpVFR.open("GET",url,true);xmlHttpVFR.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=ISO-8859-1");xmlHttpVFR.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;if(div=='p_attrib')
{htmlData("header_cart.php",'','topcart_box');}}}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');}

function htmlDataPopUp(url,qstring,title)
{	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	
	xmlHttp.onreadystatechange = function()
	{
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{
				window.open(url,"title",'width=570,height=175,toolbar=0,resizable=0');
				/*jQuery(document).ready(function($) 
				{
					$('a[rel*=facebox]').facebox() 
				})*/
			}	
				
	}
	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);
}
