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 {
				if (zz.browser.Moz||zz.browser.Opera) {
					c = Pgs.Object.apply(a).zgetWin();
				}
				else {
					c = Pgs.Object.apply(a).ownerDocument.parentWindow;	//defaultView parentWindow	解决IE刷新后的zgetWin报错
				}
				//document.getElementById('test').innerHTML += a.tagName + '<br />';

				if(c){
					//document.getElementById('test2').innerHTML += a.id + '|' + a.offsetLeft + '|' + objOffsetLeft + 'd<br />';
					if (typeof(a.id) != 'undefined') {
						if (a.tagName.match(/^(iframe|frameset)$/i))
							l();
						if (g == 1 || c != ztopWin && typeof(a.id) != 'undefined') {
							//d[0] += c.___.scrollLeft * g;
							//d[1] += c.___.scrollTop * g;
							d[0] -= a.offsetLeft;
							d[1] -= (zz.browser.Safari && a == c.document.body ? 0 : a.scrollTop);
							//document.getElementById('test2').innerHTML += a.tagName + '|' + a.offsetLeft + 'd<br />';
						}
						g = -1;
						//document.getElementById('test').innerHTML += a.tagName + '|' + a.offsetLeft + 'd<br />';
						var objOffsetLeft = a.offsetLeft;
						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.___);
						//while ((a=Pgs.Object.apply(a.offsetParent))&&!a.__&&a!=c.___);

						if (zz.browser.Safari) {
							d[0] += c.__.body.leftMargin || 0;
							d[1] += c.__.body.topMargin || 0
						}
						//document.getElementById('test2').innerHTML += a.tagName + '|' + a.offsetLeft + '|' + objOffsetLeft + 'd<br />';

					}
				}
			}
			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);

zz.module.address.source.city = typeof(citySource) != 'undefined' ? citySource : '';
zz.module.address.source.interstartcity = typeof(fltInternationalStart) != 'undefined' ? fltInternationalStart : '';
zz.module.address.source.intercity = typeof(fltInternational) != 'undefined' ? fltInternational : '';
zz.module.address.source.interairlines = typeof(interairlines) != 'undefined' ? interairlines : '';
zz.module.address.source.hotelcity = typeof(cityHotel) != 'undefined' ? cityHotel : '';

zz.string.address = {
	"zh-cn": {
		b: "输入中文/拼音/机场代码或↑↓选择.",
		i: "输入",
		j: "或↑↓选择.",
		k: "中文/拼音",
		e: "请输入至少两个字母或一个汉字.",
		h: "",
		o: "按拼音排序",
		s: "对不起, 找不到: ",
		l: "结果共",
		p: "项,←→翻页",
		a: ",共"
	},
	"zh-tw": {
		b: "輸入中文/拼音或↑↓選擇.",
		i: "輸入",
		j: "或↑↓選擇.",
		k: "中文/拼音",
		e: "請輸入至少兩個字母或一個漢字.",
		h: "",
		o: "按拼音排序",
		s: "對不起, 找不到: ",
		l: "結果共",
		p: "項,←→翻頁",
		a: ",共"
	},
	"en": {
		b: "Type or scroll to select.",
		i: "Input ",
		j: " or use up or down to select.",
		k: "English",
		e: "Please Input at least two character.",
		h: "",
		o: "sort by spelling",
		s: "No match",
		l: "Results ",
		p: ",left or right to turn page",
		a: ",All"
	}
}[zz.status.version];

zz.module.address.sourceMap = {
	"city": ["/admin/js/suggest/suggest_lang.js", "gb2312"]
};

//zloadCss("/admin/js/suggest/suggest.css");

