var objResponse=""
function loadXmlHttp(url, pParam, id) {
//url='Templates/loadbanner.aspx';
objResponse = id;
//alert(url);
pParam=pParam.replace(/\&amp;/g,'&');
var f = this;
f.xmlHttp = null;

if (window.XMLHttpRequest)
f.xmlHttp = new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari, others, IE 7+ when live - this is the standard method
else {
f.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
if(f.xmlHttp != null){
f.el = document.getElementById(id);
f.xmlHttp.open("POST",url+"?",true);
f.xmlHttp.onreadystatechange = function(){f.stateChanged();};
f.xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded")
f.xmlHttp.setRequestHeader("Content-length",pParam.length)
f.xmlHttp.setRequestHeader("Connection","close")
f.xmlHttp.send(pParam);
}
else alert('Your browser does not support AJAX!'); // substitute your desired request object unsupported code here
}


loadXmlHttp.prototype.stateChanged=function () {
if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
	//alert('ss');
	this.el.innerHTML = this.xmlHttp.responseText;
    //if(this.xmlHttp.readyState==4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href))){
    //    if(objResponse!=null || objResponse!=''){   
     //       var hasil=this.xmlHttp.responseText;
            //alert($('#'+objResponse).html());
            //alert(hasil);
    //        $('#'+objResponse).html(hasil);
            //$('#'+objResponse).html("<img src='/OtofinanceWeb/Images/Banners/operator.gif'>");
    //        evalScript(hasil);
      //  }
   // }
}

function evalScript(scripts)
{	try
	{	if(scripts != '')	
		{	var script = "";
			scripts = scripts.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi, function(){
	       	                         if (scripts !== null) script += arguments[1] + '\n';
 	        	                        return '';});
			if(script) (window.execScript) ? window.execScript(script) : window.setTimeout(script, 0);
		}
		return false;
	}
	catch(e)
	{	alert(e)
	}
}


