Element.alias("css","setStyles");Element.alias("on","addEvent");
/*
 * DianPing dp.core.js(temp)
 * @author  Kael Zhang
 */
if(!window.DP){DP={}}(function(E){var A={},C=Object.prototype.toString;"Boolean Number String Function Array Date RegExp Object".split(" ").each(function(G){var D=G.toLowerCase();A["[object "+G+"]"]=D;E["is"+G]=G==="Object"?function(H){return !!H&&B(H)===D}:function(H){return B(H)===D}});function B(G,D){return D&&A[C.call(G)]||$type(G)}function F(I,H){var G,D=[];for(G in I){D.push(G+"="+I[G])}return D.join(H||"&")}E.isPlainObject=function(D){return D&&E.isObject(D)&&"isPrototypeOf" in D};E.type=B;E.makeArray=function(D){return B(D)==="array"?D:[D]};E.toQueryString=function(G,D){return B(G)==="object"?F(G,D):G}})(DP);DP.mix=function(E,D,F,B){if(!D||!E){return E}if(F===undefined){F=true}var C=0,G,A;if(B&&(A=B.length)){for(;C<A;C++){G=B[C];if((G in D)&&(F||!(G in E))){E[G]=D[G]}}}else{for(G in D){if(F||!(G in E)){E[G]=D[G]}}}return E};function $AuthBoxShow(A,B){var E=new Element("button").set("html","免费注册").addEvent("click",function(){window.location.href="/reg/"+A+("，请先注册".cnEncode())+"?"+(B?"m="+B+"&":"")+"redir="+window.location.pathname.cnEncode()});var D=new Element("button").set("html","立即登录").addEvent("click",function(){window.location.href="/login/"+A+("，请先登录".cnEncode())+"?"+(B?"m="+B+"&":"")+"redir="+window.location.pathname.cnEncode()});var C=new Element("button").set("html","取消").addEvent("click",function(){Mbox.close()});Mbox.open({type:"ele",url:$dialog(A.cnDecode(),A.cnDecode()+"，请先登录或免费注册！",[E,D,C]),size:{x:300,y:120}});E.focus();if(B){new AjaxReq({url:"/reglogin.v",method:"post",data:{"do":"cc",m:B},onSuccess:function(){},onError:function(){}}).send()}return false}function $AuthBox(B,A){if(B){B.addEvent("click",function(){$AuthBoxShow(A);return false})}}function $HeaderMultiSearch(C,B,D,A){A.removeEvents();A.addEvent("click",function(){var F=B.value,E=D.value;$try(function(){pageTracker._trackPageview("dp_header_multisearch")});window.location.href=C+(F||"")+(E||"")})}function $HeaderKeywordSearch(D,A,B,E){B.removeEvents();B.addEvent("click",function(){var F=A.value.trim();if(F.length==0||E.contains(F)){alert(E);A.focus()}else{window.location.href=D+F.cnEncode()}return false});var C=function(){if(E.contains(this.value.trim())){this.value="";this.className="Color1"}$(this).removeEvent(C)};A.addEvent("focus",C);A.addEvent("keypress",function(F){if(F.key=="enter"){F.stop();B.fireEvent("click")}})}var pageTracker={_addOrganic:function(A,B){_gaq.push(["_addOrganic",A,B])},_initData:function(){},_trackPageview:function(A){_gaq.push(["_trackPageview",A||""])}};function $peiShow(){var A="";if($pi){A+="城市编号: "+$pi.cid+"\n";A+="城市拼音: "+$pi.cn+"\n";A+="频道编号: "+$pi.nid+"\n";A+="频道拼音: "+$pi.nn+"\n"}if($pei){A+="服务编号: "+$pei.i+"\n";A+="页面时间: "+$pei.w+"\n";A+="数据次数: "+$pei.s+"\n";A+="数据时间: "+$pei.q+"\n";A+="高速对象: \n-------------------------------------------\n"+$pei.c+"-------------------------------------------\n"}alert(A)}function $APShowTracker(A,B){new AjaxReq({url:window.location.protocol+"//"+window.location.host+"/ajax_aptracking.aspx",method:"post",callType:"json",data:{"do":"addtracking",IDs:A,ItemType:B,sc:1},onSuccess:function(C){return false}}).send()}function $APClickTracker(A,B){new AjaxReq({url:window.location.protocol+"//"+window.location.host+"/ajax_aptracking.aspx",method:"post",callType:"json",data:{"do":"addtracking",IDs:A,ItemType:B,cc:1},onSuccess:function(C){return false}}).send()}function $OpenNewWindow(G,C,F,D,A,I,H){var H=20;var B=120;if(window.screen.height){H=(window.screen.height-D)/2}if(window.screen.width){B=(window.screen.width-F)/2}var E=window.open(G,C,"width="+F+",height="+D+",resizable="+(A?"yes":"no")+",scrollbars="+(I?"yes":"no")+",status="+(H?"1":"0")+", top="+H+", left="+B);if(E){E.focus()}return E}var $equals=function(B,A){return(B==A||B.trim()==A.trim()||JSON.encode(B)==JSON.encode(A))};var $isMatch=function(ele,match,matchValue,eleAttr){var value=eleAttr?$(ele).get("value").trim().length:$(ele).get("value").trim();if($type(matchValue)=="string"){return eval('"'+value+'"'+match+'"'+matchValue+'"')}else{return eval(value+match+matchValue)}};$isMatch.extend({IS:"==",NOT_IS:"!=",MORE:">",MORE_IS:">=",LESS:"<",LESS_IS:"<="});var $isRegex=function(B,A,C){return $(B).get("value").trim().test(A,C||"i")};$isRegex.extend({EMAIL:"^[a-z0-9._%-]+@[a-z0-9.-]+\\.[a-z]{2,4}$",URL:"^(http|https|ftp)\\:\\/\\/[a-z0-9\\-\\.]+\\.[a-z]{2,3}(:[a-z0-9]*)?\\/?([a-z0-9\\-\\._\\?\\,\\'\\/\\\\\\+&amp;%\\$#\\=~])*$",MOBILE:"^1\\d{10}$",ZIPCODE:"^\\d{6}$"});function $dialog(E,C,B){var A=[],D=function(F,H){var G=new Element("div",{"class":F});$type(H)==="array"?G.adopt(H):G.set("html",H);return G};E&&A.push(D("DialogTitle",E));C&&A.push(D("DialogContent",C));B&&A.push(D("DialogButtons",B));return new Element("div").adopt(A)}function $isValidBtyes(C,E){var A=0;for(var B=0;B<C.length;B++){var D=C.charCodeAt(B);if((D>=1&&D<=126)||(65376<=D&&D<=65439)){A++}else{A+=2}}if(A>E){return false}return true}function $uploadFlashVars(A){return["movieName=",encodeURIComponent(A.movieName),"&uploadURL=",encodeURIComponent(A.upload_url),"&useQueryString=",encodeURIComponent(A.use_query_string),"&httpSuccess=",encodeURIComponent(A.httpSuccessString),"&params=",encodeURIComponent(A.paramString),"&filePostName=",encodeURIComponent(A.file_post_name),"&fileTypes=",encodeURIComponent(A.file_types),"&fileTypesDescription=",encodeURIComponent(A.file_types_description),"&fileSizeLimit=",encodeURIComponent(A.file_size_limit),"&fileUploadLimit=",encodeURIComponent(A.file_upload_limit),"&fileQueueLimit=",encodeURIComponent(A.file_queue_limit),"&ifdebug=",encodeURIComponent(A.ifdebug),"&successCall=",encodeURIComponent(A.success_call),"&completeCall=",encodeURIComponent(A.complete_call),"&buttonAction=",encodeURIComponent(A.button_action)].join("")}function $getFlashHtml(D,F,C,A,E,B){return['<object id="',D,'" type="application/x-shockwave-flash" data="',F,'" width="',C,'" height="',A,'">','<param name="wmode" value="',E,'" />','<param name="movie" value="',F,'" />','<param name="quality" value="high" />','<param name="menu" value="false" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+B+'" />',"</object>"].join("")}function $getPureText(A){var B=A;B=B.replace(/<br[\s\/]{0,2}>/ig,"\r\n");B=B.replace(/<.*?>/ig,"");B=B.replace(/&nbsp;/ig,"");return B}Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var A=0,B=this.length;if(B){do{A+=this[--B]}while(B)}return A}});Hash.implement({getFromPath:function(A){var B=this.getClean();A.replace(/\[([^\]]+)\]|\.([^.[]+)|[^[.]+/g,function(C){if(!B){return null}var D=arguments[2]||arguments[1]||arguments[0];B=(D in B)?B[D]:null;return C});return B},cleanValues:function(A){A=A||$defined;this.each(function(C,B){if(!A(C)){this.erase(B)}},this);return this},run:function(){var A=arguments;this.each(function(C,B){if($type(C)=="function"){C.run(A)}})}});String.implement({cnEncode:function(){return encodeURIComponent(this)},cnDecode:function(){return decodeURIComponent(this)}});(function(){var C=Element.getComputedStyle;function B(G){return(/^(?:body|html)$/i).test(G.tagName)}function D(G,H){return C(G,H).toInt()||0}function E(G){return C(G,"-moz-box-sizing")=="border-box"}function F(G){return D(G,"border-top-width")}function A(G){return D(G,"border-left-width")}Element.implement({exactOffsets:function(){try{if(this.getBoundingClientRect){var I=this.getBoundingClientRect(),M=document.id(this.getDocument().documentElement),P=M.getScroll(),J=this.getScrolls(),H=this.getScroll(),G=(C(this,"position")=="fixed");return{x:I.left+J.x-H.x+((G)?0:P.x)-M.clientLeft,y:I.top+J.y-H.y+((G)?0:P.y)-M.clientTop}}}catch(N){}var K=this,L={x:0,y:0};if(B(this)){return L}while(K&&!B(K)){L.x+=K.offsetLeft;L.y+=K.offsetTop;if(Browser.Engine.gecko){if(!E(K)){L.x+=A(K);L.y+=F(K)}var O=K.parentNode;if(O&&C(O,"overflow")!="visible"){L.x+=A(O);L.y+=F(O)}}else{if(K!=this&&Browser.Engine.webkit){L.x+=A(K);L.y+=F(K)}}K=K.offsetParent}if(Browser.Engine.gecko&&!E(this)){L.x-=A(this);L.y-=F(this)}return L},exactPosition:function(J){if(B(this)){return{x:0,y:0}}var K=this.exactOffsets(),H=this.getScrolls();var G={x:K.x-H.x,y:K.y-H.y};var I=(J&&(J=document.id(J)))?J.getPosition():{x:0,y:0};return{x:G.x-I.x,y:G.y-I.y}},exactCoordinates:function(I){if(B(this)){return this.getWindow().getCoordinates()}var G=this.exactPosition(I),H=this.getSize();var J={left:G.x,top:G.y,width:H.x,height:H.y};J.right=J.left+J.width;J.bottom=J.top+J.height;return J},appendHTML:function(I,H){if($type(I)!="string"){return false}H=H||"bottom";var G=new Element("div");G.set("html",I);var J=(H=="bottom"||H=="before")?$A(G.childNodes):$A(G.childNodes).reverse();J.each(function(K){if($type(K)=="element"){$(K).inject(this,H)}},this);return this},css:function(G,H){if($type(G)=="object"){for(var I in G){this.css(I,G[I])}return this}this.setStyle(G,H);return this},attr:function(G,H){if($type(G)=="object"){for(var I in G){this.attr(I,G[I])}return this}this.setProperty(G,H);return this},isDisplayed:function(){return this.getStyle("display")!="none"},toggle:function(){return this[this.isDisplayed()?"hide":"show"]()},hide:function(){var H;try{if("none"!=this.getStyle("display")){H=this.getStyle("display")}}catch(G){}return this.store("originalDisplay",H||"block").setStyle("display","none")},show:function(G){return this.setStyle("display",G||this.retrieve("originalDisplay")||"block")},swapClass:function(G,H){return this.removeClass(G).addClass(H)}})})();var npage=new Hash({ids:new Hash(),data:new Hash(),regEvents:function(B){B=B||{domready:$empty,load:$empty,unload:$empty};for(var A in B){if(typeof B[A]=="function"){window.addEvent(A,B[A])}}return this},setEles:function(B,C){if(!B){return }var A,D=arguments.callee;D.extend({v:true,d:[]});B=new Hash(B);if(C){window[C]=this.ids}B.each(function(F,E){if(A=F){this.ids.set(E,A)}else{D.v=false;D.d.push(E)}},this);return D.v},setData:function(B,A){if(!B){return }B=new Hash(B);if(A){window[A]=this.data}B.each(function(D,C){this.data.set(C,D)},this);return this},erase:function(){for(var B=0,A=arguments.length;B<A;B++){try{this[arguments[B]].empty()}catch(C){alert("unexpected param")}}},get:function(A){if(A&&$type(this[A])=="hash"){return this[A].getClean()}}});var $report=function(D,G,C,H){C=C||"";H=H||"";if(G==7){pageTracker._trackPageview("dp_report")}var L=new Element("input",{type:"text",value:C,maxlength:25}).setStyles({width:"200px"});var I=new Element("span");var N=new Element("input",{type:"text",value:H,maxlength:50,size:25}).setStyles({width:"200px"});var B=new Element("span");var F=new Element("textarea",{value:(G==13?"如果您是本店商家，请留下姓名和联系电话，我们将有专人与您核实相关信息。":""),cols:50,rows:8}).setStyles({width:"320px",height:"80px",color:(G==13?"#999999":"#000000")});var K=new Element("div").setStyles({height:"5px"});var J=new Element("input",{type:"button",value:"提交"}).setStyles({cursor:"pointer",width:"60px"});var E=new Element("input",{type:"button",value:"取消"}).setStyles({cursor:"pointer",width:"60px"});var A=new Element("div").setStyles({padding:"10px 15px"});A.appendText("您的姓名: ").adopt([L,I]).appendHTML("<br />").appendText("您的邮件: ").adopt([N,B]).appendHTML('<br /><span style="color:#999999;padding-left:53px;">回复邮件会发送到以上邮箱</span>').appendHTML("<br />").appendText("说 明:").appendHTML("<br />").adopt([F,K]);L.addEvent("blur",function(){if(!$isMatch(L,$isMatch.MORE,0,true)){I.set("text","姓名不能为空").className="fv-err";L.store("valid",false)}else{I.set("text","").className="";L.store("valid",true)}});N.addEvent("blur",function(){if(!$isMatch(N,$isMatch.MORE,0,true)){B.set("text","邮箱不能为空").className="fv-err";N.store("valid",false)}else{if(!$isRegex(N,$isRegex.EMAIL)){B.set("text","邮箱格式不对").className="fv-err";N.store("valid",false)}else{B.set("text","").className="";N.store("valid",true)}}});if(G!=7){F.addEvent("blur",function(){if($(F).value.trim().length<=0||$(F).value.trim().length>1000){K.set("text","内容长度应在1-1000字之间!").className="fv-err";F.store("valid",false)}else{K.set("text","").className="";F.store("valid",true)}})}else{F.store("valid",true)}var M=function(){var O=true;[L,N,F].each(function(P){P.fireEvent("blur");if(!P.retrieve("valid")){O=false}});return O};F.addEvent("click",function(O){if(F.get("value")=="如果您是本店商家，请留下姓名和联系电话，我们将有专人与您核实相关信息。"){F.set("value","");F.erase("style").setStyles({width:"330px",height:"150px"})}});J.addEvent("click",function(P){if(M()){var O=new AjaxReq({url:"/report.v",method:"post",data:{i:D,d:G,n:L.get("value"),e:N.get("value"),c:F.get("value").cnEncode()},onRequest:function(){if(Mbox.isOpen){Mbox.openLite('<p class="Doing">正在发送....</p>',100,30,{closable:0})}},onSuccess:function(Q){if(Q.code==200){if(Mbox.isOpen){Mbox.openLite('<p class="Doing">发送成功，感谢您对我们的支持</p>',200,30,{closable:0})}setTimeout(function(){Mbox.close()},1000)}else{if(Q.code==401&&Q.msg.e){Q.msg.e.each(function(S,R){switch(S){case 1:I.set("text",Q.msg.m[R]).className="fv-err";L.store("valid",false);break;case 2:B.set("text",Q.msg.m[R]).className="fv-err";N.store("valid",false);break;case 3:K.set("text",Q.msg.m[R]).className="fv-err";F.store("valid",false);break}})}}},onError:function(){Mbox.close()}}).send()}});E.addEvent("click",function(){if(Mbox.isOpen){Mbox.close()}});Mbox.open({url:$dialog("举报和报错",[A],[J,E]),size:{x:400,y:320}})};
/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
*/
var swfobject=function(){var d="undefined",R="object",t="Shockwave Flash",x="ShockwaveFlash.ShockwaveFlash",Q="application/x-shockwave-flash",s="SWFObjectExprInst",X="onreadystatechange",p=window,J=document,T=navigator,u=false,v=[H],O=[],o=[],j=[],L,r,e,b,k=false,A=false,N,g,M=true,n=function(){var AB=typeof J.getElementById!=d&&typeof J.getElementsByTagName!=d&&typeof J.createElement!=d,AI=T.userAgent.toLowerCase(),z=T.platform.toLowerCase(),AF=z?/win/.test(z):/win/.test(AI),AD=z?/mac/.test(z):/mac/.test(AI),AG=/webkit/.test(AI)?parseFloat(AI.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,y=!+"\v1",AH=[0,0,0],AC=null;if(typeof T.plugins!=d&&typeof T.plugins[t]==R){AC=T.plugins[t].description;if(AC&&!(typeof T.mimeTypes!=d&&T.mimeTypes[Q]&&!T.mimeTypes[Q].enabledPlugin)){u=true;y=false;AC=AC.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AH[0]=parseInt(AC.replace(/^(.*)\..*$/,"$1"),10);AH[1]=parseInt(AC.replace(/^.*\.(.*)\s.*$/,"$1"),10);AH[2]=/[a-zA-Z]/.test(AC)?parseInt(AC.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof p.ActiveXObject!=d){try{var AE=new ActiveXObject(x);if(AE){AC=AE.GetVariable("$version");if(AC){y=true;AC=AC.split(" ")[1].split(",");AH=[parseInt(AC[0],10),parseInt(AC[1],10),parseInt(AC[2],10)]}}}catch(AA){}}}return{w3:AB,pv:AH,wk:AG,ie:y,win:AF,mac:AD}}(),K=function(){if(!n.w3){return }if((typeof J.readyState!=d&&J.readyState=="complete")||(typeof J.readyState==d&&(J.getElementsByTagName("body")[0]||J.body))){F()}if(!k){if(typeof J.addEventListener!=d){J.addEventListener("DOMContentLoaded",F,false)}if(n.ie&&n.win){J.attachEvent(X,function(){if(J.readyState=="complete"){J.detachEvent(X,arguments.callee);F()}});if(p==top){(function(){if(k){return }try{J.documentElement.doScroll("left")}catch(y){setTimeout(arguments.callee,0);return }F()})()}}if(n.wk){(function(){if(k){return }if(!/loaded|complete/.test(J.readyState)){setTimeout(arguments.callee,0);return }F()})()}S(F)}}();function F(){if(k){return }try{var AA=J.getElementsByTagName("body")[0].appendChild(c("span"));AA.parentNode.removeChild(AA)}catch(AB){return }k=true;var y=v.length;for(var z=0;z<y;z++){v[z]()}}function l(y){if(k){y()}else{v[v.length]=y}}function S(z){if(typeof p.addEventListener!=d){p.addEventListener("load",z,false)}else{if(typeof J.addEventListener!=d){J.addEventListener("load",z,false)}else{if(typeof p.attachEvent!=d){I(p,"onload",z)}else{if(typeof p.onload=="function"){var y=p.onload;p.onload=function(){y();z()}}else{p.onload=z}}}}}function H(){if(u){w()}else{h()}}function w(){var y=J.getElementsByTagName("body")[0];var AB=c(R);AB.setAttribute("type",Q);var AA=y.appendChild(AB);if(AA){var z=0;(function(){if(typeof AA.GetVariable!=d){var AC=AA.GetVariable("$version");if(AC){AC=AC.split(" ")[1].split(",");n.pv=[parseInt(AC[0],10),parseInt(AC[1],10),parseInt(AC[2],10)]}}else{if(z<10){z++;setTimeout(arguments.callee,10);return }}y.removeChild(AB);AA=null;h()})()}else{h()}}function h(){var AH=O.length;if(AH>0){for(var AG=0;AG<AH;AG++){var z=O[AG].id;var AC=O[AG].callbackFn;var AB={success:false,id:z};if(n.pv[0]>0){var AF=C(z);if(AF){if(f(O[AG].swfVersion)&&!(n.wk&&n.wk<312)){W(z,true);if(AC){AB.success=true;AB.ref=Z(z);AC(AB)}}else{if(O[AG].expressInstall&&a()){var AJ={};AJ.data=O[AG].expressInstall;AJ.width=AF.getAttribute("width")||"0";AJ.height=AF.getAttribute("height")||"0";if(AF.getAttribute("class")){AJ.styleclass=AF.getAttribute("class")}if(AF.getAttribute("align")){AJ.align=AF.getAttribute("align")}var AI={};var y=AF.getElementsByTagName("param");var AD=y.length;for(var AE=0;AE<AD;AE++){if(y[AE].getAttribute("name").toLowerCase()!="movie"){AI[y[AE].getAttribute("name")]=y[AE].getAttribute("value")}}q(AJ,AI,z,AC)}else{P(AF);if(AC){AC(AB)}}}}}else{W(z,true);if(AC){var AA=Z(z);if(AA&&typeof AA.SetVariable!=d){AB.success=true;AB.ref=AA}AC(AB)}}}}}function Z(AB){var y=null;var z=C(AB);if(z&&z.nodeName=="OBJECT"){if(typeof z.SetVariable!=d){y=z}else{var AA=z.getElementsByTagName(R)[0];if(AA){y=AA}}}return y}function a(){return !A&&f("6.0.65")&&(n.win||n.mac)&&!(n.wk&&n.wk<312)}function q(AB,AC,y,AA){A=true;e=AA||null;b={success:false,id:y};var AF=C(y);if(AF){if(AF.nodeName=="OBJECT"){L=G(AF);r=null}else{L=AF;r=y}AB.id=s;if(typeof AB.width==d||(!/%$/.test(AB.width)&&parseInt(AB.width,10)<310)){AB.width="310"}if(typeof AB.height==d||(!/%$/.test(AB.height)&&parseInt(AB.height,10)<137)){AB.height="137"}J.title=J.title.slice(0,47)+" - Flash Player Installation";var AE=n.ie&&n.win?"ActiveX":"PlugIn",AD="MMredirectURL="+p.location.toString().replace(/&/g,"%26")+"&MMplayerType="+AE+"&MMdoctitle="+J.title;if(typeof AC.flashvars!=d){AC.flashvars+="&"+AD}else{AC.flashvars=AD}if(n.ie&&n.win&&AF.readyState!=4){var z=c("div");y+="SWFObjectNew";z.setAttribute("id",y);AF.parentNode.insertBefore(z,AF);AF.style.display="none";(function(){if(AF.readyState==4){AF.parentNode.removeChild(AF)}else{setTimeout(arguments.callee,10)}})()}U(AB,AC,y)}}function P(z){if(n.ie&&n.win&&z.readyState!=4){var y=c("div");z.parentNode.insertBefore(y,z);y.parentNode.replaceChild(G(z),y);z.style.display="none";(function(){if(z.readyState==4){z.parentNode.removeChild(z)}else{setTimeout(arguments.callee,10)}})()}else{z.parentNode.replaceChild(G(z),z)}}function G(AC){var AB=c("div");if(n.win&&n.ie){AB.innerHTML=AC.innerHTML}else{var z=AC.getElementsByTagName(R)[0];if(z){var AD=z.childNodes;if(AD){var y=AD.length;for(var AA=0;AA<y;AA++){if(!(AD[AA].nodeType==1&&AD[AA].nodeName=="PARAM")&&!(AD[AA].nodeType==8)){AB.appendChild(AD[AA].cloneNode(true))}}}}}return AB}function U(AJ,AH,z){var y,AB=C(z);if(n.wk&&n.wk<312){return y}if(AB){if(typeof AJ.id==d){AJ.id=z}if(n.ie&&n.win){var AI="";for(var AF in AJ){if(AJ[AF]!=Object.prototype[AF]){if(AF.toLowerCase()=="data"){AH.movie=AJ[AF]}else{if(AF.toLowerCase()=="styleclass"){AI+=' class="'+AJ[AF]+'"'}else{if(AF.toLowerCase()!="classid"){AI+=" "+AF+'="'+AJ[AF]+'"'}}}}}var AG="";for(var AE in AH){if(AH[AE]!=Object.prototype[AE]){AG+='<param name="'+AE+'" value="'+AH[AE]+'" />'}}AB.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AI+">"+AG+"</object>";o[o.length]=AJ.id;y=C(AJ.id)}else{var AA=c(R);AA.setAttribute("type",Q);for(var AD in AJ){if(AJ[AD]!=Object.prototype[AD]){if(AD.toLowerCase()=="styleclass"){AA.setAttribute("class",AJ[AD])}else{if(AD.toLowerCase()!="classid"){AA.setAttribute(AD,AJ[AD])}}}}for(var AC in AH){if(AH[AC]!=Object.prototype[AC]&&AC.toLowerCase()!="movie"){E(AA,AC,AH[AC])}}AB.parentNode.replaceChild(AA,AB);y=AA}}return y}function E(AA,y,z){var AB=c("param");AB.setAttribute("name",y);AB.setAttribute("value",z);AA.appendChild(AB)}function Y(z){var y=C(z);if(y&&y.nodeName=="OBJECT"){if(n.ie&&n.win){y.style.display="none";(function(){if(y.readyState==4){B(z)}else{setTimeout(arguments.callee,10)}})()}else{y.parentNode.removeChild(y)}}}function B(AA){var z=C(AA);if(z){for(var y in z){if(typeof z[y]=="function"){z[y]=null}}z.parentNode.removeChild(z)}}function C(AA){var y=null;try{y=J.getElementById(AA)}catch(z){}return y}function c(y){return J.createElement(y)}function I(AA,y,z){AA.attachEvent(y,z);j[j.length]=[AA,y,z]}function f(AA){var z=n.pv,y=AA.split(".");y[0]=parseInt(y[0],10);y[1]=parseInt(y[1],10)||0;y[2]=parseInt(y[2],10)||0;return(z[0]>y[0]||(z[0]==y[0]&&z[1]>y[1])||(z[0]==y[0]&&z[1]==y[1]&&z[2]>=y[2]))?true:false}function V(AD,z,AE,AC){if(n.ie&&n.mac){return }var AB=J.getElementsByTagName("head")[0];if(!AB){return }var y=(AE&&typeof AE=="string")?AE:"screen";if(AC){N=null;g=null}if(!N||g!=y){var AA=c("style");AA.setAttribute("type","text/css");AA.setAttribute("media",y);N=AB.appendChild(AA);if(n.ie&&n.win&&typeof J.styleSheets!=d&&J.styleSheets.length>0){N=J.styleSheets[J.styleSheets.length-1]}g=y}if(n.ie&&n.win){if(N&&typeof N.addRule==R){N.addRule(AD,z)}}else{if(N&&typeof J.createTextNode!=d){N.appendChild(J.createTextNode(AD+" {"+z+"}"))}}}function W(AA,y){if(!M){return }var z=y?"visible":"hidden";if(k&&C(AA)){C(AA).style.visibility=z}else{V("#"+AA,"visibility:"+z)}}function m(z){var AA=/[\\\"<>\.;]/;var y=AA.exec(z)!=null;return y&&typeof encodeURIComponent!=d?encodeURIComponent(z):z}var D=function(){if(n.ie&&n.win){window.attachEvent("onunload",function(){var AD=j.length;for(var AC=0;AC<AD;AC++){j[AC][0].detachEvent(j[AC][1],j[AC][2])}var AA=o.length;for(var AB=0;AB<AA;AB++){Y(o[AB])}for(var z in n){n[z]=null}n=null;for(var y in swfobject){swfobject[y]=null}swfobject=null})}}();return{registerObject:function(AC,y,AB,AA){if(n.w3&&AC&&y){var z={};z.id=AC;z.swfVersion=y;z.expressInstall=AB;z.callbackFn=AA;O[O.length]=z;W(AC,false)}else{if(AA){AA({success:false,id:AC})}}},getObjectById:function(y){if(n.w3){return Z(y)}},embedSWF:function(AC,AI,AF,AH,z,AB,AA,AE,AG,AD){var y={success:false,id:AI};if(n.w3&&!(n.wk&&n.wk<312)&&AC&&AI&&AF&&AH&&z){W(AI,false);l(function(){AF+="";AH+="";var AK={};if(AG&&typeof AG===R){for(var AM in AG){AK[AM]=AG[AM]}}AK.data=AC;AK.width=AF;AK.height=AH;var AN={};if(AE&&typeof AE===R){for(var AL in AE){AN[AL]=AE[AL]}}if(AA&&typeof AA===R){for(var AJ in AA){if(typeof AN.flashvars!=d){AN.flashvars+="&"+AJ+"="+AA[AJ]}else{AN.flashvars=AJ+"="+AA[AJ]}}}if(f(z)){var AO=U(AK,AN,AI);if(AK.id==AI){W(AI,true)}y.success=true;y.ref=AO}else{if(AB&&a()){AK.data=AB;q(AK,AN,AI,AD);return }else{W(AI,true)}}if(AD){AD(y)}})}else{if(AD){AD(y)}}},switchOffAutoHideShow:function(){M=false},ua:n,getFlashPlayerVersion:function(){return{major:n.pv[0],minor:n.pv[1],release:n.pv[2]}},hasFlashPlayerVersion:f,createSWF:function(AA,z,y){if(n.w3){return U(AA,z,y)}else{return undefined}},showExpressInstall:function(AA,AB,y,z){if(n.w3&&a()){q(AA,AB,y,z)}},removeSWF:function(y){if(n.w3){Y(y)}},createCSS:function(AB,AA,z,y){if(n.w3){V(AB,AA,z,y)}},addDomLoadEvent:l,addLoadEvent:S,getQueryParamValue:function(AB){var AA=J.location.search||J.location.hash;if(AA){if(/\?/.test(AA)){AA=AA.split("?")[1]}if(AB==null){return m(AA)}var z=AA.split("&");for(var y=0;y<z.length;y++){if(z[y].substring(0,z[y].indexOf("="))==AB){return m(z[y].substring((z[y].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A){var y=C(s);if(y&&L){y.parentNode.replaceChild(L,y);if(r){W(r,true);if(n.ie&&n.win){L.style.display="block"}}if(e){e(b)}}A=false}}}}();var AjaxReq=new Class({Implements:[Options,Events],options:{url:null,method:"get",data:null,headers:{},async:true,evalScripts:true,secure:false,update:false,callType:"json",timeOut:30000,onRequest:$empty,onSuccess:$empty,onError:$empty},initialize:function(B){this.setOptions(B);var A={url:this.options.url,method:this.options.method,data:this.options.data,headers:this.options.headers,async:this.options.async,evalScripts:this.options.evalScripts,secure:this.options.secure,update:this.options.update};A.onRequest=this.request.bind(this);A.onSuccess=this.success.bind(this);A.onFailure=A.onException=A.onCancel=this.error.bind(this);switch(this.options.callType){case"html":this.ajax=new Request.HTML(A);break;case"json":this.ajax=new Request.JSON(A);Object.append(this.ajax.headers,{Accept:"application/json, */*"});break}return this},error:function(){if(this.options.timeOut){$clear(this.options.timeOut)}this.fireEvent("error");return this},success:function(B,A,D,C){if(this.options.timeOut){$clear(this.options.timeOut)}if(this.options.callType=="html"){if(this.$events.success){this.fireEvent("success",[B,A,D,C])}}else{if(this.$events.success){this.fireEvent("success",[B,A])}}return this},request:function(){this.fireEvent("request");return this},send:function(A){this.options.timeOut=setTimeout(function(){this.ajax.cancel()}.bind(this),this.options.timeOut);this.ajax.send(A)}});var IframeShim=new Class({Implements:[Options,Events],options:{name:"",className:"iframeShim",display:false,zIndex:null,margin:0,offset:{x:0,y:0},browsers:(Browser.Engine.trident4||(Browser.Engine.gecko&&!Browser.Engine.gecko19&&Browser.Platform.mac)),onInject:$empty},initialize:function(B,A){this.setOptions(A);if(this.options.offset&&this.options.offset.top){this.options.offset.y=this.options.offset.top}if(this.options.offset&&this.options.offset.left){this.options.offset.x=this.options.offset.left}this.element=$(B);this.makeShim();return },makeShim:function(){this.shim=new Element("iframe");this.id=this.options.name||new Date().getTime()+"_shim";if(this.element.getStyle("z-Index").toInt()<1||isNaN(this.element.getStyle("z-Index").toInt())){this.element.setStyle("z-Index",999)}var B=this.element.getStyle("z-Index")-1;if($chk(this.options.zIndex)&&this.element.getStyle("z-Index").toInt()>this.options.zIndex){B=this.options.zIndex}this.shim.setStyles({position:"absolute",zIndex:B,border:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"}).setProperties({src:"javascript:void(0);",frameborder:"0",scrolling:"no",id:this.id}).addClass(this.options.className);this.element.store("shim",this);var A=function(){this.shim.inject(document.body);if(this.options.display){this.show()}else{this.hide()}this.fireEvent("inject")};if(this.options.browsers){if(Browser.Engine.trident&&!IframeShim.ready){window.addEvent("load",A.bind(this))}else{A.run(null,this)}}},position:function(C){if(!this.options.browsers||!IframeShim.ready){return this}if(C){this.shim.setStyles({width:C.width,height:C.height,top:C.top,left:C.left})}else{var B=this.element.getStyles("display","visibility","position");this.element.setStyles({display:"block",position:"absolute",visibility:"hidden"});var A=this.element.getSize();var D=this.element.getPosition();this.element.setStyles(B);if($type(this.options.margin)){A.x=A.x-(this.options.margin*2);A.y=A.y-(this.options.margin*2);this.options.offset.x+=this.options.margin;this.options.offset.y+=this.options.margin}this.shim.setStyles({width:A.x,height:A.y,top:D.y,left:D.x})}return this},hide:function(){if(this.options.browsers){this.shim.setStyle("display","none")}return this},show:function(A){if(!this.options.browsers){return this}this.shim.setStyle("display","block");return this.position(A)},dispose:function(){if(this.options.browsers){this.shim.dispose()}return this}});window.addEvent("load",function(){IframeShim.ready=true});var Overlay=new Class({Implements:[Options,Events],getOptions:function(){return{useFx:false,name:"",duration:200,colour:"#000",opacity:0.2,zIndex:1001,hasShim:true,container:document.body,onClick:$empty}},initialize:function(A){this.setOptions(this.getOptions(),A);this.element=$(this.options.container);this.container=new Element("div").setProperty("id",this.options.name+"_overlay").setStyles({position:"absolute",left:"0",top:"0",width:"100%",height:"100%",backgroundColor:this.options.colour,zIndex:this.options.zIndex,opacity:this.options.opacity}).inject(document.body);if(this.options.hasShim){this.shim=new IframeShim(this.container)}this.options.useFx?this.fade=new Fx.Tween(this.container,{property:"opacity",duration:this.options.duration}).set(0):this.fade=null;this.container.setStyle("display","none");this.container.addEvent("click",function(){this.fireEvent("click")}.bind(this));window.addEvent("resize",this.position.bind(this));return this},position:function(B){if(this.element==document.body){var A=window.getScrollHeight()+"px";this.container.setStyles({top:"0px",height:A});return }if(B){this.container.setStyles({width:B.width,height:B.height,top:B.top,left:B.left})}else{var C=this.element.getCoordinates();this.container.setStyles({top:C.top,height:C.height,left:C.left,width:C.width})}},show:function(A){this.container.setStyle("display","");if(this.fade){this.fade.cancel().start(this.options.opacity)}if(this.shim){this.shim.element=this.element;this.shim.show(A)}return this.position(A)},hide:function(A){if(this.fade){this.fade.cancel().start(0)}this.container.setStyle("display","none");if(this.shim){this.shim.hide()}if(A){this.dispose()}return this},dispose:function(){this.container.dispose();if(this.shim){this.shim.dispose()}}});var PopupPanel=new Class({Implements:[Options,Events],options:{mode:"single",trigger:"mouseover",type:"cling-left",adjust:{x:20,y:20},useFx:false,effect:{property:"opacity"},zIndex:1000,hasShim:true,onPreshow:$empty,onShow:$empty,onHide:$empty,needPosition:true},initialize:function(C,A,B){A=$(A);if(!A){return }B=B||{};if(B.triger){B.trigger=B.triger;delete B.triger}this.setOptions(B);this.trigger=(this.options.mode=="single"?$(C):$$(C));var D={position:"absolute",visibility:"hidden",zIndex:this.options.zIndex};this.panel=A.setStyles(D).inject($(document.body));if(this.options.hasShim){this.shim=new IframeShim(this.panel)}this.display=false;if(this.options.useFx){this.fx=new Fx.Tween(this.panel,this.options.effect);this.fx.set(0)}if(this.options.mode=="single"){if(this.options.trigger=="click"){this.trigger.addEvents({click:function(E){E&&E.stop();this.display?this.hide():this.show()}.bind(this)});document.addEvent("click",function(E){if(E&&this.display===true&&E.target!==this.panel){this.hide()}}.bind(this))}else{this.trigger.addEvents({mouseenter:this.show.bind(this),mouseleave:this.hide.bind(this)});this.panel.addEvents({mouseenter:this.show.bind(this),mouseleave:this.hide.bind(this)})}}else{this.currentTrigger=this.trigger[0];this.trigger.each(function(E){E.addEvent(this.options.trigger,function(){this.currentTrigger=E;this.show()}.bind(this))}.bind(this))}window.addEvent("resize",this.position.bind(this));this.position();return this},setPanel:function(A){if($type(A)=="array"){this.panel.empty().adopt(A)}else{this.panel.set("html",A)}},show:function(){this.fireEvent("onPreshow");this.display=true;if(this.fx){this.fx.cancel().start(1)}else{this.panel.setStyle("visibility","visible")}if(this.shim){this.shim.show()}this.fireEvent("onShow");return this.position()},hide:function(){this.display=false;if(this.fx){this.fx.cancel().start(0)}else{this.panel.setStyle("visibility","hidden")}if(this.shim){this.shim.hide()}this.fireEvent("onHide");return this},position:function(){if(this.options.needPosition){this.triggerCoo=(this.options.mode=="single"?this.trigger.exactCoordinates():this.currentTrigger.exactCoordinates());this.panelCoo={top:this.triggerCoo.bottom-2+"px"};switch(this.options.type){case"side-right":$extend(this.panelCoo,{left:this.triggerCoo.right-2+"px",top:this.triggerCoo.top+"px"});break;case"side-left":$extend(this.panelCoo,{right:window.getWidth().toInt()-this.triggerCoo.left-2+"px",top:this.triggerCoo.top+"px"});break;case"cling-right":$extend(this.panelCoo,{right:window.getWidth().toInt()-this.triggerCoo.right+"px"});break;case"cling-left":$extend(this.panelCoo,{left:this.triggerCoo.left+"px"});break;default:$extend(this.panelCoo,{left:this.triggerCoo.left+this.options.adjust.x+"px",top:this.triggerCoo.top+this.options.adjust.y+"px"})}this.panel.setStyles(this.panelCoo);if(this.shim){this.shim.position()}}return this}});var Tip=new Class({Implements:[Options,Events],options:{tipClass:null,adjust:{x:20,y:20},useFx:false,effect:{property:"opacity"},zIndex:999,fn:null,onShow:$empty,onHide:$empty,tip:null},initialize:function(B,A){this.setOptions(A);this.build();if(this.options.useFx){this.fx=new Fx.Tween(this.frame,this.options.effect);this.fx.set(0)}this.content=$$("."+B);this.content.each(function(D){var C=D;D.addEvent("mouseover",function(E){this.show(E);if(this.options.fn){this.options.fn.call(this,C)}else{this.getContent(C)}}.bind(this));D.addEvent("mouseout",function(E){this.hide(E)}.bind(this));D.addEvent("mousemove",function(E){this.locate(E)}.bind(this))}.bind(this))},build:function(){this.frame=new Element("div").setProperty("id","tipFrame").setStyles({visibility:"hidden",position:"absolute","z-index":this.options.zIndex});this.container=new Element("div").setProperty("id","tipContent").addClass(this.options.tipClass).inject(this.frame);this.frame.inject($(document.body))},getContent:function(A){this.container.set("html","<p>"+(this.options.tip||A.getProperty("tip"))+"</p>")},locate:function(A){A=new Event(A);var B={x:A.page.x,y:A.page.y};this.frame.setStyles({top:B.y+this.options.adjust.y,left:B.x+this.options.adjust.x})},show:function(A){(this.fx)?this.fx.cancel().start(1):this.frame.setStyle("visibility","visible");this.locate(A);this.fireEvent("show")},hide:function(){(this.fx)?this.fx.cancel().start(0):this.frame.setStyle("visibility","hidden");this.fireEvent("hide")}});var Prompt=new Class({Implements:[Options,Events],getOptions:function(){return{name:"dp",zIndex:2002,container:document.body,overlay:false,hasShim:true,closable:true,titleClass:"DialogTitle",contClass:"DialogContent",btnClass:"DialogButtons",deftitle:"友情提示",initProperty:{btnOk:"确定",btnCancel:"取消",boxStyle:null,inputStyle:{display:"block",margin:"0 auto 10px",width:"150px"},btnStyle:{"margin-right":"20px",width:"60px"},promptValue:"",overlay:true,closable:true,onClose:null,onReturn:null},fn:$empty,onReturn:function(A){this.options.fn.call(this,this.value,A)}.bind(this)}},initialize:function(A){if(Prompt._instance){return Prompt._instance}Prompt._instance=this;this.setOptions(this.getOptions(),A);this.build();this.display=0;document.addEvent("keyup",function(B){if(B.key=="esc"){this.value=false;this.hide()}}.bind(this));window.addEvents({resize:this.position.bind(this),scroll:this.position.bind(this)});return this},build:function(){if(this.options.overlay&&!this.overlay){this.overlay=new Overlay({name:"prompt",container:this.options.container,hasShim:this.options.hasShim})}this.control=new Element("div",{id:this.options.name+"-control","class":this.options.btnClass});this.InBox=new Element("div",{id:this.options.name+"-InBox","class":this.options.contClass});this.title=new Element("p",{id:this.options.name+"-title","class":this.options.titleClass});this.closehandle=new Element("a",{id:this.options.name+"-closehandle",href:"javascript:void(0)"}).addEvent("click",function(){this.value=false;this.hide()}.bind(this));this.Box=new Element("div",{id:this.options.name+"-Box",styles:{width:"300px",display:"none","z-index":this.options.zIndex,position:"absolute",top:"0",left:"0"}}).adopt([this.title,this.InBox,this.control,this.closehandle||null]);this.Box.inject(this.options.container)},alert:function(B,A){this.messageBox("alert",B,A)},confirm:function(B,A){this.messageBox("confirm",B,A)},prompt:function(B,A){this.messageBox("prompt",B,A)},position:function(){if(this.display==1){var B=document.getSize(),A=document.getScroll();this.Box.setStyles({left:(A.x+(B.x-this.Box.getStyle("width").toInt())/2).toInt(),top:(A.y+(B.y-this.Box.offsetHeight)/2).toInt()})}return this},show:function(A,B){if(this.display==0){this.display=1;if(this.overlay&&B.overlay){this.overlay.show()}(B.closable&&this.closehandle)?this.closehandle.setStyle("display",""):this.closehandle.setStyle("display","none");if(B.boxStyle){this.Box.setStyles(B.boxStyle)}this.Box.setStyle("display","block");this.position();A.focus();return this}},hide:function(A){var B=true;if(A&&A.onClose){B=A.onClose.call(this);if(!B){return false}}if(this.display==1){this.display=0;if(this.overlay){this.overlay.hide()}this.Box.setStyles({display:"none",top:0});this.fireEvent("onReturn",[this.overlay||null]);return this}},dispose:function(){this.Box.dispose();if(this.overlay){this.overlay.dispose()}return this},messageBox:function(B,C,A){A=$merge(this.options.initProperty,A||{});if(A.overlay&&!this.overlay){this.overlay=new Overlay({name:"prompt",container:this.options.container,hasShim:this.options.hasShim})}A.onReturn?this.options.fn=A.onReturn:this.options.fn=$empty;if($type(C)!="array"){C=[this.options.deftitle,C]}if(B=="alert"){this.AlertBtnOk=new Element("input",{id:"alertOk",type:"submit",value:A.btnOk,styles:A.btnStyle});this.AlertBtnOk.addEvent("click",function(){this.value=true;this.hide(A)}.bind(this));this.title.set("html",C[0]);this.InBox.set("html",C[1]);this.control.empty().grab(this.AlertBtnOk);this.show(this.AlertBtnOk,A)}else{if(B=="confirm"){this.ConfirmBtnOk=new Element("input",{id:"confirmOk",type:"submit",value:A.btnOk,styles:A.btnStyle});this.ConfirmBtnCancel=new Element("input",{id:"confirmCancel",type:"submit",value:A.btnCancel,styles:A.btnStyle});this.ConfirmBtnOk.addEvent("click",function(){this.value=true;this.hide(A)}.bind(this));this.ConfirmBtnCancel.addEvent("click",function(){this.value=false;this.hide()}.bind(this));this.title.set("html",C[0]);this.InBox.set("html",C[1]);this.control.empty().adopt([this.ConfirmBtnOk,this.ConfirmBtnCancel]);this.show(this.ConfirmBtnOk,A)}else{if(B=="prompt"){this.PromptBtnOk=new Element("input",{id:"promptOk",type:"submit",value:A.btnOk,styles:A.btnStyle});this.PromptBtnCancel=new Element("input",{id:"promptCancel",type:"submit",value:A.btnCancel,styles:A.btnStyle});this.PromptInput=new Element("input",{id:"promptInput",type:"text",value:A.promptValue,styles:A.inputStyle});this.PromptBtnOk.addEvent("click",function(){this.value=this.PromptInput.value;this.hide(A)}.bind(this));this.PromptBtnCancel.addEvent("click",function(){this.value=false;this.hide()}.bind(this));this.title.set("html",C[0]);this.InBox.set("html",C[1]);this.control.empty().adopt([this.PromptInput,this.PromptBtnOk,this.PromptBtnCancel]);this.show(this.PromptBtnOk,A)}else{this.value=false;this.hide()}}}}});var Mbox={presets:{sizeLoading:{x:180,y:30},sizeDefault:{x:600,y:450},marginInner:{x:20,y:20},marginImage:{x:50,y:75},size:null,type:"ele",url:false,winId:"mbox-window",contId:"mbox-content",closeId:"mbox-btn-close",overlay:false,hasShim:true,overlayClosable:false,autoSize:false,reposition:false,closable:false,container:null,zIndex:2002,useFx:false,resizeFx:{},contentFx:{},parse:"rel",parseSecure:false,ajaxOptions:{},onLoading:$empty,onOpen:$empty,onShow:$empty,onClosing:$empty,onClose:$empty},initialize:function(A){if(this.options){return this}this.options={};this.setOptions(this.presets,A||{}).build();this.bound={window:this.reposition.bind(this,[null]),scroll:this.checkTarget.bind(this),close:this.close.bind(this),key:this.onKey.bind(this)};this.isOpen=this.isLoading=false;return this},build:function(){this.overlay=new Overlay({name:"mbox",hasShim:this.options.hasShim,onClick:(this.options.overlayClosable)?this.close.bind(this):null});this.closeBtn=new Element("a",{id:this.options.closeId,href:"#"});this.content=new Element("div",{id:this.options.contId,styles:{visibility:"hidden"}});this.win=new Element("div",{id:this.options.winId,styles:{display:"none",zIndex:this.options.zIndex+2}}).adopt(this.closeBtn,this.content);if(this.options.useFx){this.fx={win:new Fx.Morph(this.win,$merge({unit:"px",duration:750,transition:Fx.Transitions.Quint.easeOut,link:"cancel",unit:"px"},this.options.resizeFx)),content:new Fx.Tween(this.content,$merge({property:"opacity",duration:250,link:"cancel"},this.options.contentFx))}}$(document.body).adopt(this.win)},assign:function(B,A){B.addEvent("click",function(C){new Event(C).stop();Mbox.open(A,this)})},open:function(A,C){if(!A){return false}this.initialize(A);if(C){this.element=$(C)}this.setOptions($merge({overlay:true,closable:true,reposition:true,container:document.body},A));if(this.element&&this.options.parse){var B=this.element.getProperty(this.options.parse);if(B&&(B=JSON.decode(B,this.options.parseSecure))){this.setOptions(B)}}if(!this.isOpen){this.isOpen=true;(this.options.closable)?this.closeBtn.setStyle("display",""):this.closeBtn.setStyle("display","none");if(this.overlay&&this.options.overlay){this.overlay.element=this.options.container;this.overlay.show()}this.toggleListeners(true);this.toggleLoading(true);this.fireEvent("onOpen",[this.content]);this.resize(true);this.load()}return this},openLite:function(D,C,A,B){this.initialize(B);this.setOptions($merge({overlay:true,closable:false,reposition:true,container:document.body},B));if(D){C=C||180;A=A||30;(this.options.closable)?this.closeBtn.setStyle("display",""):this.closeBtn.setStyle("display","none");$type(D)=="string"?this.content.set("html",D):this.content.empty().adopt(D);this.win.setStyles({width:(C+"px"),height:(A=="auto")?A:(A+"px")})}if(!this.isOpen){this.isOpen=true;(this.options.closable)?this.closeBtn.setStyle("display",""):this.closeBtn.setStyle("display","none");if(this.overlay&&this.options.overlay){this.overlay.element=this.options.container;this.overlay.show()}this.toggleListeners(true);this.win.setStyle("display","");(this.fx)?this.fx.content.cancel().start(1):this.content.setStyle("visibility","visible")}return this.reposition(true)},hide:function(){if(this.isOpen){this.isOpen=false;if(this.overlay&&this.options.overlay){this.overlay.hide()}this.win.setStyle("display","none");(this.fx)?this.fx.content.cancel().start(0):this.content.setStyle("visibility","hidden");this.trash()}return this},close:function(A){if($type(A)=="event"){new Event(A).stop()}if(!this.isOpen){return this}this.fireEvent("onClosing",[this.content]);this.isOpen=false;if(this.overlay&&this.options.overlay){this.overlay.hide()}this.hideContent();this.win.setStyle("display","none");this.fireEvent("onClose",[this.content]);this.trash();return this},trash:function(){if(this.element){this.element=null}this.asset=null;this.options={};this.setOptions(this.presets);this.toggleListeners();this.removeEvents()},load:function(){this.getContent();if(this.options.autoSize){switch(this.type){case"image":new Asset.image(this.asset.url,{onload:function(E){var D=document.getSize(),C;D.x-=this.options.marginImage.x;D.y-=this.options.marginImage.y;C={x:E.width,y:E.height};for(var B=2;B--;){if(C.x>D.x){C.y*=D.x/C.x;C.x=D.x}else{if(C.y>D.y){C.x*=D.y/C.y;C.y=D.y}}}C.x=C.x.toInt();C.y=C.y.toInt();this.asset.url=E.setProperties({width:C.x,height:C.y});this.asset.size=C;this.resize()}.bind(this)});break;case"iframe":var A={src:this.asset.url};A.onload=function(C){var B=C.getScrollSize();this.asset.size={x:B.x,y:B.y};this.resize()}.bind(this);new IFrame(A).inject(this.content);break;case"string":case"ajax":this.handlers[this.type].call(this);this.asset.size=this.content.getScrollSize();this.resize();break;case"swf":case"ele":this.resize();break}}else{this.resize()}},onError:function(){this.asset=null;this.content.set("text","Error during loading")},getContent:function(){this.asset={};this.asset.size=this.options.size||this.options.sizeDefault;if(this.options.type){this.type=this.options.type;this.asset.url=this.options.url}else{this.asset.url=this.element.getProperty("href");this.parsers.some(function(C,A){var B=C.call(this);if(B){this.type=A;this.asset.url=B;return true}return false},this)}this.content.className=this.options.contId+"-"+this.type;return this},resize:function(E){var B=document.getSize(),A=document.getScroll();this.size=E?this.options.sizeLoading:this.asset.size;var D=(A.x+(B.x-this.size.x-this.options.marginInner.x)/2).toInt(),C=(A.y+(B.y-this.size.y-this.options.marginInner.y)/2).toInt();var F={width:this.size.x,height:this.size.y,left:(D>=0)?D:0,top:(C>=0)?C:20};if(E){this.content.empty().setStyle("visibility","hidden");this.win.setStyles(F).setStyle("display","")}else{if(this.fx){this.fx.win.cancel().start(F).chain(function(){this.applyContent()}.bind(this))}else{this.win.setStyles(F);this.applyContent()}}return this.reposition(true)},reposition:function(D){if(!D&&!this.options.reposition){return this}var B;this.options.container==document.body?B=document:B=this.options.container;var C=B.getSize(),A=B.getScroll(),F=B.getPosition(),E=this.win.offsetHeight<C.y;this.win.setStyles({left:((B==document?A.x:F.x)+(C.x-this.win.offsetWidth)/2).toInt()+"px",top:(E)?((B==document?A.y:F.y)+(C.y-this.win.offsetHeight)/2).toInt()+"px":(A.y+100).toInt()+"px"});window[E?"addEvent":"removeEvent"]("scroll",this.bound.window);return this},applyContent:function(){if(this.isLoading){this.toggleLoading(false)}this.content.empty();this.handlers[this.type].call(this);this.showContent();return this},toggleListeners:function(B){var A=(B)?"addEvent":"removeEvent";this.closeBtn[A]("click",this.bound.close);document[A]("keydown",this.bound.key);window[A]("resize",this.bound.window)[A]("scroll",this.bound.window)},toggleLoading:function(A){this.isLoading=A;this.win[(A)?"addClass":"removeClass"]("mbox-loading");if(A){this.fireEvent("onLoading",[this.win])}},showContent:function(){(this.fx)?this.fx.content.cancel().start(1):this.content.setStyle("visibility","visible");this.fireEvent("onShow",[this.win])},hideContent:function(){if(this.fx){this.fx.content.cancel().start(0).chain(function(){this.content.empty()}.bind(this))}else{this.content.setStyle("visibility","hidden");this.content.empty()}},onKey:function(A){switch(A.key){case"esc":if(this.options.closable){this.close(A)}case"up":case"down":return false}},checkTarget:function(A){return this.content.hasChild(A.target)},removeEvents:function(A){if(!this.$events){return this}if(!A){this.$events=null}else{if(this.$events[A]){this.$events[A]=null}}return this},extend:function(A){return $extend(this,A)},handlers:new Hash(),parsers:new Hash()};Mbox.extend(new Events).extend(new Options);Mbox.parsers.extend({image:function(A){return(A||(/\.(?:jpg|png|gif|bmp)$/i).test(this.asset.url))?this.asset.url:false},swf:function(A){return(A||this.asset.url.test(/\.swf/)||true)?this.asset.url:false}});Mbox.handlers.extend({image:function(){this.content.adopt(typeof this.asset.url=="string"?new Element("img",{src:this.asset.url}):this.asset.url)},swf:function(){var A=new Swiff(this.asset.url,{id:"mbox-swf",width:this.asset.size.x,height:this.asset.size.y});this.content.adopt(A)},string:function(){this.content.set("html",this.asset.url)},ele:function(){this.content.grab($(this.asset.url))},ajax:function(){new Request.HTML($merge({method:"get",update:this.content},this.options.ajaxOptions)).addEvents({onFailure:this.onError.bind(this)}).send({url:this.asset.url})},iframe:function(){var A=new Element("iframe",{src:this.asset.url,frameBorder:0,width:this.asset.size.x,height:this.asset.size.y});this.content.adopt(A)}});var Mtab=new Class({initialize:function(B,A){this.options=$merge({tabClass:{width:"500px",height:"250px"},useFx:{transition:Fx.Transitions.Bounce.easeOut,property:"height"},activeClass:"active",titleClass:"mtabTitle",panelClass:"mtabPanel",show:0,event:"click",useAjax:false,ajaxOptions:{method:"get",url:""},ajaxCache:{},ajaxLoadingText:"Loading..."},A||{});this.el=$(B);this.elid=B;this.el.setStyles(this.options.tabClass);this.ajaxCache=new Hash(this.options.ajaxCache);this.titles=this.el.getElements("."+this.options.titleClass+" li");this.panels=this.el.getElements("."+this.options.panelClass);this.titles.each(function(C){C.addEvent(this.options.event,function(D){D.stop();if(C!=this.activeTitle){this.activate(C)}}.bind(this))}.bind(this));if(this.options.show!="none"){this.activate(this.titles[this.options.show])}},activate:function(A){if($type(A)=="string"){myTab=this.el.getElements("."+this.options.titleClass+" li").filter("[data="+A+"]")[0];A=myTab}if($type(A)=="element"){var C=A.getProperty("data");this.panels.removeClass(this.options.activeClass);this.activePanel=this.panels.filter("#"+C)[0];this.activePanel.addClass(this.options.activeClass);if(this.options.useFx){var B=new Fx.Tween(this.activePanel,$merge({duration:1000},this.options.useFx));B.start(20,this.activePanel.getSize().y)}this.titles.removeClass(this.options.activeClass);this.activeTitle=A;A.addClass(this.options.activeClass);if(this.options.useAjax){this._getContent()}}},_getContent:function(){var B=this.activeTitle.getProperty("data");var A=this.activePanel;this.activePanel.set("html",this.options.ajaxLoadingText);if(this.ajaxCache.has(B)){A.set("html",this.ajaxCache.get(B));return false}this.ajaxOptions=$merge(this.options.ajaxOptions,{update:A,url:this.options.ajaxOptions.url+"?tab="+B,onComplete:function(E,D,G,F){this.ajaxCache.set(B,G)}.bind(this)});var C=new Request.HTML(this.ajaxOptions).send()},add:function(D,B,C){var E=new Element("li",{data:D});E.appendText(B);this.titles.include(E);this.el.getElements("."+this.options.titleClass).adopt(E);E.addEvent("click",function(){if(E!=this.activeTitle){this.activate(E)}}.bind(this));var A=new Element("div",{id:D,"class":this.options.panelClass});if(!this.options.useAjax){A.set("html",C)}this.panels.include(A);this.el.adopt(A)},remove:function(A){if(this.activeTitle.getProperty("data")==A){this.activate(this.titles[0])}this.el.getElements("."+this.options.titleClass+" li").filter("[data="+A+"]")[0].dispose();this.el.getElements("."+this.options.panelClass).filter("#"+A)[0].dispose()},next:function(){var A=this.activeTitle.getNext();if(!A){A=this.titles[0]}this.activate(A)},previous:function(){var A=this.activeTitle.getPrevious();if(!A){A=this.titles[this.titles.length-1]}this.activate(A)}});var Calendar=new Class({Implements:[Options,Events],options:{initDate:new Date(),monthText:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],weekText:["日","一","二","三","四","五","六"],range:[new Date(1949,0,1),new Date(2015,0,1)],display:true,hasShim:false,posEle:null,onSelect:$empty},initialize:function(B,A){this.setOptions(A);this.container=$(B);if(this.options.hasShim){this.shim=new IframeShim(this.container)}this.initDate=this.options.initDate;this.init(this.container,this.initDate);this.display=this.options.display;(this.display)?this.show():this.hide()},init:function(A,D){A.set("html","");var I=this.MonthInfo(D.getFullYear(),D.getMonth());A.addClass("mcalendar");var C=[];C.push("<li class='mcalendar_logo'></li>");C.push("<li class='mcalendar_year'><a href='#' cal='year' year='"+D.getFullYear()+"'>"+D.getFullYear()+"年</a></li>");C.push("<li class='mcalendar_month'><a href='#' cal='month' month='"+D.getMonth()+"'>"+this.options.monthText[D.getMonth()]+"</a></li>");var K=new Element("ul").set("html",C.join(""));var M=[];M.push("<li><a href='#' cal='preyear' title='preyear'> << </a></li>");M.push("<li><a href='#' cal='preweek' title='preweek'> < </a></li>");M.push("<li class='mcalendar_today'><a href='#' cal='today'>今天</a></li>");M.push("<li><a href='#' cal='nextweek' title='nextweek'> > </a></li>");M.push("<li><a href='#' cal='nextyear' title='nextyear'> >> </a></li>");var L=new Element("ul").set("html",M.join(""));var G=[];for(i=0;i<7;i++){G.push("<li class='mcalendar_week'>"+this.options.weekText[i]+"</li>")}var B=new Element("ul").set("html",G.join(""));A.adopt(K,L,B);for(i=0;i<6;i++){var N=new Element("ul");for(var E=0;E<7;E++){var J=7*i-I.firstDay+E+1;var F=J==D.getDate()?"class='mcalendar_selected'":"";if(J>0&&J<=I.days){var H=new Date(D.getFullYear(),D.getMonth(),J);if(H>=this.options.range[0]&&H<=this.options.range[1]){N.grab(new Element("li").set("html","<a href='#' "+F+" year='"+D.getFullYear()+"' month='"+D.getMonth()+"' date='"+J+"'>"+J+"</a>"))}else{N.grab(new Element("li").addClass("mcalendar_outrange").set("html",J))}}else{N.grab(new Element("li").addClass("mcalendar_invalid").set("html","&nbsp;"))}}A.adopt(N)}A.getElements("a").addEvent("focus",function(){this.blur()});A.getElements("a").addEvent("click",function(T){var O=new Event(T).target;if($(O).getProperty("cal")=="today"){this.init(A,new Date());this.fireEvent("select",[new Date()])}else{if($(O).getProperty("cal")=="preyear"){D.setFullYear(D.getFullYear()-1);this.init(A,D)}else{if($(O).getProperty("cal")=="nextyear"){D.setFullYear(D.getFullYear()+1);this.init(A,D)}else{if($(O).getProperty("cal")=="preweek"){D.setMonth(D.getMonth()-1);this.init(A,D)}else{if($(O).getProperty("cal")=="nextweek"){D.setMonth(D.getMonth()+1);this.init(A,D)}else{if($(O).getProperty("cal")=="year"){var S=new Element("select").setStyle("width","60px");var R=$(O).getProperty("year");for(var P=this.options.range[0].getFullYear();P<=this.options.range[1].getFullYear();P++){S.grab(new Element("option").setProperty("value",P).set("html",P))}S.addEvent("change",function(V){var U=new Event(V).target;D.setFullYear(U.value);this.init(A,D)}.bind(this));S.setProperty("value",R);S.replaces($(O))}else{if($(O).getProperty("cal")=="month"){var Q=new Element("select").setStyle("width","60px");var R=$(O).getProperty("month");for(P=0;P<12;P++){Q.grab(new Element("option").setProperty("value",P).set("html",this.options.monthText[P]))}Q.addEvent("change",function(V){var U=new Event(V).target;D.setMonth(U.value);this.init(A,D)}.bind(this));Q.setProperty("value",R);Q.replaces($(O))}else{A.getElement(".mcalendar_selected").removeProperty("class");O.className="mcalendar_selected";this.fireEvent("select",[new Date($(O).getProperty("year"),$(O).getProperty("month"),$(O).getProperty("date"))])}}}}}}}return false}.bind(this))},MonthInfo:function(D,A){var B=[31,28,31,30,31,30,31,31,30,31,30,31];var C=(new Date(D,A,1));C.setDate(1);if(C.getDate()==2){C.setDate(0)}D+=1900;return{days:A==1?(((D%4==0)&&(D%100!=0))||(D%400==0)?29:28):B[A],firstDay:C.getDay()}},show:function(){this.display=true;if(this.options.posEle){this.position()}this.container.setStyle("display","");if(this.shim){this.shim.show()}},hide:function(){this.display=false;this.container.setStyle("display","none");if(this.shim){this.shim.hide()}},position:function(){var A=$(this.options.posEle).getCoordinates();this.container.setStyles({position:"absolute",left:A.left,top:A.bottom});if(this.shim){this.shim.position()}},dispose:function(){this.container.empty();if(this.shim){this.shim.dispose()}}});var Datepicker=new Class({Implements:[Options],options:{initDate:"",hasShim:false,monthText:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],weekText:["日","一","二","三","四","五","六"],range:[new Date(1970,0,1),new Date(2015,0,1)],splitChar:"-"},initialize:function(C,B,A){this.setOptions(A);this.calendar=null;this.container=null;this.ele=$(C);this.ele.addEvent("click",function(E){if(this.calendar){this.calendar.display?this.calendar.hide():this.calendar.show();return }var D=new Event(E).target;if(!this.container){this.container=new Element("div").setProperty("id",$time()+"_date")}$(document.body).grab(this.container);var F=this.options.initDate||new Date();this.calendar=new Calendar(this.container,{initDate:F,posEle:D,range:this.options.range,monthText:this.options.monthText,weekText:this.options.weekText,hasShim:this.options.hasShim,onSelect:function(G){B.value=G.getFullYear()+this.options.splitChar+(G.getMonth()+1)+this.options.splitChar+G.getDate();this.calendar.hide()}.bind(this)})}.bind(this));document.addEvent("mousedown",this.insideSelector.bind(this))},insideSelector:function(A){if(this.calendar&&!(/^(?:object|embed)$/i).test(A.target.tagName)&&A.target!==this.ele&&$(A.target).getParents(".mcalendar").length===0){this.calendar.hide()}},dispose:function(){if(this.calendar){this.calendar.dispose()}}});var DpAdShower=new Class({Implements:[Options,Events],options:{container:document.body,css:{width:"175px",height:"75px"},triggerClass:"DpAdShower",interval:5000,current:1,onShow:$empty},initialize:function(A){this.setOptions(A);this.container=$(this.options.container);this.container.setStyles($merge({overflow:"hidden",position:"relative"},this.options.css));this.items=this.container.getElements("ul>li");this.current=this.options.current;this.adCount=0;if(this.items.length<=1){this.show(this.current);return }this.build();this.show(this.current);this.timer=this.next.periodical(this.options.interval,this);return this},build:function(){var A=this.items.length;this.trigger=new Element("ul").addClass(this.options.triggerClass).setStyles({position:"absolute",bottom:"5px",right:"5px"});while(A>0){(function(B){var C=A;new Element("li").set("text",C).addEvents({mouseover:function(D){this.timer=$clear(this.timer);this.show(C)}.bind(B),mouseout:function(){this.timer=this.next.periodical(this.options.interval,this)}.bind(B)}).inject(B.trigger,"top")})(this);A--}this.trigger.inject(this.container)},show:function(A){this.current=A;if(this.items&&this.items.length>0){this.items.setStyle("display","none");this.items[this.current-1].setStyle("display","");if(this.adCount<=this.items.length){$APShowTracker(this.items[this.current-1].getProperty("kid"),20);this.adCount++}}if(this.trigger){var B=this.trigger.getElements("li");B.removeClass("current");B[this.current-1].className="current"}this.fireEvent("show",[this.current])},next:function(){if(this.current>=this.items.length){this.current=0}this.show(this.current+1)}});Element.implement({getOffsetParent:function(){var A=this.getDocument().body;if(this==A){return null}if(!Browser.Engine.trident){return $(this.offsetParent)}var B=this;while((B=B.parentNode)){if(B==A||Element.getComputedStyle(B,"position")!="static"){return $(B)}}return null},getCaretPosition:function(){if(!Browser.Engine.trident){return this.selectionStart}this.focus();var A=document.selection.createRange();var B=this.createTextRange();A.setEndPoint("StartToStart",B);return A.text.length},selectRange:function(C,A){if(Browser.Engine.trident){var B=this.createTextRange();B.collapse(true);B.moveEnd("character",A);B.moveStart("character",C);B.select()}else{this.focus();this.setSelectionRange(C,A)}return this}});var Autocompleter=new Class({Implements:[Options,Events],options:{enable:true,minLength:1,width:"inherit",height:"auto",adjust:{x:0,y:0},maxChoices:10,className:"autocompleter",selectClass:"ac_select",closeClass:"ac_close",titleClass:"ac_title",pageClass:"ac_page",zIndex:999,delay:200,observerOptions:{},fxOptions:{},extraParams:{},context:null,needPosition:true,autoSubmit:true,autoTrim:true,autoClose:true,filter:null,parser:$empty,selectMode:true,wordSync:true,multiple:false,separatorSplit:",",isfix:false,filterSubset:false,filterCase:false,listCloseBtn:true,onSelection:$empty,onShow:$empty,onHide:$empty,onBlur:$empty,onFocus:$empty},initialize:function(C,B,A){this.element=$(C);this.setOptions(A);this.build();this.observer=new Observer(this.element,this.fetch.bind(this),$merge({delay:this.options.delay},this.options.observerOptions));this.queryValue=null;if(this.options.filter){this.filter=this.options.filter.bind(this)}this.selectMode=this.options.selectMode;this.enable=this.options.enable;this.extraParams=this.options.extraParams;($type(B)==="array")?this.remote=false:this.remote=true;this.cached=false;this.cacheStatus="loading";this.url=B},build:function(){var A=this;this.choices=new Element("ul",{"class":this.options.className,styles:{zIndex:this.options.zIndex,position:"absolute",visibility:"hidden"}}).inject(this.options.context||document.body);this.visible=false;if(this.options.isfix){this.fix=new IframeShim(this.choices)}this.fx=(!this.options.fxOptions)?null:new Fx.Tween(this.choices,$merge({property:"opacity",link:"cancel",duration:200},this.options.fxOptions)).addEvent("onStart",Chain.prototype.clearChain).set(0);this.element.setProperty("autocomplete","off").addEvent("keydown",this.onCommand.bind(this)).addEvent("focus",this.toggleFocus.create({bind:this,arguments:true,event:true})).addEvent("blur",this.toggleFocus.create({bind:this,arguments:false,event:true}));this.choices.onmousedown=function(){if(A.options.autoClose){A.element.onbeforedeactivate=function(){A.element.onbeforedeactivate=null;return false}}return false};window.addEvent("resize",this.position.bind(this))},destroy:function(){if(this.fix){this.fix.dispose()}this.choices=this.selected=this.choices.destroy()},toggleFocus:function(B,A){B.stop();this.focussed=A;if(!this.focussed){if(this.options.autoClose){this.hideChoices(true)}}else{this.prefetch()}this.fireEvent((A)?"onFocus":"onBlur",[this.element])},position:function(){if(this.options.needPosition){var B=this.element.getCoordinates();var A={left:B.left+this.options.adjust.x,top:B.bottom+this.options.adjust.y};this.choices.setStyles(A);if(this.fix){this.fix.position()}}return this},onCommand:function(B){if(B&&B.key&&!B.shift){switch(B.key){case"enter":B.stop();if(this.selected&&this.visible){this.choiceSelect(this.selected);return !!(this.options.autoSubmit)}break;case"up":case"down":if(this.visible&&this.queryValue!==null){var A=(B.key=="up");if(this.options.listCloseBtn&&this.selected&&this.selected.getNext().hasClass(this.options.closeClass)){A?this.choiceOver(this.selected.getPrevious(),true):this.choiceOver(this.choices.getFirst(),true)}else{this.choiceOver((this.selected||this.choices)[(this.selected)?((A)?"getPrevious":"getNext"):((A)?"getLast":"getFirst")](),true)}}return false;case"esc":case"tab":this.hideChoices(true);break}}return true},prefetch:function(){if(this.cacheStatus=="loaded"){return true}if(!this.remote){this.cached=this.url;this.cacheStatus="loaded"}else{this.cached=[];this.cacheStatus="loaded"}},fetch:function(){if(!this.enable||this.cacheStatus!="loaded"){return false}var F=this.element.value,E=F,B=0;if(this.options.multiple){var C=this.options.separatorSplit;var A=F.split(C);B=this.element.getCaretPosition();var G=F.substr(0,B).split(C);var D=G.length-1;B-=G[D].length;E=A[D]}if(E.length<this.options.minLength){this.hideChoices()}else{this.queryIndex=B;if((JSON.encode(this.extraParams)===this.queryExtraParams&&E===this.queryValue)||(this.visible&&E==this.selectedValue)){if(this.visible){return false}this.showChoices()}else{this.queryExtraParams=JSON.encode(this.extraParams);this.queryValue=E;if(this.remote){this.makeUrl();this.ajaxReq=new AjaxReq({url:this.makeUrl(),callType:"json",onSuccess:function(I,H){this.cached=I;var J=this.options.parser(this.cached);if($type(J)=="array"){this.update(J)}else{if($type(J.data)=="array"&&J.more){this.update(J.data,J.more)}}}.bind(this)});this.ajaxReq.send()}else{this.update(this.filter(this.cached))}}}return true},makeUrl:function(){var A=this.url+"?q="+encodeURIComponent(this.queryValue);for(var B in this.extraParams){A+="&"+B+"="+encodeURIComponent(this.extraParams[B])}return A},filter:function(C){var B=new RegExp(((this.options.filterSubset)?"":"^")+this.queryValue.escapeRegExp(),(this.options.filterCase)?"":"i");var A=[];(C||this.tokens).each(function(D){if(B.test(D)){A.push(D)}},this);return A},setSelection:function(I){var J=this.selectedValue,K=J;if(!J){return false}var C=this.queryValue?this.queryValue.length:0,E=J.length;if(this.queryValue&&J.substr(0,C).toLowerCase()!=this.queryValue.toLowerCase()){C=0}if(this.options.multiple){var H=this.options.separatorSplit;K=this.element.value;C+=this.queryIndex;E+=this.queryIndex;var D=K.substr(this.queryIndex).split(H,1)[0];K=K.substr(0,this.queryIndex)+J+K.substr(this.queryIndex+D.length);if(I){var A=/[^\s,]+/;var G=[];K.split(this.options.separatorSplit).each(function(M){if(A.test(M)){G.push(M)}},this);var L=this.options.separatorSplit;K=G.join(L)+L;E=K.length}}if(this.options.wordSync){this.observer.setValue(K)}this.opted=K;if(I){C=E}this.element.selectRange(C,E);var F=this.selected.getElement("span")?this.selected.getElement("span").get("html"):0;var B=K;if(this.options.autoSubmit&&I){this.fireEvent("onSelection",[this.element,this.selected,F,B])}},showChoices:function(){var D=this.choices.getFirst(),C=this.choices.getLast(),B;if(!D||this.visible){return }var A=this.options.width||"auto";if($type(this.options.height)==="number"){(C.getCoordinates(this.choices).bottom>this.options.height)?B={"overflow-y":"scroll",height:this.options.height}:B={"overflow-y":"hidden",height:this.options.height}}else{B={"overflow-y":"hidden",height:this.options.height}}B=$merge(B,{width:(A===true||A=="inherit")?this.element.getSize().x:A});if(!this.visible){this.visible=true;this.choices.setStyles(B);this.position();this.fx?this.fx.start(1):this.choices.setStyle("visibility","visible");if(this.fix){this.fix.show()}this.fireEvent("onShow",[this.element,this.choices])}},hideChoices:function(A){if(A){var C=this.element.value;if(this.options.autoTrim){C=C.split(this.options.separatorSplit).filter($arguments(0)).join(this.options.separatorSplit)}this.observer.setValue(C)}if(!this.visible){return }this.visible=false;this.observer.clear();var B=function(){this.choices.setStyle("visibility","hidden");if(this.fix){this.fix.hide()}}.bind(this);this.fx?this.fx.start(0).chain(B):B();this.fireEvent("onHide",[this.element,this.choices])},update:function(F,B){this.choices.empty();if(this.selected){this.selected=this.selectedValue=null}if(!F||!F.length){this.hideChoices()}else{if(this.options.maxChoices<F.length){F.length=this.options.maxChoices}F.each(function(H){var I=H.split("|");var G=new Element("li",{html:this.markQueryValue(I)});G.inputValue=I[0];this.addChoiceEvents(G).inject(this.choices)},this);if(B&&B.text&&B.link){var E=new Element("a").addClass("BL").setProperty("href",B.link).set("html",B.text);var A=new Element("li");A.grab(E);A.inject(this.choices)}if(this.options.listCloseBtn){var D=new Element("a").addClass("BL").setStyle("margin-left","8px").setProperty("href","#").set("html","关闭").addEvent("click",function(){this.hideChoices(true);return false}.bind(this));var C=new Element("li").addClass(this.options.closeClass);C.grab(D);C.inject(this.choices)}this.showChoices()}},markQueryValue:function(A){return(A.length==1)?A[0]:('<span style="float:right;display:none">'+A[1]+"</span>")+(A[2]?"<p>"+A[2]+"</p>":"")+A[0]},addChoiceEvents:function(A){return A.addEvents({mouseover:this.choiceOver.bind(this,[A]),click:this.choiceSelect.bind(this,[A])})},choiceOver:function(A,B){if(!A||A==this.selected){return }if(this.selected){this.selected.removeClass(this.options.selectClass)}this.selected=A.addClass(this.options.selectClass);this.fireEvent("onSelect",[this.element,this.selected,B]);if(!B){return }if(this.selectMode){this.selectedValue=this.selected.inputValue;this.setSelection()}},choiceSelect:function(A){if(A){this.choiceOver(A)}this.selectedValue=this.selected.inputValue;this.setSelection(true);this.queryValue=null;this.hideChoices()}});var Observer=new Class({Implements:[Options,Events],options:{periodical:false,delay:1000},initialize:function(C,A,B){this.setOptions(B);this.addEvent("onFired",A);this.element=$(C)||$$(C);this.boundChange=this.changed.bind(this);this.resume()},changed:function(){var A=this.element.get("value");if((this.value==A||JSON.encode(this.value)==JSON.encode(A))){return }this.clear();this.value=A;this.timeout=this.onFired.delay(this.options.delay,this)},setValue:function(A){this.value=A;this.element.set("value",A);return this.clear()},onFired:function(){this.fireEvent("onFired",[this.value,this.element])},clear:function(){$clear(this.timeout||null);return this},pause:function(){$clear(this.timeout);$clear(this.timer);this.element.removeEvent("keyup",this.boundChange);return this},resume:function(){this.value=this.element.get("value");if(this.options.periodical){this.timer=this.changed.periodical(this.options.periodical,this)}else{this.element.addEvent("keyup",this.boundChange)}return this}});Autocompleter.Location=new Class({Extends:Autocompleter,initialize:function(C,B,A){A=$merge({filterSubset:false,fxOptions:false,selectMode:false,width:200,maxChoices:12,minLength:0,defaultTitle:"输入中文/拼音或↑↓选择",defaultText:"中文/拼音"},A);this.parent(C,B,A);if(this.element.value.trim()==""){this.element.setStyle("color","gray").value=this.options.defaultText}},onCommand:function(B){if(B&&B.key&&!B.shift){switch(B.key){case"enter":B.stop();if(this.selected&&this.visible){this.choiceSelect(this.selected);return !!(this.options.autoSubmit)}break;case"up":case"down":if(this.visible){var A=(B.key=="up");if(this.selected){if(this.selected.getPrevious().hasClass(this.options.titleClass)&&this.selected.getNext().hasClass(this.options.pageClass)){return false}else{if(this.selected.getPrevious().hasClass(this.options.titleClass)){A?this.choiceOver(this.choices.getLast().getPrevious(),true):this.choiceOver(this.selected.getNext(),true)}else{if(this.selected.getNext().hasClass(this.options.pageClass)){A?this.choiceOver(this.selected.getPrevious(),true):this.choiceOver(this.choices.getFirst().getNext(),true)}else{this.choiceOver(this.selected[((A)?"getPrevious":"getNext")](),true)}}}}else{this.choiceOver(A?this.choices.getLast().getPrevious():this.choices.getFirst().getNext())}}return false;case"esc":case"tab":this.hideChoices(true);break}}return true},toggleFocus:function(B,A){B.stop();this.focussed=A;if(!this.focussed){if(this.options.autoClose){this.hideChoices(true)}}else{this.prefetch()}this.fireEvent((A)?"onFocus":"onBlur",[this.element,this.blurData,this.options.defaultText])},filter:function(H){if(this.queryValue==""){var F=[].concat(this.url);F.length=this.options.maxChoices;return F}else{var E=new RegExp(((this.options.filterSubset)?"":"^")+this.queryValue.escapeRegExp(),(this.options.filterCase)?"":"i");var A=[],G=[],D=[],C=[],B=[];(H||this.tokens).each(function(K,I){var J=K.split("|");G[I]=J[0];D[I]=J[1];C[I]=J[2]},this);[D,C,G].each(function(J,I){J.each(function(K,L){if(E.test(K)){B.include(L)}},this)},this);B.each(function(I){A.push(H[I])});return A}},prefetch:function(){this.parent();if(this.element.value.trim()==this.options.defaultText){this.element.value="";var A=[].concat(this.url);A.length=this.options.maxChoices;this.update(A)}else{this.fetch()}},update:function(H,F){this.choices.empty();if(this.selected){this.selected=this.selectedValue=null}if(!H||!H.length){this.hideChoices()}else{var A=Math.ceil(H.length/this.options.maxChoices),F=F||1,G=(this.options.maxChoices<H.length),C=[];new Element("li",{html:this.options.defaultTitle}).addClass(this.options.titleClass).inject(this.choices);if(G){for(var E=0;E<this.options.maxChoices;E++){var D=(F-1)*this.options.maxChoices+E;if(D>=H.length){break}C[E]=H[D]}}else{C=[].concat(H)}this.blurData=C;C.each(function(J){var K=J.split("|");var I=new Element("li",{html:this.markQueryValue(K)});I.inputValue=K[0];this.addChoiceEvents(I).inject(this.choices)},this);var B=new Element("li",{html:(G?this.rendPage(F,A):"")}).addClass(this.options.pageClass).inject(this.choices);B.getElements("a").addEvent("click",function(I){this.update(H,$(I.target).get("name"))}.bind(this));this.showChoices()}},markQueryValue:function(A){return('<span style="float:right;display:none">'+A[3]+"</span>")+("<p>"+A[1]+"("+A[2]+")</p>")+A[0]},rendPage:function(E,B){var A=[],E=E.toInt(),C=3;A.push("<a name="+((E-1<1)?1:(E-1))+" href='javascript:'><-</a>");if(B<=2*C){for(var D=1;D<=B;D++){if(D==E){A.push("<a class='ac_page_select' name="+D+" href='javascript:'>"+D+"</a>")}else{A.push("<a class='ac_page_normal' name="+D+" href='javascript:'>"+D+"</a>")}}}else{if((E-C)<1){var G=1}else{var G=E-C}if((E+C-1)>B){var F=B}else{var F=(E+C-1)}for(var D=G;D<=F;D++){if(D==E){A.push("<a class='ac_page_select' name="+D+" href='javascript:'>"+D+"</a>")}else{A.push("<a class='ac_page_normal' name="+D+" href='javascript:'>"+D+"</a>")}}}A[A.length]="<a name="+((E+1>B)?B:(E+1))+" href='javascript:'>-></a>";return A.join("")}});var Bulletin=function(){var B={startDate:null,life:0,closable:true,icon:true,closevent:null},E={domain:"dianping.com",path:"/",duration:false,secure:false},A="_bltn",D,C;return{option:function(G,I){var F=B,H=E;G&&$extend(F,G);I&&$extend(H,I);D=true;if(F.startDate){F.startDate=+F.startDate}else{F.startDate=-1}if(!$chk(H.duration)){H.duration=F.life||30}this.option=$lambda(this);return this},show:function(J){if(!D){this.option()}var F=B,I=E,G=[],H=$time();if(!C&&(Number(Cookie.read(A))!==F.startDate)&&((!F.life||F.startDate===-1)||(H>F.startDate)&&(H<F.life*86400000+F.startDate))){C=true;if(F.icon){G.push('<div class="icon"></div>')}G.push(J);if(F.closable){G.push('<a href="javascript:;" class="close" onclick="Bulletin.close();return false;">不再提示</a>')}this.bar=new Element("div",{"class":"Bulletin",html:G.join("")}).inject(document.body,"top")}},close:function(G){var H=this,F=this.bar;if(F){if(G===0){return F.dispose()}G=$type(G)==="number"?G:250;new Fx.Tween(F,{duration:G,property:"opacity",onComplete:function(){F.dispose();H.bar=null;C=false;Cookie.write(A,B.startDate,E);if($type(B.closevent)=="function"){try{B.closevent()}catch(I){}}}}).start(0)}}}}();
