/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.6.0
*/
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={}}YAHOO.namespace=function(){var F=arguments,G=null,I,J,H;for(I=0;I<F.length;I=I+1){H=F[I].split(".");G=YAHOO;for(J=(H[0]=="YAHOO")?1:0;J<H.length;J=J+1){G[H[J]]=G[H[J]]||{};G=G[H[J]]}}return G};YAHOO.log=function(F,E,G){var H=YAHOO.widget.Logger;if(H&&H.log){return H.log(F,E,G)}else{return false}};YAHOO.register=function(M,R,J){var N=YAHOO.env.modules;if(!N[M]){N[M]={versions:[],builds:[]}}var L=N[M],O=J.version,P=J.build,Q=YAHOO.env.listeners;L.name=M;L.version=O;L.build=P;L.versions.push(O);L.builds.push(P);L.mainClass=R;for(var K=0;K<Q.length;K=K+1){Q[K](L)}if(R){R.VERSION=O;R.BUILD=P}else{YAHOO.log("mainClass is undefined for module "+M,"warn")}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(B){return YAHOO.env.modules[B]||null};YAHOO.env.ua=function(){var E={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0};var F=navigator.userAgent,D;if((/KHTML/).test(F)){E.webkit=1}D=F.match(/AppleWebKit\/([^\s]*)/);if(D&&D[1]){E.webkit=parseFloat(D[1]);if(/ Mobile\//.test(F)){E.mobile="Apple"}else{D=F.match(/NokiaN[^\/]*/);if(D){E.mobile=D[0]}}D=F.match(/AdobeAIR\/([^\s]*)/);if(D){E.air=D[0]}}if(!E.webkit){D=F.match(/Opera[\s\/]([^\s]*)/);if(D&&D[1]){E.opera=parseFloat(D[1]);D=F.match(/Opera Mini[^;]*/);if(D){E.mobile=D[0]}}else{D=F.match(/MSIE\s([^;]*)/);if(D&&D[1]){E.ie=parseFloat(D[1])}else{D=F.match(/Gecko\/([^\s]*)/);if(D){E.gecko=1;D=F.match(/rv:([^\s\)]*)/);if(D&&D[1]){E.gecko=parseFloat(D[1])}}}}}return E}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var H=YAHOO_config.listener,E=YAHOO.env.listeners,F=true,G;if(H){for(G=0;G<E.length;G=G+1){if(E[G]==H){F=false;break}}if(F){E.push(H)}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var D=YAHOO.lang,E=["toString","valueOf"],F={isArray:function(A){if(A){return D.isNumber(A.length)&&D.isFunction(A.splice)}return false},isBoolean:function(A){return typeof A==="boolean"},isFunction:function(A){return typeof A==="function"},isNull:function(A){return A===null},isNumber:function(A){return typeof A==="number"&&isFinite(A)},isObject:function(A){return(A&&(typeof A==="object"||D.isFunction(A)))||false},isString:function(A){return typeof A==="string"},isUndefined:function(A){return typeof A==="undefined"},_IEEnumFix:(YAHOO.env.ua.ie)?function(C,I){for(var J=0;J<E.length;J=J+1){var A=E[J],B=I[A];if(D.isFunction(B)&&B!=Object.prototype[A]){C[A]=B}}}:function(){},extend:function(B,A,C){if(!A||!B){throw new Error("extend failed, please check that all dependencies are included.")}var J=function(){};J.prototype=A.prototype;B.prototype=new J();B.prototype.constructor=B;B.superclass=A.prototype;if(A.prototype.constructor==Object.prototype.constructor){A.prototype.constructor=A}if(C){for(var K in C){if(D.hasOwnProperty(C,K)){B.prototype[K]=C[K]}}D._IEEnumFix(B.prototype,C)}},augmentObject:function(B,C){if(!C||!B){throw new Error("Absorb failed, verify dependencies.")}var L=arguments,J,A,K=L[2];if(K&&K!==true){for(J=2;J<L.length;J=J+1){B[L[J]]=C[L[J]]}}else{for(A in C){if(K||!(A in B)){B[A]=C[A]}}D._IEEnumFix(B,C)}},augmentProto:function(A,B){if(!B||!A){throw new Error("Augment failed, verify dependencies.")}var H=[A.prototype,B.prototype];for(var C=2;C<arguments.length;C=C+1){H.push(arguments[C])}D.augmentObject.apply(this,H)},dump:function(A,N){var Q,O,C=[],B="{...}",R="f(){...}",M=", ",P=" => ";if(!D.isObject(A)){return A+""}else{if(A instanceof Date||("nodeType" in A&&"tagName" in A)){return A}else{if(D.isFunction(A)){return R}}}N=(D.isNumber(N))?N:3;if(D.isArray(A)){C.push("[");for(Q=0,O=A.length;Q<O;Q=Q+1){if(D.isObject(A[Q])){C.push((N>0)?D.dump(A[Q],N-1):B)}else{C.push(A[Q])}C.push(M)}if(C.length>1){C.pop()}C.push("]")}else{C.push("{");for(Q in A){if(D.hasOwnProperty(A,Q)){C.push(Q+P);if(D.isObject(A[Q])){C.push((N>0)?D.dump(A[Q],N-1):B)}else{C.push(A[Q])}C.push(M)}}if(C.length>1){C.pop()}C.push("}")}return C.join("")},substitute:function(B,g,Y){var b,c,d,V,U,C,W=[],f,a="dump",X=" ",A="{",T="}";for(;;){b=B.lastIndexOf(A);if(b<0){break}c=B.indexOf(T,b);if(b+1>=c){break}f=B.substring(b+1,c);V=f;C=null;d=V.indexOf(X);if(d>-1){C=V.substring(d+1);V=V.substring(0,d)}U=g[V];if(Y){U=Y(V,U,C)}if(D.isObject(U)){if(D.isArray(U)){U=D.dump(U,parseInt(C,10))}else{C=C||"";var Z=C.indexOf(a);if(Z>-1){C=C.substring(4)}if(U.toString===Object.prototype.toString||Z>-1){U=D.dump(U,parseInt(C,10))}else{U=U.toString()}}}else{if(!D.isString(U)&&!D.isNumber(U)){U="~-"+W.length+"-~";W[W.length]=f}}B=B.substring(0,b)+U+B.substring(c+1)}for(b=W.length-1;b>=0;b=b-1){B=B.replace(new RegExp("~-"+b+"-~"),"{"+W[b]+"}","g")}return B},trim:function(B){try{return B.replace(/^\s+|\s+$/g,"")}catch(A){return B}},merge:function(){var A={},C=arguments;for(var B=0,H=C.length;B<H;B=B+1){D.augmentObject(A,C[B],true)}return A},later:function(C,R,B,P,O){C=C||0;R=R||{};var Q=B,M=P,N,A;if(D.isString(B)){Q=R[B]}if(!Q){throw new TypeError("method undefined")}if(!D.isArray(M)){M=[P]}N=function(){Q.apply(R,M)};A=(O)?setInterval(N,C):setTimeout(N,C);return{interval:O,cancel:function(){if(this.interval){clearInterval(A)}else{clearTimeout(A)}}}},isValue:function(A){return(D.isObject(A)||D.isString(A)||D.isNumber(A)||D.isBoolean(A))}};D.hasOwnProperty=(Object.prototype.hasOwnProperty)?function(B,A){return B&&B.hasOwnProperty(A)}:function(B,A){return !D.isUndefined(B[A])&&B.constructor.prototype[A]!==B[A]};F.augmentObject(D,F,true);YAHOO.util.Lang=D;D.augment=D.augmentProto;YAHOO.augment=D.augmentProto;YAHOO.extend=D.extend})();YAHOO.register("yahoo",YAHOO,{version:"2.6.0",build:"1321"});(function(){var S=YAHOO.util,f=YAHOO.lang,Y,a,Z={},d={},W=window.document;YAHOO.env._id_counter=YAHOO.env._id_counter||0;var R=YAHOO.env.ua.opera,X=YAHOO.env.ua.webkit,T=YAHOO.env.ua.gecko,c=YAHOO.env.ua.ie;var g={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i,OP_SCROLL:/^(?:inline|table-row)$/i};var V=function(B){if(!g.HYPHEN.test(B)){return B}if(Z[B]){return Z[B]}var A=B;while(g.HYPHEN.exec(A)){A=A.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase())}Z[B]=A;return A};var U=function(A){var B=d[A];if(!B){B=new RegExp("(?:^|\\s+)"+A+"(?:\\s+|$)");d[A]=B}return B};if(W.defaultView&&W.defaultView.getComputedStyle){Y=function(D,A){var B=null;if(A=="float"){A="cssFloat"}var C=D.ownerDocument.defaultView.getComputedStyle(D,"");if(C){B=C[V(A)]}return D.style[A]||B}}else{if(W.documentElement.currentStyle&&c){Y=function(E,C){switch(V(C)){case"opacity":var A=100;try{A=E.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(B){try{A=E.filters("alpha").opacity}catch(B){}}return A/100;case"float":C="styleFloat";default:var D=E.currentStyle?E.currentStyle[C]:null;return(E.style[C]||D)}}}else{Y=function(B,A){return B.style[A]}}}if(c){a=function(C,B,A){switch(B){case"opacity":if(f.isString(C.style.filter)){C.style.filter="alpha(opacity="+A*100+")";if(!C.currentStyle||!C.currentStyle.hasLayout){C.style.zoom=1}}break;case"float":B="styleFloat";default:C.style[B]=A}}}else{a=function(C,B,A){if(B=="float"){B="cssFloat"}C.style[B]=A}}var Q=function(B,A){return B&&B.nodeType==1&&(!A||A(B))};YAHOO.util.Dom={get:function(B){if(B){if(B.nodeType||B.item){return B}if(typeof B==="string"){return W.getElementById(B)}if("length" in B){var A=[];for(var C=0,D=B.length;C<D;++C){A[A.length]=S.Dom.get(B[C])}return A}return B}return null},getStyle:function(C,A){A=V(A);var B=function(D){return Y(D,A)};return S.Dom.batch(C,B,S.Dom,true)},setStyle:function(D,B,A){B=V(B);var C=function(E){a(E,B,A)};S.Dom.batch(D,C,S.Dom,true)},getXY:function(B){var A=function(C){if((C.parentNode===null||C.offsetParent===null||this.getStyle(C,"display")=="none")&&C!=C.ownerDocument.body){return false}return b(C)};return S.Dom.batch(B,A,S.Dom,true)},getX:function(B){var A=function(C){return S.Dom.getXY(C)[0]};return S.Dom.batch(B,A,S.Dom,true)},getY:function(B){var A=function(C){return S.Dom.getXY(C)[1]};return S.Dom.batch(B,A,S.Dom,true)},setXY:function(D,A,B){var C=function(E){var F=this.getStyle(E,"position");if(F=="static"){this.setStyle(E,"position","relative");F="relative"}var H=this.getXY(E);if(H===false){return false}var I=[parseInt(this.getStyle(E,"left"),10),parseInt(this.getStyle(E,"top"),10)];if(isNaN(I[0])){I[0]=(F=="relative")?0:E.offsetLeft}if(isNaN(I[1])){I[1]=(F=="relative")?0:E.offsetTop}if(A[0]!==null){E.style.left=A[0]-H[0]+I[0]+"px"}if(A[1]!==null){E.style.top=A[1]-H[1]+I[1]+"px"}if(!B){var G=this.getXY(E);if((A[0]!==null&&G[0]!=A[0])||(A[1]!==null&&G[1]!=A[1])){this.setXY(E,A,true)}}};S.Dom.batch(D,C,S.Dom,true)},setX:function(A,B){S.Dom.setXY(A,[B,null])},setY:function(B,A){S.Dom.setXY(B,[null,A])},getRegion:function(B){var A=function(D){if((D.parentNode===null||D.offsetParent===null||this.getStyle(D,"display")=="none")&&D!=D.ownerDocument.body){return false}var C=S.Region.getRegion(D);return C};return S.Dom.batch(B,A,S.Dom,true)},getClientWidth:function(){return S.Dom.getViewportWidth()},getClientHeight:function(){return S.Dom.getViewportHeight()},getElementsByClassName:function(E,A,D,C){E=f.trim(E);A=A||"*";D=(D)?S.Dom.get(D):null||W;if(!D){return[]}var H=[],I=D.getElementsByTagName(A),B=U(E);for(var G=0,F=I.length;G<F;++G){if(B.test(I[G].className)){H[H.length]=I[G];if(C){C.call(I[G],I[G])}}}return H},hasClass:function(B,C){var D=U(C);var A=function(E){return D.test(E.className)};return S.Dom.batch(B,A,S.Dom,true)},addClass:function(B,C){var A=function(D){if(this.hasClass(D,C)){return false}D.className=f.trim([D.className,C].join(" "));return true};return S.Dom.batch(B,A,S.Dom,true)},removeClass:function(B,C){var D=U(C);var A=function(E){var F=false,H=E.className;if(C&&H&&this.hasClass(E,C)){E.className=H.replace(D," ");if(this.hasClass(E,C)){this.removeClass(E,C)}E.className=f.trim(E.className);if(E.className===""){var G=(E.hasAttribute)?"class":"className";E.removeAttribute(G)}F=true}return F};return S.Dom.batch(B,A,S.Dom,true)},replaceClass:function(B,D,E){if(!E||D===E){return false}var C=U(D);var A=function(F){if(!this.hasClass(F,D)){this.addClass(F,E);return true}F.className=F.className.replace(C," "+E+" ");if(this.hasClass(F,D)){this.removeClass(F,D)}F.className=f.trim(F.className);return true};return S.Dom.batch(B,A,S.Dom,true)},generateId:function(C,A){A=A||"yui-gen";var B=function(E){if(E&&E.id){return E.id}var D=A+YAHOO.env._id_counter++;if(E){E.id=D}return D};return S.Dom.batch(C,B,S.Dom,true)||B.apply(S.Dom,arguments)},isAncestor:function(B,A){B=S.Dom.get(B);A=S.Dom.get(A);var C=false;if((B&&A)&&(B.nodeType&&A.nodeType)){if(B.contains&&B!==A){C=B.contains(A)}else{if(B.compareDocumentPosition){C=!!(B.compareDocumentPosition(A)&16)}}}else{}return C},inDocument:function(A){return this.isAncestor(W.documentElement,A)},getElementsBy:function(H,F,E,C){F=F||"*";E=(E)?S.Dom.get(E):null||W;if(!E){return[]}var D=[],A=E.getElementsByTagName(F);for(var B=0,G=A.length;B<G;++B){if(H(A[B])){D[D.length]=A[B];if(C){C(A[B])}}}return D},batch:function(C,H,A,E){C=(C&&(C.tagName||C.item))?C:S.Dom.get(C);if(!C||!H){return false}var D=(E)?A:window;if(C.tagName||C.length===undefined){return H.call(D,C,A)}var B=[];for(var F=0,G=C.length;F<G;++F){B[B.length]=H.call(D,C[F],A)}return B},getDocumentHeight:function(){var A=(W.compatMode!="CSS1Compat")?W.body.scrollHeight:W.documentElement.scrollHeight;var B=Math.max(A,S.Dom.getViewportHeight());return B},getDocumentWidth:function(){var A=(W.compatMode!="CSS1Compat")?W.body.scrollWidth:W.documentElement.scrollWidth;var B=Math.max(A,S.Dom.getViewportWidth());return B},getViewportHeight:function(){var B=self.innerHeight;var A=W.compatMode;if((A||c)&&!R){B=(A=="CSS1Compat")?W.documentElement.clientHeight:W.body.clientHeight}return B},getViewportWidth:function(){var B=self.innerWidth;var A=W.compatMode;if(A||c){B=(A=="CSS1Compat")?W.documentElement.clientWidth:W.body.clientWidth}return B},getAncestorBy:function(B,A){while((B=B.parentNode)){if(Q(B,A)){return B}}return null},getAncestorByClassName:function(B,C){B=S.Dom.get(B);if(!B){return null}var A=function(D){return S.Dom.hasClass(D,C)};return S.Dom.getAncestorBy(B,A)},getAncestorByTagName:function(B,C){B=S.Dom.get(B);if(!B){return null}var A=function(D){return D.tagName&&D.tagName.toUpperCase()==C.toUpperCase()};return S.Dom.getAncestorBy(B,A)},getPreviousSiblingBy:function(B,A){while(B){B=B.previousSibling;if(Q(B,A)){return B}}return null},getPreviousSibling:function(A){A=S.Dom.get(A);if(!A){return null}return S.Dom.getPreviousSiblingBy(A)},getNextSiblingBy:function(B,A){while(B){B=B.nextSibling;if(Q(B,A)){return B}}return null},getNextSibling:function(A){A=S.Dom.get(A);if(!A){return null}return S.Dom.getNextSiblingBy(A)},getFirstChildBy:function(C,A){var B=(Q(C.firstChild,A))?C.firstChild:null;return B||S.Dom.getNextSiblingBy(C.firstChild,A)},getFirstChild:function(B,A){B=S.Dom.get(B);if(!B){return null}return S.Dom.getFirstChildBy(B)},getLastChildBy:function(C,A){if(!C){return null}var B=(Q(C.lastChild,A))?C.lastChild:null;return B||S.Dom.getPreviousSiblingBy(C.lastChild,A)},getLastChild:function(A){A=S.Dom.get(A);return S.Dom.getLastChildBy(A)},getChildrenBy:function(C,A){var B=S.Dom.getFirstChildBy(C,A);var D=B?[B]:[];S.Dom.getNextSiblingBy(B,function(E){if(!A||A(E)){D[D.length]=E}return false});return D},getChildren:function(A){A=S.Dom.get(A);if(!A){}return S.Dom.getChildrenBy(A)},getDocumentScrollLeft:function(A){A=A||W;return Math.max(A.documentElement.scrollLeft,A.body.scrollLeft)},getDocumentScrollTop:function(A){A=A||W;return Math.max(A.documentElement.scrollTop,A.body.scrollTop)},insertBefore:function(A,B){A=S.Dom.get(A);B=S.Dom.get(B);if(!A||!B||!B.parentNode){return null}return B.parentNode.insertBefore(A,B)},insertAfter:function(A,B){A=S.Dom.get(A);B=S.Dom.get(B);if(!A||!B||!B.parentNode){return null}if(B.nextSibling){return B.parentNode.insertBefore(A,B.nextSibling)}else{return B.parentNode.appendChild(A)}},getClientRegion:function(){var B=S.Dom.getDocumentScrollTop(),C=S.Dom.getDocumentScrollLeft(),A=S.Dom.getViewportWidth()+C,D=S.Dom.getViewportHeight()+B;return new S.Region(B,A,D,C)}};var b=function(){if(W.documentElement.getBoundingClientRect){return function(B){var A=B.getBoundingClientRect(),C=Math.round;var D=B.ownerDocument;return[C(A.left+S.Dom.getDocumentScrollLeft(D)),C(A.top+S.Dom.getDocumentScrollTop(D))]}}else{return function(B){var A=[B.offsetLeft,B.offsetTop];var C=B.offsetParent;var D=(X&&S.Dom.getStyle(B,"position")=="absolute"&&B.offsetParent==B.ownerDocument.body);if(C!=B){while(C){A[0]+=C.offsetLeft;A[1]+=C.offsetTop;if(!D&&X&&S.Dom.getStyle(C,"position")=="absolute"){D=true}C=C.offsetParent}}if(D){A[0]-=B.ownerDocument.body.offsetLeft;A[1]-=B.ownerDocument.body.offsetTop}C=B.parentNode;while(C.tagName&&!g.ROOT_TAG.test(C.tagName)){if(C.scrollTop||C.scrollLeft){A[0]-=C.scrollLeft;A[1]-=C.scrollTop}C=C.parentNode}return A}}}()})();YAHOO.util.Region=function(G,F,E,H){this.top=G;this[1]=G;this.right=F;this.bottom=E;this.left=H;this[0]=H};YAHOO.util.Region.prototype.contains=function(B){return(B.left>=this.left&&B.right<=this.right&&B.top>=this.top&&B.bottom<=this.bottom)};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left))};YAHOO.util.Region.prototype.intersect=function(G){var I=Math.max(this.top,G.top);var H=Math.min(this.right,G.right);var F=Math.min(this.bottom,G.bottom);var J=Math.max(this.left,G.left);if(F>=I&&H>=J){return new YAHOO.util.Region(I,H,F,J)}else{return null}};YAHOO.util.Region.prototype.union=function(G){var I=Math.min(this.top,G.top);var H=Math.max(this.right,G.right);var F=Math.max(this.bottom,G.bottom);var J=Math.min(this.left,G.left);return new YAHOO.util.Region(I,H,F,J)};YAHOO.util.Region.prototype.toString=function(){return("Region {top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}")};YAHOO.util.Region.getRegion=function(J){var H=YAHOO.util.Dom.getXY(J);var K=H[1];var I=H[0]+J.offsetWidth;var G=H[1]+J.offsetHeight;var L=H[0];return new YAHOO.util.Region(K,I,G,L)};YAHOO.util.Point=function(C,D){if(YAHOO.lang.isArray(C)){D=C[1];C=C[0]}this.x=this.right=this.left=this[0]=C;this.y=this.top=this.bottom=this[1]=D};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.6.0",build:"1321"});YAHOO.util.CustomEvent=function(H,J,I,F){this.type=H;this.scope=J||window;this.silent=I;this.signature=F||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var G="_YUICEOnSubscribe";if(H!==G){this.subscribeEvent=new YAHOO.util.CustomEvent(G,this,true)}this.lastError=null};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(F,E,D){if(!F){throw new Error("Invalid callback for subscriber to '"+this.type+"'")}if(this.subscribeEvent){this.subscribeEvent.fire(F,E,D)}this.subscribers.push(new YAHOO.util.Subscriber(F,E,D))},unsubscribe:function(J,H){if(!J){return this.unsubscribeAll()}var I=false;for(var L=0,G=this.subscribers.length;L<G;++L){var K=this.subscribers[L];if(K&&K.contains(J,H)){this._delete(L);I=true}}return I},fire:function(){this.lastError=null;var T=[],Z=this.subscribers.length;if(!Z&&this.silent){return true}var V=[].slice.call(arguments,0),X=true,N,U=false;if(!this.silent){}var O=this.subscribers.slice(),Q=YAHOO.util.Event.throwErrors;for(N=0;N<Z;++N){var R=O[N];if(!R){U=true}else{if(!this.silent){}var S=R.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var P=null;if(V.length>0){P=V[0]}try{X=R.fn.call(S,P,R.obj)}catch(Y){this.lastError=Y;if(Q){throw Y}}}else{try{X=R.fn.call(S,this.type,V,R.obj)}catch(W){this.lastError=W;if(Q){throw W}}}if(false===X){if(!this.silent){}break}}}return(X!==false)},unsubscribeAll:function(){for(var B=this.subscribers.length-1;B>-1;B--){this._delete(B)}this.subscribers=[];return B},_delete:function(C){var D=this.subscribers[C];if(D){delete D.fn;delete D.obj}this.subscribers.splice(C,1)},toString:function(){return"CustomEvent: '"+this.type+"', scope: "+this.scope}};YAHOO.util.Subscriber=function(F,E,D){this.fn=F;this.obj=YAHOO.lang.isUndefined(E)?null:E;this.override=D};YAHOO.util.Subscriber.prototype.getScope=function(B){if(this.override){if(this.override===true){return this.obj}else{return this.override}}return B};YAHOO.util.Subscriber.prototype.contains=function(C,D){if(D){return(this.fn==C&&this.obj==D)}else{return(this.fn==C)}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }"};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var U=false;var T=[];var S=[];var V=[];var X=[];var N=0;var W=[];var O=[];var P=0;var M={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var R=YAHOO.env.ua.ie?"focusin":"focus";var Q=YAHOO.env.ua.ie?"focusout":"blur";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,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var B=this;var A=function(){B._tryPreloadAttach()};this._interval=setInterval(A,this.POLL_INTERVAL)}},onAvailable:function(B,E,A,C,D){var G=(YAHOO.lang.isString(B))?[B]:B;for(var F=0;F<G.length;F=F+1){W.push({id:G[F],fn:E,obj:A,override:C,checkReady:D})}N=this.POLL_RETRYS;this.startInterval()},onContentReady:function(B,D,A,C){this.onAvailable(B,D,A,C,true)},onDOMReady:function(C,A,B){if(this.DOMReady){setTimeout(function(){var D=window;if(B){if(B===true){D=A}else{D=B}}C.call(D,"DOMReady",[],A)},0)}else{this.DOMReadyEvent.subscribe(C,A,B)}},_addListener:function(L,d,C,H,c,g){if(!C||!C.call){return false}if(this._isValidCollection(L)){var B=true;for(var G=0,E=L.length;G<E;++G){B=this._addListener(L[G],d,C,H,c,g)&&B}return B}else{if(YAHOO.lang.isString(L)){var I=this.getEl(L);if(I){L=I}else{this.onAvailable(L,function(){YAHOO.util.Event._addListener(L,d,C,H,c,g)});return true}}}if(!L){return false}if("unload"==d&&H!==this){S[S.length]=[L,d,C,H,c,g];return true}var f=L;if(c){if(c===true){f=H}else{f=c}}var K=function(Y){return C.call(f,YAHOO.util.Event.getEvent(Y,L),H)};var A=[L,d,C,K,f,H,c,g];var F=T.length;T[F]=A;if(this.useLegacyEvent(L,d)){var J=this.getLegacyIndex(L,d);if(J==-1||L!=V[J][0]){J=V.length;O[L.id+d]=J;V[J]=[L,d,L["on"+d]];X[J]=[];L["on"+d]=function(Y){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(Y),J)}}X[J].push(A)}else{try{this._simpleAdd(L,d,K,g)}catch(D){this.lastError=D;this._removeListener(L,d,C,g);return false}}return true},addListener:function(C,A,D,B,E){return this._addListener(C,A,D,B,E,false)},addFocusListener:function(B,C,A,D){return this._addListener(B,R,C,A,D,true)},removeFocusListener:function(A,B){return this._removeListener(A,R,B,true)},addBlurListener:function(B,C,A,D){return this._addListener(B,Q,C,A,D,true)},removeBlurListener:function(A,B){return this._removeListener(A,Q,B,true)},fireLegacyEvent:function(F,H){var D=true,J,B,C,A,E;B=X[H].slice();for(var I=0,G=B.length;I<G;++I){C=B[I];if(C&&C[this.WFN]){A=C[this.ADJ_SCOPE];E=C[this.WFN].call(A,F);D=(D&&E)}}J=V[H];if(J&&J[2]){J[2](F)}return D},getLegacyIndex:function(B,A){var C=this.generateId(B)+A;if(typeof O[C]=="undefined"){return -1}else{return O[C]}},useLegacyEvent:function(B,A){return(this.webkit&&this.webkit<419&&("click"==A||"dblclick"==A))},_removeListener:function(L,Z,D,A){var I,F,B;if(typeof L=="string"){L=this.getEl(L)}else{if(this._isValidCollection(L)){var C=true;for(I=L.length-1;I>-1;I--){C=(this._removeListener(L[I],Z,D,A)&&C)}return C}}if(!D||!D.call){return this.purgeElement(L,false,Z)}if("unload"==Z){for(I=S.length-1;I>-1;I--){B=S[I];if(B&&B[0]==L&&B[1]==Z&&B[2]==D){S.splice(I,1);return true}}return false}var H=null;var G=arguments[4];if("undefined"===typeof G){G=this._getCacheIndex(L,Z,D)}if(G>=0){H=T[G]}if(!L||!H){return false}if(this.useLegacyEvent(L,Z)){var J=this.getLegacyIndex(L,Z);var K=X[J];if(K){for(I=0,F=K.length;I<F;++I){B=K[I];if(B&&B[this.EL]==L&&B[this.TYPE]==Z&&B[this.FN]==D){K.splice(I,1);break}}}}else{try{this._simpleRemove(L,Z,H[this.WFN],A)}catch(E){this.lastError=E;return false}}delete T[G][this.WFN];delete T[G][this.FN];T.splice(G,1);return true},removeListener:function(B,A,C){return this._removeListener(B,A,C,false)},getTarget:function(A,B){var C=A.target||A.srcElement;return this.resolveTextNode(C)},resolveTextNode:function(A){try{if(A&&3==A.nodeType){return A.parentNode}}catch(B){}return A},getPageX:function(A){var B=A.pageX;if(!B&&0!==B){B=A.clientX||0;if(this.isIE){B+=this._getScrollLeft()}}return B},getPageY:function(B){var A=B.pageY;if(!A&&0!==A){A=B.clientY||0;if(this.isIE){A+=this._getScrollTop()}}return A},getXY:function(A){return[this.getPageX(A),this.getPageY(A)]},getRelatedTarget:function(A){var B=A.relatedTarget;if(!B){if(A.type=="mouseout"){B=A.toElement}else{if(A.type=="mouseover"){B=A.fromElement}}}return this.resolveTextNode(B)},getTime:function(A){if(!A.time){var B=new Date().getTime();try{A.time=B}catch(C){this.lastError=C;return B}}return A.time},stopEvent:function(A){this.stopPropagation(A);this.preventDefault(A)},stopPropagation:function(A){if(A.stopPropagation){A.stopPropagation()}else{A.cancelBubble=true}},preventDefault:function(A){if(A.preventDefault){A.preventDefault()}else{A.returnValue=false}},getEvent:function(B,D){var C=B||window.event;if(!C){var A=this.getEvent.caller;while(A){C=A.arguments[0];if(C&&Event==C.constructor){break}A=A.caller}}return C},getCharCode:function(A){var B=A.keyCode||A.charCode||0;if(YAHOO.env.ua.webkit&&(B in M)){B=M[B]}return B},_getCacheIndex:function(B,A,C){for(var D=0,E=T.length;D<E;D=D+1){var F=T[D];if(F&&F[this.FN]==C&&F[this.EL]==B&&F[this.TYPE]==A){return D}}return -1},generateId:function(B){var A=B.id;if(!A){A="yuievtautoid-"+P;++P;B.id=A}return A},_isValidCollection:function(A){try{return(A&&typeof A!=="string"&&A.length&&!A.tagName&&!A.alert&&typeof A[0]!=="undefined")}catch(B){return false}},elCache:{},getEl:function(A){return(typeof A==="string")?document.getElementById(A):A},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(A){if(!U){U=true;var B=YAHOO.util.Event;B._ready();B._tryPreloadAttach()}},_ready:function(A){var B=YAHOO.util.Event;if(!B.DOMReady){B.DOMReady=true;B.DOMReadyEvent.fire();B._simpleRemove(document,"DOMContentLoaded",B._ready)}},_tryPreloadAttach:function(){if(W.length===0){N=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 B=!U;if(!B){B=(N>0&&W.length>0)}var C=[];var A=function(J,I){var K=J;if(I.override){if(I.override===true){K=I.obj}else{K=I.override}}I.fn.call(K,I.obj)};var G,H,D,E,F=[];for(G=0,H=W.length;G<H;G=G+1){D=W[G];if(D){E=this.getEl(D.id);if(E){if(D.checkReady){if(U||E.nextSibling||!B){F.push(D);W[G]=null}}else{A(E,D);W[G]=null}}else{C.push(D)}}}for(G=0,H=F.length;G<H;G=G+1){D=F[G];A(this.getEl(D.id),D)}N--;if(B){for(G=W.length-1;G>-1;G--){D=W[G];if(!D||!D.id){W.splice(G,1)}}this.startInterval()}else{clearInterval(this._interval);this._interval=null}this.locked=false},purgeElement:function(D,C,A){var F=(YAHOO.lang.isString(D))?this.getEl(D):D;var B=this.getListeners(F,A),E,H;if(B){for(E=B.length-1;E>-1;E--){var G=B[E];this._removeListener(F,G.type,G.fn,G.capture)}}if(C&&F&&F.childNodes){for(E=0,H=F.childNodes.length;E<H;++E){this.purgeElement(F.childNodes[E],C,A)}}},getListeners:function(H,J){var E=[],I;if(!J){I=[T,S]}else{if(J==="unload"){I=[S]}else{I=[T]}}var C=(YAHOO.lang.isString(H))?this.getEl(H):H;for(var F=0;F<I.length;F=F+1){var A=I[F];if(A){for(var D=0,B=A.length;D<B;++D){var G=A[D];if(G&&G[this.EL]===C&&(!J||J===G[this.TYPE])){E.push({type:G[this.TYPE],fn:G[this.FN],obj:G[this.OBJ],adjust:G[this.OVERRIDE],scope:G[this.ADJ_SCOPE],capture:G[this.CAPTURE],index:D})}}}}return(E.length)?E:null},_unload:function(C){var I=YAHOO.util.Event,F,G,H,D,E,B=S.slice();for(F=0,D=S.length;F<D;++F){H=B[F];if(H){var A=window;if(H[I.ADJ_SCOPE]){if(H[I.ADJ_SCOPE]===true){A=H[I.UNLOAD_OBJ]}else{A=H[I.ADJ_SCOPE]}}H[I.FN].call(A,I.getEvent(C,H[I.EL]),H[I.UNLOAD_OBJ]);B[F]=null;H=null;A=null}}S=null;if(T){for(G=T.length-1;G>-1;G--){H=T[G];if(H){I._removeListener(H[I.EL],H[I.TYPE],H[I.FN],H[I.CAPTURE],G)}}H=null}V=null;I._simpleRemove(window,"unload",I._unload)},_getScrollLeft:function(){return this._getScroll()[1]},_getScrollTop:function(){return this._getScroll()[0]},_getScroll:function(){var B=document.documentElement,A=document.body;if(B&&(B.scrollTop||B.scrollLeft)){return[B.scrollTop,B.scrollLeft]}else{if(A){return[A.scrollTop,A.scrollLeft]}else{return[0,0]}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(B,A,C,D){B.addEventListener(A,C,(D))}}else{if(window.attachEvent){return function(B,A,C,D){B.attachEvent("on"+A,C)}}else{return function(){}}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(B,A,C,D){B.removeEventListener(A,C,(D))}}else{if(window.detachEvent){return function(B,A,C){B.detachEvent("on"+A,C)}}else{return function(){}}}}()}}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener;
/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.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()})()}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(G,K,H,I){this.__yui_events=this.__yui_events||{};var J=this.__yui_events[G];if(J){J.subscribe(K,H,I)}else{this.__yui_subscribers=this.__yui_subscribers||{};var L=this.__yui_subscribers;if(!L[G]){L[G]=[]}L[G].push({fn:K,obj:H,override:I})}},unsubscribe:function(M,K,I){this.__yui_events=this.__yui_events||{};var H=this.__yui_events;if(M){var J=H[M];if(J){return J.unsubscribe(K,I)}}else{var N=true;for(var L in H){if(YAHOO.lang.hasOwnProperty(H,L)){N=N&&H[L].unsubscribe(K,I)}}return N}return false},unsubscribeAll:function(B){return this.unsubscribe(B)},createEvent:function(P,J){this.__yui_events=this.__yui_events||{};var M=J||{};var N=this.__yui_events;if(N[P]){}else{var O=M.scope||this;var R=(M.silent);var L=new YAHOO.util.CustomEvent(P,O,R,YAHOO.util.CustomEvent.FLAT);N[P]=L;if(M.onSubscribeCallback){L.subscribeEvent.subscribe(M.onSubscribeCallback)}this.__yui_subscribers=this.__yui_subscribers||{};var Q=this.__yui_subscribers[P];if(Q){for(var K=0;K<Q.length;++K){L.subscribe(Q[K].fn,Q[K].obj,Q[K].override)}}}return N[P]},fireEvent:function(K,L,H,M){this.__yui_events=this.__yui_events||{};var I=this.__yui_events[K];if(!I){return null}var N=[];for(var J=1;J<arguments.length;++J){N.push(arguments[J])}return I.fire.apply(I,N)},hasEvent:function(B){if(this.__yui_events){if(this.__yui_events[B]){return true}}return false}};YAHOO.util.KeyListener=function(G,H,L,K){if(!G){}else{if(!H){}else{if(!L){}}}if(!K){K=YAHOO.util.KeyListener.KEYDOWN}var J=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof G=="string"){G=document.getElementById(G)}if(typeof L=="function"){J.subscribe(L)}else{J.subscribe(L.fn,L.scope,L.correctScope)}function I(A,B){if(!H.shift){H.shift=false}if(!H.alt){H.alt=false}if(!H.ctrl){H.ctrl=false}if(A.shiftKey==H.shift&&A.altKey==H.alt&&A.ctrlKey==H.ctrl){var D;if(H.keys instanceof Array){for(var C=0;C<H.keys.length;C++){D=H.keys[C];if(D==A.charCode){J.fire(A.charCode,A);break}else{if(D==A.keyCode){J.fire(A.keyCode,A);break}}}}else{D=H.keys;if(D==A.charCode){J.fire(A.charCode,A)}else{if(D==A.keyCode){J.fire(A.keyCode,A)}}}}}this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(G,K,I);this.enabledEvent.fire(H)}this.enabled=true};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(G,K,I);this.disabledEvent.fire(H)}this.enabled=false};this.toString=function(){return"KeyListener ["+H.keys+"] "+G.tagName+(G.id?"["+G.id+"]":"")}};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.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};YAHOO.register("event",YAHOO.util.Event,{version:"2.6.0",build:"1321"});YAHOO.register("yahoo-dom-event",YAHOO,{version:"2.6.0",build:"1321"});
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.6.0
*/
if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var C=YAHOO.util.Event,D=YAHOO.util.Dom;return{useShim:false,_shimActive:false,_shimState:false,_debugShim:false,_createShim:function(){var A=document.createElement("div");A.id="yui-ddm-shim";if(document.body.firstChild){document.body.insertBefore(A,document.body.firstChild)}else{document.body.appendChild(A)}A.style.display="none";A.style.backgroundColor="red";A.style.position="absolute";A.style.zIndex="99999";D.setStyle(A,"opacity","0");this._shim=A;C.on(A,"mouseup",this.handleMouseUp,this,true);C.on(A,"mousemove",this.handleMouseMove,this,true);C.on(window,"scroll",this._sizeShim,this,true)},_sizeShim:function(){if(this._shimActive){var A=this._shim;A.style.height=D.getDocumentHeight()+"px";A.style.width=D.getDocumentWidth()+"px";A.style.top="0";A.style.left="0"}},_activateShim:function(){if(this.useShim){if(!this._shim){this._createShim()}this._shimActive=true;var B=this._shim,A="0";if(this._debugShim){A=".5"}D.setStyle(B,"opacity",A);this._sizeShim();B.style.display="block"}},_deactivateShim:function(){this._shim.style.display="none";this._shimActive=false},_shim:null,ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(H,I){for(var B in this.ids){for(var J in this.ids[B]){var A=this.ids[B][J];if(!this.isTypeOfDD(A)){continue}A[H].apply(A,I)}}},_onLoad:function(){this.init();C.on(document,"mouseup",this.handleMouseUp,this,true);C.on(document,"mousemove",this.handleMouseMove,this,true);C.on(window,"unload",this._onUnload,this,true);C.on(window,"resize",this._onResize,this,true)},_onResize:function(A){this._execOnAll("resetConstraints",[])},lock:function(){this.locked=true},unlock:function(){this.locked=false},isLocked:function(){return this.locked},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(A,B){if(!this.initialized){this.init()}if(!this.ids[B]){this.ids[B]={}}this.ids[B][A.id]=A},removeDDFromGroup:function(A,F){if(!this.ids[F]){this.ids[F]={}}var B=this.ids[F];if(B&&B[A.id]){delete B[A.id]}},_remove:function(A){for(var B in A.groups){if(B){var F=this.ids[B];if(F&&F[A.id]){delete F[A.id]}}}delete this.handleIds[A.id]},regHandle:function(A,B){if(!this.handleIds[A]){this.handleIds[A]={}}this.handleIds[A][B]=B},isDragDrop:function(A){return(this.getDDById(A))?true:false},getRelated:function(A,K){var B=[];for(var I in A.groups){for(var J in this.ids[I]){var L=this.ids[I][J];if(!this.isTypeOfDD(L)){continue}if(!K||L.isTarget){B[B.length]=L}}}return B},isLegalTarget:function(A,B){var I=this.getRelated(A,true);for(var H=0,J=I.length;H<J;++H){if(I[H].id==B.id){return true}}return false},isTypeOfDD:function(A){return(A&&A.__ygDragDrop)},isHandle:function(A,B){return(this.handleIds[A]&&this.handleIds[A][B])},getDDById:function(A){for(var B in this.ids){if(this.ids[B][A]){return this.ids[B][A]}}return null},handleMouseDown:function(A,B){this.currentTarget=YAHOO.util.Event.getTarget(A);this.dragCurrent=B;var F=B.getEl();this.startX=YAHOO.util.Event.getPageX(A);this.startY=YAHOO.util.Event.getPageY(A);this.deltaX=this.startX-F.offsetLeft;this.deltaY=this.startY-F.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var E=YAHOO.util.DDM;E.startDrag(E.startX,E.startY);E.fromTimeout=true},this.clickTimeThresh)},startDrag:function(F,A){if(this.dragCurrent&&this.dragCurrent.useShim){this._shimState=this.useShim;this.useShim=true}this._activateShim();clearTimeout(this.clickTimeout);var B=this.dragCurrent;if(B&&B.events.b4StartDrag){B.b4StartDrag(F,A);B.fireEvent("b4StartDragEvent",{x:F,y:A})}if(B&&B.events.startDrag){B.startDrag(F,A);B.fireEvent("startDragEvent",{x:F,y:A})}this.dragThreshMet=true},handleMouseUp:function(A){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.fromTimeout=false;this.handleMouseMove(A)}this.fromTimeout=false;this.fireEvents(A,true)}else{}this.stopDrag(A);this.stopEvent(A)}},stopEvent:function(A){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(A)}if(this.preventDefault){YAHOO.util.Event.preventDefault(A)}},stopDrag:function(A,B){var F=this.dragCurrent;if(F&&!B){if(this.dragThreshMet){if(F.events.b4EndDrag){F.b4EndDrag(A);F.fireEvent("b4EndDragEvent",{e:A})}if(F.events.endDrag){F.endDrag(A);F.fireEvent("endDragEvent",{e:A})}}if(F.events.mouseUp){F.onMouseUp(A);F.fireEvent("mouseUpEvent",{e:A})}}if(this._shimActive){this._deactivateShim();if(this.dragCurrent&&this.dragCurrent.useShim){this.useShim=this._shimState;this._shimState=false}}this.dragCurrent=null;this.dragOvers={}},handleMouseMove:function(A){var H=this.dragCurrent;if(H){if(YAHOO.util.Event.isIE&&!A.button){this.stopEvent(A);return this.handleMouseUp(A)}else{if(A.clientX<0||A.clientY<0){}}if(!this.dragThreshMet){var B=Math.abs(this.startX-YAHOO.util.Event.getPageX(A));var G=Math.abs(this.startY-YAHOO.util.Event.getPageY(A));if(B>this.clickPixelThresh||G>this.clickPixelThresh){this.startDrag(this.startX,this.startY)}}if(this.dragThreshMet){if(H&&H.events.b4Drag){H.b4Drag(A);H.fireEvent("b4DragEvent",{e:A})}if(H&&H.events.drag){H.onDrag(A);H.fireEvent("dragEvent",{e:A})}if(H){this.fireEvents(A,false)}}this.stopEvent(A)}},fireEvents:function(g,q){var AC=this.dragCurrent;if(!AC||AC.isLocked()||AC.dragOnly){return }var o=YAHOO.util.Event.getPageX(g),p=YAHOO.util.Event.getPageY(g),m=new YAHOO.util.Point(o,p),r=AC.getTargetCoord(m.x,m.y),w=AC.getDragEl(),x=["out","over","drop","enter"],h=new YAHOO.util.Region(r.y,r.x+w.offsetWidth,r.y+w.offsetHeight,r.x),t=[],y={},l=[],AB={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var j in this.dragOvers){var AA=this.dragOvers[j];if(!this.isTypeOfDD(AA)){continue}if(!this.isOverTarget(m,AA,this.mode,h)){AB.outEvts.push(AA)}t[j]=true;delete this.dragOvers[j]}for(var k in AC.groups){if("string"!=typeof k){continue}for(j in this.ids[k]){var v=this.ids[k][j];if(!this.isTypeOfDD(v)){continue}if(v.isTarget&&!v.isLocked()&&v!=AC){if(this.isOverTarget(m,v,this.mode,h)){y[k]=true;if(q){AB.dropEvts.push(v)}else{if(!t[v.id]){AB.enterEvts.push(v)}else{AB.overEvts.push(v)}this.dragOvers[v.id]=v}}}}}this.interactionInfo={out:AB.outEvts,enter:AB.enterEvts,over:AB.overEvts,drop:AB.dropEvts,point:m,draggedRegion:h,sourceRegion:this.locationCache[AC.id],validDrop:q};for(var z in y){l.push(z)}if(q&&!AB.dropEvts.length){this.interactionInfo.validDrop=false;if(AC.events.invalidDrop){AC.onInvalidDrop(g);AC.fireEvent("invalidDropEvent",{e:g})}}for(j=0;j<x.length;j++){var B=null;if(AB[x[j]+"Evts"]){B=AB[x[j]+"Evts"]}if(B&&B.length){var u=x[j].charAt(0).toUpperCase()+x[j].substr(1),b="onDrag"+u,s="b4Drag"+u,n="drag"+u+"Event",f="drag"+u;if(this.mode){if(AC.events[s]){AC[s](g,B,l);AC.fireEvent(s+"Event",{event:g,info:B,group:l})}if(AC.events[f]){AC[b](g,B,l);AC.fireEvent(n,{event:g,info:B,group:l})}}else{for(var A=0,i=B.length;A<i;++A){if(AC.events[s]){AC[s](g,B[A].id,l[0]);AC.fireEvent(s+"Event",{event:g,info:B[A].id,group:l[0]})}if(AC.events[f]){AC[b](g,B[A].id,l[0]);AC.fireEvent(n,{event:g,info:B[A].id,group:l[0]})}}}}}},getBestMatch:function(H){var A=null;var I=H.length;if(I==1){A=H[0]}else{for(var B=0;B<I;++B){var J=H[B];if(this.mode==this.INTERSECT&&J.cursorIsOver){A=J;break}else{if(!A||!A.overlap||(J.overlap&&A.overlap.getArea()<J.overlap.getArea())){A=J}}}}return A},refreshCache:function(K){var I=K||this.ids;for(var L in I){if("string"!=typeof L){continue}for(var J in this.ids[L]){var B=this.ids[L][J];if(this.isTypeOfDD(B)){var A=this.getLocation(B);if(A){this.locationCache[B.id]=A}else{delete this.locationCache[B.id]}}}}},verifyEl:function(B){try{if(B){var F=B.offsetParent;if(F){return true}}}catch(A){}return false},getLocation:function(U){if(!this.isTypeOfDD(U)){return null}var W=U.getEl(),R,X,A,P,Q,O,B,S,V;try{R=YAHOO.util.Dom.getXY(W)}catch(T){}if(!R){return null}X=R[0];A=X+W.offsetWidth;P=R[1];Q=P+W.offsetHeight;O=P-U.padding[0];B=A+U.padding[1];S=Q+U.padding[2];V=X-U.padding[3];return new YAHOO.util.Region(O,B,S,V)},isOverTarget:function(L,B,R,Q){var P=this.locationCache[B.id];if(!P||!this.useCache){P=this.getLocation(B);this.locationCache[B.id]=P}if(!P){return false}B.cursorIsOver=P.contains(L);var M=this.dragCurrent;if(!M||(!R&&!M.constrainX&&!M.constrainY)){return B.cursorIsOver}B.overlap=null;if(!Q){var O=M.getTargetCoord(L.x,L.y);var A=M.getDragEl();Q=new YAHOO.util.Region(O.y,O.x+A.offsetWidth,O.y+A.offsetHeight,O.x)}var N=Q.intersect(P);if(N){B.overlap=N;return(R)?true:B.cursorIsOver}else{return false}},_onUnload:function(A,B){this.unregAll()},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null}this._execOnAll("unreg",[]);this.ids={}},elementCache:{},getElWrapper:function(A){var B=this.elementCache[A];if(!B||!B.el){B=this.elementCache[A]=new this.ElementWrapper(YAHOO.util.Dom.get(A))}return B},getElement:function(A){return YAHOO.util.Dom.get(A)},getCss:function(A){var B=YAHOO.util.Dom.get(A);return(B)?B.style:null},ElementWrapper:function(A){this.el=A||null;this.id=this.el&&A.id;this.css=this.el&&A.style},getPosX:function(A){return YAHOO.util.Dom.getX(A)},getPosY:function(A){return YAHOO.util.Dom.getY(A)},swapNode:function(B,H){if(B.swapNode){B.swapNode(H)}else{var A=H.parentNode;var G=H.nextSibling;if(G==B){A.insertBefore(B,H)}else{if(H==B.nextSibling){A.insertBefore(H,B)}else{B.parentNode.replaceChild(H,B);A.insertBefore(B,G)}}}},getScroll:function(){var B,H,A=document.documentElement,G=document.body;if(A&&(A.scrollTop||A.scrollLeft)){B=A.scrollTop;H=A.scrollLeft}else{if(G){B=G.scrollTop;H=G.scrollLeft}else{}}return{top:B,left:H}},getStyle:function(A,B){return YAHOO.util.Dom.getStyle(A,B)},getScrollTop:function(){return this.getScroll().top},getScrollLeft:function(){return this.getScroll().left},moveToEl:function(F,A){var B=YAHOO.util.Dom.getXY(A);YAHOO.util.Dom.setXY(F,B)},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight()},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth()},numericSort:function(A,B){return(A-B)},_timeoutCount:0,_addListeners:function(){var A=YAHOO.util.DDM;if(YAHOO.util.Event&&document){A._onLoad()}else{if(A._timeoutCount>2000){}else{setTimeout(A._addListeners,10);if(document&&document.body){A._timeoutCount+=1}}}},handleWasClicked:function(F,A){if(this.isHandle(A,F.id)){return true}else{var B=F.parentNode;while(B){if(this.isHandle(A,B.id)){return true}else{B=B.parentNode}}}return false}}}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners()}(function(){var C=YAHOO.util.Event;var D=YAHOO.util.Dom;YAHOO.util.DragDrop=function(A,F,B){if(A){this.init(A,F,B)}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments)},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true},unlock:function(){this.locked=false},isTarget:true,padding:null,dragOnly:false,useShim:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(B,A){},startDrag:function(B,A){},b4Drag:function(A){},onDrag:function(A){},onDragEnter:function(B,A){},b4DragOver:function(A){},onDragOver:function(B,A){},b4DragOut:function(A){},onDragOut:function(B,A){},b4DragDrop:function(A){},onDragDrop:function(B,A){},onInvalidDrop:function(A){},b4EndDrag:function(A){},endDrag:function(A){},b4MouseDown:function(A){},onMouseDown:function(A){},onMouseUp:function(A){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=D.get(this.id)}return this._domRef},getDragEl:function(){return D.get(this.dragElId)},init:function(A,H,G){this.initTarget(A,H,G);C.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var B in this.events){this.createEvent(B+"Event")}},initTarget:function(A,F,B){this.config=B||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof A!=="string"){this._domRef=A;A=D.generateId(A)}this.id=A;this.addToGroup((F)?F:"default");this.handleElId=A;C.onAvailable(A,this.handleOnAvailable,this,true);this.setDragElId(A);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig()},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var A in this.config.events){if(this.config.events[A]===false){this.events[A]=false}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);this.useShim=((this.config.useShim===true)?true:false)},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable()},setPadding:function(B,H,A,G){if(!H&&0!==H){this.padding=[B,B,B,B]}else{if(!A&&0!==A){this.padding=[B,H,B,H]}else{this.padding=[B,H,A,G]}}},setInitPosition:function(I,J){var B=this.getEl();if(!this.DDM.verifyEl(B)){if(B&&B.style&&(B.style.display=="none")){}else{}return }var K=I||0;var L=J||0;var A=D.getXY(B);this.initPageX=A[0]-K;this.initPageY=A[1]-L;this.lastPageX=A[0];this.lastPageY=A[1];this.setStartPosition(A)},setStartPosition:function(A){var B=A||D.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=B[0];this.startPageY=B[1]},addToGroup:function(A){this.groups[A]=true;this.DDM.regDragDrop(this,A)},removeFromGroup:function(A){if(this.groups[A]){delete this.groups[A]}this.DDM.removeDDFromGroup(this,A)},setDragElId:function(A){this.dragElId=A},setHandleElId:function(A){if(typeof A!=="string"){A=D.generateId(A)}this.handleElId=A;this.DDM.regHandle(this.id,A)},setOuterHandleElId:function(A){if(typeof A!=="string"){A=D.generateId(A)}C.on(A,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(A);this.hasOuterHandles=true},unreg:function(){C.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this)},isLocked:function(){return(this.DDM.isLocked()||this.locked)},handleMouseDown:function(A,B){var O=A.which||A.button;if(this.primaryButtonOnly&&O>1){return }if(this.isLocked()){return }var P=this.b4MouseDown(A),M=true;if(this.events.b4MouseDown){M=this.fireEvent("b4MouseDownEvent",A)}var N=this.onMouseDown(A),K=true;if(this.events.mouseDown){K=this.fireEvent("mouseDownEvent",A)}if((P===false)||(N===false)||(M===false)||(K===false)){return }this.DDM.refreshCache(this.groups);var L=new YAHOO.util.Point(C.getPageX(A),C.getPageY(A));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(L,this)){}else{if(this.clickValidator(A)){this.setStartPosition();this.DDM.handleMouseDown(A,this);this.DDM.stopEvent(A)}else{}}},clickValidator:function(A){var B=YAHOO.util.Event.getTarget(A);return(this.isValidHandleChild(B)&&(this.id==this.handleElId||this.DDM.handleWasClicked(B,this.id)))},getTargetCoord:function(B,G){var H=B-this.deltaX;var A=G-this.deltaY;if(this.constrainX){if(H<this.minX){H=this.minX}if(H>this.maxX){H=this.maxX}}if(this.constrainY){if(A<this.minY){A=this.minY}if(A>this.maxY){A=this.maxY}}H=this.getTick(H,this.xTicks);A=this.getTick(A,this.yTicks);return{x:H,y:A}},addInvalidHandleType:function(B){var A=B.toUpperCase();this.invalidHandleTypes[A]=A},addInvalidHandleId:function(A){if(typeof A!=="string"){A=D.generateId(A)}this.invalidHandleIds[A]=A},addInvalidHandleClass:function(A){this.invalidHandleClasses.push(A)},removeInvalidHandleType:function(B){var A=B.toUpperCase();delete this.invalidHandleTypes[A]},removeInvalidHandleId:function(A){if(typeof A!=="string"){A=D.generateId(A)}delete this.invalidHandleIds[A]},removeInvalidHandleClass:function(B){for(var A=0,F=this.invalidHandleClasses.length;A<F;++A){if(this.invalidHandleClasses[A]==B){delete this.invalidHandleClasses[A]}}},isValidHandleChild:function(I){var J=true;var A;try{A=I.nodeName.toUpperCase()}catch(B){A=I.nodeName}J=J&&!this.invalidHandleTypes[A];J=J&&!this.invalidHandleIds[I.id];for(var K=0,L=this.invalidHandleClasses.length;J&&K<L;++K){J=!D.hasClass(I,this.invalidHandleClasses[K])}return J},setXTicks:function(A,H){this.xTicks=[];this.xTickSize=H;var B={};for(var G=this.initPageX;G>=this.minX;G=G-H){if(!B[G]){this.xTicks[this.xTicks.length]=G;B[G]=true}}for(G=this.initPageX;G<=this.maxX;G=G+H){if(!B[G]){this.xTicks[this.xTicks.length]=G;B[G]=true}}this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(A,H){this.yTicks=[];this.yTickSize=H;var B={};for(var G=this.initPageY;G>=this.minY;G=G-H){if(!B[G]){this.yTicks[this.yTicks.length]=G;B[G]=true}}for(G=this.initPageY;G<=this.maxY;G=G+H){if(!B[G]){this.yTicks[this.yTicks.length]=G;B[G]=true}}this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(A,B,F){this.leftConstraint=parseInt(A,10);this.rightConstraint=parseInt(B,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(F){this.setXTicks(this.initPageX,F)}this.constrainX=true},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks()},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0},setYConstraint:function(F,A,B){this.topConstraint=parseInt(F,10);this.bottomConstraint=parseInt(A,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(B){this.setYTicks(this.initPageY,B)}this.constrainY=true},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var A=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var B=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(A,B)}else{this.setInitPosition()}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize)}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)}},getTick:function(A,K){if(!K){return A}else{if(K[0]>=A){return K[0]}else{for(var M=0,N=K.length;M<N;++M){var L=M+1;if(K[L]&&K[L]>=A){var B=A-K[M];var J=K[L]-A;return(J>B)?K[M]:K[L]}}return K[K.length-1]}}},toString:function(){return("DragDrop "+this.id)}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider)})();YAHOO.util.DD=function(E,D,F){if(E){this.init(E,D,F)}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(G,H){var E=G-this.startPageX;var F=H-this.startPageY;this.setDelta(E,F)},setDelta:function(D,C){this.deltaX=D;this.deltaY=C},setDragElPos:function(E,F){var D=this.getDragEl();this.alignElWithMouse(D,E,F)},alignElWithMouse:function(O,K,L){var M=this.getTargetCoord(K,L);if(!this.deltaSetXY){var J=[M.x,M.y];YAHOO.util.Dom.setXY(O,J);var N=parseInt(YAHOO.util.Dom.getStyle(O,"left"),10);var P=parseInt(YAHOO.util.Dom.getStyle(O,"top"),10);this.deltaSetXY=[N-M.x,P-M.y]}else{YAHOO.util.Dom.setStyle(O,"left",(M.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(O,"top",(M.y+this.deltaSetXY[1])+"px")}this.cachePosition(M.x,M.y);var I=this;setTimeout(function(){I.autoScroll.call(I,M.x,M.y,O.offsetHeight,O.offsetWidth)},0)},cachePosition:function(F,D){if(F){this.lastPageX=F;this.lastPageY=D}else{var E=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=E[0];this.lastPageY=E[1]}},autoScroll:function(W,X,b,V){if(this.scroll){var U=this.DDM.getClientHeight();var Q=this.DDM.getClientWidth();var S=this.DDM.getScrollTop();var O=this.DDM.getScrollLeft();var Y=b+X;var T=V+W;var Z=(U+S-X-this.deltaY);var a=(Q+O-W-this.deltaX);var P=40;var R=(document.all)?80:30;if(Y>U&&Z<P){window.scrollTo(O,S+R)}if(X<S&&S>0&&X-S<P){window.scrollTo(O,S-R)}if(T>Q&&a<P){window.scrollTo(O+R,S)}if(W<O&&O>0&&W-O<P){window.scrollTo(O-R,S)}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false)},b4MouseDown:function(B){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(B),YAHOO.util.Event.getPageY(B))},b4Drag:function(B){this.setDragElPos(YAHOO.util.Event.getPageX(B),YAHOO.util.Event.getPageY(B))},toString:function(){return("DD "+this.id)}});YAHOO.util.DDProxy=function(E,D,F){if(E){this.init(E,D,F);this.initFrame()}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var N=this,H=document.body;if(!H||!H.firstChild){setTimeout(function(){N.createFrame()},50);return }var I=this.getDragEl(),K=YAHOO.util.Dom;if(!I){I=document.createElement("div");I.id=this.dragElId;var L=I.style;L.position="absolute";L.visibility="hidden";L.cursor="move";L.border="2px solid #aaa";L.zIndex=999;L.height="25px";L.width="25px";var M=document.createElement("div");K.setStyle(M,"height","100%");K.setStyle(M,"width","100%");K.setStyle(M,"background-color","#ccc");K.setStyle(M,"opacity","0");I.appendChild(M);if(YAHOO.env.ua.ie){var J=document.createElement("iframe");J.setAttribute("src","javascript: false;");J.setAttribute("scrolling","no");J.setAttribute("frameborder","0");I.insertBefore(J,I.firstChild);K.setStyle(J,"height","100%");K.setStyle(J,"width","100%");K.setStyle(J,"position","absolute");K.setStyle(J,"top","0");K.setStyle(J,"left","0");K.setStyle(J,"opacity","0");K.setStyle(J,"zIndex","-1");K.setStyle(J.nextSibling,"zIndex","2")}H.insertBefore(I,H.firstChild)}},initFrame:function(){this.createFrame()},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId)},showFrame:function(G,H){var I=this.getEl();var F=this.getDragEl();var J=F.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(J.width,10)/2),Math.round(parseInt(J.height,10)/2))}this.setDragElPos(G,H);YAHOO.util.Dom.setStyle(F,"visibility","visible")},_resizeProxy:function(){if(this.resizeFrame){var O=YAHOO.util.Dom;var L=this.getEl();var K=this.getDragEl();var P=parseInt(O.getStyle(K,"borderTopWidth"),10);var N=parseInt(O.getStyle(K,"borderRightWidth"),10);var Q=parseInt(O.getStyle(K,"borderBottomWidth"),10);var J=parseInt(O.getStyle(K,"borderLeftWidth"),10);if(isNaN(P)){P=0}if(isNaN(N)){N=0}if(isNaN(Q)){Q=0}if(isNaN(J)){J=0}var R=Math.max(0,L.offsetWidth-N-J);var M=Math.max(0,L.offsetHeight-P-Q);O.setStyle(K,"width",R+"px");O.setStyle(K,"height",M+"px")}},b4MouseDown:function(F){this.setStartPosition();var D=YAHOO.util.Event.getPageX(F);var E=YAHOO.util.Event.getPageY(F);this.autoOffset(D,E)},b4StartDrag:function(C,D){this.showFrame(C,D)},b4EndDrag:function(B){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden")},endDrag:function(F){var G=YAHOO.util.Dom;var H=this.getEl();var E=this.getDragEl();G.setStyle(E,"visibility","");G.setStyle(H,"visibility","hidden");YAHOO.util.DDM.moveToEl(H,E);G.setStyle(E,"visibility","hidden");G.setStyle(H,"visibility","")},toString:function(){return("DDProxy "+this.id)}});YAHOO.util.DDTarget=function(E,D,F){if(E){this.initTarget(E,D,F)}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id)}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.6.0",build:"1321"});
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.6.0
*/
YAHOO.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(YAHOO.util.Event){YAHOO.util.Event.addListener(document,"click",function(D){var C=YAHOO.util.Event.getTarget(D);if(C.nodeName.toLowerCase()=="input"&&(C.type&&C.type.toLowerCase()=="submit")){YAHOO.util.Connect._submitElementValue=encodeURIComponent(C.name)+"="+encodeURIComponent(C.value)}});return true}return false})(),startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),uploadEvent:new YAHOO.util.CustomEvent("upload"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(B){this._msxml_progid.unshift(B)},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(B){if(typeof B=="number"&&isFinite(B)){this._polling_interval=B}},createXhrObject:function(H){var I,G;try{G=new XMLHttpRequest();I={conn:G,tId:H}}catch(J){for(var L=0;L<this._msxml_progid.length;++L){try{G=new ActiveXObject(this._msxml_progid[L]);I={conn:G,tId:H};break}catch(K){}}}finally{return I}},getConnectionObject:function(E){var G;var F=this._transaction_id;try{if(!E){G=this.createXhrObject(F)}else{G={};G.tId=F;G.isUpload=true}if(G){this._transaction_id++}}catch(H){}finally{return G}},asyncRequest:function(H,K,I,G){var J=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();var L=(I&&I.argument)?I.argument:null;if(!J){return null}else{if(I&&I.customevents){this.initCustomEvents(J,I)}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(J,I,K,G);return J}if(H.toUpperCase()=="GET"){if(this._sFormData.length!==0){K+=((K.indexOf("?")==-1)?"?":"&")+this._sFormData}}else{if(H.toUpperCase()=="POST"){G=G?this._sFormData+"&"+G:this._sFormData}}}if(H.toUpperCase()=="GET"&&(I&&I.cache===false)){K+=((K.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString()}J.conn.open(H,K,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((H.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(J)}this.handleReadyState(J,I);J.conn.send(G||"");if(this._isFormSubmit===true){this.resetFormState()}this.startEvent.fire(J,L);if(J.startEvent){J.startEvent.fire(J,L)}return J}},initCustomEvents:function(D,E){var F;for(F in E.customevents){if(this._customEvents[F][0]){D[this._customEvents[F][0]]=new YAHOO.util.CustomEvent(this._customEvents[F][1],(E.scope)?E.scope:null);D[this._customEvents[F][0]].subscribe(E.customevents[F])}}},handleReadyState:function(G,F){var H=this;var E=(F&&F.argument)?F.argument:null;if(F&&F.timeout){this._timeOut[G.tId]=window.setTimeout(function(){H.abort(G,F,true)},F.timeout)}this._poll[G.tId]=window.setInterval(function(){if(G.conn&&G.conn.readyState===4){window.clearInterval(H._poll[G.tId]);delete H._poll[G.tId];if(F&&F.timeout){window.clearTimeout(H._timeOut[G.tId]);delete H._timeOut[G.tId]}H.completeEvent.fire(G,E);if(G.completeEvent){G.completeEvent.fire(G,E)}H.handleTransactionResponse(G,F)}},this._polling_interval)},handleTransactionResponse:function(J,I,H){var L,M;var N=(I&&I.argument)?I.argument:null;try{if(J.conn.status!==undefined&&J.conn.status!==0){L=J.conn.status}else{L=13030}}catch(K){L=13030}if(L>=200&&L<300||L===1223){M=this.createResponseObject(J,N);if(I&&I.success){if(!I.scope){I.success(M)}else{I.success.apply(I.scope,[M])}}this.successEvent.fire(M);if(J.successEvent){J.successEvent.fire(M)}}else{switch(L){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:M=this.createExceptionObject(J.tId,N,(H?H:false));if(I&&I.failure){if(!I.scope){I.failure(M)}else{I.failure.apply(I.scope,[M])}}break;default:M=this.createResponseObject(J,N);if(I&&I.failure){if(!I.scope){I.failure(M)}else{I.failure.apply(I.scope,[M])}}}this.failureEvent.fire(M);if(J.failureEvent){J.failureEvent.fire(M)}}this.releaseObject(J);M=null},createResponseObject:function(M,P){var J={};var N={};try{var K=M.conn.getAllResponseHeaders();var Q=K.split("\n");for(var R=0;R<Q.length;R++){var L=Q[R].indexOf(":");if(L!=-1){N[Q[R].substring(0,L)]=Q[R].substring(L+2)}}}catch(O){}J.tId=M.tId;J.status=(M.conn.status==1223)?204:M.conn.status;J.statusText=(M.conn.status==1223)?"No Content":M.conn.statusText;J.getResponseHeader=N;J.getAllResponseHeaders=K;J.responseText=M.conn.responseText;J.responseXML=M.conn.responseXML;if(P){J.argument=P}return J},createExceptionObject:function(J,N,I){var L=0;var K="communication failure";var O=-1;var P="transaction aborted";var M={};M.tId=J;if(I){M.status=O;M.statusText=P}else{M.status=L;M.statusText=K}if(N){M.argument=N}return M},initHeader:function(E,F,G){var H=(G)?this._default_headers:this._http_headers;H[E]=F;if(G){this._has_default_headers=true}else{this._has_http_headers=true}},setHeader:function(C){var D;if(this._has_default_headers){for(D in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,D)){C.conn.setRequestHeader(D,this._default_headers[D])}}}if(this._has_http_headers){for(D in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,D)){C.conn.setRequestHeader(D,this._http_headers[D])}}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(X,c,R){var Y,S,Z,b,U,a=false,f=[],V=0,g,d,Q,W,T;this.resetFormState();if(typeof X=="string"){Y=(document.getElementById(X)||document.forms[X])}else{if(typeof X=="object"){Y=X}else{return }}if(c){this.createFrame(R?R:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=Y;return }for(g=0,d=Y.elements.length;g<d;++g){S=Y.elements[g];U=S.disabled;Z=S.name;if(!U&&Z){Z=encodeURIComponent(Z)+"=";b=encodeURIComponent(S.value);switch(S.type){case"select-one":if(S.selectedIndex>-1){T=S.options[S.selectedIndex];f[V++]=Z+encodeURIComponent((T.attributes.value&&T.attributes.value.specified)?T.value:T.text)}break;case"select-multiple":if(S.selectedIndex>-1){for(Q=S.selectedIndex,W=S.options.length;Q<W;++Q){T=S.options[Q];if(T.selected){f[V++]=Z+encodeURIComponent((T.attributes.value&&T.attributes.value.specified)?T.value:T.text)}}}break;case"radio":case"checkbox":if(S.checked){f[V++]=Z+b}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(a===false){if(this._hasSubmitListener&&this._submitElementValue){f[V++]=this._submitElementValue}else{f[V++]=Z+b}a=true}break;default:f[V++]=Z+b}}}this._isFormSubmit=true;this._sFormData=f.join("&");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(D){var F="yuiIO"+this._transaction_id;var E;if(YAHOO.env.ua.ie){E=document.createElement('<iframe id="'+F+'" name="'+F+'" />');if(typeof D=="boolean"){E.src="javascript:false"}}else{E=document.createElement("iframe");E.id=F;E.name=F}E.style.position="absolute";E.style.top="-1000px";E.style.left="-1000px";document.body.appendChild(E)},appendPostData:function(F){var H=[],J=F.split("&"),I,G;for(I=0;I<J.length;I++){G=J[I].indexOf("=");if(G!=-1){H[I]=document.createElement("input");H[I].type="hidden";H[I].name=decodeURIComponent(J[I].substring(0,G));H[I].value=decodeURIComponent(J[I].substring(G+1));this._formNode.appendChild(H[I])}}return H},uploadFile:function(P,U,d,Q){var Z="yuiIO"+P.tId,Y="multipart/form-data",W=document.getElementById(Z),T=this,X=(U&&U.argument)?U.argument:null,V,a,R,b;var S={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",d);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",Z);if(YAHOO.env.ua.ie){this._formNode.setAttribute("encoding",Y)}else{this._formNode.setAttribute("enctype",Y)}if(Q){V=this.appendPostData(Q)}this._formNode.submit();this.startEvent.fire(P,X);if(P.startEvent){P.startEvent.fire(P,X)}if(U&&U.timeout){this._timeOut[P.tId]=window.setTimeout(function(){T.abort(P,U,true)},U.timeout)}if(V&&V.length>0){for(a=0;a<V.length;a++){this._formNode.removeChild(V[a])}}for(R in S){if(YAHOO.lang.hasOwnProperty(S,R)){if(S[R]){this._formNode.setAttribute(R,S[R])}else{this._formNode.removeAttribute(R)}}}this.resetFormState();var c=function(){if(U&&U.timeout){window.clearTimeout(T._timeOut[P.tId]);delete T._timeOut[P.tId]}T.completeEvent.fire(P,X);if(P.completeEvent){P.completeEvent.fire(P,X)}b={tId:P.tId,argument:U.argument};try{b.responseText=W.contentWindow.document.body?W.contentWindow.document.body.innerHTML:W.contentWindow.document.documentElement.textContent;b.responseXML=W.contentWindow.document.XMLDocument?W.contentWindow.document.XMLDocument:W.contentWindow.document}catch(A){}if(U&&U.upload){if(!U.scope){U.upload(b)}else{U.upload.apply(U.scope,[b])}}T.uploadEvent.fire(b);if(P.uploadEvent){P.uploadEvent.fire(b)}YAHOO.util.Event.removeListener(W,"load",c);setTimeout(function(){document.body.removeChild(W);T.releaseObject(P)},100)};YAHOO.util.Event.addListener(W,"load",c)},abort:function(K,I,H){var L;var N=(I&&I.argument)?I.argument:null;if(K&&K.conn){if(this.isCallInProgress(K)){K.conn.abort();window.clearInterval(this._poll[K.tId]);delete this._poll[K.tId];if(H){window.clearTimeout(this._timeOut[K.tId]);delete this._timeOut[K.tId]}L=true}}else{if(K&&K.isUpload===true){var M="yuiIO"+K.tId;var J=document.getElementById(M);if(J){YAHOO.util.Event.removeListener(J,"load");document.body.removeChild(J);if(H){window.clearTimeout(this._timeOut[K.tId]);delete this._timeOut[K.tId]}L=true}}else{L=false}}if(L===true){this.abortEvent.fire(K,N);if(K.abortEvent){K.abortEvent.fire(K,N)}this.handleTransactionResponse(K,I,true)}return L},isCallInProgress:function(D){if(D&&D.conn){return D.conn.readyState!==4&&D.conn.readyState!==0}else{if(D&&D.isUpload===true){var C="yuiIO"+D.tId;return document.getElementById(C)?true:false}else{return false}}},releaseObject:function(B){if(B&&B.conn){B.conn=null;B=null}}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.6.0",build:"1321"});
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.6.0
*/
YAHOO.lang.JSON=(function(){var l=YAHOO.lang,_UNICODE_EXCEPTIONS=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_ESCAPES=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,_VALUES=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS=/(?:^|:|,)(?:\s*\[)+/g,_INVALID=/^[\],:{}\s]*$/,_SPECIAL_CHARS=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_CHARS={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function _revive(data,reviver){var walk=function(o,key){var k,v,value=o[key];if(value&&typeof value==="object"){for(k in value){if(l.hasOwnProperty(value,k)){v=walk(value,k);if(v===undefined){delete value[k]}else{value[k]=v}}}}return reviver.call(o,key,value)};return typeof reviver==="function"?walk({"":data},""):data}function _char(c){if(!_CHARS[c]){_CHARS[c]="\\u"+("0000"+(+(c.charCodeAt(0))).toString(16)).slice(-4)}return _CHARS[c]}function _prepare(s){return s.replace(_UNICODE_EXCEPTIONS,_char)}function _isValid(str){return l.isString(str)&&_INVALID.test(str.replace(_ESCAPES,"@").replace(_VALUES,"]").replace(_BRACKETS,""))}function _string(s){return'"'+s.replace(_SPECIAL_CHARS,_char)+'"'}function _stringify(h,key,d,w,pstack){var o=typeof w==="function"?w.call(h,key,h[key]):h[key],i,len,j,k,v,isArray,a;if(o instanceof Date){o=l.JSON.dateToString(o)}else{if(o instanceof String||o instanceof Boolean||o instanceof Number){o=o.valueOf()}}switch(typeof o){case"string":return _string(o);case"number":return isFinite(o)?String(o):"null";case"boolean":return String(o);case"object":if(o===null){return"null"}for(i=pstack.length-1;i>=0;--i){if(pstack[i]===o){return"null"}}pstack[pstack.length]=o;a=[];isArray=l.isArray(o);if(d>0){if(isArray){for(i=o.length-1;i>=0;--i){a[i]=_stringify(o,i,d-1,w,pstack)||"null"}}else{j=0;if(l.isArray(w)){for(i=0,len=w.length;i<len;++i){k=w[i];v=_stringify(o,k,d-1,w,pstack);if(v){a[j++]=_string(k)+":"+v}}}else{for(k in o){if(typeof k==="string"&&l.hasOwnProperty(o,k)){v=_stringify(o,k,d-1,w,pstack);if(v){a[j++]=_string(k)+":"+v}}}}a.sort()}}pstack.pop();return isArray?"["+a.join(",")+"]":"{"+a.join(",")+"}"}return undefined}return{isValid:function(s){return _isValid(_prepare(s))},parse:function(s,reviver){s=_prepare(s);if(_isValid(s)){return _revive(eval("("+s+")"),reviver)}throw new SyntaxError("parseJSON")},stringify:function(o,w,d){if(o!==undefined){if(l.isArray(w)){w=(function(a){var uniq=[],map={},v,i,j,len;for(i=0,j=0,len=a.length;i<len;++i){v=a[i];if(typeof v==="string"&&map[v]===undefined){uniq[(map[v]=j++)]=v}}return uniq})(w)}d=d>=0?d:1/0;return _stringify({"":o},"",d,w,[])}return undefined},dateToString:function(d){function _zeroPad(v){return v<10?"0"+v:v}return d.getUTCFullYear()+"-"+_zeroPad(d.getUTCMonth()+1)+"-"+_zeroPad(d.getUTCDate())+"T"+_zeroPad(d.getUTCHours())+":"+_zeroPad(d.getUTCMinutes())+":"+_zeroPad(d.getUTCSeconds())+"Z"},stringToDate:function(str){if(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/.test(str)){var d=new Date();d.setUTCFullYear(RegExp.$1,(RegExp.$2|0)-1,RegExp.$3);d.setUTCHours(RegExp.$4,RegExp.$5,RegExp.$6);return d}return str}}})();YAHOO.register("json",YAHOO.lang.JSON,{version:"2.6.0",build:"1321"});
/*  Prototype JavaScript framework, version 1.6.0.2
 *  (c) 2005-2008 Sam Stephenson
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://www.prototypejs.org/
 *
 *--------------------------------------------------------------------------*/
var Prototype={Version:"1.6.0.2",Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div").__proto__&&document.createElement("div").__proto__!==document.createElement("form").__proto__},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(A){return A}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Class={create:function(){var E=null,D=$A(arguments);if(Object.isFunction(D[0])){E=D.shift()}function A(){this.initialize.apply(this,arguments)}Object.extend(A,Class.Methods);A.superclass=E;A.subclasses=[];if(E){var B=function(){};B.prototype=E.prototype;A.prototype=new B;E.subclasses.push(A)}for(var C=0;C<D.length;C++){A.addMethods(D[C])}if(!A.prototype.initialize){A.prototype.initialize=Prototype.emptyFunction}A.prototype.constructor=A;return A}};Class.Methods={addMethods:function(G){var C=this.superclass&&this.superclass.prototype;var B=Object.keys(G);if(!Object.keys({toString:true}).length){B.push("toString","valueOf")}for(var A=0,D=B.length;A<D;A++){var F=B[A],E=G[F];if(C&&Object.isFunction(E)&&E.argumentNames().first()=="$super"){var H=E,E=Object.extend((function(I){return function(){return C[I].apply(this,arguments)}})(F).wrap(H),{valueOf:function(){return H},toString:function(){return H.toString()}})}this.prototype[F]=E}return this}};var Abstract={};Object.extend=function(A,C){for(var B in C){A[B]=C[B]}return A};Object.extend(Object,{inspect:function(A){try{if(Object.isUndefined(A)){return"undefined"}if(A===null){return"null"}return A.inspect?A.inspect():String(A)}catch(B){if(B instanceof RangeError){return"..."}throw B}},toJSON:function(A){var C=typeof A;switch(C){case"undefined":case"function":case"unknown":return ;case"boolean":return A.toString()}if(A===null){return"null"}if(A.toJSON){return A.toJSON()}if(Object.isElement(A)){return }var B=[];for(var E in A){var D=Object.toJSON(A[E]);if(!Object.isUndefined(D)){B.push(E.toJSON()+": "+D)}}return"{"+B.join(", ")+"}"},toQueryString:function(A){return $H(A).toQueryString()},toHTML:function(A){return A&&A.toHTML?A.toHTML():String.interpret(A)},keys:function(A){var B=[];for(var C in A){B.push(C)}return B},values:function(B){var A=[];for(var C in B){A.push(B[C])}return A},clone:function(A){return Object.extend({},A)},isElement:function(A){return A&&A.nodeType==1},isArray:function(A){return A!=null&&typeof A=="object"&&"splice" in A&&"join" in A},isHash:function(A){return A instanceof Hash},isFunction:function(A){return typeof A=="function"},isString:function(A){return typeof A=="string"},isNumber:function(A){return typeof A=="number"},isUndefined:function(A){return typeof A=="undefined"}});Object.extend(Function.prototype,{argumentNames:function(){var A=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");return A.length==1&&!A[0]?[]:A},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var A=this,C=$A(arguments),B=C.shift();return function(){return A.apply(B,C.concat($A(arguments)))}},bindAsEventListener:function(){var A=this,C=$A(arguments),B=C.shift();return function(D){return A.apply(B,[D||window.event].concat(C))}},curry:function(){if(!arguments.length){return this}var A=this,B=$A(arguments);return function(){return A.apply(this,B.concat($A(arguments)))}},delay:function(){var A=this,B=$A(arguments),C=B.shift()*1000;return window.setTimeout(function(){return A.apply(A,B)},C)},wrap:function(B){var A=this;return function(){return B.apply(this,[A.bind(this)].concat($A(arguments)))}},methodize:function(){if(this._methodized){return this._methodized}var A=this;return this._methodized=function(){return A.apply(null,[this].concat($A(arguments)))}}});Function.prototype.defer=Function.prototype.delay.curry(0.01);Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"'};var Try={these:function(){var C;for(var B=0,D=arguments.length;B<D;B++){var A=arguments[B];try{C=A();break}catch(E){}}return C}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(A){return String(A).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(B,A){this.callback=B;this.frequency=A;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return }clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute()}finally{this.currentlyExecuting=false}}}});Object.extend(String,{interpret:function(A){return A==null?"":String(A)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,{gsub:function(E,C){var A="",D=this,B;C=arguments.callee.prepareReplacement(C);while(D.length>0){if(B=D.match(E)){A+=D.slice(0,B.index);A+=String.interpret(C(B));D=D.slice(B.index+B[0].length)}else{A+=D,D=""}}return A},sub:function(C,A,B){A=this.gsub.prepareReplacement(A);B=Object.isUndefined(B)?1:B;return this.gsub(C,function(D){if(--B<0){return D[0]}return A(D)})},scan:function(B,A){this.gsub(B,A);return String(this)},truncate:function(B,A){B=B||30;A=Object.isUndefined(A)?"...":A;return this.length>B?this.slice(0,B-A.length)+A:String(this)},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")},extractScripts:function(){var B=new RegExp(Prototype.ScriptFragment,"img");var A=new RegExp(Prototype.ScriptFragment,"im");return(this.match(B)||[]).map(function(C){return(C.match(A)||["",""])[1]})},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)})},escapeHTML:function(){var A=arguments.callee;A.text.data=this;return A.div.innerHTML},unescapeHTML:function(){var A=new Element("div");A.innerHTML=this.stripTags();return A.childNodes[0]?(A.childNodes.length>1?$A(A.childNodes).inject("",function(B,C){return B+C.nodeValue}):A.childNodes[0].nodeValue):""},toQueryParams:function(B){var A=this.strip().match(/([^?#]*)(#.*)?$/);if(!A){return{}}return A[1].split(B||"&").inject({},function(E,F){if((F=F.split("="))[0]){var C=decodeURIComponent(F.shift());var D=F.length>1?F.join("="):F[0];if(D!=undefined){D=decodeURIComponent(D)}if(C in E){if(!Object.isArray(E[C])){E[C]=[E[C]]}E[C].push(D)}else{E[C]=D}}return E})},toArray:function(){return this.split("")},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(A){return A<1?"":new Array(A+1).join(this)},camelize:function(){var D=this.split("-"),A=D.length;if(A==1){return D[0]}var C=this.charAt(0)=="-"?D[0].charAt(0).toUpperCase()+D[0].substring(1):D[0];for(var B=1;B<A;B++){C+=D[B].charAt(0).toUpperCase()+D[B].substring(1)}return C},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,"/").gsub(/([A-Z]+)([A-Z][a-z])/,"#{1}_#{2}").gsub(/([a-z\d])([A-Z])/,"#{1}_#{2}").gsub(/-/,"_").toLowerCase()},dasherize:function(){return this.gsub(/_/,"-")},inspect:function(B){var A=this.gsub(/[\x00-\x1f\\]/,function(C){var D=String.specialChar[C[0]];return D?D:"\\u00"+C[0].charCodeAt().toPaddedString(2,16)});if(B){return'"'+A.replace(/"/g,'\\"')+'"'}return"'"+A.replace(/'/g,"\\'")+"'"},toJSON:function(){return this.inspect(true)},unfilterJSON:function(A){return this.sub(A||Prototype.JSONFilter,"#{1}")},isJSON:function(){var A=this;if(A.blank()){return false}A=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(A)},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())},include:function(A){return this.indexOf(A)>-1},startsWith:function(A){return this.indexOf(A)===0},endsWith:function(A){var B=this.length-A.length;return B>=0&&this.lastIndexOf(A)===B},empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)},interpolate:function(A,B){return new Template(this,B).evaluate(A)}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},unescapeHTML:function(){return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")}})}String.prototype.gsub.prepareReplacement=function(B){if(Object.isFunction(B)){return B}var A=new Template(B);return function(C){return A.evaluate(C)}};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});with(String.prototype.escapeHTML){div.appendChild(text)}var Template=Class.create({initialize:function(A,B){this.template=A.toString();this.pattern=B||Template.Pattern},evaluate:function(A){if(Object.isFunction(A.toTemplateReplacements)){A=A.toTemplateReplacements()}return this.template.gsub(this.pattern,function(D){if(A==null){return""}var F=D[1]||"";if(F=="\\"){return D[2]}var B=A,G=D[3];var E=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;D=E.exec(G);if(D==null){return F}while(D!=null){var C=D[1].startsWith("[")?D[2].gsub("\\\\]","]"):D[1];B=B[C];if(null==B||""==D[3]){break}G=G.substring("["==D[3]?D[1].length:D[0].length);D=E.exec(G)}return F+String.interpret(B)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(C,B){var A=0;C=C.bind(B);try{this._each(function(E){C(E,A++)})}catch(D){if(D!=$break){throw D}}return this},eachSlice:function(D,C,B){C=C?C.bind(B):Prototype.K;var A=-D,E=[],F=this.toArray();while((A+=D)<F.length){E.push(F.slice(A,A+D))}return E.collect(C,B)},all:function(C,B){C=C?C.bind(B):Prototype.K;var A=true;this.each(function(E,D){A=A&&!!C(E,D);if(!A){throw $break}});return A},any:function(C,B){C=C?C.bind(B):Prototype.K;var A=false;this.each(function(E,D){if(A=!!C(E,D)){throw $break}});return A},collect:function(C,B){C=C?C.bind(B):Prototype.K;var A=[];this.each(function(E,D){A.push(C(E,D))});return A},detect:function(C,B){C=C.bind(B);var A;this.each(function(E,D){if(C(E,D)){A=E;throw $break}});return A},findAll:function(C,B){C=C.bind(B);var A=[];this.each(function(E,D){if(C(E,D)){A.push(E)}});return A},grep:function(D,C,B){C=C?C.bind(B):Prototype.K;var A=[];if(Object.isString(D)){D=new RegExp(D)}this.each(function(F,E){if(D.match(F)){A.push(C(F,E))}});return A},include:function(A){if(Object.isFunction(this.indexOf)){if(this.indexOf(A)!=-1){return true}}var B=false;this.each(function(C){if(C==A){B=true;throw $break}});return B},inGroupsOf:function(B,A){A=Object.isUndefined(A)?null:A;return this.eachSlice(B,function(C){while(C.length<B){C.push(A)}return C})},inject:function(A,C,B){C=C.bind(B);this.each(function(E,D){A=C(A,E,D)});return A},invoke:function(B){var A=$A(arguments).slice(1);return this.map(function(C){return C[B].apply(C,A)})},max:function(C,B){C=C?C.bind(B):Prototype.K;var A;this.each(function(E,D){E=C(E,D);if(A==null||E>=A){A=E}});return A},min:function(C,B){C=C?C.bind(B):Prototype.K;var A;this.each(function(E,D){E=C(E,D);if(A==null||E<A){A=E}});return A},partition:function(D,B){D=D?D.bind(B):Prototype.K;var C=[],A=[];this.each(function(F,E){(D(F,E)?C:A).push(F)});return[C,A]},pluck:function(B){var A=[];this.each(function(C){A.push(C[B])});return A},reject:function(C,B){C=C.bind(B);var A=[];this.each(function(E,D){if(!C(E,D)){A.push(E)}});return A},sortBy:function(B,A){B=B.bind(A);return this.map(function(D,C){return{value:D,criteria:B(D,C)}}).sort(function(F,E){var D=F.criteria,C=E.criteria;return D<C?-1:D>C?1:0}).pluck("value")},toArray:function(){return this.map()},zip:function(){var B=Prototype.K,A=$A(arguments);if(Object.isFunction(A.last())){B=A.pop()}var C=[this].concat(A).map($A);return this.map(function(E,D){return B(C.pluck(D))})},size:function(){return this.toArray().length},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">"}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(C){if(!C){return[]}if(C.toArray){return C.toArray()}var B=C.length||0,A=new Array(B);while(B--){A[B]=C[B]}return A}if(Prototype.Browser.WebKit){$A=function(C){if(!C){return[]}if(!(Object.isFunction(C)&&C=="[object NodeList]")&&C.toArray){return C.toArray()}var B=C.length||0,A=new Array(B);while(B--){A[B]=C[B]}return A}}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse}Object.extend(Array.prototype,{_each:function(B){for(var A=0,C=this.length;A<C;A++){B(this[A])}},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(A){return A!=null})},flatten:function(){return this.inject([],function(B,A){return B.concat(Object.isArray(A)?A.flatten():[A])})},without:function(){var A=$A(arguments);return this.select(function(B){return !A.include(B)})},reverse:function(A){return(A!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(A){return this.inject([],function(D,C,B){if(0==B||(A?D.last()!=C:!D.include(C))){D.push(C)}return D})},intersect:function(A){return this.uniq().findAll(function(B){return A.detect(function(C){return B===C})})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]"},toJSON:function(){var A=[];this.each(function(B){var C=Object.toJSON(B);if(!Object.isUndefined(C)){A.push(C)}});return"["+A.join(", ")+"]"}});if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(C,A){A||(A=0);var B=this.length;if(A<0){A=B+A}for(;A<B;A++){if(this[A]===C){return A}}return -1}}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(B,A){A=isNaN(A)?this.length:(A<0?this.length+A:A)+1;var C=this.slice(0,A).reverse().indexOf(B);return(C<0)?C:A-C-1}}Array.prototype.toArray=Array.prototype.clone;function $w(A){if(!Object.isString(A)){return[]}A=A.strip();return A?A.split(/\s+/):[]}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var E=[];for(var B=0,C=this.length;B<C;B++){E.push(this[B])}for(var B=0,C=arguments.length;B<C;B++){if(Object.isArray(arguments[B])){for(var A=0,D=arguments[B].length;A<D;A++){E.push(arguments[B][A])}}else{E.push(arguments[B])}}return E}}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(A){$R(0,this,true).each(A);return this},toPaddedString:function(C,B){var A=this.toString(B||10);return"0".times(C-A.length)+A},toJSON:function(){return isFinite(this)?this.toString():"null"}});$w("abs round ceil floor").each(function(A){Number.prototype[A]=Math[A].methodize()});function $H(A){return new Hash(A)}var Hash=Class.create(Enumerable,(function(){function A(B,C){if(Object.isUndefined(C)){return B}return B+"="+encodeURIComponent(String.interpret(C))}return{initialize:function(B){this._object=Object.isHash(B)?B.toObject():Object.clone(B)},_each:function(C){for(var B in this._object){var D=this._object[B],E=[B,D];E.key=B;E.value=D;C(E)}},set:function(B,C){return this._object[B]=C},get:function(B){return this._object[B]},unset:function(B){var C=this._object[B];delete this._object[B];return C},toObject:function(){return Object.clone(this._object)},keys:function(){return this.pluck("key")},values:function(){return this.pluck("value")},index:function(C){var B=this.detect(function(D){return D.value===C});return B&&B.key},merge:function(B){return this.clone().update(B)},update:function(B){return new Hash(B).inject(this,function(C,D){C.set(D.key,D.value);return C})},toQueryString:function(){return this.map(function(D){var C=encodeURIComponent(D.key),B=D.value;if(B&&typeof B=="object"){if(Object.isArray(B)){return B.map(A.curry(C)).join("&")}}return A(C,B)}).join("&")},inspect:function(){return"#<Hash:{"+this.map(function(B){return B.map(Object.inspect).join(": ")}).join(", ")+"}>"},toJSON:function(){return Object.toJSON(this.toObject())},clone:function(){return new Hash(this)}}})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(C,A,B){this.start=C;this.end=A;this.exclusive=B},_each:function(A){var B=this.start;while(this.include(B)){A(B);B=B.succ()}},include:function(A){if(A<this.start){return false}if(this.exclusive){return A<this.end}return A<=this.end}});var $R=function(C,A,B){return new ObjectRange(C,A,B)};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(A){this.responders._each(A)},register:function(A){if(!this.include(A)){this.responders.push(A)}},unregister:function(A){this.responders=this.responders.without(A)},dispatch:function(D,B,C,A){this.each(function(E){if(Object.isFunction(E[D])){try{E[D].apply(E,[B,C,A])}catch(F){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(A){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,A||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,B,A){$super(A);this.transport=Ajax.getTransport();this.request(B)},request:function(B){this.url=B;this.method=this.options.method;var D=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){D._method=this.method;this.method="post"}this.parameters=D;if(D=Object.toQueryString(D)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+D}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){D+="&_="}}}try{var A=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(A)}Ajax.Responders.dispatch("onCreate",this,A);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||D):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(C){this.dispatchException(C)}},onStateChange:function(){var A=this.transport.readyState;if(A>1&&!((A==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var E={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){E["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){E.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var C=this.options.requestHeaders;if(Object.isFunction(C.push)){for(var B=0,D=C.length;B<D;B+=2){E[C[B]]=C[B+1]}}else{$H(C).each(function(F){E[F.key]=F.value})}}for(var A in E){this.transport.setRequestHeader(A,E[A])}},success:function(){var A=this.getStatus();return !A||(A>=200&&A<300)},getStatus:function(){try{return this.transport.status||0}catch(A){return 0}},respondToReadyState:function(A){var C=Ajax.Request.Events[A],B=new Ajax.Response(this);if(C=="Complete"){try{this._complete=true;(this.options["on"+B.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(B,B.headerJSON)}catch(D){this.dispatchException(D)}var E=B.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&E&&E.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+C]||Prototype.emptyFunction)(B,B.headerJSON);Ajax.Responders.dispatch("on"+C,this,B,B.headerJSON)}catch(D){this.dispatchException(D)}if(C=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var A=this.url.match(/^\s*https?:\/\/[^\/]*/);return !A||(A[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(A){try{return this.transport.getResponseHeader(A)||null}catch(B){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(A){(this.options.onException||Prototype.emptyFunction)(this,A);Ajax.Responders.dispatch("onException",this,A)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(C){this.request=C;var D=this.transport=C.transport,A=this.readyState=D.readyState;if((A>2&&!Prototype.Browser.IE)||A==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(D.responseText);this.headerJSON=this._getHeaderJSON()}if(A==4){var B=D.responseXML;this.responseXML=Object.isUndefined(B)?null:B;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(A){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(A){return null}},getResponseHeader:function(A){return this.transport.getResponseHeader(A)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var A=this.getHeader("X-JSON");if(!A){return null}A=decodeURIComponent(escape(A));try{return A.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(B){this.request.dispatchException(B)}},_getResponseJSON:function(){var A=this.request.options;if(!A.evalJSON||(A.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(A.sanitizeJSON||!this.request.isSameOrigin())}catch(B){this.request.dispatchException(B)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,A,C,B){this.container={success:(A.success||A),failure:(A.failure||(A.success?null:A))};B=Object.clone(B);var D=B.onComplete;B.onComplete=(function(E,F){this.updateContent(E.responseText);if(Object.isFunction(D)){D(E,F)}}).bind(this);$super(C,B)},updateContent:function(D){var C=this.container[this.success()?"success":"failure"],A=this.options;if(!A.evalScripts){D=D.stripScripts()}if(C=$(C)){if(A.insertion){if(Object.isString(A.insertion)){var B={};B[A.insertion]=D;C.insert(B)}else{A.insertion(C,D)}}else{C.update(D)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,A,C,B){$super(B);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=A;this.url=C;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(A){if(this.options.decay){this.decay=(A.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=A.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(B){if(arguments.length>1){for(var A=0,D=[],C=arguments.length;A<C;A++){D.push($(arguments[A]))}return D}if(Object.isString(B)){B=document.getElementById(B)}return Element.extend(B)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(F,A){var C=[];var E=document.evaluate(F,$(A)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var B=0,D=E.snapshotLength;B<D;B++){C.push(Element.extend(E.snapshotItem(B)))}return C}}if(!window.Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(){var A=this.Element;this.Element=function(D,C){C=C||{};D=D.toLowerCase();var B=Element.cache;if(Prototype.Browser.IE&&C.name){D="<"+D+' name="'+C.name+'">';delete C.name;return Element.writeAttribute(document.createElement(D),C)}if(!B[D]){B[D]=Element.extend(document.createElement(D))}return Element.writeAttribute(B[D].cloneNode(false),C)};Object.extend(this.Element,A||{})}).call(window);Element.cache={};Element.Methods={visible:function(A){return $(A).style.display!="none"},toggle:function(A){A=$(A);Element[Element.visible(A)?"hide":"show"](A);return A},hide:function(A){$(A).style.display="none";return A},show:function(A){$(A).style.display="";return A},remove:function(A){A=$(A);A.parentNode.removeChild(A);return A},update:function(A,B){A=$(A);if(B&&B.toElement){B=B.toElement()}if(Object.isElement(B)){return A.update().insert(B)}B=Object.toHTML(B);A.innerHTML=B.stripScripts();B.evalScripts.bind(B).defer();return A},replace:function(B,C){B=$(B);if(C&&C.toElement){C=C.toElement()}else{if(!Object.isElement(C)){C=Object.toHTML(C);var A=B.ownerDocument.createRange();A.selectNode(B);C.evalScripts.bind(C).defer();C=A.createContextualFragment(C.stripScripts())}}B.parentNode.replaceChild(C,B);return B},insert:function(C,E){C=$(C);if(Object.isString(E)||Object.isNumber(E)||Object.isElement(E)||(E&&(E.toElement||E.toHTML))){E={bottom:E}}var D,F,B,G;for(var A in E){D=E[A];A=A.toLowerCase();F=Element._insertionTranslations[A];if(D&&D.toElement){D=D.toElement()}if(Object.isElement(D)){F(C,D);continue}D=Object.toHTML(D);B=((A=="before"||A=="after")?C.parentNode:C).tagName.toUpperCase();G=Element._getContentFromAnonymousElement(B,D.stripScripts());if(A=="top"||A=="after"){G.reverse()}G.each(F.curry(C));D.evalScripts.bind(D).defer()}return C},wrap:function(B,C,A){B=$(B);if(Object.isElement(C)){$(C).writeAttribute(A||{})}else{if(Object.isString(C)){C=new Element(C,A)}else{C=new Element("div",C)}}if(B.parentNode){B.parentNode.replaceChild(C,B)}C.appendChild(B);return C},inspect:function(B){B=$(B);var A="<"+B.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(F){var E=F.first(),C=F.last();var D=(B[E]||"").toString();if(D){A+=" "+C+"="+D.inspect(true)}});return A+">"},recursivelyCollect:function(A,C){A=$(A);var B=[];while(A=A[C]){if(A.nodeType==1){B.push(Element.extend(A))}}return B},ancestors:function(A){return $(A).recursivelyCollect("parentNode")},descendants:function(A){return $(A).select("*")},firstDescendant:function(A){A=$(A).firstChild;while(A&&A.nodeType!=1){A=A.nextSibling}return $(A)},immediateDescendants:function(A){if(!(A=$(A).firstChild)){return[]}while(A&&A.nodeType!=1){A=A.nextSibling}if(A){return[A].concat($(A).nextSiblings())}return[]},previousSiblings:function(A){return $(A).recursivelyCollect("previousSibling")},nextSiblings:function(A){return $(A).recursivelyCollect("nextSibling")},siblings:function(A){A=$(A);return A.previousSiblings().reverse().concat(A.nextSiblings())},match:function(B,A){if(Object.isString(A)){A=new Selector(A)}return A.match($(B))},up:function(B,D,A){B=$(B);if(arguments.length==1){return $(B.parentNode)}var C=B.ancestors();return Object.isNumber(D)?C[D]:Selector.findElement(C,D,A)},down:function(B,C,A){B=$(B);if(arguments.length==1){return B.firstDescendant()}return Object.isNumber(C)?B.descendants()[C]:B.select(C)[A||0]},previous:function(B,D,A){B=$(B);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(B))}var C=B.previousSiblings();return Object.isNumber(D)?C[D]:Selector.findElement(C,D,A)},next:function(C,D,B){C=$(C);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(C))}var A=C.nextSiblings();return Object.isNumber(D)?A[D]:Selector.findElement(A,D,B)},select:function(){var A=$A(arguments),B=$(A.shift());return Selector.findChildElements(B,A)},adjacent:function(){var A=$A(arguments),B=$(A.shift());return Selector.findChildElements(B.parentNode,A).without(B)},identify:function(B){B=$(B);var C=B.readAttribute("id"),A=arguments.callee;if(C){return C}do{C="anonymous_element_"+A.counter++}while($(C));B.writeAttribute("id",C);return C},readAttribute:function(C,A){C=$(C);if(Prototype.Browser.IE){var B=Element._attributeTranslations.read;if(B.values[A]){return B.values[A](C,A)}if(B.names[A]){A=B.names[A]}if(A.include(":")){return(!C.attributes||!C.attributes[A])?null:C.attributes[A].value}}return C.getAttribute(A)},writeAttribute:function(E,C,F){E=$(E);var B={},D=Element._attributeTranslations.write;if(typeof C=="object"){B=C}else{B[C]=Object.isUndefined(F)?true:F}for(var A in B){C=D.names[A]||A;F=B[A];if(D.values[A]){C=D.values[A](E,F)}if(F===false||F===null){E.removeAttribute(C)}else{if(F===true){E.setAttribute(C,C)}else{E.setAttribute(C,F)}}}return E},getHeight:function(A){return $(A).getDimensions().height},getWidth:function(A){return $(A).getDimensions().width},classNames:function(A){return new Element.ClassNames(A)},hasClassName:function(A,B){if(!(A=$(A))){return }var C=A.className;return(C.length>0&&(C==B||new RegExp("(^|\\s)"+B+"(\\s|$)").test(C)))},addClassName:function(A,B){if(!(A=$(A))){return }if(!A.hasClassName(B)){A.className+=(A.className?" ":"")+B}return A},removeClassName:function(A,B){if(!(A=$(A))){return }A.className=A.className.replace(new RegExp("(^|\\s+)"+B+"(\\s+|$)")," ").strip();return A},toggleClassName:function(A,B){if(!(A=$(A))){return }return A[A.hasClassName(B)?"removeClassName":"addClassName"](B)},cleanWhitespace:function(B){B=$(B);var C=B.firstChild;while(C){var A=C.nextSibling;if(C.nodeType==3&&!/\S/.test(C.nodeValue)){B.removeChild(C)}C=A}return B},empty:function(A){return $(A).innerHTML.blank()},descendantOf:function(D,C){D=$(D),C=$(C);var F=C;if(D.compareDocumentPosition){return(D.compareDocumentPosition(C)&8)===8}if(D.sourceIndex&&!Prototype.Browser.Opera){var E=D.sourceIndex,B=C.sourceIndex,A=C.nextSibling;if(!A){do{C=C.parentNode}while(!(A=C.nextSibling)&&C.parentNode)}if(A&&A.sourceIndex){return(E>B&&E<A.sourceIndex)}}while(D=D.parentNode){if(D==F){return true}}return false},scrollTo:function(A){A=$(A);var B=A.cumulativeOffset();window.scrollTo(B[0],B[1]);return A},getStyle:function(B,C){B=$(B);C=C=="float"?"cssFloat":C.camelize();var D=B.style[C];if(!D){var A=document.defaultView.getComputedStyle(B,null);D=A?A[C]:null}if(C=="opacity"){return D?parseFloat(D):1}return D=="auto"?null:D},getOpacity:function(A){return $(A).getStyle("opacity")},setStyle:function(B,C){B=$(B);var E=B.style,A;if(Object.isString(C)){B.style.cssText+=";"+C;return C.include("opacity")?B.setOpacity(C.match(/opacity:\s*(\d?\.?\d*)/)[1]):B}for(var D in C){if(D=="opacity"){B.setOpacity(C[D])}else{E[(D=="float"||D=="cssFloat")?(Object.isUndefined(E.styleFloat)?"cssFloat":"styleFloat"):D]=C[D]}}return B},setOpacity:function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;return A},getDimensions:function(C){C=$(C);var G=$(C).getStyle("display");if(G!="none"&&G!=null){return{width:C.offsetWidth,height:C.offsetHeight}}var B=C.style;var F=B.visibility;var D=B.position;var A=B.display;B.visibility="hidden";B.position="absolute";B.display="block";var H=C.clientWidth;var E=C.clientHeight;B.display=A;B.position=D;B.visibility=F;return{width:H,height:E}},makePositioned:function(A){A=$(A);var B=Element.getStyle(A,"position");if(B=="static"||!B){A._madePositioned=true;A.style.position="relative";if(window.opera){A.style.top=0;A.style.left=0}}return A},undoPositioned:function(A){A=$(A);if(A._madePositioned){A._madePositioned=undefined;A.style.position=A.style.top=A.style.left=A.style.bottom=A.style.right=""}return A},makeClipping:function(A){A=$(A);if(A._overflow){return A}A._overflow=Element.getStyle(A,"overflow")||"auto";if(A._overflow!=="hidden"){A.style.overflow="hidden"}return A},undoClipping:function(A){A=$(A);if(!A._overflow){return A}A.style.overflow=A._overflow=="auto"?"":A._overflow;A._overflow=null;return A},cumulativeOffset:function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;B=B.offsetParent}while(B);return Element._returnOffset(C,A)},positionedOffset:function(B){var A=0,D=0;do{A+=B.offsetTop||0;D+=B.offsetLeft||0;B=B.offsetParent;if(B){if(B.tagName=="BODY"){break}var C=Element.getStyle(B,"position");if(C!=="static"){break}}}while(B);return Element._returnOffset(D,A)},absolutize:function(B){B=$(B);if(B.getStyle("position")=="absolute"){return }var D=B.positionedOffset();var F=D[1];var E=D[0];var C=B.clientWidth;var A=B.clientHeight;B._originalLeft=E-parseFloat(B.style.left||0);B._originalTop=F-parseFloat(B.style.top||0);B._originalWidth=B.style.width;B._originalHeight=B.style.height;B.style.position="absolute";B.style.top=F+"px";B.style.left=E+"px";B.style.width=C+"px";B.style.height=A+"px";return B},relativize:function(A){A=$(A);if(A.getStyle("position")=="relative"){return }A.style.position="relative";var C=parseFloat(A.style.top||0)-(A._originalTop||0);var B=parseFloat(A.style.left||0)-(A._originalLeft||0);A.style.top=C+"px";A.style.left=B+"px";A.style.height=A._originalHeight;A.style.width=A._originalWidth;return A},cumulativeScrollOffset:function(B){var A=0,C=0;do{A+=B.scrollTop||0;C+=B.scrollLeft||0;B=B.parentNode}while(B);return Element._returnOffset(C,A)},getOffsetParent:function(A){if(A.offsetParent){return $(A.offsetParent)}if(A==document.body){return $(A)}while((A=A.parentNode)&&A!=document.body){if(Element.getStyle(A,"position")!="static"){return $(A)}}return $(document.body)},viewportOffset:function(D){var A=0,C=0;var B=D;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;if(B.offsetParent==document.body&&Element.getStyle(B,"position")=="absolute"){break}}while(B=B.offsetParent);B=D;do{if(!Prototype.Browser.Opera||B.tagName=="BODY"){A-=B.scrollTop||0;C-=B.scrollLeft||0}}while(B=B.parentNode);return Element._returnOffset(C,A)},clonePosition:function(B,D){var A=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});D=$(D);var E=D.viewportOffset();B=$(B);var F=[0,0];var C=null;if(Element.getStyle(B,"position")=="absolute"){C=B.getOffsetParent();F=C.viewportOffset()}if(C==document.body){F[0]-=document.body.offsetLeft;F[1]-=document.body.offsetTop}if(A.setLeft){B.style.left=(E[0]-F[0]+A.offsetLeft)+"px"}if(A.setTop){B.style.top=(E[1]-F[1]+A.offsetTop)+"px"}if(A.setWidth){B.style.width=D.offsetWidth+"px"}if(A.setHeight){B.style.height=D.offsetHeight+"px"}return B}};Element.Methods.identify.counter=1;Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(D,B,C){switch(C){case"left":case"top":case"right":case"bottom":if(D(B,"position")==="static"){return null}case"height":case"width":if(!Element.visible(B)){return null}var E=parseInt(D(B,C),10);if(E!==B["offset"+C.capitalize()]){return E+"px"}var A;if(C==="height"){A=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{A=["border-left-width","padding-left","padding-right","border-right-width"]}return A.inject(E,function(F,G){var H=D(B,G);return H===null?F:F-parseInt(H,10)})+"px";default:return D(B,C)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(C,A,B){if(B==="title"){return A.title}return C(A,B)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(C,B){B=$(B);var A=B.getStyle("position");if(A!=="static"){return C(B)}B.setStyle({position:"relative"});var D=C(B);B.setStyle({position:A});return D});$w("positionedOffset viewportOffset").each(function(A){Element.Methods[A]=Element.Methods[A].wrap(function(E,C){C=$(C);var B=C.getStyle("position");if(B!=="static"){return E(C)}var D=C.getOffsetParent();if(D&&D.getStyle("position")==="fixed"){D.setStyle({zoom:1})}C.setStyle({position:"relative"});var F=E(C);C.setStyle({position:B});return F})});Element.Methods.getStyle=function(A,B){A=$(A);B=(B=="float"||B=="cssFloat")?"styleFloat":B.camelize();var C=A.style[B];if(!C&&A.currentStyle){C=A.currentStyle[B]}if(B=="opacity"){if(C=(A.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(C[1]){return parseFloat(C[1])/100}}return 1}if(C=="auto"){if((B=="width"||B=="height")&&(A.getStyle("display")!="none")){return A["offset"+B.capitalize()]+"px"}return null}return C};Element.Methods.setOpacity=function(B,E){function F(G){return G.replace(/alpha\([^\)]*\)/gi,"")}B=$(B);var A=B.currentStyle;if((A&&!A.hasLayout)||(!A&&B.style.zoom=="normal")){B.style.zoom=1}var D=B.getStyle("filter"),C=B.style;if(E==1||E===""){(D=F(D))?C.filter=D:C.removeAttribute("filter");return B}else{if(E<0.00001){E=0}}C.filter=F(D)+"alpha(opacity="+(E*100)+")";return B};Element._attributeTranslations={read:{names:{"class":"className","for":"htmlFor"},values:{_getAttr:function(A,B){return A.getAttribute(B,2)},_getAttrNode:function(A,C){var B=A.getAttributeNode(C);return B?B.value:""},_getEv:function(A,B){B=A.getAttribute(B);return B?B.toString().slice(23,-2):null},_flag:function(A,B){return $(A).hasAttribute(B)?B:null},style:function(A){return A.style.cssText.toLowerCase()},title:function(A){return A.title}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(A,B){A.checked=!!B},style:function(A,B){A.style.cssText=B?B:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc").each(function(A){Element._attributeTranslations.write.names[A.toLowerCase()]=A;Element._attributeTranslations.has[A.toLowerCase()]=A});(function(A){Object.extend(A,{href:A._getAttr,src:A._getAttr,type:A._getAttr,action:A._getAttrNode,disabled:A._flag,checked:A._flag,readonly:A._flag,multiple:A._flag,onload:A._getEv,onunload:A._getEv,onclick:A._getEv,ondblclick:A._getEv,onmousedown:A._getEv,onmouseup:A._getEv,onmouseover:A._getEv,onmousemove:A._getEv,onmouseout:A._getEv,onfocus:A._getEv,onblur:A._getEv,onkeypress:A._getEv,onkeydown:A._getEv,onkeyup:A._getEv,onsubmit:A._getEv,onreset:A._getEv,onselect:A._getEv,onchange:A._getEv})})(Element._attributeTranslations.read.values)}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1)?0.999999:(B==="")?"":(B<0.00001)?0:B;return A}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(A,B){A=$(A);A.style.opacity=(B==1||B==="")?"":(B<0.00001)?0:B;if(B==1){if(A.tagName=="IMG"&&A.width){A.width++;A.width--}else{try{var D=document.createTextNode(" ");A.appendChild(D);A.removeChild(D)}catch(C){}}}return A};Element.Methods.cumulativeOffset=function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;if(B.offsetParent==document.body){if(Element.getStyle(B,"position")=="absolute"){break}}B=B.offsetParent}while(B);return Element._returnOffset(C,A)}}}}}if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(B,C){B=$(B);if(C&&C.toElement){C=C.toElement()}if(Object.isElement(C)){return B.update().insert(C)}C=Object.toHTML(C);var A=B.tagName.toUpperCase();if(A in Element._insertionTranslations.tags){$A(B.childNodes).each(function(D){B.removeChild(D)});Element._getContentFromAnonymousElement(A,C.stripScripts()).each(function(D){B.appendChild(D)})}else{B.innerHTML=C.stripScripts()}C.evalScripts.bind(C).defer();return B}}if("outerHTML" in document.createElement("div")){Element.Methods.replace=function(C,E){C=$(C);if(E&&E.toElement){E=E.toElement()}if(Object.isElement(E)){C.parentNode.replaceChild(E,C);return C}E=Object.toHTML(E);var D=C.parentNode,B=D.tagName.toUpperCase();if(Element._insertionTranslations.tags[B]){var F=C.next();var A=Element._getContentFromAnonymousElement(B,E.stripScripts());D.removeChild(C);if(F){A.each(function(G){D.insertBefore(G,F)})}else{A.each(function(G){D.appendChild(G)})}}else{C.outerHTML=E.stripScripts()}E.evalScripts.bind(E).defer();return C}}Element._returnOffset=function(B,C){var A=[B,C];A.left=B;A.top=C;return A};Element._getContentFromAnonymousElement=function(C,B){var D=new Element("div"),A=Element._insertionTranslations.tags[C];if(A){D.innerHTML=A[0]+B+A[1];A[2].times(function(){D=D.firstChild})}else{D.innerHTML=B}return $A(D.childNodes)};Element._insertionTranslations={before:function(A,B){A.parentNode.insertBefore(B,A)},top:function(A,B){A.insertBefore(B,A.firstChild)},bottom:function(A,B){A.appendChild(B)},after:function(A,B){A.parentNode.insertBefore(B,A.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD})}).call(Element._insertionTranslations);Element.Methods.Simulated={hasAttribute:function(A,C){C=Element._attributeTranslations.has[C]||C;var B=$(A).getAttributeNode(C);return B&&B.specified}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div").__proto__){window.HTMLElement={};window.HTMLElement.prototype=document.createElement("div").__proto__;Prototype.BrowserFeatures.ElementExtensions=true}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K}var A={},B=Element.Methods.ByTag;var C=Object.extend(function(F){if(!F||F._extendedByPrototype||F.nodeType!=1||F==window){return F}var D=Object.clone(A),E=F.tagName,H,G;if(B[E]){Object.extend(D,B[E])}for(H in D){G=D[H];if(Object.isFunction(G)&&!(H in F)){F[H]=G.methodize()}}F._extendedByPrototype=Prototype.emptyFunction;return F},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(A,Element.Methods);Object.extend(A,Element.Methods.Simulated)}}});C.refresh();return C})();Element.hasAttribute=function(A,B){if(A.hasAttribute){return A.hasAttribute(B)}return Element.Methods.Simulated.hasAttribute(A,B)};Element.addMethods=function(C){var I=Prototype.BrowserFeatures,D=Element.Methods.ByTag;if(!C){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var B=C;C=arguments[1]}if(!B){Object.extend(Element.Methods,C||{})}else{if(Object.isArray(B)){B.each(H)}else{H(B)}}function H(F){F=F.toUpperCase();if(!Element.Methods.ByTag[F]){Element.Methods.ByTag[F]={}}Object.extend(Element.Methods.ByTag[F],C)}function A(L,K,F){F=F||false;for(var N in L){var M=L[N];if(!Object.isFunction(M)){continue}if(!F||!(N in K)){K[N]=M.methodize()}}}function E(L){var F;var K={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(K[L]){F="HTML"+K[L]+"Element"}if(window[F]){return window[F]}F="HTML"+L+"Element";if(window[F]){return window[F]}F="HTML"+L.capitalize()+"Element";if(window[F]){return window[F]}window[F]={};window[F].prototype=document.createElement(L).__proto__;return window[F]}if(I.ElementExtensions){A(Element.Methods,HTMLElement.prototype);A(Element.Methods.Simulated,HTMLElement.prototype,true)}if(I.SpecificElementExtensions){for(var J in Element.Methods.ByTag){var G=E(J);if(Object.isUndefined(G)){continue}A(D[J],G.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){var A={};var C=Prototype.Browser;$w("width height").each(function(E){var B=E.capitalize();A[E]=(C.WebKit&&!document.evaluate)?self["inner"+B]:(C.Opera)?document.body["client"+B]:document.documentElement["client"+B]});return A},getWidth:function(){return this.getDimensions().width},getHeight:function(){return this.getDimensions().height},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};var Selector=Class.create({initialize:function(A){this.expression=A.strip();this.compileMatcher()},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath){return false}var A=this.expression;if(Prototype.Browser.WebKit&&(A.include("-of-type")||A.include(":empty"))){return false}if((/(\[[\w-]*?:|:checked)/).test(this.expression)){return false}return true},compileMatcher:function(){if(this.shouldUseXPath()){return this.compileXPathMatcher()}var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return }this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var E=this.expression,F=Selector.patterns,B=Selector.xpath,D,A;if(Selector._cache[E]){this.xpath=Selector._cache[E];return }this.matcher=[".//*"];while(E&&D!=E&&(/\S/).test(E)){D=E;for(var C in F){if(A=E.match(F[C])){this.matcher.push(Object.isFunction(B[C])?B[C](A):new Template(B[C]).evaluate(A));E=E.replace(A[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(A){A=A||document;if(this.xpath){return document._getElementsByXPath(this.xpath,A)}return this.matcher(A)},match:function(H){this.tokens=[];var L=this.expression,A=Selector.patterns,E=Selector.assertions;var B,D,F;while(L&&B!==L&&(/\S/).test(L)){B=L;for(var I in A){D=A[I];if(F=L.match(D)){if(E[I]){this.tokens.push([I,Object.clone(F)]);L=L.replace(F[0],"")}else{return this.findElements(document).include(H)}}}}var K=true,C,J;for(var I=0,G;G=this.tokens[I];I++){C=G[0],J=G[1];if(!Selector.assertions[C](H,J)){K=false;break}}return K},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(A){if(A[1]=="*"){return""}return"[local-name()='"+A[1].toLowerCase()+"' or local-name()='"+A[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(A){A[1]=A[1].toLowerCase();return new Template("[@#{1}]").evaluate(A)},attr:function(A){A[1]=A[1].toLowerCase();A[3]=A[5]||A[6];return new Template(Selector.xpath.operators[A[2]]).evaluate(A)},pseudo:function(A){var B=Selector.xpath.pseudos[A[1]];if(!B){return""}if(Object.isFunction(B)){return B(A)}return new Template(Selector.xpath.pseudos[A[1]]).evaluate(A)},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",checked:"[@checked]",disabled:"[@disabled]",enabled:"[not(@disabled)]",not:function(B){var H=B[6],G=Selector.patterns,A=Selector.xpath,E,C;var F=[];while(H&&E!=H&&(/\S/).test(H)){E=H;for(var D in G){if(B=H.match(G[D])){C=Object.isFunction(A[D])?A[D](B):new Template(A[D]).evaluate(B);F.push("("+C.substring(1,C.length-1)+")");H=H.replace(B[0],"");break}}}return"[not("+F.join(" and ")+")]"},"nth-child":function(A){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",A)},"nth-last-child":function(A){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",A)},"nth-of-type":function(A){return Selector.xpath.pseudos.nth("position() ",A)},"nth-last-of-type":function(A){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",A)},"first-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-of-type"](A)},"last-of-type":function(A){A[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](A)},"only-of-type":function(A){var B=Selector.xpath.pseudos;return B["first-of-type"](A)+B["last-of-type"](A)},nth:function(E,C){var F,G=C[6],B;if(G=="even"){G="2n+0"}if(G=="odd"){G="2n+1"}if(F=G.match(/^(\d+)$/)){return"["+E+"= "+F[1]+"]"}if(F=G.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(F[1]=="-"){F[1]=-1}var D=F[1]?Number(F[1]):1;var A=F[2]?Number(F[2]):0;B="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(B).evaluate({fragment:E,a:D,b:A})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(A){A[3]=(A[5]||A[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(A)},pseudo:function(A){if(A[6]){A[6]=A[6].replace(/"/g,'\\"')}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(A)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(A,B){return B[1].toUpperCase()==A.tagName.toUpperCase()},className:function(A,B){return Element.hasClassName(A,B[1])},id:function(A,B){return A.id===B[1]},attrPresence:function(A,B){return Element.hasAttribute(A,B[1])},attr:function(B,C){var A=Element.readAttribute(B,C[1]);return A&&Selector.operators[C[2]](A,C[5]||C[6])}},handlers:{concat:function(B,A){for(var C=0,D;D=A[C];C++){B.push(D)}return B},mark:function(A){var D=Prototype.emptyFunction;for(var B=0,C;C=A[B];B++){C._countedByPrototype=D}return A},unmark:function(A){for(var B=0,C;C=A[B];B++){C._countedByPrototype=undefined}return A},index:function(A,D,G){A._countedByPrototype=Prototype.emptyFunction;if(D){for(var B=A.childNodes,E=B.length-1,C=1;E>=0;E--){var F=B[E];if(F.nodeType==1&&(!G||F._countedByPrototype)){F.nodeIndex=C++}}}else{for(var E=0,C=1,B=A.childNodes;F=B[E];E++){if(F.nodeType==1&&(!G||F._countedByPrototype)){F.nodeIndex=C++}}}},unique:function(B){if(B.length==0){return B}var D=[],E;for(var C=0,A=B.length;C<A;C++){if(!(E=B[C])._countedByPrototype){E._countedByPrototype=Prototype.emptyFunction;D.push(Element.extend(E))}}return Selector.handlers.unmark(D)},descendant:function(A){var D=Selector.handlers;for(var C=0,B=[],E;E=A[C];C++){D.concat(B,E.getElementsByTagName("*"))}return B},child:function(A){var E=Selector.handlers;for(var D=0,C=[],F;F=A[D];D++){for(var B=0,G;G=F.childNodes[B];B++){if(G.nodeType==1&&G.tagName!="!"){C.push(G)}}}return C},adjacent:function(A){for(var C=0,B=[],E;E=A[C];C++){var D=this.nextElementSibling(E);if(D){B.push(D)}}return B},laterSibling:function(A){var D=Selector.handlers;for(var C=0,B=[],E;E=A[C];C++){D.concat(B,Element.nextSiblings(E))}return B},nextElementSibling:function(A){while(A=A.nextSibling){if(A.nodeType==1){return A}}return null},previousElementSibling:function(A){while(A=A.previousSibling){if(A.nodeType==1){return A}}return null},tagName:function(A,H,C,B){var I=C.toUpperCase();var E=[],G=Selector.handlers;if(A){if(B){if(B=="descendant"){for(var F=0,D;D=A[F];F++){G.concat(E,D.getElementsByTagName(C))}return E}else{A=this[B](A)}if(C=="*"){return A}}for(var F=0,D;D=A[F];F++){if(D.tagName.toUpperCase()===I){E.push(D)}}return E}else{return H.getElementsByTagName(C)}},id:function(B,A,H,F){var G=$(H),D=Selector.handlers;if(!G){return[]}if(!B&&A==document){return[G]}if(B){if(F){if(F=="child"){for(var C=0,E;E=B[C];C++){if(G.parentNode==E){return[G]}}}else{if(F=="descendant"){for(var C=0,E;E=B[C];C++){if(Element.descendantOf(G,E)){return[G]}}}else{if(F=="adjacent"){for(var C=0,E;E=B[C];C++){if(Selector.handlers.previousElementSibling(G)==E){return[G]}}}else{B=D[F](B)}}}}for(var C=0,E;E=B[C];C++){if(E==G){return[G]}}return[]}return(G&&Element.descendantOf(G,A))?[G]:[]},className:function(B,A,C,D){if(B&&D){B=this[D](B)}return Selector.handlers.byClassName(B,A,C)},byClassName:function(C,B,F){if(!C){C=Selector.handlers.descendant([B])}var H=" "+F+" ";for(var E=0,D=[],G,A;G=C[E];E++){A=G.className;if(A.length==0){continue}if(A==F||(" "+A+" ").include(H)){D.push(G)}}return D},attrPresence:function(C,B,A,G){if(!C){C=B.getElementsByTagName("*")}if(C&&G){C=this[G](C)}var E=[];for(var D=0,F;F=C[D];D++){if(Element.hasAttribute(F,A)){E.push(F)}}return E},attr:function(A,I,H,J,C,B){if(!A){A=I.getElementsByTagName("*")}if(A&&B){A=this[B](A)}var K=Selector.operators[C],F=[];for(var E=0,D;D=A[E];E++){var G=Element.readAttribute(D,H);if(G===null){continue}if(K(G,J)){F.push(D)}}return F},pseudo:function(B,C,E,A,D){if(B&&D){B=this[D](B)}if(!B){B=A.getElementsByTagName("*")}return Selector.pseudos[C](B,E,A)}},pseudos:{"first-child":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(Selector.handlers.previousElementSibling(E)){continue}C.push(E)}return C},"last-child":function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(Selector.handlers.nextElementSibling(E)){continue}C.push(E)}return C},"only-child":function(B,G,A){var E=Selector.handlers;for(var D=0,C=[],F;F=B[D];D++){if(!E.previousElementSibling(F)&&!E.nextElementSibling(F)){C.push(F)}}return C},"nth-child":function(B,C,A){return Selector.pseudos.nth(B,C,A)},"nth-last-child":function(B,C,A){return Selector.pseudos.nth(B,C,A,true)},"nth-of-type":function(B,C,A){return Selector.pseudos.nth(B,C,A,false,true)},"nth-last-of-type":function(B,C,A){return Selector.pseudos.nth(B,C,A,true,true)},"first-of-type":function(B,C,A){return Selector.pseudos.nth(B,"1",A,false,true)},"last-of-type":function(B,C,A){return Selector.pseudos.nth(B,"1",A,true,true)},"only-of-type":function(B,D,A){var C=Selector.pseudos;return C["last-of-type"](C["first-of-type"](B,D,A),D,A)},getIndices:function(B,A,C){if(B==0){return A>0?[A]:[]}return $R(1,C).inject([],function(D,E){if(0==(E-A)%B&&(E-A)/B>=0){D.push(E)}return D})},nth:function(A,L,N,K,C){if(A.length==0){return[]}if(L=="even"){L="2n+0"}if(L=="odd"){L="2n+1"}var J=Selector.handlers,I=[],B=[],E;J.mark(A);for(var H=0,D;D=A[H];H++){if(!D.parentNode._countedByPrototype){J.index(D.parentNode,K,C);B.push(D.parentNode)}}if(L.match(/^\d+$/)){L=Number(L);for(var H=0,D;D=A[H];H++){if(D.nodeIndex==L){I.push(D)}}}else{if(E=L.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(E[1]=="-"){E[1]=-1}var O=E[1]?Number(E[1]):1;var M=E[2]?Number(E[2]):0;var P=Selector.pseudos.getIndices(O,M,A.length);for(var H=0,D,F=P.length;D=A[H];H++){for(var G=0;G<F;G++){if(D.nodeIndex==P[G]){I.push(D)}}}}}J.unmark(A);J.unmark(B);return I},empty:function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.tagName=="!"||(E.firstChild&&!E.innerHTML.match(/^\s*$/))){continue}C.push(E)}return C},not:function(A,D,I){var G=Selector.handlers,J,C;var H=new Selector(D).findElements(I);G.mark(H);for(var F=0,E=[],B;B=A[F];F++){if(!B._countedByPrototype){E.push(B)}}G.unmark(H);return E},enabled:function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(!E.disabled){C.push(E)}}return C},disabled:function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.disabled){C.push(E)}}return C},checked:function(B,F,A){for(var D=0,C=[],E;E=B[D];D++){if(E.checked){C.push(E)}}return C}},operators:{"=":function(B,A){return B==A},"!=":function(B,A){return B!=A},"^=":function(B,A){return B.startsWith(A)},"$=":function(B,A){return B.endsWith(A)},"*=":function(B,A){return B.include(A)},"~=":function(B,A){return(" "+B+" ").include(" "+A+" ")},"|=":function(B,A){return("-"+B.toUpperCase()+"-").include("-"+A.toUpperCase()+"-")}},split:function(B){var A=[];B.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(C){A.push(C[1].strip())});return A},matchElements:function(F,G){var E=$$(G),D=Selector.handlers;D.mark(E);for(var C=0,B=[],A;A=F[C];C++){if(A._countedByPrototype){B.push(A)}}D.unmark(E);return B},findElement:function(B,C,A){if(Object.isNumber(C)){A=C;C=false}return Selector.matchElements(B,C||"*")[A||0]},findChildElements:function(E,G){G=Selector.split(G.join(","));var D=[],F=Selector.handlers;for(var C=0,B=G.length,A;C<B;C++){A=new Selector(G[C].strip());F.concat(D,A.findElements(E))}return(B>1)?F.unique(D):D}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(B,A){for(var C=0,D;D=A[C];C++){if(D.tagName!=="!"){B.push(D)}}return B},unmark:function(A){for(var B=0,C;C=A[B];B++){C.removeAttribute("_countedByPrototype")}return A}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(A){$(A).reset();return A},serializeElements:function(G,B){if(typeof B!="object"){B={hash:!!B}}else{if(Object.isUndefined(B.hash)){B.hash=true}}var C,F,A=false,E=B.submit;var D=G.inject({},function(H,I){if(!I.disabled&&I.name){C=I.name;F=$(I).getValue();if(F!=null&&(I.type!="submit"||(!A&&E!==false&&(!E||C==E)&&(A=true)))){if(C in H){if(!Object.isArray(H[C])){H[C]=[H[C]]}H[C].push(F)}else{H[C]=F}}}return H});return B.hash?D:Object.toQueryString(D)}};Form.Methods={serialize:function(B,A){return Form.serializeElements(Form.getElements(B),A)},getElements:function(A){return $A($(A).getElementsByTagName("*")).inject([],function(B,C){if(Form.Element.Serializers[C.tagName.toLowerCase()]){B.push(Element.extend(C))}return B})},getInputs:function(G,C,D){G=$(G);var A=G.getElementsByTagName("input");if(!C&&!D){return $A(A).map(Element.extend)}for(var E=0,H=[],F=A.length;E<F;E++){var B=A[E];if((C&&B.type!=C)||(D&&B.name!=D)){continue}H.push(Element.extend(B))}return H},disable:function(A){A=$(A);Form.getElements(A).invoke("disable");return A},enable:function(A){A=$(A);Form.getElements(A).invoke("enable");return A},findFirstElement:function(B){var C=$(B).getElements().findAll(function(D){return"hidden"!=D.type&&!D.disabled});var A=C.findAll(function(D){return D.hasAttribute("tabIndex")&&D.tabIndex>=0}).sortBy(function(D){return D.tabIndex}).first();return A?A:C.find(function(D){return["input","select","textarea"].include(D.tagName.toLowerCase())})},focusFirstElement:function(A){A=$(A);A.findFirstElement().activate();return A},request:function(B,A){B=$(B),A=Object.clone(A||{});var D=A.parameters,C=B.readAttribute("action")||"";if(C.blank()){C=window.location.href}A.parameters=B.serialize(true);if(D){if(Object.isString(D)){D=D.toQueryParams()}Object.extend(A.parameters,D)}if(B.hasAttribute("method")&&!A.method){A.method=B.method}return new Ajax.Request(C,A)}};Form.Element={focus:function(A){$(A).focus();return A},select:function(A){$(A).select();return A}};Form.Element.Methods={serialize:function(A){A=$(A);if(!A.disabled&&A.name){var B=A.getValue();if(B!=undefined){var C={};C[A.name]=B;return Object.toQueryString(C)}}return""},getValue:function(A){A=$(A);var B=A.tagName.toLowerCase();return Form.Element.Serializers[B](A)},setValue:function(A,B){A=$(A);var C=A.tagName.toLowerCase();Form.Element.Serializers[C](A,B);return A},clear:function(A){$(A).value="";return A},present:function(A){return $(A).value!=""},activate:function(A){A=$(A);try{A.focus();if(A.select&&(A.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(A.type))){A.select()}}catch(B){}return A},disable:function(A){A=$(A);A.blur();A.disabled=true;return A},enable:function(A){A=$(A);A.disabled=false;return A}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(A,B){switch(A.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(A,B);default:return Form.Element.Serializers.textarea(A,B)}},inputSelector:function(A,B){if(Object.isUndefined(B)){return A.checked?A.value:null}else{A.checked=!!B}},textarea:function(A,B){if(Object.isUndefined(B)){return A.value}else{A.value=B}},select:function(D,A){if(Object.isUndefined(A)){return this[D.type=="select-one"?"selectOne":"selectMany"](D)}else{var C,F,G=!Object.isArray(A);for(var B=0,E=D.length;B<E;B++){C=D.options[B];F=this.optionValue(C);if(G){if(F==A){C.selected=true;return }}else{C.selected=A.include(F)}}}},selectOne:function(B){var A=B.selectedIndex;return A>=0?this.optionValue(B.options[A]):null},selectMany:function(D){var A,E=D.length;if(!E){return null}for(var C=0,A=[];C<E;C++){var B=D.options[C];if(B.selected){A.push(this.optionValue(B))}}return A},optionValue:function(A){return Element.extend(A).hasAttribute("value")?A.value:A.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,A,B,C){$super(C,B);this.element=$(A);this.lastValue=this.getValue()},execute:function(){var A=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(A)?this.lastValue!=A:String(this.lastValue)!=String(A)){this.callback(this.element,A);this.lastValue=A}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(A,B){this.element=$(A);this.callback=B;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var A=this.getValue();if(this.lastValue!=A){this.callback(this.element,A);this.lastValue=A}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(A){if(A.type){switch(A.type.toLowerCase()){case"checkbox":case"radio":Event.observe(A,"click",this.onElementEvent.bind(this));break;default:Event.observe(A,"change",this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});if(!window.Event){var Event={}}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(B){var A;switch(B.type){case"mouseover":A=B.fromElement;break;case"mouseout":A=B.toElement;break;default:return null}return Element.extend(A)}});Event.Methods=(function(){var A;if(Prototype.Browser.IE){var B={0:1,1:4,2:2};A=function(D,C){return D.button==B[C]}}else{if(Prototype.Browser.WebKit){A=function(D,C){switch(C){case 0:return D.which==1&&!D.metaKey;case 1:return D.which==1&&D.metaKey;default:return false}}}else{A=function(D,C){return D.which?(D.which===C+1):(D.button===C)}}}return{isLeftClick:function(C){return A(C,0)},isMiddleClick:function(C){return A(C,1)},isRightClick:function(C){return A(C,2)},element:function(D){var C=Event.extend(D).target;return Element.extend(C.nodeType==Node.TEXT_NODE?C.parentNode:C)},findElement:function(D,F){var C=Event.element(D);if(!F){return C}var E=[C].concat(C.ancestors());return Selector.findElement(E,F,0)},pointer:function(C){return{x:C.pageX||(C.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),y:C.pageY||(C.clientY+(document.documentElement.scrollTop||document.body.scrollTop))}},pointerX:function(C){return Event.pointer(C).x},pointerY:function(C){return Event.pointer(C).y},stop:function(C){Event.extend(C);C.preventDefault();C.stopPropagation();C.stopped=true}}})();Event.extend=(function(){var A=Object.keys(Event.Methods).inject({},function(B,C){B[C]=Event.Methods[C].methodize();return B});if(Prototype.Browser.IE){Object.extend(A,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});return function(B){if(!B){return false}if(B._extendedByPrototype){return B}B._extendedByPrototype=Prototype.emptyFunction;var C=Event.pointer(B);Object.extend(B,{target:B.srcElement,relatedTarget:Event.relatedTarget(B),pageX:C.x,pageY:C.y});return Object.extend(B,A)}}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(Event.prototype,A);return Prototype.K}})();Object.extend(Event,(function(){var B=Event.cache;function C(J){if(J._prototypeEventID){return J._prototypeEventID[0]}arguments.callee.id=arguments.callee.id||1;return J._prototypeEventID=[++arguments.callee.id]}function G(J){if(J&&J.include(":")){return"dataavailable"}return J}function A(J){return B[J]=B[J]||{}}function F(L,J){var K=A(L);return K[J]=K[J]||[]}function H(K,J,L){var O=C(K);var N=F(O,J);if(N.pluck("handler").include(L)){return false}var M=function(P){if(!Event||!Event.extend||(P.eventName&&P.eventName!=J)){return false}Event.extend(P);L.call(K,P)};M.handler=L;N.push(M);return M}function I(M,J,K){var L=F(M,J);return L.find(function(N){return N.handler==K})}function D(M,J,K){var L=A(M);if(!L[J]){return false}L[J]=L[J].without(I(M,J,K))}function E(){for(var K in B){for(var J in B[K]){B[K][J]=null}}}if(window.attachEvent){window.attachEvent("onunload",E)}return{observe:function(L,J,M){L=$(L);var K=G(J);var N=H(L,J,M);if(!N){return L}if(L.addEventListener){L.addEventListener(K,N,false)}else{L.attachEvent("on"+K,N)}return L},stopObserving:function(L,J,M){L=$(L);var O=C(L),K=G(J);if(!M&&J){F(O,J).each(function(P){L.stopObserving(J,P.handler)});return L}else{if(!J){Object.keys(A(O)).each(function(P){L.stopObserving(P)});return L}}var N=I(O,J,M);if(!N){return L}if(L.removeEventListener){L.removeEventListener(K,N,false)}else{L.detachEvent("on"+K,N)}D(O,J,M);return L},fire:function(L,K,J){L=$(L);if(L==document&&document.createEvent&&!L.dispatchEvent){L=document.documentElement}var M;if(document.createEvent){M=document.createEvent("HTMLEvents");M.initEvent("dataavailable",true,true)}else{M=document.createEventObject();M.eventType="ondataavailable"}M.eventName=K;M.memo=J||{};if(document.createEvent){L.dispatchEvent(M)}else{L.fireEvent(M.eventType,M)}return Event.extend(M)}}})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});(function(){var B;function A(){if(document.loaded){return }if(B){window.clearInterval(B)}document.fire("dom:loaded");document.loaded=true}if(document.addEventListener){if(Prototype.Browser.WebKit){B=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){A()}},0);Event.observe(window,"load",A)}else{document.addEventListener("DOMContentLoaded",A,false)}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;A()}}}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(A,B){return Element.insert(A,{before:B})},Top:function(A,B){return Element.insert(A,{top:B})},Bottom:function(A,B){return Element.insert(A,{bottom:B})},After:function(A,B){return Element.insert(A,{after:B})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(B,A,C){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(B,A,C)}this.xcomp=A;this.ycomp=C;this.offset=Element.cumulativeOffset(B);return(C>=this.offset[1]&&C<this.offset[1]+B.offsetHeight&&A>=this.offset[0]&&A<this.offset[0]+B.offsetWidth)},withinIncludingScrolloffsets:function(B,A,D){var C=Element.cumulativeScrollOffset(B);this.xcomp=A+C[0]-this.deltaX;this.ycomp=D+C[1]-this.deltaY;this.offset=Element.cumulativeOffset(B);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+B.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+B.offsetWidth)},overlap:function(B,A){if(!B){return 0}if(B=="vertical"){return((this.offset[1]+A.offsetHeight)-this.ycomp)/A.offsetHeight}if(B=="horizontal"){return((this.offset[0]+A.offsetWidth)-this.xcomp)/A.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(A){Position.prepare();return Element.absolutize(A)},relativize:function(A){Position.prepare();return Element.relativize(A)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(B,C,A){A=A||{};return Element.clonePosition(C,B,A)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(B){function A(C){return C.blank()?null:"[contains(concat(' ', @class, ' '), ' "+C+" ')]"}B.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(C,E){E=E.toString().strip();var D=/\s/.test(E)?$w(E).map(A).join(""):A(E);return D?document._getElementsByXPath(".//*"+D,C):[]}:function(E,F){F=F.toString().strip();var G=[],H=(/\s/.test(F)?$w(F):null);if(!H&&!F){return G}var C=$(E).getElementsByTagName("*");F=" "+F+" ";for(var D=0,J,I;J=C[D];D++){if(J.className&&(I=" "+J.className+" ")&&(I.include(F)||(H&&H.all(function(K){return !K.toString().blank()&&I.include(" "+K+" ")})))){G.push(Element.extend(J))}}return G};return function(D,C){return $(C||document.body).getElementsByClassName(D)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(A){this.element=$(A)},_each:function(A){this.element.className.split(/\s+/).select(function(B){return B.length>0})._each(A)},set:function(A){this.element.className=A},add:function(A){if(this.include(A)){return }this.set($A(this).concat(A).join(" "))},remove:function(A){if(!this.include(A)){return }this.set($A(this).without(A).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods();
/*
// script.aculo.us builder.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008

// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
*/
var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(A){A=A.toUpperCase();var F=this.NODEMAP[A]||"div";var B=document.createElement(F);try{B.innerHTML="<"+A+"></"+A+">"}catch(E){}var D=B.firstChild||null;if(D&&(D.tagName.toUpperCase()!=A)){D=D.getElementsByTagName(A)[0]}if(!D){D=document.createElement(A)}if(!D){return }if(arguments[1]){if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)||arguments[1].tagName){this._children(D,arguments[1])}else{var C=this._attributes(arguments[1]);if(C.length){try{B.innerHTML="<"+A+" "+C+"></"+A+">"}catch(E){}D=B.firstChild||null;if(!D){D=document.createElement(A);for(attr in arguments[1]){D[attr=="class"?"className":attr]=arguments[1][attr]}}if(D.tagName.toUpperCase()!=A){D=B.getElementsByTagName(A)[0]}}}}if(arguments[2]){this._children(D,arguments[2])}return D},_text:function(A){return document.createTextNode(A)},ATTR_MAP:{className:"class",htmlFor:"for"},_attributes:function(A){var B=[];for(attribute in A){B.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+A[attribute].toString().escapeHTML().gsub(/"/,"&quot;")+'"')}return B.join(" ")},_children:function(B,A){if(A.tagName){B.appendChild(A);return }if(typeof A=="object"){A.flatten().each(function(C){if(typeof C=="object"){B.appendChild(C)}else{if(Builder._isStringOrNumber(C)){B.appendChild(Builder._text(C))}}})}else{if(Builder._isStringOrNumber(A)){B.appendChild(Builder._text(A))}}},_isStringOrNumber:function(A){return(typeof A=="string"||typeof A=="number")},build:function(B){var A=this.node("div");$(A).update(B.strip());return A.down()},dump:function(B){if(typeof B!="object"&&typeof B!="function"){B=window}var A=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);A.each(function(C){B[C]=function(){return Builder.node.apply(Builder,[C].concat($A(arguments)))}})}}
/*
// script.aculo.us effects.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008

// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Contributors:
//  Justin Palmer (http://encytemedia.com/)
//  Mark Pilgrim (http://diveintomark.org/)
//  Martin Bialasinki
// 
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/ 
*/
;String.prototype.parseColor=function(){var A="#";if(this.slice(0,4)=="rgb("){var C=this.slice(4,this.length-1).split(",");var B=0;do{A+=parseInt(C[B]).toColorPart()}while(++B<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var B=1;B<4;B++){A+=(this.charAt(B)+this.charAt(B)).toLowerCase()}}if(this.length==7){A=this.toLowerCase()}}}return(A.length==7?A:(arguments[0]||this))};Element.collectTextNodes=function(A){return $A($(A).childNodes).collect(function(B){return(B.nodeType==3?B.nodeValue:(B.hasChildNodes()?Element.collectTextNodes(B):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(A,B){return $A($(A).childNodes).collect(function(C){return(C.nodeType==3?C.nodeValue:((C.hasChildNodes()&&!Element.hasClassName(C,B))?Element.collectTextNodesIgnoreClass(C,B):""))}).flatten().join("")};Element.setContentZoom=function(A,B){A=$(A);A.setStyle({fontSize:(B/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return A};Element.getInlineOpacity=function(A){return $(A).style.opacity||""};Element.forceRerendering=function(A){try{A=$(A);var C=document.createTextNode(" ");A.appendChild(C);A.removeChild(C)}catch(B){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(A){return(-Math.cos(A*Math.PI)/2)+0.5},reverse:function(A){return 1-A},flicker:function(A){var A=((-Math.cos(A*Math.PI)/4)+0.75)+Math.random()/4;return A>1?1:A},wobble:function(A){return(-Math.cos(A*Math.PI*(9*A))/2)+0.5},pulse:function(B,A){A=A||5;return(((B%(1/A))*A).round()==0?((B*A*2)-(B*A*2).floor()):1-((B*A*2)-(B*A*2).floor()))},spring:function(A){return 1-(Math.cos(A*4.5*Math.PI)*Math.exp(-A*6))},none:function(A){return 0},full:function(A){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(A){var B="position:relative";if(Prototype.Browser.IE){B+=";zoom:1"}A=$(A);$A(A.childNodes).each(function(C){if(C.nodeType==3){C.nodeValue.toArray().each(function(D){A.insertBefore(new Element("span",{style:B}).update(D==" "?String.fromCharCode(160):D),C)});Element.remove(C)}})},multiple:function(B,C){var E;if(((typeof B=="object")||Object.isFunction(B))&&(B.length)){E=B}else{E=$(B).childNodes}var A=Object.extend({speed:0.1,delay:0},arguments[2]||{});var D=A.delay;$A(E).each(function(G,F){new C(G,Object.extend(A,{delay:F*A.speed+D}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(B,C){B=$(B);C=(C||"appear").toLowerCase();var A=Object.extend({queue:{position:"end",scope:(B.id||"global"),limit:1}},arguments[2]||{});Effect[B.visible()?Effect.PAIRS[C][1]:Effect.PAIRS[C][0]](B,A)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(A){this.effects._each(A)},add:function(B){var C=new Date().getTime();var A=Object.isString(B.options.queue)?B.options.queue:B.options.queue.position;switch(A){case"front":this.effects.findAll(function(D){return D.state=="idle"}).each(function(D){D.startOn+=B.finishOn;D.finishOn+=B.finishOn});break;case"with-last":C=this.effects.pluck("startOn").max()||C;break;case"end":C=this.effects.pluck("finishOn").max()||C;break}B.startOn+=C;B.finishOn+=C;if(!B.options.queue.limit||(this.effects.length<B.options.queue.limit)){this.effects.push(B)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(A){this.effects=this.effects.reject(function(B){return B==A});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var C=new Date().getTime();for(var B=0,A=this.effects.length;B<A;B++){this.effects[B]&&this.effects[B].loop(C)}}});Effect.Queues={instances:$H(),get:function(A){if(!Object.isString(A)){return A}return this.instances.get(A)||this.instances.set(A,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get("global");Effect.Base=Class.create({position:null,start:function(options){function codeForEvent(options,eventName){return((options[eventName+"Internal"]?"this.options."+eventName+"Internal(this);":"")+(options[eventName]?"this.options."+eventName+"(this);":""))}if(options&&options.transition===false){options.transition=Effect.Transitions.linear}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),options||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;eval('this.render = function(pos){ if (this.state=="idle"){this.state="running";'+codeForEvent(this.options,"beforeSetup")+(this.setup?"this.setup();":"")+codeForEvent(this.options,"afterSetup")+'};if (this.state=="running"){pos=this.options.transition(pos)*'+this.fromToDelta+"+"+this.options.from+";this.position=pos;"+codeForEvent(this.options,"beforeUpdate")+(this.update?"this.update(pos);":"")+codeForEvent(this.options,"afterUpdate")+"}}");this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)}},loop:function(C){if(C>=this.startOn){if(C>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return }var B=(C-this.startOn)/this.totalTime,A=(B*this.totalFrames).round();if(A>this.currentFrame){this.render(B);this.currentFrame=A}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(A){if(this.options[A+"Internal"]){this.options[A+"Internal"](this)}if(this.options[A]){this.options[A](this)}},inspect:function(){var A=$H();for(property in this){if(!Object.isFunction(this[property])){A.set(property,this[property])}}return"#<Effect:"+A.inspect()+",options:"+$H(this.options).inspect()+">"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(A){this.effects=A||[];this.start(arguments[1])},update:function(A){this.effects.invoke("render",A)},finish:function(A){this.effects.each(function(B){B.render(1);B.cancel();B.event("beforeFinish");if(B.finish){B.finish(A)}B.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(C,F,E){C=Object.isString(C)?$(C):C;var B=$A(arguments),D=B.last(),A=B.length==5?B[3]:null;this.method=Object.isFunction(D)?D.bind(C):Object.isFunction(C[D])?C[D].bind(C):function(G){C[D]=G};this.start(Object.extend({from:F,to:E},A||{}))},update:function(A){this.method(A)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(B){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var A=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(A)},update:function(A){this.element.setOpacity(A)}});Effect.Move=Class.create(Effect.Base,{initialize:function(B){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}var A=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(A)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(A){this.element.setStyle({left:(this.options.x*A+this.originalLeft).round()+"px",top:(this.options.y*A+this.originalTop).round()+"px"})}});Effect.MoveBy=function(B,A,C){return new Effect.Move(B,Object.extend({x:C,y:A},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(B,C){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}var A=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:C},arguments[2]||{});this.start(A)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(B){this.originalStyle[B]=this.element.style[B]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var A=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(B){if(A.indexOf(B)>0){this.fontSize=parseFloat(A);this.fontSizeType=B}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(A){var B=(this.options.scaleFrom/100)+(this.factor*A);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*B+this.fontSizeType})}this.setDimensions(this.dims[0]*B,this.dims[1]*B)},finish:function(A){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(A,D){var E={};if(this.options.scaleX){E.width=D.round()+"px"}if(this.options.scaleY){E.height=A.round()+"px"}if(this.options.scaleFromCenter){var C=(A-this.dims[0])/2;var B=(D-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){E.top=this.originalTop-C+"px"}if(this.options.scaleX){E.left=this.originalLeft-B+"px"}}else{if(this.options.scaleY){E.top=-C+"px"}if(this.options.scaleX){E.left=-B+"px"}}}this.element.setStyle(E)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(B){this.element=$(B);if(!this.element){throw (Effect._elementDoesNotExistError)}var A=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(A)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return }this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(A){return parseInt(this.options.startcolor.slice(A*2+1,A*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(A){return parseInt(this.options.endcolor.slice(A*2+1,A*2+3),16)-this._base[A]}.bind(this))},update:function(A){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(B,C,D){return B+((this._base[D]+(this._delta[D]*A)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(D){var C=arguments[1]||{},B=document.viewport.getScrollOffsets(),E=$(D).cumulativeOffset(),A=(window.height||document.body.scrollHeight)-document.viewport.getHeight();if(C.offset){E[1]+=C.offset}return new Effect.Tween(null,B.top,E[1]>A?A:E[1],C,function(F){scrollTo(B.left,F.round())})};Effect.Fade=function(C){C=$(C);var A=C.getInlineOpacity();var B=Object.extend({from:C.getOpacity()||1,to:0,afterFinishInternal:function(D){if(D.options.to!=0){return }D.element.hide().setStyle({opacity:A})}},arguments[1]||{});return new Effect.Opacity(C,B)};Effect.Appear=function(B){B=$(B);var A=Object.extend({from:(B.getStyle("display")=="none"?0:B.getOpacity()||0),to:1,afterFinishInternal:function(C){C.element.forceRerendering()},beforeSetup:function(C){C.element.setOpacity(C.options.from).show()}},arguments[1]||{});return new Effect.Opacity(B,A)};Effect.Puff=function(B){B=$(B);var A={opacity:B.getInlineOpacity(),position:B.getStyle("position"),top:B.style.top,left:B.style.left,width:B.style.width,height:B.style.height};return new Effect.Parallel([new Effect.Scale(B,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(B,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(C){Position.absolutize(C.effects[0].element)},afterFinishInternal:function(C){C.effects[0].element.hide().setStyle(A)}},arguments[1]||{}))};Effect.BlindUp=function(A){A=$(A);A.makeClipping();return new Effect.Scale(A,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(B){B.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(B){B=$(B);var A=B.getDimensions();return new Effect.Scale(B,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:A.height,originalWidth:A.width},restoreAfterFinish:true,afterSetup:function(C){C.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(C){C.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(B){B=$(B);var A=B.getInlineOpacity();return new Effect.Appear(B,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(C){new Effect.Scale(C.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(D){D.element.makePositioned().makeClipping()},afterFinishInternal:function(D){D.element.hide().undoClipping().undoPositioned().setStyle({opacity:A})}})}},arguments[1]||{}))};Effect.DropOut=function(B){B=$(B);var A={top:B.getStyle("top"),left:B.getStyle("left"),opacity:B.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(B,{x:0,y:100,sync:true}),new Effect.Opacity(B,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(C){C.effects[0].element.makePositioned()},afterFinishInternal:function(C){C.effects[0].element.hide().undoPositioned().setStyle(A)}},arguments[1]||{}))};Effect.Shake=function(D){D=$(D);var B=Object.extend({distance:20,duration:0.5},arguments[1]||{});var E=parseFloat(B.distance);var C=parseFloat(B.duration)/10;var A={top:D.getStyle("top"),left:D.getStyle("left")};return new Effect.Move(D,{x:E,y:0,duration:C,afterFinishInternal:function(F){new Effect.Move(F.element,{x:-E*2,y:0,duration:C*2,afterFinishInternal:function(G){new Effect.Move(G.element,{x:E*2,y:0,duration:C*2,afterFinishInternal:function(H){new Effect.Move(H.element,{x:-E*2,y:0,duration:C*2,afterFinishInternal:function(I){new Effect.Move(I.element,{x:E*2,y:0,duration:C*2,afterFinishInternal:function(J){new Effect.Move(J.element,{x:-E,y:0,duration:C,afterFinishInternal:function(K){K.element.undoPositioned().setStyle(A)}})}})}})}})}})}})};Effect.SlideDown=function(C){C=$(C).cleanWhitespace();var A=C.down().getStyle("bottom");var B=C.getDimensions();return new Effect.Scale(C,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:B.height,originalWidth:B.width},restoreAfterFinish:true,afterSetup:function(D){D.element.makePositioned();D.element.down().makePositioned();if(window.opera){D.element.setStyle({top:""})}D.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(D){D.element.down().setStyle({bottom:(D.dims[0]-D.element.clientHeight)+"px"})},afterFinishInternal:function(D){D.element.undoClipping().undoPositioned();D.element.down().undoPositioned().setStyle({bottom:A})}},arguments[1]||{}))};Effect.SlideUp=function(C){C=$(C).cleanWhitespace();var A=C.down().getStyle("bottom");var B=C.getDimensions();return new Effect.Scale(C,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:B.height,originalWidth:B.width},restoreAfterFinish:true,afterSetup:function(D){D.element.makePositioned();D.element.down().makePositioned();if(window.opera){D.element.setStyle({top:""})}D.element.makeClipping().show()},afterUpdateInternal:function(D){D.element.down().setStyle({bottom:(D.dims[0]-D.element.clientHeight)+"px"})},afterFinishInternal:function(D){D.element.hide().undoClipping().undoPositioned();D.element.down().undoPositioned().setStyle({bottom:A})}},arguments[1]||{}))};Effect.Squish=function(A){return new Effect.Scale(A,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(B){B.element.makeClipping()},afterFinishInternal:function(B){B.element.hide().undoClipping()}})};Effect.Grow=function(C){C=$(C);var B=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var A={top:C.style.top,left:C.style.left,height:C.style.height,width:C.style.width,opacity:C.getInlineOpacity()};var G=C.getDimensions();var H,F;var E,D;switch(B.direction){case"top-left":H=F=E=D=0;break;case"top-right":H=G.width;F=D=0;E=-G.width;break;case"bottom-left":H=E=0;F=G.height;D=-G.height;break;case"bottom-right":H=G.width;F=G.height;E=-G.width;D=-G.height;break;case"center":H=G.width/2;F=G.height/2;E=-G.width/2;D=-G.height/2;break}return new Effect.Move(C,{x:H,y:F,duration:0.01,beforeSetup:function(I){I.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(I){new Effect.Parallel([new Effect.Opacity(I.element,{sync:true,to:1,from:0,transition:B.opacityTransition}),new Effect.Move(I.element,{x:E,y:D,sync:true,transition:B.moveTransition}),new Effect.Scale(I.element,100,{scaleMode:{originalHeight:G.height,originalWidth:G.width},sync:true,scaleFrom:window.opera?1:0,transition:B.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(J){J.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(J){J.effects[0].element.undoClipping().undoPositioned().setStyle(A)}},B))}})};Effect.Shrink=function(C){C=$(C);var B=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var A={top:C.style.top,left:C.style.left,height:C.style.height,width:C.style.width,opacity:C.getInlineOpacity()};var F=C.getDimensions();var E,D;switch(B.direction){case"top-left":E=D=0;break;case"top-right":E=F.width;D=0;break;case"bottom-left":E=0;D=F.height;break;case"bottom-right":E=F.width;D=F.height;break;case"center":E=F.width/2;D=F.height/2;break}return new Effect.Parallel([new Effect.Opacity(C,{sync:true,to:0,from:1,transition:B.opacityTransition}),new Effect.Scale(C,window.opera?1:0,{sync:true,transition:B.scaleTransition,restoreAfterFinish:true}),new Effect.Move(C,{x:E,y:D,sync:true,transition:B.moveTransition})],Object.extend({beforeStartInternal:function(G){G.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(G){G.effects[0].element.hide().undoClipping().undoPositioned().setStyle(A)}},B))};Effect.Pulsate=function(C){C=$(C);var B=arguments[1]||{};var A=C.getInlineOpacity();var E=B.transition||Effect.Transitions.sinoidal;var D=function(F){return E(1-Effect.Transitions.pulse(F,B.pulses))};D.bind(E);return new Effect.Opacity(C,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(F){F.element.setStyle({opacity:A})}},B),{transition:D}))};Effect.Fold=function(B){B=$(B);var A={top:B.style.top,left:B.style.left,width:B.style.width,height:B.style.height};B.makeClipping();return new Effect.Scale(B,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(C){new Effect.Scale(B,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(D){D.element.hide().undoClipping().setStyle(A)}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(C){this.element=$(C);if(!this.element){throw (Effect._elementDoesNotExistError)}var A=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(A.style)){this.style=$H(A.style)}else{if(A.style.include(":")){this.style=A.style.parseStyle()}else{this.element.addClassName(A.style);this.style=$H(this.element.getStyles());this.element.removeClassName(A.style);var B=this.element.getStyles();this.style=this.style.reject(function(D){return D.value==B[D.key]});A.afterFinishInternal=function(D){D.element.addClassName(D.options.style);D.transforms.each(function(E){D.element.style[E.style]=""})}}}this.start(A)},setup:function(){function A(B){if(!B||["rgba(0, 0, 0, 0)","transparent"].include(B)){B="#ffffff"}B=B.parseColor();return $R(0,2).map(function(C){return parseInt(B.slice(C*2+1,C*2+3),16)})}this.transforms=this.style.map(function(G){var F=G[0],E=G[1],D=null;if(E.parseColor("#zzzzzz")!="#zzzzzz"){E=E.parseColor();D="color"}else{if(F=="opacity"){E=parseFloat(E);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(E)){var C=E.match(/^([\+\-]?[0-9\.]+)(.*)$/);E=parseFloat(C[1]);D=(C.length==3)?C[2]:null}}}var B=this.element.getStyle(F);return{style:F.camelize(),originalValue:D=="color"?A(B):parseFloat(B||0),targetValue:D=="color"?A(E):E,unit:D}}.bind(this)).reject(function(B){return((B.originalValue==B.targetValue)||(B.unit!="color"&&(isNaN(B.originalValue)||isNaN(B.targetValue))))})},update:function(A){var D={},B,C=this.transforms.length;while(C--){D[(B=this.transforms[C]).style]=B.unit=="color"?"#"+(Math.round(B.originalValue[0]+(B.targetValue[0]-B.originalValue[0])*A)).toColorPart()+(Math.round(B.originalValue[1]+(B.targetValue[1]-B.originalValue[1])*A)).toColorPart()+(Math.round(B.originalValue[2]+(B.targetValue[2]-B.originalValue[2])*A)).toColorPart():(B.originalValue+(B.targetValue-B.originalValue)*A).toFixed(3)+(B.unit===null?"":B.unit)}this.element.setStyle(D,true)}});Effect.Transform=Class.create({initialize:function(A){this.tracks=[];this.options=arguments[1]||{};this.addTracks(A)},addTracks:function(A){A.each(function(B){B=$H(B);var C=B.values().first();this.tracks.push($H({ids:B.keys().first(),effect:Effect.Morph,options:{style:C}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(A){var D=A.get("ids"),C=A.get("effect"),B=A.get("options");var E=[$(D)||$$(D)].flatten();return E.map(function(F){return new C(F,Object.extend({sync:true},B))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var B,A=$H();if(Prototype.Browser.WebKit){B=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';B=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(C){if(B[C]){A.set(C,B[C])}});if(Prototype.Browser.IE&&this.include("opacity")){A.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return A};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(B){var A=document.defaultView.getComputedStyle($(B),null);return Element.CSS_PROPERTIES.inject({},function(C,D){C[D]=A[D];return C})}}else{Element.getStyles=function(B){B=$(B);var A=B.currentStyle,C;C=Element.CSS_PROPERTIES.inject({},function(D,E){D[E]=A[E];return D});if(!C.opacity){C.opacity=B.getOpacity()}return C}}Effect.Methods={morph:function(A,B){A=$(A);new Effect.Morph(A,Object.extend({style:B},arguments[2]||{}));return A},visualEffect:function(C,E,B){C=$(C);var D=E.dasherize().camelize(),A=D.charAt(0).toUpperCase()+D.substring(1);new Effect[A](C,B);return C},highlight:function(B,A){B=$(B);new Effect.Highlight(B,A);return B}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(A){Effect.Methods[A]=function(C,B){C=$(C);Effect[A.charAt(0).toUpperCase()+A.substring(1)](C,B);return C}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(A){Effect.Methods[A]=Element[A]});Element.addMethods(Effect.Methods);
/*	SWFObject v2.0 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject=function(){var UNDEF="undefined",OBJECT="object",SHOCKWAVE_FLASH="Shockwave Flash",SHOCKWAVE_FLASH_AX="ShockwaveFlash.ShockwaveFlash",FLASH_MIME_TYPE="application/x-shockwave-flash",EXPRESS_INSTALL_ID="SWFObjectExprInst",win=window,doc=document,nav=navigator,domLoadFnArr=[],regObjArr=[],timer=null,storedAltContent=null,storedAltContentId=null,isDomLoaded=false,isExpressInstallActive=false;var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF&&typeof doc.appendChild!=UNDEF&&typeof doc.replaceChild!=UNDEF&&typeof doc.removeChild!=UNDEF&&typeof doc.cloneNode!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".7")}catch(e){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".6");playerVersion=[6,0,21];a.AllowScriptAccess="always"}catch(e){if(playerVersion[0]==6){fp6Crash=true}}if(!fp6Crash){try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX)}catch(e){}}}if(!fp6Crash&&a){try{d=a.GetVariable("$version");if(d){d=d.split(" ")[1].split(",");playerVersion=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10)]}}catch(e){}}}}var u=nav.userAgent.toLowerCase(),p=nav.platform.toLowerCase(),webkit=/webkit/.test(u)?parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ie=false,windows=p?/win/.test(p):/win/.test(u),mac=p?/mac/.test(p):/mac/.test(u);
/*@cc_on
			ie = true;
			@if (@_win32)
				windows = true;
			@elif (@_mac)
				mac = true;
			@end
		@*/
return{w3cdom:w3cdom,pv:playerVersion,webkit:webkit,ie:ie,win:windows,mac:mac}}();var onDomLoad=function(){if(!ua.w3cdom){return }addDomLoadEvent(main);if(ua.ie&&ua.win){try{doc.write("<script id=__ie_ondomload defer=true src=//:><\/script>");var s=getElementById("__ie_ondomload");if(s){s.onreadystatechange=function(){if(this.readyState=="complete"){this.parentNode.removeChild(this);callDomLoadFunctions()}}}}catch(e){}}if(ua.webkit&&typeof doc.readyState!=UNDEF){timer=setInterval(function(){if(/loaded|complete/.test(doc.readyState)){callDomLoadFunctions()}},10)}if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("DOMContentLoaded",callDomLoadFunctions,null)}addLoadEvent(callDomLoadFunctions)}();function callDomLoadFunctions(){if(isDomLoaded){return }if(ua.ie&&ua.win){var s=createElement("span");try{var t=doc.getElementsByTagName("body")[0].appendChild(s);t.parentNode.removeChild(t)}catch(e){return }}isDomLoaded=true;if(timer){clearInterval(timer);timer=null}var dl=domLoadFnArr.length;for(var i=0;i<dl;i++){domLoadFnArr[i]()}}function addDomLoadEvent(fn){if(isDomLoaded){fn()}else{domLoadFnArr[domLoadFnArr.length]=fn}}function addLoadEvent(fn){if(typeof win.addEventListener!=UNDEF){win.addEventListener("load",fn,false)}else{if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("load",fn,false)}else{if(typeof win.attachEvent!=UNDEF){win.attachEvent("onload",fn)}else{if(typeof win.onload=="function"){var fnOld=win.onload;win.onload=function(){fnOld();fn()}}else{win.onload=fn}}}}}function main(){var rl=regObjArr.length;for(var i=0;i<rl;i++){var id=regObjArr[i].id;if(ua.pv[0]>0){var obj=getElementById(id);if(obj){regObjArr[i].width=obj.getAttribute("width")?obj.getAttribute("width"):"0";regObjArr[i].height=obj.getAttribute("height")?obj.getAttribute("height"):"0";if(hasPlayerVersion(regObjArr[i].swfVersion)){if(ua.webkit&&ua.webkit<312){fixParams(obj)}setVisibility(id,true)}else{if(regObjArr[i].expressInstall&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){showExpressInstall(regObjArr[i])}else{displayAltContent(obj)}}}}else{setVisibility(id,true)}}}function fixParams(obj){var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var e=createElement("embed"),a=nestedObj.attributes;if(a){var al=a.length;for(var i=0;i<al;i++){if(a[i].nodeName.toLowerCase()=="data"){e.setAttribute("src",a[i].nodeValue)}else{e.setAttribute(a[i].nodeName,a[i].nodeValue)}}}var c=nestedObj.childNodes;if(c){var cl=c.length;for(var j=0;j<cl;j++){if(c[j].nodeType==1&&c[j].nodeName.toLowerCase()=="param"){e.setAttribute(c[j].getAttribute("name"),c[j].getAttribute("value"))}}}obj.parentNode.replaceChild(e,obj)}}function fixObjectLeaks(id){if(ua.ie&&ua.win&&hasPlayerVersion("8.0.0")){win.attachEvent("onunload",function(){var obj=getElementById(id);if(obj){for(var i in obj){if(typeof obj[i]=="function"){obj[i]=function(){}}}obj.parentNode.removeChild(obj)}})}}function showExpressInstall(regObj){isExpressInstallActive=true;var obj=getElementById(regObj.id);if(obj){if(regObj.altContentId){var ac=getElementById(regObj.altContentId);if(ac){storedAltContent=ac;storedAltContentId=regObj.altContentId}}else{storedAltContent=abstractAltContent(obj)}if(!(/%$/.test(regObj.width))&&parseInt(regObj.width,10)<310){regObj.width="310"}if(!(/%$/.test(regObj.height))&&parseInt(regObj.height,10)<137){regObj.height="137"}doc.title=doc.title.slice(0,47)+" - Flash Player Installation";var pt=ua.ie&&ua.win?"ActiveX":"PlugIn",dt=doc.title,fv="MMredirectURL="+win.location+"&MMplayerType="+pt+"&MMdoctitle="+dt,replaceId=regObj.id;if(ua.ie&&ua.win&&obj.readyState!=4){var newObj=createElement("div");replaceId+="SWFObjectNew";newObj.setAttribute("id",replaceId);obj.parentNode.insertBefore(newObj,obj);obj.style.display="none";win.attachEvent("onload",function(){obj.parentNode.removeChild(obj)})}createSWF({data:regObj.expressInstall,id:EXPRESS_INSTALL_ID,width:regObj.width,height:regObj.height},{flashvars:fv},replaceId)}}function displayAltContent(obj){if(ua.ie&&ua.win&&obj.readyState!=4){var el=createElement("div");obj.parentNode.insertBefore(el,obj);el.parentNode.replaceChild(abstractAltContent(obj),el);obj.style.display="none";win.attachEvent("onload",function(){obj.parentNode.removeChild(obj)})}else{obj.parentNode.replaceChild(abstractAltContent(obj),obj)}}function abstractAltContent(obj){var ac=createElement("div");if(ua.win&&ua.ie){ac.innerHTML=obj.innerHTML}else{var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var c=nestedObj.childNodes;if(c){var cl=c.length;for(var i=0;i<cl;i++){if(!(c[i].nodeType==1&&c[i].nodeName.toLowerCase()=="param")&&!(c[i].nodeType==8)){ac.appendChild(c[i].cloneNode(true))}}}}}return ac}function createSWF(attObj,parObj,id){var r,el=getElementById(id);if(typeof attObj.id==UNDEF){attObj.id=id}if(ua.ie&&ua.win){var att="";for(var i in attObj){if(attObj[i]!=Object.prototype[i]){if(i=="data"){parObj.movie=attObj[i]}else{if(i.toLowerCase()=="styleclass"){att+=' class="'+attObj[i]+'"'}else{if(i!="classid"){att+=" "+i+'="'+attObj[i]+'"'}}}}}var par="";for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par+='<param name="'+j+'" value="'+parObj[j]+'" />'}}el.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+att+">"+par+"</object>";fixObjectLeaks(attObj.id);r=getElementById(attObj.id)}else{if(ua.webkit&&ua.webkit<312){var e=createElement("embed");e.setAttribute("type",FLASH_MIME_TYPE);for(var k in attObj){if(attObj[k]!=Object.prototype[k]){if(k=="data"){e.setAttribute("src",attObj[k])}else{if(k.toLowerCase()=="styleclass"){e.setAttribute("class",attObj[k])}else{if(k!="classid"){e.setAttribute(k,attObj[k])}}}}}for(var l in parObj){if(parObj[l]!=Object.prototype[l]){if(l!="movie"){e.setAttribute(l,parObj[l])}}}el.parentNode.replaceChild(e,el);r=e}else{var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);for(var m in attObj){if(attObj[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){o.setAttribute("class",attObj[m])}else{if(m!="classid"){o.setAttribute(m,attObj[m])}}}}for(var n in parObj){if(parObj[n]!=Object.prototype[n]&&n!="movie"){createObjParam(o,n,parObj[n])}}el.parentNode.replaceChild(o,el);r=o}}return r}function createObjParam(el,pName,pValue){var p=createElement("param");p.setAttribute("name",pName);p.setAttribute("value",pValue);el.appendChild(p)}function getElementById(id){return doc.getElementById(id)}function createElement(el){return doc.createElement(el)}function hasPlayerVersion(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10);v[2]=parseInt(v[2],10);return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false}function createCSS(sel,decl){if(ua.ie&&ua.mac){return }var h=doc.getElementsByTagName("head")[0],s=createElement("style");s.setAttribute("type","text/css");s.setAttribute("media","screen");if(!(ua.ie&&ua.win)&&typeof doc.createTextNode!=UNDEF){s.appendChild(doc.createTextNode(sel+" {"+decl+"}"))}h.appendChild(s);if(ua.ie&&ua.win&&typeof doc.styleSheets!=UNDEF&&doc.styleSheets.length>0){var ls=doc.styleSheets[doc.styleSheets.length-1];if(typeof ls.addRule==OBJECT){ls.addRule(sel,decl)}}}function setVisibility(id,isVisible){var v=isVisible?"visible":"hidden";if(isDomLoaded){getElementById(id).style.visibility=v}else{createCSS("#"+id,"visibility:"+v)}}return{registerObject:function(objectIdStr,swfVersionStr,xiSwfUrlStr){if(!ua.w3cdom||!objectIdStr||!swfVersionStr){return }var regObj={};regObj.id=objectIdStr;regObj.swfVersion=swfVersionStr;regObj.expressInstall=xiSwfUrlStr?xiSwfUrlStr:false;regObjArr[regObjArr.length]=regObj;setVisibility(objectIdStr,false)},getObjectById:function(objectIdStr){var r=null;if(ua.w3cdom&&isDomLoaded){var o=getElementById(objectIdStr);if(o){var n=o.getElementsByTagName(OBJECT)[0];if(!n||(n&&typeof o.SetVariable!=UNDEF)){r=o}else{if(typeof n.SetVariable!=UNDEF){r=n}}}}return r},embedSWF:function(swfUrlStr,replaceElemIdStr,widthStr,heightStr,swfVersionStr,xiSwfUrlStr,flashvarsObj,parObj,attObj){if(!ua.w3cdom||!swfUrlStr||!replaceElemIdStr||!widthStr||!heightStr||!swfVersionStr){return }widthStr+="";heightStr+="";if(hasPlayerVersion(swfVersionStr)){setVisibility(replaceElemIdStr,false);var att=(typeof attObj==OBJECT)?attObj:{};att.data=swfUrlStr;att.width=widthStr;att.height=heightStr;var par=(typeof parObj==OBJECT)?parObj:{};if(typeof flashvarsObj==OBJECT){for(var i in flashvarsObj){if(flashvarsObj[i]!=Object.prototype[i]){if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+i+"="+flashvarsObj[i]}else{par.flashvars=i+"="+flashvarsObj[i]}}}}addDomLoadEvent(function(){createSWF(att,par,replaceElemIdStr);if(att.id==replaceElemIdStr){setVisibility(replaceElemIdStr,true)}})}else{if(xiSwfUrlStr&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){setVisibility(replaceElemIdStr,false);addDomLoadEvent(function(){var regObj={};regObj.id=regObj.altContentId=replaceElemIdStr;regObj.width=widthStr;regObj.height=heightStr;regObj.expressInstall=xiSwfUrlStr;showExpressInstall(regObj)})}}},getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]}},hasFlashPlayerVersion:hasPlayerVersion,createSWF:function(attObj,parObj,replaceElemIdStr){if(ua.w3cdom&&isDomLoaded){return createSWF(attObj,parObj,replaceElemIdStr)}else{return undefined}},createCSS:function(sel,decl){if(ua.w3cdom){createCSS(sel,decl)}},addDomLoadEvent:addDomLoadEvent,addLoadEvent:addLoadEvent,getQueryParamValue:function(param){var q=doc.location.search||doc.location.hash;if(param==null){return q}if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return pairs[i].substring((pairs[i].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(isExpressInstallActive&&storedAltContent){var obj=getElementById(EXPRESS_INSTALL_ID);if(obj){obj.parentNode.replaceChild(storedAltContent,obj);if(storedAltContentId){setVisibility(storedAltContentId,true);if(ua.ie&&ua.win){storedAltContent.style.display="block"}}storedAltContent=null;storedAltContentId=null;isExpressInstallActive=false}}}}}();
/*
 * ====================================================================
 * About
 * ====================================================================
 * Sarissa is an ECMAScript library acting as a cross-browser wrapper for native XML APIs.
 * The library supports Gecko based browsers like Mozilla and Firefox,
 * Internet Explorer (5.5+ with MSXML3.0+), Konqueror, Safari and a little of Opera
 * @version ${project.version}
 * @author: Manos Batsis, mailto: mbatsis at users full stop sourceforge full stop net
 * ====================================================================
 * Licence
 * ====================================================================
 * Sarissa is free software distributed under the GNU GPL version 2 (see <a href="gpl.txt">gpl.txt</a>) or higher, 
 * GNU LGPL version 2.1 (see <a href="lgpl.txt">lgpl.txt</a>) or higher and Apache Software License 2.0 or higher 
 * (see <a href="asl.txt">asl.txt</a>). This means you can choose one of the three and use that if you like. If 
 * you make modifications under the ASL, i would appreciate it if you submitted those.
 * In case your copy of Sarissa does not include the license texts, you may find
 * them online in various formats at <a href="http://www.gnu.org">http://www.gnu.org</a> and 
 * <a href="http://www.apache.org">http://www.apache.org</a>.
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 
 * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 
 * WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE 
 * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
function Sarissa(){}Sarissa.VERSION="${project.version}";Sarissa.PARSED_OK="Document contains no parsing errors";Sarissa.PARSED_EMPTY="Document is empty";Sarissa.PARSED_UNKNOWN_ERROR="Not well-formed or other error";Sarissa.IS_ENABLED_TRANSFORM_NODE=false;var _sarissa_iNsCounter=0;var _SARISSA_IEPREFIX4XSLPARAM="";var _SARISSA_HAS_DOM_IMPLEMENTATION=document.implementation&&true;var _SARISSA_HAS_DOM_CREATE_DOCUMENT=_SARISSA_HAS_DOM_IMPLEMENTATION&&document.implementation.createDocument;var _SARISSA_HAS_DOM_FEATURE=_SARISSA_HAS_DOM_IMPLEMENTATION&&document.implementation.hasFeature;var _SARISSA_IS_MOZ=_SARISSA_HAS_DOM_CREATE_DOCUMENT&&_SARISSA_HAS_DOM_FEATURE;var _SARISSA_IS_SAFARI=(navigator.userAgent&&navigator.vendor&&(navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1||navigator.vendor.indexOf("Apple")!=-1));var _SARISSA_IS_IE=document.all&&window.ActiveXObject&&navigator.userAgent.toLowerCase().indexOf("msie")>-1&&navigator.userAgent.toLowerCase().indexOf("opera")==-1;if(!window.Node||!Node.ELEMENT_NODE){Node={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12}}if(typeof XMLDocument=="undefined"&&typeof Document!="undefined"){XMLDocument=Document}if(_SARISSA_IS_IE){_SARISSA_IEPREFIX4XSLPARAM="xsl:";var _SARISSA_DOM_PROGID="";var _SARISSA_XMLHTTP_PROGID="";var _SARISSA_DOM_XMLWRITER="";Sarissa.pickRecentProgID=function(E){var D=false;for(var B=0;B<E.length&&!D;B++){try{var A=new ActiveXObject(E[B]);o2Store=E[B];D=true}catch(C){}}if(!D){throw"Could not retreive a valid progID of Class: "+E[E.length-1]+". (original exception: "+e+")"}E=null;return o2Store};_SARISSA_DOM_PROGID=null;_SARISSA_THREADEDDOM_PROGID=null;_SARISSA_XSLTEMPLATE_PROGID=null;_SARISSA_XMLHTTP_PROGID=null;if(!window.XMLHttpRequest){XMLHttpRequest=function(){if(!_SARISSA_XMLHTTP_PROGID){_SARISSA_XMLHTTP_PROGID=Sarissa.pickRecentProgID(["Msxml2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"])}return new ActiveXObject(_SARISSA_XMLHTTP_PROGID)}}Sarissa.getDomDocument=function(D,C){if(!_SARISSA_DOM_PROGID){_SARISSA_DOM_PROGID=Sarissa.pickRecentProgID(["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"])}var A=new ActiveXObject(_SARISSA_DOM_PROGID);if(C){var B="";if(D){if(C.indexOf(":")>1){B=C.substring(0,C.indexOf(":"));C=C.substring(C.indexOf(":")+1)}else{B="a"+(_sarissa_iNsCounter++)}}if(D){A.loadXML("<"+B+":"+C+" xmlns:"+B+'="'+D+'" />')}else{A.loadXML("<"+C+" />")}}return A};Sarissa.getParseErrorText=function(A){var C=Sarissa.PARSED_OK;if(A&&A.parseError&&A.parseError.errorCode&&A.parseError.errorCode!=0){C="XML Parsing Error: "+A.parseError.reason+"\nLocation: "+A.parseError.url+"\nLine Number "+A.parseError.line+", Column "+A.parseError.linepos+":\n"+A.parseError.srcText+"\n";for(var B=0;B<A.parseError.linepos;B++){C+="-"}C+="^\n"}else{if(A.documentElement==null){C=Sarissa.PARSED_EMPTY}}return C};Sarissa.setXpathNamespaces=function(A,B){A.setProperty("SelectionLanguage","XPath");A.setProperty("SelectionNamespaces",B)};XSLTProcessor=function(){if(!_SARISSA_XSLTEMPLATE_PROGID){_SARISSA_XSLTEMPLATE_PROGID=Sarissa.pickRecentProgID(["Msxml2.XSLTemplate.6.0","MSXML2.XSLTemplate.3.0"])}this.template=new ActiveXObject(_SARISSA_XSLTEMPLATE_PROGID);this.processor=null};XSLTProcessor.prototype.importStylesheet=function(C){if(!_SARISSA_THREADEDDOM_PROGID){_SARISSA_THREADEDDOM_PROGID=Sarissa.pickRecentProgID(["MSXML2.FreeThreadedDOMDocument.6.0","MSXML2.FreeThreadedDOMDocument.3.0"])}C.setProperty("SelectionLanguage","XPath");C.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");var B=new ActiveXObject(_SARISSA_THREADEDDOM_PROGID);if(C.url&&C.selectSingleNode("//xsl:*[local-name() = 'import' or local-name() = 'include']")!=null){B.async=false;if(_SARISSA_THREADEDDOM_PROGID=="MSXML2.FreeThreadedDOMDocument.6.0"){B.setProperty("AllowDocumentFunction",true);B.resolveExternals=true}B.load(C.url)}else{B.loadXML(C.xml)}B.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'");var A=B.selectSingleNode("//xsl:output");this.outputMethod=A?A.getAttribute("method"):"html";this.template.stylesheet=B;this.processor=this.template.createProcessor();this.paramsSet=new Array()};XSLTProcessor.prototype.transformToDocument=function(C){if(_SARISSA_THREADEDDOM_PROGID){this.processor.input=C;var B=new ActiveXObject(_SARISSA_DOM_PROGID);this.processor.output=B;this.processor.transform();return B}else{if(!_SARISSA_DOM_XMLWRITER){_SARISSA_DOM_XMLWRITER=Sarissa.pickRecentProgID(["Msxml2.MXXMLWriter.6.0","Msxml2.MXXMLWriter.3.0","MSXML2.MXXMLWriter","MSXML.MXXMLWriter","Microsoft.XMLDOM"])}this.processor.input=C;var B=new ActiveXObject(_SARISSA_DOM_XMLWRITER);this.processor.output=B;this.processor.transform();var A=new ActiveXObject(_SARISSA_DOM_PROGID);A.loadXML(B.output+"");return A}};XSLTProcessor.prototype.transformToFragment=function(G,D){this.processor.input=G;this.processor.transform();var E=this.processor.output;var F=D.createDocumentFragment();if(this.outputMethod=="text"){F.appendChild(D.createTextNode(E))}else{if(D.body&&D.body.innerHTML){var B=D.createElement("div");B.innerHTML=E;while(B.hasChildNodes()){F.appendChild(B.firstChild)}}else{var A=new ActiveXObject(_SARISSA_DOM_PROGID);if(E.substring(0,5)=="<?xml"){E=E.substring(E.indexOf("?>")+2)}var C="".concat("<my>",E,"</my>");A.loadXML(C);var B=A.documentElement;while(B.hasChildNodes()){F.appendChild(B.firstChild)}}}return F};XSLTProcessor.prototype.setParameter=function(C,A,B){B=B?B:"";if(C){this.processor.addParameter(A,B,C)}else{this.processor.addParameter(A,B)}if(!this.paramsSet[""+C]){this.paramsSet[""+C]=new Array()}this.paramsSet[""+C][A]=B};XSLTProcessor.prototype.getParameter=function(B,A){B=""+B;if(this.paramsSet[B]&&this.paramsSet[B][A]){return this.paramsSet[B][A]}else{return null}};XSLTProcessor.prototype.clearParameters=function(){for(var B in this.paramsSet){for(var A in this.paramsSet[B]){if(B){this.processor.addParameter(A,"",B)}else{this.processor.addParameter(A,"")}}}this.paramsSet=new Array()}}else{if(_SARISSA_HAS_DOM_CREATE_DOCUMENT){Sarissa.__handleLoad__=function(A){Sarissa.__setReadyState__(A,4)};_sarissa_XMLDocument_onload=function(){Sarissa.__handleLoad__(this)};Sarissa.__setReadyState__=function(A,B){A.readyState=B;A.readystate=B;if(A.onreadystatechange!=null&&typeof A.onreadystatechange=="function"){A.onreadystatechange()}};Sarissa.getDomDocument=function(C,B){var A=document.implementation.createDocument(C?C:null,B?B:null,null);if(!A.onreadystatechange){A.onreadystatechange=null}if(!A.readyState){A.readyState=0}A.addEventListener("load",_sarissa_XMLDocument_onload,false);return A};if(window.XMLDocument){}else{if(_SARISSA_HAS_DOM_FEATURE&&window.Document&&!Document.prototype.load&&document.implementation.hasFeature("LS","3.0")){Sarissa.getDomDocument=function(C,B){var A=document.implementation.createDocument(C?C:null,B?B:null,null);return A}}else{Sarissa.getDomDocument=function(C,B){var A=document.implementation.createDocument(C?C:null,B?B:null,null);if(A&&(C||B)&&!A.documentElement){A.appendChild(A.createElementNS(C,B))}return A}}}}}if(!window.DOMParser){if(_SARISSA_IS_SAFARI){DOMParser=function(){};DOMParser.prototype.parseFromString=function(B,C){var A=new XMLHttpRequest();A.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(B),false);A.send(null);return A.responseXML}}else{if(Sarissa.getDomDocument&&Sarissa.getDomDocument()&&Sarissa.getDomDocument(null,"bar").xml){DOMParser=function(){};DOMParser.prototype.parseFromString=function(A,C){var B=Sarissa.getDomDocument();B.loadXML(A);return B}}}}if((typeof (document.importNode)=="undefined")&&_SARISSA_IS_IE){try{document.importNode=function(C,B){var A;if(C.nodeName=="#text"){return document.createTextElement(C.data)}else{if(C.nodeName=="tbody"||C.nodeName=="tr"){A=document.createElement("table")}else{if(C.nodeName=="td"){A=document.createElement("tr")}else{if(C.nodeName=="option"){A=document.createElement("select")}else{A=document.createElement("div")}}}if(B){A.innerHTML=C.xml?C.xml:C.outerHTML}else{A.innerHTML=C.xml?C.cloneNode(false).xml:C.cloneNode(false).outerHTML}return A.getElementsByTagName("*")[0]}}}catch(e){}}if(!Sarissa.getParseErrorText){Sarissa.getParseErrorText=function(A){var C=Sarissa.PARSED_OK;if(!A.documentElement){C=Sarissa.PARSED_EMPTY}else{if(A.documentElement.tagName=="parsererror"){C=A.documentElement.firstChild.data;C+="\n"+A.documentElement.firstChild.nextSibling.firstChild.data}else{if(A.getElementsByTagName("parsererror").length>0){var B=A.getElementsByTagName("parsererror")[0];C=Sarissa.getText(B,true)+"\n"}else{if(A.parseError&&A.parseError.errorCode!=0){C=Sarissa.PARSED_UNKNOWN_ERROR}}}}return C}}Sarissa.getText=function(G,B){var E="";var C=G.childNodes;for(var D=0;D<C.length;D++){var F=C[D];var A=F.nodeType;if(A==Node.TEXT_NODE||A==Node.CDATA_SECTION_NODE){E+=F.data}else{if(B==true&&(A==Node.ELEMENT_NODE||A==Node.DOCUMENT_NODE||A==Node.DOCUMENT_FRAGMENT_NODE)){E+=Sarissa.getText(F,true)}}}return E};if(!window.XMLSerializer&&Sarissa.getDomDocument&&Sarissa.getDomDocument("","foo",null).xml){XMLSerializer=function(){};XMLSerializer.prototype.serializeToString=function(A){return A.xml}}Sarissa.stripTags=function(A){return A.replace(/<[^>]+>/g,"")};Sarissa.clearChildNodes=function(A){while(A.firstChild){A.removeChild(A.firstChild)}};Sarissa.copyChildNodes=function(D,E,F){if((!D)||(!E)){throw"Both source and destination nodes must be provided"}if(!F){Sarissa.clearChildNodes(E)}var B=E.nodeType==Node.DOCUMENT_NODE?E:E.ownerDocument;var A=D.childNodes;if(typeof (B.importNode)!="undefined"){for(var C=0;C<A.length;C++){E.appendChild(B.importNode(A[C],true))}}else{for(var C=0;C<A.length;C++){E.appendChild(A[C].cloneNode(true))}}};Sarissa.moveChildNodes=function(D,E,F){if((!D)||(!E)){throw"Both source and destination nodes must be provided"}if(!F){Sarissa.clearChildNodes(E)}var A=D.childNodes;if(D.ownerDocument==E.ownerDocument){while(D.firstChild){E.appendChild(D.firstChild)}}else{var B=E.nodeType==Node.DOCUMENT_NODE?E:E.ownerDocument;if(typeof (B.importNode)!="undefined"){for(var C=0;C<A.length;C++){E.appendChild(B.importNode(A[C],true))}}else{for(var C=0;C<A.length;C++){E.appendChild(A[C].cloneNode(true))}}Sarissa.clearChildNodes(D)}};Sarissa.xmlize=function(E,H,D){D=D?D:"";var F=D+"<"+H+">";var B=false;if(!(E instanceof Object)||E instanceof Number||E instanceof String||E instanceof Boolean||E instanceof Date){F+=Sarissa.escape(""+E);B=true}else{F+="\n";var G="";var A=E instanceof Array;for(var C in E){F+=Sarissa.xmlize(E[C],(A?'array-item key="'+C+'"':C),D+"   ")}F+=D}return F+=(H.indexOf(" ")!=-1?"</array-item>\n":"</"+H+">\n")};Sarissa.escape=function(A){return A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")};Sarissa.unescape=function(A){return A.replace(/&apos;/g,"'").replace(/&quot;/g,'"').replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&")};if(_SARISSA_HAS_DOM_FEATURE&&document.implementation.hasFeature("XPath","3.0")){function SarissaNodeList(A){this.length=A}SarissaNodeList.prototype=new Array(0);SarissaNodeList.prototype.constructor=Array;SarissaNodeList.prototype.item=function(A){return(A<0||A>=this.length)?null:this[A]};SarissaNodeList.prototype.expr="";if(window.XMLDocument&&(!XMLDocument.prototype.setProperty)){XMLDocument.prototype.setProperty=function(A,B){}}Sarissa.setXpathNamespaces=function(G,C){G._sarissa_useCustomResolver=true;var A=C.indexOf(" ")>-1?C.split(" "):new Array(C);G._sarissa_xpathNamespaces=new Array(A.length);for(var D=0;D<A.length;D++){var F=A[D];var H=F.indexOf(":");var I=F.indexOf("=");if(H>0&&I>H+1){var E=F.substring(H+1,I);var B=F.substring(I+2,F.length-1);G._sarissa_xpathNamespaces[E]=B}else{throw"Bad format on namespace declaration(s) given"}}};XMLDocument.prototype._sarissa_useCustomResolver=false;XMLDocument.prototype._sarissa_xpathNamespaces=new Array();XMLDocument.prototype.selectNodes=function(C,G,A){var E=this;var B=this._sarissa_useCustomResolver?function(K){var J=E._sarissa_xpathNamespaces[K];if(J){return J}else{throw"No namespace URI found for prefix: '"+K+"'"}}:this.createNSResolver(this.documentElement);var I=null;if(!A){var H=this.evaluate(C,(G?G:this),B,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var D=new SarissaNodeList(H.snapshotLength);D.expr=C;for(var F=0;F<D.length;F++){D[F]=H.snapshotItem(F)}I=D}else{I=H=this.evaluate(C,(G?G:this),B,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}return I};Element.prototype.selectNodes=function(A){var B=this.ownerDocument;if(B.selectNodes){return B.selectNodes(A,this)}else{throw"Method selectNodes is only supported by XML Elements"}};XMLDocument.prototype.selectSingleNode=function(C,B){var A=B?B:null;return this.selectNodes(C,A,true)};Element.prototype.selectSingleNode=function(A){var B=this.ownerDocument;if(B.selectSingleNode){return B.selectSingleNode(A,this)}else{throw"Method selectNodes is only supported by XML Elements"}};Sarissa.IS_ENABLED_SELECT_NODES=true}
/*
 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
 * Digest Algorithm, as defined in RFC 1321.
 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
 * Distributed under the BSD License
 * See http://pajhome.org.uk/crypt/md5 for more info.
 */
var hexcase=0;var b64pad="";var chrsz=8;function hex_md5(A){return binl2hex(core_md5(str2binl(A),A.length*chrsz))}function b64_md5(A){return binl2b64(core_md5(str2binl(A),A.length*chrsz))}function str_md5(A){return binl2str(core_md5(str2binl(A),A.length*chrsz))}function hex_hmac_md5(A,B){return binl2hex(core_hmac_md5(A,B))}function b64_hmac_md5(A,B){return binl2b64(core_hmac_md5(A,B))}function str_hmac_md5(A,B){return binl2str(core_hmac_md5(A,B))}function md5_vm_test(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}function core_md5(K,F){K[F>>5]|=128<<((F)%32);K[(((F+64)>>>9)<<4)+14]=F;var J=1732584193;var I=-271733879;var H=-1732584194;var G=271733878;for(var C=0;C<K.length;C+=16){var E=J;var D=I;var B=H;var A=G;J=md5_ff(J,I,H,G,K[C+0],7,-680876936);G=md5_ff(G,J,I,H,K[C+1],12,-389564586);H=md5_ff(H,G,J,I,K[C+2],17,606105819);I=md5_ff(I,H,G,J,K[C+3],22,-1044525330);J=md5_ff(J,I,H,G,K[C+4],7,-176418897);G=md5_ff(G,J,I,H,K[C+5],12,1200080426);H=md5_ff(H,G,J,I,K[C+6],17,-1473231341);I=md5_ff(I,H,G,J,K[C+7],22,-45705983);J=md5_ff(J,I,H,G,K[C+8],7,1770035416);G=md5_ff(G,J,I,H,K[C+9],12,-1958414417);H=md5_ff(H,G,J,I,K[C+10],17,-42063);I=md5_ff(I,H,G,J,K[C+11],22,-1990404162);J=md5_ff(J,I,H,G,K[C+12],7,1804603682);G=md5_ff(G,J,I,H,K[C+13],12,-40341101);H=md5_ff(H,G,J,I,K[C+14],17,-1502002290);I=md5_ff(I,H,G,J,K[C+15],22,1236535329);J=md5_gg(J,I,H,G,K[C+1],5,-165796510);G=md5_gg(G,J,I,H,K[C+6],9,-1069501632);H=md5_gg(H,G,J,I,K[C+11],14,643717713);I=md5_gg(I,H,G,J,K[C+0],20,-373897302);J=md5_gg(J,I,H,G,K[C+5],5,-701558691);G=md5_gg(G,J,I,H,K[C+10],9,38016083);H=md5_gg(H,G,J,I,K[C+15],14,-660478335);I=md5_gg(I,H,G,J,K[C+4],20,-405537848);J=md5_gg(J,I,H,G,K[C+9],5,568446438);G=md5_gg(G,J,I,H,K[C+14],9,-1019803690);H=md5_gg(H,G,J,I,K[C+3],14,-187363961);I=md5_gg(I,H,G,J,K[C+8],20,1163531501);J=md5_gg(J,I,H,G,K[C+13],5,-1444681467);G=md5_gg(G,J,I,H,K[C+2],9,-51403784);H=md5_gg(H,G,J,I,K[C+7],14,1735328473);I=md5_gg(I,H,G,J,K[C+12],20,-1926607734);J=md5_hh(J,I,H,G,K[C+5],4,-378558);G=md5_hh(G,J,I,H,K[C+8],11,-2022574463);H=md5_hh(H,G,J,I,K[C+11],16,1839030562);I=md5_hh(I,H,G,J,K[C+14],23,-35309556);J=md5_hh(J,I,H,G,K[C+1],4,-1530992060);G=md5_hh(G,J,I,H,K[C+4],11,1272893353);H=md5_hh(H,G,J,I,K[C+7],16,-155497632);I=md5_hh(I,H,G,J,K[C+10],23,-1094730640);J=md5_hh(J,I,H,G,K[C+13],4,681279174);G=md5_hh(G,J,I,H,K[C+0],11,-358537222);H=md5_hh(H,G,J,I,K[C+3],16,-722521979);I=md5_hh(I,H,G,J,K[C+6],23,76029189);J=md5_hh(J,I,H,G,K[C+9],4,-640364487);G=md5_hh(G,J,I,H,K[C+12],11,-421815835);H=md5_hh(H,G,J,I,K[C+15],16,530742520);I=md5_hh(I,H,G,J,K[C+2],23,-995338651);J=md5_ii(J,I,H,G,K[C+0],6,-198630844);G=md5_ii(G,J,I,H,K[C+7],10,1126891415);H=md5_ii(H,G,J,I,K[C+14],15,-1416354905);I=md5_ii(I,H,G,J,K[C+5],21,-57434055);J=md5_ii(J,I,H,G,K[C+12],6,1700485571);G=md5_ii(G,J,I,H,K[C+3],10,-1894986606);H=md5_ii(H,G,J,I,K[C+10],15,-1051523);I=md5_ii(I,H,G,J,K[C+1],21,-2054922799);J=md5_ii(J,I,H,G,K[C+8],6,1873313359);G=md5_ii(G,J,I,H,K[C+15],10,-30611744);H=md5_ii(H,G,J,I,K[C+6],15,-1560198380);I=md5_ii(I,H,G,J,K[C+13],21,1309151649);J=md5_ii(J,I,H,G,K[C+4],6,-145523070);G=md5_ii(G,J,I,H,K[C+11],10,-1120210379);H=md5_ii(H,G,J,I,K[C+2],15,718787259);I=md5_ii(I,H,G,J,K[C+9],21,-343485551);J=safe_add(J,E);I=safe_add(I,D);H=safe_add(H,B);G=safe_add(G,A)}return Array(J,I,H,G)}function md5_cmn(F,C,B,A,E,D){return safe_add(bit_rol(safe_add(safe_add(C,F),safe_add(A,D)),E),B)}function md5_ff(C,B,G,F,A,E,D){return md5_cmn((B&G)|((~B)&F),C,B,A,E,D)}function md5_gg(C,B,G,F,A,E,D){return md5_cmn((B&F)|(G&(~F)),C,B,A,E,D)}function md5_hh(C,B,G,F,A,E,D){return md5_cmn(B^G^F,C,B,A,E,D)}function md5_ii(C,B,G,F,A,E,D){return md5_cmn(G^(B|(~F)),C,B,A,E,D)}function core_hmac_md5(C,F){var E=str2binl(C);if(E.length>16){E=core_md5(E,C.length*chrsz)}var A=Array(16),D=Array(16);for(var B=0;B<16;B++){A[B]=E[B]^909522486;D[B]=E[B]^1549556828}var G=core_md5(A.concat(str2binl(F)),512+F.length*chrsz);return core_md5(D.concat(G),512+128)}function safe_add(A,D){var C=(A&65535)+(D&65535);var B=(A>>16)+(D>>16)+(C>>16);return(B<<16)|(C&65535)}function bit_rol(A,B){return(A<<B)|(A>>>(32-B))}function str2binl(D){var C=Array();var A=(1<<chrsz)-1;for(var B=0;B<D.length*chrsz;B+=chrsz){C[B>>5]|=(D.charCodeAt(B/chrsz)&A)<<(B%32)}return C}function binl2str(C){var D="";var A=(1<<chrsz)-1;for(var B=0;B<C.length*32;B+=chrsz){D+=String.fromCharCode((C[B>>5]>>>(B%32))&A)}return D}function binl2hex(C){var B=hexcase?"0123456789ABCDEF":"0123456789abcdef";var D="";for(var A=0;A<C.length*4;A++){D+=B.charAt((C[A>>2]>>((A%4)*8+4))&15)+B.charAt((C[A>>2]>>((A%4)*8))&15)}return D}function binl2b64(D){var C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var F="";for(var B=0;B<D.length*4;B+=3){var E=(((D[B>>2]>>8*(B%4))&255)<<16)|(((D[B+1>>2]>>8*((B+1)%4))&255)<<8)|((D[B+2>>2]>>8*((B+2)%4))&255);for(var A=0;A<4;A++){if(B*8+A*6>D.length*32){F+=b64pad}else{F+=C.charAt((E>>6*(3-A))&63)}}}return F}
/*
ModalBox - The pop-up window thingie with AJAX, based on prototype and script.aculo.us.

Copyright Andrey Okonetchnikov (andrej.okonetschnikow@gmail.com), 2006-2007
All rights reserved.
 
VERSION 1.6.1
Last Modified: 04/13/2008
*/
if(!window.Modalbox){var Modalbox=new Object()}Modalbox.Methods={overrideAlert:false,focusableElements:new Array,currFocused:0,initialized:false,active:true,options:{title:"ModalBox Window",overlayClose:true,width:500,height:90,overlayOpacity:0.65,overlayDuration:0.25,slideDownDuration:0.5,slideUpDuration:0.5,resizeDuration:0.25,inactiveFade:true,transitions:true,loadingString:"Please wait. Loading...",closeString:"Close window",closeValue:"&times;",params:{},method:"get",autoFocusing:true,aspnet:false},_options:new Object,setOptions:function(A){Object.extend(this.options,A||{})},_init:function(B){Object.extend(this._options,this.options);this.setOptions(B);this.MBoverlay=new Element("div",{id:"MB_overlay",opacity:"0"});this.MBwindow=new Element("div",{id:"MB_window",style:"display: none"}).update(this.MBframe=new Element("div",{id:"MB_frame"}).update(this.MBheader=new Element("div",{id:"MB_header"}).update(this.MBcaption=new Element("div",{id:"MB_caption"}))));this.MBclose=new Element("a",{id:"MB_close",title:this.options.closeString,href:"#"}).update("<span>"+this.options.closeValue+"</span>");this.MBheader.insert({bottom:this.MBclose});this.MBcontent=new Element("div",{id:"MB_content"}).update(this.MBloading=new Element("div",{id:"MB_loading"}).update(this.options.loadingString));this.MBframe.insert({bottom:this.MBcontent});var A=this.options.aspnet?$(document.body).down("form"):$(document.body);A.insert({top:this.MBwindow});A.insert({top:this.MBoverlay});this.initScrollX=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft;this.initScrollY=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;this.hideObserver=this._hide.bindAsEventListener(this);this.kbdObserver=this._kbdHandler.bindAsEventListener(this);this._initObservers();this.initialized=true},show:function(B,A){if(!this.initialized){this._init(A)}this.content=B;this.setOptions(A);if(this.options.title){$(this.MBcaption).update(this.options.title)}else{$(this.MBheader).hide();$(this.MBcaption).hide()}if(this.MBwindow.style.display=="none"){this._appear();this.event("onShow")}else{this._update();this.event("onUpdate")}},hide:function(A){if(this.initialized){if(A&&typeof A.element!="function"){Object.extend(this.options,A)}this.event("beforeHide");if(this.options.transitions){Effect.SlideUp(this.MBwindow,{duration:this.options.slideUpDuration,transition:Effect.Transitions.sinoidal,afterFinish:this._deinit.bind(this)})}else{$(this.MBwindow).hide();this._deinit()}}else{throw ("Modalbox is not initialized.")}},_hide:function(A){A.stop();if(A.element().id=="MB_overlay"&&!this.options.overlayClose){return false}this.hide()},alert:function(B){var A='<div class="MB_alert"><p>'+B+'</p><input type="button" onclick="Modalbox.hide()" value="OK" /></div>';Modalbox.show(A,{title:"Alert: "+document.title,width:300})},_appear:function(){if(Prototype.Browser.IE&&!navigator.appVersion.match(/\b7.0\b/)){window.scrollTo(0,0);this._prepareIE("100%","hidden")}this._setWidth();this._setPosition();if(this.options.transitions){$(this.MBoverlay).setStyle({opacity:0});new Effect.Fade(this.MBoverlay,{from:0,to:this.options.overlayOpacity,duration:this.options.overlayDuration,afterFinish:function(){new Effect.SlideDown(this.MBwindow,{duration:this.options.slideDownDuration,transition:Effect.Transitions.sinoidal,afterFinish:function(){this._setPosition();this.loadContent()}.bind(this)})}.bind(this)})}else{$(this.MBoverlay).setStyle({opacity:this.options.overlayOpacity});$(this.MBwindow).show();this._setPosition();this.loadContent()}this._setWidthAndPosition=this._setWidthAndPosition.bindAsEventListener(this);Event.observe(window,"resize",this._setWidthAndPosition)},resize:function(C,B,J){var I=$(this.MBoverlay).getWidth();var H=$(this.MBwindow).getHeight();var E=$(this.MBwindow).getWidth();var D=$(this.MBheader).getHeight();var G=$(this.MBcontent).getHeight();var A=((H-D+B)<G)?(G+D):(H+B);var F=E+C;if(J){this.setOptions(J)}if(this.options.transitions){new Effect.Morph(this.MBwindow,{style:"width:"+F+"px; height:"+A+"px; left:"+((I-F)/2)+"px",duration:this.options.resizeDuration,beforeStart:function(K){K.element.setStyle({overflow:"hidden"})},afterFinish:function(K){K.element.setStyle({overflow:"visible"});this.event("_afterResize");this.event("afterResize")}.bind(this)})}else{this.MBwindow.setStyle({width:F+"px",height:A+"px"});setTimeout(function(){this.event("_afterResize");this.event("afterResize")}.bind(this),1)}},resizeToContent:function(A){var B=this.options.height-$(this.MBwindow).getHeight();if(B!=0){if(A){this.setOptions(A)}Modalbox.resize(0,B)}},resizeToInclude:function(C,B){var D=$(C);var A=D.getHeight()+parseInt(D.getStyle("margin-top"),0)+parseInt(D.getStyle("margin-bottom"),0)+parseInt(D.getStyle("border-top-width"),0)+parseInt(D.getStyle("border-bottom-width"),0);if(A>0){if(B){this.setOptions(B)}Modalbox.resize(0,A)}},_update:function(){$(this.MBcontent).update($(this.MBloading).update(this.options.loadingString));this.loadContent()},loadContent:function(){if(this.event("beforeLoad")!=false){if(typeof this.content=="string"){var htmlRegExp=new RegExp(/<\/?[^>]+>/gi);if(htmlRegExp.test(this.content)){this._insertContent(this.content.stripScripts(),function(){this.content.extractScripts().map(function(script){return eval(script.replace("<!--","").replace("// -->",""))}.bind(window))}.bind(this))}else{new Ajax.Request(this.content,{method:this.options.method.toLowerCase(),parameters:this.options.params,onSuccess:function(transport){var response=new String(transport.responseText);this._insertContent(transport.responseText.stripScripts(),function(){response.extractScripts().map(function(script){return eval(script.replace("<!--","").replace("// -->",""))}.bind(window))})}.bind(this),onException:function(instance,exception){Modalbox.hide();throw ("Modalbox Loading Error: "+exception)}})}}else{if(typeof this.content=="object"){this._insertContent(this.content)}else{Modalbox.hide();throw ("Modalbox Parameters Error: Please specify correct URL or HTML element (plain HTML or object)")}}}},_insertContent:function(B,C){$(this.MBcontent).hide().update("");if(typeof B=="string"){this.MBcontent.update(new Element("div",{style:"display: none"}).update(B)).down().show()}else{if(typeof B=="object"){var A=B.cloneNode(true);if(B.id){B.id="MB_"+B.id}$(B).select("*[id]").each(function(D){D.id="MB_"+D.id});this.MBcontent.update(A).down("div").show();if(Prototype.Browser.IE){$$("#MB_content select").invoke("setStyle",{visibility:""})}}}if(this.options.height==this._options.height){Modalbox.resize((this.options.width-$(this.MBwindow).getWidth()),$(this.MBcontent).getHeight()-$(this.MBwindow).getHeight()+$(this.MBheader).getHeight(),{afterResize:function(){setTimeout(function(){this._putContent(C)}.bind(this),1)}.bind(this)})}else{this._setWidth();this.MBcontent.setStyle({overflow:"auto",height:$(this.MBwindow).getHeight()-$(this.MBheader).getHeight()-13+"px"});setTimeout(function(){this._putContent(C)}.bind(this),1)}},_putContent:function(A){this.MBcontent.show();this.focusableElements=this._findFocusableElements();this._setFocus();if(A!=undefined){A()}this.event("afterLoad")},activate:function(A){this.setOptions(A);this.active=true;$(this.MBclose).observe("click",this.hideObserver);if(this.options.overlayClose){$(this.MBoverlay).observe("click",this.hideObserver)}$(this.MBclose).show();if(this.options.transitions&&this.options.inactiveFade){new Effect.Appear(this.MBwindow,{duration:this.options.slideUpDuration})}},deactivate:function(A){this.setOptions(A);this.active=false;$(this.MBclose).stopObserving("click",this.hideObserver);if(this.options.overlayClose){$(this.MBoverlay).stopObserving("click",this.hideObserver)}$(this.MBclose).hide();if(this.options.transitions&&this.options.inactiveFade){new Effect.Fade(this.MBwindow,{duration:this.options.slideUpDuration,to:0.75})}},_initObservers:function(){$(this.MBclose).observe("click",this.hideObserver);if(this.options.overlayClose){$(this.MBoverlay).observe("click",this.hideObserver)}if(Prototype.Browser.Gecko){Event.observe(document,"keypress",this.kbdObserver)}else{Event.observe(document,"keydown",this.kbdObserver)}},_removeObservers:function(){$(this.MBclose).stopObserving("click",this.hideObserver);if(this.options.overlayClose){$(this.MBoverlay).stopObserving("click",this.hideObserver)}if(Prototype.Browser.Gecko){Event.stopObserving(document,"keypress",this.kbdObserver)}else{Event.stopObserving(document,"keydown",this.kbdObserver)}},_setFocus:function(){if(this.focusableElements.length>0&&this.options.autoFocusing==true){var A=this.focusableElements.find(function(B){return B.tabIndex==1})||this.focusableElements.first();this.currFocused=this.focusableElements.toArray().indexOf(A);A.focus()}else{if($(this.MBclose).visible()){$(this.MBclose).focus()}}},_findFocusableElements:function(){this.MBcontent.select("input:not([type~=hidden]), select, textarea, button, a[href]").invoke("addClassName","MB_focusable");return this.MBcontent.select(".MB_focusable")},_kbdHandler:function(B){var A=B.element();switch(B.keyCode){case Event.KEY_TAB:B.stop();if(A!=this.focusableElements[this.currFocused]){this.currFocused=this.focusableElements.toArray().indexOf(A)}if(!B.shiftKey){if(this.currFocused==this.focusableElements.length-1){this.focusableElements.first().focus();this.currFocused=0}else{this.currFocused++;this.focusableElements[this.currFocused].focus()}}else{if(this.currFocused==0){this.focusableElements.last().focus();this.currFocused=this.focusableElements.length-1}else{this.currFocused--;this.focusableElements[this.currFocused].focus()}}break;case Event.KEY_ESC:if(this.active){this._hide(B)}break;case 32:this._preventScroll(B);break;case 0:if(B.which==32){this._preventScroll(B)}break;case Event.KEY_UP:case Event.KEY_DOWN:case Event.KEY_PAGEDOWN:case Event.KEY_PAGEUP:case Event.KEY_HOME:case Event.KEY_END:if(Prototype.Browser.WebKit&&!["textarea","select"].include(A.tagName.toLowerCase())){B.stop()}else{if((A.tagName.toLowerCase()=="input"&&["submit","button"].include(A.type))||(A.tagName.toLowerCase()=="a")){B.stop()}}break}},_preventScroll:function(A){if(!["input","textarea","select","button"].include(A.element().tagName.toLowerCase())){A.stop()}},_deinit:function(){this._removeObservers();Event.stopObserving(window,"resize",this._setWidthAndPosition);if(this.options.transitions){Effect.toggle(this.MBoverlay,"appear",{duration:this.options.overlayDuration,afterFinish:this._removeElements.bind(this)})}else{this.MBoverlay.hide();this._removeElements()}$(this.MBcontent).setStyle({overflow:"",height:""})},_removeElements:function(){$(this.MBoverlay).remove();$(this.MBwindow).remove();if(Prototype.Browser.IE&&!navigator.appVersion.match(/\b7.0\b/)){this._prepareIE("","");window.scrollTo(this.initScrollX,this.initScrollY)}if(typeof this.content=="object"){if(this.content.id&&this.content.id.match(/MB_/)){this.content.id=this.content.id.replace(/MB_/,"")}this.content.select("*[id]").each(function(A){A.id=A.id.replace(/MB_/,"")})}this.initialized=false;this.event("afterHide");this.setOptions(this._options)},_setWidth:function(){$(this.MBwindow).setStyle({width:this.options.width+"px",height:this.options.height+"px"})},_setPosition:function(){$(this.MBwindow).setStyle({left:(($(this.MBoverlay).getWidth()-$(this.MBwindow).getWidth())/2)+"px"})},_setWidthAndPosition:function(){$(this.MBwindow).setStyle({width:this.options.width+"px"});this._setPosition()},_getScrollTop:function(){var A;if(document.documentElement&&document.documentElement.scrollTop){A=document.documentElement.scrollTop}else{if(document.body){A=document.body.scrollTop}}return A},_prepareIE:function(A,B){$$("html, body").invoke("setStyle",{width:A,height:A,overflow:B});$$("select").invoke("setStyle",{visibility:B})},event:function(A){if(this.options[A]){var B=this.options[A]();this.options[A]=null;if(B!=undefined){return B}else{return true}}return true}};Object.extend(Modalbox,Modalbox.Methods);if(Modalbox.overrideAlert){window.alert=Modalbox.alert;
/* Gotuit Feature Detection.
 */
}if((typeof pageObj==="undefined")||(null==pageObj)){var pageObj={}}pageObj.hasFirebug=false;if(window.console&&window.console.firebug){pageObj.hasFirebug=true;document.body.addClassName("hasFirebug")};/* **************************************************************************
 * Copyright Gotuit 
 ****************************************************************************/
if((typeof GOTUIT==="undefined")||(null==GOTUIT)){var GOTUIT={}}GOTUIT.VERSION="4.0.8";GOTUIT.DOM={};GOTUIT.DOM.DROP_HANDLERS=[];GOTUIT.DOM.DROP_EXEC_TIMER=null;Object.extend(GOTUIT.DOM,{get:function(A){return $(A)},getByAttribute:function(A,B){A="*["+A+"]";if(B==null){return $$(A)}else{return GOTUIT.DOM.get(B).select(A)}},getChildrenByClass:function(A,B){A=GOTUIT.DOM.get(A)||document;return GOTUIT.Object.makeArray(Element.getElementsBySelector(A,"."+B))},getChildByClass:function(A,B){A=GOTUIT.DOM.get(A)||document;return Element.down(A,"."+B)},create:function(B,A){if(B=="img"||B=="iframe"){return Builder.node(B,A)}else{return new Element(B,A)}},remove:function(A){return Element.remove(GOTUIT.DOM.get(A))},update:function(B,A){B=GOTUIT.DOM.get(B);Element.update(B,A);return B},absolutize:function(A){A=GOTUIT.DOM.get(A);Position.absolutize(A);return A},moveTo:function(A,C,B){GOTUIT.DOM.setStyles(A,{left:C+"px",top:B+"px"})},hasClass:function(A,B){A=GOTUIT.DOM.get(A);return Element.hasClassName(A,B)},addClass:function(C,B){C=GOTUIT.DOM.get(C);if(GOTUIT.Object.isArray(B)){for(var A=0;A<B.length;A++){Element.addClassName(C,B[A])}}else{Element.addClassName(C,B)}return C},removeClass:function(C,B){C=GOTUIT.DOM.get(C);if(GOTUIT.Object.isArray(B)){for(var A=0;A<B.length;A++){Element.removeClassName(C,B[A])}}else{Element.removeClassName(C,B)}return C},getStyle:function(B,A){B=GOTUIT.DOM.get(B);return Element.getStyle(B,A)},setStyles:function(B,A){B=GOTUIT.DOM.get(B);Element.setStyle(B,A);return B},hide:function(A){A=GOTUIT.DOM.get(A);A.hide();return A},show:function(A){A=GOTUIT.DOM.get(A);A.show();return A},setOpacity:function(B,A){if(A==null){A=1}if(A<0){A=0}else{if(A>1){A=1}}B=GOTUIT.DOM.get(B);B.setOpacity(A);return B},opacityFade:function(E,D,A,G,C,F){E=GOTUIT.DOM.get(E);var B={};if(D!=null){B.from=D}B.to=(A!=null)?A:1;if(G!=null){B.duration=G}if(C!=null){B.beforeStart=C}if(F!=null){B.afterFinish=F}new Effect.Opacity(E,B)},getFormValue:function(A){A=GOTUIT.DOM.get(A);return $F(A)},createDraggable:function(F,E,C,B){F=GOTUIT.DOM.get(F);var D=new YAHOO.util.DD(F);D.DROP_PRIORITY=null;D.DROP_EXEC=null;if(GOTUIT.Object.isString(E)){E=GOTUIT.DOM.getChildByClass(F,E)}if(E!=null){D.setHandleElId(E)}if(C){if(C=="horizontal"){D.setYConstraint(0,0)}else{if(C=="vertical"){D.setXConstraint(0,0)}}}var A=(B)?[GOTUIT.DOM.getX(F),GOTUIT.DOM.getY(F)]:null;D.startDrag=function(){try{if(F._DragParent!=null){GOTUIT.DOM.get(F._DragParent).appendChild(F)}}catch(G){}GOTUIT.DOM.setStyles(F,{zIndex:9000})};D.onDragEnter=function(H,I){var G=GOTUIT.DOM.get(I);var J=GOTUIT.DOM._getDropTargetHandler(G);if(J!=null){if(J[0].HOVERCLASS){GOTUIT.DOM.addClass(G,J[0].HOVERCLASS)}}};D.onDragOut=function(H,I){var G=GOTUIT.DOM.get(I);var J=GOTUIT.DOM._getDropTargetHandler(G);if(J!=null){if(J[0].HOVERCLASS){GOTUIT.DOM.removeClass(G,J[0].HOVERCLASS)}}};D.onDragDrop=function(K,L){var J=GOTUIT.DOM.get(L);var M=GOTUIT.DOM._getDropTargetHandler(J);if(M!=null){var I=GOTUIT.Event.getTarget(K);var H=M[0];var G=M[1];D.onDragOut(null,L);if(D.DROP_PRIORITY!=null&&D.DROP_EXEC!=null){if(H.PRIORITY>D.DROP_PRIORITY){D.DROP_PRIORITY=H.PRIORITY;D.DROP_EXEC=G;GOTUIT.DOM._setDropExecTimer(D,I,J,K)}}else{D.DROP_PRIORITY=H.PRIORITY;D.DROP_EXEC=G;GOTUIT.DOM._setDropExecTimer(D,I,J,K)}}};D.endDrag=function(){var H=false;try{if(F._Parent!=null){GOTUIT.DOM.get(F._Parent).appendChild(F)}}catch(G){}try{if(F._X!=null&&F._Y!=null){GOTUIT.DOM.moveTo(F,F._X,F._Y);H=true}}catch(G){}if(A!=null&&B&&!H){GOTUIT.DOM.setXY(F,A[0],A[1])}GOTUIT.DOM.setStyles(F,{zIndex:null})};return D},_setDropExecTimer:function(A,B,C,D){clearTimeout(GOTUIT.DOM.DROP_EXEC_TIMER);GOTUIT.DOM.DROP_EXEC_TIMER=setTimeout(GOTUIT.DOM._executeDropHandler.bind(GOTUIT.DOM,A,B,C,D))},_executeDropHandler:function(A,B,C,D){clearTimeout(GOTUIT.DOM.DROP_EXEC_TIMER);if(A.DROP_EXEC!=null){A.DROP_EXEC(B,C,D)}A.DROP_PRIORITY=null;A.DROP_EXEC=null},destroyDraggable:function(A){if(A){A.unreg()}},createDropTarget:function(E,A,D,C){if(D==null){D=1}E=GOTUIT.DOM.get(E);var B=new YAHOO.util.DDTarget(E);B.PRIORITY=D;if(C!=null){B.HOVERCLASS=C}GOTUIT.DOM._setDropTargetHandler(B,A);return B},destroyDropTarget:function(A){if(A){GOTUIT.DOM._clearDropTargetHandler(A);A.unreg()}},_setDropTargetHandler:function(B,A){if(B&&A){var C=B.id;GOTUIT.DOM.DROP_HANDLERS[C]=[B,A]}},_getDropTargetHandler:function(A){if(A){var B=A.id;return GOTUIT.DOM.DROP_HANDLERS[B]}return null},_clearDropTargetHandler:function(A){if(A){var B=A.id;GOTUIT.DOM.DROP_HANDLERS[B]=null}},getX:function(A){A=GOTUIT.DOM.get(A);return YAHOO.util.Dom.getX(A)},getY:function(A){A=GOTUIT.DOM.get(A);return YAHOO.util.Dom.getY(A)},setXY:function(B,C,A){B=GOTUIT.DOM.get(B);YAHOO.util.Dom.setXY(B,[C,A])},getDocumentPosition:function(A){A=GOTUIT.DOM.get(A);return Position.cumulativeOffset(A)},hasAttribute:function(B,A){B=GOTUIT.DOM.get(B);return B.hasAttribute(A)}});GOTUIT.DOM.XML={};Object.extend(GOTUIT.DOM.XML,{createDocument:function(A){return this._getDocument(A)},selectNodes:function(B,A){return B.selectNodes(A)},selectSingleNode:function(B,A){return B.selectSingleNode(A)},selectSubNodes:function(D,C){var A=new XMLSerializer().serializeToString(D);var E=this._getDocument(A);var B=this.selectNodes(E,C);return B},selectSingleSubNode:function(D,C){var A=new XMLSerializer().serializeToString(D);var E=this._getDocument(A);var B=this.selectNodes(E,C);return(B.length>0)?B[0]:null},getNodeAttribute:function(B,A){if(B){var C=B.getAttribute(A);return(C=="")?null:this._getValue(C)}return null},getNodeValue:function(A){if(A){if(A.childNodes.length==1){return this._getValue(A.childNodes[0].nodeValue)}else{if(A.childNodes.length==3){return this._getValue(A.childNodes[1].nodeValue)}}}return null},_getDocument:function(B){var A=Sarissa.getDomDocument();A=(new DOMParser()).parseFromString(B,"text/xml");A.setProperty("SelectionLanguage","XPath");return A},_getValue:function(A){if(A){A=A.replace(/\n/g,"")}return A}});GOTUIT.Event={};Object.extend(GOTUIT.Event,{getTarget:function(A){return YAHOO.util.Event.getTarget(A)},observe:function(B,C,A){B=GOTUIT.DOM.get(B);YAHOO.util.Event.addListener(B,C,A)},observeWindowLoad:function(A){GOTUIT.Event.observe(window,"load",A)},observeWindowUnload:function(A){GOTUIT.Event.observe(window,"unload",A)},observeWindowBeforeUnload:function(A){window.onbeforeunload=A},observeDomLoaded:function(A){YAHOO.util.Event.onDOMReady(A)},observeMouseOver:function(B,A){GOTUIT.Event.observe(B,"mouseover",A)},observeMouseOut:function(B,A){GOTUIT.Event.observe(B,"mouseout",A)},observeMouseDown:function(B,A){GOTUIT.Event.observe(B,"mousedown",A)},observeMouseUp:function(B,A){GOTUIT.Event.observe(B,"mouseup",A)},observeMouseClick:function(B,A){GOTUIT.Event.observe(B,"click",A)},observeSelectionChanged:function(B,A){new Form.Element.EventObserver(B,A)},stopObserving:function(B,C,A){B=GOTUIT.DOM.get(B);YAHOO.util.Event.removeListener(B,C,A)},stopObservingMouseUp:function(B,A){GOTUIT.Event.stopObserving(B,"mouseup",A)},stop:function(A){if(A){YAHOO.util.Event.stopEvent(A)}},isEnterKey:function(A){try{return(A.keyCode==Event.KEY_RETURN)}catch(B){}return false},getPageX:function(A){return Event.pointerX(A)}});GOTUIT.AJAX={};Object.extend(GOTUIT.AJAX,{get:function(D,B,A){var C={success:function(E){if(B){B(E.responseText)}},failure:A};YAHOO.util.Connect.asyncRequest("GET",D,C)}});GOTUIT.Class={};Object.extend(GOTUIT.Class,{create:function(A){return Class.create(A)},extend:function(A,B){return Class.create(A,B)}});GOTUIT.Function={};Object.extend(GOTUIT.Function,{bindCall:function(B,A){A=A||window;var C=$A(arguments);C.shift();C.shift();C.each(function(D){B=B.curry(D)});return B.bind(A)},bindListener:function(B,A){A=A||window;var C=$A(arguments);C.shift();C.shift();C.each(function(D){B=B.curry(D)});return B.bindAsEventListener(A)}});GOTUIT.Object={};Object.extend(GOTUIT.Object,{extend:function(B,A){return Object.extend(B,A)},clone:function(A){return Object.clone(A)},toJSON:function(A){return Object.toJSON(A)},isString:function(A){return(typeof A=="string")},isArray:function(A){return Object.isArray(A)},makeArray:function(A){return $A(A)}});GOTUIT.Array={};Object.extend(GOTUIT.Array,{flatten:function(B){var C=[],D;for(var A=0;A<B.length;A++){D=B[A];if(GOTUIT.Object.isArray(D)){C=C.concat(GOTUIT.Array.flatten(D))}else{C.push(D)}}return C}});GOTUIT.String={};Object.extend(GOTUIT.String,{parseJSON:function(A){return YAHOO.lang.JSON.parse(A)},capitalize:function(A){if(A.length>1){return(A.substring(0,1).toUpperCase()+A.substring(1,A.length).toLowerCase())}else{return A.toUpperCase()}}});GOTUIT.Form={};Object.extend(GOTUIT.Form,{getSelectBoxValue:function(A){try{return A.options[A.selectedIndex].value}catch(A){return null}},getSelectBoxIndex:function(A){try{return A.selectedIndex}catch(A){return null}}});GOTUIT.URL={};Object.extend(GOTUIT.URL,{getParams:function(F){if(F==null){F=location.search.substring(1)}var B={};var E=F.split("&");for(var C=0;C<E.length;C++){var G=E[C].indexOf("=");if(G==-1){continue}var A=E[C].substring(0,G);var D=E[C].substring(G+1);D=D.replace(/\+/g,"%20");B[A]=unescape(D)}return B}});GOTUIT.Client={};Object.extend(GOTUIT.Client,{isIE:function(){return(YAHOO.env.ua.ie!=0)},isWebKit:function(){return(YAHOO.env.ua.webkit!=0)}});GOTUIT.Timer=GOTUIT.Class.create({initialize:function(A,B,C){this.fnHandler=A;this.nInterval=(B*1000);if(C==null){C=true}this.oInterval=null;if(C){this.start()}},start:function(){if(this.oInterval==null){this.oInterval=setInterval(this.fnHandler,this.nInterval)}},stop:function(){if(this.oInterval!=null){clearInterval(this.oInterval);this.oInterval=null}}});GOTUIT.Component=GOTUIT.Class.create({initialize:function(A,D,E,C,B){this.pvs=A;this.sName=C;this.sType=E;this.eComponent=D;this.oEventListeners={};this.oEventFilters={};this.oAltAttributeSource=B;if(E){GOTUIT.DOM.addClass(D,E)}if(C){GOTUIT.DOM.addClass(D,C)}},getName:function(){return this.sName},getType:function(){return this.sType},getComponentElement:function(){return this.eComponent},log:function(A){GOTUIT.PVS.log("["+this.getName()+"] "+A)},logError:function(A){GOTUIT.PVS.logError("["+this.getName()+"] "+A)},logException:function(A,B){GOTUIT.PVS.logException("["+this.getName()+"] "+A,B)},debug:function(A){GOTUIT.PVS.debug("["+this.getName()+"] "+A)},setAltAttributeSource:function(A){this.oAltAttributeSource=A},getAttribute:function(B,A){if(this.oAltAttributeSource==null){if(B.substring(0,4)=="PVS_"){B=B.substring(4)}var C=this.eComponent.getAttribute("PVS_"+B);if(!C&&this.pvs&&this.pvs.getConfig()){C=this.pvs.getConfig().getComponentParam(this.getName(),B,"value")}if(!C){C=A}return C}else{return this.oAltAttributeSource.getAttribute(B,A)}},getBooleanAttribute:function(B,C){var A=(C?"true":"false");return(this.getAttribute(B,A)=="true")},getTriStateAttribute:function(A,B){var C=this.getAttribute(A);if(C){return C=="true"}else{return B}},getIntAttribute:function(B,A){var C=this.getAttribute(B);if(!C){C=A}else{C=parseInt(C,10);if(isNaN(C)){C=A}}return C},getFloatAttribute:function(B,A){var C=this.getAttribute(B);if(!C){C=A}else{C=parseFloat(C);if(isNaN(C)){C=A}}return C},getConfigNodes:function(A){var B=(this.oAltAttributeSource!=null)?this.oAltAttributeSource:this;return this.pvs.getConfig().getComponentNodes(B.getName(),A)},getConfigNodeValue:function(A,B){return GOTUIT.DOM.XML.getNodeAttribute(A,B)},getContentDisplayOptions:function(){var A=this.pvs.getConfig().getContentDisplayOptions(this.getName());return A},addElementByClass:function(F,B,A,E,D){B=B||this.eComponent;A=A||"div";E=E||[];D=D||null;var C=GOTUIT.DOM.getChildByClass(B,F);if(C==null){if(E&&E.length>0){F+=" "+E.join(" ")}switch(A){case"textbox":C=GOTUIT.DOM.create("input",{type:"text","class":F});break;case"input_button":C=GOTUIT.DOM.create("input",{type:"button","class":F});break;default:C=GOTUIT.DOM.create(A,{"class":F});break}B.appendChild(C)}else{GOTUIT.DOM.addClass(C,E)}if(D!=null){if(A=="textbox"){C.value=D}else{GOTUIT.DOM.update(C,D)}}return C},addButton:function(F,A,B,H,C,D,J){B=B||this;H=H||this.eComponent;C=C||"ButtonComponent";var G=this.addElementByClass(F,H,D,J);var E=GOTUIT.PVS[C];var I=new E(pvs,G,C,F);I.setTarget(B);I.setMouseClickEvent(A);return I},addButtonLabel:function(D,C,B,A){return this.addButton(D,C,B,A,"ButtonLabel")},addListener:function(C,B,A){this._expandNames(this._addListener,GOTUIT.Object.makeArray(arguments))},_addListener:function(C,B,A){if(!C){this.logError("Missing EventName in addListener")}if(!B){this.logError("Missing listener function in addListener("+C+")")}A=A||this;if(this.oEventListeners[C]==null){this.oEventListeners[C]=[]}this.oEventListeners[C].push({scope:A,listener:B})},removeListener:function(C,B,A){this._expandNames(this._removeListener,GOTUIT.Object.makeArray(arguments))},_removeListener:function(E,C,B){B=B||this;var D=this.oEventListeners[E];if(D){var F;for(var A=0;A<D.length;A++){F=D[A];if(F.scope==B&&F.listener==C){D.splice(A,1);break}}}},sendArrayParamsEvent:function(B,A){this.sendEvent.apply(this,[B].concat(A))},sendEvent:function(A){this._expandNames(this._sendEvent,GOTUIT.Object.makeArray(arguments))},_sendEvent:function(C){var B=GOTUIT.Object.makeArray(arguments);B.shift();if(GOTUIT.PVS.getCanLog()){var A="NOTE: Error in toJSON";try{A=GOTUIT.Object.toJSON(B)}catch(E){}this.log("Send Event:"+C+" "+A)}if(this.oEventFilters[C]){var B=GOTUIT.Object.makeArray(arguments);B.shift();var D=new GOTUIT.Component.EventFilter(this,C,B);D.next()}else{this._sendEventOnly(C,B)}},_sendEventOnly:function(E,D){var C=this;var B=this.oEventListeners[E];if(B!=null){var H;for(var A=0;A<B.length;A++){H=B[A];try{H.listener.apply(H.scope,D)}catch(F){var G;try{G=":"+H.scope.getName()}catch(F){}this.logException("SendEvent: ("+E+G+")",F)}}}},pushEventFilter:function(C,B,A){this._expandNames(this._pushEventFilter,GOTUIT.Object.makeArray(arguments))},_pushEventFilter:function(D,B,A){if(!D){this.logError("Missing EventName in pushEventFilter")}if(!B){this.logError("Missing filter function in pushEventFilter("+D+")")}if(!B){return }A=A||this;var C=GOTUIT.Object.makeArray(arguments);C.shift();C.shift();B=B.bind.apply(B,C);if(!this.oEventFilters[D]){this.oEventFilters[D]=[]}this.oEventFilters[D].unshift(B)},popEventFilter:function(){this._expandNames(this._popEventFilter,GOTUIT.Object.makeArray(arguments))},_popEventFilter:function(A){this.oEventFilters[A].shift()},pushRequireLoginEventFilter:function(C,B){var A=this.pvs;this.pushEventFilter(C,function(D){if(!A.User.getIsLoggedIn()){A.sendEvent(GOTUIT.PVS.EVENT.LOGIN_REQUEST,GOTUIT.Function.bindCall(D.next,D),B)}else{D.next()}})},pushRedirectPageEventFilter:function(C,B,D,A){if(A==null){A=true}D=D||this.getName();this.pushEventFilter(C,function(G){GOTUIT.PVS.hideVideoPlayer(true);var F=G.oComponent;var E=F.pvs;if(window.location.pathname.endsWith(".debug.html")&&!B.endsWith(".debug.html")){B=B.replace(/\.html$/,".debug.html")}B=E.Util.addURLParam(B,"component",D);B=E.Util.addURLParam(B,"event",G.getEventName());B=E.Util.addURLParam(B,"params",Object.toJSON(G.getParams()));if(GOTUIT.PVS.sLogLevel){B=E.Util.addURLParam(B,"loglevel",GOTUIT.PVS.sLogLevel)}if(A&&E.Player.isPlayingContent()){B+="&"+E.Player.getPlayingContent().getShareSignature()}this.log(B);window.location=B},this)},_expandNames:function(B,D){if(D.length>0){var E=D[0];if(GOTUIT.Object.isArray(E)){D.shift();var C;for(var A=0;A<E.length;A++){C=E[A];this._expandNames.call(this,B,[C].concat(D))}}else{if(E){B.apply(this,D)}}}},saveState:function(A){return A},restoreState:function(A){},toJSON:function(){return GOTUIT.Object.toJSON(this.getName())}});GOTUIT.Component.EventFilter=GOTUIT.Class.create({initialize:function(A,C,B){this.oComponent=A;this.sName=C;this.aParams=B;this.nNextHandler=0},next:function(){var B=this.oComponent.oEventFilters[this.getEventName()];if(B&&B.length>this.nNextHandler){var A=B[this.nNextHandler];this.nNextHandler++;A.apply(this,[this].concat(this.getParams()))}else{this.oComponent._sendEventOnly(this.getEventName(),this.getParams())}},getEventName:function(){return this.sName},setName:function(A){if(this.sName!=A){this.sName=A;this.nNextHandler=0}},getParams:function(){return this.aParams},getParam:function(A){return this.aParams[A]},setParams:function(A){this.aParams=A},setParam:function(A,B){this.aParams[A]=B}});GOTUIT.PVS=GOTUIT.Class.extend(GOTUIT.Component,{initialize:function($super,C,B){$super(this,C,"PVS",B);this.aComponents=[];this.oComponents={};this.registerComponent(B,this);this.nInitializingComponents=0;this.onComponentInitializing(this);var A=GOTUIT.PVS.EVENT;this.addListener(A.CONFIG_READY,this.loadComponents,this);this.addListener(A.GPLAYER_READY,this.onGPlayerReady,this);this.addListener(A.PLAYERS_READY,this.onPlayersReady,this);this.addListener(A.READY,this.onReady,this);this.Content=new GOTUIT.PVS.Extension.Content(this);this.Channel=new GOTUIT.PVS.Extension.Channel(this);this.Player=new GOTUIT.PVS.Extension.Player(this);this.User=new GOTUIT.PVS.Extension.User(this);this.Remix=new GOTUIT.PVS.Extension.Remix(this);this.Scene=new GOTUIT.PVS.Extension.Scene(this);this.Util=new GOTUIT.PVS.Extension.Util(this);this.loadConfig()},_onBeforeUnload:function(){if(this.Remix.Current.hasUnsavedWork()||this.Scene.Current.isActive()){return this.sLeavingMsg}},setInitializationState:function(D,C){var B=GOTUIT.PVS.EVENT;var A=this.sInitalizationState;if(A==D){this.logError("Duplicate Initialization State: "+D);return }if(D==B.WINDOW_LOADED){this.bWindowLoaded=true;this.log("WindowLoaded")}else{if(D==B.COMPONENTS_READY){this.bComponentsReady=true;this.log("ComponentsReady")}else{if((!A&&D!=B.CONFIG_READY)||(A==B.CONFIG_READY&&D!=B.GPLAYER_READY)||(A==B.GPLAYER_READY&&D!=B.PLAYERS_READY)||(A==B.PLAYERS_READY&&D!=B.CHANNELS_READY)){logError("Unexpected Initialization state: old = "+A+" new = "+D);return }this.sInitalizationState=D;this.log("InitializationState: "+D)}}if(!C){this.sendEvent(D)}if(this.bWindowLoaded&&this.bComponentsReady&&this.sInitalizationState==B.CHANNELS_READY){this.sInitalizationState=B.READY;this.log("InitializationState: "+B.READY);this.sendEvent(B.READY)}},loadConfig:function(){var A=this.getAttribute("Config");if(A){this.log("Loading config file: "+A);var B=new GOTUIT.PVS.Config(this,A)}else{this.log("No Config Found");this.setInitializationState(GOTUIT.PVS.EVENT.CONFIG_READY)}},loadComponents:function(){var E=GOTUIT.PVS;var A=GOTUIT.DOM.getByAttribute("PVS_ComponentType",this.getComponentElement());for(var B=0;B<A.length;B++){var F=A[B];var H=F.getAttribute("PVS_ComponentType");if(!H){this.logError("Missing Component Type");continue}var C=E.getComponentType(H);if(!C){this.logError("Unknown Component Type: "+H);continue}var G=E._generateComponentId(F,H);var D=new C(this,F,H,G);this.registerComponent(G,D)}this.log("aComponentElements: "+A.length)},registerComponent:function(B,A){GOTUIT.PVS.registerComponent(B,A);this.aComponents.push(A);this.oComponents[B]=A},getComponent:function(A){return this.oComponents[A]},hasComponent:function(A){return this.getComponent(A)!=null},onComponentInitializing:function(A){this.nInitializingComponents++;this.log("Component Initializing["+this.nInitializingComponents+"]: "+A.getName())},onComponentReady:function(A){this.log("Component Ready["+this.nInitializingComponents+"]: "+A.getName());this.nInitializingComponents--;if(this.nInitializingComponents<=0){this.setInitializationState(GOTUIT.PVS.EVENT.COMPONENTS_READY)}},onGPlayerReady:function(A){this.sLeavingMsg=this.getAttribute("UnsavedWorkMsg","You have unsaved work, which will be lost if you leave the page.");GOTUIT.Event.observeWindowBeforeUnload(GOTUIT.Function.bindCall(this._onBeforeUnload,this));this.configSystem=A;this.setInitializationState(GOTUIT.PVS.EVENT.GPLAYER_READY,true)},onPlayersReady:function(){var B=this;var A={onSuccess:function(C){B.onComponentReady(B);B.setInitializationState(GOTUIT.PVS.EVENT.CHANNELS_READY)}};this.Channel.load(A)},onReady:function(){var B=GOTUIT.PVS.oQueryParams;this.log("Redirect Page Event component = "+B.component);this.log("Redirect Page Event event = "+B.event);this.log("Redirect Page Event params = "+B.params);var C=this;var A={onSuccess:function(L,M,N,K){if(N){var D;for(var H=0;H<N.length;H++){N[H].setParent(D);D=N[H]}if(K&&!K.equals(D)){K.setParent(D)}}var J=true;var F=true;if(B.component&&B.event&&B.params){var I=C.getComponent(B.component);var G=B.params.evalJSON();if(I&&G){if(G.length==1){var E={onSuccess:function(O){var P=B.event;if(P==GOTUIT.PVS.EVENT.EDIT){P=C.Content.getEditEvent(O)}switch(P){case GOTUIT.PVS.EVENT.CURRENTREMIX_EDIT:case GOTUIT.PVS.EVENT.CURRENTREMIX_ADD:C.Remix.Current.setInitialEvent(P,O);C._onNormalStart(L,M,N);break;case GOTUIT.PVS.EVENT.CURRENTSCENE_EDIT:I.sendArrayParamsEvent(P,[O]);C._onNormalStart(L,M,N);break;case GOTUIT.PVS.EVENT.EDIT:I.sendArrayParamsEvent(P,[O,true]);C._onNormalStart(L,M,N,K);break;default:I.sendArrayParamsEvent(P,[O]);C._onNormalStart(L,M,N,K);break}},onError:function(O){C._onNormalStart(L,M,N,K)}};C.Content.get(G[0],E);return }}}C._onNormalStart(L,M,N,K)},onError:function(D){C.logError("player failed to start")}};this.callGPlayer("GPlayer","start",[A])},_onNormalStart:function(B,D,C,A){if(A!=null){A.play()}this.sendEvent(GOTUIT.PVS.EVENT.GPLAYER_START,B,D,C,A)},getSystemConfig:function(){return this.configSystem},getMoveBaseURL:function(){if(this.configSystem!=null){return this.configSystem.MoveBaseURL}return null},getMissingThumbnailURL:function(){if(this.configSystem!=null){return this.configSystem.MissingThumbnailURL}return null},setConfig:function(A){this.config=A},getConfig:function(){return this.config},getPVSBase:function(){if(!this.sPVSBase){this.sPVSBase=this.getAttribute("PVSBase","/pvs/")}return this.sPVSBase},onEvent:function(B,C,A){if(A==null){A=new Array()}this.sendArrayParamsEvent(B+C,A)},onComponentEvent:function(B,C,A){this.relayEvent("on"+B+"Event",new Array(C,A))},callGPlayer:function(I,H,A,D,G,C){var E=(A!=null)?PVS_registerCall(A):-1;if(D==null){D=0}if(G==null){G=[]}for(var F=0;F<D;F++){G[F]=PVS_prepareContentParam(G[F])}var B=(E!=-1)?" (index "+E+")":"";if(!C){this.log("calling "+I+"."+H+B)}getGPlayer().handleCall(I,H,E,D,G)},hasObjectParam:function(A,B){if(A!=null){if(A[B]!=null){return true}}return false},getObjectParam:function(A,B){if(this.hasObjectParam(A,B)){return A[B]}return null},relayEvent:function(E,F){this.log("event: "+E);if(F==null){F=new Array()}var B,C;for(var A=0;A<this.aComponents.length;A++){try{C=pvs.aComponents[A][E];if(C){C.apply(this.aComponents[A],F)}}catch(D){this.logException("relayEvent()",D)}}this.relayClientEvent(E,F)},relayClientEvent:function(C,D){try{var A=window["PVS_"+C];if(A){A.apply(this,D)}}catch(B){this.logException("relayClientEvent()",B)}},zzz:null});GOTUIT.Object.extend(GOTUIT.PVS,{classInitialize:function(){this.oQueryParams=GOTUIT.URL.getParams();if(this.oQueryParams.loglevel=="info"||this.oQueryParams.loglevel=="debug"){this.sLogLevel=this.oQueryParams.loglevel}this.setActiveTime();GOTUIT.Event.observeWindowLoad(GOTUIT.Function.bindCall(this.onWindowLoaded,this));GOTUIT.Event.observeDomLoaded(GOTUIT.Function.bindCall(this.onDomLoaded,this));var A=this.onMouseMove.bindAsEventListener(this);GOTUIT.Event.observe(document,"mousemove",A);var B=GOTUIT.Function.bindCall(this.setActiveTime,this);GOTUIT.Event.observe(document,"keydown",B);GOTUIT.Event.observe(window,"scroll",B);GOTUIT.Event.observe(window,"resize",B)},setActiveTime:function(){this.dActiveTime=new Date()},onMouseMove:function(A){if(this.nScreenX!=A.screenX||this.nScreenY!=A.screenY){this.nScreenX=A.screenX;this.nScreenY=A.screenY;this.setActiveTime()}},getIdleTime:function(){var A=new Date();return(A.getTime()-this.dActiveTime.getTime())/1000},onWindowLoaded:function(){this.onDomLoaded();this.bWindowLoaded=true;var B;for(var A=0;A<this.aPVS.length;A++){B=this.aPVS[A];B.setInitializationState(GOTUIT.PVS.EVENT.WINDOW_LOADED)}},onDomLoaded:function(){if(!this.bDomLoaded){this.bDomLoaded=true;this.loadPVS()}},loadPVS:function(){var D=GOTUIT.DOM.getByAttribute("PVS_Config");if(!D||D.length==0){if(document.body){D=[document.body]}else{return }}for(var B=0;B<D.length;B++){var A=D[B];var E=this._generateComponentId(A,"PVS");var C=new GOTUIT.PVS(A,E);this.aPVS.push(C);window.pvs=C}},registerComponentType:function(C,A){this.log("registering component type:  "+C);try{if(this.oComponentTypes[C]){this.logError("Duplicate component type: "+C);return }A.sComponentName=C;this.oComponentTypes[C]=A}catch(B){this.logException("registerComponentType()",B);return }},getComponentType:function(A){return this.oComponentTypes[A]},registerComponent:function(D,A){this.log("registering component:  "+D);try{if(this.oComponents[D]){this.logError("Duplicate component: "+D);return }this.oComponents[D]=A;this.aComponents.push(A)}catch(C){this.logException("registerComponent()",C);return }if(this.oUnresolvedComponents[D]){var B=this;this.oUnresolvedComponents[D].each(function(E){try{E.call(null,A)}catch(F){B.logException("registerComponent - resolving",F)}})}},getComponent:function(A){return this.oComponents[A]},hasComponent:function(A){return this.getComponent(A)!=null},resolveComponent:function(D,C,A){if(this.oComponents[D]){C.call(A,this.oComponents[D])}else{if(!this.oUnresolvedComponents[D]){this.oUnresolvedComponents[D]=[]}var B=GOTUIT.Function.bindCall(C,A);this.oUnresolvedComponents[D].push(B)}},_generateComponentId:function(B,D){var C;if(B){C=B.getAttribute("id");if(C){return C}}var C=D;var A=2;do{if(!this.getComponent(C)&&!$(C)){B.setAttribute("id",C);return C}C=D+A++}while(true)},addListener:function(E,D,B,A){var C=$A(arguments);C.shift();this.resolveComponent(E,function(F){F.addListener.apply(F,C)})},pushEventFilter:function(E,D,B,A){var C=$A(arguments);C.shift();this.resolveComponent(E,function(F){F.pushEventFilter.apply(F,C)})},pushRedirectPageEventFilter:function(E,D,C,A){var B=$A(arguments);B.shift();this.resolveComponent(E,function(F){F.pushRedirectPageEventFilter.apply(F,B)})},pushRequireLoginEventFilter:function(D,C,A){var B=$A(arguments);B.shift();this.resolveComponent(D,function(E){E.pushRequireLoginEventFilter.apply(E,B)})},hideVideoPlayer:function(A){this.aComponents.each(function(B){if(B.getType()=="VideoPlayer"){B.hide(A)}})},showVideoPlayer:function(){this.aComponents.each(function(A){if(A.getType()=="VideoPlayer"){A.show()}})},getCanLog:function(){return this.sLogLevel=="info"||this.sLogLevel=="debug"},getCanLogDebug:function(){return this.sLogLevel=="debug"},log:function(A){if(this.getCanLog()){var B=false;try{window.console.log(A);B=true}catch(C){}if(!B){try{if(this.winDebug==null||this.winDebug.closed){this.winDebug=window.open("","pvsdebug","width=600,height=300,resizable,scrollbars");this.winDebug.moveTo(0,0);this.winDebug.document.open()}if(A){this.winDebug.document.writeln(A.escapeHTML()+"<br>")}}catch(C){}}}},logError:function(A){if(this.getCanLog()){try{window.console.error("ERROR: "+A)}catch(B){this.log("ERROR: "+A)}}},logException:function(A,B){if(Object.isString(B)){A+=" "+B}else{A+=" "+B.message}if(B.stack){A+="\n"+B.stack}this.logError(A)},debug:function(A){if(this.getCanLogDebug()){this.log("---- "+A)}},oComponentTypes:{},oComponents:{},aComponents:[],oUnresolvedComponents:{},aPVS:[],zzz:null});GOTUIT.PVS.Extension=GOTUIT.Class.create({initialize:function(A){this.pvs=A;this.sLogPrefix="["+this.pvs.getName()+"."+this.getExtName()+"] "},getExtName:function(){return""},log:function(A){GOTUIT.PVS.log(this.sLogPrefix+A)},logError:function(A){GOTUIT.PVS.logError(this.sLogPrefix+A)},logException:function(A,B){GOTUIT.PVS.logException(this.sLogPrefix+A,B)},debug:function(A){GOTUIT.PVS.debug(this.sLogPrefix+A)}});GOTUIT.PVS.Extension.Util=GOTUIT.Class.extend(GOTUIT.PVS.Extension,{initialize:function($super,A){$super(A)},getExtName:function(){return"Util"},isValidEmail:function(A){if(A){return(A.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!=-1)}return false},isNotEmpty:function(A){if(A!=null){if(A.length>0){return true}}return false},addURLParam:function(D,A,E,B){if(B==null){B=true}E=""+E;var C=(B&&D.indexOf("?")==-1)?"?":"&";D+=C+A+"="+escape(E);return D},getCSSSafeName:function(A){if(A==null){A=""}A=A.replace(/ /g,"");A=A.replace(/_/g,"");A=A.replace(/'/g,"");A=A.replace(/"/g,"");return A},getAssocArraySafeString:function(B,A){if(B==null){B=""}if(A==null){A=false}B=B.replace(/ /g,"");B=B.replace(/_/g,"");B=B.replace(/'/g,"");B=B.replace(/"/g,"");return B},secondsToHHMMSSFormat:function(B,C,I,K,E){if(!C){C=false}if(!I){I=false}if(!K){K=2}if(!E){E="."}var H=Math.floor(B/60/60);var L=(H<10)?"0"+H:H;if(H==0&&C==false){L=""}else{L+=":"}B-=H*60*60;var F=Math.floor(B/60);var G=(F<10)?"0"+F:F;B-=F*60;var J,A,D;if(I){J=Math.floor(B);A=(J<10)?"0"+J:J;B-=J;D=""+B;D=D.substring(D.indexOf(".")+1);while(D.length<K){D=D+"0"}if(D.length>K){D=D.substring(0,K)}D=E+D}else{J=Math.floor(B);A=(J<10)?"0"+J:J;B-=J;D=""}return L+G+":"+A+D},HHMMSSFormatToSeconds:function(H){var C=0;try{var G=0;if(H.indexOf(".")){G=parseFloat(H.substring(H.indexOf(".")));H=H.substring(0,H.indexOf("."))}var D=H.split(":");var F=1;var B;for(var A=D.length-1;A>=0;A--){C+=F*parseInt(D[A],10);F*=60}C+=G}catch(E){}return C},setCookie:function(G,H,E,D,A,B){var C=new Date();C.setTime(C.getTime());if(E){E=E*1000*60*60*24}var F=new Date(C.getTime()+(E));document.cookie=G+"="+escape(H)+((E)?";expires="+F.toGMTString():"")+((D)?";path="+D:"")+((A)?";domain="+A:"")+((B)?";secure":"")},readCookie:function(D){var C=D+"=";var A=document.cookie.split(";");for(var B=0;B<A.length;B++){var E=A[B];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(C)==0){return E.substring(C.length,E.length)}}return null},setClipboard:function(A){this.pvs.callGPlayer("GPlayer","utilSetClipboard",null,0,[A])}});GOTUIT.PVS.VERSION=GOTUIT.VERSION;GOTUIT.PVS.Component=GOTUIT.Component;GOTUIT.PVS.classInitialize();GOTUIT.PVS.Extension.Content=GOTUIT.Class.extend(GOTUIT.PVS.Extension,{initialize:function(A){GOTUIT.PVS.Extension.prototype.initialize.call(this,A);this.PRIMARY_DETAIL=1;this.SECONDARY_DETAIL=2;this.TERTIARY_DETAIL=3;this.DETAIL_USERNAME="UserName";this.DETAIL_TAGS="Tags";this.DETAIL_SCORE="Score";this.DETAIL_VOTES="Votes";this.DETAIL_RANK="Rank";this.DETAIL_PLAYS="Plays";this.pvs.addListener(GOTUIT.PVS.EVENT.ADD,this.add,this);this.pvs.addListener(GOTUIT.PVS.EVENT.MOVE,this.move,this);this.pvs.addListener(GOTUIT.PVS.EVENT.REMOVE,this.remove,this);this.pvs.addListener(GOTUIT.PVS.EVENT.DELETE,this.deleteContent,this);this.pvs.addListener(GOTUIT.PVS.EVENT.EDIT,this.edit,this);this.pvs.addListener(GOTUIT.PVS.EVENT.FLAG,this.flag,this)},getExtName:function(){return"Content"},canOpen:function(A){return A.getCanOpen()},open:function(B,A){if(A&&A.onSuccess){A=GOTUIT.Object.clone(A);var C=A.onSuccess;A.onSuccess=function(J,I){var G=GOTUIT.Object.makeArray(arguments);var E=0;I.copyOptions(B);if(J){var H=I.getDisplayOptions();var F;for(var D=0;D<J.length;D++){F=J[D];F.setIndex(E++);F.setParent(I);F.setDisplayOptions(H)}}C.apply(this,G)}}this.pvs.callGPlayer("Navigator","openContent",[A],1,[B])},openSlice:function(D,C,B,A){if(A&&A.onSuccess){A=GOTUIT.Object.clone(A);var E=A.onSuccess;A.onSuccess=function(L,K){var I=GOTUIT.Object.makeArray(arguments);var G=C*B;K.copyOptions(D);if(L){var J=K.getDisplayOptions();var H;for(var F=0;F<L.length;F++){H=L[F];H.setIndex(G++);H.setParent(K);H.setDisplayOptions(J)}}E.apply(this,I)}}this.pvs.callGPlayer("Navigator","openContentSlice",[A],1,[D,C,B])},canClose:function(A){return A.getCanClose()},close:function(B,A){if(A&&A.onSuccess){A=GOTUIT.Object.clone(A);var D=A.onSuccess;var C;if(!GOTUIT.Object.isString(B)){C=B.getParent()}A.onSuccess=function(K,J){var H=GOTUIT.Object.makeArray(arguments);var F=0;J.copyOptions(C);if(K){var I=J.getDisplayOptions();var G;for(var E=0;E<K.length;E++){G=K[E];G.setIndex(F++);G.setParent(J);G.setDisplayOptions(I)}}D.apply(this,H)}}this.pvs.callGPlayer("Navigator","closeContent",[A],1,[B])},add:function(F,C,A,B){var E=this;var D={onSuccess:function(M,L,H){M.copyOptions(F);if(L){var K=M.getDisplayOptions();var J=H;var I;for(var G=0;G<L.length;G++){I=L[G];I.setIndex(J++);I.setParent(M);I.setDisplayOptions(K)}}E.pvs.sendEvent(GOTUIT.PVS.EVENT.ADD_SUCCESS,F,L,H);E.pvs.sendEvent(GOTUIT.PVS.EVENT.ADD_TO_FAVORITES_SUCCESS,F,L,H)},onError:function(G){E.pvs.sendEvent(GOTUIT.PVS.EVENT.ADD_ERROR,G);E.pvs.sendEvent(GOTUIT.PVS.EVENT.ADD_TO_FAVORITES_ERROR,G)}};this.pvs.callGPlayer("Navigator","addContent",[D,B],2,[F,C,A])},move:function(F,A,E,B){var D=this;var C={onSuccess:function(I,G,H){D.pvs.sendEvent(GOTUIT.PVS.EVENT.MOVE_SUCCESS,I,G,H)},onError:function(G){D.pvs.sendEvent(GOTUIT.PVS.EVENT.MOVE_ERROR,G)}};this.pvs.callGPlayer("Navigator","moveContent",[C,B],1,[F,A,E])},remove:function(E,A,B){var D=this;var C={onSuccess:function(G,F){D.pvs.sendEvent(GOTUIT.PVS.EVENT.REMOVE_SUCCESS,G,F)},onError:function(F){D.pvs.sendEvent(GOTUIT.PVS.EVENT.REMOVE_ERROR,F)}};this.pvs.callGPlayer("Navigator","removeContent",[C,B],1,[E,A])},deleteContent:function(B,A){if(B.getIsRemix()){this.pvs.sendEvent(GOTUIT.PVS.EVENT.REMIX_DELETE,B,A)}else{if(B.getIsScene()){this.pvs.sendEvent(GOTUIT.PVS.EVENT.SCENE_DELETE,B,A)}}},canEdit:function(B){if(this.hasDetail(B,"CanEdit")){var A=this.getDetail(B,"CanEdit");if(A.toLowerCase()=="false"){return false}}return(B.getIsPlaylist()||B.getIsSegment())},edit:function(C,B,A){if(A==null){A=false}if(GOTUIT.Object.isString(C)){var E=this;var D={onSuccess:function(F){E._edit(F,B,A)},onError:function(F){E._edit(C,B,A)}};this.get(C,D)}else{this._edit(C,B,A)}},getEditEvent:function(A){if(A.getIsPlaylist()){return GOTUIT.PVS.EVENT.CURRENTREMIX_EDIT}else{if(A.getIsSegment()){return GOTUIT.PVS.EVENT.CURRENTSCENE_EDIT}}},_edit:function(D,B,A){if(this.canEdit(D)){var C=this.getEditEvent(D);if(A&&C==GOTUIT.PVS.EVENT.CURRENTREMIX_EDIT){this.pvs.Remix.Current.setInitialEvent(C,D)}else{this.pvs.sendEvent(C,D,B)}}},get:function(B,A){if(A&&A.onSuccess){A=GOTUIT.Object.clone(A);var C=A.onSuccess;A.onSuccess=function(D){var E=GOTUIT.Object.makeArray(arguments);D.copyOptions(B);C.apply(this,E)}}this.pvs.callGPlayer("Navigator","getContent",[A],1,[B])},getStaticChannel:function(B,A){this.pvs.callGPlayer("Navigator","getStaticChannel",[A],0,[B])},getSearchSegments:function(B,A){this.pvs.callGPlayer("Navigator","getSearchSegmentsContent",[A],0,[B])},getSearchPlaylists:function(B,A){this.pvs.callGPlayer("Navigator","getSearchPlaylistsContent",[A],0,[B])},getSearchScenes:function(B,A){this.pvs.callGPlayer("Navigator","getSearchScenesContent",[A],0,[B])},getSearchMyScenes:function(A){this.pvs.callGPlayer("Navigator","getSearchMyScenesContent",[A])},getSearchRemixes:function(B,A){this.pvs.callGPlayer("Navigator","getSearchRemixesContent",[A],0,[B])},getSearchMyRemixes:function(A){this.pvs.callGPlayer("Navigator","getSearchMyRemixesContent",[A])},getStaticSearch:function(B,A){this.pvs.callGPlayer("Navigator","getStaticSearchContent",[A],0,[B])},hasShareURL:function(A){if(A){return(A.getCanShare())}return false},getShareURL:function(A){try{if(this.hasShareURL(A)){var B=this.pvs.getSystemConfig().WebsiteURL;var D=(B.indexOf("?")==-1)?"?":"&";B+=D+A.getShareSignature();return B}else{throw new Error("content isn't shareable")}}catch(C){return""}},hasEmbedCode:function(A){if(A){return(A.getCanEmbed())}return false},getEmbedCode:function(B){try{if(this.hasEmbedCode(B)){var A=this.pvs.getSystemConfig().EmbedCode;A=A.replace(/#SHARE_SIGNATURE#/g,B.getShareSignature());return A}else{throw new Error("content isn't embedable")}}catch(C){return""}},getTitle:function(A){return A.getTitle()},getID:function(A){return A.getID()},getType:function(A){return A.getType()},hasDuration:function(A){return A.getHasDuration()},getDuration:function(A){return A.getDuration()},hasDetail:function(A,B){return A.hasDetail(B)},getDetail:function(A,B){return A.getDetail(B)},hasThumbnailURL:function(A){return A.getHasThumbnailURL()},getThumbnailURL:function(A){return A.getThumbnailURL()},hasUserName:function(A){return A.hasDetail(this.DETAIL_USERNAME)},getUserName:function(A){return A.getDetail(this.DETAIL_USERNAME)},hasVoteCount:function(A){return A.hasDetail(this.DETAIL_VOTES)},getVoteCount:function(A){return A.getDetail(this.DETAIL_VOTES)},hasVoteRank:function(A){return A.hasDetail(this.DETAIL_RANK)},getVoteRank:function(A){return A.getDetail(this.DETAIL_RANK)},hasNumPlays:function(A){return A.hasDetail(this.DETAIL_PLAYS)},getNumPlays:function(A){return A.getDetail(this.DETAIL_PLAYS)},hasTags:function(A){return A.hasDetail(this.DETAIL_TAGS)},getTags:function(A){return A.getDetail(this.DETAIL_TAGS)},getTagsArray:function(A){var C=[];if(this.hasTags(A)){var B=A.getDetail(this.DETAIL_TAGS);C=B.split(", ")}return C},getMissingThumbnailURL:function(A){return A.getMissingThumbnailURL()},getPrimaryDetail:function(B,A){return this.getMappedDetail(B,this.PRIMARY_DETAIL,A)},getSecondaryDetail:function(B,A){return this.getMappedDetail(B,this.SECONDARY_DETAIL,A)},getTertiaryDetail:function(B,A){return this.getMappedDetail(B,this.TERTIARY_DETAIL,A)},getMappedDetail:function(F,J,E){try{if(!E&&F&&F.getChannel()){E=this.pvs.Channel.getChannel(F.getChannel())}var A=null;var G=this.pvs.getSystemConfig().detailMap;var D=G.defaultType;if(F.getHasPLType()){if(G.types[F.getPLType()]){D=G.types[F.getPLType()]}}var L=(F.getCanOpen())?D.node:D.segment;var B=L.main;if(E!=null){var C=this.pvs.Util.getAssocArraySafeString(E.getTitle(),true);if(L.chanContexts[C]){B=L.chanContexts[C]}}var K=B["pos"+J];if(K!=null){for(var I=0;I<K.length;I++){if(F.hasDetail(K[I])){A=F.getDetail(K[I]);break}}}if(A==null&&J==this.PRIMARY_DETAIL){A=F.getTitle()}return A}catch(H){return null}},shareWithFriend:function(D,A,F,E,C,B){this.pvs.callGPlayer("GPlayer","shareWithFriend",[B],1,[D,A,F,E,C])},canRate:function(A){if(A!=null){return A.getCanRate()}else{return false}},rate:function(C,B,A){this.pvs.callGPlayer("GPlayer","rateContent",[A],1,[C,B])},canFlag:function(A){if(A!=null){return(A.getIsRemix()||A.getIsScene())}else{return false}},flag:function(B,A){var D=this;var C={onSuccess:function(E){D.pvs.sendEvent(GOTUIT.PVS.EVENT.FLAG_SUCCESS,E)}};this.pvs.callGPlayer("GPlayer","flagContent",[C,A],1,[B])},getLineage:function(B,A){this.pvs.callGPlayer("Navigator","getContentLineage",[A],1,[B])}});GOTUIT.PVS.Extension.Channel=GOTUIT.Class.extend(GOTUIT.PVS.Extension,{initialize:function(A){GOTUIT.PVS.Extension.prototype.initialize.call(this,A);this.oChannelGroup=null;this.aChannels=[];this.aChannelIndex=[];this.oCurrentChannelContext=null;this.pvs.addListener(GOTUIT.PVS.EVENT.CHANNEL_CONTEXT_CHANGE,this._onChannelContextChange,this)},getExtName:function(){return"Channel"},load:function(A){var C=this;var B={onSuccess:function(F,H){C.log("received "+F.length+" channels");var E=0;var G;for(var D=0;D<F.length;D++){G=F[D];G.setIndex(E++);G.setParent(H);C.addChannel(G)}C.oChannelGroup=H},onError:function(D){C.logError("failed to load channels")}};this.pvs.callGPlayer("Navigator","getChannels",[B,A])},addChannel:function(A){this.log("adding channel: "+A.getTitle());this.aChannels.push(A);this.aChannelIndex[A.getTitle()]=A;this.pvs.sendEvent(GOTUIT.PVS.EVENT.CHANNEL_ADDED,A)},hasChannel:function(A){return(this.aChannelIndex[A]!=null)},getChannel:function(A){return this.aChannelIndex[A]},getChannels:function(){return this.aChannels},getChannelGroup:function(){return this.oChannelGroup},_onChannelContextChange:function(A){this.oCurrentChannelContext=A;this.log("channel context changed: "+this.oCurrentChannelContext.getTitle())},hasCurrentChannelContext:function(){return(this.oCurrentChannelContext!=null)},getCurrentChannelContext:function(){return this.oCurrentChannelContext}});GOTUIT.PVS.Extension.Player=GOTUIT.Class.extend(GOTUIT.PVS.Extension,{initialize:function(A){GOTUIT.PVS.Extension.prototype.initialize.call(this,A);this.oCurrentSegment=null;this.oCurrentPlaylist=null;this.oCurrentBase=null;this.oCurrentPlayRequest=null;this.AltFormatControls=new GOTUIT.PVS.Extension.Player.AltFormatControls(this.pvs);this.pvs.addListener(GOTUIT.PVS.EVENT.PLAY_STARTED,this._onContentPlayStart,this);this.pvs.addListener(GOTUIT.PVS.EVENT.PLAY,this.play,this);this.pvs.addListener(GOTUIT.PVS.EVENT.PLAYER_CONTROLS_REMIXTHIS,this._onControlsRemixThis,this)},getExtName:function(){return"Player"},play:function(C,B){var D=(this.pvs.hasObjectParam(B,"ProgressByBlock"))?this.pvs.getObjectParam(B,"ProgressByBlock"):null;var A=(this.pvs.hasObjectParam(B,"PlaySegmentSiblings"))?this.pvs.getObjectParam(B,"PlaySegmentSiblings"):null;if(D==null&&C.getIsRemix()){D=true}if(D==null){D=false}if(A==null){A=true}this.oCurrentPlayRequest=C;this.pvs.callGPlayer("Player","play",null,1,[C,D,A])},_onContentPlayStart:function(B,A,D,C){this.oCurrentSegment=B;this.oCurrentPlaylist=A;this.oCurrentBase=D},isPlayingContent:function(){return(this.getPlayingContent()!=null)},getPlayingContent:function(){if(this.isPlayingRemix()){return this.oCurrentBase}else{return this.oCurrentSegment}},getCurrentSegment:function(){return this.oCurrentSegment},getCurrentPlaylist:function(){return this.oCurrentPlaylist},getCurrentBase:function(){return this.oCurrentBase},getCurrentPlayRequest:function(){return this.oCurrentPlayRequest},isPlayingRemix:function(){if(this.oCurrentBase!=null){return this.oCurrentBase.getIsRemix()}return false},getPlayingLevel:function(A){if(A&&A.onSuccess){var B=this;A=GOTUIT.Object.clone(A);var C=A.onSuccess;A.onSuccess=function(I,K,L){var F=GOTUIT.Object.makeArray(arguments);var E=0;if(I){var M;for(var J=0;J<I.length;J++){M=I[J];M.setIndex(E++);M.setParent(K)}}if(L){var D;for(var G=0;G<L.length;G++){L[G].setParent(D);D=L[G]}if(K&&L.length>2){K.setParent(L[L.length-2])}if(L.length>0){var H=B.getCurrentPlayRequest();while(H){if(H.equals(L[0])){break}H=H.getParent()}if(H){L[0].copyOptions(H);for(var G=0;G<L.length;G++){L[G].setDisplayOptions(H.getDisplayOptions())}H=H.getParent();while(H){L.unshift(H);H=H.getParent()}}}}C.apply(B,F)}}this.pvs.callGPlayer("Navigator","getPlayingLevel",[A])},getStreamOptions:function(A){this.pvs.callGPlayer("Player","getStreamOptions",[A])},setStreamOption:function(A){this.pvs.callGPlayer("Player","setStreamOption",null,0,[A])},activateSharePanel:function(){this.pvs.callGPlayer("Player","activateShare")},_onControlsRemixThis:function(A){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_ADD,A)}});GOTUIT.PVS.Extension.Player.AltFormatControls=GOTUIT.Class.extend(GOTUIT.PVS.Extension,{initialize:function(A){GOTUIT.PVS.Extension.prototype.initialize.call(this,A)},getExtName:function(){return"Player.AltFormatControls"},setVideoDuration:function(A){this.pvs.callGPlayer("Player","onVideoDuration",null,0,[A])},setVideoProgress:function(B,A){this.pvs.callGPlayer("Player","onVideoProgress",null,0,[B,A],true)},onSegmentComplete:function(){this.pvs.callGPlayer("Player","onSegmentComplete")},onSeekComplete:function(){this.pvs.callGPlayer("Player","onSeekComplete")},onCuePoint:function(){this.pvs.callGPlayer("Player","onCuePoint")}});GOTUIT.PVS.Extension.Remix=GOTUIT.Class.extend(GOTUIT.PVS.Extension,{initialize:function(A){GOTUIT.PVS.Extension.prototype.initialize.call(this,A);this.Current=new GOTUIT.PVS.Extension.Remix.Current(this.pvs);this.pvs.addListener(GOTUIT.PVS.EVENT.REMIX_PROMPT_CLOSE_BEFORE_DELETE,this._closeBeforeDelete,this);this.pvs.addListener(GOTUIT.PVS.EVENT.REMIX_DELETE,this.deleteRemix,this)},getExtName:function(){return"Remix"},deleteRemix:function(B,A){if(this.Current.isLoaded(B)){this.pvs.sendEvent(GOTUIT.PVS.EVENT.REMIX_PROMPT_CLOSE_BEFORE_DELETE,B,A)}else{this._delete(B,A)}},_closeBeforeDelete:function(B,A){this.Current._create();this._delete(B,A)},_delete:function(D,A){var C=this;var B={onSuccess:function(){C.pvs.sendEvent(GOTUIT.PVS.EVENT.REMIX_DELETE_SUCCESS)},onError:function(E){C.pvs.sendEvent(GOTUIT.PVS.EVENT.REMIX_DELETE_ERROR,E)}};this.pvs.callGPlayer("GPlayer","remixDelete",[B,A],1,[D])},getOtherRemixesByThisUser:function(C,A){var B=this;this.pvs.callGPlayer("GPlayer","remixGetOtherByThisUser",[A],1,[C])},isActive:function(A){if(A){return A.isWorkingWithRemix}return false},isNew:function(A){if(A){return A.isNewRemix}return false},isSaved:function(A){if(A){return A.isSaved}return false},canSave:function(A){if(A){return(A.isWorkingWithRemix&&!A.isSaved&&A.isValidContent)}return false},canPreview:function(A){if(A){return(A.isWorkingWithRemix&&A.isValidContent)}return false},canShare:function(A){if(A){return(A.isWorkingWithRemix&&!A.isNewRemix)}return false},getID:function(A){if(A){if(this.isActive(A)&&!this.isNew(A)){return A.ID}}return -1},getName:function(A){if(A){if(this.isActive(A)){return A.Name}}return""},getDescription:function(A){if(A){if(this.isActive(A)){return A.Description}}return""},getTags:function(A){if(A){if(this.isActive(A)){return A.Tags}}return""},getDuration:function(A){if(A){if(this.isActive(A)){return A.Duration}}return 0},getDurationText:function(A){if(A){if(this.isActive(A)){return A.DurationText}}return""},hasMaxDuration:function(A){if(A){if(this.isActive(A)){return(parseInt(A.MaxDuration,10)>0)}}return false},getMaxDuration:function(A){if(this.hasMaxDuration(A)){return parseInt(A.MaxDuration,10)}else{return 0}},getMaxDurationText:function(A){if(this.hasMaxDuration(A)){return A.MaxDurationText}else{return""}},getNumScenes:function(A){if(A){if(this.isActive(A)){return parseInt(A.numScenes,10)}}return 0}});GOTUIT.PVS.Extension.Remix.Current=GOTUIT.Class.extend(GOTUIT.PVS.Extension,{initialize:function(A){GOTUIT.PVS.Extension.prototype.initialize.call(this,A);this.aInitialEvent=null;this.oRemixStatus=null;this.oRemix=null;this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_CREATE,this.create,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_PROMPT_CREATE_WITH_UNSAVEDWORK,this._create,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_EDIT,this.edit,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_PROMPT_EDIT_WITH_UNSAVEDWORK,this._edit,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_ADD,this.addContent,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_REMOVE,this.removeContent,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_PREVIEW,this.preview,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE,this.save,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_PROMPT_OVERWRITE,this._savePromptOverwrite,this);this.pvs.addListener(GOTUIT.PVS.EVENT.USER_LOGOUT,this._onUserLogout,this)},getExtName:function(){return"Remix.Current"},setInitialEvent:function(B,A){this.aInitialEvent=[B,A];this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_INIT_EVENT)},sendRemixInit:function(){if(this.aInitialEvent!=null){this.pvs.sendEvent(this.aInitialEvent[0],this.aInitialEvent[1]);this.aInitialEvent=null}},_updateRemixStatus:function(A){this.oRemixStatus=A;this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_STATUS_SUCCESS,A)},_updateRemixContent:function(A){this.oRemix=A},getRemixContent:function(){return this.oRemix},create:function(B,A){if(this.hasUnsavedWork()){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_PROMPT_CREATE_WITH_UNSAVEDWORK,B,A)}else{this._create(B,A)}},_create:function(B,A){var D=this;var C={onSuccess:function(G,F){D._updateRemixStatus(F);D.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_CREATE_SUCCESS,G,F)},onError:function(F){D.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_CREATE_ERROR,F)}};var E=(B!=null)?1:0;this.pvs.callGPlayer("GPlayer","remixCreate",[C,A],E,[B])},edit:function(B,A){if(this.hasUnsavedWork()){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_PROMPT_EDIT_WITH_UNSAVEDWORK,B,A)}else{this._edit(B,A)}},_edit:function(B,A){if(!this.pvs.User.getOwnsContent(B)){this._create(B,A)}else{var D=this;var C={onSuccess:function(G,F,E){D._updateRemixContent(F);D._updateRemixStatus(E);D.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_EDIT_SUCCESS,G,F,E)},onError:function(E){D.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_EDIT_ERROR,E)}};this.pvs.callGPlayer("GPlayer","remixEdit",[C,A],1,[B])}},addContent:function(C,A,B){var E=this;var D={onSuccess:function(H,F,G){E._updateRemixStatus(G);E.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_ADD_SUCCESS,H,F,G)},onError:function(F){E.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_ADD_ERROR,F)}};if(A==null){A=-1}this.pvs.callGPlayer("GPlayer","remixAdd",[D,B],1,[C,A])},removeContent:function(A,B){var D=this;var C={onSuccess:function(E,F){D._updateRemixStatus(F);D.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_REMOVE_SUCCESS,E,F)},onError:function(E){D.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_REMOVE_ERROR,E)}};if(A==null){A=-1}this.pvs.callGPlayer("GPlayer","remixRemove",[C,B],0,[A])},moveContent:function(A,E,B){var D=this;var C={onSuccess:function(F,H,G){D._updateRemixStatus(G);D.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_MOVE_SUCCESS,F,H,G)},onError:function(F){D.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_MOVE_ERROR,F)}};if(A==null){A=-1}if(E==null){E=-1}this.pvs.callGPlayer("GPlayer","remixMove",[C,B],0,[A,E])},updateMetadata:function(E,F,D,A){var C=this;var B={onSuccess:function(G){C._updateRemixStatus(G);C.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_UPDATE_METADATA_SUCCESS,G)},onError:function(G,H){C.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_UPDATE_METADATA_ERROR,G,H)}};this.pvs.callGPlayer("GPlayer","remixUpdateMetadata",[B,A],0,[E,F,D])},clearAudioTrack:function(A){var C=this;var B={onSuccess:function(D){C._updateRemixStatus(D)}};this.pvs.callGPlayer("GPlayer","remixClearAudioTrack",[B,A])},setAudioTrack:function(F,G,B,E,A){var D=this;var C={onSuccess:function(H){D._updateRemixStatus(H)}};this.pvs.callGPlayer("GPlayer","remixSetAudioTrack",[C,A],0,[F,G,B,E])},getStatus:function(A){var C=this;var B={onSuccess:function(D){C._updateRemixStatus(D)},onError:function(D){C.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_STATUS_ERROR,D)}};this.pvs.callGPlayer("GPlayer","remixStatus",[B,A])},preview:function(A){if(this.canPreview()){this._preview(A)}},_preview:function(A){var B=(this.pvs.hasObjectParam(A,"ProgressByBlock"))?this.pvs.getObjectParam(A,"ProgressByBlock"):true;this.pvs.callGPlayer("Player","previewRemix",null,0,[B])},hasUnsavedWork:function(){return(this.isActive()&&!this.isSaved()&&!(this.isNew()&&this.getNumScenes()==0))},save:function(A){if(this.canSave()){this._save(A)}},_save:function(A){var C=this;var B={onSuccess:function(E,D){C._updateRemixContent(E);C._updateRemixStatus(D);C.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_SUCCESS,E,D)},onError:function(D,E){C.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_ERROR,D,E)}};this.pvs.callGPlayer("GPlayer","remixSave",[B,A])},_savePromptOverwrite:function(){this.pvs.callGPlayer("GPlayer","remixSaveOverwrite")},close:function(A){var C=this;var B={onSuccess:function(D){C._updateRemixContent(null);C._updateRemixStatus(D);C.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_CLOSE_SUCCESS,D)},onError:function(D){C.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_CLOSE_ERROR,D)}};this.pvs.callGPlayer("GPlayer","remixClose",[B,A])},isLoaded:function(A){if(this.isActive()&&!this.isNew()){return(A.getID()==this.getID())}else{return false}},isActive:function(){return this.pvs.Remix.isActive(this.oRemixStatus)},isNew:function(){return this.pvs.Remix.isNew(this.oRemixStatus)},isSaved:function(){return this.pvs.Remix.isSaved(this.oRemixStatus)},canSave:function(){return this.pvs.Remix.canSave(this.oRemixStatus)},canPreview:function(A){return this.pvs.Remix.canPreview(this.oRemixStatus)},canShare:function(A){return this.pvs.Remix.canShare(this.oRemixStatus)},getID:function(){return this.pvs.Remix.getID(this.oRemixStatus)},getName:function(){return this.pvs.Remix.getName(this.oRemixStatus)},getDescription:function(){return this.pvs.Remix.getDescription(this.oRemixStatus)},getTags:function(){return this.pvs.Remix.getTags(this.oRemixStatus)},getDuration:function(){return this.pvs.Remix.getDuration(this.oRemixStatus)},getDurationText:function(){return this.pvs.Remix.getDurationText(this.oRemixStatus)},hasMaxDuration:function(){return this.pvs.Remix.hasMaxDuration(this.oRemixStatus)},getMaxDuration:function(){return this.pvs.Remix.getMaxDuration(this.oRemixStatus)},getMaxDurationText:function(){return this.pvs.Remix.getMaxDurationText(this.oRemixStatus)},hasAudioTrack:function(){if(this.oRemixStatus!=null){return(this.oRemixStatus.hasAudioTrack)}return false},getAudioTrackPlaylist:function(){if(this.oRemixStatus!=null){return(this.oRemixStatus.audioPlaylist)}return null},getAudioTrackSegment:function(){if(this.oRemixStatus!=null){return(this.oRemixStatus.audioSegment)}return null},getAudioTrackVolume:function(){if(this.oRemixStatus!=null){return(this.oRemixStatus.audioVolume)}return null},getShareURL:function(){return this.pvs.Content.getShareURL(this.oRemix)},getEmbedCode:function(){return this.pvs.Content.getEmbedCode(this.oRemix)},getNumScenes:function(){return this.pvs.Remix.getNumScenes(this.oRemixStatus)},_onUserLogout:function(){if(this.isActive()&&!this.isNew()){this._create()}}});GOTUIT.PVS.Extension.Scene=GOTUIT.Class.extend(GOTUIT.PVS.Extension,{initialize:function(A){GOTUIT.PVS.Extension.prototype.initialize.call(this,A);this.Current=new GOTUIT.PVS.Extension.Scene.Current(this.pvs);this.pvs.addListener(GOTUIT.PVS.EVENT.SCENE_DELETE,this.deleteScene,this)},getExtName:function(){return"Scene"},deleteScene:function(B,A){var D=this;var C={onSuccess:function(){D.pvs.sendEvent(GOTUIT.PVS.EVENT.SCENE_DELETE_SUCCESS)},onError:function(E){D.pvs.sendEvent(GOTUIT.PVS.EVENT.SCENE_DELETE_ERROR,E)}};this.pvs.callGPlayer("SceneManager","sceneDelete",[C,A],1,[B])},isActive:function(A){if(A){return A.isWorkingWithScene}return false},isNew:function(A){if(A){return A.isNewScene}return false},canSave:function(A){if(A){return(A.isWorkingWithScene&&A.isComplete)}return false},getName:function(A){if(A){if(this.isActive(A)){return A.Name}}return""},getDescription:function(A){if(A){if(this.isActive(A)){return A.Description}}return""},getTags:function(A){if(A){if(this.isActive(A)){return A.Tags}}return""},hasThumbnail:function(A){if(A){return(A.Thumbnail!=null)}return false},getThumbnail:function(A){if(A){return A.Thumbnail}return""},hasSourceMissingThumbnail:function(A){if(A){return(A.SourceMissingThumbnail!=null)}return false},getSourceMissingThumbnail:function(A){if(A){return A.SourceMissingThumbnail}return""},getStart:function(A){if(A){return A.StartOffset}return -1},getEnd:function(A){if(A){return A.EndOffset}return -1},getSourceDuration:function(A){if(A){return A.SourceDuration}return -1}});GOTUIT.PVS.Extension.Scene.Current=GOTUIT.Class.extend(GOTUIT.PVS.Extension,{initialize:function(A){GOTUIT.PVS.Extension.prototype.initialize.call(this,A);this.oSceneStatus=null;this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_EDIT,this.edit,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_PREVIEW,this.preview,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_SAVE,this.save,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_CANCEL,this.cancel,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_THUMBNAIL_COMPLETE,this._onThumbnailComplete,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_OFFSETS_CHANGED,this._onOffsetsChanged,this)},getExtName:function(){return"Scene.Current"},_updateSceneStatus:function(A){this.oSceneStatus=A;this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_STATUS_SUCCESS,A)},edit:function(B,A){if(this.pvs.User.getOwnsContent(B)){this._edit(B,A)}else{this._create(B,A)}},_create:function(C,A){var E=this;var D={onSuccess:function(F){E._updateSceneStatus(F);E.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_CREATE_SUCCESS,F);E.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_SAVE_SHOW_DIALOG)},onError:function(F){E.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_CREATE_ERROR,F)}};var B=(this.pvs.hasObjectParam(A,"StartAsNew"))?this.pvs.getObjectParam(A,"StartAsNew"):false;this.pvs.callGPlayer("Player","sceneCreate",[D,A],1,[C,B])},_edit:function(B,A){var D=this;var C={onSuccess:function(E){D._updateSceneStatus(E);D.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_EDIT_SUCCESS,E);D.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_SAVE_SHOW_DIALOG)},onError:function(E){D.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_EDIT_ERROR,E)}};this.pvs.callGPlayer("Player","sceneEdit",[C,A],1,[B])},setVideoDuration:function(A){this.pvs.callGPlayer("Player","sceneSetVideoDuration",null,0,[A])},updateMetadata:function(F,B,E,A){var D=this;var C={onSuccess:function(G){D._updateSceneStatus(G);D.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_UPDATE_METADATA_SUCCESS,G)},onError:function(G){D.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_UPDATE_METADATA_ERROR,G)}};this.pvs.callGPlayer("Player","sceneUpdate",[C,A],0,[F,B,E])},updateOffsets:function(B,A){if(B==null){B=-1}if(A==null){A=-1}this.pvs.callGPlayer("SceneControls","updateOffsets",null,0,[B,A])},getStatus:function(A){var C=this;var B={onSuccess:function(D){C._updateSceneStatus(D)},onError:function(D){C.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_STATUS_ERROR,D)}};this.pvs.callGPlayer("Player","sceneStatus",[B,A])},preview:function(){this.pvs.callGPlayer("Player","scenePreview")},save:function(A){var C=this;var B={onSuccess:function(D){C._updateSceneStatus(D);C.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_SAVE_SUCCESS,D)},onError:function(D,E){C.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_SAVE_ERROR,D,E)}};this.pvs.callGPlayer("Player","sceneSave",[B,A])},cancel:function(A){var C=this;var B={onSuccess:function(D){C._updateSceneStatus(D);C.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_CANCEL_SUCCESS,D)},onError:function(D){C.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_CANCEL_ERROR,D)}};this.pvs.callGPlayer("Player","sceneCancel",[B,A])},_onThumbnailComplete:function(A){this._updateSceneStatus(A)},_onOffsetsChanged:function(A){this._updateSceneStatus(A)},isActive:function(){return this.pvs.Scene.isActive(this.oSceneStatus)},isNew:function(){return this.pvs.Scene.isNew(this.oSceneStatus)},canSave:function(){return this.pvs.Scene.canSave(this.oSceneStatus)},getName:function(){return this.pvs.Scene.getName(this.oSceneStatus)},getDescription:function(){return this.pvs.Scene.getDescription(this.oSceneStatus)},getTags:function(){return this.pvs.Scene.getTags(this.oSceneStatus)},hasThumbnail:function(){return this.pvs.Scene.hasThumbnail(this.oSceneStatus)},getThumbnail:function(){return this.pvs.Scene.getThumbnail(this.oSceneStatus)},hasSourceThumbnail:function(){return this.pvs.Scene.hasSourceThumbnail(this.oSceneStatus)},getSourceThumbnail:function(){return this.pvs.Scene.getSourceThumbnail(this.oSceneStatus)},hasSourceMissingThumbnail:function(){return this.pvs.Scene.hasSourceMissingThumbnail(this.oSceneStatus)},getSourceMissingThumbnail:function(){return this.pvs.Scene.getSourceMissingThumbnail(this.oSceneStatus)},getStart:function(){return this.pvs.Scene.getStart(this.oSceneStatus)},getEnd:function(){return this.pvs.Scene.getEnd(this.oSceneStatus)},getSourceDuration:function(){return this.pvs.Scene.getSourceDuration(this.oSceneStatus)}});GOTUIT.PVS.Extension.User=GOTUIT.Class.extend(GOTUIT.PVS.Extension,{initialize:function(A){GOTUIT.PVS.Extension.prototype.initialize.call(this,A);this.oUserProfile=null;this.oMyFavorites=null;this.oMyScenes=null;this.pvs.addListener(GOTUIT.PVS.EVENT.ADD_TO_FAVORITES,this.addToFavorites,this)},getExtName:function(){return"User"},isAdmin:function(){if(this.getIsLoggedIn()){return(this.oUserProfile.GroupID==2)?true:false}},isGuest:function(){if(this.getIsLoggedIn()){return(this.oUserProfile.GroupID==1)?true:false}},getIsLoggedIn:function(){return(this.oUserProfile!=null)},getUserProfile:function(){return this.oUserProfile},getMyFavorites:function(){return this.oMyFavorites},getUserName:function(){if(this.getIsLoggedIn()){return this.oUserProfile.UserName}return""},getUserEmail:function(){if(this.getIsLoggedIn()){return this.oUserProfile.Email}return""},getPrize:function(){if(this.getIsLoggedIn()){return this.oUserProfile.PRize}return"0"},getOwnsContent:function(A){try{if(this.getIsLoggedIn()&&this.pvs.Content.hasUserName(A)){return(this.getUserName()==this.pvs.Content.getUserName(A))}}catch(B){}return false},login:function(C,B,A){var D=this._getLoginResponseHandler(GOTUIT.PVS.EVENT.USER_LOGIN_SUCCESS,GOTUIT.PVS.EVENT.USER_LOGIN_ERROR,B);this.pvs.callGPlayer("UserManager","login",[D,A],0,[C,B])},loginByUsername:function(A,C,B){var D=this._getLoginResponseHandler(GOTUIT.PVS.EVENT.USER_LOGIN_SUCCESS,GOTUIT.PVS.EVENT.USER_LOGIN_ERROR,C);this.pvs.callGPlayer("UserManager","loginByUsername",[D,B],0,[A,C])},register:function(I,C,G,A,D,F,B,E,H){var K=this._isValidDOB(F);if(K==null){F=this._convertDOB(F);var J=this._getLoginResponseHandler(GOTUIT.PVS.EVENT.USER_REGISTER_SUCCESS,GOTUIT.PVS.EVENT.USER_REGISTER_ERROR,C);this.pvs.callGPlayer("UserManager","register",[J,H],0,[I,C,G,A,D,F,B,E])}else{this.pvs.sendEvent(GOTUIT.PVS.EVENT.USER_REGISTER_ERROR,K)}},resetPassword:function(B,E,A){var D=this;var C={onSuccess:function(){D.pvs.sendEvent(GOTUIT.PVS.EVENT.USER_RESETPASSWORD_SUCCESS)},onError:function(F){D.pvs.sendEvent(GOTUIT.PVS.EVENT.USER_RESETPASSWORD_ERROR,F)}};this.pvs.callGPlayer("UserManager","resetPassword",[C,A],0,[B,E])},updatePassword:function(F,C,B,A){var E=this;var D={onSuccess:function(){E.pvs.sendEvent(GOTUIT.PVS.EVENT.USER_UPDATEPASSWORD_SUCCESS)},onError:function(G){E.pvs.sendEvent(GOTUIT.PVS.EVENT.USER_UPDATEPASSWORD_ERROR,G)}};this.pvs.callGPlayer("UserManager","updatePassword",[D,A],0,[F,C,B])},updateProfile:function(A,J,H,B,E,G,C,F,I){var L=this._isValidDOB(G);if(L==null){G=this._convertDOB(G);var D=this.oUserProfile.Password;var K=this._getLoginResponseHandler(GOTUIT.PVS.EVENT.USER_UPDATEPROFILE_SUCCESS,GOTUIT.PVS.EVENT.USER_UPDATEPROFILE_ERROR,D);this.pvs.callGPlayer("UserManager","updateProfile",[K,I],0,[A,J,H,B,E,G,C,F])}else{this.pvs.sendEvent(GOTUIT.PVS.EVENT.USER_UPDATEPROFILE_ERROR,L)}},logout:function(A){var C=this;var B={onSuccess:function(){C.oUserProfile=null;C.oMyFavorites=null;C.oMyScenes=null;C.pvs.sendEvent(GOTUIT.PVS.EVENT.USER_LOGOUT)}};this.pvs.callGPlayer("UserManager","logout",[B,A])},_isValidDOB:function(B){try{if(B!=null){var E=B.split("/");if(E.length==3){if(E[0].length==2&&E[1].length==2&&E[2].length==4){if(parseInt(E[0],10)&&parseInt(E[1],10)&&parseInt(E[2],10)){var D=parseInt(E[0],10);var G=parseInt(E[1],10);var A=parseInt(E[2],10);var C=[];C[1]=31;C[2]=28;C[3]=31;C[4]=30;C[5]=31;C[6]=30;C[7]=31;C[8]=31;C[9]=30;C[10]=31;C[11]=30;C[12]=31;if(C[D]==null||D<1||D>12){return"InvalidDOBMonth"}else{if(G<1||G>C[D]){return"InvalidDOBDay"}else{return null}}}}}}}catch(F){}return"InvalidDOB"},_convertDOB:function(A){var B=A.split("/");return B[2]+"-"+B[0]+"-"+B[1]},_getLoginResponseHandler:function(A,E,B){var D=this;var C={onSuccess:function(F,H,G){D.oUserProfile=F;D.oMyFavorites=H;D.oMyScenes=G;D.pvs.sendEvent(A,F,H,G);D.pvs.sendEvent(GOTUIT.PVS.EVENT.USER_LOGIN,F,H,G,B)},onError:function(F,G){D.pvs.sendEvent(E,F,G)}};return C},addToFavorites:function(C,A,B){if(this.getIsLoggedIn()){this.pvs.Content.add(this.getMyFavorites(),C,A,B)}}});GOTUIT.PVS.EVENT={READY:"OnReady",CONFIG_READY:"ConfigReady",GPLAYER_READY:"GPlayerReady",GPLAYER_START:"GPlayerStart",PLAYERS_READY:"PlayersReady",CHANNELS_READY:"ChannelsReady",COMPONENTS_READY:"ComponentsReady",WINDOW_LOADED:"WindowLoaded",APP_FULLSCREEN:"GPlayerScreenSizeChanged",CHANNELS:"Channels",CHANNEL_ADDED:"ChannelAdded",CHANNEL_REMOVED:"ChannelRemoved",CHANNEL_CONTEXT_CHANGE:"NavigatorChannelContextChange",SELECTION_CHANGED:"SelectionChanged",SELECTION_SET:"SelectionSet",SELECTION_OVERRIDE:"SelectionOverride",NAVIGATOR_DRILL_DOWN:"NavigatorDrillDown",NAVIGATOR_GO_UP:"NavigatorGoUp",NAVIGATOR_NEXT_PAGE:"NavigatorNextPage",NAVIGATOR_PREV_PAGE:"NavigatorPrevPage",NAVIGATOR_ADD_TO_FAVORITES:"NavigatorAddToFavorites",NAVIGATOR_EDIT:"NavigatorEdit",NAVIGATOR_PLAY:"NavigatorPlay",NAVIGATOR_PLAY_CURRENT_LEVEL:"NavigatorPlayCurrentLevel",NAVIGATOR_MOVE_UP:"NavigatorMoveUp",NAVIGATOR_MOVE_DOWN:"NavigatorMoveDown",NAVIGATOR_REMOVE:"NavigatorRemove",NAVIGATOR_DELETE:"NavigatorDelete",NAVIGATOR_PARENT_CHANGED:"NavigatorParentChanged",NAVIGATOR_RELOAD:"NavigatorReload",CONTENTBAR_GO_TO_PLAYING:"ContentBarGoToPlaying",CONTENTBAR_PASS_THROUGH:"ContentPassThrough",USER_LOGIN_SUCCESS:"UserLoginSuccess",USER_LOGIN_ERROR:"UserLoginError",USER_REGISTER_SUCCESS:"UserRegisterSuccess",USER_REGISTER_ERROR:"UserRegisterError",USER_LOGIN:"UserLogin",USER_LOGOUT:"UserLogout",USER_RESETPASSWORD_SUCCESS:"UserResetPasswordSuccess",USER_RESETPASSWORD_ERROR:"UserResetPasswordError",USER_UPDATEPASSWORD_SUCCESS:"UserResetPasswordSuccess",USER_UPDATEPASSWORD_ERROR:"UserResetPasswordError",USER_UPDATEPROFILE_SUCCESS:"UserUpdateProfileSuccess",USER_UPDATEPROFILE_ERROR:"UserUpdateProfileError",LOGIN_REQUEST:"LoginRequest",LOGOUT_REQUEST:"LogoutRequest",REGISTER_REQUEST:"RegisterRequest",RESETPASSWORD_REQUEST:"ResetPasswordRequest",UPDATEPASSWORD_REQUEST:"UpdatePasswordRequest",UPDATEPROFILE_REQUEST:"UpdateProfileRequest",REGISTRATION_CHANGE_REQUEST:"RegistationChangeRequest",PLAYBLOCK_STARTED:"PlayControllerPlayBlockStart",PLAYBLOCK_COMPLETE:"PlayControllerPlayBlockComplete",PLAY_STARTED:"PlayControllerContentPlayStart",PLAY_SEEK:"PlayControllerContentPlaySeek",PLAY_COMPLETE:"PlayControllerContentPlayComplete",PLAYER_STATE_CHANGE:"PlayerStateChange",PLAYER_SEEK:"PlayerSeek",PLAYER_ADDCUEPOINT:"PlayerAddCuePoint",PLAYER_PAUSE:"PlayerPause",PLAYER_VOLUME_CHANGE:"PlayerVolumeChange",PLAYER_AD_STARTED:"PlayerAdStarted",PLAYER_AD_COMPLETE:"PlayerAdComplete",PLAYER_WINDOW_CHANGE:"PlayerWindowChange",PLAYER_CONTROLS_REMIXTHIS:"PlayerControlsRemixThis",PLAY:"Play",EDIT:"Edit",EDIT_SUCCESS:"EditSuccess",EDIT_ERROR:"EditError",ADD:"Add",ADD_SUCCESS:"AddSuccess",ADD_ERROR:"AddError",ADD_TO_FAVORITES:"AddToFavorites",ADD_TO_FAVORITES_SUCCESS:"AddToFavoritesSuccess",ADD_TO_FAVORITES_ERROR:"AddToFavoritesError",MOVE:"Move",MOVE_SUCCESS:"MoveSuccess",MOVE_ERROR:"MoveError",REMOVE:"Remove",REMOVE_SUCCESS:"RemoveSuccess",REMOVE_ERROR:"RemoveError",DELETE_REQUEST:"DeleteRequest",DELETE:"Delete",DELETE_SUCCESS:"DeleteSuccess",DELETE_ERROR:"DeleteError",FLAG:"Flag",FLAG_SUCCESS:"FlagSuccess",CURRENTSCENE_VIDEO_PLAY:"PlayerSceneVideoPlay",CURRENTSCENE_VIDEO_STOP:"PlayerSceneVideoStop",CURRENTSCENE_CREATE_SUCCESS:"PlayerSceneCreateSuccess",CURRENTSCENE_CREATE_ERROR:"PlayerSceneCreateError",CURRENTSCENE_EDIT:"PlayerSceneEdit",CURRENTSCENE_EDIT_SUCCESS:"PlayerSceneEditSuccess",CURRENTSCENE_EDIT_ERROR:"PlayerSceneEditError",CURRENTSCENE_UPDATE_METADATA_SUCCESS:"PlayerSceneUpdateMetadataSuccess",CURRENTSCENE_UPDATE_METADATA_ERROR:"PlayerSceneUpdateMetadataError",CURRENTSCENE_STATUS_SUCCESS:"SceneStatusSuccess",CURRENTSCENE_STATUS_ERROR:"SceneStatusError",CURRENTSCENE_PREVIEW:"ScenePreview",CURRENTSCENE_SAVE_SHOW_DIALOG:"SceneSaveShowDialog",CURRENTSCENE_SAVE:"PlayerSceneSave",CURRENTSCENE_SAVE_CANCEL:"PlayerSceneSaveCancel",CURRENTSCENE_SAVE_SUCCESS:"PlayerSceneSaveSuccess",CURRENTSCENE_SAVE_ERROR:"PlayerSceneSaveError",CURRENTSCENE_CANCEL:"PlayerSceneCancel",CURRENTSCENE_CANCEL_SUCCESS:"PlayerSceneCancelSuccess",CURRENTSCENE_CANCEL_ERROR:"PlayerSceneCancelError",CURRENTSCENE_THUMBNAIL_LOADING:"SceneThumbnailLoading",CURRENTSCENE_THUMBNAIL_COMPLETE:"SceneThumbnailComplete",CURRENTSCENE_THUMBNAIL_ERROR:"SceneThumbnailError",CURRENTSCENE_OFFSETS_CHANGED:"SceneControlsOffsetsChanged",SCENE_DELETE:"SceneDelete",SCENE_DELETE_SUCCESS:"PlayerSceneDeleteSuccess",SCENE_DELETE_ERROR:"PlayerSceneDeleteError",CURRENTREMIX_INIT_EVENT:"RemixInitEvent",CURRENTREMIX_CREATE:"RemixCreate",CURRENTREMIX_PROMPT_CREATE_WITH_UNSAVEDWORK:"RemixPromptCreateWithUnsavedWork",CURRENTREMIX_CREATE_SUCCESS:"RemixCreateSuccess",CURRENTREMIX_CREATE_ERROR:"RemixCreateError",CURRENTREMIX_EDIT:"RemixEdit",CURRENTREMIX_PROMPT_EDIT_WITH_UNSAVEDWORK:"RemixPromptEditWithUnsavedWork",CURRENTREMIX_EDIT_SUCCESS:"RemixEditSuccess",CURRENTREMIX_EDIT_ERROR:"RemixEditError",CURRENTREMIX_ADD:"RemixAdd",CURRENTREMIX_ADD_SUCCESS:"RemixAddSuccess",CURRENTREMIX_ADD_ERROR:"RemixAddError",CURRENTREMIX_REMOVE:"RemixRemove",CURRENTREMIX_REMOVE_SUCCESS:"RemixRemoveSuccess",CURRENTREMIX_REMOVE_ERROR:"RemixRemoveError",CURRENTREMIX_MOVE_SUCCESS:"RemixMoveSuccess",CURRENTREMIX_MOVE_ERROR:"RemixMoveError",CURRENTREMIX_UPDATE_METADATA_SUCCESS:"RemixUpdateMetadataSuccess",CURRENTREMIX_UPDATE_METADATA_ERROR:"RemixUpdateMetadataError",CURRENTREMIX_STATUS_SUCCESS:"RemixStatusSuccess",CURRENTREMIX_STATUS_ERROR:"RemixStatusError",CURRENTREMIX_PREVIEW:"RemixPreview",CURRENTREMIX_SAVE_SHOW_DIALOG:"RemixSaveShowDialog",CURRENTREMIX_SAVE:"RemixSave",CURRENTREMIX_SAVE_PROMPT_OVERWRITE:"RemixSavePromptOverwrite",CURRENTREMIX_SAVE_PROMPT_OVERWRITE_CANCEL:"RemixSavePromptOverwriteCancel",CURRENTREMIX_SAVE_CANCEL:"RemixSaveCancel",CURRENTREMIX_SAVE_SUCCESS:"RemixSaveSuccess",CURRENTREMIX_SAVE_ERROR:"RemixSaveError",CURRENTREMIX_CLOSE_SUCCESS:"RemixCloseSuccess",CURRENTREMIX_CLOSE_ERROR:"RemixCloseError",CURRENTREMIX_SHARE_SHOW_DIALOG:"RemixShareShowDialog",CURRENTREMIX_SHARE_HIDE_DIALOG:"RemixShareHideDialog",REMIX_DELETE:"RemixDelete",REMIX_PROMPT_CLOSE_BEFORE_DELETE:"RemixPromptCloseBeforeDelete",REMIX_DELETE_SUCCESS:"RemixDeleteSuccess",REMIX_DELETE_ERROR:"RemixDeleteError"};GOTUIT.PVS.Config=GOTUIT.Class.create({initialize:function(C,A){var E=this;this.pvs=C;var D=function(F){var G=GOTUIT.DOM.XML.createDocument(F);E.xmlConfig=G;E.bValid=true;C.setConfig(E);C.setInitializationState(GOTUIT.PVS.EVENT.CONFIG_READY)};var B=function(){C.logError("unable to load configuration")};A=this.pvs.Util.addURLParam(A,"ck",Math.random());GOTUIT.AJAX.get(A,D,B)},getSystemURL:function(B){var A=GOTUIT.DOM.XML.selectSingleNode(this.xmlConfig,"/gotuit/pvs/system/url[@name='"+B+"']");return GOTUIT.DOM.XML.getNodeAttribute(A,"value")},getSystemParam:function(B,A){var C=GOTUIT.DOM.XML.selectSingleNode(this.xmlConfig,"/gotuit/pvs/system/param[@name='"+B+"']");if(A!=null){return GOTUIT.DOM.XML.getNodeAttribute(C,A)}else{return GOTUIT.DOM.XML.getNodeValue(C)}},getComponentParam:function(E,B,A){var C;var D=GOTUIT.DOM.XML.selectSingleNode(this.xmlConfig,"/gotuit/pvs/components/"+E+"/param[@name='"+B+"']");if(A!=null){C=GOTUIT.DOM.XML.getNodeAttribute(D,A)}else{C=GOTUIT.DOM.XML.getNodeValue(D)}if(!C){C=this.getSystemParam(B,A)}return C},getComponentParams:function(F,C,B){var G=[];var E=GOTUIT.DOM.XML.selectNodes(this.xmlConfig,"/gotuit/pvs/components/"+F+"/param[@name='"+C+"']");var D;for(var A=0;A<E.length;A++){if(B!=null){D=GOTUIT.DOM.XML.getNodeAttribute(E[A],B)}else{D=GOTUIT.DOM.XML.getNodeValue(E[A])}G.push(D)}return G},getComponentNodes:function(D,A){var C="/gotuit/pvs/components/"+D+"/"+A;var B=GOTUIT.DOM.XML.selectNodes(this.xmlConfig,C);return B},getContentDisplayOptions:function(D){var H=[];var E=GOTUIT.DOM.XML.selectNodes(this.xmlConfig,"/gotuit/pvs/components/"+D+"/content");var I,B,J,A,C;for(var G=0;G<E.length;G++){I={};for(var F=0;F<E[G].attributes.length;F++){B=E[G].attributes[F].name;I[B]=E[G].attributes[F].value}I.search=null;A=GOTUIT.DOM.XML.selectSingleSubNode(E[G],"//search");if(A!=null){I.search={};for(var F=0;F<A.attributes.length;F++){B=A.attributes[F].name;J=A.attributes[F].value;I.search[B]=J}}I.cssClasses=[];C=GOTUIT.DOM.XML.selectSubNodes(E[G],"//cssClass");for(var F=0;F<C.length;F++){I.cssClasses.push(GOTUIT.DOM.XML.getNodeValue(C[F]))}H.push(new GOTUIT.PVS.DisplayOptions(I))}return H}});var iCallIndex=1;var aCallbacks=[];var aStatusCallbacks=[];var aErrorCallbacks=[];var PVS_aResponseHandlers=[];var GPLAYER=null;function getGPlayer(){if(GPLAYER==null){GPLAYER=GOTUIT.DOM.get("PVS_GPlayer")}return GPLAYER}function timeoutRelay(B,A){if(!A){setTimeout(B,5)}else{setTimeout(function(){B.apply(this,A)},5)}}function PVS_registerCall(B){if(B==null){B=[]}var A=iCallIndex++;PVS_aResponseHandlers[A]=B;return A}function clearCall(A){PVS_aResponseHandlers[A]=null}function PVS_prepareContentParam(A){if(typeof A=="object"){return A.getBaseRef()}else{return A}}function PVS_Response_Success(D,G,E,F){pvs.log("[Success Response] (index "+D+")");if(PVS_aResponseHandlers[D]!=null){var C=PVS_aResponseHandlers[D];var B;var H=PVS_processIncomingParams(G,E,F);for(var A=0;A<C.length;A++){if(C[A]!=null){B=C[A]["onSuccess"];if(B!=null){timeoutRelay(B,H)}}}}clearCall(D)}function PVS_Response_Status(D,F){pvs.log("[Status Response] "+F+" (index "+D+")");if(PVS_aResponseHandlers[D]!=null){var C=PVS_aResponseHandlers[D];var B,E;for(var A=0;A<C.length;A++){if(C[A]!=null){B=C[A]["onStatus"];if(B!=null){timeoutRelay(B,[F])}}}}}function PVS_Response_Error(E,D,F){pvs.log("[Error Response] "+D+" (index "+E+") helper: "+F);if(PVS_aResponseHandlers[E]!=null){var C=PVS_aResponseHandlers[E];var B,G;for(var A=0;A<C.length;A++){if(C[A]!=null){B=C[A]["onError"];if(B!=null){timeoutRelay(B,[D,F])}}}}clearCall(E)}function PVS_Event(D,E,C,A,B){C=PVS_processIncomingParams(C,A,B);pvs.log("[Event] "+D+"."+E+" : "+C);timeoutRelay(GOTUIT.Function.bindCall(pvs.onEvent,pvs),[D,E,C])}function PVS_processIncomingParams(C,A,D){if(A!=null){var F=new Array();var K,E,H,J,B;for(var M=0;M<A.length;M++){E=A[M];if(F[E]==null){F[E]=true;if(C[E]!=null){H=false;for(var L=0;L<D.length;L++){if(D[L]==E){H=true}}if(H){J=C[E];B=[];var G;for(var I=0;I<J.length;I++){G=J[I];K=new GOTUIT.PVS.GPlayerContent(pvs);K.setBaseRef(G);B.push(K)}C[E]=B}else{K=new GOTUIT.PVS.GPlayerContent(pvs);K.setBaseRef(C[E]);C[E]=K}}}}}return C}GOTUIT.PVS.Content=GOTUIT.Class.create({initialize:function(A){this.sTYPE_GPLAYERCONTENT="#GPlayerContent#";this.pvs=A;this.sContentType=null;this.oBaseRef=null;this.bIsSearchResult=false;this.oDisplayOptions=null;this.oParent=null;this.nIndex=0;this.sChannel=null;this.sPlaylist=null;this.bIsSegmentContainer=false;this.bIsPlaylist=false;this.bIsSegment=false;this.bIsRemix=false;this.bIsScene=false;this.bIsSearch=false;this.bCanShare=false;this.bCanEmbed=false;this.bCanOpen=false;this.bCanClose=false;this.bCanPlay=false;this.sVideoType="";this.sVideoFile="";this.nStartOffset=0;this.nEndOffset=0;this.bHasDuration=false;this.nDuration=0;this.bHasAudioTrack=false;this.sAudioTrackFile=null;this.sAudioTrackPlaylistID=null;this.sAudioTrackSegmentID=null;this.bCanRate=false;this.bHasRating=false;this.nRating=0;this.nRatingCount=0;this.bHasSessionRating=false;this.nSessionRating=0;this.sType=null;this.sID=null;this.sInstanceID=null;this.sTitle="";this.sThumbnailURL="";this.sMissingThumbnailURL="";this.sPLType=null;this.sShareSignature="";this.aDetailIndex=[];this.aSearchAttributesSelected=[]},getBaseRef:function(){return this.oBaseRef},setBaseRef:function(A){this.oBaseRef=A},getHasDisplayOptions:function(){return(this.oDisplayOptions!=null)},setDisplayOptions:function(A){this.oDisplayOptions=A},getDisplayOptions:function(){return this.oDisplayOptions},getHasParent:function(){return(this.oParent!=null)},getParent:function(){return this.oParent},setParent:function(A){this.oParent=A},getIndex:function(){return this.nIndex},setIndex:function(A){this.nIndex=A},getHasChannel:function(){return(this.sChannel!=null)},getChannel:function(){return this.sChannel},setChannel:function(A){this.sChannel=A},getHasPlaylist:function(){return(this.sPlaylist!=null)},getPlaylist:function(){return this.sPlaylist},setPlaylist:function(A){this.sPlaylist=A},getIsSegmentContainer:function(){return this.bIsSegmentContainer},getIsPlaylist:function(){return this.bIsPlaylist},getIsSegment:function(){return this.bIsSegment},getIsRemix:function(){return this.bIsRemix},getIsScene:function(){return this.bIsScene},getIsSearch:function(){return this.bIsSearch},getCanPlay:function(){return this.bCanPlay},getSourceType:function(){return this.sVideoType},getSourceFile:function(){return this.sVideoFile},getStartOffset:function(){return this.nStartOffset},getEndOffset:function(){return this.nEndOffset},getHasDuration:function(){return this.bHasDuration},getDuration:function(){return this.nDuration},getHasAudioTrack:function(){return this.bCanPlay},getAudioTrackFile:function(){return this.sAudioTrackFile},getAudioTrackPlaylistID:function(){return this.sAudioTrackPlaylistID},getAudioTrackSegmentID:function(){return this.getAudioTrackSegmentID},getCanRate:function(){return this.bCanRate},getHasRating:function(){return this.bHasRating},getRating:function(){return this.nRating},getRatingCount:function(){return this.nRatingCount},getHasSessionRating:function(){return this.bHasSessionRating},getSessionRating:function(){return this.nSessionRating},getCanOpen:function(){return this.bCanOpen},open:function(B,A){},setCanClose:function(A){this.bCanClose=A},getCanClose:function(){return this.bCanClose},close:function(B,A){},play:function(B,A){},getType:function(){return this.sType},getID:function(){return this.sID},setID:function(A){this.sID=A},getHasInstanceID:function(){return(this.sInstanceID!=null)},getInstanceID:function(){return this.sInstanceID},setInstanceID:function(A){this.sInstanceID=sInstanceID},getTitle:function(){return this.sTitle},setTitle:function(A){this.sTitle=A},getCSSClassName:function(A){A=(A==null)?this.getTitle():A;A=A.replace(/ /g,"");A=A.replace(/'/g,"");return A},getHasThumbnailURL:function(){return(this.sThumbnailURL!=""&&this.sThumbnailURL!=null)},getThumbnailURL:function(){return this.sThumbnailURL},getMissingThumbnailURL:function(){return this.sMissingThumbnailURL},getHasPLType:function(){return(this.sPLType!=""&&this.sPLType!=null)},getPLType:function(){return this.sPLType},getCanShare:function(){return this.bCanShare},getCanEmbed:function(){return this.bCanEmbed},getShareSignature:function(){return this.sShareSignature},toJSON:function(){return GOTUIT.Object.toJSON(this.getShareSignature())},getDetails:function(){return null},addDetail:function(A,B){A=A.replace(/ /g,"");A=A.replace(/_/g,"");A=A.toLowerCase();this.aDetailIndex["GDETAIL_"+A]=B},hasDetail:function(A){A=A.replace(/ /g,"");A=A.replace(/_/g,"");A=A.toLowerCase();A="GDETAIL_"+A;if(this.aDetailIndex[A]!=null){return(this.aDetailIndex[A].length>0)}return false},getDetail:function(A){A=A.replace(/ /g,"");A=A.replace(/_/g,"");A=A.toLowerCase();return this.aDetailIndex["GDETAIL_"+A]},getSearchAttributesSelected:function(){return this.aSearchAttributesSelected},setSearchAttributesSelected:function(A){this.aSearchAttributesSelected=A}});GOTUIT.PVS.GPlayerContent=GOTUIT.Class.extend(GOTUIT.PVS.Content,{initialize:function($super,A){$super(A);this.sContentType=this.sTYPE_GPLAYERCONTENT},setBaseRef:function(B){GOTUIT.PVS.Content.prototype.setBaseRef.call(this,B);if(GOTUIT.Object.isString(B)){return }this.sCacheID=B.CacheID;this.bCanOpen=B.canOpen;this.bCanClose=B.canClose;this.bCanPlay=B.canPlay;if(this.bCanPlay){this.sVideoType=B.VideoType;this.sVideoFile=B.VideoFile;this.nStartOffset=B.StartOffset;this.nEndOffset=B.EndOffset}this.bHasDuration=B.hasDuration;this.nDuration=B.Duration;this.bHasAudioTrack=B.hasAudioTrack;if(this.bHasAudioTrack){this.sAudioTrackFile=B.audioTrackFile;this.sAudioTrackPlaylistID=B.audioTrackPlaylistID;this.sAudioTrackSegmentID=B.audioTrackSegmentID}this.bCanRate=B.canRate;if(this.bCanRate){this.bHasRating=B.HasRating;this.nRating=B.Rating;this.nRatingCount=B.RatingCount;this.bHasSessionRating=B.HasSessionRating;this.nSessionRating=B.SessionRating}this.sChannel=B.Channel;this.sPlaylist=B.Playlist;this.bIsSegmentContainer=B.isSegmentContainer;this.bIsPlaylist=B.isPlaylist;this.bIsSegment=B.isSegment;this.bIsRemix=B.isRemix;this.bIsScene=B.isScene;this.bIsSearch=B.isSearch;this.bCanShare=B.canShare;this.bCanEmbed=B.canEmbed;this.sShareSignature=B.ShareSignature;this.sType=B.Type;this.sID=B.ID;this.sInstanceID=B.Instance;if(B.isSearch){this.sTitle="Results for: "+B.Title}else{this.sTitle=B.Title}this.sThumbnailURL=B.ThumbnailURL;this.sMissingThumbnailURL=B.MissingThumbnailURL;this.sPLType=B.PLType;for(var A=0;A<B.Details.length;A++){this.addDetail(B.Details[A].name,B.Details[A].value)}},getCacheID:function(){return this.sCacheID},getDynamicContent:function(){return this.oDynamicContent},setDynamicContent:function(A){this.oDynamicContent=A},equals:function(C){try{if(this.getCacheID()==C.getCacheID()){return true}else{if(C.getDynamicContent()===this||this.getDynamicContent()===C){return true}else{var B=false;if(this.getType()==C.getType()){B=true}else{if((this.getIsSegment()&&C.getIsSegment())||(this.getIsPlaylist()&&C.getIsPlaylist())){B=true}}var A=false;if((this.getID()!=null)&&(C.getID()!=null)){if(this.getID()==C.getID()){A=true}}else{if(this.getTitle()==C.getTitle()){A=true}}return(B&&A)}}}catch(D){return false}},clone:function(){var A=new GOTUIT.PVS.GPlayerContent(this.pvs);return GOTUIT.Object.extend(A,this)},copyOptions:function(A){if(A&&!GOTUIT.Object.isString(A)){this.setDisplayOptions(A.getDisplayOptions());this.setParent(A.getParent());if(GOTUIT.Object.isString(A.getBaseRef())&&A.getDisplayOptions()&&A.getDisplayOptions().getIsDynamic()){this.setDynamicContent(A)}else{this.setDynamicContent(A.getDynamicContent())}}},getDetails:function(){return this.getBaseRef.Details},open:function(A){this.pvs.Content.open(this,A)},openSlice:function(C,B,A){this.pvs.Content.openSlice(this,C,B,A)},close:function(A){this.pvs.Content.close(this,A)},play:function(C,B){var A={};A.ProgressByBlock=C;A.PlaySegmentSiblings=B;this.pvs.Player.play(this,A)}});GOTUIT.PVS.DisplayOptions=GOTUIT.Class.create({initialize:function(A){GOTUIT.Object.extend(this,A)},clone:function(){return new GOTUIT.PVS.DisplayOptions(this)},getLoadMethod:function(){if(this.loadMethod){return this.loadMethod}return"static"},getType:function(){if(this.type){return this.type}return"fixed"},getIsStatic:function(){return this.getType()=="fixed"},getIsDynamic:function(){return this.getType()=="dynamic"},getIsSpread:function(){return this.getType()=="spread"},getIsPassThrough:function(){return this.getType()=="passThrough"},getTitle:function(){return this.title},getHoverText:function(){return this.hover},getSignature:function(){return this.signature},getHideText:function(){return(this.hideText&&this.hideText=="true")},getRequiresLogin:function(){return(this.requireLogin?true:false)},getRequiresLoginMessage:function(){if(this.requireLogin&&this.requireLogin=="true"){return null}else{return this.requireLogin}},getHasCanDrill:function(){return this.canDrill!=null},getCanDrill:function(){return this.canDrill=="true"},getHasCanDrag:function(){return this.canDrag!=null},getCanDrag:function(){return this.canDrag=="true"},getIsDefault:function(){return this.isDefault=="true"},getMaxContent:function(){var A=this.maxContent;if(GOTUIT.Object.isString(A)){A=parseInt(A,10)}if(isNaN(A)){A=0}return A},setMaxContent:function(A){this.maxContent=A},isSearchEnabled:function(){return(this.search&&this.search.signature!=null)},getSearchSignature:function(){if(this.isSearchEnabled()){return this.search.signature}return null},getSearchPrompt:function(){try{return this.search.prompt}catch(A){}return""},getSearchAttributes:function(){var B=[];try{var D=0;for(var A in this.search){var C=this.search[A];if(A.match("attribute")!=null){B[D]=C;D++}}}catch(E){}return B},getSearchClearBarSelection:function(){try{return(this.search.clearBarSelection=="true")}catch(A){}return false},getSearchAttributeCustomNames:function(){var B=[];try{var D=0;for(var A in this.search){var C=this.search[A];if(A.match("customName")!=null){B[D]=C;D++}}}catch(E){}return B},getSearchMaxContent:function(){var B=0;if(this.isSearchEnabled()){try{B=this.search.maxContent;B=parseInt(B,10);if(isNaN(B)){B=0}}catch(A){}}return B},getCSSClasses:function(){return this.cssClasses}});GOTUIT.PVS.UIContent=GOTUIT.Class.create({initialize:function(A,B){this.oContent=A;this.eContainer=B;this.aListeners=new Array();this.nIndex=0;this.aChildLinks=[]},getID:function(){return this.oContent.getID()},getTitle:function(){return this.oContent.getTitle()},getContent:function(){return this.oContent},setContent:function(A){this.oContent=A},getContainer:function(){return this.eContainer},setIndex:function(A){this.nIndex=A},getIndex:function(){return this.nIndex},addChildLink:function(A){this.aChildLinks.push(A)},addEventListener:function(B,C,A){GOTUIT.Event.observe(B,C,A);this.aListeners.push({target:B,type:C,fn:A})},destroy:function(){var D;for(var A=0;A<this.aListeners.length;A++){D=this.aListeners[A];GOTUIT.Event.stopObserving(D.target,D.type,D.fn)}try{GOTUIT.DOM.remove(this.eContainer)}catch(C){}var B;for(var A=0;A<this.aChildLinks.length;A++){B=this.aChildLinks[A];try{B.destroy()}catch(C){}}},toJSON:function(){var A=this.getContainer();var C=null;try{var C=A.getAttribute("id")||A.getAttribute("class")}catch(B){}return GOTUIT.Object.toJSON(C)}});GOTUIT.PVS.Button=GOTUIT.Class.extend(GOTUIT.PVS.UIContent,{initialize:function(H,G,B,A){if(!A){A=GOTUIT.DOM.create("div",{"class":H})}else{GOTUIT.DOM.addClass(A,H)}GOTUIT.PVS.UIContent.prototype.initialize.call(this,G,A);GOTUIT.PVS.Button.register(this);this.eButton=A;this.sName=H;this.oOptions=B;this.bMouseOver=false;this.bPressed=false;this.bSelected=false;this.bDisabled=false;this.bDisarmed=false;this.bDisarmOnClick=false;var C=GOTUIT.Function.bindListener(this.eventButtonOver,this);var F=GOTUIT.Function.bindListener(this.eventButtonOut,this);var E=GOTUIT.Function.bindListener(this.eventButtonDown,this);var D=GOTUIT.Function.bindListener(this.eventButtonClick,this);this.addEventListener(A,"mouseover",C);this.addEventListener(A,"mouseout",F);this.addEventListener(A,"mousedown",E);this.addEventListener(A,"click",D)},destroy:function(){GOTUIT.PVS.Button.unregister(this);GOTUIT.PVS.UIContent.prototype.destroy.call(this)},getElement:function(){return this.eButton},getName:function(){return this.sName},getOptions:function(){return this.oOptions},getButton:function(){return this.getContainer()},getMouseOver:function(){return this.bMouseOver},setMouseOver:function(A){this.bMouseOver=A;this.setStyle()},getPressed:function(){return this.bPressed},setPressed:function(A){this.bPressed=A;this.setStyle()},getSelected:function(){return this.bSelected},setSelected:function(A){this.bSelected=A;this.setStyle()},getDisabled:function(){return this.bDisabled},setDisabled:function(A){this.bDisabled=A;this.setStyle()},getDisarmed:function(){return this.bDisarmed},setDisarmed:function(A){this.bDisarmed=A;this.setStyle()},getDisarmOnClick:function(){return this.bDisarmOnClick},setDisarmOnClick:function(A){this.bDisarmOnClick=A},setHoverText:function(A){if(A){this.getButton().title=A}else{this.getButton().title=null}},setTarget:function(A){if(A&&GOTUIT.Object.isString(A)){var B=this;GOTUIT.PVS.resolveComponent(A,function(C){B.oTarget=C})}else{this.oTarget=A}},getTarget:function(){return this.oTarget},setMouseOverEvent:function(A){this.sMouseOverEvent=A},setMouseOutEvent:function(A){this.sMouseOutEvent=A},setMouseDownEvent:function(A){this.sMouseDownEvent=A},setMouseUpEvent:function(A){this.sMouseUpEvent=A},setMouseClickEvent:function(A){this.sMouseClickEvent=A},_appendStyleName:function(G,E,B){var D=this.getButton();var F=G.added;var I=G.removed;if(B){GOTUIT.DOM.addClass(D,E)}else{GOTUIT.DOM.removeClass(D,E)}var C=[],A,H;for(var K=0;K<I.length;K++){A=I[K];C.push(A);H=A+"_"+E;C.push(H);GOTUIT.DOM.removeClass(D,H)}I=C;if(B){C=[];for(var K=0;K<F.length;K++){A=F[K];C.push(A);H=A+"_"+E;C.push(H);GOTUIT.DOM.addClass(D,H)}F=C}else{C=[];for(var K=0;K<F.length;K++){A=F[K];C.push(A);H=A+"_"+E;C.push(H);GOTUIT.DOM.removeClass(D,H)}I=C}var J=this.getName()+"_"+E;if(B){F.push(J);GOTUIT.DOM.addClass(D,J)}else{I.push(J);GOTUIT.DOM.removeClass(D,J)}G.added=F;G.removed=I},setStyle:function(){if(this.getButton()){var A={added:[],removed:[]};this._appendStyleName(A,"Disabled",this.bDisabled);this._appendStyleName(A,"Disarmed",this.bDisarmed);this._appendStyleName(A,"Selected",this.bSelected);this._appendStyleName(A,"Pressed",this.bPressed);this._appendStyleName(A,"MouseOver",this.bMouseOver)}},eventButtonOver:function(A){if(this.getDisabled()){return }this.setMouseOver(true);if(this.oTarget&&this.sMouseOverEvent){this.oTarget.sendEvent(this.sMouseOverEvent,this.getContent())}},eventButtonOut:function(A){this.setMouseOver(false);if(this.oTarget&&this.sMouseOutEvent){this.oTarget.sendEvent(this.sMouseOutEvent,this.getContent())}},eventButtonDown:function(A){if(this.getDisabled()){return }GOTUIT.PVS.Button.setPressedButton(this);this.setPressed(true);if(this.oTarget&&this.sMouseDownEvent){this.oTarget.sendEvent(this.sMouseDownEvent,this.getContent())}},eventButtonUp:function(){var A=this.getPressed();this.setPressed(false);if(A&&this.oTarget&&this.sMouseUpEvent){this.oTarget.sendEvent(this.sMouseUpEvent,this.getContent())}},eventButtonClick:function(A){if(this.getDisabled()||this.getDisarmed()){return }if(this.getDisarmOnClick()){this.setDisarmed(true)}if(this.oTarget&&this.sMouseClickEvent){this.oTarget.sendEvent(this.sMouseClickEvent,this.getContent())}GOTUIT.Event.stop(A)},click:function(){this.eventButtonClick()}});Object.extend(GOTUIT.PVS.Button,{registeredCount:0,oPressedButton:null,register:function(A){if(this.registeredCount<=0){this.eventMouseUp=GOTUIT.Function.bindCall(this.setPressedButton,this,null);GOTUIT.Event.observeMouseUp(document,this.eventMouseUp)}this.registeredCount++},unregister:function(A){if(this.oPressedButton==A){this.setPressedButton(null)}this.registeredCount--;if(this.registeredCount<=0){GOTUIT.Event.stopObservingMouseUp(document,this.eventMouseUp)}},setPressedButton:function(A){if(this.oPressedButton){this.oPressedButton.eventButtonUp()}this.oPressedButton=A}});GOTUIT.PVS.ExternalVideoPlayer=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(B,E,A,D,C){GOTUIT.PVS.Component.prototype.initialize.call(this,B,E,A,D,C);this.oVideoPlayerComponent=C;this.sVideoType=A;this.nCuePointProximity=this.getFloatAttribute("CuePointProximity",0.3);this.nCuePoint=null;B.addListener(GOTUIT.PVS.EVENT.PLAYER_VOLUME_CHANGE,this._onPlayerVolumeChange,this);B.addListener(GOTUIT.PVS.EVENT.PLAYER_ADDCUEPOINT,this._onPlayerAddCuePoint,this)},getVideoType:function(){return this.sVideoType},setPlayerDiv:function(A){this.ePlayerDiv=GOTUIT.DOM.get(A)},getPlayerDiv:function(){return this.ePlayerDiv},canPlayThrough:function(){return false},playerHide:function(A){if(A){this.playerStop();GOTUIT.DOM.setStyles(this.getPlayerDiv(),{visibility:"hidden"})}else{GOTUIT.DOM.setStyles(this.getPlayerDiv(),{visibility:"visible"});this.playVolume(this.nVolume)}},playBlockStart:function(A){this.aPlayList=A},playBlockComplete:function(){this.playerStop();this.aPlayList=null},_onPlayerVolumeChange:function(A){this.nVolume=A;this.playVolume(A)},playerPause:function(A){},playerStop:function(){},playStart:function(C,B,A){},playSeek:function(C,B,A){},seek:function(A){},playComplete:function(C,A,B){},playVolume:function(A){},playVideo:function(A){},onVideoDuration:function(A){this.oVideoPlayerComponent.onVideoDuration(A)},setFullScreen:function(A){},_onPlayerAddCuePoint:function(A){this.nCuePoint=A},_checkForCuePoint:function(A){if(this.nCuePoint!=null){if(Math.abs(this.nCuePoint-A)<=this.nCuePointProximity){this._onCuePoint()}}},_onCuePoint:function(){this.nCuePoint=null;this.pvs.Player.AltFormatControls.onCuePoint()}});GOTUIT.PVS.FlvVideoPlayer=GOTUIT.Class.extend(GOTUIT.PVS.ExternalVideoPlayer,{initialize:function(B,F,A,E,D){GOTUIT.PVS.ExternalVideoPlayer.prototype.initialize.call(this,B,F,A,E,D);this.GPLAYER_ID="PVS_VideoPlayer_GPlayer";this.sWidth=this.getAttribute("Width","400");this.sHeight=this.getAttribute("Height","300");var G=GOTUIT.DOM.get(this.GPLAYER_ID);if(!G){G=GOTUIT.DOM.create("div",{id:this.GPLAYER_ID});F.appendChild(G)}this.setPlayerDiv(G);GOTUIT.DOM.absolutize(G);var C=GOTUIT.PVS.EVENT;B.addListener(C.CONFIG_READY,this.createSwf,this);B.addListener(C.GPLAYER_READY,this.onGPlayerReady,this);B.addListener(C.PLAYER_WINDOW_CHANGE,this.onPlayerWindowChange,this)},onPlayerWindowChange:function(B,A,C,D){this.log("window change: "+B+"x"+A+" at top "+C+", left "+D);GOTUIT.DOM.setStyles(this.GPLAYER_ID,{top:C+"px",left:D+"px"});GOTUIT.DOM.setStyles("PVS_GPlayer",{width:B+"px",height:A+"px"})},createSwf:function(){var N,V,L,S,B,T;var R,U,P;var E,I,C,M;var J,G,D,Q,A;var K=this.getAttribute("MinFlashVer","9.0.115");var F=GOTUIT.DOM.get(this.GPLAYER_ID);var M=GOTUIT.DOM.get("PVS_GPlayer");var O=this.oVideoPlayerComponent.getComponentElement();var H=GOTUIT.URL.getParams();if(!M){M=GOTUIT.DOM.create("div",{id:"PVS_GPlayer"});F.appendChild(M)}if(swfobject.hasFlashPlayerVersion(K)){N=this.getAttribute("SystemConfig","system.xml");V=this.getAttribute("AppConfig","app.xml");L=this.getAttribute("InactiveIntroVideo","");S=this.getAttribute("InactiveLoopVideo","");B=this.getAttribute("InactiveImage","");T=this.getBooleanAttribute("EnableRatings",true);R=this.getAttribute("WindowMode","window");U=this.pvs.getPVSBase()+"build/core/assets/gplayer.swf";U=this.getAttribute("GPlayerSWF",U);U=this.pvs.Util.addURLParam(U,"ck",Math.random());P=this.pvs.getPVSBase()+"build/core/assets/expressInstall.swf";P=this.getAttribute("ExpressInstallSWF",P);P=this.pvs.Util.addURLParam(P,"ck",Math.random());E={scfg:N,acfg:V,c:H.c,p:H.p,s:H.s,i:H.i,r:H.r,u:H.u,us:H.us,loglevel:H.loglevel,rlog:H.rlog,inactiveIntro:L,inactiveLoop:S,inactiveImage:B,ratings:T};if(H.space){E.u=H.space}I={allowScriptAccess:"always",allowFullScreen:"true"};if(R!=null){I.wmode=R}C={id:"PVS_GPlayer",name:"PVS_GPlayer"};swfobject.embedSWF(U,"PVS_GPlayer",this.sWidth,this.sHeight,K,P,E,I,C)}else{J=this.getAttribute("NoFlashImage","inc/images/noflash.jpg");G=this.getAttribute("NoFlashMsg","You must update your Flash Player to use this site! Download now.");D=this.getAttribute("NoFlashLink","http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash");Q=GOTUIT.DOM.create("a",{href:D,target:"_blank"});A=GOTUIT.DOM.create("img",{src:J,alt:G});Q.appendChild(A);M.appendChild(Q);GOTUIT.DOM.setStyles(M,{visibility:"visible"})}},onGPlayerReady:function(){this.oVideoPlayerComponent.playerReady(this)},playerHide:function(A){}});GOTUIT.PVS.QmxVideoPlayer=GOTUIT.Class.extend(GOTUIT.PVS.ExternalVideoPlayer,{initialize:function(B,F,A,E,C){GOTUIT.PVS.ExternalVideoPlayer.prototype.initialize.call(this,B,F,A,E,C);this.sQmxTop=this.getAttribute("QmxTop","4");this.sQmxLeft=this.getAttribute("QmxLeft","4");this.sQmxWidth=this.getAttribute("QmxWidth","400");this.sQmxHeight=this.getAttribute("QmxHeight","300");this.bAllowQvt=this.getBooleanAttribute("QmxAllowQvt",true);this.bAllowPlayThru=this.getBooleanAttribute("QmxAllowPlayThru",true);this.bAcceptSegmentEnds=false;this.QMXPLAYER_ID="PVS_VideoPlayer_Qmx";var D=GOTUIT.DOM.create("div",{id:this.QMXPLAYER_ID});GOTUIT.DOM.setStyles(D,{position:"absolute",zIndex:1000,top:this.sQmxTop,left:this.sQmxLeft,width:this.sQmxWidth,height:this.sQmxHeight});this.setPlayerDiv(D);F.appendChild(D);this.pvs.addListener(GOTUIT.PVS.EVENT.GPLAYER_READY,this._onGPlayerReady,this)},_onGPlayerReady:function(){this.sBaseURL=pvs.getMoveBaseURL();this.createMovePlayer()},createMovePlayer:function(){try{if(pvs.sLogLevel=="debug"){MN.Log.ShowPane(500)}if(!MN.QMPInstall.CanPlay()){this.oVideoPlayerComponent.hideFlash();this.bNeedInstall=true}MN.QVT.CreatePlayer(this.QMXPLAYER_ID,GOTUIT.Function.bindCall(this.onMovePlayerCreated,this),this.sQmxWidth,this.sQmxHeight)}catch(A){this.logException("error creating Move player: ",A)}},onMovePlayerCreated:function(A){this.oMovePlayer=A;if(A){if(this.bNeedInstall){this.oVideoPlayerComponent.showFlash()}this.playerHide(true);MN.Event.Observe(this.oMovePlayer,"PlayStateChanged",GOTUIT.Function.bindCall(this.onMovePlayStateChanged,this));MN.Event.Observe(this.oMovePlayer,"NextClip",GOTUIT.Function.bindCall(this.onNextClip,this));MN.Event.Observe(this.oMovePlayer,"ShowChanged",GOTUIT.Function.bindCall(this.onShowChanged,this));MN.Event.Observe(this.oMovePlayer,"BitRateChanged",GOTUIT.Function.bindCall(this.onBitRateChanged,this));this.oVideoPlayerComponent.playerReady(this)}else{this.log("Failed to create Move Qmx player")}},onMovePlayStateChanged:function(B,A){this.log("PlayStateChanged: "+B+" --> "+A);if(A==2){this.onVideoDuration(this.oMovePlayer.Duration())}else{if(A==3){this.bAcceptSegmentEnds=true}else{if(A==5){this.pvs.Player.AltFormatControls.onSegmentComplete()}}}},onNextClip:function(A){this.log("NextClip: "+A)},onShowChanged:function(A){this.log("ShowChanged: "+A+", accepting segment ends? "+this.bAcceptSegmentEnds);if(this.bAcceptSegmentEnds&&A>this.nPlayerByTypePlayListIndex){this.nPlayerByTypePlayListIndex=A;this.pvs.Player.AltFormatControls.onSegmentComplete()}},onBitRateChanged:function(A){this.log("BitRateChanged: "+A);this.pvs.callGPlayer("Player","onCurrentBitRate",null,0,[A])},playVolume:function(A){if(this.oMovePlayer){this.oMovePlayer.Volume(A)}},playerPause:function(A){if(this.oMovePlayer){this.oMovePlayer.Paused(A)}},playBlockStart:function(F){GOTUIT.PVS.ExternalVideoPlayer.prototype.playBlockStart.call(this,F);if(!this.bAllowQvt||F.length==0){return }var B={clips:[]};var C=0;var K;var J=0;var L;for(var G=0;G<F.length;G++){var E=F[G];var I=this.sBaseURL+E.getSourceFile();var D=E.getStartOffset();var A=E.getEndOffset();var H=A-D;if(G>0&&E.getSourceFile()==L.getSourceFile()&&E.getStartOffset()==L.getEndOffset()){K.range=J+","+A;K.shows.push({start:D-J})}else{J=D;K={url:I,range:D+","+A,shows:[{start:0}]};B.clips.push(K)}E.nQVTStartOffset=C;C+=H;E.nQVTEndOffset=C;L=E}for(var G=F.length-1;G>=0;G--){var E=F[G];if(G==F.length-1||F[G].nPlayListIndex+1!=F[G+1].nPlayListIndex){C=E.nQVTEndOffset}E.nQVTGroupEndOffset=C}this.oQVT=B;this.oMovePlayer.Load(B)},playBlockComplete:function(){GOTUIT.PVS.ExternalVideoPlayer.prototype.playBlockComplete.call(this);this.oQVT=null;this.bAcceptSegmentEnds=false},playStart:function(E,D,A){if(this.oQVT){if(this.bAllowPlayThru){if(this.nContollerByTypePlayListIndex<0||this.nPlayerByTypePlayListIndex<A||A!=this.nContollerByTypePlayListIndex+1||E.StartAdjustment>E.StartOffset){var B=this.aPlayList[A];this.log("Start play thru: "+(B.nQVTStartOffset+E.AdjustedStartOffset-E.StartOffset)+", "+B.nQVTGroupEndOffset);this.oMovePlayer.Play(this.oQVT,B.nQVTStartOffset+E.AdjustedStartOffset-E.StartOffset,B.nQVTGroupEndOffset)}}else{var B=this.aPlayList[A];this.oMovePlayer.Play(this.oQVT,B.nQVTStartOffset+E.AdjustedStartOffset-E.StartOffset,B.nQVTEndOffset)}}else{var C=this.sBaseURL+E.File;this.oMovePlayer.Play(C,E.StartOffset+E.AdjustedStartOffset-E.StartOffset,E.EndOffset)}this.nContollerByTypePlayListIndex=A;this.nPlayerByTypePlayListIndex=A;if(!this.positionInterval){this.positionInterval=setInterval(GOTUIT.Function.bindCall(this.onPositionInterval,this),250)}},playSeek:function(E,D,A){if(this.isPlaying()){var B=E.AdjustedStartOffset;if(this.oQVT){var C=this.aPlayList[A];B+=C.nQVTStartOffset-C.getStartOffset()}this.seek(B)}else{this.playStart(E,D,A)}this.pvs.Player.AltFormatControls.onSeekComplete()},seek:function(A){this.oMovePlayer.CurrentPosition(A)},onPositionInterval:function(){var A=this.oMovePlayer.CurrentPosition();if(this.aPlayList&&this.nPlayerByTypePlayListIndex>=0){var B=this.aPlayList[this.nPlayerByTypePlayListIndex];A=A-B.nQVTStartOffset+B.getStartOffset();this.pvs.Player.AltFormatControls.setVideoProgress(A,B.nPlayListIndex)}else{this.pvs.Player.AltFormatControls.setVideoProgress(A,-1)}this._checkForCuePoint(A)},isPlaying:function(){if(!this.oMovePlayer||this.oMovePlayer.CurrentPlayState()==4||this.oMovePlayer.CurrentPlayState()==5){return false}return true},playerStop:function(){if(this.positionInterval){clearInterval(this.positionInterval);this.positionInterval=null}if(this.oMovePlayer){this.oMovePlayer.Stop()}this.nContollerByTypePlayListIndex=-1;this.nPlayerByTypePlayListIndex=-1},playVideo:function(B){var A=this.sBaseURL+B;this.oMovePlayer.Play(A);if(!this.positionInterval){this.positionInterval=setInterval(GOTUIT.Function.bindCall(this.onPositionInterval,this),250)}},setFullScreen:function(B){if(this.oMovePlayer){var A=(B)?1:0;if(this.oMovePlayer.fullScreenSupported()){this.oMovePlayer.fullScreen(A)}}},zzz:null});GOTUIT.PVS.VideoPlayer=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(B,F,A,G){GOTUIT.PVS.Component.prototype.initialize.call(this,B,F,A,G);GOTUIT.DOM.setStyles(F,{position:"relative"});var I=this.getAttribute("VideoTypes","flv");if((","+I+",").indexOf(",flv,")==-1){I+=",flv"}var H=I.split(",");this.aPlayers=[];this.nPlayers=H.length;this.nPlayersReady=0;for(var E=0;E<H.length;E++){var C=H[E];var D=GOTUIT.String.capitalize(C)+"VideoPlayer";var J=GOTUIT.PVS[D];this.aPlayers[C]=new J(B,F,C,D,this);this.aPlayers.push(this.aPlayers[C]);this.log("Player added: "+D)}this.oActivePlayer=null;this.oActivePlayerType=null;var K=GOTUIT.PVS.EVENT;this.pvs.addListener(K.PLAYBLOCK_STARTED,this.onPlayBlockStarted,this);this.pvs.addListener(K.PLAYBLOCK_COMPLETE,this.onPlayBlockComplete,this);this.pvs.addListener(K.PLAY_STARTED,this.onPlayStarted,this);this.pvs.addListener(K.PLAYER_PAUSE,this.onPlayerPause,this);this.pvs.addListener(K.PLAYER_SEEK,this.onPlayerSeek,this);this.pvs.addListener(K.PLAY_SEEK,this.onPlaySeek,this);this.pvs.addListener(K.PLAY_COMPLETE,this.onPlayComplete,this);this.pvs.addListener(K.PLAYER_AD_STARTED,this.onPlayerAdStarted,this);this.pvs.addListener(K.CURRENTSCENE_VIDEO_PLAY,this.onSceneVideoPlay,this);this.pvs.addListener(K.CURRENTSCENE_VIDEO_STOP,this.onSceneVideoStop,this);this.pvs.addListener(K.APP_FULLSCREEN,this.onFullScreenChange,this)},playerReady:function(A){this.nPlayersReady++;this.log("Player ready["+this.nPlayersReady+"/"+this.nPlayers+"]: "+A.getName());if(this.nPlayersReady>=this.nPlayers){this.pvs.setInitializationState(GOTUIT.PVS.EVENT.PLAYERS_READY)}},onPlayBlockStarted:function(G,F){this.aPlayList=F;var B={};for(var A=0;A<this.aPlayers.length;A++){B[this.aPlayers[A].getVideoType()]=[]}for(var A=0;A<F.length;A++){var C=F[A];var E=C.getSourceType();C.nPlayListIndex=A;if(E&&B[E]){C.nByTypePlayListIndex=B[E].length;B[E].push(C)}this.log("!!! playing "+F[A].getSourceType()+" : "+F[A].getSourceFile()+" : "+F[A].getStartOffset()+" : "+F[A].getEndOffset())}for(var A=0;A<this.aPlayers.length;A++){var D=this.aPlayers[A];D.playBlockStart(B[D.getVideoType()])}},onPlayBlockComplete:function(B){for(var A=0;A<this.aPlayers.length;A++){this.aPlayers[A].playBlockComplete()}this.oActivePlayerType=null;if(this.oActivePlayer){this.oActivePlayer.playerHide(true);this.oActivePlayer=null}this.aPlayList=null},onPlayStarted:function(C,A,F,E){this.setActivePlayer(E.Type);var D=E.PlayIndex;var B=0;if(this.aPlayList){B=this.aPlayList[D].nByTypePlayListIndex}this.log("!!!!!! "+E.Type+" : "+E.File+" : "+E.StartOffset+" : "+E.EndOffset+" : from ad? "+E.StateComingFromAd);if(this.oActivePlayer){this.oActivePlayer.playStart(E,D,B)}},onPlaySeek:function(C,A,F,E){this.setActivePlayer(E.Type);var D=E.PlayIndex;var B=0;if(this.aPlayList){B=this.aPlayList[D].nByTypePlayListIndex}this.log("!!! seeking within current segment to: "+E.AdjustedStartOffset);if(this.oActivePlayer){this.oActivePlayer.playSeek(E,D,B)}},onPlayComplete:function(B,A,D,C){if(!this.aPlayList){this.onPlayBlockComplete(D)}},onPlayerPause:function(A){if(this.oActivePlayer){this.oActivePlayer.playerPause(A)}},onPlayerSeek:function(A){this.onPlaySeek(null,null,null,A)},onPlayerAdStarted:function(A){this.setActivePlayer("flv")},setActivePlayer:function(A){if(A&&A!=this.oActivePlayerType){if(this.oActivePlayer){this.oActivePlayer.playerHide(true)}this.oActivePlayer=this.aPlayers[A];this.oActivePlayerType=A;this.oActivePlayer.playerHide(false)}},onSceneVideoPlay:function(A){this.setActivePlayer(A.Type);if(this.oActivePlayer){this.oActivePlayer.playVideo(A.File)}},onSceneVideoStop:function(){if(this.oActivePlayer){this.oActivePlayer.playerHide(true);this.oActivePlayerType=null;this.oActivePlayer=null}},onVideoDuration:function(A){this.pvs.Player.AltFormatControls.setVideoDuration(A)},onFullScreenChange:function(B){if(!B){for(var A=0;A<this.aPlayers.length;A++){this.aPlayers[A].setFullScreen(false)}}else{if(this.oActivePlayer){this.oActivePlayer.setFullScreen(true)}}},hideFlash:function(){var A=this.aPlayers.flv;if(A){GOTUIT.DOM.setStyles(A.getPlayerDiv(),{visibility:"hidden"});GOTUIT.DOM.setStyles("PVS_GPlayer",{visibility:"hidden"})}},showFlash:function(){var A=this.aPlayers.flv;if(A){GOTUIT.DOM.setStyles(A.getPlayerDiv(),{visibility:"visible"});GOTUIT.DOM.setStyles("PVS_GPlayer",{visibility:"visible"})}},hideQmx:function(){var A=this.aPlayers.qmx;if(A){GOTUIT.DOM.setStyles(A.getPlayerDiv(),{visibility:"hidden"})}},showQmx:function(){var A=this.aPlayers.qmx;if(A){GOTUIT.DOM.setStyles(A.getPlayerDiv(),{visibility:"visible"})}},hide:function(A){GOTUIT.DOM.setStyles(this.eComponent,{visibility:"hidden"});this.hideFlash();this.hideQmx();if(A&&this.oActivePlayer){this.oActivePlayer.playerStop()}},show:function(){GOTUIT.DOM.setStyles(this.eComponent,{visibility:"visible"});this.showFlash();if(this.oActivePlayer){this.oActivePlayer.playerHide(false)}},zzz:null});GOTUIT.PVS.registerComponentType("VideoPlayer",GOTUIT.PVS.VideoPlayer);GOTUIT.PVS.ListEffects=GOTUIT.PVS.ListEffects||{};GOTUIT.PVS.ListEffects.Base=GOTUIT.Class.create({initialize:function(B,D,C,A){this.oComponent=B;this.eComponent=D;this.sName=C;if(!A){A=0.15}this.nDuration=B.getFloatAttribute("EffectDuration",A)},getDuration:function(){return this.nDuration},initializeOutEffect:function(A){A.PVS_EffectState="out";GOTUIT.DOM.setStyles(A,{visibility:"hidden"})},doOutEffect:function(A,B){if(A.PVS_EffectState!="out"){A.PVS_EffectState="out";GOTUIT.DOM.setStyles(A,{visibility:"hidden"})}if(B){B()}},doInEffect:function(A,B){A.PVS_EffectState="in";GOTUIT.DOM.setStyles(A,{visibility:"hidden"});if(B){B()}}});GOTUIT.PVS.ListEffects.Fade=GOTUIT.Class.extend(GOTUIT.PVS.ListEffects.Base,{initialize:function(A,C,B){GOTUIT.PVS.ListEffects.Base.prototype.initialize.call(this,A,C,B,0.15)},initializeOutEffect:function(A){A.PVS_EffectState="out"},doOutEffect:function(A,B){if(A.PVS_EffectState!="out"){A.PVS_EffectState="out";GOTUIT.DOM.opacityFade(A,null,0.00001,this.getDuration(),null,B)}else{if(B){B()}}},doInEffect:function(A,B){A.PVS_EffectState="in";GOTUIT.DOM.opacityFade(A,null,1,this.getDuration(),null,B)}});GOTUIT.PVS.ListPane=GOTUIT.PVS.ListPane||{};GOTUIT.PVS.ListPane.Base=GOTUIT.Class.create({initialize:function(E,G,B,D){this.oComponent=E;this.eComponent=G;this.aStates=[];this.setHorizontalList(B);var A=E.getAttribute("ListDirection");if(A){this.setHorizontalList(A)}this.eContainer=this.createContainer(E,G);var C;if(B){C={Change:"Fade",NextPage:"Fade",PrevPage:"Fade",DrillDown:"Fade",GoUp:"Fade",Reload:"Fade"}}else{C={Change:"Fade",NextPage:"Fade",PrevPage:"Fade",DrillDown:"Fade",GoUp:"Fade",Reload:"Fade"}}this.oEffects=GOTUIT.Object.extend(C,D||{});for(var F in C){this.setEffect(F,D)}this.getChangeEffect().initializeOutEffect(this.getContainer())},createContainer:function(A,C){GOTUIT.DOM.addClass(C,"BaseListPane");var B=A.addElementByClass("BaseContentList",C,"div",["ContentList"]);B.id=A.getName()+"_BaseContentList";return B},getContainer:function(){return this.eContainer},getDrillablesContainer:function(){return this.eDrillablesContainer},getNonDrillablesContainer:function(){return this.eNonDrillablesContainer},setEffect:function(D,B){var A=this.oEffects[D];D+="Effect";A=this.oComponent.getAttribute(D,A);var C=GOTUIT.PVS.ListEffects[A];this[D]=new C(this.oComponent,this.eComponent,A)},getHorizontalList:function(){return this.bHorizontalList},setHorizontalList:function(A){if(!A){this.bHorizontalList=false}else{if(GOTUIT.Object.isString(A)){A=A.toLowerCase().substring(0,1);if(A=="h"){this.bHorizontalList=true}else{if(A=="v"){this.bHorizontalList=false}}}else{this.bHorizontalList=true}}},getChangeEffect:function(){return this.ChangeEffect},getNextPageEffect:function(){return this.NextPageEffect},getPrevPageEffect:function(){return this.PrevPageEffect},getDrillDownEffect:function(){return this.DrillDownEffect},getGoUpEffect:function(){return this.GoUpEffect},getReloadEffect:function(){return this.ReloadEffect},getCanPage:function(){return false},updateUI:function(){},clearAllState:function(){this.aStates=[];this.setState()},resetState:function(){},pushState:function(A){this.aStates.push(this.getState());this.setState()},popState:function(){this.setState(this.aStates.pop())},restoreState:function(){this.setState(this.getState())},getState:function(){return null},setState:function(A){}});GOTUIT.PVS.ListPane.ArrowScroll=GOTUIT.Class.extend(GOTUIT.PVS.ListPane.Base,{initialize:function(A,B){GOTUIT.PVS.ListPane.Base.prototype.initialize.call(this,A,B);this.nScrollOffset=0;this.intervalScroll=null;this.nScrollDelay=50;this.nScrollDelay=A.getIntAttribute("ScrollDelay",50);this.nScrollStep=A.getIntAttribute("ScrollStep",15)},createContainer:function(C,E){GOTUIT.DOM.addClass(E,"ArrowScrollListPane");var B=C.addElementByClass("ScrollPrev",E);this.oScrollPrevButton=new GOTUIT.PVS.Button("ScrollPrev",null,{},B);this.oScrollPrevButton.setDisabled(true);this.oScrollPrevButton.setTarget(C);this.oScrollPrevButton.setMouseDownEvent("ScrollPrevStart");C.addListener("ScrollPrevStart",this.startScrollPrev,this);this.oScrollPrevButton.setMouseUpEvent("ScrollPrevStop");C.addListener("ScrollPrevStop",this.cancelScroll,this);var F=C.addElementByClass("ArrowScrollMask",E,"div",["ContentListMask"]);this.eMask=F;var A=C.addElementByClass("ArrowScrollHolder",F,"div",["ContentListHolder"]);if(/Macintosh.*Firefox\/2\.0/.test(navigator.userAgent)){GOTUIT.DOM.addClass(A,"ArrowScrollHolder_MacFirefox2")}this.eHolder=A;var D=C.addElementByClass("ArrowScrollContentList",A,"div",["ContentList"]);this.eHolder=A;B=C.addElementByClass("ScrollNext",E);this.oScrollNextButton=new GOTUIT.PVS.Button("ScrollNext",null,{},B);this.oScrollNextButton.setDisabled(true);this.oScrollNextButton.setTarget(C);this.oScrollNextButton.setMouseDownEvent("ScrollNextStart");C.addListener("ScrollNextStart",this.startScrollNext,this);this.oScrollNextButton.setMouseUpEvent("ScrollNextStop");C.addListener("ScrollNextStop",this.cancelScroll,this);E.appendChild(this.oScrollNextButton.getButton());GOTUIT.Event.observe(A,"scroll",GOTUIT.Function.bindCall(this.updateScrollButtons,this));return D},startScrollNext:function(){clearInterval(this.intervalScroll);var B=this.getScrollOffset();var A=this.getScrollMax();if(B<A){this.intervalScroll=setInterval(GOTUIT.Function.bindCall(this.scrollNext,this),this.nScrollDelay)}},scrollNext:function(){var B=this.getScrollOffset()+this.nScrollStep;var A=this.getScrollMax();if(B>=A){this.setScrollOffset(A);clearInterval(this.intervalScroll);this.updateScrollButtons()}else{this.setScrollOffset(B)}},startScrollPrev:function(){clearInterval(this.intervalScroll);var A=this.getScrollOffset();if(A>0){this.intervalScroll=setInterval(GOTUIT.Function.bindCall(this.scrollPrev,this),this.nScrollDelay)}},scrollPrev:function(){var A=this.getScrollOffset();if(A<=this.nScrollStep){this.setScrollOffset(0);clearInterval(this.intervalScroll);this.updateScrollButtons()}else{this.setScrollOffset(A-this.nScrollStep)}},cancelScroll:function(){clearInterval(this.intervalScroll);this.updateScrollButtons()},updateScrollButtons:function(){var B=this.getScrollOffset();var A=this.getScrollMax();this.oScrollPrevButton.setDisabled(B<=0);this.oScrollNextButton.setDisabled(B>=A)},getState:function(){return this.getScrollOffset()},setState:function(A){clearInterval(this.intervalScroll);if(!A){A=0}this.nScrollOffset=A},updateUI:function(){this.updateScrollButtons()},getScrollOffset:function(){if(this.getHorizontalList()){return this.eHolder.scrollLeft}else{return this.eHolder.scrollTop}},getScrollMax:function(){if(this.getHorizontalList()){return this.eHolder.scrollWidth-this.eHolder.clientWidth}else{return this.eHolder.scrollHeight-this.eHolder.clientHeight}},setScrollOffset:function(A){if(this.getHorizontalList()){this.eHolder.scrollLeft=A}else{this.eHolder.scrollTop=A}}});GOTUIT.PVS.ListPane.Scrollbar=GOTUIT.Class.extend(GOTUIT.PVS.ListPane.Base,{initialize:function(A,B){GOTUIT.PVS.ListPane.Base.prototype.initialize.call(this,A,B);this.nScrollOffset=0},createContainer:function(B,D){GOTUIT.DOM.addClass(D,"ScrollbarListPane");var A=B.addElementByClass("ScrollbarHolder",D);GOTUIT.DOM.addClass(A,"ContentListHolder");this.eHolder=A;var C=B.addElementByClass("ScrollbarContentList",A);C.id=B.getName()+"_ScrollbarContentList";GOTUIT.DOM.addClass(C,"ContentList");return C},getState:function(){if(this.getHorizontalList()){return this.eHolder.scrollLeft}else{return this.eHolder.scrollTop}},setState:function(A){if(!A){A=0}this.nScrollOffset=A},updateUI:function(){}});GOTUIT.PVS.ListPane.Paged=GOTUIT.Class.extend(GOTUIT.PVS.ListPane.Base,{initialize:function(A,B){GOTUIT.PVS.ListPane.Base.prototype.initialize.call(this,A,B)},createContainer:function(B,D){GOTUIT.DOM.addClass(D,"PagedListPane");var A=GOTUIT.PVS.EVENT;var C=B.addElementByClass("PagedContentList",D);C.id=B.getName()+"_PagedContentList";GOTUIT.DOM.addClass(C,"ContentList");this.oNextPageButton=B.addButton("NextPage",A.NAVIGATOR_NEXT_PAGE,B,D);this.oNextPageButton.setDisabled(true);B.addListener(A.NAVIGATOR_NEXT_PAGE,B.nextPage,B);this.oPrevPageButton=B.addButton("PrevPage",A.NAVIGATOR_PREV_PAGE,B,D);this.oPrevPageButton.setDisabled(true);B.addListener(A.NAVIGATOR_PREV_PAGE,B.prevPage,B);return C},getCanPage:function(){return true},getState:function(){return this.oComponent.getPageNumber()},setState:function(A){if(!A){A=0}this.oComponent.setPageNumber(A)},updateUI:function($super){$super();this.oPrevPageButton.setDisabled(this.oComponent.getPageNumber()==0);this.oNextPageButton.setDisabled(this.oComponent.getPageNumber()+1==this.oComponent.getPageCount())}});GOTUIT.PVS.ContentSelector=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(A,D,E,C){GOTUIT.PVS.Component.prototype.initialize.call(this,A,D,E,C);var B=GOTUIT.PVS.EVENT;A.addListener(B.READY,this.onReady,this);this.setSource(this.getAttribute("Source"));this.setSourceEvent(this.getAttribute("SourceEvent",B.SELECTION_CHANGED));this.setTarget(this.getAttribute("Target"));this.setTargetEvent(this.getAttribute("TargetEvent",B.SELECTION_CHANGED));this.loadContent(this.getAttribute("LoadContent"));this.setSuppressDuplicateSelects(this.getBooleanAttribute("SuppressDuplicateSelects",false));this.addListener(B.SELECTION_SET,this.setSelectedContent,this);this.addListener(B.SELECTION_OVERRIDE,this.setOverrideContent,this);this.pushEventFilter(B.SELECTION_SET,this._checkRequireLoginFilter,this);this.sContentSignature=null;this.oLoadedContent=null;this.aLoadedContentPath=null;this.oLoadedTargetContent=null;this.oLoadedIsOverride=false;this.oSelectedContent=null;this.oOverrideContent=null;this.bReady=false},onReady:function(){this.bReady=true;var A=this.getLoadedContent();this.oLoadedContent=null;if(A&&(GOTUIT.Object.isString(A)||GOTUIT.Object.isString(A.getBaseRef()))){this._loadContent(A,this.aLoadedContentPath)}else{if(A||this.aLoadedContentPath){this.setLoadedContent(A,this.aLoadedContentPath,this.oLoadedTargetContent)}}},loadContent:function(D,B,E,A,C){if(this==B){return }if(this.bReady){if(D&&(GOTUIT.Object.isString(D)||GOTUIT.Object.isString(D.getBaseRef()))){this._loadContent(D,E,A,C)}else{this.setLoadedContent(D,E,A,C)}}else{this.oLoadedContent=D;this.aLoadedContentPath=E;this.oLoadedTargetContent=A;this.oLoadedIsOverride=C}},_loadContent:function(D,F,A,B){var E=this;var C={onSuccess:function(G){if(G.getDisplayOptions()&&G.getDisplayOptions().getTitle()){G.setTitle(G.getDisplayOptions().getTitle())}E.setLoadedContent(G,F,A,B)},onError:function(G){E.logError("failed to load content")}};this.pvs.Content.get(D,C)},getLoadedContent:function(){if(!this.bReady){return null}return this.oLoadedContent},getLoadedContentIsOverride:function(){return this.oLoadedIsOverride},setLoadedContent:function(C,D,A,B){this.oLoadedContent=C;this.aLoadedContentPath=D;this.oLoadedTargetContent=A;this.oLoadedIsOverride=B},getSource:function(){return this.oSource},setSource:function(A){if(A&&GOTUIT.Object.isString(A)){this.oSource=null;GOTUIT.PVS.resolveComponent(A,this._setSource,this)}else{this._setSource(A)}},_setSource:function(A){this.oSource=A;if(A&&this.getSourceEvent()){A.addListener(this.getSourceEvent(),this.loadContent,this)}},getSourceEvent:function(){return this.sSourceEvent},setSourceEvent:function(A){this.sSourceEvent=A;if(this.oSource&&this.getSourceEvent()){this.oSource.addListener(this.getSourceEvent(),this.loadContent,this)}},getTarget:function(){return this.oTarget},setTarget:function(A){if(A&&GOTUIT.Object.isString(A)){var B=this;GOTUIT.PVS.resolveComponent(A,function(C){B.oTarget=C})}else{if(A){this.oTarget=A}else{this.oTarget=this}}},getTargetEvent:function(){return this.sTargetEvent},setTargetEvent:function(A){this.sTargetEvent=A},getSuppressDuplicateSelects:function(){return this.bSuppressDuplicateSelects},setSuppressDuplicateSelects:function(A){this.bSuppressDuplicateSelects=A},getSelectedContent:function(){return this.oSelectedContent},setSelectedContent:function(C,B,D,A){if(C){this.oOverrideContent=null}if(!this.getSuppressDuplicateSelects()||this.oSelectedContent!=C||(D&&D.length>0)){this.oSelectedContent=C;if(this.getTarget()&&this.getTargetEvent()){this.getTarget().sendEvent(this.getTargetEvent(),C,B||this,D,A,false)}}},_checkRequireLoginFilter:function(C){var B=C.getParam(0);var A=B&&B.getDisplayOptions();if(A&&A.getRequiresLogin()&&!this.pvs.User.getIsLoggedIn()){pvs.sendEvent(GOTUIT.PVS.EVENT.LOGIN_REQUEST,GOTUIT.Function.bindCall(C.next,C),A.getRequiresLoginMessage())}else{C.next()}},getOverrideContent:function(){return this.oOverrideContent},setOverrideContent:function(B,A){if(B){if(!this.getSuppressDuplicateSelects()||this.oOverrideContent!=B){this.oOverrideContent=B;if(this.getTarget()&&this.getTargetEvent()){this.getTarget().sendEvent(this.getTargetEvent(),B,A||this,null,null,true)}}}else{this.oOverrideContent=null;if(this.oSelectedContent!=null&&this.getTarget()&&this.getTargetEvent()){this.getTarget().sendEvent(this.getTargetEvent(),this.oSelectedContent,this)}}}});GOTUIT.PVS.ButtonComponent=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(A,E,F,D,B){GOTUIT.PVS.Component.prototype.initialize.call(this,A,E,F,D,B);var C=new GOTUIT.PVS.Button(D,this,{},E);this.oButton=C;C.setTarget(this.getAttribute("Target",this));C.setMouseOverEvent(this.getAttribute("MouseOverEvent"));C.setMouseOutEvent(this.getAttribute("MouseOutEvent"));C.setMouseDownEvent(this.getAttribute("MouseDownEvent"));C.setMouseUpEvent(this.getAttribute("MouseUpEvent"));C.setMouseClickEvent(this.getAttribute("MouseClickEvent"));C.setDisarmOnClick(this.getBooleanAttribute("DisarmOnClick"))},setTarget:function(A){this.oButton.setTarget(A)},getTarget:function(){return this.oButton.getTarget()},setContent:function(A){this.oButton.setContent(A)},getContent:function(){return this.oButton.getContent()},setMouseOverEvent:function(A){this.oButton.setMouseOverEvent(A)},setMouseOutEvent:function(A){this.oButton.setMouseOutEvent(A)},setMouseDownEvent:function(A){this.oButton.setMouseDownEvent(A)},setMouseUpEvent:function(A){this.oButton.setMouseUpEvent(A)},setMouseClickEvent:function(A){this.oButton.setMouseClickEvent(A)},setDisabled:function(A){this.oButton.setDisabled(A)},getDisabled:function(){return this.oButton.getDisabled()},setDisarmed:function(A){this.oButton.setDisarmed(A)},getDisarmed:function(){return this.oButton.getDisarmed()},setDisarmOnClick:function(A){this.oButton.setDisarmOnClick(A)},getDisarmOnClick:function(){return this.oButton.getDisarmOnClick()},setHoverText:function(A){this.oButton.setHoverText(A)},setSelected:function(A){this.oButton.setSelected(A)},getSelected:function(){return this.oButton.getSelected()},setPressed:function(A){this.oButton.setPressed(A)},getPressed:function(){return this.oButton.getPressed()},click:function(){this.oButton.click()}});GOTUIT.PVS.registerComponentType("ButtonComponent",GOTUIT.PVS.ButtonComponent);GOTUIT.PVS.ButtonLabel=GOTUIT.Class.extend(GOTUIT.PVS.ButtonComponent,{initialize:function(A,D,E,C,B){GOTUIT.PVS.ButtonComponent.prototype.initialize.call(this,A,D,E,C,B);GOTUIT.DOM.addClass(D,["ButtonLabel","PVS_Label"]);GOTUIT.PVS.Label.trimLabel(D,this)},hasText:function(){return(this.getText().length>0)},getText:function(){return GOTUIT.PVS.Label.getText(this.eComponent)},setText:function(A){GOTUIT.PVS.Label.setText(this.eComponent,A);GOTUIT.PVS.Label.trimLabel(this.eComponent,this)},trimLabel:function(){GOTUIT.PVS.Label.trimLabel(this.eComponent,this)},clear:function(){this.setText("")}});GOTUIT.PVS.registerComponentType("ButtonLabel",GOTUIT.PVS.ButtonLabel);GOTUIT.PVS.ContentBar=GOTUIT.Class.extend(GOTUIT.PVS.ContentSelector,{initialize:function(A,D,E,C){GOTUIT.PVS.ContentSelector.prototype.initialize.call(this,A,D,E,C);A.onComponentInitializing(this);this.aButtons=[];this.oButtonIndex={};this.oSelectedButton=null;this.oSelectedButtonContent=null;this.oDefaultContent=null;this.nContentRead=0;this.nOptionsRead=0;this.aContent=[];var B=GOTUIT.PVS.EVENT;A.addListener(B.GPLAYER_READY,this._onGPlayerReady,this);A.addListener(B.GPLAYER_START,this._onGPlayerStart,this);A.addListener(B.USER_LOGOUT,this._onUserLogout,this);this.addListener(B.CONTENTBAR_PASS_THROUGH,this._onPassThroughClicked,this);this.addListener(B.CONTENTBAR_GO_TO_PLAYING,this._onGoToPlayingLevel,this);this.addListener(B.SELECTION_SET,this._onSelectionSet,this)},_onGPlayerReady:function(){var G=this.getContentDisplayOptions();var E=this;this.nOptionsRead=G.length;for(var C=0;C<G.length;C++){var B=G[C];var D=new GOTUIT.PVS.GPlayerContent(this.pvs);D.setDisplayOptions(B);D.setTitle(B.getTitle());D.setBaseRef(B.getSignature());switch(B.getType()){case"fixed":case"static":var A={onSuccess:this._staticContentSuccess.bind(this,C),onError:function(H){E.logError("Static Content Load Failed");E._onLoadComplete()}};this.pvs.Content.get(D,A);break;case"spread":var F={onSuccess:this._spreadContentSuccess.bind(this,C),onError:function(H){E.logError("Spread Content Load Failed")}};this.pvs.Content.open(D,F);break;default:this.aContent[C]=D;this._onLoadComplete();break}}},_staticContentSuccess:function(A,B){if(B.getDisplayOptions()&&B.getDisplayOptions().getTitle()){B.setTitle(B.getDisplayOptions().getTitle())}this.aContent[A]=B;this._onLoadComplete()},_staticContentError:function(A,B){this._onLoadComplete()},_spreadContentSuccess:function(A,B){this.aContent[A]=B;this._onLoadComplete()},_onLoadComplete:function(){this.nContentRead++;if(this.nContentRead==this.nOptionsRead){this._createButtons()}},_onGPlayerStart:function(C,F,E,B){var A=GOTUIT.URL.getParams();if(A.tab){if(this.oButtonIndex[A.tab]!=null){var D=this.oButtonIndex[A.tab];D.click();return }}this.setLevel(E,B)},_onGoToPlayingLevel:function(){var B=this;var A={onSuccess:function(E,D,C){if(C){B.setLevel(C)}}};this.pvs.Player.getPlayingLevel(A)},_onUserLogout:function(){if(this.oSelectedButtonContent&&this.oSelectedButtonContent.getDisplayOptions()&&this.oSelectedButtonContent.getDisplayOptions().getRequiresLogin()){this._loadDefaultContent()}},_createButtons:function(){this.aContent=GOTUIT.Array.flatten(this.aContent);var J=this;var I=GOTUIT.PVS.EVENT;var A=0;var D;for(var G=0;G<this.aContent.length;G++){D=this.aContent[G];D.setIndex(A++);var F=D.getDisplayOptions();var H;if(F.getIsSpread()){H=D.getTitle()}else{H=F.getTitle()||D.getTitle()}var C=J.pvs.Util.getCSSSafeName(H);var B=(F.getIsPassThrough()?I.CONTENTBAR_PASS_THROUGH:I.SELECTION_SET);var E=J.addButtonLabel(C,B);GOTUIT.DOM.addClass(E.getComponentElement(),"Button");if(F.getHideText()){E.setText("")}else{E.setText(H)}if(F.getIsSpread()){E.setHoverText(H)}else{E.setHoverText(F.getHoverText()||H)}E.setContent(D);J.aButtons.push(E);J.oButtonIndex[H]=E;if(F.getIsDefault()&&!this.oDefaultContent){this.oDefaultContent=D}}if(!this.oDefaultContent&&this.aContent.length>0){this.oDefaultContent=this.aContent[0]}this.pvs.onComponentReady(this)},setLoadedContent:function(B,C,A){GOTUIT.PVS.ContentSelector.prototype.setLoadedContent.call(this,B,C,A);this.setLevel(C,A)},setLevel:function(I,F){if(I!=null){var B,E,G;for(var D=I.length-1;D>=0;D--){B=I[D];for(var C=0;C<this.aContent.length;C++){G=this.aContent[C];if(G.getDisplayOptions().getIsPassThrough()&&this.getLoadedContent()&&D==0){var A=this.getLoadedContent().clone();A.setIndex(G.getIndex());this.sendEvent(GOTUIT.PVS.EVENT.SELECTION_SET,A,this,I,F);return }else{if(B.equals(G)){var H=I.slice(D+1);this.sendEvent(GOTUIT.PVS.EVENT.SELECTION_SET,G,this,H,F);return }}}}}this._loadDefaultContent()},_loadDefaultContent:function(){if(this.oDefaultContent&&this.oDefaultContent.getDisplayOptions().getIsPassThrough()){this._onPassThroughClicked(this.oDefaultContent)}else{this.sendEvent(GOTUIT.PVS.EVENT.SELECTION_SET,this.oDefaultContent)}},refresh:function(){if(this.oSelectedButton!=null){this.oSelectedButton.click()}},clickButton:function(A){if(this.oButtonIndex[A]!=null){var B=this.oButtonIndex[A];B.click()}},_onPassThroughClicked:function(B){var A=this.getLoadedContent().clone();A.setIndex(B.getIndex());this.sendEvent(GOTUIT.PVS.EVENT.SELECTION_SET,A)},_onSelectionSet:function(A){if(this.oSelectedButton!=null){GOTUIT.DOM.removeClass(this.pvs.getComponentElement(),this.oSelectedButtonContent.getCSSClassName());this.oSelectedButton.setSelected(false);this.oSelectedButtonContent=null;this.oSelectedButton=null}var B=this.aButtons[A.getIndex()];if(B){this.oSelectedButtonContent=A;GOTUIT.DOM.addClass(this.pvs.getComponentElement(),A.getCSSClassName());this.oSelectedButton=B;this.oSelectedButton.setSelected(true)}},setOverrideContent:function(B,A){if(B){if(B.getIsSearch()&&B.getDisplayOptions().getSearchClearBarSelection()){if(this.oSelectedButton!=null){this.oSelectedButton.setSelected(false)}}}GOTUIT.PVS.ContentSelector.prototype.setOverrideContent.call(this,B,A)}});GOTUIT.PVS.registerComponentType("ContentBar",GOTUIT.PVS.ContentBar);GOTUIT.PVS.TabComponent=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(A,C,D,B){GOTUIT.PVS.Component.prototype.initialize.call(this,A,C,D,B);this.aTabs=[];this.oSelectedTab=null;this.eTabs=this.addElementByClass("Tabs");this.eTabContents=this.addElementByClass("TabContents")},addTab:function(A){this.aTabs.push(A);A.setTarget(this);A.setContent(A);A.setMouseClickEvent("ClickedTab");this.addListener("ClickedTab",this._onClickedTab,this);this.eTabs.appendChild(A.getComponentElement());this.eTabContents.appendChild(A.getContents());if(this.oSelectedTab==null){this._selectTab(A)}else{this._deselectTab(A)}},_onClickedTab:function(A){this._deselectTabs();this._selectTab(A)},_deselectTabs:function(){var B;for(var A=0;A<this.aTabs.length;A++){B=this.aTabs[A];this._deselectTab(B)}},_deselectTab:function(A){A.setSelected(false);GOTUIT.DOM.setStyles(A.getContents(),{display:"none"})},_selectTab:function(A){this.oSelectedTab=A;this.oSelectedTab.setSelected(true);GOTUIT.DOM.setStyles(A.getContents(),{display:"block"});this.oSelectedTab._onSelected()}});GOTUIT.PVS.Tab=GOTUIT.Class.extend(GOTUIT.PVS.ButtonLabel,{initialize:function(A,D,E,C,B){GOTUIT.PVS.ButtonLabel.prototype.initialize.call(this,A,D,E,C,B);GOTUIT.DOM.addClass(D,"Tab");this.eContents=this.addElementByClass("TabContent")},getContents:function(){return this.eContents},_onSelected:function(){}});GOTUIT.PVS.Shield=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(A,C,D,B){GOTUIT.PVS.Component.prototype.initialize.call(this,A,C,D,B);GOTUIT.DOM.addClass(this.eComponent,"Shield");this.nDuration=this.getFloatAttribute("Duration",0.5);this.nFromOpacity=this.getFloatAttribute("FromOpacity",0);this.nToOpacity=this.getFloatAttribute("ToOpacity",0.5);this._hide()},_prepare:function(){GOTUIT.DOM.show(this.eComponent)},raise:function(){GOTUIT.DOM.opacityFade(this.eComponent,this.nFromOpacity,this.nToOpacity,this.nDuration,GOTUIT.Function.bindCall(this._prepare,this),null)},lower:function(){GOTUIT.DOM.opacityFade(this.eComponent,this.nToOpacity,this.nFromOpacity,this.nDuration,null,GOTUIT.Function.bindCall(this._hide,this))},_hide:function(){GOTUIT.DOM.hide(this.eComponent)}});GOTUIT.PVS.SaveDialogShield=GOTUIT.Class.extend(GOTUIT.PVS.Shield,{initialize:function(A,C,D,B){GOTUIT.PVS.Shield.prototype.initialize.call(this,A,C,D,B);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_SHOW_DIALOG,this.raise,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_SUCCESS,this.lower,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_CANCEL,this.lower,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_SAVE_SHOW_DIALOG,this.raise,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_SAVE_SUCCESS,this.lower,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_CANCEL_SUCCESS,this.lower,this)}});GOTUIT.PVS.SaveShareDialogShield=GOTUIT.Class.extend(GOTUIT.PVS.SaveDialogShield,{initialize:function(A,C,D,B){GOTUIT.PVS.SaveDialogShield.prototype.initialize.call(this,A,C,D,B);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_SHARE_SHOW_DIALOG,this.raise,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_SHARE_HIDE_DIALOG,this.lower,this)}});GOTUIT.PVS.registerComponentType("SaveDialogShield",GOTUIT.PVS.SaveDialogShield);GOTUIT.PVS.registerComponentType("SaveShareDialogShield",GOTUIT.PVS.SaveShareDialogShield);GOTUIT.PVS.EmbedCodeBox=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(A,F,G,D,B){GOTUIT.PVS.Component.prototype.initialize.call(this,A,F,G,D,B);this.oContent=null;var C=this.getAttribute(this._getLabelAttribute(),"");var E=this.addElementByClass(this._getLabelAttribute(),null,"label",["Label"],C);this.eEmbedBox=GOTUIT.DOM.create("input",{type:"text",readonly:"true"});GOTUIT.Event.observe(this.eEmbedBox,"click",GOTUIT.Function.bindCall(this._onBoxClick,this));F.appendChild(this.eEmbedBox);this.pvs.addListener(GOTUIT.PVS.EVENT.PLAY_STARTED,this._onPlayStarted,this)},_getLabelAttribute:function(){return"EmbedLabel"},_getBoxButtonClass:function(){return"Embed"},setContent:function(A){this.oContent=A;this.eEmbedBox.value=this.pvs.Content.getEmbedCode(this.oContent)},_onBoxClick:function(){try{this.eEmbedBox.focus();this.eEmbedBox.select()}catch(A){}},_setEventEmbedCode:function(A){if(this.oContent==null){this.eEmbedBox.value=this.pvs.Content.getEmbedCode(A)}},_onClickedCopy:function(){this.pvs.Util.setClipboard(this.eEmbedBox.value)},_onPlayStarted:function(C,A,D){var B=(D.getIsRemix())?D:C;this._setEventEmbedCode(B)}});GOTUIT.PVS.EmbedPlaylistCodeBox=GOTUIT.Class.extend(GOTUIT.PVS.EmbedCodeBox,{initialize:function(A,D,E,C,B){GOTUIT.PVS.EmbedCodeBox.prototype.initialize.call(this,A,D,E,C,B)},_getLabelAttribute:function(){return"EmbedPlaylistLabel"},_getBoxButtonClass:function(){return"EmbedPlaylist"},_onPlayStarted:function(B,A,C){this._setEventEmbedCode(A)}});GOTUIT.PVS.EmbedSegmentCodeBox=GOTUIT.Class.extend(GOTUIT.PVS.EmbedCodeBox,{initialize:function(A,D,E,C,B){GOTUIT.PVS.EmbedCodeBox.prototype.initialize.call(this,A,D,E,C,B)},_getLabelAttribute:function(){return"EmbedSegmentLabel"},_getBoxButtonClass:function(){return"EmbedSegment"},_onPlayStarted:function(B,A,C){this._setEventEmbedCode(B)}});GOTUIT.PVS.registerComponentType("EmbedCodeBox",GOTUIT.PVS.EmbedCodeBox);GOTUIT.PVS.registerComponentType("EmbedPlaylistCodeBox",GOTUIT.PVS.EmbedPlaylistCodeBox);GOTUIT.PVS.registerComponentType("EmbedSegmentCodeBox",GOTUIT.PVS.EmbedSegmentCodeBox);GOTUIT.PVS.Label=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(A,C,D,B){GOTUIT.PVS.Component.prototype.initialize.call(this,A,C,D,B);GOTUIT.DOM.addClass(C,"PVS_Label");GOTUIT.PVS.Label.trimLabel(C,this)},getText:function(){return GOTUIT.PVS.Label.getText(this.eComponent)},setText:function(A){GOTUIT.PVS.Label.setText(this.eComponent,A);GOTUIT.PVS.Label.trimLabel(this.eComponent,this)},clear:function(){this.setText("")}});GOTUIT.Object.extend(GOTUIT.PVS.Label,{appendLabel:function(A,D,C,B){if(C){var E=GOTUIT.DOM.create("div",{className:D+" PVS_Label"});if(B&&B.labelMode){E.setAttribute("PVS_LabelMode",B.labelMode)}GOTUIT.DOM.update(E,C);A.appendChild(E)}},setText:function(C,A,B){C.PVS_OrigText=B;C.textContent=(A?A:"")},getText:function(B){if(B.PVS_OrigText){return B.PVS_OrigText}else{var A=B.textContent;return A?A:""}},restoreText:function(B){if(B.PVS_OrigText){var A=B.PVS_OrigText;B.textContent=(A?A:"");B.PVS_OrigText="";return A}else{var A=B.textContent;return A?A:""}},_trimLabelWithStyle:function(A){return false},trimLabel:function(G,H,B,F){var C=this.restoreText(G);var A=G.getAttribute("PVS_LabelMode");if(A){F=A}if(!F&&H){F=H.getAttribute("LabelMode","default")}if(!F){F="default"}switch(F){default:case"none":case"ellipsis":G.title="";break;case"hover":case"default":if((G.clientWidth>0&&G.clientWidth<G.scrollWidth)||(G.clientHeight>0&&G.clientHeight<G.scrollHeight)){G.title=C}else{G.title=""}break;case"hoverAll":case"all":G.title=C;break}if((F=="ellipsis"||F=="default"||F=="all")&&C&&G.clientWidth>0&&G.clientWidth>0&&(G.clientWidth<G.scrollWidth||G.clientHeight<G.scrollHeight)){if(this._trimLabelWithStyle(G,H)){return false}else{if(B){B.push(new GOTUIT.PVS._TrimLabelWorkItem(G,C));return false}}var L=C;var I=0;var D=C.length;var K;var J=G.clientWidth;var E=G.clientHeight;while(I+1<D){K=Math.floor((I+D)/2);C=L.substring(0,K)+"...";this.setText(G,C,L);if((J<G.scrollWidth)||(E<G.scrollHeight)){D=K}else{I=K}}if(I!=K){C=L.substring(0,I)+"...";this.setText(G,C,L)}return true}return false},trimAllLabels:function(C,E){var F=this;var H=GOTUIT.DOM.getChildrenByClass((C||document),"PVS_Label");var B=[];var D=E.getAttribute("LabelMode","default");var G;for(var A=0;A<H.length;A++){G=H[A];this.trimLabel(G,E,B,D)}this._processDeferredWorkList(B)},_processDeferredWorkList:function(A){if(A.length>0){var C;do{for(var B=0;B<A.length;B++){A[B].storeStep()}C=false;for(var B=0;B<A.length;B++){if(A[B].testStep()){C=true}}}while(C);for(var B=0;B<A.length;B++){A[B].finishStep()}}}});if(GOTUIT.Client.isIE()){GOTUIT.Object.extend(GOTUIT.PVS.Label,{setText:function(C,A,B){C.PVS_OrigText=B;C.innerText=(A?A:"")},getText:function(B){if(B.PVS_OrigText){return B.PVS_OrigText}else{var A=B.innerText;return A?A:""}},restoreText:function(B){if(B.PVS_OrigText){var A=B.PVS_OrigText;B.innerText=(A?A:"");B.PVS_OrigText="";return A}else{var A=B.innerText;return A?A:""}}})}if(GOTUIT.Client.isIE()||GOTUIT.Client.isWebKit()){GOTUIT.Object.extend(GOTUIT.PVS.Label,{_trimLabelWithStyle:function(B,A){if(GOTUIT.DOM.getStyle(B,"textOverflow")=="ellipsis"){return true}return false}})}GOTUIT.PVS._TrimLabelWorkItem=GOTUIT.Class.create({initialize:function(B,A){this.eLabel=B;this.sText=A;this.low=0;this.high=A.length;this.mid=0},storeStep:function(){if(this.low+1<this.high){this.mid=Math.floor((this.low+this.high)/2);var A=this.sText.substring(0,this.mid)+"...";GOTUIT.PVS.Label.setText(this.eLabel,A,this.sText)}},testStep:function(){if(this.low+1<this.high){var A=this.eLabel;if((A.clientWidth<A.scrollWidth)||(A.clientHeight<A.scrollHeight)){this.high=this.mid}else{this.low=this.mid}}return this.low+1<this.high},finishStep:function(){if(this.low!=this.mid){var A=this.sText.substring(0,this.low)+"...";GOTUIT.PVS.Label.setText(this.eLabel,A,this.sText)}}});GOTUIT.PVS.TrimAllLabelsTask=GOTUIT.Class.create({initialize:function(B,D,C){this.eParent=B;this.oComponent=D;this.labelMode=D.getAttribute("LabelMode","default");this.aLabels=GOTUIT.DOM.getChildrenByClass((B||document),"PVS_Label");this.nNextLabel=0;this.aWorkList=[];var A;if(this.aLabels&&this.aLabels.length>0){this.oExecutor=new GOTUIT.Timer(GOTUIT.Function.bindCall(this.trimSomeLabels,this),C)}},trimSomeLabels:function(){while(this.nNextLabel<this.aLabels.length){if(GOTUIT.PVS.Label.trimLabel(this.aLabels[this.nNextLabel++],this.oComponent,this.aWorkList,this.labelMode)){break}}if(this.nNextLabel>=this.aLabels.length){GOTUIT.PVS.Label._processDeferredWorkList(this.aWorkList);this.stop()}},stop:function(){if(this.oExecuter){this.oExecuter.stop();this.oExecuter=null}}});GOTUIT.PVS.registerComponentType("Label",GOTUIT.PVS.Label);GOTUIT.PVS.LevelTitle=GOTUIT.Class.extend(GOTUIT.PVS.Label,{initialize:function(A,C,D,B){GOTUIT.PVS.Label.prototype.initialize.call(this,A,C,D,B);this.setSource(this.getAttribute("Source"))},getSource:function(){return this.oSource},setSource:function(A){if(A&&GOTUIT.Object.isString(A)){this.oSource=null;GOTUIT.PVS.resolveComponent(A,this._setSource,this)}else{if(A){this._setSource(A)}}},_setSource:function(A){this.oSource=A;A.addListener(GOTUIT.PVS.EVENT.NAVIGATOR_PARENT_CHANGED,this._navigatorParentChanged,this)},_navigatorParentChanged:function(){try{var C=this.oSource.getParentContent();var A=this.pvs.Content.getPrimaryDetail(C);this.setText(A)}catch(B){this.logException("_navigatorParentChanged()",B)}}});GOTUIT.PVS.registerComponentType("LevelTitle",GOTUIT.PVS.LevelTitle);GOTUIT.PVS.LoginLinks=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(A,D,E,C){GOTUIT.PVS.Component.prototype.initialize.call(this,A,D,E,C);var B=GOTUIT.PVS.EVENT;this.sLoginText=this.getAttribute("LoginText","Login");this.sRegisterText=this.getAttribute("RegisterText","Register");this.sUserNameText=this.getAttribute("WelcomeText","Welcome #{UserName}");this.sUserNameTemplate=new Template(this.sUserNameText);this.sLogoutText=this.getAttribute("LogoutText","Logout");this.sResetPasswordText=this.getAttribute("ResetPasswordText","Reset Password");this.sUpdatePasswordText=this.getAttribute("UpdatePasswordText","Update Password");this.sUpdateProfileText=this.getAttribute("UpdateProfileText","Update Profile");this.eLoggedInGroup=this.addElementByClass("LoggedInGroup");GOTUIT.DOM.hide(this.eLoggedInGroup);this.eNotLoggedInGroup=this.addElementByClass("NotLoggedInGroup");this.oLoginButton=this.addButtonLabel("Login",B.LOGIN_REQUEST,A,this.eNotLoggedInGroup);this.oLoginButton.setText(this.sLoginText);this.oLoginButton.setContent(null);this.oRegisterButton=this.addButtonLabel("Register",B.REGISTER_REQUEST,A,this.eNotLoggedInGroup);this.oRegisterButton.setText(this.sRegisterText);this.oRegisterButton.setContent(null);this.oUserNameButton=this.addButtonLabel("UserName",B.REGISTRATION_CHANGE_REQUEST,A,this.eLoggedInGroup);this.oLogoutButton=this.addButtonLabel("Logout",B.LOGOUT_REQUEST,A,this.eLoggedInGroup);this.oLogoutButton.setText(this.sLogoutText);this.oUpdatePasswordButton=this.addButtonLabel("UpdatePassword",B.UPDATEPASSWORD_REQUEST,A,this.eLoggedInGroup);this.oUpdatePasswordButton.setText(this.sUpdatePasswordText);this.oUpdatePasswordButton.setContent(null);this.oUpdateProfileButton=this.addButtonLabel("UpdateProfile",B.UPDATEPROFILE_REQUEST,A,this.eLoggedInGroup);this.oUpdateProfileButton.setText(this.sUpdateProfileText);this.oUpdateProfileButton.setContent(null);A.addListener([B.READY,B.USER_LOGIN,B.USER_LOGOUT],this.loginChanged,this)},loginChanged:function(){if(this.pvs.User.getIsLoggedIn()){GOTUIT.DOM.hide(this.eNotLoggedInGroup);var A=this.pvs.User.getUserProfile();this.oUserNameButton.setText(this.sUserNameTemplate.evaluate(A));GOTUIT.DOM.show(this.eLoggedInGroup)}else{GOTUIT.DOM.hide(this.eLoggedInGroup);GOTUIT.DOM.show(this.eNotLoggedInGroup)}}});GOTUIT.PVS.LoginModalBox=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(A,D,E,C){GOTUIT.PVS.Component.prototype.initialize.call(this,A,D,E,C);var B=GOTUIT.PVS.EVENT;this.sLoginBoxURL=this.getAttribute("LoginBoxURL","./html/box_Login.html");this.sDefaultLoginMessage=this.getAttribute("DefaultLoginMessage","Login required");this.sDefaultResetPasswordMessage=this.getAttribute("DefaultResetPasswordMessage","Please enter both required fields.");this.sDefaultUpdatePasswordMessage=this.getAttribute("DefaultUpdatePasswordMessage","Please enter both required fields.");this.sDefaultUpdateProfileMessage=this.getAttribute("DefaultUpdateProfileMessage","Please enter both required fields.");this.sLoginTitle=this.getAttribute("LoginTitle","Login");this.sRegistrationBoxURL=this.getAttribute("RegistrationBoxURL","./html/box_Register.html");this.sRegistrationTitle=this.getAttribute("RegistrationTitle","New Account");this.sErrorProfaneMetadata=this.getAttribute("Message_Error_Profane_Metadata",'Offensive language cannot be saved.  Please edit "#{Profanity}" and save again.');this.sInvalidDOBMessage=this.getAttribute("InvalidDOBMessage","Please enter a valid DOB (MM/DD/YYYY)");this.sInvalidDOBMonthMessage=this.getAttribute("InvalidDOBMonthMessage","Please enter between 01 and 12 for month");this.sInvalidDOBDayMessage=this.getAttribute("InvalidDOBDayMessage","Please enter a valid day for DOB");this.sResetPasswordBoxURL=this.getAttribute("ResetPasswordBoxURL","./html/box_ResetPassword.html");this.sResetPasswordTitle=this.getAttribute("ResetPasswordTitle","Reset user password");this.sUpdatePasswordBoxURL=this.getAttribute("UpdatePasswordBoxURL","./html/box_UpdatePassword.html");this.sUpdatePasswordTitle=this.getAttribute("UpdatePasswordTitle","Update user password");this.sUpdateProfileBoxURL=this.getAttribute("UpdateProfileBoxURL","./html/box_UpdateProfile.html");this.sUpdateProfileTitle=this.getAttribute("UpdateProfileTitle","Update user profile");this.sLoginBoxWidth=this.getAttribute("LoginBoxWidth","325");this.sLoginBoxHeight=this.getAttribute("LoginBoxHeight","280");this.sResetPasswordBoxWidth=this.getAttribute("ResetPasswordBoxWidth","325");this.sResetPasswordBoxHeight=this.getAttribute("ResetPasswordBoxHeight","280");this.sUpdatePasswordBoxWidth=this.getAttribute("UpdatePasswordBoxWidth","325");this.sUpdatePasswordBoxHeight=this.getAttribute("UpdatePasswordBoxHeight","280");this.sUpdateProfileBoxWidth=this.getAttribute("UpdateProfileBoxWidth","450");this.sUpdateProfileBoxHeight=this.getAttribute("UpdateProfileBoxHeight","515");this.sRegisterBoxWidth=this.getAttribute("RegisterBoxWidth","450");this.sRegisterBoxHeight=this.getAttribute("RegisterBoxHeight","515");this.fnCallback=null;this.sLoginMessage=null;A.addListener(B.LOGIN_REQUEST,this.onLoginRequest,this);A.addListener(B.USER_LOGIN_SUCCESS,this.onUserLoginSuccess,this);A.addListener(B.USER_LOGIN_ERROR,this.onUserLoginError,this);A.addListener(B.REGISTER_REQUEST,this.onRegisterRequest,this);A.addListener(B.USER_REGISTER_SUCCESS,this.onUserRegisterSuccess,this);A.addListener(B.USER_REGISTER_ERROR,this.onUserRegisterError,this);A.addListener(B.RESETPASSWORD_REQUEST,this.onResetPasswordRequest,this);A.addListener(B.USER_RESETPASSWORD_SUCCESS,this.onUserResetPasswordSuccess,this);A.addListener(B.USER_RESETPASSWORD_ERROR,this.onUserResetPasswordError,this);A.addListener(B.UPDATEPASSWORD_REQUEST,this.onUpdatePasswordRequest,this);A.addListener(B.USER_UPDATEPASSWORD_SUCCESS,this.onUserUpdatePasswordSuccess,this);A.addListener(B.USER_UPDATEPASSWORD_ERROR,this.onUserUpdatePasswordError,this);A.addListener(B.UPDATEPROFILE_REQUEST,this.onUpdateProfileRequest,this);A.addListener(B.USER_UPDATEPROFILE_SUCCESS,this.onUserUpdateProfileSuccess,this);A.addListener(B.USER_UPDATEPROFILE_ERROR,this.onUserUpdateProfileError,this);A.addListener(B.LOGOUT_REQUEST,this.onLogoutRequest,this);this.addListener("LoginSubmit",this.onClickedLoginSubmit,this);this.addListener("LoginNewAccount",this.onClickedLoginNewAccount,this);this.addListener("LoginResetPassword",this.onClickedLoginResetPassword,this);this.addListener("ResetPasswordSubmit",this.onClickedResetPasswordSubmit,this);this.addListener("LoginUpdatePassword",this.onClickedLoginUpdatePassword,this);this.addListener("UpdatePasswordSubmit",this.onClickedUpdatePasswordSubmit,this);this.addListener("UpdateProfileSubmit",this.onClickedUpdateProfileSubmit,this);this.addListener("RegisterSubmit",this.onClickedRegisterSubmit,this);this.addListener("RegisterGoToLogin",this.onClickedRegisterGoToLogin,this)},onLoginRequest:function(B,A){this.fnCallback=B;this.sLoginMessage=A||this.sDefaultLoginMessage;this.bShowing=true;this.onModalBoxShow();Modalbox.show(this.sLoginBoxURL,{title:this.sLoginTitle,width:this.sLoginBoxWidth,height:this.sLoginBoxHeight,inactiveFade:false,afterLoad:GOTUIT.Function.bindCall(this.onLoginBoxLoaded,this),beforeHide:GOTUIT.Function.bindCall(this.onLoginBoxBeforeHide,this),afterHide:GOTUIT.Function.bindCall(this.onModalBoxHide,this)})},onLoginBoxLoaded:function(){if(!this.bShowing){return }GOTUIT.DOM.update("LoginBoxInstructions",this.sLoginMessage);this.oLoginSubmitButton=new GOTUIT.PVS.Button("LoginSubmit",null,{},GOTUIT.DOM.get("LoginSubmit"));this.oLoginSubmitButton.setTarget(this);this.oLoginSubmitButton.setMouseClickEvent("LoginSubmit");this.oLoginNewAccountButton=new GOTUIT.PVS.Button("LoginNewAccount",null,{},GOTUIT.DOM.get("LoginNewAccount"));this.oLoginNewAccountButton.setTarget(this);this.oLoginNewAccountButton.setMouseClickEvent("LoginNewAccount");this.oLoginResetPasswordButton=new GOTUIT.PVS.Button("LoginResetPassword",null,{},GOTUIT.DOM.get("LoginResetPassword"));this.oLoginResetPasswordButton.setTarget(this);this.oLoginResetPasswordButton.setMouseClickEvent("LoginResetPassword")},onLoginBoxBeforeHide:function(){this.bShowing=false;this.oLoginSubmitButton=this.deleteButton(this.oLoginSubmitButton);this.oLoginNewAccountButton=this.deleteButton(this.oLoginNewAccountButton);this.oLoginResetPasswordButton=this.deleteButton(this.oLoginResetPasswordButton)},onClickedLoginSubmit:function(){try{var B=GOTUIT.DOM.getFormValue("txtLoginEmail");var A=GOTUIT.DOM.getFormValue("txtLoginPassword");if(!B||!A){this.showModalBoxErrorMessage(GOTUIT.DOM.get("LoginBoxStatus"),"Please enter all fields")}else{this.showModalBoxStatusMessage(GOTUIT.DOM.get("LoginBoxStatus"),"Logging in to system");A=hex_md5(A);if(this.bShowing){Modalbox.deactivate()}this.pvs.User.login(B,A)}return false}catch(C){}},onUserLoginSuccess:function(){if(this.bShowing){Modalbox.hide()}var A=this.fnCallback;this.fnCallback=null;if(A){A()}},onUserLoginError:function(A){this.showModalBoxErrorMessage(GOTUIT.DOM.get("LoginBoxStatus"),"The email address or password you entered is incorrect");if(this.bShowing){Modalbox.activate()}},onClickedLoginNewAccount:function(){this.onLoginBoxBeforeHide();this.onRegisterRequest(this.fnCallback,this.sLoginMessage)},onClickedLoginResetPassword:function(){this.onLoginBoxBeforeHide();this.onResetPasswordRequest(this.fnCallback,this.sLoginMessage)},onClickedLoginUpdatePassword:function(){this.onUpdateProfileBoxBeforeHide();this.onUpdatePasswordRequest(this.fnCallback,this.sLoginMessage)},onRegisterRequest:function(B,A){this.fnCallback=B;this.sLoginMessage=A||this.sDefaultLoginMessage;this.bShowing=true;this.onModalBoxShow();Modalbox.show(this.sRegistrationBoxURL,{title:this.sRegistrationTitle,width:this.sRegisterBoxWidth,height:this.sRegisterBoxHeight,inactiveFade:false,afterLoad:GOTUIT.Function.bindCall(this.onRegistrationBoxLoaded,this),beforeHide:GOTUIT.Function.bindCall(this.onRegistrationBoxBeforeHide,this),afterHide:GOTUIT.Function.bindCall(this.onModalBoxHide,this)})},onRegistrationBoxLoaded:function(){if(!this.bShowing){return }this.oRegisterSubmitButton=new GOTUIT.PVS.Button("RegisterSubmit",null,{},GOTUIT.DOM.get("RegisterSubmit"));this.oRegisterSubmitButton.setTarget(this);this.oRegisterSubmitButton.setMouseClickEvent("RegisterSubmit");this.oRegisterGoToLoginButton=new GOTUIT.PVS.Button("RegisterGoToLogin",null,{},GOTUIT.DOM.get("RegisterGoToLogin"));this.oRegisterGoToLoginButton.setTarget(this);this.oRegisterGoToLoginButton.setMouseClickEvent("RegisterGoToLogin")},onRegistrationBoxBeforeHide:function(){this.bShowing=false;this.oRegisterSubmitButton=this.deleteButton(this.oRegisterSubmitButton);this.oRegisterGoToLoginButton=this.deleteButton(this.oRegisterGoToLoginButton)},onClickedRegisterSubmit:function(){var H=GOTUIT.DOM.getFormValue("txtRegEmail");var C=GOTUIT.DOM.getFormValue("txtRegPassword");var I=GOTUIT.DOM.getFormValue("txtRegPassword2");var G=GOTUIT.DOM.getFormValue("txtRegUserName");var A=GOTUIT.DOM.getFormValue("txtRegFirstName");var E=GOTUIT.DOM.getFormValue("txtRegLastName");var F=GOTUIT.DOM.getFormValue("txtRegDOB");var B=GOTUIT.DOM.getFormValue("txtRegZip");var D=(GOTUIT.DOM.getFormValue("txtRegNewsletter")=="true")?true:false;if(!H||!C||!G||!A||!E||!F||!B){this.showModalBoxErrorMessage(GOTUIT.DOM.get("RegisterBoxStatus"),"Please enter all fields")}else{if(!this.pvs.Util.isValidEmail(H)){this.showModalBoxErrorMessage(GOTUIT.DOM.get("RegisterBoxStatus"),"Please enter a valid email address")}else{if(C!=I){this.showModalBoxErrorMessage(GOTUIT.DOM.get("RegisterBoxStatus"),"Passwords do not match")}else{this.showModalBoxStatusMessage(GOTUIT.DOM.get("RegisterBoxStatus"),"Registering new user");C=hex_md5(C);if(this.bShowing){Modalbox.deactivate()}this.pvs.User.register(H,C,G,A,E,F,B,D)}}}},onUserRegisterSuccess:function(){if(this.bShowing){Modalbox.hide()}var A=this.fnCallback;this.fnCallback=null;if(A){A()}},onUserRegisterError:function(B,C){switch(B){case"ProfaneMetadata":var A=this.sErrorProfaneMetadata.replace("#{Profanity}",C);this.showModalBoxErrorMessage(GOTUIT.DOM.get("RegisterBoxStatus"),A);break;case"InvalidDOB":this.showModalBoxErrorMessage(GOTUIT.DOM.get("RegisterBoxStatus"),this.sInvalidDOBMessage);break;case"InvalidDOBMonth":this.showModalBoxErrorMessage(GOTUIT.DOM.get("RegisterBoxStatus"),this.sInvalidDOBMonthMessage);break;case"InvalidDOBDay":this.showModalBoxErrorMessage(GOTUIT.DOM.get("RegisterBoxStatus"),this.sInvalidDOBDayMessage);break;default:this.showModalBoxErrorMessage(GOTUIT.DOM.get("RegisterBoxStatus"),"That email address or username is already in use, please try another");break}if(this.bShowing){Modalbox.activate()}},onClickedRegisterGoToLogin:function(){this.onRegistrationBoxBeforeHide();this.onLoginRequest(this.fnCallback,this.sLoginMessage)},onResetPasswordRequest:function(B,A){this.fnCallback=B;this.sLoginMessage=this.sDefaultResetPasswordMessage;this.bShowing=true;this.onModalBoxShow();Modalbox.show(this.sResetPasswordBoxURL,{title:this.sResetPasswordTitle,width:this.sResetPasswordBoxWidth,height:this.sResetPasswordBoxHeight,inactiveFade:false,afterLoad:GOTUIT.Function.bindCall(this.onResetPasswordBoxLoaded,this),beforeHide:GOTUIT.Function.bindCall(this.onResetPasswordBoxBeforeHide,this),afterHide:GOTUIT.Function.bindCall(this.onModalBoxHide,this)})},onUserResetPasswordSuccess:function(){if(this.bShowing){Modalbox.hide()}var A=this.fnCallback;this.fnCallback=null;if(A){A()}},onUserResetPasswordError:function(){this.showModalBoxErrorMessage(GOTUIT.DOM.get("ResetPasswordBoxStatus"),"The email address or username you entered is incorrect");if(this.bShowing){Modalbox.activate()}},onResetPasswordBoxLoaded:function(){if(!this.bShowing){return }GOTUIT.DOM.get("ResetPasswordBoxInstructions").update(this.sLoginMessage);this.oResetPasswordSubmitButton=new GOTUIT.PVS.Button("ResetPasswordSubmit",null,{},GOTUIT.DOM.get("ResetPasswordSubmit"));this.oResetPasswordSubmitButton.setTarget(this);this.oResetPasswordSubmitButton.setMouseClickEvent("ResetPasswordSubmit");this.oLoginNewAccountButton=new GOTUIT.PVS.Button("LoginNewAccount",null,{},GOTUIT.DOM.get("LoginNewAccount"));this.oLoginNewAccountButton.setTarget(this);this.oLoginNewAccountButton.setMouseClickEvent("LoginNewAccount")},onResetPasswordBoxBeforeHide:function(){this.bShowing=false;this.oResetPasswordSubmitButton=this.deleteButton(this.oResetPasswordSubmitButton);this.oLoginNewAccountButton=this.deleteButton(this.oLoginNewAccountButton)},onClickedResetPasswordSubmit:function(){try{var A=GOTUIT.DOM.getFormValue("txtLoginEmail");var C=GOTUIT.DOM.getFormValue("txtLoginUserName");if(!A||!C){this.showModalBoxErrorMessage(GOTUIT.DOM.get("ResetPasswordBoxStatus"),"Please enter all fields")}else{this.showModalBoxStatusMessage(GOTUIT.DOM.get("ResetPasswordBoxStatus"),"Resetting user's password.");if(this.bShowing){Modalbox.deactivate()}this.pvs.User.resetPassword(A,C)}return false}catch(B){}},onUpdatePasswordRequest:function(B,A){this.fnCallback=B;this.sLoginMessage=this.sDefaultUpdatePasswordMessage;this.bShowing=true;this.onModalBoxShow();Modalbox.show(this.sUpdatePasswordBoxURL,{title:this.sUpdatePasswordTitle,width:this.sUpdatePasswordBoxWidth,height:this.sUpdatePasswordBoxHeight,inactiveFade:false,afterLoad:this.onUpdatePasswordBoxLoaded.bind(this),beforeHide:this.onUpdatePasswordBoxBeforeHide.bind(this),afterHide:this.onModalBoxHide.bind(this)})},onUserUpdatePasswordSuccess:function(){if(this.bShowing){Modalbox.hide()}var A=this.fnCallback;this.fnCallback=null;if(A){A()}},onUserUpdatePasswordError:function(){this.showModalBoxErrorMessage(GOTUIT.DOM.get("UpdatePasswordBoxStatus"),"The email address or username you entered is incorrect");if(this.bShowing){Modalbox.activate()}},onUpdatePasswordBoxLoaded:function(){if(!this.bShowing){return }GOTUIT.DOM.get("UpdatePasswordBoxInstructions").update(this.sLoginMessage);var A=this.pvs.User.getUserProfile();var B=A.Email;GOTUIT.DOM.get("txtLoginEmail").setValue(B);this.oUpdatePasswordSubmitButton=new GOTUIT.PVS.Button("UpdatePasswordSubmit",null,{},GOTUIT.DOM.get("UpdatePasswordSubmit"));this.oUpdatePasswordSubmitButton.setTarget(this);this.oUpdatePasswordSubmitButton.setMouseClickEvent("UpdatePasswordSubmit")},onUpdatePasswordBoxBeforeHide:function(){this.bShowing=false;this.oUpdatePasswordSubmitButton=this.deleteButton(this.oUpdatePasswordSubmitButton)},onClickedUpdatePasswordSubmit:function(){try{var B=this.pvs.User.getUserProfile();var C=B.UserID;var D=GOTUIT.DOM.getFormValue("txtLoginEmail");var A=GOTUIT.DOM.getFormValue("txtLoginPassword");if(!D||!A){this.showModalBoxErrorMessage(GOTUIT.DOM.get("UpdatePasswordBoxStatus"),"Please enter all fields")}else{this.showModalBoxStatusMessage(GOTUIT.DOM.get("UpdatePasswordBoxStatus"),"Updating user's password.");A=hex_md5(A);if(this.bShowing){Modalbox.deactivate()}this.pvs.User.updatePassword(C,D,A)}return false}catch(E){}},onUpdateProfileRequest:function(B,A){this.fnCallback=B;this.sLoginMessage=A||this.sDefaultUpdateProfileMessage;this.bShowing=true;this.onModalBoxShow();Modalbox.show(this.sUpdateProfileBoxURL,{title:this.sUpdateProfileTitle,width:this.sUpdateProfileBoxWidth,height:this.sUpdateProfileBoxHeight,inactiveFade:false,afterLoad:this.onUpdateProfileBoxLoaded.bind(this),beforeHide:this.onUpdateProfileBoxBeforeHide.bind(this),afterHide:this.onModalBoxHide.bind(this)})},onUpdateProfileBoxLoaded:function(){if(!this.bShowing){return }try{var G=this.pvs.User.getUserProfile();var C=G.UserName;var E=G.Email;var D=G.FirstName;var B=G.LastName;var J=G.DOB;var A=G.Zip;var H=G.NewsletterFlag;var I=J.split("-");if(I.length==3){J=I[1]+"/"+I[2]+"/"+I[0]}GOTUIT.DOM.get("txtProfileEmail").setValue(E);GOTUIT.DOM.get("txtProfileUserName").setValue(C);GOTUIT.DOM.get("txtProfileFirstName").setValue(D);GOTUIT.DOM.get("txtProfileLastName").setValue(B);GOTUIT.DOM.get("txtProfileDOB").setValue(J);GOTUIT.DOM.get("txtProfileZip").setValue(A);if(H=="1"){GOTUIT.DOM.get("txtProfileNewsletter").setValue("true")}else{GOTUIT.DOM.get("txtProfileNewsletter").setValue("false")}}catch(F){}this.oLoginUpdatePasswordButton=new GOTUIT.PVS.Button("LoginUpdatePassword",null,{},GOTUIT.DOM.get("LoginUpdatePassword"));this.oLoginUpdatePasswordButton.setTarget(this);this.oLoginUpdatePasswordButton.setMouseClickEvent("LoginUpdatePassword");this.oUpdateProfileSubmitButton=new GOTUIT.PVS.Button("UpdateProfileSubmit",null,{},GOTUIT.DOM.get("UpdateProfileSubmit"));this.oUpdateProfileSubmitButton.setTarget(this);this.oUpdateProfileSubmitButton.setMouseClickEvent("UpdateProfileSubmit")},onUpdateProfileBoxBeforeHide:function(){this.bShowing=false;this.oLoginUpdatePasswordButton=this.deleteButton(this.oLoginUpdatePasswordButton);this.oUpdateProfileSubmitButton=this.deleteButton(this.oUpdateProfileSubmitButton)},onClickedUpdateProfileSubmit:function(){var H=GOTUIT.DOM.getFormValue("txtProfileEmail");var G=GOTUIT.DOM.getFormValue("txtProfileUserName");var B=GOTUIT.DOM.getFormValue("txtProfileFirstName");var D=GOTUIT.DOM.getFormValue("txtProfileLastName");var F=GOTUIT.DOM.getFormValue("txtProfileDOB");var C=GOTUIT.DOM.getFormValue("txtProfileZip");var E=(GOTUIT.DOM.getFormValue("txtProfileNewsletter")=="true")?true:false;var I=this.pvs.User.getUserProfile();var A=I.UserID;if(!H||!G||!B||!D||!F||!C){this.showModalBoxErrorMessage(GOTUIT.DOM.get("UpdateProfileBoxStatus"),"Please enter all fields")}else{if(!this.pvs.Util.isValidEmail(H)){this.showModalBoxErrorMessage(GOTUIT.DOM.get("UpdateProfileBoxStatus"),"Please enter a valid email address")}else{this.showModalBoxStatusMessage(GOTUIT.DOM.get("UpdateProfileBoxStatus"),"Updating user profile");if(this.bShowing){Modalbox.deactivate()}this.pvs.User.updateProfile(A,H,G,B,D,F,C,E)}}},onUserUpdateProfileSuccess:function(){if(this.bShowing){Modalbox.hide()}var A=this.fnCallback;this.fnCallback=null;if(A){A()}},onUserUpdateProfileError:function(B){switch(B){case"ProfaneMetadata":var A=this.sErrorProfaneMetadata.replace("#{Profanity}",sHelperText);this.showModalBoxErrorMessage(GOTUIT.DOM.get("UpdateProfileBoxStatus"),A);break;case"InvalidDOB":this.showModalBoxErrorMessage(GOTUIT.DOM.get("UpdateProfileBoxStatus"),this.sInvalidDOBMessage);break;case"InvalidDOBMonth":this.showModalBoxErrorMessage(GOTUIT.DOM.get("UpdateProfileBoxStatus"),this.sInvalidDOBMonthMessage);break;case"InvalidDOBDay":this.showModalBoxErrorMessage(GOTUIT.DOM.get("UpdateProfileBoxStatus"),this.sInvalidDOBDayMessage);break;default:this.showModalBoxErrorMessage(GOTUIT.DOM.get("UpdateProfileBoxStatus"),"Unable to update your profile at this time");break}if(this.bShowing){Modalbox.activate()}},onLogoutRequest:function(){this.pvs.User.logout()},onModalBoxShow:function(){GOTUIT.PVS.hideVideoPlayer()},onModalBoxHide:function(){GOTUIT.PVS.showVideoPlayer()},showModalBoxStatusMessage:function(B,A){if(B){if(GOTUIT.DOM.hasClass(B,"MB_error")){GOTUIT.DOM.removeClass(B,"MB_error")}GOTUIT.DOM.addClass(B,"MB_status");GOTUIT.DOM.update(B,A)}},showModalBoxErrorMessage:function(B,A){if(B){if(GOTUIT.DOM.hasClass(B,"MB_status")){GOTUIT.DOM.removeClass(B,"MB_status")}GOTUIT.DOM.addClass(B,"MB_error");GOTUIT.DOM.update(B,A)}},deleteButton:function(A){if(A&&A.destroy){A.destroy()}A=null;return A},zzz:null});GOTUIT.PVS.LoginCookie=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(A,D,E,C){GOTUIT.PVS.Component.prototype.initialize.call(this,A,D,E,C);A.onComponentInitializing(this);this.sLoginCookiePath=this.getAttribute("LoginCookiePath","/");this.nLoginCookieExpirationDays=this.getFloatAttribute("LoginCookieExpirationDays",5);this.bCookieLoginInProgress=false;var B=GOTUIT.PVS.EVENT;A.addListener(B.GPLAYER_READY,this._onGPlayerReady,this);A.addListener(B.USER_LOGIN,this._onUserLogin,this);A.addListener(B.USER_LOGIN_SUCCESS,this._onUserLoginSuccess,this);A.addListener(B.USER_LOGIN_ERROR,this._onUserLoginError,this);A.addListener(B.USER_LOGOUT,this._onUserLogout,this)},_onGPlayerReady:function(){try{var B=this.pvs.Util.readCookie("ue");var A=this.pvs.Util.readCookie("up");if(this.pvs.Util.isValidEmail(B)&&A.length>0){this.bCookieLoginInProgress=true;this.log("Cookie login for: "+B);this.pvs.User.login(B,A)}else{this.log("No cookie login");this.pvs.onComponentReady(this)}}catch(C){this.logException("_onGPlayerReady() Auto login:",C)}},_onUserLoginSuccess:function(){if(this.bCookieLoginInProgress){this.pvs.onComponentReady(this)}this.bCookieLoginInProgress=false},_onUserLoginError:function(){if(this.bCookieLoginInProgress){this._onUserLogout();this.pvs.onComponentReady(this)}this.bCookieLoginInProgress=false},_onUserLogin:function(A,E,C,B){try{this.pvs.Util.setCookie("ue",A.Email,this.nLoginCookieExpirationDays,this.sLoginCookiePath);this.pvs.Util.setCookie("up",B,this.nLoginCookieExpirationDays,this.sLoginCookiePath)}catch(D){this.logException("_onUserLogin: Error creating cookie",D)}},_onUserLogout:function(){try{this.pvs.Util.setCookie("ue","",0,this.sLoginCookiePath);this.pvs.Util.setCookie("up","",0,this.sLoginCookiePath)}catch(A){this.logException("_onUserLogin: Error clearing cookie",A)}}});GOTUIT.PVS.registerComponentType("LoginLinks",GOTUIT.PVS.LoginLinks);GOTUIT.PVS.registerComponentType("LoginModalBox",GOTUIT.PVS.LoginModalBox);GOTUIT.PVS.registerComponentType("LoginCookie",GOTUIT.PVS.LoginCookie);GOTUIT.PVS.GoToPlayingLevelButton=GOTUIT.Class.extend(GOTUIT.PVS.ButtonComponent,{getAttribute:function(B,A){if(B=="MouseClickEvent"){A=GOTUIT.PVS.EVENT.CONTENTBAR_GO_TO_PLAYING}return GOTUIT.PVS.ButtonComponent.prototype.getAttribute.call(this,B,A)}});GOTUIT.PVS.GoUpButton=GOTUIT.Class.extend(GOTUIT.PVS.ButtonComponent,{initialize:function(A,C,D,B){GOTUIT.PVS.ButtonComponent.prototype.initialize.call(this,A,C,D,B);A.addListener(GOTUIT.PVS.EVENT.READY,this._onReady,this)},getAttribute:function(B,A){if(B=="MouseClickEvent"){return GOTUIT.PVS.EVENT.NAVIGATOR_GO_UP}return GOTUIT.PVS.ButtonComponent.prototype.getAttribute.call(this,B,A)},_onReady:function(){var A=this.getTarget();if(A){A.addListener(GOTUIT.PVS.EVENT.NAVIGATOR_PARENT_CHANGED,this._navigatorParentChanged,this)}},_navigatorParentChanged:function(){var A=this.getTarget();this.setDisabled(!A||!A.getCanGoUp())}});GOTUIT.PVS.PlayCurrentLevelButton=GOTUIT.Class.extend(GOTUIT.PVS.ButtonComponent,{getAttribute:function(B,A){if(B=="MouseClickEvent"){A=GOTUIT.PVS.EVENT.NAVIGATOR_PLAY_CURRENT_LEVEL}return GOTUIT.PVS.ButtonComponent.prototype.getAttribute.call(this,B,A)}});GOTUIT.PVS.registerComponentType("GoToPlayingLevelButton",GOTUIT.PVS.GoToPlayingLevelButton);GOTUIT.PVS.registerComponentType("GoUpButton",GOTUIT.PVS.GoUpButton);GOTUIT.PVS.registerComponentType("PlayCurrentLevelButton",GOTUIT.PVS.PlayCurrentLevelButton);GOTUIT.PVS.Navigator=GOTUIT.Class.extend(GOTUIT.PVS.ContentSelector,{initialize:function(C,F,B,G){GOTUIT.PVS.ContentSelector.prototype.initialize.call(this,C,F,B,G);this.aContentButtons=[];this.sSelectedButton=null;this.oNowPlayingSegment=null;this.oNowPlayingPlaylist=null;this.oNowPlayingBase=null;this.oButtonOptions={};this.nPageNumber=0;this.nTotalResults=0;this.nMAX=1<<30;var D=this.getIntAttribute("PVS_MaxContent",this.nMAX);this.setDrillDownMaxContent(this.getIntAttribute("PVS_DrillDownMaxContent",D));this.setSegmentMaxContent(this.getIntAttribute("PVS_SegmentMaxContent",D));var H=this.getIntAttribute("PVS_PageSize",this.nMAX);this.nDrillDownPageSize=this.getIntAttribute("PVS_DrillDownPageSize",H);this.nSegmentPageSize=this.getIntAttribute("PVS_SegmentPageSize",H);this.nIdleThreshold=this.getIntAttribute("IdleThreshold",60);this.bTransitioning=false;this.aTransitionCall=[];this.nNumColumns=this.getIntAttribute("Columns",-1);this.nSpaceWidth=this.getIntAttribute("SpaceWidth",100);this.nSpaceHeight=this.getIntAttribute("SpaceHeight",100);this.nRow=1;this.nColumn=1;this.nDrillableColumns=this.getIntAttribute("DrillableColumns",-1);this.nDrillableSpaceWidth=this.getIntAttribute("DrillableSpaceWidth",100);this.nDrillableSpaceHeight=this.getIntAttribute("DrillableSpaceHeight",100);this.nNonDrillableColumns=this.getIntAttribute("NonDrillableColumns",-1);this.nNonDrillableSpaceWidth=this.getIntAttribute("NonDrillableSpaceWidth",100);this.nNonDrillableSpaceHeight=this.getIntAttribute("NonDrillableSpaceHeight",100);this.nDrillableRow=1;this.nDrillableColumn=1;this.nNonDrillableRow=1;this.nNonDrillableColumn=1;this.bSinglePlacementSize=(this.nNumColumns!=-1);this.bManualPlacementMode=(this.nNumColumns!=-1||(this.nDrillableColumns!=-1&&this.nNonDrillableColumns!=-1));var A=this.getAttribute("PVS_ButtonType","NavigatorContentButton");this.oButtonType=GOTUIT.PVS[A];var E=this.getAttribute("PVS_ListPaneType","Scrollbar");var J=GOTUIT.PVS.ListPane[E];this.oListPane=new J(this,F);this.sSubButtons=this.getAttribute("PVS_SubButtons");this.sExtraButtonDivs=this.getAttribute("PVS_ExtraButtonDivs");this.setDefaultCanDrill(this.getBooleanAttribute("CanDrill",true));this.setDefaultCanDrag(this.getBooleanAttribute("CanDrag",false));this.setDefaultAutoOpenSingleLevels(this.getBooleanAttribute("AutoOpenSingleLevels",false));this.setDefaultAutoPlaySegments(this.getBooleanAttribute("AutoPlaySegments",false));this.setDefaultClickToAutoPlaySegments(this.getBooleanAttribute("ClickToAutoPlaySegments",true));this.setDefaultPlaySegmentSiblings(this.getTriStateAttribute("PlaySegmentSiblings",(this.oListPane.getCanPage()?false:null)));this.setDefaultProgressByBlock(this.getTriStateAttribute("ProgressByBlock",null));this.sPageNumberText=this.getAttribute("PVS_PageNumberText");if(this.sPageNumberText){this.ePageNumber=this.addElementByClass("PageNumber")}GOTUIT.DOM.addClass(F,"Initializing");this.setAutoPlaySegmentDelay(this.getFloatAttribute("AutoPlaySegmentDelay",0.25));this.setTrimLabelsDelay(this.getFloatAttribute("TrimLabelsDelay",0));this.setTrimLabelsInterval(this.getFloatAttribute("TrimLabelsInterval",0));this.bShowRaters=this.getBooleanAttribute("ShowRaters",true);this.bReadOnlyRaters=this.getBooleanAttribute("ReadOnlyRaters",false);this.bGradualButtons=this.getBooleanAttribute("UseGradualButtons",false);this.intervalGradualAdd=null;this.aKillButtonList=[];this.intervalKillFactory=null;this.oAutoPlaySegmentDelayTimer=null;this.oTrimLabelsDelayTimer=null;this.oTrimLabelsTask=null;var I=GOTUIT.PVS.EVENT;this.pvs.addListener(I.PLAYBLOCK_COMPLETE,this._onPVSPlayBlockComplete,this);this.pvs.addListener(I.PLAY_STARTED,this._onPVSPlayStarted,this);this.addListener(I.NAVIGATOR_DRILL_DOWN,this.drillDown,this);this.addListener(I.NAVIGATOR_GO_UP,this.goUp,this);this.addListener(I.NAVIGATOR_ADD_TO_FAVORITES,this._addToFavorites,this);this.addListener(I.NAVIGATOR_MOVE_UP,this._moveContentUp,this);this.addListener(I.NAVIGATOR_MOVE_DOWN,this._moveContentDown,this);this.addListener(I.NAVIGATOR_REMOVE,this._removeContent,this);this.addListener(I.NAVIGATOR_DELETE,this._deleteContent,this);this.addListener(I.NAVIGATOR_EDIT,this._editContent,this);this.addListener(I.NAVIGATOR_PLAY,this._playContent,this);this.addListener(I.NAVIGATOR_PLAY_CURRENT_LEVEL,this._playCurrentLevel,this);this.addListener(I.NAVIGATOR_RELOAD,this.reloadPage,this);C.addListener(I.ADD_SUCCESS,this._contentAdded,this);C.addListener(I.REMOVE_SUCCESS,this._contentRemoved,this);C.addListener(I.MOVE_SUCCESS,this._contentMoved,this)},getManualPlacementMode:function(){return this.bManualPlacementMode},_getUseSinglePlacementSize:function(){return this.bSinglePlacementSize},getButtonContainer:function(A){return this.oListPane.getContainer()},_resetPositions:function(){this.nRow=1;this.nColumn=1;this.nDrillableRow=1;this.nDrillableColumn=1;this.nNonDrillableRow=1;this.nNonDrillableColumn=1},_positionButton:function(C){if(this.getManualPlacementMode()){var A=C.getButton();GOTUIT.DOM.absolutize(A);var D=0,B=0;if(this._getUseSinglePlacementSize()){D=(this.nColumn-1)*this.nSpaceWidth;B=(this.nRow-1)*this.nSpaceHeight;this.nColumn++;if(this.nColumn>this.nNumColumns){this.nRow++;this.nColumn=1}}else{if(C.getIsDrillable()){D=(this.nDrillableColumn-1)*this.nDrillableSpaceWidth;B=(this.nDrillableRow-1)*this.nDrillableSpaceHeight;this.nDrillableColumn++;if(this.nDrillableColumn>this.nDrillableColumns){this.nDrillableRow++;this.nDrillableColumn=1}}else{D=(this.nNonDrillableColumn-1)*this.nNonDrillableSpaceWidth;B=(this.nNonDrillableRow-1)*this.nNonDrillableSpaceHeight;this.nNonDrillableColumn++;if(this.nNonDrillableColumn>this.nNonDrillableColumns){this.nNonDrillableRow++;this.nNonDrillableColumn=1}}}GOTUIT.DOM.moveTo(A,D,B);A._Parent=this.getButtonContainer(C).id;A._DragParent=this.getName();A._X=D;A._Y=B}},getShowRaters:function(){return this.bShowRaters},getCanDrill:function(){return this.bCanDrill},setCanDrill:function(A){this.bCanDrill=A;if(A&&!this.oGoUpButton){this.createGoUpButton()}},setDefaultCanDrill:function(A){this.bDefaultCanDrill=A;this.setCanDrill(A)},getCanDrag:function(){return this.bCanDrag},setCanDrag:function(A){this.bCanDrag=A},setDefaultCanDrag:function(A){this.bDefaultCanDrag=A;this.setCanDrag(A)},getAutoOpenSingleLevels:function(){return this.getCanDrill()&&this.bAutoOpenSingleLevels},setAutoOpenSingleLevels:function(A){this.bAutoOpenSingleLevels=A},setDefaultAutoOpenSingleLevels:function(A){this.bDefaultAutoOpenSingleLevels=A;this.setAutoOpenSingleLevels(A)},getAutoPlaySegments:function(){return this.bAutoPlaySegments},setAutoPlaySegments:function(A){this.bAutoPlaySegments=A},setDefaultAutoPlaySegments:function(A){this.bDefaultAutoPlaySegments=A;this.setAutoPlaySegments(A)},getClickToAutoPlaySegments:function(){return this.bClickToAutoPlaySegments},setClickToAutoPlaySegments:function(A){this.bClickToAutoPlaySegments=A},setDefaultClickToAutoPlaySegments:function(A){this.bClickToDefaultAutoPlaySegments=A;this.setClickToAutoPlaySegments(A)},getPlaySegmentSiblings:function(){return this.bPlaySegmentSiblings},setPlaySegmentSiblings:function(A){this.bPlaySegmentSiblings=A},setDefaultPlaySegmentSiblings:function(A){this.bDefaultPlaySegmentSiblings=A;this.setPlaySegmentSiblings(A)},getProgressByBlock:function(){return this.bProgressByBlock},setProgressByBlock:function(A){this.bProgressByBlock=A},setDefaultProgressByBlock:function(A){this.bDefaultProgressByBlock=A;this.setProgressByBlock(A)},getAutoPlaySegmentDelay:function(){return this.nAutoPlaySegmentDelay},setAutoPlaySegmentDelay:function(A){this.nAutoPlaySegmentDelay=A},getTrimLabelsDelay:function(){return this.nTrimLabelsDelay},setTrimLabelsDelay:function(A){this.nTrimLabelsDelay=A},getTrimLabelsInterval:function(){return this.nTrimLabelsInterval},setTrimLabelsInterval:function(A){this.nTrimLabelsInterval=A},getTopParentContent:function(){return this.oTopParentContent},setTopParentContent:function(A){this.oTopParentContent=A},getParentContent:function(){return this.oParentContent},setParentContent:function(B){var A=this.oParentContent;this.oParentContent=B;if(this.oGoUpButton){this.oGoUpButton.setDisabled(!this.getCanGoUp())}if(A!=B){this.sendEvent(GOTUIT.PVS.EVENT.NAVIGATOR_PARENT_CHANGED,B)}},getCanGoUp:function(A){A=A||this.getParentContent();if(this.getLoadedContentIsOverride()&&A.getIsSearch()){if(A){return !A.getDisplayOptions().getSearchClearBarSelection()}else{return true}}return this._getCanGoUp(A)},_getCanGoUp:function(A){A=A||this.getParentContent();if(A&&!A.equals(this.getTopParentContent())&&A.getCanClose()){return true}else{return false}},getMaxContent:function(){var A=this.getIsSegmentContainer()?this.nSegmentMaxContent:this.nDrillDownMaxContent;var C=this.getParentContent();if(C&&C.getDisplayOptions()){var B=C.getDisplayOptions().getMaxContent();if(B>0&&B<A){A=B}}return A},setMaxContent:function(A){this.setDrillDownMaxContent(A);this.setSegmentMaxContent(A)},setDrillDownMaxContent:function(A){if(!A){A=this.nMAX}this.nDrillDownMaxContent=A},setSegmentMaxContent:function(A){if(!A){A=this.nMAX}this.nSegmentMaxContent=A},getIsSegmentContainer:function(){var A=this.getParentContent();if(!this.getCanDrill()){return true}return A?A.getIsSegmentContainer():false},getIsPlaylist:function(){var A=this.getParentContent();return A?A.getIsPlaylist():false},getPageSize:function(){if(this.oListPane.getCanPage()){var B=(this.getIsSegmentContainer()&&!this.getIsPlaylist());var A=(this.getParentContent().getIsRemix());if(B||A){return this.nSegmentPageSize}else{return this.nDrillDownPageSize}}else{return this.getMaxContent()}},getPageNumber:function(){return this.nPageNumber},setPageNumber:function(A){this.nPageNumber=A},getTotalResults:function(){return this.nTotalResults},setTotalResults:function(A){this.nTotalResults=Math.min(A,this.getMaxContent())},getPageCount:function(){var A=this.getPageSize();if(A>=this.nMAX||A<=0||this.getTotalResults()<=0){return 1}else{return Math.ceil(this.getTotalResults()/A)}},getCanRate:function(A){return this.pvs.Content.canRate(A)},getIsReadOnlyRaters:function(){return this.bReadOnlyRaters},createGoUpButton:function(){var A=this.addElementByClass("GoUp");this.oGoUpButton=new GOTUIT.PVS.Button("GoUp",null,{},A);if(!this.getParentContent()||!this.getParentContent().getCanClose()){this.oGoUpButton.setDisabled(true)}this.oGoUpButton.setTarget(this);this.oGoUpButton.setMouseClickEvent(GOTUIT.PVS.EVENT.NAVIGATOR_GO_UP)},resetList:function(){this._stopGradualAdd();var A=this.oListPane.getContainer();GOTUIT.DOM.update(A,"");this._addToKillFactory(this.aContentButtons);this.aContentButtons=[];this.sSelectedButton=null;this._resetPositions()},_addToKillFactory:function(A){this.aKillButtonList=this.aKillButtonList.concat(A);this._stopKillFactory();this.intervalKillFactory=setInterval(GOTUIT.Function.bindCall(this._killButton,this),175)},_killButton:function(){if(this.aKillButtonList.length>0){try{this.aKillButtonList[0].destroy()}catch(A){}this.aKillButtonList.splice(0,1)}else{this._stopKillFactory()}},_stopKillFactory:function(){clearInterval(this.intervalKillFactory)},addContentButton:function(D,A){if(A==null){A=this.aContentButtons.length}var F=new this.oButtonType(this,D,this.getButtonOptions(),A);F.addSubButtons(this.sSubButtons);F.addExtraDivs(this.sExtraButtonDivs);if(this.getPageNumber()==0&&A==0){if(this.aContentButtons.length>0){GOTUIT.DOM.removeClass(this.aContentButtons[0].getButton(),"FirstContent")}GOTUIT.DOM.addClass(F.getButton(),"FirstContent")}var B=this.getPageNumber()*this.getPageSize();if(B+A==this.getTotalResults()-1){if(this.aContentButtons.length>0&&this.aContentButtons.length==A-B){GOTUIT.DOM.removeClass(this.aContentButtons[A-B-1].getButton(),"LastContent")}GOTUIT.DOM.addClass(F.getButton(),"LastContent")}var E=this.getButtonContainer(F);if(A<this.aContentButtons.length){var C=this.aContentButtons[A].getButton();E.insertBefore(F.getButton(),C);this.aContentButtons.splice(A,0,F)}else{E.appendChild(F.getButton());this.aContentButtons.push(F)}if(this.getManualPlacementMode()){this._positionButton(F)}if(F.afterAddButton){F.afterAddButton()}},removeContentButton:function(A){if(this.getPageNumber()==0&&A==0&&this.aContentButtons.length>1){GOTUIT.DOM.addClass(this.aContentButtons[1].getButton(),"FirstContent")}var B=this.getPageNumber()*this.getPageSize();if(this.getPageNumber()==this.getPageCount()-1&&B+A==this.getTotalResults()&&this.aContentButtons.length>1){GOTUIT.DOM.addClass(this.aContentButtons[A-B-1].getButton(),"LastContent")}var D=this.getButtonContainer(this.aContentButtons[A]);var C=this.aContentButtons[A].getButton();D.removeChild(C);this.aContentButtons.splice(A,1)},getContentListIndex:function(B){var A=-1;var C=this.getContentButton(B);if(C){A=C.getIndex()}return A},getContentButton:function(B){if(!B){return null}var C;for(var A=0;A<this.aContentButtons.length;A++){C=this.aContentButtons[A];if(C.getContent().equals(B)){return C}}return null},getButtonList:function(){return this.aContentButtons},setLoadedContent:function(P,C,D,B){if(!this.bTransitioning){this.bTransitioning=true;this.aTransitionCall=null;GOTUIT.PVS.ContentSelector.prototype.setLoadedContent.call(this,P,C,D,B);this._cancelTimers();var L=P.getDisplayOptions();if(L&&L.getHasCanDrill()){this.setCanDrill(L.getCanDrill())}else{this.setCanDrill(this.bDefaultCanDrill)}if(L&&L.getHasCanDrag()){this.setCanDrag(L.getCanDrag())}else{this.setCanDrag(this.bDefaultCanDrag)}var E=this.getAutoOpenSingleLevels()&&this.getCanDrill()&&!B;if(!E){this.setTopParentContent(P)}var G=!C&&!B&&!this.getClickToAutoPlaySegments();if(C&&!D){var M=this.pvs.Player.getCurrentBase();if(!this.getCanDrill()&&M&&M.getIsRemix()){D=M}else{D=this.pvs.Player.getCurrentSegment()}}var I=false;if(C&&D&&this.oListPane.getCanPage()){I=true}var N;if(C&&C.length>0){N=C.last()}else{N=P}if(!N){this.bTransitioning=true;this.aTransitionCall=null;return }var K=this.oListPane;var H=K.getContainer();var J=K.getChangeEffect();var R=GOTUIT.Function.bindCall(this.afterLoadContent,this,L);var O=GOTUIT.Function.bindCall(this.afterLoadPage,this,R,false,G,I,D,L);var Q;if(E){var F=GOTUIT.Function.bindCall(this.loadPage,this,O,"clearAllState",I,L);var A;if(N==P){A=F}else{A=GOTUIT.Function.bindCall(this.autoOpenSingleLevels,this,F,false,null,N,0)}var Q=GOTUIT.Function.bindCall(this.autoOpenSingleLevels,this,A,true,null,P,0)}else{Q=GOTUIT.Function.bindCall(this.loadPage,this,O,"clearAllState",I,L,N)}Q()}else{this.aTransitionCall=[this.setLoadedContent,P,C,D,B]}},afterLoadContent:function(){this.bTransitioning=false;if(this.aTransitionCall!=null){var A=this.aTransitionCall.shift();A.apply(this,this.aTransitionCall)}},drillDown:function(D,E){if(!this.getCanDrill()){return }if(!this.bTransitioning){this.bTransitioning=true;this.aTransitionCall=null;this._cancelTimers();var C=this.getAutoOpenSingleLevels();var B=this.oListPane;var G=B.getContainer();var J=B.getDrillDownEffect();var A=GOTUIT.Function.bindCall(this.afterDrillDown,this,E);var H=GOTUIT.Function.bindCall(this.afterLoadPage,this,A,false,true,false,null,E);var I;if(C){var F=GOTUIT.Function.bindCall(this.loadPage,this,H,"pushState",false,E);var I=GOTUIT.Function.bindCall(this.autoOpenSingleLevels,this,F,false,null,D,0)}else{I=GOTUIT.Function.bindCall(this.loadPage,this,H,"pushState",false,E,D)}I()}},afterDrillDown:function(){this.afterLoadContent()},goUp:function(D){if(!this._getCanGoUp()&&this.getLoadedContentIsOverride()&&this.getSource()){this.getSource().sendEvent(GOTUIT.PVS.EVENT.SELECTION_OVERRIDE,null,this)}if(!this.getCanDrill()||!this.getCanGoUp()){return }if(!this.bTransitioning){this.bTransitioning=true;this.aTransitionCall=null;this._cancelTimers();var A=this.oListPane;var E=A.getContainer();var I=A.getDrillDownEffect();var B=GOTUIT.Function.bindCall(this.afterGoUp,this,D);var F=GOTUIT.Function.bindCall(this.afterLoadPage,this,B,false,true,false,null,D);var H=GOTUIT.Function.bindCall(this.loadPage,this,F,"popState",false,D);var G=GOTUIT.Function.bindCall(this.afterCloseContent,this,H,D);var C=GOTUIT.Function.bindCall(this.closeContent,this,G,D);C()}},afterGoUp:function(){this.afterLoadContent()},nextPage:function(C){var A=this.getPageNumber()+1;if(A<this.getPageCount()){if(!this.bTransitioning){this.bTransitioning=true;this.aTransitionCall=null;this._cancelTimers();this.setPageNumber(A);var B=this.oListPane;var G=B.getContainer();var D=B.getNextPageEffect();var F=GOTUIT.Function.bindCall(this.afterNextPage,this,C);var E=GOTUIT.Function.bindCall(this.afterLoadPage,this,F,true,false,false,null,C);var H=GOTUIT.Function.bindCall(this.loadPage,this,E,"resetState",false,C,null);H()}}},afterNextPage:function(){this.afterLoadContent()},prevPage:function(C){var A=this.getPageNumber();if(A>0){if(!this.bTransitioning){this.bTransitioning=true;this.aTransitionCall=null;this._cancelTimers();this.setPageNumber(A-1);var B=this.oListPane;var F=B.getContainer();var D=B.getPrevPageEffect();var G=GOTUIT.Function.bindCall(this.afterPrevPage,this,C);var E=GOTUIT.Function.bindCall(this.afterLoadPage,this,G,true,false,false,null,C);var H=GOTUIT.Function.bindCall(this.loadPage,this,E,"resetState",false,C,null);H()}}},afterPrevPage:function(){this.afterLoadContent()},reloadPage:function(B){if(!this.bTransitioning){this.bTransitioning=true;this.aTransitionCall=null;this._cancelTimers();var A=this.oListPane;var F=A.getContainer();var C=A.getReloadEffect();var E=GOTUIT.Function.bindCall(this.afterReloadPage,this,B);var D=GOTUIT.Function.bindCall(this.afterLoadPage,this,E,true,false,false,null,B);var G=GOTUIT.Function.bindCall(this.loadPage,this,D,"restoreState",false,B,null);G()}},afterReloadPage:function(){this.afterLoadContent()},autoOpenSingleLevels:function(E,B,D,C,A){if(D){if(A==1&&D[0].getCanOpen()){C=D[0]}else{if(B){this.setTopParentContent(C)}E(C);return }}C.openSlice(0,2,{onSuccess:GOTUIT.Function.bindCall(this.autoOpenSingleLevels,this,E,B),onError:GOTUIT.Function.bindCall(this.logError,this,"autoOpenSingleLevels() failed")})},loadPage:function(B,J,I,F,H){var A=this.oListPane;if(J&&A[J]){A[J].call(A)}if(F&&F.beforeLoadPage){F.beforeLoadPage()}if(H){var G=H&&H.getDisplayOptions();var K;var D=this.getParentContent();if(D){GOTUIT.DOM.removeClass(this.eComponent,D.getType());K=D.getDisplayOptions();if(K&&K!=G){var E=K.getCSSClasses();if(E){for(var C=0;C<E.length;C++){GOTUIT.DOM.removeClass(this.eComponent,E[C])}}}}if(G&&K!=G){var E=G.getCSSClasses();if(E){for(var C=0;C<E.length;C++){GOTUIT.DOM.addClass(this.eComponent,E[C])}}}this.setParentContent(H);GOTUIT.DOM.addClass(this.eComponent,H.getType())}var L=this;if(I){this.getParentContent().openSlice(0,this.getMaxContent(),{onSuccess:B,onError:function(){L.logError("loadPage() failed");L._handleEmptyOrInvalidPage()}})}else{this.getParentContent().openSlice(this.getPageNumber(),Math.min(this.getPageSize(),this.getMaxContent()),{onSuccess:B,onError:function(){L.logError("loadPage() failed");L._handleEmptyOrInvalidPage()}})}this.resetList()},afterLoadPage:function(F,B,E,O,H,K,J,M,D){this.setTotalResults(D);var A=-1;if(H&&J){for(var G=0;G<J.length;G++){if(H.equals(J[G])){if(O){var N=this.getPageSize();if(J&&J.length>N){var L=Math.floor(G/N);var C=N*L;var I=Math.min(C+N,J.length);this.setPageNumber(L);A=G-C;J=J.slice(C,I)}}else{A=G}break}}}if(A==-1&&O){var N=this.getPageSize();if(J&&J.length>N){J=J.slice(0,N)}}this.nADDINDEX=0;this.aCONTENT=J;this.fnADDCALLBACK=F;this.bALLOWAUTOPLAY=E;this.nSCROLLTARGET=A;this.oOPTIONS=K;if(J&&J.length>0){GOTUIT.DOM.removeClass(this.eComponent,"NoContent");if(this.bGradualButtons){this._stopGradualAdd();this.intervalGradualAdd=setInterval(GOTUIT.Function.bindCall(this._addContent,this),85)}else{for(var G=0;G<J.length;G++){this.addContentButton(J[G],G)}this._onAddContentComplete()}}else{this._handleEmptyOrInvalidPage()}},_handleEmptyOrInvalidPage:function(){GOTUIT.DOM.addClass(this.eComponent,"NoContent");this._onAddContentComplete()},_stopGradualAdd:function(){clearInterval(this.intervalGradualAdd)},_addContent:function(){if(this.aCONTENT[this.nADDINDEX]!=null){this.addContentButton(this.aCONTENT[this.nADDINDEX],this.nADDINDEX);this.nADDINDEX++}else{this._onAddContentComplete()}},_onAddContentComplete:function(){this._stopGradualAdd();GOTUIT.DOM.removeClass(this.eComponent,"Initializing");if(this.getTrimLabelsDelay()>0){this.oTrimLabelsDelayTimer=setTimeout(GOTUIT.Function.bindCall(this._trimLabels,this),this.getTrimLabelsDelay()*1000)}else{this._trimLabels()}this.oListPane.updateUI();this.setNowPlayingHighlight(this.getNowPlayingContent());if(this.bALLOWAUTOPLAY&&this.getAutoPlaySegments()&&this.aCONTENT&&this.aCONTENT.length>0&&this.getContentButton(this.getNowPlayingContent())==null&&(!this.getCanDrill()||!this.aCONTENT[0].getCanOpen())){this.oAutoPlaySegmentDelayTimer=setTimeout(this._playContent.bind(this,aContent[0]),this.getAutoPlaySegmentDelay()*1000)}if(this.nSCROLLTARGET>=0){var A=this.aContentButtons[this.nSCROLLTARGET].getButton();if(A&&A.scrollIntoView){try{A.scrollIntoView(false)}catch(C){}}}if(this.oListPane.getCanPage()){if(this.getPageCount()>1){GOTUIT.DOM.addClass(this.eComponent,"MultiplePage")}else{GOTUIT.DOM.removeClass(this.eComponent,"MultiplePage")}if(this.ePageNumber){var B=this.sPageNumberText.replace(/#{PageNumber}/g,this.getPageNumber()+1);B=B.replace(/#{PageCount}/g,this.getPageCount());GOTUIT.DOM.update(this.ePageNumber,B)}}if(this.oOPTIONS&&this.oOPTIONS.afterLoadPage){this.oOPTIONS.afterLoadPage()}if(this.fnADDCALLBACK){this.fnADDCALLBACK()}},closeContent:function(B,A){this.getParentContent().close({onSuccess:B,onError:GOTUIT.Function.bindCall(this.logError,this,"closeContent: close() failed")})},afterCloseContent:function(E,A,D,C){var B=this.getAutoOpenSingleLevels();if(B&&D&&D.length==1&&this.getCanGoUp(C)){if(this._getCanGoUp(C)){C.close({onSuccess:GOTUIT.Function.bindCall(this.afterCloseContent,this,E,A),onError:GOTUIT.Function.bindCall(this.logError,this,"afterCloseContent: close() failed")})}else{if(this.getLoadedContentIsOverride()&&this.getSource()){this.getSource().sendEvent(GOTUIT.PVS.EVENT.SELECTION_OVERRIDE,null,this)}}return }if(E){E(C)}},_trimLabels:function(){if(this.getTrimLabelsInterval()>0){this.oTrimLabelsTask=new GOTUIT.PVS.TrimAllLabelsTask(this.eComponent,this,this.getTrimLabelsInterval())}else{GOTUIT.PVS.Label.trimAllLabels(this.eComponent,this)}},_cancelTimers:function(){if(this.oAutoPlaySegmentDelayTimer){clearTimeout(this.oAutoPlaySegmentDelayTimer);this.oAutoPlaySegmentDelayTimer=null}if(this.oTrimLabelsDelayTimer){clearTimeout(this.oTrimLabelsDelayTimer);this.oTrimLabelsDelayTimer=null}if(this.oTrimLabelsTask){this.oTrimLabelsTask.stop();this.oTrimLabelsTask=null}},setButtonOptions:function(A){this.oButtonOptions=A},getButtonOptions:function(){return this.oButtonOptions},removeNowPlayingHighlight:function(){if(this.sSelectedButton!=null){this.sSelectedButton.setSelected(false);this.sSelectedButton=null}},setNowPlayingHighlight:function(B){this.removeNowPlayingHighlight();if(B!=null){this.sSelectedButton=this.getContentButton(B);if(this.sSelectedButton){this.sSelectedButton.setSelected(true);var A=this.sSelectedButton.getButton();if(A&&GOTUIT.PVS.getIdleTime()>this.nIdleThreshold&&A.scrollIntoView){try{A.scrollIntoView(false)}catch(C){}}}}},getNowPlayingContent:function(){if(!this.getCanDrill()&&this.oNowPlayingBase&&this.oNowPlayingBase.getIsRemix()){return this.oNowPlayingBase}else{return this.oNowPlayingSegment}},_onPVSPlayBlockComplete:function(A){this.oNowPlayingSegment=null;this.oNowPlayingPlaylist=null;this.oNowPlayingBase=null;this.setNowPlayingHighlight(null)},_onPVSPlayStarted:function(B,A,C){this.oNowPlayingSegment=B;this.oNowPlayingPlaylist=A;this.oNowPlayingBase=C;this.setNowPlayingHighlight(this.getNowPlayingContent())},_addToFavorites:function(A){this.pvs.sendEvent(GOTUIT.PVS.EVENT.ADD_TO_FAVORITES,A)},_moveContentUp:function(B){var A=B.getIndex();if(A>0){this.pvs.sendEvent(GOTUIT.PVS.EVENT.MOVE,B.getParent(),A,A-1)}},_moveContentDown:function(B){var A=B.getIndex();if(A<this.getTotalResults()-1){this.pvs.sendEvent(GOTUIT.PVS.EVENT.MOVE,B.getParent(),A,A+1)}},_removeContent:function(A){this.pvs.sendEvent(GOTUIT.PVS.EVENT.REMOVE,A.getParent(),A.getIndex())},_deleteContent:function(A){this.pvs.sendEvent(GOTUIT.PVS.EVENT.DELETE,A)},_editContent:function(A){this.pvs.sendEvent(GOTUIT.PVS.EVENT.EDIT,A)},_playContent:function(B){if(this.oAutoPlaySegmentDelayTimer){clearTimeout(this.oAutoPlaySegmentDelayTimer);this.oAutoPlaySegmentDelayTimer=null}var A={};if(this.getPlaySegmentSiblings()!=null){A.PlaySegmentSiblings=this.getPlaySegmentSiblings()}if(this.getProgressByBlock()!=null){A.ProgressByBlock=this.getProgressByBlock()}this.pvs.sendEvent(GOTUIT.PVS.EVENT.PLAY,B,A)},_playCurrentLevel:function(){if(this.getParentContent()){this.pvs.sendEvent(GOTUIT.PVS.EVENT.PLAY,this.getParentContent())}},_contentAdded:function(F,G,A){if(!G||G.length==0||!F||!F.equals(this.getParentContent())){return }var B=this.oListPane;if(B&&B.getCanPage()){this.reloadPage();return }GOTUIT.DOM.removeClass(this.eComponent,"NoContent");var C=G.length;for(var D=A;D<this.aContentButtons.length;D++){var E=this.aContentButtons[D].getContent();E.setIndex(E.getIndex()+C)}this.setTotalResults(this.getTotalResults()+C);for(var D=C-1;D>=0;D--){this.addContentButton(G[D],A)}},_contentRemoved:function(E,A){if(!E||!E.equals(this.getParentContent())){return }var B=this.oListPane;if(B&&B.getCanPage()){this.reloadPage();return }for(var C=A+1;C<this.aContentButtons.length;C++){var D=this.aContentButtons[C].getContent();D.setIndex(D.getIndex()-1)}this.setTotalResults(this.getTotalResults()-1);if(this.getTotalResults()==0){GOTUIT.DOM.addClass(this.eComponent,"NoContent")}this.removeContentButton(A)},_contentMoved:function(C,A,B){if(!C||!C.equals(this.getParentContent())||A==B){return }this.reloadPage()}});GOTUIT.PVS.registerComponentType("Navigator",GOTUIT.PVS.Navigator);GOTUIT.PVS.NavigatorContentButton=GOTUIT.Class.extend(GOTUIT.PVS.Button,{initialize:function(F,E,C,A){this.TYPE_DRILLDOWN="DrillDownButton";this.TYPE_SEGMENT="SegmentButton";this.bDrillable=false;this.bDragable=false;if(F.getCanDrill()&&E.getCanOpen()){this.bDrillable=true}else{if(F.getCanDrag()){this.bDragable=true}}this.sPrimaryDetail=F.pvs.Content.getPrimaryDetail(E);var D=this._determineCssClasses(F,E);var B=GOTUIT.DOM.create("div",{"class":D.join(" ")});GOTUIT.PVS.Button.prototype.initialize.call(this,D[0],E,C,B);this.oComponent=F;this.setIndex(A);this.getButton().PVS_Content=E;this._applyDragSourceSignature(this.getButton());if(this.bDrillable){this.setTarget(F);this.setMouseClickEvent(GOTUIT.PVS.EVENT.NAVIGATOR_DRILL_DOWN)}else{if(!this.bDragable){this.setTarget(F);this.setMouseClickEvent(GOTUIT.PVS.EVENT.NAVIGATOR_PLAY,{})}}this._addButtonContent()},_applyDragSourceSignature:function(C){var B=this.getContent();var A=B.getShareSignature();A+="&cache="+B.getCacheID();C.PVS_ShareSignature=A},destroy:function(){this.getButton().PVS_Content=null;this.getButton().PVS_ShareSignature=null;if(this.oDraggable){GOTUIT.DOM.destroyDraggable(this.oDraggable);this.oDraggable=null}GOTUIT.PVS.Button.prototype.destroy.call(this)},addSubButtons:function(H){if(!H){return }if(GOTUIT.Object.isString(H)){H=H.split(",")}var B=this;var D=this.oComponent;var C=this.getContent();var G,F,E;for(var A=0;A<H.length;A++){G=H[A];F=G.split("|");G=F.shift();E=new GOTUIT.PVS.Button(G,C);this.getButton().appendChild(E.getButton());this.addChildLink(E);E.setMouseClickEvent(G);E.setTarget(D);if(F.length>0&&F[0]){E.setHoverText(F.join("|"))}}},addExtraDivs:function(C){if(!C){return }if(GOTUIT.Object.isString(C)){C=C.split(",")}var E=this.oComponent;var D=this.getContent();var F,B;for(var A=0;A<C.length;A++){F=C[A];B=GOTUIT.DOM.create("div",{className:F});this.getButton().appendChild(B)}},_determineCssClasses:function(D,C){var B=[];var E;if(D.getCanDrill()&&C.getCanOpen()){E=this.TYPE_DRILLDOWN}else{E=this.TYPE_SEGMENT}B.push(E);if(E==this.TYPE_SEGMENT){B.push("NonDrillButton")}else{try{B.push(D.pvs.Util.getCSSSafeName(this.sPrimaryDetail))}catch(A){}}B.push("NavigatorButton");B.push(C.getType());if((D.pvs.User.isAdmin()||D.pvs.User.getOwnsContent(C))&&(C.getIsScene()||C.getIsRemix())){B.push("OwnsContent");B.push(E+"_OwnsContent")}if(D.pvs.Content.canEdit(C)){B.push("EditContent");B.push(E+"_EditContent")}if(D.getShowRaters()&&D.getCanRate(C)){B.push("RateContent");B.push(E+"_RateContent")}return B},_addButtonContent:function(){var D=this.getButton();var C=this.getContent();var J=C.getThumbnailURL();var E=C.getMissingThumbnailURL();var B=(this.getIsDrillable()&&!C.getHasThumbnailURL());if(!B&&(C.getHasThumbnailURL()||E)){var K=GOTUIT.DOM.create("div",{className:"Thumbnail"});this._applyDragSourceSignature(K);var A;if(C.getHasThumbnailURL()&&E){A=GOTUIT.DOM.create("img",{className:"ThumbnailImage",src:J,onerror:"this.src='"+E+"'"})}else{if(C.getHasThumbnailURL()){A=GOTUIT.DOM.create("img",{className:"ThumbnailImage",src:J})}else{A=GOTUIT.DOM.create("img",{className:"ThumbnailImage MissingThumbnailImage",src:E});GOTUIT.DOM.addClass(K,"MissingThumbnail")}}this._applyDragSourceSignature(A);K.appendChild(A);D.appendChild(K)}var G=GOTUIT.PVS.Label;var F=this.oComponent.pvs.Content;G.appendLabel(D,"LabelPrimaryDetail",this.sPrimaryDetail,this.getOptions());var L=F.getSecondaryDetail(C);G.appendLabel(D,"LabelSecondaryDetail",L,this.getOptions());L=F.getTertiaryDetail(C);G.appendLabel(D,"LabelTertiaryDetail",L,this.getOptions());if(F.hasUserName(C)){L=F.getUserName(C);G.appendLabel(D,"LabelUserName",L,this.getOptions())}if(F.hasDuration(C)){L=this.oComponent.pvs.Util.secondsToHHMMSSFormat(F.getDuration(C));G.appendLabel(D,"LabelDuration",L,this.getOptions())}if(F.hasVoteCount(C)){L=F.getVoteCount(C);G.appendLabel(D,"LabelNumVotes",L,this.getOptions())}if(F.hasVoteRank(C)){L=F.getVoteRank(C);G.appendLabel(D,"LabelVoteRank",L,this.getOptions())}if(F.hasNumPlays(C)){L=F.getNumPlays(C);G.appendLabel(D,"LabelNumPlays",L,this.getOptions())}if(this.oComponent.getShowRaters()&&this.oComponent.getCanRate(C)){var H=GOTUIT.DOM.create("div");var I=new GOTUIT.PVS.ButtonRater(this.oComponent.pvs,H,"ButtonRater","ButtonRater"+this.getIndex(),null,this.oComponent.getIsReadOnlyRaters());I.setContent(C);D.appendChild(H)}},afterAddButton:function(){var B=this.oComponent;var A=this.getContent();if(B&&B.getCanDrag()&&!this.bDrillable){this.oDraggable=GOTUIT.DOM.createDraggable(this.getButton(),"Thumbnail",null,true)}},getIsDrillable:function(){return this.bDrillable}});GOTUIT.PVS.AbstractAdminDeleteButton=GOTUIT.Class.extend(GOTUIT.PVS.ButtonLabel,{initialize:function(A,C,D,B){GOTUIT.PVS.ButtonLabel.prototype.initialize.call(this,A,C,D,B);this.setTarget(this);this.setMouseClickEvent("ClickedDelete");this.oContent=null;this.addListener("ClickedDelete",this._onClickedDelete,this);this._disable()},_setContent:function(A){this.log("admin delete content loaded: "+A.getType()+":"+A.getTitle());this.oContent=A;this.setDisabled(false)},_disable:function(){this.oContent=null;this.setDisabled(true)},_onClickedDelete:function(){if(this.oContent!=null){this._delete(this.oContent)}},_delete:function(A){this.pvs.sendEvent(GOTUIT.PVS.EVENT.DELETE,A)}});GOTUIT.PVS.AbstractAdminDeleteNowPlayingButton=GOTUIT.Class.extend(GOTUIT.PVS.AbstractAdminDeleteButton,{initialize:function(A,C,D,B){GOTUIT.PVS.AbstractAdminDeleteButton.prototype.initialize.call(this,A,C,D,B);this.pvs.addListener(GOTUIT.PVS.EVENT.PLAY_STARTED,this._onPlayStarted,this)},_onPlayStarted:function(B,A,D,C){this._disable()}});GOTUIT.PVS.AdminDeleteNowPlayingSceneButton=GOTUIT.Class.extend(GOTUIT.PVS.AbstractAdminDeleteNowPlayingButton,{initialize:function(A,C,D,B){GOTUIT.PVS.AbstractAdminDeleteNowPlayingButton.prototype.initialize.call(this,A,C,D,B)},_onPlayStarted:function(B,A,D,C){if(B.getIsScene()){this._setContent(B)}else{this._disable()}}});GOTUIT.PVS.AdminDeleteNowPlayingRemixButton=GOTUIT.Class.extend(GOTUIT.PVS.AbstractAdminDeleteNowPlayingButton,{initialize:function(A,C,D,B){GOTUIT.PVS.AbstractAdminDeleteNowPlayingButton.prototype.initialize.call(this,A,C,D,B)},_onPlayStarted:function(B,A,D,C){if(A.getIsRemix()){this._setContent(A)}else{this._disable()}}});GOTUIT.PVS.registerComponentType("AdminDeleteNowPlayingRemixButton",GOTUIT.PVS.AdminDeleteNowPlayingRemixButton);GOTUIT.PVS.registerComponentType("AdminDeleteNowPlayingSceneButton",GOTUIT.PVS.AdminDeleteNowPlayingSceneButton);GOTUIT.PVS.AbstractNowPlayingDetail=GOTUIT.Class.extend(GOTUIT.PVS.ButtonLabel,{initialize:function(A,D,E,C){GOTUIT.PVS.ButtonLabel.prototype.initialize.call(this,A,D,E,C);var B=GOTUIT.PVS.EVENT;this.pvs.addListener(B.PLAY_STARTED,this._onPlayStarted,this)},_getTargetContent:function(B,A,D,C){return this.pvs.Player.getPlayingContent()},_onPlayStarted:function(B,A,D,C){}});GOTUIT.PVS.AbstractNowPlayingMappedDetail=GOTUIT.Class.extend(GOTUIT.PVS.AbstractNowPlayingDetail,{initialize:function(A,C,D,B){GOTUIT.PVS.AbstractNowPlayingDetail.prototype.initialize.call(this,A,C,D,B)},_getMapPosition:function(){return this.pvs.Content.PRIMARY_DETAIL},_onPlayStarted:function(B,A,D,C){this.setText(this.pvs.Content.getMappedDetail(this._getTargetContent(B,A,D,C),this._getMapPosition()))}});GOTUIT.PVS.NowPlayingPrimaryDetail=GOTUIT.Class.extend(GOTUIT.PVS.AbstractNowPlayingMappedDetail,{initialize:function(A,C,D,B){GOTUIT.PVS.AbstractNowPlayingMappedDetail.prototype.initialize.call(this,A,C,D,B)},_getMapPosition:function(){return this.pvs.Content.PRIMARY_DETAIL}});GOTUIT.PVS.NowPlayingSegmentPrimaryDetail=GOTUIT.Class.extend(GOTUIT.PVS.NowPlayingPrimaryDetail,{initialize:function(A,C,D,B){GOTUIT.PVS.NowPlayingPrimaryDetail.prototype.initialize.call(this,A,C,D,B)},_getTargetContent:function(B,A,D,C){return B}});GOTUIT.PVS.NowPlayingPlaylistPrimaryDetail=GOTUIT.Class.extend(GOTUIT.PVS.NowPlayingPrimaryDetail,{initialize:function(A,C,D,B){GOTUIT.PVS.NowPlayingPrimaryDetail.prototype.initialize.call(this,A,C,D,B)},_getTargetContent:function(B,A,D,C){return A}});GOTUIT.PVS.NowPlayingSecondaryDetail=GOTUIT.Class.extend(GOTUIT.PVS.AbstractNowPlayingMappedDetail,{initialize:function(A,C,D,B){GOTUIT.PVS.AbstractNowPlayingMappedDetail.prototype.initialize.call(this,A,C,D,B)},_getMapPosition:function(){return this.pvs.Content.SECONDARY_DETAIL}});GOTUIT.PVS.NowPlayingSegmentSecondaryDetail=GOTUIT.Class.extend(GOTUIT.PVS.NowPlayingSecondaryDetail,{initialize:function(A,C,D,B){GOTUIT.PVS.NowPlayingSecondaryDetail.prototype.initialize.call(this,A,C,D,B)},_getTargetContent:function(B,A,D,C){return B}});GOTUIT.PVS.NowPlayingPlaylistSecondaryDetail=GOTUIT.Class.extend(GOTUIT.PVS.NowPlayingSecondaryDetail,{initialize:function(A,C,D,B){GOTUIT.PVS.NowPlayingSecondaryDetail.prototype.initialize.call(this,A,C,D,B)},_getTargetContent:function(B,A,D,C){return A}});GOTUIT.PVS.NowPlayingTertiaryDetail=GOTUIT.Class.extend(GOTUIT.PVS.AbstractNowPlayingMappedDetail,{initialize:function(A,C,D,B){GOTUIT.PVS.AbstractNowPlayingMappedDetail.prototype.initialize.call(this,A,C,D,B)},_getMapPosition:function(){return this.pvs.Content.TERTIARY_DETAIL}});GOTUIT.PVS.NowPlayingSegmentTertiaryDetail=GOTUIT.Class.extend(GOTUIT.PVS.NowPlayingTertiaryDetail,{initialize:function(A,C,D,B){GOTUIT.PVS.NowPlayingTertiaryDetail.prototype.initialize.call(this,A,C,D,B)},_getTargetContent:function(B,A,D,C){return B}});GOTUIT.PVS.NowPlayingPlaylistTertiaryDetail=GOTUIT.Class.extend(GOTUIT.PVS.NowPlayingTertiaryDetail,{initialize:function(A,C,D,B){GOTUIT.PVS.NowPlayingTertiaryDetail.prototype.initialize.call(this,A,C,D,B)},_getTargetContent:function(B,A,D,C){return A}});GOTUIT.PVS.AbstractNowPlayingElement=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(A,D,E,C){GOTUIT.PVS.Component.prototype.initialize.call(this,A,D,E,C);var B=GOTUIT.PVS.EVENT;this.pvs.addListener(B.PLAYBLOCK_STARTED,this._onPlayBlockStarted,this);this.pvs.addListener(B.PLAY_STARTED,this._onPlayStarted,this)},_onPlayBlockStarted:function(A){},_onPlayStarted:function(B,A,D,C){}});GOTUIT.PVS.NowPlayingThumbnail=GOTUIT.Class.extend(GOTUIT.PVS.AbstractNowPlayingElement,{initialize:function(A,C,D,B){GOTUIT.PVS.AbstractNowPlayingElement.prototype.initialize.call(this,A,C,D,B);this.sInactiveImageURL=this.getAttribute("ThumbnailInactiveImage");this.pvs.addListener(GOTUIT.PVS.EVENT.GPLAYER_READY,this._onGPlayerReady,this)},_onGPlayerReady:function(){this.eThumbnailImage=GOTUIT.DOM.create("img",{className:"Thumbnail",onerror:"this.src='"+pvs.getMissingThumbnailURL()+"'"});this.getComponentElement().appendChild(this.eThumbnailImage)},_setContentThumb:function(A){if(this.pvs.Content.hasThumbnailURL(A)){this._setThumbSource(this.pvs.Content.getThumbnailURL(A))}else{this._setThumbSource(this.pvs.Content.getMissingThumbnailURL(A))}GOTUIT.DOM.show(this.eThumbnailImage)},_setThumbSource:function(A){if(this.eThumbnailImage.src!=A){this.eThumbnailImage.src=A}},_onPlayBlockStarted:function(A){if(A.getIsRemix()){this._setContentThumb(A)}},_onPlayStarted:function(B,A,D,C){if(!D.getIsRemix()){this._setContentThumb(B)}}});GOTUIT.PVS.NowPlayingSegmentThumbnail=GOTUIT.Class.extend(GOTUIT.PVS.NowPlayingThumbnail,{initialize:function(A,C,D,B){GOTUIT.PVS.NowPlayingThumbnail.prototype.initialize.call(this,A,C,D,B)},_onPlayBlockStarted:function(A){},_onPlayStarted:function(B,A,D,C){this._setContentThumb(B)}});GOTUIT.PVS.NowPlayingPlaylistThumbnail=GOTUIT.Class.extend(GOTUIT.PVS.NowPlayingThumbnail,{initialize:function(A,C,D,B){GOTUIT.PVS.NowPlayingThumbnail.prototype.initialize.call(this,A,C,D,B)},_onPlayBlockStarted:function(A){},_onPlayStarted:function(B,A,D,C){this._setContentThumb(A)}});GOTUIT.PVS.NowPlayingOtherRemixesByThisUser=GOTUIT.Class.extend(GOTUIT.PVS.AbstractNowPlayingElement,{initialize:function(A,C,D,B){GOTUIT.PVS.AbstractNowPlayingElement.prototype.initialize.call(this,A,C,D,B);this.oCurrentRemix=null;this.aButtons=[];this.eContainer=this.addElementByClass("RemixListContainer");this.eLabel=this.addElementByClass("Label",this.eContainer);this.eHolder=this.addElementByClass("RemixList",this.eContainer);GOTUIT.DOM.update(this.eLabel,this.getAttribute("RemixListLabelText","Other remixes by this user: "));this.clear();this.addListener("ClickedRemix",this._onClickedRemix,this)},_onClickedRemix:function(A){this.pvs.Player.play(A)},_onPlayBlockStarted:function(F){if(F.getIsRemix()){var G=false;if(this.oCurrentRemix!=null){if(this.oCurrentRemix.getID()==F.getID()){G=true}}if(!G){this.oCurrentRemix=F;this.clear();var I=this;var C,B,D,A=true,E;var H={onSuccess:function(L,K){for(var J=0;J<L.length;J++){C=L[J];if(C.getID()!=I.oCurrentRemix.getID()){if(!A){E=GOTUIT.DOM.create("span");GOTUIT.DOM.update(E,", ");I.eHolder.appendChild(E)}B=GOTUIT.DOM.create("span",{className:"Remix"});D=new GOTUIT.PVS.Button("Remix",C,{},B);D.setTarget(I);D.setMouseClickEvent("ClickedRemix");GOTUIT.DOM.update(D.getElement(),I.pvs.Content.getPrimaryDetail(C));I.eHolder.appendChild(B);I.aButtons.push(D);A=false}}if(I.aButtons.length>0){GOTUIT.DOM.show(I.eLabel)}},onError:function(J){}};this.pvs.Remix.getOtherRemixesByThisUser(this.oCurrentRemix,H)}}else{this.clear()}},clear:function(){for(var A=0;A<this.aButtons.length;A++){this.aButtons[A].destroy()}this.aButtons=[];GOTUIT.DOM.update(this.eHolder,"");GOTUIT.DOM.hide(this.eLabel)}});GOTUIT.PVS.NowPlayingAddToFavoritesButton=GOTUIT.Class.extend(GOTUIT.PVS.ButtonLabel,{initialize:function(A,C,D,B){GOTUIT.PVS.ButtonLabel.prototype.initialize.call(this,A,C,D,B);this.setMouseClickEvent("ClickedButton");this.addListener("ClickedButton",this._onClicked,this)},_onClicked:function(){if(this.pvs.Player.isPlayingContent()){this.pvs.sendEvent(GOTUIT.PVS.EVENT.ADD_TO_FAVORITES,this.pvs.Player.getCurrentSegment())}}});GOTUIT.PVS.NowPlayingAddToRemixButton=GOTUIT.Class.extend(GOTUIT.PVS.ButtonLabel,{initialize:function(A,C,D,B){GOTUIT.PVS.ButtonLabel.prototype.initialize.call(this,A,C,D,B);this.setMouseClickEvent("AddToRemix");this.addListener("AddToRemix",this._onClicked,this)},_onClicked:function(){if(this.pvs.Player.isPlayingContent()){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_ADD,this.pvs.Player.getPlayingContent())}}});GOTUIT.PVS.NowPlayingSegmentAddToRemixButton=GOTUIT.Class.extend(GOTUIT.PVS.NowPlayingAddToRemixButton,{initialize:function(A,C,D,B){GOTUIT.PVS.NowPlayingAddToRemixButton.prototype.initialize.call(this,A,C,D,B)},_onClicked:function(){if(this.pvs.Player.isPlayingContent()){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_ADD,this.pvs.Player.getCurrentSegment())}}});GOTUIT.PVS.NowPlayingPlaylistAddToRemixButton=GOTUIT.Class.extend(GOTUIT.PVS.NowPlayingAddToRemixButton,{initialize:function(A,C,D,B){GOTUIT.PVS.NowPlayingAddToRemixButton.prototype.initialize.call(this,A,C,D,B)},_onClicked:function(){if(this.pvs.Player.isPlayingContent()){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_ADD,this.pvs.Player.getCurrentPlaylist())}}});GOTUIT.PVS.NowPlayingEditButton=GOTUIT.Class.extend(GOTUIT.PVS.ButtonLabel,{initialize:function(A,C,D,B){GOTUIT.PVS.ButtonLabel.prototype.initialize.call(this,A,C,D,B);this.setMouseClickEvent("Edit");this.addListener("Edit",this._onClickedEdit,this)},_onClickedEdit:function(){if(this.pvs.Player.isPlayingContent()){this.pvs.sendEvent(GOTUIT.PVS.EVENT.EDIT,this.pvs.Player.getPlayingContent())}}});GOTUIT.PVS.NowPlayingSegmentEditButton=GOTUIT.Class.extend(GOTUIT.PVS.NowPlayingEditButton,{initialize:function(A,C,D,B){GOTUIT.PVS.NowPlayingEditButton.prototype.initialize.call(this,A,C,D,B)},_onClickedEdit:function(){if(this.pvs.Player.isPlayingContent()){this.pvs.sendEvent(GOTUIT.PVS.EVENT.EDIT,this.pvs.Player.getCurrentSegment())}}});GOTUIT.PVS.NowPlayingPlaylistEditButton=GOTUIT.Class.extend(GOTUIT.PVS.NowPlayingEditButton,{initialize:function(A,C,D,B){GOTUIT.PVS.NowPlayingEditButton.prototype.initialize.call(this,A,C,D,B)},_onClickedEdit:function(){if(this.pvs.Player.isPlayingContent()){this.pvs.sendEvent(GOTUIT.PVS.EVENT.EDIT,this.pvs.Player.getCurrentPlaylist())}}});GOTUIT.PVS.AbstractFlagContentButton=GOTUIT.Class.extend(GOTUIT.PVS.ButtonLabel,{initialize:function(A,C,D,B){GOTUIT.PVS.ButtonLabel.prototype.initialize.call(this,A,C,D,B);this.oContent=null;this.setMouseClickEvent("ClickedButton");this.addListener("ClickedButton",this._onClicked,this);this.pvs.addListener(GOTUIT.PVS.EVENT.PLAY_STARTED,this._onPlayStarted,this);this.setDisabled(true)},_setContent:function(A){if(this.pvs.Content.canFlag(A)){this.setDisabled(false);this.oContent=A}else{this.setDisabled(true)}},_onClicked:function(){if(this.oContent!=null){this.pvs.sendEvent(GOTUIT.PVS.EVENT.FLAG,this.oContent)}},_onPlayStarted:function(B,A,D,C){}});GOTUIT.PVS.NowPlayingFlagSegmentButton=GOTUIT.Class.extend(GOTUIT.PVS.AbstractFlagContentButton,{initialize:function(A,C,D,B){GOTUIT.PVS.AbstractFlagContentButton.prototype.initialize.call(this,A,C,D,B)},_onPlayStarted:function(B,A,D,C){this._setContent(B)}});GOTUIT.PVS.NowPlayingFlagPlaylistButton=GOTUIT.Class.extend(GOTUIT.PVS.AbstractFlagContentButton,{initialize:function(A,C,D,B){GOTUIT.PVS.AbstractFlagContentButton.prototype.initialize.call(this,A,C,D,B)},_onPlayStarted:function(B,A,D,C){this._setContent(A)}});GOTUIT.PVS.NowPlayingInfo=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(M,H,L,I){GOTUIT.PVS.Component.prototype.initialize.call(this,M,H,L,I);this.eInstructions=this.addElementByClass("Instructions");this.eHolder=this.addElementByClass("NowPlayingHolder");this.eThumbnail=this._createThumbnail();this.eHolder.appendChild(this.eThumbnail);var F=this.addElementByClass("Details");var J=this._createMappedDetail("Primary",GOTUIT.PVS.NowPlayingPrimaryDetail);this.ePrimaryHolder=J[0];this.oPrimaryDetail=J[1];F.appendChild(this.ePrimaryHolder);J=this._createMappedDetail("Secondary",GOTUIT.PVS.NowPlayingSecondaryDetail);this.eSecondaryHolder=J[0];this.oSecondaryDetail=J[1];F.appendChild(this.eSecondaryHolder);J=this._createMappedDetail("Tertiary",GOTUIT.PVS.NowPlayingTertiaryDetail);this.eTertiaryHolder=J[0];this.oTertiaryDetail=J[1];F.appendChild(this.eTertiaryHolder);this.eHolder.appendChild(F);var K=this.addElementByClass("Duration",F);this.oLabelDuration=new GOTUIT.PVS.Label(this.pvs,K,"Label",this.getName()+"_Duration");this.sUserPrefix=this.getAttribute("UserNamePrefix","");var G=this.addElementByClass("UserName",F);this.oUserLink=new GOTUIT.PVS.ButtonLabel(this.pvs,G,"ButtonLabel",this.getName()+"_UserLink");this.sVoteCountPrefix=this.getAttribute("VoteCountPrefix","");var A=this.addElementByClass("LabelNumVotes",F);this.oLabelVoteCount=new GOTUIT.PVS.Label(this.pvs,A,"Label",this.getName()+"_NumVotes");this.sVoteRankPrefix=this.getAttribute("VoteRankPrefix","");var Q=this.addElementByClass("LabelVoteRank",F);this.oLabelVoteRank=new GOTUIT.PVS.Label(this.pvs,Q,"Label",this.getName()+"_VoteRank");this.sNumPlaysPrefix=this.getAttribute("NumPlaysPrefix","");var E=this.addElementByClass("LabelNumPlays",F);this.oLabelNumPlays=new GOTUIT.PVS.Label(this.pvs,E,"Label",this.getName()+"_NumPlays");var B=this.addElementByClass("Tags",F);this.oLabelTags=new GOTUIT.PVS.Label(this.pvs,B,"Label",this.getName()+"_Tags");var R=this._createRater();this.eRater=R[0];this.oRater=R[1];this.eHolder.appendChild(this.eRater);GOTUIT.DOM.hide(this.eRater);var N=this.addElementByClass("Buttons");this.eAddHolder=this.addElementByClass("AddToRemixHolder",N);this.oAddToRemixButton=this._createButton("NowPlayingAddToRemixButton",GOTUIT.PVS.NowPlayingAddToRemixButton);this.eAddHolder.appendChild(this.oAddToRemixButton.getComponentElement());this.eEditHolder=this.addElementByClass("EditHolder",N);this.oEditButton=this._createButton("NowPlayingEditButton",GOTUIT.PVS.NowPlayingEditButton);this.eEditHolder.appendChild(this.oEditButton.getComponentElement());this.oMyFavsButton=this._createButton("NowPlayingAddToFavoritesButton",GOTUIT.PVS.NowPlayingAddToFavoritesButton);N.appendChild(this.oMyFavsButton.getComponentElement());this.oShareButton=this._createButton("NowPlayingShareButton",GOTUIT.PVS.SharePanelButton);N.appendChild(this.oShareButton.getComponentElement());this.oFlagSegmentContent=this._createButton("NowPlayingFlagSegmentButton",GOTUIT.PVS.NowPlayingFlagSegmentButton);N.appendChild(this.oFlagSegmentContent.getComponentElement());this.oFlagPlaylistContent=this._createButton("NowPlayingFlagPlaylistButton",GOTUIT.PVS.NowPlayingFlagPlaylistButton);N.appendChild(this.oFlagPlaylistContent.getComponentElement());this.oDeleteSceneContent=this._createButton("NowPlayingDeleteSceneButton",GOTUIT.PVS.AdminDeleteNowPlayingSceneButton);N.appendChild(this.oDeleteSceneContent.getComponentElement());this.oDeleteRemixContent=this._createButton("NowPlayingDeleteRemixButton",GOTUIT.PVS.AdminDeleteNowPlayingRemixButton);N.appendChild(this.oDeleteRemixContent.getComponentElement());var C=this.addElementByClass("ShareButtons",N);var O=new GOTUIT.PVS.ShareButtons(this.pvs,C,"ShareButtons",this.getName()+"_ShareButtons",this);this.eHolder.appendChild(N);var D=this.addElementByClass("OtherRemixesByThisUser",this.eHolder);var P=new GOTUIT.PVS.NowPlayingOtherRemixesByThisUser(this.pvs,D,"NowPlayingOtherRemixesByThisUser",this.getName()+"_NowPlayingOtherRemixesByThisUser");this._hideNowPlaying();this.pvs.addListener(GOTUIT.PVS.EVENT.PLAY_STARTED,this._onPlayStarted,this)},_createThumbnail:function(){var A=GOTUIT.DOM.create("div",{"class":"ThumbnailHolder"});var B=GOTUIT.DOM.create("div");var C=new GOTUIT.PVS.NowPlayingThumbnail(this.pvs,B,"NowPlayingThumbnail",this.getName()+"_NowPlayingThumbnail");A.appendChild(B);return A},_createMappedDetail:function(F,A){var B=GOTUIT.DOM.create("div",{"class":F+"DetailHolder"});var D=GOTUIT.DOM.create("div",{"class":F+"Prefix Prefix"});GOTUIT.DOM.update(D,this.getAttribute(F+"Prefix",""));B.appendChild(D);var C=GOTUIT.DOM.create("div");var E=new A(this.pvs,C,"NowPlaying"+F+"Detail",this.getName()+"_NowPlaying"+F+"Detail");B.appendChild(C);return[B,E]},_createRater:function(){var A=GOTUIT.DOM.create("div");var B=new GOTUIT.PVS.ButtonRater(this.pvs,A,"ButtonRater",this.getName()+"_ButtonRater");return[A,B]},_createButton:function(C,B){var A=GOTUIT.DOM.create("div",{"class":"Button "+C});return new B(this.pvs,A,C,this.getName()+"_"+C)},_hideNowPlaying:function(){GOTUIT.DOM.hide(this.eHolder);GOTUIT.DOM.show(this.eInstructions)},_showNowPlaying:function(){GOTUIT.DOM.hide(this.eInstructions);GOTUIT.DOM.show(this.eHolder)},_onPlayStarted:function(D,A,G,F){this._showNowPlaying();var C=this.pvs.Player.getPlayingContent();var B=this.pvs.Content;if(B.canEdit(C)){GOTUIT.DOM.show(this.eAddHolder);GOTUIT.DOM.show(this.eEditHolder)}else{GOTUIT.DOM.hide(this.eAddHolder);GOTUIT.DOM.hide(this.eEditHolder)}if(this.oLabelDuration){if(B.hasDuration(C)){var E=this.pvs.Util.secondsToHHMMSSFormat(B.getDuration(C));this.oLabelDuration.setText(E)}else{this.oLabelDuration.setText("")}}if(this.oUserLink){if(B.hasUserName(C)){this.oUserLink.setText(this.sUserPrefix+B.getUserName(C))}else{this.oUserLink.setText("")}}if(this.oLabelTags){if(B.hasTags(C)){this.oLabelTags.setText(B.getTags(C))}else{this.oLabelTags.setText("")}}if(this.oLabelVoteCount){if(B.hasVoteCount(C)){this.oLabelVoteCount.setText(this.sVoteCountPrefix+B.getVoteCount(C))}else{this.oLabelVoteCount.setText("")}}if(this.oLabelVoteRank){if(B.hasVoteRank(C)){this.oLabelVoteRank.setText(this.sVoteRankPrefix+B.getVoteRank(C))}else{this.oLabelVoteRank.setText("")}}if(this.oLabelNumPlays){if(B.hasNumPlays(C)){this.oLabelNumPlays.setText(this.sNumPlaysPrefix+B.getNumPlays(C))}else{this.oLabelNumPlays.setText("")}}if(B.canRate(C)){this.oRater.setContent(C);GOTUIT.DOM.show(this.eRater)}else{GOTUIT.DOM.hide(this.eRater)}}});GOTUIT.PVS.TabbedNowPlayingInfo=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(C,E,A,F){GOTUIT.PVS.Component.prototype.initialize.call(this,C,E,A,F);this.eInstructions=this.addElementByClass("Instructions");var D=this.addElementByClass("NowPlayingTabs");this.oTabs=new GOTUIT.PVS.TabComponent(C,D,"TabComponent",this.getName()+"_TabComponent");this._hideNowPlaying();var B=this.addElementByClass("SegmentTab",D);var H=new GOTUIT.PVS.NowPlayingSegmentTab(C,B,"NowPlayingSegmentTab",this.getName()+"_NowPlayingSegmentTab",this);this.oTabs.addTab(H);var I=this.addElementByClass("PlaylistTab",D);var G=new GOTUIT.PVS.NowPlayingPlaylistTab(C,I,"NowPlayingPlaylistTab",this.getName()+"_NowPlayingPlaylistTab",this);this.oTabs.addTab(G);this.pvs.addListener(GOTUIT.PVS.EVENT.PLAY_STARTED,this._onPlayStarted,this)},_hideNowPlaying:function(){GOTUIT.DOM.hide(this.oTabs.getComponentElement());GOTUIT.DOM.show(this.eInstructions)},_showNowPlaying:function(){GOTUIT.DOM.hide(this.eInstructions);GOTUIT.DOM.show(this.oTabs.getComponentElement())},_onPlayStarted:function(B,A,D,C){this._showNowPlaying()}});GOTUIT.PVS.AbstractNowPlayingTab=GOTUIT.Class.extend(GOTUIT.PVS.Tab,{initialize:function(A,E,F,D,C){GOTUIT.PVS.Tab.prototype.initialize.call(this,A,E,F,D,C);this.oRater=null;this.oLabelDuration=null;this.oLabelTags=null;this._addDetails();this._addThumbnail();this._addRater();this._addLabels();var B=GOTUIT.PVS.EVENT;this.pvs.addListener(B.PLAY_STARTED,this._onPlayStarted,this)},_addDetails:function(){},_addThumbnail:function(){},_addRater:function(){var A=this.addElementByClass("Rater",this.eContents);this.oRater=new GOTUIT.PVS.ButtonRater(this.pvs,A,"ButtonRater",this.getName()+"_ButtonRater")},_addLabels:function(){var B=this.addElementByClass("Duration",this.eContents);this.oLabelDuration=new GOTUIT.PVS.Label(this.pvs,B,"Label",this.getName()+"_DurationLabel");this.sUserPrefix=this.getAttribute("UserNamePrefix","");var C=this.addElementByClass("UserName",this.eContents);this.oUserLink=new GOTUIT.PVS.ButtonLabel(this.pvs,C,"ButtonLabel",this.getName()+"_UserLink");this.oUserLink.setTarget(this);this.oUserLink.setMouseClickEvent("ClickedUserName");var A=this.addElementByClass("Tags",this.eContents);this.oLabelTags=new GOTUIT.PVS.Label(this.pvs,A,"Label",this.getName()+"_TagsLabel")},_update:function(A){if(this.oRater){if(this.pvs.Content.canRate(A)){this.oRater.setContent(A);GOTUIT.DOM.show(this.oRater.getComponentElement())}else{GOTUIT.DOM.hide(this.oRater.getComponentElement())}}if(this.oLabelDuration){if(this.pvs.Content.hasDuration(A)){var B=this.pvs.Util.secondsToHHMMSSFormat(this.pvs.Content.getDuration(A));this.oLabelDuration.setText(B)}else{this.oLabelDuration.setText("")}}if(this.oUserLink){if(this.pvs.Content.hasUserName(A)){this.oUserLink.setText(this.sUserPrefix+this.pvs.Content.getUserName(A))}else{this.oUserLink.setText("")}}if(this.oLabelTags){if(this.pvs.Content.hasTags(A)){this.oLabelTags.setText(this.pvs.Content.getTags(A))}else{this.oLabelTags.setText("")}}},_onSelected:function(){},_onPlayStarted:function(B,A,D,C){}});GOTUIT.PVS.NowPlayingSegmentTab=GOTUIT.Class.extend(GOTUIT.PVS.AbstractNowPlayingTab,{initialize:function(P,I,O,J,M){GOTUIT.PVS.AbstractNowPlayingTab.prototype.initialize.call(this,P,I,O,J,M);var B=this.addElementByClass("AddToFavsButton",this.eContents);var L=new GOTUIT.PVS.NowPlayingAddToFavoritesButton(this.pvs,B,"NowPlayingAddToFavoritesButton",this.getName()+"_NowPlayingAddToFavoritesButton",M);var S=this.addElementByClass("AddToRemixButton",this.eContents);var E=new GOTUIT.PVS.NowPlayingSegmentAddToRemixButton(this.pvs,S,"NowPlayingSegmentAddToRemixButton",this.getName()+"_NowPlayingSegmentAddToRemixButton",M);var K=this.addElementByClass("EditButton",this.eContents);var C=new GOTUIT.PVS.NowPlayingSegmentEditButton(this.pvs,K,"NowPlayingSegmentEditButton",this.getName()+"_NowPlayingSegmentEditButton",M);var Q=this.addElementByClass("FlagButton",this.eContents);var T=new GOTUIT.PVS.NowPlayingFlagSegmentButton(this.pvs,Q,"NowPlayingFlagSegmentButton",this.getName()+"_NowPlayingFlagSegmentButton",M);var A=this.addElementByClass("ShareButton",this.eContents);var H=new GOTUIT.PVS.SharePanelButton(this.pvs,A,"SharePanelButton",this.getName()+"_SharePanelButton",M);var R=this.addElementByClass("ShareSegment",this.eContents);var N=new GOTUIT.PVS.ShareSegmentURLBox(this.pvs,R,"ShareSegmentURLBox",this.getName()+"_ShareSegmentURLBox",M);var D=this.addElementByClass("ShareButtons",this.eContents);var U=new GOTUIT.PVS.ShareButtons(this.pvs,D,"ShareButtons",this.getName()+"_ShareButtons",M);var G=this.addElementByClass("DeleteButton",this.eContents);var F=new GOTUIT.PVS.AdminDeleteNowPlayingSceneButton(this.pvs,G,"NowPlayingSegmentDeleteButton",this.getName()+"_NowPlayingSegmentDeleteButton",M)},_addDetails:function(){var D=this.addElementByClass("Details",this.eContents);var C=this.addElementByClass("PrimaryDetail",D);this.oPrimaryDetail=new GOTUIT.PVS.NowPlayingSegmentPrimaryDetail(this.pvs,C,"NowPlayingSegmentPrimaryDetail",this.getName()+"_NowPlayingSegmentPrimaryDetail");var B=this.addElementByClass("SecondaryDetail",D);this.oSecondaryDetail=new GOTUIT.PVS.NowPlayingSegmentSecondaryDetail(this.pvs,B,"NowPlayingSegmentSecondaryDetail",this.getName()+"_NowPlayingSegmentSecondaryDetail");var A=this.addElementByClass("TertiaryDetail",D);this.oTertiaryDetail=new GOTUIT.PVS.NowPlayingSegmentTertiaryDetail(this.pvs,A,"NowPlayingSegmentTertiaryDetail",this.getName()+"_NowPlayingSegmentTertiaryDetail")},_addThumbnail:function(){var B=this.addElementByClass("ThumbnailHolder",this.eContents);var A=new GOTUIT.PVS.NowPlayingSegmentThumbnail(this.pvs,B,"NowPlayingSegmentThumbnail",this.getName()+"_NowPlayingSegmentThumbnail")},_onSelected:function(){if(this.oPrimaryDetail){this.oPrimaryDetail.trimLabel()}if(this.oSecondaryDetail){this.oSecondaryDetail.trimLabel()}if(this.oTertiaryDetail){this.oTertiaryDetail.trimLabel()}},_onPlayStarted:function(B,A,E,D){var C=this.eContents.getElementsByClassName("DeleteButton");if(C!=null){if(this.pvs.User.isAdmin()&&this.pvs.User.getOwnsContent(B)){GOTUIT.DOM.show(C[0])}else{if(this.pvs.User.isAdmin()||this.pvs.User.getOwnsContent(B)){GOTUIT.DOM.show(C[0])}else{GOTUIT.DOM.hide(C[0])}}}this._update(B)}});GOTUIT.PVS.NowPlayingPlaylistTab=GOTUIT.Class.extend(GOTUIT.PVS.AbstractNowPlayingTab,{initialize:function(O,J,N,K,M){GOTUIT.PVS.AbstractNowPlayingTab.prototype.initialize.call(this,O,J,N,K,M);var Q=this.addElementByClass("AddToRemixButton",this.eContents);var F=new GOTUIT.PVS.NowPlayingPlaylistAddToRemixButton(this.pvs,Q,"NowPlayingPlaylistAddToRemixButton",this.getName()+"_NowPlayingPlaylistAddToRemixButton",M);var L=this.addElementByClass("EditButton",this.eContents);var C=new GOTUIT.PVS.NowPlayingPlaylistEditButton(this.pvs,L,"NowPlayingPlaylistEditButton",this.getName()+"_NowPlayingPlaylistEditButton",M);var P=this.addElementByClass("FlagButton",this.eContents);var R=new GOTUIT.PVS.NowPlayingFlagPlaylistButton(this.pvs,P,"NowPlayingFlagPlaylistButton",this.getName()+"_NowPlayingFlagPlaylistButton",M);var A=this.addElementByClass("ShareButton",this.eContents);var I=new GOTUIT.PVS.SharePanelButton(this.pvs,A,"SharePanelButton",this.getName()+"_SharePanelButton",M);var B=this.addElementByClass("SharePlaylist",this.eContents);var D=new GOTUIT.PVS.SharePlaylistURLBox(this.pvs,B,"SharePlaylistURLBox",this.getName()+"_SharePlaylistURLBox",M);var H=this.addElementByClass("DeleteButton",this.eContents);var G=new GOTUIT.PVS.AdminDeleteNowPlayingRemixButton(this.pvs,H,"NowPlayingPlaylistDeleteButton",this.getName()+"NowPlayingPlaylistDeleteButton",M);var E=this.addElementByClass("OtherRemixesByThisUser",this.eContents);var S=new GOTUIT.PVS.NowPlayingOtherRemixesByThisUser(this.pvs,E,"NowPlayingOtherRemixesByThisUser",this.getName()+"_NowPlayingOtherRemixesByThisUser",M)},_addDetails:function(){var E=this.addElementByClass("Details",this.eContents);var D=this.addElementByClass("PrimaryDetail",E);var A=new GOTUIT.PVS.NowPlayingPlaylistPrimaryDetail(this.pvs,D,"NowPlayingPlaylistPrimaryDetail",this.getName()+"_NowPlayingPlaylistPrimaryDetail");var C=this.addElementByClass("SecondaryDetail",E);var F=new GOTUIT.PVS.NowPlayingPlaylistSecondaryDetail(this.pvs,C,"NowPlayingPlaylistSecondaryDetail",this.getName()+"_NowPlayingPlaylistSecondaryDetail");var B=this.addElementByClass("TertiaryDetail",E);this.oTertiaryDetail=new GOTUIT.PVS.NowPlayingPlaylistTertiaryDetail(this.pvs,B,"NowPlayingPlaylistTertiaryDetail",this.getName()+"_NowPlayingPlaylistTertiaryDetail")},_addThumbnail:function(){var B=this.addElementByClass("ThumbnailHolder",this.eContents);var A=new GOTUIT.PVS.NowPlayingPlaylistThumbnail(this.pvs,B,"NowPlayingPlaylistThumbnail",this.getName()+"_NowPlayingPlaylistThumbnail")},_onSelected:function(){if(this.oPrimaryDetail){this.oPrimaryDetail.trimLabel()}if(this.oSecondaryDetail){this.oSecondaryDetail.trimLabel()}if(this.oTertiaryDetail){this.oTertiaryDetail.trimLabel()}},_onPlayStarted:function(B,A,E,D){var C=this.eContents.getElementsByClassName("DeleteButton");if(C!=null){if(this.pvs.User.isAdmin()&&this.pvs.User.getOwnsContent(B)){GOTUIT.DOM.show(C[0])}else{if(this.pvs.User.isAdmin()||this.pvs.User.getOwnsContent(B)){GOTUIT.DOM.show(C[0])}else{GOTUIT.DOM.hide(C[0])}}}this._update(A)}});GOTUIT.PVS.registerComponentType("NowPlayingPrimaryDetail",GOTUIT.PVS.NowPlayingPrimaryDetail);GOTUIT.PVS.registerComponentType("NowPlayingSegmentPrimaryDetail",GOTUIT.PVS.NowPlayingSegmentPrimaryDetail);GOTUIT.PVS.registerComponentType("NowPlayingPlaylistPrimaryDetail",GOTUIT.PVS.NowPlayingPlaylistPrimaryDetail);GOTUIT.PVS.registerComponentType("NowPlayingSecondaryDetail",GOTUIT.PVS.NowPlayingSecondaryDetail);GOTUIT.PVS.registerComponentType("NowPlayingSegmentSecondaryDetail",GOTUIT.PVS.NowPlayingSegmentSecondaryDetail);GOTUIT.PVS.registerComponentType("NowPlayingPlaylistSecondaryDetail",GOTUIT.PVS.NowPlayingPlaylistSecondaryDetail);GOTUIT.PVS.registerComponentType("NowPlayingTertiaryDetail",GOTUIT.PVS.NowPlayingTertiaryDetail);GOTUIT.PVS.registerComponentType("NowPlayingSegmentTertiaryDetail",GOTUIT.PVS.NowPlayingSegmentTertiaryDetail);GOTUIT.PVS.registerComponentType("NowPlayingPlaylistTertiaryDetail",GOTUIT.PVS.NowPlayingPlaylistTertiaryDetail);GOTUIT.PVS.registerComponentType("NowPlayingThumbnail",GOTUIT.PVS.NowPlayingThumbnail);GOTUIT.PVS.registerComponentType("NowPlayingSegmentThumbnail",GOTUIT.PVS.NowPlayingSegmentThumbnail);GOTUIT.PVS.registerComponentType("NowPlayingPlaylistThumbnail",GOTUIT.PVS.NowPlayingPlaylistThumbnail);GOTUIT.PVS.registerComponentType("NowPlayingOtherRemixesByThisUser",GOTUIT.PVS.NowPlayingOtherRemixesByThisUser);GOTUIT.PVS.registerComponentType("NowPlayingAddToFavoritesButton",GOTUIT.PVS.NowPlayingAddToFavoritesButton);GOTUIT.PVS.registerComponentType("NowPlayingAddToRemixButton",GOTUIT.PVS.NowPlayingAddToRemixButton);GOTUIT.PVS.registerComponentType("NowPlayingSegmentAddToRemixButton",GOTUIT.PVS.NowPlayingSegmentAddToRemixButton);GOTUIT.PVS.registerComponentType("NowPlayingPlaylistAddToRemixButton",GOTUIT.PVS.NowPlayingPlaylistAddToRemixButton);GOTUIT.PVS.registerComponentType("NowPlayingEditButton",GOTUIT.PVS.NowPlayingEditButton);GOTUIT.PVS.registerComponentType("NowPlayingSegmentEditButton",GOTUIT.PVS.NowPlayingSegmentEditButton);GOTUIT.PVS.registerComponentType("NowPlayingPlaylistEditButton",GOTUIT.PVS.NowPlayingPlaylistEditButton);GOTUIT.PVS.registerComponentType("NowPlayingFlagSegmentButton",GOTUIT.PVS.NowPlayingFlagSegmentButton);GOTUIT.PVS.registerComponentType("NowPlayingFlagPlaylistButton",GOTUIT.PVS.NowPlayingFlagPlaylistButton);GOTUIT.PVS.registerComponentType("NowPlayingInfo",GOTUIT.PVS.NowPlayingInfo);GOTUIT.PVS.registerComponentType("TabbedNowPlayingInfo",GOTUIT.PVS.TabbedNowPlayingInfo);GOTUIT.PVS.NowPlayingSavePane=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(A,G,H,F){GOTUIT.PVS.Component.prototype.initialize.call(this,A,G,H,F);this._createNowPlaying();var E=this.addElementByClass("RemixSaveControls");GOTUIT.DOM.hide(E);this.oRemixSaveControls=new GOTUIT.PVS.RemixSaveControls(this.pvs,E,"RemixSaveControls",F+"_RemixSaveControls");this.bRemixSaveMode=false;var D=this.addElementByClass("SceneSaveControls");GOTUIT.DOM.hide(D);this.oSceneSaveControls=new GOTUIT.PVS.SceneSaveControls(this.pvs,D,"SceneSaveControls",F+"_SceneSaveControls");this.bSceneSaveMode=false;var C=this.addElementByClass("RemixShareControls");GOTUIT.DOM.hide(C);this.oRemixShareControls=new GOTUIT.PVS.RemixShareControls(this.pvs,C,"RemixShareControls",F+"_RemixShareControls");this.bRemixShareMode=false;var B=this.addElementByClass("CloseButton");this.oCloseButton=new GOTUIT.PVS.Button("CloseButton",{},{},B);this.oCloseButton.setTarget(this);this.oCloseButton.setMouseClickEvent("ClickedClose");this.addListener("ClickedClose",this._onClickedClose,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_SHOW_DIALOG,this._onRemixSaveShowDialog,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_CANCEL,this._onRemixSaveHideDialog,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_SUCCESS,this._onRemixSaveHideDialog,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_SAVE_SHOW_DIALOG,this._onSceneSaveShowDialog,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_SAVE_CANCEL,this._onSceneSaveHideDialog,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_SAVE_SUCCESS,this._onSceneSaveHideDialog,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_CANCEL_SUCCESS,this._onSceneSaveHideDialog,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_SHARE_SHOW_DIALOG,this._onRemixShareShowDialog,this);this._hideShowElements()},_createNowPlaying:function(){var A=this.addElementByClass("NowPlayingInfo");GOTUIT.DOM.hide(A);this.oNowPlaying=new GOTUIT.PVS.NowPlayingInfo(this.pvs,A,"NowPlayingInfo",this.getName()+"_NowPlayingInfo")},_hideShowElements:function(){if(this.bRemixSaveMode){GOTUIT.DOM.hide(this.oNowPlaying.getComponentElement());GOTUIT.DOM.hide(this.oSceneSaveControls.getComponentElement());GOTUIT.DOM.hide(this.oRemixShareControls.getComponentElement());GOTUIT.DOM.show(this.oRemixSaveControls.getComponentElement());GOTUIT.DOM.hide(this.oCloseButton.getContainer())}else{if(this.bSceneSaveMode){GOTUIT.DOM.hide(this.oNowPlaying.getComponentElement());GOTUIT.DOM.hide(this.oRemixSaveControls.getComponentElement());GOTUIT.DOM.hide(this.oRemixShareControls.getComponentElement());GOTUIT.DOM.show(this.oSceneSaveControls.getComponentElement());GOTUIT.DOM.hide(this.oCloseButton.getContainer())}else{if(this.bRemixShareMode){GOTUIT.DOM.hide(this.oNowPlaying.getComponentElement());GOTUIT.DOM.hide(this.oRemixSaveControls.getComponentElement());GOTUIT.DOM.hide(this.oSceneSaveControls.getComponentElement());GOTUIT.DOM.show(this.oRemixShareControls.getComponentElement());GOTUIT.DOM.show(this.oCloseButton.getContainer())}else{GOTUIT.DOM.hide(this.oRemixSaveControls.getComponentElement());GOTUIT.DOM.hide(this.oSceneSaveControls.getComponentElement());GOTUIT.DOM.hide(this.oRemixShareControls.getComponentElement());GOTUIT.DOM.show(this.oNowPlaying.getComponentElement());GOTUIT.DOM.hide(this.oCloseButton.getContainer())}}}},_onClickedClose:function(){if(this.bRemixShareMode){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_SHARE_HIDE_DIALOG)}this.bRemixSaveMode=false;this.bSceneSaveMode=false;this.bRemixShareMode=false;this._hideShowElements()},_onRemixSaveShowDialog:function(){this.bRemixSaveMode=true;this.bSceneSaveMode=false;this.bRemixShareMode=false;this._hideShowElements()},_onRemixSaveHideDialog:function(){this.bRemixSaveMode=false;this.bSceneSaveMode=false;this.bRemixShareMode=false;this._hideShowElements()},_onSceneSaveShowDialog:function(){this.bRemixSaveMode=false;this.bSceneSaveMode=true;this.bRemixShareMode=false;this._hideShowElements()},_onSceneSaveHideDialog:function(){this.bRemixSaveMode=false;this.bSceneSaveMode=false;this.bRemixShareMode=false;this._hideShowElements()},_onRemixShareShowDialog:function(){this.bRemixSaveMode=false;this.bSceneSaveMode=false;this.bRemixShareMode=true;this._hideShowElements()}});GOTUIT.PVS.TabbedNowPlayingSavePane=GOTUIT.Class.extend(GOTUIT.PVS.NowPlayingSavePane,{initialize:function(A,C,D,B){GOTUIT.PVS.NowPlayingSavePane.prototype.initialize.call(this,A,C,D,B)},_createNowPlaying:function(){var A=this.addElementByClass("NowPlayingInfo");this.oNowPlaying=new GOTUIT.PVS.TabbedNowPlayingInfo(this.pvs,A,"TabbedNowPlayingInfo",this.getName()+"_TabbedNowPlayingInfo")}});GOTUIT.PVS.registerComponentType("NowPlayingSavePane",GOTUIT.PVS.NowPlayingSavePane);GOTUIT.PVS.registerComponentType("TabbedNowPlayingSavePane",GOTUIT.PVS.TabbedNowPlayingSavePane);GOTUIT.PVS.ShareURLBox=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(A,F,G,D,B){GOTUIT.PVS.Component.prototype.initialize.call(this,A,F,G,D,B);this.oContent=null;var C=this.getAttribute(this._getLabelAttribute(),"");var E=this.addElementByClass(this._getLabelAttribute(),null,"label",["Label"],C);this.eShareBox=GOTUIT.DOM.create("input",{type:"text",readonly:"true",className:"ShareURLBox "+this._getBoxButtonClass});GOTUIT.Event.observe(this.eShareBox,"click",GOTUIT.Function.bindCall(this._onBoxClick,this));F.appendChild(this.eShareBox);this.pvs.addListener(GOTUIT.PVS.EVENT.PLAY_STARTED,this.onPVSPlayStarted,this)},_getLabelAttribute:function(){return"ShareLabel"},_getBoxButtonClass:function(){return"Share"},setContent:function(A){this.oContent=A;this.eShareBox.value=this.pvs.Content.getShareURL(this.oContent)},_onBoxClick:function(){try{this.eShareBox.focus();this.eShareBox.select()}catch(A){}},_setEventShareURL:function(A){if(this.oContent==null){this.eShareBox.value=this.pvs.Content.getShareURL(A)}},_onClickedCopy:function(){this.pvs.Util.setClipboard(this.eShareBox.value)},onPVSPlayStarted:function(C,A,D){if(this.oContent==null){var B=(D.getIsRemix())?D:C;this._setEventShareURL(B)}}});GOTUIT.PVS.SharePlaylistURLBox=GOTUIT.Class.extend(GOTUIT.PVS.ShareURLBox,{initialize:function(A,D,E,C,B){GOTUIT.PVS.ShareURLBox.prototype.initialize.call(this,A,D,E,C,B)},_getLabelAttribute:function(){return"SharePlaylistLabel"},_getBoxButtonClass:function(){return"SharePlaylist"},onPVSPlayStarted:function(B,A,C){this._setEventShareURL(A)}});GOTUIT.PVS.ShareSegmentURLBox=GOTUIT.Class.extend(GOTUIT.PVS.ShareURLBox,{initialize:function(A,D,E,C,B){GOTUIT.PVS.ShareURLBox.prototype.initialize.call(this,A,D,E,C,B)},_getLabelAttribute:function(){return"ShareSegmentLabel"},_getBoxButtonClass:function(){return"ShareSegment"},onPVSPlayStarted:function(B,A,C){this._setEventShareURL(B)}});GOTUIT.PVS.SharePanelButton=GOTUIT.Class.extend(GOTUIT.PVS.ButtonLabel,{initialize:function(A,C,D,B){GOTUIT.PVS.ButtonLabel.prototype.initialize.call(this,A,C,D,B);this.setMouseClickEvent("Clicked");this.addListener("Clicked",this._onClicked,this)},_onClicked:function(){this.pvs.Player.activateSharePanel()}});GOTUIT.PVS.ShareButtons=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(A,D,E,C,B){GOTUIT.PVS.Component.prototype.initialize.call(this,A,D,E,C,B);this.eButtonHolder=this.addElementByClass("ShareButtonHolder");this.aShareNodes=this.getConfigNodes("shareButton");GOTUIT.DOM.hide(this.eButtonHolder);this.pvs.addListener(GOTUIT.PVS.EVENT.PLAYBLOCK_STARTED,this._onPlayBlockStarted,this);this.pvs.addListener(GOTUIT.PVS.EVENT.PLAY_STARTED,this._onPlayStarted,this)},_onPlayBlockStarted:function(B,A){if(B.getIsRemix()){this._loadButtons(B)}},_onPlayStarted:function(B,A,D,C){if(!D.getIsRemix()){this._loadButtons(B)}GOTUIT.DOM.show(this.eButtonHolder)},_loadButtons:function(F){GOTUIT.DOM.update(this.eButtonHolder,"");if(this.pvs.Content.hasShareURL(F)){var C=this.pvs.Content.getShareURL(F);var E,I,G,H,B,D,A;for(var J=0;J<this.aShareNodes.length;J++){E=this.getConfigNodeValue(this.aShareNodes[J],"class");I=this.getConfigNodeValue(this.aShareNodes[J],"url");G=this.getConfigNodeValue(this.aShareNodes[J],"image");H=GOTUIT.DOM.create("div",{className:"ShareLinkButton "+E});B=I+escape(C);D=GOTUIT.DOM.create("a",{href:B,target:"_new"});A=GOTUIT.DOM.create("img",{src:G});D.appendChild(A);H.appendChild(D);this.eButtonHolder.appendChild(H)}}}});GOTUIT.PVS.registerComponentType("ShareURLBox",GOTUIT.PVS.ShareURLBox);GOTUIT.PVS.registerComponentType("SharePlaylistURLBox",GOTUIT.PVS.SharePlaylistURLBox);GOTUIT.PVS.registerComponentType("ShareSegmentURLBox",GOTUIT.PVS.ShareSegmentURLBox);GOTUIT.PVS.registerComponentType("SharePanelButton",GOTUIT.PVS.SharePanelButton);GOTUIT.PVS.registerComponentType("ShareButtons",GOTUIT.PVS.ShareButtons);GOTUIT.PVS.EmailAFriendBox=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(C,F,A,H){GOTUIT.PVS.Component.prototype.initialize.call(this,C,F,A,H);var K=this.getAttribute("Your_Name_Label","Your name:");var J=this.getAttribute("Your_Email_Label","Your email:");var D=this.getAttribute("Friend_Email_Label","Friend's email:");this.sFillInFields=this.getAttribute("Missing_Fields","Please fill out all fields");this.sInvalidEmails=this.getAttribute("Invalid_Email","Invalid email address entered");this.sEmailSent=this.getAttribute("EmailSent","Email sent");this.sMessage=this.getAttribute("EmailMessage","Check out this video!");var L=this.addElementByClass("Forms");var B=this.addElementByClass("YourName",null,null,["InputHolder"]);var G=this.addElementByClass("YourNameLabel",B,"label",["InputTitle"],K);this.eYourNameBox=this.addElementByClass("YourName",B,"textbox");L.appendChild(B);var M=this.addElementByClass("YourEmail",null,null,["InputHolder"]);var I=this.addElementByClass("YourEmailLabel",M,"label",["InputTitle"],J);this.eYourEmailBox=this.addElementByClass("YourEmail",M,"textbox");L.appendChild(M);var O=this.addElementByClass("FriendEmail",null,null,["InputHolder"]);var N=this.addElementByClass("FriendEmailLabel",O,"label",["InputTitle"],D);this.eFriendEmailBox=this.addElementByClass("FriendEmail",O,"textbox");L.appendChild(O);F.appendChild(L);var E=this.addElementByClass("SendButton");this.oSendButton=new GOTUIT.PVS.Button("SendButton",{},{},E);this.oSendButton.setTarget(this);this.oSendButton.setMouseClickEvent("ClickedSend");this.addListener("ClickedSend",this._onClickedSend,this);this.eStatus=this.addElementByClass("StatusMsg");this.oContent=null;this.oOverrideContent=null;this.pvs.addListener(GOTUIT.PVS.EVENT.PLAY_STARTED,this._onPlayStarted,this);this._setSendButtonState()},reset:function(){this.eYourNameBox.value="";this.eYourEmailBox.value="";this.eFriendEmailBox.value="";this._setStatus("")},_setStatus:function(B,A){if(A){GOTUIT.DOM.addClass(this.eStatus,"Error")}else{GOTUIT.DOM.removeClass(this.eStatus,"Error")}GOTUIT.DOM.update(this.eStatus,B)},setContent:function(A){this.oOverrideContent=A;this._setSendButtonState()},_setEventContent:function(A){this.oContent=A;this._setSendButtonState()},_setSendButtonState:function(){this.oSendButton.setDisabled(this.oOverrideContent==null&&this.oContent==null)},_onClickedSend:function(){var A=this.eYourNameBox.value;var E=this.eYourEmailBox.value;var D=this.eFriendEmailBox.value;var C=this.sMessage;if(this.pvs.Util.isNotEmpty(A)&&this.pvs.Util.isNotEmpty(E)&&this.pvs.Util.isNotEmpty(D)){if(this.pvs.Util.isValidEmail(E)&&this.pvs.Util.isValidEmail(D)){var B=(this.oOverrideContent!=null)?this.oOverrideContent:this.oContent;this.pvs.Content.shareWithFriend(B,A,E,D,C);this.reset();this._setStatus(this.sEmailSent)}else{this._setStatus(this.sInvalidEmails,true)}}else{this._setStatus(this.sFillInFields,true)}},_onPlayStarted:function(C,A,D){var B=(D.getIsRemix())?D:C;this._setEventContent(B)}});GOTUIT.PVS.registerComponentType("EmailAFriendBox",GOTUIT.PVS.EmailAFriendBox);GOTUIT.PVS.EmailAFriendRadioPlaylistSegmentBox=GOTUIT.Class.extend(GOTUIT.PVS.EmailAFriendBox,{initialize:function(D,E,C,G){GOTUIT.PVS.EmailAFriendBox.prototype.initialize.call(this,D,E,C,G);this.OPTION_PLAYLIST="Playlist";this.OPTION_SEGMENT="Segment";var H=this.getAttribute("Playlist_Label","Playlist/Remix");var B=this.getAttribute("Segment_Label","Segment/Scene");var A=this.addElementByClass("RadioOptions");this.ePlaylistOption=GOTUIT.DOM.create("input",{type:"radio",name:"EAFRPSB_Type",className:"Option OptionPlaylist",value:this.OPTION_PLAYLIST});A.appendChild(this.ePlaylistOption);var F=this.addElementByClass("PlaylistLabel",A);GOTUIT.DOM.update(F,H);A.appendChild(F);this.eSegmentOption=GOTUIT.DOM.create("input",{type:"radio",name:"EAFRPSB_Type",className:"Option OptionSegment",value:this.OPTION_SEGMENT,checked:"checked"});A.appendChild(this.eSegmentOption);var I=this.addElementByClass("SegmentLabel",A);GOTUIT.DOM.update(I,B);A.appendChild(I);E.appendChild(A)},_onClickedSend:function(){if(this.pvs.Player.isPlayingContent()){if(this.ePlaylistOption.checked){this.setContent(this.pvs.Player.getCurrentPlaylist())}else{this.setContent(this.pvs.Player.getCurrentSegment())}GOTUIT.PVS.EmailAFriendBox.prototype._onClickedSend.call(this)}}});GOTUIT.PVS.registerComponentType("EmailAFriendRadioPlaylistSegmentBox",GOTUIT.PVS.EmailAFriendRadioPlaylistSegmentBox);GOTUIT.PVS.TabbedEmailShareBox=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(C,G,B,H){GOTUIT.PVS.Component.prototype.initialize.call(this,C,G,B,H);var D=this.addElementByClass("EmailShareTabs");this.oTabs=new GOTUIT.PVS.TabComponent(C,D,"TabComponent",this.getName()+"_TabComponent");var A=this.addElementByClass("EmailTab",D);var F=new GOTUIT.PVS.ShareBoxEmailTab(C,A,"ShareBoxEmailTab",this.getName()+"_ShareBoxEmailTab",this);this.oTabs.addTab(F);var I=this.addElementByClass("ShareTab",D);var E=new GOTUIT.PVS.ShareBoxShareTab(C,I,"ShareBoxShareTab",this.getName()+"_ShareBoxShareTab",this);this.oTabs.addTab(E)}});GOTUIT.PVS.ShareBoxEmailTab=GOTUIT.Class.extend(GOTUIT.PVS.Tab,{initialize:function(A,E,F,D,B){GOTUIT.PVS.Tab.prototype.initialize.call(this,A,E,F,D,B);var C=new GOTUIT.PVS.EmailAFriendRadioPlaylistSegmentBox(this.pvs,this.eContents,"EmailAFriendRadioPlaylistSegmentBox",this.getName()+"_EmailAFriendRadioPlaylistSegmentBox",B)}});GOTUIT.PVS.ShareBoxShareTab=GOTUIT.Class.extend(GOTUIT.PVS.Tab,{initialize:function(E,G,B,I,L){GOTUIT.PVS.Tab.prototype.initialize.call(this,E,G,B,I,L);var M=this.addElementByClass("SharePlaylist",this.eContents);var A=new GOTUIT.PVS.SharePlaylistURLBox(this.pvs,M,"SharePlaylistURLBox",this.getName()+"_SharePlaylistURLBox",L);var O=this.addElementByClass("EmbedPlaylist",this.eContents);var C=new GOTUIT.PVS.EmbedPlaylistCodeBox(this.pvs,O,"EmbedPlaylistCodeBox",this.getName()+"_EmbedPlaylistCodeBox",L);var F=this.addElementByClass("ShareSegment",this.eContents);var K=new GOTUIT.PVS.ShareSegmentURLBox(this.pvs,F,"ShareSegmentURLBox",this.getName()+"_ShareSegmentURLBox",L);var J=this.addElementByClass("EmbedSegment",this.eContents);var N=new GOTUIT.PVS.EmbedSegmentCodeBox(this.pvs,J,"EmbedSegmentCodeBox",this.getName()+"_EmbedSegmentCodeBox",L);var D=this.addElementByClass("ShareButtons",this.eContents);var H=new GOTUIT.PVS.ShareButtons(this.pvs,D,"ShareButtons",this.getName()+"_ShareButtons",L)}});GOTUIT.PVS.registerComponentType("TabbedEmailShareBox",GOTUIT.PVS.TabbedEmailShareBox);GOTUIT.PVS.AbstractUIRater=GOTUIT.Class.extend(GOTUIT.PVS.UIContent,{initialize:function(C,A,B){GOTUIT.PVS.UIContent.prototype.initialize.call(this,C,A,B);this.MAX_SCORE=B},draw:function(B,A){}});GOTUIT.PVS.ButtonUIRater=GOTUIT.Class.extend(GOTUIT.PVS.AbstractUIRater,{initialize:function(B,E,D,H){GOTUIT.PVS.AbstractUIRater.prototype.initialize.call(this,{},B,D);if(!B){B=GOTUIT.DOM.create("div")}GOTUIT.DOM.addClass(B,["Rater",H]);this.eRater=B;this.aButtons=[];var G,C,F;for(var A=0;A<E;A++){G="RateButton";C=GOTUIT.DOM.create("div",{className:G});F=new GOTUIT.PVS.Button(G,{index:A},{},C);F.setMouseOverEvent("MouseOverRateButton");F.setMouseOutEvent("MouseOutRateButton");F.setMouseClickEvent("ClickedRateButton");this.eRater.appendChild(C);this.aButtons.push(F)}},setTarget:function(B){var C;for(var A=0;A<this.getNumButtons();A++){C=this.aButtons[A];C.setTarget(B)}},getNumButtons:function(){return this.aButtons.length},draw:function(F,C,E){var D=this.MAX_SCORE/this.getNumButtons();var H=Math.ceil(F/D);if((C||E>0)&&H==0){H=1}var G,B;for(var A=0;A<this.getNumButtons();A++){G=this.aButtons[A];B=G.getButton();GOTUIT.DOM.removeClass(B,["RateButton_Active","RateButton_Active_User"]);if(A<H){if(C){GOTUIT.DOM.addClass(B,"RateButton_Active_User")}else{GOTUIT.DOM.addClass(B,"RateButton_Active")}}}},_onClickedRateButton:function(){},destroy:function($super){for(var A=0;A<this.getNumButtons();A++){this.aButtons[A].destroy()}$super()}});GOTUIT.PVS.AbstractRater=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(A,C,D,B){GOTUIT.PVS.Component.prototype.initialize.call(this,A,C,D,B);this.MAX_SCORE=100;this.timerDraw=null;this._reset()},_reset:function(){this.oContent=null;this.bHasRating=false;this.nRating=0;this.bHasSessionRating=false;this.nSessionRating=0;this.bHasTempRating=false;this.nTempRating=0;this.nRatingCount=0},setContent:function(A){this.oContent=A;if(this.oContent!=null){if(this.oContent.getCanRate()){this.bHasRating=this.oContent.getHasRating();this.nRating=this.oContent.getRating();this.bHasSessionRating=this.oContent.getHasSessionRating();this.nSessionRating=this.oContent.getSessionRating();this.nRatingCount=this.oContent.getRatingCount();this._draw();return }}this._reset();this._draw()},_draw:function(){clearTimeout(this.timerDraw);this.timerDraw=setTimeout(this._handleDraw.bind(this),50)},_handleDraw:function(){clearTimeout(this.timerDraw);if(this.oRater){var B=0;if(this.bHasTempRating){B=this.nTempRating}else{if(this.bHasSessionRating){B=this.nSessionRating}else{if(this.bHasRating){B=this.nRating}}}var A=(this.bHasTempRating||this.bHasSessionRating);this.oRater.draw(B,A,this.nRatingCount)}},_rate:function(){if(this.oContent!=null&&this.bHasSessionRating){this.pvs.Content.rate(this.oContent,this.nSessionRating)}}});GOTUIT.PVS.ButtonRater=GOTUIT.Class.extend(GOTUIT.PVS.AbstractRater,{initialize:function(B,E,F,D,C,A){GOTUIT.PVS.AbstractRater.prototype.initialize.call(this,B,E,F,D);if(C==null){C=5}this.nNumButtons=C;if(A==null){A=false}this.bReadOnly=A;this.oRater=new GOTUIT.PVS.ButtonUIRater(E,C,this.MAX_SCORE,D);this.oRater.setTarget(this);if(!this.bReadOnly){this.addListener("MouseOverRateButton",this._onMouseOverRateButton,this);this.addListener("MouseOutRateButton",this._onMouseOutRateButton,this);this.addListener("ClickedRateButton",this._onClickedRateButton,this)}},_onMouseOverRateButton:function(A){if(!this.bReadOnly){this.bHasTempRating=true;this.nTempRating=((A.index+1)*this.MAX_SCORE)/this.nNumButtons;this._draw()}},_onMouseOutRateButton:function(A){if(!this.bReadOnly){this.bHasTempRating=false;this.nTempRating=0;this._draw()}},_onClickedRateButton:function(A){if(!this.bReadOnly){this.bHasSessionRating=true;this.nSessionRating=(this.MAX_SCORE/(this.nNumButtons-1))*A.index;this._draw();this._rate()}}});GOTUIT.PVS.registerComponentType("ButtonRater",GOTUIT.PVS.ButtonRater);GOTUIT.PVS.RemixControls=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(A,C,D,B){GOTUIT.PVS.Component.prototype.initialize.call(this,A,C,D,B);this.oNewRemixButton=this._addSubButton("NewRemixButton","RemixNew");this.oSaveRemixButton=this._addSubButton("SaveRemixButton","RemixSave");this.oShareRemixButton=this._addSubButton("ShareRemixButton","RemixShare");this.oPlayRemixButton=this._addSubButton("PlayRemixButton","RemixPlay");this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_STATUS_SUCCESS,this._onRemixStatusSuccess,this);this.addListener("RemixNew",this._onClickedNewRemix,this);this.addListener("RemixSave",this._onClickedSaveRemix,this);this.addListener("RemixShare",this._onClickedShareRemix,this);this.addListener("RemixPlay",this._onClickedPlayRemix,this)},_addSubButton:function(A,C){var D=GOTUIT.DOM.create("div",{className:"Button "+A});var B=new GOTUIT.PVS.Button(A,{},{},D);B.setTarget(this);B.setMouseClickEvent(C);this.eComponent.appendChild(D);return B},_onClickedNewRemix:function(){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_CREATE)},_onClickedSaveRemix:function(){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_SHOW_DIALOG)},_onClickedShareRemix:function(){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_SHARE_SHOW_DIALOG)},_onClickedPlayRemix:function(){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_PREVIEW)},_onRemixStatusSuccess:function(A){this.oSaveRemixButton.setDisabled(!this.pvs.Remix.Current.canSave());this.oShareRemixButton.setDisabled(!this.pvs.Remix.Current.canShare());this.oPlayRemixButton.setDisabled(!this.pvs.Remix.Current.canPreview())}});GOTUIT.PVS.RemixSaveControls=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(F,G,E,J){GOTUIT.PVS.Component.prototype.initialize.call(this,F,G,E,J);var L=this.addElementByClass("Forms");var K=this.addElementByClass("Name",L);var D=this.getAttribute("NameLabel","Name:");var I=this.addElementByClass("InputTitle",K);GOTUIT.DOM.update(I,D);this.eTitleBox=GOTUIT.DOM.create("input",{type:"text",className:"Name"});K.appendChild(this.eTitleBox);var C=this.addElementByClass("Description",L);var N=this.getAttribute("DescriptionLabel","Description:");var B=this.addElementByClass("InputTitle",C);GOTUIT.DOM.update(B,N);this.eDescBox=GOTUIT.DOM.create("input",{type:"text",className:"Description"});C.appendChild(this.eDescBox);var H=this.addElementByClass("Tags",L);var M=this.getAttribute("TagsLabel","Tags:");var A=this.addElementByClass("InputTitle",H);GOTUIT.DOM.update(A,M);this.eTagsBox=GOTUIT.DOM.create("input",{type:"text",className:"Tags"});H.appendChild(this.eTagsBox);this.eComponent.appendChild(L);var O=this.addElementByClass("Buttons");this.oSaveButton=this._addSubButton("SaveRemixButton","RemixSave",O);this.oCancelButton=this._addSubButton("CancelSaveRemixButton","RemixSaveCancel",O);this.eComponent.appendChild(O);this.eStatus=this.addElementByClass("StatusMsg");this.sSavingMsg=this.getAttribute("Message_Saving","");this.sSaveCompleteMsg=this.getAttribute("Message_Save_Complete","Save complete");this.sSaveErrorRemixEmpty=this.getAttribute("Message_Error_Remix_Empty","Your remix is empty");this.sSaveErrorRemixMetadata=this.getAttribute("Message_Error_Invalid_Metadata","Please fill out all fields");this.sSaveErrorProfaneMetadata=this.getAttribute("Message_Error_Profane_Metadata",'Offensive language cannot be saved.  Please edit "#{Profanity}" and save again.');this.sSaveErrorNotLoggedIn=this.getAttribute("Message_Error_Not_Logged_In","Must be logged in to save");this.sSaveErrorTechnical=this.getAttribute("Message_Error_Technical","Unable to save at this time");this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_SHOW_DIALOG,this._onPVSCurrentRemixSaveShowDialog,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_SUCCESS,this._onPVSCurrentRemixSaveSuccess,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_ERROR,this._onPVSCurrentRemixSaveError,this);this.pvs.addListener(GOTUIT.PVS.EVENT.LOGIN_REQUEST,this._onLoginRequest,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_PROMPT_OVERWRITE_CANCEL,this._onSavePromptOverwriteCancel,this);this.addListener("RemixSave",this._onClickedSave,this);this.addListener("RemixSaveCancel",this._onClickedSaveCancel,this)},_addSubButton:function(A,C,D){var E=GOTUIT.DOM.create("div",{className:"Button "+A});var B=new GOTUIT.PVS.Button(A,{},{},E);B.setTarget(this);B.setMouseClickEvent(C);D.appendChild(E);return B},_reset:function(){this.eTitleBox.value="";this.eDescBox.value="";this.eTagsBox.value="";this._setStatus("")},_disableButtons:function(){this.oSaveButton.setDisabled(true);this.oCancelButton.setDisabled(true)},_enableButtons:function(){this.oSaveButton.setDisabled(false);this.oCancelButton.setDisabled(false)},_setStatus:function(B,A){if(A){GOTUIT.DOM.addClass(this.eStatus,"Error")}else{GOTUIT.DOM.removeClass(this.eStatus,"Error")}GOTUIT.DOM.update(this.eStatus,B)},_onClickedSave:function(){this._setStatus(this.sSavingMsg,false);this._disableButtons();var B=this;var A={onSuccess:function(C){B.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE)},onError:function(C,D){B.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE)}};this.pvs.Remix.Current.updateMetadata(this.eTitleBox.value,this.eDescBox.value,this.eTagsBox.value,A)},_onClickedSaveCancel:function(){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_CANCEL);this._reset()},_onPVSCurrentRemixSaveShowDialog:function(){this._reset();this.eTitleBox.value=this.pvs.Remix.Current.getName();this.eDescBox.value=this.pvs.Remix.Current.getDescription();this.eTagsBox.value=this.pvs.Remix.Current.getTags()},_onPVSCurrentRemixSaveSuccess:function(){this._enableButtons();this._setStatus(this.sSaveCompleteMsg,false)},_onPVSCurrentRemixSaveError:function(B,C){this._enableButtons();switch(B){case"RemixIsEmpty":this._setStatus(this.sSaveErrorRemixEmpty,true);break;case"InvalidMetadata":this._setStatus(this.sSaveErrorRemixMetadata,true);break;case"ProfaneMetadata":var A=this.sSaveErrorProfaneMetadata.replace("#{Profanity}",C);this._setStatus(A,true);break;case"NotLoggedIn":this._setStatus(this.sSaveErrorNotLoggedIn,true);break;default:this._setStatus(this.sSaveErrorTechnical,true);break}},_onLoginRequest:function(){this._enableButtons()},_onSavePromptOverwriteCancel:function(){this._enableButtons()}});GOTUIT.PVS.RemixOverwriteModalBox=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(A,C,D,B){GOTUIT.PVS.Component.prototype.initialize.call(this,A,C,D,B);this.sOverwriteBoxURL=this.getAttribute("OverwriteBoxURL","./html/box_Overwrite.html");this.sDefaultOverwriteTitle=this.getAttribute("DefaultOverwriteTitle","Replace remix?");this.sDefaultOverwriteMessage=this.getAttribute("DefaultOverwriteMessage","You already have a remix with that name - replace it?");this.oFilter=null;GOTUIT.PVS.pushEventFilter("PVS",GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_PROMPT_OVERWRITE,this._onRemixSavePromptOverwrite.bind(this));this.addListener("Replace",this._onClickedReplace,this);this.addListener("Cancel",this._onClickedCancel,this)},_onRemixSavePromptOverwrite:function(A){this.oFilter=A;this._onModalBoxShow();Modalbox.show(this.sOverwriteBoxURL,{title:this.sDefaultOverwriteTitle,width:325,height:280,inactiveFade:false,afterLoad:GOTUIT.Function.bindCall(this._onBoxLoaded,this),beforeHide:GOTUIT.Function.bindCall(this._onBoxBeforeHide,this),afterHide:GOTUIT.Function.bindCall(this._onModalBoxHide,this)})},_onBoxLoaded:function(){GOTUIT.DOM.update("RemixOverwriteBoxInstructions",this.sDefaultOverwriteMessage);this.oReplaceButton=new GOTUIT.PVS.Button("RemixOverwriteReplaceButton",null,{},GOTUIT.DOM.get("RemixOverwriteReplaceButton"));this.oReplaceButton.setTarget(this);this.oReplaceButton.setMouseClickEvent("Replace");this.oCancelButton=new GOTUIT.PVS.Button("RemixOverwriteCancelButton",null,{},GOTUIT.DOM.get("RemixOverwriteCancelButton"));this.oCancelButton.setTarget(this);this.oCancelButton.setMouseClickEvent("Cancel")},_onBoxBeforeHide:function(){if(this.oReplaceButton){this.oReplaceButton.destroy();this.oReplaceButton=null}if(this.oCancelButton){this.oCancelButton.destroy();this.oCancelButton=null}this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_SAVE_PROMPT_OVERWRITE_CANCEL)},_onClickedReplace:function(){if(this.oFilter!=null){this.oFilter.next();this.oFilter=null}Modalbox.hide()},_onClickedCancel:function(){Modalbox.hide()},_onModalBoxShow:function(){GOTUIT.PVS.hideVideoPlayer()},_onModalBoxHide:function(){GOTUIT.PVS.showVideoPlayer()}});GOTUIT.PVS.RemixShareControls=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(E,H,C,I){GOTUIT.PVS.Component.prototype.initialize.call(this,E,H,C,I);var G=this.addElementByClass("ShareEmbedBoxes");var B=this.addElementByClass("ShareURLBox",G);var L=this.getAttribute("ShareLabel","Share:");var K=this.addElementByClass("InputTitle",B);GOTUIT.DOM.update(K,L);this.oShareBox=new GOTUIT.PVS.ShareURLBox(this.pvs,B,"ShareURLBox",I+"_ShareURLBox");var A=this.addElementByClass("EmbedCodeBox",G);var J=this.getAttribute("EmbedLabel","Embed:");var F=this.addElementByClass("InputTitle",A);GOTUIT.DOM.update(F,J);this.oEmbedBox=new GOTUIT.PVS.EmbedCodeBox(this.pvs,A,"EmbedCodeBox",I+"_EmbedCodeBox");var D=this.addElementByClass("EmailAFriend");this.oEmailFriend=new GOTUIT.PVS.EmailAFriendBox(this.pvs,D,"EmailAFriendBox",I+"_EmailAFriendBox");this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_SHARE_SHOW_DIALOG,this._onRemixShowShareDialog,this)},_onRemixShowShareDialog:function(){var A=this.pvs.Remix.Current.getRemixContent();this.oShareBox.setContent(A);this.oEmbedBox.setContent(A);this.oEmailFriend.setContent(A);this.oEmailFriend.reset()}});GOTUIT.PVS.registerComponentType("RemixControls",GOTUIT.PVS.RemixControls);GOTUIT.PVS.registerComponentType("RemixSaveControls",GOTUIT.PVS.RemixSaveControls);GOTUIT.PVS.registerComponentType("RemixOverwriteModalBox",GOTUIT.PVS.RemixOverwriteModalBox);GOTUIT.PVS.registerComponentType("RemixShareControls",GOTUIT.PVS.RemixShareControls);GOTUIT.PVS.RemixStoryboard=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(G,H,E,I){GOTUIT.PVS.Component.prototype.initialize.call(this,G,H,E,I);this.bInit=true;this.aButtons=[];this.aDraggables=[];this.aDroppables=[];this.intervalScroll=null;this.aVolumeSettings=[];this.aVolumeSettings[0]=[this.getAttribute("LowVolumeText","Low"),this.getAttribute("LowVolume","20")];this.aVolumeSettings[1]=[this.getAttribute("MediumVolumeText","Medium"),this.getAttribute("MediumVolume","50")];this.aVolumeSettings[2]=[this.getAttribute("HighVolumeText","High"),this.getAttribute("HighVolume","75")];this.aVolumeSettings[3]=[this.getAttribute("MaxVolumeText","Max"),this.getAttribute("MaxVolume","100")];var D=this.addElementByClass("Metadata");var M=this.addElementByClass("Title",D);this.oTitleLabel=new GOTUIT.PVS.Label(this.pvs,M,"Label","RemixTitleLabel");this.sEmptyTitlePlaceholder=this.getAttribute("EmptyTitlePlaceholder","");var C=this.addElementByClass("Description",D);this.oDescLabel=new GOTUIT.PVS.Label(this.pvs,C,"Label","RemixDescLabel");this.sEmptyDescPlaceholder=this.getAttribute("EmtpyDescriptionPlaceholder","");var A=this.addElementByClass("Tags",D);this.oTagsLabel=new GOTUIT.PVS.Label(this.pvs,A,"Label","RemixTagsLabel");this.sEmptyTagsPlaceholder=this.getAttribute("EmtpyTagsPlaceholder","");this.eDurationsLabel=this.addElementByClass("RemixDurations",D);var Q=this.addElementByClass("Prefix",this.eDurationsLabel,"span",null,this.getAttribute("RemixDurationPrefix","Length: "));var L=this.addElementByClass("RemixDuration",this.eDurationsLabel,"span");this.oDurationLabel=new GOTUIT.PVS.Label(this.pvs,L,"Label","RemixDurationLabel");var F=this.addElementByClass("Link",this.eDurationsLabel,"span",null,this.getAttribute("RemixDurationLinkText"," of "));var O=this.addElementByClass("MaxRemixDuration",this.eDurationsLabel,"span");this.oMaxDurationLabel=new GOTUIT.PVS.Label(this.pvs,O,"Label","MaxRemixDurationLabel");GOTUIT.DOM.hide(this.eDurationsLabel);this.sAudioTrackPlaylist=this.getAttribute("AudioTrackPlaylist");this.eAudioTrack=this.addElementByClass("AudioTrack");this.aAudioTracks=[];this.eDragLabel=GOTUIT.DOM.create("div",{className:"DragHereLabel"});GOTUIT.DOM.update(this.eDragLabel,this.getAttribute("DragHereLabel",""));GOTUIT.DOM.hide(this.eDragLabel);var B=GOTUIT.DOM.create("div",{className:"LeftScrollButton"});var P=new GOTUIT.PVS.Button("LeftScrollButton",{},{},B);P.setTarget(this);P.setMouseDownEvent("LeftMouseDown");this.addListener("LeftMouseDown",GOTUIT.Function.bindCall(this.eventScrollLeftPressed,this),this);P.setMouseUpEvent("LeftMouseUp");this.addListener("LeftMouseUp",GOTUIT.Function.bindCall(this.eventScrollLeftReleased,this),this);this.eButtonListHolder=GOTUIT.DOM.create("div",{className:"RemixButtonListHolder"});var N=GOTUIT.DOM.create("div",{className:"RightScrollButton"});var K=new GOTUIT.PVS.Button("RightScrollButton",{},{},N);K.setTarget(this);K.setMouseDownEvent("RightMouseDown");this.addListener("RightMouseDown",GOTUIT.Function.bindCall(this.eventRightScrollPressed,this),this);K.setMouseUpEvent("RightMouseUp");this.addListener("RightMouseUp",GOTUIT.Function.bindCall(this.eventRightScrollReleased,this),this);this.eButtonList=GOTUIT.DOM.create("div",{className:"ButtonList"});this.eButtonListHolder.appendChild(this.eButtonList);var J=GOTUIT.Function.bindCall(this.eventDroppedOnStoryboard,this);this.aDroppables[this.aDroppables.length]=GOTUIT.DOM.createDropTarget(this.eButtonListHolder,J,1,"RemixButtonListHolder_DropHover");this.eComponent.appendChild(B);this.eComponent.appendChild(this.eButtonListHolder);this.eComponent.appendChild(N);this.eButtonListHolder.appendChild(this.eDragLabel);this.nScrollDelay=this.getIntAttribute("ScrollDelay",50);this.nMaxLabelLength=this.getIntAttribute("MaxLabelLength",15);this.nButtonSpacing=this.getIntAttribute("ButtonSpacing",130);this.pvs.addListener(GOTUIT.PVS.EVENT.READY,this._onPVSReady,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_INIT_EVENT,this._onPVSRemixInitEvent,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_CREATE_SUCCESS,this._onPVSRemixCreateSuccess,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_EDIT_SUCCESS,this._onPVSRemixEditSuccess,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_ADD_SUCCESS,this._onPVSRemixAddSuccess,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_REMOVE_SUCCESS,this._onPVSRemixRemoveSuccess,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_MOVE_SUCCESS,this._onPVSRemixMoveSuccess,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_MOVE_ERROR,this._onPVSRemixMoveError,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_STATUS_SUCCESS,this._onPVSRemixStatusSuccess,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTREMIX_CLOSE_SUCCESS,this._onPVSRemixMoveError,this);this.addListener("Play",this.eventPlayButtonClick,this);this.addListener("Remove",this.eventRemoveButtonClick,this);this.addListener("Edit",this.eventEditButtonClick,this);this.addListener("Duplicate",this.eventDuplicateButtonClick,this)},_onPVSRemixInitEvent:function(B,A){if(!this.bInit){this.pvs.Remix.Current.sendRemixInit()}},_updateStatus:function(A){this._updateMetadata(A)},_updateMetadata:function(C){var A=(this.pvs.Util.isNotEmpty(C.Name))?C.Name:this.sEmptyTitlePlaceholder;this.oTitleLabel.setText(A);var B=(this.pvs.Util.isNotEmpty(C.Description))?C.Description:this.sEmptyDescPlaceholder;this.oDescLabel.setText(B);var D=(this.pvs.Util.isNotEmpty(C.Tags))?C.Tags:this.sEmptyTagsPlaceholder;this.oTagsLabel.setText(D)},addButtons:function(C,B){if(B==null){B=0}else{B=parseInt(B,10)}this.log("adding "+C.length+" buttons at index "+B);for(var A=0;A<C.length;A++){this.addButton(C[A],B+A)}this.resetSequence()},addButton:function(C,A){var D=GOTUIT.DOM.create("div",{className:"StoryboardButton"});D._SBIndex=A;var I=GOTUIT.DOM.create("div",{className:"Background"});D.appendChild(I);var E=new GOTUIT.PVS.UIContent(C,D);var H=this.pvs.Content.getPrimaryDetail(C);this.addLabel(H,"LabelPrimaryDetail",D);if(this.pvs.Content.hasDuration(C)){H=this.pvs.Util.secondsToHHMMSSFormat(this.pvs.Content.getDuration(C));this.addLabel(H,"LabelDuration",D)}var F=GOTUIT.DOM.create("div",{className:"Thumbnail"});var B;if(this.pvs.Content.hasThumbnailURL(C)){B=GOTUIT.DOM.create("img",{className:"Thumbnail",title:H,alt:H,src:this.pvs.Content.getThumbnailURL(C),onerror:"this.src='"+this.pvs.Content.getMissingThumbnailURL(C)+"'"})}else{B=GOTUIT.DOM.create("img",{className:"Thumbnail",title:H,alt:H,src:this.pvs.Content.getMissingThumbnailURL(C)})}B._SBIndex=A;F.appendChild(B);D.appendChild(F);var G=GOTUIT.DOM.create("div",{className:"SubButtons"});this.addSubButton("PlayButton","Play",E,G);this.addSubButton("RemoveButton","Remove",E,G);this.addSubButton("EditButton","Edit",E,G);this.addSubButton("DuplicateButton","Duplicate",E,G);D.appendChild(G);this.aButtons.splice(A,0,E);this.eButtonList.appendChild(D)},addLabel:function(C,B,A){if(C!=null){C=(C.length>this.nMaxLabelLength)?C.substring(0,this.nMaxLabelLength)+"...":C;var D=GOTUIT.DOM.create("div",{className:B});GOTUIT.DOM.update(D,C);A.appendChild(D)}},addSubButton:function(A,C,E,D){var F=GOTUIT.DOM.create("div",{className:"SubButton "+A});var B=new GOTUIT.PVS.Button(A,E,{},F);B.setTarget(this);B.setMouseClickEvent(C);E.addChildLink(B);D.appendChild(F)},clearButtons:function(){while(this.aButtons.length>0){this.removeButton(0,false)}this.resetSequence()},removeButton:function(A,C){if(C==null){C=true}if(this.getIsValidIndex(A)){var B=this.getButton(A);B.destroy();this.aButtons.splice(A,1);if(C){this.resetSequence()}}},moveButton:function(A,C){if(this.getIsValidIndex(A)&&this.getIsValidIndex(C)){var B=this.getButton(A);this.aButtons.splice(A,1);this.aButtons.splice(C,0,B);this.resetSequence()}else{this.logError("moveButton() invalid indexes")}},resetSequence:function(){var J;for(var H=0;H<this.aDraggables.length;H++){J=this.aDraggables[H];GOTUIT.DOM.destroyDraggable(J)}this.aDraggables=[];var K;for(var H=0;H<this.aDroppables.length;H++){K=this.aDroppables[H];GOTUIT.DOM.destroyDropTarget(K)}this.aDroppables=[];var G,C,I,D,A;for(var H=0;H<this.aButtons.length;H++){G=this.aButtons[H];G.setIndex(H);C=G.getContainer();GOTUIT.DOM.absolutize(C);this.aDraggables[this.aDraggables.length]=GOTUIT.DOM.createDraggable(C,"Thumbnail","horizontal");C._SBIndex=H;I=GOTUIT.DOM.getChildByClass(C,"Thumbnail");I=GOTUIT.DOM.getChildByClass(I,"Thumbnail");I._SBIndex=H;D=H*this.nButtonSpacing;GOTUIT.DOM.setStyles(C,{left:D+"px"});A=GOTUIT.Function.bindCall(this.eventDroppedOnStoryboardButton,this);this.aDroppables[this.aDroppables.length]=GOTUIT.DOM.createDropTarget(C,A,2,"StoryboardButton_DropHover")}var F=GOTUIT.Function.bindCall(this.eventDroppedOnStoryboard,this);this.aDroppables[this.aDroppables.length]=GOTUIT.DOM.createDropTarget(this.eButtonListHolder,F,1,"RemixButtonListHolder_DropHover");var E=null;if(this.aButtons.length>this.getNumVisibleButtons()){var M=parseInt(this.eButtonList.offsetLeft,10);var B=this.getMinScrollPosition();var L=this.getMaxScrollPosition();if(M>L){E=L}else{if(M<B){E=B}}}else{E=0}if(E!=null){GOTUIT.DOM.setStyles(this.eButtonList,{left:E+"px"})}},getMaxScrollPosition:function(){return 0},eventScrollLeftPressed:function(){clearInterval(this.intervalScroll);var B=parseInt(this.eButtonList.offsetLeft,10);var A=this.getMaxScrollPosition();if(B<A){this.intervalScroll=setInterval(GOTUIT.Function.bindCall(this.handleScrollLeft,this),this.nScrollDelay)}},handleScrollLeft:function(){var B=parseInt(this.eButtonList.offsetLeft,10);var A=this.getMaxScrollPosition();B+=(this.nButtonSpacing/3);if(B>A){B=A;clearInterval(this.intervalScroll)}GOTUIT.DOM.setStyles(this.eButtonList,{left:B+"px"})},eventScrollLeftReleased:function(){clearInterval(this.intervalScroll)},getMinScrollPosition:function(){var B=parseInt(this.eButtonListHolder.offsetWidth,10);var A=this.getButtonListWidth();return(B-A)},eventRightScrollPressed:function(){clearInterval(this.intervalScroll);var A=parseInt(this.eButtonList.offsetLeft,10);if(A>this.getMinScrollPosition()){this.intervalScroll=setInterval(GOTUIT.Function.bindCall(this.handleScrollRight,this),this.nScrollDelay)}},handleScrollRight:function(){var B=parseInt(this.eButtonList.offsetLeft,10);var A=this.getMinScrollPosition();B-=(this.nButtonSpacing/3);if(B<A){B=A;clearInterval(this.intervalScroll)}GOTUIT.DOM.setStyles(this.eButtonList,{left:B+"px"})},eventRightScrollReleased:function(){clearInterval(this.intervalScroll)},_getSBIndex:function(A){try{if(A._SBIndex!=null){return parseInt(A._SBIndex,10)}}catch(A){}return null},_getShareSignature:function(A){try{if(A.PVS_ShareSignature){return A.PVS_ShareSignature}}catch(A){}return null},eventDroppedOnStoryboard:function(B,C,D,H){try{var E=this._getSBIndex(B);if(E!=null){var G=this.aButtons.length-1;if(E!=G){this.pvs.Remix.Current.moveContent(E,G);return }}else{var A=this._getShareSignature(B);if(A!=null){if(!this._droppedAudioTrack(A)){this.log("adding content: "+A);this.pvs.Remix.Current.addContent(A);return }}}}catch(F){this.logError("eventDroppedOnStoryboard() "+F.message)}this.resetSequence()},eventDroppedOnStoryboardButton:function(C,D,E){try{var G=this._getSBIndex(C);var F=this._getSBIndex(D);var B=(G!=null&&F!=null)?true:false;if(B){this.pvs.Remix.Current.moveContent(G,F);return }else{var A=this._getShareSignature(C);if(A!=null&&F!=null){if(!this._droppedAudioTrack(A)){this.pvs.Remix.Current.addContent(C.PVS_ShareSignature,F);return }}}}catch(H){this.logError("eventDroppedOnStoryboardButton() "+H.message)}this.resetSequence()},_droppedAudioTrack:function(B){try{if(this.sAudioTrackPlaylist){var C=GOTUIT.URL.getParams(B);if(C.p==this.sAudioTrackPlaylist){for(var A=1;A<this.aAudioTracks.length;A++){if(C.s==this.aAudioTracks[A].segment){this.bSettingAudioTrack=true;this.eAudioTrackSelect.selectedIndex=this.aAudioTracks[A].pos;this.bSettingAudioTrack=false;this._updateTrack();return true}}}}}catch(D){}return false},_initAudioTracks:function(){if(this.sAudioTrackPlaylist){var B=this;var A={onSuccess:function(C){B._loadAudioTracks(C)},onError:function(C){B._onPVSAudioTracksLoaded()}};this.pvs.Content.get("p="+this.sAudioTrackPlaylist,A)}else{this._onPVSAudioTracksLoaded()}},_loadAudioTracks:function(B){var C=this;var A={onSuccess:function(F,E){if(F.length>0){C.eAudioTrackSelect=C.addElementByClass("AudioTrackSelect",C.eAudioTrack,"select");C.eAudioTrackSelect.options[0]=new Option(C.getAttribute("SceneAudioText","Scene Audio"),"scene");for(var D=0;D<F.length;D++){C._addTrack(F[D].sVideoFile,F[D].getPlaylist(),F[D].getID(),C.pvs.Content.getPrimaryDetail(F[D]))}C.eAudioTrackVolume=C.addElementByClass("AudioTrackVolumeSelect",C.eAudioTrack,"select");for(var D=0;D<C.aVolumeSettings.length;D++){C.eAudioTrackVolume.options[D]=new Option(C.aVolumeSettings[D][0],C.aVolumeSettings[D][1])}C.eAudioTrackVolume.selectedIndex=1;GOTUIT.Event.observeSelectionChanged(C.eAudioTrackSelect,GOTUIT.Function.bindCall(C._updateTrack,C));GOTUIT.Event.observeSelectionChanged(C.eAudioTrackVolume,GOTUIT.Function.bindCall(C._updateTrack,C));C._onPVSAudioTracksLoaded()}},onError:function(D){C._onPVSAudioTracksLoaded()}};this.pvs.Content.open(B,A)},_addTrack:function(D,E,C,B){var A=this.eAudioTrackSelect.options.length;this.aAudioTracks[A]={file:D,playlist:E,segment:C,pos:A};this.eAudioTrackSelect.options[A]=new Option(B,A)},_updateTrack:function(){try{if(!this.bSettingAudioTrack){var E=GOTUIT.Form.getSelectBoxValue(this.eAudioTrackSelect);if(E=="scene"){this.pvs.Remix.Current.clearAudioTrack();this._resetTrack()}else{var B=parseInt(E,10);if(this.aAudioTracks[B]!=null){GOTUIT.DOM.show(this.eAudioTrackVolume);var C=parseInt(GOTUIT.Form.getSelectBoxValue(this.eAudioTrackVolume),10);var A=this.aAudioTracks[B];this.pvs.Remix.Current.setAudioTrack(A.file,A.playlist,A.segment,C)}}}}catch(D){this.logError("_updateTrack() "+D.message)}},_resetTrack:function(){if(this.eAudioTrackSelect&&this.eAudioTrackVolume){this.bSettingAudioTrack=true;this.eAudioTrackSelect.selectedIndex=0;this.eAudioTrackVolume.selectedIndex=1;GOTUIT.DOM.hide(this.eAudioTrackVolume);this.bSettingAudioTrack=false}},_setTrack:function(){if(this.pvs.Remix.Current.hasAudioTrack()){var C=this.pvs.Remix.Current.getAudioTrackPlaylist();var B=this.pvs.Remix.Current.getAudioTrackSegment();for(var A=0;A<this.aAudioTracks.length;A++){if(this.aAudioTracks[A]!=null){if((this.aAudioTracks[A].playlist==C)&&(this.aAudioTracks[A].segment==B)){this.bSettingAudioTrack=true;this.eAudioTrackSelect.selectedIndex=A;this.bSettingAudioTrack=false;GOTUIT.DOM.show(this.eAudioTrackVolume);this._setVolume();return }}}}this._resetTrack()},_setVolume:function(){if(this.pvs.Remix.Current.hasAudioTrack()){var B=this.pvs.Remix.Current.getAudioTrackVolume();for(var A=0;A<this.aVolumeSettings.length;A++){if(B==parseInt(this.aVolumeSettings[A][1],10)){this.bSettingAudioTrack=true;this.eAudioTrackVolume.selectedIndex=A;this.bSettingAudioTrack=false;return }}}this.bSettingAudioTrack=true;this.eAudioTrackVolume.selectedIndex=1;this.bSettingAudioTrack=false},eventPlayButtonClick:function(A){this.pvs.sendEvent(GOTUIT.PVS.EVENT.PLAY,A.getContent(),{ProgressByBlock:true,PlaySegmentSiblings:false})},eventRemoveButtonClick:function(A){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_REMOVE,A.getIndex())},eventEditButtonClick:function(A){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_EDIT,A.getContent())},eventDuplicateButtonClick:function(A){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTREMIX_ADD,A.getContent(),A.getIndex())},_onPVSReady:function(){this._initAudioTracks()},_onPVSAudioTracksLoaded:function(){this.pvs.Remix.Current.create()},_onPVSRemixCreateSuccess:function(B,A){this.clearButtons();this.addButtons(B);this._resetTrack();this.hideShowDragLabel();this._updateDurationLabel();if(this.bInit){this.bInit=false;this.pvs.Remix.Current.sendRemixInit()}},_onPVSRemixEditSuccess:function(C,B,A){this.clearButtons();this.addButtons(C);this._setTrack();this.hideShowDragLabel();this._updateDurationLabel()},_onPVSRemixAddSuccess:function(C,A,B){this.addButtons(C,A);this.hideShowDragLabel();this._updateDurationLabel()},_onPVSRemixRemoveSuccess:function(A,B){this.removeButton(A);this.hideShowDragLabel();this._updateDurationLabel()},_onPVSRemixMoveSuccess:function(A,C,B){this.moveButton(A,C)},_onPVSRemixMoveError:function(A){this.resetSequence()},_onPVSRemixStatusSuccess:function(A){this._updateStatus(A)},_onPVSRemixCloseSuccess:function(A){this.clearButtons();this.hideShowDragLabel();this._updateDurationLabel()},getIsValidIndex:function(A){return(this.aButtons[A]!=null)},getButton:function(A){return this.aButtons[A]},getButtonListWidth:function(){return(this.aButtons.length+1)*this.nButtonSpacing},getNumVisibleButtons:function(){var A=parseInt(this.eButtonListHolder.offsetWidth,10);return Math.ceil(A/this.nButtonSpacing)},hideShowDragLabel:function(){if(this.aButtons.length==0){GOTUIT.DOM.show(this.eDragLabel)}else{GOTUIT.DOM.hide(this.eDragLabel)}},_updateDurationLabel:function(){if(this.pvs.Remix.Current.hasMaxDuration()){this.oDurationLabel.setText(this.pvs.Remix.Current.getDurationText());this.oMaxDurationLabel.setText(this.pvs.Remix.Current.getMaxDurationText());GOTUIT.DOM.show(this.eDurationsLabel)}}});GOTUIT.PVS.registerComponentType("RemixStoryboard",GOTUIT.PVS.RemixStoryboard);GOTUIT.PVS.SceneSaveControls=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(L,G,K,H){GOTUIT.PVS.Component.prototype.initialize.call(this,L,G,K,H);this.sInactiveImageURL=this.getAttribute("InactiveImage","");this.sLoadingImageURL=this.getAttribute("LoadingImage",null);var Q=this.addElementByClass("Thumbnail");this.eThumbnailImage=GOTUIT.DOM.create("img",{src:this.sInactiveImageURL,"class":"Thumbnail"});Q.appendChild(this.eThumbnailImage);this.eComponent.appendChild(Q);var N=this.addElementByClass("Forms");var J=this.addElementByClass("Name",N);var S=this.getAttribute("NameLabel","Name:");var C=this.addElementByClass("InputTitle",J);GOTUIT.DOM.update(C,S);this.eTitleBox=GOTUIT.DOM.create("input",{type:"text",className:"Name"});J.appendChild(this.eTitleBox);var F=this.addElementByClass("Description",N);var R=this.getAttribute("DescriptionLabel","Description:");var M=this.addElementByClass("InputTitle",F);GOTUIT.DOM.update(M,R);this.eDescBox=GOTUIT.DOM.create("input",{type:"text",className:"Description"});F.appendChild(this.eDescBox);var B=this.addElementByClass("Tags",N);var I=this.getAttribute("TagsLabel","Tags:");var D=this.addElementByClass("InputTitle",B);GOTUIT.DOM.update(D,I);this.eTagsBox=GOTUIT.DOM.create("input",{type:"text",className:"Tags"});B.appendChild(this.eTagsBox);this.eComponent.appendChild(N);var E=this.addElementByClass("TimeControls");this.eStart=this.addElementByClass("StartOffset",E);this.eStartOffset=GOTUIT.DOM.create("input",{type:"text",className:"StartOffset"});GOTUIT.Event.observe(this.eStartOffset,"keypress",GOTUIT.Function.bindCall(this._onStartSubmit,this));this.eStart.appendChild(this.eStartOffset);var A=GOTUIT.DOM.create("div",{className:"StartOffsetButtons"});this.oStartUp=this._addSubButton("StartUpButton","StartUp",A);this.oStartDown=this._addSubButton("StartDownButton","StartDown",A);this.eStart.appendChild(A);this.eEnd=this.addElementByClass("EndOffset",E);this.eEndOffset=GOTUIT.DOM.create("input",{type:"text",className:"EndOffset"});GOTUIT.Event.observe(this.eEndOffset,"keypress",GOTUIT.Function.bindCall(this._onEndSubmit,this));this.eEnd.appendChild(this.eEndOffset);var P=GOTUIT.DOM.create("div",{className:"EndOffsetButtons"});this.oEndUp=this._addSubButton("EndUpButton","EndUp",P);this.oEndDown=this._addSubButton("EndDownButton","EndDown",P);this.eEnd.appendChild(P);this.nTimeIncrement=this.getAttribute("TimeIncrement",0.5);var O=this.addElementByClass("Buttons");this.oSaveButton=this._addSubButton("SaveSceneButton","SceneSave",O);this.oCancelButton=this._addSubButton("CancelSaveSceneButton","SceneSaveCancel",O);this.oPreviewButton=this._addSubButton("PreviewSceneButton","ScenePreview",O);this.eStatus=this.addElementByClass("StatusMsg");this.sSavingMsg=this.getAttribute("Message_Saving","");this.sSaveCompleteMsg=this.getAttribute("Message_Save_Complete","Save complete");this.sSaveErrorInvalidThumbnail=this.getAttribute("Message_Error_Invalid_Thumbnail","Click the camera to snap a screenshot");this.sSaveErrorSceneMetadata=this.getAttribute("Message_Error_Invalid_Metadata","Please fill out all fields");this.sSaveErrorProfaneMetadata=this.getAttribute("Message_Error_Profane_Metadata",'Offensive language cannot be saved.  Please edit "#{Profanity}" and save again.');this.sSaveErrorInvalidOffsets=this.getAttribute("Message_Error_Invalid_Offsets","Must specify a start and end time");this.sSaveErrorNotLoggedIn=this.getAttribute("Message_Error_Not_Logged_In","Must be logged in to save");this.sSaveErrorTechnical=this.getAttribute("Message_Error_Technical","Unable to save at this time");this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_SAVE_SHOW_DIALOG,this._onSceneSaveShowDialog,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_SAVE_SUCCESS,this._onSceneSaveSuccess,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_SAVE_ERROR,this._onSceneSaveError,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_THUMBNAIL_LOADING,this._onSceneThumbnailLoading,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_THUMBNAIL_COMPLETE,this._onSceneThumbnailComplete,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_THUMBNAIL_ERROR,this._onSceneThumbnailError,this);this.pvs.addListener(GOTUIT.PVS.EVENT.CURRENTSCENE_OFFSETS_CHANGED,this._onSceneOffsetsChanged,this);this.pvs.addListener(GOTUIT.PVS.EVENT.LOGIN_REQUEST,this._onLoginRequest,this);this.addListener("StartUp",this._onClickedStartUp,this);this.addListener("StartDown",this._onClickedStartDown,this);this.addListener("EndUp",this._onClickedEndUp,this);this.addListener("EndDown",this._onClickedEndDown,this);this.addListener("SceneSave",this._onClickedSave,this);this.addListener("SceneSaveCancel",this._onClickedSaveCancel,this);this.addListener("ScenePreview",this._onClickedPreview,this)},_addSubButton:function(A,C,D){var E=GOTUIT.DOM.create("div",{className:"Button "+A});var B=new GOTUIT.PVS.Button(A,{},{},E);B.setTarget(this);B.setMouseClickEvent(C);D.appendChild(E);return B},_reset:function(){this.eTitleBox.value="";this.eDescBox.value="";this.eTagsBox.value="";this._setStatus("");this._resetThumbnail()},_setStatus:function(B,A){if(A){GOTUIT.DOM.addClass(this.eStatus,"Error")}else{GOTUIT.DOM.removeClass(this.eStatus,"Error")}GOTUIT.DOM.update(this.eStatus,B)},_disableButtons:function(){this.oSaveButton.setDisabled(true);this.oCancelButton.setDisabled(true);this.oPreviewButton.setDisabled(true)},_enableButtons:function(){this.oSaveButton.setDisabled(false);this.oCancelButton.setDisabled(false);this.oPreviewButton.setDisabled(false)},_resetThumbnail:function(){},_setThumbnailLoading:function(){if(this.sLoadingImageURL!=null){this.eThumbnailImage.src=this.sLoadingImageURL}},_setThumbnail:function(){if(this.pvs.Scene.Current.hasThumbnail()){this.eThumbnailImage.src=this.pvs.Scene.Current.getThumbnail()}else{if(this.pvs.Scene.Current.hasSourceMissingThumbnail()){this.eThumbnailImage.src=this.pvs.Scene.Current.getSourceMissingThumbnail()}else{this._resetThumbnail()}}},_setOffsets:function(){var A=this.pvs.Scene.Current.getStart();if(A!=-1){this.eStartOffset.value=this.pvs.Util.secondsToHHMMSSFormat(A,false,true,2);GOTUIT.DOM.show(this.eStart)}else{GOTUIT.DOM.hide(this.eStart)}var B=this.pvs.Scene.Current.getEnd();if(B!=-1){this.eEndOffset.value=this.pvs.Util.secondsToHHMMSSFormat(B,false,true,2);GOTUIT.DOM.show(this.eEnd)}else{GOTUIT.DOM.hide(this.eEnd)}},_onStartSubmit:function(B){if(B.keyCode==13){try{var A=this.pvs.Util.HHMMSSFormatToSeconds(this.eStartOffset.value);this._updateOffsets(A)}catch(B){}}},_onClickedStartUp:function(){try{var A=this.pvs.Util.HHMMSSFormatToSeconds(this.eStartOffset.value);this._updateOffsets(A+this.nTimeIncrement)}catch(B){}},_onClickedStartDown:function(){try{var A=this.pvs.Util.HHMMSSFormatToSeconds(this.eStartOffset.value);this._updateOffsets(A-this.nTimeIncrement)}catch(B){}},_onEndSubmit:function(B){if(B.keyCode==13){try{var A=this.pvs.Util.HHMMSSFormatToSeconds(this.eEndOffset.value);this._updateOffsets(null,A)}catch(B){}}},_onClickedEndUp:function(){try{var A=this.pvs.Util.HHMMSSFormatToSeconds(this.eEndOffset.value);this._updateOffsets(null,A+this.nTimeIncrement)}catch(B){}},_onClickedEndDown:function(){try{var A=this.pvs.Util.HHMMSSFormatToSeconds(this.eEndOffset.value);this._updateOffsets(null,A-this.nTimeIncrement)}catch(B){}},_updateOffsets:function(B,A){this.pvs.Scene.Current.updateOffsets(B,A)},_onClickedSave:function(){this._setStatus(this.sSavingMsg,false);this._disableButtons();var B=this;var A={onSuccess:function(C){B.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_SAVE)},onError:function(C){B.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_SAVE)}};this.pvs.Scene.Current.updateMetadata(this.eTitleBox.value,this.eDescBox.value,this.eTagsBox.value,A)},_onClickedSaveCancel:function(){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_CANCEL);this._reset()},_onClickedPreview:function(){this.pvs.sendEvent(GOTUIT.PVS.EVENT.CURRENTSCENE_PREVIEW)},_onSceneSaveShowDialog:function(){this._reset();this.eTitleBox.value=this.pvs.Scene.Current.getName();this.eDescBox.value=this.pvs.Scene.Current.getDescription();this.eTagsBox.value=this.pvs.Scene.Current.getTags();this._setThumbnail();this._setOffsets()},_onSceneSaveSuccess:function(){this._enableButtons();this._setStatus(this.sSaveCompleteMsg,false)},_onSceneSaveError:function(B,C){this._enableButtons();switch(B){case"InvalidThumbnail":this._setStatus(this.sSaveErrorInvalidThumbnail,true);break;case"InvalidMetadata":this._setStatus(this.sSaveErrorSceneMetadata,true);break;case"ProfaneMetadata":var A=this.sSaveErrorProfaneMetadata.replace("#{Profanity}",C);this._setStatus(A,true);break;case"InvalidOffsets":this._setStatus(this.sSaveErrorInvalidOffsets,true);break;case"NotLoggedIn":this._setStatus(this.sSaveErrorNotLoggedIn,true);break;default:this._setStatus(this.sSaveErrorTechnical,true);break}},_onSceneThumbnailLoading:function(A){this._setThumbnailLoading()},_onSceneThumbnailComplete:function(A,B){this._setThumbnail()},_onSceneThumbnailError:function(A){this._setThumbnail()},_onSceneOffsetsChanged:function(A){this._setOffsets()},_onLoginRequest:function(){this._enableButtons()}});GOTUIT.PVS.registerComponentType("SceneSaveControls",GOTUIT.PVS.SceneSaveControls);GOTUIT.PVS.SearchBox=GOTUIT.Class.extend(GOTUIT.PVS.ContentSelector,{initialize:function(B,D,E,C){GOTUIT.PVS.ContentSelector.prototype.initialize.call(this,B,D,E,C);this.sSearchSignature=null;this.oDisplayOptions=null;this.sCurrentSearchAttribute=null;this.aSearchAttributeCustomNames=null;this.oCurrentContent=null;this.eSearchForm=this.addElementByClass("SearchForm");this.eSearchBoxLabel=this.addElementByClass("SearchBoxLabel",this.eSearchForm,"div");GOTUIT.DOM.addClass(this.eSearchBoxLabel,"PVS_Label");this.eSearchBoxDiv=this.addElementByClass("SearchBoxDiv",this.eSearchForm,"div");this.eSearchBox=this.addElementByClass("SearchBox",this.eSearchBoxDiv,"textbox");var A=GOTUIT.PVS._generateComponentId(this.eSearchBox,"SearchBox");this.eSearchBoxLabel.setAttribute("for",A);this.sSearchAttributeList=[];this.eSearchAttributes=this.addElementByClass("SearchAttributes",this.eSearchForm,"div");this.eSearchAttributesULDiv=this.addElementByClass("SearchAttributesULDiv",this.eSearchForm,"div");this.eSearchAttributesUL=this.addElementByClass("SearchAttributesUL",this.eSearchAttributesULDiv,"ul");this.eSearchAttributesInputDiv=this.addElementByClass("SearchAttributesInputDiv",this.eSearchForm,"div");this.eSearchAttributesList=this.addElementByClass("SearchAttributesList",this.eSearchForm,"div");this.aSearchAttributeSelectionStack=[];this.addButton("SubmitButton","ClickedSubmit",this,this.eSearchForm);this.eComponent.appendChild(this.eSearchForm);this.addListener("ClickedSubmit",this._onClickedSubmit,this);GOTUIT.Event.observe(this.eSearchBox,"focus",GOTUIT.Function.bindCall(this._onFocus,this));GOTUIT.Event.observe(this.eSearchBox,"blur",GOTUIT.Function.bindCall(this._onBlur,this));GOTUIT.Event.observe(this.eSearchBox,"keypress",GOTUIT.Function.bindListener(this._onKeyPress,this));GOTUIT.Event.observe(this.eSearchBoxLabel,"click",GOTUIT.Function.bindCall(this._onLabelClick,this))},setLoadedContent:function(A){try{this.reset(A);return }catch(B){}this._clearAndHide()},reset:function(E){try{var F=E.getDisplayOptions();if(F){if(F.isSearchEnabled()){this.oCurrentParentContent=E;if(F.getSearchMaxContent()>0){F=GOTUIT.Object.clone(F);F.setMaxContent(F.getSearchMaxContent())}this.oDisplayOptions=F;this.setPrompt(F.getSearchPrompt());this.sSearchAttributeList=F.getSearchAttributes();this.aSearchAttributeCustomNames=F.getSearchAttributeCustomNames();var D=this.sSearchAttributeList.length;if(D<1){GOTUIT.DOM.hide(this.eSearchAttributes);GOTUIT.DOM.hide(this.eSearchAttributesULDiv);GOTUIT.DOM.hide(this.eSearchAttributesInputDiv);GOTUIT.DOM.hide(this.eSearchAttributesList);GOTUIT.DOM.hide(this.eSearchBoxLabel)}else{for(var C=0;C<D;C++){var B=this.sSearchAttributeList[C];var A=this.aSearchAttributeCustomNames[C];this._initSearchAttribute(B,A,E)}GOTUIT.DOM.show(this.eSearchAttributes);GOTUIT.DOM.show(this.eSearchAttributesInputDiv);GOTUIT.DOM.hide(this.eSearchAttributesList);GOTUIT.DOM.hide(this.eSearchAttributesULDiv)}if(this.sSearchSignature!=F.getSearchSignature()){this.sSearchSignature=F.getSearchSignature();if(this.getQuery()){GOTUIT.DOM.hide(this.eSearchBoxLabel)}else{GOTUIT.DOM.show(this.eSearchBoxLabel)}GOTUIT.DOM.show(this.eSearchForm)}return }}}catch(G){this.logException("reset()",G)}this._clearAndHide()},_clearAndHide:function(){this.sSearchSignature=null;this.setPrompt("");GOTUIT.DOM.hide(this.eSearchBoxLabel);GOTUIT.DOM.hide(this.eSearchForm)},setPrompt:function(A){GOTUIT.PVS.Label.setText(this.eSearchBoxLabel,A);GOTUIT.PVS.Label.trimLabel(this.eSearchBoxLabel,this)},getPrompt:function(){return GOTUIT.PVS.Label.getText(this.eSearchBoxLabel);GOTUIT.PVS.Label.trimLabel(this.eSearchBoxLabel,this)},getQuery:function(){return this.eSearchBox.value},getSearchAttributeSelections:function(){var A=[];return A},_onFocus:function(){GOTUIT.DOM.hide(this.eSearchBoxLabel)},_onBlur:function(){if(this.getQuery()){GOTUIT.DOM.hide(this.eSearchBoxLabel)}else{GOTUIT.DOM.show(this.eSearchBoxLabel)}},_onLabelClick:function(){this.eSearchBox.focus()},_onKeyPress:function(A){if(GOTUIT.Event.isEnterKey(A)){this._onClickedSubmit();GOTUIT.Event.stop(A)}},_loadSearchAttribute:function(C,D){var M=this;var G=D.getDisplayOptions();var F=G.getSearchSignature();F=this.pvs.Util.addURLParam(F,"searchAttribute",C,false);var K=D;var D=new GOTUIT.PVS.GPlayerContent(this.pvs);D.setDisplayOptions(this.oDisplayOptions);D.setParent(K);var H=[];for(var E=0;E<this.sSearchAttributeList.length;E++){if(this.sSearchAttributeList[E]!=C){var B=GOTUIT.DOM.getChildByClass(M.eSearchAttributes,this.sSearchAttributeList[E]+"Select");var L=B.options[0].text;var J=null;if(L.indexOf("All")<0){J=B.options[0].text;H[this.sSearchAttributeList[E]]=J;var I=this.sSearchAttributeList[E]+"::"+J;F=this.pvs.Util.addURLParam(F,"searchAttributeSelected",I,false)}}}D.setBaseRef(F);if(H.length>0){D.setSearchAttributesSelected(H)}for(var E=0;E<this.sSearchAttributeList.length;E++){if(this.sSearchAttributeList[E]!=C){M.eSearchAttributeSelectionHide=GOTUIT.DOM.getChildByClass(M.eSearchAttributesList,this.sSearchAttributeList[E]+"Select_list");M.eSearchAttributeSelectionHide.style.display="none"}}var A={onSuccess:function(U,R){if(U.length>0){var T=GOTUIT.DOM.getChildByClass(M.eSearchAttributes,C+"Select");var S=GOTUIT.DOM.getChildByClass(M.eSearchAttributesList,C+"Select_list");S.options.length=1;var P=1;for(var N=0;N<U.length;N++){S.options[P]=new Option(U[N].getTitle(),C);P++}var O=GOTUIT.DOM.getChildByClass(M.eSearchAttributes,C);O.style.zIndex=6;S.size=6;var Q=GOTUIT.DOM.getChildByClass(M.eSearchAttributesList,C+"_list");Q.style.zIndex=998;S.style.zIndex=998;M.eSearchAttributesList.style.zIndex=998;GOTUIT.DOM.show(M.eSearchAttributesList);GOTUIT.DOM.show(Q);GOTUIT.DOM.show(S);S.focus();M._onPVSSearchAttributesLoaded()}},onError:function(N){M._onPVSSearchAttributesLoaded()}};this.pvs.Content.open(D,A)},_initSearchAttribute:function(C,B,D){if(C){var E=this;E.eSearchAttributeLiDiv=this.addElementByClass(C+"_li",this.eSearchAttributesUL,"div");E.eSearchAttributeLi=this.addElementByClass(C+"Li",this.eSearchAttributeLiDiv,"li");E.eSearchAttributeInputDiv=this.addElementByClass(C+"_input",this.eSearchAttributesInputDiv,"div");E.eSearchAttributeInput=this.addElementByClass(C+"Input",this.eSearchAttributeInputDiv,"input_button");E.eSearchAttribute=this.addElementByClass(C,this.eSearchAttributes,"div");E.eSearchAttributeSelect=E.addElementByClass(C+"Select",E.eSearchAttribute,"select");E.eSearchAttributeSelectionDiv=this.addElementByClass(C+"_list",this.eSearchAttributesList,"div");E.eSearchAttributeSelectionList=E.addElementByClass(C+"Select_list",E.eSearchAttributeSelectionDiv,"select");if(B==null){B="All "+C}var A=document.createTextNode(B);E.eSearchAttributeLi.appendChild(A);E.eSearchAttributeLi.setAttribute("id",C);E.eSearchAttributeInput.setAttribute("id",C);E.eSearchAttributeInput.setAttribute("value",B);E.eSearchAttributeInput.style.zIndex=999;E.eSearchAttributeSelect.options[0]=new Option(E.getAttribute("SearchAttributeSelectText",B),C);E.eSearchAttributeSelect.options.length=1;GOTUIT.Event.observe(E.eSearchAttributeSelect,"click",GOTUIT.Function.bindCall(this._onSearchAttributeSelectClick,this));GOTUIT.Event.observe(E.eSearchAttributeSelect,"click",GOTUIT.Function.bindCall(this._onSearchAttributeSelectionChanged,this));GOTUIT.Event.observe(E.eSearchAttributeSelect,"keypress",GOTUIT.Function.bindCall(this._onSearchAttributeSelectionKeyPressed,this));GOTUIT.Event.observe(E.eSearchAttributeLi,"click",GOTUIT.Function.bindCall(this._onSearchAttributeSelectClick,this));GOTUIT.Event.observe(E.eSearchAttributeInput,"focus",GOTUIT.Function.bindCall(this._onSearchAttributeSelectClick,this));E.eSearchAttributeSelectionList.options[0]=new Option(E.getAttribute("SearchAttributeSelectText",B),C);E.eSearchAttributeSelectionList.options.length=1;GOTUIT.Event.observe(E.eSearchAttributeSelectionList,"focus",GOTUIT.Function.bindCall(this._onSearchAttributeSelectionListClick,this));GOTUIT.Event.observe(E.eSearchAttributeSelectionList,"change",GOTUIT.Function.bindCall(this._onSearchAttributeSelectionListChanged,this));GOTUIT.Event.observe(E.eSearchAttributeSelectionList,"blur",GOTUIT.Function.bindCall(this._onSearchAttributeSelectionListBlur,this));GOTUIT.Event.observe(E.eSearchAttributeSelectionList,"keypress",GOTUIT.Function.bindCall(this._onSearchAttributeSelectionListKeyPressed,this));this.sCurrentSearchAttribute=C;this.oCurrentContent=D}else{this._onPVSSearchAttributesLoaded()}},_onPVSSearchAttributesLoaded:function(){},_notInStack:function(B){var D=1;for(var C=0;C<this.aSearchAttributeSelectionStack.length;C++){var A=this.aSearchAttributeSelectionStack[C];if(A==B){D=0;break}}return D},_onSearchAttributeSelectionKeyPressed:function(A){var C=GOTUIT.Event.getTarget(A);var B=this;if(A.keyCode==13){GOTUIT.DOM.hide(C);C.size=0;GOTUIT.DOM.show(C)}},_onSearchAttributeSelectionListKeyPressed:function(A){var C=GOTUIT.Event.getTarget(A);var B=this;if(A.keyCode==13){GOTUIT.DOM.hide(C)}},_onSearchAttributeSelectionChanged:function(A){var C=GOTUIT.Event.getTarget(A);var B=this;GOTUIT.DOM.hide(C.parentNode);C.parentNodesize=0;GOTUIT.DOM.show(C.parentNode);C.blur()},_onSearchAttributeSelectionListChanged:function(C){var F=GOTUIT.Event.getTarget(C);var E=this;var A=F.options[F.selectedIndex].value;var D=F.options[F.selectedIndex].text;var G=GOTUIT.DOM.getChildByClass(E.eSearchAttributes,A+"Select");var B=GOTUIT.DOM.getChildByClass(E.eSearchAttributesInputDiv,A+"Input");G.options[0].value=A;G.options[0].text=D;B.setAttribute("value",D);B.setAttribute("name",A)},_onSearchAttributeSelectionBlur:function(C){var E=GOTUIT.Event.getTarget(C);var D=this;var B=E.options[0].value;var A=GOTUIT.DOM.getChildByClass(D.eSearchAttributes,B);A.style.zIndex=1;GOTUIT.DOM.hide(E);E.size=0;GOTUIT.DOM.show(E)},_onSearchAttributeSelectionListBlur:function(A){var B=GOTUIT.Event.getTarget(A);GOTUIT.DOM.hide(B)},_onSearchAttributeSelectChange:function(I){var H=GOTUIT.Event.getTarget(I);var J=this;var C=H.options[0].value;var A;if(this.aSearchAttributeSelectionStack.length==0||this._notInStack(C)){this.aSearchAttributeSelectionStack.push(C)}else{for(var G=0;G<this.aSearchAttributeSelectionStack.length;G++){var E=this.aSearchAttributeSelectionStack[G];if(E==C){A=G;if(H.selectedIndex>0){for(var F=A+1;F<this.aSearchAttributeSelectionStack.length;F++){var D=this.aSearchAttributeSelectionStack[F];if(D!=null){this._loadSearchAttribute(D,this.oCurrentContent)}}}else{for(var F=A+1;F<this.aSearchAttributeSelectionStack.length;F++){var D=this.aSearchAttributeSelectionStack[F];for(var G=0;G<this.sSearchAttributeList.length;G++){var B=GOTUIT.DOM.getChildByClass(J.eSearchAttributes,this.sSearchAttributeList[G]+"Select");if(this.sSearchAttributeList[G]==D){B.selectedIndex=0}}}}}}}},_onSearchAttributeSelectClick:function(A){var C=GOTUIT.Event.getTarget(A);var B=this;if(C.options!=null){C.options.length=1;var D=C.options[0].value;this._loadSearchAttribute(D,this.oCurrentContent)}else{var D=C.getAttribute("id");this._loadSearchAttribute(D,this.oCurrentContent)}},_onSearchAttributeSelectionListClick:function(A){},_onSearchAttributeSelectionListDblClick:function(A){var B=GOTUIT.Event.getTarget(A);GOTUIT.DOM.hide(B)},_onClickedSubmit:function(){if(this.sSearchSignature!=null){var H=this.getQuery();var E=this.sSearchSignature;E=this.pvs.Util.addURLParam(E,"query",H,false);var J=this.oCurrentParentContent;var C=new GOTUIT.PVS.GPlayerContent(this.pvs);C.setDisplayOptions(this.oDisplayOptions);C.setParent(J);var M=this;var F=[];var N=0;for(var D=0;D<this.sSearchAttributeList.length;D++){var A=GOTUIT.DOM.getChildByClass(M.eSearchAttributes,this.sSearchAttributeList[D]+"Select");var B=A.selectedIndex;var K=A.options[0].text;var I=null;if(K.indexOf("All")<0){N=1;I=A.options[0].text;F[this.sSearchAttributeList[D]]=I;var G=this.sSearchAttributeList[D]+"::"+I;E=this.pvs.Util.addURLParam(E,"searchAttributeSelected",G,false)}}C.setBaseRef(E);var L={onSuccess:function(O){M.sendEvent(GOTUIT.PVS.EVENT.SELECTION_SET,O)}};if(H.length>0||N){this.pvs.Content.get(C,L)}return }this.sendEvent(GOTUIT.PVS.EVENT.SELECTION_SET,null)}});GOTUIT.PVS.registerComponentType("SearchBox",GOTUIT.PVS.SearchBox);GOTUIT.PVS.AbstractAdComponent=GOTUIT.Class.extend(GOTUIT.PVS.Component,{initialize:function(C,E,F,D,B,A){GOTUIT.PVS.Component.prototype.initialize.call(this,C,E,F,D);this.nChannelIntroTimeout=this.getIntAttribute("IntroBannerTimeout",5)*1000;this.sAdBanner=this.getAttribute("AdBannerPage");this.bLinkedToVideo=this.getBooleanAttribute("LinkedToVideo",true);this.bClearWhileFullScreen=this.getBooleanAttribute("ClearWhileFullScreen",false);this.bShowingCompanion=false;this.timerIntroBanner=null;this.nWidth=B;this.nHeight=A;this.eFrame=GOTUIT.DOM.create("iframe",{frameborder:0,width:B,height:A,scrolling:"no",marginwidth:0,marginheight:0});E.appendChild(this.eFrame);if(this.bClearWhileFullScreen){this.pvs.addListener(GOTUIT.PVS.EVENT.APP_FULLSCREEN,this._onFullScreenChange,this)}this.pvs.addListener(GOTUIT.PVS.EVENT.CHANNEL_CONTEXT_CHANGE,this._onChannelContextChange,this);this.pvs.addListener(GOTUIT.PVS.EVENT.PLAYER_AD_STARTED,this._onAdStarted,this);this.pvs.addListener(GOTUIT.PVS.EVENT.PLAYER_AD_COMPLETE,this._onAdComplete,this);if(!this.bClearWhileFullScreen){this._loadAd()}},getWidth:function(){return this.nWidth},getHeight:function(){return this.nHeight},_loadAd:function(){this._loadPage(this.sAdBanner)},_hide:function(){try{var A=this.pvs.getPVSBase()+"build/components/assets/blank.html";this._loadPage(A)}catch(B){}},_loadPage:function(C,B,E,A){clearTimeout(this.timerIntroBanner);if(A==null){A=false}this.bShowingCompanion=A;try{if(C){this.eFrame.src=C}else{if(B){if(E){this.eFrame.src=this.pvs.getPVSBase()+"build/components/assets/ad.html?img="+escape(B)+"&link="+escape(E)+"&w="+this.getWidth()+"&h="+this.getHeight()}else{this.eFrame.src=this.pvs.getPVSBase()+"build/components/assets/ad.html?img="+escape(B)+"&w="+this.getWidth()+"&h="+this.getHeight()}}}}catch(D){}},_onFullScreenChange:function(A){if(A){this._hide()}else{this._loadAd()}},_onChannelContextChange:function(A){},_onAdStarted:function(B){try{if(this.bLinkedToVideo&&B){if(B["Companion"+this.getWidth()+"x"+this.getHeight()+"Ad"]!=null){var A=B["Companion"+this.getWidth()+"x"+this.getHeight()+"Ad"];this._loadPage(A.URL,A.Image,A.ImageLink,true)}}}catch(C){}},_onAdComplete:function(A){if(this.bShowingCompanion){this._loadAd()}}});GOTUIT.PVS.Ad300x250=GOTUIT.Class.extend(GOTUIT.PVS.AbstractAdComponent,{initialize:function(A,C,D,B){GOTUIT.PVS.AbstractAdComponent.prototype.initialize.call(this,A,C,D,B,300,250)}});GOTUIT.PVS.Ad468x60=GOTUIT.Class.extend(GOTUIT.PVS.AbstractAdComponent,{initialize:function(A,C,D,B){GOTUIT.PVS.AbstractAdComponent.prototype.initialize.call(this,A,C,D,B,468,60)}});GOTUIT.PVS.Ad160x600=GOTUIT.Class.extend(GOTUIT.PVS.AbstractAdComponent,{initialize:function(A,C,D,B){GOTUIT.PVS.AbstractAdComponent.prototype.initialize.call(this,A,C,D,B,160,600)}});GOTUIT.PVS.Ad728x90=GOTUIT.Class.extend(GOTUIT.PVS.AbstractAdComponent,{initialize:function(A,C,D,B){GOTUIT.PVS.AbstractAdComponent.prototype.initialize.call(this,A,C,D,B,728,90)}});GOTUIT.PVS.CustomAd=GOTUIT.Class.extend(GOTUIT.PVS.AbstractAdComponent,{initialize:function(A,C,D,B){GOTUIT.PVS.AbstractAdComponent.prototype.initialize.call(this,A,C,D,B,this.getAttribute("AdWidth",300),this.getAttribute("AdHeight",250))}});GOTUIT.PVS.registerComponentType("Ad300x250",GOTUIT.PVS.Ad300x250);GOTUIT.PVS.registerComponentType("Ad468x60",GOTUIT.PVS.Ad468x60);GOTUIT.PVS.registerComponentType("Ad160x600",GOTUIT.PVS.Ad160x600);GOTUIT.PVS.registerComponentType("Ad728x90",GOTUIT.PVS.Ad728x90);GOTUIT.PVS.registerComponentType("CustomAd",GOTUIT.PVS.CustomAd);