function ajax(g) { var k = [], $ = this, l = ajax.__pool__ || (ajax.__pool__ = []); (function(e) { var d = function() {}; e = e ? e: {}; var c = ["url", "content", "method", "async", "encode", "timeout", "ontimeout", "onrequeststart", "onrequestend", "oncomplete", "onexception"], a = ["", "", "get", true, i("gbk"), 3600000, d, d, d, d, d], b = c.length; while (b--) $[c[b]] = _(e[c[b]], a[b]); if (!n()) return false; })(g); function _(_, $) { return _ != undefined ? _: $ } function n() { var a, $ = [window.xmlhttprequest, "msxml2.xmlhttp", "microsoft.xmlhttp"]; for (var b = 0; b < l.length; b += 1) if (l[b].readystate == 0 || l[b].readystate == 4) return l[b]; for (b = 0; b < $.length; b += 1) { try { if (window.xmlhttprequest) { a = ($[b] && typeof($[b]) == "function" ? new $[b] : new xmlhttprequest($[b])); }else { a = ($[b] && typeof($[b]) == "function" ? new $[b] : new activexobject($[b])); } break } catch(_) { a = false; continue } } if (!a) { throw "cannot init xmlhttprequest object!"; return false } else { l[l.length] = a; return a } } function e($) { return document.getelementbyid($) } function c($) { var _ = $ * 1; return (isnan(_) ? 0 : _) } function d($) { return (typeof($) == "string" ? ($ = e($)) ? $: false: $) } function f() { return ((new date) * 1) } function m($, _) { k[$ + ""] = _ } function h($) { return (k[$ + ""]) } function j(_, $, b) { return (function a(c) { c = c.replace(/([^\u0080-\u00ff]+)/g, function($0, $1) { return _($1) }).replace(/([\u0080-\u00ff])/g, function($0, $1) { return escape($1).replace("%", "%u00") }); for (var e = 0, d = $.length; e < d; e += 1) c = c.replace($[e], b[e]); return (c) }) } function i($) { if ($.touppercase() == "utf-8") return (encodeuricomponent); else return (j(escape, [/\+/g], ["%2b"])) } function o(a, b) { if (!a.nodename) return; var _ = "|" + a.nodename.touppercase() + "|"; if ("|input|textarea|option|".indexof(_) > -1) a.value = b; else { try { a.innerhtml = b } catch($) {} } } function p(_) { if (typeof(_) == "function") return _; else { _ = d(_); if (_) return (function($) { o(_, $.responsetext) }); else return $.oncomplete } } function b(_, a, $) { var c = 0, b = []; while (c < _.length) { b[c] = _[c] ? ($[c] ? $[c](_[c]) : _[c]) : a[c]; c += 1 } while (c < a.length) { b[c] = a[c]; c += 1 } return b } function a() { var e, c = false, k = n(), j = b(arguments, [$.url, $.content, $.oncomplete, $.method, $.async, null], [null, null, p, null, null, null]), g = j[0], i = j[1], l = j[2], m = j[3], h = j[4], a = j[5], o = m.touppercase() == "post" ? true: false; if (!g) { throw "url is null"; return false } var _ = { url: g, content: i, method: m, params: a }; if (!o) g += (g.indexof("?") > -1 ? "&": "?") + "timestamp=" + f(); k.open(m, g, h); $.onrequeststart(_); if (o) k.setrequestheader("content-type", "application/x-www-form-urlencoded"); k.setrequestheader("x-request-with", "xmlhttprequest"); e = settimeout(function() { c = true; k.abort() }, $.timeout); var d = function() { if (c) { $.ontimeout(_); $.onrequestend(_) } else if (k.readystate == 4) { cleartimeout(e); _.status = k.status; try { if (k.status == 200) l(k, a); else $.onexception(_) } catch(b) { $.onexception(_) } $.onrequestend(_) } }; k.onreadystatechange = d; if (o) k.send(i); else k.send(""); if (h == false) d(); return true } this.setcharset = function(_) { if (!$.encode) $.encode = i(_) }; this.get = function(c, b, _) { return a(c, "", b, "get", $.async, _) }; this.update = function(h, j, _, d, e) { _ = c(_); d = c(d); if (_ < 1) d = 1; var b = function() { a(j, "", h, "get", $.async, e) }, g = f(), i = function($) { b(); $--; if ($ > 0) m(g, settimeout(function() { i($) }, _)) }; i(d); return g }; this.stopupdate = function($) { cleartimeout(h($)) }; this.post = function(d, _, c, b) { return a(d, _, c, "post", $.async, b) }; this.postf = function(o, j, b) { var h = [], l, _, g, i, m, k = arguments.length, c = arguments; o = o ? d(o) : false; if (!o || o.nodename != "form") return false; validfoo = o.getattribute("onvalidate"); validfoo = validfoo ? (typeof(validfoo) == "string" ? new function(validfoo) : validfoo) : null; if (validfoo && !validfoo()) return false; var e = o.getattribute("action"), n = o.getattribute("method"), f = $.formtostr(o); if (f.length == 0) return false; if (n.touppercase() == "post") return a(e, f, j, "post", true, b); else { e += (e.indexof("?") > -1 ? "&": "?") + f; return a(e, "", j, "get", true, b) } }; this.formtostr = function(c) { var b = "", e = "", _, a; for (var d = 0; d < c.length; d += 1) { _ = c[d]; if (_.name != "") { switch (_.type) { case "select-one": if (_.selectedindex > -1) a = _.options[_.selectedindex].value; else a = ""; break; case "checkbox": case "radio": if (_.checked == true) a = _.value; break; default: a = _.value } a = $.encode(a); b += e + _.name + "=" + a; e = "&" } } return b } } //------------------------------------------------------- function checkall(bool,tagname,name) { var checkboxarray;checkboxarray=getelementsbyname(tagname,name) for (var i=0;i 70){ obj.style.height = obj.scrollheight + 'px'; } } function set(obj,value){ obj.innerhtml = value } function view(id){ document.getelementbyid(id).style.display='inline' } function hide(id){ document.getelementbyid(id).style.display='none' } function getscroll(){var t;if(document.documentelement&&document.documentelement.scrolltop){t=document.documentelement.scrolltop;}else if(document.body){t=document.body.scrolltop;}return(t);} function htmlencode(str) { var s = ""; if(str.length == 0) return ""; s = str.replace(/&/g,"&"); s = s.replace(//g,">"); s = s.replace(/ /g," "); s = s.replace(/\'/g,"'"); s = s.replace(/\"/g,"""); return s; } function getelementsbyname(tag,name){ var rtarr=new array(); var el=document.getelementsbytagname(tag); for(var i=0;i(parseint(height)+29+2+16+30)?(iheight-height-2-29-16-30)/2:0)))+"px"; msgdiv.innerhtml="
"; document.body.appendchild(msgdiv); } function openwindow2(zindex,width,height,alpha){ var iwidth = document.documentelement.scrollwidth; var bgdiv = document.createelement("div"); bgdiv.id="bg"; bgdiv.style.csstext = "top:0;width:"+iwidth+"px;height:"+document.documentelement.scrollheight+"px;filter:alpha(opacity="+alpha+");opacity:0.3;z-index:"+zindex+";"; document.body.appendchild(bgdiv); var msgdiv=document.createelement("div"); msgdiv.id="msg"; msgdiv.style.csstext ="position: absolute;z-index:"+(zindex+1)+";width:"+width+"px; height:"+(height=="auto"?height:(height+"px"))+";"; document.body.appendchild(msgdiv); } function selecttogg(){ var selects=document.getelementsbytagname("select"); for(var i=0;i