/*
* (c) Copyright Spacial Audio Solutions, LLC - 2008.
* Please make sure to read the license before making any use of this software.
* http://www.spacialaudio.com
*/
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,f,Y){var b,c,d,V,U,C,W=[],e,a="dump",X=" ",A="{",T="}";for(;;){b=B.lastIndexOf(A);if(b<0){break}c=B.indexOf(T,b);if(b+1>=c){break}e=B.substring(b+1,c);V=e;C=null;d=V.indexOf(X);if(d>-1){C=V.substring(d+1);V=V.substring(0,d)}U=f[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]=e}}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"});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,f){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,f)&&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,f)});return true}}}if(!L){return false}if("unload"==d&&H!==this){S[S.length]=[L,d,C,H,c,f];return true}var e=L;if(c){if(c===true){e=H}else{e=c}}var K=function(Y){return C.call(e,YAHOO.util.Event.getEvent(Y,L),H)};var A=[L,d,C,K,e,H,c,f];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,f)}catch(D){this.lastError=D;this._removeListener(L,d,C,f);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 A=YAHOO.util.Event;A.on=A.addListener;A.onFocus=A.addFocusListener;A.onBlur=A.addBlurListener;if(A.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var B=document.createElement("p");A._dri=setInterval(function(){try{B.doScroll("left");clearInterval(A._dri);A._dri=null;A._ready();B=null}catch(C){}},A.POLL_INTERVAL)}else{if(A.webkit&&A.webkit<525){A._dri=setInterval(function(){var C=document.readyState;if("loaded"==C||"complete"==C){clearInterval(A._dri);A._dri=null;A._ready()}},A.POLL_INTERVAL)}else{A._simpleAdd(document,"DOMContentLoaded",A._ready)}}A._simpleAdd(window,"load",A._load);A._simpleAdd(window,"unload",A._unload);A._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"});function getBrowser(){if(navigator.userAgent.indexOf("MSIE")!=-1){return"IE"}else{if(navigator.userAgent.indexOf("Firefox")!=-1){return"FF"}else{if(navigator.userAgent.indexOf("Chrome")!=-1){return"CHROME"}else{return("OTHER")}}}}function Def(B,A){if((B==null)||(B=="")){return A}else{return B}}function IsEmpty(A){return(A==null)||(A=="")||(A=="undefined")}function IsNotEmpty(A){return(IsEmpty(A)==false)}function IsNull(A){return(A==null)}function java_include(A){document.write('<script language="javascript" type="text/javascript" src="'+A+'"><\/script>')}function javascript_include(A,B){if(A!=null){A.write('<script language="javascript" type="text/javascript" src="'+B+'"><\/script>')}}function DynWrite(H,E){var D,C,B,A;var G="return false;";var F=(document.getElementById)?document.getElementById(H):null;if((F)&&(typeof F.innerHTML=="string")){A="tSt";while(document.getElementById(A)){A+=A}B=F.innerHTML;C=B+"<sTrOnG  Id='"+A+"'  >test</StRoNg    >";F.innerHTML=C;D=F.innerHTML;if((D!=C)&&(D!=B)&&(document.getElementById(A))){G="document.getElementById(id).innerHTML=S; return true"}}DynWrite=new Function("id","S",G);return DynWrite(H,E)}window.onerror=function(){var A=ParseQueryStr();if(typeof (A.catcherrors)!="undefined"&&A.catcherrors=="no"){return false}return true};function ParamsToArray(B){var D=0;var A=B.split("&");var C=new Array();for(i=0;i<A.length;i++){data=A[i];D=data.indexOf("=");if(D>0){key=data.substr(0,D);val=data.substr(D+1,data.length);C[key]=unescape(val)}}return C}function ArrayToParams(B){var A="";for(param in B){if(A.length>0){A=A+"&"}A=A+param+"="+escape(B[param])}return A}function ParseQueryStr(){var A=window.location.search.substring(1);return ParamsToArray(A)}function setVisibility(A,B){layer=document.getElementById(A);if(layer!=null){if(B){layer.style.display=""}else{layer.style.display="none"}}}function logGoogleAd(D){var C=new Array();C["0"]="1006669";C["10"]="1003872";C["15"]="1003873";C["30"]="1003874";C["60"]="1003875";var E=D/1000;var A;if(E==0){A=C["0"]}if(E>=9&&E<=13){A=C["10"]}if(E>=14&&E<=19){A=C["15"]}if(E>=29&&E<=33){A=C["30"]}if(E>=59&&E<=63){A=C["60"]}var B="http://sa-m.streamads.com/view?pid=13266&t=i&o=jsonx&cbfunc=onGoogleLogURL&l=4&aid="+A;JSLoader.LoadJS(B)}function onGoogleLogURL(A){if(A.length>0){Touch.touch(A[0]["logurl"])}}TGlobals=function(){var A=0;var B=Array();this.Create=function(D){A++;var C=A;this.Write(C,D);return C};this.Write=function(C,D){globals[C]=D};this.Read=function(C){return globals[C]}};var globals=new TGlobals();TJSLoader=function(){this.useCacheBuster=true;this.LoadJS=function(D,C){if(D==null){return }if(this.useCacheBuster){var E=new Date();if(D.indexOf("?")==-1){D=D+"?"}D=D+"&buster="+E.getTime()}if((C!=null)&&(B[C]!=null)){document.body.removeChild(B[C])}A++;oScript=document.createElement("script");oScript.id="idJSLoader"+A;oScript.type="text/javascript";oScript.src=D;document.body.appendChild(oScript);if(C!=null){B[C]=oScript}};var B=Array();var A=0};var JSLoader=new TJSLoader();TLint=function(){this.debugMode=false;this.enableProblemReports=true;this.log=function(B){if(this.enableProblemReports){this.addProblemText(B)}if(!this.debugMode){return }if(typeof (console)!="undefined"&&typeof (console.log)!="undefined"){console.log(B)}};this.info=function(B){if(this.enableProblemReports){this.addProblemText("INFO: "+B)}if(!this.debugMode){return }if(typeof (console)!="undefined"){if(typeof (console.info)!="undefined"){console.info(B)}else{console.log("INFO: "+B)}}};this.warn=function(B){if(this.enableProblemReports){this.addProblemText("WARNING: "+B)}if(!this.debugMode){return }if(typeof (console)!="undefined"){if(typeof (console.warn)!="undefined"){console.warn(B)}else{console.log("WARNING: "+B)}}};this.error=function(B){if(this.enableProblemReports){this.addProblemText("ERROR: "+B)}if(!this.debugMode){return }if(typeof (console)!="undefined"){if(typeof (console.error)!="undefined"){console.error(B)}else{console.log("ERROR: "+B)}}};this.dir=function(B){if(!this.debugMode){return }if(typeof (console)!="undefined"){if(typeof (console.dir)!="undefined"){console.dir(B)}else{console.log("OBJECT: "+B+" ID: "+B.id+" NAME: "+B.name)}}};this.stackDump=function(C,M){var G=[];var Q=0;for(var J=arguments.callee.caller;J!=null;J=J.caller){if(typeof (C)=="number"&&C-->0){continue}Q++;var P=!(J.caller);sCaller=(J+"").replace(/function\s*|\s*{[\s\S]*/g,"");var F=sCaller.match(/(\w*\s*)\(([^\)]*)\)/);var K=" "+(P?"\u2514":"\u251C")+"\u2500 ";var B=" "+(P?" ":"\u2502")+"  ";if(F==null){G.push(K+visualize(sCaller));if(M){G.push(B+"    Argument info unavailable.")}}else{var I=F[1];var E=F[2].match(/^\s*$/)?[]:F[2].split(",");G.push(K+I+" ("+E.join(", ")+")");if(M){for(var H=0;H<E.length||H<J.arguments.length;H++){var O="arguments["+H+"]";if(H<E.length){E[H]=E[H].replace(/^\s*|\s*$/g,"");O=E[H]}var N=(H+1>=E.length&&H+1>=J.arguments.length);var L=" "+(N?"\u2514":"\u251C")+"\u2500 ";var D=" "+(N?" ":"\u2502")+"  ";G.push(B+L+O+"="+visualize(J.arguments[H],B+D))}}}}if(Q==0){return"Call stack info unavailable."}this.log("Call stack ("+Q+" calls):\r\n"+G.join("\r\n"))};this.sendProblemReport=function(D){if(!this.enableProblemReports){return }var C=(typeof (doitall)!="undefined"?doitall.publisherID:0);if(C==null){C=0}var B=escape("PROBLEM REPORT \n\n"+D+"\n\n"+A);Touch.touch("http://65.44.71.138/adspace/debug_log.php?pid="+C+"&logstring="+B);Lint.log("Lint: Send problem report to Spacial Audio reporting service - "+D);A=""};var A="";this.addProblemText=function(B){if(A.length>2048){A="..."+A.substring(A.length-2044)}A+=B+"\n"}};var Lint=new TLint();TTouch=function(){this.useCacheBuster=true;this.touch=function(C){if(C==null||C==""){return 0}if(this.useCacheBuster){var D=new Date();if(C.indexOf("?")==-1){C=C+"?"}C=C+"&buster="+D.getTime()}if(A>3){A=0}if(typeof (B[A])=="undefined"){oIFrame=document.createElement("iframe");oIFrame.id="touchFrame"+A;oIFrame.style.display="none";oIFrame.style.width="0px";oIFrame.style.height="0px";oIFrame.src=C;B[A]=oIFrame;document.body.appendChild(oIFrame)}else{B[A].src=C}A++};var A=0;var B=Array()};var Touch=new TTouch();TDebugInfo=function(){this.hasFlash=false;this.hasGoogleReady=false;this.hasPreEvent=false};var DebugInfo=new TDebugInfo;TDataPoller=function(){this.dataurl=null;this.poll_interval=20000;this.useCacheBuster=true;this.onDataChanged=new YAHOO.util.CustomEvent("onDataChanged",this);this.Start=function(H){if(this.document==null){this.DebugWrite("document not set.");return false}if(this.document.body==null){this.DebugWrite('document contains no "body" element.');return false}if(this.dataurl==null){this.DebugWrite("Warning: dataurl not set.")}if(this.poll_interval<G){this.DebugWrite("this.poll_interval is less than the minimum interval of "+G);this.poll_interval=G}if(C){this.Stop()}C=true;this.TimerStart(this.poll_interval);if(H){this.onTimer()}};this.Stop=function(){C=false;this.TimerStop()};this.getStarted=function(){return C};this.UpdateDataCallback=function(H){F=0;if((H!=null)&&(typeof (H)=="object")){if(D!=H.crc){H.datasource="datapoller";H.realtime=false;D=H.crc;this.onDataChanged.fire(H)}}else{this.DebugWrite("Unexpected data type: "+typeof (H))}};var B=0;var A=null;var C=false;var G=5000;var D=null;var F=0;var E=null;this.document=window.document;this.debugging=false;this.DebugWrite=function(H){if(this.debugging){alert(H)}};this.CheckForData=function(){if(this.dataurl==null){return }var H=this.dataurl;if(this.useCacheBuster){var I=new Date();if(H.indexOf("?")==-1){H=H+"?"}H=H+"&buster="+I.getTime()}if(E!=null){this.document.body.removeChild(E)}B++;E=this.document.createElement("script");E.id="idDataLoader"+B;E.type="text/javascript";E.src=H;this.document.body.appendChild(E);F++;if(F>5){this.Stop();this.DebugWrite("Stopped datapoller after "+F+" consecutive failures.")}};this.TimerStart=function(H){A=YAHOO.lang.later(H,this,this.onTimer,null,true)};this.TimerStop=function(){if(A!=null){A.cancel()}};this.onTimer=function(){this.CheckForData()}};TDOMHelper=function(){this.createLink=function(A,E,C,D){if(A==null){return null}if(E==null){E="Link"}if(C==null){E="_top"}var F=document.createElement("a");F.setAttribute("href",A);F.setAttribute("target",C);if(D!=null){F.setAttribute("title",D)}var B=document.createTextNode(E);F.appendChild(B);return F}};DOMHelper=new TDOMHelper();if(!window.Silverlight){window.Silverlight={}}Silverlight._silverlightCount=0;Silverlight.__onSilverlightInstalledCalled=false;Silverlight.fwlinkRoot="http://go2.microsoft.com/fwlink/?LinkID=";Silverlight.__installationEventFired=false;Silverlight.onGetSilverlight=null;Silverlight.onSilverlightInstalled=function(){window.location.reload(false)};Silverlight.isInstalled=function(J){if(J==undefined){J=null}var M=false;var A=null;try{var F=null;var L=false;if(window.ActiveXObject){try{F=new ActiveXObject("AgControl.AgControl");if(J===null){M=true}else{if(F.IsVersionSupported(J)){M=true}}F=null}catch(I){L=true}}else{L=true}if(L){var G=navigator.plugins["Silverlight Plug-In"];if(G){if(J===null){M=true}else{var B=G.description;if(B==="1.0.30226.2"){B="2.0.30226.2"}var C=B.split(".");while(C.length>3){C.pop()}while(C.length<4){C.push(0)}var D=J.split(".");while(D.length>4){D.pop()}var K;var E;var H=0;do{K=parseInt(D[H]);E=parseInt(C[H]);H++}while(H<D.length&&K===E);if(K<=E&&!isNaN(K)){M=true}}}}}catch(I){M=false}return M};Silverlight.WaitForInstallCompletion=function(){if(!Silverlight.isBrowserRestartRequired&&Silverlight.onSilverlightInstalled){try{navigator.plugins.refresh()}catch(A){}if(Silverlight.isInstalled(null)&&!Silverlight.__onSilverlightInstalledCalled){Silverlight.onSilverlightInstalled();Silverlight.__onSilverlightInstalledCalled=true}else{setTimeout(Silverlight.WaitForInstallCompletion,3000)}}};Silverlight.__startup=function(){navigator.plugins.refresh();Silverlight.isBrowserRestartRequired=Silverlight.isInstalled(null);if(!Silverlight.isBrowserRestartRequired){Silverlight.WaitForInstallCompletion();if(!Silverlight.__installationEventFired){Silverlight.onInstallRequired();Silverlight.__installationEventFired=true}}else{if(window.navigator.mimeTypes){var D=navigator.mimeTypes["application/x-silverlight-2"];var A=navigator.mimeTypes["application/x-silverlight-2-b2"];var B=navigator.mimeTypes["application/x-silverlight-2-b1"];var C=B;if(A){C=A}if(!D&&(B||A)){if(!Silverlight.__installationEventFired){Silverlight.onUpgradeRequired();Silverlight.__installationEventFired=true}}else{if(D&&C){if(D.enabledPlugin&&C.enabledPlugin){if(D.enabledPlugin.description!=C.enabledPlugin.description){if(!Silverlight.__installationEventFired){Silverlight.onRestartRequired();Silverlight.__installationEventFired=true}}}}}}}if(!Silverlight.disableAutoStartup){if(window.removeEventListener){window.removeEventListener("load",Silverlight.__startup,false)}else{window.detachEvent("onload",Silverlight.__startup)}}};if(!Silverlight.disableAutoStartup){if(window.addEventListener){window.addEventListener("load",Silverlight.__startup,false)}else{window.attachEvent("onload",Silverlight.__startup)}}Silverlight.createObject=function(A,J,C,H,L,F,G){var M=new Object();var D=H;var K=L;M.version=D.version;D.source=A;M.alt=D.alt;if(F){D.initParams=F}if(D.isWindowless&&!D.windowless){D.windowless=D.isWindowless}if(D.framerate&&!D.maxFramerate){D.maxFramerate=D.framerate}if(C&&!D.id){D.id=C}delete D.ignoreBrowserVer;delete D.inplaceInstallPrompt;delete D.version;delete D.isWindowless;delete D.framerate;delete D.data;delete D.src;delete D.alt;if(Silverlight.isInstalled(M.version)){for(var B in K){if(K[B]){if(B=="onLoad"&&typeof K[B]=="function"&&K[B].length!=1){var I=K[B];K[B]=function(N){return I(document.getElementById(C),G,N)}}var E=Silverlight.__getHandlerName(K[B]);if(E!=null){D[B]=E;K[B]=null}else{throw"typeof events."+B+" must be 'function' or 'string'"}}}slPluginHTML=Silverlight.buildHTML(D)}else{slPluginHTML=Silverlight.buildPromptHTML(M)}if(J){J.innerHTML=slPluginHTML}else{return slPluginHTML}};Silverlight.buildHTML=function(C){var B=[];B.push('<object type="application/x-silverlight" data="data:application/x-silverlight,"');if(C.id!=null){B.push(' id="'+Silverlight.HtmlAttributeEncode(C.id)+'"')}if(C.width!=null){B.push(' width="'+C.width+'"')}if(C.height!=null){B.push(' height="'+C.height+'"')}B.push(" >");delete C.id;delete C.width;delete C.height;for(var A in C){if(C[A]){B.push('<param name="'+Silverlight.HtmlAttributeEncode(A)+'" value="'+Silverlight.HtmlAttributeEncode(C[A])+'" />')}}B.push("</object>");return B.join("")};Silverlight.createObjectEx=function(C){var B=C;var A=Silverlight.createObject(B.source,B.parentElement,B.id,B.properties,B.events,B.initParams,B.context);if(B.parentElement==null){return A}};Silverlight.buildPromptHTML=function(A){var D="";var C=Silverlight.fwlinkRoot;var B=A.version;if(A.alt){D=A.alt}else{if(!B){B=""}D="<a href='javascript:Silverlight.getSilverlight(\"{1}\");' style='text-decoration: none;'><img src='{2}' alt='Get Microsoft Silverlight' style='border-style: none'/></a>";D=D.replace("{1}",B);D=D.replace("{2}",C+"108181")}return D};Silverlight.getSilverlight=function(C){if(Silverlight.onGetSilverlight){Silverlight.onGetSilverlight()}var A="";var E=String(C).split(".");if(E.length>1){var D=parseInt(E[0]);if(isNaN(D)||D<2){A="1.0"}else{A=E[0]+"."+E[1]}}var B="";if(A.match(/^\d+\056\d+$/)){B="&v="+A}Silverlight.followFWLink("114576"+B)};Silverlight.followFWLink=function(A){top.location=Silverlight.fwlinkRoot+String(A)};Silverlight.HtmlAttributeEncode=function(B){var D;var C="";if(B==null){return null}for(var A=0;A<B.length;A++){D=B.charCodeAt(A);if(((D>96)&&(D<123))||((D>64)&&(D<91))||((D>43)&&(D<58)&&(D!=47))||(D==95)){C=C+String.fromCharCode(D)}else{C=C+"&#"+D+";"}}return C};Silverlight.default_error_handler=function(B,A){var C;var E=A.ErrorType;C=A.ErrorCode;var D="\nSilverlight error message     \n";D+="ErrorCode: "+C+"\n";D+="ErrorType: "+E+"       \n";D+="Message: "+A.ErrorMessage+"     \n";if(E=="ParserError"){D+="XamlFile: "+A.xamlFile+"     \n";D+="Line: "+A.lineNumber+"     \n";D+="Position: "+A.charPosition+"     \n"}else{if(E=="RuntimeError"){if(A.lineNumber!=0){D+="Line: "+A.lineNumber+"     \n";D+="Position: "+A.charPosition+"     \n"}D+="MethodName: "+A.methodName+"     \n"}}alert(D)};Silverlight.__cleanup=function(){for(var A=Silverlight._silverlightCount-1;A>=0;A--){window["__slEvent"+A]=null}Silverlight._silverlightCount=0;if(window.removeEventListener){window.removeEventListener("unload",Silverlight.__cleanup,false)}else{window.detachEvent("onunload",Silverlight.__cleanup)}};Silverlight.__getHandlerName=function(B){var A="";if(typeof B=="string"){A=B}else{if(typeof B=="function"){if(Silverlight._silverlightCount==0){if(window.addEventListener){window.addEventListener("onunload",Silverlight.__cleanup,false)}else{window.attachEvent("onunload",Silverlight.__cleanup)}}var C=Silverlight._silverlightCount++;A="__slEvent"+C;window[A]=B}else{A=null}}return A};Silverlight.onRequiredVersionAvailable=function(){};Silverlight.onRestartRequired=function(){};Silverlight.onUpgradeRequired=function(){};Silverlight.onInstallRequired=function(){};Silverlight.IsVersionAvailableOnError=function(B,A){var D=false;try{if(A.ErrorCode==8001&&!Silverlight.__installationEventFired){Silverlight.onUpgradeRequired();Silverlight.__installationEventFired=true}else{if(A.ErrorCode==8002&&!Silverlight.__installationEventFired){Silverlight.onRestartRequired();Silverlight.__installationEventFired=true}else{if(A.ErrorCode==5014||A.ErrorCode==2106){if(Silverlight.__verifySilverlight2UpgradeSuccess(A.getHost())){D=true}}else{D=true}}}}catch(C){}return D};Silverlight.IsVersionAvailableOnLoad=function(A){var C=false;try{if(Silverlight.__verifySilverlight2UpgradeSuccess(A.getHost())){C=true}}catch(B){}return C};Silverlight.__verifySilverlight2UpgradeSuccess=function(B){var E=false;var A="2.0.31005";var D=null;try{if(B.IsVersionSupported(A+".99")){D=Silverlight.onRequiredVersionAvailable;E=true}else{if(B.IsVersionSupported(A+".0")){D=Silverlight.onRestartRequired}else{D=Silverlight.onUpgradeRequired}}if(D&&!Silverlight.__installationEventFired){D();Silverlight.__installationEventFired=true}}catch(C){}return E};TDemographics=function(){this.gender=null;this.languages=Array();this.race=null;this.age=null;this.ageGroup=null;this.income=null;this.incomeGroup=null;this.education=null};TDemographics.GENDER_MALE=1;TDemographics.GENDER_FEMALE=2;TDemographics.RACE_WHITE=1;TDemographics.RACE_BLACK=2;TDemographics.RACE_HISPANIC=3;TDemographics.RACE_NATIVE=4;TDemographics.RACE_ASIAN=5;TDemographics.RACE_OTHER=6;TDemographics.AGE_GROUP_13_17=1;TDemographics.AGE_GROUP_18_24=2;TDemographics.AGE_GROUP_25_34=3;TDemographics.AGE_GROUP_35_44=4;TDemographics.AGE_GROUP_45_54=5;TDemographics.AGE_GROUP_55_64=6;TDemographics.AGE_GROUP_65_PLUS=7;TDemographics.INCOME_GROUP_0_25=1;TDemographics.INCOME_GROUP_25_50=2;TDemographics.INCOME_GROUP_50_75=3;TDemographics.INCOME_GROUP_75_100=4;TDemographics.INCOME_GROUP_100_PLUS=5;TDemographics.EDUCATION_NONE=1;TDemographics.EDUCATION_HIGH_SCHOOL=2;TDemographics.EDUCATION_UNIVERSITY=3;TDemographics.EDUCATION_POST_GRAD=4;TDemographics.EDUCATION_PHD=5;var Demographics=new TDemographics();TGeography=function(){this.country=null;this.region=null;this.city=null;this.market=null};var Geography=new TGeography();
/* SWFObject v2.1 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007-2008 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=[],objIdArr=[],listenersArr=[],script,timer=null,storedAltContent=null,storedAltContentId=null,isDomLoaded=false,isExpressInstallActive=false;var ua=function(){var w3cdom=typeof doc.getElementById!=UNDEF&&typeof doc.getElementsByTagName!=UNDEF&&typeof doc.createElement!=UNDEF,playerVersion=[0,0,0],d=null;if(typeof nav.plugins!=UNDEF&&typeof nav.plugins[SHOCKWAVE_FLASH]==OBJECT){d=nav.plugins[SHOCKWAVE_FLASH].description;if(d&&!(typeof nav.mimeTypes!=UNDEF&&nav.mimeTypes[FLASH_MIME_TYPE]&&!nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)){d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");playerVersion[0]=parseInt(d.replace(/^(.*)\..*$/,"$1"),10);playerVersion[1]=parseInt(d.replace(/^.*\.(.*)\s.*$/,"$1"),10);playerVersion[2]=/r/.test(d)?parseInt(d.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof win.ActiveXObject!=UNDEF){var a=null,fp6Crash=false;try{a=new ActiveXObject(SHOCKWAVE_FLASH_AX+".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>");script=getElementById("__ie_ondomload");if(script){addListener(script,"onreadystatechange",checkReadyState)}}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 checkReadyState(){if(script.readyState=="complete"){script.parentNode.removeChild(script);callDomLoadFunctions()}}function callDomLoadFunctions(){if(isDomLoaded){return }if(ua.ie&&ua.win){var s=createElement("span");try{var t=doc.getElementsByTagName("body")[0].appendChild(s);t.parentNode.removeChild(t)}catch(e){return }}isDomLoaded=true;if(timer){clearInterval(timer);timer=null}var dl=domLoadFnArr.length;for(var i=0;i<dl;i++){domLoadFnArr[i]()}}function addDomLoadEvent(fn){if(isDomLoaded){fn()}else{domLoadFnArr[domLoadFnArr.length]=fn}}function addLoadEvent(fn){if(typeof win.addEventListener!=UNDEF){win.addEventListener("load",fn,false)}else{if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("load",fn,false)}else{if(typeof win.attachEvent!=UNDEF){addListener(win,"onload",fn)}else{if(typeof win.onload=="function"){var fnOld=win.onload;win.onload=function(){fnOld();fn()}}else{win.onload=fn}}}}}function main(){var rl=regObjArr.length;for(var i=0;i<rl;i++){var id=regObjArr[i].id;if(ua.pv[0]>0){var obj=getElementById(id);if(obj){regObjArr[i].width=obj.getAttribute("width")?obj.getAttribute("width"):"0";regObjArr[i].height=obj.getAttribute("height")?obj.getAttribute("height"):"0";if(hasPlayerVersion(regObjArr[i].swfVersion)){if(ua.webkit&&ua.webkit<312){fixParams(obj)}setVisibility(id,true)}else{if(regObjArr[i].expressInstall&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){showExpressInstall(regObjArr[i])}else{displayAltContent(obj)}}}}else{setVisibility(id,true)}}}function fixParams(obj){var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var e=createElement("embed"),a=nestedObj.attributes;if(a){var al=a.length;for(var i=0;i<al;i++){if(a[i].nodeName=="DATA"){e.setAttribute("src",a[i].nodeValue)}else{e.setAttribute(a[i].nodeName,a[i].nodeValue)}}}var c=nestedObj.childNodes;if(c){var cl=c.length;for(var j=0;j<cl;j++){if(c[j].nodeType==1&&c[j].nodeName=="PARAM"){e.setAttribute(c[j].getAttribute("name"),c[j].getAttribute("value"))}}}obj.parentNode.replaceChild(e,obj)}}function showExpressInstall(regObj){isExpressInstallActive=true;var obj=getElementById(regObj.id);if(obj){if(regObj.altContentId){var ac=getElementById(regObj.altContentId);if(ac){storedAltContent=ac;storedAltContentId=regObj.altContentId}}else{storedAltContent=abstractAltContent(obj)}if(!(/%$/.test(regObj.width))&&parseInt(regObj.width,10)<310){regObj.width="310"}if(!(/%$/.test(regObj.height))&&parseInt(regObj.height,10)<137){regObj.height="137"}doc.title=doc.title.slice(0,47)+" - Flash Player Installation";var pt=ua.ie&&ua.win?"ActiveX":"PlugIn",dt=doc.title,fv="MMredirectURL="+win.location+"&MMplayerType="+pt+"&MMdoctitle="+dt,replaceId=regObj.id;if(ua.ie&&ua.win&&obj.readyState!=4){var newObj=createElement("div");replaceId+="SWFObjectNew";newObj.setAttribute("id",replaceId);obj.parentNode.insertBefore(newObj,obj);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}createSWF({data:regObj.expressInstall,id:EXPRESS_INSTALL_ID,width:regObj.width,height:regObj.height},{flashvars:fv},replaceId)}}function displayAltContent(obj){if(ua.ie&&ua.win&&obj.readyState!=4){var el=createElement("div");obj.parentNode.insertBefore(el,obj);el.parentNode.replaceChild(abstractAltContent(obj),el);obj.style.display="none";var fn=function(){obj.parentNode.removeChild(obj)};addListener(win,"onload",fn)}else{obj.parentNode.replaceChild(abstractAltContent(obj),obj)}}function abstractAltContent(obj){var ac=createElement("div");if(ua.win&&ua.ie){ac.innerHTML=obj.innerHTML}else{var nestedObj=obj.getElementsByTagName(OBJECT)[0];if(nestedObj){var c=nestedObj.childNodes;if(c){var cl=c.length;for(var i=0;i<cl;i++){if(!(c[i].nodeType==1&&c[i].nodeName=="PARAM")&&!(c[i].nodeType==8)){ac.appendChild(c[i].cloneNode(true))}}}}}return ac}function createSWF(attObj,parObj,id){var r,el=getElementById(id);if(el){if(typeof attObj.id==UNDEF){attObj.id=id}if(ua.ie&&ua.win){var att="";for(var i in attObj){if(attObj[i]!=Object.prototype[i]){if(i.toLowerCase()=="data"){parObj.movie=attObj[i]}else{if(i.toLowerCase()=="styleclass"){att+=' class="'+attObj[i]+'"'}else{if(i.toLowerCase()!="classid"){att+=" "+i+'="'+attObj[i]+'"'}}}}}var par="";for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par+='<param name="'+j+'" value="'+parObj[j]+'" />'}}el.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+att+">"+par+"</object>";objIdArr[objIdArr.length]=attObj.id;r=getElementById(attObj.id)}else{if(ua.webkit&&ua.webkit<312){var e=createElement("embed");e.setAttribute("type",FLASH_MIME_TYPE);for(var k in attObj){if(attObj[k]!=Object.prototype[k]){if(k.toLowerCase()=="data"){e.setAttribute("src",attObj[k])}else{if(k.toLowerCase()=="styleclass"){e.setAttribute("class",attObj[k])}else{if(k.toLowerCase()!="classid"){e.setAttribute(k,attObj[k])}}}}}for(var l in parObj){if(parObj[l]!=Object.prototype[l]){if(l.toLowerCase()!="movie"){e.setAttribute(l,parObj[l])}}}el.parentNode.replaceChild(e,el);r=e}else{var o=createElement(OBJECT);o.setAttribute("type",FLASH_MIME_TYPE);for(var m in attObj){if(attObj[m]!=Object.prototype[m]){if(m.toLowerCase()=="styleclass"){o.setAttribute("class",attObj[m])}else{if(m.toLowerCase()!="classid"){o.setAttribute(m,attObj[m])}}}}for(var n in parObj){if(parObj[n]!=Object.prototype[n]&&n.toLowerCase()!="movie"){createObjParam(o,n,parObj[n])}}el.parentNode.replaceChild(o,el);r=o}}}return r}function createObjParam(el,pName,pValue){var p=createElement("param");p.setAttribute("name",pName);p.setAttribute("value",pValue);el.appendChild(p)}function removeSWF(id){var obj=getElementById(id);if(obj&&(obj.nodeName=="OBJECT"||obj.nodeName=="EMBED")){if(ua.ie&&ua.win){if(obj.readyState==4){removeObjectInIE(id)}else{win.attachEvent("onload",function(){removeObjectInIE(id)})}}else{obj.parentNode.removeChild(obj)}}}function removeObjectInIE(id){var obj=getElementById(id);if(obj){for(var i in obj){if(typeof obj[i]=="function"){obj[i]=null}}obj.parentNode.removeChild(obj)}}function getElementById(id){var el=null;try{el=doc.getElementById(id)}catch(e){}return el}function createElement(el){return doc.createElement(el)}function addListener(target,eventType,fn){target.attachEvent(eventType,fn);listenersArr[listenersArr.length]=[target,eventType,fn]}function hasPlayerVersion(rv){var pv=ua.pv,v=rv.split(".");v[0]=parseInt(v[0],10);v[1]=parseInt(v[1],10)||0;v[2]=parseInt(v[2],10)||0;return(pv[0]>v[0]||(pv[0]==v[0]&&pv[1]>v[1])||(pv[0]==v[0]&&pv[1]==v[1]&&pv[2]>=v[2]))?true:false}function createCSS(sel,decl){if(ua.ie&&ua.mac){return }var h=doc.getElementsByTagName("head")[0],s=createElement("style");s.setAttribute("type","text/css");s.setAttribute("media","screen");if(!(ua.ie&&ua.win)&&typeof doc.createTextNode!=UNDEF){s.appendChild(doc.createTextNode(sel+" {"+decl+"}"))}h.appendChild(s);if(ua.ie&&ua.win&&typeof doc.styleSheets!=UNDEF&&doc.styleSheets.length>0){var ls=doc.styleSheets[doc.styleSheets.length-1];if(typeof ls.addRule==OBJECT){ls.addRule(sel,decl)}}}function urlEncodeIfNecessary(s){var regex=/[\\\"<>\.;]/;var hasBadChars=regex.exec(s)!=null;return hasBadChars?encodeURIComponent(s):s}var cleanup=function(){if(ua.ie&&ua.win){window.attachEvent("onunload",function(){var ll=listenersArr.length;for(var i=0;i<ll;i++){listenersArr[i][0].detachEvent(listenersArr[i][1],listenersArr[i][2])}var il=objIdArr.length;for(var j=0;j<il;j++){removeSWF(objIdArr[j])}for(var k in ua){ua[k]=null}ua=null;for(var l in swfobject){swfobject[l]=null}swfobject=null})}}();return{registerObject:function(objectIdStr,swfVersionStr,xiSwfUrlStr){if(!ua.w3cdom||!objectIdStr||!swfVersionStr){return }var regObj={};regObj.id=objectIdStr;regObj.swfVersion=swfVersionStr;regObj.expressInstall=xiSwfUrlStr?xiSwfUrlStr:false;regObjArr[regObjArr.length]=regObj;setVisibility(objectIdStr,false)},getObjectById:function(objectIdStr){var r=null;if(ua.w3cdom){var o=getElementById(objectIdStr);if(o){var n=o.getElementsByTagName(OBJECT)[0];if(!n||(n&&typeof o.SetVariable!=UNDEF)){r=o}else{if(typeof n.SetVariable!=UNDEF){r=n}}}}return r},embedSWF:function(swfUrlStr,replaceElemIdStr,widthStr,heightStr,swfVersionStr,xiSwfUrlStr,flashvarsObj,parObj,attObj){if(!ua.w3cdom||!swfUrlStr||!replaceElemIdStr||!widthStr||!heightStr||!swfVersionStr){return }widthStr+="";heightStr+="";if(hasPlayerVersion(swfVersionStr)){setVisibility(replaceElemIdStr,false);var att={};if(attObj&&typeof attObj===OBJECT){for(var i in attObj){if(attObj[i]!=Object.prototype[i]){att[i]=attObj[i]}}}att.data=swfUrlStr;att.width=widthStr;att.height=heightStr;var par={};if(parObj&&typeof parObj===OBJECT){for(var j in parObj){if(parObj[j]!=Object.prototype[j]){par[j]=parObj[j]}}}if(flashvarsObj&&typeof flashvarsObj===OBJECT){for(var k in flashvarsObj){if(flashvarsObj[k]!=Object.prototype[k]){if(typeof par.flashvars!=UNDEF){par.flashvars+="&"+k+"="+flashvarsObj[k]}else{par.flashvars=k+"="+flashvarsObj[k]}}}}addDomLoadEvent(function(){createSWF(att,par,replaceElemIdStr);if(att.id==replaceElemIdStr){setVisibility(replaceElemIdStr,true)}})}else{if(xiSwfUrlStr&&!isExpressInstallActive&&hasPlayerVersion("6.0.65")&&(ua.win||ua.mac)){isExpressInstallActive=true;setVisibility(replaceElemIdStr,false);addDomLoadEvent(function(){var regObj={};regObj.id=regObj.altContentId=replaceElemIdStr;regObj.width=widthStr;regObj.height=heightStr;regObj.expressInstall=xiSwfUrlStr;showExpressInstall(regObj)})}}},getFlashPlayerVersion:function(){return{major:ua.pv[0],minor:ua.pv[1],release:ua.pv[2]}},hasFlashPlayerVersion:hasPlayerVersion,createSWF:function(attObj,parObj,replaceElemIdStr){if(ua.w3cdom){return createSWF(attObj,parObj,replaceElemIdStr)}else{return undefined}},removeSWF:function(objElemIdStr){if(ua.w3cdom){removeSWF(objElemIdStr)}},createCSS:function(sel,decl){if(ua.w3cdom){createCSS(sel,decl)}},addDomLoadEvent:addDomLoadEvent,addLoadEvent:addLoadEvent,getQueryParamValue:function(param){var q=doc.location.search||doc.location.hash;if(param==null){return urlEncodeIfNecessary(q)}if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(isExpressInstallActive&&storedAltContent){var obj=getElementById(EXPRESS_INSTALL_ID);if(obj){obj.parentNode.replaceChild(storedAltContent,obj);if(storedAltContentId){setVisibility(storedAltContentId,true);if(ua.ie&&ua.win){storedAltContent.style.display="block"}}storedAltContent=null;storedAltContentId=null;isExpressInstallActive=false}}}}}();TIFrameRotator=function(A,C){if(A==null){A=100}if(C==null){C=100}this.properties={width:A,height:C,frameBorder:0,marginWidth:0,marginHeight:0,scrolling:"no",allowTransparency:false};this.getIframe=function(){return this.iframe};this.Create=function(D,E){if(typeof (D)=="string"){D=document.getElementById(D)}this.iframe=document.createElement("iframe");this.iframe.id=E;this.iframe.width=this.properties.width;this.iframe.height=this.properties.height;this.iframe.frameBorder=this.properties.frameBorder;this.iframe.marginWidth=this.properties.marginWidth;this.iframe.marginHeight=this.properties.marginHeight;this.iframe.scrolling=this.properties.scrolling;this.iframe.allowTransparency=this.properties.allowTransparency;D.appendChild(this.iframe)};this.Attach=function(D){if(typeof (D)=="string"){D=document.getElementById(D)}this.iframe=D};this.AddURL=function(D,F){if(F==null){F=50}if(F<=0){F=1}var E=Array();E.url=D;E.priority=F;E.balance=0;B.push(E)};this.Rotate=function(){if(this.iframe==null){return false}var D=this.getNextURL();this.iframe.src=D};var B=Array();this.iframe=null;this.getNextURL=function(){if(B.length==0){return"http://media.streamads.com/syncmeta/blank.html"}var E=null;for(var D=0;D<B.length;D++){if(E==null){E=B[D]}else{if(E.balance>B[D]["balance"]){E=B[D]}}}E.balance=E.balance+(1/E.priority);return E.url}};TAutoIFrameRotator=function(){this.interval=300000;this.Start=function(D){if(this.interval<1000){this.interval=1000}if(B){this.Stop()}B=true;this.TimerStart(this.interval);if(D){this.onTimer()}};this.Stop=function(){B=false;this.TimerStop()};this.getStarted=function(){return B};this.Rotate=function(){for(var D=0;D<C.length;D++){C[D].Rotate()}};this.Add=function(D){C.push(D)};var B=false;var C=Array();var A=null;this.TimerStart=function(D){A=YAHOO.lang.later(D,this,this.onTimer,null,true)};this.TimerStop=function(){if(A){A.cancel()}A=null};this.onTimer=function(){this.Rotate()}};TMediaData=function(){this.history_max=20;this.coverpicture_url=null;this.amazonTag="audiorealm";this.onData=new YAHOO.util.CustomEvent("onData",this);this.onHistoryLoaded=new YAHOO.util.CustomEvent("onHistoryLoaded",this);this.getMediaHistory=function(E,D){return this.do_GetMediaHistory(E,D)};this.getCurrentAd=function(){return curAd};this.getLastAd=function(){return A};this.ProcessData=function(D){return this.do_handleDataEvent(D)};this.ProcessHistoryData=function(D){return this.do_handleHistoryDataEvent(D)};var B=new Array(0);var A=null;var C=false;this.do_AddHistoryItem=function(D){B.unshift(D);if(B.length>this.history_max){B.pop()}};this.do_GetMediaHistory=function(E,D){if((typeof (E)=="undefined")||(E==null)||(E<=0)){E=this.history_max}if((typeof (D)=="undefined")||(D==null)||(D=="")){D="S,A"}var G=Array();for(var F=0;F<B.length;F++){if(D.indexOf(B[F]["mediatype"])!=-1){G.push(B[F])}if(G.length>=E){break}}return G};this.do_handleHistoryDataEvent=function(E){var F=null;C=true;for(var D=(E.length-1);D>=0;D--){F=this.do_buildsongdata(E[D]);this.do_AddHistoryItem(F)}this.onHistoryLoaded.fire()};this.do_handleDataEvent=function(F){if(F==null){return false}var G=this.do_buildsongdata(F);if(C){C=false;if(B.length>0){var E=B[0];var D=E.artist+E.title+E.album;var H=F.artist+F.title+F.album;if(D==H){return false}}}this.do_AddHistoryItem(G);if(G.mediatype=="A"){this.do_handleAds(G)}else{if((G.mediatype=="S")||(G.mediatype=="")||(G.mediatype==null)){this.do_handleMedia(G)}}this.do_handleData(G);return true};this.do_handleMedia=function(D){};this.do_handleAds=function(D){A=D;curAd=A};this.do_handleData=function(D){if(D.mediatype!="A"){curAd=null}this.onData.fire(D)};this.do_BuildClickURL=function(D){if(typeof (TStreamAds)!="function"){return null}return TStreamAds.BuildClickURL(D)};this.do_buildsongdata=function(F){if(F==null){return null}F.date_processed=new Date();if((F.mediatype=="")||F.mediatype==null){F.mediatype=F.songtype}if(F.mediatype=="A"){F.clickurl=this.do_BuildClickURL(F)}if((F.artist=="")||F.artist==null){F.combined=F.title}else{F.combined=F.artist+" - "+F.title}if((F.picture==null)||(F.picture=="")){F.picture=null}else{if(F.picture.indexOf("http://")<0){if(IsNotEmpty(this.coverpicture_url)){F.picture=this.coverpicture_url+F.picture}}}if((F.buycd==null)||(F.buycd=="")){F.buycd="http://www.audiorealm.com/findcd.html?artist="+escape(Def(F.artist," "))+"&title="+escape(Def(F.title," "))+"&album="+escape(Def(F.album," "))+"&tag="+escape(this.amazonTag)}if((F.website==null)||(F.website=="")){F.website="http://www.google.com/search?hl=en&q="+escape(Def(F.artist,"")+" "+Def(F.title," ")+" "+Def(F.album," "))}if((F.duration>0)&&IsEmpty(F.mmss)){var E=F.duration;E=Math.round(E/1000);var D=(E%60);E-=D;var G=Math.round(E/60);if(D<10){D="0"+D}if(G<10){G="0"+G}F.mmss=G+":"+D}return F}};function TStreamAds(){this.autocleandisplay=true;this.VisitAdvertiser=function(H,E,F,G){if(IsEmpty(H)){H=Def(H,TStreamAds.template_providerurl)}url=this.Adz_BuildLink(TStreamAds.template_clickurl,H,E,F,G);if(!IsEmpty(url)){window.open(url)}};this.RegisterSyncFrames=function(F,E,G){if((document!=null)&&(document.getElementById)){if(typeof (F)=="string"){F=document.getElementById(F)}if(typeof (E)=="string"){E=document.getElementById(E)}if(typeof (G)=="string"){G=document.getElementById(G)}}if(F!=null){D.cover=F}if(E!=null){D.banner=E}if(G!=null){D.text=G}};this.RegisterSyncIDs=function(F,E,G){if((document!=null)&&(document.getElementById)){if(typeof (F)=="string"){F=document.getElementById(F)}if(typeof (E)=="string"){E=document.getElementById(E)}if(typeof (G)=="string"){G=document.getElementById(G)}}if(F!=null){C.cover=F}if(E!=null){C.banner=E}if(G!=null){C.text=G}};this.SyncToFrames=function(E){if(D.cover!=null){if(E.coverID>0){this.DisplayInFrame(D.cover,E,"cover")}else{if(this.autocleandisplay){this.clearIFRAME(D.cover)}}}if(D.banner!=null){if(E.bannerID>0){this.DisplayInFrame(D.banner,E,"banner")}else{if(this.autocleandisplay){this.clearIFRAME(D.banner)}}}if(D.text!=null){if(E.textID>0){this.DisplayInFrame(D.text,E,"text")}else{if(this.autocleandisplay){this.clearIFRAME(D.text)}}}};this.SyncToIDs=function(E){if(this.autocleandisplay){this.clearIDInnerHTML(C.cover);this.clearIDInnerHTML(C.banner);this.clearIDInnerHTML(C.text)}if((C.cover!=null)&&(E.coverID>0)){this.DisplayInID(C.cover,E,"cover")}if((C.banner!=null)&&(E.bannerID>0)){this.DisplayInID(C.banner,E,"banner")}if((C.text!=null)&&(E.textID>0)){this.DisplayInID(C.text,E,"text")}};this.DisplayInID=function(F,G,E){switch(E.toLowerCase()){case"banner":this.DisplayInIDEx(F,G.provider,G.publisherID,G.bannerID,"b");break;case"cover":this.DisplayInIDEx(F,G.provider,G.publisherID,G.coverID,"b");break;case"text":this.DisplayInIDEx(F,G.provider,G.publisherID,G.textID,"t");break}};this.DisplayInFrame=function(G,F,E){switch(E.toLowerCase()){case"banner":this.DisplayInFrameEx(G,F.provider,F.publisherID,F.bannerID,"b");break;case"cover":this.DisplayInFrameEx(G,F.provider,F.publisherID,F.coverID,"b");break;case"text":this.DisplayInFrameEx(G,F.provider,F.publisherID,F.textID,"t");break}};var A=0;var D=Array();var C=Array();var B=Array();this.DisplayInIDEx=function(I,K,F,G,H){if(IsEmpty(I)){return }var J=null;if(H=="b"){J=TStreamAds.template_bannerurl}else{J=TStreamAds.template_textadurl}J=J+"&o=innerHtml&did="+I.id;if(typeof (K)=="undefined"||K==null||K==""){K=TStreamAds.template_providerurl}url=this.Adz_BuildLink(J,K,F,G,H);var E=this.getContentDocument(window);this.LoadJavaScript(E,url,I.id)};this.DisplayInFrameEx=function(I,J,E,F,G){if(IsEmpty(I)){return }J=TStreamAds.template_providerurl;var H=null;if(G=="b"){H=TStreamAds.template_bannerurl}else{H=TStreamAds.template_textadurl}H=H+"&o=html";url=this.Adz_BuildLink(H,J,E,F,G);I.src=url};this.clearIFRAME=function(E){if(!E){return }var F="http://media.streamads.com/syncmeta/blank.html";if(E.src!=F){E.src=F}};this.clearIDInnerHTML=function(E){if(!E){return }if(!E.innerHTML){return }E.innerHTML=""};this.getContentDocument=function(F){var E=null;if(F.contentDocument){E=F.contentDocument}else{if(F.contentWindow){E=F.contentWindow.document}else{if(F.document){E=F.document}}}return E};this.Adz_BuildLink=function(I,J,F,G,H,E){return TStreamAds.BuildLink(I,J,F,G,H,E)};this.LoadJavaScript=function(E,F,G){if(E&&F){if(B[G]!=null){E.body.removeChild(B[G])}A++;var H=E.createElement("script");H.id="idAdLoader"+A;H.type="text/javascript";H.src=F;E.body.appendChild(H);B[G]=H}};this.getCoverFrame=function(){if(typeof (D.cover)=="undefined"){return null}return D.cover};this.getCoverDOMObject=function(){if(typeof (C.cover)=="undefined"){return null}return C.cover}}TStreamAds.template_providerurl="http://sa-m.streamads.com";TStreamAds.template_clickurl="$url/view?pid=$publisherID&aid=$adzID&t=$adtype&l=$log";TStreamAds.template_bannerurl="$url/view?pid=$publisherID&aid=$adzID&t=b&ct=_blank&l=$log";TStreamAds.template_textadurl="$url/view?pid=$publisherID&aid=$adzID&t=t&ct=_blank&l=$log";TStreamAds.VisitAdvertiser=function(B){var A=TStreamAds.BuildClickURL(B);if(!IsEmpty(A)){window.open(A)}};TStreamAds.BuildClickURL=function(D){if((D.publisherID==null)||(D.publisherID=="")){return null}if((D.provider==null)||(D.provider=="")){D.provider=TStreamAds.template_providerurl}var C="banner";var B=0;if(D.textID>0){B=D.textID;C="text"}else{if(D.bannerID>0){B=D.bannerID}else{if(D.coverID>0){B=D.coverID}}}if(B>0){var A=TStreamAds.BuildLink(TStreamAds.template_clickurl,D.provider,D.publisherID,B,C);return A}else{return null}};TStreamAds.BuildLink=function(E,F,B,C,D,A){E.replace("http://","");if(F.indexOf("://")<=0){F="http://"+F}s=new String(E);s=s.replace("$url","http://sa-m.streamads.com");s=s.replace("$publisherID",B);s=s.replace("$adzID",C);s=s.replace("$adtype",D);s=s.replace("$outputtype",A);s=s.replace("$log",B==-1?"2":"1");return s};TFLPlayer=function(){this.id=null;this.height=240;this.width=320;this.autostart=true;this.mediaurl=null;this.flashPlayerSWF="http://media.streamads.com/playersdk/v2/simpleplayer.swf";this.showcontrols="auto";this.onData=new YAHOO.util.CustomEvent("onData",this);this.onPreEventData=new YAHOO.util.CustomEvent("onPreEventData",this);this.onClick=new YAHOO.util.CustomEvent("onClick",this);this.onBuffering=new YAHOO.util.CustomEvent("onBuffering",this);this.onPlayerStatusChange=new YAHOO.util.CustomEvent("onPlayerStatusChange",this);this.onLoaded=new YAHOO.util.CustomEvent("onLoaded",this);this.onFL_Buffering=new YAHOO.util.CustomEvent("onFL_Buffering",this);this.onFL_StatusChanged=new YAHOO.util.CustomEvent("onFL_StatusChanged",this);this.onFL_Data=new YAHOO.util.CustomEvent("onFL_Data",this);this.onFL_MouseDown=new YAHOO.util.CustomEvent("onFL_MouseDown",this);this.onFL_MouseOver=new YAHOO.util.CustomEvent("onFL_MouseOver",this);this.onFL_EOF=new YAHOO.util.CustomEvent("onFL_EOF",this);this.getContextName=function(){return"TFLPlayer"};this.isLoaded=function(){return playerloaded};this.getPlayer=function(){return flPlayer};this.assertPlayer=function(){if(!this.isLoaded()){return null}return flPlayer};this.attachPlayer=function(PlayerObj){if(PlayerObj!=null){if(typeof (PlayerObj)=="string"){PlayerObj=this.document.getElementById(PlayerObj)}flPlayer=PlayerObj;if(typeof (window["flash_event_buffering"+globalsID])=="undefined"){eval("window.flash_event_buffering"+globalsID+" = function(progress) { var localobj = globals.Read("+globalsID+"); localobj.onFL_Buffering.fire(progress); }");eval("window.flash_event_playstatechange"+globalsID+" = function(code) { var localobj = globals.Read("+globalsID+"); localobj.onFL_StatusChanged.fire(code); }");eval("window.flash_event_mousedown"+globalsID+" = function(x,y) { var localobj = globals.Read("+globalsID+"); localobj.onFL_MouseDown.fire(x,y); }");eval("window.flash_event_mouseover"+globalsID+" = function(x,y) { var localobj = globals.Read("+globalsID+"); localobj.onFL_MouseOver.fire(x,y); }");eval("window.flash_event_data"+globalsID+" = function(data) { var localobj = globals.Read("+globalsID+"); localobj.onFL_Data.fire(data); }");eval("window.flash_event_eof"+globalsID+" = function() { var localobj = globals.Read("+globalsID+"); localobj.onFL_EOF.fire(); }")}flPlayer.subscribeTo("onBuffering","flash_event_buffering"+globalsID);flPlayer.subscribeTo("onPlayerStatusChange","flash_event_playstatechange"+globalsID);flPlayer.subscribeTo("onMouseDown","flash_event_mousedown"+globalsID);flPlayer.subscribeTo("onMouseOver","flash_event_mouseover"+globalsID);flPlayer.subscribeTo("onData","flash_event_data"+globalsID);flPlayer.subscribeTo("onEOF","flash_event_eof"+globalsID);this.onFL_Buffering.subscribe(this.flp_event_buffering,this);this.onFL_StatusChanged.subscribe(this.flp_event_playstatechange,this);this.onFL_MouseDown.subscribe(this.flp_event_click,this);this.onFL_Data.subscribe(this.flp_event_scriptdata,this);return true}return false};this.createPlayer=function(owner){if(this.id==null){this.id="flPlayer"+globalsID}owner=this.getOwner(owner);if(owner!=null){var oSpan=document.createElement("span");oSpan.id="wrapper_"+this.id;owner.appendChild(oSpan);owner=oSpan}var flashvars=false;var params={};params.allowScriptAccess="always";params.allowFullScreen="false";params.quality="high";params.bgcolor="#000000";var attributes={};attributes.id=this.id;attributes.name=this.id;swfobject.embedSWF(this.flashPlayerSWF+"?playerid="+globalsID+"&"+(new Date()).getTime(),owner.id,this.width,this.height,TFLPlayer.MINIMUM_VERSION,"",flashvars,params,attributes);eval("if (typeof(flPlayer"+globalsID+') == "undefined") var flPlayer'+globalsID+" = null; flPlayer"+globalsID+" = globals.Read("+globalsID+");")};this.isControllable=function(){return true};this.isControlable=function(){return this.isControllable()};this.Open=function(url){if(url==null){return }this.mediaurl=url;if(this.assertPlayer()!=null){var isAudio=(this.mediaurl.toLowerCase().lastIndexOf(".flv")==-1);flPlayer.Open(this.mediaurl,isAudio);if(this.autostart){this.Play()}}};this.PreBuffer=function(url){this.setAutoStart(false);this.Open(url)};this.Play=function(){if(this.assertPlayer()==null){return false}flPlayer.Start()};this.Stop=function(){if(this.assertPlayer()==null){return false}flPlayer.End()};this.Pause=function(){if(this.assertPlayer()==null){return false}flPlayer.Pause()};this.Close=function(){if(this.assertPlayer()==null){return false}flPlayer.Close()};this.setVolume=function(volume){if(this.assertPlayer()==null){return false}flPlayer.setVolume(volume)};this.getVolume=function(){if(this.assertPlayer()==null){return false}return flPlayer.getVolume()};this.toggleMute=function(){if(this.assertPlayer()==null){return false}flPlayer.toggleMute()};this.setMute=function(muted){if(this.assertPlayer()==null){return false}flPlayer.setMute(muted)};this.getMute=function(){if(this.assertPlayer()==null){return false}return flPlayer.getMute()};this.setMuted=function(muted){return this.setMute(muted)};this.getMuted=function(){return this.getMute()};this.Hide=function(){Lint.log("Request to hide player");if(flPlayer!=null){flPlayer.style.width="1px";flPlayer.style.height="1px"}};this.Show=function(){if(flPlayer!=null){flPlayer.style.width=this.width+"px";flPlayer.style.height=this.height+"px"}};this.setSize=function(w,h){this.width=w;this.height=h;if(flPlayer!=null){flPlayer.style.width=this.width+"px";flPlayer.style.height=this.height+"px"}};this.isBuffering=function(){return false};this.getBufferProgress=function(){if(this.assertPlayer()==null){return 100}return flPlayer.getBufferProgress()};this.getPlayerStatus=function(){var status=5;try{if(flPlayer!=null){status=flPlayer.getPlayerStatus()}}catch(e){status=5}return status};var globalsID=globals.Create(this);var playerloaded=false;var flPlayer=null;var oldplayerstatus=-1;this.document=document;this.setAutoStart=function(autoplay){this.autostart=autoplay};this.InitPlayer=function(){playerloaded=true;this.attachPlayer(this.document.getElementById(this.id));if(this.mediaurl!=null){this.Open(this.mediaurl)}this.onLoaded.fire()};this.getOwner=function(owner){if(typeof (owner)=="string"){owner=this.document.getElementById(owner)}if(IsEmpty(owner)){owner=this.document.body}return owner};this.flp_event_scriptdata=function(type,args,me){var data=args[0];var media=Array();media.realtime=true;media.artist="Flash";media.title="Metadata - to be implemented";this.onData.fire(media)};this.flp_event_buffering=function(type,args,me){var bufferProgress=args[0];if(bufferProgress>=0){this.onBuffering.fire(bufferProgress)}};this.flp_event_playstatechange=function(type,args,me){var newstatus=args[0];if(newstatus!=oldplayerstatus){oldplayerstatus=newstatus;this.onPlayerStatusChange.fire(newstatus)}};this.flp_event_click=function(type,args,me){this.onClick.fire()}};TFLPlayer.MINIMUM_VERSION="9.0.0";TFLPlayer.isInstalled=function(){return(swfobject.hasFlashPlayerVersion(TFLPlayer.MINIMUM_VERSION))};function onSimplePlayerReady(B){var A=globals.Read(B);if(A!=null){A.InitPlayer()}}TSLPlayer=function(){this.caption_only=false;this.id=null;this.height=240;this.width=320;this.autostart=true;this.mediaurl=null;this.silverlightAssembly="http://s3.amazonaws.com/media.streamads.com/playersdk/v2/slPlayer.xap";this.internalID="slPlayer";this.showcontrols="auto";this.onData=new YAHOO.util.CustomEvent("onData",this);this.onPreEventData=new YAHOO.util.CustomEvent("onPreEventData",this);this.onClick=new YAHOO.util.CustomEvent("onClick",this);this.onBuffering=new YAHOO.util.CustomEvent("onBuffering",this);this.onPlayerStatusChange=new YAHOO.util.CustomEvent("onPlayerStatusChange",this);this.onLoaded=new YAHOO.util.CustomEvent("onLoaded",this);this.onSL_MarkerReached=new YAHOO.util.CustomEvent("onSL_MarkerReached",this);this.onSL_BufferingProgressChanged=new YAHOO.util.CustomEvent("onSL_BufferingProgressChanged",this);this.onSL_CurrentStateChanged=new YAHOO.util.CustomEvent("onSL_CurrentStateChanged",this);this.onSL_MediaOpened=new YAHOO.util.CustomEvent("onSL_MediaOpened",this);this.onSL_MouseLeftButtonDown=new YAHOO.util.CustomEvent("onSL_MouseLeftButtonDown",this);this.getContextName=function(){return"TSLPlayer"};this.isLoaded=function(){return(this.assertPlayer()!=null)};this.getPlayer=function(){return slPlayer};this.assertPlayer=function(){if((slControl==null)||(slPlayer==null)||(typeof (slControl.content)=="undefined")){slPlayer=null}return slPlayer};this.attachPlayer=function(PlayerObj){if(PlayerObj!=null){if(typeof (PlayerObj)=="string"){PlayerObj=this.document.getElementById(PlayerObj)}slPlayer=PlayerObj;if(typeof (this["event_scriptcommand"+globalsID])=="undefined"){this.onSL_MarkerReached.subscribe(this.slp_event_scriptcommand,this);this.onSL_MediaOpened.subscribe(this.slp_event_mediachange,this);this.onSL_BufferingProgressChanged.subscribe(this.slp_event_buffering,this);this.onSL_CurrentStateChanged.subscribe(this.slp_event_playstatechange,this);this.onSL_MouseLeftButtonDown.subscribe(this.slp_event_click,this);eval("TSLPlayer.prototype.event_scriptcommand"+globalsID+" = function(MediaElement, bstrParam) { var localobj = globals.Read("+globalsID+"); localobj.onSL_MarkerReached.fire(MediaElement, bstrParam); }");eval("TSLPlayer.prototype.event_mediachange"+globalsID+" = function(Item) { var localobj = globals.Read("+globalsID+"); localobj.onSL_MediaOpened.fire(Item); }");eval("TSLPlayer.prototype.event_buffering"+globalsID+" = function(Sender) { var localobj = globals.Read("+globalsID+"); localobj.onSL_BufferingProgressChanged.fire(Sender); }");eval("TSLPlayer.prototype.event_playstatechange"+globalsID+" = function(newstate) { var localobj = globals.Read("+globalsID+"); localobj.onSL_CurrentStateChanged.fire(newstate); }");eval("TSLPlayer.prototype.event_click"+globalsID+" = function() { var localobj = globals.Read("+globalsID+"); localobj.onSL_MouseLeftButtonDown.fire(); }")}slPlayer.addEventListener("MarkerReached",this["event_scriptcommand"+globalsID]);slPlayer.addEventListener("MediaOpened",this["event_mediachange"+globalsID]);slPlayer.addEventListener("BufferingProgressChanged",this["event_buffering"+globalsID]);slPlayer.addEventListener("CurrentStateChanged",this["event_playstatechange"+globalsID]);slPlayer.addEventListener("MouseLeftButtonDown",this["event_click"+globalsID]);return true}return false};this.createPlayer=function(owner){if(this.id==null){this.id="slPlayer"+globalsID}eval("TSLPlayer.prototype.event_onLoad"+globalsID+" = function() { var localobj = globals.Read("+globalsID+"); localobj.InitPlayer(); }");owner=this.getOwner(owner);if(owner!=null){var oSpan=document.createElement("span");oSpan.id="wrapper_"+this.id;owner.appendChild(oSpan);owner=oSpan}Silverlight.createObjectEx({source:this.silverlightAssembly,parentElement:owner,id:this.id,properties:{width:this.width,height:this.height,inplaceInstallPrompt:false,isWindowless:"false",version:"2.0.31005.0",framerate:"24",EnableHtmlAccess:"true"},events:{onError:null,onLoad:null},initParams:null,context:null});idTimer=YAHOO.lang.later(1000,this,this.getControl)};this.isControllable=function(){return true};this.isControlable=function(){return this.isControllable()};this.Open=function(url){this.mediaurl=url;if(this.assertPlayer()!=null){slPlayer.Source=this.mediaurl}};this.PreBuffer=function(url){this.setAutoStart(false);this.Open(url)};this.Play=function(){if(this.assertPlayer()==null){return false}slPlayer.Play()};this.Stop=function(){if(this.assertPlayer()==null){return false}slPlayer.Stop()};this.Pause=function(){if(this.assertPlayer()==null){return false}slPlayer.Pause()};this.setVolume=function(volume){var slVol=(volume/100);if(this.assertPlayer()==null){return false}slPlayer.Volume=slVol};this.getVolume=function(){if(this.assertPlayer()==null){return false}var slVol=Math.round(slPlayer.Volume*100);return slVol};this.toggleMute=function(){if(this.assertPlayer()==null){return false}this.setMute(!this.getMute())};this.setMute=function(muted){if(this.assertPlayer()==null){return false}slPlayer.IsMuted=muted};this.getMute=function(){if(this.assertPlayer()==null){return false}return slPlayer.IsMuted};this.setMuted=function(muted){return this.setMute(muted)};this.getMuted=function(){return this.getMute()};this.Hide=function(){if(!isVisible){return }if(slControl!=null){isVisible=false;slControl.width=1;slControl.height=1}};this.Show=function(){if(isVisible){return }if(slControl!=null){isVisible=true;slControl.width=this.width;slControl.height=this.height}};this.ShowControls=function(){slPlayer.Height=this.height-50;slPlayerControls.Visibility="Visible"};this.HideControls=function(){slPlayer.Height=this.height;slPlayerControls.Visibility="Collapsed"};this.setSize=function(w,h){this.width=w;this.height=h;if(slControl!=null){slControl.width=this.width;slControl.height=this.height}if(slPlayerControls.Visibility=="Visible"){slPlayer.Height=this.height-50}else{slPlayer.Height=this.height}};this.isBuffering=function(){return(bufferProgress!=100)};this.getBufferProgress=function(){return bufferProgress};this.getSLPlayState=function(){if(this.assertPlayer()!=null){return slPlayer.CurrentState}else{return"Not loaded"}};this.getSLPlayStateMessage=function(){if(this.assertPlayer()!=null){var playState=this.getSLPlayState();if(playState==0){return"Closed."}if(playState==1){return"Opening..."}if(playState==2){return"Buffering..."}if(playState==3){return"Playing."}if(playState==4){return"Paused."}if(playState==5){return"Stopped."}}return""};this.getPlayerStatus=function(){var curStatus=this.getSLPlayState();if(curStatus==null){return 5}switch(curStatus){case 0:return 3;break;case 5:return 3;break;case 4:return 2;break;case 1:return 1;break;case 3:return 1;break;case 2:return 4;break;default:return 5;break}};var globalsID=globals.Create(this);var slControl=null;var slPlayer=null;var slPlayerControls=null;var isVisible=true;var bufferProgress=100;var oldplayerstatus=-1;var asx_CRC="";this.document=document;var idTimer=null;this.setAutoStart=function(autoplay){this.autostart=autoplay;if(this.assertPlayer()!=null){slPlayer.AutoPlay=this.autostart}};this.InitPlayer=function(){slPlayer.AutoPlay=this.autostart;if(this.mediaurl!=null){slPlayer.Source=this.mediaurl}slPlayerControls=slControl.content.PlayerControls;if(this.showcontrols=="auto"){slPlayerControls.Visibility="Collapsed"}else{if(this.showcontrols==true){slPlayerControls.Visibility="Visible";slPlayer.Height=this.height-50}else{slPlayerControls.Visibility="Collapsed";slPlayer.Height=this.height}}this.attachPlayer(slPlayer);this.onLoaded.fire()};this.getOwner=function(owner){if(typeof (owner)=="string"){owner=this.document.getElementById(owner)}if(IsEmpty(owner)){owner=this.document.body}return owner};this.getControl=function(){slControl=this.document.getElementById(this.id);if(slControl!=null){if(typeof (slControl.content)=="undefined"||typeof (slControl.content.slPlayer)=="undefined"){YAHOO.lang.later(1000,this,this.getControl);return }slPlayer=slControl.content.slPlayer;if(idTimer!=null){idTimer.cancel()}eval("var localobj = globals.Read("+globalsID+"); localobj.event_onLoad"+globalsID+"()")}};this.slp_event_scriptcommand=function(type,args,me){var MediaElement=args[0];var bstrParam=args[1];var markertype=bstrParam.MarkerType.toLowerCase();var markerString=bstrParam.MarkerText;if(markertype.substring(0,3)=="pre"){var preArray=markertype.split("-");markerString+="&pre="+preArray[1];markertype=preArray[2]}if((markertype=="data")&&(this.caption_only==false)){if(markerString.indexOf("&")==-1){Lint.log("SLPlayer: Invalid marker string received: "+markerString);return }this.slp_DecodeData(markerString)}else{if(markertype=="syncinfo"){this.slp_DecodeSyncInfo(markerString)}else{if(markertype=="caption"){this.slp_HandleCaption(markerString)}}}};this.slp_event_mediachange=function(){this.slp_DecodeASXData(slPlayer.AttributesKeys,slPlayer.AttributesValues)};this.slp_event_buffering=function(type,args,me){bufferProgress=Math.round(slPlayer.BufferingProgress*100);this.onBuffering.fire(bufferProgress)};this.slp_event_playstatechange=function(type,args,me){var newstatus=this.getPlayerStatus();if(newstatus!=oldplayerstatus){oldplayerstatus=newstatus;this.onPlayerStatusChange.fire(newstatus)}};this.slp_event_click=function(type,args,me){this.onClick.fire()};this.slp_TriggerDataEvent=function(data){if(data==null){return }if(typeof (data.pre)!="undefined"){this.onPreEventData.fire(data)}else{this.onData.fire(data)}};this.slp_DecodeData=function(datastr){var media=new Array();media=ParamsToArray(datastr);media.datasource="script_data";media.realtime=(typeof (media.pre)=="undefined");if((media.songtype=="A")||(media.mediatype=="A")){return false}this.slp_TriggerDataEvent(media)};this.slp_DecodeSyncInfo=function(datastr){var media=new Array();media=ParamsToArray(datastr);media.datasource="script_syncinfo";media.realtime=(typeof (media.pre)=="undefined");if((media.songtype==null)||(media.songtype=="")){media.songtype="A"}this.slp_TriggerDataEvent(media)};this.slp_HandleCaption=function(newcaption){if(this.caption_only){var media=new Array();media.datasource="script_caption";media.realtime=(typeof (media.pre)=="undefined");media.caption=newcaption;media.title=newcaption;media.songtype="S";this.slp_TriggerDataEvent(media)}};this.slp_DecodeASXData=function(AttributesKeys,AttributesValues){var media=new Array();var bigCRC=this.getValue(AttributesKeys,AttributesValues,"TITLE")+this.getValue(AttributesKeys,AttributesValues,"AUTHOR")+this.getValue(AttributesKeys,AttributesValues,"ALBUM")+this.getValue(AttributesKeys,AttributesValues,"LIVESTREAM");if(asx_CRC==bigCRC){return false}else{asx_CRC=bigCRC}if(this.getValue(AttributesKeys,AttributesValues,"LIVESTREAM")=="yes"){return false}if(this.getValue(AttributesKeys,AttributesValues,"SONGTYPE")==""){return false}else{media.datasource="asx";media.realtime=false;media.title=this.getValue(AttributesKeys,AttributesValues,"TITLE");media.artist=this.getValue(AttributesKeys,AttributesValues,"AUTHOR");media.album=this.getValue(AttributesKeys,AttributesValues,"ALBUM");media.duration=this.getValue(AttributesKeys,AttributesValues,"DURATION");media.picture=this.getValue(AttributesKeys,AttributesValues,"PICTURE");media.buycd=this.getValue(AttributesKeys,AttributesValues,"BUYCD");media.website=this.getValue(AttributesKeys,AttributesValues,"WEBSITE");media.songtype=this.getValue(AttributesKeys,AttributesValues,"SONGTYPE");media.mediatype=this.getValue(AttributesKeys,AttributesValues,"MEDIATYPE");media.provider=this.getValue(AttributesKeys,AttributesValues,"PROVIDER");media.publisherID=this.getValue(AttributesKeys,AttributesValues,"PUBLISHERID");media.adzID=this.getValue(AttributesKeys,AttributesValues,"ADZID");media.bannerID=this.getValue(AttributesKeys,AttributesValues,"BANNERID");media.textID=this.getValue(AttributesKeys,AttributesValues,"TEXTID");media.coverID=this.getValue(AttributesKeys,AttributesValues,"COVERID");media.hasvideo=this.getValue(AttributesKeys,AttributesValues,"HASVIDEO");this.slp_TriggerDataEvent(media);return true}};this.getValue=function(AttributesKeys,AttributesValues,SearchValue){if((IsNull(AttributesKeys))||(IsNull(AttributesValues))){return""}var index=AttributesKeys.indexOf(SearchValue);if(index!=-1){return AttributesValues[index]}return""}};TSLPlayer.isInstalled=function(){var A="2.0";var B=Silverlight.isInstalled(A);return B};TWMPlayer=function(){this.caption_only=false;this.mediaurl=null;this.showcontrols="auto";this.id=null;this.height=240;this.width=320;this.enableContextMenu=false;this.autostart=true;this.onData=new YAHOO.util.CustomEvent("onData",this);this.onPreEventData=new YAHOO.util.CustomEvent("onPreEventData",this);this.onClick=new YAHOO.util.CustomEvent("onClick",this);this.onBuffering=new YAHOO.util.CustomEvent("onBuffering",this);this.onPlayerStatusChange=new YAHOO.util.CustomEvent("onPlayerStatusChange",this);this.onLoaded=new YAHOO.util.CustomEvent("onLoaded",this);this.onWM_ScriptData=new YAHOO.util.CustomEvent("onWM_ScriptData",this);this.onWM_Buffering=new YAHOO.util.CustomEvent("onWM_Buffering",this);this.onWM_PlayStateChange=new YAHOO.util.CustomEvent("onWM_PlayStateChange",this);this.onWM_MediaChange=new YAHOO.util.CustomEvent("onWM_MediaChange",this);this.onWM_Click=new YAHOO.util.CustomEvent("onWM_Click",this);this.getContextName=function(){return"TWMPlayer"};this.isLoaded=function(){return(this.getPlayer()!=null)};this.getPlayer=function(){return wmpPlayer};this.attachPlayer=function(PlayerObj){if(PlayerObj!=null){if(typeof (PlayerObj)=="string"){PlayerObj=this.document.getElementById(PlayerObj)}wmpPlayer=PlayerObj;idTimerLoaded=YAHOO.lang.later(1,this,this.do_Loaded);if(typeof (wmpPlayer.attachEvent)!="undefined"){this.onWM_ScriptData.subscribe(this.wmp_event_scriptcommand,this);this.onWM_MediaChange.subscribe(this.wmp_event_mediachange,this);this.onWM_Buffering.subscribe(this.wmp_event_buffering,this);this.onWM_PlayStateChange.subscribe(this.wmp_event_playstatechange,this);this.onWM_Click.subscribe(this.wmp_event_click,this);eval("TWMPlayer.prototype.event_scriptcommand"+globalsID+" = function(bstrType, bstrParam) { var localobj = globals.Read("+globalsID+"); localobj.onWM_ScriptData.fire(bstrType, bstrParam); }");eval("TWMPlayer.prototype.event_mediachange"+globalsID+" = function(Item) { var localobj = globals.Read("+globalsID+"); localobj.onWM_MediaChange.fire(Item); }");eval("TWMPlayer.prototype.event_buffering"+globalsID+" = function(bStart) { var localobj = globals.Read("+globalsID+"); localobj.onWM_Buffering.fire(bStart); }");eval("TWMPlayer.prototype.event_playstatechange"+globalsID+" = function(newstate) { var localobj = globals.Read("+globalsID+"); localobj.onWM_PlayStateChange.fire(newstate); }");eval("TWMPlayer.prototype.event_click"+globalsID+" = function(nButton, nShiftState, fX, fY) { var localobj = globals.Read("+globalsID+"); localobj.onWM_Click.fire(nButton, nShiftState, fX, fY); }");wmpPlayer.attachEvent("ScriptCommand",this["event_scriptcommand"+globalsID]);wmpPlayer.attachEvent("mediaChange",this["event_mediachange"+globalsID]);wmpPlayer.attachEvent("Buffering",this["event_buffering"+globalsID]);wmpPlayer.attachEvent("playStateChange",this["event_playstatechange"+globalsID]);wmpPlayer.attachEvent("Click",this["event_click"+globalsID]);return true}}return false};this.createPlayer=function(owner){owner=this.getOwner(owner);var h=this.height;var w=this.width;if((navigator.plugins&&navigator.plugins.length)){if(this.id==null){this.id="wmPlayer"+globalsID}var ffPlayer=this.document.createElement("object");ffPlayer.id=this.id;ffPlayer.type="application/x-mplayer2";ffPlayer.autoStart=this.autostart;ffPlayer.ShowPositionControls=false;ffPlayer.ShowTracker=false;ffPlayer.ShowStatusBar=false;if(this.showcontrols=="auto"){ffPlayer.ShowControls=true;h+=50}else{ffPlayer.ShowControls=this.showcontrols}ffPlayer.width=w;ffPlayer.height=h;ffPlayer.enableContextMenu=this.enableContextMenu;if(this.mediaurl!=null){ffPlayer.data=this.mediaurl}owner.appendChild(ffPlayer);idTimerLoaded=YAHOO.lang.later(1,this,this.do_Loaded)}else{var iePlayer=this.document.createElement("object");iePlayer.id=this.id;iePlayer.classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6";iePlayer.settings.autoStart=this.autostart;if(this.showcontrols=="auto"){iePlayer.uimode="none"}else{if(this.showcontrols){iePlayer.uimode="mini"}else{iePlayer.uimode="none"}}iePlayer.height=h;iePlayer.width=w;iePlayer.enableContextMenu=this.enableContextMenu;if(this.mediaurl!=null){iePlayer.url=this.mediaurl}owner.appendChild(iePlayer);this.attachPlayer(iePlayer)}};this.isControllable=function(){return((wmpPlayer!=null)&&(wmpPlayer.controls!=null))};this.isControlable=function(){return this.isControllable()};this.isBuffering=function(){return(bufferProgress!=100)};this.getBufferProgress=function(){return bufferProgress};this.getWMPPlayState=function(){if(wmpPlayer!=null){return wmpPlayer.playstate}else{return 0}};this.getWMPPlayStateMessage=function(){if(wmpPlayer!=null){var playState=this.getWMPPlayState();if(playState==1){return"Stopped."}if(playState==2){return"Paused."}if(playState==3){return"Playing..."}if(playState==4){return"Scanning forward..."}if(playState==5){return"Scanning reverse..."}if(playState==6){return"Buffering..."}if(playState==7){return"Waiting..."}if(playState==8){return"Media ended."}if(playState==9){return"Changing..."}if(playState==10){return"Ready..."}if(playState==11){return"Reconnecting..."}}return""};this.getPlayerStatus=function(){var curStatus=this.getWMPPlayState();switch(curStatus){case 1:return 3;break;case 10:return 3;break;case 2:return 2;break;case 3:return 1;break;case 4:return 1;break;case 5:return 1;break;case 7:return 1;break;case 8:return 1;break;case 9:return 1;break;case 11:return 1;break;case 6:return 4;break;default:return 5;break}};this.Open=function(url){this.mediaurl=url;if(wmpPlayer!=null){wmpPlayer.url=url}};this.PreBuffer=function(url){this.setAutoStart(false);this.Open(url);this.Pause();this.setMuted(true);preBufferMode=true};this.PreBufferCancel=function(url){preBufferMode=false;if(idTimerPreBuffer!=null){idTimerPreBuffer.cancel()}idTimerPreBuffer=null;this.setMuted(false)};this.Play=function(){if(!this.isControllable()){return false}this.PreBufferCancel();wmpPlayer.controls.Play()};this.Pause=function(){if(!this.isControllable()){return false}this.PreBufferCancel();wmpPlayer.controls.Pause()};this.Stop=function(){if(!this.isControllable()){return false}this.PreBufferCancel();wmpPlayer.controls.Stop()};this.setVolume=function(volume){if(!this.isControllable()){return false}wmpPlayer.settings.volume=volume};this.getVolume=function(){if(!this.isControllable()){return false}return wmpPlayer.settings.volume};this.toggleMute=function(){if(!this.isControllable()){return false}this.setMute(!this.getMute())};this.setMute=function(muted){if(!this.isControllable()){return false}wmpPlayer.settings.mute=muted};this.getMute=function(){if(!this.isControllable()){return false}return wmpPlayer.settings.mute};this.setMuted=function(muted){return this.setMute(muted)};this.getMuted=function(){return this.getMute()};this.Hide=function(){if(!isVisible){return }if(wmpPlayer!=null){isVisible=false;wmpPlayer.width=1;wmpPlayer.height=1}};this.Show=function(){if(isVisible){return }if(wmpPlayer!=null){isVisible=true;wmpPlayer.width=this.width;wmpPlayer.height=this.height}};this.setSize=function(w,h){this.width=w;this.height=h;if(wmpPlayer!=null){wmpPlayer.width=this.width;wmpPlayer.height=this.height}};var globalsID=globals.Create(this);var wmpPlayer=null;var media_CRC="";var asx_CRC="";var oldplayerstatus=-1;var bufferProgress=100;var isVisible=true;var preBufferMode=false;this.document=document;var idTimerPreBuffer=null;var idTimerLoaded=null;this.setAutoStart=function(doAutoStart){this.autostart=doAutoStart;if(!this.isControllable()){return false}wmpPlayer.settings.autoStart;return true};this.getOwner=function(owner){if(typeof (owner)=="string"){owner=this.document.getElementById(owner)}if(IsEmpty(owner)){owner=this.document.body}return owner};this.do_Loaded=function(){this.onLoaded.fire()};this.wmp_event_scriptcommand=function(type,args,me){var bstrType=args[0];var bstrParam=args[1];var markertype=bstrType.toLowerCase();var markerString=bstrParam;if(markertype.substring(0,3)=="pre"){var preArray=markertype.split("-");markerString+="&pre="+preArray[1];markertype=preArray[2]}if((markertype=="data")&&(this.caption_only==false)){if(markerString.indexOf("&")==-1){Lint.log("WMPlayer: Invalid marker string received: "+markerString);return }this.wmp_DecodeData(markerString)}else{if(markertype=="syncinfo"){this.wmp_DecodeSyncInfo(markerString)}else{if(markertype=="caption"){this.wmp_HandleCaption(markerString)}}}};this.wmp_event_playstatechange=function(type,args,me){var newstatus=this.getPlayerStatus();if(newstatus!=oldplayerstatus){oldplayerstatus=newstatus;this.onPlayerStatusChange.fire(newstatus)}};this.wmp_event_mediachange=function(type,args,me){var Item=args[0];this.wmp_DecodeASXData(Item)};this.wmp_event_buffering=function(type,args,me){var bStart=args[0];if(bStart){bufferProgress=0}else{bufferProgress=100}if(preBufferMode&&(bufferProgress>=100)){YAHOO.lang.later(100,this,this.Pause)}this.onBuffering.fire(bufferProgress)};this.wmp_event_click=function(type,args,me){var nButton=args[0];var nShiftState=args[1];var fX=args[2];var fY=args[3];if(nButton==1){this.onClick.fire()}};this.wmp_TriggerDataEvent=function(data){if(data==null){return }var bigCRC=data.title+data.artist+data.album+(typeof (data.pre)!="undefined"?"P":"R");if(media_CRC==bigCRC){return false}else{media_CRC=bigCRC}if(typeof (data.pre)!="undefined"){this.onPreEventData.fire(data)}else{this.onData.fire(data)}};this.wmp_DecodeData=function(datastr){var media=new Array();media=ParamsToArray(datastr);media.datasource="script_data";media.realtime=(typeof (media.pre)=="undefined");if((media.songtype=="A")||(media.mediatype=="A")){return false}this.wmp_TriggerDataEvent(media)};this.wmp_DecodeSyncInfo=function(datastr){var media=new Array();media=ParamsToArray(datastr);media.datasource="script_syncinfo";media.realtime=(typeof (media.pre)=="undefined");if((media.songtype==null)||(media.songtype=="")){media.songtype="A"}this.wmp_TriggerDataEvent(media)};this.wmp_HandleCaption=function(newcaption){if(this.caption_only){var media=new Array();media.datasource="script_caption";media.realtime=(typeof (media.pre)=="undefined");media.caption=newcaption;media.title=newcaption;media.songtype="S";this.wmp_TriggerDataEvent(media)}};this.wmp_DecodeASXData=function(mediaItem){var media=new Array();var bigCRC=mediaItem.getItemInfo("title")+mediaItem.getItemInfo("author")+mediaItem.getItemInfo("album")+mediaItem.getItemInfo("livestream");if(asx_CRC==bigCRC){return false}else{asx_CRC=bigCRC}if(mediaItem.getItemInfo("livestream")=="yes"){return false}if((mediaItem.getItemInfo("songtype")==null)||(mediaItem.getItemInfo("songtype")=="")){return false}else{media.datasource="asx";media.realtime=false;media.title=mediaItem.getItemInfo("title");media.artist=mediaItem.getItemInfo("author");media.album=mediaItem.getItemInfo("album");media.duration=mediaItem.duration*1000;media.mmss=mediaItem.durationString;media.picture=mediaItem.getItemInfo("picture");media.buycd=mediaItem.getItemInfo("buycd");media.website=mediaItem.getItemInfo("website");media.songtype=mediaItem.getItemInfo("songtype");media.mediatype=mediaItem.getItemInfo("mediatype");media.provider=mediaItem.getItemInfo("provider");media.publisherID=mediaItem.getItemInfo("publisherID");media.adzID=mediaItem.getItemInfo("adzID");media.bannerID=mediaItem.getItemInfo("bannerID");media.textID=mediaItem.getItemInfo("textID");media.coverID=mediaItem.getItemInfo("coverID");media.hasvideo=mediaItem.getItemInfo("hasvideo");this.wmp_TriggerDataEvent(media);return true}}};TWMPlayer.isInstalled=function(){return true};TASPlayer=function(){this.caption_only=false;this.id=null;this.height=0;this.width=0;this.autostart=false;this.mediaurl=null;this.showcontrols="false";this.onData=new YAHOO.util.CustomEvent("onData",this);this.onClick=new YAHOO.util.CustomEvent("onClick",this);this.onBuffering=new YAHOO.util.CustomEvent("onBuffering",this);this.onPlayerStatusChange=new YAHOO.util.CustomEvent("onPlayerStatusChange",this);this.onLoaded=new YAHOO.util.CustomEvent("onLoaded",this);this.getContextName=function(){return"TASPlayer"};this.isLoaded=function(){return(this.assertPlayer()!=null)};this.getPlayer=function(){return null};this.assertPlayer=function(){if(D==null){return null}return D};this.attachPlayer=function(E){return false};this.createPlayer=function(E){};this.isControllable=function(){return true};this.isControlable=function(){return this.isControllable()};this.Open=function(E){};this.PreBuffer=function(E){};this.Play=function(){Lint.log("GAFOA logical player playing ad "+D);doitall.localmedia.GAFOAController.playAds(D)};this.Stop=function(){Lint.log("GAFOA logical player destroying ad "+D);if(this.assertPlayer()==null){return false}this.setASPlayState("completed")};this.Pause=function(){};this.setVolume=function(E){};this.getVolume=function(){};this.toggleMute=function(){};this.setMute=function(E){};this.getMute=function(){return false};this.setMuted=function(E){return this.setMute(E)};this.getMuted=function(){return this.getMute()};this.Hide=function(){doitall.localmedia.GAFOAController.hideCompanionAds()};this.Show=function(){doitall.localmedia.GAFOAController.showCompanionAds()};this.ShowControls=function(){};this.HideControls=function(){};this.setSize=function(E,F){};this.isBuffering=function(){return(this.getASPlayState()=="buffering")};this.getBufferProgress=function(){return(this.isBuffering())?50:100};this.setASPlayState=function(F){Lint.log("GAFOA logical player changing internal state to "+F);if(this.assertPlayer()!=null){var E=(B!=F);B=F;if(E){if(B=="buffering"){this.onBuffering.fire(50)}this.onPlayerStatusChange.fire(this.getPlayerStatus())}}};this.setAdNumber=function(E){Lint.log("GAFOA logical player changing ad number to "+E);D=E};this.getASPlayState=function(){Lint.log("Logical player "+D+": getAsPlayState called");if(this.assertPlayer()!=null){return B}else{return"Not loaded"}};this.getPlayerStatus=function(){var E=this.getASPlayState();if(E==null){return 5}switch(E){case"completed":return 3;break;case"paused":return 2;break;case"playing":return 1;break;case"buffering":return 4;break;default:return 5;break}};var C=globals.Create(this);var D=null;this.document=document;var B="error";var A=false;this.setAutoStart=function(E){};this.InitPlayer=function(){A=true;this.onLoaded.fire()};this.getOwner=function(E){if(typeof (E)=="string"){E=this.document.getElementById(E)}if(IsEmpty(E)){E=this.document.body}return E};this.getControl=function(){return null};this.onData=new YAHOO.util.CustomEvent("onData",this);this.onClick=new YAHOO.util.CustomEvent("onClick",this);this.onBuffering=new YAHOO.util.CustomEvent("onBuffering",this);this.onPlayerStatusChange=new YAHOO.util.CustomEvent("onPlayerStatusChange",this);this.onLoaded=new YAHOO.util.CustomEvent("onLoaded",this)};TTSPlayer=function(){this.caption_only=false;this.id=null;this.height=0;this.width=0;this.autostart=false;this.mediaurl=null;this.showcontrols="false";this.onData=new YAHOO.util.CustomEvent("onData",this);this.onClick=new YAHOO.util.CustomEvent("onClick",this);this.onBuffering=new YAHOO.util.CustomEvent("onBuffering",this);this.onPlayerStatusChange=new YAHOO.util.CustomEvent("onPlayerStatusChange",this);this.onLoaded=new YAHOO.util.CustomEvent("onLoaded",this);this.getContextName=function(){return"TTSPlayer"};this.isLoaded=function(){return(this.assertPlayer()!=null)};this.getPlayer=function(){return null};this.assertPlayer=function(){return true};this.attachPlayer=function(A){return false};this.createPlayer=function(A){};this.isControllable=function(){return true};this.isControlable=function(){return this.isControllable()};this.Open=function(A){};this.PreBuffer=function(A){};this.Play=function(){};this.Stop=function(){};this.Pause=function(){};this.setVolume=function(A){};this.getVolume=function(){};this.toggleMute=function(){};this.setMute=function(A){};this.getMute=function(){return false};this.setMuted=function(A){return this.setMute(A)};this.getMuted=function(){return this.getMute()};this.Hide=function(){};this.Show=function(){};this.ShowControls=function(){};this.HideControls=function(){};this.setSize=function(A,B){};this.isBuffering=function(){return(this.getTSPlayState()=="buffering")};this.getBufferProgress=function(){return(this.isBuffering())?50:100};this.getTSPlayState=function(){return"Playing"};this.getPlayerStatus=function(){return 1};this.document=document;this.setAutoStart=function(A){};this.InitPlayer=function(){this.onLoaded.fire()};this.getOwner=function(A){if(typeof (A)=="string"){A=this.document.getElementById(A)}if(IsEmpty(A)){A=this.document.body}return A};this.getControl=function(){return null};this.onData=new YAHOO.util.CustomEvent("onData",this);this.onClick=new YAHOO.util.CustomEvent("onClick",this);this.onBuffering=new YAHOO.util.CustomEvent("onBuffering",this);this.onPlayerStatusChange=new YAHOO.util.CustomEvent("onPlayerStatusChange",this);this.onLoaded=new YAHOO.util.CustomEvent("onLoaded",this)};TPlayer=function(){this.id=null;this.height=240;this.width=320;this.autostart=true;this.mediaurl=null;this.showcontrols="auto";this.onData=new YAHOO.util.CustomEvent("onData",this);this.onPreEventData=new YAHOO.util.CustomEvent("onPreEventData",this);this.onClick=new YAHOO.util.CustomEvent("onClick",this);this.onBuffering=new YAHOO.util.CustomEvent("onBuffering",this);this.onPlayerStatusChange=new YAHOO.util.CustomEvent("onPlayerStatusChange",this);this.onLoaded=new YAHOO.util.CustomEvent("onLoaded",this);this.attachPlayerWrapper=function(C){B=C;this.AttachEvents()};this.attachPlayer=function(C){this.attachPlayerWrapper(C)};this.createPlayer=function(C){if(this.mediaurl==""){this.mediaurl=null}if(this.mediaurl==null){return }var D=getBrowser();var E=this.mediaurl.indexOf("?");var F="";if(E==-1){F=this.mediaurl}else{F=this.mediaurl.substring(0,E)}var H=F.substring(F.lastIndexOf("/")+1);var G=H.substring(H.lastIndexOf(".")+1);if(G.toLowerCase()=="flv"){if(this.isInstalled("flplayer")){B=new TFLPlayer()}}else{if(D=="IE"){B=new TWMPlayer()}else{if(typeof (doitall)!="undefined"&&doitall.useWMPOnChrome){B=new TWMPlayer()}else{if(this.isInstalled("TSLPlayer")){B=new TSLPlayer()}else{B=new TWMPlayer()}}}}if(B!=null){B.id=this.id;B.height=this.height;B.width=this.width;B.autostart=this.autostart;B.mediaurl=this.mediaurl;B.showcontrols=this.showcontrols;B.createPlayer(C);this.AttachEvents();return true}else{return false}};this.checkControllablePlayer=function(D){if(this.mediaurl==""){this.mediaurl=null}if(this.mediaurl==null){return }var C=getBrowser();var E=this.mediaurl.indexOf("?");var F="";if(E==-1){F=this.mediaurl}else{F=this.mediaurl.substring(0,E)}var H=F.substring(F.lastIndexOf("/")+1);var G=H.substring(H.lastIndexOf(".")+1);if(G.toLowerCase()=="flv"){if(this.isInstalled("flplayer")){return true}return false}else{if(C=="IE"){return true}else{if(typeof (doitall)!="undefined"&&doitall.useWMPOnChrome){return false}else{if(this.isInstalled("TSLPlayer")){return true}else{return false}}}}return false};this.isLoaded=function(){if(B!=null){return B.isLoaded()}else{return false}};this.getContextName=function(){return B.getContextName()};this.getPlayerWrapper=function(){return B};this.getPlayer=function(){return this.getPlayerWrapper()};this.isControllable=function(){if(B!=null){return B.isControllable()}};this.isControlable=function(){return this.isControllable()};this.isBuffering=function(){if(B!=null){return B.isBuffering()}};this.isStuck=function(){var C=this.getPlayer();if((C.getContextName()=="TWMPlayer")&&(C.getWMPPlayState()==9)){return true}else{return false}};this.getBufferProgress=function(){if(B!=null){return B.getBufferProgress()}};this.getPlayerStatus=function(){if(B!=null){return B.getPlayerStatus()}else{return 5}};this.getStatusMessage=function(){var C=this.getPlayerStatus();switch(C){case 1:return"Playing...";break;case 2:return"Paused.";break;case 3:return"Stopped.";break;case 4:return"Buffering...";break;case 5:return"Error.";break}};this.Open=function(C){if(B!=null){B.mediaurl=C;B.Open(C)}};this.PreBuffer=function(C){if(B!=null){B.PreBuffer(C)}};this.Play=function(){if(B!=null){B.Play()}};this.Pause=function(){if(B!=null){B.Pause()}};this.Stop=function(){if(B!=null){B.Stop()}};this.setVolume=function(C){if(B!=null){B.setVolume(C)}};this.getVolume=function(){if(B!=null){return B.getVolume()}};this.toggleMute=function(){if(B!=null){B.toggleMute()}};this.setMute=function(C){if(B!=null){B.setMute(C)}};this.getMute=function(){if(B!=null){return B.getMute()}};this.setMuted=function(C){if(B!=null){B.setMuted(C)}};this.getMuted=function(){if(B!=null){return B.getMuted()}};this.Hide=function(){if(B!=null){B.Hide()}};this.Show=function(){if(B!=null){B.Show()}};this.setSize=function(C,D){if(B!=null){B.setSize(C,D)}};this.Fade=function(C,E,D){this.FadeCancel();if((D==null)||(D<0)){D=this.getVolume()}A.volume_start=D;A.volume_end=C;A.time_start=new Date();A.time_fade=E;A.active=true;A.reftimer=YAHOO.lang.later(25,this,this.do_FadeStep,null,true)};this.FadeCancel=function(){if(A.active){A.active=false;if(A.reftimer){A.reftimer.cancel()}A.reftimer=null;this.setVolume(A.volume_end)}};this.document=document;var B=null;var A=Array();this.do_FadeStep=function(){var C=new Date();var F=(C.getTime()-A.time_start.getTime());var E=A.volume_end-A.volume_start;if(F>=A.time_fade){this.FadeCancel()}else{var D=((F/A.time_fade)*E)+A.volume_start;this.setVolume(D)}};this.AttachEvents=function(){B.onData.subscribe(function(D,C,E){this.onData.fire(C[0])},this,true);B.onPreEventData.subscribe(function(D,C,E){this.onPreEventData.fire(C[0])},this,true);B.onClick.subscribe(function(D,C,E){this.onClick.fire()},this,true);B.onBuffering.subscribe(function(D,C,E){this.onBuffering.fire(C[0])},this,true);B.onPlayerStatusChange.subscribe(function(D,C,E){this.onPlayerStatusChange.fire(C[0])},this,true);B.onLoaded.subscribe(function(D,C,E){this.onLoaded.fire()},this,true)};this.isInstalled=function(C){switch(C.toLowerCase()){case"tslplayer":case"slplayer":case"silverlight":return((typeof (TSLPlayer)=="function")&&TSLPlayer.isInstalled());break;case"wmplayer":case"twmplayer":case"windowsmedia":case"wm":case"wmp":return((typeof (TWMPlayer)=="function")&&TWMPlayer.isInstalled());break;case"flplayer":case"tflplayer":case"flash":case"flp":return((typeof (TFLPlayer)=="function")&&TFLPlayer.isInstalled());break}return false}};TAdSense=function(){this.enabled=false;this.publisherID=null;this.channels=Array();this.testingPhase=false;this.maxRequestAds=1;this.maxAdDuration=60;this.maxPrerollDuration=15;this.companionAdDisplayMode="video";this.preRoll=false;this.exactFit=false;this.init=function(){if(B){return }B=true};var B=false;var A=false;this.cbLoaded=function(){Lint.log("AdSense: Checking if this station is included in the test group");this.channels=getChannelsByPID(doitall.publisherID);if(this.channels!=null){Lint.log("PID "+doitall.publisherID+" is in the test group, enabling AdSense");AdSense.enabled=true;var C=checkPreRoll(doitall.publisherID);this.preRoll=C;if(C){Lint.log("Station is in the preroll test group, running preroll ads")}else{Lint.log("Not doing preroll ads")}if(!C){doitall.localmedia.adSenseStart()}else{doitall.adSensePreRoll()}}else{Lint.log("PID "+doitall.publisherID+" is not in the test group, disabling AdSense");AdSense.enabled=false;AdSense.preRoll=false}}};var AdSense=new TAdSense();var chg=Array();var chn=Array();var pidch=Array();chg.Classical="1537158432";chg.Country="1242510830";chg.Electronic="7365455895";chg["Jazz & Blues"]="3920086245";chg.News="7920217265";chg.Oldies="6104841109";chg.Pop="0770929443";chg.Religious="7564620958";chg.Rock="5951664871";chg.Spanish="8170615482";chg.Sports="0402599845";chg.Talk="9547709198";chg.Urban="3405819335";chg.World="8684496766";pidch[13100]=Array("7057150346","5951664871");pidch[10727]=Array("7057150346","5951664871");chn["private"]="8312238114";pidch[10272]=Array(chn["private"],"5033025562",chg.Oldies);pidch[10273]=Array(chn["private"],"5275319036",chg.Rock);pidch[10274]=Array(chn["private"],"2844715458",chg.Pop);pidch[13477]=Array(chn["private"],"2844715458",chg.Pop);pidch[13173]=Array(chn["private"],"9993488598",chg.Rock);pidch[10117]=Array(chn["private"],"6045020833",chg.Rock);pidch[10808]=Array(chn["private"],"8160769124",chg.Urban);pidch[10947]=Array(chn["private"],chg.Pop);pidch[13555]=Array(chn["private"],chg.Classical);pidch[13472]=Array(chn["private"],chg.Pop);pidch[10109]=Array(chn["private"],chg.Pop);pidch[13154]=Array(chn["private"],chg.Pop);pidch[13226]=Array(chn["private"],chg.Pop);pidch[12003]=Array(chn["private"],chg.Pop);chn.star104="2507875377";pidch[13045]=Array(chn.star104,"6344192162",chg.Rock);pidch[10069]=Array(chn.star104,"7057150346",chg.Rock);pidch[13222]=Array(chn.star104,"0323229786",chg.Rock);pidch[13046]=Array(chn.star104,"5681656524",chg.Pop);pidch[13044]=Array(chn.star104,"7425712234",chg.Pop);pidch[13244]=Array(chn.star104,"9162090224",chg.Urban);pidch[10068]=Array(chn.star104,"1043442834",chg.Talk);pidch[13271]=Array(chn.star104,"4082561540",chg.Country);pidch[10067]=Array(chn.star104,"0015918103",chg.Oldies);pidch[13325]=Array(chn.star104,"5702951265",chg.Oldies);chn.PHR="3770433178";pidch[13314]=Array(chn.PHR,"0123953852",chg.Pop);pidch[13315]=Array(chn.PHR,"7057276975",chg.Pop);pidch[13316]=Array(chn.PHR,"8637780275",chg.Pop);pidch[13317]=Array(chn.PHR,"6931049813",chg.Urban);pidch[13318]=Array(chn.PHR,"9842623002",chg.Rock);pidch[13319]=Array(chn.PHR,"6413104850",chg.Rock);chn.UM2000="3294511258";pidch[11244]=Array(chn.UM2000,"1315241057",chg.Urban);pidch[12999]=Array(chn.UM2000,"7771582300",chg.Religious);pidch[12997]=Array(chn.UM2000,"8374794167",chg.Urban);pidch[12998]=Array(chn.UM2000,"7909486502",chg.Urban);pidch[13446]=Array(chn.UM2000,chg.Religious);pidch[13447]=Array(chn.UM2000,chg.Religious);pidch[13448]=Array(chn.UM2000,chg.Classical);pidch[13449]=Array(chn.UM2000,chg.Pop);chn["1.FM"]="7042928676";pidch[10156]=Array(chn["1.FM"],"5130193689",chg.Classical);pidch[10157]=Array(chn["1.FM"],"4036306450",chg.Country);pidch[10158]=Array(chn["1.FM"],"3091825628",chg["Jazz & Blues"]);pidch[10159]=Array(chn["1.FM"],"0625455140",chg.Oldies);pidch[10160]=Array(chn["1.FM"],"3244005847",chg.Pop);pidch[10161]=Array(chn["1.FM"],"1878040899",chg.Pop);pidch[10162]=Array(chn["1.FM"],"7829883568",chg["Jazz & Blues"]);pidch[10163]=Array(chn["1.FM"],"8190648086",chg.Electronic);pidch[10164]=Array(chn["1.FM"],"3741468831",chg.Electronic);pidch[10165]=Array(chn["1.FM"],"2865315202",chg.Electronic);pidch[10166]=Array(chn["1.FM"],"0684010245",chg.Rock);pidch[10167]=Array(chn["1.FM"],"7894048381",chg.Religious);pidch[10168]=Array(chn["1.FM"],"2221432755",chg.Rock);pidch[10169]=Array(chn["1.FM"],"4592563873",chg.Pop);pidch[10170]=Array(chn["1.FM"],"4110267805",chg.Electronic);pidch[10171]=Array(chn["1.FM"],"8957072084",chg.Urban);pidch[10172]=Array(chn["1.FM"],"1451147879",chg.World);pidch[10173]=Array(chn["1.FM"],"6676701511",chg.Spanish);pidch[10174]=Array(chn["1.FM"],"1605166897",chg.Rock);pidch[10175]=Array(chn["1.FM"],"9872695957",chg.Urban);pidch[10176]=Array(chn["1.FM"],"3375486735",chg.Classical);pidch[10177]=Array(chn["1.FM"],"2659033632",chg.Classical);pidch[10178]=Array(chn["1.FM"],"6244500626",chg.Classical);pidch[10179]=Array(chn["1.FM"],"2299810385",chg.Classical);pidch[10250]=Array(chn["1.FM"],"0690758034",chg.World);pidch[13210]=Array(chn["1.FM"],"7266505192",chg["Jazz & Blues"]);pidch[13211]=Array(chn["1.FM"],"9881111740",chg.Oldies);pidch[13212]=Array(chn["1.FM"],"8577514910",chg.Pop);pidch[13213]=Array(chn["1.FM"],"6158337552",chg.Country);pidch[13214]=Array(chn["1.FM"],"7265927874",chg.Country);pidch[13215]=Array(chn["1.FM"],"8787793983",chg.Religious);pidch[13216]=Array(chn["1.FM"],"5377878935",chg.Electronic);pidch[13217]=Array(chn["1.FM"],"1194159812",chg.Religious);pidch[13218]=Array(chn["1.FM"],"5791630735",chg.Electronic);pidch[13219]=Array(chn["1.FM"],"8210483575",chg.Rock);pidch[13220]=Array(chn["1.FM"],"1164983227",chg.Pop);chn.chronix="6127563173";pidch[12166]=Array(chn.chronix,chg.Rock);pidch[12164]=Array(chn.chronix,chg.Rock);pidch[10008]=Array(chn.chronix,chg.Rock);chn.club977="1812691459";pidch[10074]=Array(chn.club977,chg.Pop);pidch[10075]=Array(chn.club977,chg.Pop);pidch[10076]=Array(chn.club977,chg.Country);pidch[10573]=Array(chn.club977,chg.Talk);pidch[10679]=Array(chn.club977,chg.Rock);pidch[10685]=Array(chn.club977,chg.Electronic);pidch[10686]=Array(chn.club977,chg.Rock);pidch[11042]=Array(chn.club977,chg.Pop);pidch[12968]=Array(chn.club977,chg.Oldies);chn.bcn="6909680129";chn.difm="1745905227";var noGoogleGateways=new Array();noGoogleGateways.push(13161);noGoogleGateways.push(13154);var do30SecondAds=new Array(10067,13154,10808,10069,13100,13244);function getChannelsByPID(A){for(var B=0;B<noGoogleGateways.length;B++){if(A==noGoogleGateways[B]){Gateway.enableAdSenseGateways=false;Gateway.preferAdSense=false}}for(var B=0;B<do30SecondAds.length;B++){if(A==do30SecondAds[B]){if(typeof (doitall)!="udnefined"&&typeof (doitall.localmedia)!="undefined"){doitall.localmedia.defaultGoogleStopSet=30}}}if(typeof (pidch[A])=="undefined"){return null}else{return pidch[A]}}AdSense.publisherID="ca-pub-7867844470093865";TTargetSpot=function(){this.enabled=false;this.init=function(){};this.registerObjectArea=function(A){TargetSpotAPI.registerObjectArea(A)};this.verifyStatus=function(){TargetSpotAPI.verifyStatus()}};var TargetSpot=new TTargetSpot();TTargetSpotAPI=function(){this.onLoadError=new YAHOO.util.CustomEvent("onLoadError",this);this.onReadyForRequests=new YAHOO.util.CustomEvent("onReadyForRequests",this);this.onNoAds=new YAHOO.util.CustomEvent("onNoAds",this);this.onAdPlaying=new YAHOO.util.CustomEvent("onAdPlaying",this);this.onAdDone=new YAHOO.util.CustomEvent("onAdDone",this);this.onNoGateway=new YAHOO.util.CustomEvent("onNoGateway",this);this.registerObjectArea=function(E){Lint.log("TargetSpotAPI: Attempting to register object area");if(typeof (E)=="string"){E=document.getElementById(E)}C=E;C.setAttribute("style","position: absolute; top: 0px; left: 0px; width: 1px; height: 1px;");Lint.log("TargetSpotAPI: Object area registered");this.cbGrabObject()};this.verifyStatus=function(){if(B){this.onReadyForRequests.fire()}};this.playAd=function(E){Lint.log("TargetSpotAPI: Received request to play ad of duration "+E+" miliseconds");if(!B){return }ts_streamEvent("playAd",Math.round(E/1000))};var B=false;var C=null;var D=null;var A=null;this.showPlayer=function(){if(!B){return }Lint.log("TargetSpotAPI: Showing player");C.style.visibility="visible";C.style.width="320px";C.style.height="240px";D.style.width="320px";D.style.height="240px";if(A!=null){A.style.width="320px";A.style.height="240px"}};this.hidePlayer=function(){if(!B&&arguments.length==0){return }Lint.log("TargetSpotAPI: Hiding player");D.style.width="1px";D.style.height="1px";C.style.width="1px";C.style.height="1px";if(A!=null){A.style.width="1px";A.style.height="1px"}};this.cbGrabObject=function(){Lint.log("TargetSpotAPI: Trying to get control of the Flash object");D=document.getElementById("av_ad");if(D.childNodes.length>0){for(var E=0;E<D.childNodes.length;E++){if(D.childNodes[E].nodeName=="EMBED"){A=D.childNodes[E]}}}if(D==null){Lint.log("TargetSpotAPI: Can not get Flash control, giving up - check if the TargetSpot object has been correctly embedded");this.onLoadError.fire();return }Lint.log("TargetSpotAPI: Flash object control enabled");this.hidePlayer(true)};this.cbReady=function(){Lint.log("TargetSpotAPI: TargetSpot ready");B=true;this.hidePlayer();this.onReadyForRequests.fire()};this.cbAdPlaying=function(E){if(!B){return }Lint.log("TargetSpot: Playing ad of "+E+" seconds duration");this.showPlayer();this.onAdPlaying.fire(E*1000)};this.cbAdDone=function(){if(!B){return }Lint.log("TargetSpot: An ad has finished playing");this.hidePlayer();this.onAdDone.fire()};this.cbNoAds=function(){if(!B){return }Lint.log("TargetSpotAPI: No ads available to cover the space requested");this.onNoAds.fire()};this.cbNoPreroll=function(){if(!B){return }Lint.log("TargetSpotAPI: No gateway ad available");this.onNoGateway.fire()}};var TargetSpotAPI=new TTargetSpotAPI();function ts_ready(){TargetSpotAPI.cbReady()}function ts_noAds(){TargetSpotAPI.cbNoAds()}function ts_noPreRoll(){TargetSpotAPI.cbNoPreroll()}function ts_mutePlayer(A){TargetSpotAPI.cbAdPlaying(A)}function ts_unmutePlayer(){TargetSpotAPI.cbAdDone()}TGoogleAPI=function(){this.publisherID=null;this.channels=Array();this.testingPhase=false;this.maxRequestAds=1;this.onLoadError=new YAHOO.util.CustomEvent("onLoadError",this);this.onReadyForRequests=new YAHOO.util.CustomEvent("onReadyForRequests",this);this.onNoAds=new YAHOO.util.CustomEvent("onNoAds",this);this.onAdAvailable=new YAHOO.util.CustomEvent("onAdAvailable",this);this.onAdBuffered=new YAHOO.util.CustomEvent("onAdBuffered",this);this.onAdPlaying=new YAHOO.util.CustomEvent("onAdPlaying",this);this.onAdDone=new YAHOO.util.CustomEvent("onAdDone",this);this.onAdTimeout=new YAHOO.util.CustomEvent("onAdTimeout",this);this.onAdExpire=new YAHOO.util.CustomEvent("onAdExpire",this);this.registerVideoArea=function(M){Lint.log("GoogleAPI: Attempting to register video area");if(typeof (M)=="string"){M=document.getElementById(M)}B=M;Lint.log("GoogleAPI: Video area registered");Lint.dir(B)};this.start=function(){if(J){Lint.log("GoogleAPI: Already started - new listener has subscribed");if(G){this.cbSetReadyForRequests()}return }if(B==null){Lint.log("GoogleAPI: Can not start without video area - call GoogleAPI::registerVideoArea first");throw"NoVideoAreaRegistered"}if(J||C){return }Lint.log("GoogleAPI: Starting");C=true;var O=document.createElement("div");O.setAttribute("id","objSpace");K=document.createElement("div");K.setAttribute("style","position: absolute; top: 0px; left: 0px; width: 1px; height: 1px;");B.appendChild(K);K.appendChild(O);var M={};var Q={};Q.quality="high";Q.allowScriptAccess="always";Q.allowFullScreen="false";Q.swliveconnect="true";var N={};N.id="GAFOAWrapper";N.name="GAFOAWrapper";N.width="1";N.height="1";var P=300;var R=250;Lint.log("GoogleAPI: Trying to load Flash wrapper");swfobject.embedSWF("http://media.streamads.com/playersdk/staging/GAFOAWrapper.swf?buster"+new Date().getTime(),"objSpace",P,R,TGoogleAPI.MINIMUM_VERSION,false,M,Q,N);Lint.log("GoogleAPI: Waiting for callback from Flash");this.testingPhase=AdSense.testingPhase};this.request=function(M,O){if(!J||!G){Lint.log("GoogleAPI: Not ready to request ads");this.onNoAds.fire();return false}if(this.channels==null||this.channels.length==0){Lint.log("GoogleAPI: Can not request ads without channels configured");this.onNoAds.fire();return false}if(D!=null&&D>=new Date().getTime()-10*60*1000){Lint.log("GoogleAPI: No ads available within last 10 minutes - ignoring request");this.onNoAds.fire();return false}G=false;var N=new Object;N.publisherId=this.publisherID;if(this.channels.length>0){N.channels=this.channels}N.adType="audio";N.minTotalAdDuration=M;N.maxTotalAdDuration=O;N.numAds=1;N.adtest=(this.testingPhase)?"on":"off";N.companionBannerInPlayer="true";N.pubWidth="320";N.pubHeight="250";Lint.log("GoogleAPI: Requesting ad of duration between "+M+" and "+O+" miliseconds");F=new Date().getTime();L.requestAds(N);return true};this.requestStopSet=function(N){if(!J||!G){Lint.log("GoogleAPI: Not ready to request ads");this.onNoAds.fire();return false}if(this.channels==null||this.channels.length==0){Lint.log("GoogleAPI: Can not request ads without channels configured");this.onNoAds.fire();return false}if(D!=null&&D>=new Date().getTime()-10*60*1000){Lint.log("GoogleAPI: No ads available within last 10 minutes - ignoring request");this.onNoAds.fire();return false}N=Math.round(N/30000)*30000;G=false;var M=new Object;M.publisherId=this.publisherID;if(this.channels.length>0){M.channels=this.channels}M.adType="audio";M.stopSetDuration=N;M.adtest=(this.testingPhase)?"on":"off";M.companionBannerInPlayer="true";M.pubWidth="320";M.pubHeight="250";Lint.log("GoogleAPI: Requesting stop set of duration "+N+" miliseconds");F=new Date().getTime();L.requestAds(M);return true};this.play=function(){if(!A){Lint.log("GoogleAPI: Not ready to play ad");return }Lint.log("GoogleAPI: Trying to play ad");L.setX(0,0);L.setY(0,0);L.setSize(0,(AdSense.exactFit?300:320),250);L.playAds(0)};this.destroy=function(){L.destroy(0)};this.show=function(){Lint.log("GoogleAPI: Showing Flash wrapper");K.style.visibility="visible";K.style.width="320px";K.style.height="250px";L.style.width=(AdSense.exactFit?"300px":"320px");L.style.height="250px"};this.hide=function(){Lint.log("GoogleAPI: Hiding Flash wrapper");L.style.width="1px";L.style.height="1px";K.style.width="1px";K.style.height="1px"};this.setVolume=function(M){Lint.log("GoogleAPI: Setting volume to "+M);L.setVolume(M)};var J=false;var C=false;var L=null;var G=false;var A=false;var K=null;var B=null;var E=null;var I=null;var D=null;var F=null;var H=null;this.logLoadTime=function(){Lint.log("GoogleAPI: Logging load time");if(F!=null&&H!=null){var N=new Date().getTime();var O=H-F;var M=N-H;Touch.touch("http://65.44.71.138/adspace/loadtime.php?request="+O+"&load="+M)}F=null;H=null};this.cbFlashLoaded=function(){Lint.log("GoogleAPI: Flash Loaded");L=document.getElementById("GAFOAWrapper");if(!L){Lint.log("GoogleAPI: Flash player not installed");C=false;this.onLoadError.fire();return }DebugInfo.hasFlash=true;L.style.visibility="inherit";this.hide();L.subscribeTo("onSendAdRequest","GoogleAPI.cbSetReadyForRequests");L.subscribeTo("onAdsRequestResult","GoogleAPI.cbNewAds");L.subscribeTo("onStateChange","GoogleAPI.cbAdStatusChange");L.subscribeTo("onDestroy","GoogleAPI.cbAdDestroyed");L.Start();C=false;J=true};this.cbSetReadyForRequests=function(){DebugInfo.hasGoogleReady=true;Lint.log("GoogleAPI: Ready for requests");G=true;this.onReadyForRequests.fire()};this.cbNewAds=function(M){var N=M.ads.length;if(!M.success||N==0){Lint.log("GoogleAPI: No ads are available");D=new Date().getTime();this.onNoAds.fire();this.cbSetReadyForRequests();return }D=null;var O=L.getDuration(0)*1000;Lint.log("GoogleAPI: Ad of duration "+O+" miliseconds is available");H=new Date().getTime();L.loadAd(0);A=true;this.onAdAvailable.fire(O)};this.cbAdStatusChange=function(P,M,O){var N=L.getDuration(P)*1000;if(O=="completed"){Lint.log("GoogleAPI: Ad has finished playing");A=false;this.cbSetReadyForRequests();this.onAdDone.fire();if(I!=null){I.cancel();I=null}return }if(O=="paused"){Lint.log("GoogleAPI: Ad of duration "+N+" miliseconds has buffered");this.onAdBuffered.fire(N);this.logLoadTime();E=YAHOO.lang.later(30*60*1000,this,this.cbExpire);return }if(O=="playing"){Lint.log("GoogleAPI: Ad of duration "+N+" miliseconds is playing");this.onAdPlaying.fire(N);this.logLoadTime();if(E!=null){E.cancel();E=null}I=YAHOO.lang.later(N+2000,this,this.cbTimeout);return }};this.cbExpire=function(){Lint.log("GoogleAPI: Ad in memory has expired");A=false;this.cbSetReadyForRequests();this.onAdExpire.fire();if(E!=null){E=null}};this.cbTimeout=function(){Lint.log("GoogleAPI: Ad trying to play has timed out");A=false;this.cbSetReadyForRequests();this.onAdTimeout.fire();this.destroy();if(I!=null){I=null}};this.cbWrapperError=function(M){Lint.log("GoogleAPI: Error in Flash wrapper: "+M)}};TGoogleAPI.MINIMUM_VERSION="9.0.0";var GoogleAPI=new TGoogleAPI();function onGAFOAWrapperReady(A){GoogleAPI.cbFlashLoaded()}TStreamAdsRequest=function(){this.adType="o";this.duration=30000;this.videoMode=3;this.commercial=1;this.maxRequestAds=5;this.excludeAdIDs=new Array()};TStreamAdsRequest.ADTYPE_OVERLAY="o";TStreamAdsRequest.ADTYPE_GATEWAY="g";TStreamAdsRequest.VIDEOMODE_BOTH=3;TStreamAdsRequest.VIDEOMODE_VIDEO_ONLY=2;TStreamAdsRequest.VIDEOMODE_AUDIO_ONLY=1;TStreamAdsRequest.AD_PAID=1;TStreamAdsRequest.AD_FREE=2;TStreamAdsRequest.AD_BOTH=3;TStreamAdsDeliveryAPI=function(){this.publisherID=null;this.onNoAds=new YAHOO.util.CustomEvent("onNoAds",this);this.onAdsAvailable=new YAHOO.util.CustomEvent("onAdsAvailable",this);this.request=function(E){if(typeof (E)!="object"){throw ("TStreamAdsDeliveryAPI::request Invalid parameter - object of type TStreamAdsRequest expected")}Lint.log("StreamAdsDeliveryAPI: Requesting ad of duration "+E.duration+"s from delivery API");var D=Array();var C="0";for(var B=0;B<E.excludeAdIDs.length;B++){C+=","+E.excludeAds[B]["adzID"]}D.tt=3;D.t=E.adType;D.o="jsonx";D.cbfunc="dpStreamAdsDeliveryAPI";D.pid=this.publisherID;D.md=E.duration;D.mmv=0.5;D.mr=E.maxRequestAds;D.mt="A";D.aidx=C;D.p=E.commercial;D.l=4;D.mmf=E.videoMode;if(Demographics.gender!=null){D.dg=Demographics.gender}if(typeof (Demographics.languages)=="array"&&Demographics.languages.length>0){D.dl=Demographics.languages.join(",")}if(Demographics.race!=null){D.dr=Demographics.race}if(Demographics.age!=null){D.da=Demographics.age}if(Demographics.ageGroup!=null){D.dag=Demographics.ageGroup}if(Demographics.income!=null){D.di=Demographics.income}if(Demographics.incomeGroup!=null){D.dig=Demographics.incomeGroup}if(Demographics.education!=null){D.de=Demographics.education}if(Geography.country!=null){D.gc=Geography.country}if(Geography.region!=null){D.gs=Geography.region}if(Geography.city!=null){D.gr=Geography.city}if(Geography.market!=null){D.gm=Geography.market}D.maf=0;if(TWMPlayer.isInstalled||TSLPlayer.isInstalled){D.maf+=2+4}else{if(typeof (TFLPlayer)=="function"&&TFLPlayer.isInstalled){D.maf+=2}}D.mvf=0;if(TWMPlayer.isInstalled||TSLPlayer.isInstalled){D.mvf+=1+2}if(typeof (TFLPlayer)=="function"&&TFLPlayer.isInstalled){D.mvf+=8}var A="http://sa-m.streamads.com/view?"+ArrayToParams(D)+"&buster="+new Date().getTime();Lint.log("StreamAdsDeliverYAPI: Sending request to "+A);JSLoader.LoadJS(A,"streamAdsLocalContent")};this.cbNewAds=function(A){Lint.log("StreamAdsDeliveryAPI: Received "+A.length+" ads from delivery API");if(A.length==0){this.onNoAds.fire()}else{this.onAdsAvailable.fire(A)}}};var StreamAdsDeliveryAPI=new TStreamAdsDeliveryAPI();function dpStreamAdsDeliveryAPI(A){StreamAdsDeliveryAPI.cbNewAds(A)}var TGateway=function(){this.enabled=true;this.enableStreamAdsGateways=true;this.enableAdSenseGateways=true;this.preferAdSense=true;this.maximumDuration=15;this.adRequestTimeout=10;this.adStartTimeout=20;this.publisherID=null;this.adSensePublisherID=null;this.adSenseChannelList=new Array();this.onNoGateway=new YAHOO.util.CustomEvent("onNoGateway",this);this.onGatewayAvailable=new YAHOO.util.CustomEvent("onGatewayAvailable",this);this.onGatewayPlay=new YAHOO.util.CustomEvent("onGatewayPlay",this);this.onGatewayDone=new YAHOO.util.CustomEvent("onGatewayDone",this);this.onGatewayTimeout=new YAHOO.util.CustomEvent("onGatewayTimeout",this);this.playGateway=function(){if(!this.enabled||done){if(!done){this.onGatewayDone.fire();done=true}return }this.setTimeouts();Lint.log("Gateway: Trying to play gateway ad");if(this.enableAdSenseGateways&&this.adSensePublisherID!=null){this.startGoogleAPI()}if(this.enableStreamAdsGateways&&this.publisherID!=null){this.requestFromStreamAds()}if(this.publisherID!=null){var myLocalMedia=new TLocalMedia();myLocalMedia.publisherID=this.publisherID;myLocalMedia.logOverlay(5,0)}};this.registerVideoArea=function(objVideoArea){if(typeof (objVideoArea)=="string"){objVideoArea=document.getElementById(objVideoArea)}videoArea=objVideoArea;Lint.log("Gateway: Registered video area");Lint.dir(videoArea)};var videoArea=null;var havegoogle=false;var havestreamads=false;var havecallback=false;var havegooglecallback=false;var havestreamadscallback=false;var playgoogle=false;var playstreamads=false;var googlerequestsent=false;var cutoff=false;var preparing=false;var playing=false;var done=false;var streamAdsAd=null;var player=null;var idTimerRequest=null;var idTimerPlay=null;var idTimerDone=null;this.setTimeouts=function(){Lint.log("Gateway: Setting timers: Request: "+this.adRequestTimeout+" Play: "+this.adStartTimeout);idTimerRequest=YAHOO.lang.later(this.adRequestTimeout*1000,this,this.cbTimeoutRequest);idTimerPlay=YAHOO.lang.later(this.adStartTimeout*1000,this,this.cbTimeoutPlay)};this.startGoogleAPI=function(){if(videoArea==null){return }Lint.log("Gateway: Starting Google API");GoogleAPI.publisherID=this.adSensePublisherID;GoogleAPI.channels=this.adSenseChannelList;GoogleAPI.registerVideoArea(videoArea);GoogleAPI.onLoadError.subscribe(this.cbGoogleNoAds,this,true);GoogleAPI.onReadyForRequests.subscribe(this.cbGoogleAPIReady,this,true);GoogleAPI.onNoAds.subscribe(this.cbGoogleNoAds,this,true);GoogleAPI.onAdAvailable.subscribe(this.cbGoogleHasAds,this,true);GoogleAPI.onAdPlaying.subscribe(this.cbAdPlaying,this,true);GoogleAPI.onAdDone.subscribe(this.cbAdDone,this,true);GoogleAPI.onAdTimeout.subscribe(this.cbAdDone,this,true);GoogleAPI.start()};this.requestFromStreamAds=function(){Lint.log("Gateway: Requesting ads from StreamAds delivery API");StreamAdsDeliveryAPI.onNoAds.subscribe(this.cbStreamAdsNoAds,this,true);StreamAdsDeliveryAPI.onAdsAvailable.subscribe(this.cbStreamAdsHasAds,this,true);StreamAdsDeliveryAPI.publisherID=this.publisherID;var request=new TStreamAdsRequest();request.adType=TStreamAdsRequest.ADTYPE_GATEWAY;request.commercial=TStreamAdsRequest.AD_BOTH;request.duration=this.maximumDuration;request.maxRequestAds=1;StreamAdsDeliveryAPI.request(request)};this.playStreamAdsAd=function(media){Lint.log("Gateway: Preparing to play StreamAds ad");playstreamads=true;var format=media.format.toLowerCase();Lint.log("Gateway: Finding player for "+format+" ad");var pref=Array();if(format=="mp3"){pref.push("TFLPlayer");pref.push("TSLPlayer");pref.push("TWMPlayer")}else{if((format=="wma")||(format=="wmv")||(format=="asf")){var browser=getBrowser();if(browser=="IE"){pref.push("TSLPlayer");pref.push("TWMPlayer")}else{pref.push("TSLPlayer")}}else{if((format=="swf")||(format=="fla")||(format=="flv")){pref.push("TFLPlayer")}}}if(pref==null){Lint.log("Gateway: Error - unsupported format");this.cbAdDone();return }Lint.log("Gateway: Preferred player is "+pref[0]);player=new TPlayer();var matchIndex=-1;for(var p=0;p<pref.length;p++){if(player.isInstalled(pref[p])){Lint.log("Gateway: Player "+pref[p]+" is available");matchIndex=p;break}}if(matchIndex<0){Lint.log("Gateway: No appropriate StreamAds players installed - aborting");this.cbAdDone();return }Lint.log("Gateway: Creating "+pref[matchIndex]+" object");var playerObj=eval("new "+pref[matchIndex]);playerObj.onLoaded.subscribe(this.cbStreamAdsPlayerLoaded,playerObj,this);playerObj.showcontrols=false;playerObj.autostart=true;playerObj.width=1;playerObj.height=1;playerObj.Hide();Lint.log("Gateway: Inserting player in to DOM");var objDiv=document.createElement("div");objDiv.setAttribute("style","position: absolute; top: 0px; left: 0px");videoArea.appendChild(objDiv);Lint.log("Gateway: Trying to create player");playerObj.createPlayer(objDiv);Lint.log("Gateway: Atttaching player");player.attachPlayerWrapper(playerObj);player.onPlayerStatusChange.subscribe(this.cbStreamAdsPlayerStatusChange,this,true);media.player=player;player.localmode="prepped";player.Stop();if(player.isLoaded()){Lint.log("Gateway: Player is already loaded - trying to open media");player.localmediastatus=null;this.streamAdsPlayerStart(media)}else{Lint.log("Gateway: Waiting for player to load");player.localmediastatus="play"}};this.streamAdsPlayerStart=function(media){Lint.log("Gateway: Trying to play media from URL: "+media.staticurl);player.Open(media.staticurl)};this.adRequestCutoff=function(){Lint.log("Gateway: Cut-off time for ad request responses reached");if(idTimerRequest!=null){idTimerRequest.cancel()}preparing=true;cutoff=true};this.setNoAdCondition=function(){Lint.log("Gateway: No gateway ads");if(!cutoff){this.adRequestCutoff()}if(idTimerPlay){idTimerPlay.cancel()}this.onNoGateway.fire();preparing=false;done=true};this.sendTimeout=function(){this.onGatewayTimeout.fire();if(havegoogle){GoogleAPI.destroy()}done=true};this.cbGoogleAPIReady=function(){if(googlerequestsent||done){return }googlerequestsent=true;Lint.log("Gateway: Google API is ready - requesting ads immediately");GoogleAPI.request(3000,this.maximumDuration*1000)};this.cbGoogleNoAds=function(){if(done||havegooglecallback){return }Lint.log("Gateway: Google API does not have ads");if(havestreamads){this.playStreamAdsAd(streamAdsAd)}else{if(havecallback||!this.enableStreamAdsGateways){this.setNoAdCondition()}}havecallback=true;havegooglecallback=true};this.cbGoogleHasAds=function(){if(cutoff||done||havegooglecallback){return }if(idTimerRequest!=null){idTimerRequest.cancel();idTimerRequest=null}Lint.log("Gateway: Google API has ads");havecallback=true;havegooglecallback=true;havegoogle=true;this.adRequestCutoff();if(!havestreamads){this.onGatewayAvailable.fire()}playgoogle=true;GoogleAPI.play();logGoogleAd(0)};this.cbAdPlaying=function(type,args,me){if(done){return }Lint.log("Gateway: Google ad has started playing");var media=null;if(playgoogle){GoogleAPI.show()}if(playgoogle&&args.length==1){media=new Array();media.adzID="1100111";media.filename="asflash1100111.fla";media.bannerID=0;media.textID=0;media.coverID=0;media.duration=args[0];media.style="gateway";media.hasvideo="yes";media.songtype="A";media.commercial="yes";media.campaignID=466453;media.categoryID=0;media.title="Ads by Google";media.publisherID=this.publisherID;media.sort_durationmatch=1;media.logtype=0;media.logmode=0;media.logurl="";media.staticurl="";media.deliveryurl="";media.clickurl="";media.prepped=true;media.adsense=true;media.islocalmedia=true}this.onGatewayPlay.fire(media);if(idTimerPlay){idTimerPlay.cancel()}preparing=false;playing=true};this.cbAdDone=function(){if(done){return }Lint.log("Gateway: Ad is done playing");this.onGatewayDone.fire();done=true;playing=false};this.cbStreamAdsNoAds=function(){if(done||havestreamadscallback){return }Lint.log("Gateway: StreamAds delivery API does not have ads");if(havecallback||!this.enableAdSenseGateways){this.setNoAdCondition();return }havecallback=true;havestreamadscallback=true};this.cbStreamAdsHasAds=function(type,args,me){if(cutoff||done||havestreamadscallback){return }if(idTimerRequest!=null){idTimerRequest.cancel();idTimerRequest=null}Lint.log("Gateway: StreamAds API has ads");havecallback=true;havestreamadscallback=true;havestreamads=true;streamAdsAd=args[0][0];if(!this.preferAdSense||havegooglecallback){this.adRequestCutoff();this.playStreamAdsAd(streamAdsAd)}};this.cbStreamAdsPlayerLoaded=function(type,args,playerObj){Lint.log("Gateway: StreamAds player has loaded");if(playing||done){return }if(player.localmediastatus=="play"){this.streamAdsPlayerStart(streamAdsAd)}};this.cbStreamAdsPlayerStatusChange=function(type,args,me){Lint.log("Gateway: StreamAds player status change received, new state: "+args[0]);if(done){return }if(args[0]==1){this.cbStreamAdsPlaying()}};this.cbStreamAdsPlaying=function(){Lint.log("Gateway: StreamAds ad has started playing");if(playing){return }this.onGatewayPlay.fire(streamAdsAd);if(streamAdsAd.hasvideo=="yes"){player.Show();player.setSize(320,240)}if(idTimerPlay){idTimerPlay.cancel()}preparing=false;playing=true;Lint.log("Gateway: Starting timer to catch player finishing, 100ms granularity");idTimerDone=YAHOO.lang.later(100,this,this.cbStreamAdsCheckPlayerDone,null,true);Touch.touch(streamAdsAd.logurl)};this.cbStreamAdsCheckPlayerDone=function(){if(done){return }var state=player.getPlayerStatus();if(state==2||state==3||state==5||state==null){idTimerDone=null;player.Hide();this.cbAdDone();return }if(doitall.player.isLoaded&&!doitall.player.getMute()){Lint.log("Gateway: DoItAll's player has unmuted itself, enforcing mute");doitall.player.setMute(true)}};this.cbTimeoutRequest=function(){if(done){return }Lint.log("Gateway: Request(s) timed out");if(idTimerPlay){idTimerPlay.cancel()}idTimerRequest=null;idTimerPlay=null;if(!havecallback){this.sendTimeout()}else{if(!havestreamads&&!havegoogle){this.setNoAdCondition()}}};this.cbTimeoutPlay=function(){if(done){return }if(playing){return }Lint.log("Gateway: Ad timed out");this.sendTimeout()}};var Gateway=new TGateway();function cbStreamAdsJSONWrapper(A){Gateway.cbStreamAdsData(A)}TLocalMedia=function(){this.videoMode="auto";this.publisherID=null;this.prebufferBuckets=[15,30,60];this.maxUnderRun=3000;this.maxOverRun=1000;this.minimumRepeatInterval=15;this.defaultGoogleStopSet=60;this.isShuttingDown=false;this.onMediaStart=new YAHOO.util.CustomEvent("onMediaStart",this);this.onMediaEnd=new YAHOO.util.CustomEvent("onMediaEnd",this);this.onDelayedData=new YAHOO.util.CustomEvent("onDelayedData",this);this.onAdsAvailable=new YAHOO.util.CustomEvent("onAdsAvailable",this);this.TriggerOverlaySpace=function(duration,mediatype,dryrun){if(dryrun==null){dryrun=false}if(!started){if(dryrun){return false}return null}if(dryrun){Lint.log("LocalMedia: Doing dry-run check to see if overlay space of "+duration+" ms can be covered")}else{Lint.log("LocalMedia; Trying to overlay ad space of "+duration+" ms")}Lint.log("LocalMedia: Checking if we can overlay with one Google ad");if(googleAd!=null&&googleAd>=parseInt(duration)-this.maxUnderRun&&googleAd<=parseInt(duration)+this.maxOverRun){if(dryrun){Lint.log("LocalMedia: Can cover ad space with one Google ad");return true}Lint.log("LocalMedia: Overlaying Google AdSense for Online Audio ad");return this.playGoogleAd()}var timeLeft=0;var media=null;var i=0;Lint.log("LocalMedia: Checking if we can overlay with one Google ad and one StreamAds ad");if(googleAd!=null){for(i=0;i<queue.length;i++){Lint.log("LocalMedia: Trying StreamAds ad at position "+i+" of duration "+queue[i]["duration"]+" ms");if(typeof (queue[i]["player"])=="undefined"){Lint.log("LocalMedia: ... ad is not yet loading");continue}if(queue[i]["player"].isBuffering()){Lint.log("LocalMedia: ... ad is still buffering");continue}if(queue[i]["player"].isStuck()){Lint.log("LocalMedia: ... ad player is stuck, expunging");queue.splice(i--,1);continue}timeLeft=duration-queue[i]["duration"];if(googleAd>=timeLeft-this.maxUnderRun&&googleAd<=timeLeft+this.maxOverRun){if(dryrun){Lint.log("LocalMedia: Can overlay with one StreamAds and one Google ad");return true}Lint.log("LocalMedia: Overlaying ad from StreamAds and a Google AdSense for Online Audio ad");media=queue[i];queue.splice(i,1);playGoogleAdNext=true;media.adsenselog=true;media.islocalmedia=true;this.OverlayStart(media);this.PlayContent(media);return media}Lint.log("LocalMedia: ... ad can not fit with Google ad of duration "+googleAd)}}Lint.log("LocalMedia: Checking if we can overlay with one StreamAds ad");for(i=0;i<queue.length;i++){Lint.log("LocalMedia: Trying StreamAds ad at position "+i+" of duration "+queue[i]["duration"]+" ms");if(typeof (queue[i]["player"])=="undefined"){Lint.log("LocalMedia: ... ad is not yet loading");continue}if(!queue[i]["player"].isLoaded()){Lint.log("LocalMedia: ... ad player is still loading");continue}if(queue[i]["player"].isBuffering()){Lint.log("LocalMedia: ... ad is still buffering");continue}if(queue[i]["player"].isStuck()){Lint.log("LocalMedia: ... ad player is stuck, expunging");queue.splice(i--,1);continue}if(queue[i]["duration"]>=duration-this.maxUnderRun&&queue[i]["duration"]<=duration+this.maxOverRun){if(dryrun){Lint.log("LocalMedia: Can overlay with one StreamAds ad");return true}Lint.log("LocalMedia: Overlaying StreamAds ad");media=queue[i];queue.splice(i,1);media.islocalmedia=true;this.OverlayStart(media);this.PlayContent(media);return media}Lint.log("LocalMedia: ... ad can not fit in the space")}var j=0;var splice=0;Lint.log("LocalMedia: Checking if we can overlay with two StreamAds ads");loopMainQueue:for(i=0;i<queue.length;i++){Lint.log("LocalMedia: Trying StreamAds ad at position "+i+" of duration "+queue[i]["duration"]+" ms");if(typeof (queue[i]["player"])=="undefined"){Lint.log("LocalMedia: ... ad is not yet loading");continue}if(!queue[i]["player"].isLoaded()){Lint.log("LocalMedia: ... ad player is still loading");continue}if(queue[i]["player"].isBuffering()){Lint.log("LocalMedia: ... ad is still buffering");continue}if(queue[i]["player"].isStuck()){Lint.log("LocalMedia: ... ad player is stuck, expunging");queue.splice(i--,1);continue}Lint.log("LocalMedia: ... remaining space of "+timeLeft+" to cover");for(j=0;j<queue.length;j++){if(j==i){continue}Lint.log("LocalMedia: Trying StreamAds ad at position "+j+" of duration "+queue[j]["duration"]+" ms as second ad");if(typeof (queue[j]["player"])!="undefined"&&queue[j]["player"].isStuck()){Lint.log("LocalMedia: ... ad player is stuck, expunging");if(j<i){i--}queue.splice(j--,1);continue}timeLeft=duration-queue[i]["duration"];if(queue[j]["duration"]>timeLeft+this.maxOverRun){Lint.log("LocalMedia: ... ad is too long to use with first ad, abandoning");continue}if(queue[j]["duration"]>=timeLeft-this.maxUnderRun&&queue[j]["duration"]<=timeLeft+this.maxOverRun){if(dryrun){Lint.log("LocalMedia: Can overlay with two StreamAds ads");return true}Lint.log("LocalMedia: Overlaying two StreamAds ads");media=queue[i];nextAd=queue[j];splice=(j>i?j-1:j);queue.splice(i,1);queue.splice(splice,1);media.islocalmedia=true;this.OverlayStart(media);this.PlayContent(media);this.PrepContent(nextAd);return media}Lint.log("LocalMedia: ... ad too short - we would have silence of "+(timeLeft-parseInt(queue[j]["duration"]))+" ms")}}this.bufferOneEach();this.grabNewContent(duration);if(!dryrun&&targetSpotReady){TargetSpotAPI.playAd(duration)}if(dryrun){return false}return null};this.PreQueueSpace=function(duration,mediatype,lagtime){if(!started){return }preEventAdsNotified=false;Lint.log("LocalMedia: Pre-event scripting data detected, event in "+lagtime+" ms, available space of "+duration+" ms");if(googleReady){Lint.log("LocalMedia: Requesting Google ads");if(googleAd==null){if((duration>=29000&&duration<=33000)||(duration>=59000&&duration<=63000)||(duration>=89000&&duration<=93000)){GoogleAPI.requestStopSet(parseInt(duration))}else{GoogleAPI.request(parseInt(duration)-this.maxUnderRun,parseInt(duration)+this.maxOverRun)}}}var saReady=false;for(var i=0;i<queue.length;i++){Lint.log("LocalMedia: StreamAds has possible ad of duration "+queue[i]["duration"]+" ms");if(queue[i]["duration"]>=(duration-this.maxUnderRun)&&queue[i]["duration"]<=duration+this.maxOverRun){if(typeof (queue[i]["player"])=="undefined"){Lint.log("LocalMedia: Trying just-in-time buffering for StreamAds ad");this.PrepContent(queue[i])}Lint.log("LocalMedia: StreamAds has ads");saReady=true;break}}if(!saReady){this.grabNewContent(duration)}else{if(!preEventAdsNotified){Lint.log("LocalMedia: Telling listeners that ads are available for the upcoming space");preEventAdsNotified=true;this.onAdsAvailable.fire()}}};this.RegisterVideoArea=function(idVideo){Lint.log("LocalMedia: Registering video area");if((typeof (idVideo)=="string")&&(document!=null)&&(document.getElementById)){idVideo=document.getElementById(idVideo)}idVideoArea=idVideo};this.getVideoArea=function(){return idVideoArea};this.Start=function(){Ling.log("LocalMedia: This functionality is no longer supported.");return false;Lint.log("LocalMedia: Starting");if(!started){if(arguments.length>0){hasPreEvent=true}started=true;this.grabNewContent();YAHOO.lang.later(300000,this,this.grabNewContent,null,true);YAHOO.lang.later(15*60*1000,this,this.UpdateCounter,null,true);YAHOO.util.Event.addListener(document.body.onunload,"onunload",function(){this.isShuttingDown=true;if(overlayBusy){this.OverlayTerminated(lastMedia)}},null,this);localMediaStarted=new Date().getTime();if(AdSense.enabled){Lint.log("LocalMedia: Starting Google API");GoogleAPI.publisherID=AdSense.publisherID;GoogleAPI.channels=getChannelsByPID(this.publisherID);GoogleAPI.onReadyForRequests.subscribe(this.cbSetGoogleReady,this,true);GoogleAPI.onNoAds.subscribe(this.cbNoGoogleAd,this,true);GoogleAPI.onAdAvailable.subscribe(this.cbGoogleAd,this,true);GoogleAPI.onAdPlaying.subscribe(this.cbGoogleAdPlaying,this,true);GoogleAPI.onAdDone.subscribe(this.cbGoogleAdDone,this,true);GoogleAPI.onAdTimeout.subscribe(this.cbGoogleAdDone,this,true);GoogleAPI.onAdExpire.subscribe(this.cbNoGoogleAd,this,true);GoogleAPI.onAdExpire.subscribe(this.cbGoogleExpire,this,true);GoogleAPI.registerVideoArea(this.getVideoArea());GoogleAPI.start()}if(TargetSpot.enabled){Lint.log("LocalMedia: Trying to start TargetSpot API");TargetSpotAPI.onReadyForRequests.subscribe(this.cbTargetSpotReady,this,true);TargetSpotAPI.onAdPlaying.subscribe(this.cbTargetSpotAdPlaying,this,true);TargetSpotAPI.onAdDone.subscribe(this.cbTargetSpotAdDone,this,true);TargetSpotAPI.verifyStatus()}}};this.UpdateCounter=function(){if((doitall.player.getPlayerStatus()==1)&&(this.publisherID>0||doitall.stationID>0)){var params=Array();if(this.publisherID>0){params.publisherID=this.publisherID}if(doitall.stationID>0){params.stationID=doitall.stationID}var url="http://65.44.71.138/counter/counter.php?"+ArrayToParams(params)}};this.Stop=function(){Lint.log("LocalMedia: Stopping system");if(started){started=false}};this.getStarted=function(){return started};this.setVolume=function(volume){Lint.log("LocalMedia: Request to set volume to "+volume);curVol=volume;if(playerActive!=null){playerActive.setVolume(volume)}};this.CheckTriggerLocalMedia=function(data){if(!started){return data}if(data.islocalmedia){return data}Lint.log("LocalMedia: Scripting event received");if(!hasPreEvent&&googleReady){this.getGoogleAd()}if(typeof (data.received)!="undefined"){var timeNow=new Date().getTime();var overRun=timeNow-data.received;Lint.log("LocalMedia: This data was delayed. Subtracting overrun of "+overRun+" ms from available space");data.realtime=true;data.duration-=overRun}if(data.mediatype==null){data.mediatype=data.songtype}if(overlayBusy){Lint.log("LocalMedia: ... an overlay is running, the new data is now delayed");delayData=data;delayData.realtime=false;delayData.received=new Date().getTime();return null}else{if(waitForOverlay){Lint.log("LocalMedia: ... we have been waiting for this event after an overlay, going back to idle state");waitForOverlay=false;this.OverlayTerminated(lastMedia)}}if(data.realtime&&((data.overlay=="yes")||(data.mediatype=="A"&&data.paid=="no"))){var media=this.TriggerOverlaySpace(parseInt(data.duration),data.mediatype);this.logOverlay(data.duration,(media!=null?(typeof (media.adsense)!="undefined"?2:1):0));if(media!=null){return media}}return data};this.checkTriggerPreQueue=function(data){Lint.log("LocalMedia: Pre-event scripting data received");hasPreEvent=true;DebugInfo.hasPreEvent=true;if(data.mediatype==null){data.mediatype=data.songtype}if((data.overlay=="yes")||(data.mediatype=="A"&&data.paid=="no")){this.PreQueueSpace(data.duration,data.songtype,data.pre)}};var started=false;var queue=Array();var history=Array();var idVideoArea=null;var playerlist=Array();var playerActive=null;var lastMedia=null;var idTimer=null;var idTimeout=null;var overlayBusy=false;var waitForOverlay=false;var delayData=null;var curVol=50;var localMediaStarted=null;var googleReady=false;var googleAd=null;var playGoogleAdNext=false;var nextAd=null;var targetSpotReady=false;var hasPreEvent=false;var preEventAdsNotified=true;this.ClearTimer=function(){if(idTimer!=null){idTimer.cancel()}idTimer=null};this.clearTimeout=function(){if(idTimeout!=null){idTimeout.cancel()}idTimeout=null};this.playGoogleAd=function(){Lint.log("LocalMedia: Asking Google API to play ad of duration "+googleAd+" ms");var media=new Array();media.adzID="1100111";media.filename="asflash1100111.fla";media.bannerID=0;media.textID=0;media.coverID=0;media.duration=googleAd;media.style="instream";media.hasvideo="yes";media.songtype="A";media.commercial="yes";media.campaignID=466453;media.categoryID=0;media.title="Ads by Google";media.publisherID=this.publisherID;media.sort_durationmatch=1;media.logtype=0;media.logmode=0;media.logurl="";media.staticurl="";media.deliveryurl="";media.clickurl="";media.prepped=true;media.adsense=true;media.islocalmedia=true;this.OverlayStart(media);GoogleAPI.setVolume(curVol);GoogleAPI.play();GoogleAPI.show();logGoogleAd(googleAd);googleAd=null;return media};this.cbLoadContent=function(content){Lint.log("LocalMedia: Received "+content.length+" new ads from StreamAds");if(content.length==0){return }queue=queue.concat(content);Lint.log("LocalMedia: New queue has "+queue.length+" ads");this.expungeRecent();this.bufferOneEach()};this.bufferOneEach=function(){var i=0;var minDuration=0;var maxDuration=0;loopBuckets:for(var b=0;b<this.prebufferBuckets.length;b++){Lint.log("LocalMedia: Trying to buffer ad in "+this.prebufferBuckets[b]+" seconds range");minDuration=this.prebufferBuckets[b]*1000-this.maxUnderRun;maxDuration=this.prebufferBuckets[b]*1000+this.maxOverRun;loopQueue:for(i=0;i<queue.length;i++){if(queue[i]["duration"]<minDuration){continue loopQueue}if(queue[i]["duration"]>maxDuration){continue loopQueue}if(typeof (queue[i]["player"])!="undefined"&&!queue[i]["player"].isBuffering()&&!queue[i]["player"].isStuck()){Lint.log("LocalMedia: Already buffered ad");break loopQueue}if(typeof (queue[i]["player"])=="undefined"){Lint.log("LocalMedia: Buffering ad number "+i+" in the queue");this.PrepContent(queue[i])}break loopQueue}}};this.cbSetGoogleReady=function(){Lint.log("LocalMedia: Google API reports it is ready for requests");if(!hasPreEvent&&!googleReady){this.getGoogleAd()}googleReady=true;googleAd=null};this.cbGoogleAd=function(type,args,obj){var duration=args[0];Lint.log("LocalMedia: Google API has an ad of "+duration+" ms");googleAd=duration;if(hasPreEvent&&!preEventAdsNotified){Lint.log("LocalMedia: Telling listeners that we have ads to cover the upcoming space");preEventAdsNotified=true;this.onAdsAvailable.fire()}};this.cbNoGoogleAd=function(){Lint.log("LocalMedia: Google API has no ads");googleAd=null};this.cbGoogleAdPlaying=function(){Lint.log("LocalMedia: Google API is playing an ad");overlayBusy=true;lastMedia=new Array();lastMedia.hasvideo="yes";lastMedia.adsense=true};this.cbGoogleAdDone=function(){Lint.log("LocalMedia: Google API is done playing");if(overlayBusy){overlayBusy=false;this.OverlayEnd()}if(!hasPreEvent){this.getGoogleAd()}};this.cbGoogleExpire=function(){if(!hasPreEvent){this.getGoogleAd()}};this.cbTargetSpotReady=function(){Lint.log("LocalMedia: TargetSpot API ready - enabled support for TargetSpot ad space passthrough");targetSpotReady=true};this.cbTargetSpotAdPlaying=function(type,args,me){Lint.log("LocalMedia: TargetSpot API is playing an ad");overlayBusy=true;var duration=args[0]*1000;var media=new Array();media.adzID="7274377757";media.filename="tsflash7274377757.swf";media.bannerID=0;media.textID=0;media.coverID=0;media.duration=duration;media.style="instream";media.hasvideo="yes";media.songtype="A";media.commercial="yes";media.campaignID=72743;media.categoryID=0;media.title="Ads by TargetSpot";media.publisherID=this.publisherID;media.sort_durationmatch=1;media.logtype=0;media.logmode=0;media.logurl="";media.staticurl="";media.deliveryurl="";media.clickurl="";media.prepped=true;media.islocalmedia=true;this.OverlayStart(media);lastMedia=media};this.cbTargetSpotAdDone=function(){Lint.log("LocalMedia: TargetSpot API is done playing");overlayBusy=false;this.OverlayEnd()};this.setActivePlayer=function(player,video){Lint.log("LocalMedia: Changing active player");if(playerActive!=null){playerActive.localmode=null;playerActive.Stop();playerActive.Hide();playerActive=null}playerActive=player;Lint.log("LocalMedia: ... old player removed");if(playerActive!=null){Lint.log("LocalMedia: Trying to set player volume to "+curVol);playerActive.setVolume(curVol);if(video){Lint.log("LocalMedia: Showing video player");playerActive.Show();playerActive.setSize(320,240)}else{Lint.log("LocalMedia: Hiding audio player");playerActive.Hide()}Lint.log("LocalMedia: ... new player ready")}else{Lint.log("LocalMedia: ... no new player specified")}};this.isPlayerDone=function(){if(playerActive==null){return true}var state=playerActive.getPlayerStatus();if(state==2){return true}if(state==3){return true}if(state==5){return true}if(state==null){return true}return false};this.PrepAndPlay=function(media){if(!this.PrepContent(media)){return null}if(!this.PlayContent(media)){return null}return media};this.getBestPlayerTypes=function(format){format=format.toLowerCase();var pref=Array();if(format=="mp3"){pref.push("TFLPlayer");pref.push("TSLPlayer");pref.push("TWMPlayer")}else{if((format=="wma")||(format=="wmv")||(format=="asf")){var browser=getBrowser();if(browser=="IE"){if(typeof (doitall)!="undefined"&&doitall.isASX){pref.push("TWMPlayer")}else{pref.push("TSLPlayer");pref.push("TWMPlayer")}}else{pref.push("TSLPlayer")}}else{if((format=="swf")||(format=="fla")||(format=="flv")){pref.push("TFLPlayer")}else{return null}}}return pref};this.getBestPlayer=function(format){var pref=this.getBestPlayerTypes(format);if(pref==null){return null}for(p=0;p<pref.length;p++){Lint.log("LocalMedia: Trying to find an existing player of type "+pref[p]);for(i=0;i<playerlist.length;i++){if(playerlist[i].isLoaded()){var playerWrapper=playerlist[i].getPlayerWrapper();if(playerWrapper.getContextName().toLowerCase()==pref[p].toLowerCase()){Lint.log("LocalMedia: ... found existing player");if(playerlist[i].localmode==null){Lint.log("LocalMedia: ... player is available, recycling");return playerlist[i]}}}}}Lint.log("LocalMedia: ... no appropriate players found, creating...");var playerProxy=new TPlayer();var matchIndex=-1;for(p=0;p<pref.length;p++){if(playerProxy.isInstalled(pref[p])){matchIndex=p;break}}if(matchIndex<0){return null}var player=eval("new "+pref[matchIndex]);player.onLoaded.subscribe(this.PlayerLoadedEvent,player,this);player.showcontrols=false;player.autostart=false;player.width=1;player.height=1;player.Hide();var objDiv=document.createElement("div");objDiv.setAttribute("style","position: absolute; top: 0px; left: 0px");idVideoArea.appendChild(objDiv);player.createPlayer(objDiv);playerProxy.attachPlayerWrapper(player);playerlist.push(playerProxy);return playerProxy};this.PrepContent=function(media){if(!media.prepped){Lint.log("LocalMedia: Preparing local content of duration "+media.duration+" ms");media.prepped=true;var player=this.getBestPlayer(media.format);if(player==null){return false}media.player=player;player.localmode="prepped";player.Stop();this.StartPreBuffer(media.staticurl,player)}else{Lint.log("LocalMedia: Local content of duration "+media.duration+" already buffered")}return true};this.PlayContent=function(media){if(typeof (media.player)!="undefined"){Lint.log("LocalMedia: Playing local content of duration "+media.duration+" ms");Touch.touch(media.logurl);lastMedia=media;overlayBusy=true;this.setActivePlayer(media.player,(media.hasvideo=="yes"));media.player.localmode="playing";this.StartPlay(media.player);this.clearTimeout();idTimeout=YAHOO.lang.later(parseInt(media.duration)+1000,this,this.cbLocalMediaTimeout);var now=new Date().getTime();media.lastPlayed=now;history.push(media);if(history.length>10){history.shift()}this.bufferOneEach();this.grabNewContent(media.duration);return true}else{Lint.log("LocalMedia: Can not play requested content - no player available");return false}};this.StartEOFCheck=function(){Lint.log("LocalMedia: Starting timer to catch player finishing, 100ms granularity");this.ClearTimer();idTimer=YAHOO.lang.later(100,this,this.CheckPlayerDone,null,true)};this.cbLocalMediaTimeout=function(){Lint.log("LocalMedia: Local content timed out, overriding and returning to idle");idTimeout=null;this.setActivePlayer(null,false)};this.StartPlay=function(player){Lint.log("LocalMedia: Playing content");if(player.isLoaded){player.localmediastatus=null;player.Play();this.StartEOFCheck()}else{player.customstatus="play"}};this.StartPreBuffer=function(url,player){Lint.log("LocalMedia: Starting prebuffering for url "+url);if(player.isLoaded){player.localmediastatus=null;player.PreBuffer(url)}else{player.customstatus="queue"}};this.PlayerLoadedEvent=function(type,args,me){var player=me;switch(player.localmediastatus){case"queue":this.StartPreBuffer(player.mediaurl,player);break;case"play":this.StartPlay(player);break}};this.CheckPlayerDone=function(){if(overlayBusy&&this.isPlayerDone()){Lint.log("LocalMedia: Overlay has finished playing");if(playerActive!=null){playerActive.localmode=null}this.ClearTimer();this.clearTimeout();if(!playGoogleAdNext&&nextAd!=null&&googleAd!=null&&(googleAd>=nextAd.duration-500&&googleAd<=nextAd.duration+500)){Lint.log("LocalMedia: Replacing StreamAds ad of duration "+nextAd.duration+" ms with Google ad of duration "+googleAd+" ms");queue.unshift(nextAd);nextAd=null;playGoogleAdNext=true}if(playGoogleAdNext){Lint.log("LocalMedia: Playing follow-on Google ad");playGoogleAdNext=false;this.onDelayedData.fire(this.playGoogleAd());return }if(nextAd!=null){var nextAdReady=true;if(typeof (nextAd.player)=="undefined"||!nextAd.player.isLoaded()){Lint.log("LocalMedia: Follow-on ad is not yet loaded, abandoning");nextAdReady=false}else{if(nextAd.player.isStuck()){Lint.log("LocalMedia: Follow-on ad is stuck, abandoning");nextAdReady=false}else{if(nextAd.player.isBuffering()){Lint.log("LocalMedia: Follow-on ad is not yet buffered, abandoning");queue.push(nextAd);nextAdReady=false}}}if(nextAdReady){Lint.log("LocalMedia: Playing follow-on StreamAds ad");this.PlayContent(nextAd);nextAd.islocalmedia=true;this.onDelayedData.fire(nextAd);nextAd=null;return }nextAd=null}Lint.log("LocalMedia: Signalling listeners to return control to main player");overlayBusy=false;this.OverlayEnd()}};this.OverlayStart=function(media){Lint.log("LocalMedia: Overlay starting, firing onMediaStart");this.onMediaStart.fire(media)};this.OverlayEnd=function(){Lint.log("LocalMedia: Overlay has ended");if(delayData!=null){Lint.log("LocalMedia: Sending delayed event data");this.OverlayTerminated(lastMedia);this.onDelayedData.fire(delayData);delayData=null}else{waitForOverlay=true}};this.OverlayTerminated=function(media){Lint.log("LocalMedia: Overlay terminated - resetting players and firing onMediaEnd");this.setActivePlayer(null,false);this.onMediaEnd.fire(media)};this.grabNewContent=function(myDuration){Lint.log("LocalMedia: Trying to clean old ads from history");this.expungeOldHistoryItems();if(myDuration==null){myDuration=60}if(myDuration>1000){myDuration=Math.round(myDuration/100)/10}var msg="LocalMedia: Requesting new ads of duration up to "+myDuration;Lint.log(msg);var url=this.BuildUrl(this.publisherID,myDuration);JSLoader.LoadJS(url,"localcontent")};this.expungeOldHistoryItems=function(){var now=new Date().getTime();for(var i=0;i<history.length;i++){if(now-history[i]["lastPlayed"]>this.minimumRepeatInterval*1000*60){history.splice(i--,1)}}};this.BuildUrl=function(pid,dur){var params=Array();var exclude="0";for(var i=0;i<history.length;i++){exclude+=","+history[i]["adzID"]}for(i=0;i<queue.length;i++){exclude+=","+queue[i]["adzID"]}params.tt=2;params.t="o";params.o="jsonx";params.cbfunc="dpLocalMediaData";params.pid=pid;params.md=dur;params.mmv=0.5;params.mr=5;params.mt="A";params.aidx=exclude;params.p=3;params.l=4;if(Demographics.gender!=null){params.dg=Demographics.gender}if(typeof (Demographics.languages)=="array"&&Demographics.languages.length>0){params.dl=Demographics.languages.join(",")}if(Demographics.race!=null){params.dr=Demographics.race}if(Demographics.age!=null){params.da=Demographics.age}if(Demographics.ageGroup!=null){params.dag=Demographics.ageGroup}if(Demographics.income!=null){params.di=Demographics.income}if(Demographics.incomeGroup!=null){params.dig=Demographics.incomeGroup}if(Demographics.education!=null){params.de=Demographics.education}if(Geography.country!=null){params.gc=Geography.country}if(Geography.region!=null){params.gs=Geography.region}if(Geography.city!=null){params.gr=Geography.city}if(Geography.market!=null){params.gm=Geography.market}params.maf=0;if(TWMPlayer.isInstalled||TSLPlayer.isInstalled){params.maf+=2+4}else{if(typeof (TFLPlayer)=="function"&&TFLPlayer.isInstalled){params.maf+=2}}params.mvf=0;if(TWMPlayer.isInstalled||TSLPlayer.isInstalled){params.mvf+=1+2}if(typeof (TFLPlayer)=="function"&&TFLPlayer.isInstalled){params.mvf+=8}var vidMode=this.videoMode;if(vidMode=="auto"){vidMode=(idVideoArea!=null)}if(vidMode=="onlyvideo"){params.mmf=2}else{if(vidMode){params.mmf=3}else{params.mmf=1}}var url="http://sa-m.streamads.com/view?"+ArrayToParams(params);return url};this.compareDuration=function(ad1,ad2){var d1=parseInt(ad1.duration);var d2=parseInt(ad2.duration);var r=d1-d2;return r};this.expungeRecent=function(){for(var i=0;i<history.length;i++){for(var j=0;j<queue.length;j++){if(history[i]["adzID"]==queue[j]["adzID"]){queue.splice(j,1)}}}};this.logOverlay=function(duration,covered){var logstring=Math.round((new Date().getTime()-localMediaStarted)/60000)+"|";for(var i=0;i<queue.length;i++){if(typeof (queue[i]["adsenselog"])!="undefined"){logstring+="adsense"}else{logstring+=queue[i]["adzID"]}logstring+=":"+queue[i]["duration"]+","}logstring+="|";for(i=0;i<history.length;i++){if(typeof (history[i]["adsense"])!="undefined"){logstring+="adsense"}else{logstring+=history[i]["adzID"]}logstring+=":"+Math.round((new Date().getTime()-history[i]["lastPlayed"])/60000)+","}logstring+="|";logstring=logstring.replace(",|","|");Lint.log("Sending log data");if(this.publisherID!=null&&this.publisherID>0){Touch.touch("http://174.129.204.153/adspace/counter.php?publisherID="+this.publisherID+"&adspace="+duration+"&covered="+covered+"&flash="+(TFLPlayer.isInstalled()*1)+"&googleready="+(googleReady*1)+"&preevent="+(hasPreEvent*1)+"&logstring="+logstring)}};this.getGoogleAd=function(){if(googleAd!=null){return }GoogleAPI.requestStopSet(this.defaultGoogleStopSet*1000)}};function TDoItAll(){this.publisherID=0;this.stationID=0;this.timeoutPadding=180000;this.parseQueryStr=true;this.loadDebug=false;this.preloadHistory=false;this.loadStationInfo=false;this.useDataPoller=false;this.autoDisplayAds=true;this.useLocalMedia=false;this.useGateway=true;this.overlayRelativeVolume=0;this.isASX=false;this.ignoreVistaBug=false;this.useWMPOnChrome=false;this.amazonTag="audiorealm";this.mediadata=null;this.datapoller=null;this.streamads=null;this.player=null;this.localmedia=null;this.onData=new YAHOO.util.CustomEvent("onData",this);this.onMedia=new YAHOO.util.CustomEvent("onMedia",this);this.onAds=new YAHOO.util.CustomEvent("onAds",this);this.onHistoryLoaded=new YAHOO.util.CustomEvent("onHistoryLoaded",this);this.onStationData=new YAHOO.util.CustomEvent("onStationData",this);this.onRestore=new YAHOO.util.CustomEvent("onRestore",this);this.onVideoBegin=new YAHOO.util.CustomEvent("onVideoBegin",this);this.onVideoEnd=new YAHOO.util.CustomEvent("onVideoEnd",this);this.onConfigure=new YAHOO.util.CustomEvent("onConfigure",this);this.RegisterSyncFrames=function(O,N,P){this.streamads.RegisterSyncFrames(O,N,P)};this.RegisterSyncIDs=function(O,N,P){this.streamads.RegisterSyncIDs(O,N,P)};this.RegisterVideoArea=function(N){this.localmedia.RegisterVideoArea(N)};this.RegisterPlayerSpace=function(N){if(typeof (N)=="string"){N=document.getElementById(N)}L=N};this.init=function(){var N=ParseQueryStr();if(typeof (N.lint)!="undefined"&&N.lint=="yes"){Lint.debugMode=true}YAHOO.util.Event.onDOMReady(function(){this.onConfigure.fire();Lint.log("DoItAll: Starting");this.Start()},null,this)};this.Start=function(){if(H){return }var N=ParseQueryStr();if(typeof (N.lint)!="undefined"&&N.lint=="yes"){Lint.debugMode=true}H=true;this.do_Start()};this.context="TDoItAll";var C=30000;var G=null;var K=false;var L=null;this.do_Init=function(){if(J){return }J=true;this.mediadata=new TMediaData();this.datapoller=new TDataPoller();this.streamads=new TStreamAds();this.player=new TPlayer();this.localmedia=new TLocalMedia();this.mediadata.onData.subscribe(this.DataEvent,this,true);this.mediadata.onHistoryLoaded.subscribe(this.HistoryLoadedEvent,this,true);this.localmedia.onMediaStart.subscribe(this.LocalMediaStartEvent,this,true);this.localmedia.onMediaEnd.subscribe(this.LocalMediaEndEvent,this,true);this.localmedia.onDelayedData.subscribe(this.PlayerDataEvent,this,true);this.player.onData.subscribe(this.PlayerDataEvent,this,true);this.player.onPreEventData.subscribe(this.preEventScript,this,true);this.datapoller.onDataChanged.subscribe(this.DataPollerEvent,this,true);this.player.onClick.subscribe(this.PlayerClickEvent,this,true);if(this.parseQueryStr){var N=ParseQueryStr();if(N.pid>0){this.publisherID=N.pid}if(N.sid>0){this.stationID=N.sid}if(N.debug!=null){this.loadDebug=(N.debug.toLowerCase()=="y")}}};this.do_Start=function(){Lint.log("DoItAll: Starting PlayerSDK");if(this.loadDebug){JSLoader.LoadJS("http://media.streamads.com/playersdk/v2/tests/runtests.js","debug")}if(this.loadStationInfo&&(this.stationID>0)){JSLoader.LoadJS("http://player.spacialnet.com/players/core/stationdata.php?stationID="+this.stationID,"stationData")}if(this.preloadHistory&&(this.stationID>0)){this.player.onLoaded.subscribe(function(){JSLoader.LoadJS("http://player.spacialnet.com/players/core/historydata.php?stationID="+this.stationID,"preloadHistory")},this,true)}if(this.useDataPoller){if(this.datapoller.dataurl==null){if(this.publisherID>0){this.datapoller.dataurl="http://media.streamads.com/syncmeta/syncdata/"+this.publisherID+".js"}else{if(this.stationID>0){this.datapoller.dataurl="http://player.spacialnet.com/players/core/mediadata.php?stationID="+this.stationID}}}this.datapoller.Start(false)}if(this.isASX&&this.isVista()&&!this.ignoreVistaBug){this.useLocalMedia=false}var N=getChannelsByPID(this.publisherID);if(this.useGateway){this.doGateway()}else{this.cbNoGateway()}AdSense.enabled=(N!=null);this.onAds.subscribe(this.doCheckGoogleHide,this,true);this.checkSilverLight();this.mediadata.amazonTag=this.amazonTag};this.doCheckGoogleHide=function(O,N,Q){var P=N[0];if(typeof (P.adsense)=="undefined"||!P.adsense){GoogleAPI.hide()}};this.doGateway=function(){Lint.log("DoItAll: Trying to run Gateway ads");if(this.player!=null&&this.player.getPlayerWrapper()!=null){this.cbNoGateway();return }if(!this.player.checkControllablePlayer(this.player.mediaurl)){this.cbNoGateway();return }Gateway.adSensePublisherID=AdSense.publisherID;Gateway.adSenseChannelList=getChannelsByPID(this.publisherID);if(Gateway.adSenseChannelList==null&&!Gateway.enableStreamAdsGateways){this.cbNoGateway();return }Gateway.publisherID=this.publisherID;Gateway.onNoGateway.subscribe(this.cbNoGateway,this,true);Gateway.onGatewayPlay.subscribe(this.cbGatewayPlaying,this,true);Gateway.onGatewayDone.subscribe(this.cbGatewayDone,this,true);Gateway.onGatewayTimeout.subscribe(this.cbGatewayDone,this,true);Gateway.adRequestTimeout=10;Gateway.adStartTimeout=20;Gateway.maximumDuration=30;Gateway.registerVideoArea(this.localmedia.getVideoArea());Gateway.playGateway()};this.cbNoGateway=function(){Lint.log("DoItAll: No gateway ads available");if(this.player==null||this.player.getPlayerWrapper()==null){this.player.createPlayer(L)}};this.cbGatewayPlaying=function(O,N,P){D=true;N[0]["islocalmedia"]=true;N[0]["isgateway"]=true;this.mediadata.ProcessData(N[0]);F=N[0];if(F.hasvideo=="yes"){this.onVideoBegin.fire(F)}this.player.onLoaded.subscribe(function(){Lint.log("DoItAll: Starting player "+(A?"muted":"unmuted"));if(A){this.player.setMute(true);Lint.log("DoItAll: Player reports state: "+(this.player.getMute()?"muted":"unmuted"))}},this,true);A=true;this.player.createPlayer(L);this.DataEvent(O,N,P)};this.cbGatewayDone=function(){Lint.log("DoItAll: Gateway reports it is done - unmuting player");D=false;if(F!=null&&typeof (F.adsense)!="undefined"&&F.adsense){B=F}if(this.player.isLoaded()){this.player.setMute(false)}else{if(A){A=false;L.removeChild(L.childNodes[0])}this.player.createPlayer(L)}if(F!=null&&F.hasvideo=="yes"&&(typeof (F.adsense)=="undefined"||!F.adsense)){this.onVideoEnd.fire(F)}if(M!=null){this.mediadata.ProcessHistoryData(M)}if(I.length>0){for(var N=0;N<I.length;N++){this.mediadata.ProcessData(I[N])}}};this.LocalMediaStartEvent=function(O,N,P){var R=N[0];this.player.FadeCancel();if(E==null){E=this.player.getVolume()}var Q=E+this.overlayRelativeVolume;if(Q<0){Q=0}if(Q>100){Q=100}Lint.log("doitall: Setting LocalMedia volume to "+Q);this.localmedia.setVolume(Q);this.player.setMuted(true);if(R.hasvideo=="yes"){this.onVideoBegin.fire(R)}};this.LocalMediaEndEvent=function(O,N,P){var Q=N[0];if(!this.localmedia.isShuttingDown){E=this.player.getVolume();this.player.setVolume(0)}this.player.setMuted(false);if(!this.localmedia.isShuttingDown){this.player.Fade(E,500,0)}if(Q.hasvideo=="yes"&&(typeof (Q.adsense)=="undefined"||!Q.adsense)){this.onVideoEnd.fire(Q)}else{if(typeof (Q.adsense)!="undefined"&&Q.adsense){B=Q}}};this.HistoryLoadedEvent=function(O,N,P){this.onHistoryLoaded.fire()};this.DataEvent=function(O,N,P){var Q=N[0];if(D&&typeof (Q.isgateway)=="undefined"){I.push(Q);return }this.onData.fire(Q);if(Q.mediatype=="A"){this.do_AdsEvent(Q)}else{if((Q.mediatype=="S")||(Q.mediatype=="")||(Q.mediatype==null)){this.do_MediaEvent(Q)}}};this.do_AdsEvent=function(O){Lint.log("DoItAll: AdsEvent received");if(this.autoDisplayAds){Lint.log("DoItAll: Trying to sync StreamAds banners");this.streamads.SyncToFrames(O);this.streamads.SyncToIDs(O)}var N=parseInt(O.duration);if(N>0){N+=this.timeoutPadding}else{N=C}if(G!=null){G.cancel()}G=YAHOO.lang.later(N,this,this.RestoreEvent);Lint.log("doitall: Resetting ad restore timer for "+N+" ms");this.onAds.fire(O)};this.do_MediaEvent=function(N){this.onMedia.fire(N)};this.RestoreEvent=function(O,N,P){G=null;if(B!=null){GoogleAPI.hide();this.onVideoEnd.fire(B);B=null}this.onRestore.fire()};this.PlayerClickEvent=function(O,N,P){var Q=this.mediadata.getLastAd();if(Q==null){return }TStreamads.VisitAdvertiser(Q)};this.DataPollerEvent=function(O,N,P){var Q=N[0];this.mediadata.ProcessData(Q)};this.PlayerDataEvent=function(O,N,P){var Q=N[0];if((this.publisherID==null)||(this.publisherID<=0)){if(Q.publisherID>0){this.publisherID=Q.publisherID}}if(!K){if(Q.realtime&&typeof (Q.datasource)=="string"){switch(Q.datasource){case"script_syncinfo":case"script_data":K=true;this.datapoller.Stop();if(this.useLocalMedia){this.localmedia.publisherID=this.publisherID;this.localmedia.Start()}break}}}if(this.useLocalMedia&&this.localmedia.getStarted()&&!D){this.localmedia.setVolume(this.player.getVolume());Q=this.localmedia.CheckTriggerLocalMedia(Q);if(Q==null){return false}}if(D){I.push(Q)}else{this.mediadata.ProcessData(Q)}};this.preEventScript=function(O,N,P){var Q=N[0];if((this.publisherID==null)||(this.publisherID<=0)){if(Q.publisherID>0){this.publisherID=Q.publisherID}}if(!K){if(Q.pre&&typeof (Q.datasource)=="string"){switch(Q.datasource){case"script_syncinfo":case"script_data":K=true;this.datapoller.Stop();if(this.useLocalMedia){this.localmedia.publisherID=this.publisherID;this.localmedia.Start(true)}break}}}if(this.useLocalMedia&&this.localmedia.getStarted()){this.localmedia.checkTriggerPreQueue(Q)}};this.processHistoryData=function(N){if(D){M=N}else{this.mediadata.ProcessHistoryData(N)}};this.isVista=function(){if(navigator.userAgent.indexOf("Windows NT 6.0")>-1){Lint.log("doitall: We are in an ASX HTMLview on Windows Vista - disabling overlays due to Vista mute bug");return true}return false};this.checkSilverLight=function(){return ;var N=(navigator.userAgent.indexOf("MSIE")!=-1)*1;var O=TSLPlayer.isInstalled()*1;Touch.touch("http://65.44.71.138/adspace/checksilverlight.php?pid="+this.publisherID+"&has_ie="+N+"&has_silverlight="+O)};var B=null;var E=null;var J=false;var H=false;var F=null;var D=false;var I=new Array();var M=null;var A=false;this.do_Init()}var doitall=new TDoItAll();function dpCallback(A){doitall.datapoller.UpdateDataCallback(A)}function dpHistoryCallback(A){doitall.processHistoryData(A)}function dpStationInfoCallback(A){doitall.onStationData.fire(A);if(A.webpicturedir!=null&&A.webpicturedir!=""){doitall.mediadata.coverpicture_url=A.webpicturedir}}function dpLocalMediaData(A){doitall.localmedia.cbLoadContent(A)}TAdsAPI=function(){this.streamAdsPublisherID=null;this.maxUnderRun=3000;this.maxOverRun=1000;this.autoDisplayBanners=true;this.bannerTimeout=60;this.preEventScripting=false;this.start=function(){if(A){return }if(this.streamAdsPublisherID==null){Lint.log("AdsAPI: No publisher ID set up, please specify a publisher ID to use the ad delivery API");return }Lint.log("AdsAPI: Starting");Lint.log("AdsAPI: Disabling doitall and redirecting media events to Ads API");doitall.localmedia=this.localmedia;var D=getChannelsByPID(this.streamAdsPublisherID);if(D!=null){AdSense.enabled=true}this.localmedia.publisherID=this.streamAdsPublisherID;this.localmedia.maxUnderRun=this.maxUnderRun;this.localmedia.maxOverRun=this.maxOverRun;this.localmedia.onMediaStart.subscribe(this.cbLocalMediaStartEvent,this,true);this.localmedia.onMediaEnd.subscribe(this.cbLocalMediaEndEvent,this,true);this.localmedia.onAdsAvailable.subscribe(this.cbLocalMediaAdsAvailable,this,true);if(this.preEventScripting){this.localmedia.Start(true)}else{this.localmedia.Start()}};this.playAds=function(E){if(E<1000){Lint.log("AdsAPI: Ads of duration less then 1000ms not supported, assuming "+durationg+" seconds");E=E*1000}Lint.log("AdsAPI: Trying to cover ad space of "+E+" ms");var D=new Array();D.mediatype=D.songtype="A";D.paid="no";D.duration=E;D.realtime=true;D.overlay="yes";D=this.localmedia.CheckTriggerLocalMedia(D);if(typeof (D.islocalmedia)=="undefined"||!D.islocalmedia){Lint.log("AdsAPI: LocalMedia can not cover the ad space");this.onNoAds.fire()}};this.registerVideoArea=function(D){if(typeof (D)=="string"){D=document.getElementById(D)}this.localmedia.RegisterVideoArea(D);Lint.log("AdsAPI: Registered video area with LocalMedia")};this.registerSyncFrames=function(E,D,F){this.streamads.RegisterSyncFrames(E,D,F);Lint.log("AdsAPI: Registered sync frames with StreamAds class")};this.registerSyncIDs=function(E,D,F){this.streamads.RegisterSyncIDs(E,D,F);Lint.log("AdsAPI: Registered sync areas with StreamAds class")};this.setVolume=function(D){Lint.log("AdsAPI: Request to set volume to "+D);this.localmedia.setVolume(D)};this.areAdsAvailable=function(D){return this.localmedia.TriggerOverlaySpace(D,"A",true)};this.preEventCue=function(D,E){if(!this.preEventScripting){Lint.log("AdsAPI: Pre-event scripting is not available, preEventCue can not be used");return }Lint.log("AdsAPI: Trying to prepare ads for space of "+D+" ms in "+E+" ms");this.localmedia.PreQueueSpace(D,"A",E)};this.onNoAds=new YAHOO.util.CustomEvent("onNoAds",this);this.onAdsAvailable=new YAHOO.util.CustomEvent("onAdsAvailable",this);this.onAdsPlaying=new YAHOO.util.CustomEvent("onAdsPlaying",this);this.onAdsDone=new YAHOO.util.CustomEvent("onAdsDone",this);this.onPrepareVideoArea=new YAHOO.util.CustomEvent("onPrepareVideoArea",this);this.onRestoreVideoArea=new YAHOO.util.CustomEvent("onRestoreVideoArea",this);this.onRestoreBanners=new YAHOO.util.CustomEvent("onRestoreBanners",this);var A=false;var C=false;var B=null;this.streamads=null;this.localmedia=null;this.init=function(){this.streamads=new TStreamAds();this.localmedia=new TLocalMedia()};this.cbLocalMediaStartEvent=function(F,E,G){Lint.log("AdsAPI: LocalMedia is playing an ad");var H=E[0];this.onAdsPlaying.fire(H);Lint.log("AdsAPI: Sent signal to event listeners that ad is playing");if(H.hasvideo=="yes"){if(C&&(typeof (H.adsense)=="undefined"||!H.adsense)){GoogleAPI.hide();C=false}this.onPrepareVideoArea.fire()}Lint.log("AdsAPI: Sent signal to event listeners to prepare the video area");YAHOO.lang.later(5000,this,this.cbSendFakeMediaEvent);Lint.log("AdsAPI: Set up a fake scripting event to recover from end of overlay");if(this.autoDisplayBanners){this.streamads.SyncToFrames(H);this.streamads.SyncToIDs(H)}Lint.log("AdsAPI: Sent signal to StreamAds to sync bannners");var D=parseInt(H.duration)+(this.bannerTimeout*1000);if(B){B.cancel()}B=YAHOO.lang.later(D,this,this.cbRestoreEvent);Lint.log("AdsAPI: Set up timer event to clear the banners in "+D+" ms")};this.cbLocalMediaEndEvent=function(E,D,F){Lint.log("AdsAPI: LocalMedia is done playing an ad");var G=D[0];this.onAdsDone.fire();if(G.hasvideo=="yes"&&(typeof (G.adsense)=="undefined"||!G.adsense)){this.onRestoreVideoArea.fire()}else{if(typeof (G.adsense)!="undefined"&&G.adsense){C=true}}};this.cbLocalMediaAdsAvailable=function(E,D,F){this.onAdsAvailable.fire()};this.cbRestoreEvent=function(){if(C){C=false;GoogleAPI.hide();this.onRestoreVideoArea.fire()}this.onRestoreBanners.fire()};this.cbSendFakeMediaEvent=function(){Lint.log("AdsAPI: Sending scripting data to LocalMedia");var D=new Array();D.mediatype=D.songtype="S";D.duration=10000;D.realtime=true;D.overlay="no";this.localmedia.CheckTriggerLocalMedia(D)};this.init()};var AdsAPI=new TAdsAPI();