var Prototype={Version:"1.5.1.1",Description:"Prototype JavaScript framework, version 1.5.1.1 (c) 2005-2007 Sam Stephenson,Prototype is freely distributable under the terms of an MIT-style license.For details, see the Prototype web site: http://www.prototypejs.org/",Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,iPhone:navigator.userAgent.indexOf("iPhone")>-1,iPad:navigator.userAgent.indexOf("iPad")>-1,iPod:navigator.userAgent.indexOf("iPod")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:(document.createElement("div").__proto__!==document.createElement("form").__proto__)},ScriptFragment:"<script[^>]*>([\\S\\s]*?)</script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(B){return B;}};var Class={create:function(){return function(){this.initialize.apply(this,arguments);};}};var Abstract=new Object();Object.extend=function(D,F){for(var E in F){D[E]=F[E];}return D;};Object.extend(Object,{inspect:function(C){try{if(C===undefined){return"undefined";}if(C===null){return"null";}return C.inspect?C.inspect():C.toString();}catch(D){if(D instanceof RangeError){return"...";}throw D;}},toJSON:function(I){var G=typeof I;switch(G){case"undefined":case"function":case"unknown":return;case"boolean":return I.toString();}if(I===null){return"null";}if(I.toJSON){return I.toJSON();}if(I.ownerDocument===document){return;}var J=[];for(var H in I){var F=Object.toJSON(I[H]);if(F!==undefined){J.push(H.toJSON()+": "+F);}}return"{"+J.join(", ")+"}";},keys:function(F){var D=[];for(var E in F){D.push(E);}return D;},values:function(E){var F=[];for(var D in E){F.push(E[D]);}return F;},clone:function(B){return Object.extend({},B);}});Function.prototype.bind=function(){var D=this,F=$A(arguments),E=F.shift();return function(){return D.apply(E,F.concat($A(arguments)));};};Function.prototype.bindAsEventListener=function(E){var D=this,F=$A(arguments),E=F.shift();return function(A){return D.apply(E,[A||window.event].concat(F));};};Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16);},succ:function(){return this+1;},times:function(B){$R(0,this,true).each(B);return this;},toPaddedString:function(F,D){var E=this.toString(D||10);return"0".times(F-E.length)+E;},toJSON:function(){return isFinite(this)?this.toString():"null";}});Date.prototype.toJSON=function(){return'"'+this.getFullYear()+"-"+(this.getMonth()+1).toPaddedString(2)+"-"+this.getDate().toPaddedString(2)+"T"+this.getHours().toPaddedString(2)+":"+this.getMinutes().toPaddedString(2)+":"+this.getSeconds().toPaddedString(2)+'"';};var Try={these:function(){var F;for(var H=0,J=arguments.length;H<J;H++){var G=arguments[H];try{F=G();break;}catch(I){}}return F;}};var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(D,C){this.callback=D;this.frequency=C;this.currentlyExecuting=false;this.registerCallback();},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},stop:function(){if(!this.timer){return;}clearInterval(this.timer);this.timer=null;},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback(this);}finally{this.currentlyExecuting=false;}}}};Object.extend(String,{interpret:function(B){return B==null?"":String(B);},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,{gsub:function(G,I){var F="",J=this,H;I=arguments.callee.prepareReplacement(I);while(J.length>0){if(H=J.match(G)){F+=J.slice(0,H.index);F+=String.interpret(I(H));J=J.slice(H.index+H[0].length);}else{F+=J,J="";}}return F;},sub:function(E,F,D){F=this.gsub.prepareReplacement(F);D=D===undefined?1:D;return this.gsub(E,function(A){if(--D<0){return A[0];}return F(A);});},scan:function(D,C){this.gsub(D,C);return this;},truncate:function(D,C){D=D||30;C=C===undefined?"...":C;return this.length>D?this.slice(0,D-C.length)+C:this;},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"");},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"");},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");},extractScripts:function(){var C=new RegExp(Prototype.ScriptFragment,"img");var D=new RegExp(Prototype.ScriptFragment,"im");return(this.match(C)||[]).map(function(A){return(A.match(D)||["",""])[1];});},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script);});},escapeHTML:function(){var B=arguments.callee;B.text.data=this;return B.div.innerHTML;},unescapeHTML:function(){var B=document.createElement("div");B.innerHTML=this.stripTags();return B.childNodes[0]?(B.childNodes.length>1?$A(B.childNodes).inject("",function(A,D){return A+D.nodeValue;}):B.childNodes[0].nodeValue):"";},toQueryParams:function(C){var D=this.strip().match(/([^?#]*)(#.*)?$/);if(!D){return{};}return D[1].split(C||"&").inject({},function(B,A){if((A=A.split("="))[0]){var G=decodeURIComponent(A.shift());var H=A.length>1?A.join("="):A[0];if(H!=undefined){H=decodeURIComponent(H);}if(G in B){if(B[G].constructor!=Array){B[G]=[B[G]];}B[G].push(H);}else{B[G]=H;}}return B;});},toArray:function(){return this.split("");},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1);},times:function(D){var E="";for(var F=0;F<D;F++){E+=this;}return E;},camelize:function(){var G=this.split("-"),E=G.length;if(E==1){return G[0];}var H=this.charAt(0)=="-"?G[0].charAt(0).toUpperCase()+G[0].substring(1):G[0];for(var F=1;F<E;F++){H+=G[F].charAt(0).toUpperCase()+G[F].substring(1);}return H;},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase();},dasherize:function(){return this.gsub(/_/,"-");},inspect:function(C){var D=this.gsub(/[\x00-\x1f\\]/,function(A){var B=String.specialChar[A[0]];return B?B:"\\u00"+A[0].charCodeAt().toPaddedString(2,16);});if(C){return'"'+D.replace(/"/g,'\\"')+'"';}return"'"+D.replace(/'/g,"\\'")+"'";},toJSON:function(){return this.inspect(true);},unfilterJSON:function(B){return this.sub(B||Prototype.JSONFilter,"#{1}");},isJSON:function(){var B=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(B);},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")");}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect());},include:function(B){return this.indexOf(B)>-1;},startsWith:function(B){return this.indexOf(B)===0;},endsWith:function(C){var D=this.length-C.length;return D>=0&&this.lastIndexOf(C)===D;},empty:function(){return this=="";},blank:function(){return/^\s*$/.test(this);}});String.prototype.gsub.prepareReplacement=function(D){if(typeof D=="function"){return D;}var C=new Template(D);return function(A){return C.evaluate(A);};};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});with(String.prototype.escapeHTML){div.appendChild(text);}var Template=Class.create();Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;Template.prototype={initialize:function(C,D){this.template=C.toString();this.pattern=D||Template.Pattern;},evaluate:function(B){return this.template.gsub(this.pattern,function(D){var A=D[1];if(A=="\\"){return D[2];}return A+String.interpret(B[D[3]]);});}};var $break={},$continue=new Error('"throw $continue" is deprecated, use "return" instead');var Enumerable={each:function(D){var F=0;try{this._each(function(A){D(A,F++);});}catch(E){if(E!=$break){throw E;}}return this;},eachSlice:function(H,F){var J=-H,G=[],I=this.toArray();while((J+=H)<I.length){G.push(I.slice(J,J+H));}return G.map(F);},all:function(C){var D=true;this.each(function(A,B){D=D&&!!(C||Prototype.K)(A,B);if(!D){throw $break;}});return D;},any:function(C){var D=false;this.each(function(A,B){if(D=!!(C||Prototype.K)(A,B)){throw $break;}});return D;},collect:function(C){var D=[];this.each(function(A,B){D.push((C||Prototype.K)(A,B));});return D;},detect:function(C){var D;this.each(function(A,B){if(C(A,B)){D=A;throw $break;}});return D;},findAll:function(C){var D=[];this.each(function(A,B){if(C(A,B)){D.push(A);}});return D;},grep:function(E,D){var F=[];this.each(function(A,C){var B=A.toString();if(B.match(E)){F.push((D||Prototype.K)(A,C));}});return F;},include:function(D){var C=false;this.each(function(A){if(A==D){C=true;throw $break;}});return C;},inGroupsOf:function(D,C){C=C===undefined?null:C;return this.eachSlice(D,function(A){while(A.length<D){A.push(C);}return A;});},inject:function(D,C){this.each(function(A,B){D=C(D,A,B);});return D;},invoke:function(C){var D=$A(arguments).slice(1);return this.map(function(A){return A[C].apply(A,D);});},max:function(C){var D;this.each(function(A,B){A=(C||Prototype.K)(A,B);if(D==undefined||A>=D){D=A;}});return D;},min:function(C){var D;this.each(function(A,B){A=(C||Prototype.K)(A,B);if(D==undefined||A<D){D=A;}});return D;},partition:function(D){var F=[],E=[];this.each(function(A,B){((D||Prototype.K)(A,B)?F:E).push(A);});return[F,E];},pluck:function(C){var D=[];this.each(function(A,B){D.push(A[C]);});return D;},reject:function(C){var D=[];this.each(function(A,B){if(!C(A,B)){D.push(A);}});return D;},sortBy:function(B){return this.map(function(A,D){return{value:A,criteria:B(A,D)};}).sort(function(H,A){var F=H.criteria,G=A.criteria;return F<G?-1:F>G?1:0;}).pluck("value");},toArray:function(){return this.map();},zip:function(){var E=Prototype.K,F=$A(arguments);if(typeof F.last()=="function"){E=F.pop();}var D=[this].concat(F).map($A);return this.map(function(A,B){return E(D.pluck(B));});},size:function(){return this.toArray().length;},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">";}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(H){if(!H){return[];}if(H.toArray){return H.toArray();}else{var G=[];for(var F=0,E=H.length;F<E;F++){G.push(H[F]);}return G;}};if(Prototype.Browser.WebKit){$A=Array.from=function(H){if(!H){return[];}if(!(typeof H=="function"&&H=="[object NodeList]")&&H.toArray){return H.toArray();}else{var G=[];for(var F=0,E=H.length;F<E;F++){G.push(H[F]);}return G;}};}Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse;}Object.extend(Array.prototype,{_each:function(D){for(var E=0,F=this.length;E<F;E++){D(this[E]);}},clear:function(){this.length=0;return this;},first:function(){return this[0];},last:function(){return this[this.length-1];},compact:function(){return this.select(function(B){return B!=null;});},flatten:function(){return this.inject([],function(D,C){return D.concat(C&&C.constructor==Array?C.flatten():[C]);});},without:function(){var B=$A(arguments);return this.select(function(A){return !B.include(A);});},indexOf:function(D){for(var E=0,F=this.length;E<F;E++){if(this[E]==D){return E;}}return -1;},reverse:function(B){return(B!==false?this:this.toArray())._reverse();},reduce:function(){return this.length>1?this:this[0];},uniq:function(B){return this.inject([],function(F,A,E){if(0==E||(B?F.last()!=A:!F.include(A))){F.push(A);}return F;});},clone:function(){return[].concat(this);},size:function(){return this.length;},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]";},toJSON:function(){var B=[];this.each(function(D){var A=Object.toJSON(D);if(A!==undefined){B.push(A);}});return"["+B.join(", ")+"]";}});Array.prototype.toArray=Array.prototype.clone;function $w(B){B=B.strip();return B?B.split(/\s+/):[];}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var J=[];for(var H=0,G=this.length;H<G;H++){J.push(this[H]);}for(var H=0,G=arguments.length;H<G;H++){if(arguments[H].constructor==Array){for(var I=0,F=arguments[H].length;I<F;I++){J.push(arguments[H][I]);}}else{J.push(arguments[H]);}}return J;};}var Hash=function(B){if(B instanceof Hash){this.merge(B);}else{Object.extend(this,B||{});}};Object.extend(Hash,{toQueryString:function(D){var C=[];C.add=arguments.callee.addPair;this.prototype._each.call(D,function(A){if(!A.key){return;}var B=A.value;if(B&&typeof B=="object"){if(B.constructor==Array){B.each(function(F){C.add(A.key,F);});}return;}C.add(A.key,B);});return C.join("&");},toJSON:function(C){var D=[];this.prototype._each.call(C,function(A){var B=Object.toJSON(A.value);if(B!==undefined){D.push(A.key.toJSON()+": "+B);}});return"{"+D.join(", ")+"}";}});Hash.toQueryString.addPair=function(E,D,F){E=encodeURIComponent(E);if(D===undefined){this.push(E);}else{this.push(E+"="+(D==null?"":encodeURIComponent(D)));}};Object.extend(Hash.prototype,Enumerable);Object.extend(Hash.prototype,{_each:function(F){for(var G in this){var H=this[G];if(H&&H==Hash.prototype[G]){continue;}var E=[G,H];E.key=G;E.value=H;F(E);}},keys:function(){return this.pluck("key");},values:function(){return this.pluck("value");},merge:function(B){return $H(B).inject(this,function(D,A){D[A.key]=A.value;return D;});},remove:function(){var F;for(var G=0,H=arguments.length;G<H;G++){var E=this[arguments[G]];if(E!==undefined){if(F===undefined){F=E;}else{if(F.constructor!=Array){F=[F];}F.push(E);}}delete this[arguments[G]];}return F;},toQueryString:function(){return Hash.toQueryString(this);},inspect:function(){return"#<Hash:{"+this.map(function(B){return B.map(Object.inspect).join(": ");}).join(", ")+"}>";},toJSON:function(){return Hash.toJSON(this);}});function $H(B){if(B instanceof Hash){return B;}return new Hash(B);}if(function(){var F=0,E=function(A){this.key=A;};E.prototype.key="foo";for(var D in new E("bar")){F++;}return F>1;}()){Hash.prototype._each=function(G){var I=[];for(var H in this){var J=this[H];if((J&&J==Hash.prototype[H])||I.include(H)){continue;}I.push(H);var F=[H,J];F.key=H;F.value=J;G(F);}};}ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(E,F,D){this.start=E;this.end=F;this.exclusive=D;},_each:function(C){var D=this.start;while(this.include(D)){C(D);D=D.succ();}},include:function(B){if(B<this.start){return false;}if(this.exclusive){return B<this.end;}return B<=this.end;}});var $R=function(E,F,D){return new ObjectRange(E,F,D);};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("Msxml2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");})||false;},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(B){this.responders._each(B);},register:function(B){if(!this.include(B)){this.responders.push(B);}},unregister:function(B){this.responders=this.responders.without(B);},dispatch:function(H,F,G,E){this.each(function(A){if(typeof A[H]=="function"){try{A[H].apply(A,[F,G,E]);}catch(B){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++;},onComplete:function(){Ajax.activeRequestCount--;}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(B){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:""};Object.extend(this.options,B||{});this.options.method=this.options.method.toLowerCase();if(typeof this.options.parameters=="string"){this.options.parameters=this.options.parameters.toQueryParams();}}};Ajax.Request=Class.create();Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{_complete:false,initialize:function(C,D){this.transport=Ajax.getTransport();this.setOptions(D);this.request(C);},request:function(E){this.url=E;this.method=this.options.method;var D=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){D["_method"]=this.method;this.method="post";}this.parameters=D;if(D=Hash.toQueryString(D)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+D;}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){D+="&_=";}}}try{if(this.options.onCreate){this.options.onCreate(this.transport);}Ajax.Responders.dispatch("onCreate",this,this.transport);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){setTimeout(function(){this.respondToReadyState(1);}.bind(this),10);}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||D):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange();}}catch(F){this.dispatchException(F);}},onStateChange:function(){var B=this.transport.readyState;if(B>1&&!((B==4)&&this._complete)){this.respondToReadyState(this.transport.readyState);}},setRequestHeaders:function(){var I={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){I["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){I["Connection"]="close";}}if(typeof this.options.requestHeaders=="object"){var J=this.options.requestHeaders;if(typeof J.push=="function"){for(var H=0,G=J.length;H<G;H+=2){I[J[H]]=J[H+1];}}else{$H(J).each(function(A){I[A.key]=A.value;});}}for(var F in I){this.transport.setRequestHeader(F,I[F]);}},success:function(){return !this.transport.status||(this.transport.status>=200&&this.transport.status<300);},respondToReadyState:function(G){var F=Ajax.Request.Events[G];var J=this.transport,H=this.evalJSON();if(F=="Complete"){try{this._complete=true;(this.options["on"+this.transport.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(J,H);}catch(I){this.dispatchException(I);}}try{(this.options["on"+F]||Prototype.emptyFunction)(J,H,this.options);Ajax.Responders.dispatch("on"+F,this,J,H);}catch(I){this.dispatchException(I);}if(F=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction;}},getHeader:function(C){try{return this.transport.getResponseHeader(C);}catch(D){return null;}},evalJSON:function(){try{var C=this.getHeader("X-JSON");return C?C.evalJSON():null;}catch(D){return null;}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON());}catch(e){this.dispatchException(e);}},dispatchException:function(B){(this.options.onException||Prototype.emptyFunction)(this,B);Ajax.Responders.dispatch("onException",this,B);}});function $(G){if(arguments.length>1){for(var E=0,F=[],H=arguments.length;E<H;E++){F.push($(arguments[E]));}return F;}if(typeof G=="string"){G=document.getElementById(G);}return Element.extend(G);}if(!window.Element){var Element={};}Element.extend=function(P){var F=Prototype.BrowserFeatures;if(!P||!P.tagName||P.nodeType==3||P._extended||F.SpecificElementExtensions||P==window){return P;}var N={},J=P.tagName,O=Element.extend.cache,L=Element.Methods.ByTag;if(!F.ElementExtensions){Object.extend(N,Element.Methods),Object.extend(N,Element.Methods.Simulated);}if(L[J]){Object.extend(N,L[J]);}for(var M in N){var K=N[M];if(typeof K=="function"&&!(M in P)){P[M]=O.findOrStore(K);}}P._extended=Prototype.emptyFunction;return P;};Element.extend.cache={findOrStore:function(B){return this[B]=this[B]||function(){return B.apply(null,[this].concat($A(arguments)));};}};Element.Methods={visible:function(B){return $(B).style.display!="none";},toggle:function(B){B=$(B);Element[Element.visible(B)?"hide":"show"](B);return B;},hide:function(B){$(B).style.display="none";return B;},show:function(B){$(B).style.display="";return B;},remove:function(B){B=$(B);B.parentNode.removeChild(B);return B;},update:function(D,C){C=typeof C=="undefined"?"":C.toString();$(D).innerHTML=C.stripScripts();setTimeout(function(){C.evalScripts();},10);return D;},replace:function(F,E){F=$(F);E=typeof E=="undefined"?"":E.toString();if(F.outerHTML){F.outerHTML=E.stripScripts();}else{var D=F.ownerDocument.createRange();D.selectNodeContents(F);F.parentNode.replaceChild(D.createContextualFragment(E.stripScripts()),F);}setTimeout(function(){E.evalScripts();},10);return F;},inspect:function(D){D=$(D);var C="<"+D.tagName.toLowerCase();$H({"id":"id","className":"class"}).each(function(A){var G=A.first(),B=A.last();var H=(D[G]||"").toString();if(H){C+=" "+B+"="+H.inspect(true);}});return C+">";},recursivelyCollect:function(F,E){F=$(F);var D=[];while(F=F[E]){if(F.nodeType==1){D.push(Element.extend(F));}}return D;},ancestors:function(B){return $(B).recursivelyCollect("parentNode");},descendants:function(B){return $A($(B).getElementsByTagName("*")).each(Element.extend);},firstDescendant:function(B){B=$(B).firstChild;while(B&&B.nodeType!=1){B=B.nextSibling;}return $(B);},immediateDescendants:function(B){if(!(B=$(B).firstChild)){return[];}while(B&&B.nodeType!=1){B=B.nextSibling;}if(B){return[B].concat($(B).nextSiblings());}return[];},previousSiblings:function(B){return $(B).recursivelyCollect("previousSibling");},nextSiblings:function(B){return $(B).recursivelyCollect("nextSibling");},siblings:function(B){B=$(B);return B.previousSiblings().reverse().concat(B.nextSiblings());},match:function(D,C){if(typeof C=="string"){C=new Selector(C);}return C.match($(D));},up:function(F,H,G){F=$(F);if(arguments.length==1){return $(F.parentNode);}var E=F.ancestors();return H?Selector.findElement(E,H,G):E[G||0];},down:function(F,H,G){F=$(F);if(arguments.length==1){return F.firstDescendant();}var E=F.descendants();return H?Selector.findElement(E,H,G):E[G||0];},previous:function(F,H,G){F=$(F);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(F));}var E=F.previousSiblings();return H?Selector.findElement(E,H,G):E[G||0];},next:function(E,H,G){E=$(E);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(E));}var F=E.nextSiblings();return H?Selector.findElement(F,H,G):F[G||0];},getElementsBySelector:function(){var C=$A(arguments),D=$(C.shift());return Selector.findChildElements(D,C);},readAttribute:function(H,F){H=$(H);if(Prototype.Browser.IE){if(!H.attributes){return null;}var G=Element._attributeTranslations;if(G.values[F]){return G.values[F](H,F);}if(G.names[F]){F=G.names[F];}var E=H.attributes[F];return E?E.nodeValue:null;}return H.getAttribute(F);},getHeight:function(B){return $(B).getDimensions().height;},getWidth:function(B){return $(B).getDimensions().width;},classNames:function(B){return new Element.ClassNames(B);},hasClassName:function(F,E){if(!(F=$(F))){return;}var D=F.className;if(D.length==0){return false;}if(D==E||D.match(new RegExp("(^|\\s)"+E+"(\\s|$)"))){return true;}return false;},addClassName:function(D,C){if(!(D=$(D))){return;}Element.classNames(D).add(C);return D;},removeClassName:function(D,C){if(!(D=$(D))){return;}Element.classNames(D).remove(C);return D;},toggleClassName:function(D,C){if(!(D=$(D))){return;}Element.classNames(D)[D.hasClassName(C)?"remove":"add"](C);return D;},observe:function(){Event.observe.apply(Event,arguments);return $A(arguments).first();},stopObserving:function(){Event.stopObserving.apply(Event,arguments);return $A(arguments).first();},cleanWhitespace:function(E){E=$(E);var F=E.firstChild;while(F){var D=F.nextSibling;if(F.nodeType==3&&!/\S/.test(F.nodeValue)){E.removeChild(F);}F=D;}return E;},empty:function(B){return $(B).innerHTML.blank();},descendantOf:function(C,D){C=$(C),D=$(D);while(C=C.parentNode){if(C==D){return true;}}return false;},scrollTo:function(D){D=$(D);var C=Position.cumulativeOffset(D);window.scrollTo(C[0],C[1]);return D;},getStyle:function(H,F){H=$(H);F=F=="float"?"cssFloat":F.camelize();var E=H.style[F];if(!E){var G=document.defaultView.getComputedStyle(H,null);E=G?G[F]:null;}if(F=="opacity"){return E?parseFloat(E):1;}return E=="auto"?null:E;},getOpacity:function(B){return $(B).getStyle("opacity");},setStyle:function(J,G,F){J=$(J);var I=J.style;for(var H in G){if(H=="opacity"){J.setOpacity(G[H]);}else{I[(H=="float"||H=="cssFloat")?(I.styleFloat===undefined?"cssFloat":"styleFloat"):(F?H:H.camelize())]=G[H];}}return J;},setOpacity:function(D,C){D=$(D);D.style.opacity=(C==1||C==="")?"":(C<1e-05)?0:C;return D;},getDimensions:function(P){P=$(P);var L=$(P).getStyle("display");if(L!="none"&&L!=null){return{width:P.offsetWidth,height:P.offsetHeight};}var I=P.style;var J=I.visibility;var N=I.position;var M=I.display;I.visibility="hidden";I.position="absolute";I.display="block";var O=P.clientWidth;var K=P.clientHeight;I.display=M;I.position=N;I.visibility=J;return{width:O,height:K};},makePositioned:function(D){D=$(D);var C=Element.getStyle(D,"position");if(C=="static"||!C){D._madePositioned=true;D.style.position="relative";if(window.opera){D.style.top=0;D.style.left=0;}}return D;},undoPositioned:function(B){B=$(B);if(B._madePositioned){B._madePositioned=undefined;B.style.position=B.style.top=B.style.left=B.style.bottom=B.style.right="";}return B;},makeClipping:function(B){B=$(B);if(B._overflow){return B;}B._overflow=B.style.overflow||"auto";if((Element.getStyle(B,"overflow")||"visible")!="hidden"){B.style.overflow="hidden";}return B;},undoClipping:function(B){B=$(B);if(!B._overflow){return B;}B.style.overflow=B._overflow=="auto"?"":B._overflow;B._overflow=null;return B;}};Object.extend(Element.Methods,{childOf:Element.Methods.descendantOf,childElements:Element.Methods.immediateDescendants});if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(L,I){var J=[];var G=document.evaluate(L,$(I)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var H=0,K=G.snapshotLength;H<K;H++){J.push(G.snapshotItem(H));}return J;};}if(!document.getElementsByClassName){if(Prototype.BrowserFeatures.XPath){document.getElementsByClassName=function(D,F){var E=".//*[contains(concat(' ', @class, ' '), ' "+D+" ')]";return document._getElementsByXPath(E,F);};}else{document.getElementsByClassName=function(Q,M){var J=($(M)||document.body).getElementsByTagName("*");var K=[],P,N=new RegExp("(^|\\s)"+Q+"(\\s|$)");for(var R=0,O=J.length;R<O;R++){P=J[R];var L=P.className;if(L.length==0){continue;}if(L==Q||L.match(N)){K.push(Element.extend(P));}}return K;};}Object.extend(Element.Methods,{getElementsByClassName:function(D,C){return document.getElementsByClassName(C,D);}});}if(Prototype.Browser.Opera){Element.Methods._getStyle=Element.Methods.getStyle;Element.Methods.getStyle=function(D,C){switch(C){case"left":case"top":case"right":case"bottom":if(Element._getStyle(D,"position")=="static"){return null;}default:return Element._getStyle(D,C);}};}else{if(Prototype.Browser.IE){Element.Methods.getStyle=function(F,E){F=$(F);E=(E=="float"||E=="cssFloat")?"styleFloat":E.camelize();var D=F.style[E];if(!D&&F.currentStyle){D=F.currentStyle[E];}if(E=="opacity"){if(D=(F.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(D[1]){return parseFloat(D[1])/100;}}return 1;}if(D=="auto"){if((E=="width"||E=="height")&&(F.getStyle("display")!="none")){return F["offset"+E.capitalize()]+"px";}return null;}return D;};Element.Methods.setOpacity=function(G,E){G=$(G);var H=G.getStyle("filter"),F=G.style;if(E==1||E===""){F.filter=H.replace(/alpha\([^\)]*\)/gi,"");return G;}else{if(E<1e-05){E=0;}}F.filter=H.replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+(E*100)+")";return G;};Element.Methods.update=function(G,F){G=$(G);F=typeof F=="undefined"?"":F.toString();var H=G.tagName.toUpperCase();if(["THEAD","TBODY","TR","TD"].include(H)){var E=document.createElement("div");switch(H){case"THEAD":case"TBODY":E.innerHTML="<table><tbody>"+F.stripScripts()+"</tbody></table>";depth=2;break;case"TR":E.innerHTML="<table><tbody><tr>"+F.stripScripts()+"</tr></tbody></table>";depth=3;break;case"TD":E.innerHTML="<table><tbody><tr><td>"+F.stripScripts()+"</td></tr></tbody></table>";depth=4;}$A(G.childNodes).each(function(A){G.removeChild(A);});depth.times(function(){E=E.firstChild;});$A(E.childNodes).each(function(A){G.appendChild(A);});}else{G.innerHTML=F.stripScripts();}setTimeout(function(){F.evalScripts();},10);return G;};}else{if(Prototype.Browser.Gecko){Element.Methods.setOpacity=function(D,C){D=$(D);D.style.opacity=(C==1)?0.999999:(C==="")?"":(C<1e-05)?0:C;return D;};}}}Element._attributeTranslations={names:{colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",readonly:"readOnly",longdesc:"longDesc"},values:{_getAttr:function(D,C){return D.getAttribute(C,2);},_flag:function(D,C){return $(D).hasAttribute(C)?C:null;},style:function(B){return B.style.cssText.toLowerCase();},title:function(C){var D=C.getAttributeNode("title");return D.specified?D.nodeValue:null;}}};(function(){Object.extend(this,{href:this._getAttr,src:this._getAttr,type:this._getAttr,disabled:this._flag,checked:this._flag,readonly:this._flag,multiple:this._flag});}).call(Element._attributeTranslations.values);Element.Methods.Simulated={hasAttribute:function(G,E){var F=Element._attributeTranslations,H;E=F.names[E]||E;H=$(G).getAttributeNode(E);return H&&H.specified;}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div").__proto__){window.HTMLElement={};window.HTMLElement.prototype=document.createElement("div").__proto__;Prototype.BrowserFeatures.ElementExtensions=true;}Element.hasAttribute=function(D,C){if(D.hasAttribute){return D.hasAttribute(C);}return Element.Methods.Simulated.hasAttribute(D,C);};Element.addMethods=function(O){var K=Prototype.BrowserFeatures,R=Element.Methods.ByTag;if(!O){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{"FORM":Object.clone(Form.Methods),"INPUT":Object.clone(Form.Element.Methods),"SELECT":Object.clone(Form.Element.Methods),"TEXTAREA":Object.clone(Form.Element.Methods)});}if(arguments.length==2){var L=O;O=arguments[1];}if(!L){Object.extend(Element.Methods,O||{});}else{if(L.constructor==Array){L.each(F);}else{F(L);}}function F(A){A=A.toUpperCase();if(!Element.Methods.ByTag[A]){Element.Methods.ByTag[A]={};}Object.extend(Element.Methods.ByTag[A],O);}function Q(B,A,C){C=C||false;var G=Element.extend.cache;for(var E in B){var D=B[E];if(!C||!(E in A)){A[E]=G.findOrStore(D);}}}function M(A){var C;var B={"OPTGROUP":"OptGroup","TEXTAREA":"TextArea","P":"Paragraph","FIELDSET":"FieldSet","UL":"UList","OL":"OList","DL":"DList","DIR":"Directory","H1":"Heading","H2":"Heading","H3":"Heading","H4":"Heading","H5":"Heading","H6":"Heading","Q":"Quote","INS":"Mod","DEL":"Mod","A":"Anchor","IMG":"Image","CAPTION":"TableCaption","COL":"TableCol","COLGROUP":"TableCol","THEAD":"TableSection","TFOOT":"TableSection","TBODY":"TableSection","TR":"TableRow","TH":"TableCell","TD":"TableCell","FRAMESET":"FrameSet","IFRAME":"IFrame"};if(B[A]){C="HTML"+B[A]+"Element";}if(window[C]){return window[C];}C="HTML"+A+"Element";if(window[C]){return window[C];}C="HTML"+A.capitalize()+"Element";if(window[C]){return window[C];}window[C]={};window[C].prototype=document.createElement(A).__proto__;return window[C];}if(K.ElementExtensions){Q(Element.Methods,HTMLElement.prototype);Q(Element.Methods.Simulated,HTMLElement.prototype,true);}if(K.SpecificElementExtensions){for(var N in Element.Methods.ByTag){var P=M(N);if(typeof P=="undefined"){continue;}Q(R[N],P.prototype);}}Object.extend(Element,Element.Methods);delete Element.ByTag;};var Toggle={display:Element.toggle};Abstract.Insertion=function(B){this.adjacency=B;};Abstract.Insertion.prototype={initialize:function(F,E){this.element=$(F);this.content=E.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content);}catch(G){var H=this.element.tagName.toUpperCase();if(["TBODY","TR"].include(H)){this.insertContent(this.contentFromAnonymousTable());}else{throw G;}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange){this.initializeRange();}this.insertContent([this.range.createContextualFragment(this.content)]);}setTimeout(function(){E.evalScripts();},10);},contentFromAnonymousTable:function(){var B=document.createElement("div");B.innerHTML="<table><tbody>"+this.content+"</tbody></table>";return $A(B.childNodes[0].childNodes[0].childNodes);}};var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){this.range.setStartBefore(this.element);},insertContent:function(B){B.each((function(A){this.element.parentNode.insertBefore(A,this.element);}).bind(this));}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true);},insertContent:function(B){B.reverse(false).each((function(A){this.element.insertBefore(A,this.element.firstChild);}).bind(this));}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element);},insertContent:function(B){B.each((function(A){this.element.appendChild(A);}).bind(this));}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){this.range.setStartAfter(this.element);},insertContent:function(B){B.each((function(A){this.element.parentNode.insertBefore(A,this.element.nextSibling);}).bind(this));}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(B){this.element=$(B);},_each:function(B){this.element.className.split(/\s+/).select(function(A){return A.length>0;})._each(B);},set:function(B){this.element.className=B;},add:function(B){if(this.include(B)){return;}this.set($A(this).concat(B).join(" "));},remove:function(B){if(!this.include(B)){return;}this.set($A(this).without(B).join(" "));},toString:function(){return $A(this).join(" ");}};Object.extend(Element.ClassNames.prototype,Enumerable);var Selector=Class.create();Selector.prototype={initialize:function(B){this.expression=B.strip();this.compileMatcher();},compileMatcher:function(){if(Prototype.BrowserFeatures.XPath&&!(/\[[\w-]*?:/).test(this.expression)){return this.compileXPathMatcher();}var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return;}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(typeof c[i]=="function"?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],"");break;}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher;},compileXPathMatcher:function(){var K=this.expression,G=Selector.patterns,H=Selector.xpath,L,J;if(Selector._cache[K]){this.xpath=Selector._cache[K];return;}this.matcher=[".//*"];while(K&&L!=K&&(/\S/).test(K)){L=K;for(var I in G){if(J=K.match(G[I])){this.matcher.push(typeof H[I]=="function"?H[I](J):new Template(H[I]).evaluate(J));K=K.replace(J[0],"");break;}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath;},findElements:function(B){B=B||document;if(this.xpath){return document._getElementsByXPath(this.xpath,B);}return this.matcher(B);},match:function(B){return this.findElements(document).include(B);},toString:function(){return this.expression;},inspect:function(){return"#<Selector:"+this.expression.inspect()+">";}};Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(B){if(B[1]=="*"){return"";}return"[local-name()='"+B[1].toLowerCase()+"' or local-name()='"+B[1].toUpperCase()+"']";},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:"[@#{1}]",attr:function(B){B[3]=B[5]||B[6];return new Template(Selector.xpath.operators[B[2]]).evaluate(B);},pseudo:function(C){var D=Selector.xpath.pseudos[C[1]];if(!D){return"";}if(typeof D==="function"){return D(C);}return new Template(Selector.xpath.pseudos[C[1]]).evaluate(C);},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]","empty":"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]","checked":"[@checked]","disabled":"[@disabled]","enabled":"[not(@disabled)]","not":function(I){var K=I[6],M=Selector.patterns,J=Selector.xpath,L,I,O;var N=[];while(K&&L!=K&&(/\S/).test(K)){L=K;for(var P in M){if(I=K.match(M[P])){O=typeof J[P]=="function"?J[P](I):new Template(J[P]).evaluate(I);N.push("("+O.substring(1,O.length-1)+")");K=K.replace(I[0],"");break;}}}return"[not("+N.join(" and ")+")]";},"nth-child":function(B){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",B);},"nth-last-child":function(B){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",B);},"nth-of-type":function(B){return Selector.xpath.pseudos.nth("position() ",B);},"nth-last-of-type":function(B){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",B);},"first-of-type":function(B){B[6]="1";return Selector.xpath.pseudos["nth-of-type"](B);},"last-of-type":function(B){B[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](B);},"only-of-type":function(C){var D=Selector.xpath.pseudos;return D["first-of-type"](C)+D["last-of-type"](C);},nth:function(H,I){var L,N=I[6],K;if(N=="even"){N="2n+0";}if(N=="odd"){N="2n+1";}if(L=N.match(/^(\d+)$/)){return"["+H+"= "+L[1]+"]";}if(L=N.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(L[1]=="-"){L[1]=-1;}var J=L[1]?Number(L[1]):1;var M=L[2]?Number(L[2]):0;K="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(K).evaluate({fragment:H,a:J,b:M});}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);   c = false;',className:'n = h.className(n, r, "#{1}", c); c = false;',id:'n = h.id(n, r, "#{1}", c);        c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}"); c = false;',attr:function(B){B[3]=(B[5]||B[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(B);},pseudo:function(B){if(B[6]){B[6]=B[6].replace(/"/g,'\\"');}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(B);},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|\s|(?=:))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\]]*?)\4|([^'"][^\]]*?)))?\]/},handlers:{concat:function(E,F){for(var G=0,H;H=F[G];G++){E.push(H);}return E;},mark:function(D){for(var E=0,F;F=D[E];E++){F._counted=true;}return D;},unmark:function(D){for(var E=0,F;F=D[E];E++){F._counted=undefined;}return D;},index:function(L,I,H){L._counted=true;if(I){for(var J=L.childNodes,K=J.length-1,G=1;K>=0;K--){node=J[K];if(node.nodeType==1&&(!H||node._counted)){node.nodeIndex=G++;}}}else{for(var K=0,G=1,J=L.childNodes;node=J[K];K++){if(node.nodeType==1&&(!H||node._counted)){node.nodeIndex=G++;}}}},unique:function(G){if(G.length==0){return G;}var I=[],F;for(var H=0,J=G.length;H<J;H++){if(!(F=G[H])._counted){F._counted=true;I.push(Element.extend(F));}}return Selector.handlers.unmark(I);},descendant:function(F){var G=Selector.handlers;for(var H=0,I=[],J;J=F[H];H++){G.concat(I,J.getElementsByTagName("*"));}return I;},child:function(N){var O=Selector.handlers;for(var P=0,K=[],I;I=N[P];P++){for(var M=0,J=[],L;L=I.childNodes[M];M++){if(L.nodeType==1&&L.tagName!="!"){K.push(L);}}}return K;},adjacent:function(F){for(var G=0,H=[],J;J=F[G];G++){var I=this.nextElementSibling(J);if(I){H.push(I);}}return H;},laterSibling:function(F){var G=Selector.handlers;for(var H=0,I=[],J;J=F[H];H++){G.concat(I,Element.nextSiblings(J));}return I;},nextElementSibling:function(B){while(B=B.nextSibling){if(B.nodeType==1){return B;}}return null;},previousElementSibling:function(B){while(B=B.previousSibling){if(B.nodeType==1){return B;}}return null;},tagName:function(N,I,J,M){J=J.toUpperCase();var K=[],O=Selector.handlers;if(N){if(M){if(M=="descendant"){for(var P=0,L;L=N[P];P++){O.concat(K,L.getElementsByTagName(J));}return K;}else{N=this[M](N);}if(J=="*"){return N;}}for(var P=0,L;L=N[P];P++){if(L.tagName.toUpperCase()==J){K.push(L);}}return K;}else{return I.getElementsByTagName(J);}},id:function(N,L,I,M){var J=$(I),O=Selector.handlers;if(!N&&L==document){return J?[J]:[];}if(N){if(M){if(M=="child"){for(var P=0,K;K=N[P];P++){if(J.parentNode==K){return[J];}}}else{if(M=="descendant"){for(var P=0,K;K=N[P];P++){if(Element.descendantOf(J,K)){return[J];}}}else{if(M=="adjacent"){for(var P=0,K;K=N[P];P++){if(Selector.handlers.previousElementSibling(J)==K){return[J];}}}else{N=O[M](N);}}}}for(var P=0,K;K=N[P];P++){if(K==J){return[J];}}return[];}return(J&&Element.descendantOf(J,L))?[J]:[];},className:function(G,F,H,E){if(G&&E){G=this[E](G);}return Selector.handlers.byClassName(G,F,H);},byClassName:function(N,K,O){if(!N){N=Selector.handlers.descendant([K]);}var M=" "+O+" ";for(var P=0,J=[],I,L;I=N[P];P++){L=I.className;if(L.length==0){continue;}if(L==O||(" "+L+" ").include(M)){J.push(I);}}return J;},attrPresence:function(H,G,K){var J=[];for(var I=0,L;L=H[I];I++){if(Element.hasAttribute(L,K)){J.push(L);}}return J;},attr:function(O,K,L,P,M){if(!O){O=K.getElementsByTagName("*");}var S=Selector.operators[M],N=[];for(var T=0,Q;Q=O[T];T++){var R=Element.readAttribute(Q,L);if(R===null){continue;}if(S(R,P)){N.push(Q);}}return N;},pseudo:function(I,F,J,H,G){if(I&&G){I=this[G](I);}if(!I){I=H.getElementsByTagName("*");}return Selector.pseudos[F](I,J,H);}},pseudos:{"first-child":function(I,G,H){for(var J=0,K=[],L;L=I[J];J++){if(Selector.handlers.previousElementSibling(L)){continue;}K.push(L);}return K;},"last-child":function(I,G,H){for(var J=0,K=[],L;L=I[J];J++){if(Selector.handlers.nextElementSibling(L)){continue;}K.push(L);}return K;},"only-child":function(K,I,J){var L=Selector.handlers;for(var M=0,N=[],H;H=K[M];M++){if(!L.previousElementSibling(H)&&!L.nextElementSibling(H)){N.push(H);}}return N;},"nth-child":function(E,F,D){return Selector.pseudos.nth(E,F,D);},"nth-last-child":function(E,F,D){return Selector.pseudos.nth(E,F,D,true);},"nth-of-type":function(E,F,D){return Selector.pseudos.nth(E,F,D,false,true);},"nth-last-of-type":function(E,F,D){return Selector.pseudos.nth(E,F,D,true,true);},"first-of-type":function(E,F,D){return Selector.pseudos.nth(E,"1",D,false,true);},"last-of-type":function(E,F,D){return Selector.pseudos.nth(E,"1",D,true,true);},"only-of-type":function(F,H,E){var G=Selector.pseudos;return G["last-of-type"](G["first-of-type"](F,H,E),H,E);},getIndices:function(E,F,D){if(E==0){return F>0?[F]:[];}return $R(1,D).inject([],function(A,B){if(0==(B-F)%E&&(B-F)/E>=0){A.push(B);}return A;});},nth:function(d,Z,Q,T,a){if(d.length==0){return[];}if(Z=="even"){Z="2n+0";}if(Z=="odd"){Z="2n+1";}var f=Selector.handlers,V=[],U=[],S;f.mark(d);for(var g=0,W;W=d[g];g++){if(!W.parentNode._counted){f.index(W.parentNode,T,a);U.push(W.parentNode);}}if(Z.match(/^\d+$/)){Z=Number(Z);for(var g=0,W;W=d[g];g++){if(W.nodeIndex==Z){V.push(W);}}}else{if(S=Z.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(S[1]=="-"){S[1]=-1;}var R=S[1]?Number(S[1]):1;var Y=S[2]?Number(S[2]):0;var X=Selector.pseudos.getIndices(R,Y,d.length);for(var g=0,W,c=X.length;W=d[g];g++){for(var b=0;b<c;b++){if(W.nodeIndex==X[b]){V.push(W);}}}}}f.unmark(d);f.unmark(U);return V;},"empty":function(I,G,H){for(var J=0,K=[],L;L=I[J];J++){if(L.tagName=="!"||(L.firstChild&&!L.innerHTML.match(/^\s*$/))){continue;}K.push(L);}return K;},"not":function(R,N,K){var S=Selector.handlers,M,L;var P=new Selector(N).findElements(K);S.mark(P);for(var T=0,Q=[],O;O=R[T];T++){if(!O._counted){Q.push(O);}}S.unmark(P);return Q;},"enabled":function(I,G,H){for(var J=0,K=[],L;L=I[J];J++){if(!L.disabled){K.push(L);}}return K;},"disabled":function(I,G,H){for(var J=0,K=[],L;L=I[J];J++){if(L.disabled){K.push(L);}}return K;},"checked":function(I,G,H){for(var J=0,K=[],L;L=I[J];J++){if(L.checked){K.push(L);}}return K;}},operators:{"=":function(D,C){return D==C;},"!=":function(D,C){return D!=C;},"^=":function(D,C){return D.startsWith(C);},"$=":function(D,C){return D.endsWith(C);},"*=":function(D,C){return D.include(C);},"~=":function(D,C){return(" "+D+" ").include(" "+C+" ");},"|=":function(D,C){return("-"+D.toUpperCase()+"-").include("-"+C.toUpperCase()+"-");}},matchElements:function(J,H){var I=new Selector(H).findElements(),K=Selector.handlers;K.mark(I);for(var L=0,M=[],N;N=J[L];L++){if(N._counted){M.push(N);}}K.unmark(I);return M;},findElement:function(D,F,E){if(typeof F=="number"){E=F;F=false;}return Selector.matchElements(D,F||"*")[E||0];},findChildElements:function(J,N){var M=N.join(","),N=[];M.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(A){N.push(A[1].strip());});var K=[],O=Selector.handlers;for(var P=0,I=N.length,L;P<I;P++){L=new Selector(N[P].strip());O.concat(K,L.findElements(J));}return(I>1)?O.unique(K):K;}});function $$(){return Selector.findChildElements(document,$A(arguments));}var Form={reset:function(B){$(B).reset();return B;},serializeElements:function(D,E){var F=D.inject({},function(H,A){if(!A.disabled&&A.name){var C=A.name,B=$(A).getValue();if(B!=null){if(C in H){if(H[C].constructor!=Array){H[C]=[H[C]];}H[C].push(B);}else{H[C]=B;}}}return H;});return E?F:Hash.toQueryString(F);}};Form.Methods={serialize:function(C,D){return Form.serializeElements(Form.getElements(C),D);},getElements:function(B){return $A($(B).getElementsByTagName("*")).inject([],function(A,D){if(Form.Element.Serializers[D.tagName.toLowerCase()]){A.push(Element.extend(D));}return A;});},getInputs:function(L,I,M){L=$(L);var N=L.getElementsByTagName("input");if(!I&&!M){return $A(N).map(Element.extend);}for(var P=0,K=[],O=N.length;P<O;P++){var J=N[P];if((I&&J.type!=I)||(M&&J.name!=M)){continue;}K.push(Element.extend(J));}return K;},disable:function(B){B=$(B);Form.getElements(B).invoke("disable");return B;},enable:function(B){B=$(B);Form.getElements(B).invoke("enable");return B;},findFirstElement:function(B){return $(B).getElements().find(function(A){return A.type!="hidden"&&!A.disabled&&["input","select","textarea"].include(A.tagName.toLowerCase());});},focusFirstElement:function(B){B=$(B);B.findFirstElement().activate();return B;},request:function(E,F){E=$(E),F=Object.clone(F||{});var D=F.parameters;F.parameters=E.serialize(true);if(D){if(typeof D=="string"){D=D.toQueryParams();}Object.extend(F.parameters,D);}if(E.hasAttribute("method")&&!F.method){F.method=E.method;}return new Ajax.Request(E.readAttribute("action"),F);}};Form.Element={focus:function(B){$(B).focus();return B;},select:function(B){$(B).select();return B;}};Form.Element.Methods={serialize:function(F){F=$(F);if(!F.disabled&&F.name){var E=F.getValue();if(E!=undefined){var D={};D[F.name]=E;return Hash.toQueryString(D);}}return"";},getValue:function(D){D=$(D);var C=D.tagName.toLowerCase();return Form.Element.Serializers[C](D);},clear:function(B){$(B).value="";return B;},present:function(B){return $(B).value!="";},activate:function(C){C=$(C);try{C.focus();if(C.select&&(C.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(C.type))){C.select();}}catch(D){}return C;},disable:function(B){B=$(B);B.blur();B.disabled=true;return B;},enable:function(B){B=$(B);B.disabled=false;return B;}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(B){switch(B.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(B);default:return Form.Element.Serializers.textarea(B);}},inputSelector:function(B){return B.checked?B.value:null;},textarea:function(B){return B.value;},select:function(B){return this[B.type=="select-one"?"selectOne":"selectMany"](B);},selectOne:function(C){var D=C.selectedIndex;return D>=0?this.optionValue(C.options[D]):null;},selectMany:function(H){var I,F=H.length;if(!F){return null;}for(var G=0,I=[];G<F;G++){var J=H.options[G];if(J.selected){I.push(this.optionValue(J));}}return I;},optionValue:function(B){return Element.extend(B).hasAttribute("value")?B.value:B.text;}};Abstract.TimedObserver=function(){};Abstract.TimedObserver.prototype={initialize:function(E,D,F){this.frequency=D;this.element=$(E);this.callback=F;this.lastValue=this.getValue();this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){var C=this.getValue();var D=("string"==typeof this.lastValue&&"string"==typeof C?this.lastValue!=C:String(this.lastValue)!=String(C));if(D){this.callback(this.element,C);this.lastValue=C;}}};Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element);}});Abstract.EventObserver=function(){};Abstract.EventObserver.prototype={initialize:function(C,D){this.element=$(C);this.callback=D;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks();}else{this.registerCallback(this.element);}},onElementEvent:function(){var B=this.getValue();if(this.lastValue!=B){this.callback(this.element,B);this.lastValue=B;}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback.bind(this));},registerCallback:function(B){if(B.type){switch(B.type.toLowerCase()){case"checkbox":case"radio":Event.observe(B,"click",this.onElementEvent.bind(this));break;default:Event.observe(B,"change",this.onElementEvent.bind(this));break;}}}};Form.Element.EventObserver=Class.create();Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.EventObserver=Class.create();Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.serialize(this.element);}});if(!window.Event){var Event=new Object();}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(B){return $(B.target||B.srcElement);},isLeftClick:function(B){return(((B.which)&&(B.which==1))||((B.button)&&(B.button==1)));},pointerX:function(B){return B.pageX||(B.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));},pointerY:function(B){return B.pageY||(B.clientY+(document.documentElement.scrollTop||document.body.scrollTop));},stop:function(B){if(B.preventDefault){B.preventDefault();B.stopPropagation();}else{B.returnValue=false;B.cancelBubble=true;}},findElement:function(D,F){var E=Event.element(D);while(E.parentNode&&(!E.tagName||(E.tagName.toUpperCase()!=F.toUpperCase()))){E=E.parentNode;}return E;},observers:false,_observeAndCache:function(H,E,F,G){if(!this.observers){this.observers=[];}if(H.addEventListener){this.observers.push([H,E,F,G]);H.addEventListener(E,F,G);}else{if(H.attachEvent){this.observers.push([H,E,F,G]);H.attachEvent("on"+E,F);}}},unloadCache:function(){if(!Event.observers){return;}for(var C=0,D=Event.observers.length;C<D;C++){Event.stopObserving.apply(this,Event.observers[C]);Event.observers[C][0]=null;}Event.observers=false;},observe:function(H,E,F,G){H=$(H);G=G||false;if(E=="keypress"&&(Prototype.Browser.WebKit||H.attachEvent)){E="keydown";}Event._observeAndCache(H,E,F,G);},stopObserving:function(I,F,G,H){I=$(I);H=H||false;if(F=="keypress"&&(Prototype.Browser.WebKit||I.attachEvent)){F="keydown";}if(I.removeEventListener){I.removeEventListener(F,G,H);}else{if(I.detachEvent){try{I.detachEvent("on"+F,G);}catch(J){}}}}});if(Prototype.Browser.IE){Event.observe(window,"unload",Event.unloadCache,false);}var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},realOffset:function(F){var D=0,E=0;do{D+=F.scrollTop||0;E+=F.scrollLeft||0;F=F.parentNode;}while(F);return[E,D];},cumulativeOffset:function(F){var D=0,E=0;do{D+=F.offsetTop||0;E+=F.offsetLeft||0;F=F.offsetParent;}while(F);return[E,D];},positionedOffset:function(G){var E=0,F=0;do{E+=G.offsetTop||0;F+=G.offsetLeft||0;G=G.offsetParent;if(G){if(G.tagName=="BODY"){break;}var H=Element.getStyle(G,"position");if(H=="relative"||H=="absolute"){break;}}}while(G);return[F,E];},offsetParent:function(B){if(B.offsetParent){return B.offsetParent;}if(B==document.body){return B;}while((B=B.parentNode)&&B!=document.body){if(Element.getStyle(B,"position")!="static"){return B;}}return document.body;},within:function(F,D,E){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(F,D,E);}this.xcomp=D;this.ycomp=E;this.offset=this.cumulativeOffset(F);return(E>=this.offset[1]&&E<this.offset[1]+F.offsetHeight&&D>=this.offset[0]&&D<this.offset[0]+F.offsetWidth);},withinIncludingScrolloffsets:function(H,F,G){var E=this.realOffset(H);this.xcomp=F+E[0]-this.deltaX;this.ycomp=G+E[1]-this.deltaY;this.offset=this.cumulativeOffset(H);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+H.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+H.offsetWidth);},overlap:function(D,C){if(!D){return 0;}if(D=="vertical"){return((this.offset[1]+C.offsetHeight)-this.ycomp)/C.offsetHeight;}if(D=="horizontal"){return((this.offset[0]+C.offsetWidth)-this.xcomp)/C.offsetWidth;}},page:function(E){var F=0,G=0;var H=E;do{F+=H.offsetTop||0;G+=H.offsetLeft||0;if(H.offsetParent==document.body){if(Element.getStyle(H,"position")=="absolute"){break;}}}while(H=H.offsetParent);H=E;do{if(!window.opera||H.tagName=="BODY"){F-=H.scrollTop||0;G-=H.scrollLeft||0;}}while(H=H.parentNode);return[G,F];},clone:function(J,I){var K=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});J=$(J);var L=Position.page(J);I=$(I);var G=[0,0];var H=null;if(Element.getStyle(I,"position")=="absolute"){H=Position.offsetParent(I);G=Position.page(H);}if(H==document.body){G[0]-=document.body.offsetLeft;G[1]-=document.body.offsetTop;}if(K.setLeft){I.style.left=(L[0]-G[0]+K.offsetLeft)+"px";}if(K.setTop){I.style.top=(L[1]-G[1]+K.offsetTop)+"px";}if(K.setWidth){I.style.width=J.offsetWidth+"px";}if(K.setHeight){I.style.height=J.offsetHeight+"px";}},absolutize:function(K){K=$(K);if(K.style.position=="absolute"){return;}Position.prepare();var L=Position.positionedOffset(K);var H=L[1];var J=L[0];var I=K.clientWidth;var G=K.clientHeight;K._originalLeft=J-parseFloat(K.style.left||0);K._originalTop=H-parseFloat(K.style.top||0);K._originalWidth=K.style.width;K._originalHeight=K.style.height;K.style.position="absolute";K.style.top=H+"px";K.style.left=J+"px";K.style.width=I+"px";K.style.height=G+"px";},relativize:function(F){F=$(F);if(F.style.position=="relative"){return;}Position.prepare();F.style.position="relative";var D=parseFloat(F.style.top||0)-(F._originalTop||0);var E=parseFloat(F.style.left||0)-(F._originalLeft||0);F.style.top=D+"px";F.style.left=E+"px";F.style.height=F._originalHeight;F.style.width=F._originalWidth;}};if(Prototype.Browser.WebKit){Position.cumulativeOffset=function(F){var D=0,E=0;do{D+=F.offsetTop||0;E+=F.offsetLeft||0;if(F.offsetParent==document.body){if(Element.getStyle(F,"position")=="absolute"){break;}}F=F.offsetParent;}while(F);return[E,D];};}Element.addMethods();function $$(F,D,E){return Selector.findChildElements(D,[F]);}var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(L){L=L.toUpperCase();var I=this.NODEMAP[L]||"div";var H=document.createElement(I);try{H.innerHTML="<"+L+"></"+L+">";}catch(J){}var K=H.firstChild||null;if(K&&(K.tagName.toUpperCase()!=L)){K=K.getElementsByTagName(L)[0];}if(!K){K=document.createElement(L);}if(!K){return;}if(arguments[1]){if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)||arguments[1].tagName){this._children(K,arguments[1]);}else{var G=this._attributes(arguments[1]);if(G.length){try{H.innerHTML="<"+L+" "+G+"></"+L+">";}catch(J){}K=H.firstChild||null;if(!K){K=document.createElement(L);for(attr in arguments[1]){K[attr=="class"?"className":attr]=arguments[1][attr];}}if(K.tagName.toUpperCase()!=L){K=H.getElementsByTagName(L)[0];}}}}if(arguments[2]){this._children(K,arguments[2]);}return $(K);},_text:function(B){return document.createTextNode(B);},ATTR_MAP:{"className":"class","htmlFor":"for"},_attributes:function(D){var C=[];for(attribute in D){C.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+D[attribute].toString().escapeHTML()+'"');}return C.join(" ");},_children:function(D,C){if(C.tagName){D.appendChild(C);return;}if(typeof C=="object"){C.flatten().each(function(A){if(typeof A=="object"){D.appendChild(A);}else{if(Builder._isStringOrNumber(A)){D.appendChild(Builder._text(A));}}});}else{if(Builder._isStringOrNumber(C)){D.appendChild(Builder._text(C));}}},_isStringOrNumber:function(B){return(typeof B=="string"||typeof B=="number");},build:function(C){var D=this.node("div");$(D).update(C.strip());return D.down();},dump:function(D){if(typeof D!="object"&&typeof D!="function"){D=window;}var C=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);C.each(function(A){D[A]=function(){return Builder.node.apply(Builder,[A].concat($A(arguments)));};});}};Function.prototype.bind=function(){var D=this,F=$A(arguments),E=F.shift();return function(){if(typeof $A=="function"){return D.apply(E,F.concat($A(arguments)));}};};Function.prototype.bindAsEventListener=function(E){var D=this,F=$A(arguments),E=F.shift();return function(A){if(typeof $A=="function"){return D.apply(E,[A||window.event].concat(F));}};};Object.extend(Event,{onDOMReady:function(B){Ready.onIdReady("contentEnd",B);},onReady:function(B){Ready.onDOMReady(B);},onDone:function(B){Ready.onDOMDone(B);},onIdReady:function(D,C){Ready.onIdReady(D,C);},findElement:function(D,F){var E=Event.element(D);while(E.parentNode&&(!E.tagName||(E.tagName.toUpperCase()!=F.toUpperCase()))){E=E.parentNode;}if(E&&E!=null){Element.extend(E);}return E;},stopAllObserving:function(F,D){if(!Event.observers){return;}F=$(F);for(var E=0;E<Event.observers.length;E++){if(Event.observers[E][0]==F){if((D==null)||(Event.observers[E][1]==D)){Event.stopObserving.apply(Event,Event.observers[E]);}}}}});Element.Methods.readAttribute=function(H,F){H=$(H);if(IE){if(!H.attributes){return null;}var E=H[F];if(typeof E!="undefined"&&E!=null){return E;}var G=Element._attributeTranslations;if(G.values[F]){return G.values[F](H,F);}if(G.names[F]){F=G.names[F];}E=H.attributes[F];return E?E.nodeValue:null;}return H.getAttribute(F);};Element.Methods.remove=function(C){C=$(C);if(IE){if(C&&C.tagName!="BODY"){var D=document.createElement("div");D.appendChild(C);D.innerHTML="";}}else{if(C&&C.parentNode&&C.tagName!="BODY"){C.parentNode.removeChild(C);}}return C;};var GlobalResponder={loadingElement:$("globalLoading"),callInProgress:function(B){switch(B.readyState){case 1:case 2:case 3:return true;break;default:return false;break;}},onCreate:function(B){GlobalResponder.beginWaiting();B["timeoutId"]=window.setTimeout(function(){if(GlobalResponder.callInProgress(B.transport)){GlobalResponder.endWaiting();B.transport.abort();if(B.options["onFailure"]){B.options["onFailure"](B.transport,B.json);}}},B.options.timeout);},onComplete:function(B){GlobalResponder.endWaiting();if(B["timeoutId"]){window.clearTimeout(B["timeoutId"]);}},onException:function(D,C){GlobalResponder.endWaiting();if(D["timeoutId"]){window.clearTimeout(D["timeoutId"]);}if(C&&typeof C.message=="string"){if(C.message.indexOf("Component returned failure code: 0x80040111")!=0){if(debug){alert("Exception:"+C.message);}}}},beginWaiting:function(){var B=this._getLoadingElement();if(B&&!B.visible()){B.show();}},endWaiting:function(){var B=this._getLoadingElement();if(B&&B.visible()){B.hide();}},_getLoadingElement:function(){if(this.loadingElement===null){this.loadingElement=$("globalLoading");}return this.loadingElement;}};Ajax.Responders.register(GlobalResponder);Object.extend(Template.prototype,{initialize:function(C,D){C=C.toString();this.template=C;this.pattern=D||Template.Pattern;},eval:function(B){return this.evaluate(B);}});var Fx={};Fx.Base=Class.create();Fx.Base.prototype={initialize:function(C,D){this.element=$(C);this.options=D||{};this.duration=(this.options.duration||1)*1000;this.fps=this.options.fps||24;this.steps=Math.floor(this.duration/this.fps);this.maxSteps=this.steps;this.timer=null;if(this.options.delay){FunctionExt.defer(this.start,this.options.delay*1000,this);}else{this.start();}},start:function(){this.setup(this);(this.options.onStart||Prototype.emptyFunction)(this);this.timer=setInterval(this.run.bind(this),this.fps);},run:function(){if(this.isFinished()){clearInterval(this.timer);this.end(this);return(this.options.onComplete||Prototype.emptyFunction)(this);}this.duration-=this.fps;this.steps--;var B=1-this.steps/this.maxSteps;this.loop(this,B);(this.options.onUpdate||Prototype.emptyFunction)(this,B);},isFinished:function(){return this.steps<=0;},setup:function(B){},loop:function(D,C){this.update(D,C);},end:function(B){}};Fx.Slide=Class.create();Object.extend(Object.extend(Fx.Slide.prototype,Fx.Base.prototype),{setup:function(D){var C;if(this.options.dimensions){C=this.options.dimensions;}else{C=this.element.getDimensions();}this.originalHeight=C.height;this.originalWidth=C.width;this.factor=1;this.slideType=D.options.slideType||"down";if(this.slideType=="down"){this.element.setStyle({height:"0px"}).show();}},update:function(L,I){var K=this.factor*I;var H=this.originalWidth*K;var G=this.originalHeight*K;var J={};if(L.options.scaleX){J.width=Math.round(H)+"px";}if(L.options.scaleY){J.height=Math.round(G)+"px";}this.element.setStyle(J);},end:function(B){if(this.slideType=="up"){this.element.hide();}if(B.options.callback){B.options.callback();}}});if(!String.prototype.trim){var TRIM_REG=/^\s+|\s+$/g;String.prototype.trim=function(){return this.replace(TRIM_REG,"");};}String.prototype.Trim=String.prototype.trim;String.prototype.bytelength=function(){var B=this.match(/[^\x00-\xff]/ig);return this.length+(B==null?0:B.length);};String.prototype.cut=function(){var F=arguments[0]*2;var E=this.bytelength();if(F>E){return this;}var G=0,H=0;for(G=0;G<this.length;G++){if(this.charCodeAt(G)>255){H+=2;}else{H++;}if(H>F){break;}}return this.substr(0,G)+"...";};String.prototype.Cut=String.prototype.cut;String.prototype.empty=function(){return this.trim().length===0;};String.prototype.extract=function(){var K=arguments,N=this,H=K[0],M=K[1];var J=N.indexOf(H)+H.length;var L=N.indexOf(M);var I="";if(L>J){I=N.substr(J,L-J);}return I;};String.prototype.formatWithWBR=function(){var P=arguments,M=10;if(P.length>0){var N=parseInt(P[0],10);if(!isNaN(N)&&N>0){M=N;}}var O=this,K=[],Q=0,L=0,S;for(var T=1,R=O.length;T<R;T++){S=O.charAt(T);if(/\s/.test(S)){L=T;}else{if((T-L)==M){K.push(O.substring(Q,T));K.push("<wbr>");Q=L=T;}}}K.push(O.substr(Q));return K.join("");};String.prototype.isNumber=function(){var E=this;if(E.length===0){return false;}for(var F=0,D=E.length;F<D;F++){if(isNaN(parseInt(E.charAt(F),10))){return false;}}return true;};Date.prototype.toString=function(){var H=this;var G=H.getMonth();G=(G+1).toString().length==2?G+1:"0"+(G+1);var J=H.getDate();J=J.toString().length==2?J:"0"+J;var F=H.getHours();F=F.toString().length==2?F:"0"+F;var I=H.getMinutes();I=I.toString().length==2?I:"0"+I;return H.getFullYear()+"-"+G+"-"+J+" "+F+":"+I;};Number.prototype.NaN0=function(){var B=this;return isNaN(B)?0:B;};if(typeof debug!=="boolean"){debug=false;}if(typeof version==="undefined"){version="1.0.js";}if(typeof cssVersion==="undefined"){cssVersion="1.0.css";}if(typeof mtimeCookieDomain==="undefined"){mtimeCookieDomain="mtime.com";}if(typeof siteType==="undefined"){siteType="mtime";}if(typeof enable08==="undefined"){enable08="true";}if(typeof crossDomainUpload==="undefined"){crossDomainUpload="http://upload2.mtime.com/Upload.ashx";}if(typeof jsServer==="undefined"){jsServer="http://static1.mtime.cn/static/";}if(typeof cssServer==="undefined"){cssServer="";}if(typeof subJsServer==="undefined"){subJsServer="";}if(typeof siteUrl==="undefined"){siteUrl="http://www.mtime.com";}if(typeof siteMcUrl==="undefined"){siteMcUrl="http://my.mtime.com";}if(typeof siteApiUrl==="undefined"){siteApiUrl="http://api.mtime.com";}if(typeof siteLogUrl==="undefined"){siteLogUrl="http://log.mtime.cn";}if(typeof siteGroupUrl==="undefined"){siteGroupUrl="http://group.mtime.com";}if(typeof siteBlogUrl==="undefined"){siteBlogUrl="http://i.mtime.com";}if(typeof siteMovieUrl==="undefined"){siteMovieUrl="http://movie.mtime.com";}if(typeof sitePeopleUrl==="undefined"){sitePeopleUrl="http://people.mtime.com";}if(typeof siteNewsUrl==="undefined"){siteNewsUrl="http://news.mtime.com";}if(typeof siteServiceUrl==="undefined"){siteServiceUrl="http://service.mtime.com";}if(typeof siteSearchUrl==="undefined"){siteSearchUrl="http://search.mtime.com";}if(typeof siteFunUrl==="undefined"){siteFunUrl="http://fun.mtime.com";}var Mtime={version:"0.1",emptyFunction:function(){},K:function(B){return B;},RELATED_OBJ_TYPE_MOVIE:1,RELATED_OBJ_TYPE_PERSON:2,RELATED_OBJ_TYPE_MOVIE_IMAGE:11,RELATED_OBJ_TYPE_PERSON_IMAGE:21,RELATED_OBJ_TYPE_TOPIC:10,RELATED_OBJ_TYPE_GROUP:9,RELATED_OBJ_TYPE_USER:4,RELATED_OBJ_TYPE_PHOTO:5,RELATED_OBJ_TYPE_BLOG:6,RELATED_OBJ_TYPE_THEATER:33,RELATED_OBJ_TYPE_VIDEO:41,namespace:function(){var H=arguments,G=null,I,J,F;for(I=0;I<H.length;I=I+1){F=H[I].split(".");G=Mtime;for(J=(F[0]=="Mtime")?1:0;J<F.length;J=J+1){G[F[J]]=G[F[J]]||{};G=G[F[J]];}}return G;},extend:function(D,F){for(var E in F){D[E]=F[E];}return D;},extendIf:function(D,F){if(extend&&F){for(var E in F){if(typeof D[E]=="undefined"){D[E]=F[E];}}}return D;},augmentObject:function(G,H){if(!H||!G){throw new Error("Absorb failed, verify dependencies.");}var I=arguments,J,K,L=I[2];if(L&&L!==true){for(J=2;J<I.length;J=J+1){G[I[J]]=H[I[J]];}}else{for(K in H){if(L||!(K in G)){G[K]=H[K];}}Mtime._IEEnumFix(G,H);}},merge:function(){var E={},F=arguments;for(var G=0,H=F.length;G<H;G=G+1){Mtime.augmentObject(E,F[G],true);}return E;},isArray:function(B){if(B){return Mtime.isNumber(B.length)&&Mtime.isFunction(B.splice);}return false;},isBoolean:function(B){return typeof B==="boolean";},isFunction:function(B){return typeof B==="function";},isNull:function(B){return B===null;},isNumber:function(B){return typeof B==="number"&&isFinite(B);},isObject:function(B){return(B&&(typeof B==="object"||Mtime.isFunction(B)))||false;},isString:function(B){return typeof B==="string";},isUndefined:function(B){return typeof B==="undefined";},isValue:function(B){return(Mtime.isObject(B)||Mtime.isString(B)||Mtime.isNumber(B)||Mtime.isBoolean(B));},isEmpty:function(C,D){return Mtime.isNull(C)||Mtime.isUndefined(C)||(!D?C==="":false);},later:function(R,K,Q,L,O){R=R||0;K=K||{};var J=Q,M=L,N,P;if(Mtime.isString(Q)){J=K[Q];}if(!J){throw new TypeError("method undefined");}if(!Mtime.isArray(M)){M=[L];}N=function(){J.apply(K,M);};P=(O)?setInterval(N,R):setTimeout(N,R);return{interval:O,cancel:function(){if(this.interval){clearInterval(P);}else{clearTimeout(P);}}};},log:function(E,D,F){alert(E);}};Mtime.namespace("Mtime.Component","Mtime.Control","Mtime.Page","Mtime.Utility");Mtime.browser=function(){var E={ie:0,opera:0,gecko:0,webkit:0};var F=navigator.userAgent,D;if((/KHTML/).test(F)){E.webkit=1;}D=F.match(/AppleWebKit\/([^\s]*)/);if(D&&D[1]){E.webkit=parseFloat(D[1]);}if(!E.webkit){D=F.match(/Opera[\s\/]([^\s]*)/);if(D&&D[1]){E.opera=parseFloat(D[1]);}else{D=F.match(/MSIE\s([^;]*)/);if(D&&D[1]){E.ie=parseFloat(D[1]);}else{D=F.match(/Gecko\/([^\s]*)/);if(D){E.gecko=1;D=F.match(/rv:([^\s\)]*)/);if(D&&D[1]){E.gecko=parseFloat(D[1]);}}}}}return E;}();if(Object.prototype.hasOwnProperty){Mtime.hasOwnProperty=function(C,D){return C&&C.hasOwnProperty(D);};}else{Mtime.hasOwnProperty=function(C,D){return !Mtime.isUndefined(C[D])&&C.constructor.prototype[D]!==C[D];};}var browser=Mtime.browser;if(browser.ie){var ADD=["toString","valueOf"];Mtime._IEEnumFix=function(F,G){for(var I=0;I<ADD.length;I=I+1){var H=ADD[I],J=G[H];if(Mtime.isFunction(J)&&J!=Object.prototype[H]){F[H]=J;}}};}else{Mtime._IEEnumFix=Mtime.emptyFunction;}if(browser.ie&&browser.ie<7){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}window.attachEvent("onunload",function(){var F=document.getElementsByTagName("OBJECT");for(var E=F.length-1;E>=0;E--){F[E].style.display="none";for(var D in F[E]){if(typeof F[E][D]=="function"){F[E][D]=Mtime.emptyFunction;}}}});}Mtime.Utility.JSON={toObject:function(text){var o=null;if(typeof JSON==="object"&&typeof JSON.parse==="function"){try{o=JSON.parse(text);}catch(e){o=null;}}if(o===null){if(browser.gecko){o=new Function("return "+text)();}else{o=eval("("+text+")");}}return o;}};Mtime.loader=function(){var a={},U=0,f=0,j=false,X=Mtime.browser;var l=function(D,B,A){var F=A||window,E=F.document,C=E.createElement(D);for(var G in B){if(B[G]&&Mtime.hasOwnProperty(B,G)){C.setAttribute(G,B[G]);}}return C;};var b=function(A,C,D){var B=D||"utf-8";return l("link",{"id":"__core_"+(f++),"type":"text/css","charset":B,"rel":"stylesheet","href":A},C);};var S=function(A,C,D){var B=D||"utf-8";return l("script",{"id":"__core_"+(f++),"type":"text/javascript","charset":B,"src":A,"async":true},C);};var g=function(B,A){return{tId:B.tId,win:B.win,data:B.data,nodes:B.nodes,msg:A,purge:function(){d(this.tId);}};};var h=function(B,C){var D=a[C],A=(Mtime.isString(B))?D.win.document.getElementById(B):B;if(!A){V(C,"target node not found: "+B);}return A;};var V=function(C,B){Mtime.log("get failure: "+B,"warn","Get");var D=a[C];if(D.onFailure){var A=D.scope||D.win;D.onFailure.call(A,g(D,B));}};var c=function(C){var D=a[C];D.finished=true;if(D.aborted){var B="transaction "+C+" was aborted";V(C,B);return;}if(D.onSuccess){var A=D.scope||D.win;D.onSuccess.call(A,g(D));}};var T=function(B){Mtime.log("Timeout "+B,"info","get");var C=a[B];if(C.onTimeout){var A=C.context||C;C.onTimeout.call(A,g(C));}};var Y=function(C,A){var K=a[C];if(K.timer){K.timer.cancel();}if(K.aborted){var G="transaction "+C+" was aborted";V(C,G);return;}if(A){K.url.shift();if(K.varName){K.varName.shift();}}else{K.url=(Mtime.isString(K.url))?[K.url]:K.url;if(K.varName){K.varName=(Mtime.isString(K.varName))?[K.varName]:K.varName;}}var D=K.win,I=D.document,E=I.getElementsByTagName("head")[0],B;if(K.url.length===0){if(K.type==="script"&&Mtime.browser.webkit&&Mtime.browser.webkit<420&&!K.finalpass&&!K.varName){var F=S(null,K.win,K.charset);F.innerHTML='Mtime.loader._finalize("'+C+'");';K.nodes.push(F);E.appendChild(F);}else{c(C);}return;}var J=K.url[0];if(!J){K.url.shift();return Y(C);}if(K.timeout){K.timer=Mtime.later(K.timeout,K,T,C);}if(K.type==="script"){B=S(J,D,K.charset);}else{B=b(J,D,K.charset);}k(K.type,B,C,J,D,K.url.length);K.nodes.push(B);if(K.insertBefore){var H=h(K.insertBefore,C);if(H){H.parentNode.insertBefore(B,H);}}else{E.appendChild(B);}if((Mtime.browser.webkit||Mtime.browser.gecko)&&K.type==="css"){Y(C,J);}};var W=function(){if(j){return;}j=true;for(var A in a){var B=a[A];if(B.autopurge&&B.finished){d(B.tId);delete a[A];}}j=false;};var d=function(H){var E=a[H];if(E){var C=E.nodes,B=C.length,D=E.win.document,F=D.getElementsByTagName("head")[0];if(E.insertBefore){var G=h(E.insertBefore,H);if(G){F=G.parentNode;}}for(var A=0;A<B;A=A+1){F.removeChild(C[A]);}E.nodes=[];}};var Z=function(B,A,E){var D="q"+(U++);E=E||{};if(U%Mtime.loader.PURGE_THRESH===0){W();}a[D]=Mtime.merge(E,{tId:D,type:B,url:A,finished:false,aborted:false,nodes:[]});var C=a[D];C.win=C.win||window;C.scope=C.scope||C.win;C.autopurge=("autopurge" in C)?C.autopurge:(B==="script")?true:false;Mtime.later(0,C,Y,D);return{tId:D};};var k=function(E,F,D,I,B,G,C){var H=C||Y;if(X.ie){F.onreadystatechange=function(){var K=this.readyState;if("loaded"===K||"complete"===K){F.onreadystatechange=null;H(D,I);}};}else{if(Mtime.browser.webkit){if(E==="script"){if(Mtime.browser.webkit>=420){F.addEventListener("load",function(){H(D,I);});}else{var J=a[D];if(J.varName){var A=Mtime.loader.POLL_FREQ;J.maxattempts=YAHOO.util.Get.TIMEOUT/A;J.attempts=0;J._cache=J.varName[0].split(".");J.timer=Mtime.later(A,J,function(L){var M=this._cache,N=M.length,O=this.win,K;for(K=0;K<N;K=K+1){O=O[M[K]];if(!O){this.attempts++;if(this.attempts++>this.maxattempts){var P="Over retry limit, giving up";J.timer.cancel();V(D,P);}else{Mtime.log(M[K]+" failed, retrying");}return;}}J.timer.cancel();H(D,I);},null,true);}else{Mtime.later(Mtime.loader.POLL_FREQ,null,H,[D,I]);}}}}else{F.onload=function(){H(D,I);};}}};return{POLL_FREQ:20,PURGE_THRESH:30,TIMEOUT:30000,_finalize:function(A){Mtime.later(0,null,c,A);},abort:function(A){var B=(Mtime.isString(A))?A:A.tId;var C=a[B];if(C){C.aborted=true;}},script:function(B,A){return Z("script",B,A);},css:function(B,A){return Z("css",B,A);}};}();$get=function(F,D,E){$defer(function(C,A,B){return Mtime.loader.script(C,{onSuccess:function(J){var I=window["result_"+J.data];A(I);},data:B});},this,[F,D,E]);};$loadJs=function(F,D,E){$defer(function(M,C,L){L=L||0;if(!L){if(Mtime.isString(M)){M=M.indexOf("http")!==0?jsServer+M:M;}else{if(Mtime.isArray(M)&&M.length>0){var N=[],A="";for(var K=0,B=M.length;K<B;K++){A=M[K];N.push(A.indexOf("http")!==0?(jsServer+A):A);}M=N;}}}return Mtime.loader.script(M,{onSuccess:C,onFailure:function(){return Mtime.loader.script(M,{onSuccess:C});},onTimeout:function(){return Mtime.loader.script(M,{onSuccess:C});}});},this,[F,D,E]);};$loadSubJs=function(F,D,E){$defer(function(M,C,L){L=L||0;if(!L){if(Mtime.isString(M)){M=M.indexOf("http")!==0?subJsServer+M:M;}else{if(Mtime.isArray(M)&&M.length>0){var N=[],A="";for(var K=0,B=M.length;K<B;K++){A=M[K];N.push(A.indexOf("http")!==0?(subJsServer+A):A);}M=N;}}}return Mtime.loader.script(M,{onSuccess:C});},this,[F,D,E]);};$loadAppJs=function(F,D,E){$defer(function(M,C,L){L=L||0;if(!L){if(Mtime.isString(M)){M=M.indexOf("http")!==0?appJsServer+M:M;}else{if(Mtime.isArray(M)&&M.length>0){var N=[],A="";for(var K=0,B=M.length;K<B;K++){A=M[K];N.push(A.indexOf("http")!==0?(appJsServer+A):A);}M=N;}}}return Mtime.loader.script(M,{onSuccess:C});},this,[F,D,E]);};$loadCss=function(D,C){$defer(function(B,A){B=B.indexOf("http")!==0?cssServer+B:B;return Mtime.loader.css(B,{onSuccess:A,onFailure:function(){return Mtime.loader.css(B,{onSuccess:A,onFailure:A,onTimeout:A});},onTimeout:function(){return Mtime.loader.css(B,{onSuccess:A,onFailure:A,onTimeout:A});}});},this,[D,C]);};Mtime.Component.Ajax={MAX_REREQUEST_COUNT:2,_requestKeys:[],_requestErrorCounts:[],requestQueue:[],_lock:false,get:function(O,I,L,P,K,M,J,N){this.request(siteServiceUrl,O,I,L,P,K,M,J,N);},request:function(U,X,O,S,Z,R,V,P,W){var N=new StringBuilder();if(R.indexOf("Ajax_CallBack=true")<0){N.append("Ajax_CallBack=true&");}N.append("Ajax_CallBackType=");N.append(X);N.append("&Ajax_CallBackMethod=");N.append(O);N.append("&Ajax_RequestUrl=");N.append(encodeURIComponent(location.href));N.append("&t=");var Q=this.getToken();N.append(Q);N.append(this.toQueryString(S));R=R.indexOf("http")!==0?U+R:R;if(R.indexOf("?")>0){R+="&"+N.toString();}else{R+="?"+N.toString();}var T=null;if(this.isValid(W)){T=this.addOverlay(W);}var Y=function(A){if(this.isValid(W)&&T){this.removeOverlay(W,T);}if(!this._lock&&A&&A.ddos){this._lock=true;new Dialog({windowClassName:"w445",content:A.html});}else{if(this._lock){return;}else{if(Z){Z(A);}}}}.bind(this);$get(R,Y,Q);},crossDomainCallBack:function(N,Q,J,M,R,L,O,K,P){this.callBack(Q,J,M,R,N+L,O,K,P);},callBack:function(Y,Q,T,Z,S,W,R,X){var V=null;if(this.isValid(X)){V=this.addOverlay(X);}R=R||20000;R=R*10;var N=true;if(!Z||Z==null){N=false;}if(N){var P={serverType:Y,serverMethod:Q,clientCallBack:Z,args:T,url:S,submitButton:X,overlay:V};if(this.inQueue(P)){return;}this.requestQueue.push(P);}var U=encodeURIComponent(location.href);var O=new StringBuilder();if(S.indexOf("Ajax_CallBack=true")<0){O.append("Ajax_CallBack=true&");}O.append("Ajax_CallBackType=");O.append(Y);O.append("&Ajax_CallBackMethod=");O.append(Q);O.append("&Ajax_RequestUrl=");O.append(U);O.append("&t=");O.append(this.getToken());O.append(this.toQueryString(T));W=W||"post";new Ajax.Request(this.attachTokenToUrl(S),{parameters:O.toString(),requestObj:P,method:W,timeout:R,onComplete:this.onComplete.bind(this)});},SERVICE_URL:"/callbackServices.m?Ajax_CallBack=true",callBack08:function(c,T,X,d,V,a,U,S,b){var Z=null;if(this.isValid(b)){Z=this.addOverlay(b);}U=U||20000;var P=true;if(!d||d==null){P=false;}if(P){var R={serverType:c,serverMethod:T,clientCallBack:d,args:X,url:V,submitButton:b,overlay:Z};if(this.inQueue(R)){return;}this.requestQueue.push(R);}S=(typeof S==="undefined"||S.length===0)?"":("&"+S);var Y=encodeURIComponent(location.href);var Q=new StringBuilder();Q.append("Ajax_CallBackType=");Q.append(c);Q.append("&Ajax_CallBackMethod=");Q.append(T);Q.append("&Ajax_RequestUrl=");Q.append(Y);Q.append("&Ajax_Command=");Q.append(V);Q.append("&t=");Q.append(this.getToken());Q.append(this.toQueryString(X));a=a||"post";var W=this.SERVICE_URL+S;new Ajax.Request(this.attachTokenToUrl(W),{parameters:Q.toString(),requestObj:R,method:a,timeout:U,onComplete:this.onComplete.bind(this)});},attachTokenToUrl:function(B){if(B.indexOf("?")>0){B+="&t="+this.getToken();}else{B+="?t="+this.getToken();}return B;},getToken:function(){var D=new Date(),C=[];C.push(D.getFullYear());C.push(D.getMonth()+1);C.push(D.getDate());C.push(D.getHours());C.push(D.getMinutes());C.push(D.getSeconds());C.push(parseInt(Math.random()*100000,10));return C.join("");},toQueryString:function(G){var J="";if(G){var H=[];for(var I=0,F=G.length;I<F;I++){H.push("&Ajax_CallBackArgument");H.push(I);H.push("=");H.push(encodeURIComponent(G[I]));}J=H.join("");}return J;},inQueue:function(J){if(this.requestQueue.length>0){var I=this.requestQueue,G=null;for(var H=0,F=I.length;H<F;H++){G=I[H];if(G==J){return true;}else{if(this.equal(G,J)){return true;}}}return false;}},dequeue:function(L){if(this.requestQueue.length>0){var J=this.requestQueue,H=null,K=-1;for(var I=0,G=J.length;I<G;I++){H=J[I];if(H==L){K=I;break;}else{if(this.equal(H,L)){K=I;break;}}}if(K>=0){J.splice(K,1);}}},equal:function(C,D){if(C.url==D.url&&C.serverType==D.serverType&&C.serverMethod==D.serverMethod&&C.args==D.args){return true;}return false;},onComplete:function(K,H,J){if(!Mtime.isEmpty(K.responseText)){var G=Mtime.Utility.JSON.toObject(K.responseText);var L=J.requestObj;this.dequeue(L);FunctionExt.defer(L.clientCallBack,1,null,[G]);L.clientCallBack=null;delete L.clientCallBack;var I=L.submitButton;if(this.isValid(I)&&L.overlay){this.removeOverlay(I,L.overlay);}L.overlay=null;L=null;delete L;J.requestObj=null;delete J.requestObj;}},isValid:function(B){if(!Mtime.isUndefined(B)&&!Mtime.isNull(B)&&!Mtime.isString(B)){return true;}return false;},addOverlay:function(G){if(typeof G==="undefined"||G===null){return;}var J=new Date().getTime();var I="submitOverlay_"+J;var F=G.parentNode;var H=Element.extend(document.createElement("div"));H.id=I;H.className="submiting";this.getContainer().appendChild(H);Position.clone(G,H);return H;},removeOverlay:function(C,D){if(typeof C==="undefined"||C===null){return;}if(D){FunctionExt.defer(function(A,B){this.getContainer().removeChild(B);},1000,this,[C,D]);}},getContainer:function(){var B=$("contentEnd");if(typeof B==="undefined"||B===null){B=document.getElementsByTagName("body")[0];}return B;}};Mtime.Component.Statistic=Class.create();Mtime.Component.Statistic.Service={Log:function(H,E,G,F){return Mtime.Component.Ajax.request(siteLogUrl,"Mtime.Analytics.Web.Log.Pages.StatisticService","Log",[H,E,G,this.getUserId()],F,"/Log/StatisticService.m?Ajax_CallBack=true","get","20000");},GetImageCounts:function(C,D){return Mtime.Component.Ajax.callBack("Mtime.Community.Controls.CommunityPages.StatisticService","GetImageCounts",[C],D,"/Utility/StatisticService.m?Ajax_CallBack=true","get","20000");},GetUserPhotoCounts:function(C,D){return Mtime.Component.Ajax.callBack("Mtime.Community.Controls.CommunityPages.StatisticService","GetUserPhotoCounts",[C],D,"/Utility/StatisticService.m?Ajax_CallBack=true","get","20000");},GetBlogCategoryCounts:function(D,E,F){return Mtime.Component.Ajax.callBack("Mtime.Community.Controls.CommunityPages.StatisticService","GetBlogCategoryCounts",[D,E],F,"/Utility/StatisticService.m?Ajax_CallBack=true","get","20000");},GetBlogCommentCount:function(C,D){return Mtime.Component.Ajax.callBack("Mtime.Community.Controls.CommunityPages.StatisticService","GetBlogCommentCount",[C],D,"/Utility/StatisticService.m?Ajax_CallBack=true","get","20000");},GetBlogs:function(C,D){return Mtime.Component.Ajax.callBack("Mtime.Community.Controls.CommunityPages.StatisticService","GetBlogs",[C],D,"/Utility/StatisticService.m?Ajax_CallBack=true","get","20000");},getUserId:function(){var B=getCookie("_mi_");if(B||B.length>0){return B;}return"";}};Mtime.Component.Statistic.prototype={BehaviorType_ClickExternalRecommendVideo:50001,initialize:function(){this.relatedObjTypes=[];this.relatedIds=[];},viewTheater:function(B){this.add(Mtime.RELATED_OBJ_TYPE_THEATER,B);},viewMovie:function(B){this.add(Mtime.RELATED_OBJ_TYPE_MOVIE,B);},viewPerson:function(B){this.add(Mtime.RELATED_OBJ_TYPE_PERSON,B);},viewMovieImage:function(B){this.add(Mtime.RELATED_OBJ_TYPE_MOVIE_IMAGE,B);},viewPersonImage:function(B){this.add(Mtime.RELATED_OBJ_TYPE_PERSON_IMAGE,B);},viewGroup:function(B){this.add(Mtime.RELATED_OBJ_TYPE_GROUP,B);},viewUser:function(B){this.add(Mtime.RELATED_OBJ_TYPE_USER,B);},viewPhoto:function(B){this.add(Mtime.RELATED_OBJ_TYPE_PHOTO,B);},viewBlog:function(B){this.add(Mtime.RELATED_OBJ_TYPE_BLOG,B);},viewBlogs:function(B){this.addRange(Mtime.RELATED_OBJ_TYPE_BLOG,B);},viewVideo:function(B){this.add(Mtime.RELATED_OBJ_TYPE_VIDEO,B);},clickExternalRecommendVideo:function(B){this.add(this.BehaviorType_ClickExternalRecommendVideo,B);},add:function(C,D){this.relatedObjTypes.push(C);this.relatedIds.push(D);this.log();},addRange:function(F,G){var J=G.split("|");if(J.length>0){for(var I=0,H=J.length;I<H;I++){if(J[I].length>0){this.relatedObjTypes.push(F);this.relatedIds.push(J[I]);}}this.log();}},isLogged:false,log:function(){var I=this.relatedIds;var F=this.relatedObjTypes;if(typeof(I)!="undefined"&&I&&I.length>0){var J="";if(typeof(requestUserId)!="undefined"){J=requestUserId;}var H=this.relatedObjTypes.join("|");var G=this.relatedIds.join("|");Mtime.Component.Statistic.Service.Log(H,G,J,function(){}.bind(this));this.relatedObjTypes.clear();this.relatedIds.clear();}}};var FunctionExt=Mtime.Component.FunctionExt;FunctionExt={createCallback:function(F){var E=arguments;var D=F;return function(){return D.apply(window,E);};},createDelegate:function(H,J,G,I){var F=H;return function(){var B=G||arguments;if(I===true){B=Array.prototype.slice.call(arguments,0);B=B.concat(G);}else{if(typeof I=="number"){B=Array.prototype.slice.call(arguments,0);var A=[I,0].concat(G);Array.prototype.splice.apply(B,A);}}return F.apply(J||window,B);};},defer:function(I,K,L,H,J){var G=this.createDelegate(I,L,H,J);if(K){return setTimeout(G,K);}G();return 0;}};var Ready=Mtime.Component.Ready;Ready={timePassed:0,lastTimerInterval:0,finalTimeout:20,timerInterval:1000,intervalId:0,isDOMDone:0,isDOMReady:0,runReadyCallbacking:0,onFunctionReadyCallbacks:{},onDOMReadyCallbacks:[],onDOMDoneCallbacks:[],onIdReadyCallbacks:{},isRun:0,onFunctionReady:function(E,F){if(!Ready._checkFunctionReady(E)){var D=Ready.onFunctionReadyCallbacks[E];if(!D){D=[];}D.push(F);Ready.onFunctionReadyCallbacks[E]=D;Ready.start();}else{$defer(F);}},onDOMReady:function(B){if(Ready._checkDOMReady()){$defer(B);}else{Ready.onDOMReadyCallbacks.push(B);Ready.start();}},onDOMDone:function(B){if(Ready._checkDOMDone()){$defer(B);}else{Ready.onDOMDoneCallbacks.push(B);Ready.start();}},onIdReady:function(G,H){if(Ready._checkDOMReady()){var F=document.getElementById(G);if(F){$defer(H,this,[$(F)]);return;}}var E=Ready.onIdReadyCallbacks[G];if(!E){E=[];}E.push(H);Ready.onIdReadyCallbacks[G]=E;Ready.start();},runFunctionCallbacks:function(){var H=true;for(var F in Ready.onFunctionReadyCallbacks){if(Ready.onFunctionReadyCallbacks.hasOwnProperty(F)){if(Ready._checkFunctionReady(F)){var E=Ready.onFunctionReadyCallbacks[F];for(var G=0;G<E.length;G++){$defer(E[G]);}delete Ready.onFunctionReadyCallbacks[F];delete E;}else{if(H){H=false;}}}}return H;},runDOMReadyCallbacks:function(){for(var B=0;B<Ready.onDOMReadyCallbacks.length;B++){$defer(Ready.onDOMReadyCallbacks[B]);}Ready.onDOMReadyCallbacks=[];},runDOMDoneCallbacks:function(){for(var B=0;B<Ready.onDOMDoneCallbacks.length;B++){$defer(Ready.onDOMDoneCallbacks[B]);}Ready.onDOMDoneCallbacks=[];},runIdCallbacks:function(){var J=true;for(var I in Ready.onIdReadyCallbacks){if(Ready.onIdReadyCallbacks.hasOwnProperty(I)){var H=document.getElementById(I);if(typeof H!="undefined"&&H!=null){var F=Ready.onIdReadyCallbacks[I];for(var G=0;G<F.length;G++){$defer(F[G],this,[$(H)]);}delete Ready.onIdReadyCallbacks[I];delete F;}else{if(J){J=false;}}}}return J;},runReadyCallbacks:function(){if(Ready.runReadyCallbacking){return;}Ready.runReadyCallbacking=1;var D=true;if(Ready._checkDOMReady()){Ready.runDOMReadyCallbacks();var F=Ready.runIdCallbacks();if(!F){D=false;}}else{D=false;}if(Ready._checkDOMDone()){Ready.runDOMDoneCallbacks();}else{D=false;}var E=Ready.runFunctionCallbacks();if(!E){D=false;}if(D){Ready.stop();}else{Ready.timePassed+=Ready.lastTimerInterval;if((Ready.timePassed/Ready.timerInterval)>=Ready.finalTimeout){Ready.stop();}}Ready.runReadyCallbacking=0;},start:function(){if(!Ready.isRun){if(debug){alert("请尽量避免,Ready.start");}Ready.isRun=1;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){Ready.isDOMDone=1;},false);}Ready.lastTimerInterval=Ready.timerInterval;Ready.intervalId=setInterval(Ready.runReadyCallbacks,Ready.timerInterval);}},stop:function(){if(Ready.isRun){Ready.isRun=0;Ready.isDOMReady=0;Ready.isDOMDone=0;Ready.onDOMReadyCallbacks=[];Ready.onDOMDoneCallbacks=[];Ready.onIdReadyCallbacks={};Ready.timePassed=0;Ready.onFunctionReadyCallbacks={};if(Ready.intervalId){clearInterval(Ready.intervalId);Ready.intervalId=null;}}},reset:function(){Ready.stop();Ready.start();},runCallbacks:function(){Ready.runReadyCallbacks();},_checkFunctionReady:function(I){var K=Ready._checkObjectReady;if(I.indexOf(",")<=0){return K(I);}else{var J=I.split(",");for(var L=0,G=J.length;L<G;L++){var H=J[L];if(!K(H)){return false;}}return true;}},_checkObjectReady:function(B){B=B.trim();if(typeof(this[B])!=="undefined"&&this[B]!==null){return true;}return false;},_checkDOMReady:function(){if(Ready.isDOMReady){return Ready.isDOMReady;}if(typeof document.getElementsByTagName!=="undefined"&&typeof document.getElementById!=="undefined"&&(document.getElementsByTagName("body")[0]!==null||document.body!==null)){Ready.isDOMReady=1;}return Ready.isDOMReady;},_checkDOMDone:function(){if(document.readyState&&document.readyState==="complete"){return 1;}return Ready.isDOMDone;}};var Pay=Mtime.Component.Pay;Pay={ConvertCentToYuan:function(B){return(B/100).toFixed(2);},ConvertYuanToCent:function(B){return B*100;}};function $FuncReady(C,D){Ready.onFunctionReady(C,D);}function $DOMReady(B){Ready.onDOMReady(B);}function $IdReady(C,D){Ready.onIdReady(C,D);}$onId=$IdReady;$onDOM=$DOMReady;$onFunc=$FuncReady;function $visible(B){B=$(B);return !B.hasClassName("none")&&B.visible();}function $hide(B){B=$(B);B.addClassName("none");B.hide();}function $show(B){B=$(B);B.removeClassName("none");B.show();}function $defer(G,J,F,H){try{return FunctionExt.defer(G,0.1,J,F,H);}catch(I){alert(I);}}function $Redirect(J){if(IE){var H=["object","embed","applet"],K,L;for(K=0;K<H.length;K++){var I=document.getElementsByTagName(H[K]);for(L=0;L<I.length;L++){try{$(I[L]).innerHTML="";}catch(G){}}}}location.href=J;}var $redirect=$Redirect;var port=window.location.port;var AppPath=window.location.protocol+"//"+window.location.host;var Globals={SiteUrl:"http://test.com",UrlParamsCacheKey:"Global-UrlParamsCacheKey",getSiteUrl:function(B){alert("不要在客户端拼装URL");return this.SiteUrl+B;},isDefined:function(B){return typeof(B)!="undefined"&&B!=null;},isNullOrEmpty:function(B){if(!this.isDefined(B)){return true;}if(this.isDefined(B.length)&&B.length==0){return true;}if(B.toString()=="null"){return true;}return false;},getParam:function(D){var C=this._getParams();if(!this.isDefined(C)){return"";}return C[D];},_getParams:function(){var H={};var G=document.location.search.substr(1).split("&");if(Globals.isNullOrEmpty(G)){return null;}for(var K=0,L=G.length;K<L;K++){try{var I=G[K].split("=");if(I.length<2){continue;}H[I[0]]=I[1].Trim();}catch(J){}}return H;},copyToClipboard:function(Q){if(window.clipboardData){window.clipboardData.setData("Text",Q);}else{if(Opera){window.location=Q;}else{if(Prototype.Browser.WebKit){var K=document.createElement("input");K.type="text";K.value=Q;document.body.appendChild(K);FunctionExt.defer(function(){K.select();document.execCommand("copy",false,null);document.body.removeChild(K);},100);}else{if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");}catch(M){alert("你的firefox安全限制限制您进行剪贴板操作，请在地址栏输入: about:config 将signed.applets.codebase_principal_support设置为true之后重试");return false;}var J=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(!J){return false;}var N=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(!N){return false;}N.addDataFlavor("text/unicode");var O={};var P=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);var R=Q;P.data=R;N.setTransferData("text/unicode",P,R.length*2);var L=Components.interfaces.nsIClipboard;if(!J){return false;}J.setData(N,null,L.kGlobalClipboard);}}}}return true;},addCSSStyle:function(H,G){if(!H){return;}var F=document.getElementsByTagName("head")[0];var E=document.createElement("style");E.type="text/css";if(G){E.media="screen";}if(E.styleSheet){E.styleSheet.cssText=H;}else{E.appendChild(document.createTextNode(H));}F.appendChild(E);},hideSelect:function(){if(IE){var E=document.getElementsByTagName("SELECT");for(var F=0,D=E.length;F<D;F++){E[F].style.visibility="hidden";}}},showSelect:function(){if(IE){var E=document.getElementsByTagName("SELECT");for(var F=0,D=E.length;F<D;F++){E[F].style.visibility="visible";}}}};var IE=document.all?true:false;var _ieVersion=navigator.appVersion.match(/MSIE (.\..)/);var IE6=IE&&(_ieVersion&&_ieVersion[1]==6);var FireFox=document.getElementById&&!document.all;var Safari=/webkit/.test(navigator.userAgent.toLowerCase());var Opera=navigator.userAgent.indexOf("Opera")!=-1?true:false;var disappearDelay=500;var isTouchPad=false;var touchPadUas=["iphone","ipod","ipad","android"],ua=navigator.userAgent.toLowerCase();for(var i=0,count=touchPadUas.length;i<count;++i){if(ua.indexOf(touchPadUas[i])>0){isTouchPad=true;break;}}function getCookie(G){var E=""+document.cookie;var F=E.indexOf(G);if(E==""||F==-1){return"";}var H=E.indexOf(";",F);if(H==-1){H=E.length;}return unescape(E.substring(F+G.length+1,H));}function setCookie(F,D,E){setCookieForever(F,D);}function setCookieForever(F,D,E){setCookieTerminable(F,D,60,E);}function setCookieTerminable(I,F,J,G){var H=new Date();H.setTime(H.getTime()+J*24*60*60*1000);if(!G){G="/";}document.cookie=I+"="+escape(F)+";path="+G+";expires="+H.toUTCString()+";domain="+mtimeCookieDomain+";";}function setLocalCookie(I,F,J,G){J=J||1;var H=new Date();H.setTime(H.getTime()+J*24*60*60*1000);if(!G){G="/";}document.cookie=I+"="+escape(F)+";path="+G+";expires="+H.toUTCString()+";";}function Random(B){return Math.floor(Math.random()*100000)%B;}function showHTMLContent(){}function $Name(B){return $A(document.getElementsByName(B));}function $SelectOne(H){var F=document.getElementsByName(H);if(F&&F.length){for(var G=0,E=F.length;G<E;G++){if(F[G].checked){return $(F[G]);}}}return null;}function $Value(L){var K=[];var I=$Name(L);if(I&&I.length>0){for(var J=0,G=I.length;J<G;J++){var H=I[J].value;if(H.length>0){K[J]=H;}}}return K;}var Utility={};Utility.Dom={nextElement:function(B){B=$(B);while(B=B.nextSibling){if(B.nodeType==1){return $(B);}}return null;},previousElement:function(B){B=$(B);while(B=B.previousSibling){if(B.nodeType==1){return $(B);}}return null;},remove:function(B){return $(B).parentNode.removeChild(B);},insertAfter:function(C,D){return $(C).previousSibling.inserBefore(D);},replaceElement:function(C,D){$(C).parentNode.replaceChild(D,C);return D;},setSelectedValue:function(L,J,K){K=$(K);var I=document.getElementsByName(L);for(var H=0,G=I.length;H<G;H++){if(I[H].value==J){if(K){if(I[H].parentNode==K){I[H].checked=true;}}else{I[H].checked=true;}}else{I[H].checked=false;}}},getSelectedValues:function(J,F){var I=[];var G=$Name(J);if(Globals.isNullOrEmpty(G)){return I;}F=F||G.length;var H=0;G.each(function(A){if(A.checked){if(H<F){I[H++]=A.value;}}});if(F==1){if(I.length==1){return I[0];}else{return 0;}}return I;},collapse:function(N,O,P,L,J,I){var K=$(N);var M=$(O);if(!K||!M){return;}P=P||"/images/m_down.gif";L=L||"/images/m_up.gif";J=J||"收起";I=I||"展开";if(!K.visible()){K.show();if(M){M.src=L;M.title=I;}}else{K.hide();if(M){M.src=P;M.title=J;}}},getInt:function(B){return parseInt(B.replace(/[^ \d.-]/g,""));}};String.Format=function(){var H=arguments,J=H.length;if(J==0){return"";}if(J==1){return H[0];}var I=/{(\d+)?}/g,G,F;if(H[1] instanceof Array){G=H[1];F=H[0].replace(I,function(A,B){return G[parseInt(B)];});}else{G=H;F=H[0].replace(I,function(A,B){return G[parseInt(B)+1];});}return F;};String.format=String.Format;function StringBuilder(){this.strings=[];}StringBuilder.prototype.append=function(B){this.strings.push(B);};StringBuilder.prototype.add=function(B){this.strings.push(B);};StringBuilder.prototype.toString=function(){if(arguments.length==0){return this.strings.join("");}else{return this.strings.join(arguments[0]);}};StringBuilder.prototype.clear=function(){this.strings.clear();};StringBuilder.prototype.backspace=function(){this.strings.pop();};Object.extend(Event,{stopB:function(B){if(B.preventDefault){B.preventDefault();}else{B.returnValue=false;}}});if(typeof(stat)=="undefined"){stat=new Mtime.Component.Statistic();}function loadTg(I){if(!I||typeof I!=="object"){I=window.mtimeStufs;}if(typeof I!=="undefined"){siteType=typeof siteType==="undefined"?"mtime":siteType;var G=null,L=null,H="";for(var J=0,K=I.length;J<K;J++){G=I[J];if(G.type.length===0){continue;}H=getTagMapId(G.id);L=$(H);if(L&&G.content.trim().length>0&&!L.handle){L.handle=true;L.update(G.content);if(typeof tracker!=="undefined"&&typeof tracker.trackAdView!=="undefined"){tracker.trackAdView(L,H);tracker.observeAdClick(L,H);}}}}}function getTagMapId(F){if(typeof tgMaps!=="undefined"){var H=null;for(var G=0,E=tgMaps.length;G<E;++G){H=tgMaps[G];if(H.name.toLowerCase()==F.toLowerCase()){F=H.regionId;break;}}}return F;}setTimeout(loadTg,1000);Event.observe(window,"unload",function(){Ready.stop();});function $innerHTML(E,H){var F=document.createElement("div"),G=document.createDocumentFragment();F.innerHTML=E;(function(){if(F.firstChild){G.appendChild(F.firstChild);setTimeout(arguments.callee,0);}else{H(G);}})();}function $css(F){var D=document.getElementsByTagName("head")[0];var E=document.createElement("style");E.type="text/css";E.media="screen";if(E.styleSheet){E.styleSheet.cssText=F;}else{E.appendChild(document.createTextNode(F));}D.appendChild(E);}var Validator={Require:/.+/,Email:/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/i,Url:/^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/,Number:/^\d+$/,Password:/^\S{6,20}$/,NickName:/^[0-9a-zA-Z\u4e00-\u9fa5_·-]*$/,Int:/^[-\+]?\d+$/,Double:/^[-\+]?\d+(\.\d+)?$/,English:/^[A-Za-z]+$/,Chinese:/^[\u0391-\uFFE5]+$/,Tag:/[\\\/\<\>\`\~\'\"\、\!\@\#\$\%\^\&\*\{\}\?\(\)\（\）\《\》\-\:]/,DateTime:/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2})$/,IdCard:/^(\d{18,18}|\d{15,15}|\d{17,17}[x|X])$/,MobilePhone:/^(13|15|18)[0-9]{9}$/,testRegExp:function(D,C){return D.test(C);},validateUrl:function(B){return this.testRegExp(this.Url,B);},validateEmail:function(B){return this.testRegExp(this.Email,B);},validatePassword:function(B){return this.testRegExp(this.Password,B);},validateNickName:function(D){if(!D){return false;}var C=this.getChineseStringLength(D);if(C>=4&&C<=20){return this.testRegExp(this.NickName,D);}return false;},validateRequireElement:function(D){var C=$F(D);return validateRequire(C);},validateRequire:function(B){return this.testRegExp(this.Require,B.Trim());},validateDatetime:function(B){return this.testRegExp(this.DateTime,B.Trim());},filterTagToArray:function(I){var L=[];var H=I.Trim().replace(/[\s　]+/g," ").split(" ");if(H.length==0){return L;}for(var J=0,K=0,G=H.length;J<G;J++){if(!this.Tag.test(H[J])){L[K++]=this.getChineseSubString(H[J],10);}}if(L.length==0){return L;}if(L.length==1){return L;}else{return L.uniq();}},filterMovieTagToArray:function(I){var L=[];var H=I.Trim().replace(/[\s　]+/g," ").split(" ");if(H.length==0){return L;}for(var J=0,K=0,G=H.length;J<G;J++){if(!this.Tag.test(H[J])){L[K++]=H[J];}}if(L.length==0){return L;}if(L.length==1){return L;}else{return L.uniq();}},isChinese:function(D){var C=/[u00-uFF]/;return !C.test(D);},getChineseStringLength:function(G){var F=0;for(var H=0,E=G.length;H<E;H++){if(this.isChinese(G.charAt(H))){F=F+2;}else{F=F+1;}}return F;},getChineseSubString:function(L,I,N){N=(typeof N=="undefined"||N==null)?"":N;var H=I*2;if(H>=this.getChineseStringLength(L)){return L;}else{H-=N.length;var J=new StringBuilder();for(var M=0,I=L.length;M<I;M++){var K=L.charAt(M);J.append(K);if(this.isChinese(K)){H-=2;if(H<0){J.backspace();break;}}else{H--;}if(H==0){break;}}return J.toString()+N;}}};var Windows={windows:[],maxZIndex:100,register:function(B){this.windows.push(B);this.maxZIndex+=10;},unregister:function(B){this.windows=this.windows.reject(function(A){return A==B;});},closeAll:function(){if(this.count()>0){this.windows.each(function(B){B.close();});}},count:function(){return this.windows.length;},getZIndex:function(){return this.maxZIndex;}};var Window=Mtime.Control.Window;Window=Class.create();Window.prototype={fixTopHeight:30,zIndex:100,createIframe:false,isToggleTroubleElement:false,isFocus:true,windowElement:null,overlay:null,createOverlay:true,closed:false,dimensions:{cruft:null,container:null,viewport:{height:null,width:null,offsetTop:null,offsetLeft:null}},pagePosition:{x:0,y:0},pageDimensions:{width:null,height:null},options:{},setOptions:function(B){Object.extend(Object.extend(this,this.options),B);},initialize:function(B){this.uniqueId=new Date().getTime();this.setOptions(B);this.initializeWindow();this.addDOM();this.initializeWindowElement();this.initializeDOM();this.initializeEvent();this.load();this.render();Event.observe(window,"unload",this.close.bind(this));},initializeWindow:function(){},initializeWindowElement:function(){var B=this.getContainer();B.appendChild(this.windowElement);this.windowElement=$(this.windowElement);},destroyWindowElement:function(){if(this.windowElement!==null){var B=this.getContainer();B.removeChild(this.windowElement);this.windowElement=null;}},addDOM:function(){},removeDOM:function(){},initializeDOM:function(){},initializeEvent:function(){},load:function(){},render:function(){},addOverlay:function(){if(typeof this.uniqueId=="undefined"){this.uniqueId=new Date().getTime();}var F="overlay"+this.uniqueId;this.overlay=$(F);if(!this.overlay){var D=this.getContainer();var E=Element.extend(document.createElement("div"));E.id=F;E.setStyle({background:"#000",filter:"alpha(opacity=60)",opacity:0.6,zoom:1,zIndex:Windows.getZIndex(),position:"absolute",margin:"0px",padding:"0px",top:"0px",left:"0px",width:this.pageDimensions.width+"px",height:this.pageDimensions.height+"px"});D.appendChild(E);this.overlay=E;}},removeOverlay:function(){if(this.overlay){var B=this.getContainer();this.overlay.setStyle({top:"0px",left:"0px",width:"0px",height:"0px"});B.removeChild(this.overlay);this.overlay=null;delete this.overlay;}},getContainer:function(){var B=$("contentEnd");if(typeof B==="undefined"||B===null){B=document.getElementsByTagName("body")[0];}return B;},open:function(){this.windowId=this.windowElement.id;if(this.windowId.length===0){this.windowId="window_"+new Date().getTime();}Windows.register(this);this.getScroll();this.getPageDimensions();this.browserDimensions();if(this.createOverlay){this.addOverlay();}this.showWindow();this.setupDimensions();this.prepareIE(true);this.checkIEOverlapping();},visible:function(){return this.windowElement.visible();},close:function(){if(!this.closed){this.closed=true;Windows.unregister(this);this.prepareIE(false);this.hideDimensions();this.hideWindow();if(this.createOverlay){this.removeOverlay();}if(this.iefix){Element.remove(this.iefix);}this.dispose();this.destroyWindowElement();}},getScroll:function(){if(typeof(window.pageYOffset)=="number"){this.pagePosition.x=window.pageXOffset;this.pagePosition.y=window.pageYOffset;}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){this.pagePosition.x=document.body.scrollLeft;this.pagePosition.y=document.body.scrollTop;}else{if(document.documentElement){this.pagePosition.x=document.documentElement.scrollLeft;this.pagePosition.y=document.documentElement.scrollTop;}}}},getPageDimensions:function(){var E,G;if(window.innerHeight&&window.scrollMaxY){E=document.body.scrollWidth;G=window.innerHeight+window.scrollMaxY;}else{if(document.body.scrollHeight>document.body.offsetHeight){E=document.body.scrollWidth;G=document.body.scrollHeight;}else{E=document.body.offsetWidth;G=document.body.offsetHeight;}}var H,F;if(self.innerHeight){H=self.innerWidth;F=self.innerHeight;}else{if(document.documentElement&&document.documentElement.clientHeight){H=document.documentElement.clientWidth;F=document.documentElement.clientHeight;}else{if(document.body){H=document.body.clientWidth;F=document.body.clientHeight;}}}if(G<F){this.pageDimensions.height=F;}else{this.pageDimensions.height=G;}if(E<H){this.pageDimensions.width=H;}else{this.pageDimensions.width=E;}},browserDimensions:function(){if(Prototype.Browser.IE){this.dimensions.viewport.height=document.documentElement.clientHeight;this.dimensions.viewport.width=document.documentElement.clientWidth;}else{this.dimensions.viewport.height=window.innerHeight;this.dimensions.viewport.width=document.width||document.body.offsetWidth;}},setupDimensions:function(){var L=this.dimensions.viewport.height/2+this.pagePosition.y;var K=this.dimensions.viewport.width/2+this.pagePosition.x;var I=this.windowElement.getDimensions();var J=I.width,H=I.height;var G=(L-parseFloat(H)/2);if(G<=0){G=this.fixTopHeight;}this.windowElement.setStyle({position:"absolute",top:G+"px",left:(K-parseFloat(J)/2)+"px",zIndex:this.overlay?parseInt(this.overlay.getStyle("zIndex"),10)+1:Windows.getZIndex()});},hideDimensions:function(){this.windowElement.setStyle({position:"absolute",top:"0px",left:"0px",zIndex:0});},prepareIE:function(K){if(Prototype.Browser.IE){var H,I,G;if(K){H="100%";}else{H="auto";}var J=document.getElementsByTagName("body")[0];var L=document.getElementsByTagName("html")[0];L.style.height=J.style.height=H;}},toggleTroubleElements:function(M){if(Prototype.Browser.IE){var J=document.getElementsByTagName("select");for(var P=0;P<J.length;P++){var L=J[P];if(L.style.visibility!=M&&!Element.descendantOf(L,this.windowElement)){L.style.visibility=M;}}var K=document.getElementsByTagName("object");for(P=0;P!=K.length;P++){var I=K[P];if(I.style.visibility!=M&&!Element.descendantOf(I,this.windowElement)){I.style.visibility=M;}}var N=document.getElementsByTagName("embed");for(P=0;P!=N.length;P++){var O=N[P];if(O.style.visibility!=M&&!Element.descendantOf(O,this.windowElement)){O.style.visibility=M;}}}},checkIEOverlapping:function(){if(this.createIframe){if(!this.iefix&&IE){new Insertion.After(this.windowElement,'<iframe id="'+this.windowId+'_iefix" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.windowId+"_iefix");}if(this.iefix){setTimeout(this.fixIEOverlapping.bind(this),1);}}},fixIEOverlapping:function(){if(this.createIframe){if(this.windowElement){Position.clone(this.windowElement,this.iefix);if(this.iefix.getStyle("width")==="0px"){var D=this.windowElement.getDimensions();var C=D.height+30;this.iefix.setStyle({width:D.width+"px",height:C+"px"});}this.iefix.style.zIndex=parseInt(this.windowElement.style.zIndex,10)-1;this.iefix.show();}}},setScroll:function(C,D){window.scrollTo(C,D);},setLocation:function(C,D){this.windowElement.setStyle({top:C+"px",left:D+"px"});},showWindow:function(){this.onWindowResizeHandler=this.onWindowResize.bind(this);Event.observe(window,"resize",this.onWindowResizeHandler);this.onDocumentKeydownHandler=this.onDocumentKeydown.bindAsEventListener(this);Event.observe(document,"keydown",this.onDocumentKeydownHandler);if(this.createOverlay){this.overlay.show();}if(this.createOverlay||this.isToggleTroubleElement){this.toggleTroubleElements("hidden");}this.showWindowElement();if(this.isFocus){$defer(function(){if(this.windowElement&&this.windowElement.visible()){this.windowElement.focus();}},this);}if(this.iefix){this.iefix.show();}},hideWindow:function(){Event.stopObserving(window,"resize",this.onWindowResizeHandler);Event.stopObserving(document,"keydown",this.onDocumentKeydownHandler);if(this.createOverlay){this.overlay.hide();}if(this.createOverlay||this.isToggleTroubleElement){this.toggleTroubleElements("visible");}this.hideWindowElement();if(this.iefix){this.iefix.hide();}},showWindowElement:function(){this.windowElement.show();},hideWindowElement:function(){this.windowElement.hide();},getEl:function(P){if(this.windowElement&&this.windowElement!==null){var L=this.windowElement.descendants();if(L&&L.length>0){var J=null;var I=[],N=typeof P=="string";for(var M=0,O=L.length;M<O;M++){J=L[M];if(J.id.length===0){continue;}if(N){if(J.id==P){return J;}}else{var K=P.indexOf(J.id);if(K>=0){I.push(J);}}}if(I.length>0){return I;}}}return null;},dispose:function(){},onWindowResize:function(){if(this.closed){return;}this.getScroll();this.getPageDimensions();this.browserDimensions();this.setupDimensions();},onDocumentKeydown:function(){}};var Textbox=Mtime.Control.Textbox;Textbox=Class.create();Object.extend(Textbox.prototype,{options:{text:null,value:"",watermarkText:"请输入",focusClassName:"c_000",blurClassName:"c_a5",onKeypressCallback:null,onKeyupCallback:null,onKeydownCallback:null,onClickCallback:null,onFocusCallback:null,onBlurCallback:null,readonly:false},setOptions:function(B){Object.extend(Object.extend(this,this.options),B);},initialize:function(B){this.setOptions(B);this.initializeField();this.initializeDOM();this.initializeEvent();this.load();},initializeField:function(){this.box=null;},initializeDOM:function(){this.text=$(this.text);},destroyDOM:function(){this.text.value="";this.text=null;},initializeEvent:function(){this.onFocusTextHandler=this.onFocusText.bindAsEventListener(this);this.text.observe("focus",this.onFocusTextHandler);this.onBlurTextHandler=this.onBlurText.bindAsEventListener(this);this.text.observe("blur",this.onBlurTextHandler);if(this.onKeydownCallback!==null){this.onKeydownTextHandler=this.onKeydownText.bindAsEventListener(this);this.text.observe("keydown",this.onKeydownTextHandler);}if(this.onKeypressCallback!==null){this.onKeypressTextHandler=this.onKeypressText.bindAsEventListener(this);this.text.observe("keypress",this.onKeypressTextHandler);}if(this.onKeyupCallback!==null){this.onKeyupTextHandler=this.onKeyupText.bindAsEventListener(this);this.text.observe("keyup",this.onKeyupTextHandler);}if(this.onClickCallback!==null){this.onClickTextHandler=this.onClickText.bindAsEventListener(this);this.text.observe("click",this.onClickTextHandler);}Event.observe(window,"unload",this.close.bind(this));},destroyEvent:function(){this.text.stopObserving("focus",this.onFocusTextHandler);this.text.stopObserving("blur",this.onBlurTextHandler);if(this.onKeydownCallback!==null){this.text.stopObserving("keydown",this.onKeydownTextHandler);}if(this.onKeypressCallback!==null){this.text.stopObserving("keypress",this.onKeypressTextHandler);}if(this.onKeyupCallback!==null){this.text.stopObserving("keyup",this.onKeyupTextHandler);}if(this.onClickCallback!==null){this.text.stopObserving("click",this.onClickTextHandler);}},load:function(){if(this.value.length>0){this.setValue(this.value);}this.initializeWatermarkText();},initializeWatermarkText:function(){if(this.text.value.length===0){this.text.value=this.watermarkText;this.setBlurTextClass();}else{if(this.text.value==this.watermarkText){this.setBlurTextClass();}else{this.setFocusTextClass();}}},setWatermarkText:function(B){this.watermarkText=B;this.initializeWatermarkText();},onFocusText:function(B){if(this.text.value==this.watermarkText){this.text.value="";}this.setFocusTextClass();if(this.onFocusCallback!==null){this.onFocusCallback(this.getValue(),B);}},setFocusTextClass:function(){if(this.focusClassName.length!==0){if(!this.text.hasClassName(this.focusClassName)){this.text.addClassName(this.focusClassName);}}if(this.blurClassName.length!==0){if(this.text.hasClassName(this.blurClassName)){this.text.removeClassName(this.blurClassName);}}},onBlurText:function(B){if(this.text.value.length===0){this.text.value=this.watermarkText;}this.setBlurTextClass();if(this.onBlurCallback!==null){this.onBlurCallback(this.getValue(),B);}},setBlurTextClass:function(){if(this.text.value==this.watermarkText){if(this.focusClassName.length!==0){if(this.text.hasClassName(this.focusClassName)){this.text.removeClassName(this.focusClassName);}}if(this.blurClassName.length!==0){if(!this.text.hasClassName(this.blurClassName)){this.text.addClassName(this.blurClassName);}}}},onKeydownText:function(B){this.onKeydownCallback(B);},onKeyupText:function(B){this.onKeyupCallback(B);},onKeypressText:function(B){this.onKeypressCallback(B);},onClickText:function(B){this.onClickCallback(B);},getValue:function(){var B=this.text.value;if(B==this.watermarkText){B="";}return B.trim();},setValue:function(B){this.text.value=B;},trim:function(){var B=this.text.value.trim();if(B.length>0){this.setValue(B);}},clear:function(){this.setValue("");this.initializeWatermarkText();},isClosed:false,close:function(){if(!this.isClosed){this.isClosed=true;this.destroyEvent();this.destroyDOM();}}});var MenuBase=Class.create();MenuBase.prototype={SlideTypePrev:0,SlideTypeNext:1,options:{menuRegion:null,contentRegion:null,initializeMenuIndex:0,menuTagName:"",overTimeout:1},setOptions:function(B){Object.extend(Object.extend(this,this.options),B);},initialize:function(B){this.setOptions(B);this.initializeField();this.initializeDOM();this.initializeEvent();this.initializeMenu();this.load();this.render();},initializeField:function(){this.outMenuTimer=null;this.overMenuTimer=null;},initializeDOM:function(){this.initializeMenuDOM();if(this.contentRegion){this.contentRegion=$(this.contentRegion);this.contents=this.contentRegion.immediateDescendants();}},initializeMenuDOM:function(){this.menuRegion=$(this.menuRegion);this.menus=this.menuRegion.immediateDescendants();},destroyDOM:function(){this.menus.clear();this.menus=null;if(typeof this.contents!="undefined"){this.contents.clear();this.contents=null;}},initializeEvent:function(){this.onOverMenuHandler=this.onOverMenu.bindAsEventListener(this);this.menuRegion.observe("mouseover",this.onOverMenuHandler);this.onOutMenuHandler=this.onOutMenu.bindAsEventListener(this);this.menuRegion.observe("mouseout",this.onOutMenuHandler);this.onClickMenuHandler=this.onClickMenu.bindAsEventListener(this);this.menuRegion.observe("click",this.onClickMenuHandler);Event.observe(window,"unload",this.close.bind(this));},destroyEvent:function(){this.menuRegion.stopObserving("mouseover",this.onOverMenuHandler);this.menuRegion.stopObserving("mouseout",this.onOutMenuHandler);this.menuRegion.stopObserving("click",this.onClickMenuHandler);},initializeMenu:function(){},destroyMenu:function(){},load:function(){if(this.menuTagName.length===0&&this.menus&&this.menus.length>0){this.menuTagName=this.menus[0].tagName.toLowerCase();}},render:function(){if(this.menus!==null&&this.menus.length>0&&this.initializeMenuIndex>=0&&this.initializeMenuIndex<this.menus.length){this.setMenuOn(this.menus[this.initializeMenuIndex]);}},onOverMenu:function(D){this.handleOverMenuTimer();var E=Event.findElement(D,this.menuTagName);if(E!==null){this.handleOutMenuTimer(E);var F=FunctionExt.defer(function(A){this.setMenuOver(A);},this.overTimeout,this,[E]);this.overMenuTimer={menu:E,timeout:F};}},handleOverMenuTimer:function(){if(this.overMenuTimer!==null&&this.overMenuTimer.timeout!==null){clearTimeout(this.overMenuTimer.timeout);this.overMenuTimer=null;}},handleOutMenuTimer:function(B){if(this.outMenuTimer!==null&&this.outMenuTimer.menu!==null&&this.outMenuTimer.menu==B){clearTimeout(this.outMenuTimer.timeout);this.outMenuTimer=null;}},onOutMenu:function(D){this.handleOverMenuTimer();var E=Event.findElement(D,this.menuTagName);if(E!==null){this.handleOutMenuTimer(E);var F=FunctionExt.defer(function(A){this.setMenuOut(A);},1,this,[E]);this.outMenuTimer={menu:E,timeout:F};}},onClickMenu:function(E){var F=Event.findElement(E,this.menuTagName);if(F!==null){var H=this.indexOf(F);if(H>=0){var G=Event.element(E);if(this.onClickMenuCallback){this.onClickMenuCallback(F,H,G);}}}},setMenuOn:function(C){var D=this.indexOf(C);if(D>=0){if(this.onMenuActiveCallback){this.onMenuActiveCallback(C,D);}}},setMenuOff:function(C){var D=this.menus.indexOf(C);if(D>=0){if(this.onMenuInactiveCallback){this.onMenuInactiveCallback(C,D);}}},setMenuOver:function(C){var D=this.menus.indexOf(C);if(D>=0){if(this.onMenuOverCallback){this.onMenuOverCallback(C,D);}}},setMenuOut:function(C){var D=this.menus.indexOf(C);if(D>=0){if(this.onMenuOutCallback){this.onMenuOutCallback(C,D);}}},indexOf:function(I){if(I&&I!==null){var F=this.menus,H=null;for(var G=0,J=F.length;G<J;G++){H=F[G];if(H==I){return G;}}}return -1;},closed:false,close:function(){if(!this.closed){this.closed=true;this.destroyMenu();this.destroyEvent();this.destroyDOM();}}};var Observer=Class.create();Observer.prototype={options:{sourceElement:null,targetElement:null,timeout:1},setOptions:function(B){Object.extend(Object.extend(this,this.options),B);},initialize:function(B){this.setOptions(B);this.initializeField();this.initializeDOM();this.initializeEvent();this.initializeMenu();this.load();this.render();},initializeField:function(){this.outSourceTimer={};this.overSourceTimer={};this.outTargetTimer={};this.overTargetTimer={};},initializeDOM:function(){this.sourceElement=$(this.sourceElement);this.targetElement=$(this.targetElement);},destroyDOM:function(){this.sourceElement=null;this.targetElement=null;},initializeEvent:function(){this.onOverSourceHandler=this.onOverSource.bindAsEventListener(this);this.sourceElement.observe("mouseover",this.onOverSourceHandler);this.onOutSourceHandler=this.onOutSource.bindAsEventListener(this);this.sourceElement.observe("mouseout",this.onOutSourceHandler);this.onClickSourceHandler=this.onClickSource.bindAsEventListener(this);this.sourceElement.observe("click",this.onClickSourceHandler);if(this.targetElement){this.initializeTargetEvent();}Event.observe(window,"unload",this.close.bind(this));},initializeTargetEvent:function(){this.onOverTargetHandler=this.onOverTarget.bindAsEventListener(this);this.targetElement.observe("mouseover",this.onOverTargetHandler);this.onOutTargetHandler=this.onOutTarget.bindAsEventListener(this);this.targetElement.observe("mouseout",this.onOutTargetHandler);},destroyEvent:function(){this.sourceElement.stopObserving("mouseover",this.onOverSourceHandler);this.sourceElement.stopObserving("mouseout",this.onOutSourceHandler);this.sourceElement.stopObserving("click",this.onClickSourceHandler);if(this.targetElement){this.destroyTargetEvent();}},destroyTargetEvent:function(){this.targetElement.stopObserving("mouseover",this.onOverTargetHandler);this.targetElement.stopObserving("mouseout",this.onOutTargetHandler);},initializeMenu:function(){},destroyMenu:function(){},load:function(){},render:function(){},handleOverSourceTimer:function(){if(this.overSourceTimer!==null){clearTimeout(this.overSourceTimer.timeout);this.overSourceTimer=null;}this.handleOutTargetTimer();},handleOutSourceTimer:function(){if(this.outSourceTimer!==null){clearTimeout(this.outSourceTimer.timeout);this.outSourceTimer=null;}if(this.outTargetTimer!==null){clearTimeout(this.outTargetTimer.timeout);this.outTargetTimer=null;}},handleOverTargetTimer:function(){if(this.overTargetTimer!==null){clearTimeout(this.overTargetTimer.timeout);this.overTargetTimer=null;}this.handleOutSourceTimer();},handleOutTargetTimer:function(){if(this.outTargetTimer!==null){clearTimeout(this.outTargetTimer.timeout);this.outTargetTimer=null;}if(this.outSourceTimer!==null){clearTimeout(this.outSourceTimer.timeout);this.outSourceTimer=null;}},onOverSource:function(D){this.handleOverSourceTimer();this.handleOutSourceTimer();var E=Event.element(D);if(E!==null){var F=FunctionExt.defer(function(A){if(this.onOverSourceCallback){this.onOverSourceCallback(A);}},this.timeout,this,[E]);this.overSourceTimer={menu:E,timeout:F};}},onOutSource:function(D){this.handleOverSourceTimer();this.handleOutSourceTimer();var E=Event.element(D);if(E!==null){var F=FunctionExt.defer(function(A){if(this.onOutSourceCallback){this.onOutSourceCallback(A);}},this.timeout,this,[E]);this.outSourceTimer={menu:E,timeout:F};}},onClickSource:function(C){var D=Event.element(C);if(D!==null){if(this.onClickSourceCallback){this.onClickSourceCallback(D);}}},onOverTarget:function(D){this.handleOverTargetTimer();this.handleOutTargetTimer();var E=Event.element(D);if(E!==null){var F=FunctionExt.defer(function(A){if(this.onOverTargetCallback){this.onOverTargetCallback(A);}},this.timeout,this,[E]);this.overTargetTimer={menu:E,timeout:F};}},onOutTarget:function(D){this.handleOverTargetTimer();this.handleOutTargetTimer();var E=Event.element(D);if(E!==null){var F=FunctionExt.defer(function(A){if(this.onOutTargetCallback){this.onOutTargetCallback(A);}},this.timeout,this,[E]);this.outTargetTimer={menu:E,timeout:F};}},closed:false,close:function(){if(!this.closed){this.closed=true;this.destroyMenu();this.destroyEvent();this.destroyDOM();}}};var TabPanel=Class.create();Object.extend(Object.extend(TabPanel.prototype,MenuBase.prototype),{initializeMenu:function(){this.overTimeout=300;this.menuOn=null;},destroyMenu:function(){this.menuOn=null;},setTab:function(B){this.setMenuOn(this.menus[B]);},onMenuActiveCallback:function(C,D){if(this.menuOn!=C){this.on(C,D);}},onMenuOverCallback:function(C,D){this.onClickMenuCallback(C,D);},onClickMenuCallback:function(C,D){if(this.menuOn!=C){this.on(C,D);}},beforeOn:function(C,D){if(this.menuOn&&this.menuOn!=null){this.off(this.menuOn,this.menuOn.index);}this.menuOn=C;this.menuOn.index=D;},on:function(C,D){this.beforeOn(C,D);C.addClassName("on");this.showMenuContent(D);},onShowMenuComplete:function(){this.isActive=false;},off:function(C,D){if(C.className!=""){C.removeClassName("on");this.hideMenuContent(D);}},showMenuContent:function(D){var C=this.contents[D];if(!$visible(C)){$show(C);if(this.onShowContentCallback){this.onShowContentCallback(D);}}},hideMenuContent:function(D){var C=this.contents[D];if($visible(C)){$hide(C);}}});var AccordionPanel=Class.create();Object.extend(Object.extend(AccordionPanel.prototype,MenuBase.prototype),{initializeMenu:function(){this.menuOn=null;var G=this.menus,J=null,I=[],H=null;for(var K=0,L=this.menus.length;K<L;K++){J=G[K];H=J.down("div");I.push(H);}this.subMenus=I;this.overTimeout=2;this.isActive=false;},destroyMenu:function(){this.menuOn=null;},onMenuActiveCallback:function(C,D){if(this.menuOn!=C){this.on(C,D);}},onMenuOverCallback:function(C,D){if(this.menuOn!=C){this.on(C,D);}},beforeOn:function(C,D){if(this.menuOn&&this.menuOn!=null){this.off(this.menuOn,this.menuOn.index);}this.menuOn=C;this.menuOn.index=D;},on:function(C,D){this.beforeOn(C,D);C.addClassName("on");this.showMenuContent(D);},onShowMenuComplete:function(){this.isActive=false;},off:function(C,D){if(C.className!=""){C.removeClassName("on");this.hideMenuContent(D);}},showMenuContent:function(D){var C=this.subMenus[D];if(!$visible(C)){$show(C);}},hideMenuContent:function(D){var C=this.subMenus[D];if($visible(C)){$hide(C);}}});var NavigationSubMenus={"index":{hasSubMenu:0,Title:"\u9996\u9875",Url:siteUrl,pan:"M11_Nav_Home",pageSubAreaName:"M11_R_Head_Navigation_HomeSubMenu"},"news":{hasSubMenu:1,Title:"新闻",Url:siteNewsUrl,"新闻首页":{Title:"新闻首页",Url:siteNewsUrl,Pan:"M11_Nav_News_Index"},"电影新闻":{Title:"电影新闻",Url:siteNewsUrl+"/movie/all/",Pan:"M11_Nav_News_Movie"},"人物新闻":{Title:"人物新闻",Url:siteNewsUrl+"/people/all/",Pan:"M11_Nav_News_Person"},"电视新闻":{Title:"电视新闻",Url:siteNewsUrl+"/tv/all/",Pan:"M11_Nav_News_TV"},"图片新闻":{Title:"图片新闻",Url:siteNewsUrl+"/gallery/",Pan:"M11_Nav_News_Gallery"},"视频新闻":{Title:"视频新闻",Url:siteNewsUrl+"/video/all/",Pan:"M11_Nav_News_Video"},"专题策划":{Title:"专题策划",Url:siteNewsUrl+"/features/",Pan:"M11_Nav_News_Feature"}},"trailer":{hasSubMenu:1,Title:"预告片",Url:siteUrl+"/trailer/","预告片首页":{Title:"预告片",Url:siteUrl+"/trailer/",Pan:"M11_Nav_Trailer_Index"},"最新预告片":{Title:"最新预告片",Url:siteUrl+"/trailer/trailer/",Pan:"M11_Nav_Trailer_New"},"幕后花絮":{Title:"幕后花絮",Url:siteUrl+"/trailer/behind_the_scene/",Pan:"M11_Nav_Trailer_BehindTheScene"},"精彩片段":{Title:"精彩片段",Url:siteUrl+"/trailer/clips/",Pan:"M11_Nav_Trailer_Clips"},"MV":{Title:"MV",Url:siteUrl+"/trailer/MV/",Pan:"M11_Nav_Trailer_MV"},"高清视频":{Title:"高清视频",Url:siteUrl+"/trailer/HD/",Pan:"M11_Nav_Trailer_HD"}},"review":{hasSubMenu:1,Title:"影评",Url:siteUrl+"/review/","影评首页":{Title:"影评首页",Url:siteUrl+"/review/",Pan:"M11_Nav_Review_Index"},"最新影评":{Title:"最新影评",Url:siteUrl+"/review/newcomment/",Pan:"M11_Nav_Review_NewComment"},"新片热评":{Title:"新片热评",Url:siteUrl+"/review/nowplaying/",Pan:"M11_Nav_Review_NowPlaying"},"经典赏析":{Title:"经典赏析",Url:siteUrl+"/review/1/",Pan:"M11_Nav_Review_Classic"},"媒体评论":{Title:"媒体评论",Url:siteUrl+"/review/mediareview/",Pan:"M11_Nav_Review_MediaReview"},"影评人专栏":{Title:"影评人专栏",Url:siteUrl+"/review/column/",Pan:"M11_Nav_Review_Column"}},"showtime":{hasSubMenu:1,Title:"\u7535\u5F71\u9662",Url:"http://theater.mtime.com/","电影院频道":{Title:"电影院频道",Url:"http://theater.mtime.com/",Pan:"M11_Nav_Theater_Index"},"影讯":{Title:"影讯",Url:"http://theater.mtime.com/showtime/",Pan:"M11_Nav_Theater_Showtime"},"新片":{Title:"新片",Url:"http://theater.mtime.com/movie/",Pan:"M11_Nav_Theater_NewMovie"},"影院":{Title:"影院",Url:"http://theater.mtime.com/cinema/",Pan:"M11_Nav_Theater_Cinema"},"优惠":{Title:"优惠",Url:"http://theater.mtime.com/discount/",Pan:"M11_Nav_Theater_Discount"}},"movie":{hasSubMenu:1,Title:"资料库",Url:siteMovieUrl,"资料库首页":{Title:"资料库首页",Url:siteMovieUrl,className:"",Pan:"M11_Nav_Movie_Index"},"全球新片":{Title:"全球新片",Url:siteMovieUrl+"/new/",Pan:"M11_Nav_Movie_New"},"票房榜":{Title:"票房榜",Url:siteMovieUrl+"/boxoffice/",Pan:"M11_Nav_Movie_BoxOffice"},"时光网TOP100":{Title:"时光网TOP100",Url:siteUrl+"/top/movie/top100/",Pan:"M11_Nav_Movie_MovieTop100"},"典藏佳片":{Title:"典藏佳片",Url:siteMovieUrl+"/classic/",Pan:"M11_Nav_Movie_Classic"},"电影查询":{Title:"电影查询",Url:siteMovieUrl+"/movie/search/section/",Pan:"M11_Nav_Movie_Section"},"人物查询":{Title:"人物查询",Url:siteMovieUrl+"/people/search/section/",Pan:"M11_Nav_Person_Section"},"电视查询":{Title:"电视查询",Url:siteMovieUrl+"/tv/search/section/",Pan:"M11_Nav_Tv_Section"}},"community":{hasSubMenu:0,Title:"社区",Url:siteUrl+"/community/",pan:"M11_Nav_Community",pageSubAreaName:"M11_R_Head_Navigation_CommunitySubMenu"},"home":{hasSubMenu:0,Title:"我的时光",Url:"http://my.mtime.com/"}};var NavigationBar=Class.create();Object.extend(Object.extend(NavigationBar.prototype,MenuBase.prototype),{initializeMenu:function(){this.menuOn=null;this.subMenuElements=[];this.subMenus=NavigationSubMenus;for(var D=0,C=this.menus.length;D<C;D++){this.saveOriginStyle(this.menus[D]);}},render:function(){if(this.menus!==null&&this.menus.length>0&&this.initializeMenuIndex>=0){var E=this.menus,F=null;for(var G=0,H=E.length;G<H;G++){F=E[G];if(F.token==this.initializeMenuIndex){this.setMenuOn(F);break;}}}},destroyMenu:function(){this.menuOn=null;this.subMenuElements.clear();this.subMenuElements=null;},onMenuActiveCallback:function(L,N){if(this.menuOn&&this.menuOn!=null){this.off(this.menuOn,N);}this.menuOn=L;this.on(L,N);if(this.subNavigaionType>0){var I=$("nav_sec");if(I){var H=I.getElementsByTagName("li");if(H&&H.length>0){for(var M=0;M<H.length;++M){var K=$(H[M]);var J=parseInt(K.readAttribute("token"),10);if(J==this.subNavigaionType){K.className="on";}}}}}},onMenuInactiveCallback:function(C,D){this.off(C,D);},onMenuOverCallback:function(C,D){if(this.menuOn!=C){this.on(C,D);if(!this.visibleMenu(C._className)){this.showSubMenu(C,C._className);}}},onMenuOutCallback:function(C,D){if(this.menuOn!=C){this.off(C,D);this.hideSubMenu(C._className);}},on:function(C,D){if(C.noMouseOver){return;}C.className=C._className+" hover";},off:function(C,D){C.className=C._className;},onClickMenuCallback:function(D,F,E){},isMenuHover:function(B){return B.className==(B._className+" hover");},visibleMenu:function(C){var D=this.subMenuElements[C];if(D&&D!=null&&D.visible()){return true;}return false;},hideSubMenu:function(C){var D=this.subMenuElements[C];if(D&&D!=null){D.hide();}},showSubMenu:function(E,D){var F=this.subMenuElements[D];if(!F){F=this.createSubMenu(D);this.subMenuElements[D]=F;if(F==null){return;}E.appendChild(F);F["dimensions"]=F.getDimensions();F.hide();}else{if(F==null){return;}}new Fx.Slide(F,{scaleY:true,duration:0.2,dimensions:F["dimensions"]});},createSubMenu:function(J){var P=this.getSubMenu(J);if(P!=null){var N=new StringBuilder();var O=P.className?P.className:"";N.append(String.Format('<p style="overflow:hidden;">',O));for(var L in P){var I=P[L];if(I.Title&&I.Url){var K=I.Url.startsWith("http")?I.Url:siteUrl+I.Url;N.append(String.Format('<a class="__r_c_" pan="{0}" href="{1}">',I.Pan,K));N.append(I.Title);N.append("</a>");}}N.append("</p>");var M=Element.extend(Builder.build(N.toString()));return M;}return null;},saveOriginStyle:function(B){if(typeof B._className==="undefined"){B._className=B.className;B.token=parseInt(B.readAttribute("token"),10);}},indexOfByClass:function(G){var F=this.menus,J=null;for(var H=0,I=F.length;H<I;H++){J=F[H];if(J.className==G){return H;}}return -1;},getSubMenu:function(D){var C=this.subMenus[D];if(typeof C!=="undefined"&&C.hasSubMenu){return C;}return null;}});var DropDownList=Mtime.Control.DropDownList;DropDownList=Class.create();Object.extend(DropDownList.prototype,{options:{selectRegion:null,selectDefaultOption:null,selectButton:null,listRegion:null,itemTemplate:'<a href="#" onclick="return false;" value="#{id}">#{text}</a>',selectDatas:null,idFieldName:"",titleFieldName:"",width:-1,height:-1,showCount:8,onChangeCallback:null},setOptions:function(B){Object.extend(Object.extend(this,this.options),B);},initialize:function(B){this.setOptions(B);this.initializeField();this.initializeDOM();this.initializeEvent();this.load();this.render();},initializeField:function(){this.itemTemplate=new Template(this.itemTemplate);this.reset();},reset:function(){this.selectIndex=-1;this.selectedValue=null;this.scrollTop=-1;this.usedDataIds=[];this.active=false;this.listIndex=0;},initializeDOM:function(){this.selectRegion=$(this.selectRegion);this.selectDefaultOption=$(this.selectDefaultOption);this.selectDefaultOption._text=this.selectDefaultOption.innerHTML;this.selectButton=$(this.selectButton);this.listRegion=$(this.listRegion);},destroyDOM:function(){this.listRegion=null;this.selectRegion=null;this.selectDefaultOption=null;this.selectButton=null;},initializeEvent:function(){this.onClickDefaultOptionHandler=this.onClickDefaultOption.bindAsEventListener(this);this.selectDefaultOption.observe("click",this.onClickDefaultOptionHandler);this.onClickSelectButtonHandler=this.onClickSelectButton.bindAsEventListener(this);this.selectButton.observe("click",this.onClickSelectButtonHandler);this.onClickListRegionHandler=this.onClickListRegion.bindAsEventListener(this);this.listRegion.observe("click",this.onClickListRegionHandler);this.onScrollListRegionHandler=this.onScrollListRegion.bindAsEventListener(this);this.listRegion.observe("scroll",this.onScrollListRegionHandler);this.onClickHandler=this.onClick.bindAsEventListener(this);Event.observe(document.body,"click",this.onClickHandler);Event.observe(window,"unload",this.close.bind(this));},destroyEvent:function(){this.selectDefaultOption.stopObserving("click",this.onClickDefaultOptionHandler);this.selectButton.stopObserving("click",this.onClickSelectButtonHandler);this.listRegion.stopObserving("click",this.onClickListRegionHandler);this.listRegion.stopObserving("scroll",this.onScrollListRegionHandler);Event.stopObserving(document.body,"click",this.onClickHandler);},load:function(){if(this.selectDatas==null||this.selectDatas.length==0){return;}this.setSelectedValue(this.selectDatas[0]);},show:function(){if(!this.selectRegion.visible()){this.selectRegion.show();}},hide:function(){if(this.selectRegion.visible()){this.selectRegion.hide();}},onClickDefaultOption:function(){this.showSelectList();},onClickSelectButton:function(){this.showSelectList();},onClickListRegion:function(F){var H=Event.findElement(F,"a");if(H&&H.readAttribute){var E=H.readAttribute("value");var G=this.getOption(E);this.setValue(G);}},onScrollListRegion:function(C){var D=this.getScrollTop();if(D>=this.scrollTop){if(!this.active){this.active=true;this.scrollTop=D;this.render();this.active=false;}}},render:function(){var B=this.getMoreLists();if(B&&B.length>0){B.each(function(A){this.listRegion.appendChild(A);}.bind(this));}},setValue:function(B){this.setSelectedValue(B);this.hideSelectList();},setValueById:function(B){this.setValue(this.getOption(B));},setData:function(B){this.reset();this.listRegion.innerHTML="";this.selectDefaultOption.innerHTML=this.selectDefaultOption._text;this.selectDatas=B;this.render();},getMoreLists:function(){if(this.selectDatas==null||this.selectDatas.length==0){return"";}var P=this.showCount,K=this.selectDatas,N=null,L=[],O=0,Q=this.itemTemplate;for(var R=this.listIndex,M=K.length;R<M&&O<P;R++){N=K[R];var J=N[this.idFieldName];if(!this.usedDataIds.include(J)){this.usedDataIds.push(J);L.push(Builder.build(this.createListItem(N)));O++;this.listIndex=R;}}this.listIndex++;return L;},createListItem:function(B){return this.itemTemplate.evaluate(B);},onClick:function(C){var D=Event.element(C);if(!this.contain(D)){this.hideSelectList();}},showSelectList:function(){if(!this.listRegion.visible()){this.listRegion.show();this.scrollTop=this.getScrollTop();}},hideSelectList:function(){if(this.listRegion.visible()){this.listRegion.hide();}},setSelectedValue:function(B){if(B!=null){if(this.selectedValue==null||this.selectedValue[this.idFieldName]!=B[this.idFieldName]){this.selectDefaultOption.innerHTML=B[this.titleFieldName];this.selectedValue=B;if(this.onChangeCallback&&this.onChangeCallback!=null){this.onChangeCallback(B);}}}},contain:function(B){return B.descendantOf(this.selectRegion);},getValue:function(){return this.selectedValue;},getOption:function(F){var D=null;var E=this.idFieldName;this.selectDatas.each(function(A){if(A[E]==F){D=A;throw $break;}});return D;},getScrollTop:function(){return Position.realOffset(this.listRegion)[1];},isClosed:false,close:function(){if(!this.isClosed){this.isClosed=true;if(this.selectDatas!=null){this.selectDatas.clear();}this.hideSelectList();this.destroyEvent();this.destroyDOM();}}});var DropDownMenu=Mtime.Control.DropDownList;DropDownMenu=Class.create();Object.extend(DropDownMenu.prototype,{name:"DropDownMenu",visible:false,menuButton:null,menuContent:null,canHide:null,onClickMenuButtonHandler:null,onClickDocumentHandler:null,options:{menuButton:"",menuContent:"",canHide:null},setOptions:function(B){Object.extend(Object.extend(this,this.options),B);},initialize:function(B){this.setOptions(B);this.initializeDOM();this.initializeEvent();},initializeDOM:function(){this.menuButton=$(this.menuButton);this.menuContent=$(this.menuContent);},destroyDOM:function(){this.menuButton=this.menuContent=null;},initializeEvent:function(){this.onClickMenuButtonHandler=this.onClickMenuButton.bindAsEventListener(this);this.menuButton.observe("click",this.onClickMenuButtonHandler);this.onClickMenuContentHandler=this.onClickMenuContent.bindAsEventListener(this);this.menuContent.observe("click",this.onClickMenuContentHandler);this.onClickDocumentHandler=this.onClickDocument.bindAsEventListener(this);Event.observe(document,"click",this.onClickDocumentHandler);},destroyEvent:function(){Event.stopObserving(document,"click",this.onClickDocumentHandler);this.onClickDocumentHandler=null;this.menuButton.stopObserving("click",this.onClickMenuButtonHandler);this.onClickMenuButtonHandler=null;this.menuContent.stopObserving("click",this.onClickMenuContentHandler);this.onClickMenuContentHandler=null;},onClickMenuButton:function(B){this.visible=!this.menuContent.visible();},onClickMenuContent:function(B){this.visible=this.menuContent.visible();},onClickDocument:function(C){if(this.visible){this.menuContent.show();}else{var D=true;if(this.canHide){D=this.canHide();}if(D){this.menuContent.hide();}}this.visible=false;},close:function(){this.destroyEvent();this.destroyDOM();}});var AutoCompleteBase=Mtime.Control.AutoCompleteBase;AutoCompleteBase=Class.create();Object.extend(AutoCompleteBase.prototype,{options:{text:null,textWatermarkText:"",listRegion:null,itemTemplate:"",searchDatas:null,defaultSearchDatas:null,idFieldName:"id",titleFieldName:"title",choiceCount:8,frequency:0.1,minChars:1,isMatch:null,isShowMoreResult:true,isAlwayShowList:true,isEnable:true,onChangeInputCallback:null,onChangeCallback:null,isAutoMatchSuggest:false,onEnterCallback:null},setOptions:function(B){Object.extend(Object.extend(this,this.options),B);},baseInitialize:function(B){this.setOptions(B);this.baseInitializeField();this.initializeField();this.baseInitializeDOM();this.initializeDOM();this.baseInitializeEvent();this.initializeEvent();this.initializeControl();this.load();},baseInitializeField:function(){this.itemTemplate=new Template(this.itemTemplate);this.selectedValue=null;this.scrollTop=-1;this.active=false;this.searchIndex=0;this.hasFocus=false;this.changed=false;this.index=-1;this.entryCount=0;this.observer=null;this.keyword="";},initializeField:function(){},baseInitializeDOM:function(){this.text=$(this.text);this.text.setAttribute("autocomplete","off");this.listRegion=$(this.listRegion);},initializeDOM:function(){},baseDestroyDOM:function(){this.listRegion=null;this.text=null;},destroyDOM:function(){},baseInitializeEvent:function(){this.onScrollListRegionHandler=this.onScrollListRegion.bindAsEventListener(this);this.listRegion.observe("scroll",this.onScrollListRegionHandler);this.onClickListRegionHandler=this.onClickListRegion.bindAsEventListener(this);this.listRegion.observe("click",this.onClickListRegionHandler);this.onClickHandler=this.onClick.bindAsEventListener(this);Event.observe(document.body,"click",this.onClickHandler);Event.observe(window,"unload",this.close.bind(this));},initializeEvent:function(){},baseDestroyEvent:function(){this.listRegion.stopObserving("scroll",this.onScrollListRegionHandler);this.listRegion.stopObserving("click",this.onClickListRegionHandler);Event.stopObserving(document.body,"click",this.onClickHandler);},destroyEvent:function(){},initializeControl:function(){this.textbox=new Textbox({text:this.text,value:this.text.value,watermarkText:this.textWatermarkText,focusClassName:"c_000",blurClassName:"c_a5",onFocusCallback:this.onFocusText.bind(this),onBlurCallback:this.onBlurText.bind(this),onKeydownCallback:this.onKeydownText.bind(this),onKeyupCallback:this.onKeydownText.bind(this),onClickCallback:this.onClickText.bind(this)});},destroyControl:function(){this.textbox.close();},load:function(){},onBlurText:function(C,D){this.active=false;this.hasFocus=false;if(C!==""&&!this.listRegion.visible()){this.search();}setTimeout(this.hide.bind(this),250);},onFocusText:function(B){this.hasFocus=true;this.active=true;},onKeydownText:function(B){if(this.handled){this.handled=false;return;}this.handled=true;switch(B.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.onEnterText();Event.stop(B);return;case Event.KEY_ESC:this.hide();Event.stop(B);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:this.markPrevious();Event.stop(B);return;case Event.KEY_DOWN:this.markNext();Event.stop(B);return;default:this.addObserver();this.onChangeInput();break;}},onEnterText:function(){this.search();if(this.onEnterCallback){this.onEnterCallback(this.getValue());}},onClickText:function(){this.render();},onClick:function(C){var D=Event.element(C);if(D!=this.text&&!this.contain(D)){this.hide();}},onClickListRegion:function(C){var D=Event.findElement(C,"a");if(D){this.removeObserver();this.selectedEntry(D);if(this.onEnterCallback){this.onEnterCallback(this.getValue());}}},onScrollListRegion:function(C){var D=this.getScrollTop();if(D>=this.scrollTop){if(!this.active){this.active=true;this.scrollTop=D;this.render();this.active=false;}}},reset:function(){this.selectedValue=null;this.index=-1;this.searchIndex=0;this.entryCount=0;},render:function(){if(this.searchDatas===null&&this.getSearchDataCallback!==null){this.getSearchDataCallback(function(B){this.searchDatas=B;this.doRender();}.bind(this));}else{this.doRender();}},doRender:function(){if(this.isEnable){if(this.changed){this.reset();}var D=this.getSearchKeyword();if(D.length==0){this.removeObserver();this.renderDefaultList();}else{var C=this.getMoreLists();if(this.isAlwayShowList||this.entryCount>0){this.renderTip(D,this.entryCount);this.renderList(this.changed,C);this.showSelectList();}else{this.hideSelectList();}}}},renderDefaultList:function(){if(this.defaultSearchDatas){var N=this.choiceCount,J=this.defaultSearchDatas,I=null,K=[],M=new StringBuilder(),O=0;for(var P=0,L=J.length;P<L&&O<N;P++){I=J[P];M.append(this.createListItem(I));O++;}this.entryCount=O;this.renderTip("",0);this.renderList(true,M.toString());this.showSelectList();}else{this.hideSelectList();}},renderTip:function(D,C){},renderList:function(D,C){if(!D){this.listRegion.innerHTML+=C;}else{this.listRegion.innerHTML=C;}},getMoreLists:function(){var Q=this.getSearchKeyword(),V=Q.length,Z=this.choiceCount,P=this.searchDatas,O=null,S=[],X=new StringBuilder(),a=0,Y=this.idFieldName,W=this.titleFieldName;for(var b=this.searchIndex,T=P.length;b<T&&a<Z;b++){O=P[b];var U=O[W],R=O[Y];if(V==0){X.append(this.createListItem(O));a++;}else{if(this.match(Q,O)){X.append(this.createListItem(O));a++;}}}this.entryCount+=a;return X.toString();},onChangeInput:function(){this.changed=true;if(this.onChangeInputCallback!=null){if(this.onChangeInputTimer){clearTimeout(this.onChangeInputTimer);}this.onChangeInputTimer=setTimeout(function(){this.onChangeInputCallback();}.bind(this),10);}},addObserver:function(){this.removeObserver();this.observer=setInterval(this.onObserverEvent.bind(this),this.frequency*1000);},removeObserver:function(){if(this.observer){clearInterval(this.observer);}},onObserverEvent:function(){var B=this.getSearchKeyword();if(B.length>=this.minChars){if(B!=this.keyword){this.keyword=B;this.render();}}else{this.keyword="";this.active=false;this.hideSelectList();}},markPrevious:function(){this.setEntryOff(this.index);if(this.index>0){this.index--;}else{this.index=this.entryCount-1;}this.setEntryOn(this.index);},markNext:function(){this.setEntryOff(this.index);if(this.index<this.entryCount-1){this.index++;}else{this.index=0;}this.setEntryOn(this.index);},setEntryOn:function(D){var C=this.getEntry(this.index);if(C&&C!=null){C.className="on";}},setEntryOff:function(D){var C=this.getEntry(this.index);if(C&&C!=null){C.className="";}},getCurrentEntry:function(){return this.getEntry(this.index);},getEntry:function(B){return this.listRegion.childNodes[B+1];},selectEntry:function(){this.active=false;var B=this.getCurrentEntry();if(B){this.removeObserver();this.selectedEntry(B.down("a"));}},selectedEntry:function(D){if(D&&D.readAttribute){var E=D.readAttribute("value");if(E&&E.length>0){var F=this.getOption(E);this.setValue(F);}}},search:function(){if(this.index===-1){if(this.isAutoMatchSuggest){this.render();this.index=0;}}this.selectEntry();},setValue:function(B){this.setSelectedValue(B);this.hideSelectList();},match:function(E,F){var D=F[this.titleFieldName].toLowerCase().indexOf(E);if(D==0){return true;}return false;},createListItem:function(B){return this.itemTemplate.evaluate(B);},show:function(){this.showSelectList();},showSelectList:function(){if(!this.listRegion.visible()){this.listRegion.show();this.scrollTop=this.getScrollTop();}},hideSelectList:function(){if(this.listRegion.visible()){this.listRegion.hide();}},hide:function(){this.hideSelectList();},setSelectedValue:function(B){if(B!=null){if(this.selectedValue===null||this.selectedValue[this.idFieldName]!=B[this.idFieldName]){this.textbox.setValue(B[this.titleFieldName]);this.selectedValue=B;if(this.onChangeCallback&&this.onChangeCallback!=null){this.onChangeCallback(B);}}}},getValue:function(){return this.selectedValue;},getOption:function(F){var D=null;var E=this.idFieldName;this.searchDatas.each(function(A){if(A[E]==F){D=A;throw $break;}});return D;},getSearchKeyword:function(){return this.textbox.getValue();},getScrollTop:function(){return Position.realOffset(this.listRegion)[1];},contain:function(B){return B.descendantOf(this.listRegion);},setEnable:function(B){this.isEnable=B;},isClosed:false,close:function(){if(!this.isClosed){this.isClosed=true;if(this.observer){clearTimeout(this.observer);}if(this.searchDatas!=null){this.searchDatas=null;}this.destroyControl();this.hideSelectList();this.baseDestroyEvent();this.destroyEvent();this.baseDestroyDOM();this.destroyDOM();}}});var KeywordAutoComplete=Class.create();Object.extend(Object.extend(KeywordAutoComplete.prototype,AutoCompleteBase.prototype),{initialize:function(B){this.type=typeof B.type==="undefined"?"all":B.type;this.baseInitialize(B);},initializeField:function(){this.isAlwayShowList=false;this.isShowMoreResult=false;},initializeDOM:function(){},destroyDOM:function(){},initializeEvent:function(){},destroyEvent:function(){},getEntry:function(D){var C=this.listRegion.childNodes.length;if(C>D&&D>=0){return $(this.listRegion.childNodes[D]);}return null;},selectEntry:function(){this.active=false;var B=this.getCurrentEntry();this.selectedEntry(B);},getOption:function(F){var D=null;var E=this.idFieldName;this.searchDatas[F.charAt(0).toLowerCase()].each(function(A){if(A[E]==F){D=A;throw $break;}});return D;},getMoreLists:function(){var R=this.getSearchKeyword(),W=R.length,b=this.choiceCount,Q=this.searchDatas,P=null,T=[],Y=new StringBuilder(),c=0,a=this.idFieldName,X=this.titleFieldName;var Z=W===0?Q[0]:Q[R.charAt(0).toLowerCase()];if(Z){for(var d=this.searchIndex,U=Z.length;d<U&&c<b;d++){P=Z[d];var V=P[X],S=P[a];if(this.match(R,P)){if(P.count>0){P.display="";}else{P.display='style="display:none;"';}Y.append(this.createListItem(P));c++;}this.searchIndex=d;}this.entryCount+=c;}return Y.toString();},match:function(E,F){if(this.type!=="all"){if(this.type==="movie"){if(F.type!==1){return false;}}if(this.type==="person"){if(F.type!==2){return false;}}}var D=F[this.titleFieldName].toLowerCase().indexOf(E.toLowerCase());if(D==0){return true;}return false;},renderTip:function(D,C){},renderList:function(D,C){this.listRegion.innerHTML=C;},setType:function(B){this.type=B;},equal:function(C,D){if(this.type!=="all"){if(this.type==="movie"){if(D.type!==1){return false;}}if(this.type==="person"){if(D.type!==2){return false;}}}if(D[this.titleFieldName]==C){return true;}else{return false;}},isIntern:function(K){var L=this.searchDatas;var H=this.idFieldName;if(K.length===0){return true;}else{var I=L[K.charAt(0).toLowerCase()];if(I){for(var J=0,G=I.length;J<G;J++){if(this.equal(K,I[J])){return true;}}}return false;}}});var Search=Class.create();Object.extend(Search.prototype,{options:{textbox:"",textboxSuggestRegion:"",searchButton:"",selectTypeRegion:"",selectTypeDefaultOption:"",selectTypeButton:"",selectTypeListRegion:"",selectTypeDatas:null,itemTemplate:'<a href="#" onclick="return false;" value="#{id}">#{text}</a>',watermark:"请输入关键字",actionUrl:"/search/",isMini:false},setOptions:function(B){Object.extend(Object.extend(this,this.options),B);},initialize:function(B){this.setOptions(B);this.initializeField();this.initializeDOM();this.initializeEvent();this.initializeControl();},initializeField:function(){this.type="";},initializeDOM:function(){this.textbox=$(this.textbox);this.searchButton=$(this.searchButton);this.selectTypeRegion=$(this.selectTypeRegion);if(this.isMini){this.currentTypeElement=$("all");}},destroyDOM:function(){this.textbox=null;this.searchButton=null;this.selectTypeRegion=null;if(this.isMini){this.currentTypeElement=null;}},initializeEvent:function(){this.onClickSearchButtonHandler=this.onClickSearchButton.bindAsEventListener(this);this.searchButton.observe("click",this.onClickSearchButtonHandler);if(this.selectTypeRegion){if(this.isMini){this.onClickSelectTypeRegionHandler=this.onClickSelectTypeRegion.bindAsEventListener(this);this.selectTypeRegion.observe("click",this.onClickSelectTypeRegionHandler);}}Event.observe(window,"unload",this.close.bind(this));},destroyEvent:function(){this.searchButton.stopObserving("click",this.onClickSearchButtonHandler);if(this.selectTypeRegion){if(this.isMini){this.selectTypeRegion.stopObserving("click",this.onClickSelectTypeRegionHandler);}}},initializeControl:function(){if(this.selectTypeRegion){if(!this.isMini){this.typeDropDownList=new DropDownList({selectRegion:this.selectTypeRegion,selectDefaultOption:this.selectTypeDefaultOption,selectButton:this.selectTypeButton,listRegion:this.selectTypeListRegion,itemTemplate:'<a href="#" onclick="return false;" value="#{id}">#{text}</a>',selectDatas:this.selectTypeDatas,idFieldName:"id",titleFieldName:"text",showCount:6,onChangeCallback:this.onChangeTypeCallback.bind(this)});}}this.keywordAutoComplete=new KeywordAutoComplete({text:this.textbox,textWatermarkText:this.watermark,listRegion:this.textboxSuggestRegion,itemTemplate:'<a href="#" value="#{word}"><em #{display}>被查询 #{count} 次</em>#{word}</a>',idFieldName:"word",titleFieldName:"word",searchDatas:null,getSearchDataCallback:function(B){$loadJs("/Utility/Data/SearchKeywordData.m",function(){B(searchKeywordData);});}.bind(this),choiceCount:8,onChangeInputCallback:null,onChangeCallback:null,onEnterCallback:this.onEnter.bind(this)});},destroyControl:function(){if(this.keywordAutoComplete){this.keywordAutoComplete.close();}if(this.typeDropDownList){this.typeDropDownList.close();}},load:function(){},onClickSearchButton:function(){var B=this.getKeyword();this.search(B);},onClickSelectTypeRegion:function(C){var D=Event.findElement(C,"li");if(D&&D.id){this.type=D.id;if(this.currentTypeElement){this.currentTypeElement.className="";}D.className="current";this.currentTypeElement=D;if(this.keywordAutoComplete){if(this.type=="all"||this.type=="movie"||this.type=="person"){this.keywordAutoComplete.setType(this.type);this.keywordAutoComplete.setEnable(true);}else{this.keywordAutoComplete.setEnable(false);}}}},onChangeTypeCallback:function(B){this.type=B.id;if(this.keywordAutoComplete){if(this.type=="all"||this.type=="movie"||this.type=="person"){this.keywordAutoComplete.setType(this.type);this.keywordAutoComplete.setEnable(true);}else{this.keywordAutoComplete.setEnable(false);}}},onEnter:function(C){var D="";if(!C){D=this.getKeyword();}else{D=C.word;}this.search(D);},search:function(D){if((this.type=="all"||this.type=="movie"||this.type=="person")&&!this.keywordAutoComplete.isIntern(D)){setCookie("searchPrompt",D);}if(D.length>0){var C=siteUrl+this.actionUrl+(this.type==="all"?"":this.type)+"?"+encodeURIComponent(D).replace(/'/g,"%27");$redirect(C);}},getKeyword:function(){var B="";if(this.keywordAutoComplete){B=this.keywordAutoComplete.getSearchKeyword();}else{B=this.textbox.value;}return B;},isClosed:false,close:function(){if(!this.isClosed){this.isClosed=true;this.destroyControl();this.destroyEvent();this.destroyDOM();}}});var ShowtimeCityAutoComplete=Class.create();Object.extend(Object.extend(ShowtimeCityAutoComplete.prototype,AutoCompleteBase.prototype),{initialize:function(B){this.baseInitialize(B);},initializeField:function(){this.firstRender=true;this.isShowMoreResult=false;this.isAutoMatchSuggest=true;},initializeDOM:function(){this.listTipText=$(this.listTipText);this.listContentRegion=$(this.listContentRegion);},destroyDOM:function(){this.listTipText=null;this.listContentRegion=null;},initializeEvent:function(){},destroyEvent:function(){},getEntry:function(D){var C=this.listContentRegion.childNodes.length;if(C>D&&D>=0){return $(this.listContentRegion.childNodes[D]);}return null;},match:function(C,D){if((D["NameCn"].toLowerCase().indexOf(C)===0)||(D["NameEn"].toLowerCase().indexOf(C)===0)){return true;}return false;},renderTip:function(D,C){if(this.firstRender||D===""){this.firstRender=false;this.listTipText.innerHTML="输入中文/拼音或按&uarr;&darr;选择";}else{if(C>0){this.listTipText.innerHTML=D.stripTags()+"，按拼音数排序";}else{this.listTipText.innerHTML="对不起，找不到："+D.stripTags();}}},renderList:function(D,C){this.listContentRegion.innerHTML=C;}});var defaultCityIds=[290,292,365,366,561,880];var ShowtimeHelper={getDefaultCitys:function(J){var N=[];for(var K=0,I=defaultCityIds.length;K<I;K++){var M=defaultCityIds[K];var H=this.getCity(J,M);if(H!==null){N.push(H);}}if(N.length<defaultCityIds.length){var L=defaultCityIds.length-N.length;for(var K=0,I=J.length;K<I;K++){if(L===0){break;}if(!defaultCityIds.include(J[K].Id)){N.push(J[K]);L--;}}}return N;},getCity:function(E,F){for(var G=0,H=E.length;G<H;G++){if(F==E[G].Id){return E[G];}}return null;},getDistricts:function(M){var J=M.Districts.List;if(J){var I=[];I.push({Id:0,NameCn:"所有地区"});var K="",N=[];for(var P=0,O=J.length;P<O;P++){var L=J[P];if(L.MovieIds){K+=L.MovieIds;}if(L.Cinemas.List){L.Cinemas.List.each(function(A){N.push(A);});}I.push(L);}if(K.length>0){I[0].MovieIds=K;}if(N.length>0){I[0].Cinemas={List:N};}return I;}return J;},getDistrict:function(H,G){var J=H.Districts.List;for(var I=0,F=J.length;I<F;I++){if(G==J[I].Id){return J[I];}}return null;}};var HeaderTheaterSearchBox=Class.create();HeaderTheaterSearchBox.prototype={server:{getData:function(B){$loadJs("/Utility/Data/TheaterSearchBoxData.m",B);},getLocation:function(B){return Mtime.Component.Ajax.get("Mtime.Community.Controls.CommunityPages.UserService","GetLocation",[],B,"/Service/User.m?Ajax_CallBack=true","get","25000");},search:function(F,E,H,G){return Mtime.Component.Ajax.get("Mtime.Community.Controls.CommunityPages.UserService","SearchShowtime",[F,E,H],G,"/Service/User.m?Ajax_CallBack=true","get","25000");}},options:{searchCityText:"",cityListRegion:"",cityListTipText:"",cityListContentRegion:"",selectMovieRegion:"",selectMovieListContainerRegion:"t_movieListContainerRegion",selectMovieListRegion:"",searchShowtimeButton:""},setOptions:function(B){Object.extend(Object.extend(this,this.options),B);},initialize:function(B){this.setOptions(B);if(typeof threaterSearchBoxData==="undefined"){this.server.getData(function(){this.initializeThreaterSearchBoxData();}.bind(this));}else{this.initializeThreaterSearchBoxData();}},initializeThreaterSearchBoxData:function(){this.data=threaterSearchBoxData;this.initializeField();this.initializeData();this.initializeDOM();this.initializeEvent();this.initializeControl();this.render();},initializeField:function(){this.defaultCityIds=defaultCityIds;},initializeData:function(){if(this.data.locations){this.locations=this.data.locations.List;this.defaultCityDatas=ShowtimeHelper.getDefaultCitys(this.locations);this.movies=this.data.movies;}},initializeDOM:function(){this.searchCityText=$(this.searchCityText);this.cityListRegion=$(this.cityListRegion);this.cityListTipText=$(this.cityListTipText);this.cityListContentRegion=$(this.cityListContentRegion);this.selectMovieRegion=$(this.selectMovieRegion);this.selectMovieListContainerRegion=$(this.selectMovieListContainerRegion);this.selectMovieListRegion=$(this.selectMovieListRegion);this.searchShowtimeButton=$(this.searchShowtimeButton);},destroyDOM:function(){this.searchCityText=null;this.cityListRegion=null;this.cityListTipText=null;this.cityListContentRegion=null;this.selectMovieRegion=null;this.selectMovieListContainerRegion=null;this.selectMovieListRegion=null;this.searchShowtimeButton=null;},initializeEvent:function(){this.onClickSearchButtonHandler=this.onClickSearchButton.bindAsEventListener(this);this.searchShowtimeButton.observe("click",this.onClickSearchButtonHandler);this.onClickSelectMovieListRegionHandler=this.onClickSelectMovieListRegion.bindAsEventListener(this);this.selectMovieListRegion.observe("click",this.onClickSelectMovieListRegionHandler);Event.observe(window,"unload",this.close.bind(this));},destroyEvent:function(){this.searchShowtimeButton.stopObserving("click",this.onClickSearchButtonHandler);this.selectMovieListRegion.stopObserving("click",this.onClickSelectMovieListRegionHandler);},initializeControl:function(){this.cityAutoComplete=new ShowtimeCityAutoComplete({text:this.searchCityText,textWatermarkText:"",listRegion:this.cityListRegion,listTipText:this.cityListTipText,listContentRegion:this.cityListContentRegion,itemTemplate:'<a href="#" onclick="return false;" value="#{Id}"><span class="fr">#{NameCn}</span>#{NameEn}</a>',idFieldName:"Id",titleFieldName:"NameCn",searchDatas:this.locations,defaultSearchDatas:this.defaultCityDatas,choiceCount:8,onChangeInputCallback:this.onChangeCityInputCallback.bind(this),onChangeCallback:this.onChangeCityCallback.bind(this)});this.server.getLocation(function(){var B=getLocationResult;if(B&&B.value){this.initializeCityLocation(B.value);}}.bind(this));this.observer=new Observer({sourceElement:this.selectMovieRegion,onOverSourceCallback:function(){if(this.menuTimeout){clearTimeout(this.menuTimeout);this.menuTimeout=null;}if(!this.selectMovieListContainerRegion.visible()){this.selectMovieListContainerRegion.show();}}.bind(this),onOutSourceCallback:function(){this.menuTimeout=setTimeout(function(){if(this.selectMovieListContainerRegion.visible()){this.selectMovieListContainerRegion.hide();}}.bind(this),100);}.bind(this)});},destroyControl:function(){if(this.cityAutoComplete){this.cityAutoComplete.close();}if(this.observer){this.observer.close();}},initializeCityLocation:function(F){var D=F.cityId;if(D>0){var E=this.getCity(D);if(E!==null){this.city=E;this.cityAutoComplete.setValue(E);}}else{this.setMovieList(this.movies);}},render:function(){},onChangeCityInputCallback:function(){if(this.cityAutoComplete.getSearchKeyword().length===0){this.setMovieList(this.movies);}else{this.setMovieList(null);}},onChangeCityCallback:function(J){var K=[];if(J.MovieIds){var I=J.MovieIds.split("|");for(var H=0,G=I.length;H<G;H++){var L=this.getMovie(I[H]);if(L!==null){K.push(L);}}}else{K=this.movies;}this.setMovieList(K);},onClickSearchButton:function(){var F=this.cityAutoComplete.getValue();if(F&&F!==null){var G=F.Id,E=0,H=0;this.server.search(G,E,H,this.onSearchCallback.bind(this));}},onSearchCallback:function(){var B=searchShowtimeResult;if(B&&B.value&&B.value.length>0){$redirect(B.value);}},onClickSelectMovieListRegion:function(H){var J=Event.findElement(H,"a");if(J){var L=J.readAttribute("movieid");if(L&&L.length>0){var I=this.cityAutoComplete.getValue();if(I&&I!==null){var K=I.Id,G=0;this.server.search(K,G,L,this.onSearchCallback.bind(this));}else{$redirect(siteUrl+"/showtime/"+L+"/");}}}},setMovieList:function(D){var C=this.buildMovieList(D);this.selectMovieListRegion.innerHTML=C;},buildMovieList:function(H){if(H!==null&&H.length>0){var G=new StringBuilder(),J=null;for(var I=0,F=H.length;I<F;I++){J=H[I];G.append(String.format('<a href="#" onclick="return false;" movieid="{2}"><span class="fr">{0}</span>{1}</a>',(parseInt(J.Third,10)>0?J.Third:""),J.Second,J.First));}return G.toString();}return"";},getCity:function(D){for(var E=0,F=this.locations.length;E<F;E++){if(D==this.locations[E].Id){return this.locations[E];}}return null;},getDistrict:function(H,G){var J=H.Districts.List;for(var I=0,F=J.length;I<F;I++){if(G==J[I].Id){return J[I];}}return null;},getMovie:function(F){for(var E=0,D=this.movies.length;E<D;E++){if(F==this.movies[E].First){return this.movies[E];}}return null;},isClosed:false,close:function(){if(!this.isClosed){this.isClosed=true;this.destroyControl();this.destroyEvent();this.destroyDOM();}}};var HeadSearchControl=Class.create();Object.extend(HeadSearchControl.prototype,{server:{getSuggestions:function(D,C){return Mtime.Component.Ajax.request(siteServiceUrl,"Mtime.Service.Pages.UtilityService","GetSuggestionKeywords",[D],C,"/service/utility.msi","get","20000");}},options:{searchRegion:"",suggestRegion:"",attributeName:"value",watermark:"请输入搜索内容",actionUrl:siteSearchUrl+"/search/",timer:0.7,type:"all"},setOptions:function(B){Object.extend(Object.extend(this,this.options),B);},initialize:function(B){this.setOptions(B);this.initializeField();this.initializeDOM();this.initializeEvent();this.load();},initializeField:function(){this.searchRegion=$(this.searchRegion);this.suggestRegion=$(this.suggestRegion);},initializeDOM:function(){this.textBox=this.searchRegion.down('input[type="text"]');this.submitButton=this.searchRegion.down('a[type="button"]');this.menuRegion=this.searchRegion.down('div[class="h_slist"]');this.menu=this.menuRegion.down("p");this.menuText=this.menu.previousSibling;},initializeEvent:function(){this.onMenuRegionClickHandler=this.onMenuRegionClick.bind(this);Event.observe(this.menuRegion,"click",this.onMenuRegionClickHandler);this.onMenuRegionMouseoutHandler=this.onMenuRegionMouseout.bind(this);this.onMenuRegionMouseoverHandler=this.onMenuRegionMouseover.bind(this);Event.observe(this.menuRegion,"mouseover",this.onMenuRegionMouseoverHandler);Event.observe(this.menuRegion,"mouseout",this.onMenuRegionMouseoutHandler);this.onButtonClickHandler=this.onButtonClick.bind(this);Event.observe(this.submitButton,"click",this.onButtonClickHandler);Event.observe(window,"unload",this.close.bind(this));},destroyEvent:function(){this.onMenuRegionMouseoverHandler&&Event.stopObserving(this.menuRegion,"mouseover",this.onMenuRegionMouseoverHandler);this.onMenuRegionMouseoutHandler&&Event.stopObserving(this.menuRegion,"mouseout",this.onMenuRegionMouseoutHandler);this.onMenuRegionClickHandler&&Event.stopObserving(this.menuRegion,"click",this.onMenuRegionClickHandler);this.onButtonClickHandler&&Event.stopObserving(this.submitButton,"click",this.onButtonClickHandler);this.onWindowClickHandler&&Event.stopObserving(document,"click",this.onWindowClickHandler);},destroyDOM:function(){this.keywordAutoComplete&&this.keywordAutoComplete.close();this.textBox=null;this.submitButton=null;this.menuRegion=null;this.menu=null;this.menuText=null;},closed:function(){this.destroyEvent();this.destroyDOM();},close:function(){this.destroyEvent();this.destroyDOM();},load:function(){this.typeTemplateHTML=this.menu.innerHTML;this.keywordAutoComplete=new SearchAutoComplete({text:this.textBox,textWatermarkText:this.watermark,listRegion:this.suggestRegion,itemTemplate:'<a href="#" value="#{word}"><em #{display}>被查询 #{count} 次</em>#{word}</a>',idFieldName:"word",titleFieldName:"word",searchDatas:null,getSearchDataCallback:function(B){if(this.type==="all"||this.type==="movie"||this.type==="person"){clearTimeout(this.timeout);this.timeout=setTimeout(this.getSuggestionsByServer.bind(this,this.keywordAutoComplete.keyword,B),this.timer*1000);}}.bind(this),choiceCount:8,onChangeInputCallback:null,onChangeCallback:null,onEnterCallback:this.onEnter.bind(this)});},getSuggestionsByServer:function(D,C){if(D!==""){this.server.getSuggestions(D,function(){if(typeof keywordResult!=="undefined"&&keywordResult.value&&keywordResult.value.keywords){var A=keywordResult.value.keywords.List;C(A);}});}},onMenuRegionClick:function(D){var C=D.target||D.srcElement;Event.stop(D);if(C.nodeName==="A"){this.type=C.getAttribute(this.attributeName);this.menuText.nodeValue=C.innerHTML;this.menu.hide();}},onMenuRegionMouseover:function(E){if(this.menuTimeout){clearTimeout(this.menuTimeout);this.menuTimeout=null;}if(!this.menuOn){this.suggestRegion.hide();if(this.type){var F=new RegExp('<a[^>]*?value="'+this.type+'"[^>]*?>[^<]*?</a>');var D=this.typeTemplateHTML.replace(F,"");this.menu.update(D);}this.menu.show();this.menuOn=true;}},onMenuRegionMouseout:function(B){this.menuTimeout=setTimeout(function(){if(this.menuOn){this.menu.hide();this.menuOn=false;}}.bind(this),100);},onButtonClick:function(C){var D=this.getKeyword();this.search(D);},onEnter:function(C){var D="";if(!C){D=this.getKeyword();}else{D=C.word;}this.search(D);},search:function(D){if(!this.type){this.type="all";}setCookie("searchPrompt",D);if(D.length>0){var C=this.actionUrl+(this.type==="all"?"":this.type)+"?"+encodeURIComponent(D).replace(/'/g,"%27");$redirect(C);}},getKeyword:function(){var B="";if(this.keywordAutoComplete){B=this.keywordAutoComplete.getSearchKeyword();}else{B=this.textBox.value;}return B;}});var SearchAutoComplete=Class.create();Object.extend(Object.extend(SearchAutoComplete.prototype,AutoCompleteBase.prototype),{initialize:function(B){this.baseInitialize(B);},initializeField:function(){this.isAlwayShowList=false;this.isShowMoreResult=false;},selectEntry:function(){this.active=false;var B=this.getCurrentEntry();this.selectedEntry(B);},getEntry:function(C){var D=null;if(C>=0){D=$(this.listRegion.childNodes[C]);}return D;},getOption:function(F){var D=null;var E=this.idFieldName;this.searchDatas.each(function(A){if(A[E]==F){D=A;throw $break;}});return D;},render:function(){if(this.getSearchDataCallback!==null){this.getSearchDataCallback(function(B){this.searchDatas=B;this.doRender();}.bind(this));}else{this.doRender();}},getMoreLists:function(){var L=this.searchDatas,K=null,I=new StringBuilder(),H=0;for(var J=0,G=L.length;J<G;J++){K=L[J];I.append(this.createListItem(K));H++;this.searchIndex=J;}this.entryCount+=H;return I.toString();},renderList:function(D,C){this.listRegion.innerHTML=C;},onClickText:function(){this.render();},createListItem:function(D){var C=this.itemTemplate.evaluate(D);C=C.replace("<em >被查询 0 次</em>","");return C;}});var BaseWindow08=Class.create();Object.extend(Object.extend(BaseWindow08.prototype,Window.prototype),{options:{hideBorder:false,windowClassName:"",windowStyle:"",windowContentStyle:"",onClickCloseCallback:null,readyCallback:null,closeCallback:null},initializeWindow:function(){var B=this.uniqueId;this.id="window08_"+B;this.closeButtonId="window08_closeButton_"+B;this.titleBarId="window08_titleBar_"+B;this.initializeWindowCallback();},initializeWindowCallback:function(){},addDOM:function(){this.windowClassName=this.windowClassName||"";this.windowStyle=this.windowStyle||"";this.windowContentStyle=this.windowContentStyle||"";var B=this.hideBorder?"":"share_tip ";this.windowElement=Builder.node("div",{className:this.windowClassName,style:this.windowStyle},[Builder.node("div",{className:B+this.windowClassName,style:this.windowStyle},[Builder.node("div",{className:"share_tiper",style:this.windowContentStyle},[Builder.node("div",{id:this.titleBarId,style:"cursor: move"},[Builder.node("div",{id:this.closeButtonId,className:"btn_close"},[Builder.node("a",{title:"关闭",href:"#"})]),Builder.node("div",{className:"ele_colorline"}),this.addTitleDOM()]),this.addContentDOM()])])]);},addTitleDOM:function(){},addContentDOM:function(){},initializeDOM:function(){this.closeButton=$(this.closeButtonId);this.titleBar=$(this.titleBarId);this.initializeDOMCallback();},initializeDOMCallback:function(){},destroyDOM:function(){this.closeButton=null;this.titleBar=null;this.destroyDOMCallback();},destroyDOMCallback:function(){},initializeEvent:function(){this.onClickCloseButtonHandler=this.onClickCloseButton.bind(this);this.closeButton.observe("click",this.onClickCloseButtonHandler);this.onMousedownTitleBarHandler=this.onMousedownTitleBar.bindAsEventListener(this);this.titleBar.observe("mousedown",this.onMousedownTitleBarHandler);this.onMouseupTitleBarHandler=this.onMouseupTitleBar.bindAsEventListener(this);Event.observe(document,"mouseup",this.onMouseupTitleBarHandler);this.onMousemoveTitleBarHandler=this.onMousemoveTitleBar.bindAsEventListener(this);Event.observe(document,"mousemove",this.onMousemoveTitleBarHandler);this.initializeEventCallback();},initializeEventCallback:function(){},destroyEvent:function(){this.closeButton.stopObserving("click",this.onClickCloseButtonHandler);this.titleBar.stopObserving("mousedown",this.onMousedownTitleBarHandler);Event.stopObserving(document,"mouseup",this.onMouseupTitleBarHandler);Event.stopObserving(document,"mousemove",this.onMousemoveTitleBarHandler);this.destroyEventCallback();},destroyEventCallback:function(){},load:function(){if(this.readyCallback&&this.readyCallback!==null){this.readyCallback(this);}this.titleBar.ondrag=function(){return false;};this.titleBar.onselectstart=function(){return false;};},onClickCloseButton:function(){if(this.onClickCloseCallback&&this.onClickCloseCallback!==null){this.onClickCloseCallback(this);}this.close();},onMouseupTitleBar:function(){if(!this.isDragging){return;}this.isDragging=false;},onMousedownTitleBar:function(F){var H=parseInt(this.windowElement.getStyle("left"),10);var I=parseInt(this.windowElement.getStyle("top"),10);var J=Event.pointerX(F);var G=Event.pointerY(F);this.offsetX=J-H;this.offsetY=G-I;this.isDragging=true;},onMousemoveTitleBar:function(E){if(!this.isDragging){return;}var F=Event.pointerX(E)-this.offsetX;var D=Event.pointerY(E)-this.offsetY;this.setLocation(D,F);},dispose:function(){if(this.closeCallback&&this.closeCallback!==null){this.closeCallback(this);}this.disposeCallback();this.destroyEvent();this.destroyDOM();},disposeCallback:function(){}});var Dialog=Class.create();Object.extend(Object.extend(Dialog.prototype,BaseWindow08.prototype),{options:{title:"",content:"",containerClassName:"",containerStyle:"",isDirectOpen:true,buttonRegionClass:"",buttons:null,closeTimeout:-1},initializeWindowCallback:function(){this.buttonNodes=[];this.buttonHandlers=[];this.keyCodeButtons=[];var B=this.uniqueId;this.buttonRegionId="dialogButtonRegion_"+B;},addContentDOM:function(){this.containerClassName=this.containerClassName;return Builder.node("div",{className:this.containerClassName,style:this.containerStyle},[Builder.node("div",{className:"myray"},[typeof this.content=="string"?Builder.build(this.content):this.content]),Builder.node("p",{id:this.buttonRegionId,className:"tip_btnbox"})]);},addTitleDOM:function(){this.title=this.title||"";var B=null;if(typeof this.title==="string"){if(this.title.length>0){B=Builder.build(this.title);if(B===null){B=this.title;}}else{B=Builder._text("");}}else{B=this.title;}return Builder.node("div",{className:"share_tit"},[B]);},initializeDOMCallback:function(){this.buttonRegion=$(this.buttonRegionId);if(this.buttons&&this.buttons!==null){for(var D=0,C=this.buttons.length;D<C;D++){this.addButton(this.buttons[D]);}}},destroyDOMCallback:function(){this.buttonRegion=null;this.removeButtons();},initializeEventCallback:function(){},destroyEventCallback:function(){},render:function(){if(this.isDirectOpen){this.open();if(this.closeTimeout>0){this.timerId=setTimeout(this.autoClose.bind(this),this.closeTimeout*1000);}}},autoClose:function(){if(this.timerId){clearTimeout(this.timerId);}this.onClickCloseButton();},disposeCallback:function(){},addButton:function(J){var H=J.onmouseover||"";var G=J.onmouseout||"";var I=Element.extend(Builder.node("input",{type:"button",value:J.title,className:J.buttonStyle,onmouseover:H,onmouseout:G},[]));var F=function(){J.callback(this,I);}.bind(this);I.observe("click",F);this.buttonRegion.appendChild(I);this.buttonNodes.push(I);this.buttonHandlers.push(F);if(J.keyCode){this.keyCodeButtons.push({keyCode:J.keyCode,button:I,handler:F});}},removeButtons:function(){if(this.buttonNodes&&this.buttonHandlers&&this.buttonNodes.length==this.buttonHandlers.length){for(var D=0,C=this.buttonNodes.length;D<C;D++){this.buttonNodes[D].stopObserving("click",this.buttonHandlers[D]);}}if(this.keyCodeButtons.length>0){this.keyCodeButtons.clear();}},getButtonByKey:function(H){if(this.keyCodeButtons.length>0){var G=this.keyCodeButtons,J=null;for(var I=0,F=G.length;I<F;I++){J=G[I];if(J.keyCode==H){return J;}}}return null;},onDocumentKeydown:function(C){var D=this.getButtonByKey(C.keyCode);if(D!==null){D.handler();Event.stop(C);}if(C.keyCode==Event.KEY_ESC){this.onClickCloseButton();}},setupDimensions:function(){var L=this.dimensions.viewport.height/2+this.pagePosition.y;var K=this.dimensions.viewport.width/2+this.pagePosition.x;var I=this.windowElement.down(1).getDimensions();var J=I.width,H=I.height;var G=(L-parseFloat(H)/2);if(G<=0){G=this.fixTopHeight;}this.windowElement.setStyle({position:"absolute",top:G+"px",left:(K-parseFloat(J)/2)+"px",zIndex:this.overlay?parseInt(this.overlay.getStyle("zIndex"))+1:Windows.getZIndex()});}});function $alert(H,F,E,G){new Dialog({windowClassName:"w295",content:'<div class="tc bold mt30">'+H+"</div>",buttonRegionClass:"tc pb12 pt15",buttons:[{title:"确定",keyCode:Event.KEY_RETURN,buttonStyle:"btn_blue mr15",callback:function(A){if(F){F(A);}A.close();}.bind(this)}],onClickCloseCallback:E||Prototype.emptyFunction,closeTimeout:G||-1});}function $tip(D,C){$alert(D,null,null,C);}function $confirm(H,G,E,F){new Dialog({windowClassName:"w295",content:'<div class="tc bold">'+H+"</div>",buttonRegionClass:"tc pb12 pt15",buttons:[{title:"确定",keyCode:Event.KEY_RETURN,buttonStyle:"btn_square_hover mr15",callback:function(A){if(G){G(A);}A.close();}.bind(this)},{title:"取消",buttonStyle:"btn_square",callback:function(A){if(E){E(A);}A.close();}.bind(this)}],onClickCloseCallback:F||Prototype.emptyFunction});}var DialogBoxs={dialogs:[],unregister:function(B){this.dialogs=this.dialogs.reject(function(A){return A==B;});},register:function(B){if(!this.dialogs.include(B)){this.dialogs.push(B);}},isRegistered:function(B){return this.dialogs.include(B);}};var DialogBox=Class.create();Object.extend(Object.extend(DialogBox.prototype,Window.prototype),{options:{title:"",content:"",width:"",element:null,isInOverflowContainer:false,buttons:null,readyCallback:null,closeCallback:null,isToggleTroubleElement:false,isAutoClose:true,positionType:0,arrowNew:false},initialize:function(C){this.setOptions(C);if(DialogBoxs.isRegistered(this.element)){return;}DialogBoxs.register(this.element);var D=new Date().getTime();this.id="dialogBox_"+D;this.titleId="dialogBoxTitle_"+D;this.contentId="dialogBoxContent_"+D;this.buttonRegionId="dialogBoxButtonRegion_"+D;this.createOverlay=false;this.buttonNodes=[];this.buttonHandlers=[];this.getPosition();this.initializeDOM();this.initializeEvent();this.open();if(this.readyCallback!==null){this.readyCallback(this);}},addDOM:function(){var C="";if(this.arrowNew){switch(this.positionType){case 0:C="tl_arrow";break;case 1:C="tr_arrow";break;case 2:C="bl_arrow";break;case 3:C="br_arrow";break;default:C="tl_arrow";break;}this.windowElement=Builder.node("div",{id:this.id,className:"my_layer"},[Builder.node("em",{className:C}),this.content!==""?(typeof this.content==="string"?Builder.build(this.content):this.content):"",Builder.node("p",{id:this.buttonRegionId},[])]);}else{switch(this.positionType){case 0:C="directiontl";break;case 1:C="directiontr";break;case 2:C="directionbl";break;case 3:C="directionbr";break;default:C="directiontl";break;}var D="";if(this.width&&this.width.length!==0){D="width:"+this.width;}this.windowElement=Builder.node("div",{id:this.id,className:"eject_outer",style:("display:none;"+D)},[Builder.node("div",{className:"eject"},[Builder.node("p",{className:C}),this.content!==""?(typeof this.content==="string"?Builder.build(this.content):this.content):"",Builder.node("p",{id:this.buttonRegionId,className:"mt15"},[])])]);}this.indicationStyle=C;this.initializeWindowElement();},initializeWindowElement:function(){var B=this.getContainer();B.appendChild(this.windowElement);this.windowElement=$(this.windowElement);this.cardId=$(this.id);},destroyWindowElement:function(){if(this.windowElement!==null){var B=this.getContainer();B.removeChild(this.windowElement);this.windowElement=null;}},getPosition:function(){if(this.element){var M=this.element;Position.prepare();var Q=Position.cumulativeOffset(M);var T=M.getDimensions();var V=Q[0],O=Q[1];if(this.isInOverflowContainer){var S=Position.realOffset(M);var P=S[0],U=S[1];V=V-P+Position.deltaX;O=O-U+Position.deltaY;}this.elementWidth=T.width;this.elementHeight=T.height;this.getScroll();this.getPageDimensions();this.browserDimensions();var N=this.dimensions.viewport.width/2+this.pagePosition.x;var L=this.dimensions.viewport.height/2+this.pagePosition.y;var R=null;if(V<=N&&O<=L){this.positionType=0;}else{if(V>=N&&O<=L){this.positionType=1;}else{if(V<=N&&O>=L){this.positionType=2;}else{if(V>=N&&O>=L){this.positionType=3;}}}}this.elementX=V;this.elementY=O;}},setupDimensions:function(){var O=0,Q=0;var M=this.windowElement.getDimensions();var N=M.width;var R=M.height;var V=this.elementX+this.elementWidth/2;var X=this.elementY;var S=V;var U=X+this.elementHeight;if(this.arrowNew){var W=this.cardId.down("em."+this.indicationStyle);}else{var W=this.cardId.down("p."+this.indicationStyle);}var T;if(W===undefined||W===null){T=17;}else{T=W.getHeight();}switch(this.positionType){case 0:O=S-47;Q=U+T;break;case 1:O=S-(N-47);Q=U+T;break;case 2:O=V-47;Q=X-T-R;break;case 3:O=V-(N-47);Q=X-T-R;break;default:O=S-47;Q=U+T;break;}var P=0;if(this.overlay){P=parseInt(this.overlay.getStyle("zIndex"),10)+1;}else{P=Windows.getZIndex()+1;}this.windowElement.setStyle({position:"absolute",top:Q+"px",left:O+"px",zIndex:P});},removeDOM:function(){this.title=null;this.buttonRegion=null;this.removeButtons();this.destroyWindowElement();},initializeDOM:function(){this.addDOM();this.windowElement=$(this.windowElement);this.title=$(this.titleId);this.buttonRegion=$(this.buttonRegionId);if(this.arrowNew&&this.buttons){this.buttonRegion.addClassName("mt15 tc");}if(this.buttons){for(var D=0,C=this.buttons.length;D<C;D++){this.addButton(this.buttons[D]);}}},addButton:function(L){var K=L.parameters||{};var I=L.onmouseover||"";var H=L.onmouseout||"";var J=Element.extend(Builder.node("input",{type:"button",value:L.title,className:L.buttonStyle,onmouseover:I,onmouseout:H},[]));var G=function(){L.callback(this,J,K);}.bind(this);J.observe("click",G);this.buttonRegion.appendChild(J);this.buttonNodes.push(J);this.buttonHandlers.push(G);},removeButtons:function(){if(this.buttonNodes&&this.buttonHandlers&&this.buttonNodes.length==this.buttonHandlers.length){for(var D=0,C=this.buttonNodes.length;D<C;D++){this.buttonNodes[D].stopObserving("click",this.buttonHandlers[D]);}}},initializeEvent:function(){if(this.isAutoClose){this.onClickHandler=this.onClick.bindAsEventListener(this);Event.observe(document.body,"click",this.onClickHandler);}},destroyEvent:function(){Event.stopObserving(document.body,"click",this.onClickHandler);if(this.closeCallback!==null){this.closeCallback(this);}},onClick:function(G){var E=Event.pointerX(G);var F=Event.pointerY(G);var H=Event.element(G);if(H!=this.element&&!H.descendantOf(this.element)&&!H.descendantOf(this.windowElement)&&!Position.within(this.windowElement,E,F)){this.close();}},dispose:function(){DialogBoxs.unregister(this.element);this.destroyEvent();this.removeDOM();this.buttonNodes.clear();this.buttonNodes=null;this.buttonHandlers.clear();this.buttonHandlers=null;}});var ToggleDialog=Class.create();Object.extend(Object.extend(ToggleDialog.prototype,Dialog.prototype),{options:Object.extend(Object.extend({},Dialog.prototype.options),{element:null,hideBorder:true,createOverlay:false,isToggleTroubleElement:false,isAutoClose:true}),getPosition:function(){if(this.element){var I=this.element;Position.prepare();var L=Position.cumulativeOffset(I);var N=I.getDimensions();var P=L[0],J=L[1];if(this.isInOverflowContainer){var M=Position.realOffset(I);var K=M[0],O=M[1];P=P-K+Position.deltaX;J=J-O+Position.deltaY;}this.elementWidth=N.width;this.elementHeight=N.height;this.getScroll();this.getPageDimensions();this.browserDimensions();this.elementX=P;this.elementY=J;}},setupDimensions:function(){this.getPosition();var I=this.windowElement.down(1).getDimensions();var J=I.width,H=I.height;var G=0,K=0;G=this.elementX+this.elementWidth-J+2;K=this.elementY+1;var L=0;if(this.overlay){L=parseInt(this.overlay.getStyle("zIndex"),10)+1;}else{L=Windows.getZIndex()+1;}this.windowElement.setStyle({position:"absolute",top:K+"px",left:G+"px",zIndex:L});},initializeEventCallback:function(){if(this.isAutoClose){this.onClickHandler=this.onClick.bindAsEventListener(this);Event.observe(document.body,"click",this.onClickHandler);}},destroyEventCallback:function(){Event.stopObserving(document.body,"click",this.onClickHandler);},onClick:function(G){var E=Event.pointerX(G);var F=Event.pointerY(G);var H=Event.element(G);if(H!=this.element&&!H.descendantOf(this.element)&&!H.descendantOf(this.windowElement)&&!Position.within(this.windowElement,E,F)){this.close();}}});var BoxBase=Class.create();Object.extend(BoxBase.prototype,{options:{boxRegion:null,closeButton:null,timeout:0,onClickCloseCallback:null,offsetX:0,offsetY:0},setOptions:function(B){Object.extend(Object.extend(this,this.options),B);},initialize:function(B){this.timeoutId=null;this.setOptions(B);this.initializeDOM();this.initializeEvent();this.initializeBox();this.timeout=this.timeout*1000;},initializeDOM:function(){this.boxRegion=$(this.boxRegion);this.closeButton=$(this.closeButton);},destroyDOM:function(){this.boxRegion=null;this.closeButton=null;},initializeBox:function(){},destroyBox:function(){},initializeEvent:function(){if(this.closeButton){this.onClickCloseButtonHandler=this.onClickCloseButton.bindAsEventListener(this);this.closeButton.observe("click",this.onClickCloseButtonHandler);}Event.observe(window,"unload",this.close.bind(this));},destroyEvent:function(){if(this.closeButton){this.closeButton.stopObserving("click",this.onClickCloseButtonHandler);}},onClickCloseButton:function(){if(this.onClickCloseCallback){this.onClickCloseCallback(this);}this.hide();},show:function(){if(!this.boxRegion.visible()){this.boxRegion.show();}this._handleTimeout();},hide:function(){if(this.boxRegion.visible()){this.boxRegion.hide();}},_handleTimeout:function(){if(this.boxRegion.visible()&&this.timeout>0){clearTimeout(this.timeoutId);this.timeoutId=setTimeout(this.hide.bind(this),this.timeout);}},closed:false,close:function(){if(!this.closed){this.closed=true;if(this.timeoutId!==null){clearTimeout(this.timeoutId);}this.hide();this.destroyBox();this.destroyEvent();this.destroyDOM();}}});var HintBox=Class.create();Object.extend(Object.extend(HintBox.prototype,BoxBase.prototype),{initializeBox:function(){this.hint=$(this.hint);},destroyBox:function(){this.hint=null;},set:function(B){this.hint.innerHTML=B;this.show();this.boxRegion.scrollTo();}});var FloatHintBox=Class.create();Object.extend(Object.extend(FloatHintBox.prototype,BoxBase.prototype),{getContainer:function(){var B=$("contentEnd");if(typeof B==="undefined"||B===null){B=document.getElementsByTagName("body")[0];}return B;},initializeBox:function(){Windows.register(this);this.element=$(this.element);this.boxRegion=Element.extend(Builder.node("div",{className:"bubble",style:"display:none;"},[Builder.node("div",{className:"bubble_inner"},[Builder.node("p",{className:"bubble_g"}),Builder.node("p",{className:"c_a5"},[this.message])])]));this.hint=Element.extend(this.boxRegion.getElementsByTagName("p")[1]);var I=Position.cumulativeOffset(this.element);var H=this.element.getDimensions();var J=I[0],K=I[1];var L=this.offsetX||0;var G=this.offsetY||0;this.boxRegion.setStyle({position:"absolute",left:(J+H.width+20)+L+"px",top:K+G+"px",zIndex:Windows.getZIndex()});this.getContainer().appendChild(this.boxRegion);},destroyBox:function(){Windows.unregister(this);this.element=null;this.getContainer().removeChild(this.boxRegion);},set:function(D,C){this.hint.innerHTML=C;this.hint.className=D;if(C.length===0){this.hide();}else{this.show();}}});var Tooltips={tooltips:[],unregister:function(B){this.tooltips=this.tooltips.reject(function(A){return A==B;});},register:function(B){if(!this.tooltips.include(B)){this.tooltips.push(B);}},isRegistered:function(B){return this.tooltips.include(B);}};Window.TooltipWindow=Class.create();Object.extend(Object.extend(Window.TooltipWindow.prototype,Window.prototype),{isOpen:false,isObserveMouse:true,observeCloseEvent:false,options:{element:null,isInOverflowContainer:false},initialize:function(C){this.setOptions(C);if(!Tooltips.isRegistered(this.element)){Tooltips.register(this.element);var D=new Date().getTime();this.id="tooltipWindow_"+D;this.isFocus=false;this.createOverlay=false;this.isObserveMouse=this.element.tagName.toLowerCase()!=="input";this.initializeDOM();this.initializeControl();this.initializeEvent();}},addDOM:function(){},removeDOM:function(){this.wrapElement.removeChild(this.windowElement);var B=this.getContainer();B.removeChild(this.wrapElement);this.wrapElement=null;this.windowElement=null;this.element=null;},initializeDOM:function(){this.addDOM();this.windowElement=$(this.windowElement);this.element=$(this.element);this.wrapElement=Element.extend(Builder.node("div",{},[""]));this.wrapElement.appendChild(this.windowElement);var B=this.getContainer();B.appendChild(this.wrapElement);this.wrapElement.setStyle({zoom:1});},initializeEvent:function(){Event.observe(window,"unload",this.close.bind(this));},destroyEvent:function(){},initializeControl:function(){this.observer=new Observer({sourceElement:this.element,onOverSourceCallback:this.show.bind(this),onOutSourceCallback:this.hide.bind(this),onOverTargetCallback:this.show.bind(this),onOutTargetCallback:this.hide.bind(this)});},destroyControl:function(){this.observer.close();},setupDimensions:function(){var V=0,Y=0,p=this.element,b=this.zIndex;Position.prepare();var X=Position.cumulativeOffset(p);var Z=X[0],k=X[1];if(this.isInOverflowContainer){var l=Position.realOffset(p);var m=l[0],o=l[1];Z=Z-m+Position.deltaX;k=k-o+Position.deltaY;}var j=p.getDimensions();var n=j.width;var a=j.height;var g=this.windowElement.getDimensions();var U=g.width;var c=g.height;var f=Z+n/2;var d=k;var h=f;var W=d+a;V=f-30;Y=d-17-c;if(this.overlay){b=parseInt(this.overlay.getStyle("zIndex"))+1;}else{b++;}this.windowElement.setStyle({position:"absolute",top:Y+"px",left:V+"px",zIndex:b});this.elementX=Z;this.elementY=k;this.elementWidth=n;this.elementHeight=a;this.windowX=Y;this.windowY=V;this.windowWidth=U;this.windowHeight=c;},show:function(){if(!this.isOpen){this.isOpen=true;this.open();this.observer.targetElement=this.windowElement;this.observer.initializeTargetEvent();}else{this.setupDimensions();this.showWindow();}},hide:function(){this.hideWindow();},dispose:function(){Tooltips.unregister(this.element);this.hide();this.destroyControl();this.destroyEvent();this.removeDOM();}});var Tracker=Class.create();Object.extend(Tracker.prototype,{PAGE_TRACK_URL:"http://log.mtime.cn/_t.gif",PAGE_CLICK_URL:"http://log1.mtime.cn/_t.gif",AD_TRACK_URL:"http://log2.mtime.cn/_t.gif",AD_CLICK_URL:"http://log2.mtime.cn/_t.gif",options:{siteId:0,title:"",observeRegionStyle:"__r_c_",observeAdStyle:"__a_c_",args:null},setOptions:function(B){Object.extend(Object.extend(this,this.options),B);},initialize:function(B){this.setOptions(B);this.initializeField();this.initializeDOM();this.initializeEvent();this.load();},initializeField:function(){this.observeAds=[];this.onClickAdHandlers=[];},initializeDOM:function(){},destroyDOM:function(){},initializeEvent:function(){if(this.observeRegionStyle.length>0){var K=Element.extend(document.body).readAttribute("pn");if(K&&K!==null&&K.length>0){var O=[],M=null;var N=document.getElementsByClassName(this.observeRegionStyle),J=null,I=null;for(var P=0,L=N.length;P<L;P++){J=Element.extend(N[P]);I=J.readAttribute("pan");if(I&&I!==null&&I.length>0){M=this.onClickPageArea.bindAsEventListener(this,K,I);O.push(M);Event.observe(J,"mousedown",M);}}this.observeRegions=N;this.onClickPageAreaHandlers=O;}}Event.observe(window,"unload",this.close.bind(this));},destroyEvent:function(){if(this.observeRegions&&this.observeRegions.length>0){var I=this.observeRegions;var K=this.onClickPageAreaHandlers;for(var L=0,G=I.length;L<G;L++){Event.stopObserving(I[L],"mousedown",K[L]);}}if(this.observeAds&&this.observeAds.length>0){var H=this.observeAds;var J=this.onClickAdHandlers;for(var L=0,G=H.length;L<G;L++){Event.stopObserving(H[L],"mousedown",J[L]);}}},load:function(){},onClickPageArea:function(E,F,D){if(!E._handle&&F&&F!==null&&F.length>0&&D&&D!==null&&D.length>0){E._handle=true;this.trackClick(F,D);}},onClickAd:function(C,D){this.trackAdClick(D);},trackPageView:function(){this.trackGooglePageView();var B=new StringBuilder();B.append(this.PAGE_TRACK_URL);this.getBaseParam(B);if(this.args!==null){B.append(String.format("&args={0}",encodeURIComponent(this.args)));}this.log(B.toString());this.trackBaiduPageView();},trackBaiduPageView:function(){},trackGooglePageView:function(){if(typeof urchinTracker!=="undefined"){return;}$loadJs("http://www.google-analytics.com/ga.js",function(){try{this._trackGooglePageView("UA-257914-4");this._trackGooglePageView("UA-2192709-1");}catch(B){}}.bind(this));},_trackGooglePageView:function(D){var F=_gat._getTracker(D);var E=this.getEvent();if(E.length>0){F._setCustomVar(1,"event",E,2);F._setCustomVar(2,"user",this.getUserId());}F._trackPageview();},trackClick:function(F,D){var E=new StringBuilder();E.append(this.PAGE_CLICK_URL);this.getBaseParam(E);E.append(String.format("&pn={0}",F));E.append(String.format("&pan={0}",D));this.log(E.toString());},trackAdView:function(D,F){if(typeof F==="string"){var E=new StringBuilder();E.append(this.AD_TRACK_URL);this.getBaseParam(E);E.append(String.format("&t={0}",0));E.append(String.format("&an={0}",F));this.log(E.toString());}},observeAdClick:function(E,F){var D=this.onClickAd.bindAsEventListener(this,F);Event.observe(E,"mousedown",D);this.observeAds.push(E);this.onClickAdHandlers.push(D);},trackAdClick:function(D){if(typeof D==="string"){var C=new StringBuilder();C.append(this.AD_CLICK_URL);this.getBaseParam(C);C.append(String.format("&t={0}",1));C.append(String.format("&an={0}",D));this.log(C.toString());}},getBaseParam:function(H){var F=this.getBrowser();H.append(String.format("?url={0}",encodeURIComponent(document.location.href)));H.append(String.format("&u={0}",this.getUserCode()));H.append(String.format("&uId={0}",this.getUserId()));H.append(String.format("&w={0}",screen.width));H.append(String.format("&h={0}",screen.height));H.append(String.format("&r={0}",encodeURIComponent(this.getReferrer())));H.append(String.format("&b={0}",F.type));H.append(String.format("&bVer={0}",F.ver));var G=this.getUserIdentity();H.append(String.format("&u2={0}",G.id));H.append(String.format("&isNew={0}",G.isNewbie));var E=this.getPartnerType();H.append(String.format("&pt={0}",E));},getReferrer:function(){var F="";try{F=top.document.referrer;}catch(E){if(parent){try{F=parent.document.referrer;}catch(D){F="";}}}if(F===""){F=document.referrer;}return F;},getBrowser:function(){var D=Mtime.browser,E=0,F=0;if(D.ie>0){E=1;F=D.ie;}else{if(D.gecko>0){E=2;F=D.gecko;}else{if(D.opera>0){E=3;F=D.opera;}else{if(D.webkit>0){E=4;F=D.webkit;}}}}return{type:E,ver:F};},getUserCode:function(){var E=getCookie("_userCode_");if(E===null||E.length===0){var F=new Date(),D=[];D.push(F.getFullYear());D.push(F.getMonth()+1);D.push(F.getDate());D.push(F.getHours());D.push(F.getMinutes());D.push(F.getSeconds());D.push(parseInt(Math.random()*10000,10));E=D.join("");setCookie("_userCode_",E);}return E;},getUserIdentity:function(){var F=getCookie("_userIdentity_"),G=false;if(F===null||F.length===0){G=true;var H=new Date(),E=[];E.push(H.getFullYear());E.push(H.getMonth()+1);E.push(H.getDate());E.push(H.getHours());E.push(H.getMinutes());E.push(H.getSeconds());E.push(parseInt(Math.random()*10000,10));F=E.join("");setCookie("_userIdentity_",F);}return{id:F,isNewbie:G};},getUserId:function(){var B=getCookie("_mi_")||"";if(B||B.length>0){return B;}return"";},log:function(E){var F=new Date(),D=new Image(1,1);D.onLoad=function(){};D.src=E+"&r="+Math.random();},setCookie:function(F,D){var E=new Date();E.setTime(E.getTime()+12*60*60*1000);document.cookie=F+"="+escape(D)+";path=/;expires="+E.toUTCString()+";domain="+mtimeCookieDomain+";";},getEvent:function(){var B=Globals.getParam("event")||"";if(!B||B.length===0){B=getCookie("_e_")||"";}if(B&&B.length>0){this.setCookie("_e_",B);}return B;},getPartnerType:function(){var B=Globals.getParam("PartnerType")||"";if(!B||B.length===0){B=getCookie("_pt_")||"";}if(B&&B.length>0){this.setCookie("_pt_",B);}return B;},isClosed:false,close:function(){if(!this.isClosed){this.isClosed=true;this.destroyEvent();this.destroyDOM();}}});
