﻿var $jex={ie:0,gecko:0,opera:0,safari:0,isdebug:false,testurl:(window.location.search.indexOf("&testurl")>0),browser:null,mobile:null,air:null,VOIDFUNC:function(){},globalID:(function(){var a=0;return function(){return a++;};})(),_innerClass:{},register:function(b,a){$jex._innerClass[b]=a;},getClass:function(a){return $jex._innerClass[a];},$:function(a){return(typeof a=="string")?document.getElementById(a):a;},_:function(f,d){var g=function(){};g.prototype=d.prototype;f.prototype=new g();},compare:function(b,h,g){var d=h||{};var c=g||{};for(var a=0;a<b.length;a++){var f=b[a];if(d[f]!=c[f]){return false;}}return true;},$defined:function(a){return typeof a!="undefined"&&a!=null;},$empty:function(b){for(var a in b){if(typeof b[a]=="function"){continue;}return false;}return true;},parseQueryParam:function(){var d={};var b=window.location.search.replace("?","").split("&");for(var a=0;a<b.length;a++){var c=b[a].split("=");d[c[0]]=decodeURIComponent(c[1]);}return d;},extendClass:function(){var a=Object.prototype.constructor;return function(b,g){var c=g.prototype;var f=b.prototype;var d=function(){};d.prototype=c;f=b.prototype=new d();b.superclass=c;f.constructor=b;if(c.constructor==a){c.constructor=g;}b.prototype.toString=g.prototype.toString;return b;};}(),body:function(a){if(!a){a=document;}return a.body?a.body:a.getElementsByTagName("body")[0];},doc:function(a){return a?a.nodeType==9?a:a.ownerDocument||document:document;},merge:function(b,d){for(var a in d){if(d[a]){b[a]=d[a];}}return b;},exec:function(a){return a();},toInt:function(b,c){var a;return isNaN(a=parseInt(b))?c:a;},toFloat:function(b,c){var a;return isNaN(a=parseFloat(b))?c:a;},toBoolean:function(a){if(!a){return false;}return(a==true||(a=a.toUpperCase())=="TRUE"||a=="1");},toQueryString:function(b){var a=[];$jex.foreach(b,function(d,f,c){if(f>0){a.push("&");}a.push(encodeURIComponent(c),"=",encodeURIComponent(d));});return a.join("");},text:function(a){return a.innerText||a.textContent;},trim:function(b,a){switch(a){case"l":return b.replace(/(^\s*)/g,"");case"r":return b.replace(/(\s*$)/g,"");default:return b.replace(/(^\s*)|(\s*$)/g,"");}},stripTag:function(a){return a.replace(/<\/?[^>]+>/gi,"");},starsWith:function(b,a,c){if(!c){c=0;}if(!b||b.length<c+a.length){return false;}return b.substring(c,a.length)==a;},exists:function(d,a){var c=a.split("."),b;for(b=0;b<c.length;b++){if(!d[c[b]]){return false;}d=d[c[b]];}return true;},isNull:function(a){return(typeof a=="object")&&!a;},isNumber:function(a){return typeof a=="number"&&isFinite(a)?true:false;},isArray:function(a){return !!a&&a.constructor==Array;},removeElement:function(a){if(a&&a.parentNode){a.parentNode.removeChild(a);}},isChildrenOf:function(b,a,c){if(c&&b){b=b.parentNode;}while(b){if(b==a){return true;}b=b.parentNode;}return false;},hasClassName:function(b,a){if(!b){return;}return this.array.indexOf(b.className.split(/\s+/),a)!=-1;},addClassName:function(b,a){if(!b){return;}if(this.hasClassName(b,a)){return;}b.className=b.className+" "+a;},removeClassName:function(a,b){if(!a){return;}if(typeof b=="string"){b=[b];}a.className=this.array.select(a.className.split(/\s+/),function(c){return($jex.array.indexOf(b,c)==-1);}).join(" ");},toggleClassName:function(b,a,d,c){if($jex.hasClassName(b,a)){$jex.removeClassName(b,a);if(c){c();}}else{$jex.addClassName(b,a);if(d){d();}}},createCssText:function(f,d){if(!f){return;}if(!d){d=document;}var c=d.createElement("style");c.setAttribute("type","text/css");var a=d.getElementsByTagName("head")[0];if(!a){return;}else{a.appendChild(c);}if(c.styleSheet){c.styleSheet.cssText=f;}else{var b=d.createTextNode(f);c.appendChild(b);}return c;},createCssLink:function(a,d){if(!a){return;}if(!d){d=document;}if(document.createStyleSheet){document.createStyleSheet(a);}else{var c=d.createElement("link");c.setAttribute("rel","stylesheet");c.setAttribute("type","text/css");c.setAttribute("href",a);var b=d.getElementsByTagName("head")[0];if(!b){return;}else{b.appendChild(c);}}},stopEvent:function(a){if(window.event){event.returnValue=false;event.cancelBubble=true;}else{a.preventDefault();a.stopPropagation();}},callback:function(b,a){return function(){return a.apply(b,arguments);};},getDocumentWindow:function(a){return a.parentWindow||window;},array:{toArray:function(c){if(!c){return[];}var b=[],a;for(a=0;a<c.length;a++){b.push(c[a]);}return b;},indexOf:function(a,b){for(var c=0,d=a.length;c<d;c++){if(a[c]==b){return c;}}return -1;},each:function(a,c){if(!a){return;}for(var b=0,d=a.length;b<d;b++){c(a[b],b);}},select:function(a,d){if(!a){return[];}var b=[],c,f;for(c=0,f=a.length;c<f;c++){if(d(a[c])){b.push(a[c]);}}return b;},copy:function(d,c,g,b){var f=g||0,a=b||d.length;for(;f<a;++f){c.push(d[f]);}},remove:function(a,d,g){var b=0,c,f;for(c=0,f=a.length;c<f;c++){if(a[c]===d||g&&a[c]==d){a.splice(c--,1);b++;}}return b;}},hash:{each:function(c,b){for(var a in c){b(a,c[a]);}}},each:function(b,a){if(b instanceof Array){this.array.each(b,a);}else{this.hash.each(b,a);}},$continue:new Object(),$break:new Object(),foreach:function(b,g){var a=null;if(b instanceof Array){for(var d=0;d<b.length;d++){var f=b[d];a=g(f,d);if(a==$jex.$continue){continue;}if(a==$jex.$break){break;}}}else{var d=0;for(var c in b){var f=b[c];a=g(f,d,c);if(a==$jex.$continue){continue;}if(a==$jex.$break){break;}d++;}}return a;},event:{doclick:function(c){var b=document.getElementById(c);if(document.createEvent){var a=document.createEvent("MouseEvents");a.initEvent("click",true,false);b.dispatchEvent(a);}else{if(document.createEventObject){b.fireEvent("onclick");}}},add:function(c,a,b){},remove:function(a){},bind:function(f,b,d){var c=(f==window&&b=="unload");if(f.addEventListener){var a=false;if(b=="focusin"){b="focus";a=true;}else{if(b=="focusout"){b="blur";a=true;}}f.addEventListener(b,d,a);d=this.add(f,b,d,a?4:1,c);}else{if(f.attachEvent){d=$jex.callback(f,d);f.attachEvent("on"+b,d);d=this.add(f,b,d,2,c);}else{f["on"+b]=d;d=this.add(f,b,d,3,c);}}return d;},bindDom:function(c,a,d,b){return this.bind(c,a,function(f){if(!f.target){f.target=f.srcElement;}b.call(d,f,this);});},stop:function(b,a){this.bind(b,a,function(c){$jex.stopEvent(c);return false;});},trigger:function(c,b,a){}},element:{hide:function(a){if(!a){return;}if(typeof a=="string"){a=$jex.$(a);}a.style.display="none";return a;},show:function(a){if(!a){return;}if(typeof a=="string"){a=$jex.$(a);}a.style.display="block";return a;},visible:function(a){if(!a){return false;}return a.style.display!="none";},toggle:function(c){for(var c=arguments[0],b=0,a=arguments.length;b<a;b++,c=arguments[b]){c=$jex.$(c);if(!c){continue;}if($jex.element.visible(c)){$jex.element.hide(c);}else{$jex.element.show(c);}}}}};$jex.createXMLHttpRequest=$jex.exec(function(){var b=0,a=[function(){return new XMLHttpRequest();},function(){return new ActiveXObject("Msxml2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");}];return function(){for(var c=b;c<a.length;c++){try{b=c;return a[c]();}catch(d){}}return $jex.VOIDFUNC;};});$jex.exec(function(){var b=navigator.userAgent,a;if((/WebKit|KHTML/).test(b)){$jex.browser="safari";$jex.safari=1;}a=b.match(/AppleWebKit\/([^\s]*)/);if(a&&a[1]){$jex.safari=$jex.toFloat(a[1]);if(/ Mobile\//.test(b)){$jex.mobile="Apple";}else{a=b.match(/NokiaN[^\/]*/);if(a){$jex.mobile=a[0];}}a=b.match(/AdobeAIR\/([^\s]*)/);if(a){$jex.air=a[0];}}else{a=b.match(/Opera[\s\/]([^\s]*)/);if(a&&a[1]){$jex.opera=$jex.toFloat(a[1]);$jex.browser="opera";a=b.match(/Opera Mini[^;]*/);if(a){$jex.mobile=a[0];}}else{a=b.match(/MSIE\s([^;]*)/);if(a&&a[1]){$jex.browser="ie";$jex.ie=$jex.toFloat(a[1]);}else{a=b.match(/Gecko\/([^\s]*)/);if(a){$jex.browser="gecko";$jex.gecko=1;a=b.match(/rv:([^\s\)]*)/);if(a&&a[1]){$jex.gecko=$jex.toFloat(a[1]);}}}}}return false;});$jex.exec(function(){$jex.namespace=function(c){var d=c.split(".");var b=$jex;for(var a=0;a<d.length;a++){var f=d[a];if(f=="$jex"){continue;}if(!b[f]){b[f]={};}b=b[f];}};$jex.addFormParam=function(c,a,d){if(!c){return;}var b="__"+a+"__";if(c[b]){c[b].value=d;}else{var f=document.createElement("INPUT");f.name=a;f.type="hidden";f.value=d;c.appendChild(f);c[b]=f;}};});$jex.exec(function(){var a=-1;$jex.boxModel=function(){if(a!==-1){return a;}var b=document.createElement("div");b.style.width=b.style.paddingLeft="1px";document.body.appendChild(b);a=b.offsetWidth===2;document.body.removeChild(b).style.display="none";return a;};if(window.location.search.indexOf("debug=true")>=0){$jex.isdebug=true;}});$jex.exec(function(){var g=false,c,d,b,f;function a(){if(g){return;}var o=document.body,i=document.createElement("div"),k,j,q,l,p,h,m=o.style.marginTop,n='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';p={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(h in p){i.style[h]=p[h];}i.innerHTML=n;o.insertBefore(i,o.firstChild);k=i.firstChild,j=k.firstChild,l=k.nextSibling.firstChild.firstChild;c=(j.offsetTop!==5);d=(l.offsetTop===5);k.style.overflow="hidden",k.style.position="relative";b=(j.offsetTop===-5);o.style.marginTop="1px";f=(o.offsetTop===0);o.style.marginTop=m;o.removeChild(i);g=true;}if(document.documentElement.getBoundingClientRect){$jex.offset=function(j){if(j===j.ownerDocument.body){return $jex.bodyOffset(j);}var l=j.getBoundingClientRect(),p=j.ownerDocument,m=p.body,h=p.documentElement,k=h.clientTop||m.clientTop||0,n=h.clientLeft||m.clientLeft||0,o=l.top+(self.pageYOffset||$jex.boxModel&&h.scrollTop||m.scrollTop)-k,i=l.left+(self.pageXOffset||$jex.boxModel&&h.scrollLeft||m.scrollLeft)-n;return{top:o,left:i};};}else{$jex.offset=function(m){if(m===m.ownerDocument.body){return $jex.bodyOffset(m);}g||a();var m=m,j=m.offsetParent,i=m,s=m.ownerDocument,p,k=s.documentElement,n=s.body,o=s.defaultView,h=o.getComputedStyle(m,null),q=m.offsetTop,l=m.offsetLeft;while((m=m.parentNode)&&m!==n&&m!==k){p=o.getComputedStyle(m,null);q-=m.scrollTop,l-=m.scrollLeft;if(m===j){q+=m.offsetTop,l+=m.offsetLeft;if(c&&!(d&&/^t(able|d|h)$/i.test(m.tagName))){q+=parseInt(p.borderTopWidth,10)||0,l+=parseInt(p.borderLeftWidth,10)||0;}i=j,j=m.offsetParent;}if(b&&p.overflow!=="visible"){q+=parseInt(p.borderTopWidth,10)||0,l+=parseInt(p.borderLeftWidth,10)||0;}h=p;}if(h.position==="relative"||h.position==="static"){q+=n.offsetTop,l+=n.offsetLeft;}if(h.position==="fixed"){q+=Math.max(k.scrollTop,n.scrollTop),l+=Math.max(k.scrollLeft,n.scrollLeft);}return{top:q,left:l};};}$jex.bodyOffset=function(){g||a();var i=body.offsetTop,h=body.offsetLeft;return{top:i,left:h};};$jex.pointerX=function(h){return h.pageX||(h.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));},$jex.pointerY=function(h){return h.pageY||(h.clientY+(document.documentElement.scrollTop||document.body.scrollTop));},$jex.getPageSize=function(){var j,h;if(window.innerHeight&&window.scrollMaxY){j=document.body.scrollWidth;h=window.innerHeight+window.scrollMaxY;}else{if(document.body.scrollHeight>document.body.offsetHeight){j=document.body.scrollWidth;h=document.body.scrollHeight;}else{j=document.body.offsetWidth;h=document.body.offsetHeight;}}var i,k;if(self.innerHeight){i=self.innerWidth;k=self.innerHeight;}else{if(document.documentElement&&document.documentElement.clientHeight){i=document.documentElement.clientWidth;k=document.documentElement.clientHeight;}else{if(document.body){i=document.body.clientWidth;k=document.body.clientHeight;}}}if(h<k){pageHeight=k;}else{pageHeight=h;}if(j<i){pageWidth=i;}else{pageWidth=j;}return{pageWidth:pageWidth,pageHeight:pageHeight,windowWidth:i,windowHeight:k};},$jex.getPosition=function(){var i,k;if(window.pageXOffset){i=window.pageXOffset;}else{if(document.documentElement&&document.documentElement.scrollLeft){i=document.documentElement.scrollLeft;}else{if(document.body){i=document.body.scrollLeft;}}}if(window.pageYOffset){k=window.pageYOffset;}else{if(document.documentElement&&document.documentElement.scrollTop){k=document.documentElement.scrollTop;}else{if(document.body){k=document.body.scrollTop;}}}var j,h;if(window.innerWidth){j=window.innerWidth;}else{if(document.documentElement&&document.documentElement.clientWidth){j=document.documentElement.clientWidth;}else{if(document.body){j=document.body.clientWidth;}}}if(window.innerHeight){h=window.innerHeight;}else{if(document.documentElement&&document.documentElement.clientHeight){h=document.documentElement.clientHeight;}else{if(document.body){h=document.body.clientHeight;}}}return{scrollTop:k,scrollLeft:i,clientHeight:h,clientWidth:j};};});$jex.exec(function(){function setObjectValue(target,id,obj){if(!target[id]){target[id]=obj;}else{if(target[id] instanceof Array){var arr=target[id];if(obj instanceof Array){for(var i=0;i<obj.length;i++){arr.push(obj[i]);}}else{target[id].push(obj);}}else{target[id]=[target[id],obj];}}}var readObject=$jex.readObject=function(el,target,id){var obj,text;var childs=el.getAttribute("jxChilds")||!target;if(text=el.getAttribute("jxObject")){obj=eval("({"+text+"});");}else{if(text=el.getAttribute("jxValue")){if(_Rp$(text,"%.")){obj=el.getAttribute(text.substring(2));}else{obj=text;}}else{if(!childs){obj=el.innerHTML;}else{obj={};}}}if(childs=="1"){var els=el.childNodes;for(var i=0;i<els.length;i++){if(els[i].nodeType==1){var _id=els[i].getAttribute("jxc");if(_id){readObject(els[i],obj,_id);}}}}if(id=="."){asd=(obj);}if(target&&id){if(id=="."){for(var i in obj){setObjectValue(target,i,obj[i]);}}else{setObjectValue(target,id,obj);}}return obj;};function getEventStack(obj,name,create){var arr,prop=obj.__x_;if(prop){arr=prop[name];if(!arr){arr=[];if(create){prop[name]=arr;}}}else{arr=[];if(create){obj.__x_={};obj.__x_[name]=arr;}}return arr;}function getEventStackCopy(obj,name){var arr=[],prop=obj.__x_;if(prop){if(name){if(prop[name]){$jex.array.copy(prop[name],arr);}}else{$jex.array.each(prop,function(name,obj){$jex.arraycopy(obj,arr);});}}return arr;}var events=[];var bindingArr="blur,focus,load,resize,scroll,unload,click,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error";var bindingEvent={keypress:function(object,target,eventname,handler){return $jex.event.bindDom(object,$jex.ie||$jex.safari?"keydown":"keypress",target,handler);}};$jex.event.binding=function(object,target,eventname,handler){if(!object){return;}if(arguments.length==3){handler=eventname;eventname=target;target=object;}if(bindingArr.indexOf(eventname.toLowerCase())<0){return $jex.event.add(target,eventname,handler);}else{if(!bindingEvent[eventname]){return $jex.event.bindDom(object,eventname,target,handler);}else{return bindingEvent[eventname](object,target,eventname,handler);}}};$jex.event.addEx=function(objarr,name,handler,type,notmark){for(var i=0,n=objarr.length;i<n;i++){var obj=objarr[i];$jex.event.add(obj,name,handler,type,notmark);}};$jex.event.add=function(obj,name,handler,type,notmark){obj=new EventListener(obj,name,handler,type);if(!notmark){events.push(obj);obj.refer=events.length-1;}return obj;};$jex.event.remove=function(listener){listener.remove();var i=listener.refer;if(!(i<0)){var obj=events.pop();if(i<events.length){events[i]=obj;obj.refer=i;}listener.refer=-1;}};$jex.event.clear=function(elem,name){$jex.array.each(getEventStackCopy(elem,name),$jex.event.remove);};$jex.event.trigger=function(elem,name,arg){$jex.console.info("[事件触发] name:",name,", elem:",elem,"  , arg:",arg);var args=[];$jex.array.copy(arguments,args,2);this.triggerParam(elem,name,args);};$jex.event.triggerParam=function(elem,name,args){$jex.array.each(getEventStackCopy(elem,name),function(func){func.apply(elem,args);});};$jex.event.click=function(elemId,func){$jex.event.binding($jex.$(elemId),"click",function(evt){func();$jex.stopEvent(evt);});};$jex.event.within=function(contentEl,evt){var element=typeof event!="undefined"?event.srcElement:evt.target;var isIn=false;while(element){isIn=(element==contentEl);if(isIn){break;}element=element.parentNode;}return isIn;};$jex.errorStack=[];window.onerror=function(e){e.toString=$jex.errToString;$jex.console.error(e);};function EventListener(elem,name,handler,type){this.elem=elem;this.name=name;this.handler=handler;this.type=type;this.refer=-1;getEventStack(elem,name,true).push(this);}EventListener.prototype.remove=function(){if(this.elem){switch(this.type){case 1:this.elem.removeEventListener(this.name,this.handler,false);break;case 4:this.elem.removeEventListener(this.name,this.handler,true);break;case 2:this.elem.detachEvent("on"+this.name,this.handler);break;case 3:this.elem["on"+this.name]=null;break;}$jex.array.remove(getEventStack(this.elem,this.name),this);this.elem=this.handler=null;}};EventListener.prototype.apply=function(obj,args){return this.handler.apply(obj,args);};});$jex.exec(function(){function ScriptRequest(option){if(option.funcName){this.funcName=option.funcName;}this.callbackName=option.callbackName||"callback";this.doc=option.doc||document;this.win=$jex.getDocumentWindow(this.doc);if(option.onerror){$jex.event.add(this,"error",option.onerror);}if(option.ontimeout){$jex.event.add(this,"timeout",option.ontimeout);}if(option.oncancel){$jex.event.add(this,"cancel",option.oncancel);}if(option.oncomplete){$jex.event.add(this,"complete",option.oncomplete);}}ScriptRequest.loadScript=function(url,doc){doc=doc||document;var port=doc.createElement("script");port.type="text/javascript";port.src=url;doc.getElementsByTagName("head")[0].appendChild(port);return port;};ScriptRequest.prototype.send=function(url,timeout){var cid=this.callID=this.funcName?this.funcName:"XQScript_"+$jex.globalID();if(url.indexOf("?")==-1){url=url+"?";}url+="&"+this.callbackName+"="+cid;var _self=this;var _win=this.win;var timerid;_win[cid]=function(){if(timerid){window.clearTimeout(timerid);timerid=null;}_self.release();_win[cid]=null;$jex.event.triggerParam(_self,"complete",$jex.array.toArray(arguments));};if(timeout&&timeout>0){timerid=window.setTimeout(function(){_self.release();$jex.event.trigger(_self,"timeout");},timeout);}this.searchPort=ScriptRequest.loadScript(url,this.doc);};ScriptRequest.prototype.release=function(){if(this.searchPort){$jex.removeElement(this.searchPort);this.searchPort=null;this.win[this.callID]=$jex.VOIDFUNC;return true;}return false;};ScriptRequest.prototype.cancel=function(){if(this.release()){$jex.event.trigger(this,"cancel");}};$jex.scriptRequest=ScriptRequest;$jex.jsonp=function(url,data,successhandler,options){if(arguments.length==2&&typeof data=="function"){successhandler=data;data={};}options=options||{};options.oncomplete=successhandler;if(url.indexOf("?")==-1){url=url+"?";}for(var k in data){url+="&"+k+"="+encodeURIComponent(data[k]);}var req=new ScriptRequest(options);req.send(url);return req;};$jex.ajax=function(url,data,successhandler,options){if($jex.isdebug&&$jex.gecko){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");}catch(e){alert("Permission UniversalBrowserRead denied.");}}var request=$jex.createXMLHttpRequest();request.onreadystatechange=function(){if(request.readyState==4){if(request.status>=200&&request.status<300){var _result={result:{}};try{var str=request.responseText;if(str){if(str.charAt(0,1)=="{"){str="("+str+")";}_result=eval(str);successhandler(_result);}else{if(options.onerror){options.onerror(request);}$jex.console.error(url,"返回值为空");}}catch(e){if(options.onerror){options.onerror(e);}e.toString=$jex.errToString;$jex.console.error(e);}}}};var token=Math.floor(Math.random()*100000);data._token=token;if(url.indexOf("?")==-1){url=url+"?";}request.open("GET",url+"&"+$jex.toQueryString(data),true);request.send(null);$jex.console.info("[接口调用 token=",token,"]"," url:",url,data,successhandler,options,request);return request;};var timeMap={};var _consoleStack=[];var _filter={INFO:1,WARN:1};$jex.errToString=function(){var s=["[ERROR]"];for(var key in this){if(typeof this[key]=="function"){continue;}s.push(key,":",this[key],"<br/>");}return s.join(" ");};var _pushToStack=function(level){if(!_filter[level]){return function(){_consoleStack.push(arguments);};}else{return $jex.VOIDFUNC;}};$jex.console={info:new _pushToStack("INFO"),error:new _pushToStack("ERROR"),warn:new _pushToStack("WARN"),time:new _pushToStack("TIME"),trace:new _pushToStack("TRACE")};if($jex.isdebug){}$jex.console.start=function(key){timeMap[key]=new Date();};$jex.console.end=function(key){if(timeMap[key]){$jex.console.time("[TIME]",key,":",new Date()-timeMap[key]);delete timeMap[key];}};$jex.console.output=function(){var str=[];for(var i=0;i<_consoleStack.length;i++){var line=[];var args=_consoleStack[i];for(var j=0;j<args.length;j++){line.push(args[j]);}str.push(line.join(""));}var div=$jex.$("divDebugConsole");if(div){div.innerHTML=str.join("<br/>");$jex.element.show(div);}else{alert(str.join("\r\n"));}};$jex.event.binding(document,"keydown",function(ev){if(ev.keyCode==121&&ev.ctrlKey&&ev.altKey){$jex.console.output();}});});function UIObject(){this._XGUI_=true;this._content_=[];this._childrens_=[];this._GID_="XI"+$jex.globalID();this._tplsreg=/\{\#([^\}]*?)\}/;}UIObject.prototype.isempty=function(){return this._content_.length==0;};UIObject.prototype.clear=function(){this._content_=[];this._childrens_=[];};UIObject.prototype.newid=function(a){return a+this._GID_;};UIObject.prototype.tpls=function(b){var d=this._content_;var a=this._childrens_;var f=this._GID_;for(var c=0;c<arguments.length;c++){var g=arguments[c];if(g!=null){if(g.indexOf("{#")<0){d.push(g);}else{if(g._XGUI_==true){a.push(g);d.push(g);}else{d.push(g.replace(this._tplsreg,"$1"+f));}}}}return this;};UIObject.prototype.append=function(b){var d=this._content_;var a=this._childrens_;var f=this._GID_;for(var c=0;c<arguments.length;c++){var g=arguments[c];if(g!=null){if(c%2==0){d.push(g);}else{if(g._XGUI_==true){a.push(g);d.push(g);}else{d.push(' id="',g,f,'"');}}}}return this;};UIObject.prototype.text=function(c){var b=this._content_;for(var a=0;a<arguments.length;a++){b.push(arguments[a]);}return this;};UIObject.prototype.getDomNode=function(a){return $jex.$(a+this._GID_,this._document_);};UIObject.prototype.initDocument=function(a){this._document_=a;var b=this._childrens_;for(var c=0;c<b.length;c++){b[c].initDocument(a);}this.initialize();};UIObject.prototype.write=function(b){var a=this.toString();if(a){b.innerHTML=a;this.initDocument($jex.doc(b));}else{b.innerHTML="";}};UIObject.prototype.toString=function(){return this._content_.join("");};UIObject.prototype.initialize=$jex.VOIDFUNC;function ScriptRequest(a){if(a.funcName){this.funcName=a.funcName;}this.callbackName=a.callbackName||"__jscallback";this.doc=a.doc||document;this.win=$jex.getDocumentWindow(this.doc);if(a.onerror){$jex.event.add(this,"error",a.onerror);}if(a.ontimeout){$jex.event.add(this,"timeout",a.ontimeout);}if(a.oncancel){$jex.event.add(this,"cancel",a.oncancel);}if(a.oncomplete){$jex.event.add(this,"complete",a.oncomplete);}}ScriptRequest.loadScript=function(b,c){c=c||document;var a=c.createElement("script");a.type="text/javascript";a.src=b;c.getElementsByTagName("head")[0].appendChild(a);return a;};ScriptRequest.prototype.send=function(b,c){var g=this.callID=this.funcName?this.funcName:"XQScript_"+$jex.globalID();if(b.indexOf("?")==-1){b=b+"?";}b+="&"+this.callbackName+"="+g;var a=this;var f=this.win;var d;f[g]=function(){if(d){window.clearTimeout(d);d=null;}a.release();f[g]=null;$jex.event.triggerParam(a,"complete",$jex.array.toArray(arguments));};if(c&&c>0){d=window.setTimeout(function(){a.release();$jex.event.trigger(a,"timeout");},c);}this.searchPort=ScriptRequest.loadScript(b,this.doc);};ScriptRequest.prototype.release=function(){if(this.searchPort){$jex.removeElement(this.searchPort);this.searchPort=null;this.win[this.callID]=$jex.VOIDFUNC;return true;}return false;};ScriptRequest.prototype.cancel=function(){if(this.release()){$jex.event.trigger(this,"cancel");}};$jex.List=function(a){this._map={};this._size=0;this.addRange(a);};$jex.exec(function(){var a=new Object();$jex.List.prototype.addRange=function(d){var g=this._size;if(d){var b=this._map;for(var f in d){var c=d[f];b[f]=c==null?a:c;g++;}}this._size=g;};$jex.List.prototype.firstkey=function(){var b=this.keys();if(b.length==0){return null;}return b[0];};$jex.List.prototype.first=function(){var b=this.keys();if(b.length==0){return null;}return this.get(b[0]);};$jex.List.prototype.get=function(c){var b=this._map[c];return b===a?null:b;};$jex.List.prototype.put=function(c,d){var b=this._map[c];if(typeof b==="undefined"){this._size++;}if(d==null){d=a;}this._map[c]=d;return b;};$jex.List.prototype.keys=function(){var c=[];var b=this._map;for(var d in b){c.push(d);}return c;};$jex.List.prototype.contains=function(b){return this._map[b]!=null;};$jex.List.prototype.remove=function(c){var b=this._map[c];if(b!=null){this._size--;}if(b===a){b=null;}delete this._map[c];return b;};$jex.List.prototype.size=function(){return this._size;};$jex.List.prototype.clear=function(){this._map={};this._size=0;};$jex.List.prototype.toArray=function(){var c=this._map;var b=[];for(var d in c){v=c[d];if(v===a){v=null;}b.push([d,v]);}return b;};$jex.List.prototype.toString=function(){var d=[];var c=this._map;for(var b in c){d.push(b+": "+c[b]);}return d.join("\n");};});function ActionDelay(a){this.delay=a;this.timer=null;}ActionDelay.prototype.reset=function(a){this.cancel();this.timer=setTimeout(a,this.delay);};ActionDelay.prototype.cancel=function(){if(this.timer){clearTimeout(this.timer);}};function ActionFlow(a){this.actions={};this.logs=[];this.interval=a;this.tid=null;}ActionFlow.prototype.add=function(b,a,d){var c=this.actions[a];if(c&&c.order<b){return;}this.actions[a]={order:b,key:a,func:d};return this;};ActionFlow.prototype.remove=function(a){delete this.actions[a];};ActionFlow.prototype.start=function(){if(this.tid!==null){return;}var b=false;for(var a in this.actions){b=true;break;}if(!b){return;}this.tid=setTimeout($jex.callback(this,this.run),this.interval);};ActionFlow.prototype.run=function(){clearTimeout(this.tid);this.tid=null;var a=this.actions,h=null;for(var b in a){var c=a[b];if(!h||c.order<h.order){h=c;delete a[b];}}if(h==null){return;}var g=new Date().getTime();var d;try{h.func();d="done";}catch(f){d="error:"+f;}this.logs.push([g,d,new Date().getTime()-g,h.key]);this.start();};if($jex.ie>5&&$jex.ie<7){try{(function(){document.execCommand("BackgroundImageCache",false,true);$jex.addClassName(document.getElementsByTagName("html")[0],"jx-ie"+($jex.ie*10));})();}catch(e){}}(function(){$jex.define=function(a){return typeof(a)!="undefined"&&a!=null;};$jex.extend=function(){for(var b=1,a=arguments.length;b<a;b++){$jex.merge(arguments[0],arguments[b]);}return arguments[0];};$jex.element.compareDocumentPosition=function(d,c){return d.compareDocumentPosition?d.compareDocumentPosition(c):d.contains?(d!=c&&d.contains(c)&&16)+(d!=c&&c.contains(d)&&8)+(d.sourceIndex>=0&&c.sourceIndex>=0?(d.sourceIndex<c.sourceIndex&&4)+(d.sourceIndex>c.sourceIndex&&2):1):0;};$jex.array.inArray=function(b,a){return $jex.array.indexOf(a,b);};$jex.array.xcopy=function(){var f=-1,a=arguments.length,h,g=arguments[a-1];if(typeof arguments[a-1]=="number"){var d=[g,0];g=arguments[--a-1];while(++f<a-1){arguments.callee(arguments[f],d);}Array.prototype.splice.apply(g,d);}else{while(++f<a-1){for(var c=0,b=arguments[f].length;c<b;c++){g.push(arguments[f][c]);}}}return g;};$jex.merge($jex.event,{_readyList:[],_isReady:false,_bindReady:function(){if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);$jex.event._ready();},false);}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);$jex.event._ready();}});if(document.documentElement.doScroll&&window==window.top){(function(){if($jex.event._isReady){return;}try{document.documentElement.doScroll("left");}catch(a){setTimeout(arguments.callee,0);return;}$jex.event._ready();})();}}}$jex.event.bind(window,"load",$jex.event._ready);},ready:function(a){if($jex.event._isReady){a();}else{$jex.event._readyList.push(a);}},_ready:function(){if(!$jex.event._isReady){$jex.event._isReady=true;for(var b=0,a=$jex.event._readyList.length;b<a;b++){$jex.event._readyList[b].call(document);}}}});$jex.event._bindReady();$jex.merge($jex.date={},{_prefix:function(a,b){b=b||2;a=a+"";while(a.length<b){a="0"+a;}return a;},_format:{yyyy:function(a){return a.getFullYear().toString();},MM:function(a){return $jex.date._prefix(a.getMonth()+1);},M:function(a){return a.getMonth()+1+"";},HH:function(a){return $jex.date._prefix(a.getHours());},H:function(a){return a.getHours();},dd:function(a){return $jex.date._prefix(a.getDate());},d:function(a){return a.getDate();},mm:function(a){return $jex.date._prefix(a.getMinutes());},m:function(a){return a.getMinutes();},m:function(a){return a.getMinutes();},ss:function(a){return $jex.date._prefix(a.getSeconds());},s:function(a){return a.getSeconds();}},format:function(b,g){var h=g.split("'");var f=[];for(var c=0,a=h.length;c<h.length;c++){if(c/2==Math.floor(c/2)){for(var d in $jex.date._format){h[c]=h[c].replace(new RegExp(d,"g"),$jex.date._format[d](b));}f.push(h[c]);}else{f.push(h[c]==""?"'":h[c]);}}return f.join("");}});$jex.merge($jex.web={},{parseQueryString:function(c){var b=/([^\?|\&]\w+)=([^\?|\&]+)/ig;var a={};if(c){if(c.charAt(0)=="?"){c=c.substr(1);}while(true){if((r=b.exec(c))){a[r[1]]=r[2];}else{break;}}}return a;}});$jex.web.parameters=$jex.web.parseQueryString(window.location.search);})();var ObjectRange=function(c,a,b){this.start=c;this.end=a;this.exclusive=b;this._each=function(d){var f=this.start;while(this.include(f)){d(f);f=f+1;}};this.include=function(d){if(d<this.start){return false;}if(this.exclusive){return d<this.end;}return d<=this.end;};};(function(){$jex.lightbox={overlay:null,content:null,a:{display:"none",left:"0"},b:{display:"none"},c:{display:"block",left:"50%"},d:{display:"block"},binded:false,toBind:function(){$jex.lightbox.show(null,null,1);},cache:{},gid:1,expand:"lightbox_temp",removeData:function(c){var f=c[this.expand];if(!f){return;}try{delete c[this.expand];}catch(d){if(c.removeAttribute){c.removeAttribute(this.expand);}}delete this.cache[f];},data:function(d,f){var c=d[this.expand]?d[this.expand]:(d[this.expand]=""+this.gid++);if(f!=undefined){this.cache[c]=f;}return this.cache[c];},_place:function(c){var g=(document.compatMode&&document.compatMode.toLowerCase()=="css1compat")?document.documentElement:document.body;if(c&2){var f=(g.clientHeight-this.content.offsetHeight)/2;var d=Math.floor(this.content.offsetWidth/2);$jex.hash.each($jex.extend({},this.c,{top:((f>0?f:0)+(window.pageYOffset||g.scrollTop))+"px",marginLeft:0-d+"px"}),function(i,h){$jex.lightbox.content.style[i]=h;});}if(c&1){$jex.hash.each($jex.extend({},this.d,{height:Math.max(g.scrollHeight,g.clientHeight)+"px",width:Math.max(g.scrollWidth,g.clientWidth)+"px"}),function(i,h){$jex.lightbox.overlay.style[i]=h;});}},show:function(f,h,d){if(!this.overlay){this.overlay=document.body.appendChild(document.createElement("div"));this.content=document.body.appendChild(document.createElement("div"));this.overlay.className="lb_overlay";this.content.className="lb_content";}if(f){this.content.innerHTML=f;}if(!this.binded){this.binded=true;var g=$jex.array.xcopy(document.getElementsByTagName("object"),document.getElementsByTagName("select"),document.getElementsByTagName("embed"),[]);$jex.array.each(g,function(i){$jex.lightbox.data(i,i.style.visibility);i.style.visibility="hidden";});if(window.attachEvent){window.attachEvent("onresize",this.toBind);}else{if(window.addEventListener){window.addEventListener("resize",this.toBind,false);}}}this.content.style.visibility="hidden";this.content.style.display="block";if(typeof h=="function"){h.call(this);}this._place(d==null?3:d);this.content.style.visibility="visible";var c=$jex.$("msgButton");if(c){$jex.event.click(c,function(){$jex.lightbox.hide();});}},hide:function(){var d=$jex.array.xcopy(document.getElementsByTagName("object"),document.getElementsByTagName("select"),document.getElementsByTagName("embed"),[]);$jex.array.each(d,function(f){f.style.visibility=$jex.lightbox.data(f)||"inherit";$jex.lightbox.removeData(f);});for(var c in this.a){this.content.style[c]=this.a[c];}for(var c in this.b){this.overlay.style[c]=this.b[c];}if(window.detachEvent){window.detachEvent("onresize",this.toBind);}else{if(window.removeEventListener){window.removeEventListener("resize",this.toBind,false);}}this.binded=false;}};var a=document.createElement("style");a.type="text/css";var b=".lb_content {display : none ; position : absolute ; z-index:10000 ; left:0 ;}.lb_overlay {display : none ; position : absolute ; z-index:10000 ; background-color : #000 ; left : 0px ; top : 0px ; opacity : 0.2 ; filter: Alpha(opacity=20) ;}";if(a.styleSheet){a.styleSheet.cssText=b;}else{a.appendChild(document.createTextNode(b));}document.getElementsByTagName("head")[0].appendChild(a);window.$jex=$jex;})();Array.prototype.map=function(c){var b=[];for(var a=0;a<this.length;a++){b.push((c)(this[a],a));}return b;};Array.prototype.clone=function(){return[].concat(this);};Array.prototype.toArray=Array.prototype.clone;if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse;}Array.prototype.toArray=function(){return[].concat(this);};Array.prototype.reverse=function(a){return(a!==false?this:this.toArray())._reverse();};Array.defaultCompare=function(d,c){if(d>c){return 1;}if(d==c){return 0;}if(d<c){return -1;}};Array.prototype.isSubset=function(c){var a=true;for(var b=0;b<this.length;b++){if(c.indexOf(this[b])==-1){a=false;break;}}return a;};Array.prototype.indexOf=function(a){for(var b=0,c=this.length;b<c;b++){if(this[b]==a){return b;}}return -1;};Array.prototype.include=function(a){var c=false;for(var b=0;b<this.length;b++){if(a==this[b]){c=true;break;}}return c;};Array.prototype.any=function(c){var a=false;for(var b=0;b<this.length;b++){if(a=!!(c)(this[b],b)){break;}}return a;};Array.prototype.flatten=function(){return this.inject([],function(b,a){return b.concat(a&&a.constructor==Array?a.flatten():[a]);});};Array.prototype.inject=function(a,c){for(var b=0;b<this.length;b++){a=c(a,this[b],b);}return a;};Array.prototype.all=function(c){var a=true;for(var b=0;b<this.length;b++){a=a&&!!(c)(this[b],b);if(!a){break;}}return a;};Array.prototype.clear=function(){this.length=0;return this;};Array.prototype.findAll=function(c){var b=[];for(var a=0;a<this.length;a++){if(c(this[a],a)){b.push(this[a]);}}return b;};Array.prototype.__quickSort1=function(d,c){if(c-d<=6){return this.insertSort(d,c);}var g=this[(d+c)>>1],f=d,b=c,a;do{while(f<=c&&this.compare(this[f],g)<0){f++;}while(b>=d&&this.compare(this[b],g)>0){b--;}if(f<=b){a=this[f];this[f]=this[b];this[b]=a;f++;b--;}}while(f<b);if(d<b){this.__quickSort1(d,b);}if(f<c){this.__quickSort1(f,c);}};Array.prototype.quickSort=function(a){this.compare=a||Array.defaultCompare;this.__quickSort1(0,this.length-1);return this;};Array.prototype.defaultCompare=Array.defaultCompare;Array.prototype.insertSort=function(f,h,g){f=f||0;h=h||this.length-1;g=g||this.compare||Array.defaultCompare;var a,d;for(var c=f+1;c<=h;c++){a=this[c];d=-1;for(var b=c-1;b>=f;b--){if(this.compare(this[b],a)>0){this[b+1]=this[b];d=b;}else{break;}}if(d!=-1){this[d]=a;}}};Array.prototype.hasIntersection=function(c){var b=false;for(var a=0;a<this.length;a++){if(c.indexOf(this[a])!=-1){b=true;break;}}return b;};Array.prototype.uniquelize=function(){var b=new Array();for(var a=0;a<this.length;a++){if(b.indexOf(this[a])<0){b.push(this[a]);}}return b;};Array.prototype.contains=function(b){var a=String.fromCharCode(5);return(a+this.join(a)+a).indexOf(a+b+a)==-1?false:true;};String.prototype.strip=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"");};String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"");};Function.prototype.method=function(a,b){this.prototype[a]=b;};
/*
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,j=0,d=Object.prototype.toString,o=false,i=true;[0,0].sort(function(){i=false;return 0;});var b=function(y,s,B,C){B=B||[];s=s||document;var E=s;if(s.nodeType!==1&&s.nodeType!==9){return[];}if(!y||typeof y!=="string"){return B;}var z=[],u,G,J,t,x=true,w=b.isXML(s),D=y,F,I,H,A;do{p.exec("");u=p.exec(D);if(u){D=u[3];z.push(u[1]);if(u[2]){t=u[3];break;}}}while(u);if(z.length>1&&k.exec(y)){if(z.length===2&&f.relative[z[0]]){G=h(z[0]+z[1],s);}else{G=f.relative[z[0]]?[s]:b(z.shift(),s);while(z.length){y=z.shift();if(f.relative[y]){y+=z.shift();}G=h(y,G);}}}else{if(!C&&z.length>1&&s.nodeType===9&&!w&&f.match.ID.test(z[0])&&!f.match.ID.test(z[z.length-1])){F=b.find(z.shift(),s,w);s=F.expr?b.filter(F.expr,F.set)[0]:F.set[0];}if(s){F=C?{expr:z.pop(),set:a(C)}:b.find(z.pop(),z.length===1&&(z[0]==="~"||z[0]==="+")&&s.parentNode?s.parentNode:s,w);G=F.expr?b.filter(F.expr,F.set):F.set;if(z.length>0){J=a(G);}else{x=false;}while(z.length){I=z.pop();H=I;if(!f.relative[I]){I="";}else{H=z.pop();}if(H==null){H=s;}f.relative[I](J,H,w);}}else{J=z=[];}}if(!J){J=G;}if(!J){b.error(I||y);}if(d.call(J)==="[object Array]"){if(!x){B.push.apply(B,J);}else{if(s&&s.nodeType===1){for(A=0;J[A]!=null;A++){if(J[A]&&(J[A]===true||J[A].nodeType===1&&b.contains(s,J[A]))){B.push(G[A]);}}}else{for(A=0;J[A]!=null;A++){if(J[A]&&J[A].nodeType===1){B.push(G[A]);}}}}}else{a(J,B);}if(t){b(t,E,B,C);b.uniqueSort(B);}return B;};b.uniqueSort=function(t){if(c){o=i;t.sort(c);if(o){for(var s=1;s<t.length;s++){if(t[s]===t[s-1]){t.splice(s--,1);}}}}return t;};b.matches=function(s,t){return b(s,null,null,t);};b.find=function(A,s,B){var z;if(!A){return[];}for(var w=0,u=f.order.length;w<u;w++){var y=f.order[w],x;if((x=f.leftMatch[y].exec(A))){var t=x[1];x.splice(1,1);if(t.substr(t.length-1)!=="\\"){x[1]=(x[1]||"").replace(/\\/g,"");z=f.find[y](x,s,B);if(z!=null){A=A.replace(f.match[y],"");break;}}}}if(!z){z=s.getElementsByTagName("*");}return{set:z,expr:A};};b.filter=function(E,D,H,x){var u=E,J=[],B=D,z,s,A=D&&D[0]&&b.isXML(D[0]);while(E&&D.length){for(var C in f.filter){if((z=f.leftMatch[C].exec(E))!=null&&z[2]){var t=f.filter[C],I,G,w=z[1];s=false;z.splice(1,1);if(w.substr(w.length-1)==="\\"){continue;}if(B===J){J=[];}if(f.preFilter[C]){z=f.preFilter[C](z,B,H,J,x,A);if(!z){s=I=true;}else{if(z===true){continue;}}}if(z){for(var y=0;(G=B[y])!=null;y++){if(G){I=t(G,z,y,B);var F=x^!!I;if(H&&I!=null){if(F){s=true;}else{B[y]=false;}}else{if(F){J.push(G);s=true;}}}}}if(I!==undefined){if(!H){B=J;}E=E.replace(f.match[C],"");if(!s){return[];}break;}}}if(E===u){if(s==null){b.error(E);}else{break;}}u=E;}return B;};b.error=function(s){throw"Syntax error, unrecognized expression: "+s;};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(s){return s.getAttribute("href");}},relative:{"+":function(z,t){var w=typeof t==="string",y=w&&!/\W/.test(t),A=w&&!y;if(y){t=t.toLowerCase();}for(var u=0,s=z.length,x;u<s;u++){if((x=z[u])){while((x=x.previousSibling)&&x.nodeType!==1){}z[u]=A||x&&x.nodeName.toLowerCase()===t?x||false:x===t;}}if(A){b.filter(t,z,true);}},">":function(z,t){var x=typeof t==="string",y,u=0,s=z.length;if(x&&!/\W/.test(t)){t=t.toLowerCase();for(;u<s;u++){y=z[u];if(y){var w=y.parentNode;z[u]=w.nodeName.toLowerCase()===t?w:false;}}}else{for(;u<s;u++){y=z[u];if(y){z[u]=x?y.parentNode:y.parentNode===t;}}if(x){b.filter(t,z,true);}}},"":function(w,t,y){var u=j++,s=q,x;if(typeof t==="string"&&!/\W/.test(t)){t=t.toLowerCase();x=t;s=n;}s("parentNode",t,u,w,x,y);},"~":function(w,t,y){var u=j++,s=q,x;if(typeof t==="string"&&!/\W/.test(t)){t=t.toLowerCase();x=t;s=n;}s("previousSibling",t,u,w,x,y);}},find:{ID:function(t,u,w){if(typeof u.getElementById!=="undefined"&&!w){var s=u.getElementById(t[1]);return s?[s]:[];}},NAME:function(u,y){if(typeof y.getElementsByName!=="undefined"){var t=[],x=y.getElementsByName(u[1]);for(var w=0,s=x.length;w<s;w++){if(x[w].getAttribute("name")===u[1]){t.push(x[w]);}}return t.length===0?null:t;}},TAG:function(s,t){return t.getElementsByTagName(s[1]);}},preFilter:{CLASS:function(w,t,u,s,z,A){w=" "+w[1].replace(/\\/g,"")+" ";if(A){return w;}for(var x=0,y;(y=t[x])!=null;x++){if(y){if(z^(y.className&&(" "+y.className+" ").replace(/[\t\n]/g," ").indexOf(w)>=0)){if(!u){s.push(y);}}else{if(u){t[x]=false;}}}}return false;},ID:function(s){return s[1].replace(/\\/g,"");},TAG:function(t,s){return t[1].toLowerCase();},CHILD:function(s){if(s[1]==="nth"){var t=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(s[2]==="even"&&"2n"||s[2]==="odd"&&"2n+1"||!/\D/.test(s[2])&&"0n+"+s[2]||s[2]);s[2]=(t[1]+(t[2]||1))-0;s[3]=t[3]-0;}s[0]=j++;return s;},ATTR:function(x,t,u,s,y,z){var w=x[1].replace(/\\/g,"");if(!z&&f.attrMap[w]){x[1]=f.attrMap[w];}if(x[2]==="~="){x[4]=" "+x[4]+" ";}return x;},PSEUDO:function(x,t,u,s,y){if(x[1]==="not"){if((p.exec(x[3])||"").length>1||/^\w/.test(x[3])){x[3]=b(x[3],null,null,t);}else{var w=b.filter(x[3],t,u,true^y);if(!u){s.push.apply(s,w);}return false;}}else{if(f.match.POS.test(x[0])||f.match.CHILD.test(x[0])){return true;}}return x;},POS:function(s){s.unshift(true);return s;}},filters:{enabled:function(s){return s.disabled===false&&s.type!=="hidden";},disabled:function(s){return s.disabled===true;},checked:function(s){return s.checked===true;},selected:function(s){s.parentNode.selectedIndex;return s.selected===true;},parent:function(s){return !!s.firstChild;},empty:function(s){return !s.firstChild;},has:function(u,t,s){return !!b(s[3],u).length;},header:function(s){return(/h\d/i).test(s.nodeName);},text:function(s){return"text"===s.type;},radio:function(s){return"radio"===s.type;},checkbox:function(s){return"checkbox"===s.type;},file:function(s){return"file"===s.type;},password:function(s){return"password"===s.type;},submit:function(s){return"submit"===s.type;},image:function(s){return"image"===s.type;},reset:function(s){return"reset"===s.type;},button:function(s){return"button"===s.type||s.nodeName.toLowerCase()==="button";},input:function(s){return(/input|select|textarea|button/i).test(s.nodeName);}},setFilters:{first:function(t,s){return s===0;},last:function(u,t,s,w){return t===w.length-1;},even:function(t,s){return s%2===0;},odd:function(t,s){return s%2===1;},lt:function(u,t,s){return t<s[3]-0;},gt:function(u,t,s){return t>s[3]-0;},nth:function(u,t,s){return s[3]-0===t;},eq:function(u,t,s){return s[3]-0===t;}},filter:{PSEUDO:function(u,A,z,B){var s=A[1],t=f.filters[s];if(t){return t(u,z,A,B);}else{if(s==="contains"){return(u.textContent||u.innerText||b.getText([u])||"").indexOf(A[3])>=0;}else{if(s==="not"){var w=A[3];for(var y=0,x=w.length;y<x;y++){if(w[y]===u){return false;}}return true;}else{b.error("Syntax error, unrecognized expression: "+s);}}}},CHILD:function(s,w){var z=w[1],t=s;switch(z){case"only":case"first":while((t=t.previousSibling)){if(t.nodeType===1){return false;}}if(z==="first"){return true;}t=s;case"last":while((t=t.nextSibling)){if(t.nodeType===1){return false;}}return true;case"nth":var u=w[2],C=w[3];if(u===1&&C===0){return true;}var y=w[0],B=s.parentNode;if(B&&(B.sizcache!==y||!s.nodeIndex)){var x=0;for(t=B.firstChild;t;t=t.nextSibling){if(t.nodeType===1){t.nodeIndex=++x;}}B.sizcache=y;}var A=s.nodeIndex-C;if(u===0){return A===0;}else{return(A%u===0&&A/u>=0);}}},ID:function(t,s){return t.nodeType===1&&t.getAttribute("id")===s;},TAG:function(t,s){return(s==="*"&&t.nodeType===1)||t.nodeName.toLowerCase()===s;},CLASS:function(t,s){return(" "+(t.className||t.getAttribute("class"))+" ").indexOf(s)>-1;},ATTR:function(y,w){var u=w[1],s=f.attrHandle[u]?f.attrHandle[u](y):y[u]!=null?y[u]:y.getAttribute(u),z=s+"",x=w[2],t=w[4];return s==null?x==="!=":x==="="?z===t:x==="*="?z.indexOf(t)>=0:x==="~="?(" "+z+" ").indexOf(t)>=0:!t?z&&s!==false:x==="!="?z!==t:x==="^="?z.indexOf(t)===0:x==="$="?z.substr(z.length-t.length)===t:x==="|="?z===t||z.substr(0,t.length+1)===t+"-":false;},POS:function(x,t,u,y){var s=t[2],w=f.setFilters[s];if(w){return w(x,u,t,y);}}}};var k=f.match.POS,g=function(t,s){return"\\"+(s-0+1);};for(var m in f.match){f.match[m]=new RegExp(f.match[m].source+(/(?![^\[]*\])(?![^\(]*\))/.source));f.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[m].source.replace(/\\(\d+)/g,g));}var a=function(t,s){t=Array.prototype.slice.call(t,0);if(s){s.push.apply(s,t);return s;}return t;};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType;}catch(l){a=function(x,w){var t=w||[],u=0;if(d.call(x)==="[object Array]"){Array.prototype.push.apply(t,x);}else{if(typeof x.length==="number"){for(var s=x.length;u<s;u++){t.push(x[u]);}}else{for(;x[u];u++){t.push(x[u]);}}}return t;};}var c;if(document.documentElement.compareDocumentPosition){c=function(t,s){if(!t.compareDocumentPosition||!s.compareDocumentPosition){if(t==s){o=true;}return t.compareDocumentPosition?-1:1;}var u=t.compareDocumentPosition(s)&4?-1:t===s?0:1;if(u===0){o=true;}return u;};}else{if("sourceIndex" in document.documentElement){c=function(t,s){if(!t.sourceIndex||!s.sourceIndex){if(t==s){o=true;}return t.sourceIndex?-1:1;}var u=t.sourceIndex-s.sourceIndex;if(u===0){o=true;}return u;};}else{if(document.createRange){c=function(w,t){if(!w.ownerDocument||!t.ownerDocument){if(w==t){o=true;}return w.ownerDocument?-1:1;}var u=w.ownerDocument.createRange(),s=t.ownerDocument.createRange();u.setStart(w,0);u.setEnd(w,0);s.setStart(t,0);s.setEnd(t,0);var x=u.compareBoundaryPoints(Range.START_TO_END,s);if(x===0){o=true;}return x;};}}}b.getText=function(s){var t="",w;for(var u=0;s[u];u++){w=s[u];if(w.nodeType===3||w.nodeType===4){t+=w.nodeValue;}else{if(w.nodeType!==8){t+=b.getText(w.childNodes);}}}return t;};(function(){var t=document.createElement("div"),u="script"+(new Date()).getTime();t.innerHTML="<a name='"+u+"'/>";var s=document.documentElement;s.insertBefore(t,s.firstChild);if(document.getElementById(u)){f.find.ID=function(x,y,z){if(typeof y.getElementById!=="undefined"&&!z){var w=y.getElementById(x[1]);return w?w.id===x[1]||typeof w.getAttributeNode!=="undefined"&&w.getAttributeNode("id").nodeValue===x[1]?[w]:undefined:[];}};f.filter.ID=function(y,w){var x=typeof y.getAttributeNode!=="undefined"&&y.getAttributeNode("id");return y.nodeType===1&&x&&x.nodeValue===w;};}s.removeChild(t);s=t=null;})();(function(){var s=document.createElement("div");s.appendChild(document.createComment(""));if(s.getElementsByTagName("*").length>0){f.find.TAG=function(t,y){var x=y.getElementsByTagName(t[1]);if(t[1]==="*"){var w=[];for(var u=0;x[u];u++){if(x[u].nodeType===1){w.push(x[u]);}}x=w;}return x;};}s.innerHTML="<a href='#'></a>";if(s.firstChild&&typeof s.firstChild.getAttribute!=="undefined"&&s.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(t){return t.getAttribute("href",2);};}s=null;})();if(document.querySelectorAll){(function(){var s=b,u=document.createElement("div");u.innerHTML="<p class='TEST'></p>";if(u.querySelectorAll&&u.querySelectorAll(".TEST").length===0){return;}b=function(z,y,w,x){y=y||document;if(!x&&y.nodeType===9&&!b.isXML(y)){try{return a(y.querySelectorAll(z),w);}catch(A){}}return s(z,y,w,x);};for(var t in s){b[t]=s[t];}u=null;})();}(function(){var s=document.createElement("div");s.innerHTML="<div class='test e'></div><div class='test'></div>";if(!s.getElementsByClassName||s.getElementsByClassName("e").length===0){return;}s.lastChild.className="e";if(s.getElementsByClassName("e").length===1){return;}f.order.splice(1,0,"CLASS");f.find.CLASS=function(t,u,w){if(typeof u.getElementsByClassName!=="undefined"&&!w){return u.getElementsByClassName(t[1]);}};s=null;})();function n(t,z,y,C,A,B){for(var w=0,u=C.length;w<u;w++){var s=C[w];if(s){s=s[t];var x=false;while(s){if(s.sizcache===y){x=C[s.sizset];break;}if(s.nodeType===1&&!B){s.sizcache=y;s.sizset=w;}if(s.nodeName.toLowerCase()===z){x=s;break;}s=s[t];}C[w]=x;}}}function q(t,z,y,C,A,B){for(var w=0,u=C.length;w<u;w++){var s=C[w];if(s){s=s[t];var x=false;while(s){if(s.sizcache===y){x=C[s.sizset];break;}if(s.nodeType===1){if(!B){s.sizcache=y;s.sizset=w;}if(typeof z!=="string"){if(s===z){x=true;break;}}else{if(b.filter(z,[s]).length>0){x=s;break;}}}s=s[t];}C[w]=x;}}}b.contains=document.compareDocumentPosition?function(t,s){return !!(t.compareDocumentPosition(s)&16);}:function(t,s){return t!==s&&(t.contains?t.contains(s):true);};b.isXML=function(s){var t=(s?s.ownerDocument||s:0).documentElement;return t?t.nodeName!=="HTML":false;};var h=function(s,A){var w=[],x="",y,u=A.nodeType?[A]:A;while((y=f.match.PSEUDO.exec(s))){x+=y[0];s=s.replace(f.match.PSEUDO,"");}s=f.relative[s]?s+"*":s;for(var z=0,t=u.length;z<t;z++){b(s,u[z],w);}return b.filter(x,w);};$jex.$$=b;})();function ScriptRequest(a){if(a.funcName){this.funcName=a.funcName;}this.callbackName=a.callbackName||"__jscallback";this.doc=a.doc||document;this.win=$jex.getDocumentWindow(this.doc);if(a.onerror){$jex.event.add(this,"error",a.onerror);}if(a.ontimeout){$jex.event.add(this,"timeout",a.ontimeout);}if(a.oncancel){$jex.event.add(this,"cancel",a.oncancel);}if(a.oncomplete){$jex.event.add(this,"complete",a.oncomplete);}}ScriptRequest.loadScript=function(b,c){c=c||document;var a=c.createElement("script");a.type="text/javascript";a.src=b;c.getElementsByTagName("head")[0].appendChild(a);return a;};ScriptRequest.prototype.send=function(b,c){var g=this.callID=this.funcName?this.funcName:"XQScript_"+$jex.globalID();if(b.indexOf("?")==-1){b=b+"?";}b+="&"+this.callbackName+"="+g;var a=this;var f=this.win;var d;f[g]=function(){if(d){window.clearTimeout(d);d=null;}a.release();f[g]=null;$jex.event.triggerParam(a,"complete",$jex.array.toArray(arguments));};if(c&&c>0){d=window.setTimeout(function(){a.release();$jex.event.trigger(a,"timeout");},c);}this.searchPort=ScriptRequest.loadScript(b,this.doc);};ScriptRequest.prototype.release=function(){if(this.searchPort){$jex.removeElement(this.searchPort);this.searchPort=null;this.win[this.callID]=$jex.VOIDFUNC;return true;}return false;};ScriptRequest.prototype.cancel=function(){if(this.release()){$jex.event.trigger(this,"cancel");}};function FocusChecker(f,g){var d=false;var a=false;var c=null;var b=5;function h(){c=null;if(d!=a){d=a;}if(d){g.focusin();}else{g.focusout();}}$jex.event.bind(f,"focusin",function(){a=true;if(c){clearTimeout(c);}c=setTimeout(h,b);});$jex.event.bind(f,"focusout",function(){a=false;if(c){clearTimeout(c);}c=setTimeout(h,b);});}function XCombox(j,a){var c=this.elem=j.parentNode;this.inputEl=j;this.collateValue=j.value;this.tempValue=null;this._invalid=false;var g=$jex.doc(c).createElement("DIV");g.className="boxWrapper";c.insertBefore(g,j);var b=new UIObject().append("<div","main",' class="boxContainer">').append("<div","sinfo",' class="sinfo"></div><div class="sicon"></div>').text('<div style="clear:both"></div>').text("</div>");b.write(g);var h=b.getDomNode("main"),k=b.getDomNode("sinfo");this.infoPanel=k;$jex.event.bind(h,"mouseover",function(){$jex.addClassName(this,"switcher_in");});$jex.event.bind(h,"mouseout",function(){$jex.removeClassName(this,"switcher_in");});if(a.attrs){for(var d in a.attrs){this[d]=a.attrs[d];}}if(a.button){if(a.button.mousedown){$jex.event.add(this,"buttonmousedown",a.button.mousedown);}}if(a.input){if(a.input.click){$jex.event.bindDom(j,"click",this,a.input.click);}if(a.input.mousedown){$jex.event.bindDom(j,"mousedown",this,a.input.mousedown);}if(a.input.change){$jex.event.add(this,"valuechange",a.input.change);}if(a.input.keypress){$jex.event.bindDom(j,$jex.ie||$jex.safari?"keydown":"keypress",this,a.input.keypress);}}FocusChecker(c,this,j);if(a.focus){$jex.event.add(this,"focus",a.focus);}if(a.blur){$jex.event.add(this,"blur",a.blur);}$jex.event.bindDom(j,"keyup",this,function(i){setTimeout($jex.callback(this,this._listenKey),0);});var f=this.popContainer=$jex.doc(c).createElement("DIV");f.className="popContainer";f.display="none";c.appendChild(f);this.popups=new XPopupManager(f);if(a.popups){for(var d in a.popups){this.popups.createPopup(d,a.popups[d]).own=this;}}$jex.ie&&$jex.event.bind(j,"beforedeactivate",function(i){if(this._f_leave){$jex.stopEvent(i);}this._f_leave=0;});$jex.ie&&$jex.event.bind(j,"focus",function(i){this._f_leave=0;});$jex.event.bindDom(h,"mousedown",this,this.mousedown);f.onmousedown=function(i){j._f_leave=1;return false;};}XCombox.prototype.show=function(){this.elem.style.display="block";};XCombox.prototype.hide=function(){this.elem.style.display="none";};XCombox.prototype.setValue=function(a){this.tempValue=null;this.inputEl.value=a;this._listenKey(true);};XCombox.prototype.volateValue=function(a){this.tempValue=this.inputEl.value=a;this._listenKey();};XCombox.prototype.initValue=function(a){this.collateValue=this.inputEl.value=a;this.tempValue=null;};XCombox.prototype.getValue=function(){return this.inputEl.value;};XCombox.prototype.setInfo=function(d,b,c){this.infoPanel.innerHTML=d||"";var a="sinfo";if(b){a=a+" "+b;}this.infoPanel.className=a;this.infoPanel.title=c||"";};XCombox.prototype.focusin=function(){$jex.addClassName(this.elem,"qbc_fin");$jex.event.trigger(this,"focus");this.timerListen(true);};XCombox.prototype.focusout=function(){this.popups.close();$jex.removeClassName(this.elem,"qbc_fin");$jex.event.trigger(this,"blur");this.timerListen(false);};XCombox.prototype.mousedown=function(a){var b=this.inputEl;$jex.ie&&(b._f_leave=1);window.setTimeout(function(){b.focus();},0);$jex.stopEvent(a);$jex.event.trigger(this,"buttonmousedown",a);return false;};XCombox.prototype.openMainMenu=function(){var a=this.popups.get("main");if(a&&a.isOpend()){this.popups.close();}else{this.popups.open("main");}};XCombox.prototype._listenKey=function(b){if(this.inputEl.value==this.tempValue){}else{if(this.inputEl.value!=this.collateValue){var a=this.collateValue;this.collateValue=this.inputEl.value;$jex.event.trigger(this,"valuechange",this.inputEl.value,a,b===true);}}};XCombox.prototype.timerListen=function(a){if(a){if(!this.listenID){this.listenID=setInterval($jex.callback(this,this._listenKey),50);}}else{if(this.listenID){clearInterval(this.listenID);this.listenID=null;}}};function XPopup(a){this.panel=null;this.className="popPanel"+(a.className?" "+a.className:"");if(a.close){$jex.event.add(this,"close",a.close);}if(a.open){$jex.event.add(this,"open",a.open);}if(a.initialize){this.initialize=a.initialize;}}XPopup.prototype.initialize=function(a){};XPopup.prototype._open=function(){this.panel.style.display="";$jex.event.trigger(this,"open");};XPopup.prototype.isOpend=function(){return this.panel&&this.panel.style.display!="none";};XPopup.prototype.close=function(){$jex.event.trigger(this,"close");this.panel.style.display="none";};function XPopupManager(a){this.popups={};this.container=a;this.current=null;this.defaultName=null;}XPopupManager.prototype.createPopup=function(a,b){return this.popups[a]=new XPopup(b);};XPopupManager.prototype.open=function(b){var a=this.popups[b];if(a){if(!a.inited){var c=a.panel;if(!c){c=$jex.doc(this.container).createElement("DIV");c.className=a.className;c.style.display="none";this.container.appendChild(c);a.panel=c;}a.initialize();a.inited=true;}if(this.current&&this.current!=a&&this.current.isOpend()){this.current.close();}if(!a.isOpend()){a._open();}return this.current=a;}};XPopupManager.prototype.close=function(a){if(a&&!this.isOpend(a)){return;}if(this.current!=null){this.current.close();this.current=null;}};XPopupManager.prototype.isOpend=function(a){if(a){if(this.popups[a]){return this.popups[a].isOpend();}}else{if(this.current!=null){return this.current.isOpend();}}return false;};XPopupManager.prototype.get=function(a){return this.popups[a];};function FlightSuggestItemListLayer(a){this.popup=a;this.cursor=-1;this.nodes=[];}FlightSuggestItemListLayer.prototype.error=function(){var a=new UIObject();a.append("<table","suggestList",' class="ill" cellspacing="0" cellpadding="0" >');a.text('<tr class="illrow error">',"<td>暂未收录</td>","</tr>");a.write(this.popup.panel);};FlightSuggestItemListLayer.prototype.refresh=function(g){this.cursor=-1;if(this.nodes.length>0){for(var h=0;h<this.nodes.length;h++){var d=this.nodes[h];d.item=null;d.layer=null;$jex.event.clear(d);}}this.nodes.length=0;var k=g.q;var j=g.result;var l=g.userInput;var a=new RegExp("("+l+")","i");var c=new UIObject();c.append("<table","suggestList",' class="ill" cellspacing="0" cellpadding="0" >');for(var h=0;h<j.length;h++){var f=j[h];var m=(f.type==4)?"nearbyAirport":"";c.text('<tr class="illrow ',m,'"',">");c.append("<td ",h).text(' class="illn" hashkey="',f.key,'"',((f.type==1)?'noAirport="true"':""),">",((f.type==4)?"·邻近机场:":""),f.display.replace(a,'<span class="keystring">$1</span>'),((f.type==4)?"<span>-"+f.length+"公里</span>":""),((f.type==1)?"-该城市没有机场":""),((f.type==2)?"-该地区的机场有":""),"</td>");c.text("</tr>");}c.text("</table>");c.write(this.popup.panel);var b=this.nodes;for(var h=0;h<j.length;h++){var d=c.getDomNode(h);d.item=j[h];d.layer=this;d.idx=h;b[h]=d;$jex.event.bind(d,"mouseover",this.mouseover);$jex.event.bind(d,"click",this.click);}};FlightSuggestItemListLayer.prototype.mouseover=function(a){if(this.item.type==1){return;}this.layer.enter(this.idx);};FlightSuggestItemListLayer.prototype.click=function(a){this.layer.select(this.idx,true);};FlightSuggestItemListLayer.prototype.select=function(a,b){$jex.event.trigger(this,"select",a,b);};FlightSuggestItemListLayer.prototype.enter=function(a){for(var b=0;b<this.nodes.length;b++){$jex.removeClassName(this.nodes[b].parentNode,"tllover");}if(a>-1){$jex.addClassName(this.nodes[a].parentNode,"tllover");this.cursor=a;}};FlightSuggestItemListLayer.prototype.moveCursor=function(c,b){if(this.nodes.length==0){return;}if(this.cursor==-1&&c==-1){this.cursor=this.nodes.length-1;}else{var a=this.nodes[this.cursor+c];if(a&&a.item.type==1){c*=2;}this.cursor+=c;if(this.cursor<-1||this.cursor>=this.nodes.length){this.cursor=-1;}}this.enter(this.cursor);if(b){this.select(this.cursor);}};function TTSCityXCombox(c,d,b){var h=new Date();var a=this;this.setting=b||{};var g=this.setting.lang;var f=new ScriptRequest({oncomplete:function(i){a.suggLoaded(i);},callbackName:"callback"});TTSCityXCombox.superclass.constructor.call(this,c,{button:{mousedown:function(i){this.openMainMenu();$jex.stopEvent(i);}},input:{change:function(l,j,k){if(!k){this.vidx=-1;this.inputold=l;l=l.replace(/[~!@#\$%\^&\*\(\)_\+<>\?:\\\\"\|\{\}`,\.;'\\\{\}]+/ig,"");if(l){var i=this.popups.get("suggest");i&&i.layer&&(i.layer.cursor=-1);f.cancel();if(this.cache[l]){a.suggLoaded(this.cache[l]);}else{f.send("http://www.qunar.com/suggest/livesearch.jsp?lang=zh&q="+encodeURIComponent(l)+"&sa=true");}}else{this.popups.close();}}else{$jex.event.trigger(d,"cityfinished",this.getValue());}},keypress:function(i){this.keypress(i,i.keyCode);}},focus:function(){this.inputEl.select();},blur:function(){if(this.vidx==-1){var i=this.popups.get("suggest");if(i&&i.layer&&(i.layer.cursor>-1)){this.setValue(i.layer.nodes[i.layer.cursor].item.key);}}else{if(this.getValue()==""){this.setTip();}}},popups:{main:{initialize:function(){var p=g.cityList;var k=g.number;var q=g.desc;var n=g.type;var m=new UIObject().text('<div class="cityinput" hotcitytype="1"><div class="hint">').append("<img","close",' class="closeImg" src="aa_files/Button_Hotcity_Close.gif"/>').text('<span class="">Top ',p.length,"热门",n,"</span>",'<span class=""> (<span class="CIunderline">',q,"</span>)</span>","<hr/><ul>");for(var l=0;l<p.length;l++){m.text("<li>");m.append("<a ",l).text(' href="javascript:void(0);" country="',p[l].country,'">',p[l].name,"</a></li>");}m.text('<div class="clear"></div>',"</ul>","</div></div>");m.write(this.panel);var j=this.own;for(var l=0;l<p.length;l++){var o=m.getDomNode(l);$jex.event.bind(o,"click",function(){j.setValue($jex.trim(this.innerHTML));j.setInfo("");j.popups.close();a._invalid=false;});}$jex.event.bind(m.getDomNode("close"),"click",function(){j.popups.close();});},open:function(){this.own.setInfo("");}},suggest:{initialize:function(){this.layer=new FlightSuggestItemListLayer(this);$jex.event.bind(this.layer,"select",function(i,j){if(i>-1){j?this.popup.own.setValue(this.nodes[i].item.key):this.popup.own.volateValue(this.nodes[i].item.key);}else{j?this.popup.own.initValue(this.popup.own.inputold):this.popup.own.volateValue(this.popup.own.inputold);}this.popup.own.vidx=i;if(j){this.popup.close();}});}}},attrs:{setTip:function(){if(this.getValue()==""){this.setInfo((this.info||"城市名"),"infotext");}else{this.setInfo("");}},clear:function(){var i=this.popups.get("suggest");i&&i.layer&&(i.layer.cursor=-1);this.setValue("");this.setTip();},getHotCityConfig:function(j){var i=this.setting.hotCityConfig;if(i&&i[j]){return i[j];}},setHotCityConfig:function(i){this.setting.hotCityConfig=i;},invalid:function(){return this._invalid;},cache:{},suggLoaded:function(i){if(i){this.cache[i.userInput]=i;}if(!i||!i.result||i.result.length==0){this.setInfo("");i.q=i.userInput;var j=this.popups.open("suggest");j.layer.error();this._invalid=true;return;}this._invalid=false;this.setInfo("");i.q=i.userInput;var j=this.popups.open("suggest");j.layer.refresh(i);j.layer.enter(0);},keypress:function(j,k){if(this._invalid){return;}var i=this.popups.get("suggest");if(!i||!i.isOpend()){return;}switch(k){case 40:i.layer.moveCursor(1,true);break;case 38:i.layer.moveCursor(-1,true);break;case 13:$jex.stopEvent(j);i.layer.select(i.layer.cursor,true);i.close();break;default:}}}});}$jex.extendClass(TTSCityXCombox,XCombox);var QunarDate=$jex.exec(function(){var b={};var f=["今天","明天","后天"];var i=24*60*60*1000;var h=["日","一","二","三","四","五","六"];var c={week:"周",day:"天",before:"前",after:"后"};var g={SECOND:"秒",MILLISECOND:"毫秒",MINUTE:"分钟",HOUR:"小时",DAY:"天",YEAR:"年"};var a=null;var d=null;return{isHoliday:function(j){return !!b[j];},parseTimeToNL_et:function(j){if(j>=i){j=i;}return this.parseTimeToNL(j);},parseTimeToNL:function(o){var n=o%1000;var m=(o-n)%60000;var k=(o-m*1000-n)%3600000;var p=(o-k*60000-m*1000-n)%(24*3600000);var j=(o-p*3600000-k*60000-m*1000-n)%(24*3600000);var l="";if(o<1000){l=o+g.MILLISECOND;}else{if(o<60000){l=parseInt(o/1000)+g.SECOND;}else{if(o<3600000){l=parseInt(o/60000)+g.MINUTE;}else{if(o<(24*3600000)){l=parseInt(o/3600000)+g.HOUR;}else{if(o<(365*24*3600000)){l=parseInt(o/(24*3600000))+g.DAY;}else{l=parseInt(o/(365*24*3600000))+g.YEAR;}}}}}return l;},plus:function(j,k){return new Date(j.getTime()+k*i);},today:function(){if(a){return a;}var j=window.SERVER_TIME||new Date();return a=new Date(j.getFullYear(),j.getMonth(),j.getDate());},parse:function(k){var j=k.split("-");return new Date(j[0],j[1]-1,j[2]);},format:function(j){if(typeof j=="number"){j=new Date(j);}return j.getFullYear()+"-"+this.convert2digit(j.getMonth()+1)+"-"+this.convert2digit(j.getDate());},convert2digit:function(j){return j<10?"0"+j:j;},compareDate:function(k,j){return k.getTime()-j.getTime();},getFirstDaysOfMonth:function(j){return new Date(j.getFullYear(),j.getMonth(),1);},getLastDaysOfMonth:function(j){return new Date(j.getFullYear(),j.getMonth()+1,0);},getDateTip:function(j){var k=this.parse(j);var l=(k.getTime()-this.today().getTime())/1000/3600/24;var m="";if(l<3){m=f[l];}else{this.initDataTable();if(d[j]){m=d[j].holidayName;}}if(m==""){m=c.week+h[k.getDay()];}return m;},initDataTable:function(){if(d!=null){return d;}d={};for(var t in b){var k=t;var o=b[t];d[t]=o;var n="";var p="";if(o.beforeTime>0){for(var l=1;l<=o.beforeTime;l++){var q={};var u=new Date(this.parse(k).getTime()-l*24*3600*1000);var m=this.format(u);q.holidayName=o.holidayName+c.before+l+c.day;q.dayindex=o.dayindex;if(!d[m]){d[m]=q;}else{if((o.dayindex>d[m].dayindex)&&d[m].beforeTime==null){d[m]=q;}}}}if(o.afterTime>0){for(var l=1;l<=o.afterTime;l++){var q={};var s=new Date(this.parse(k).getTime()+l*24*3600*1000);var j=this.format(s);q.holidayName=o.holidayName+c.after+l+c.day;q.dayindex=o.dayindex;if(!d[j]){d[j]=q;}else{if((o.dayindex>d[j].dayindex)&&d[this.format(new Date(u))].afterTime==null){d[j]=q;}}}}}}};});function DateChecker(a,h,f,g){a=a||89;spanByDate1=89;h=h||1;f=f||3;if(g){var b=new Date(QunarDate.today().getTime()+g*24*3600000)||QunarDate.today();}else{var b=QunarDate.today();}var d=new Date(b.getTime()+a*24*3600000);var c=new Date(b.getTime()+h*24*3600000);this.date1=c;this.firstSpan=a;this.setDate1=function(i){return this.date1=this.checkDate1(i).recommendDate;};this.getDate1=function(){return QunarDate.format(this.date1);};this.date2=new Date(c.getTime()+f*24*3600000);this.setDate2=function(j,i){return this.date2=this.checkDate2(j,QunarDate.format(this.date1),i).recommendDate;};this.getDate2=function(){return QunarDate.format(this.date2);};this.checkDate1=function(i){return this.checkDate(i,b,d,c);};this.checkDate2=function(m,k,j){var i=d;if(j){i=QunarDate.parse(j);}var l=new Date(this.date1.getTime()+f*24*3600000);if(l.getTime()>i.getTime()){l=i;}return this.checkDate(m,this.date1,i,l);};this.setDelay2=function(i){f=i||f;};this.checkDate=function(p,m,q,i){var k=null;var l=false;var j=null;var o="";try{k=QunarDate.parse(p);}catch(n){l=true;j="格式错误";o="日期格式如: "+QunarDate.format(i);k=i;}if(isNaN(k)){l=true;j="格式错误";o="日期格式如: "+QunarDate.format(i);k=i;}else{if(m.getTime()>k.getTime()){l=true;j="超出范围";o="应选择"+QunarDate.format(m)+"至"+QunarDate.format(q)+"之间的日期";k=i;}else{if(k.getTime()>q.getTime()){l=true;j="超出范围";o="应选择"+QunarDate.format(m)+"至"+QunarDate.format(q)+"之间的日期";k=i;}}}return{error:l,recommend:QunarDate.format(k),recommendDate:k,value:j,tip:o};};this.getMin=function(){return b;};this.getMax=function(){return d;};this.resetMax=function(j,k){var l=j||b;var i=k||a;d=new Date(l.getTime()+i*24*3600000);};this.setSpan=function(i){a=i;};this.marks={};this.date2Hide=false;this.hideDate2=function(){this.date2Hide=true;};this.showDate2=function(){this.date2Hide=false;};this.getTdStyle=function(j,k,i){i=i||d;k=k||b;var m=j.getTime();var l="";if(m==this.date1.getTime()){l+=" curr";}else{if(m==this.date2.getTime()&&this.date2Hide==false){l+=" othr";}}if(j.getDay()==0||j.getDay()==6||QunarDate.isHoliday(QunarDate.format(j))){l+=" holi";}if(m==b.getTime()){l+=" today";}if(!(k.getTime()<=m&&m<=i.getTime())){l+=" out";}return l;};}function DateLayer(c,f){this.panel=c;this.nodes=[];var a=this;this.render=function(l,m,s){var m=m||f.getMin();var s=s||f.getMax();for(var o=0,h=this.nodes.length;o<h;o++){var k=this.nodes[o];$jex.event.clear(k);}this.nodes=[];var g=new UIObject().text('<div class="dpanel">');var p=0;var q=0;$jex.array.each([0,1],function(x,D){var F=new Date(l.getFullYear(),l.getMonth()+x,1);var y=F.getMonth()+1;var z=QunarDate.convert2digit(y);var H=F.getFullYear();var A=new Date(H,F.getMonth(),0);var w=new Date(H,F.getMonth(),1);var E=new Date(H,F.getMonth()+1,1);var n=new Date(H,y-1,1).getDay()-1;if(n<0){n=6;}var I=new Date(H,y,0).getDate();var B=D==0?m.getTime()<=A.getTime():E.getTime()<=s.getTime();g.text('<div class="dpart dbg',y,'">');g.text("<h3>");g.append("<span ","a"+(q++)).text(' class="',(D?"downTd":"upTd"),'" ym="',(QunarDate.format(D?w:A)),'" style="',(B?"display:block":"display:none"),'"></span>',H,"年",y,"月</h3>");g.text('<table cellspacing="0" cellpadding="0" border="0">');g.text('<tr class="thead"><td>一</td><td>二</td><td>三</td><td>四</td><td>五</td><td class="holi">六</td><td class="holi">日</td></tr>');var G=0;for(var C=0;C<42;C++){if(C%7==0){g.text('<tr class="tdate">');}if(C<n){g.text('<td class="cnone">&nbsp;</td>');}else{if(G<I){G++;var K=QunarDate.convert2digit(G);var L=H+"-"+z+"-"+K;var J=new Date(H,y-1,G);g.append("<td ",p++).text(' value="',L,'" class="',f.getTdStyle(J,m,s),'" >',G,"</td>");}else{g.text('<td class="cnone">&nbsp;</td>');}}if(C%7==6){g.text("</tr>");}}g.text("</table></div>");});g.text("</div>");g.write(this.panel);function u(){var i=this.getAttribute("value");var n=QunarDate.parse(i);if((n.getTime()>=m.getTime())&&(n.getTime()<=s.getTime())){$jex.event.trigger(a,"selected",n);}}function j(i){a.render(QunarDate.parse(this.getAttribute("ym")),m,s);}for(var o=0;o<p;o++){var k=g.getDomNode(o);$jex.event.bind(k,"mouseover",b);$jex.event.bind(k,"mouseout",d);$jex.event.bind(k,"click",u);this.nodes.push(k);}for(var o=0;o<q;o++){var t=g.getDomNode("a"+o);$jex.event.bind(t,"mousedown",j);this.nodes.push(t);}};function b(g){$jex.addClassName(this,"onmouseover");}function d(g){$jex.removeClassName(this,"onmouseover");}}function DatePickerXCombox(f,g,d){var b=this;var a=new ActionDelay(100);this.setting=d||{};var c=this.fromDateBox=this.setting.fromDateBox||null;var h=this.dateChecker=this.setting.dateChecker||null;DatePickerXCombox.superclass.constructor.call(this,f,{button:{mousedown:function(i){this.openMainMenu();$jex.stopEvent(i);}},input:{click:function(i){this.openMainMenu();$jex.stopEvent(i);},change:function(k,i,j){if(!b.fromDateBox){var l=h.checkDate1(this.getValue());if(!l.error){h.setDate1(l.recommend);a.reset(function(){$jex.event.trigger(g,"fromDateChanged");});}this.setTip(l);}else{var l=h.checkDate2(this.getValue(),c.getValue(),QunarDate.format(QunarDate.plus(h.getMax(),1)));if(!l.error){h.setDate2(l.recommend,QunarDate.format(QunarDate.plus(h.getMax(),1)));a.reset(function(){$jex.event.trigger(g,"toDateChanged");});}this.setTip(l);}},keypress:function(i){this.keypress(i,i.keyCode);}},blur:function(){if(b.fromDateBox){var i=h.checkDate2(this.getValue(),c.getValue(),QunarDate.format(QunarDate.plus(h.getMax(),1)));h.setDate2(i.recommend,QunarDate.format(QunarDate.plus(h.getMax(),1)));this.setValue(i.recommend);}else{var i=h.checkDate1(this.getValue());if(this.getValue()==""||this.getValue()=="yyyy-mm-dd"){i.recommend=QunarDate.format(QunarDate.today());}h.setDate1(i.recommend);this.setValue(i.recommend);}},popups:{main:{initialize:function(){this.dateLayer=new DateLayer(this.panel,h);var j=this.own;var i=this;$jex.event.add(this.dateLayer,"selected",function(k){j.setValue(QunarDate.format(k));i.close();});},open:function(){if(b.fromDateBox){h.resetMax(h.date1,h.firstSpan);var i=h.checkDate2(this.own.getValue(),c.getValue(),QunarDate.format(QunarDate.plus(h.getMax(),1)));this.dateLayer.render(i.recommendDate,new Date(QunarDate.parse(c.getValue()).getTime()),new Date(QunarDate.plus(h.getMax(),1)));}else{h.resetMax();if(this.own.getValue()==""||this.own.getValue()=="yyyy-mm-dd"){var i=h.checkDate1(QunarDate.format(QunarDate.today()));}else{var i=h.checkDate1(this.own.getValue());}this.dateLayer.render(i.recommendDate,h.getMin());}$jex.event.trigger(b,"openDatepicker");},close:function(){$jex.event.trigger(b,"closeDatepicker");}}},attrs:{keypress:function(i,j){switch(j){case 13:if(this.popups.isOpend()){$jex.stopEvent(i);this.popups.close();}break;case 27:$jex.stopEvent(i);this.popups.close();break;default:}},setTip:function(i){if(b.fromDateBox){var i=i||h.checkDate2(this.getValue(),c.getValue(),QunarDate.format(QunarDate.plus(h.getMax(),1)));}else{var i=i||h.checkDate1(this.getValue());}if(i.error){this.setInfo(i.value,"errtext",i.tip);}else{this.setInfo(QunarDate.getDateTip(i.recommend),"","");}},invalid:function(){return $jex.hasClassName(this.infoPanel,"errtext");}}});}$jex.extendClass(DatePickerXCombox,XCombox);function TTSSearch(c,i){var b=this;this.option=i||{};var j=b.fromLang=i.fromHotCity;var g=b.toLang=i.toHotCity;this.sswitcher=null;var n=this.fromCity=new TTSCityXCombox(c.fromCity,b,{lang:j});var k=this.toCity=new TTSCityXCombox(c.toCity,b,{lang:g});var h=new DateChecker(210);var f=new ActionDelay(200);function a(){f.reset(function(){$jex.event.trigger(b,"dateFinish");});}$jex.event.addEx([n,k],"valuechange",function(p,o,q){if(q){$jex.event.trigger(b,"citychange",this.inputEl.name,p);}});$jex.event.bindDom(c,"submit",this,function(o){if((n.invalid()||k.invalid())||(!n.getValue()||!k.getValue())){$jex.stopEvent(o);return false;}$jex.event.trigger(b,"pre_submit");});n.info=this.option.info;n.setTip();k.info=this.option.info;k.setTip();var l=this.fromDate=new DatePickerXCombox(c.fromDate,b,{dateChecker:h});var d=this.returnDate=new DatePickerXCombox(c.returnDate,b,{dateChecker:h,fromDateBox:l});$jex.event.add(this,"fromDateChanged",function(){var p=h.checkDate1(l.getValue()).recommend;var o=h.checkDate2(d.getValue(),p,QunarDate.format(QunarDate.plus(h.getMax(),1))).recommend;h.setDate2(o,QunarDate.format(QunarDate.plus(h.getMax(),1)));d.setValue(o);});$jex.event.addEx([l,d],"openDatepicker",function(){$jex.event.trigger(b,"openDatepicker");});l.setValue(h.getDate1());d.setValue(h.getDate2());h.hideDate2();if($jex.$("roundTrip")){$jex.event.bind($jex.$("roundTrip"),"click",function(){$jex.removeClassName($jex.$("rtDate"),"hide");h.setSpan(210);h.setDelay2(3);h.showDate2();});}if($jex.$("onewayTrip")){$jex.event.bind($jex.$("onewayTrip"),"click",function(){$jex.addClassName($jex.$("rtDate"),"hide");h.setSpan(210);h.setDelay2(3);h.hideDate2();});}if($jex.$("roundTripInter")){$jex.event.bind($jex.$("roundTripInter"),"click",function(){$jex.removeClassName($jex.$("rtDateInter"),"hide");h.setSpan(210);h.setDelay2(3);h.showDate2();});}if($jex.$("onewayTripInter")){$jex.event.bind($jex.$("onewayTripInter"),"click",function(){$jex.addClassName($jex.$("rtDateInter"),"hide");h.setSpan(210);h.setDelay2(3);h.hideDate2();});}var m=initParamSearch(b);this.flyType=m.flytype;createTime();parseLogin();}function initParamSearch(c){var a={};var b=window.location.search;$jex.array.each(b.replace("?","").split("&"),function(g,d){var f=g.split("=");a[f[0]]=decodeURIComponent(f[1]);});if(a.fromCity){c.fromCity.setValue(a.fromCity);c.fromCity.setTip();}if(a.toCity){c.toCity.setValue(a.toCity);c.toCity.setTip();}if(a.fromDate){c.fromDate.setValue(a.fromDate);}if(a.returnDate){c.returnDate.setValue(a.returnDate);}if(a.flytype&&a.flytype=="2"){if($jex.$("roundTrip")){$jex.$("roundTrip").click();}if($jex.$("roundTripInter")){$jex.$("roundTripInter").click();}}return a;}function createTime(){if(!$jex.$("timelayer")){return;}var k={"0":"日","1":"一","2":"二","3":"三","4":"四","5":"五","6":"六"};function b(m){if(m<10){return"0"+m;}else{return m;}}var l=new Date();var i=l.getFullYear();var g=b(l.getMonth()+1);var j=b(l.getDate());var c=k[l.getDay()];var d=l.getHours();var a=b(l.getMinutes());var f=b(l.getSeconds());var h=[i,"-",g,"-",j,"　",d,":",a,"　星期",c];$jex.$("timelayer").innerHTML=h.join("");setTimeout(createTime,1000*60);}function parseLogin(){var a={};var b=document.cookie.split("; ");$jex.array.each(b,function(f){var d=f.split("=");a[d[0]]=d[1];});if(a._vv&&a._qq){$jex.$("ttsLogin").innerHTML='<div class="login">您好，'+a._qq+'　欢迎光临　<a href="/tts/user/logout.jsp">退出</a></div>';var c=$jex.$("yaoLogin");if(c){c.parentNode.removeChild(c);}}}function TabGroup(a){this._contentMAP={};this.setting=a||{};this.setting.activeTab=this.setting.activeTab||0;this.setting.activeCls="active";this._initPanels();this._bindEvent();this.activeTab();this.bindedEvent=false;}TabGroup.prototype._got=function(a){if(typeof a=="string"){return $jex.$(a);}else{return a;}};TabGroup.prototype._initPanels=function(){if(!this.setting.panelContainerID){return;}var a=this.setting.items;var g=this._got(this.setting.panelContainerID);for(var b=0;b<a.length;b++){var d=a[b];if(d.render&&!d.panelID){var f=document.createElement("DIV");f.id="TG_PANEL_"+$jex.globalID();g.appendChild(f);$jex.element.hide(f);d.panelID=f.id;}}};TabGroup.prototype.activeTab=function(a){a=a||0;var d=this.setting;var b=this.setting.items;if(this.currentTab!=null&&this.currentPanel!=null){$jex.removeClassName(this.currentTab,d.activeCls);$jex.element.hide(this.currentPanel);}var f=b[a];if(!f){return;}var c=this.currentTab=this._got(f.tabID);var g=this.currentPanel=this._got(f.panelID);if(f.render&&!this._contentMAP[f.panelID]){f.container=g;f.render(g);this._contentMAP[f.panelID]=true;}$jex.addClassName(c,d.activeCls);$jex.element.show(g);$jex.event.trigger(this,"onselected",f);};TabGroup.prototype._bindEvent=function(){if(this.bindedEvent){return;}var a=this.setting.items;for(var c=0;c<a.length;c++){var d=a[c];var b=this._got(d.tabID);$jex.event.bindDom(b,"mousedown",this,function(f){return function(){this.activeTab(f);};}(c));}this.bindedEvent=true;};function initSearchBox(){if($jex.$("searchForm")){window.FlightForm=new TTSSearch($jex.$("searchForm"),{info:"城市名",fromHotCity:CityConfig.china["top20"],toHotCity:CityConfig.china["top20"]});}if($jex.$("searchFormInter")){window.FlightFormInter=new TTSSearch($jex.$("searchFormInter"),{info:"城市名",fromHotCity:CityConfig.china["top20"],toHotCity:CityConfig.inter["top20"]});}}function LOG(){this.error=[];this.info=[];this.warning=[];this.allmsg=[];this.regEvent();}LOG.method("setLog",function(c,b){var d=[];for(var a=1;a<arguments.length;a++){d.push(arguments[a]);}d=d.join(",");switch(c){case"error":this.error.push(d);this.allmsg.push("error:"+d);break;case"info":this.info.push(d);this.allmsg.push("info:"+d);break;case"warning":this.warning.push(d);this.allmsg.push("warning:"+d);break;default:this.info.push(d);this.allmsg.push("info:"+d);}});LOG.method("getLog",function(b){if(typeof b=="undefined"){return this.allmsg;}var a=null;switch(b){case"error":a=this.error;break;case"info":a=this.info;break;case"warning":a=this.warning;break;default:a=this.error;break;}return a;});LOG.method("viewLog",function(c){var a=this;if(!$jex.$("LOGinfo")){var b=document.createElement("div");b.id="LOGinfo";if(typeof c!="undefined"){b.innerHTML=a.getLog(c).join("<br />");}else{b.innerHTML=a.getLog().join("<br />");}document.getElementsByTagName("body")[0].appendChild(b);}else{document.getElementsByTagName("body")[0].removeChild($jex.$("LOGinfo"));}});LOG.method("regEvent",function(){var a=this;$jex.event.bind(document,"keydown",function(b){return function(c){if(c.keyCode==121&&c.ctrlKey&&c.altKey){a.viewLog();}};}());});var TTSLOG=new LOG();(function(){var g={};var c={};function f(){var p=document.cookie.toString().split(";");for(var o=0;o<p.length;o++){var q=p[o];var l=q.indexOf("=");var n=q.substr(0,l);var m=q.substr(l+1,q.length);g[$jex.trim(n)]=m;}}function i(k){$jex.jsonp("http://user.qunar.com/islogin.jsp",{conkey:window.location.host.toString(),n:Math.random()},function(n,m,l){c.username=n;c.access_token=m;c.access_secret=l;k();});}function h(n){var l=[];var m=window.location.host.toString();var k=encodeURIComponent(d(window.AUTHORIZATION_RET||window.location.href.toString()));window.tts_auth_islogin=n;if(n){l.push(g._user);l.push(' | <a href="/tts/user/logout.jsp?ret=http%3A%2F%2F'+m+"&ttsname="+m+'">退出</a>');if(window.tts_auth_callback){window.tts_auth_callback(g._user);}}else{l.push('去哪儿通行证 <a href="http://user.qunar.com/login_tts.jsp?ret='+k+"&ttsname="+m+'">登录</a> | ');l.push('<a href="http://user.qunar.com/reg.jsp?ret='+k+"&ttsname="+m+'">注册</a>');}$jex.$("ttsLogin").innerHTML=l.join("");}function d(k){if(k.indexOf("/tts/user/login.jsp")>0){k=k.replace("/tts/user/login.jsp","/tts/user/national/order.jsp");}return k;}function a(k){$jex.jsonp("/tts/user/checkUser.jsp",$jex.merge(c,{n:Math.random()}),function(){if(k){k();}});}function j(k,l){f();if(g._tt&&g._user&&!k){h(true);}else{if(l){l();}}}function b(){if(!$jex.$("ttsLogin")){return;}j(window.tts_auth_nocache,function(){i(function(){if(c.username){a(function(){j(false,function(){h(false);});});}else{h(false);}});});}setTimeout(function(){b();},500);window.tts_auth=b;})();
