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:$empty,_initData:$empty,_trackPageview:$empty};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(F,D,B){var C=new Element("div").addClass("DialogTitle");($type(F)=="array")?C.adopt(F):C.set("html",F);var E=new Element("div").addClass("DialogContent");($type(D)=="array")?E.adopt(D):E.set("html",D);var A=new Element("div").addClass("DialogButtons");($type(B)=="array")?A.adopt(B):A.set("html",B);return new Element("div").adopt([C,E,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)}});Element.implement({appendHTML:function(C,B){if($type(C)!="string"){return false}B=B||"bottom";var A=new Element("div");A.set("html",C);var D=(B=="bottom"||B=="before")?$A(A.childNodes):$A(A.childNodes).reverse();D.each(function(E){if($type(E)=="element"){$(E).inject(this,B)}},this);return this},css:function(A,B){if($type(A)=="object"){for(var C in A){this.css(C,A[C])}return this}this.setStyle(A,B);return this},attr:function(A,B){if($type(A)=="object"){for(var C in A){this.attr(C,A[C])}return this}this.setProperty(A,B);return this},isDisplayed:function(){return this.getStyle("display")!="none"},toggle:function(){return this[this.isDisplayed()?"hide":"show"]()},hide:function(){var B;try{if("none"!=this.getStyle("display")){B=this.getStyle("display")}}catch(A){}return this.store("originalDisplay",B||"block").setStyle("display","none")},show:function(A){return this.setStyle("display",A||this.retrieve("originalDisplay")||"block")},swapClass:function(A,B){return this.removeClass(A).addClass(B)}});Element.alias("store","sdata");Element.alias("retrieve","gdata");(function(){var B=1;function D(J){var H=$(J.target),I=J.type,G=document.retrieve("live",[]),E=[],F=true;if(!G.length){return }G.each(function(L){if(L.type==I){var K=C(L.exp,H);if(K){E.push({ele:H,fn:L,order:K})}}});if(E.length){E.sort(function(L,K){return L.order-K.order});E.each(function(K){if(K.fn.call(K.ele,J)===false){return(F=false)}})}return F}function C(G,E){var I=$type(G)=="string"?$$(G):null,F=E,H=1;if(!I){return false}while(F&&!A(F)){if(I.contains(F)){return H}F=F.getParent();H++}return false}function A(E){return(/^(?:body|html)$/i).test(E.tagName)}Window.implement({$live:function(I,H,G){var E=document.retrieve("live",[]);var F=function(){return G.apply(this,arguments)};F.guid=G.guid=G.guid||F.guid||B++;F.type=H;F.exp=I;E.length?E.each(function(J){if(J.guid!=F.guid||J.type!=F.type||J.exp!=F.exp){E.push(F)}}):E.push(F);document.addEvent(H,D)},$die:function(H,G,F){var E=document.retrieve("live");if(!E||!E.length){return }document.store("live",E.filter(function(I){return !(I.exp==H&&I.type==G&&(F?I.guid==F.guid:true))}))}})})();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}})};var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",EXPRESS_INSTALL_ID="SWFObjectExprInst",win=window,doc=document,nav=navigator,domLoadFnArr=[],regObjArr=[],objIdArr=[],listenersArr=[],script,timer=null,storedAltContent=null,storedAltContentId=null,isDomLoaded=false,isExpressInstallActive=false;var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d&&!(typeof nav.mimeTypes!=UNDEF&&nav.mimeTypes[FLASH_MIME_TYPE]&&!nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".10")}catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7")}catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always"}catch(e){if(playerVersion[0]==6){fp6Crash=true}}}if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX)}catch(e){}}}if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}catch(e){}}}}var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);
/*@cc_on
		ie = true;
		@if (@_win32)
		windows = true;
		@elif (@_mac)
				mac = true;
			@end
		@*/
