var SME = {} SME._xmlHttp = function(url, params, callback, method) { this.url = url; this.params = params; this.callback = callback; this.method = method; } SME._xmlHttp.prototype = { getXMLHttpRequest: function() { if (window.ActiveXObject) { var versions = ["Microsoft.XMLHTTP", "MSXML2.XMLHTTP", "MSXML2.XMLHTTP.3.0", "Msxml2.XMLHTTP.4.0", "Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.7.0"]; for (var i = 0; i < versions.length ; i++) { try { var xmlIE = new ActiveXObject(versions[i]); if (xmlIE) return xmlIE; } catch(e1) { } } } else if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else { return null; } }, XMLHttpSend: function() { this.req = this.getXMLHttpRequest(); var httpMethod = this.method ? this.method : 'GET'; if (httpMethod != 'GET' && httpMethod != 'POST') { httpMethod = 'GET'; } var httpParams = (this.params == null || this.params == '') ? null : this.params; var httpUrl = this.url; if (httpMethod == 'GET' && httpParams != null) { httpUrl = httpUrl + "?" + httpParams; } this.req.open(httpMethod, httpUrl, true); this.req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); var request = this; this.req.onreadystatechange = function() { request.onStateChange.call(request); } this.req.send(httpMethod == 'POST' ? httpParams : null); timeoutreset(); }, onStateChange: function() { this.callback(this.req); } } function start_progress() { document.getElementById('progress').style.display = 'block'; } function end_progress() { document.getElementById('progress').style.display = 'none'; } var show_waiting = function() { var _x = document.body.clientWidth/2 + document.body.scrollLeft - 190; var _y = document.body.clientHeight/3 + document.body.scrollTop; obj = document.getElementById('progress1'); obj.style.left=_x; obj.style.top=_y; obj.style.display=''; timeoutreset(); } var hide_waiting = function() { document.getElementById('progress1').style.display='none'; } var show_waiting2 = function() { var _x = document.body.clientWidth/2 + document.body.scrollLeft - 190; var _y = document.body.clientHeight/3 + document.body.scrollTop; obj = document.getElementById('progress2'); obj.style.left=_x; obj.style.top=_y; obj.style.display=''; timeoutreset(); } var hide_waiting2 = function() { document.getElementById('progress2').style.display='none'; } var timeoutreset = function(){ if (typeof parent.tmoutreset == 'function') { parent.tmoutreset(); }else if (typeof opener.tmoutreset == 'function') { opener.tmoutreset(); } }