function sortFunc(c, b){
	var e = c.match(/^[^\|]+/), f = b.match(/^[^\|]+/);
	return e > f ? 1 : (e == f ? 0 : -1)
}
(function c_address(){
	var i = zc("div");
	i.id = "cool_address";
	with (i.style) {
		display = "none";
		position = "absolute";
		zIndex = "120";
		overflow = "hidden"
	}
	i.innerHTML = "<div id=\"address_warp\"><div id=\"address_message\">&nbsp;<\/div><div id=\"address_list\"><a class=\"a1\" href=\"javascript:void(0);\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"javascript:void(0);\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"javascript:void(0);\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"javascript:void(0);\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"javascript:void(0);\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"javascript:void(0);\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"javascript:void(0);\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"javascript:void(0);\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"javascript:void(0);\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"javascript:void(0);\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"javascript:void(0);\"><span>&nbsp;<\/span>&nbsp;<\/a><a class=\"a1\" href=\"javascript:void(0);\"><span>&nbsp;<\/span>&nbsp;<\/a><\/div><div class=\"address_pagebreak\" id=\"address_p\"><a id=\"address_arrowl\" href=\"javascript:;\" name=\"p\">&lt;-<\/a><a id=\"address_p1\" href=\"javascript:;\" name=\"1\" class=\"address_current\">1<\/a><a id=\"address_p2\" href=\"javascript:;\" name=\"2\">2<\/a><a id=\"address_p3\" href=\"javascript:;\" name=\"3\">3<\/a><a id=\"address_p4\" href=\"javascript:;\" name=\"4\">4<\/a><a id=\"address_p5\" href=\"javascript:;\" name=\"5\">5<\/a><a id=\"address_arrowr\" href=\"javascript:;\" name=\"n\">-&gt;<\/a><\/div><\/div>";

	z("jsContainer").appendChild(i);

	zz.module.address.source["default"] = "@@";

	var K = z("address_warp"), u = z('address_message'), A = z('address_list'), v = [z('address_p'), z('address_p1'), z('address_p2'), z('address_p3'), z('address_p4'), z('address_p5')], B = z('address_arrowl'), C = z('address_arrowr'), h = A.getElementsByTagName("a"), L = [];

	for (var D = 0; D < h.length; D++)
		L[D] = h[D].cloneNode(true);

	function M(){
		function Q(d){
			var n = 0, r, s = d.zgetWin();
			var a = d.module.address = {};
			var R, w, g = null, t, p = [];
			d.setAttribute("autoComplete", "off");
			zr("beforeunload", function(){
				d.setAttribute("autoComplete", "on")
			});
			a.focusNext = d.getAttribute("mod_address_focusNext");
			a.focusNext = /^(1|true)$/i.test(a.focusNext || "");
			a.reference = d.getAttribute("mod_address_reference");
			var m = d.getAttribute("mod_address_cookie");
			if (m) {
				m = s.z(m);
				if (!m) {
					var G = s.zc("input");
					with (G) {
						type = "hidden";
						id = name = m
					}
					m = G;
					d.parentNode.insertBefore(m, d)
				}
			}

			if (a.reference)
				a.reference = s.z(a.reference) || s.z(a.reference, true);

			var x = d.getAttribute("mod_address_suggest");
			if(!x){
				x = "@Guilin|桂林|KWL@Qingdao|青岛|TAO@Dalian|大连|DLC@Jinan|济南|TNA@Changsha|长沙|CSX@Chongqing|重庆|CKG@Fuzhou|福州|FOC@Guangzhou|广州|CAN@Haikou|海口|HAK@Harbin|哈尔滨|HRB@Kunming|昆明|KMG@Lijiang|丽江|LJG@Nanchang|南昌|KHN@Nanjing|南京|NKG@Ningbo|宁波|NGB@Sanya|三亚|SYX@Tianjin|天津|TSN@Wenzhou|温州|WNZ@Wuhan|武汉|WUH@Xiamen|厦门|XMN@Xishuangbanna|西双版纳|JHG@Zhengzhou|郑州|CGO@Zhuhai|珠海|ZUH@";
			}
			var H = d.getAttribute("mod_address_cookieSuggest");
			a.suggest = [];
			if (H) {
				a.suggest = H.match(/[^@]+@/gi);
				if (x)
					a.suggest._0(x.match(/[^@]+@/gi))
			}
			else
				if (x)
					a.suggest = x.match(/[^@]+@/gi);

			if (a.suggest.length > 12)
				a.suggest = a.suggest.slice(0, 999);
			a.source = d.getAttribute("mod_address_source") || "default";
			if (!zz.module.address.source[a.source]) {
				zz.module.address.source[a.source] = "@@";
				//if (zz.module.address.sourceMap[a.source]) {
					//zloadJs(zz.module.address.sourceMap[a.source][0].replace(/\{\$charset\}/gi, zz.status.charset), (zz.module.address.sourceMap[a.source][1] || "").replace(/\{\$charset\}/gi, zz.status.charset) || zz.status.charset);
				//}
				//else {
					//zloadJs("coolcity.js", zz.status.charset);
				//}
			}
			a.auto = d.getAttribute("mod_address_auto");
			a.auto = a.auto && a.auto.match(/^(false|0)$/i) ? false : true;
			a.redraw = function(){
				if (w)
					F()
			};
			a.hook = {};
			(d.getAttribute("mod_address_hook") || "").replace(/(on)?([^;:]+):([^;]+)/gi, function(c, b, e, f){
				a.hook[e.toLowerCase()] = s[f]
			});
			function N(){
				if (n) {
					n = 0;
					return
				}
				r = false;
				A.style.display = u.style.display = v[0].style.display = "none";
				function e(b){
					h[b].onmousedown = function(c){

						z(b);
						zstopEvent(c);
						if(h[b].outerHTML) h[b].outerHTML = h[b].outerHTML + ' ';
						//if (h[b].replaceNode) h[b].replaceNode(L[b].cloneNode(true));
						d.blur()
					}
				}
				i.onmousedown = function(){
					n = 1
				};
				for (var f = 0; f < h.length; f++)
					new e(f);
				B.onmousedown = C.onmousedown = y;
				for (var f = 1; f < v.length; f++)
					v[f].onmousedown = y;
				t = null;
				if (g !== null)
					h[g].className = "address_selected";
				if (a.hook["focus"])
					a.hook["focus"](d);
				setTimeout(F, 0);
				w = setInterval(F, 150)
			}

			function y(c){
				n = 1;
				if (c)
					zstopEvent(c);
				switch (this) {
					case B:
						k.m_get(k.page - 1);
						break;
					case C:
						k.m_get(k.page + 1);
						break;
					default:
						k.m_get(parseInt(this.firstChild.nodeValue))
				}
			}

			var k = new function(){
				var o;
				this.page = 1;
				this.pagelist;
				this.maxpage = 1;
				this.m_get = function(c){
					if (!o || !c || c < 1 || c > this.maxpage)
						return null;
					this.page = c;
					this.pagelist = o.slice((c - 1) * 12, Math.min(c * 12, o.length));
					for (var b = 0; b < h.length; b++) {
						if (b < this.pagelist.length) {
							h[b].style.display = "block";
							var e = this.pagelist[b].replace(/@/g, "").split("|");
							h[b].lastChild.nodeValue = e[1];
							h[b].firstChild.firstChild.nodeValue = e[0];
							p[b] = e
						}
						else {
							h[b].style.display = "none";
							p[b] = null
						}
					}
					if (g !== null) {
						if (g >= this.pagelist.length) {
							h[g].className = "";
							g = this.pagelist.length - 1;
							h[g].className = "address_selected"
						}
					}
					else {
						g = 0;
						h[0].className = "address_selected"
					}
					l.call(this);
					A.style.display = u.style.display = "";
					if (!r) {
						i.style.display = "";
						i.zsetPos(d);
						i.zsetIframe();
						r = true
					}
					E.call(this)
				};

				this.m_set = function(c){
					o = c;
					this.maxpage = Math.ceil(c.length / 12);
					this.page = 1;
					this.m_get(1)
				};

				function l(){
					var c = this.maxpage < 6 || this.page < 3 ? 1 : this.page > this.maxpage - 2 ? this.maxpage - 4 : this.page - 2;
					var b = Math.min(c + 4, this.maxpage);
					var e;
					B.style.display = this.page == 1 ? "none" : "";
					C.style.display = this.page == this.maxpage ? "none" : "";
					for (var f = c; f < c + 5; f++) {
						e = v[f - c + 1];
						if (f <= b) {
							e.firstChild.nodeValue = f;
							e.className = f == this.page ? "address_current" : "";
							e.style.display = ""
						}
						else
							e.style.display = "none"
					}
					v[0].style.display = this.maxpage > 1 ? "block" : "none"
				}
			};

			function E(){
				with (i.style) {
					width = K.offsetWidth + "px";
					height = K.offsetHeight + "px"
				}
				i.zsetIframe()
			}
			function I(){
				if (a.suggest.length == 0) {
					i.style.display = "none";
					if (g !== null) {
						h[g].className = "";
						g = null
					}
					return
				}
				k.m_set(a.suggest);
				u.lastChild.nodeValue = zz.status.version.match(/^zh-/) ? zz.string.address.i + (d.module.notice ? d.module.notice.tip : zz.string.address.k) + zz.string.address.j : zz.string.address.b
			}

			function F(){
				var b = d.value.trim();
				if (b === t)
					return;
				t = b;
				b = b.replace(/([\(\)\\\[\]\.\+\?\*\|\^\$])/gi, "\\z1").replace(/@|\|/gi, "");
				if (!b) {
					I();
					E();
					return
				}
				i.style.display = "";
				var e = zz.module.address.source[a.source];
				var f = new RegExp("@([^@]*\\|)?" + b + "[^@]*", "gi");
				var o = new RegExp("@[^@]*" + b + "[^@]*", "gi");
				var l = [], j = [];
				e = e.replace(f, function(c){
					l.push(c);
					return ""
				});
				if (l)
					l.sort(sortFunc);
				e = e.replace(o, function(c){
					j.push(c);
					return ""
				});
				if (j)
					j.sort(sortFunc);
				if (l && j)
					arr = l.concat(j);
				else
					arr = l || j;
				if (!arr || !arr.length) {
					u.lastChild.nodeValue = a.auto ? (zz.string.address.s + (zz.status.version == "en" ? "" : d.value)) : (zz.string.address.h + d.value + ", " + zz.string.address.o);
					if (!a.auto) {
						i.style.display = "none";
						if (g !== null) {
							h[g].className = "";
							g = null
						}
					}
					if (A.style.display == "none")
						I();
					E()
				}
				else {
					u.lastChild.nodeValue = zz.string.address.h + d.value + ", " + zz.string.address.o;
					k.m_set(arr)
				}
			}

			function O(c){
				var b = c ? c.keyCode : event.charCode;
				var e = "|" + b + "|";
				if (g == null) {
					if ("|13|".indexOf(e) != -1) {
						zstopEvent(c, 1);
						if (a.focusNext)
							setTimeout(function(){
								d.zfocusNext()
							}, 1)
					}
					return true
				}
				if ("|13|".indexOf(e) != -1) {
					zstopEvent(c, 1);
					z(g);
					d.blur()
				}
				if ("|33|37|109|188|219|".indexOf(e) != -1) {
					y.call(B);
					zstopEvent(c, 1)
				}
				if ("|34|39|61|190|221|".indexOf(e) != -1) {
					y.call(C);
					zstopEvent(c, 1)
				}
				if ("|38|40|".indexOf(e) != -1) {
					h[g].className = "";
					g += k.pagelist.length - 39 + b;
					g %= k.pagelist.length;
					h[g].className = "address_selected";
					zstopEvent(c, 1)
				}
			}

			function z(c, b){
				n = 2;
				d.value = p[c][1] || p[c][0];
				if (a.reference)
					a.reference.value = p[c][2];
				if (m)
					m.value = p.join("|");
				if (a.hook["change"])
					a.hook["change"](d);
				if (b !== false && a.focusNext)
					setTimeout(function(){
						d.zfocusNext()
					}, 1)
			}

			function P(){
				if (n == 1) {
					setTimeout(function(){
						d.focus()
					}, 1);
					return
				}
				clearInterval(w);
				w = null;
				i.zclearIframe();
				i.style.display = "none";
				if (g !== null) {
					if (d.value && n != 2 && a.auto)
						z(g, false);
					h[g].className = "";
					g = null
				}
				n = 0;
				i.onmousedown = null
			}

			a.check = function(){
				var b = d.value.trim();
				if (d.isNull && d.isNull())
					b = "";
				if (b === t)
					return;
				var e;
				t = b;
				b = b.replace(/([\(\)\\\[\]\.\+\?\*\|\^\$])/gi, "\\$1").replace(/@|\|/gi, "");
				if (b) {
					var f = zz.module.address.source[a.source];
					var o = new RegExp("@([^@]*\\|)?" + b + "[^@]*", "gi");
					var l = new RegExp("@[^@]*" + b + "[^@]*", "gi");
					var j = [], q = [];
					f = f.replace(o, function(c){
						j.push(c);
						return ""
					});
					if (j)
						j.sort(sortFunc);
					f = f.replace(l, function(c){
						q.push(c);
						return ""
					});
					if (q)
						q.sort(sortFunc);
					if (j && q)
						e = j.concat(q);
					else
						e = j || q;
					if (e && e.length) {
						r = true;
						k.m_set(e);
						r = false;
						z(0, false);
						n = 0
					}
				}
				if (d.module.notice)
					d.module.notice.check();
				return !!e
			};
			d.zr("onfocus", N);
			d.blur();
			d.zr("onblur", P);
			d.zr("onkeydown", O);
			if (a.hook["load"])
				a.hook["load"](d);
		}
			if (zz.module.address.list != null) {
				var J;
				while ((J = zz.module.address.list.shift()) != null)
					new Q(J);
			}
	}
	zinit(M);
	M()
})();

function getCityNameByCode(code)
{
	if(code!=null && code!=""){
		var f = zz.module.address.source["city"];
		var l = new RegExp("@([^@]*)\\|([^@]*)\\|"+code+"@", "g");
		var j="";
		f = f.replace(l, function(c){
						if(c!=""){
							j=c.split("|")[1];
						}
					});
	   	if(j!=""){
			return j;
		}
		else{
			return code;
		}
	}
	else{
		return "";
	}
}