var BUG={};BUG.mode="production";BUG.toss=function(error){if(arguments.length!=1){return;} try{switch(BUG.mode.toLowerCase()){case"console":if(error.constructor.name!="Bug"){error=Bug({'message':error});} Console(error);break;case"log":break;default:break;}}catch(e){}};var Console=function(content){var console=document.getElementById('bug-console');if(!console){console=document.createElement('div');console.id='bug-console';console.style.position='absolute';console.style.top="0";console.style.left="0";console.style.width=VEOH.Util.documentWidth()+'px';console.style.height='100px';console.style.margin="0";console.style.padding="0";console.style.background='#000';console.style.opacity="80%";console.style.font='16px "Andale Mono"';console.style.textAlign="left";console.style.color="lime";console.style.zIndex="10001";var list=document.createElement('ul');list.id='bug-console-list';list.style.listStyle="none";list.style.position='absolute';list.style.bottom="0";list.style.left="0";list.style.margin="0";list.style.padding="0";list.style.height='100px';list.style.width='100%';list.style.overflow='auto';document.body.appendChild(console);console.appendChild(list);} if(content){var item=document.createElement('li');item.className='bug-console-item';item.setAttribute('style','margin: 2px 0; padding: 2px 20px; height: 14px; border-bottom: 1px solid lime; overflow: hidden');document.getElementById('bug-console-list').appendChild(item);item.appendChild(content);} document.body.style.marginTop='100px';return console;};var Bug=function(params){var bug=document.createElement('div');bug.className='bug';var message=document.createElement('span');message.className="bug-message";message.innerHTML="Error: "+params.message||"Error";var line=document.createElement('span');line.className="bug-line";line.innerHTML="line: "+params.line||"";var file=document.createElement('span');file.className="bug-file";file.innerHTML="file: "+params.file||"";bug.appendChild(message);bug.appendChild(line);bug.appendChild(file);message.setAttribute('style','display: block; float: left; position: relative; width: 480px; overflow: hidden');line.setAttribute('style','display: block; float: right; width: 162px; margin: 0 5px; overflow: hidden');file.setAttribute('style','display: block; float: right; width: 240px; margin: 0 5px; overflow: hidden');return bug;};var Email=function(params){}; if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}if(I.length>1){I.pop();}I.push("]");}else{I.push("{");for(D in A){if(C.hasOwnProperty(A,D)){I.push(D+E);if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}}if(I.length>1){I.pop();}I.push("}");}return I.join("");},substitute:function(Q,B,J){var G,F,E,M,N,P,D=YAHOO.lang,L=[],C,H="dump",K=" ",A="{",O="}";for(;;){G=Q.lastIndexOf(A);if(G<0){break;}F=Q.indexOf(O,G);if(G+1>=F){break;}C=Q.substring(G+1,F);M=C;P=null;E=M.indexOf(K);if(E>-1){P=M.substring(E+1);M=M.substring(0,E);}N=B[M];if(J){N=J(M,N,P);}if(D.isObject(N)){if(D.isArray(N)){N=D.dump(N,parseInt(P,10));}else{P=P||"";var I=P.indexOf(H);if(I>-1){P=P.substring(4);}if(N.toString===Object.prototype.toString||I>-1){N=D.dump(N,parseInt(P,10));}else{N=N.toString();}}}else{if(!D.isString(N)&&!D.isNumber(N)){N="~-"+L.length+"-~";L[L.length]=C;}}Q=Q.substring(0,G)+N+Q.substring(F+1);}for(G=L.length-1;G>=0;G=G-1){Q=Q.replace(new RegExp("~-"+G+"-~"),"{"+L[G]+"}","g");}return Q;},trim:function(A){try{return A.replace(/^\s+|\s+$/g,"");}catch(B){return A;}},merge:function(){var D={},B=arguments;for(var C=0,A=B.length;C=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};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(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.5.1",build:"984"});YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B0){A=H[0];}try{F=K.fn.call(J,A,K.obj);}catch(E){this.lastError=E;}}else{try{F=K.fn.call(J,this.type,H,K.obj);}catch(G){this.lastError=G;}}if(false===F){if(!this.silent){}return false;}}}return true;},unsubscribeAll:function(){for(var A=this.subscribers.length-1;A>-1;A--){this._delete(A);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,startInterval:function(){if(!this._interval){var K=this;var L=function(){K._tryPreloadAttach();};this._interval=setInterval(L,this.POLL_INTERVAL);}},onAvailable:function(P,M,Q,O,N){var K=(YAHOO.lang.isString(P))?[P]:P;for(var L=0;L-1;O--){U=(this.removeListener(L[O],K,T)&&U);}return U;}}if(!T||!T.call){return this.purgeElement(L,false,K);}if("unload"==K){for(O=J.length-1;O>-1;O--){V=J[O];if(V&&V[0]==L&&V[1]==K&&V[2]==T){J.splice(O,1);return true;}}return false;}var P=null;var Q=arguments[3];if("undefined"===typeof Q){Q=this._getCacheIndex(L,K,T);}if(Q>=0){P=I[Q];}if(!L||!P){return false;}if(this.useLegacyEvent(L,K)){var N=this.getLegacyIndex(L,K);var M=E[N];if(M){for(O=0,R=M.length;O0&&F.length>0);}var P=[];var R=function(T,U){var S=T;if(U.override){if(U.override===true){S=U.obj;}else{S=U.override;}}U.fn.call(S,U.obj);};var L,K,O,N,M=[];for(L=0,K=F.length;L-1;L--){O=F[L];if(!O||!O.id){F.splice(L,1);}}this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N-1;M--){L=I[M];if(L){K.removeListener(L[K.EL],L[K.TYPE],L[K.FN],M);}}L=null;}G=null;K._simpleRemove(window,"unload",K._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;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(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C0)?E:0;}B.Dom.setStyle(this.getEl(),C,E+D);},getAttribute:function(C){var E=this.getEl();var G=B.Dom.getStyle(E,C);if(G!=="auto"&&!this.patterns.offsetUnit.test(G)){return parseFloat(G);}var D=this.patterns.offsetAttribute.exec(C)||[];var H=!!(D[3]);var F=!!(D[2]);if(F||(B.Dom.getStyle(E,"position")=="absolute"&&H)){G=E["offset"+D[0].charAt(0).toUpperCase()+D[0].substr(1)];}else{G=0;}return G;},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return"px";}return"";},setRuntimeAttribute:function(D){var I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined");};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false;}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"];}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B0&&!(L[0]instanceof Array)){L=[L];}else{var K=[];for(M=0,O=L.length;M0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L);}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I;}else{F.setRuntimeAttribute.call(this,P);}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G;};var D=function(G){return(typeof G!=="undefined");};E.Motion=A;})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H);}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)];}else{G=C.doMethod.call(this,E,H,F);}return G;};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop];}else{G=C.getAttribute.call(this,E);}return G;};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1];}else{C.setAttribute.call(this,E,H,G);}};B.Scroll=D;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.5.1",build:"984"}); YAHOO.namespace("lang");YAHOO.lang.JSON={_ESCAPES:/\\["\\\/bfnrtu]/g,_VALUES:/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS:/(?:^|:|,)(?:\s*\[)+/g,_INVALID:/^[\],:{}\s]*$/,_SPECIAL_CHARS:/["\\\x00-\x1f\x7f-\x9f]/g,_PARSE_DATE:/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/,_CHARS:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},_applyFilter:function(C,B){var A=function(E,D){var F,G;if(D&&typeof D==="object"){for(F in D){if(YAHOO.lang.hasOwnProperty(D,F)){G=A(F,D[F]);if(G===undefined){delete D[F];}else{D[F]=G;}}}}return B(E,D);};if(YAHOO.lang.isFunction(B)){A("",C);}return C;},isValid:function(A){if(!YAHOO.lang.isString(A)){return false;}return this._INVALID.test(A.replace(this._ESCAPES,"@").replace(this._VALUES,"]").replace(this._BRACKETS,""));},dateToString:function(B){function A(C){return C<10?"0"+C:C;}return'"'+B.getUTCFullYear()+"-"+A(B.getUTCMonth()+1)+"-"+A(B.getUTCDate())+"T"+A(B.getUTCHours())+":"+A(B.getUTCMinutes())+":"+A(B.getUTCSeconds())+'Z"';},stringToDate:function(B){if(this._PARSE_DATE.test(B)){var A=new Date();A.setUTCFullYear(RegExp.$1,(RegExp.$2|0)-1,RegExp.$3);A.setUTCHours(RegExp.$4,RegExp.$5,RegExp.$6);return A;}},parse:function(s,filter){if(this.isValid(s)){return this._applyFilter(eval("("+s+")"),filter);}throw new SyntaxError("parseJSON");},stringify:function(C,K,F){var E=YAHOO.lang,H=E.JSON,D=H._CHARS,A=this._SPECIAL_CHARS,B=[];var I=function(N){if(!D[N]){var J=N.charCodeAt();D[N]="\\u00"+Math.floor(J/16).toString(16)+(J%16).toString(16);}return D[N];};var M=function(J){return'"'+J.replace(A,I)+'"';};var L=H.dateToString;var G=function(J,T,R){var W=typeof J,P,Q,O,N,U,V,S;if(W==="string"){return M(J);}if(W==="boolean"||J instanceof Boolean){return String(J);}if(W==="number"||J instanceof Number){return isFinite(J)?String(J):"null";}if(J instanceof Date){return L(J);}if(E.isArray(J)){for(P=B.length-1;P>=0;--P){if(B[P]===J){return"null";}}B[B.length]=J;S=[];if(R>0){for(P=J.length-1;P>=0;--P){S[P]=G(J[P],T,R-1)||"null";}}B.pop();return"["+S.join(",")+"]";}if(W==="object"){if(!J){return"null";}for(P=B.length-1;P>=0;--P){if(B[P]===J){return"null";}}B[B.length]=J;S=[];if(R>0){if(T){for(P=0,O=0,Q=T.length;P=0?F:1/0;return G(C,K,F);}};YAHOO.register("json",YAHOO.lang.JSON,{version:"2.5.1",build:"984"}); setTimeout(function(){},0);if(typeof VEOH=="undefined"||!VEOH){var VEOH={};} if(typeof VEOH=="undefined"||!VEOH){var VEOH={};} VEOH.Util={};VEOH.Util.appendNode=function(element,surrogate){if(surrogate){surrogate.appendChild(element);} else{document.body.appendChild(element);}};VEOH.Util.removeNode=function(element){element.parentNode.removeChild(element);};VEOH.Util.hide=function(element){element.style.display='none';element.style.filter='alpha(opacity=0)';element.style.opacity='0';};VEOH.Util.documentWidth=function(){if(document.documentElement&&document.documentElement.scrollWidth){return document.documentElement.scrollWidth;} else if(document.body.scrollWidth){return document.body.scrollWidth;} else{throw new Error('cannot get document width');}};VEOH.Util.documentHeight=function(){if(document.documentElement&&document.documentElement.scrollHeight){return document.documentElement.scrollHeight;} else if(document.body.scrollHeight){return document.body.scrollHeight;} else{throw new Error('cannot get document height');}};VEOH.Util.xScroll=function(){var xScroll=window.scrollX||document.documentElement.scrollLeft;return xScroll;};VEOH.Util.yScroll=function(){var yScroll=window.scrollY||document.documentElement.scrollTop;return yScroll;};VEOH.Util.extend=function(oSub,oSuper){if(!(oSub&&oSuper)) return;for(sProperty in oSuper){oSub[sProperty]=oSuper[sProperty];}};VEOH.Util.clearHighlight=function(un) {if(!un) return;un.style.border="1px solid #D7D7D7";un.style.backgroundColor="#FFFFFF";un.onBlur="";};VEOH.Util.focusField=function(un) {if(!un) return;un.oldBackgroundColor=un.style.backgroundColor;un.oldBorder=un.style.border;un.style.backgroundColor="#FFF899";un.style.border="1px solid #F46E2A";un.onblur=function(){VEOH.Util.clearHighlight(un);};};VEOH.Util.createMethodReference=function(object,method){if(!(method instanceof Function)) method=object[method];return function(){method.apply(object,arguments);};};VEOH.Util.log=function(message,type,component){if(!message) return;if(typeof YAHOO!="undefined"&&typeof YAHOO.log!="undefined"){YAHOO.log(message,type,component);return;} return;var output=message;if(type) output+=" - "+type;if(component) output+=" - "+component;if(typeof console!="undefined"&&console.log) console.log(output);};var log=VEOH.Util.log;VEOH.Util.getAbsolutePosition=function(element,axis){if(!element){log("no element to get position for","error");return 0;} var curleft=0;var curtop=0;if(!element.parentNode){log("cannot get absolute position: unsupported browser");return 0;} var iterateElement=element;do{if(iterateElement&&iterateElement.offsetLeft){curleft+=iterateElement.offsetLeft;curtop+=iterateElement.offsetTop;}} while(iterateElement=iterateElement.parentNode);if(axis&&axis=="y"){return curtop;} return curleft;};VEOH.Util.queryString=function(qs){var params=new Array();if(qs==null) qs=location.search.substring(1,location.search.length);if(qs.length==0) return null;qs=qs.replace(/\+/g,' ');var args=qs.split('&');for(var i=0;i0){VEOH.Util.removeChildSafe(el.childNodes[el.childNodes.length-1]);}} if(el.parentNode) el.parentNode.removeChild(el);};VEOH.Util.captureMousePosition=function(e){if(!e) this.event=window.event;else this.event=e;this.getXMousePos=function(){if(this.event.pageX){return this.event.pageX;} else if(this.event.clientX){return this.event.clientX+ (document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft);} else{return null;}};this.getYMousePos=function(evt){if(this.event.pageY){return this.event.pageY;} else if(this.event.clientY){return this.event.clientY+ (document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);} else{return null;}};glbXMousePos=this.getXMousePos();glbYMousePos=this.getYMousePos();}; if(typeof VEOH=="undefined"||!VEOH){var VEOH={};} VEOH.comm={};VEOH.comm.queue=[];VEOH.comm.counter=0;VEOH.comm.fire=function(){var requests=VEOH.comm.queue;var quantityOpen=0;for(var i=0;i=2){break dispatch;}}}};VEOH.comm.request=function(params){var request={};request.id=VEOH.comm.counter++;request.object=VEOH.comm.XHR();request.method=params.method||'GET';request.url=params.url;request.async=params.async||1;request.data=params.data||null;request.tries=params.tries||2;request.state=0;request.timeout=null;request.onSuccess=params.onSuccess||function(){BUG.toss('Communicator expects an onSuccess callback');};request.onFailure=params.onFailure||function(){BUG.toss('Communicator expects an onFailure callback');};VEOH.comm.queue.push({'id':request.id,'request':request,'tries':request.tries,'state':request.state});VEOH.comm.fire();};VEOH.comm.kill=function(id){for(var i=0;i=0){var first=currentBody.substring(0,currentBody.indexOf('dark'));var last=currentBody.substring(currentBody.indexOf('dark')+4,currentBody.length);document.body.className=first+' '+last;} document.getElementById('veoh-backdrop').style.display='none';if(callbacks.onLight.constructor==Function){callbacks.onLight();} window.onresize=function(){};});lighten.animate();};document.body.appendChild(backdrop);return backdrop;};var Pocket=function(cache){var pocket=document.getElementById('veoh-pocket');if(!pocket){pocket=document.createElement('div');pocket.id='veoh-pocket';pocket.style.display='none';} document.body.appendChild(pocket);if(cache){switch(cache.constructor.name){case"String":var surrogate=document.createElement('div');surrogate.innerHTML=cache;pocket.appendChild(surrogate);break;case"Object":pocket.appendChild(cache);break;default:var surrogate=document.createElement('div');surrogate.innerHTML=cache;pocket.appendChild(surrogate);break;}} return pocket;};var Overlay=function(element,specs){var existing=document.getElementById('veoh-modal-box');if(!existing&&!element){return null;} if(!element&&existing){return existing;} if(existing&&element){existing.close({"maintain":true});} var pocket=Pocket();var backdrop=Backdrop();var layer=document.createElement('div');layer.className='veoh-layer';layer.style.height='100%';layer.style.width='100%';layer.style.textAlign='center';layer.style.position='absolute';layer.style.top='0px';layer.style.left='0px';layer.style.zIndex='99960';var container=document.createElement('div');container.className='veoh-container';container.style.height='100%';container.style.width='950px';container.style.margin='0px auto';container.style.textAlign='left';container.style.position="relative";var frame=document.createElement('div');frame.className='veoh-frame';var box=document.createElement('div');box.id='veoh-modal-box';box.style.position='absolute';box.style.top=(VEOH.Util.yScroll()+110)+'px';backdrop.place();document.body.appendChild(layer);layer.appendChild(container);container.appendChild(frame);frame.appendChild(box);box.appendChild(element);box.close=function(mods){if(document.getElementById('veoh-modal-box')){VEOH.Util.removeNode(document.getElementById('veoh-modal-box').parentNode.parentNode.parentNode);} var backdrop=Backdrop();if(backdrop){if(typeof mods=="undefined"||mods["maintain"]!=true){backdrop.release();}} return false;};var collection=element.childNodes;for(var i=0;i=0){if(specs&&specs.onClose.constructor.name=="Function"){collection[i].onclick=function(){specs.onClose();box.close();};} else{collection[i].onclick=box.close;}}} return box;};var Alert=function(message){var dialog=document.createElement('div');dialog.className='veoh-panel';var header=document.createElement('h3');header.className='veoh-header';if(message&&message.header){header.innerHTML=message.header;} else{header.innerHTML="Veoh Video Network";} var messageText=document.createElement('p');messageText.className='veoh-message';if(message&&message.message){messageText.innerHTML=message.message;} else if(message&&message.constructor.name=='String'){messageText.innerHTML=message;} else{messageText.innerHTML="Alert!";} var accept=document.createElement('a');accept.href="#";accept.className='veoh-accept buttonD_130';if(message&&message.accept){accept.innerHTML=message.accept;} else{accept.innerHTML="OK";} if(message&&message.onAccept){accept.onclick=function(){message.onAccept();return false;};} else{accept.onclick=function(){var overlay=Overlay();overlay.close();return false;};} dialog.appendChild(header);dialog.appendChild(messageText);dialog.appendChild(accept);Overlay(dialog);};var Confirm=function(specs){var confirmation=document.createElement('div');confirmation.className='veoh-panel';var header=document.createElement('h3');header.className='veoh-header';if(specs&&specs.header){header.innerHTML=specs.header;} else{header.innerHTML="Veoh Video Network";} var message=document.createElement('p');message.className='veoh-message';if(specs&&specs.message){message.innerHTML=specs.message;} else{message.innerHTML="Are you sure you want to complete this action?";} var decline=document.createElement('a');decline.href="#";decline.className='veoh-decline';if(specs&&specs.decline){decline.innerHTML=decline;} else{decline.innerHTML="cancel";} if(specs&&specs.onDecline){decline.onclick=function(){specs.onDecline();return false;};} else{decline.onclick=function(){var overlay=Overlay();overlay.close();return false;};} var accept=document.createElement('a');accept.href="#";accept.className='veoh-accept buttonD_130';if(specs&&specs.accept){accept.innerHTML=accept;} else{accept.innerHTML="OK";} if(specs&&specs.onAccept){accept.onclick=function(){specs.onAccept();return false;};} else{accept.onclick=function(){var overlay=Overlay();overlay.close();return false;};} confirmation.appendChild(header);confirmation.appendChild(message);confirmation.appendChild(decline);confirmation.appendChild(accept);Overlay(confirmation);}; VEOH.Messaging={};VEOH.Messaging.clear=function(start){var startingNode=start||document.body;var candidates=startingNode.getElementsByTagName('div');for(var i=0;i=0){candidates[i].parentNode.removeChild(candidates[i]);}}};var Message=function(type){var message=document.createElement('div');message.className='veoh-message-element';message.style.margin='5px';message.style.padding='10px';message.style.background="#fff";message.style.border="1px solid #fff";switch(type){case"success":message.className+=' message-type-success';message.style.borderColor='darkgreen';message.style.backgroundColor='palegreen';break;case"update":message.className+=' message-type-update';message.style.borderColor='teal';message.style.backgroundColor='aliceblue';break;case"error":case"failure":message.className+=' message-type-success';message.style.borderColor='darkred';message.style.backgroundColor='mistyrose';break;default:message.style.borderColor='teal';message.style.backgroundColor='aliceblue';break;} message.setHeader=function(text){var h3=document.createElement('h3');h3.className="veoh-message-header";h3.setAttribute('style','margin:0; padding:0');h3.innerHTML=text;this.insertBefore(h3,this.childNodes[0]);};message.setBody=function(text){var p=document.createElement('p');p.className="veoh-message-text";p.setAttribute('style','margin:0; padding:0');p.innerHTML=text;this.appendChild(p,this.childNodes[0]);};message.setDecay=function(text){};message.setProperties=function(object){};message.place=function(element,position){element.normalize();if(position&&position.constructor.name=="Number"){if(position&&element.childNodes[position]){element.insertBefore(this,element.childNodes[position]);} else{element.insertBefore(this,element.childNodes[0]);}} else if(position&&document.getElementById(position)){element.insertBefore(this,document.getElementById(position));} else if(position){var nodes=element.childNodes;for(var i=0;i=0){element.insertBefore(this,nodes[i]);break;}}} else{var nodes=element.childNodes;var close=false;var header=false;for(var i=0;i=0){var close=i;} if(nodes[i].className&&nodes[i].className.indexOf('header')>=0){var header=i;break;}} if(close&&header&&(header+1)>0){element.insertBefore(this,element.childNodes[(header+1)]);} else if(close&&(close+1)>0){element.insertBefore(this,element.childNodes[(close+1)]);} else if(header&&(header+1)>0){element.insertBefore(this,element.childNodes[(header+1)]);} else{element.insertBefore(this,element.childNodes[0]);}}};message.replace=function(element,position){var children=element.childNodes;for(var i=0;i=0){children[i].parentNode.removeChild(children[i]);}} this.place(element,position);};return message;};