/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.3.1
*/
if(typeof YAHOO=="undefined"){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]};}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0};var B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang={isArray:function(B){if(B){var A=YAHOO.lang;return A.isNumber(B.length)&&A.isFunction(B.splice)&&!A.hasOwnProperty(B.length);}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"||YAHOO.lang.isFunction(A)))||false;},isString:function(A){return typeof A==="string";},isUndefined:function(A){return typeof A==="undefined";},hasOwnProperty:function(A,B){if(Object.prototype.hasOwnProperty){return A.hasOwnProperty(B);}return !YAHOO.lang.isUndefined(A[B])&&A.constructor.prototype[B]!==A[B];},_IEEnumFix:function(C,B){if(YAHOO.env.ua.ie){var E=["toString","valueOf"],A;for(A=0;A<E.length;A=A+1){var F=E[A],D=B[F];if(YAHOO.lang.isFunction(D)&&D!=Object.prototype[F]){C[F]=D;}}}},extend:function(D,E,C){if(!E||!D){throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");}var B=function(){};B.prototype=E.prototype;D.prototype=new B();D.prototype.constructor=D;D.superclass=E.prototype;if(E.prototype.constructor==Object.prototype.constructor){E.prototype.constructor=E;}if(C){for(var A in C){D.prototype[A]=C[A];}YAHOO.lang._IEEnumFix(D.prototype,C);}},augmentObject:function(E,D){if(!D||!E){throw new Error("Absorb failed, verify dependencies.");}var A=arguments,C,F,B=A[2];if(B&&B!==true){for(C=2;C<A.length;C=C+1){E[A[C]]=D[A[C]];}}else{for(F in D){if(B||!E[F]){E[F]=D[F];}}YAHOO.lang._IEEnumFix(E,D);}},augmentProto:function(D,C){if(!C||!D){throw new Error("Augment failed, verify dependencies.");}var A=[D.prototype,C.prototype];for(var B=2;B<arguments.length;B=B+1){A.push(arguments[B]);}YAHOO.lang.augmentObject.apply(this,A);},dump:function(A,G){var C=YAHOO.lang,D,F,I=[],J="{...}",B="f(){...}",H=", ",E=" => ";if(!C.isObject(A)){return A+"";}else{if(A instanceof Date||("nodeType" in A&&"tagName" in A)){return A;}else{if(C.isFunction(A)){return B;}}}G=(C.isNumber(G))?G:3;if(C.isArray(A)){I.push("[");for(D=0,F=A.length;D<F;D=D+1){if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}if(I.length>1){I.pop();}I.push("]");}else{I.push("{");for(D in A){if(C.hasOwnProperty(A,D)){I.push(D+E);if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}}if(I.length>1){I.pop();}I.push("}");}return I.join("");},substitute:function(Q,B,J){var G,F,E,M,N,P,D=YAHOO.lang,L=[],C,H="dump",K=" ",A="{",O="}";for(;;){G=Q.lastIndexOf(A);if(G<0){break;}F=Q.indexOf(O,G);if(G+1>=F){break;}C=Q.substring(G+1,F);M=C;P=null;E=M.indexOf(K);if(E>-1){P=M.substring(E+1);M=M.substring(0,E);}N=B[M];if(J){N=J(M,N,P);}if(D.isObject(N)){if(D.isArray(N)){N=D.dump(N,parseInt(P,10));}else{P=P||"";var I=P.indexOf(H);if(I>-1){P=P.substring(4);}if(N.toString===Object.prototype.toString||I>-1){N=D.dump(N,parseInt(P,10));}else{N=N.toString();}}}else{if(!D.isString(N)&&!D.isNumber(N)){N="~-"+L.length+"-~";L[L.length]=C;}}Q=Q.substring(0,G)+N+Q.substring(F+1);}for(G=L.length-1;G>=0;G=G-1){Q=Q.replace(new RegExp("~-"+G+"-~"),"{"+L[G]+"}","g");}return Q;},trim:function(A){try{return A.replace(/^\s+|\s+$/g,"");}catch(B){return A;}},merge:function(){var C={},A=arguments,B;for(B=0;B<A.length;B=B+1){YAHOO.lang.augmentObject(C,A[B],true);}return C;},isValue:function(B){var A=YAHOO.lang;return(A.isObject(B)||A.isString(B)||A.isNumber(B)||A.isBoolean(B));}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.3.1",build:"541"});
/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.3.1
*/
YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){var E=this.subscribers.length;if(!E&&this.silent){return true;}var H=[],G=true,D,I=false;for(D=0;D<arguments.length;++D){H.push(arguments[D]);}var A=H.length;if(!this.silent){}for(D=0;D<E;++D){var L=this.subscribers[D];if(!L){I=true;}else{if(!this.silent){}var K=L.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var B=null;if(H.length>0){B=H[0];}try{G=L.fn.call(K,B,L.obj);}catch(F){this.lastError=F;}}else{try{G=L.fn.call(K,this.type,H,L.obj);}catch(F){this.lastError=F;}}if(false===G){if(!this.silent){}return false;}}}if(I){var J=[],C=this.subscribers;for(D=0,E=C.length;D<E;D=D+1){J.push(C[D]);}this.subscribers=J;}return true;},unsubscribeAll:function(){for(var B=0,A=this.subscribers.length;B<A;++B){this._delete(A-1-B);}this.subscribers=[];return B;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers[A]=null;},toString:function(){return"CustomEvent: '"+this.type+"', scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var J=false;var I=[];var K=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39};return{POLL_RETRYS:4000,POLL_INTERVAL:10,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,startInterval:function(){if(!this._interval){var L=this;var M=function(){L._tryPreloadAttach();};this._interval=setInterval(M,this.POLL_INTERVAL);}},onAvailable:function(N,L,O,M){F.push({id:N,fn:L,obj:O,override:M,checkReady:false});C=this.POLL_RETRYS;this.startInterval();},onDOMReady:function(L,N,M){if(J){setTimeout(function(){var O=window;if(M){if(M===true){O=N;}else{O=M;}}L.call(O,"DOMReady",[],N);},0);}else{this.DOMReadyEvent.subscribe(L,N,M);}},onContentReady:function(N,L,O,M){F.push({id:N,fn:L,obj:O,override:M,checkReady:true});C=this.POLL_RETRYS;this.startInterval();},addListener:function(N,L,W,R,M){if(!W||!W.call){return false;}if(this._isValidCollection(N)){var X=true;for(var S=0,U=N.length;S<U;++S){X=this.on(N[S],L,W,R,M)&&X;}return X;}else{if(YAHOO.lang.isString(N)){var Q=this.getEl(N);if(Q){N=Q;}else{this.onAvailable(N,function(){YAHOO.util.Event.on(N,L,W,R,M);});return true;}}}if(!N){return false;}if("unload"==L&&R!==this){K[K.length]=[N,L,W,R,M];return true;}var Z=N;if(M){if(M===true){Z=R;}else{Z=M;}}var O=function(a){return W.call(Z,YAHOO.util.Event.getEvent(a,N),R);};var Y=[N,L,W,O,Z,R,M];var T=I.length;I[T]=Y;if(this.useLegacyEvent(N,L)){var P=this.getLegacyIndex(N,L);if(P==-1||N!=G[P][0]){P=G.length;B[N.id+L]=P;G[P]=[N,L,N["on"+L]];E[P]=[];N["on"+L]=function(a){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(a),P);};}E[P].push(Y);}else{try{this._simpleAdd(N,L,O,false);}catch(V){this.lastError=V;this.removeListener(N,L,W);return false;}}return true;},fireLegacyEvent:function(P,N){var R=true,L,T,S,U,Q;T=E[N];for(var M=0,O=T.length;M<O;++M){S=T[M];if(S&&S[this.WFN]){U=S[this.ADJ_SCOPE];Q=S[this.WFN].call(U,P);R=(R&&Q);}}L=G[N];if(L&&L[2]){L[2](P);}return R;},getLegacyIndex:function(M,N){var L=this.generateId(M)+N;if(typeof B[L]=="undefined"){return -1;}else{return B[L];}},useLegacyEvent:function(M,N){if(this.webkit&&("click"==N||"dblclick"==N)){var L=parseInt(this.webkit,10);if(!isNaN(L)&&L<418){return true;}}return false;},removeListener:function(M,L,U){var P,S,W;if(typeof M=="string"){M=this.getEl(M);}else{if(this._isValidCollection(M)){var V=true;for(P=0,S=M.length;P<S;++P){V=(this.removeListener(M[P],L,U)&&V);}return V;}}if(!U||!U.call){return this.purgeElement(M,false,L);}if("unload"==L){for(P=0,S=K.length;P<S;P++){W=K[P];if(W&&W[0]==M&&W[1]==L&&W[2]==U){K[P]=null;return true;}}return false;}var Q=null;var R=arguments[3];if("undefined"===typeof R){R=this._getCacheIndex(M,L,U);}if(R>=0){Q=I[R];}if(!M||!Q){return false;}if(this.useLegacyEvent(M,L)){var O=this.getLegacyIndex(M,L);var N=E[O];if(N){for(P=0,S=N.length;P<S;++P){W=N[P];if(W&&W[this.EL]==M&&W[this.TYPE]==L&&W[this.FN]==U){N[P]=null;break;}}}}else{try{this._simpleRemove(M,L,Q[this.WFN],false);}catch(T){this.lastError=T;return false;}}delete I[R][this.WFN];delete I[R][this.FN];I[R]=null;return true;},getTarget:function(N,M){var L=N.target||N.srcElement;return this.resolveTextNode(L);},resolveTextNode:function(L){if(L&&3==L.nodeType){return L.parentNode;}else{return L;}},getPageX:function(M){var L=M.pageX;if(!L&&0!==L){L=M.clientX||0;if(this.isIE){L+=this._getScrollLeft();}}return L;},getPageY:function(L){var M=L.pageY;if(!M&&0!==M){M=L.clientY||0;if(this.isIE){M+=this._getScrollTop();}}return M;},getXY:function(L){return[this.getPageX(L),this.getPageY(L)];
},getRelatedTarget:function(M){var L=M.relatedTarget;if(!L){if(M.type=="mouseout"){L=M.toElement;}else{if(M.type=="mouseover"){L=M.fromElement;}}}return this.resolveTextNode(L);},getTime:function(N){if(!N.time){var M=new Date().getTime();try{N.time=M;}catch(L){this.lastError=L;return M;}}return N.time;},stopEvent:function(L){this.stopPropagation(L);this.preventDefault(L);},stopPropagation:function(L){if(L.stopPropagation){L.stopPropagation();}else{L.cancelBubble=true;}},preventDefault:function(L){if(L.preventDefault){L.preventDefault();}else{L.returnValue=false;}},getEvent:function(Q,O){var P=Q||window.event;if(!P){var R=this.getEvent.caller;while(R){P=R.arguments[0];if(P&&Event==P.constructor){break;}R=R.caller;}}if(P&&this.isIE){try{var N=P.srcElement;if(N){var M=N.type;}}catch(L){P.target=O;}}return P;},getCharCode:function(M){var L=M.keyCode||M.charCode||0;if(YAHOO.env.ua.webkit&&(L in D)){L=D[L];}return L;},_getCacheIndex:function(P,Q,O){for(var N=0,M=I.length;N<M;++N){var L=I[N];if(L&&L[this.FN]==O&&L[this.EL]==P&&L[this.TYPE]==Q){return N;}}return -1;},generateId:function(L){var M=L.id;if(!M){M="yuievtautoid-"+A;++A;L.id=M;}return M;},_isValidCollection:function(M){try{return(typeof M!=="string"&&M.length&&!M.tagName&&!M.alert&&typeof M[0]!=="undefined");}catch(L){return false;}},elCache:{},getEl:function(L){return(typeof L==="string")?document.getElementById(L):L;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(M){if(!H){H=true;var L=YAHOO.util.Event;L._ready();L._tryPreloadAttach();}},_ready:function(M){if(!J){J=true;var L=YAHOO.util.Event;L.DOMReadyEvent.fire();L._simpleRemove(document,"DOMContentLoaded",L._ready);}},_tryPreloadAttach:function(){if(this.locked){return false;}if(this.isIE){if(!J){this.startInterval();return false;}}this.locked=true;var Q=!H;if(!Q){Q=(C>0);}var P=[];var R=function(T,U){var S=T;if(U.override){if(U.override===true){S=U.obj;}else{S=U.override;}}U.fn.call(S,U.obj);};var M,L,O,N;for(M=0,L=F.length;M<L;++M){O=F[M];if(O&&!O.checkReady){N=this.getEl(O.id);if(N){R(N,O);F[M]=null;}else{P.push(O);}}}for(M=0,L=F.length;M<L;++M){O=F[M];if(O&&O.checkReady){N=this.getEl(O.id);if(N){if(H||N.nextSibling){R(N,O);F[M]=null;}}else{P.push(O);}}}C=(P.length===0)?0:C-1;if(Q){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;return true;},purgeElement:function(O,P,R){var Q=this.getListeners(O,R),N,L;if(Q){for(N=0,L=Q.length;N<L;++N){var M=Q[N];this.removeListener(O,M.type,M.fn,M.index);}}if(P&&O&&O.childNodes){for(N=0,L=O.childNodes.length;N<L;++N){this.purgeElement(O.childNodes[N],P,R);}}},getListeners:function(N,L){var Q=[],M;if(!L){M=[I,K];}else{if(L=="unload"){M=[K];}else{M=[I];}}for(var P=0;P<M.length;P=P+1){var T=M[P];if(T&&T.length>0){for(var R=0,S=T.length;R<S;++R){var O=T[R];if(O&&O[this.EL]===N&&(!L||L===O[this.TYPE])){Q.push({type:O[this.TYPE],fn:O[this.FN],obj:O[this.OBJ],adjust:O[this.OVERRIDE],scope:O[this.ADJ_SCOPE],index:R});}}}}return(Q.length)?Q:null;},_unload:function(S){var R=YAHOO.util.Event,P,O,M,L,N;for(P=0,L=K.length;P<L;++P){M=K[P];if(M){var Q=window;if(M[R.ADJ_SCOPE]){if(M[R.ADJ_SCOPE]===true){Q=M[R.UNLOAD_OBJ];}else{Q=M[R.ADJ_SCOPE];}}M[R.FN].call(Q,R.getEvent(S,M[R.EL]),M[R.UNLOAD_OBJ]);K[P]=null;M=null;Q=null;}}K=null;if(I&&I.length>0){O=I.length;while(O){N=O-1;M=I[N];if(M){R.removeListener(M[R.EL],M[R.TYPE],M[R.FN],N);}O=O-1;}M=null;R.clearCache();}for(P=0,L=G.length;P<L;++P){G[P][0]=null;G[P]=null;}G=null;R._simpleRemove(window,"unload",R._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var L=document.documentElement,M=document.body;if(L&&(L.scrollTop||L.scrollLeft)){return[L.scrollTop,L.scrollLeft];}else{if(M){return[M.scrollTop,M.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(N,O,M,L){N.addEventListener(O,M,(L));};}else{if(window.attachEvent){return function(N,O,M,L){N.attachEvent("on"+O,M);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(N,O,M,L){N.removeEventListener(O,M,(L));};}else{if(window.detachEvent){return function(M,N,L){M.detachEvent("on"+N,L);};}else{return function(){};}}}()};}();(function(){var D=YAHOO.util.Event;D.on=D.addListener;if(D.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var B,E=document,A=E.body;if(("undefined"!==typeof YAHOO_config)&&YAHOO_config.injecting){B=document.createElement("script");var C=E.getElementsByTagName("head")[0]||A;C.insertBefore(B,C.firstChild);}else{E.write("<script id=\"_yui_eu_dr\" defer=\"true\" src=\"//:\"></script>");B=document.getElementById("_yui_eu_dr");}if(B){B.onreadystatechange=function(){if("complete"===this.readyState){this.parentNode.removeChild(this);YAHOO.util.Event._ready();}};}else{}B=null;}else{if(D.webkit){D._drwatch=setInterval(function(){var F=document.readyState;if("loaded"==F||"complete"==F){clearInterval(D._drwatch);D._drwatch=null;D._ready();}},D.POLL_INTERVAL);}else{D._simpleAdd(document,"DOMContentLoaded",D._ready);}}D._simpleAdd(window,"load",D._load);D._simpleAdd(window,"unload",D._unload);D._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};
var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].override);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};YAHOO.util.KeyListener=function(A,F,B,C){if(!A){}else{if(!F){}else{if(!B){}}}if(!C){C=YAHOO.util.KeyListener.KEYDOWN;}var D=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof A=="string"){A=document.getElementById(A);}if(typeof B=="function"){D.subscribe(B);}else{D.subscribe(B.fn,B.scope,B.correctScope);}function E(K,J){if(!F.shift){F.shift=false;}if(!F.alt){F.alt=false;}if(!F.ctrl){F.ctrl=false;}if(K.shiftKey==F.shift&&K.altKey==F.alt&&K.ctrlKey==F.ctrl){var H;var G;if(F.keys instanceof Array){for(var I=0;I<F.keys.length;I++){H=F.keys[I];if(H==K.charCode){D.fire(K.charCode,K);break;}else{if(H==K.keyCode){D.fire(K.keyCode,K);break;}}}}else{H=F.keys;if(H==K.charCode){D.fire(K.charCode,K);}else{if(H==K.keyCode){D.fire(K.keyCode,K);}}}}}this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(A,C,E);this.enabledEvent.fire(F);}this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(A,C,E);this.disabledEvent.fire(F);}this.enabled=false;};this.toString=function(){return"KeyListener ["+F.keys+"] "+A.tagName+(A.id?"["+A.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.register("event",YAHOO.util.Event,{version:"2.3.1",build:"541"});
var __JSON_JS__ = 1;

/*
Copyright (c) 2005 JSON.org

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The Software shall be used for Good, not Evil.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

Array.prototype.______array = '______array';

var JSON = {
    org: 'http://www.JSON.org',
    copyright: '(c)2005 JSON.org',
    license: 'http://www.crockford.com/JSON/license.html',

    stringify: function (arg) {
        var c, i, l, s = '', v;

        switch (typeof arg) {
        case 'object':
            if (arg) {
                if (arg.______array == '______array') {
                    for (i = 0; i < arg.length; ++i) {
                        v = this.stringify(arg[i]);
                        if (s) {
                            s += ',';
                        }
                        s += v;
                    }
                    return '[' + s + ']';
                } else if (typeof arg.toString != 'undefined') {
                    for (i in arg) {
                        v = arg[i];
                        if (typeof v != 'undefined' && typeof v != 'function') {
                            v = this.stringify(v);
                            if (s) {
                                s += ',';
                            }
                            s += this.stringify(i) + ':' + v;
                        }
                    }
                    return '{' + s + '}';
                }
            }
            return 'null';
        case 'number':
            return isFinite(arg) ? String(arg) : 'null';
        case 'string':
            l = arg.length;
            s = '"';
            for (i = 0; i < l; i += 1) {
                c = arg.charAt(i);
                if (c >= ' ') {
                    if (c == '\\' || c == '"') {
                        s += '\\';
                    }
                    s += c;
                } else {
                    switch (c) {
                        case '\b':
                            s += '\\b';
                            break;
                        case '\f':
                            s += '\\f';
                            break;
                        case '\n':
                            s += '\\n';
                            break;
                        case '\r':
                            s += '\\r';
                            break;
                        case '\t':
                            s += '\\t';
                            break;
                        default:
                            c = c.charCodeAt();
                            s += '\\u00' + Math.floor(c / 16).toString(16) +
                                (c % 16).toString(16);
                    }
                }
            }
            return s + '"';
        case 'boolean':
            return String(arg);
        default:
            return 'null';
        }
    },
    parse: function (text) {
        var at = 0;
        var ch = ' ';

        function error(m) {
            throw {
                name: 'JSONError',
                message: m,
                at: at - 1,
                text: text
            };
        }

        function next() {
            ch = text.charAt(at);
            at += 1;
            return ch;
        }

        function white() {
            while (ch) {
                if (ch <= ' ') {
                    next();
                } else if (ch == '/') {
                    switch (next()) {
                        case '/':
                            while (next() && ch != '\n' && ch != '\r') {}
                            break;
                        case '*':
                            next();
                            for (;;) {
                                if (ch) {
                                    if (ch == '*') {
                                        if (next() == '/') {
                                            next();
                                            break;
                                        }
                                    } else {
                                        next();
                                    }
                                } else {
                                    error("Unterminated comment");
                                }
                            }
                            break;
                        default:
                            error("Syntax error");
                    }
                } else {
                    break;
                }
            }
        }

        function string() {
            var i, s = '', t, u;

            if (ch == '"') {
outer:          while (next()) {
                    if (ch == '"') {
                        next();
                        return s;
                    } else if (ch == '\\') {
                        switch (next()) {
                        case 'b':
                            s += '\b';
                            break;
                        case 'f':
                            s += '\f';
                            break;
                        case 'n':
                            s += '\n';
                            break;
                        case 'r':
                            s += '\r';
                            break;
                        case 't':
                            s += '\t';
                            break;
                        case 'u':
                            u = 0;
                            for (i = 0; i < 4; i += 1) {
                                t = parseInt(next(), 16);
                                if (!isFinite(t)) {
                                    break outer;
                                }
                                u = u * 16 + t;
                            }
                            s += String.fromCharCode(u);
                            break;
                        default:
                            s += ch;
                        }
                    } else {
                        s += ch;
                    }
                }
            }
            error("Bad string");
        }

        function array() {
            var a = [];

            if (ch == '[') {
                next();
                white();
                if (ch == ']') {
                    next();
                    return a;
                }
                while (ch) {
                    a.push(value());
                    white();
                    if (ch == ']') {
                        next();
                        return a;
                    } else if (ch != ',') {
                        break;
                    }
                    next();
                    white();
                }
            }
            error("Bad array");
        }

        function object() {
            var k, o = {};

            if (ch == '{') {
                next();
                white();
                if (ch == '}') {
                    next();
                    return o;
                }
                while (ch) {
                    k = string();
                    white();
                    if (ch != ':') {
                        break;
                    }
                    next();
                    o[k] = value();
                    white();
                    if (ch == '}') {
                        next();
                        return o;
                    } else if (ch != ',') {
                        break;
                    }
                    next();
                    white();
                }
            }
            error("Bad object");
        }

        function number() {
            var n = '', v;
            if (ch == '-') {
                n = '-';
                next();
            }
            while (ch >= '0' && ch <= '9') {
                n += ch;
                next();
            }
            if (ch == '.') {
                n += '.';
                while (next() && ch >= '0' && ch <= '9') {
                    n += ch;
                }
            }
            if (ch == 'e' || ch == 'E') {
                n += 'e';
                next();
                if (ch == '-' || ch == '+') {
                    n += ch;
                    next();
                }
                while (ch >= '0' && ch <= '9') {
                    n += ch;
                    next();
                }
            }
            v = +n;
            if (!isFinite(v)) {
                ////error("Bad number");
            } else {
                return v;
            }
        }

        function word() {
            switch (ch) {
                case 't':
                    if (next() == 'r' && next() == 'u' && next() == 'e') {
                        next();
                        return true;
                    }
                    break;
                case 'f':
                    if (next() == 'a' && next() == 'l' && next() == 's' &&
                            next() == 'e') {
                        next();
                        return false;
                    }
                    break;
                case 'n':
                    if (next() == 'u' && next() == 'l' && next() == 'l') {
                        next();
                        return null;
                    }
                    break;
            }
            error("Syntax error");
        }

        function value() {
            white();
            switch (ch) {
                case '{':
                    return object();
                case '[':
                    return array();
                case '"':
                    return string();
                case '-':
                    return number();
                default:
                    return ch >= '0' && ch <= '9' ? number() : word();
            }
        }

        return value();
    }
};
/*
 * modexec.js
 * ------------
 * CVS Tags
 * $Id: modexec.js,v 1.2 2006/02/06 15:55:04 mstemle Exp $
 * $Date: 2006/02/06 15:55:04 $
 * ----------
 */

var SECURE_URI = "/%3Atools%3Amodexec";
var INSECURE_URI = "/%3Amodexec";

function ModExec (auth)
{
	this.uri = (auth) ? SECURE_URI : INSECURE_URI;

	this.exec = ModExec_Exec;

	return this;
}

function ModExec_Exec (use_module, call_function, args, success_callback, failure_callback)
{
	var conn = null;
	var post_data = null;

	post_data = "use_module="+escape(use_module)+"&call_function="+escape(call_function)+"&args=";
	if (args != null)
	{
		post_data += escape(JSON.stringify(args));
	}

	try
	{
		conn = new XMLHttpRequest();
	}
	catch (error)
	{
		try
		{
			conn = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (error)
		{
			return false;
		}
	}
	conn.onreadystatechange = function ()
	{
		var response_obj = null;
		
		/* If XMLHR object has finished retrieving the data */
		if (conn.readyState == 4)
		{
			/* If the data was retrieved successfully */
			if (conn.status == 200)
			{
				response_obj = JSON.parse (conn.responseText);
				if (response_obj.errcode)
				{
					return failure_callback (response_obj);
				}
				else
				{
					return success_callback (response_obj);
				}
			}
			/* IE returns a status code of 0 on some occasions, so ignore this case */
			else if (conn.status != 0)
			{
				failure_callback ({errcode:"ERR_UNKNOWN",errstr:conn.statusText});
			}
		} 
	}
	conn.open ("POST", this.uri, true);
	conn.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	conn.send (post_data);
}

// Include the JSON reader
try {
  if (!__JSON_JS__) {
    document.write ("<scr"+"ipt language=\"javascript\" type=\"text/javascript\" src=\"/lib/jslib/json.js\"></scr"+"ipt>");
  }
} catch (e) {
  document.write ("<scr"+"ipt language=\"javascript\" type=\"text/javascript\" src=\"/lib/jslib/json.js\"></scr"+"ipt>");
}

try {
  if (On_ModExecReady != null) {
    On_ModExecReady();
  }
} catch (e) {};

var ZB={};
ZB.v=parseInt('$Revision: 5050 $'.match(/ (\d+) /)[1]).toString(16);
ZB.tld=location.host.match(/\.([^\.]+)$/)[1];
ZB.burl="http://www.zoomshare."+ZB.tld+"/";
ZB.IE=(navigator.userAgent.indexOf('MSIE')>0)?true:false;
ZB.diggit_url="http://digg.com/submit?phase=2&url="+document.location.href;

function StartEvents() {
  try {
    YAHOO.util.Event.onContentReady("heading", zoombar_finish_load, null);
    YAHOO.util.Event.onAvailable('heading', zoombar_finish_load, null);
  } catch (e) {
    if (e.description) {
      alert(e.description);
    } else {
      alert(e);
    }
  }
}

var __zoombar_ad_location = 'heading';
var bump_timeout_time = 1000;
var retry_max = 5;
var retry_count = 0;
var toolbar_height = 45;
var use_toolbar=true;

var ad_bg='ffffff';//default

//get the colors from the body - oldschool
if (document.body.bgColor) ad_bg = document.body.bgColor;

var ie_hack = ZB.IE ? '<div class="zst_iewidthhack">&nbsp;</div><div class="lower_iewidthhack">&nbsp;</div>' : "";
		
var ad_frame_src='/lib/suffixapp/zoombar/ad_iframe.htm';
var ad_code = '<iframe id="_zst_google_frame" name="_zst_google_frame" border="0" class="zst_ad_frame" style="background:'+ad_bg+';" frameborder="0" allowtransparency="true" scrolling="no" src="'+ad_frame_src+'"></iframe>';
var profile_url = "/:profile?action=view&website=1";
var profile_html = (document.location.href.match(/:profile/))?"":'<a href="'+profile_url+'" style="float:right;padding-right: 5px;" class="zst_zslinks">View My Profile</a>';
var __zoombar_HTML = '\
<!-- START TOOLBAR -->\
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>\
<script type="text/javascript" src="http://search.zoomshare.com/dw/script/dw_base.js"></script>\
<script type="text/javascript" src="http://search.zoomshare.com/dw/script/dw_shadow.js"></script>\
<script type="text/javascript" src="/lib/js/zs_rater.js"></script>\
<style type="text/css">\
	@import url(/lib/suffixapp/zoombar/zoombar.css?'+ZB.v+');\
	.watermark { background-image: url(/lib/img/watermarkSearch.png); background-repeat:no-repeat; background-position:center }\
</style>\
	<div class="zst_zstoolbar">\
		<table width="100%" cellpadding="0" cellspacing="0" id="zst_header_bar" border="0">\
			<tr>\
				<td align="left" class="zst_cell" style="width: 30px; padding-top:14px !important;" valign="top"><a href="http://www.zoomshare.'+ZB.tld+'/?source=zoombar"><img src="'+ZB.burl+'images/logoZb.png?'+ZB.v+'" width="28" height="17" border="0"></a></td>\
				<td class="zst_cell" class="zst_zslinks" align="left" style="width: 75px; padding-top:15px !important;" valign="top"><a href="http://www.allabout.zoomshare.com/" class="zst_zslinks">resources</a></td>\
				<td class="zst_cell" align="left" valign="top" width="125px" style="padding-top:10px !important;"><form name="zsform" method="get" action="http://search.zoomshare.com/search.aspx" class="zsform" onsubmit="checkImageSearchSubmit(this);" id="zsform">\
<input type="text" name="tbx_search" style="font-size:10px; height:19px; width:125px" class="watermark" onfocus="this.className=\'\'" onBlur="this.className=\'watermark\'" /></form></td>\
				<td class="zst_cell" align="left" style="width: 190px; padding: 3px 0 0 5px !important;; text-align:left"><iframe src="http://www.facebook.com/plugins/like.php?href=' + escape(location.href) + '&amp;layout=standard&amp;show_faces=false&amp;width=190&amp;action=like&amp;colorscheme=light&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:190px; height:35px; font-size:7pt" allowTransparency="true"></iframe></td>\
				<td class="zst_cell" align="center" width="60%" valign="top" style="padding-top:5px !important;"><a href="http://www.zoomshare.'+ZB.tld+'/?source=zoombar"><img src="'+ZB.burl+'lib/img/zslogo.png?'+ZB.v+'" width="170" height="35" border="0" align="center"></a></td>\
				<td align="right" class="zst_freelink_cell" valign="top" style="padding-top:10px !important;"><script type="text/javascript">var addthis_pub="zoomshare";var addthis_header_color = "#990000";var addthis_header_background = "#d89f84"; var my_timer = null; function show_share() { return addthis_open(document.getElementById("a_share_link"),"", "[URL]", "[TITLE]");}</script><a id="a_share_link" class="zst_zslinks" href="http://www.addthis.com/bookmark.php" style="text-decoration:none;" onmouseover="if (my_timer == null ) { my_timer = setTimeout(show_share, 200);}" onmouseout="if ( my_timer != null ) { clearTimeout(my_timer); my_timer=null; } else { addthis_close();}" onclick="return addthis_sendto();"><img src="/lib/img/addthis.png" width="16" height="12" border="0" alt="" />share!</a><script type="text/javascript" src="http://s7.addthis.com/js/200/addthis_widget.js"></script>\
				<a href="javascript:void(0)" onclick=" jQuery.noConflict();shadowPieces.shadowPath=\'http://search.zoomshare.com/dw/image/\';toggle_zs_rater(this, \'Rate This Site\', \'rater\')" class="zst_zslinks">rate this site</a>\
				<a href="http://www.zoomshare.com/upgrade.html" style="font-weight:bold" class="zst_zslinks">UPGRADE</a>\
				<a href="http://www.zoomshare.com/freepersonalsite/" class="zst_zslinks">create website</a> <a href="http://www.zoomshare.com/" class="zst_zslinks">login</a></td>\
			</tr>\
		</table>\
	</div>\
	'+ie_hack+'\
'+'<scr'+'ipt  type="text/javascript">try{insertPageAd();}catch(e){};</scr'+'ipt>'+'\
<!-- END TOOLBAR -->\
<div id="zs_rater_holder" style="position:absolute;z-index:1000;left:0px;top:0px;height:auto;width:auto;display:none;text-align:left; font-size:8pt;" class="floating">\
	<div id="zs_rater" style="position:absolute; z-index: 10;left:0px; height:0px; width: 452px; height:auto; background-color:#fff; border:1px solid #666; color:#000">\
		<div id="zs_rater_label" onmouseover="Drag.init(this,$g(\'zs_rater_holder\'))" style="height:20px; width:100%; background-color: #666; color:#fff; font-weight:bold;"><span onclick="toggle_zs_rater()" style="float:right;margin-right:6px;cursor:pointer;">&times;</span>\
			<span class="label" id="zs_rater_label_text" style="margin-left:6px; margin-top:2px;">test</span>\
		</div>\
		<div id="zs_rater_form" style="width:432px; height:auto;padding:10px;">\
		<div align="left"><a href="http://www.zoomshare.com/"><img src="/lib/img/logoPopUp.png" width="125" height="35" style="border: 0" alt="Zoomshare - Rate This Site" align="right" hspace="10"/></a></div>\
<p style="font-size:110%; font-weight:600; font-style:italic">Zoomshare values the feedback of our members and visitors. Thank you for taking the time to tell us your opinion of this site. </p>\
<input type="hidden" name="_recipient" value="ratethissite@zoomshare.com">\
<div style="padding-bottom:5px"><em>Please note: Zoomshare will never share your responses with any outside parties.</em></div>\
<div>Rate this site between one and five stars, where five stars is a &quot;Must See&quot; website.<br>\
<input type="radio" name="mustSee" value="One Star"><img src="/lib/img/star.png" /><br>\
<input type="radio" name="mustSee" value="Two Stars"><img src="/lib/img/star.png" /><img src="/lib/img/star.png" /><br>\
<input type="radio" name="mustSee" value="Three Stars"><img src="/lib/img/star.png" /><img src="/lib/img/star.png" /><img src="/lib/img/star.png" /><br>\
<input type="radio" name="mustSee" value="Four Stars"><img src="/lib/img/star.png" /><img src="/lib/img/star.png" /><img src="/lib/img/star.png" /><img src="/lib/img/star.png" /><br>\
<input type="radio" name="mustSee" value="Five Stars"><img src="/lib/img/star.png" /><img src="/lib/img/star.png" /><img src="/lib/img/star.png" /><img src="/lib/img/star.png" />\
<img src="/lib/img/star.png" />\
</div>\
<div>Please feel free to send Zoomshare your comments about this site:<br>\
<textarea cols="40" rows="2" name="comments"></textarea>\
</div>\
<div>Report a Terms of Service Violation.</div>\
<table>\
<tr>\
<td style="font-size:8pt; color:#000; border:none"><input type="radio" name="tosViolation" value="Copyright/Piracy Issues">Copyright/Piracy Issues<br>\
<input type="radio" name="tosViolation" value="Defamation/Libel/Slander">Defamation/Libel/Slander<br>\
<input type="radio" name="tosViolation" value="Nudity">Nudity<br>\
<input type="radio" name="tosViolation" value="Spam">Spam</td>\
<td style="font-size:8pt; color:#000; border:none"><input type="radio" name="tosViolation" value="Posting of Private Information">Posting of Private Information<br>\
<input type="radio" name="tosViolation" value="Hate/Violence">Hate/Violence<br>\
<input type="radio" name="tosViolation" value="Impersonation">Impersonation<br>\
<input type="radio" name="tosViolation" value="Other">Other</td>\
</tr>\
</table>\
<div>Please describe the violation in detail.</div>\
<textarea cols="40" rows="2" name="description of violation"></textarea>\
<div style="height:31px"><INPUT TYPE="button" VALUE="Submit Form" id="btn_submitform" onclick="submit_ratethissite(this);">\
	<span id="img_submitform_wait" style="display:none"><img src="http://search.zoomshare.com/dw/image/wait.gif" style="width:31px; height:31px;"></span>\
	&nbsp;<INPUT TYPE="reset" VALUE="Start Over">\
</div>\
		</div>\
		<div id="zs_rater_closelink" style="text-align:right;padding:10px;font-size:7pt;"><span class="action closelink" onclick="toggle_zs_rater()">Close</span></div>\
	</div>\
</div>\
<div style="display:none;">\
<img src="http://search.zoomshare.com/dw/image/shad_bl3.png" />\
<img src="http://search.zoomshare.com/dw/image/shad_h3.png" />\
<img src="http://search.zoomshare.com/dw/image/shad_tr3.png" />\
<img src="http://search.zoomshare.com/dw/image/shad_v3.png" />\
<img src="http://search.zoomshare.com/dw/image/shad_br3.png" />\
</div>';
function submit_ratethissite(ocaller) {
		var req = getreq();
		this.handler = function() {
			if (req.readyState == 4) {
				jQuery('#img_submitform_wait').hide();
				jQuery('#btn_submitform').show();
				document.body.style.cursor = "default";
				if (req.status == 200) {
					toggle_zs_rater();
				}
				else {
					alert(req.responseText);
				}
			}
		}

		this.validate = function() {
			var oci = getObjectChildrenInput("zs_rater_form");
			var retval = "";
			for ( var x=0; x < oci.length; x++ ) {
				if ( x > 0 ) retval += "&";
				retval += (oci[x].K + "=" + escape(oci[x].V ));
			}
			
			return retval; // if no problems, otherwise return null and display alert!
		}

		var sendObj = this.validate();

		if (req && sendObj) {
			jQuery('#img_submitform_wait').show();
			jQuery('#btn_submitform').hide();
			req.open("GET", "/lib/cgi-bin/thankyou.cgi?" + sendObj, true);
			req.onreadystatechange = this.handler;
			document.body.style.cursor = "wait";
			req.sendObj = sendObj;
			req.send("");
		}
	
	}
function runSearch ()
{
	var f = document.getElementById ("zst_searchform");
	
	if (f.q.value == "Enter Keywords..." || f.q.value.length == 0)
	{
		alert ("Please enter at least one search terms before clicking GO.");
		f.q.focus();
	}
	else
	{
		f.submit ();
	}
}

function loadToolbarControl () {
	// Make sure we're not in the editor!!!!
	if (location.pathname.match(/:tools/i)) return;

	if (! (parent === self)) { // framed in
		var r = false;
		try { if (parent.DW != null) r = true; } catch (e) {} finally {}
		if (r) return;
	}

	// Generate chat control
	document.write (__zoombar_HTML);
  if (ZB.IE) {
		document.write('<scr'+'ipt src="http://www.google-analytics.com/urchin.js" type="text/javascript"><\/scr'+'ipt>');
		document.onreadystatechange = function () {
			if (document.readyState=="complete")
			{
				_uacct = "UA-83262-4";
				urchinTracker();
				try {
				  insertPageAd();
        } catch (e) {};
			}
		};
	}
	else {
		document.write('<scr'+'ipt src="http://www.google-analytics.com/urchin.js" type="text/javascript"><\/scr'+'ipt><scr'+'ipt type="text/javascript">try {_uacct = "UA-83262-4";urchinTracker();insertPageAd()} catch (e) {};<\/scr'+'ipt>');
	}
	
	bump_content();
	
	return true;
}

function bump_content ()
{
	// Bump the document down to make room for everything.
	document.body.style.marginTop = toolbar_height + "px";
	document.body.style.backgroundPosition='0px ' + toolbar_height + "px";
	
	return true;
}

var global_color_info = null;

function insertHeaderAd() {
  if (location.pathname.match(/^\/:/i))
	{
		// Do nothing here.
		return;
	} else if (zoombar_finished) {
    return;
  }
  
  var tbl = document.getElementById('zst_header_bar');
  var row = document.createElement('tr');
  var cell = document.createElement('td');
  var iframe = document.createElement('iframe');
  
  // Make the row
  row.id = 'top_ad';
  
  // Make the cell
  cell.id='zst_ad_cell';
  cell.setAttribute('valign', 'middle');
  cell.setAttribute('align', 'center');
  cell.className = 'zst_ad_cell';
  cell.setAttribute('colspan', '4');
  cell.style.backgroundColor = (global_color_info != null && global_color_info.bgcolor != null)?
    global_color_info:ad_bg;
  
  // Make the iframe
  iframe.id = '_zst_google_frame';
  iframe.setAttribute('name', '_zst_google_frame');
  iframe.setAttribute('border', '0');
  iframe.setAttribute('frameborder', '0');
  iframe.setAttribute('allowtransparency', 'true');
  iframe.setAttribute('scrolling', 'no');
  iframe.className = 'zst_ad_frame';
  iframe.style.backgroundColor = (global_color_info != null && global_color_info.bgcolor != null)?
    global_color_info:ad_bg;
  iframe.src = ad_frame_src;
  
  // Put the lime in the coke, you nut!
  cell.appendChild(iframe);
  row.appendChild(cell);
  tbl.appendChild(row);
  
  return;
}

function insertPageAd() {
  if (location.pathname.match(/^\/:/i))
	{
		// Do nothing here.
		return;
	} else if (zoombar_finished) {
    return;
  }
  // Make sure we're not in the editor!!!!
	if (location.pathname.match (/:tools/i))
	{
		// Do nothing here.
		return;
	}
  var target = document.getElementById(__zoombar_ad_location);
  
  if (target == null) {
    throw 1;
  }

  var fullControl = document.createElement('div');
  with (fullControl.style) {
    width = '468px';
    padding = '10px 0px 10px 0px';
    margin = '0px 0px 0px -4px';
    overflow = 'hidden';
    overflowX = 'hidden';
    overflowY = 'hidden';
    zIndex = '99';
    position = 'relative';
  }
  
/*  var _iframe = document.createElement('iframe');
  _iframe.setAttribute('border', '0');
  _iframe.frameBorder = 0;
  _iframe.setAttribute('scrolling', "no");
  _iframe.src="http://ads.zoomshare.dwqa/ad.aspx";
  // _iframe.src="/lib/suffixapp/zoombar/ad_page_frame.html";
  
  // Set the style attributes
  with (_iframe.style) {
    width = '468px';
    height = '60px';
    overflow = 'hidden';
    overflowX = 'hidden';
    overflowY = 'hidden';
    padding = '0px';
    margin = '0px';
    border = global_color_info.canvascolor;
    backgroundColor = global_color_info.canvascolor;
    zIndex = '99';
    position = 'relative';
  }
  
  fullControl.appendChild(_iframe);
  target.insertBefore(fullControl, target.firstChild.nextSibling);
  */
}

function set_default_ads() {
  if (location.pathname.match(/^\/:/i))
	{
		// Do nothing here.
		return;
	} else if (zoombar_finished) {
    return;
  }
  
  insertHeaderAd();
  toolbar_height = 114;
  bump_content();
  zoombar_finished = true;
  return;
}

var zoombar_finished = false;
function zoombar_finish_load (dummy) {
  if (location.pathname.match(/^\/:/i))
	{
		// Do nothing here.
		return;
	} else if (zoombar_finished) {
    return;
  }

  if (typeof(DW_colorinfo) == 'object') {
    global_color_info = DW_colorinfo;
    insertPageAd();
    zoombar_finished = true;
  }
  else {
    try {
      var meh = new ModExec();
      meh.exec('DigitalWork::Site::ColorInfo', 'color_info', null,
        function (data) {
          try {
            DW_colorinfo = global_color_info = data.value;
            insertPageAd();
            zoombar_finished = true;
  
          } catch (e) {
            set_default_ads();
          };
        },
        function (data) {
          set_default_ads();
          return;
        });
    } catch (e) {
      set_default_ads();
    };
  }
}

loadToolbarControl();
try {
  insertPageAd();
} catch (e) {
  StartEvents();
};


