var request; function doRequestAsync(v, func) { try { request = new XMLHttpRequest(); } catch(e) { try { request = new ActiveXObject("MSXML2.XMLHTTP.3.0");; } catch(e) { try { request = new ActieXObject("Msxml2.XMLHTTP"); } catch(e) { try { request = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { alert("You cannot run this web"); return false; } } } } try { request.onreadystatechange = func; request.open("GET", v , true, top.gAccount, top.gPwd) ; request.setRequestHeader("Cache-Control","no-cache"); request.setRequestHeader("Content-Type", "text/plain;charset=utf-8"); request.setRequestHeader("Pragma","no-cache"); request.setRequestHeader("Expires","0"); request.setRequestHeader("Last-Modified","Wed, 1 Jan 1997 00:00:00 GMT"); request.setRequestHeader("If-Modified-Since","01"); request.send(); } catch(e) { alert(v +'\n'+ e.description); } } function doXMLDOMRequestAsync(v, func) { var url = "/cgi-bin/system?" ; url += "USER=" + top.gAccount + "&PWD=" + top.gPwd + "&"; url += v; xmlhttp=new XMLHttpRequest(); xmlhttp.open("GET", url , true) ; xmlhttp.send(); return xmlhttp; } //-- getCookie ########################################################################### function getCookie(c_name) { if (document.cookie.length>0){ var c_start=document.cookie.indexOf(c_name + "="); if (c_start!=-1){ c_start=c_start + c_name.length+1 ; c_end=document.cookie.indexOf(";",c_start); if (c_end==-1) c_end=document.cookie.length return unescape(document.cookie.substring(c_start,c_end)); } } return "" } //-- setCookie ########################################################################### function setCookie(c_name,value,expiredays){ var today = new Date(); var exdate=new Date(); exdate.setTime(today.getTime() + 1000*60*60*24*7);//keep for one week document.cookie=c_name+ "=" +escape(value)+"; expires="+exdate.toUTCString(); } //-- idget ########################################################################### function idget(a){ return document.getElementById(a); } //-- doRequest ########################################################################### function doRequest(v) { if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else{// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET", v , false) ; xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Pragma","no-cache"); xmlhttp.setRequestHeader("Cache-Control","no-cache"); xmlhttp.setRequestHeader("Expires","0"); xmlhttp.setRequestHeader("Last-Modified","Wed, 1 Jan 1997 00:00:00 GMT"); xmlhttp.setRequestHeader("If-Modified-Since","-1"); xmlhttp.send(); //alert(xmlhttp.responseText) return xmlhttp.responseText; } function doRequestXML(v) { if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else{// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET", v , false) ; xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Pragma","no-cache"); xmlhttp.setRequestHeader("Cache-Control","no-cache"); xmlhttp.setRequestHeader("Expires","0"); xmlhttp.setRequestHeader("Last-Modified","Wed, 1 Jan 1997 00:00:00 GMT"); xmlhttp.setRequestHeader("If-Modified-Since","-1"); xmlhttp.send(); return xmlhttp.responseXML; } //-- doSplitValue ########################################################################### function doSplitValue( v ) { var r = new Array(); r[0] = '' ; r[1] = '' ; if ( v.substr(0,4) != 'ERROR') { r[0]=v.slice(0, v.indexOf("=")); r[1]=v.slice(v.indexOf("=")+1, v.length); if ( r[0].substr(r[0].length-1,1) == ' '){ r[0] = r[0].substr(0, r[0].length-1 ) ;} if ( r[1].substr(r[1].length-1,1) == '\''){ r[1] = r[1].substr(0, r[1].length-1 ) ;} if ( r[1].substr( 0,1) == '\''){ r[1] = r[1].substr(1, r[1].length-1 ) ;} }else { r[0] = 'ERROR' ; r[1] = v.substr(6,v.length-6) ; } return r ; } //-- V2doSplitValue ########################################################################### function V2doSplitValue( v ) { var r = new Array(); r[0] = '' ; r[1] = '' ; if ( v.substr(0,4) != 'ERROR') { if ( v.indexOf('=') >= 0 ) { t = v.split("'") ; //alert(t[0]+','+t[1]); r[0] = t[0] ; r[1] = t[1] ; l = r[1].length ; if ( r[0].substr(r[0].length-1,1) == ' '){ r[0] = r[0].substr(0, r[0].length-1 ) ;} if ( r[1].substr(r[1].length-1,1) == '\''){ r[1] = r[1].substr(0, r[1].length-1 ) ;} if ( r[1].substr( 0,1) == '\''){ r[1] = r[1].substr(1, r[1].length-1 ) ;} } }else { r[0] = 'ERROR' ; r[1] = v.substr(6,v.length-6) ; } return r ; } //################################################################## function SetSelectedValue(e, v){ var i; for(i=0; i 0 ) { obj.remove(0); } var nIdx; for(nIdx=n_min; nIdx<=n_max; nIdx++){ //obj.add(new Option(nIdx, nIdx)); var y=document.createElement('option'); y.text=nIdx; y.value=nIdx; try{ obj.add(y,null); // standards compliant }catch(ex){ obj.add(y); // IE only } } } function InsertSelectOptions_Number_2(obj, n_min, n_max, str){ while (obj.options.length > 0 ) { obj.remove(0); } var nIdx; for(nIdx=n_min; nIdx<=n_max; nIdx++){ //obj.add(new Option(nIdx, nIdx)); var y=document.createElement('option'); y.text=nIdx+str; y.value=nIdx; //alert(y.value); try{ obj.add(y,null); // standards compliant }catch(ex){ obj.add(y); // IE only } } } //-- SelectSetOption ########################################################################### function SelectSetOption(obj, v){ var nIdx; for(nIdx=0; nIdx 0 ) { obj.remove(0); } items = items.split(","); for (i=0;i 0 ) { obj.remove(0); } items = items.split(","); for (i=0;i 0 ) { obj.remove(0); } items = items.split(","); values = values.split(","); for (i=0;i> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; if (isNaN(chr2)) { enc3 = enc4 = 64; } else if (isNaN(chr3)) { enc4 = 64; } output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); } return output; }, // public method for decoding decode : function (input) { var output = ""; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); while (i < input.length) { enc1 = this._keyStr.indexOf(input.charAt(i++)); enc2 = this._keyStr.indexOf(input.charAt(i++)); enc3 = this._keyStr.indexOf(input.charAt(i++)); enc4 = this._keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); if (enc3 != 64) { output = output + String.fromCharCode(chr2); } if (enc4 != 64) { output = output + String.fromCharCode(chr3); } } output = Base64._utf8_decode(output); return output; }, // private method for UTF-8 encoding _utf8_encode : function (string) { string = string.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return utftext; }, // private method for UTF-8 decoding _utf8_decode : function (utftext) { var string = ""; var i = 0; var c = c1 = c2 = 0; while ( i < utftext.length ) { c = utftext.charCodeAt(i); if (c < 128) { string += String.fromCharCode(c); i++; } else if((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i+1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return string; } } /*function doRequest1(v) { //alert("gAccount="+top.gAccount+"\n"+"gPwd="+top.gPwd) var auth = make_base_auth(top.gAccount,top.gPwd); //alert("auth="+auth) top.gauth=auth; if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else{// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } //xmlhttp.open("GET", v , false, "admin", "123456") ; xmlhttp.open("GET", v , false) ; //xmlhttp.withCredentials = true; xmlhttp.setRequestHeader('Authorization', auth); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Pragma","no-cache"); xmlhttp.setRequestHeader("Cache-Control","no-cache"); xmlhttp.setRequestHeader("Expires","0"); xmlhttp.setRequestHeader("Last-Modified","Wed, 1 Jan 1997 00:00:00 GMT"); xmlhttp.setRequestHeader("If-Modified-Since","-1"); xmlhttp.send(); //alert(xmlhttp.responseText) return xmlhttp.responseText; }*/ function printf(message){ //alert(message); }