
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="<img src='/images/121doc-loader.gif' border=0> Loading....";}}
if(qstring!='')
url=url+"&"+qstring;xmlHttp.open("POST",url,true);xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=ISO-8859-1");xmlHttp.send(null);}
function htmlData2(url,qstring,div)
{if(url.length==0)
{document.getElementById(div).innerHTML="";return;}
xmlHttp2=GetXmlHttpObject()
if(xmlHttp2==null)
{alert("Browser does not support HTTP Request");return;}
xmlHttp2.onreadystatechange=function()
{if(xmlHttp2.readyState==4||xmlHttp2.readyState=="complete")
{document.getElementById(div).innerHTML=xmlHttp2.responseText;}
else
{document.getElementById(div).innerHTML="<img src='/images/121doc-loader.gif' border=0> Loading....";}}
if(qstring!='')
url=url+"&"+qstring;xmlHttp2.open("POST",url,true);xmlHttp2.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=ISO-8859-1");xmlHttp2.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",'','topcartbox_new');}}}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 html_get_ip_country_popup(url,qstring,div)
{
	if (url.length==0)
	{
		return;
	}
	if(getCookie('IS_REDIRECT'))
	{
		if(getCookie('REDIRECT_URL') != "")
		{	
			location.href=getCookie('REDIRECT_URL');
		}
		return;
		
	}

	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		return;
	}
	xmlHttp.onreadystatechange = function()
	{
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
				if(xmlHttp.responseText != 'false' && xmlHttp.responseText != "")
				{
					hs.lang.loadingText = '';
					hs.align = 'center';
					hs.htmlExpand ( document.getElementById('anchor'), { src: xmlHttp.responseText, objectType: 'ajax',maxWidth:320});
				}
	
		}
	}

	if(qstring!='')
		url=url+"&"+qstring;
		
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null);
}

function redirect_ip_popup()
{
	if(getCookie('IS_REDIRECT'))
	{
		if(getCookie('REDIRECT_URL') != "")
		{	
			location.href=getCookie('REDIRECT_URL');
		}
		return;
		
	}
}