return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac}}();var onDomLoad=function(){if(!ua.w3cdom){return }addDomLoadEvent(main);window.addEvent("domready",callDomLoadFunctions);addLoadEvent(callDomLoadFunctions)}();function checkReadyState(){if(script.readyState=="complete"){script.parentNode.removeChild(script);callDomLoadFunctions()}}function callDomLoadFunctions(){if(isDomLoaded){return }if(ua.ie&&ua.win){var s=createElement("span");try{var t=doc.getElementsByTagName("body")[0].appendChild(s);t.parentNode.removeChild(t)}catch(e){return }}isDomLoaded=true;if(timer){clearInterval(timer);timer=null}var dl=domLoadFnArr.length;for(var i=0;i<dl;i++){domLoadFnArr[i]()}}function addDomLoadEvent(fn){if(isDomLoaded){fn()}else{domLoadFnArr[domLoadFnArr.length]=fn}}function addLoadEvent(fn){if(typeof win.addEventListener!=UNDEF){win.addEventListener("load",fn,false)}else{if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("load",fn,false)}else{if(typeof win.attachEvent!=UNDEF){addListener(win,"onload",fn)}else{if(typeof win.onload=="function"){var fnOld=win.onload;win.onload=function(){fnOld();fn()}}else{win.onload=fn}}}}}function main(){var rl=regObjArr.length;for(var i=0;i<rl;i++){var id=regObjArr[i].id;if(ua.pv[0]>0){var obj=getElementById(id);if(obj){regObjArr[i].width=obj.getAttribute("width")?obj.getAttribute("width"):"0";regObjArr[i].height=obj.getAttribute("height")?obj.getAttribute("height"):"0";if(hasPlayerVersion(regObjArr[i].swfVersion)){if(ua.webkit&&ua.webkit<312){fixParams(obj)}setVisibility(id,true)}else{if(regObjArr[i].expressInstall&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){showExpressInstall(regObjArr[i])}else{displayAltContent(obj)}}}}else{setVisibility(id,true)}}}function fixParams(obj){var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var e=createElement("embed"),a=nestedObj.attributes;if(a){var al=a.length;for(var i=0;i<al;i++){if(a[i].nodeName=="DATA"){e.setAttribute("src",a[i].nodeValue)}else{e.setAttribute(a[i].nodeName,a[i].nodeValue)}}}var c=nestedObj.childNodes;if(c){var cl=c.length;for(var j=0;j<cl;j++){if(c[j].nodeType==1&&c[j].nodeName=="PARAM"){e.setAttribute(c[j].getAttribute("name"),c[j].getAttribute("value"))}}}obj.parentNode.replaceChild(e,obj)}}function showExpressInstall(regObj){isExpressInstallActive=true;var obj=getElementById(regObj.id);if(obj){if(regObj.altContentId){var ac=getElementById(regObj.altContentId);if(ac){storedAltContent=ac;storedAltContentId=regObj.altContentId}}else{storedAltContent=abstractAltContent(obj)}if(!(/%$/.test(regObj.width))&&parseInt(regObj.width,10)<310){regObj.width="310"}if(!(/%$/.test(regObj.height))&&parseInt(regObj.height,10)<137){regObj.height="137"}doc.title=doc.title.slice(0,47)+" - Flash Player Installation";var pt=ua.ie&&ua.win?"ActiveX":"PlugIn",dt=doc.title,fv="MMredirectURL="+win.location+"&MMplayerType="+pt+"&MMdoctitle="+dt,replaceId=regObj.id;if(ua.ie&&ua.win&&obj.readyState!=4){var newObj=createElement("div");replaceId+="SWFObjectNew";newObj.setAttribute("id",replaceId);obj.parentNode.insertBefore(newObj,obj);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}createSWF({data:regObj.expressInstall,id:EXPRESS_INSTALL_ID,width:regObj.width,height:regObj.height},{flashvars:fv},replaceId)}}function displayAltContent(obj){if(ua.ie&&ua.win&&obj.readyState!=4){var el=createElement("div");obj.parentNode.insertBefore(el,obj);el.parentNode.replaceChild(abstractAltContent(obj),el);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}else{obj.parentNode.replaceChild(abstractAltContent(obj),obj)}}function abstractAltContent(obj){var ac=createElement("div");if(ua.win&&ua.ie){ac.innerHTML=obj.innerHTML}else{var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var c=nestedObj.childNodes;if(c){var cl=c.length;for(var i=0;i<cl;i++){if(!(c[i].nodeType==1&&c[i].nodeName=="PARAM")&&!(c[i].nodeType==8)){ac.appendChild(c[i].cloneNode(true))}}}}}return ac}function createSWF(attObj,parObj,id){var r,el=getElementById(id);if(el){if(typeof attObj.id==UNDEF){attObj.id=id}if(ua.ie&&ua.win){var att="";for(var i in attObj){if(attObj[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){parObj.movie=attObj[i]}else{if(i.toLowerCase()=="styleclass"){att+=' class="'+attObj[i]+'"'}else{if(i.toLowerCase()!="classid"){att+=" "+i+'="'+attObj[i]+'"'}}}}}var par="";for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par+='<param name="'+j+'" value="'+parObj[j]+'" />'}}el.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+att+">"+par+"</object>";objIdArr[objIdArr.length]=attObj.id;r=getElementById(attObj.id)}else{if(ua.webkit&&ua.webkit<312){var e=createElement("embed");e.setAttribute("type",FLASH_MIME_TYPE);for(var k in attObj){if(attObj[k]!=Object.prototype[k]){if(k.toLowerCase()=="data"){e.setAttribute("src",attObj[k])}else{if(k.toLowerCase()=="styleclass"){e.setAttribute("class",attObj[k])}else{if(k.toLowerCase()!="classid"){e.setAttribute(k,attObj[k])}}}}}for(var l in parObj){if(parObj[l]!=Object.prototype[l]){if(l.toLowerCase()!="movie"){e.setAttribute(l,parObj[l])}}}el.parentNode.replaceChild(e,el);r=e}else{var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);for(var m in attObj){if(attObj[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){o.setAttribute("class",attObj[m])}else{if(m.toLowerCase()!="classid"){o.setAttribute(m,attObj[m])}}}}for(var n in parObj){if(parObj[n]!=Object.prototype[n]&&n.toLowerCase()!="movie"){createObjParam(o,n,parObj[n])}}el.parentNode.replaceChild(o,el);r=o}}}return r}function createObjParam(el,pName,pValue){var p=createElement("param");p.setAttribute("name",pName);p.setAttribute("value",pValue);el.appendChild(p)}function removeSWF(id){var obj=getElementById(id);if(obj&&(obj.nodeName=="OBJECT"||obj.nodeName=="EMBED")){if(ua.ie&&ua.win){if(obj.readyState==4){removeObjectInIE(id)}else{win.attachEvent("onload",function(){removeObjectInIE(id)})}}else{obj.parentNode.removeChild(obj)}}}function removeObjectInIE(id){var obj=getElementById(id);if(obj){for(var i in obj){if(typeof obj[i]=="function"){obj[i]=null}}obj.parentNode.removeChild(obj)}}function getElementById(id){var el=null;try{el=doc.getElementById(id)}catch(e){}return el}function createElement(el){return doc.createElement(el)}function addListener(target,eventType,fn){target.attachEvent(eventType,fn);listenersArr[listenersArr.length]=[target,eventType,fn]}function hasPlayerVersion(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10)||0;v[2]=parseInt(v[2],10)||0;return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false}function createCSS(sel,decl){if(ua.ie&&ua.mac){return }var h=doc.getElementsByTagName("head")[0],s=createElement("style");s.setAttribute("type","text/css");s.setAttribute("media","screen");if(!(ua.ie&&ua.win)&&typeof doc.createTextNode!=UNDEF){s.appendChild(doc.createTextNode(sel+" {"+decl+"}"))}h.appendChild(s);if(ua.ie&&ua.win&&typeof doc.styleSheets!=UNDEF&&doc.styleSheets.length>0){var ls=doc.styleSheets[doc.styleSheets.length-1];if(typeof ls.addRule==OBJECT){ls.addRule(sel,decl)}}}function setVisibility(id,isVisible){var v=isVisible?"visible":"hidden";if(isDomLoaded&&getElementById(id)){getElementById(id).style.visibility=v}else{createCSS("#"+id,"visibility:"+v)}}function urlEncodeIfNecessary(s){var regex=/[\\\"<>\.;]/;var hasBadChars=regex.exec(s)!=null;return hasBadChars?encodeURIComponent(s):s}var cleanup=function(){if(ua.ie&&ua.win){window.attachEvent("onunload",function(){var ll=listenersArr.length;for(var i=0;i<ll;i++){listenersArr[i][0].detachEvent(listenersArr[i][1],listenersArr[i][2])}var il=objIdArr.length;for(var j=0;j<il;j++){removeSWF(objIdArr[j])}for(var k in ua){ua[k]=null}ua=null;for(var l in swfobject){swfobject[l]=null}swfobject=null})}}();return{registerObject:function(objectIdStr,swfVersionStr,xiSwfUrlStr){if(!ua.w3cdom||!objectIdStr||!swfVersionStr){return }var regObj={};regObj.id=objectIdStr;regObj.swfVersion=swfVersionStr;regObj.expressInstall=xiSwfUrlStr?xiSwfUrlStr:false;regObjArr[regObjArr.length]=regObj;setVisibility(objectIdStr,false)},getObjectById:function(objectIdStr){var r=null;if(ua.w3cdom){var o=getElementById(objectIdStr);if(o){var n=o.getElementsByTagName(OBJECT)[0];if(!n||(n&&typeof o.SetVariable!=UNDEF)){r=o}else{if(typeof n.SetVariable!=UNDEF){r=n}}}}return r},embedSWF:function(swfUrlStr,replaceElemIdStr,widthStr,heightStr,swfVersionStr,xiSwfUrlStr,flashvarsObj,parObj,attObj){if(!ua.w3cdom||!swfUrlStr||!replaceElemIdStr||!widthStr||!heightStr||!swfVersionStr){return }widthStr+="";heightStr+="";if(hasPlayerVersion(swfVersionStr)){setVisibility(replaceElemIdStr,false);var att={};if(attObj&&typeof attObj===OBJECT){for(var i in attObj){if(attObj[i]!=Object.prototype[i]){att[i]=attObj[i]}}}att.data=swfUrlStr;att.width=widthStr;att.height=heightStr;var par={};if(parObj&&typeof parObj===OBJECT){for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par[j]=parObj[j]}}}if(flashvarsObj&&typeof flashvarsObj===OBJECT){for(var k in flashvarsObj){if(flashvarsObj[k]!=Object.prototype[k]){if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+k+"="+flashvarsObj[k]}else{par.flashvars=k+"="+flashvarsObj[k]}}}}addDomLoadEvent(function(){createSWF(att,par,replaceElemIdStr);if(att.id==replaceElemIdStr){setVisibility(replaceElemIdStr,true)}})}else{if(xiSwfUrlStr&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){isExpressInstallActive=true;setVisibility(replaceElemIdStr,false);addDomLoadEvent(function(){var regObj={};regObj.id=regObj.altContentId=replaceElemIdStr;regObj.width=widthStr;regObj.height=heightStr;regObj.expressInstall=xiSwfUrlStr;showExpressInstall(regObj)})}}},getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]}},hasFlashPlayerVersion:hasPlayerVersion,createSWF:function(attObj,parObj,replaceElemIdStr){if(ua.w3cdom){return createSWF(attObj,parObj,replaceElemIdStr)}else{return undefined}},removeSWF:function(objElemIdStr){if(ua.w3cdom){removeSWF(objElemIdStr)}},createCSS:function(sel,decl){if(ua.w3cdom){createCSS(sel,decl)}},addDomLoadEvent:addDomLoadEvent,addLoadEvent:addLoadEvent,getQueryParamValue:function(param){var q=doc.location.search||doc.location.hash;if(param==null){return urlEncodeIfNecessary(q)}if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(isExpressInstallActive&&storedAltContent){var obj=getElementById(EXPRESS_INSTALL_ID);if(obj){obj.parentNode.replaceChild(storedAltContent,obj);if(storedAltContentId){setVisibility(storedAltContentId,true);if(ua.ie&&ua.win){storedAltContent.style.display="block"}}storedAltContent=null;storedAltContentId=null;isExpressInstallActive=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);this.ajax.headers.extend({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)}});Request.Queue=new Class({Implements:[Options,Events],Binds:["attach","request","complete","cancel","success","failure","exception"],options:{stopOnFailure:true,autoAdvance:true,concurrent:1,requests:{}},initialize:function(A){this.setOptions(A);this.requests=new Hash;this.addRequests(this.options.requests);this.queue=[];this.reqBinders={}},addRequest:function(A,B){this.requests.set(A,B);this.attach(A,B);return this},addRequests:function(A){$each(A,function(C,B){this.addRequest(B,C)},this);return this},getName:function(A){return this.requests.keyOf(A)},attach:function(A,B){if(B._groupSend){return this}["request","complete","cancel","success","failure","exception"].each(function(C){if(!this.reqBinders[A]){this.reqBinders[A]={}}this.reqBinders[A][C]=function(){this["on"+C.capitalize()].apply(this,[A,B].extend(arguments))}.bind(this);B.addEvent(C,this.reqBinders[A][C])},this);B._groupSend=B.send;B.send=function(C){this.send(A,C);return B}.bind(this);return this},removeRequest:function(B){var A=$type(B)=="object"?this.getName(B):B;if(!A&&$type(A)!="string"){return this}B=this.requests.get(A);if(!B){return this}["request","complete","cancel","success","failure","exception"].each(function(C){B.removeEvent(C,this.reqBinders[A][C])},this);B.send=B._groupSend;delete B._groupSend;return this},getRunning:function(){return this.requests.filter(function(A){return A.running})},isRunning:function(){return !!this.getRunning().getKeys().length},send:function(B,A){var C=function(){this.requests.get(B)._groupSend(A);this.queue.erase(C)}.bind(this);C.name=B;if(this.getRunning().getKeys().length>=this.options.concurrent||(this.error&&this.options.stopOnFailure)){this.queue.push(C)}else{C()}return this},hasNext:function(A){return(!A)?!!this.queue.length:!!this.queue.filter(function(B){return B.name==A}).length},resume:function(){this.error=false;(this.options.concurrent-this.getRunning().getKeys().length).times(this.runNext,this);return this},runNext:function(A){if(!this.queue.length){return this}if(!A){this.queue[0]()}else{var B;this.queue.each(function(C){if(!B&&C.name==A){B=true;C()}})}return this},runAll:function(){this.queue.each(function(A){A()});return this},clear:function(A){if(!A){this.queue.empty()}else{this.queue=this.queue.map(function(B){if(B.name!=A){return B}else{return false}}).filter(function(B){return B})}return this},cancel:function(A){this.requests.get(A).cancel();return this},onRequest:function(){this.fireEvent("request",arguments)},onComplete:function(){this.fireEvent("complete",arguments)},onCancel:function(){if(this.options.autoAdvance&&!this.error){this.runNext()}this.fireEvent("cancel",arguments)},onSuccess:function(){if(this.options.autoAdvance&&!this.error){this.runNext()}this.fireEvent("success",arguments)},onFailure:function(){this.error=true;if(!this.options.stopOnFailure&&this.options.autoAdvance){this.runNext()}this.fireEvent("failure",arguments)},onException:function(){this.error=true;if(!this.options.stopOnFailure&&this.options.autoAdvance){this.runNext()}this.fireEvent("exception",arguments)}});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:99,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:{triger:"mouseover",type:"cling-left",adjust:{x:20,y:20},useFx:false,effect:{property:"opacity"},zIndex:999,hasShim:true,onShow:$empty,onHide:$empty},initialize:function(C,A,B){this.setOptions(B);this.trigger=$(C);this.panel=$(A).setStyles({position:"absolute",visibility:"hidden"}).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.triger=="click"){this.trigger.addEvents({click:function(){this.display?this.hide():this.show()}.bind(this)});document.addEvent("mouseup",function(D){if(D&&this.display==true&&this.panel!=D.target&&this.trigger!=D.target){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)})}window.addEvent("resize",this.position.bind(this));this.position();return this},show:function(){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(){this.triggerCoo=this.trigger.getCoordinates();this.panelCoo={"z-index":this.options.zIndex,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},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>"+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:999,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:999,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 Minput={presets:{openwidth:26,zIndex:9,checkboxClass:"minputCheckbox",radioboxClass:"minputRadiobox",hiddenClass:"minputHidden",checkedClass:"minputChecked",selectwrapClass:"minputWrapper",selectcontClass:"minputContent",selectopenClass:"minputOpen"},initialize:function(A){if(this.options){return this}this.options={};this.setOptions($merge(this.presets,A))},checkbox:function(B,A){this.options=$merge(this.options,A||{});if($$(B).length!=0){B.each(function(G,C){var E=G;var F=(G.getParent().tagName.toLowerCase()=="label")?G.getParent():null;var D=new Element("a").addClass(this.options.checkboxClass).inject(E,"after");E.addClass(this.options.hiddenClass);$$(D,F).addEvent("click",function(){if(E.checked===true){E.checked=false;D.removeClass(this.options.checkedClass)}else{E.checked=true;D.addClass(this.options.checkedClass)}return false}.bind(this));if(E.checked){D.addClass(this.options.checkedClass)}},this)}return this},radiobox:function(B,A){this.options=$merge(this.options,A||{});if($$(B).length!=0){B.each(function(G,C){var E=G;var F=(G.getParent().tagName.toLowerCase()=="label")?G.getParent():null;var D=new Element("a").addClass(this.options.radioboxClass).setProperty("rel",E.name).inject(E,"after");E.addClass(this.options.hiddenClass);$$(D,F).addEvent("click",function(){E.checked=true;D.addClass(this.options.checkedClass);$$('a[rel="'+D.getProperty("rel")+'"]').erase(D).each(function(H){H.removeClass(this.options.checkedClass);H.getPrevious().checked=false},this);return false}.bind(this));if(E.checked){D.addClass(this.options.checkedClass)}},this)}return this},selectbox:function(E,C){this.options=$merge(this.options,C||{});var B=this;if($$(E).length!=0){E.each(function(J,I){var H=J;var F=H.getSize().x+(C.adjustWidth||0);H.addClass(this.options.hiddenClass);var K=new Element("div").addClass(this.options.selectwrapClass).setStyle("z-index",this.options.zIndex).set("html",'<div><span class="'+this.options.selectcontClass+'"></span><a href="javascript:void(0)" onfocus="this.blur()" class="'+this.options.selectopenClass+'"></a></div><ul></ul>');K.getElement("."+this.options.selectcontClass).setStyle("width",F-this.options.openwidth+"px");var G=K.getElement("ul").setStyles({width:F+"px","z-index":this.options.zIndex+1,display:"none"});H.getElements("option").each(function(M,L){new Element("li").set("html",'<a href="javascript:void(0)" index="'+L+'">'+M.get("text")+"</a>").inject(G)});K.inject(H,"after");G.getElements("a").addEvent("click",function(M){G.getElements("a.selected").removeClass("selected");$(this).addClass("selected");K.getElement("."+B.options.selectcontClass).set("html",$(this).get("html"));G.setStyle("display","none");H.selectedIndex=$(this).getProperty("index");var L;document.all?H.fireEvent("change"):(L=document.createEvent("HTMLEvents"),L.initEvent("change",true,true),H.dispatchEvent(L));return false});G.getElements("a")[H.selectedIndex].fireEvent("click")},this);$$("a."+this.options.selectopenClass).addEvent("click",function(G){var F=$(this).getParent().getNext();if(F.getStyle("display")=="none"){D();F.setStyle("display","block")}else{F.setStyle("display","none")}return false});var D=function(){$$("."+B.options.selectwrapClass+" ul").setStyle("display","none")};var A=function(F){if($(F.target).getParents("."+B.options.selectwrapClass).length===0){D()}};document.addEvent("mousedown",A)}return this},reset:function(A){$(A).addEvent("reset",function(){var B=function(){this._reset(A)}.bind(this);setTimeout(B,10)}.bind(this))},_reset:function(B){var A;$(B).getElements("select").each(function(C){if(C.getNext().hasClass(this.options.selectwrapClass)){A=(C.selectedIndex<0)?0:C.selectedIndex;C.getNext().getElements("ul a").each(function(E,D){if(D==A){E.fireEvent("click")}})}});$(B).getElements("a."+this.options.checkboxClass+",a."+this.options.radioboxClass).removeClass(this.options.checkedClass);$(B).getElements('input[type="checkbox"],input[type="radio"]').each(function(C){if(C.checked){C.getNext().addClass(this.options.checkedClass)}},this)},extend:function(A){return $extend(this,A)}};Minput.extend(new Events).extend(new Options);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,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;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()}},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")}var F=$(D).getCoordinates();this.container.setStyles({position:"absolute",left:F.left,top:F.bottom});$(document.body).grab(this.container);var G=new Date();this.calendar=new Calendar(this.container,{initDate:G,range:this.options.range,monthText:this.options.monthText,weekText:this.options.weekText,hasShim:this.options.hasShim,onSelect:function(H){B.value=H.getFullYear()+this.options.splitChar+(H.getMonth()+1)+this.options.splitChar+H.getDate();this.calendar.hide()}.bind(this)})}.bind(this));document.addEvent("mousedown",this.insideSelector.bind(this))},insideSelector:function(A){if($(A.target).getParents(".mcalendar").length===0&&A.target!==this.ele&&this.calendar){this.calendar.hide()}},dispose:function(){if(this.calendar){this.calendar.dispose()}}});var Carousel=new Class({Implements:[Events,Options],options:{type:"auto",idContent:null,idPrevious:null,idNext:null,klass:"item",size:100,interval:3000,direction:"left",slideCount:1,idPause:null,playClass:"play",showCount:3,autoFx:{},itemFx:{},unableClass:"unable",selectClass:"sitem",itemHTML:'<p><a href="{0}"><img src="{0}" style="width:100px; height:75px" /></a></p>',onPrevious:$empty,onNext:$empty,onGo:$empty},initialize:function(A,B){this.setOptions(A);this.container=$(this.options.idContent);(arguments.length>1)?this.data=B:this.data=null;this.aItems=$A(this.container.getElements("."+this.options.klass));this.fx=new Fx.Morph(this.container,$merge({duration:500,transition:Fx.Transitions.Cubic.easeInOut,wait:false},this.options.autoFx));this.isMouseOver=false;if(this.options.idPrevious!=null){$(this.options.idPrevious).addEvent("click",function(C){var D=new Event(C).stop();if(!$(D.target).hasClass(this.options.unableClass)){if(this.options.idPause!=null){$(this.options.idPause).removeClass(this.options.playClass).fireEvent("click")}this._previous()}}.bind(this))}if(this.options.idNext!=null){$(this.options.idNext).addEvent("click",function(C){var D=new Event(C).stop();if(!$(D.target).hasClass(this.options.unableClass)){if(this.options.idPause!=null){$(this.options.idPause).removeClass(this.options.playClass).fireEvent("click")}this._next()}}.bind(this))}switch(this.options.type){case"auto":(2).times(function(){this.aItems.each(function(C){C.clone().inject(this.container)}.bind(this))}.bind(this));this.aItems=$A(this.container.getElements("."+this.options.klass));if(this.options.idPause==null){this.aItems.each(function(C){C.addEvents({mouseenter:function(){this.isMouseOver=true;this.timer=$clear(this.timer)}.bind(this),mouseleave:function(){this.isMouseOver=false;this.timer=this._autoRotate.periodical(this.options.interval,this)}.bind(this)})}.bind(this))}else{$(this.options.idPause).addEvent("click",function(C){$(this.options.idPause).toggleClass(this.options.playClass);if(this.options.type=="auto"&&!$(this.options.idPause).hasClass(this.options.playClass)){this.timer=this._autoRotate.periodical(this.options.interval,this)}else{if(this.options.type=="auto"){this.timer=$clear(this.timer)}}}.bind(this))}this.atScreen=this.aItems.length/3;this.container.setStyle(this.options.direction,-this.atScreen*this.options.size);this.timer=this._autoRotate.periodical(this.options.interval,this);break;case"slide":this.atScreen=0;this.container.setStyle(this.options.direction,-this.atScreen*this.options.size);break;case"manual":this.currentPos=this.data.toInt();this.imgArray=$A(this.container.getElements("."+this.options.klass));this.dataLength=this.imgArray.slice(this.currentPos,this.currentPos+this.options.showCount+1).length;this._animate(this.currentPos);this._check();break;case"imanual":this.defaultPos=this.data.currentPos.toInt();this.currentPos=this.data.currentPos.toInt();this.imgArray=this.data.img;this._showImg(this.currentPos,this.options.showCount);break}},go:function(A){this.atScreen=Math.abs(A%(this.aItems.length));this._animate(this.atScreen);this.fireEvent("onGo",this,20);return this},_previous:function(){switch(this.options.type){case"auto":this.atScreen-=this.options.slideCount;if(this.atScreen<this.aItems.length/3){this.container.setStyle(this.options.direction,-this.options.size*this.aItems.length*2/3);this.atScreen=this.aItems.length*2/3-this.options.slideCount}this._animate(this.atScreen);this.fireEvent("onPrevious",this,20);break;case"slide":break;case"manual":(this.currentPos-=this.options.slideCount,(this.currentPos<0)?this.currentPos=0:this.currentPos=this.currentPos);this.dataLength=this.imgArray.slice(this.currentPos,this.currentPos+this.options.showCount+1).length;this._animate(this.currentPos);this._check();this.fireEvent("onPrevious",this,20);break;case"imanual":(this.currentPos-=this.options.slideCount,(this.currentPos<0)?this.currentPos=0:this.currentPos=this.currentPos);this._showImg(this.currentPos,this.options.showCount);this.fireEvent("onPrevious",this,20);break}},_next:function(){switch(this.options.type){case"auto":this.atScreen+=this.options.slideCount;if(this.atScreen>this.aItems.length*2/3){this.container.setStyle(this.options.direction,-this.options.size*this.aItems.length/3);this.atScreen=this.aItems.length/3+this.options.slideCount}this._animate(this.atScreen);this.fireEvent("onNext",this,20);break;case"slide":break;case"manual":this.currentPos+=this.options.slideCount;this.dataLength=this.imgArray.slice(this.currentPos,this.currentPos+this.options.showCount+1).length;this._animate(this.currentPos);this._check();this.fireEvent("onNext",this,20);break;case"imanual":this.currentPos+=this.options.slideCount;this._showImg(this.currentPos,this.options.showCount);this.fireEvent("onNext",this,20);break}},_showImg:function(H,G){var D=[],F,E,C;var A=this.imgArray.slice(H,H+G+1);this.dataLength=A.length;var B=this.options.itemHTML.split("{0}");F=B[0];E=B[1];C=B[2];A.each(function(J,I){D.push('<li class="'+this.options.klass+'">'+F+J.href+E+J.src+C+"</li>")},this);this.container.set("html",D.join(""));this._check();return this},_check:function(){if($(this.options.idPrevious).hasClass(this.options.unableClass)){$(this.options.idPrevious).removeClass(this.options.unableClass)}if($(this.options.idNext).hasClass(this.options.unableClass)){$(this.options.idNext).removeClass(this.options.unableClass)}if(this.currentPos==0){$(this.options.idPrevious).addClass(this.options.unableClass)}if(this.dataLength<=this.options.showCount){$(this.options.idNext).addClass(this.options.unableClass)}if((this.currentPos<=this.defaultPos)&&(this.defaultPos<this.currentPos+this.options.showCount)){this.container.getElements("li")[this.defaultPos-this.currentPos].className=this.options.selectClass}},_autoRotate:function(){if(!this.isMouseOver){this._next()}},_animate:function(A){var B=this;if(B.options.direction=="top"){B.fx.start({top:-A*B.options.size})}else{B.fx.start({left:-A*B.options.size})}},_animateImg:function(A,B){this.itemFx=new Fx.Tween(this.container.getFirst(),$merge({duration:100,transition:Fx.Transitions.Quad.easeOut,wait:false},this.options.itemFx));(A)?this.itemFx.start((this.options.direction=="left")?"width":"height",[this.options.size,1]).chain(function(){this._showImg(B,this.options.showCount)}.bind(this)):this.itemFx.start((this.options.direction=="left")?"width":"height",[1,this.options.size])}});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:{},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"}}).inject(document.body);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}},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])},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.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").get("html");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 E=this.element.getCoordinates(),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,{left:E.left+this.options.adjust.x,top:E.bottom+this.options.adjust.y,width:(A===true||A=="inherit")?E.width:A});if(!this.visible){this.visible=true;this.choices.setStyles(B);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 style="float:right;color:#777">'+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("")}});