//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 = '

Đang tải dữ liệu...
'; } else { document.getElementById("loadid").style.visibility='visible'; document.getElementById("loadid").style.top=document.body.scrollTop; document.getElementById("loadid").innerHTML = '
'+showstatus+''; } } } function ajax_abort(ajax_request) { ajax_request.ajaxobj.abort(); document.getElementById("loadid").style.visibility='hidden'; self.status=''; ajax_request = false; } function addOption(obj,text,value,selected) { if(obj!=null && obj.options!=null && text!=null && value!=null) { obj.options[obj.options.length] = new Option(text, value, false, selected); } } function add_listbox(containerid,responseText) { reset(containerid); //alert(responseText); responseText= responseText.split("/;"); if(isArray(responseText)) { for(var i=0;i=0;i--) { from.options[i] = null; } from.selectedIndex = 0; } function isArray(obj) { return(typeof(obj.length)=="undefined")?false:true; } function ajax_delrow(url,obj,tb,showstatus) { var eda_ajax=new eda_ajaxclass(); eda_ajax.getAjaxRequest(url, null, function(){ delrowexec(eda_ajax,obj,tb,showstatus); }, "txt"); self.status='Runing...'; return eda_ajax; } function delrowexec(ajax_request,obj,tb,showstatus) { if (ajax_request.ajaxobj.readyState == 4 && (ajax_request.ajaxobj.status==200 || window.location.href.indexOf("http")==-1)) { if(ajax_request.ajaxobj.responseText.search("executedok")!=-1) { delrow(obj,tb); } else alert('Undeleted'); if(showstatus!='no') document.getElementById("loadid").style.visibility='hidden'; ajax_request=false; document.getElementById("loadid").style.top=document.body.scrollTop; self.status='Complete'; } else if(showstatus!='no') { document.getElementById("loadid").style.visibility='visible'; document.getElementById("loadid").style.top=document.body.scrollTop; document.getElementById("loadid").innerHTML = '
'+showstatus+''; } } function load_checkdomain(domain,id) { var eda_ajax=new eda_ajaxclass(); url='?eda_act=182ee919d3c16fa19f1b752939b076ee&eda_type=ajax&eda_module=checkdomain&eda_code='+domain; eda_request=eda_ajax.getAjaxRequest(url, null, function(){ loadact_checkdomain(eda_ajax,domain, id,'html','no'); }, "txt"); self.status='Runing...'; document.getElementById('statusid_'+id).innerHTML='Đang kiểm tra ...'; return eda_ajax; } function loadact_checkdomain(ajax_request, domain, containerid,containertype,showstatus){ if (ajax_request.ajaxobj.readyState == 4 && (ajax_request.ajaxobj.status==200 || window.location.href.indexOf("http")==-1)) { if(ajax_request.ajaxobj.responseText.indexOf("Unavailable")>=0) { document.getElementById('statusid_'+containerid).innerHTML='Tên miền đã được đăng ký (Chi tiết)'; } else { document.getElementById('chk_'+containerid).disabled=false; document.getElementById('hidden_domain_'+containerid).disabled=false; document.getElementById('statusid_'+containerid).innerHTML="Chưa có chủ thể nào đăng ký"; } self.status='Completed'; ajax_request = null; } } var eda_request = false; var eda_cur_url=""; var eda_cur_hid=""; var eda_history=""; var eda_hid=""; var run_history=false;