//checkProxy()- Added by Jeff. 12 Aug 2009. If proxy on, the show SDL adv. else show external adv.
function checkProxy(fn1, param1){
	var oXMLHTTP=false;
	if(window.XMLHttpRequest){
		try{oXMLHTTP=new XMLHttpRequest();}
		catch(e){oXMLHTTP=false;}
	}else if(window.ActiveXObject){
		try{oXMLHTTP=new ActiveXObject("Msxml2.XMLHTTP");}
		catch(e){
			try{oXMLHTTP=new ActiveXObject("Microsoft.XMLHTTP");}
			catch(e){oXMLHTTP=false;}
		}
	}


	if(oXMLHTTP){
		
		var targetServer;
		targetServer = "http://" + document.domain;
		
		oXMLHTTP.open("POST",targetServer,true);
		oXMLHTTP.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		oXMLHTTP.send(null);
		oXMLHTTP.onreadystatechange=function() {
			if(oXMLHTTP.readyState == 4){
				var xHeader = oXMLHTTP.getAllResponseHeaders();
				isProxyOn(xHeader,fn1,param1);
			}
		}
	}
}


function isProxyOn(strHeader,fn1,param1){
	if (strHeader != ""){
		if ( strHeader.search(/Proxy/) > -1 || strHeader.search(/proxy/) > -1){
			window.status = "proxy On";
			fn1(param1);
		}else{
			window.status = "proxy Off";
		}
	}else{
		return true;
	}
}
