
if(typeof JD=="undefined"||!JD){var JD={};}
JD.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=a[i].split(".");o=JD;for(j=(d[0]=="JD")?1:0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}
return o;};JD.log=function(msg,cat,src){var l=JD.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};JD.register=function(name,mainClass,data){var mods=JD.env.modules;if(!mods[name]){mods[name]={versions:[],builds:[]};}
var m=mods[name],v=data.version,b=data.build,ls=JD.env.listeners;m.name=name;m.version=v;m.build=b;m.versions.push(v);m.builds.push(b);m.mainClass=mainClass;for(var i=0;i<ls.length;i=i+1){ls[i](m);}
if(mainClass){mainClass.VERSION=v;mainClass.BUILD=b;}else{JD.log("mainClass is undefined for module "+name,"warn");}};JD.env=JD.env||{modules:[],listeners:[]};JD.env.getVersion=function(name){return JD.env.modules[name]||null;};JD.env.ua=function(){var o={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0};var ua=navigator.userAgent,m;if((/KHTML/).test(ua)){o.webkit=1;}
m=ua.match(/AppleWebKit\/([^\s]*)/);if(m&&m[1]){o.webkit=parseFloat(m[1]);if(/ Mobile\//.test(ua)){o.mobile="Apple";}else{m=ua.match(/NokiaN[^\/]*/);if(m){o.mobile=m[0];}}
m=ua.match(/AdobeAIR\/([^\s]*)/);if(m){o.air=m[0];}}
if(!o.webkit){m=ua.match(/Opera[\s\/]([^\s]*)/);if(m&&m[1]){o.opera=parseFloat(m[1]);m=ua.match(/Opera Mini[^;]*/);if(m){o.mobile=m[0];}}else{m=ua.match(/MSIE\s([^;]*)/);if(m&&m[1]){o.ie=parseFloat(m[1]);}else{m=ua.match(/Gecko\/([^\s]*)/);if(m){o.gecko=1;m=ua.match(/rv:([^\s\)]*)/);if(m&&m[1]){o.gecko=parseFloat(m[1]);}}}}}
return o;}();(function(){JD.namespace("util","widget","example");if("undefined"!==typeof JD_config){var l=JD_config.listener,ls=JD.env.listeners,unique=true,i;if(l){for(i=0;i<ls.length;i=i+1){if(ls[i]==l){unique=false;break;}}
if(unique){ls.push(l);}}}})();JD.lang=JD.lang||{};(function(){var L=JD.lang,ADD=["toString","valueOf"],OB={isArray:function(o){if(o){return L.isNumber(o.length)&&L.isFunction(o.splice);}
return false;},isBoolean:function(o){return typeof o==='boolean';},isFunction:function(o){return typeof o==='function';},isNull:function(o){return o===null;},isNumber:function(o){return typeof o==='number'&&isFinite(o);},isObject:function(o){return(o&&(typeof o==='object'||L.isFunction(o)))||false;},isString:function(o){return typeof o==='string';},isUndefined:function(o){return typeof o==='undefined';},_IEEnumFix:(JD.env.ua.ie)?function(r,s){for(var i=0;i<ADD.length;i=i+1){var fname=ADD[i],f=s[fname];if(L.isFunction(f)&&f!=Object.prototype[fname]){r[fname]=f;}}}:function(){},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error("extend failed, please check that "+"all dependencies are included.");}
var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;}
if(overrides){for(var i in overrides){if(L.hasOwnProperty(overrides,i)){subc.prototype[i]=overrides[i];}}
L._IEEnumFix(subc.prototype,overrides);}},augmentObject:function(r,s){if(!s||!r){throw new Error("Absorb failed, verify dependencies.");}
var a=arguments,i,p,override=a[2];if(override&&override!==true){for(i=2;i<a.length;i=i+1){r[a[i]]=s[a[i]];}}else{for(p in s){if(override||!(p in r)){r[p]=s[p];}}
L._IEEnumFix(r,s);}},augmentProto:function(r,s){if(!s||!r){throw new Error("Augment failed, verify dependencies.");}
var a=[r.prototype,s.prototype];for(var i=2;i<arguments.length;i=i+1){a.push(arguments[i]);}
L.augmentObject.apply(this,a);},dump:function(o,d){var i,len,s=[],OBJ="{...}",FUN="f(){...}",COMMA=', ',ARROW=' => ';if(!L.isObject(o)){return o+"";}else if(o instanceof Date||("nodeType"in o&&"tagName"in o)){return o;}else if(L.isFunction(o)){return FUN;}
d=(L.isNumber(d))?d:3;if(L.isArray(o)){s.push("[");for(i=0,len=o.length;i<len;i=i+1){if(L.isObject(o[i])){s.push((d>0)?L.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
s.push(COMMA);}
if(s.length>1){s.pop();}
s.push("]");}else{s.push("{");for(i in o){if(L.hasOwnProperty(o,i)){s.push(i+ARROW);if(L.isObject(o[i])){s.push((d>0)?L.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}
s.push(COMMA);}}
if(s.length>1){s.pop();}
s.push("}");}
return s.join("");},substitute:function(s,o,f){var i,j,k,key,v,meta,saved=[],token,DUMP='dump',SPACE=' ',LBRACE='{',RBRACE='}';for(;;){i=s.lastIndexOf(LBRACE);if(i<0){break;}
j=s.indexOf(RBRACE,i);if(i+1>=j){break;}
token=s.substring(i+1,j);key=token;meta=null;k=key.indexOf(SPACE);if(k>-1){meta=key.substring(k+1);key=key.substring(0,k);}
v=o[key];if(f){v=f(key,v,meta);}
if(L.isObject(v)){if(L.isArray(v)){v=L.dump(v,parseInt(meta,10));}else{meta=meta||"";var dump=meta.indexOf(DUMP);if(dump>-1){meta=meta.substring(4);}
if(v.toString===Object.prototype.toString||dump>-1){v=L.dump(v,parseInt(meta,10));}else{v=v.toString();}}}else if(!L.isString(v)&&!L.isNumber(v)){v="~-"+saved.length+"-~";saved[saved.length]=token;}
s=s.substring(0,i)+v+s.substring(j+1);}
for(i=saved.length-1;i>=0;i=i-1){s=s.replace(new RegExp("~-"+i+"-~"),"{"+saved[i]+"}","g");}
return s;},trim:function(s){try{return s.replace(/^\s+|\s+$/g,"");}catch(e){return s;}},merge:function(){var o={},a=arguments;for(var i=0,l=a.length;i<l;i=i+1){L.augmentObject(o,a[i],true);}
return o;},later:function(when,o,fn,data,periodic){when=when||0;o=o||{};var m=fn,d=data,f,r;if(L.isString(fn)){m=o[fn];}
if(!m){throw new TypeError("method undefined");}
if(!L.isArray(d)){d=[data];}
f=function(){m.apply(o,d);};r=(periodic)?setInterval(f,when):setTimeout(f,when);return{interval:periodic,cancel:function(){if(this.interval){clearInterval(r);}else{clearTimeout(r);}}};},isValue:function(o){return(L.isObject(o)||L.isString(o)||L.isNumber(o)||L.isBoolean(o));}};L.hasOwnProperty=(Object.prototype.hasOwnProperty)?function(o,prop){return o&&o.hasOwnProperty(prop);}:function(o,prop){return!L.isUndefined(o[prop])&&o.constructor.prototype[prop]!==o[prop];};OB.augmentObject(L,OB,true);JD.util.Lang=L;L.augment=L.augmentProto;JD.augment=L.augmentProto;JD.extend=L.extend;})();JD.register("JD",JD,{version:"2.5.2",build:"1076"});(function(){var Y=JD.util,getStyle,setStyle,propertyCache={},reClassNameCache={},document=window.document;JD.env._id_counter=JD.env._id_counter||0;var isOpera=JD.env.ua.opera,isSafari=JD.env.ua.webkit,isGecko=JD.env.ua.gecko,isIE=JD.env.ua.ie;var patterns={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i,OP_SCROLL:/^(?:inline|table-row)$/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}
if(propertyCache[property]){return propertyCache[property];}
var converted=property;while(patterns.HYPHEN.exec(converted)){converted=converted.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}
propertyCache[property]=converted;return converted;};var getClassRegEx=function(className){var re=reClassNameCache[className];if(!re){re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');reClassNameCache[className]=re;}
return re;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;if(property=='float'){property='cssFloat';}
var computed=el.ownerDocument.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}
return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}
return val/100;case'float':property='styleFloat';default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};}
if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(JD.lang.isString(el.style.filter)){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}
break;case'float':property='styleFloat';default:el.style[property]=val;}};}else{setStyle=function(el,property,val){if(property=='float'){property='cssFloat';}
el.style[property]=val;};}
var testElement=function(node,method){return node&&node.nodeType==1&&(!method||method(node));};JD.util.Dom={get:function(el){if(el&&(el.nodeType||el.item)){return el;}
if(JD.lang.isString(el)||!el){return document.getElementById(el);}
if(el.length!==undefined){var c=[];for(var i=0,len=el.length;i<len;++i){c[c.length]=Y.Dom.get(el[i]);}
return c;}
return el;},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=el.ownerDocument.body){return false;}
return getXY(el);};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative';}
var pageXY=this.getXY(el);if(pageXY===false){return false;}
var delta=[parseInt(this.getStyle(el,'left'),10),parseInt(this.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=(style_pos=='relative')?0:el.offsetLeft;}
if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop;}
if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}
if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}
if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true);}}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){if((el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none')&&el!=el.ownerDocument.body){return false;}
var region=Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}
var nodes=[],elements=root.getElementsByTagName(tag),re=getClassRegEx(className);for(var i=0,len=elements.length;i<len;++i){if(re.test(elements[i].className)){nodes[nodes.length]=elements[i];if(apply){apply.call(elements[i],elements[i]);}}}
return nodes;},hasClass:function(el,className){var re=getClassRegEx(className);var f=function(el){return re.test(el.className);};return Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return false;}
el.className=JD.lang.trim([el.className,className].join(' '));return true;};return Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,className){var re=getClassRegEx(className);var f=function(el){if(!className||!this.hasClass(el,className)){return false;}
var c=el.className;el.className=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}
el.className=JD.lang.trim(el.className);return true;};return Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(!newClassName||oldClassName===newClassName){return false;}
var re=getClassRegEx(oldClassName);var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return true;}
el.className=el.className.replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}
el.className=JD.lang.trim(el.className);return true;};return Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';var f=function(el){if(el&&el.id){return el.id;}
var id=prefix+JD.env._id_counter++;if(el){el.id=id;}
return id;};return Y.Dom.batch(el,f,Y.Dom,true)||f.apply(Y.Dom,arguments);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);needle=Y.Dom.get(needle);if(!haystack||!needle){return false;}
if(haystack.contains&&needle.nodeType&&!isSafari){return haystack.contains(needle);}
else if(haystack.compareDocumentPosition&&needle.nodeType){return!!(haystack.compareDocumentPosition(needle)&16);}else if(needle.nodeType){return!!this.getAncestorBy(needle,function(el){return el==haystack;});}
return false;},inDocument:function(el){return this.isAncestor(document.documentElement,el);},getElementsBy:function(method,tag,root,apply){tag=tag||'*';root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}
var nodes=[],elements=root.getElementsByTagName(tag);for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];if(apply){apply(elements[i]);}}}
return nodes;},batch:function(el,method,o,override){el=(el&&(el.tagName||el.item))?el:Y.Dom.get(el);if(!el||!method){return false;}
var scope=(override)?o:window;if(el.tagName||el.length===undefined){return method.call(scope,el,o);}
var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=method.call(scope,el[i],o);}
return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}
return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}
return width;},getAncestorBy:function(node,method){while(node=node.parentNode){if(testElement(node,method)){return node;}}
return null;},getAncestorByClassName:function(node,className){node=Y.Dom.get(node);if(!node){return null;}
var method=function(el){return Y.Dom.hasClass(el,className);};return Y.Dom.getAncestorBy(node,method);},getAncestorByTagName:function(node,tagName){node=Y.Dom.get(node);if(!node){return null;}
var method=function(el){return el.tagName&&el.tagName.toUpperCase()==tagName.toUpperCase();};return Y.Dom.getAncestorBy(node,method);},getPreviousSiblingBy:function(node,method){while(node){node=node.previousSibling;if(testElement(node,method)){return node;}}
return null;},getPreviousSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}
return Y.Dom.getPreviousSiblingBy(node);},getNextSiblingBy:function(node,method){while(node){node=node.nextSibling;if(testElement(node,method)){return node;}}
return null;},getNextSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}
return Y.Dom.getNextSiblingBy(node);},getFirstChildBy:function(node,method){var child=(testElement(node.firstChild,method))?node.firstChild:null;return child||Y.Dom.getNextSiblingBy(node.firstChild,method);},getFirstChild:function(node,method){node=Y.Dom.get(node);if(!node){return null;}
return Y.Dom.getFirstChildBy(node);},getLastChildBy:function(node,method){if(!node){return null;}
var child=(testElement(node.lastChild,method))?node.lastChild:null;return child||Y.Dom.getPreviousSiblingBy(node.lastChild,method);},getLastChild:function(node){node=Y.Dom.get(node);return Y.Dom.getLastChildBy(node);},getChildrenBy:function(node,method){var child=Y.Dom.getFirstChildBy(node,method);var children=child?[child]:[];Y.Dom.getNextSiblingBy(child,function(node){if(!method||method(node)){children[children.length]=node;}
return false;});return children;},getChildren:function(node){node=Y.Dom.get(node);if(!node){}
return Y.Dom.getChildrenBy(node);},getDocumentScrollLeft:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);},getDocumentScrollTop:function(doc){doc=doc||document;return Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);},insertBefore:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null;}
return referenceNode.parentNode.insertBefore(newNode,referenceNode);},insertAfter:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode.parentNode){return null;}
if(referenceNode.nextSibling){return referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling);}else{return referenceNode.parentNode.appendChild(newNode);}},getClientRegion:function(){var t=Y.Dom.getDocumentScrollTop(),l=Y.Dom.getDocumentScrollLeft(),r=Y.Dom.getViewportWidth()+l,b=Y.Dom.getViewportHeight()+t;return new Y.Region(t,r,b,l);}};var getXY=function(){if(document.documentElement.getBoundingClientRect){return function(el){var box=el.getBoundingClientRect();var rootNode=el.ownerDocument;return[box.left+Y.Dom.getDocumentScrollLeft(rootNode),box.top+
Y.Dom.getDocumentScrollTop(rootNode)];};}else{return function(el){var pos=[el.offsetLeft,el.offsetTop];var parentNode=el.offsetParent;var accountForBody=(isSafari&&Y.Dom.getStyle(el,'position')=='absolute'&&el.offsetParent==el.ownerDocument.body);if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;if(!accountForBody&&isSafari&&Y.Dom.getStyle(parentNode,'position')=='absolute'){accountForBody=true;}
parentNode=parentNode.offsetParent;}}
if(accountForBody){pos[0]-=el.ownerDocument.body.offsetLeft;pos[1]-=el.ownerDocument.body.offsetTop;}
parentNode=el.parentNode;while(parentNode.tagName&&!patterns.ROOT_TAG.test(parentNode.tagName))
{if(parentNode.scrollTop||parentNode.scrollLeft){if(!patterns.OP_SCROLL.test(Y.Dom.getStyle(parentNode,'display'))){if(!isOpera||Y.Dom.getStyle(parentNode,'overflow')!=='visible'){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}}}
parentNode=parentNode.parentNode;}
return pos;};}}()})();JD.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};JD.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom);};JD.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};JD.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new JD.util.Region(t,r,b,l);}else{return null;}};JD.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new JD.util.Region(t,r,b,l);};JD.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};JD.util.Region.getRegion=function(el){var p=JD.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new JD.util.Region(t,r,b,l);};JD.util.Point=function(x,y){if(JD.lang.isArray(x)){y=x[1];x=x[0];}
this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};JD.util.Point.prototype=new JD.util.Region();JD.register("dom",JD.util.Dom,{version:"2.5.2",build:"1076"});JD.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this.scope=oScope||window;this.silent=silent;this.signature=signature||JD.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}
var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new JD.util.CustomEvent(onsubscribeType,this,true);}
this.lastError=null;};JD.util.CustomEvent.LIST=0;JD.util.CustomEvent.FLAT=1;JD.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(!fn){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}
if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);}
this.subscribers.push(new JD.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){if(!fn){return this.unsubscribeAll();}
var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}
return found;},fire:function(){this.lastError=null;var errors=[],len=this.subscribers.length;if(!len&&this.silent){return true;}
var args=[].slice.call(arguments,0),ret=true,i,rebuild=false;if(!this.silent){}
var subs=this.subscribers.slice(),throwErrors=JD.util.Event.throwErrors;for(i=0;i<len;++i){var s=subs[i];if(!s){rebuild=true;}else{if(!this.silent){}
var scope=s.getScope(this.scope);if(this.signature==JD.util.CustomEvent.FLAT){var param=null;if(args.length>0){param=args[0];}
try{ret=s.fn.call(scope,param,s.obj);}catch(e){this.lastError=e;if(throwErrors){throw e;}}}else{try{ret=s.fn.call(scope,this.type,args,s.obj);}catch(ex){this.lastError=ex;if(throwErrors){throw ex;}}}
if(false===ret){if(!this.silent){}
break;}}}
return(ret!==false);},unsubscribeAll:function(){for(var i=this.subscribers.length-1;i>-1;i--){this._delete(i);}
this.subscribers=[];return i;},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}
this.subscribers.splice(index,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};JD.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=JD.lang.isUndefined(obj)?null:obj;this.override=override;};JD.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}
return defaultScope;};JD.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};JD.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!JD.util.Event){JD.util.Event=function(){var loadComplete=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;var webkitKeymap={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:JD.env.ua.webkit,webkit:JD.env.ua.webkit,isIE:JD.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(p_id,p_fn,p_obj,p_override,checkContent){var a=(JD.lang.isString(p_id))?[p_id]:p_id;for(var i=0;i<a.length;i=i+1){onAvailStack.push({id:a[i],fn:p_fn,obj:p_obj,override:p_override,checkReady:checkContent});}
retryCount=this.POLL_RETRYS;this.startInterval();},onContentReady:function(p_id,p_fn,p_obj,p_override){this.onAvailable(p_id,p_fn,p_obj,p_override,true);},onDOMReady:function(p_fn,p_obj,p_override){if(this.DOMReady){setTimeout(function(){var s=window;if(p_override){if(p_override===true){s=p_obj;}else{s=p_override;}}
p_fn.call(s,"DOMReady",[],p_obj);},0);}else{this.DOMReadyEvent.subscribe(p_fn,p_obj,p_override);}},addListener:function(el,sType,fn,obj,override){if(!fn||!fn.call){return false;}
if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=this.on(el[i],sType,fn,obj,override)&&ok;}
return ok;}else if(JD.lang.isString(el)){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){JD.util.Event.on(el,sType,fn,obj,override);});return true;}}
if(!el){return false;}
if("unload"==sType&&obj!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,obj,override];return true;}
var scope=el;if(override){if(override===true){scope=obj;}else{scope=override;}}
var wrappedFn=function(e){return fn.call(scope,JD.util.Event.getEvent(e,el),obj);};var li=[el,sType,fn,wrappedFn,scope,obj,override];var index=listeners.length;listeners[index]=li;if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1||el!=legacyEvents[legacyIndex][0]){legacyIndex=legacyEvents.length;legacyMap[el.id+sType]=legacyIndex;legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];legacyHandlers[legacyIndex]=[];el["on"+sType]=function(e){JD.util.Event.fireLegacyEvent(JD.util.Event.getEvent(e),legacyIndex);};}
legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(ex){this.lastError=ex;this.removeListener(el,sType,fn);return false;}}
return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true,le,lh,li,scope,ret;lh=legacyHandlers[legacyIndex].slice();for(var i=0,len=lh.length;i<len;++i){li=lh[i];if(li&&li[this.WFN]){scope=li[this.ADJ_SCOPE];ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}
le=legacyEvents[legacyIndex];if(le&&le[2]){le[2](e);}
return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(this.webkit&&("click"==sType||"dblclick"==sType)){var v=parseInt(this.webkit,10);if(!isNaN(v)&&v<418){return true;}}
return false;},removeListener:function(el,sType,fn){var i,len,li;if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(i=el.length-1;i>-1;i--){ok=(this.removeListener(el[i],sType,fn)&&ok);}
return ok;}
if(!fn||!fn.call){return this.purgeElement(el,false,sType);}
if("unload"==sType){for(i=unloadListeners.length-1;i>-1;i--){li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners.splice(i,1);return true;}}
return false;}
var cacheItem=null;var index=arguments[3];if("undefined"===typeof index){index=this._getCacheIndex(el,sType,fn);}
if(index>=0){cacheItem=listeners[index];}
if(!el||!cacheItem){return false;}
if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist.splice(i,1);break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(ex){this.lastError=ex;return false;}}
delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners.splice(index,1);return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(n){try{if(n&&3==n.nodeType){return n.parentNode;}}catch(e){}
return n;},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}
return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}
return y;},getXY:function(ev){return[this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else if(ev.type=="mouseover"){t=ev.fromElement;}}
return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(ex){this.lastError=ex;return t;}}
return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e,boundEl){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}
c=c.caller;}}
return ev;},getCharCode:function(ev){var code=ev.keyCode||ev.charCode||0;if(JD.env.ua.webkit&&(code in webkitKeymap)){code=webkitKeymap[code];}
return code;},_getCacheIndex:function(el,sType,fn){for(var i=0,l=listeners.length;i<l;i=i+1){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}
return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}
return id;},_isValidCollection:function(o){try{return(o&&typeof o!=="string"&&o.length&&!o.tagName&&!o.alert&&typeof o[0]!=="undefined");}catch(ex){return false;}},elCache:{},getEl:function(id){return(typeof id==="string")?document.getElementById(id):id;},clearCache:function(){},DOMReadyEvent:new JD.util.CustomEvent("DOMReady",this),_load:function(e){if(!loadComplete){loadComplete=true;var EU=JD.util.Event;EU._ready();EU._tryPreloadAttach();}},_ready:function(e){var EU=JD.util.Event;if(!EU.DOMReady){EU.DOMReady=true;EU.DOMReadyEvent.fire();EU._simpleRemove(document,"DOMContentLoaded",EU._ready);}},_tryPreloadAttach:function(){if(onAvailStack.length===0){retryCount=0;clearInterval(this._interval);this._interval=null;return;}
if(this.locked){return;}
if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}
this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0&&onAvailStack.length>0);}
var notAvail=[];var executeItem=function(el,item){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}
item.fn.call(scope,item.obj);};var i,len,item,el,ready=[];for(i=0,len=onAvailStack.length;i<len;i=i+1){item=onAvailStack[i];if(item){el=this.getEl(item.id);if(el){if(item.checkReady){if(loadComplete||el.nextSibling||!tryAgain){ready.push(item);onAvailStack[i]=null;}}else{executeItem(el,item);onAvailStack[i]=null;}}else{notAvail.push(item);}}}
for(i=0,len=ready.length;i<len;i=i+1){item=ready[i];executeItem(this.getEl(item.id),item);}
retryCount--;if(tryAgain){for(i=onAvailStack.length-1;i>-1;i--){item=onAvailStack[i];if(!item||!item.id){onAvailStack.splice(i,1);}}
this.startInterval();}else{clearInterval(this._interval);this._interval=null;}
this.locked=false;},purgeElement:function(el,recurse,sType){var oEl=(JD.lang.isString(el))?this.getEl(el):el;var elListeners=this.getListeners(oEl,sType),i,len;if(elListeners){for(i=elListeners.length-1;i>-1;i--){var l=elListeners[i];this.removeListener(oEl,l.type,l.fn);}}
if(recurse&&oEl&&oEl.childNodes){for(i=0,len=oEl.childNodes.length;i<len;++i){this.purgeElement(oEl.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var results=[],searchLists;if(!sType){searchLists=[listeners,unloadListeners];}else if(sType==="unload"){searchLists=[unloadListeners];}else{searchLists=[listeners];}
var oEl=(JD.lang.isString(el))?this.getEl(el):el;for(var j=0;j<searchLists.length;j=j+1){var searchList=searchLists[j];if(searchList){for(var i=0,len=searchList.length;i<len;++i){var l=searchList[i];if(l&&l[this.EL]===oEl&&(!sType||sType===l[this.TYPE])){results.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.OVERRIDE],scope:l[this.ADJ_SCOPE],index:i});}}}}
return(results.length)?results:null;},_unload:function(e){var EU=JD.util.Event,i,j,l,len,index,ul=unloadListeners.slice();for(i=0,len=unloadListeners.length;i<len;++i){l=ul[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.UNLOAD_OBJ];}else{scope=l[EU.ADJ_SCOPE];}}
l[EU.FN].call(scope,EU.getEvent(e,l[EU.EL]),l[EU.UNLOAD_OBJ]);ul[i]=null;l=null;scope=null;}}
unloadListeners=null;if(listeners){for(j=listeners.length-1;j>-1;j--){l=listeners[j];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],j);}}
l=null;}
legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=JD.util.Event;EU.on=EU.addListener;if(EU.isIE){JD.util.Event.onDOMReady(JD.util.Event._tryPreloadAttach,JD.util.Event,true);var n=document.createElement('p');EU._dri=setInterval(function(){try{n.doScroll('left');clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}
EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}
JD.util.EventProvider=function(){};JD.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,p_override){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];}
subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var evts=this.__yui_events;if(p_type){var ce=evts[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}}else{var ret=true;for(var i in evts){if(JD.lang.hasOwnProperty(evts,i)){ret=ret&&evts[i].unsubscribe(p_fn,p_obj);}}
return ret;}
return false;},unsubscribeAll:function(p_type){return this.unsubscribe(p_type);},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=(opts.silent);var ce=new JD.util.CustomEvent(p_type,scope,silent,JD.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}
this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}
return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(!ce){return null;}
var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}
return ce.fire.apply(ce,args);},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}
return false;}};JD.util.KeyListener=function(attachTo,keyData,handler,event){if(!attachTo){}else if(!keyData){}else if(!handler){}
if(!event){event=JD.util.KeyListener.KEYDOWN;}
var keyEvent=new JD.util.CustomEvent("keyPressed");this.enabledEvent=new JD.util.CustomEvent("enabled");this.disabledEvent=new JD.util.CustomEvent("disabled");if(typeof attachTo=='string'){attachTo=document.getElementById(attachTo);}
if(typeof handler=='function'){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}
function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}
if(!keyData.alt){keyData.alt=false;}
if(!keyData.ctrl){keyData.ctrl=false;}
if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem;if(keyData.keys instanceof Array){for(var i=0;i<keyData.keys.length;i++){dataItem=keyData.keys[i];if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);break;}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);break;}}}else{dataItem=keyData.keys;if(dataItem==e.charCode){keyEvent.fire(e.charCode,e);}else if(dataItem==e.keyCode){keyEvent.fire(e.keyCode,e);}}}}
this.enable=function(){if(!this.enabled){JD.util.Event.addListener(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}
this.enabled=true;};this.disable=function(){if(this.enabled){JD.util.Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}
this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+
(attachTo.id?"["+attachTo.id+"]":"");};};JD.util.KeyListener.KEYDOWN="keydown";JD.util.KeyListener.KEYUP="keyup";JD.util.KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};JD.register("event",JD.util.Event,{version:"2.5.2",build:"1076"});JD.util.Get=function(){var queues={},qidx=0,nidx=0,purging=false,ua=JD.env.ua,lang=JD.lang;var _node=function(type,attr,win){var w=win||window,d=w.document,n=d.createElement(type);for(var i in attr){if(attr[i]&&JD.lang.hasOwnProperty(attr,i)){n.setAttribute(i,attr[i]);}}
return n;};var _linkNode=function(url,win,charset){var c=charset||"utf-8";return _node("link",{"id":"yui__dyn_"+(nidx++),"type":"text/css","charset":c,"rel":"stylesheet","href":url},win);};var _scriptNode=function(url,win,charset){var c=charset||"utf-8";return _node("script",{"id":"yui__dyn_"+(nidx++),"type":"text/javascript","charset":c,"src":url},win);};var _returnData=function(q,msg){return{tId:q.tId,win:q.win,data:q.data,nodes:q.nodes,msg:msg,purge:function(){_purge(this.tId);}};};var _get=function(nId,tId){var q=queues[tId],n=(lang.isString(nId))?q.win.document.getElementById(nId):nId;if(!n){_fail(tId,"target node not found: "+nId);}
return n;};var _fail=function(id,msg){var q=queues[id];if(q.onFailure){var sc=q.scope||q.win;q.onFailure.call(sc,_returnData(q,msg));}};var _finish=function(id){var q=queues[id];q.finished=true;if(q.aborted){var msg="transaction "+id+" was aborted";_fail(id,msg);return;}
if(q.onSuccess){var sc=q.scope||q.win;q.onSuccess.call(sc,_returnData(q));}};var _next=function(id,loaded){var q=queues[id];if(q.aborted){var msg="transaction "+id+" was aborted";_fail(id,msg);return;}
if(loaded){q.url.shift();if(q.varName){q.varName.shift();}}else{q.url=(lang.isString(q.url))?[q.url]:q.url;if(q.varName){q.varName=(lang.isString(q.varName))?[q.varName]:q.varName;}}
var w=q.win,d=w.document,h=d.getElementsByTagName("head")[0],n;if(q.url.length===0){if(q.type==="script"&&ua.webkit&&ua.webkit<420&&!q.finalpass&&!q.varName){var extra=_scriptNode(null,q.win,q.charset);extra.innerHTML='JD.util.Get._finalize("'+id+'");';q.nodes.push(extra);h.appendChild(extra);}else{_finish(id);}
return;}
var url=q.url[0];if(q.type==="script"){n=_scriptNode(url,w,q.charset);}else{n=_linkNode(url,w,q.charset);}
_track(q.type,n,id,url,w,q.url.length);q.nodes.push(n);if(q.insertBefore){var s=_get(q.insertBefore,id);if(s){s.parentNode.insertBefore(n,s);}}else{h.appendChild(n);}
if((ua.webkit||ua.gecko)&&q.type==="css"){_next(id,url);}};var _autoPurge=function(){if(purging){return;}
purging=true;for(var i in queues){var q=queues[i];if(q.autopurge&&q.finished){_purge(q.tId);delete queues[i];}}
purging=false;};var _purge=function(tId){var q=queues[tId];if(q){var n=q.nodes,l=n.length,d=q.win.document,h=d.getElementsByTagName("head")[0];if(q.insertBefore){var s=_get(q.insertBefore,tId);if(s){h=s.parentNode;}}
for(var i=0;i<l;i=i+1){h.removeChild(n[i]);}}
q.nodes=[];};var _queue=function(type,url,opts){var id="q"+(qidx++);opts=opts||{};if(qidx%JD.util.Get.PURGE_THRESH===0){_autoPurge();}
queues[id]=lang.merge(opts,{tId:id,type:type,url:url,finished:false,nodes:[]});var q=queues[id];q.win=q.win||window;q.scope=q.scope||q.win;q.autopurge=("autopurge"in q)?q.autopurge:(type==="script")?true:false;lang.later(0,q,_next,id);return{tId:id};};var _track=function(type,n,id,url,win,qlength,trackfn){var f=trackfn||_next;if(ua.ie){n.onreadystatechange=function(){var rs=this.readyState;if("loaded"===rs||"complete"===rs){f(id,url);}};}else if(ua.webkit){if(type==="script"){if(ua.webkit>=420){n.addEventListener("load",function(){f(id,url);});}else{var q=queues[id];if(q.varName){var freq=JD.util.Get.POLL_FREQ;q.maxattempts=JD.util.Get.TIMEOUT/freq;q.attempts=0;q._cache=q.varName[0].split(".");q.timer=lang.later(freq,q,function(o){var a=this._cache,l=a.length,w=this.win,i;for(i=0;i<l;i=i+1){w=w[a[i]];if(!w){this.attempts++;if(this.attempts++>this.maxattempts){var msg="Over retry limit, giving up";q.timer.cancel();_fail(id,msg);}else{}
return;}}
q.timer.cancel();f(id,url);},null,true);}else{lang.later(JD.util.Get.POLL_FREQ,null,f,[id,url]);}}}}else{n.onload=function(){f(id,url);};}};return{POLL_FREQ:10,PURGE_THRESH:20,TIMEOUT:2000,_finalize:function(id){lang.later(0,null,_finish,id);},abort:function(o){var id=(lang.isString(o))?o:o.tId;var q=queues[id];if(q){q.aborted=true;}},script:function(url,opts){return _queue("script",url,opts);},css:function(url,opts){return _queue("css",url,opts);}};}();JD.register("get",JD.util.Get,{version:"2.5.2",build:"1076"});JD.util.Connect={_msxml_progid:['Microsoft.XMLHTTP','MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP'],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:'application/x-www-form-urlencoded; charset=UTF-8',_default_form_header:'application/x-www-form-urlencoded',_use_default_xhr_header:true,_default_xhr_header:'XMLHttpRequest',_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function()
{if(JD.util.Event){JD.util.Event.addListener(document,'click',function(e){var obj=JD.util.Event.getTarget(e);if(obj.nodeName.toLowerCase()=='input'&&(obj.type&&obj.type.toLowerCase()=='submit')){JD.util.Connect._submitElementValue=encodeURIComponent(obj.name)+"="+encodeURIComponent(obj.value);}});return true;}
return false;})(),startEvent:new JD.util.CustomEvent('start'),completeEvent:new JD.util.CustomEvent('complete'),successEvent:new JD.util.CustomEvent('success'),failureEvent:new JD.util.CustomEvent('failure'),uploadEvent:new JD.util.CustomEvent('upload'),abortEvent:new JD.util.CustomEvent('abort'),_customEvents:{onStart:['startEvent','start'],onComplete:['completeEvent','complete'],onSuccess:['successEvent','success'],onFailure:['failureEvent','failure'],onUpload:['uploadEvent','upload'],onAbort:['abortEvent','abort']},setProgId:function(id)
{this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b)
{if(typeof b=='string'){this._default_post_header=b;}
else if(typeof b=='boolean'){this._use_default_post_header=b;}},setDefaultXhrHeader:function(b)
{if(typeof b=='string'){this._default_xhr_header=b;}
else{this._use_default_xhr_header=b;}},setPollingInterval:function(i)
{if(typeof i=='number'&&isFinite(i)){this._polling_interval=i;}},createXhrObject:function(transactionId)
{var obj,http;try
{http=new XMLHttpRequest();obj={conn:http,tId:transactionId};}
catch(e)
{for(var i=0;i<this._msxml_progid.length;++i){try
{http=new ActiveXObject(this._msxml_progid[i]);obj={conn:http,tId:transactionId};break;}
catch(e){}}}
finally
{return obj;}},getConnectionObject:function(isFileUpload)
{var o;var tId=this._transaction_id;try
{if(!isFileUpload){o=this.createXhrObject(tId);}
else{o={};o.tId=tId;o.isUpload=true;}
if(o){this._transaction_id++;}}
catch(e){}
finally
{return o;}},asyncRequest:function(method,uri,callback,postData)
{var o=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();var args=(callback&&callback.argument)?callback.argument:null;if(!o){return null;}
else{if(callback&&callback.customevents){this.initCustomEvents(o,callback);}
if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o,callback,uri,postData);return o;}
if(method.toUpperCase()=='GET'){if(this._sFormData.length!==0){uri+=((uri.indexOf('?')==-1)?'?':'&')+this._sFormData;}}
else if(method.toUpperCase()=='POST'){postData=postData?this._sFormData+"&"+postData:this._sFormData;}}
if(method.toUpperCase()=='GET'&&(callback&&callback.cache===false)){uri+=((uri.indexOf('?')==-1)?'?':'&')+"rnd="+new Date().valueOf().toString();}
o.conn.open(method,uri,true);if(this._use_default_xhr_header){if(!this._default_headers['X-Requested-With']){this.initHeader('X-Requested-With',this._default_xhr_header,true);}}
if((method.toUpperCase()=='POST'&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader('Content-Type',this._default_post_header);}
if(this._has_default_headers||this._has_http_headers){this.setHeader(o);}
this.handleReadyState(o,callback);o.conn.send(postData||'');if(this._isFormSubmit===true){this.resetFormState();}
this.startEvent.fire(o,args);if(o.startEvent){o.startEvent.fire(o,args);}
return o;}},initCustomEvents:function(o,callback)
{for(var prop in callback.customevents){if(this._customEvents[prop][0]){o[this._customEvents[prop][0]]=new JD.util.CustomEvent(this._customEvents[prop][1],(callback.scope)?callback.scope:null);o[this._customEvents[prop][0]].subscribe(callback.customevents[prop]);}}},handleReadyState:function(o,callback)
{var oConn=this;var args=(callback&&callback.argument)?callback.argument:null;if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState===4){window.clearInterval(oConn._poll[o.tId]);delete oConn._poll[o.tId];if(callback&&callback.timeout){window.clearTimeout(oConn._timeOut[o.tId]);delete oConn._timeOut[o.tId];}
oConn.completeEvent.fire(o,args);if(o.completeEvent){o.completeEvent.fire(o,args);}
oConn.handleTransactionResponse(o,callback);}},this._polling_interval);},handleTransactionResponse:function(o,callback,isAbort)
{var httpStatus,responseObject;var args=(callback&&callback.argument)?callback.argument:null;try
{if(o.conn.status!==undefined&&o.conn.status!==0){httpStatus=o.conn.status;}
else{httpStatus=13030;}}
catch(e){httpStatus=13030;}
if(httpStatus>=200&&httpStatus<300||httpStatus===1223){responseObject=this.createResponseObject(o,args);if(callback&&callback.success){if(!callback.scope){callback.success(responseObject);}
else{callback.success.apply(callback.scope,[responseObject]);}}
this.successEvent.fire(responseObject);if(o.successEvent){o.successEvent.fire(responseObject);}}
else{switch(httpStatus){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:responseObject=this.createExceptionObject(o.tId,args,(isAbort?isAbort:false));if(callback&&callback.failure){if(!callback.scope){callback.failure(responseObject);}
else{callback.failure.apply(callback.scope,[responseObject]);}}
break;default:responseObject=this.createResponseObject(o,args);if(callback&&callback.failure){if(!callback.scope){callback.failure(responseObject);}
else{callback.failure.apply(callback.scope,[responseObject]);}}}
this.failureEvent.fire(responseObject);if(o.failureEvent){o.failureEvent.fire(responseObject);}}
this.releaseObject(o);responseObject=null;},createResponseObject:function(o,callbackArg)
{var obj={};var headerObj={};try
{var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i<header.length;i++){var delimitPos=header[i].indexOf(':');if(delimitPos!=-1){headerObj[header[i].substring(0,delimitPos)]=header[i].substring(delimitPos+2);}}}
catch(e){}
obj.tId=o.tId;obj.status=(o.conn.status==1223)?204:o.conn.status;obj.statusText=(o.conn.status==1223)?"No Content":o.conn.statusText;obj.getResponseHeader=headerObj;obj.getAllResponseHeaders=headerStr;obj.responseText=o.conn.responseText;obj.responseXML=o.conn.responseXML;if(callbackArg){obj.argument=callbackArg;}
return obj;},createExceptionObject:function(tId,callbackArg,isAbort)
{var COMM_CODE=0;var COMM_ERROR='communication failure';var ABORT_CODE=-1;var ABORT_ERROR='transaction aborted';var obj={};obj.tId=tId;if(isAbort){obj.status=ABORT_CODE;obj.statusText=ABORT_ERROR;}
else{obj.status=COMM_CODE;obj.statusText=COMM_ERROR;}
if(callbackArg){obj.argument=callbackArg;}
return obj;},initHeader:function(label,value,isDefault)
{var headerObj=(isDefault)?this._default_headers:this._http_headers;headerObj[label]=value;if(isDefault){this._has_default_headers=true;}
else{this._has_http_headers=true;}},setHeader:function(o)
{if(this._has_default_headers){for(var prop in this._default_headers){if(JD.lang.hasOwnProperty(this._default_headers,prop)){o.conn.setRequestHeader(prop,this._default_headers[prop]);}}}
if(this._has_http_headers){for(var prop in this._http_headers){if(JD.lang.hasOwnProperty(this._http_headers,prop)){o.conn.setRequestHeader(prop,this._http_headers[prop]);}}
delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(formId,isUpload,secureUri)
{this.resetFormState();var oForm;if(typeof formId=='string'){oForm=(document.getElementById(formId)||document.forms[formId]);}
else if(typeof formId=='object'){oForm=formId;}
else{return;}
if(isUpload){var io=this.createFrame((window.location.href.toLowerCase().indexOf("https")===0||secureUri)?true:false);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}
var oElement,oName,oValue,oDisabled;var hasSubmit=false;for(var i=0;i<oForm.elements.length;i++){oElement=oForm.elements[i];oDisabled=oElement.disabled;oName=oElement.name;oValue=oElement.value;if(!oDisabled&&oName)
{switch(oElement.type)
{case'select-one':case'select-multiple':for(var j=0;j<oElement.options.length;j++){if(oElement.options[j].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].attributes['value'].specified?oElement.options[j].value:oElement.options[j].text)+'&';}
else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].hasAttribute('value')?oElement.options[j].value:oElement.options[j].text)+'&';}}}
break;case'radio':case'checkbox':if(oElement.checked){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}
break;case'file':case undefined:case'reset':case'button':break;case'submit':if(hasSubmit===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+'&';}
else{this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}
hasSubmit=true;}
break;default:this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}}}
this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);this.initHeader('Content-Type',this._default_form_header);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(secureUri){var frameId='yuiIO'+this._transaction_id;var io;if(window.ActiveXObject){io=document.createElement('<iframe id="'+frameId+'" name="'+frameId+'" />');if(typeof secureUri=='boolean'){io.src='javascript:false';}}
else{io=document.createElement('iframe');io.id=frameId;io.name=frameId;}
io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},appendPostData:function(postData)
{var formElements=[];var postMessage=postData.split('&');for(var i=0;i<postMessage.length;i++){var delimitPos=postMessage[i].indexOf('=');if(delimitPos!=-1){formElements[i]=document.createElement('input');formElements[i].type='hidden';formElements[i].name=postMessage[i].substring(0,delimitPos);formElements[i].value=postMessage[i].substring(delimitPos+1);this._formNode.appendChild(formElements[i]);}}
return formElements;},uploadFile:function(o,callback,uri,postData){var oConn=this;var frameId='yuiIO'+o.tId;var uploadEncoding='multipart/form-data';var io=document.getElementById(frameId);var args=(callback&&callback.argument)?callback.argument:null;var rawFormAttributes={action:this._formNode.getAttribute('action'),method:this._formNode.getAttribute('method'),target:this._formNode.getAttribute('target')};this._formNode.setAttribute('action',uri);this._formNode.setAttribute('method','POST');this._formNode.setAttribute('target',frameId);if(JD.env.ua.ie){this._formNode.setAttribute('encoding',uploadEncoding);}
else{this._formNode.setAttribute('enctype',uploadEncoding);}
if(postData){var oElements=this.appendPostData(postData);}
this._formNode.submit();this.startEvent.fire(o,args);if(o.startEvent){o.startEvent.fire(o,args);}
if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}
if(oElements&&oElements.length>0){for(var i=0;i<oElements.length;i++){this._formNode.removeChild(oElements[i]);}}
for(var prop in rawFormAttributes){if(JD.lang.hasOwnProperty(rawFormAttributes,prop)){if(rawFormAttributes[prop]){this._formNode.setAttribute(prop,rawFormAttributes[prop]);}
else{this._formNode.removeAttribute(prop);}}}
this.resetFormState();var uploadCallback=function()
{if(callback&&callback.timeout){window.clearTimeout(oConn._timeOut[o.tId]);delete oConn._timeOut[o.tId];}
oConn.completeEvent.fire(o,args);if(o.completeEvent){o.completeEvent.fire(o,args);}
var obj={};obj.tId=o.tId;obj.argument=callback.argument;try
{obj.responseText=io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:io.contentWindow.document.documentElement.textContent;obj.responseXML=io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}
catch(e){}
if(callback&&callback.upload){if(!callback.scope){callback.upload(obj);}
else{callback.upload.apply(callback.scope,[obj]);}}
oConn.uploadEvent.fire(obj);if(o.uploadEvent){o.uploadEvent.fire(obj);}
JD.util.Event.removeListener(io,"load",uploadCallback);setTimeout(function(){document.body.removeChild(io);oConn.releaseObject(o);},100);};JD.util.Event.addListener(io,"load",uploadCallback);},abort:function(o,callback,isTimeout)
{var abortStatus;var args=(callback&&callback.argument)?callback.argument:null;if(o&&o.conn){if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this._poll[o.tId]);delete this._poll[o.tId];if(isTimeout){window.clearTimeout(this._timeOut[o.tId]);delete this._timeOut[o.tId];}
abortStatus=true;}}
else if(o&&o.isUpload===true){var frameId='yuiIO'+o.tId;var io=document.getElementById(frameId);if(io){JD.util.Event.removeListener(io,"load");document.body.removeChild(io);if(isTimeout){window.clearTimeout(this._timeOut[o.tId]);delete this._timeOut[o.tId];}
abortStatus=true;}}
else{abortStatus=false;}
if(abortStatus===true){this.abortEvent.fire(o,args);if(o.abortEvent){o.abortEvent.fire(o,args);}
this.handleTransactionResponse(o,callback,true);}
return abortStatus;},isCallInProgress:function(o)
{if(o&&o.conn){return o.conn.readyState!==4&&o.conn.readyState!==0;}
else if(o&&o.isUpload===true){var frameId='yuiIO'+o.tId;return document.getElementById(frameId)?true:false;}
else{return false;}},releaseObject:function(o)
{if(o&&o.conn){o.conn=null;o=null;}}};JD.register("connection",JD.util.Connect,{version:"2.5.2",build:"1076"});if(typeof(JD.util.ImageLoader)=='undefined'){JD.util.ImageLoader={};}
JD.util.ImageLoader.group=function(trigEl,trigAct,timeout){this.name='unnamed';this._imgObjs={};this.timeoutLen=timeout;this._timeout=null;this._triggers=[];this._customTriggers=[];this.foldConditional=false;this.className=null;this._classImageEls=null;JD.util.Event.addListener(window,'load',this._onloadTasks,this,true);this.addTrigger(trigEl,trigAct);};JD.util.ImageLoader.group.prototype.addTrigger=function(trigEl,trigAct){if(!trigEl||!trigAct){return;}
var wrappedFetch=function(){this.fetch();};this._triggers.push([trigEl,trigAct,wrappedFetch]);JD.util.Event.addListener(trigEl,trigAct,wrappedFetch,this,true);};JD.util.ImageLoader.group.prototype.addCustomTrigger=function(event){if(!event||!event instanceof JD.util.CustomEvent){return;}
var wrappedFetch=function(){this.fetch();};this._customTriggers.push([event,wrappedFetch]);event.subscribe(wrappedFetch,this,true);};JD.util.ImageLoader.group.prototype._onloadTasks=function(){if(this.timeoutLen&&typeof(this.timeoutLen)=='number'&&this.timeoutLen>0){this._timeout=setTimeout(this._getFetchTimeout(),this.timeoutLen*1000);}
if(this.foldConditional){this._foldCheck();}};JD.util.ImageLoader.group.prototype._getFetchTimeout=function(){var self=this;return function(){self.fetch();};};JD.util.ImageLoader.group.prototype.registerBgImage=function(domId,url){this._imgObjs[domId]=new JD.util.ImageLoader.bgImgObj(domId,url);return this._imgObjs[domId];};JD.util.ImageLoader.group.prototype.registerSrcImage=function(domId,url,width,height){this._imgObjs[domId]=new JD.util.ImageLoader.srcImgObj(domId,url,width,height);return this._imgObjs[domId];};JD.util.ImageLoader.group.prototype.registerPngBgImage=function(domId,url,ailProps){this._imgObjs[domId]=new JD.util.ImageLoader.pngBgImgObj(domId,url,ailProps);return this._imgObjs[domId];};JD.util.ImageLoader.group.prototype.fetch=function(){clearTimeout(this._timeout);for(var i=0,len=this._triggers.length;i<len;i++){JD.util.Event.removeListener(this._triggers[i][0],this._triggers[i][1],this._triggers[i][2]);}
for(var i=0,len=this._customTriggers.length;i<len;i++){this._customTriggers[i][0].unsubscribe(this._customTriggers[i][1],this);}
this._fetchByClass();for(var id in this._imgObjs){if(JD.lang.hasOwnProperty(this._imgObjs,id)){this._imgObjs[id].fetch();}}};JD.util.ImageLoader.group.prototype._foldCheck=function(){var scrollTop=(document.compatMode!='CSS1Compat')?document.body.scrollTop:document.documentElement.scrollTop;var viewHeight=JD.util.Dom.getViewportHeight();var hLimit=scrollTop+viewHeight;var scrollLeft=(document.compatMode!='CSS1Compat')?document.body.scrollLeft:document.documentElement.scrollLeft;var viewWidth=JD.util.Dom.getViewportWidth();var wLimit=scrollLeft+viewWidth;for(var id in this._imgObjs){if(JD.lang.hasOwnProperty(this._imgObjs,id)){var elPos=JD.util.Dom.getXY(this._imgObjs[id].domId);if(elPos[1]<hLimit&&elPos[0]<wLimit){this._imgObjs[id].fetch();}}}
if(this.className){this._classImageEls=JD.util.Dom.getElementsByClassName(this.className);for(var i=0,len=this._classImageEls.length;i<len;i++){var elPos=JD.util.Dom.getXY(this._classImageEls[i]);if(elPos[1]<hLimit&&elPos[0]<wLimit){JD.util.Dom.removeClass(this._classImageEls[i],this.className);}}}};JD.util.ImageLoader.group.prototype._fetchByClass=function(){if(!this.className){return;}
if(this._classImageEls===null){this._classImageEls=JD.util.Dom.getElementsByClassName(this.className);}
JD.util.Dom.removeClass(this._classImageEls,this.className);};JD.util.ImageLoader.imgObj=function(domId,url){this.domId=domId;this.url=url;this.width=null;this.height=null;this.setVisible=false;this._fetched=false;};JD.util.ImageLoader.imgObj.prototype.fetch=function(){if(this._fetched){return;}
var el=document.getElementById(this.domId);if(!el){return;}
this._applyUrl(el);if(this.setVisible){el.style.visibility='visible';}
if(this.width){el.width=this.width;}
if(this.height){el.height=this.height;}
this._fetched=true;};JD.util.ImageLoader.imgObj.prototype._applyUrl=function(el){};JD.util.ImageLoader.bgImgObj=function(domId,url){JD.util.ImageLoader.bgImgObj.superclass.constructor.call(this,domId,url);};JD.lang.extend(JD.util.ImageLoader.bgImgObj,JD.util.ImageLoader.imgObj);JD.util.ImageLoader.bgImgObj.prototype._applyUrl=function(el){el.style.backgroundImage="url('"+this.url+"')";};JD.util.ImageLoader.srcImgObj=function(domId,url,width,height){JD.util.ImageLoader.srcImgObj.superclass.constructor.call(this,domId,url);this.width=width;this.height=height;};JD.lang.extend(JD.util.ImageLoader.srcImgObj,JD.util.ImageLoader.imgObj);JD.util.ImageLoader.srcImgObj.prototype._applyUrl=function(el){el.src=this.url;};JD.util.ImageLoader.pngBgImgObj=function(domId,url,ailProps){JD.util.ImageLoader.pngBgImgObj.superclass.constructor.call(this,domId,url);this.props=ailProps||{};};JD.lang.extend(JD.util.ImageLoader.pngBgImgObj,JD.util.ImageLoader.imgObj);JD.util.ImageLoader.pngBgImgObj.prototype._applyUrl=function(el){if(JD.env.ua.ie&&JD.env.ua.ie<=6){var sizingMethod=(JD.lang.isUndefined(this.props.sizingMethod))?'scale':this.props.sizingMethod;var enabled=(JD.lang.isUndefined(this.props.enabled))?'true':this.props.enabled;el.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+this.url+'", sizingMethod="'+sizingMethod+'", enabled="'+enabled+'")';}
else{el.style.backgroundImage="url('"+this.url+"')";}};JD.register("imageloader",JD.util.ImageLoader,{version:"2.5.2",build:"1076"});(function(){var Y=JD.util;var Anim=function(el,attributes,duration,method){if(!el){}
this.init(el,attributes,duration,method);};Anim.NAME='Anim';Anim.prototype={toString:function(){var el=this.getEl()||{};var id=el.id||el.tagName;return(this.constructor.NAME+': '+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(attr,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attr,val,unit){if(this.patterns.noNegatives.test(attr)){val=(val>0)?val:0;}
Y.Dom.setStyle(this.getEl(),attr,val+unit);},getAttribute:function(attr){var el=this.getEl();var val=Y.Dom.getStyle(el,attr);if(val!=='auto'&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);}
var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||(Y.Dom.getStyle(el,'position')=='absolute'&&pos)){val=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;}
return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return'px';}
return'';},setRuntimeAttribute:function(attr){var start;var end;var attributes=this.attributes;this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=='undefined');};if(!isset(attributes[attr]['to'])&&!isset(attributes[attr]['by'])){return false;}
start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]['by'][i]*1;}}else{end=start+attributes[attr]['by']*1;}}
this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);return true;},init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var actualFrames=0;el=Y.Dom.get(el);this.attributes=attributes||{};this.duration=!JD.lang.isUndefined(duration)?duration:1;this.method=method||Y.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=Y.AnimMgr.fps;this.setEl=function(element){el=Y.Dom.get(element);};this.getEl=function(){return el;};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}
this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(Y.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}
Y.AnimMgr.registerElement(this);return true;};this.stop=function(finish){if(!this.isAnimated()){return false;}
if(finish){this.currentFrame=this.totalFrames;this._onTween.fire();}
Y.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var attr in this.attributes){this.setRuntimeAttribute(attr);}
isAnimated=true;actualFrames=0;startTime=new Date();};var onTween=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){return('duration: '+data.duration+', currentFrame: '+data.currentFrame);};this.onTween.fire(data);var runtimeAttributes=this.runtimeAttributes;for(var attr in runtimeAttributes){this.setAttribute(attr,this.doMethod(attr,runtimeAttributes[attr].start,runtimeAttributes[attr].end),runtimeAttributes[attr].unit);}
actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new Y.CustomEvent('_start',this,true);this.onStart=new Y.CustomEvent('start',this);this.onTween=new Y.CustomEvent('tween',this);this._onTween=new Y.CustomEvent('_tween',this,true);this.onComplete=new Y.CustomEvent('complete',this);this._onComplete=new Y.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};Y.Anim=Anim;})();JD.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=1000;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){index=index||getIndex(tween);if(!tween.isAnimated()||index==-1){return false;}
tween._onComplete.fire();queue.splice(index,1);tweenCount-=1;if(tweenCount<=0){this.stop();}
return true;};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){this.unRegister(queue[0],0);}
queue=[];thread=null;tweenCount=0;}
else{this.unRegister(tween);}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}
if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null)
{tween.currentFrame+=1;if(tween.useSeconds){correctFrame(tween);}
tween._onTween.fire();}
else{JD.util.AnimMgr.stop(tween,i);}}};var getIndex=function(anim){for(var i=0,len=queue.length;i<len;++i){if(queue[i]==anim){return i;}}
return-1;};var correctFrame=function(tween){var frames=tween.totalFrames;var frame=tween.currentFrame;var expected=(tween.currentFrame*tween.duration*1000/tween.totalFrames);var elapsed=(new Date()-tween.getStartTime());var tweak=0;if(elapsed<tween.duration*1000){tweak=Math.round((elapsed/expected-1)*tween.currentFrame);}else{tweak=frames-(frame+1);}
if(tweak>0&&isFinite(tweak)){if(tween.currentFrame+tweak>=frames){tweak=frames-(frame+1);}
tween.currentFrame+=tweak;}};};JD.util.Bezier=new function(){this.getPosition=function(points,t){var n=points.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[points[i][0],points[i][1]];}
for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}
return[tmp[0][0],tmp[0][1]];};};(function(){var ColorAnim=function(el,attributes,duration,method){ColorAnim.superclass.constructor.call(this,el,attributes,duration,method);};ColorAnim.NAME='ColorAnim';var Y=JD.util;JD.extend(ColorAnim,Y.Anim);var superclass=ColorAnim.superclass;var proto=ColorAnim.prototype;proto.patterns.color=/color$/i;proto.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;proto.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;proto.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;proto.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;proto.parseColor=function(s){if(s.length==3){return s;}
var c=this.patterns.hex.exec(s);if(c&&c.length==4){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}
c=this.patterns.rgb.exec(s);if(c&&c.length==4){return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}
c=this.patterns.hex3.exec(s);if(c&&c.length==4){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}
return null;};proto.getAttribute=function(attr){var el=this.getEl();if(this.patterns.color.test(attr)){var val=JD.util.Dom.getStyle(el,attr);if(this.patterns.transparent.test(val)){var parent=el.parentNode;val=Y.Dom.getStyle(parent,attr);while(parent&&this.patterns.transparent.test(val)){parent=parent.parentNode;val=Y.Dom.getStyle(parent,attr);if(parent.tagName.toUpperCase()=='HTML'){val='#fff';}}}}else{val=superclass.getAttribute.call(this,attr);}
return val;};proto.doMethod=function(attr,start,end){var val;if(this.patterns.color.test(attr)){val=[];for(var i=0,len=start.length;i<len;++i){val[i]=superclass.doMethod.call(this,attr,start[i],end[i]);}
val='rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')';}
else{val=superclass.doMethod.call(this,attr,start,end);}
return val;};proto.setRuntimeAttribute=function(attr){superclass.setRuntimeAttribute.call(this,attr);if(this.patterns.color.test(attr)){var attributes=this.attributes;var start=this.parseColor(this.runtimeAttributes[attr].start);var end=this.parseColor(this.runtimeAttributes[attr].end);if(typeof attributes[attr]['to']==='undefined'&&typeof attributes[attr]['by']!=='undefined'){end=this.parseColor(attributes[attr].by);for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+end[i];}}
this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;}};Y.ColorAnim=ColorAnim;})();JD.util.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}
return-c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}
return-c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0){return b;}
if((t/=d)==1){return b+c;}
if(!p){p=d*.3;}
if(!a||a<Math.abs(c)){a=c;var s=p/4;}
else{var s=p/(2*Math.PI)*Math.asin(c/a);}
return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0){return b;}
if((t/=d)==1){return b+c;}
if(!p){p=d*.3;}
if(!a||a<Math.abs(c)){a=c;var s=p/4;}
else{var s=p/(2*Math.PI)*Math.asin(c/a);}
return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0){return b;}
if((t/=d/2)==2){return b+c;}
if(!p){p=d*(.3*1.5);}
if(!a||a<Math.abs(c)){a=c;var s=p/4;}
else{var s=p/(2*Math.PI)*Math.asin(c/a);}
if(t<1){return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}
return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=='undefined'){s=1.70158;}
if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;}
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-JD.util.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}
return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;},bounceBoth:function(t,b,c,d){if(t<d/2){return JD.util.Easing.bounceIn(t*2,0,c,d)*.5+b;}
return JD.util.Easing.bounceOut(t*2-d,0,c,d)*.5+c*.5+b;}};(function(){var Motion=function(el,attributes,duration,method){if(el){Motion.superclass.constructor.call(this,el,attributes,duration,method);}};Motion.NAME='Motion';var Y=JD.util;JD.extend(Motion,Y.ColorAnim);var superclass=Motion.superclass;var proto=Motion.prototype;proto.patterns.points=/^points$/i;proto.setAttribute=function(attr,val,unit){if(this.patterns.points.test(attr)){unit=unit||'px';superclass.setAttribute.call(this,'left',val[0],unit);superclass.setAttribute.call(this,'top',val[1],unit);}else{superclass.setAttribute.call(this,attr,val,unit);}};proto.getAttribute=function(attr){if(this.patterns.points.test(attr)){var val=[superclass.getAttribute.call(this,'left'),superclass.getAttribute.call(this,'top')];}else{val=superclass.getAttribute.call(this,attr);}
return val;};proto.doMethod=function(attr,start,end){var val=null;if(this.patterns.points.test(attr)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;val=Y.Bezier.getPosition(this.runtimeAttributes[attr],t);}else{val=superclass.doMethod.call(this,attr,start,end);}
return val;};proto.setRuntimeAttribute=function(attr){if(this.patterns.points.test(attr)){var el=this.getEl();var attributes=this.attributes;var start;var control=attributes['points']['control']||[];var end;var i,len;if(control.length>0&&!(control[0]instanceof Array)){control=[control];}else{var tmp=[];for(i=0,len=control.length;i<len;++i){tmp[i]=control[i];}
control=tmp;}
if(Y.Dom.getStyle(el,'position')=='static'){Y.Dom.setStyle(el,'position','relative');}
if(isset(attributes['points']['from'])){Y.Dom.setXY(el,attributes['points']['from']);}
else{Y.Dom.setXY(el,Y.Dom.getXY(el));}
start=this.getAttribute('points');if(isset(attributes['points']['to'])){end=translateValues.call(this,attributes['points']['to'],start);var pageXY=Y.Dom.getXY(this.getEl());for(i=0,len=control.length;i<len;++i){control[i]=translateValues.call(this,control[i],start);}}else if(isset(attributes['points']['by'])){end=[start[0]+attributes['points']['by'][0],start[1]+attributes['points']['by'][1]];for(i=0,len=control.length;i<len;++i){control[i]=[start[0]+control[i][0],start[1]+control[i][1]];}}
this.runtimeAttributes[attr]=[start];if(control.length>0){this.runtimeAttributes[attr]=this.runtimeAttributes[attr].concat(control);}
this.runtimeAttributes[attr][this.runtimeAttributes[attr].length]=end;}
else{superclass.setRuntimeAttribute.call(this,attr);}};var translateValues=function(val,start){var pageXY=Y.Dom.getXY(this.getEl());val=[val[0]-pageXY[0]+start[0],val[1]-pageXY[1]+start[1]];return val;};var isset=function(prop){return(typeof prop!=='undefined');};Y.Motion=Motion;})();(function(){var Scroll=function(el,attributes,duration,method){if(el){Scroll.superclass.constructor.call(this,el,attributes,duration,method);}};Scroll.NAME='Scroll';var Y=JD.util;JD.extend(Scroll,Y.ColorAnim);var superclass=Scroll.superclass;var proto=Scroll.prototype;proto.doMethod=function(attr,start,end){var val=null;if(attr=='scroll'){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=superclass.doMethod.call(this,attr,start,end);}
return val;};proto.getAttribute=function(attr){var val=null;var el=this.getEl();if(attr=='scroll'){val=[el.scrollLeft,el.scrollTop];}else{val=superclass.getAttribute.call(this,attr);}
return val;};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};Y.Scroll=Scroll;})();JD.register("animation",JD.util.Anim,{version:"2.5.2",build:"1076"});if(typeof JD==="undefined"||!JD){var JD={};}JD.i13n=JD.i13n||{};JD.i13n.Track=function(H){if(!H){return null;}var L="geo.JD.com/",A=JD.i13n.Util,F=H.tracked_mods||[],E=A.enc,Q=H.spaceid,K=H.keys||{},M=1970,R=[],N=[],B=H.lt_attr||"text",P=H.text_link_len||-1,D=H.region||"",C={aa:1,eu:1,la:1};if(B==="text"&&P>0){P=H.text_link_len;}else{P=-1;}K.A_sid=A.rand();K._w=A.clean(window.location.href);K="1.3.2"+A.ce+A.ser(K);if(D!==""&&C[D]){L=D+"."+L;}L="http://"+L;var I="?s="+E(Q)+"&_R="+E(A.clref(document.referrer));function S(U){return L+U+I;}function T(Z,X,Y,U,W){var V=new Image();var a=function(){V=V;};Z+="&t="+new Date().valueOf();if(X==="c"){Z+="&_K="+K;if(!W){V.onload=V.onerror=V.onabort=function(){location=U;};A.prevDef(Y);}else{V.onload=a;}}else{Z+="&_P="+K;V.onload=a;V.onerror=V.onabort=function(){var b=new Image();b.src=Z;};}V.src=Z;setTimeout(function(){V=null;},10000);}function J(X,W){var g=X.getElementsByTagName("a"),f={name:W,links:[]},h=f.links;for(var Y=0,c=g.length;Y<c;Y++){var U=g[Y],d="",V=U.firstChild,Z=false;while(V){if(V.nodeName.toLowerCase()==="img"){d=V.getAttribute("alt");if(!d||d===""){d=A.getLT(U,"href");}Z=true;break;}V=V.nextSibling;}if(!Z){d=A.getLT(U,B);}if(d&&d!==""){d=A.clean(A.trim(d));try{N[A.getPosKey(W,d)]=Y+1;h[h.length]=E(P>0?d.substring(0,P):d);}catch(b){}}}R[R.length]=f;}function G(d){var X=d+"&_L=",V=A.cf;for(var Y=0,e=R.length,U=K.length;Y<e;Y++){var Z=R[Y];X+="m"+V+Z.name+A.ca+"l"+V;for(var W=0,a=Z.links.length;W<a;W++){var c=Z.links[W];if(X.length+c.length+U+23<M){X+=(W>0?A.cb:"")+c;}else{T(X);X=S("p")+"&_L=m"+V+Z.name+A.ca+"l"+V+c;}}if(Y+1<e){X+=A.ch;}}T(X);}function O(){var X=A.isArr(F);for(var W in F){if(!F.hasOwnProperty(W)){continue;}var Y=F[W];Y=A.trim(Y!==""?Y:W);var V=document.getElementById(X?Y:W);if(!V){continue;}A.addEv(V,"click",function(Z){return function(g){g=g||event;var d=A.getTarget(g),c=null;var i=d.nodeName.toLowerCase(),b="";if(i!=="a"){if(d.parentNode.nodeName.toLowerCase()!=="a"){return;}if(i==="img"){c=d;}d=d.parentNode;}if(c){b=A.getLT(c,"alt");if(!b||b===""){b=A.getLT(d,"href");}}else{b=A.getLT(d,B);}b=A.trim(A.clean(b));var h=N[A.getPosKey(Z,b)]||-1;if(P>0){b=b.substring(0,P);}var a=S("c")+"&_C="+A.ser({sec:Z,slk:b,_p:h});var f=(d.target.toLowerCase()==="_blank"||g.altKey||g.ctrlKey||g.shiftKey||g.metaKey);T(a,"c",g,d.href,f);};}(Y));if(A.uot(H.track_lv)){J(V,Y);}}var U=S(H.client_only?"b":"p");if(A.uot(H.track_lv)){G(U);}else{T(U);}}return{init:function(){return O();}};};JD.i13n.Util=function(){var E=new RegExp(/\r|\r\n|\n|\t/g),B=new RegExp(/^\s+|\s+$/g),C=navigator.userAgent,D=(C.match(/MSIE\s[^;]*/)?1:0),A=((/KHTML/).test(C)?1:0);if(!D&&!A){A=(C.match(/AppleWebKit/)?1:0);}return{ca:"%01",cb:"%02",cd:"%04",ce:"%05",cf:"%06",ch:"%08",enc:encodeURIComponent,uot:function(F){return F===undefined||F===true;},getTarget:function(G){var F=G.target||G.srcElement;return this.rTN(F);},rTN:function(F){if(F&&3===F.nodeType){return F.parentNode;}else{return F;}},getPosKey:function(F,G){return F+"_"+G;},addEv:function(H,F,G){if(H.addEventListener){H.addEventListener(F,G,false);}else{if(H.attachEvent){H.attachEvent("on"+F,G);}}},clean:function(F){if(!F){return"";}if(F.substr(0,7)==="http://"){return F.substr(7,F.length);}if(F.substr(0,8)==="https://"){return F.substr(8,F.length);}return F;},getLT:function(F,H){H=H.toLowerCase();if(!H||H==="text"){var G="";if(A){G=F.textContent;}else{G=(F.innerText?F.innerText:F.textContent);}return(G?G.replace(E,""):G);}var I="";if(H==="href"){I=F.getAttribute("href",2);}else{I=F.getAttribute(H)||"";}return I.replace(E,"");},ser:function(K){if(!K){return"";}var L=[];for(var H in K){if(K.hasOwnProperty(H)){var G=H,F=K[H];if(G.length<=8&&F.toString().length<=300&&!this.hasCC(G)&&!this.hasCC(F)){var J="";try{J=this.enc(G+"\x03"+F);}catch(I){J="_ERR_ENCODE_";}L[L.length]=J;}}}return L.join(this.cd);},clref:function(F){if(F.indexOf("http://")!==0&&F.indexOf("https://")!==0){return"";}return F;},hasCC:function(H){for(var G=0,F=H.length;G<F;G++){if(H.charCodeAt(G)<32){return true;}}return false;},trim:function(F){if(typeof F!=="string"){return F;}return F.replace(B,"");},isNum:function(F){return typeof F==="number";},isFun:function(F){return typeof F==="function";},isArr:function(F){return this.isNum(F.length)&&this.isFun(F.splice);},prevDef:function(F){if(F.preventDefault){F.preventDefault();}else{F.returnValue=false;}},rand:function(){var G="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",H="",F=0;for(;F<8;F++){H+=G.charAt(Math.floor(Math.random()*62));}return H;}};}();(function(){var $U=JD.util;var $D=$U.Dom;var $C=$U.CustomEvent;var DTK=JD.namespace('Media.Dtk');JD.namespace('Media.Dtk.util');var spawn=function(cls,args){if(!args)args=[];else if(!args instanceof Array)args=[args];var f=function(){};f.prototype=cls.prototype;f.prototype.constructor=cls;var obj=new f();cls.apply(obj,args);return obj;};DTK.util.Manager=function(daemonClass){this.daemons={};this.stack=[];var idCounter=[0];var p=daemonClass.prototype;if(typeof p.getId!=='function'){p.getId=function(){if(this.id){return this.id;}
return(this.id='daemon_'+(idCounter[0]++));};}
if(typeof p.toString!=='function'){p.toString=function(){return'Daemon '+this.getId();};}
this.onCreate=new $C('create',this);this.onDaemonEvent=new $C('daemonEvent');this.daemonClass=daemonClass;var unload=function(e){var s=this.stack;for(var i=s.length-1;i>-1;i--){if(s[i]){s[i].manager=null;if(typeof(s[i].unload)=='function'){s[i].unload();}
this.daemons[s[i].getId()]=null;s[i]=null;}}};$U.Event.addListener(window,'unload',unload,this,true);};DTK.util.Manager.prototype={daemonEvents:{},spawnDaemon:function(){var obj=spawn(this.daemonClass,arguments)
this.onCreate.fire(obj);return obj;},idString:'Generic Daemon Manager',toString:function(){var s=[this.idString,'{\n'];for(var c in this.daemons){if(this.daemons[c]instanceof this.daemonClass){s.push('\t',c,' : (',this.daemons[c].toString(),')\n');}}
s.push('}');return s.join('');},init:function(){var d=this.spawnDaemon.apply(this,arguments);if(d&&d.manager!=this){var onDaemonEvent=this.onDaemonEvent;d.manager=this;this.daemons[d.getId()]=d;this.stack.push(d);for(var e in d){if(d[e]instanceof $C){if(!this.daemonEvents[e]){this.daemonEvents[e]=new $C(d[e].type);}
var evMgr=this.daemonEvents[e];var fn=function(type,data){evMgr.scope=this;evMgr.fire.apply(evMgr,data);onDaemonEvent.scope=this;onDaemonEvent.type=type;onDaemonEvent.fire.apply(onDaemonEvent,data);};d[e].subscribe(fn);}}}
return d;},initAll:function(finder){if(typeof(finder)!='function')return[];var things=finder();var ret=[];var len=things.length;var args=[null];var arglen=arguments.length;for(var i=1;i<arglen;i++){args.push(arguments[i]);}
for(var i=0;i<len;i++){args[0]=things[i];var d=this.init.apply(this,args);if(d){ret.push(d);}}
return ret;},getDaemonById:function(id){if(id.id)return this.getDaemonById(id.id);return this.daemons[id]||null;}};})();with({$D:JD.util.Dom,$E:JD.util.Event,$C:JD.util.CustomEvent,DTK:JD.namespace('Media.Dtk'),GS:null,GlobalSearch:null,hiddenInputs:{},parseQueryString:function(qs){var o={};if(qs){if(qs.indexOf('?')!=-1){qs=qs.split('?')[1];qs=qs.replace(/&amp;/g,'&').split('&');for(var i=qs.length-1;i>-1;i--){qs[i]=qs[i].split('=');var v=qs[i][0];qs[i][0]='';o[v]=decodeURIComponent(qs[i].join('=').replace(/^=/,''));}}}
return o;},getInputsByName:function(name,type,form){var f;if(type){f=function(el){return el.name===name&&el.type===type;};}else{f=function(el){return el.name===name;};}
return JD.util.Dom.getElementsBy(f,'input',form);}}){(function(){var setupTabs=function(){if(!this.tabs||!this.tabs.length){this.tabs=this.tabList.getElementsByTagName(this.tabTagName);var f=this.getForm();for(var i=this.tabs.length-1;i>-1;i--){if($D.hasClass(this.tabs[i],this.selectedClassName)){this.selectedTab=this.tabs[i];}
var a=this.tabs[i].getElementsByTagName('a');for(var j=a.length-1;j>-1;j--){var qs=parseQueryString(a[j].href);for(var name in qs){if(!hiddenInputs[name]){var inputs=getInputsByName(name,'hidden',f);if(inputs&&inputs.length){hiddenInputs[name]=inputs[0];}
if(name=='vs'&&qs[name]=='games.JD.com'){a[j].href=a[j].href.split('vs=games.JD.com').join('vs=games.JD.com+videogames.JD.com+wii.JD.com');}}}
if(j==0&&i==0){f.action=a[j].href;}
$E.on(a[j],'click',tabClick,this);}}}
return true;};var getTabList=function(){if(!this.tabList){var tabList=$D.getElementsByClassName(this.tabListClassName,this.tabListTagName,this.getForm());if(!tabList||!tabList.length){return false;}
this.tabList=tabList[0];tabList=null;}
return true;};var getInputElement=function(){if(!this.input||this.input.type!='text'){var input=$D.getElementsBy(function(i){return i.name=='p'&&i.type=='text';},'input',this.getForm());if(!input[0]){return false;}
this.input=input[0];}
return true;};var tabClick=function(e,o){select.call(o,this);$E.stopEvent(e);return false;};var formSubmit=function(e){var f=this.getForm();if(f.method.toLowerCase()=='get'){var a=parseQueryString(f.action);for(var name in hiddenInputs){hiddenInputs[name].value=a[name]||'';delete(a[name]);}
for(var name in a){var h=getInputsByName(name,'hidden',f);if(h&&h.length){h=h[0];}else{h=document.createElement('input');h.type='hidden';h.name=name;f.appendChild(h);}
h.value=a[name];}}
return true;};var select=function(a){this.input.focus();var l=a.parentNode;while(l&&l.tagName&&l.parentNode&&l.tagName.toLowerCase()!=this.tabTagName.toLowerCase())l=l.parentNode;if(l&&l.tagName.toLowerCase()==this.tabTagName.toLowerCase()&&l!=this.selectedTab){$D.removeClass(this.selectedTab,this.selectedClassName);$D.addClass(l,this.selectedClassName);this.formerTab=this.selectedTab;this.selectedTab=l;this.getForm().action=a.href;this.onChange.fire();}};GS=function(form,args){form=$D.get(form);$D.generateId(form);this.onChange=new $C('change',this);if(form){this.getForm=function(){return form;};this.getId=function(){return form.id;};this.toString=function(){return'Global Search Object - '+form.id+' (uninitialized)';};this.initialized=false;this.tabs=[];this.selectedTab=null;this.formerTab=null;this.init(args);}};GS.prototype={init:function(args){if(args&&typeof(args)=='object'){for(var i in args){if(i in GS.prototype&&i!='init'){this[i]=args[i];}}}
if(getTabList.call(this)&&setupTabs.call(this)&&getInputElement.call(this)&&$E.on(this.getForm(),'submit',formSubmit,this,true)){this.toString=function(){return'Global Search Object - '+this.getForm().id;};this.initialized=true;}},tabListClassName:'search-targets',tabListTagName:'ul',tabList:null,tabTagName:'li',selectedClassName:'selected',input:null,hiddenInputs:hiddenInputs};})();GlobalSearch=function(){GlobalSearch.superclass.constructor.call(this,GS);};JD.extend(GlobalSearch,DTK.util.Manager);GlobalSearch.prototype.getGlobalSearch=GlobalSearch.prototype.getDaemonById;GlobalSearch.prototype.idString='Global Search Manager';DTK.GlobalSearch=new GlobalSearch();}
(function(){var $U=JD.util;var $D=$U.Dom;var $E=$U.Event;var $S=$U.Scroll;var DTK=JD.namespace('Media.Dtk');var Carousel;(function(){var setupElements=function(el,len,onclick,ontween,oncomplete){if(JD.util.ImageLoader){this.imageGroup=new JD.util.ImageLoader.group(el.id,'mouseover',null);var deferred_image_array=$D.getElementsByClassName('deferred','img',el);for(i=0;i<deferred_image_array.length;i++){var img=deferred_image_array[i];var deferred_image=this.imageGroup.registerSrcImage(img.id,img.getAttribute('path'));deferred_image.setVisible=true;}}
var s=this.scrollBody;var list=this.pages;var h=$D.getRegion(s);h=(h.bottom-h.top+4)+'px';s.parentNode.style.height=h;s.style.height=h;s.style.position='absolute';var w=$D.getRegion(s.parentNode);w=(w.right-w.left)+'px';s.style.width=w;s.parentNode.style.width=w;s.parentNode.style.position='relative';for(var i=len-1;i>-1;i--){list[i].style.width=w;list[i].style.overflow='hidden';}
var r=$D.getRegion(list[0]);this.scrollDistance=r.right-r.left;$E.addListener(s,'click',onclick,this,true);var p=$D.getElementsByClassName('scrollpages','div',s)[0];p.style.width=(len*this.scrollDistance*1.0+10)+'px';p.style.position='absolute';var sl=Math.round(s.scrollLeft/this.scrollDistance);if(sl<0)sl=0;else if(sl>=this.pages.length)sl=this.pages.length-1;this.current=sl;this.scrollBody.scrollLeft=this.__currentScroll=sl*this.scrollDistance;this.anim=new $S(this.scrollBody,this.animAttrs,this.animDur,this.easeMethod);this.anim.onTween.subscribe(ontween,this,true);this.anim.onComplete.subscribe(oncomplete,this,true);if(len>1){addNavButtons.call(this);addPageIndicators.call(this);updateNavState.call(this);}else this.navLinks=[];el=list=s=null;};var addPageIndicators=function(){var n=$D.getElementsByClassName('scrollnav','div',this.getElement());n=n[0]||document.createElement('div');n.className='scrollnav';removeNavLinks.call(this);var p=this.pages.length;for(var x=0;x<p;x++){var a=this.navLinks[x]||document.createElement('a');a.href='#pg:'+(x+1);a.index=x;a.carousel=this;a.onmousedown=a.onclick=this.scrollTo_click;if(x==this.current){a.className='current';}
n.appendChild(a);this.navLinks[x]=a;}
var s=this.scrollBody;s.parentNode.insertBefore(n,s);return;};var removeNavLinks=function(){if(this.navLinks){for(var j=this.navLinks.length-1;j>-1;j--){var a=this.navLinks[j];if(a){a.onclick=null;a.onmousedown=null;a.onmouseup=null;a.carousel=null;}
a=null;this.navLinks[j]=null;}}
this.navLinks=[];};var addNavButtons=function(){if(this.prev||this.next)return;var p=document.createElement('a'),n=p.cloneNode(true);var i=this.getElement().id;n.href=p.href="#"+i;p.className="prev";n.className="next";var s=this.scrollBody;s.parentNode.insertBefore(p,s);s.parentNode.insertBefore(n,s);p.onmousedown=p.onclick=this.scrollPrev_click;n.onmousedown=n.onclick=this.scrollNext_click;this.prev=p;this.next=n;n.carousel=p.carousel=this;s=null;};var updateNavState=function(){var l=this.navLinks.length;for(var x=0;x<l;x++){if(x==this.current){this.navLinks[x].className='current';}else{this.navLinks[x].className='';}}
if(this.current==0&&!this.roundRobin){$D.addClass(this.prev,'off');$D.removeClass(this.next,'off');$D.setStyle(this.next,'cursor','')
$D.setStyle(this.prev,'cursor','default')}else if(this.current==(l-1)&&!this.roundRobin){$D.removeClass(this.prev,'off');$D.addClass(this.next,'off');$D.setStyle(this.prev,'cursor','')
$D.setStyle(this.next,'cursor','default')}else{$D.removeClass(this.prev,'off');$D.removeClass(this.next,'off');$D.setStyle(this.next,'cursor','')
$D.setStyle(this.prev,'cursor','')}};var clickHandler=function(whichFn,fnFailure,fnArgs){return function(e){e=e||window.event;fnFailure=fnFailure||function(){return false;};fnArgs=fnArgs||function(){};var a=$E.getTarget(e);if(!a||!a.carousel||fnFailure(a)){return true;}
if(!a.didMouseDown){a.carousel.autoPlay=false;a.carousel[whichFn](fnArgs(a));}else{a.blur();}
a.didMouseDown=(e.type=='mousedown');a=null;$E.stopEvent(e);return false;};};Carousel=function(el,args){var me=this;this.__currentScroll=0;this.getCurrentScroll=function(){return this.__currentScroll;};var _element=null;this.imageGroup=null;this.getElement=function(){return _element;};this.init=function(el,args){el=$D.get(el);if(el){_element=el;}
$D.generateId(el,'carousel_');s=$D.getElementsByClassName('scrollbody','div',el)[0];if(typeof(args)=='object'){for(var i in args){this[i]=args[i];}}
var pages=$D.getElementsBy(function(el){return me.pageFinder(el);},this.pageTagName,s);var len=pages.length;if(!el||!s||!len){return false;}
this.pages=pages;this.scrollBody=s;pages=s=null;this.onScrollStart=new $U.CustomEvent('scrollstart',this);this.onPageChange=new $U.CustomEvent('scrollcomplete',this);this.onClick=new $U.CustomEvent('click',this);this.onAutoPlayStart=new $U.CustomEvent('autoplaystart',this);this.onAutoPlayStop=new $U.CustomEvent('autoplaystop',this);var onclick=function(e){this.onClick.fire(e);};var ontween=function(e,data){this.__currentScroll=this.anim.doMethod('scroll',this.animAttrs.scroll.from,this.animAttrs.scroll.to)[0];};var oncomplete=function(e,data){if(data[0].duration>=this.animDur){data=data[0];data.carousel=this;var _toString=data.toString;data.toString=function(){return _toString()+', current page:'+this.carousel.current;};this.onPageChange.fire(data);}};window.setTimeout(function(){setupElements.call(me,el,len,onclick,ontween,oncomplete);},0);s=null;return true;};var autoPlayTimeOut=0;var autoPlayFn=function(){me.autoPlay=(me.autoPlayDirection>0)?me.scrollNext():me.scrollPrev();};var autoPlaySubscribed=false;var autoPlayer=function(){clearTimeout(autoPlayTimeOut);if(me.autoPlay&&!me.roundRobin&&(me.current==me.pages.length-1&&me.autoPlayDirection>0||me.autoPlayDirection<=0&&me.current==0)){me.autoPlay=false;}
if(!me.autoPlay){me.onPageChange.unsubscribe(autoPlayer);autoPlaySubscribed=false;me.onAutoPlayStop.fire(me.current);}else{if(!autoPlaySubscribed){autoPlaySubscribed=true;me.onPageChange.subscribe(autoPlayer);autoPlayFn();}else{autoPlayTimeOut=window.setTimeout(autoPlayFn,me.autoPlayDur*1000);}}};this.autoPlayStart=function(){if(!this.autoPlay){this.onAutoPlayStart.fire(this.current);}
this.autoPlay=true;autoPlayer();};this.autoPlayStop=function(){this.autoPlay=false;autoPlayer();};this.getData=function(url,postExecute){var id=this.getId();var s=function(){me.getDataSuccess.apply(me,arguments);};var f=function(){me.getDataFailure.apply(me,arguments);};var callback={success:s,failure:f,argument:{postExecute:postExecute}};var oConObj=$U.Connect.asyncRequest('GET',url,callback,null);};this.getDataSuccess=function(o){if(o.responseText){var sText=o.responseText;sText=sText.replace(/<\!--.+-->/gim,'');var oArr=eval('('+sText+')');var createdPages=false,removedPages=false;if(oArr){var numPages=this.pages.length;var len=oArr.length;for(var i=0;i<len;i++){var pg=oArr[i].pgIdx;var html=oArr[i].pgHtml;var page;if(pg<numPages&&pg>=0){page=this.pages[pg];}else{var p=this.pages[numPages-1];page=p.cloneNode(false);p.parentNode.appendChild(page);this.pages[numPages++]=page;createdPages=true;}
page.innerHTML=html;if(oArr[i].attributes){for(var a in oArr[i].attributes){page.setAttribute(a,oArr[i].attributes[a]);}}}
while(i<numPages){this.pages[i].parentNode.removeChild(this.pages[i]);delete this.pages[i];removedPages=true;i++;}
if(createdPages||removedPages){addPageIndicators.call(this);}}
if(o.argument.postExecute){o.argument.postExecute();}}};this.getDataFailure=function(o){};this.unload=function(){if(!this.navLinks){this.navLinks=[];}
this.navLinks.push(_element,this.prev,this.next,this.scrollBody,this.anim);removeNavLinks.call(this);if(this.pages){for(var j=this.pages.length-1;j>-1;j--){this.pages[j]=null;}}};this.animAttrs={scroll:{from:[0,0],to:[0,0]}};if(el){me.init(el,args);}};Carousel.prototype={pageFinder:function(el){return $D.hasClass(el,this.pageClassName);},pageTagName:'div',pageClassName:'scrollpage',easeMethod:$U.Easing.easeOut,roundRobin:false,animDur:1.5,autoPlayDur:5,onScrollStart:null,onPageChange:null,onClick:null,autoPlayDirection:1,onAutoPlayStart:null,onAutoPlayStop:null,scrollTo:function(index){if(this.roundRobin){if(index<0){index=this.pages.length-1;}else if(index>=this.pages.length){index=0;}}
if((!index&&index!==0)||index>=this.pages.length||index<0||index==this.current){return false;}
if(this.anim.isAnimated()){this.anim.stop();}
this.onScrollStart.fire({to:index,from:this.current,toString:function(){return'from:'+this.from+', to:'+this.to;}});var end=index*this.scrollDistance;this.animAttrs.scroll.from=[this.getCurrentScroll(),0];this.animAttrs.scroll.to=[end,0];this.current=index;updateNavState.call(this);this.anim.attributes=this.animAttrs;this.anim.duration=this.animDur;var a=this.anim;window.setTimeout(function(){a.animate();},0);return true;},scrollNext:function(){var ret=this.scrollTo(this.current+1);return ret;},scrollNext_click:clickHandler('scrollNext'),scrollPrev:function(){var ret=this.scrollTo(this.current-1);return ret;},scrollPrev_click:clickHandler('scrollPrev'),scrollTo_click:clickHandler('scrollTo',function(el){return(!el.index&&el.index!==0);},function(el){return el.index;}),toString:function(){var el=this.getElement();if(el){return'Carousel #'+el.id+' .'+el.className;}else{return'Carousel [Not Initiated]';}
el=null;},getId:function(){return this.getElement().id;}}})();(function(){var CarouselMgr=function(){CarouselMgr.superclass.constructor.call(this,Carousel);};JD.extend(CarouselMgr,DTK.util.Manager);CarouselMgr.prototype.initAll=function(cls,args){return CarouselMgr.superclass.initAll.call(this,function(){return $D.getElementsByClassName(cls||'dtk-carousel','div',document);},args);};CarouselMgr.prototype.getCarousel=CarouselMgr.prototype.getDaemonById;CarouselMgr.prototype.idString='Carousel Manager';DTK.CarouselMgr=new CarouselMgr();})();})();JD.namespace('Games').PromoBox=new(function(){var $U=JD.util;var $E=$U.Event;var $D=$U.Dom;var $C=$U.CustomEvent;var maxAP=500;var cntAP=0;var PromoBox=function(){this.loaded=false;this.onLoad=new $C('load',this);this.onCardChange=new $C("cardChanged",this);this.onAutoPlayStart=new $C("autoPlayStarted",this);this.onAutoPlayStop=new $C("autoPlayStopped",this);this.mouseX=0;this.mouseY=0;};PromoBox.prototype={init:function(box,autoPlay,cardDuration){box=$D.get(box);if(!box||this.loaded){return false;}
this.box=box;this.autoPlay=!!autoPlay;this.cardDuration=cardDuration||7;this.maxAutoPlays=500;this.autoTweenDuration=0.5;this.userTweenDuration=0.2;this.cards=[];this.imageLoaderGroups=[];this.imageLoaderTriggers=[];cntAP=0;$E.on(document,'mousemove',this.trackMouse,this,true);var cards_array=$D.getElementsByClassName('card','div',this.box);if(!$D.hasClass(cards_array[cards_array.length-1],'last')){var func=function(self){return function(){self.init();};}(this);window.setTimeout(func,50);return;}
var links_array=$D.getElementsByClassName('card-menu','*',this.box)[0];links_array=links_array.getElementsByTagName('a');this.currentCard=null;var currentCardIndex=0;var i,a,c;for(i=0;i<cards_array.length;i++){a=links_array[i];c=cards_array[i];this.cards[i]={card:c,link:a};a.i=i;c.i=i;$E.on(a,'click',this.showSelectedCard,this,true);if($D.hasClass(c,'selected')&&this.currentCard===null){currentCardIndex=i;this.currentCard=c;$D.addClass(a,'selected');$D.addClass(a.parentNode,'selected');$D.setStyle(c,'opacity',0.99);}else{$D.removeClass(a,'selected');$D.removeClass(a.parentNode,'selected');$D.removeClass(c,'selected');$D.setStyle(c,'opacity',0);}
var images=$D.getElementsBy(function(e){return e.getAttribute('yg_img_path')!==null;},'img',cards_array[i]);var imageCount=images.length;if(imageCount>0){this.imageLoaderGroups[i]=new JD.util.ImageLoader.group(links_array[i],'mouseover',0);for(var z=0;z<imageCount;z++){this.imageLoaderGroups[i].registerSrcImage(images[z].id,images[z].getAttribute('yg_img_path'));}
this.imageLoaderTriggers[i]=new $C('imageLoaderTrigger');this.imageLoaderGroups[i].addCustomTrigger(this.imageLoaderTriggers[i]);}}
if(this.currentCard===null){this.currentCard=cards_array[0];}
var cards_e=$D.getElementsByClassName('cards','div',this.box)[0];if(JD.Games.launchConsole&&JD.Games.launchConsole.instrument){JD.Games.launchConsole.instrument(cards_e);}
if(JD.Games.launchVideo&&JD.Games.launchVideo.instrument){JD.Games.launchVideo.instrument(cards_e);}
this.loaded=true;this.onLoad.fire();if(this.autoPlay){this.startAutoPlay();}},trackMouse:function(e){this.mouseX=$E.getPageX(e);this.mouseY=$E.getPageY(e);},showPreviousCard:function(e){if(!this.loaded){return;}
$E.preventDefault(e);this.showCard(this.getPreviousCard(),true);},showNextCard:function(e){if(!this.loaded){return;}
$E.preventDefault(e);this.showCard(this.getNextCard(),true);},showSelectedCard:function(e){if(!this.loaded){return;}
$E.preventDefault(e);var a=$E.getTarget(e,true);while(a&&a.nodeType===1&&a.tagName!='A'){a=a.parentNode;}
a.blur();this.showCard(a.i,true);},showCard:function(i,userInit){if(i===null){return false;}
if(userInit){this.stopAutoPlay();}else if(this.autoPlay&&this.pauseElement){var el=$D.getRegion(this.pauseElement);var cursor=new $U.Point(this.mouseX,this.mouseY);if(el.contains(cursor)){this.startAutoPlay();return false;}}
try{var newCard=this.cards[i].card,newLink=this.cards[i].link,oldCard=this.currentCard||this.cards[0].card,oldLink=this.cards[oldCard.i].link;}catch(ex){return false;}
if(newCard==oldCard){return;}
if(this.imageLoaderTriggers[i]){this.imageLoaderTriggers[i].fire();this.imageLoaderTriggers[i]=null;}
if(this.fadeIn&&this.fadeIn.isAnimated()){this.fadeIn.stop();}
if(this.fadeOut&&this.fadeOut.isAnimated()){this.fadeOut.stop();}
this.currentCard=newCard;var tweenDuration=userInit?this.userTweenDuration:this.autoTweenDuration;this.fadeOut=new $U.Anim(oldCard,{opacity:{from:0.99,to:0}},tweenDuration);this.fadeOut.onStart.subscribe(function(){$D.removeClass(oldLink,'selected');$D.removeClass(oldLink.parentNode,'selected');$D.setStyle(oldCard,'zIndex',1);oldLink=null;});this.fadeOut.onComplete.subscribe(function(){$D.removeClass(oldCard,'selected');oldCard=null});this.fadeOut.animate();this.fadeIn=new $U.Anim(newCard,{opacity:{from:0,to:0.99}},tweenDuration);this.fadeIn.onStart.subscribe(function(){$D.addClass(newLink,'selected');$D.addClass(newLink.parentNode,'selected');$D.addClass(newCard,'selected');$D.setStyle(newCard,'zIndex',2);newLink=null;newCard=null;});this.fadeIn.animate();if(this.autoPlay){this.startAutoPlay();}
this.onCardChange.fire();var nextCard=this.getNextCard();if(this.imageLoaderTriggers[nextCard]){this.imageLoaderTriggers[nextCard].fire();this.imageLoaderTriggers[nextCard]=null;}},getPreviousCard:function(){return(!this.currentCard||this.currentCard.i<=0)?this.cards.length-1:this.currentCard.i-1;},getNextCard:function(){return(!this.currentCard||this.currentCard.i>=this.cards.length-1)?0:this.currentCard.i+1;},startAutoPlay:function(){if(!this.loaded){return;}
cntAP+=1;if(cntAP>maxAP){return this.stopAutoPlay();}
var func=function(self){return function(){self.showCard(self.getNextCard());};}(this);this.timer=window.setTimeout(func,this.cardDuration*1000);if(!this.autoPlay){this.autoPlay=true;this.onAutoPlayStart.fire();}},stopAutoPlay:function(){if(typeof this.timer==='number'){window.clearTimeout(this.timer);}
this.autoPlay=false;cntAP=0;this.onAutoPlayStop.fire();},toggleAutoPlay:function(e){if(e){$E.stopEvent(e);var a=$E.getTarget(e,true);if(a.blur){a.blur();}}
if(this.autoPlay){this.stopAutoPlay();}
else{this.startAutoPlay();}}};return PromoBox;}());with({$D:JD.util.Dom,$E:JD.util.Event,G:JD.namespace('Games'),create:function(tag){return document.createElement(tag);},schedule:function(o){o.delay=window.setTimeout(function(){o[o.autoplay]();},o.interval);},makeButtons:null,moreTickerSetup:null})
{G.Ticker=function(id,autoplay,interval){if(id){this.init(id,autoplay,interval);}};G.Ticker.instances={};makeButtons=function(){var d=create("DIV");d.className="buttons";var p=create("A");p.innerHTML="Previous";p.className="prev";p.title="Scroll Up";p.href="#";$E.on(p,"click",this.previous,this,true);var n=create("A");n.innerHTML="Next";n.className="next";n.title="Scroll Down";n.href="#";$E.on(n,"click",this.next,this,true);n.href="#";d.appendChild(p);d.appendChild(n);if(this.autoplay){var toggle=create("A");toggle.innerHTML="Pause";toggle.className="autoplay-toggle playing";toggle.title="Pause";toggle.href="#";$E.on(toggle,"click",this.toggle,this,true);d.appendChild(toggle);this.toggleEl=toggle;}
this.e.parentNode.insertBefore(d,this.e.nextSibling);};moreTickerSetup=function(id,autoplay,interval){this.items=this.getElements(this.e);if(!this.items.length)return;this.count=this.items.length;this.anim=new JD.util.Motion(this.e,{},this.speed);this.anim.onComplete.subscribe(this.checkPosition,this,true);this.distance=this.computeDistance();this.items=this.addItems();this.current=0;this.target=0;this.autoplay=!!autoplay?(autoplay==='prev'?'prev':'next'):false;this.buttons=true;this.toggleEl=null;this.interval=interval||4000;var r1=$D.getRegion(this.e);var r2=$D.getRegion(this.items[1]);this.firstPos=r1.top-(r2.top-r1.top);r2=$D.getRegion(this.items[this.count]);this.lastPos=r1.top-(r2.top-r1.top);$E.on(this.items,"mouseover",this.rollover,this,true);$E.on(this.items,"mouseout",this.rollout,this,true);if(this.buttons){makeButtons.call(this);}
if(this.autoplay){schedule(this);}};G.Ticker.prototype={init:function(id,autoplay,interval){this.speed=.4;this.id=id;G.Ticker.instances[id]=this;this.e=$D.get(id);window.setTimeout(function(){moreTickerSetup.call(G.Ticker.instances[id],id,autoplay,interval);},0);},getElements:function(e){var elements=[];for(var i=0;i<e.childNodes.length;i++){if(e.childNodes[i].nodeType==1){elements[elements.length]=e.childNodes[i];}}
return elements;},computeDistance:function(direction){var elements=this.items;var el1=this.items[this.current];var el2=this.items[this.current+direction];var rgn1=$D.getRegion(el1);var rgn2=$D.getRegion(el2);var d=rgn1.bottom-rgn1.top;return d<0?-d:d;},addItems:function(e,items){var e=this.e;var items=this.items;var resultItems=items;var p=e.parentNode.parentNode;var parentRgn=$D.getRegion(p);var addedHeight=0;var parentHeight=parentRgn.bottom-parentRgn.top+2;for(var j=0;addedHeight<=parentHeight&&j<items.length;j++){var r=$D.getRegion(items[j]);var amnt=r.bottom-r.top;addedHeight+=amnt;var ch=create(items[j].tagName);ch.innerHTML=items[j].innerHTML;ch.className=items[j].className;e.appendChild(ch);resultItems[resultItems.length]=ch;}
return resultItems;},animate:function(direction){var d=this.computeDistance(direction);this.target=this.current+direction;if(this.target<0){this.flip(-1);}
var rgn=JD.util.Dom.getRegion(this.e);this.anim.attributes={points:{to:[rgn.left,rgn.top-(d*direction)]}};this.anim.duration=this.speed;this.anim.animate();},next:function(e){if(!this.anim.isAnimated()){this.stop();this.animate(1);}
if(e){if(this.autoplay){this.toggle();}
$E.stopEvent(e);}else if(this.autoplay){schedule(this);}},previous:function(e){if(!this.anim.isAnimated()){this.animate(-1);this.stop();}
if(e){if(this.autoplay){this.toggle();}
$E.stopEvent(e);}else if(this.autoplay){this.autoplay='prev';schedule(this);}},checkPosition:function(){this.current=this.target;if(this.current>this.count){this.flip(1);}},flip:function(direction){if(direction==1){$D.setY(this.e,this.firstPos);this.current=1;}else{$D.setY(this.e,this.lastPos);this.current=this.count;this.target=this.count-1;}},toggle:function(e,direction){this.stop();if(e){$E.stopEvent(e);}
if(this.autoplay){this.autoplay=false;this.toggleEl.innerHTML="Play";this.toggleEl.title="Play";$D.removeClass(this.toggleEl,"playing");}else{this.autoplay=(typeof(direction)==='string')?direction:'next';this.toggleEl.innerHTML="Pause";this.toggleEl.title="Pause";$D.addClass(this.toggleEl,"playing");this.next();}},stop:function(){if(this.delay){clearTimeout(this.delay);}},start:function(){this.autoplay=this.autoplay||'next';schedule(this);},rollover:function(e){if(this.autoplay){this.stop();}},rollout:function(e){if(this.autoplay){this.start();}}};}
(function(){var $U=JD.util;var $D=$U.Dom;var $E=$U.Event;var $S=$U.Scroll;var DTK=JD.namespace('Media.Dtk');var Carousel;(function(){var setupElements=function(el,len,onclick,ontween,oncomplete){if(JD.util.ImageLoader){this.imageGroup=new JD.util.ImageLoader.group(el.id,'mouseover',null);var deferred_image_array=$D.getElementsByClassName('deferred','img',el);for(i=0;i<deferred_image_array.length;i++){var img=deferred_image_array[i];var deferred_image=this.imageGroup.registerSrcImage(img.id,img.getAttribute('path'));deferred_image.setVisible=true;}}
var s=this.scrollBody;var list=this.pages;var h=$D.getRegion(s);h=(h.bottom-h.top+4)+'px';s.parentNode.style.height=h;s.style.height=h;s.style.position='absolute';var w=$D.getRegion(s.parentNode);w=(w.right-w.left)+'px';s.style.width=w;s.parentNode.style.width=w;s.parentNode.style.position='relative';for(var i=len-1;i>-1;i--){list[i].style.width=w;list[i].style.overflow='hidden';}
var r=$D.getRegion(list[0]);this.scrollDistance=r.right-r.left;$E.addListener(s,'click',onclick,this,true);var p=$D.getElementsByClassName('scrollpages','div',s)[0];p.style.width=(len*this.scrollDistance*1.0+10)+'px';p.style.position='absolute';var sl=Math.round(s.scrollLeft/this.scrollDistance);if(sl<0)sl=0;else if(sl>=this.pages.length)sl=this.pages.length-1;this.current=sl;this.scrollBody.scrollLeft=this.__currentScroll=sl*this.scrollDistance;this.anim=new $S(this.scrollBody,this.animAttrs,this.animDur,this.easeMethod);this.anim.onTween.subscribe(ontween,this,true);this.anim.onComplete.subscribe(oncomplete,this,true);if(len>1){addNavButtons.call(this);addPageIndicators.call(this);updateNavState.call(this);}else this.navLinks=[];el=list=s=null;};var addPageIndicators=function(){var n=$D.getElementsByClassName('scrollnav','div',this.getElement());n=n[0]||document.createElement('div');n.className='scrollnav';removeNavLinks.call(this);var p=this.pages.length;for(var x=0;x<p;x++){var a=this.navLinks[x]||document.createElement('a');a.href='#pg:'+(x+1);a.index=x;a.carousel=this;a.onmousedown=a.onclick=this.scrollTo_click;if(x==this.current){a.className='current';}
n.appendChild(a);this.navLinks[x]=a;}
var s=this.scrollBody;s.parentNode.insertBefore(n,s);return;};var removeNavLinks=function(){if(this.navLinks){for(var j=this.navLinks.length-1;j>-1;j--){var a=this.navLinks[j];if(a){a.onclick=null;a.onmousedown=null;a.onmouseup=null;a.carousel=null;}
a=null;this.navLinks[j]=null;}}
this.navLinks=[];};var addNavButtons=function(){if(this.prev||this.next)return;var p=document.createElement('a'),n=p.cloneNode(true);var i=this.getElement().id;n.href=p.href="#"+i;p.className="prev";n.className="next";var s=this.scrollBody;s.parentNode.insertBefore(p,s);s.parentNode.insertBefore(n,s);p.onmousedown=p.onclick=this.scrollPrev_click;n.onmousedown=n.onclick=this.scrollNext_click;this.prev=p;this.next=n;n.carousel=p.carousel=this;s=null;};var updateNavState=function(){var l=this.navLinks.length;for(var x=0;x<l;x++){if(x==this.current){this.navLinks[x].className='current';}else{this.navLinks[x].className='';}}
if(this.current==0&&!this.roundRobin){$D.addClass(this.prev,'off');$D.removeClass(this.next,'off');$D.setStyle(this.next,'cursor','')
$D.setStyle(this.prev,'cursor','default')}else if(this.current==(l-1)&&!this.roundRobin){$D.removeClass(this.prev,'off');$D.addClass(this.next,'off');$D.setStyle(this.prev,'cursor','')
$D.setStyle(this.next,'cursor','default')}else{$D.removeClass(this.prev,'off');$D.removeClass(this.next,'off');$D.setStyle(this.next,'cursor','')
$D.setStyle(this.prev,'cursor','')}};var clickHandler=function(whichFn,fnFailure,fnArgs){return function(e){e=e||window.event;fnFailure=fnFailure||function(){return false;};fnArgs=fnArgs||function(){};var a=$E.getTarget(e);if(!a||!a.carousel||fnFailure(a)){return true;}
if(!a.didMouseDown){a.carousel.autoPlay=false;a.carousel[whichFn](fnArgs(a));}else{a.blur();}
a.didMouseDown=(e.type=='mousedown');a=null;$E.stopEvent(e);return false;};};Carousel=function(el,args){var me=this;this.__currentScroll=0;this.getCurrentScroll=function(){return this.__currentScroll;};var _element=null;this.imageGroup=null;this.getElement=function(){return _element;};this.init=function(el,args){el=$D.get(el);if(el){_element=el;}
$D.generateId(el,'carousel_');s=$D.getElementsByClassName('scrollbody','div',el)[0];if(typeof(args)=='object'){for(var i in args){this[i]=args[i];}}
var pages=$D.getElementsBy(function(el){return me.pageFinder(el);},this.pageTagName,s);var len=pages.length;if(!el||!s||!len){return false;}
this.pages=pages;this.scrollBody=s;pages=s=null;this.onScrollStart=new $U.CustomEvent('scrollstart',this);this.onPageChange=new $U.CustomEvent('scrollcomplete',this);this.onClick=new $U.CustomEvent('click',this);this.onAutoPlayStart=new $U.CustomEvent('autoplaystart',this);this.onAutoPlayStop=new $U.CustomEvent('autoplaystop',this);var onclick=function(e){this.onClick.fire(e);};var ontween=function(e,data){this.__currentScroll=this.anim.doMethod('scroll',this.animAttrs.scroll.from,this.animAttrs.scroll.to)[0];};var oncomplete=function(e,data){if(data[0].duration>=this.animDur){data=data[0];data.carousel=this;var _toString=data.toString;data.toString=function(){return _toString()+', current page:'+this.carousel.current;};this.onPageChange.fire(data);}};window.setTimeout(function(){setupElements.call(me,el,len,onclick,ontween,oncomplete);},0);s=null;return true;};var autoPlayTimeOut=0;var autoPlayFn=function(){me.autoPlay=(me.autoPlayDirection>0)?me.scrollNext():me.scrollPrev();};var autoPlaySubscribed=false;var autoPlayer=function(){clearTimeout(autoPlayTimeOut);if(me.autoPlay&&!me.roundRobin&&(me.current==me.pages.length-1&&me.autoPlayDirection>0||me.autoPlayDirection<=0&&me.current==0)){me.autoPlay=false;}
if(!me.autoPlay){me.onPageChange.unsubscribe(autoPlayer);autoPlaySubscribed=false;me.onAutoPlayStop.fire(me.current);}else{if(!autoPlaySubscribed){autoPlaySubscribed=true;me.onPageChange.subscribe(autoPlayer);autoPlayFn();}else{autoPlayTimeOut=window.setTimeout(autoPlayFn,me.autoPlayDur*1000);}}};this.autoPlayStart=function(){if(!this.autoPlay){this.onAutoPlayStart.fire(this.current);}
this.autoPlay=true;autoPlayer();};this.autoPlayStop=function(){this.autoPlay=false;autoPlayer();};this.getData=function(url,postExecute){var id=this.getId();var s=function(){me.getDataSuccess.apply(me,arguments);};var f=function(){me.getDataFailure.apply(me,arguments);};var callback={success:s,failure:f,argument:{postExecute:postExecute}};var oConObj=$U.Connect.asyncRequest('GET',url,callback,null);};this.getDataSuccess=function(o){if(o.responseText){var sText=o.responseText;sText=sText.replace(/<\!--.+-->/gim,'');var oArr=eval('('+sText+')');var createdPages=false,removedPages=false;if(oArr){var numPages=this.pages.length;var len=oArr.length;for(var i=0;i<len;i++){var pg=oArr[i].pgIdx;var html=oArr[i].pgHtml;var page;if(pg<numPages&&pg>=0){page=this.pages[pg];}else{var p=this.pages[numPages-1];page=p.cloneNode(false);p.parentNode.appendChild(page);this.pages[numPages++]=page;createdPages=true;}
page.innerHTML=html;if(oArr[i].attributes){for(var a in oArr[i].attributes){page.setAttribute(a,oArr[i].attributes[a]);}}}
while(i<numPages){this.pages[i].parentNode.removeChild(this.pages[i]);delete this.pages[i];removedPages=true;i++;}
if(createdPages||removedPages){addPageIndicators.call(this);}}
if(o.argument.postExecute){o.argument.postExecute();}}};this.getDataFailure=function(o){};this.unload=function(){if(!this.navLinks){this.navLinks=[];}
this.navLinks.push(_element,this.prev,this.next,this.scrollBody,this.anim);removeNavLinks.call(this);if(this.pages){for(var j=this.pages.length-1;j>-1;j--){this.pages[j]=null;}}};this.animAttrs={scroll:{from:[0,0],to:[0,0]}};if(el){me.init(el,args);}};Carousel.prototype={pageFinder:function(el){return $D.hasClass(el,this.pageClassName);},pageTagName:'div',pageClassName:'scrollpage',easeMethod:$U.Easing.easeOut,roundRobin:false,animDur:1.5,autoPlayDur:5,onScrollStart:null,onPageChange:null,onClick:null,autoPlayDirection:1,onAutoPlayStart:null,onAutoPlayStop:null,scrollTo:function(index){if(this.roundRobin){if(index<0){index=this.pages.length-1;}else if(index>=this.pages.length){index=0;}}
if((!index&&index!==0)||index>=this.pages.length||index<0||index==this.current){return false;}
if(this.anim.isAnimated()){this.anim.stop();}
this.onScrollStart.fire({to:index,from:this.current,toString:function(){return'from:'+this.from+', to:'+this.to;}});var end=index*this.scrollDistance;this.animAttrs.scroll.from=[this.getCurrentScroll(),0];this.animAttrs.scroll.to=[end,0];this.current=index;updateNavState.call(this);this.anim.attributes=this.animAttrs;this.anim.duration=this.animDur;var a=this.anim;window.setTimeout(function(){a.animate();},0);return true;},scrollNext:function(){var ret=this.scrollTo(this.current+1);return ret;},scrollNext_click:clickHandler('scrollNext'),scrollPrev:function(){var ret=this.scrollTo(this.current-1);return ret;},scrollPrev_click:clickHandler('scrollPrev'),scrollTo_click:clickHandler('scrollTo',function(el){return(!el.index&&el.index!==0);},function(el){return el.index;}),toString:function(){var el=this.getElement();if(el){return'Carousel #'+el.id+' .'+el.className;}else{return'Carousel [Not Initiated]';}
el=null;},getId:function(){return this.getElement().id;}}})();(function(){var CarouselMgr=function(){CarouselMgr.superclass.constructor.call(this,Carousel);};JD.extend(CarouselMgr,DTK.util.Manager);CarouselMgr.prototype.initAll=function(cls,args){return CarouselMgr.superclass.initAll.call(this,function(){return $D.getElementsByClassName(cls||'dtk-carousel','div',document);},args);};CarouselMgr.prototype.getCarousel=CarouselMgr.prototype.getDaemonById;CarouselMgr.prototype.idString='Carousel Manager';DTK.CarouselMgr=new CarouselMgr();})();})();(function(){JD.namespace('Games').launchConsole=function(e){if(this.href.indexOf('daily-crossword-with-JD-search')>0||this.href.indexOf('hollywood-jumble')>0){var settings='width=1000,height=744,resizable,scrollbars';}else{var settings='width=986,height=617'+(window.screen.height<617?',scrollbars':'');}
window.open(this.href,'',settings);JD.util.Event.stopEvent(e);return false;};JD.Games.launchConsole.instrument=function(root,regex){regex=regex||/\/console\//;var a=JD.util.Dom.getElementsBy(function(el){return!!el.href.match(regex);},'a',root);for(var i=a.length-1;i>-1;i--){JD.util.Event.on(a[i],'click',JD.Games.launchConsole);}};window.launchConsole=JD.Games.launchConsole;JD.namespace('Games').launchVideo=function(e){var settings='width=790,height=666'+(window.screen.height<617?',scrollbars':'');window.open(this.href,'',settings);JD.util.Event.stopEvent(e);return false;};JD.Games.launchVideo.instrument=function(root){var a=JD.util.Dom.getElementsBy(function(el){return el.href.indexOf("cosmos.bcst.JD.com")!=-1||el.href.indexOf("/age_gate")!=-1;},'a',root);for(var i=a.length-1;i>-1;i--){JD.util.Event.on(a[i],'click',JD.Games.launchVideo);}};})();JD.namespace('Games');(function(){var Dom=JD.util.Dom;var Event=JD.util.Event;var Connect=JD.util.Connect;JD.Games.List=function(el){this.container=el;this.main=null;this.backlog=null;this.init();};var proto=JD.Games.List.prototype;proto.init=function(){this.main=Dom.getElementsByClassName('main','ul',this.container)[0];this.backlog=Dom.getElementsByClassName('backlog','ul',this.container)[0];this.callback={cache:false,success:function(o){},failure:function(o){}};Event.addListener(this.container,'click',this.clickHandler,this);this.setupConsoleLinks();};proto.setupConsoleLinks=function(){var links=Dom.getElementsByClassName('target','a',this.container);for(var i=0;i<links.length;i++){if(links[i].href.indexOf('/console/')>0){Event.on(links[i],'click',JD.Games.launchConsole);}}};proto.clickHandler=function(e,me){var target=Event.getTarget(e);if(Dom.hasClass(target,'action')){Event.preventDefault(e);me.execAction(target);}};proto.execAction=function(a){var url=a.href;url+='?noredirect=1';Connect.asyncRequest('GET',url,this.callback,null);if(Dom.hasClass(a,'remove')){var row=Dom.getAncestorByTagName(Dom.getAncestorByClassName(a,'actions'),'li');this.main.removeChild(row);this.updateDom();}};proto.updateDom=function(){var main_children=Dom.getChildren(this.main);if(main_children.length===0){Dom.addClass(this.container,'empty');}else{if(main_children.length<5){var next_item=Dom.getFirstChild(this.backlog);if(next_item){var old_last=Dom.getLastChild(this.main);Dom.removeClass(old_last,'last');this.main.appendChild(next_item);}}}
var first=Dom.getFirstChild(this.main);if(!Dom.hasClass(first,'first')){Dom.addClass(first,'first');}
var last=Dom.getLastChild(this.main);if(!Dom.hasClass(last,'last')){Dom.addClass(last,'last');}};})();(function(){var Dom=JD.util.Dom;var Event=JD.util.Event;JD.Games.Expander=function(el){this.container=el;this.init();};var proto=JD.Games.Expander.prototype;proto.init=function(){this.toggle(false);var hd=Dom.getFirstChild(this.container);Event.addListener(hd,'click',this.clickHandler,this);};proto.clickHandler=function(e,me){me.toggle();};proto.toggle=function(expanded){if(Dom.hasClass(this.container,'collapsed')){Dom.removeClass(this.container,'collapsed');}else{Dom.addClass(this.container,'collapsed');}};})();(function(){var lists=JD.util.Dom.getElementsByClassName('nlist','div',document.body);var len=lists.length;for(var i=0;i<len;i++){lists[i]=new JD.Games.List(lists[i]);}
var expanders=JD.util.Dom.getElementsByClassName('expander','div',document.body);var len=expanders.length;for(var i=0;i<len;i++){expanders[i]=new JD.Games.Expander(expanders[i]);}})();JD.namespace('Games');JD.Games.FlyoutData=[];(function(){var D=JD.util.Dom;var E=JD.util.Event;JD.Games.Flyout=function(data){this.domNode=null;this.init(data);};var p=JD.Games.Flyout.prototype;p.init=function(data){if(typeof data==='undefined'){return false;}
var rankTitle='Overall Rank';if(data.genre!=='all'){rankTitle='Genre Rank';}
var tpl=D.get('flyout-template').innerHTML;tpl=tpl.replace(/{NAME}/g,data.name);tpl=tpl.replace(/{PLAY_URL}/g,data.playUrl);tpl=tpl.replace(/{DESCRIPTION}/g,data.shortDesc);tpl=tpl.replace(/{RANK}/g,data.rank);tpl=tpl.replace(/{RANK_CHANGE}/g,data.rankChange);tpl=tpl.replace(/{RANK_LAST_WEEK}/g,data.rankLastWeek);tpl=tpl.replace(/{IMAGE_URL}/g,data.imageUrl);tpl=tpl.replace(/{IMAGE_WIDTH}/g,data.imageWidth);tpl=tpl.replace(/{IMAGE_HEIGHT}/g,data.imageHeight);tpl=tpl.replace(/{RANK_TITLE}/g,rankTitle);if(parseInt(data.imageWidth)<212){tpl=tpl.replace(/{LETTERBOX}/g,'letterbox');}else{tpl=tpl.replace(/{LETTERBOX}/g,'');}
var rankChangeClass='';if(parseInt(data.rankChange)>0){rankChangeClass='up';}
tpl=tpl.replace('{RANK_CHANGE_CLASS}',rankChangeClass);this.domNode=document.createElement('div');this.domNode.className='flyout-wrapper';this.domNode.innerHTML=tpl;};p.appendTo=function(node){node.appendChild(this.domNode);E.addListener(this.domNode,'mouseout',this.mouseOutHandler,null,this);};p.show=function(){this.domNode.style.visibility='visible';};p.hide=function(){this.domNode.style.visibility='hidden';};p.alignTo=function(node){if(!node){console.log('JD,Games.Flyout.alignTo: Alignment node is not set!');return false;}
var toRegion=D.getRegion(node);var selfRegion=D.getRegion(this.domNode);var selfHeight=selfRegion.bottom-selfRegion.top-5;var tip=D.getElementsByClassName('tip','span',this.domNode)[0];if(tip){var tipRegion=D.getRegion(tip);var tipTop=Math.floor((selfHeight/2)-((tipRegion.bottom-tipRegion.top)/2));tip.style.top=tipTop+'px';}
var selfTop=Math.floor(toRegion.bottom-((toRegion.bottom-toRegion.top)/2)-(selfHeight/2));this.domNode.style.left=(toRegion.right+5)+'px';this.domNode.style.top=selfTop+'px';};p.mouseOutHandler=function(e){var target=E.getTarget(e);if(!D.hasClass(target,'flyout-wrapper')){target=D.getAncestorByClassName(target,'flyout-wrapper');}
var toNode=E.getRelatedTarget(e);if(toNode===target){return false;}
var div=D.getAncestorByClassName(toNode,'flyout-wrapper');if(div&&div===target){return false;}
this.hide();};})();(function(){var D=JD.util.Dom;var E=JD.util.Event;JD.Games.FlyoutList=function(el){if(!el||el.tagName!=='UL'){console.log('FlyoutList: el is not a UL element.');return false;}
this.el=el;this.flyoutIdSeed=1;this.flyouts=[];this.flyoutContainer=null;this.timeoutId=0;this.init();this.firstFlyout=true;};var p=JD.Games.FlyoutList.prototype;p.init=function(){this.flyoutContainer=document.createElement('div');this.flyoutContainer.id=this.el.id+'-flyouts';document.body.appendChild(this.flyoutContainer);var lis=this.el.getElementsByTagName('LI');for(var i in lis){E.addListener(lis[i],'mouseover',this.mouseOver,lis[i],this);E.addListener(lis[i],'mouseout',this.mouseOut,lis[i],this);}};p.mouseOver=function(e,obj){var target=E.getTarget(e);var related=E.getRelatedTarget(e);var li=D.getAncestorByTagName(related,'LI');if(li===obj){return false;}
if(target.tagName!=='LI'){target=D.getAncestorByTagName(target,'LI');}
this.showFlyout(target);};p.mouseOut=function(e,obj){var target=E.getTarget(e);if(target.tagName!=='LI'){target=D.getAncestorByTagName(target,'LI');}
if(!this.isNodeWithin(target,E.getRelatedTarget(e))){this.hideFlyout(target);}};p.isNodeWithin=function(target,testNode){var li=D.getAncestorByTagName(testNode,'LI');if(li===target){return true;}
var id=target.getAttribute('data-ygames-flyout-id');if(id&&this.flyouts[id]){if(D.isAncestor(this.flyouts[id].domNode,testNode)){return true;}}
return false;};p.getFlyoutId=function(){return this.el.id+'-flyout'+this.flyoutIdSeed++;};p.showFlyout=function(target){for(var i in this.flyouts){this.flyouts[i].hide();}
var gameRef=target.getAttribute('data-ref');var id=target.getAttribute('data-ygames-flyout-id');if(!this.flyouts[id]){id=this.getFlyoutId();target.setAttribute('data-ygames-flyout-id',id);this.flyouts[id]=new JD.Games.Flyout(JD.Games.FlyoutData[this.el.id][gameRef]);if(this.flyouts[id].domNode===null){delete(this.flyouts[id]);return false;}
if(D.hasClass(target,'tagged')){D.addClass(this.flyouts[id].domNode,'tagged');}
if(D.hasClass(target,'unranked')||this.el.getAttribute('data-editorial')==='1'){D.addClass(this.flyouts[id].domNode,'unranked');}
this.flyouts[id].appendTo(this.flyoutContainer);}
this.flyouts[id].alignTo(target);var f=this.flyouts[id];var callShow=function(){f.show();};var delay=125;if(this.firstFlyout){delay=250;this.firstFlyout=false;}
this.timeoutId=window.setTimeout(callShow,delay);};p.hideFlyout=function(target){window.clearTimeout(this.timeoutId);var id=target.getAttribute('data-ygames-flyout-id');if(this.flyouts[id]){this.flyouts[id].hide();}};})();JD.namespace('Games.controls');(function(){var D=JD.util.Dom;var E=JD.util.Event;JD.Games.controls.PickerOption=function(text,value){this.text=text;this.value=value;};JD.Games.controls.Picker=function(options){this.options=options;this.selectedIndex=0;this.fadeDelay=0.25;this.setupDom();};var p=JD.Games.controls.Picker.prototype;p.setupDom=function(){var opts=[];var seps=[];for(var x in this.options){if(this.options[x].text==='--'&&this.options[x].value===null){seps.push(x-1);}else{opts.push(this.options[x]);}}
this.options=opts;this.domNode=document.createElement('div');this.domNode.className='picker';var html='<a class="selector" href="#"><span class="button"></span><em>'+this.options[this.selectedIndex].text+'</em></a><div class="options hidden"><ul>';var len=this.options.length;var sep_len=seps.length;for(var x=0;x<len;x++){var classes=[];if(x==this.selectedIndex){classes.push('selected');}
if(x==0){classes.push('first');}
if(x==(len-1)){classes.push('last');}
for(var j=0;j<sep_len;j++){if(x==seps[j]){classes.push('separator');break;}}
html+='<li class="'+classes.join(' ')+'"><a href="#" data-index="'+x+'">'+this.options[x].text+'</a></li>';}
html+='</ul></div>';this.domNode.innerHTML=html;};p.init=function(){this.optionsNode=D.getElementsByClassName('options','div',this.domNode)[0];this.textNode=this.domNode.getElementsByTagName('em')[0];E.on(this.domNode,'click',this.clickHandler,null,this);this.onChange=new JD.util.CustomEvent('onChange');this.optionsNode.style.opacity='0';this.fadeIn=new JD.util.Anim(this.optionsNode,{opacity:{from:0,to:1}},this.fadeDelay,JD.util.Easing.easeIn);this.fadeOut=new JD.util.Anim(this.optionsNode,{opacity:{to:0}},this.fadeDelay,JD.util.Easing.easeOut);var optNode=this.optionsNode;this.fadeOut.onComplete.subscribe(function(){D.addClass(optNode,'hidden');});this.align();};p.align=function(){var r=D.getRegion(this.domNode);var s=this.optionsNode.style;s.top=r.bottom+2+'px';s.left=r.left+'px';s.width=(r.right-r.left)+'px';};p.toggleOptions=function(){this.align();if(D.hasClass(this.optionsNode,'hidden')){D.removeClass(this.optionsNode,'hidden');this.fadeIn.animate();}else{this.fadeOut.animate();}};p.clickHandler=function(e){var target=E.getTarget(e);E.stopEvent(e);var opts=D.getAncestorByClassName(target,'options');if(opts){var index=parseInt(target.getAttribute('data-index'));if(this.selectedIndex!==index){this.selectedIndex=index;this.textNode.innerHTML=this.options[this.selectedIndex].text;var lis=this.optionsNode.getElementsByTagName('li');var len=lis.length;for(var x=0;x<len;x++){if(x===this.selectedIndex){D.addClass(lis[x],'selected');}else{D.removeClass(lis[x],'selected');}}
this.onChange.fire(this.getValue());}}
this.toggleOptions();};p.getValue=function(){return this.options[this.selectedIndex].value;};})();JD.namespace('Games.controls');(function(){var D=JD.util.Dom;JD.Games.controls.Swapper=function(el,picker){this.domNode=el;this.picker=picker;if(picker){picker.onChange.subscribe(this.handleOnChange,this);}
this.init();};var p=JD.Games.controls.Swapper.prototype;p.init=function(){this.swap(this.picker.getValue());};p.handleOnChange=function(type,args,me){me.swap(args[0]);};p.swap=function(index){var divs=this.domNode.getElementsByTagName('div');var len=divs.length;for(var x=0;x<len;x++){if(x===index){D.addClass(divs[x],'selected');}else{D.removeClass(divs[x],'selected');}}};})();
