﻿/*
 Copyright (c) 2008, HNAS Co. Ltd,
 Version: 1.0.2
 Create by Yongm_wang
 * Notes: You can get the site's contextPath by <head id="">
 *
 * 1.0.2 Fix the fatal bug which is caused by the patch of Cumulative Security Update for IE KB956390;
 */
var ztopWin = window;
(function(){
    while (true) {
        var a = ztopWin.parent;
        if (a && a != ztopWin && a.zPgs) 
            ztopWin = a;
        else 
            return
    }
})();

window.zPgs = function(h){
    this.Variable = function(){
        this._ = h;
        this.__ = h.document;
        this.___ = h.__.documentElement;
        h.__.write("<div id=\"jsContainer\"><input id=\"jsSaveStatus\" type=\"text\" style=\"display:none;\" \/><div id=\"cool_alert\" style=\"display:none;position:absolute;z-Index:999;overflow:hidden;\"><\/div><\/div>");
        this.zz = new function(){
            this.status = new function(){
                this.domReady = false;
                this.busy = 0;
                this.domReadyFunc = [];
                this.dealt = {};
                this.regEvent = [];
                this.regEventHash = {};
                this.charset = (((h.__.charset ? h.__.charset : h.__.characterSet) || "").match(/^(gb2312|big5|utf-8)$/gi) || "gb2312").toString().toLowerCase();
                //this.version={"gb2312":"zh-cn","big5":"zh-tw","utf-8":"en"}[this.charset];
                this.version = {
                    "gb2312": "zh-cn",
                    "big5": "zh-tw",
                    "utf-8": "zh-cn"
                }[this.charset];
                var a = ztopWin.__.getElementsByTagName("script");
                this.debug = false;
                this.alertDiv = h.__.getElementById("cool_alert");
                this.container = h.__.getElementById("jsContainer");
                this.saveStatus = h.__.getElementById("jsSaveStatus");
                this.today = new Date().toStdString()                
            };
            this.module = {
                iframe: [],
                list: {
                    address: "coolcity"
                },
                tab: {},
                selectAll: {},
                checkInput: {},
                address: {
                    source: {}
                },
                calendar: {},
                jmpInfo: {
                    array: {}
                },
                init: []
            };
            with (navigator) {
                with (userAgent) {
                    this.browser = {
                        IE: !!match(/MSIE/),
                        IE6: !!appVersion.match(/MSIE 6\.0/i),
                        Moz: match(/Mozilla/i) && !match(/compatible|WebKit/i),
                        Opera: !!match(/Opera/i),
                        Safari: !!match(/Mac|Safari/i)
                    }
                }
            }
            this.string = {
                "zh-cn": {},
                "zh-tw": {},
                "en": {}
            }[this.status.version];
            this.access = {}
        }
    };
    this.window = function(){
        this.zfixE = function(a){
            a = h.event || a || arguments.callee.caller.arguments[0];
            Pgs.Object.apply(a.ztarget = a.target ? (a.target.nodeType == 3 ? a.target.parentNode : a.target) : a.srcElement);
            return a
        };
        this.zstopEvent = function(a, c){
            a = zfixE(a);
            c = c || 0;
            if (c >= 0) 
                a.preventDefault ? a.stopPropagation() : (a.cancelBubble = true);
            if (c != 0) 
                a.preventDefault ? a.preventDefault() : (a.returnValue = false)
        };
        this.zgetUid = function(){
            return "uid_" + (new Date()).getTime() + Math.random().toString().substr(2, 5)
        };
        this.zc = this.zcreateElement = function(a){
            if (a.constructor == Array) 
                return Pgs.Object.apply(h.__.createTextNode(a.join("\n")));
            else 
                return Pgs.Object.apply(h.__.createElement(a))
        };
        this.zgetQuery = function(a){
            var c = (location.search || "").match(new RegExp("[\\?&]" + a + "=([^&]+)", "i"));
            return c ? unescape(c[1]) : null
        };
        this.zloadJs = function(a, c, d){
            var f = arguments.callee;
            var g = f.queue || (f.queue = {});
            c = c || zz.status.charset;
            a = a.replace('{$charset}', c);
            if (a in g) {
                if (d) {
                    if (g[a]) 
                        g[a].push(d);
                    else 
                        d()
                }
                return
            }
            g[a] = d ? [d] : [];
            var i = h.__.createElement("script");
            i.type = "text/javascript";
            i.charset = c;
            i.onload = i.onreadystatechange = function(){
                if (i.readyState && i.readyState != "loaded" && i.readyState != "complete") 
                    return;
                i.onreadystatechange = i.onload = null;
                while (g[a].length) 
                    g[a].shift()();
                g[a] = null
            };
            //获取域名
            var eHead = h.__.getElementsByTagName("head")[0];
            if(eHead.id!=null || eHead.id!=undefined)
            	i.src = eHead.id+"/"+a;
            else 
            	i.src = a;
            eHead.appendChild(i)
        };
        this.zloadCss = function(a, c){
        	 if (ztopWin.zz.browser.IE) 
                h.__.createStyleSheet(a).charset = c || zz.status.charset;
            else {
                var d = h.__.createElement("link");
                with (d) {
                    type = "text\/css";
                    rel = "stylesheet";
                    href = a
                }
                h.__.z("head")[0].appendChild(d)
            }
        };
        /*
         this.zgetCookie=function(a,c){
         var d=h.__.cookie.match(new RegExp("(?:^|;)\\s*"+encodeURIComponent(a)+"=([^;]+)"));
         if(c===false)return d?d[1]:null;
         if(d&&c)d=d[1].match(new RegExp("(?:^|&)\\s*"+encodeURIComponent(c)+"=([^&]+)"));
         return d?decodeURIComponent(d[1]):null
         };
         this.zdelCookie=function(a,c){
         if(c){
         var d=zgetCookie(a,false);
         if(d===null)return;
         d=d.replace(new RegExp("(^|&)\\s*"+encodeURIComponent(c)+"=[^&]+"),"").replace(/^\s*&/,"");
         if(d){
         h.__.cookie=encodeURIComponent(a)+"="+d;
         return
         }
         }
         var f=new Date();
         f.setTime(f.getTime()-1);
         h.__.cookie=encodeURIComponent(a)+"=;expires="+f
         };
         this.zsetCookie=function(a,c,d){
         if(!d){
         d=c;c=null
         }
         if(c){
         var f=zgetCookie(a,false)||"";
         if(f)f=(f+"&").replace(new RegExp("(^|&)\\s*"+encodeURIComponent(c)+"=[^&]+&"),"z1");
         h.__.cookie=encodeURIComponent(a)+"="+f+encodeURIComponent(c)+"="+encodeURIComponent(d)
         }
         else h.__.cookie=encodeURIComponent(a)+"="+encodeURIComponent(d)
         };
         */
        this.zinit = function(a){
            if (a) 
                zz.module.init.push(a);
            else 
                zz.module.init.foreach()
        };
        this.zparserRe = function(d){
            var f = [];
            var g = /<[^>]+\smod=[\'\"]?([\w|]+)[^>]+/g;
            var i = /\smod_jmpInfo_page=[\'\"]?([^\'\"\s]+)/;
            var j = /id=[\'\"]?([\w\-]+)/i;
            var l = null;
            var m = null;
            var n = null;
            (d && d.innerHTML ? d : h.__.body).innerHTML.replace(g, function(a, c){
                try {
                    if (c == "jmpInfo") {
                        if (l = a.match(i)) 
                            Pgs.module.jmpInfo(l[1])
                    }
                    else 
                        if ((m = a.match(j)) && (n = z(m[1]))) {
                            if (c in Pgs.module) 
                                new Pgs.module[c](n);
                            else 
                                f.push(n)
                        }
                } 
                catch (e) {
                    zt("parserRe函数错误:" + func.toString().slice(0, 50) + "...", "red")
                };
                return ""
            });
            var k = setInterval(function(){
                var a = f.shift();
                if (a) 
                    h.zd(a);
                else 
                    clearInterval(k)
            }, 50)
        };
        this.zd = this.zdealElement = function(c){
            Pgs.Object.apply(c);
            (c.getAttribute("mod") || "").replace(/\w+/ig, function(a){
                if (ztopWin.zz.module.list[a]) {
                    if (!ztopWin.zz.module[a].list) {
                        ztopWin.zz.module[a].list = [];
                        ztopWin.zloadJs(ztopWin.zz.module.list[a] + ".js", "utf-8")
                    }
                    ztopWin.zz.module[a].list.push(c);
                    ztopWin.zinit()
                }
                else 
                    if (Pgs.module[a]) {
                        if (a == 'jmpInfo') 
                            Pgs.module[a](c);
                        else 
                            new Pgs.module[a](c)
                    }
                return ''
            })
        };
        this.zi = function(i){
            var j = h.zz.access[i];
            if (j) 
                return j;
            else {
                j = new function(){
                    var f = [], g = [];
                    this.get = function(){
                        var a = j.value;
                        for (var c = 0; c < f.length; c++) {
                            var d = f[c].call(a);
                            if (typeof d != 'undefined') 
                                a = d
                        }
                        return a
                    };
                    this.set = function(a){
                        for (var c = 0; c < g.length; c++) {
                            var d = g[c].call(a);
                            if (typeof d != 'undefined') 
                                a = d
                        }
                        return j.value = a
                    };
                    this.regGet = function(a){
                        if (!a) 
                            f = [];
                        else 
                            f.push(a);
                        return
                    };
                    this.regSet = function(a){
                        if (!a) 
                            g = [];
                        else 
                            g.push(a);
                        return
                    }
                }
            }
            return h.zz.access[i] = j
        };
        
        this.zfixElement = function(f){
        
            function g(a, c, d){
                if ('attachEvent' in a) 
                    a.attachEvent('on' + c, d);
                else 
                    a.addEventListener(c, d)
            }
            function i(a){
                a = a.getElementsByTagName('input');
                for (var c = 0; c < a.length; c++) 
                    if (/checkbox|radio/.test(a[c].type)) 
                        return a[c];
                return null
            }
            function j(a){
                if (!a) 
                    a = window.event;
                return a.srcElement || a.target
            }
            
            function l(a){
                var c = a._0;
                if (c) {
                    a.htmlFor = c.id || (c.id = zgetUid());
                    a._0 = null
                }
                var d = a.style;
                d.borderBottom = '#aaa 1px dashed';
                d.paddingBottom = '0px';
                d.color = '#1E1A75'
            }
            function m(a){
                var c = a.style;
                c.borderBottom = '';
                c.paddingBottom = '';
                c.color = ''
            }
            f = f && f.nodeType ? f : h.__;
            if (zz.browser.IE6) {
                var n = f.getElementsByTagName("label");
                for (var k = 0; k < n.length; k++) {
                    var o = i(n[k]);
                    if (o && /checkbox|radio/.test(o.type)) 
                        (function(lbl, box){
                            lbl._0 = box;
                            g(lbl, 'mouseover', function(){
                                l(lbl)
                            });
                            g(lbl, 'mouseout', function(){
                                m(lbl)
                            })
                        })(n[k], o)
                }
            }
            
            if (zz.browser.IE) {
                var t = f.getElementsByTagName("select");
                for (var k = 0; k < t.length; k++) 
                    t[k].onmousewheel = function(){
                        return false
                    }
            }
        };
        
        this.zajax = function(a, c, d){
            var f = ["MSXML2.XMLHTTP", "Microsoft.XMLHTTP"], g;
            try {
                g = new XMLHttpRequest()
            } 
            catch (e) {
                for (var i = 0; i < f.length; i++) 
                    try {
                        g = new ActiveXObject(f[i]);
                        break
                    } 
                    catch (e) {
                    }
            }
            if (!g) 
                return;
            g.open(c ? "POST" : "GET", a || h.location.href, !!d);
            g.setRequestHeader("Content-Type", "application\/x-www-form-urlencoded");
            g.setRequestHeader("If-Modified-Since", new Date(0));
            if (d) 
                g.onreadystatechange = function(){
                    if (g.readyState == 4) 
                        if (d(g.status == 200 ? g.responseText : null) === true) {
                            setTimeout(function(){
                                h.zajax(a, c, d)
                            }, 1000)
                        }
                };
            g.send(c || '');
            return d ? g : (g.status == 200 ? g.responseText : null)
        };
        
        function u(){
            var a = ztopWin.frames["Pgs_debug"];
            if (a) 
                return a;
            with (a = ztopWin.zc("iframe")) {
                frameBorder = 0;
                id = name = "Pgs_debug";
                style.border = "1px solid red";
                style.width = "400px";
                style.height = "300px";
                style.position = zz.browser.IE6 ? "absolute" : "fixed";
                style.bottom = style.right = "10px"
            }
            ztopWin.zz.status.container.appendChild(a);
            if (zz.browser.IE6) 
                ztopWin.zr("scroll", function(){
                    with (z("Pgs_debug").style) {
                        zoom = 1;
                        zoom = 0
                    }
                });
            with ((a = u()).document) {
                open();
                write("<style>body{margin:0;padding:0;font-family:fixedsys;font-size:12px;overflow:hidden}<\/style><body><\/body>");
                close()
            }
            return a
        }
        
        this.zt = function(a, c){
            if (!ztopWin.zz.status.debug) 
                return;
            if (h != ztopWin) 
                return ztopWin.zt(a, c);
            var d = u(), f = a;
            with (d.document.body) {
                f = new Date().getTime() % (1E7) + ":" + f;
                if (c) 
                    f = "<font color=\"" + c + "\">" + f + "<\/font>";
                innerHTML = f + "<br \/>" + innerHTML
            }
            return a
        };
        this.zalert = function(a, c, d, f, g){
            var i = z("alertInfo"), j = z("alertTable"), l = 1;
            if (typeof(a) == "string") 
                a = z(a);
            else 
                Pgs.Object.apply(a);
            i.innerHTML = c;
            zz.status.alertDiv.style.display = "";
            zz.status.alertDiv.zsetPos(a, f || "tl", g || "tr");
            zz.status.alertDiv.zsetIframe();
            a.className += " pubGlobal_checkinfo_input01";
            if (d !== false) 
                a.zsetDisplay();
            function m(){
                a.className = a.className.replace("pubGlobal_checkinfo_input01", "");
                zz.status.alertDiv.style.display = "none";
                zz.status.alertDiv.zclearIframe();
                a.zur("onblur", m);
                h.__.body.zur("onmousedown", m);
                a.clearAlert = null;
                h.zalert.element = null
            }
            if (a.disabled) 
                l = 0;
            else 
                setTimeout(function(){
                    try {
                        a.focus()
                    } 
                    catch (e) {
                        l = 0
                    }
                }, 0);
            if (l) 
                a.zr("onblur", m);
            else 
                h.__.body.zr("onmousedown", m);
            h.zalert.element = a;
            a.clearAlert = m
        };
        this.checkinfo = this.zalert;
        this.zfix_height = function(){
        };
        this.c_linklist = {};
        this.c_allyes_text = {};
        this.c_allyes_delay = 1000
    };
    this.Object = function(){
        if (!this || this.nodeType == 3 || this.z) 
            return this;
        if (this.__) 
            this.z = function(objId, flag){
                var r;
                if (flag) {
                    var p = h.___.innerHTML.match(new RegExp("\\sid=([\\\'\\\"]?)([\\wz]+?[_z]" + objId.toReString() + ")\\1"), "g");
                    if (p) {
                        for (var s = 0; s < p.length; s++) {
                            r = h.z(p[s]);
                            if (r) 
                                return r
                        }
                    }
                    return h.z(objId)
                }
                else 
                    r = h.__.getElementById(objId);
                Pgs.Object.apply(r);
                return r
            };
        else 
            this.z = function(f){
                var g = this.getElementsByTagName(f);
                g.zforeach = function(a){
                    var c;
                    if (g.length !== undefined) 
                        for (var d = 0; d < g.length && (c = a.call(this, g[d], d)) !== false; d++) 
                            ;
                    else 
                        a.call(this, g, 0);
                    return c === false ? 0 : 1
                };
                for (var i = 0; i < g.length; i++) 
                    Pgs.Object.apply(g[i]);
                return g
            };
        this.module = {};
        if (!this.hasAttribute) 
            this.hasAttribute = function(str){
                return typeof this.attributes[str] != "undefined"
            };
        this.zparentNode = function(a){
            var c = Pgs.Object.apply(this.parentNode);
            if (a && c && c.tagName && c.tagName.toLowerCase() != a.toLowerCase()) 
                c = c.zparentNode(a);
            return c && c.tagName ? c : null
        };
        this.zfirstChild = function(){
            return Pgs.Object.apply(this.firstChild)
        };
        this.zlastChild = function(){
            return Pgs.Object.apply(this.lastChild)
        };
        this.zchildNodes = function(){
            var a = this.childNodes;
            for (var c = 0; c < a.length; c++) 
                Pgs.Object.apply(a[c]);
            return a
        };
        this.znSib = this.znextSibling = function(){
            return Pgs.Object.apply(this.nextSibling)
        };
        this.zpSib = this.zpreviousSibling = function(){
            return Pgs.Object.apply(this.previousSibling)
        };
        this.zclick = function(){
            if (this.click) 
                this.click();
            else {
                var a = __.createEvent("MouseEvents");
                a.initMouseEvent("click", true, true, h, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
                this.dispatchEvent(a)
            }
        };
        this.zgetStyle = function(a){
            var c = this.currentStyle || h.getComputedStyle(this, null);
            return a ? c[a] : c
        };
        this.zgetPara = function(){
            var a, c = (a = this.getAttribute(arguments[0]) || "").split(a.indexOf("") > -1 ? "" : "|");
            for (var d = 0; d < Math.max(arguments.length - 1, c.length); d++) 
                c[d] = c[d] || arguments[d + 1] || "";
            return c
        };
        this.zr = this.zregEvent = function(d, f, g){
            var i = this;
            if (d.constructor != Array) 
                d = [d];
            if (f.constructor != Array) 
                f = [f];
            d.foreach(function(c){
                f.foreach(function(a){
                    if (i.__ && c.match(/^(on)?domready$/i)) {
                        if (zz.status.domReady) 
                            a();
                        else 
                            zz.status.domReadyFunc.push(a);
                        return
                    }
                    if (i.attachEvent) 
                        i.attachEvent(c.replace(/^(on)?/i, "on"), a);
                    else 
                        i.addEventListener(c.replace(/^(on)?/i, ""), a, false);
                    if (zz.browser.IE6) 
                        zz.status.regEvent.push([i, c, a]);
                    if (g) {
                        if (!zz.status.regEventHash[g]) 
                            zz.status.regEventHash[g] = [];
                        zz.status.regEventHash[g].push([i, c, a])
                    }
                })
            })
        };
        this.zur = this.zunregEvent = function(d, f){
            var g = this;
            if (d.constructor != Array) 
                d = [d];
            if (f.constructor != Array) 
                f = [f];
            d.foreach(function(c){
                f.foreach(function(a){
                    if (g.detachEvent) 
                        g.detachEvent(c.replace(/^(on)?/i, "on"), a);
                    else 
                        g.removeEventListener(c.replace(/^(on)?/i, ""), a, false)
                })
            })
        };
        
        this.zurh = this.zunregEventHash = function(a){
            var c = zz.status.regEventHash[a];
            if (!c) 
                return;
            for (var d = c.length - 1; d >= 0; d--) {
                if (this.__ || this == c[d][0]) {
                    c[d][0].zur(c[d][1], c[d][2]);
                    c.splice(d, 1)
                }
            }
            zz.status.regEventHash[a] = c.length ? c : null
        };
        this.zgetWin = function(){
            var a = this.ownerDocument;
            return a.parentWindow || a.defaultView
        };
        this.zg = this.zselNode = function(y){
            function z(l, m){
                var n = [], k = l.match(/^([\.\#]*)([a-zA-Z0-9\-_*]+)(.*)$/i);
                if (!k) 
                    return [];
                if (k[1] == "#") {
                    var o = z(k[2]);
                    if (o) 
                        n.push(o)
                }
                else 
                    if (k[1] == ".") 
                        m.foreach(function(r){
                            zforeach(r.z("*"), function(a){
                                if (a.className.match(new RegExp("\\b" + k[2] + "\\b"))) 
                                    n.push(Pgs.Object.apply(a))
                            })
                        });
                    else 
                        for (var t = 0; t < m.length; t++) {
                            var o = m[t].z(k[2]);
                            if (o) 
                                for (var u = 0; u < o.length; u++) 
                                    n.push(o[u])
                        }
                k[3].replace(/\[([^!=]+)(=|!=)([^\]]*)\]/gi, function(d, f, g, i){
                    var j = n.slice(0);
                    n = [];
                    j.foreach(function(a){
                        f = {
                            _3: "className",
                            _0: "htmlFor"
                        }["_" + f] || f;
                        var c = a[f] || a.getAttribute(f);
                        if (g != "=" ^ c == i) 
                            n.push(Pgs.Object.apply(a))
                    })
                });
                return n
            }
            var v = [this == h ? h.__.body : this];
            y.replace(/(#|\*)/gi, " $1").replace(/([^\^ ])\.(\w+)/gi, "$1[className=$2]").trim().split(/\s+/g).foreach(function(a){
                v = z(a, v)
            });
            return v.length == 0 ? null : v
        };
        this.zgetPos = function(){
            var a = this, c, d = [0, 0], f, g, i = {
                "thin": 2,
                "medium": 4,
                "thick": 6
            }, j;
            function l(){
                j = [a.zgetStyle("borderLeftStyle").match(/none|hidden/) ? 0 : a.zgetStyle("borderLeftWidth"), a.zgetStyle("borderTopStyle").match(/none|hidden/) ? 0 : a.zgetStyle("borderTopWidth")];
                d[0] += i[j[0]] || parseInt(j[0]) || 0;
                d[1] += i[j[1]] || parseInt(j[1]) || 0
            }
            do {
                c = Pgs.Object.apply(a).zgetWin();
                if (a.tagName.match(/^(iframe|frameset)$/i)) 
                    l();
                g = -1;
                do {
                    d[0] += a.offsetLeft - a.scrollLeft;
                    d[1] += a.offsetTop - (zz.browser.Safari && a == c.document.body ? 0 : a.scrollTop);
                    switch (a.zgetStyle("position")) {
                        case "absolute":
                            l();
                            break;
                        case "fixed":
                            g = 1;
                            break
                    }
                }
                while (a.offsetParent && a != a.offsetParent && (a = Pgs.Object.apply(a.offsetParent)) && a != h.___);
                if (zz.browser.Safari) {
                    d[0] += c.__.body.leftMargin || 0;
                    d[1] += c.__.body.topMargin || 0
                }
                if (g == 1 || c != ztopWin) {
                    d[0] += c.___.scrollLeft * g;
                    d[1] += c.___.scrollTop * g
                }
            }
            while (a = c.frameElement);
            return d
        };
        this.zsetPos = function(l, m, n){
            function k(g, i){
                function j(a, c, d, f){
                    return d + {
                        "l": 0,
                        "c": c.offsetWidth / 2,
                        "r": c.offsetWidth,
                        "t": 0,
                        "m": c.offsetHeight / 2,
                        "b": c.offsetHeight
                    }[a || "l"] * f
                }
                return j(m.match(g), this, j(n.match(g), l, o[i], 1), -1) + "px"
            }
            var o = l.zgetPos();
            m = m || "lt";
            n = n || "lb";
           	try{
				var cw = document.body.clientWidth;
				if(parseInt(o[0])+230 > cw){
					var posx = parseInt(o[0])-(230-l.offsetWidth);
					this.style.left = posx + "px";
				}
				else{
					this.style.left = k.call(this, /[lcr]/i, 0);
				}	
			}
			catch(ex){
				this.style.left = k.call(this, /[lcr]/i, 0);            	
			}					
            this.style.top = k.call(this, /[tmb]/i, 1);
        };
        this.zsetIframe = function(c){
            if (c !== true && !zz.browser.IE6) 
                return;
            if (this.module.iframe) 
                f = this.module.iframe;
            else {
                function d(){
                    for (var a = 0; a < ztopWin.zz.module.iframe.length; a++) {
                        if (ztopWin.zz.module.iframe[a].zgetStyle("display") == "none") 
                            return ztopWin.zz.module.iframe[a]
                    }
                }
                var f = d();
                if (!f) {
                    f = ztopWin.zc("iframe");
                    with (f.style) {
                        width = height = "0px";
                        background = "#FFF";
                        position = "absolute";
                        display = "none";
                        zIndex = 100
                    }
                    f.frameBorder = 0;
                    f.id = f.name = zgetUid();
                    ztopWin.zz.status.container.appendChild(f);
                    ztopWin.zz.module.iframe.push(f);
                    with (ztopWin.frames[f.id].document) {
                        open();
                        write('<style>html,body{overflow:hidden}</style>');
                        close()
                    }
                }
                this.module.iframe = f
            }
            f.zsetPos(this, "tl", "tl");
            with (f.style) {
                width = this.offsetWidth + "px";
                height = this.offsetHeight + "px";
                display = ""
            }
            return f
        };
        this.zclearIframe = function(){
            var a = this.module.iframe;
            if (a) {
                a.style.display = "none";
                this.module.iframe = null
            }
            return a
        };
        function q(a, c, d){
            if (!a) 
                return null;
            c = c || "n";
            var f = new RegExp(({
                1: "n",
                3: "t",
                8: "c"
            }[a.nodeType]) || "o", "i");
            return c.match(f) ? a : d.call(a, c)
        }
        this.znAbs = function(a){
            var c = this, d = c.firstChild || c.nextSibling;
            if (!d) 
                do {
                    c = c.parentNode;
                    if (c == h.__.body) 
                        return null;
                    d = c.nextSibling
                }
                while (!d);
            return Pgs.Object.apply(q(d, a, arguments.callee))
        };
        this.zpAbs = function(a){
            if (this == h.__.body) 
                return null;
            var c = this.previousSibling;
            if (c) {
                while (c.lastChild) 
                    c = c.lastChild
            }
            else 
                c = this.parentNode;
            return Pgs.Object.apply(q(c, a, arguments.callee))
        };
        this.zfocusNext = function(){
            if (!this.form) 
                return;
            try {
                this.blur()
            } 
            catch (e) {
            };
            var a = this.form.elements, c;
            for (var d = 0; d < a.length; d++) {
                if (c) {
                    Pgs.Object.apply(a[d]);
                    if (!a[d].disabled && a[d].zisDisplay()) 
                        try {
                            a[d].focus();
                            return
                        } 
                        catch (e) {
                        }
                }
                if (a[d] == this) 
                    c = true
            }
        };
        this.zsetDisplay = function(){
            var a = this.zgetPos();
            with (ztopWin.___) {
                scrollLeft = a[0] - 80;
                scrollTop = a[1] - 80
            }
        };
        this.zisDisplay = function(){
            var a = this;
            do {
                if (a.tagName == "INPUT" && a.type == "hidden" || a.zgetStyle("display") == "none" || a.zgetStyle("visibility") == "hidden") 
                    return false
            }
            while ((a = a.zparentNode()) && a.nodeType == 1);
            return true
        };
        return this
    };
    this.Array = function(){
        this.foreach = function(a){
            for (var c = 0; c < this.length; c++) 
                if ((a ? a(this[c], c) : this[c]()) === false) 
                    return false;
            return true
        };
        if (zz.browser.IE) 
            this.map = function(func){
                var d = [];
                for (var f = 0; f < this.length; f++) 
                    d.push(func(this[f]));
                return d
            }
    };
    this.Number = function(){
        this.parseCur = function(a){
            var c = this.toFixed(a || 2), d = /(\d)(\d{3}[,\.])/;
            while (d.test(c)) 
                c = c.replace(d, "$1,$2");
            c = c.replace(/^(-?)\./, "$10.");
            return a === 0 ? c.replace(/\..*z/, "") : c
        }
    };
    this.String = function(){
        this.replaceWith = function(d){
            return this.replace(/\{\$(\w+)\}/g, function(a, c){
                if (c in d) 
                    return d[c];
                else 
                    return a
            })
        };
        this.trim = function(){
            return this.replace(/^\s+|\s+$/g, '')
        };
        
        this.isEmail = function(){
            var a = /^[^@\s]+@[^@\.\s]+(\.[^@\.\s]+)+$/;
            return a.test(this)
        };
        this.isDateTime = function(){
            var a = zz.status.version.match(/^zh-/) ? this : this.replace(/^(\d{1,2})-(\d{1,2})-(\d{4})$/, "$3-$1-$2");
            var c = a.match(/^((19|20)\d{2})-(\d{1,2})-(\d{1,2})$/);
            if (!c) 
                return false;
            for (var d = 1; d < 5; d++) 
                c[d] = parseInt(c[d], 10);
            if (c[3] < 1 || c[3] > 12 || c[4] < 1 || c[4] > 31) 
                return false;
            var f = new Date(c[1], c[3] - 1, c[4]);
            return f.getDate() == c[4] ? f : null
        };
        this.toReString = function(){
            return this.replace(/\.\\\/\+\*\?\[\]\{\}\(\)\^\$\|/)
        };
        this.isChinaIDCard = function(){
            var a = this.toLowerCase().match(/./g);
            if (this.match(/^\d{17}[\dx]$/i)) {
                var c = 0, d = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
                for (var f = 0; f < 17; f++) 
                    c += parseInt(a[f], 10) * d[f];
                if ("10x98765432".charAt(c % 11) != a[17]) 
                    return false;
                return !!this.replace(/^\d{6}(\d{4})(\d{2})(\d{2}).+$/, "$1-$2-$3").isDateTime()
            }
            if (this.match(/^\d{15}$/)) 
                return !!this.replace(/^\d{6}(\d{2})(\d{2})(\d{2}).+$/, "19$1-$2-$3").isDateTime();
            return false
        };
        this.parseStdDate = function(){
            var c = "January|1@February|2@March|3@April|4@May|5@June|6@July|7@August|8@September|9@October|10@November|11@December|12", d = this.replace(/[ \-,\.\/]+/g, "-").replace(/(^|-)0+(?=\d+)/g, "$1").replace(/[a-z]{3,}/i, function(a){
                return (_1 = c.match(new RegExp("(^|@)" + a + "[^\\|]*\\|(\\d+)", "i"))) ? _1[2] : a
            }).replace(/^([^-]{1,2}-[^-]{1,2})-([^-]{4})$/, "$2-$1");
            return d.isDateTime() ? d : null
        };
        this.parseEngDate = function(){
            var a = this.parseStdDate();
            if (!a) 
                return null;
            var c = a.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);
            return "Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec".split("|")[parseInt(c[2]) - 1] + "-" + c[3] + "-" + c[1]
        }
    };
    this.Date = function(){
        this.dateValue = function(){
            return new Date(this.getFullYear(), this.getMonth(), this.getDate())
        };
        this.addDate = function(a){
            return new Date(this.getFullYear(), this.getMonth(), this.getDate() + a)
        };
        this.toStdString = function(){
            return this.getFullYear() + "-" + (this.getMonth() + 1) + "-" + this.getDate()
        };
        this.toEngString = function(){
            return "Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec".split("|")[this.getMonth()] + "-" + this.getDate() + "-" + this.getFullYear()
        }
    };
    
    this.module = new function(){
        this.linklist = function(a){
            var c = a.getAttribute('mod_linklist_class');
            if (c === null) 
                c = 'pubSidebar_linkmargin01';
            var d = '<a class="' + c + '" href="{$link}" title="{$text}" target="{$target}">{$text}</a>';
            var f = a.getAttribute('mod_linklist_id');
            if (!f || !(f = window.c_linklist[f]) || f.constructor !== Array) 
                return;
            for (var g = 0; g < f.length; g++) {
                var i = f[g].split('|', 2);
                f[g] = d.replaceWith({
                    text: zs2t(i[0]),
                    link: i[1],
                    target: f[g].target || '_2'
                })
            }
            a.innerHTML = f.join('')
        };
        this.allyes = function(f){
            var g = k("user") || k("mod_allyes_user");
            if (!g) {
                var i = k('mod_allyes_buttons', window);
                var j = k('mod_allyes_text', window.c_allyes_text);
                if (!i && !j) 
                    return
            }
            var l = '<div class="pubGlobal_ad140x60" style="height:{$height}px">{$iframe}<\/div>';
            var m = '<div class="pubGlobal_adtxt140">{$text}<\/div>';
            var n = '<iframe marginheight="0" width="100%" height="100%" marginwidth="0" frameborder="0" scrolling="no" src=""><\/iframe>';
            setTimeout(function(){
                if (g) {
                    if (g.indexOf('@') > -1) 
                        g = o(g.split('@'));
                    f.innerHTML = n.replace('{$user}', g)
                }
                else {
                    var a = [];
                    if (i) 
                        a = i.map(function(b){
                            b.button = b.button || ';';
                            return l.replace('{$height}', b.height).replace('{$iframe}', n.replace('{$user}', b.user))
                        });
                    if (j) 
                        a.push(m.replace('{$text}', zs2t(j)));
                    f.innerHTML = a.join('')
                }
            }, window.c_allyes_delay);
            function k(a, c){
                var d = f.getAttribute(a);
                if (!d) 
                    return null;
                if (c) 
                    return c[d] || null;
                else 
                    return d
            }
            function o(a){
                var c = /^(SearchFlights\.aspx|SearchHotels\.aspx|query\.asp)$/i;
                var d = location.pathname;
                d = d.slice(d.lastIndexOf('/') + 1);
                return c.test(d) ? a[0] : a[1]
            }
        };
        
        this.notice = function(a){
            a.module.notice = new function(){
                this.enabled = true;
                this.tip = a.getAttribute("mod_notice_tip") || "";
                this.check = function(){
                    if (a.module.notice.enabled) {
                        with (a) {
                            if (isNull()) {
                                style.color = "gray";
                                value = module.notice.tip;
                                var b = h.z(getAttribute("mod_address_reference"));
								if(b){
									b.value = "";
								}
                            }
                            else 
                                style.color = ""
                        }
                    }
                };
                this.isNull = a.isNull = function(){
                    return a.value.trim() == "" || a.value == a.module.notice.tip
                }
            };
            a.zr("focus", function(){
                if (a.module.notice.enabled) {
                    a.style.color = "";
                    if (a.value == a.module.notice.tip) 
                        a.value = ""
                }
            });
            a.zr("blur", function(){
                setTimeout(a.module.notice.check, 1)
            });
            a.module.notice.check()
        };
        
        this.tab = function(g){
            var i = h.zg(g.getAttribute("mod_tab_button") || "");
            var j = h.zg(g.getAttribute("mod_tab_panel") || "");
            var l = parseInt(g.getAttribute("mod_tab_select") || 1, 10);
            var m = ((g.getAttribute("mod_tab_event") || "").match(/^mouseover$/i) || "click").toString();
            var n = {
                "true": "_" + "current",
                "false": "_" + "nocurrent"
            };
            if (!i || !j) 
                return;
            g.module.tab = new function(){
                this.funcListHash = {};
                this.select = function(a){
                    if (this.funcListHash[a - 1]) 
                        this.funcListHash[a - 1]()
                }
            };
            i.foreach(function(d, f){
                g.module.tab.funcListHash[f] = function(){
                    i.foreach(function(a, c){
                        a.className = a.className.replace(n[f != c], n[f == c]);
                        if (j[c]) 
                            j[c].style.display = (f == c) ? "" : "none"
                    })
                };
                d.zr(m, g.module.tab.funcListHash[f])
            });
            g.module.tab.select(l)
        };
        this.display = function(j){
            var l = j.zgetPara("mod_display_panel"), m = [];
            l.foreach(function(a){
                a = h.z(a) || h.zselNode(a);
                if (a) {
                    if (a.length) 
                        a.foreach(function(a){
                            m.push(a)
                        });
                    else 
                        m.push(a)
                }
            });
            j.zr("click", function(){
                (function(f){
                    for (var g = 0; g < f.childNodes.length; g++) {
                        with (f.childNodes[g]) {
                            if (nodeType == 3) {
                                var i = new RegExp(zz.string.display.match(/[^@]+/g).join("|"), "gi");
                                nodeValue = nodeValue.replace(i, function(a){
                                    var c = new RegExp("@" + a + "\\|([^@]+)|([^@]+)\\|" + a + "@", "i");
                                    var d = zz.string.display.match(c);
                                    return d[1] || d[2]
                                })
                            }
                            else 
                                arguments.callee(f.childNodes[g])
                        }
                    }
                })(j);
                m.foreach(function(a){
                    a.style.display = a.zgetStyle("display") == "none" ? "" : "none"
                })
            })
        };
        this.selectAll = function(d){
            var f = zselNode(d.getAttribute("mod_selectAll_input") || "");
            if (!f) 
                return;
            f.foreach(function(c){
                if (c != d) 
                    c.zr("onclick", function(){
                        d.checked = f.foreach(function(a){
                            if (a != d && !a.checked) 
                                return false
                        })
                    })
            });
            d.zr("click", function(){
                f.foreach(function(a){
                    a.checked = d.checked
                })
            })
        };
        this.validate = function(a){
            var c = h.z(a.getAttribute("mod_validate_true") || "");
            var d = h.z(a.getAttribute("mod_validate_false") || "");
            var f = a.getAttribute("mod_validate_function") || "";
            if (!f) 
                return;
            var g = f.match(/^\/(.*?[^\\])\/([gmi]*?)$/);
            var i, j, l;
            f = h[f];
            if (g || f) {
                a.module.validate = new function(){
                    this.check = function(){
                        if (a.value || !c && !d) 
                            l = !(j = f ? f(a.value, a) : a.value.match(new RegExp(g[1], g[2])));
                        else 
                            j = l = false;
                        if (c) 
                            c.style.display = j ? "" : "none";
                        if (d) 
                            d.style.display = l ? "" : "none"
                    }
                };
                a.zr("focus", function(){
                    i = setInterval(a.module.validate.check, 200)
                });
                a.zr("blur", function(){
                    a.module.validate.check();
                    clearInterval(i)
                })
            }
        }
    };
    this.debug = new function(){
    };
    this.Date.apply(h.Date.prototype);
    this.Variable.apply(h);
    this.Number.apply(h.Number.prototype);
    this.String.apply(h.String.prototype);
    this.Array.apply(h.Array.prototype);
    this.window.apply(h);
    this.Object.apply(h);
    this.Object.apply(h.__);
    this.Object.apply(h.___);
    this.Object.apply(zz.status.alertDiv);
    
    this.init = new function(){
        var dm = __.domain;
        if (zz.browser.IE6) 
            try {
                __.execCommand("BackgroundImageCache", false, true)
            } 
            catch (e) {
            };
        zz.status.debug = /^(true|1)$/.test(zgetQuery("debug"));
        function d(a){
            var c;
            zz.status.domReady = true;
            while (c = zz.status.domReadyFunc.shift()) 
                try {
                    c(a)
                } 
                catch (a) {
                    zt("domReady函数错误:" + c.toString().slice(0, 50) + "...", "red")
                }
        }
        if (zz.browser.Moz || zz.browser.Opera) 
            h.zr("DOMContentLoaded", d);
        else 
            if (zz.browser.IE) {
                h.__.write("<script id=\"ieDomReady\" src=\":\/\/\" defer=\"true\"><\/script>");
                h.__.getElementById("ieDomReady").onreadystatechange = function(){
                    if (this.readyState == "complete") 
                        d()
                }
            }
            else 
                if (zz.browser.Safari) {
                    var f = setInterval(function(){
                        if (h.__.readyState == "loaded" || h.__.readyState == "complete") {
                            clearInterval(f);
                            d()
                        }
                    }, 10)
                }
        if (zz.browser.IE6) 
            h.zr("unload", function(){
                var g;
                while (g = zz.status.regEvent.shift()) {
                    if (g[0]) 
                        g[0].zur(g[1], g[2])
                }
            });
        h.zr("domready", [function(){
            Pgs.Object.apply(h.__.body)
        }, h.zparserRe, h.zfixElement])
    }
};

var Pgs = new zPgs(window);
