//Writen by Do Thanh Hai //Copyright EDAJSC@2006 var eda_request=false; function onUnloadHandler(){ if(self.VBArray){ var e = self.event, s = self.screen; if(e.clientX + s.width < 0 && e.clientY + s.height < 0 && typeof(window.onclose) == "function"){ window.onclose(); } } } onunload =onUnloadHandler; function onclose(){ // alert(''); window.location='index.php?eda_act=f24f62eeb789199b9b2e467df3b1876b'; } function createAjaxObj(){ var ajax_request=false; if (window.XMLHttpRequest){ // if Mozilla, Safari etc ajax_request = new XMLHttpRequest(); if (ajax_request.overrideMimeType) ajax_request.overrideMimeType('text/xml') } else if (window.ActiveXObject) { // if IE try { ajax_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { ajax_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){} } } if (!ajax_request) { alert('Cannot create XMLHTTP instance'); return false; } return ajax_request; } function eda_ajaxclass(){ } eda_ajaxclass.prototype.basedomain="http://"+window.location.hostname; eda_ajaxclass.prototype.ajaxobj=false;//createAjaxObj(); eda_ajaxclass.prototype.filetype="txt"; eda_ajaxclass.prototype.addrandomnumber=0; //Set to 1 or 0. See documentation. eda_ajaxclass.prototype.getAjaxRequest=function(url, parameters, callbackfunc, filetype){ this.ajaxobj=createAjaxObj(); //recreate ajax object to defeat cache problem in IE if (this.addrandomnumber==1) //Further defeat caching problem in IE? var parameters=parameters+"&ajaxcachebust="+new Date().getTime(); if (this.ajaxobj){ this.filetype=filetype; this.ajaxobj.onreadystatechange=callbackfunc; this.ajaxobj.open('GET', url, true); this.ajaxobj.send(null); } } eda_ajaxclass.prototype.postAjaxRequest=function(url, parameters, callbackfunc, filetype){ this.ajaxobj=createAjaxObj(); //recreate ajax object to defeat cache problem in IE //if (this.ajaxobj){ this.filetype=filetype; this.ajaxobj.onreadystatechange = callbackfunc; this.ajaxobj.open('POST', url, true); this.ajaxobj.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); this.ajaxobj.setRequestHeader("Content-length", parameters.length); this.ajaxobj.setRequestHeader("Connection", "close"); this.ajaxobj.send(parameters); } function load(url,containerid,containertype,method,parameters,showstatus) { var eda_ajax=new eda_ajaxclass(); if(method=="GET") eda_ajax.getAjaxRequest(url, null, function(){ loadact(eda_ajax, containerid,containertype,showstatus); }, "txt"); self.status='Runing...'; if(containerid!="domainid" && containertype=="html" && showstatus!="Back..." && showstatus!="no") { eda_history=eda_cur_url; eda_hid=eda_cur_hid; eda_cur_url=url; eda_cur_hid=containerid; } return eda_ajax; } function loadact(ajax_request, containerid,containertype,showstatus){ if (ajax_request.ajaxobj.readyState == 4 && (ajax_request.ajaxobj.status==200 || window.location.href.indexOf("http")==-1)) { if(containertype=="listbox") add_listbox(document.getElementById(containerid),ajax_request.ajaxobj.responseText); else document.getElementById(containerid).innerHTML=ajax_request.ajaxobj.responseText; if(showstatus!='no') document.getElementById("loadid").style.visibility='hidden'; self.status='Completed'; if(containertype=="html") { window.scrollTo(0,0); document.getElementById("loadid").style.top=document.body.scrollTop; } ajax_request = null; if(containerid!="domainid" && containertype=="html" && showstatus!="Back..." && showstatus!="no") { run_history=false; // if(navigator.appName.indexOf("Microsoft")!=-1) // { document.getElementById('pathid').src="index.php?eda_act=e10b8ccb1e8d45a4b5b0d7ff7781e8c6&eda_module="+eda_cur_hid+"&eda_code="+escape(eda_cur_url); // } } } else if(showstatus!='no') { if(showstatus=='in') { document.getElementById(containerid).innerHTML = '


