
if(!this.JSON){JSON={};}
(function(){function f(n){return n<10?'0'+n:n;}
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return this.getUTCFullYear()+'-'+
f(this.getUTCMonth()+1)+'-'+
f(this.getUTCDate())+'T'+
f(this.getUTCHours())+':'+
f(this.getUTCMinutes())+':'+
f(this.getUTCSeconds())+'Z';};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapeable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapeable.lastIndex=0;return escapeable.test(string)?'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==='string'){return c;}
return'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
gap+=indent;partial=[];if(typeof value.length==='number'&&!value.propertyIsEnumerable('length')){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
v=partial.length===0?'[]':gap?'[\n'+gap+
partial.join(',\n'+gap)+'\n'+
mind+']':'['+partial.join(',')+']';gap=mind;return v;}
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==='string'){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+
mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
return str('',{'':value});};}
if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
return reviver.call(holder,key,value);}
cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('JSON.parse');};}})();
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
if(typeof YAHOO=="undefined"||!YAHOO){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,mobile:null,air: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(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}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=YAHOO.lang||{};(function(){var A=YAHOO.lang,C=["toString","valueOf"],B={isArray:function(D){if(D){return A.isNumber(D.length)&&A.isFunction(D.splice);}return false;},isBoolean:function(D){return typeof D==="boolean";},isFunction:function(D){return typeof D==="function";},isNull:function(D){return D===null;},isNumber:function(D){return typeof D==="number"&&isFinite(D);},isObject:function(D){return(D&&(typeof D==="object"||A.isFunction(D)))||false;},isString:function(D){return typeof D==="string";},isUndefined:function(D){return typeof D==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(F,E){for(var D=0;D<C.length;D=D+1){var H=C[D],G=E[H];if(A.isFunction(G)&&G!=Object.prototype[H]){F[H]=G;}}}:function(){},extend:function(H,I,G){if(!I||!H){throw new Error("extend failed, please check that "+"all dependencies are included.");}var E=function(){};E.prototype=I.prototype;H.prototype=new E();H.prototype.constructor=H;H.superclass=I.prototype;if(I.prototype.constructor==Object.prototype.constructor){I.prototype.constructor=I;}if(G){for(var D in G){if(A.hasOwnProperty(G,D)){H.prototype[D]=G[D];}}A._IEEnumFix(H.prototype,G);}},augmentObject:function(H,G){if(!G||!H){throw new Error("Absorb failed, verify dependencies.");}var D=arguments,F,I,E=D[2];if(E&&E!==true){for(F=2;F<D.length;F=F+1){H[D[F]]=G[D[F]];}}else{for(I in G){if(E||!(I in H)){H[I]=G[I];}}A._IEEnumFix(H,G);}},augmentProto:function(G,F){if(!F||!G){throw new Error("Augment failed, verify dependencies.");}var D=[G.prototype,F.prototype];for(var E=2;E<arguments.length;E=E+1){D.push(arguments[E]);}A.augmentObject.apply(this,D);},dump:function(D,I){var F,H,K=[],L="{...}",E="f(){...}",J=", ",G=" => ";if(!A.isObject(D)){return D+"";}else{if(D instanceof Date||("nodeType"in D&&"tagName"in D)){return D;}else{if(A.isFunction(D)){return E;}}}I=(A.isNumber(I))?I:3;if(A.isArray(D)){K.push("[");for(F=0,H=D.length;F<H;F=F+1){if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}if(K.length>1){K.pop();}K.push("]");}else{K.push("{");for(F in D){if(A.hasOwnProperty(D,F)){K.push(F+G);if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}}if(K.length>1){K.pop();}K.push("}");}return K.join("");},substitute:function(S,E,L){var I,H,G,O,P,R,N=[],F,J="dump",M=" ",D="{",Q="}";for(;;){I=S.lastIndexOf(D);if(I<0){break;}H=S.indexOf(Q,I);if(I+1>=H){break;}F=S.substring(I+1,H);O=F;R=null;G=O.indexOf(M);if(G>-1){R=O.substring(G+1);O=O.substring(0,G);}P=E[O];if(L){P=L(O,P,R);}if(A.isObject(P)){if(A.isArray(P)){P=A.dump(P,parseInt(R,10));}else{R=R||"";var K=R.indexOf(J);if(K>-1){R=R.substring(4);}if(P.toString===Object.prototype.toString||K>-1){P=A.dump(P,parseInt(R,10));}else{P=P.toString();}}}else{if(!A.isString(P)&&!A.isNumber(P)){P="~-"+N.length+"-~";N[N.length]=F;}}S=S.substring(0,I)+P+S.substring(H+1);}for(I=N.length-1;I>=0;I=I-1){S=S.replace(new RegExp("~-"+I+"-~"),"{"+N[I]+"}","g");}return S;},trim:function(D){try{return D.replace(/^\s+|\s+$/g,"");}catch(E){return D;}},merge:function(){var G={},E=arguments;for(var F=0,D=E.length;F<D;F=F+1){A.augmentObject(G,E[F],true);}return G;},later:function(K,E,L,G,H){K=K||0;E=E||{};var F=L,J=G,I,D;if(A.isString(L)){F=E[L];}if(!F){throw new TypeError("method undefined");}if(!A.isArray(J)){J=[G];}I=function(){F.apply(E,J);};D=(H)?setInterval(I,K):setTimeout(I,K);return{interval:H,cancel:function(){if(this.interval){clearInterval(D);}else{clearTimeout(D);}}};},isValue:function(D){return(A.isObject(D)||A.isString(D)||A.isNumber(D)||A.isBoolean(D));}};A.hasOwnProperty=(Object.prototype.hasOwnProperty)?function(D,E){return D&&D.hasOwnProperty(E);}:function(D,E){return!A.isUndefined(D[E])&&D.constructor.prototype[E]!==D[E];};B.augmentObject(A,B,true);YAHOO.util.Lang=A;A.augment=A.augmentProto;YAHOO.augment=A.augmentProto;YAHOO.extend=A.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.5.2",build:"1076"});(function(){var B=YAHOO.util,K,I,J={},F={},M=window.document;YAHOO.env._id_counter=YAHOO.env._id_counter||0;var C=YAHOO.env.ua.opera,L=YAHOO.env.ua.webkit,A=YAHOO.env.ua.gecko,G=YAHOO.env.ua.ie;var E={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i,OP_SCROLL:/^(?:inline|table-row)$/i};var N=function(P){if(!E.HYPHEN.test(P)){return P;}if(J[P]){return J[P];}var Q=P;while(E.HYPHEN.exec(Q)){Q=Q.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}J[P]=Q;return Q;};var O=function(Q){var P=F[Q];if(!P){P=new RegExp("(?:^|\\s+)"+Q+"(?:\\s+|$)");F[Q]=P;}return P;};if(M.defaultView&&M.defaultView.getComputedStyle){K=function(P,S){var R=null;if(S=="float"){S="cssFloat";}var Q=P.ownerDocument.defaultView.getComputedStyle(P,"");if(Q){R=Q[N(S)];}return P.style[S]||R;};}else{if(M.documentElement.currentStyle&&G){K=function(P,R){switch(N(R)){case"opacity":var T=100;try{T=P.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(S){try{T=P.filters("alpha").opacity;}catch(S){}}return T/100;case"float":R="styleFloat";default:var Q=P.currentStyle?P.currentStyle[R]:null;return(P.style[R]||Q);}};}else{K=function(P,Q){return P.style[Q];};}}if(G){I=function(P,Q,R){switch(Q){case"opacity":if(YAHOO.lang.isString(P.style.filter)){P.style.filter="alpha(opacity="+R*100+")";if(!P.currentStyle||!P.currentStyle.hasLayout){P.style.zoom=1;}}break;case"float":Q="styleFloat";default:P.style[Q]=R;}};}else{I=function(P,Q,R){if(Q=="float"){Q="cssFloat";}P.style[Q]=R;};}var D=function(P,Q){return P&&P.nodeType==1&&(!Q||Q(P));};YAHOO.util.Dom={get:function(R){if(R&&(R.nodeType||R.item)){return R;}if(YAHOO.lang.isString(R)||!R){return M.getElementById(R);}if(R.length!==undefined){var S=[];for(var Q=0,P=R.length;Q<P;++Q){S[S.length]=B.Dom.get(R[Q]);}return S;}return R;},getStyle:function(P,R){R=N(R);var Q=function(S){return K(S,R);};return B.Dom.batch(P,Q,B.Dom,true);},setStyle:function(P,R,S){R=N(R);var Q=function(T){I(T,R,S);};B.Dom.batch(P,Q,B.Dom,true);},getXY:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}return H(R);};return B.Dom.batch(P,Q,B.Dom,true);},getX:function(P){var Q=function(R){return B.Dom.getXY(R)[0];};return B.Dom.batch(P,Q,B.Dom,true);},getY:function(P){var Q=function(R){return B.Dom.getXY(R)[1];};return B.Dom.batch(P,Q,B.Dom,true);},setXY:function(P,S,R){var Q=function(V){var U=this.getStyle(V,"position");if(U=="static"){this.setStyle(V,"position","relative");U="relative";}var X=this.getXY(V);if(X===false){return false;}var W=[parseInt(this.getStyle(V,"left"),10),parseInt(this.getStyle(V,"top"),10)];if(isNaN(W[0])){W[0]=(U=="relative")?0:V.offsetLeft;}if(isNaN(W[1])){W[1]=(U=="relative")?0:V.offsetTop;}if(S[0]!==null){V.style.left=S[0]-X[0]+W[0]+"px";}if(S[1]!==null){V.style.top=S[1]-X[1]+W[1]+"px";}if(!R){var T=this.getXY(V);if((S[0]!==null&&T[0]!=S[0])||(S[1]!==null&&T[1]!=S[1])){this.setXY(V,S,true);}}};B.Dom.batch(P,Q,B.Dom,true);},setX:function(Q,P){B.Dom.setXY(Q,[P,null]);},setY:function(P,Q){B.Dom.setXY(P,[null,Q]);},getRegion:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}var S=B.Region.getRegion(R);return S;};return B.Dom.batch(P,Q,B.Dom,true);},getClientWidth:function(){return B.Dom.getViewportWidth();},getClientHeight:function(){return B.Dom.getViewportHeight();},getElementsByClassName:function(T,X,U,V){X=X||"*";U=(U)?B.Dom.get(U):null||M;if(!U){return[];}var Q=[],P=U.getElementsByTagName(X),W=O(T);for(var R=0,S=P.length;R<S;++R){if(W.test(P[R].className)){Q[Q.length]=P[R];if(V){V.call(P[R],P[R]);}}}return Q;},hasClass:function(R,Q){var P=O(Q);var S=function(T){return P.test(T.className);};return B.Dom.batch(R,S,B.Dom,true);},addClass:function(Q,P){var R=function(S){if(this.hasClass(S,P)){return false;}S.className=YAHOO.lang.trim([S.className,P].join(" "));return true;};return B.Dom.batch(Q,R,B.Dom,true);},removeClass:function(R,Q){var P=O(Q);var S=function(T){if(!Q||!this.hasClass(T,Q)){return false;}var U=T.className;T.className=U.replace(P," ");if(this.hasClass(T,Q)){this.removeClass(T,Q);}T.className=YAHOO.lang.trim(T.className);return true;};return B.Dom.batch(R,S,B.Dom,true);},replaceClass:function(S,Q,P){if(!P||Q===P){return false;}var R=O(Q);var T=function(U){if(!this.hasClass(U,Q)){this.addClass(U,P);return true;}U.className=U.className.replace(R," "+P+" ");if(this.hasClass(U,Q)){this.replaceClass(U,Q,P);}U.className=YAHOO.lang.trim(U.className);return true;};return B.Dom.batch(S,T,B.Dom,true);},generateId:function(P,R){R=R||"yui-gen";var Q=function(S){if(S&&S.id){return S.id;}var T=R+YAHOO.env._id_counter++;if(S){S.id=T;}return T;};return B.Dom.batch(P,Q,B.Dom,true)||Q.apply(B.Dom,arguments);},isAncestor:function(P,Q){P=B.Dom.get(P);Q=B.Dom.get(Q);if(!P||!Q){return false;}if(P.contains&&Q.nodeType&&!L){return P.contains(Q);}else{if(P.compareDocumentPosition&&Q.nodeType){return!!(P.compareDocumentPosition(Q)&16);}else{if(Q.nodeType){return!!this.getAncestorBy(Q,function(R){return R==P;});}}}return false;},inDocument:function(P){return this.isAncestor(M.documentElement,P);},getElementsBy:function(W,Q,R,T){Q=Q||"*";R=(R)?B.Dom.get(R):null||M;if(!R){return[];}var S=[],V=R.getElementsByTagName(Q);for(var U=0,P=V.length;U<P;++U){if(W(V[U])){S[S.length]=V[U];if(T){T(V[U]);}}}return S;},batch:function(T,W,V,R){T=(T&&(T.tagName||T.item))?T:B.Dom.get(T);if(!T||!W){return false;}var S=(R)?V:window;if(T.tagName||T.length===undefined){return W.call(S,T,V);}var U=[];for(var Q=0,P=T.length;Q<P;++Q){U[U.length]=W.call(S,T[Q],V);}return U;},getDocumentHeight:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollHeight:M.documentElement.scrollHeight;var P=Math.max(Q,B.Dom.getViewportHeight());return P;},getDocumentWidth:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollWidth:M.documentElement.scrollWidth;var P=Math.max(Q,B.Dom.getViewportWidth());return P;},getViewportHeight:function(){var P=self.innerHeight;var Q=M.compatMode;if((Q||G)&&!C){P=(Q=="CSS1Compat")?M.documentElement.clientHeight:M.body.clientHeight;}return P;},getViewportWidth:function(){var P=self.innerWidth;var Q=M.compatMode;if(Q||G){P=(Q=="CSS1Compat")?M.documentElement.clientWidth:M.body.clientWidth;}return P;},getAncestorBy:function(P,Q){while(P=P.parentNode){if(D(P,Q)){return P;}}return null;},getAncestorByClassName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return B.Dom.hasClass(S,P);};return B.Dom.getAncestorBy(Q,R);},getAncestorByTagName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return S.tagName&&S.tagName.toUpperCase()==P.toUpperCase();};return B.Dom.getAncestorBy(Q,R);},getPreviousSiblingBy:function(P,Q){while(P){P=P.previousSibling;if(D(P,Q)){return P;}}return null;},getPreviousSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getPreviousSiblingBy(P);},getNextSiblingBy:function(P,Q){while(P){P=P.nextSibling;if(D(P,Q)){return P;}}return null;},getNextSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getNextSiblingBy(P);},getFirstChildBy:function(P,R){var Q=(D(P.firstChild,R))?P.firstChild:null;return Q||B.Dom.getNextSiblingBy(P.firstChild,R);},getFirstChild:function(P,Q){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getFirstChildBy(P);},getLastChildBy:function(P,R){if(!P){return null;}var Q=(D(P.lastChild,R))?P.lastChild:null;return Q||B.Dom.getPreviousSiblingBy(P.lastChild,R);},getLastChild:function(P){P=B.Dom.get(P);return B.Dom.getLastChildBy(P);},getChildrenBy:function(Q,S){var R=B.Dom.getFirstChildBy(Q,S);var P=R?[R]:[];B.Dom.getNextSiblingBy(R,function(T){if(!S||S(T)){P[P.length]=T;}return false;});return P;},getChildren:function(P){P=B.Dom.get(P);if(!P){}return B.Dom.getChildrenBy(P);},getDocumentScrollLeft:function(P){P=P||M;return Math.max(P.documentElement.scrollLeft,P.body.scrollLeft);},getDocumentScrollTop:function(P){P=P||M;return Math.max(P.documentElement.scrollTop,P.body.scrollTop);},insertBefore:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}return P.parentNode.insertBefore(Q,P);},insertAfter:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}if(P.nextSibling){return P.parentNode.insertBefore(Q,P.nextSibling);}else{return P.parentNode.appendChild(Q);}},getClientRegion:function(){var R=B.Dom.getDocumentScrollTop(),Q=B.Dom.getDocumentScrollLeft(),S=B.Dom.getViewportWidth()+Q,P=B.Dom.getViewportHeight()+R;return new B.Region(R,S,P,Q);}};var H=function(){if(M.documentElement.getBoundingClientRect){return function(Q){var R=Q.getBoundingClientRect();var P=Q.ownerDocument;return[R.left+B.Dom.getDocumentScrollLeft(P),R.top+B.Dom.getDocumentScrollTop(P)];};}else{return function(R){var S=[R.offsetLeft,R.offsetTop];var Q=R.offsetParent;var P=(L&&B.Dom.getStyle(R,"position")=="absolute"&&R.offsetParent==R.ownerDocument.body);if(Q!=R){while(Q){S[0]+=Q.offsetLeft;S[1]+=Q.offsetTop;if(!P&&L&&B.Dom.getStyle(Q,"position")=="absolute"){P=true;}Q=Q.offsetParent;}}if(P){S[0]-=R.ownerDocument.body.offsetLeft;S[1]-=R.ownerDocument.body.offsetTop;}Q=R.parentNode;while(Q.tagName&&!E.ROOT_TAG.test(Q.tagName)){if(Q.scrollTop||Q.scrollLeft){if(!E.OP_SCROLL.test(B.Dom.getStyle(Q,"display"))){if(!C||B.Dom.getStyle(Q,"overflow")!=="visible"){S[0]-=Q.scrollLeft;S[1]-=Q.scrollTop;}}}Q=Q.parentNode;}return S;};}}();})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this[0]=B;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.5.2",build:"1076"});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(){this.lastError=null;var K=[],E=this.subscribers.length;if(!E&&this.silent){return true;}var I=[].slice.call(arguments,0),G=true,D,J=false;if(!this.silent){}var C=this.subscribers.slice(),A=YAHOO.util.Event.throwErrors;for(D=0;D<E;++D){var M=C[D];if(!M){J=true;}else{if(!this.silent){}var L=M.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var B=null;if(I.length>0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){for(var A=this.subscribers.length-1;A>-1;A--){this._delete(A);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var K=this;var L=function(){K._tryPreloadAttach();};this._interval=setInterval(L,this.POLL_INTERVAL);}},onAvailable:function(P,M,Q,O,N){var K=(YAHOO.lang.isString(P))?[P]:P;for(var L=0;L<K.length;L=L+1){F.push({id:K[L],fn:M,obj:Q,override:O,checkReady:N});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(M,K,N,L){this.onAvailable(M,K,N,L,true);},onDOMReady:function(K,M,L){if(this.DOMReady){setTimeout(function(){var N=window;if(L){if(L===true){N=M;}else{N=L;}}K.call(N,"DOMReady",[],M);},0);}else{this.DOMReadyEvent.subscribe(K,M,L);}},addListener:function(M,K,V,Q,L){if(!V||!V.call){return false;}if(this._isValidCollection(M)){var W=true;for(var R=0,T=M.length;R<T;++R){W=this.on(M[R],K,V,Q,L)&&W;}return W;}else{if(YAHOO.lang.isString(M)){var P=this.getEl(M);if(P){M=P;}else{this.onAvailable(M,function(){YAHOO.util.Event.on(M,K,V,Q,L);});return true;}}}if(!M){return false;}if("unload"==K&&Q!==this){J[J.length]=[M,K,V,Q,L];return true;}var Y=M;if(L){if(L===true){Y=Q;}else{Y=L;}}var N=function(Z){return V.call(Y,YAHOO.util.Event.getEvent(Z,M),Q);};var X=[M,K,V,N,Y,Q,L];var S=I.length;I[S]=X;if(this.useLegacyEvent(M,K)){var O=this.getLegacyIndex(M,K);if(O==-1||M!=G[O][0]){O=G.length;B[M.id+K]=O;G[O]=[M,K,M["on"+K]];E[O]=[];M["on"+K]=function(Z){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(Z),O);};}E[O].push(X);}else{try{this._simpleAdd(M,K,N,false);}catch(U){this.lastError=U;this.removeListener(M,K,V);return false;}}return true;},fireLegacyEvent:function(O,M){var Q=true,K,S,R,T,P;S=E[M].slice();for(var L=0,N=S.length;L<N;++L){R=S[L];if(R&&R[this.WFN]){T=R[this.ADJ_SCOPE];P=R[this.WFN].call(T,O);Q=(Q&&P);}}K=G[M];if(K&&K[2]){K[2](O);}return Q;},getLegacyIndex:function(L,M){var K=this.generateId(L)+M;if(typeof B[K]=="undefined"){return-1;}else{return B[K];}},useLegacyEvent:function(L,M){if(this.webkit&&("click"==M||"dblclick"==M)){var K=parseInt(this.webkit,10);if(!isNaN(K)&&K<418){return true;}}return false;},removeListener:function(L,K,T){var O,R,V;if(typeof L=="string"){L=this.getEl(L);}else{if(this._isValidCollection(L)){var U=true;for(O=L.length-1;O>-1;O--){U=(this.removeListener(L[O],K,T)&&U);}return U;}}if(!T||!T.call){return this.purgeElement(L,false,K);}if("unload"==K){for(O=J.length-1;O>-1;O--){V=J[O];if(V&&V[0]==L&&V[1]==K&&V[2]==T){J.splice(O,1);return true;}}return false;}var P=null;var Q=arguments[3];if("undefined"===typeof Q){Q=this._getCacheIndex(L,K,T);}if(Q>=0){P=I[Q];}if(!L||!P){return false;}if(this.useLegacyEvent(L,K)){var N=this.getLegacyIndex(L,K);var M=E[N];if(M){for(O=0,R=M.length;O<R;++O){V=M[O];if(V&&V[this.EL]==L&&V[this.TYPE]==K&&V[this.FN]==T){M.splice(O,1);break;}}}}else{try{this._simpleRemove(L,K,P[this.WFN],false);}catch(S){this.lastError=S;return false;}}delete I[Q][this.WFN];delete I[Q][this.FN];I.splice(Q,1);return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement;}else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in D)){K=D[K];}return K;},_getCacheIndex:function(O,P,N){for(var M=0,L=I.length;M<L;M=M+1){var K=I[M];if(K&&K[this.FN]==N&&K[this.EL]==O&&K[this.TYPE]==P){return M;}}return-1;},generateId:function(K){var L=K.id;if(!L){L="yuievtautoid-"+A;++A;K.id=L;}return L;},_isValidCollection:function(L){try{return(L&&typeof L!=="string"&&L.length&&!L.tagName&&!L.alert&&typeof L[0]!=="undefined");}catch(K){return false;}},elCache:{},getEl:function(K){return(typeof K==="string")?document.getElementById(K):K;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(L){if(!H){H=true;var K=YAHOO.util.Event;K._ready();K._tryPreloadAttach();}},_ready:function(L){var K=YAHOO.util.Event;if(!K.DOMReady){K.DOMReady=true;K.DOMReadyEvent.fire();K._simpleRemove(document,"DOMContentLoaded",K._ready);}},_tryPreloadAttach:function(){if(F.length===0){C=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 Q=!H;if(!Q){Q=(C>0&&F.length>0);}var P=[];var R=function(T,U){var S=T;if(U.override){if(U.override===true){S=U.obj;}else{S=U.override;}}U.fn.call(S,U.obj);};var L,K,O,N,M=[];for(L=0,K=F.length;L<K;L=L+1){O=F[L];if(O){N=this.getEl(O.id);if(N){if(O.checkReady){if(H||N.nextSibling||!Q){M.push(O);F[L]=null;}}else{R(N,O);F[L]=null;}}else{P.push(O);}}}for(L=0,K=M.length;L<K;L=L+1){O=M[L];R(this.getEl(O.id),O);}C--;if(Q){for(L=F.length-1;L>-1;L--){O=F[L];if(!O||!O.id){F.splice(L,1);}}this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[I,J];}else{if(K==="unload"){L=[J];}else{L=[I];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(Q){var K=YAHOO.util.Event,N,M,L,P,O,R=J.slice();for(N=0,P=J.length;N<P;++N){L=R[N];if(L){var S=window;if(L[K.ADJ_SCOPE]){if(L[K.ADJ_SCOPE]===true){S=L[K.UNLOAD_OBJ];}else{S=L[K.ADJ_SCOPE];}}L[K.FN].call(S,K.getEvent(Q,L[K.EL]),L[K.UNLOAD_OBJ]);R[N]=null;L=null;S=null;}}J=null;if(I){for(M=I.length-1;M>-1;M--){L=I[M];if(L){K.removeListener(L[K.EL],L[K.TYPE],L[K.FN],M);}}L=null;}G=null;K._simpleRemove(window,"unload",K._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;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(J,I){if(!F.shift){F.shift=false;}if(!F.alt){F.alt=false;}if(!F.ctrl){F.ctrl=false;}if(J.shiftKey==F.shift&&J.altKey==F.alt&&J.ctrlKey==F.ctrl){var G;if(F.keys instanceof Array){for(var H=0;H<F.keys.length;H++){G=F.keys[H];if(G==J.charCode){D.fire(J.charCode,J);break;}else{if(G==J.keyCode){D.fire(J.keyCode,J);break;}}}}else{G=F.keys;if(G==J.charCode){D.fire(J.charCode,J);}else{if(G==J.keyCode){D.fire(J.keyCode,J);}}}}}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.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.5.2",build:"1076"});YAHOO.register("yahoo-dom-event",YAHOO,{version:"2.5.2",build:"1076"});
(function(){var B=YAHOO.util;var A=function(D,C,E,F){if(!D){}this.init(D,C,E,F);};A.NAME="Anim";A.prototype={toString:function(){var C=this.getEl()||{};var D=C.id||C.tagName;return(this.constructor.NAME+": "+D);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(C,E,D){return this.method(this.currentFrame,E,D-E,this.totalFrames);},setAttribute:function(C,E,D){if(this.patterns.noNegatives.test(C)){E=(E>0)?E:0;}B.Dom.setStyle(this.getEl(),C,E+D);},getAttribute:function(C){var E=this.getEl();var G=B.Dom.getStyle(E,C);if(G!=="auto"&&!this.patterns.offsetUnit.test(G)){return parseFloat(G);}var D=this.patterns.offsetAttribute.exec(C)||[];var H=!!(D[3]);var F=!!(D[2]);if(F||(B.Dom.getStyle(E,"position")=="absolute"&&H)){G=E["offset"+D[0].charAt(0).toUpperCase()+D[0].substr(1)];}else{G=0;}return G;},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return"px";}return"";},setRuntimeAttribute:function(D){var I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined");};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false;}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"];}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G<C;++G){E[G]=I[G]+F[D]["by"][G]*1;}}else{E=I+F[D]["by"]*1;}}}this.runtimeAttributes[D].start=I;this.runtimeAttributes[D].end=E;this.runtimeAttributes[D].unit=(H(F[D].unit))?F[D]["unit"]:this.getDefaultUnit(D);return true;},init:function(E,J,I,C){var D=false;var F=null;var H=0;E=B.Dom.get(E);this.attributes=J||{};this.duration=!YAHOO.lang.isUndefined(I)?I:1;this.method=C||B.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=B.AnimMgr.fps;this.setEl=function(M){E=B.Dom.get(M);};this.getEl=function(){return E;};this.isAnimated=function(){return D;};this.getStartTime=function(){return F;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(B.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}B.AnimMgr.registerElement(this);return true;};this.stop=function(M){if(!this.isAnimated()){return false;}if(M){this.currentFrame=this.totalFrames;this._onTween.fire();}B.AnimMgr.stop(this);};var L=function(){this.onStart.fire();this.runtimeAttributes={};for(var M in this.attributes){this.setRuntimeAttribute(M);}D=true;H=0;F=new Date();};var K=function(){var O={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};O.toString=function(){return("duration: "+O.duration+", currentFrame: "+O.currentFrame);};this.onTween.fire(O);var N=this.runtimeAttributes;for(var M in N){this.setAttribute(M,this.doMethod(M,N[M].start,N[M].end),N[M].unit);}H+=1;};var G=function(){var M=(new Date()-F)/1000;var N={duration:M,frames:H,fps:H/M};N.toString=function(){return("duration: "+N.duration+", frames: "+N.frames+", fps: "+N.fps);};D=false;H=0;this.onComplete.fire(N);};this._onStart=new B.CustomEvent("_start",this,true);this.onStart=new B.CustomEvent("start",this);this.onTween=new B.CustomEvent("tween",this);this._onTween=new B.CustomEvent("_tween",this,true);this.onComplete=new B.CustomEvent("complete",this);this._onComplete=new B.CustomEvent("_complete",this,true);this._onStart.subscribe(L);this._onTween.subscribe(K);this._onComplete.subscribe(G);}};B.Anim=A;})();YAHOO.util.AnimMgr=new function(){var C=null;var B=[];var A=0;this.fps=1000;this.delay=1;this.registerElement=function(F){B[B.length]=F;A+=1;F._onStart.fire();this.start();};this.unRegister=function(G,F){F=F||E(G);if(!G.isAnimated()||F==-1){return false;}G._onComplete.fire();B.splice(F,1);A-=1;if(A<=0){this.stop();}return true;};this.start=function(){if(C===null){C=setInterval(this.run,this.delay);}};this.stop=function(H){if(!H){clearInterval(C);for(var G=0,F=B.length;G<F;++G){this.unRegister(B[0],0);}B=[];C=null;A=0;}else{this.unRegister(H);}};this.run=function(){for(var H=0,F=B.length;H<F;++H){var G=B[H];if(!G||!G.isAnimated()){continue;}if(G.currentFrame<G.totalFrames||G.totalFrames===null){G.currentFrame+=1;if(G.useSeconds){D(G);}G._onTween.fire();}else{YAHOO.util.AnimMgr.stop(G,H);}}};var E=function(H){for(var G=0,F=B.length;G<F;++G){if(B[G]==H){return G;}}return-1;};var D=function(G){var J=G.totalFrames;var I=G.currentFrame;var H=(G.currentFrame*G.duration*1000/G.totalFrames);var F=(new Date()-G.getStartTime());var K=0;if(F<G.duration*1000){K=Math.round((F/H-1)*G.currentFrame);}else{K=J-(I+1);}if(K>0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B<F;++B){C[B]=[E[B][0],E[B][1]];}for(var A=1;A<F;++A){for(B=0;B<F-A;++B){C[B][0]=(1-D)*C[B][0]+D*C[parseInt(B+1,10)][0];C[B][1]=(1-D)*C[B][1]+D*C[parseInt(B+1,10)][1];}}return[C[0][0],C[0][1]];};};(function(){var A=function(F,E,G,H){A.superclass.constructor.call(this,F,E,G,H);};A.NAME="ColorAnim";var C=YAHOO.util;YAHOO.extend(A,C.Anim);var D=A.superclass;var B=A.prototype;B.patterns.color=/color$/i;B.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;B.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;B.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;B.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;B.parseColor=function(E){if(E.length==3){return E;}var F=this.patterns.hex.exec(E);if(F&&F.length==4){return[parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16)];}F=this.patterns.rgb.exec(E);if(F&&F.length==4){return[parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10)];}F=this.patterns.hex3.exec(E);if(F&&F.length==4){return[parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16)];}return null;};B.getAttribute=function(E){var G=this.getEl();if(this.patterns.color.test(E)){var H=YAHOO.util.Dom.getStyle(G,E);if(this.patterns.transparent.test(H)){var F=G.parentNode;H=C.Dom.getStyle(F,E);while(F&&this.patterns.transparent.test(H)){F=F.parentNode;H=C.Dom.getStyle(F,E);if(F.tagName.toUpperCase()=="HTML"){H="#fff";}}}}else{H=D.getAttribute.call(this,E);}return H;};B.doMethod=function(F,J,G){var I;if(this.patterns.color.test(F)){I=[];for(var H=0,E=J.length;H<E;++H){I[H]=D.doMethod.call(this,F,J[H],G[H]);}I="rgb("+Math.floor(I[0])+","+Math.floor(I[1])+","+Math.floor(I[2])+")";}else{I=D.doMethod.call(this,F,J,G);}return I;};B.setRuntimeAttribute=function(F){D.setRuntimeAttribute.call(this,F);if(this.patterns.color.test(F)){var H=this.attributes;var J=this.parseColor(this.runtimeAttributes[F].start);var G=this.parseColor(this.runtimeAttributes[F].end);if(typeof H[F]["to"]==="undefined"&&typeof H[F]["by"]!=="undefined"){G=this.parseColor(H[F].by);for(var I=0,E=J.length;I<E;++I){G[I]=J[I]+G[I];}}this.runtimeAttributes[F].start=J;this.runtimeAttributes[F].end=G;}};C.ColorAnim=A;})();YAHOO.util.Easing={easeNone:function(B,A,D,C){return D*B/C+A;},easeIn:function(B,A,D,C){return D*(B/=C)*B+A;},easeOut:function(B,A,D,C){return-D*(B/=C)*(B-2)+A;},easeBoth:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A;}return-D/2*((--B)*(B-2)-1)+A;},easeInStrong:function(B,A,D,C){return D*(B/=C)*B*B*B+A;},easeOutStrong:function(B,A,D,C){return-D*((B=B/C-1)*B*B*B-1)+A;},easeBothStrong:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B*B+A;}return-D/2*((B-=2)*B*B*B-2)+A;},elasticIn:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return-(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;},elasticOut:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return B*Math.pow(2,-10*C)*Math.sin((C*F-D)*(2*Math.PI)/E)+G+A;},elasticBoth:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F/2)==2){return A+G;}if(!E){E=F*(0.3*1.5);}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}if(C<1){return-0.5*(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;}return B*Math.pow(2,-10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E)*0.5+G+A;},backIn:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*(B/=D)*B*((C+1)*B-C)+A;},backOut:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*((B=B/D-1)*B*((C+1)*B+C)+1)+A;},backBoth:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}if((B/=D/2)<1){return E/2*(B*B*(((C*=(1.525))+1)*B-C))+A;}return E/2*((B-=2)*B*(((C*=(1.525))+1)*B+C)+2)+A;},bounceIn:function(B,A,D,C){return D-YAHOO.util.Easing.bounceOut(C-B,0,D,C)+A;},bounceOut:function(B,A,D,C){if((B/=C)<(1/2.75)){return D*(7.5625*B*B)+A;}else{if(B<(2/2.75)){return D*(7.5625*(B-=(1.5/2.75))*B+0.75)+A;}else{if(B<(2.5/2.75)){return D*(7.5625*(B-=(2.25/2.75))*B+0.9375)+A;}}}return D*(7.5625*(B-=(2.625/2.75))*B+0.984375)+A;},bounceBoth:function(B,A,D,C){if(B<C/2){return YAHOO.util.Easing.bounceIn(B*2,0,D,C)*0.5+A;}return YAHOO.util.Easing.bounceOut(B*2-C,0,D,C)*0.5+D*0.5+A;}};(function(){var A=function(H,G,I,J){if(H){A.superclass.constructor.call(this,H,G,I,J);}};A.NAME="Motion";var E=YAHOO.util;YAHOO.extend(A,E.ColorAnim);var F=A.superclass;var C=A.prototype;C.patterns.points=/^points$/i;C.setAttribute=function(G,I,H){if(this.patterns.points.test(G)){H=H||"px";F.setAttribute.call(this,"left",I[0],H);F.setAttribute.call(this,"top",I[1],H);}else{F.setAttribute.call(this,G,I,H);}};C.getAttribute=function(G){if(this.patterns.points.test(G)){var H=[F.getAttribute.call(this,"left"),F.getAttribute.call(this,"top")];}else{H=F.getAttribute.call(this,G);}return H;};C.doMethod=function(G,K,H){var J=null;if(this.patterns.points.test(G)){var I=this.method(this.currentFrame,0,100,this.totalFrames)/100;J=E.Bezier.getPosition(this.runtimeAttributes[G],I);}else{J=F.doMethod.call(this,G,K,H);}return J;};C.setRuntimeAttribute=function(P){if(this.patterns.points.test(P)){var H=this.getEl();var J=this.attributes;var G;var L=J["points"]["control"]||[];var I;var M,O;if(L.length>0&&!(L[0]instanceof Array)){L=[L];}else{var K=[];for(M=0,O=L.length;M<O;++M){K[M]=L[M];}L=K;}if(E.Dom.getStyle(H,"position")=="static"){E.Dom.setStyle(H,"position","relative");}if(D(J["points"]["from"])){E.Dom.setXY(H,J["points"]["from"]);}else{E.Dom.setXY(H,E.Dom.getXY(H));}G=this.getAttribute("points");if(D(J["points"]["to"])){I=B.call(this,J["points"]["to"],G);var N=E.Dom.getXY(this.getEl());for(M=0,O=L.length;M<O;++M){L[M]=B.call(this,L[M],G);}}else{if(D(J["points"]["by"])){I=[G[0]+J["points"]["by"][0],G[1]+J["points"]["by"][1]];for(M=0,O=L.length;M<O;++M){L[M]=[G[0]+L[M][0],G[1]+L[M][1]];}}}this.runtimeAttributes[P]=[G];if(L.length>0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L);}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I;}else{F.setRuntimeAttribute.call(this,P);}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G;};var D=function(G){return(typeof G!=="undefined");};E.Motion=A;})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H);}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)];}else{G=C.doMethod.call(this,E,H,F);}return G;};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop];}else{G=C.getAttribute.call(this,E);}return G;};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1];}else{C.setAttribute.call(this,E,H,G);}};B.Scroll=D;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.5.2",build:"1076"});
YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function(){if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,"click",function(B){var A=YAHOO.util.Event.getTarget(B);if(A.nodeName.toLowerCase()=="input"&&(A.type&&A.type.toLowerCase()=="submit")){YAHOO.util.Connect._submitElementValue=encodeURIComponent(A.name)+"="+encodeURIComponent(A.value);}});return true;}return false;})(),startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),uploadEvent:new YAHOO.util.CustomEvent("upload"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(A){this._msxml_progid.unshift(A);YAHOO.log("ActiveX Program Id  "+A+" added to _msxml_progid.","info","Connection");},setDefaultPostHeader:function(A){if(typeof A=="string"){this._default_post_header=A;YAHOO.log("Default POST header set to  "+A,"info","Connection");}else{if(typeof A=="boolean"){this._use_default_post_header=A;}}},setDefaultXhrHeader:function(A){if(typeof A=="string"){this._default_xhr_header=A;YAHOO.log("Default XHR header set to  "+A,"info","Connection");}else{this._use_default_xhr_header=A;}},setPollingInterval:function(A){if(typeof A=="number"&&isFinite(A)){this._polling_interval=A;YAHOO.log("Default polling interval set to "+A+"ms","info","Connection");}},createXhrObject:function(E){var D,A;try{A=new XMLHttpRequest();D={conn:A,tId:E};YAHOO.log("XHR object created for transaction "+E,"info","Connection");}catch(C){for(var B=0;B<this._msxml_progid.length;++B){try{A=new ActiveXObject(this._msxml_progid[B]);D={conn:A,tId:E};YAHOO.log("ActiveX XHR object created for transaction "+E,"info","Connection");break;}catch(C){}}}finally{return D;}},getConnectionObject:function(A){var C;var D=this._transaction_id;try{if(!A){C=this.createXhrObject(D);}else{C={};C.tId=D;C.isUpload=true;}if(C){this._transaction_id++;}}catch(B){}finally{return C;}},asyncRequest:function(F,C,E,A){var D=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();var B=(E&&E.argument)?E.argument:null;if(!D){YAHOO.log("Unable to create connection object.","error","Connection");return null;}else{if(E&&E.customevents){this.initCustomEvents(D,E);}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(D,E,C,A);return D;}if(F.toUpperCase()=="GET"){if(this._sFormData.length!==0){C+=((C.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(F.toUpperCase()=="POST"){A=A?this._sFormData+"&"+A:this._sFormData;}}}if(F.toUpperCase()=="GET"&&(E&&E.cache===false)){C+=((C.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString();}D.conn.open(F,C,true);if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);YAHOO.log("Initialize transaction header X-Request-Header to XMLHttpRequest.","info","Connection");}}if((F.toUpperCase()=="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);YAHOO.log("Initialize header Content-Type to application/x-www-form-urlencoded; UTF-8 for POST transaction.","info","Connection");}if(this._has_default_headers||this._has_http_headers){this.setHeader(D);}this.handleReadyState(D,E);D.conn.send(A||"");YAHOO.log("Transaction "+D.tId+" sent.","info","Connection");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(D,B);if(D.startEvent){D.startEvent.fire(D,B);}return D;}},initCustomEvents:function(A,C){for(var B in C.customevents){if(this._customEvents[B][0]){A[this._customEvents[B][0]]=new YAHOO.util.CustomEvent(this._customEvents[B][1],(C.scope)?C.scope:null);YAHOO.log("Transaction-specific Custom Event "+A[this._customEvents[B][1]]+" created.","info","Connection");A[this._customEvents[B][0]].subscribe(C.customevents[B]);YAHOO.log("Transaction-specific Custom Event "+A[this._customEvents[B][1]]+" subscribed.","info","Connection");}}},handleReadyState:function(C,D){var B=this;var A=(D&&D.argument)?D.argument:null;if(D&&D.timeout){this._timeOut[C.tId]=window.setTimeout(function(){B.abort(C,D,true);},D.timeout);}this._poll[C.tId]=window.setInterval(function(){if(C.conn&&C.conn.readyState===4){window.clearInterval(B._poll[C.tId]);delete B._poll[C.tId];if(D&&D.timeout){window.clearTimeout(B._timeOut[C.tId]);delete B._timeOut[C.tId];}B.completeEvent.fire(C,A);if(C.completeEvent){C.completeEvent.fire(C,A);}B.handleTransactionResponse(C,D);}},this._polling_interval);},handleTransactionResponse:function(F,G,A){var D,C;var B=(G&&G.argument)?G.argument:null;try{if(F.conn.status!==undefined&&F.conn.status!==0){D=F.conn.status;}else{D=13030;}}catch(E){D=13030;}if(D>=200&&D<300||D===1223){C=this.createResponseObject(F,B);if(G&&G.success){if(!G.scope){G.success(C);YAHOO.log("Success callback. HTTP code is "+D,"info","Connection");}else{G.success.apply(G.scope,[C]);YAHOO.log("Success callback with scope. HTTP code is "+D,"info","Connection");}}this.successEvent.fire(C);if(F.successEvent){F.successEvent.fire(C);}}else{switch(D){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:C=this.createExceptionObject(F.tId,B,(A?A:false));if(G&&G.failure){if(!G.scope){G.failure(C);YAHOO.log("Failure callback. Exception detected. Status code is "+D,"warn","Connection");}else{G.failure.apply(G.scope,[C]);YAHOO.log("Failure callback with scope. Exception detected. Status code is "+D,"warn","Connection");}}break;default:C=this.createResponseObject(F,B);if(G&&G.failure){if(!G.scope){G.failure(C);YAHOO.log("Failure callback. HTTP status code is "+D,"warn","Connection");}else{G.failure.apply(G.scope,[C]);YAHOO.log("Failure callback with scope. HTTP status code is "+D,"warn","Connection");}}}this.failureEvent.fire(C);if(F.failureEvent){F.failureEvent.fire(C);}}this.releaseObject(F);C=null;},createResponseObject:function(A,G){var D={};var I={};try{var C=A.conn.getAllResponseHeaders();var F=C.split("\n");for(var E=0;E<F.length;E++){var B=F[E].indexOf(":");if(B!=-1){I[F[E].substring(0,B)]=F[E].substring(B+2);}}}catch(H){}D.tId=A.tId;D.status=(A.conn.status==1223)?204:A.conn.status;D.statusText=(A.conn.status==1223)?"No Content":A.conn.statusText;D.getResponseHeader=I;D.getAllResponseHeaders=C;D.responseText=A.conn.responseText;D.responseXML=A.conn.responseXML;if(G){D.argument=G;}return D;},createExceptionObject:function(H,D,A){var F=0;var G="communication failure";var C=-1;var B="transaction aborted";var E={};E.tId=H;if(A){E.status=C;E.statusText=B;}else{E.status=F;E.statusText=G;}if(D){E.argument=D;}return E;},initHeader:function(A,D,C){var B=(C)?this._default_headers:this._http_headers;B[A]=D;if(C){this._has_default_headers=true;}else{this._has_http_headers=true;}},setHeader:function(A){if(this._has_default_headers){for(var B in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,B)){A.conn.setRequestHeader(B,this._default_headers[B]);YAHOO.log("Default HTTP header "+B+" set with value of "+this._default_headers[B],"info","Connection");}}}if(this._has_http_headers){for(var B in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,B)){A.conn.setRequestHeader(B,this._http_headers[B]);YAHOO.log("HTTP header "+B+" set with value of "+this._http_headers[B],"info","Connection");}}delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(K,E,B){this.resetFormState();var J;if(typeof K=="string"){J=(document.getElementById(K)||document.forms[K]);}else{if(typeof K=="object"){J=K;}else{YAHOO.log("Unable to create form object "+K,"warn","Connection");return;}}if(E){var F=this.createFrame((window.location.href.toLowerCase().indexOf("https")===0||B)?true:false);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=J;return;}var A,I,G,L;var H=false;for(var D=0;D<J.elements.length;D++){A=J.elements[D];L=A.disabled;I=A.name;G=A.value;if(!L&&I){switch(A.type){case"select-one":case"select-multiple":for(var C=0;C<A.options.length;C++){if(A.options[C].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].attributes["value"].specified?A.options[C].value:A.options[C].text)+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].hasAttribute("value")?A.options[C].value:A.options[C].text)+"&";}}}break;case"radio":case"checkbox":if(A.checked){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(H===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}H=true;}break;default:this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}}}this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);YAHOO.log("Form initialized for transaction. HTML form POST message is: "+this._sFormData,"info","Connection");this.initHeader("Content-Type",this._default_form_header);YAHOO.log("Initialize header Content-Type to application/x-www-form-urlencoded for setForm() transaction.","info","Connection");return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(A){var B="yuiIO"+this._transaction_id;var C;if(window.ActiveXObject){C=document.createElement('<iframe id="'+B+'" name="'+B+'" />');if(typeof A=="boolean"){C.src="javascript:false";}}else{C=document.createElement("iframe");C.id=B;C.name=B;}C.style.position="absolute";C.style.top="-1000px";C.style.left="-1000px";document.body.appendChild(C);YAHOO.log("File upload iframe created. Id is:"+B,"info","Connection");},appendPostData:function(A){var D=[];var B=A.split("&");for(var C=0;C<B.length;C++){var E=B[C].indexOf("=");if(E!=-1){D[C]=document.createElement("input");D[C].type="hidden";D[C].name=B[C].substring(0,E);D[C].value=B[C].substring(E+1);this._formNode.appendChild(D[C]);}}return D;},uploadFile:function(D,M,E,C){var N=this;var H="yuiIO"+D.tId;var I="multipart/form-data";var K=document.getElementById(H);var J=(M&&M.argument)?M.argument:null;var B={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",E);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",H);if(YAHOO.env.ua.ie){this._formNode.setAttribute("encoding",I);}else{this._formNode.setAttribute("enctype",I);}if(C){var L=this.appendPostData(C);}this._formNode.submit();this.startEvent.fire(D,J);if(D.startEvent){D.startEvent.fire(D,J);}if(M&&M.timeout){this._timeOut[D.tId]=window.setTimeout(function(){N.abort(D,M,true);},M.timeout);}if(L&&L.length>0){for(var G=0;G<L.length;G++){this._formNode.removeChild(L[G]);}}for(var A in B){if(YAHOO.lang.hasOwnProperty(B,A)){if(B[A]){this._formNode.setAttribute(A,B[A]);}else{this._formNode.removeAttribute(A);}}}this.resetFormState();var F=function(){if(M&&M.timeout){window.clearTimeout(N._timeOut[D.tId]);delete N._timeOut[D.tId];}N.completeEvent.fire(D,J);if(D.completeEvent){D.completeEvent.fire(D,J);}var P={};P.tId=D.tId;P.argument=M.argument;try{P.responseText=K.contentWindow.document.body?K.contentWindow.document.body.innerHTML:K.contentWindow.document.documentElement.textContent;P.responseXML=K.contentWindow.document.XMLDocument?K.contentWindow.document.XMLDocument:K.contentWindow.document;}catch(O){}if(M&&M.upload){if(!M.scope){M.upload(P);YAHOO.log("Upload callback.","info","Connection");}else{M.upload.apply(M.scope,[P]);YAHOO.log("Upload callback with scope.","info","Connection");}}N.uploadEvent.fire(P);if(D.uploadEvent){D.uploadEvent.fire(P);}YAHOO.util.Event.removeListener(K,"load",F);setTimeout(function(){document.body.removeChild(K);N.releaseObject(D);YAHOO.log("File upload iframe destroyed. Id is:"+H,"info","Connection");},100);};YAHOO.util.Event.addListener(K,"load",F);},abort:function(E,G,A){var D;var B=(G&&G.argument)?G.argument:null;if(E&&E.conn){if(this.isCallInProgress(E)){E.conn.abort();window.clearInterval(this._poll[E.tId]);delete this._poll[E.tId];if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{if(E&&E.isUpload===true){var C="yuiIO"+E.tId;var F=document.getElementById(C);if(F){YAHOO.util.Event.removeListener(F,"load");document.body.removeChild(F);YAHOO.log("File upload iframe destroyed. Id is:"+C,"info","Connection");if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{D=false;}}if(D===true){this.abortEvent.fire(E,B);if(E.abortEvent){E.abortEvent.fire(E,B);}this.handleTransactionResponse(E,G,true);YAHOO.log("Transaction "+E.tId+" aborted.","info","Connection");}return D;},isCallInProgress:function(B){if(B&&B.conn){return B.conn.readyState!==4&&B.conn.readyState!==0;}else{if(B&&B.isUpload===true){var A="yuiIO"+B.tId;return document.getElementById(A)?true:false;}else{return false;}}},releaseObject:function(A){if(A&&A.conn){A.conn=null;YAHOO.log("Connection object for transaction "+A.tId+" destroyed.","info","Connection");A=null;}}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.5.2",build:"1076"});
(function(){YAHOO.util.Config=function(D){if(D){this.init(D);}};var B=YAHOO.lang,C=YAHOO.util.CustomEvent,A=YAHOO.util.Config;A.CONFIG_CHANGED_EVENT="configChanged";A.BOOLEAN_TYPE="boolean";A.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(D){this.owner=D;this.configChangedEvent=this.createEvent(A.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=C.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(D){return(typeof D==A.BOOLEAN_TYPE);},checkNumber:function(D){return(!isNaN(D));},fireEvent:function(D,F){var E=this.config[D];if(E&&E.event){E.event.fire(F);}},addProperty:function(E,D){E=E.toLowerCase();this.config[E]=D;D.event=this.createEvent(E,{scope:this.owner});D.event.signature=C.LIST;D.key=E;if(D.handler){D.event.subscribe(D.handler,this.owner);}this.setProperty(E,D.value,true);if(!D.suppressEvent){this.queueProperty(E,D.value);}},getConfig:function(){var D={},F,E;for(F in this.config){E=this.config[F];if(E&&E.event){D[F]=E.value;}}return D;},getProperty:function(D){var E=this.config[D.toLowerCase()];if(E&&E.event){return E.value;}else{return undefined;}},resetProperty:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event){if(this.initialConfig[D]&&!B.isUndefined(this.initialConfig[D])){this.setProperty(D,this.initialConfig[D]);return true;}}else{return false;}},setProperty:function(E,G,D){var F;E=E.toLowerCase();if(this.queueInProgress&&!D){this.queueProperty(E,G);return true;}else{F=this.config[E];if(F&&F.event){if(F.validator&&!F.validator(G)){return false;}else{F.value=G;if(!D){this.fireEvent(E,G);this.configChangedEvent.fire([E,G]);}return true;}}else{return false;}}},queueProperty:function(S,P){S=S.toLowerCase();var R=this.config[S],K=false,J,G,H,I,O,Q,F,M,N,D,L,T,E;if(R&&R.event){if(!B.isUndefined(P)&&R.validator&&!R.validator(P)){return false;}else{if(!B.isUndefined(P)){R.value=P;}else{P=R.value;}K=false;J=this.eventQueue.length;for(L=0;L<J;L++){G=this.eventQueue[L];if(G){H=G[0];I=G[1];if(H==S){this.eventQueue[L]=null;this.eventQueue.push([S,(!B.isUndefined(P)?P:I)]);K=true;break;}}}if(!K&&!B.isUndefined(P)){this.eventQueue.push([S,P]);}}if(R.supercedes){O=R.supercedes.length;for(T=0;T<O;T++){Q=R.supercedes[T];F=this.eventQueue.length;for(E=0;E<F;E++){M=this.eventQueue[E];if(M){N=M[0];D=M[1];if(N==Q.toLowerCase()){this.eventQueue.push([N,D]);this.eventQueue[E]=null;break;}}}}}return true;}else{return false;}},refireEvent:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event&&!B.isUndefined(E.value)){if(this.queueInProgress){this.queueProperty(D);}else{this.fireEvent(D,E.value);}}},applyConfig:function(D,G){var F,E;if(G){E={};for(F in D){if(B.hasOwnProperty(D,F)){E[F.toLowerCase()]=D[F];}}this.initialConfig=E;}for(F in D){if(B.hasOwnProperty(D,F)){this.queueProperty(F,D[F]);}}},refresh:function(){var D;for(D in this.config){this.refireEvent(D);}},fireQueue:function(){var E,H,D,G,F;this.queueInProgress=true;for(E=0;E<this.eventQueue.length;E++){H=this.eventQueue[E];if(H){D=H[0];G=H[1];F=this.config[D];F.value=G;this.fireEvent(D,G);}}this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(E,F,H,D){var G=this.config[E.toLowerCase()];if(G&&G.event){if(!A.alreadySubscribed(G.event,F,H)){G.event.subscribe(F,H,D);}return true;}else{return false;}},unsubscribeFromConfigEvent:function(D,E,G){var F=this.config[D.toLowerCase()];if(F&&F.event){return F.event.unsubscribe(E,G);}else{return false;}},toString:function(){var D="Config";if(this.owner){D+=" ["+this.owner.toString()+"]";}return D;},outputEventQueue:function(){var D="",G,E,F=this.eventQueue.length;for(E=0;E<F;E++){G=this.eventQueue[E];if(G){D+=G[0]+"="+G[1]+", ";}}return D;},destroy:function(){var E=this.config,D,F;for(D in E){if(B.hasOwnProperty(E,D)){F=E[D];F.event.unsubscribeAll();F.event=null;}}this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};A.alreadySubscribed=function(E,H,I){var F=E.subscribers.length,D,G;if(F>0){G=F-1;do{D=E.subscribers[G];if(D&&D.obj==I&&D.fn==H){return true;}}while(G--);}return false;};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(Q,P){if(Q){this.init(Q,P);}else{}};var F=YAHOO.util.Dom,D=YAHOO.util.Config,M=YAHOO.util.Event,L=YAHOO.util.CustomEvent,G=YAHOO.widget.Module,H,O,N,E,A={"BEFORE_INIT":"beforeInit","INIT":"init","APPEND":"append","BEFORE_RENDER":"beforeRender","RENDER":"render","CHANGE_HEADER":"changeHeader","CHANGE_BODY":"changeBody","CHANGE_FOOTER":"changeFooter","CHANGE_CONTENT":"changeContent","DESTORY":"destroy","BEFORE_SHOW":"beforeShow","SHOW":"show","BEFORE_HIDE":"beforeHide","HIDE":"hide"},I={"VISIBLE":{key:"visible",value:true,validator:YAHOO.lang.isBoolean},"EFFECT":{key:"effect",suppressEvent:true,supercedes:["visible"]},"MONITOR_RESIZE":{key:"monitorresize",value:true},"APPEND_TO_DOCUMENT_BODY":{key:"appendtodocumentbody",value:false}};G.IMG_ROOT=null;G.IMG_ROOT_SSL=null;G.CSS_MODULE="yui-module";G.CSS_HEADER="hd";G.CSS_BODY="bd";G.CSS_FOOTER="ft";G.RESIZE_MONITOR_SECURE_URL="javascript:false;";G.textResizeEvent=new L("textResize");function K(){if(!H){H=document.createElement("div");H.innerHTML=('<div class="'+G.CSS_HEADER+'"></div>'+'<div class="'+G.CSS_BODY+'"></div><div class="'+G.CSS_FOOTER+'"></div>');O=H.firstChild;N=O.nextSibling;E=N.nextSibling;}return H;}function J(){if(!O){K();}return(O.cloneNode(false));}function B(){if(!N){K();}return(N.cloneNode(false));}function C(){if(!E){K();}return(E.cloneNode(false));}G.prototype={constructor:G,element:null,header:null,body:null,footer:null,id:null,imageRoot:G.IMG_ROOT,initEvents:function(){var P=L.LIST;this.beforeInitEvent=this.createEvent(A.BEFORE_INIT);this.beforeInitEvent.signature=P;this.initEvent=this.createEvent(A.INIT);this.initEvent.signature=P;this.appendEvent=this.createEvent(A.APPEND);this.appendEvent.signature=P;this.beforeRenderEvent=this.createEvent(A.BEFORE_RENDER);this.beforeRenderEvent.signature=P;this.renderEvent=this.createEvent(A.RENDER);this.renderEvent.signature=P;this.changeHeaderEvent=this.createEvent(A.CHANGE_HEADER);this.changeHeaderEvent.signature=P;this.changeBodyEvent=this.createEvent(A.CHANGE_BODY);this.changeBodyEvent.signature=P;this.changeFooterEvent=this.createEvent(A.CHANGE_FOOTER);this.changeFooterEvent.signature=P;this.changeContentEvent=this.createEvent(A.CHANGE_CONTENT);this.changeContentEvent.signature=P;this.destroyEvent=this.createEvent(A.DESTORY);this.destroyEvent.signature=P;this.beforeShowEvent=this.createEvent(A.BEFORE_SHOW);this.beforeShowEvent.signature=P;this.showEvent=this.createEvent(A.SHOW);this.showEvent.signature=P;this.beforeHideEvent=this.createEvent(A.BEFORE_HIDE);this.beforeHideEvent.signature=P;this.hideEvent=this.createEvent(A.HIDE);this.hideEvent.signature=P;},platform:function(){var P=navigator.userAgent.toLowerCase();if(P.indexOf("windows")!=-1||P.indexOf("win32")!=-1){return"windows";}else{if(P.indexOf("macintosh")!=-1){return"mac";}else{return false;}}}(),browser:function(){var P=navigator.userAgent.toLowerCase();if(P.indexOf("opera")!=-1){return"opera";}else{if(P.indexOf("msie 7")!=-1){return"ie7";}else{if(P.indexOf("msie")!=-1){return"ie";}else{if(P.indexOf("safari")!=-1){return"safari";}else{if(P.indexOf("gecko")!=-1){return"gecko";}else{return false;}}}}}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty(I.VISIBLE.key,{handler:this.configVisible,value:I.VISIBLE.value,validator:I.VISIBLE.validator});this.cfg.addProperty(I.EFFECT.key,{suppressEvent:I.EFFECT.suppressEvent,supercedes:I.EFFECT.supercedes});this.cfg.addProperty(I.MONITOR_RESIZE.key,{handler:this.configMonitorResize,value:I.MONITOR_RESIZE.value});this.cfg.addProperty(I.APPEND_TO_DOCUMENT_BODY.key,{value:I.APPEND_TO_DOCUMENT_BODY.value});},init:function(U,T){var R,V;this.initEvents();this.beforeInitEvent.fire(G);this.cfg=new D(this);if(this.isSecure){this.imageRoot=G.IMG_ROOT_SSL;}if(typeof U=="string"){R=U;U=document.getElementById(U);if(!U){U=(K()).cloneNode(false);U.id=R;}}this.element=U;if(U.id){this.id=U.id;}V=this.element.firstChild;if(V){var Q=false,P=false,S=false;do{if(1==V.nodeType){if(!Q&&F.hasClass(V,G.CSS_HEADER)){this.header=V;Q=true;}else{if(!P&&F.hasClass(V,G.CSS_BODY)){this.body=V;P=true;}else{if(!S&&F.hasClass(V,G.CSS_FOOTER)){this.footer=V;S=true;}}}}}while((V=V.nextSibling));}this.initDefaultConfig();F.addClass(this.element,G.CSS_MODULE);if(T){this.cfg.applyConfig(T,true);}if(!D.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}this.initEvent.fire(G);},initResizeMonitor:function(){var Q=(YAHOO.env.ua.gecko&&this.platform=="windows");if(Q){var P=this;setTimeout(function(){P._initResizeMonitor();},0);}else{this._initResizeMonitor();}},_initResizeMonitor:function(){var P,R,T;function V(){G.textResizeEvent.fire();}if(!YAHOO.env.ua.opera){R=F.get("_yuiResizeMonitor");var U=this._supportsCWResize();if(!R){R=document.createElement("iframe");if(this.isSecure&&G.RESIZE_MONITOR_SECURE_URL&&YAHOO.env.ua.ie){R.src=G.RESIZE_MONITOR_SECURE_URL;}if(!U){T=["<html><head><script ",'type="text/javascript">',"window.onresize=function(){window.parent.","YAHOO.widget.Module.textResizeEvent.","fire();};<","/script></head>","<body></body></html>"].join("");R.src="data:text/html;charset=utf-8,"+encodeURIComponent(T);}R.id="_yuiResizeMonitor";R.style.position="absolute";R.style.visibility="hidden";var Q=document.body,S=Q.firstChild;if(S){Q.insertBefore(R,S);}else{Q.appendChild(R);}R.style.width="10em";R.style.height="10em";R.style.top=(-1*R.offsetHeight)+"px";R.style.left=(-1*R.offsetWidth)+"px";R.style.borderWidth="0";R.style.visibility="visible";if(YAHOO.env.ua.webkit){P=R.contentWindow.document;P.open();P.close();}}if(R&&R.contentWindow){G.textResizeEvent.subscribe(this.onDomResize,this,true);if(!G.textResizeInitialized){if(U){if(!M.on(R.contentWindow,"resize",V)){M.on(R,"resize",V);}}G.textResizeInitialized=true;}this.resizeMonitor=R;}}},_supportsCWResize:function(){var P=true;if(YAHOO.env.ua.gecko&&YAHOO.env.ua.gecko<=1.8){P=false;}return P;},onDomResize:function(S,R){var Q=-1*this.resizeMonitor.offsetWidth,P=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=P+"px";this.resizeMonitor.style.left=Q+"px";},setHeader:function(Q){var P=this.header||(this.header=J());if(Q.nodeName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}this.changeHeaderEvent.fire(Q);this.changeContentEvent.fire();},appendToHeader:function(Q){var P=this.header||(this.header=J());P.appendChild(Q);this.changeHeaderEvent.fire(Q);this.changeContentEvent.fire();},setBody:function(Q){var P=this.body||(this.body=B());if(Q.nodeName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}this.changeBodyEvent.fire(Q);this.changeContentEvent.fire();},appendToBody:function(Q){var P=this.body||(this.body=B());P.appendChild(Q);this.changeBodyEvent.fire(Q);this.changeContentEvent.fire();},setFooter:function(Q){var P=this.footer||(this.footer=C());if(Q.nodeName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}this.changeFooterEvent.fire(Q);this.changeContentEvent.fire();},appendToFooter:function(Q){var P=this.footer||(this.footer=C());P.appendChild(Q);this.changeFooterEvent.fire(Q);this.changeContentEvent.fire();},render:function(R,P){var S=this,T;function Q(U){if(typeof U=="string"){U=document.getElementById(U);}if(U){S._addToParent(U,S.element);S.appendEvent.fire();}}this.beforeRenderEvent.fire();if(!P){P=this.element;}if(R){Q(R);}else{if(!F.inDocument(this.element)){return false;}}if(this.header&&!F.inDocument(this.header)){T=P.firstChild;if(T){P.insertBefore(this.header,T);}else{P.appendChild(this.header);}}if(this.body&&!F.inDocument(this.body)){if(this.footer&&F.isAncestor(this.moduleElement,this.footer)){P.insertBefore(this.body,this.footer);}else{P.appendChild(this.body);}}if(this.footer&&!F.inDocument(this.footer)){P.appendChild(this.footer);}this.renderEvent.fire();return true;},destroy:function(){var P,Q;if(this.element){M.purgeElement(this.element,true);P=this.element.parentNode;}if(P){P.removeChild(this.element);}this.element=null;this.header=null;this.body=null;this.footer=null;G.textResizeEvent.unsubscribe(this.onDomResize,this);this.cfg.destroy();this.cfg=null;this.destroyEvent.fire();for(Q in this){if(Q instanceof L){Q.unsubscribeAll();}}},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(Q,P,R){var S=P[0];if(S){this.beforeShowEvent.fire();F.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();F.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(R,Q,S){var P=Q[0];if(P){this.initResizeMonitor();}else{G.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}},_addToParent:function(P,Q){if(!this.cfg.getProperty("appendtodocumentbody")&&P===document.body&&P.firstChild){P.insertBefore(Q,P.firstChild);}else{P.appendChild(Q);}},toString:function(){return"Module "+this.id;}};YAHOO.lang.augmentProto(G,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Overlay=function(L,K){YAHOO.widget.Overlay.superclass.constructor.call(this,L,K);};var F=YAHOO.lang,I=YAHOO.util.CustomEvent,E=YAHOO.widget.Module,J=YAHOO.util.Event,D=YAHOO.util.Dom,C=YAHOO.util.Config,B=YAHOO.widget.Overlay,G,A={"BEFORE_MOVE":"beforeMove","MOVE":"move"},H={"X":{key:"x",validator:F.isNumber,suppressEvent:true,supercedes:["iframe"]},"Y":{key:"y",validator:F.isNumber,suppressEvent:true,supercedes:["iframe"]},"XY":{key:"xy",suppressEvent:true,supercedes:["iframe"]},"CONTEXT":{key:"context",suppressEvent:true,supercedes:["iframe"]},"FIXED_CENTER":{key:"fixedcenter",value:false,validator:F.isBoolean,supercedes:["iframe","visible"]},"WIDTH":{key:"width",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"HEIGHT":{key:"height",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"ZINDEX":{key:"zindex",value:null},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:false,validator:F.isBoolean,supercedes:["iframe","x","y","xy"]},"IFRAME":{key:"iframe",value:(YAHOO.env.ua.ie==6?true:false),validator:F.isBoolean,supercedes:["zindex"]}};B.IFRAME_SRC="javascript:false;";B.IFRAME_OFFSET=3;B.VIEWPORT_OFFSET=10;B.TOP_LEFT="tl";B.TOP_RIGHT="tr";B.BOTTOM_LEFT="bl";B.BOTTOM_RIGHT="br";B.CSS_OVERLAY="yui-overlay";B.windowScrollEvent=new I("windowScroll");B.windowResizeEvent=new I("windowResize");B.windowScrollHandler=function(K){if(YAHOO.env.ua.ie){if(!window.scrollEnd){window.scrollEnd=-1;}clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){B.windowScrollEvent.fire();},1);}else{B.windowScrollEvent.fire();}};B.windowResizeHandler=function(K){if(YAHOO.env.ua.ie){if(!window.resizeEnd){window.resizeEnd=-1;}clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){B.windowResizeEvent.fire();},100);}else{B.windowResizeEvent.fire();}};B._initialized=null;if(B._initialized===null){J.on(window,"scroll",B.windowScrollHandler);J.on(window,"resize",B.windowResizeHandler);B._initialized=true;}YAHOO.extend(B,E,{init:function(L,K){B.superclass.init.call(this,L);this.beforeInitEvent.fire(B);D.addClass(this.element,B.CSS_OVERLAY);if(K){this.cfg.applyConfig(K,true);}if(this.platform=="mac"&&YAHOO.env.ua.gecko){if(!C.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}if(!C.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}this.initEvent.fire(B);},initEvents:function(){B.superclass.initEvents.call(this);var K=I.LIST;this.beforeMoveEvent=this.createEvent(A.BEFORE_MOVE);this.beforeMoveEvent.signature=K;this.moveEvent=this.createEvent(A.MOVE);this.moveEvent.signature=K;},initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);this.cfg.addProperty(H.X.key,{handler:this.configX,validator:H.X.validator,suppressEvent:H.X.suppressEvent,supercedes:H.X.supercedes});this.cfg.addProperty(H.Y.key,{handler:this.configY,validator:H.Y.validator,suppressEvent:H.Y.suppressEvent,supercedes:H.Y.supercedes});this.cfg.addProperty(H.XY.key,{handler:this.configXY,suppressEvent:H.XY.suppressEvent,supercedes:H.XY.supercedes});this.cfg.addProperty(H.CONTEXT.key,{handler:this.configContext,suppressEvent:H.CONTEXT.suppressEvent,supercedes:H.CONTEXT.supercedes});this.cfg.addProperty(H.FIXED_CENTER.key,{handler:this.configFixedCenter,value:H.FIXED_CENTER.value,validator:H.FIXED_CENTER.validator,supercedes:H.FIXED_CENTER.supercedes});this.cfg.addProperty(H.WIDTH.key,{handler:this.configWidth,suppressEvent:H.WIDTH.suppressEvent,supercedes:H.WIDTH.supercedes});this.cfg.addProperty(H.HEIGHT.key,{handler:this.configHeight,suppressEvent:H.HEIGHT.suppressEvent,supercedes:H.HEIGHT.supercedes});this.cfg.addProperty(H.ZINDEX.key,{handler:this.configzIndex,value:H.ZINDEX.value});this.cfg.addProperty(H.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:H.CONSTRAIN_TO_VIEWPORT.value,validator:H.CONSTRAIN_TO_VIEWPORT.validator,supercedes:H.CONSTRAIN_TO_VIEWPORT.supercedes});this.cfg.addProperty(H.IFRAME.key,{handler:this.configIframe,value:H.IFRAME.value,validator:H.IFRAME.validator,supercedes:H.IFRAME.supercedes});},moveTo:function(K,L){this.cfg.setProperty("xy",[K,L]);},hideMacGeckoScrollbars:function(){D.removeClass(this.element,"show-scrollbars");D.addClass(this.element,"hide-scrollbars");},showMacGeckoScrollbars:function(){D.removeClass(this.element,"hide-scrollbars");D.addClass(this.element,"show-scrollbars");},configVisible:function(N,K,T){var M=K[0],O=D.getStyle(this.element,"visibility"),U=this.cfg.getProperty("effect"),R=[],Q=(this.platform=="mac"&&YAHOO.env.ua.gecko),b=C.alreadySubscribed,S,L,a,Y,X,W,Z,V,P;if(O=="inherit"){a=this.element.parentNode;while(a.nodeType!=9&&a.nodeType!=11){O=D.getStyle(a,"visibility");if(O!="inherit"){break;}a=a.parentNode;}if(O=="inherit"){O="visible";}}if(U){if(U instanceof Array){V=U.length;for(Y=0;Y<V;Y++){S=U[Y];R[R.length]=S.effect(this,S.duration);}}else{R[R.length]=U.effect(this,U.duration);}}if(M){if(Q){this.showMacGeckoScrollbars();}if(U){if(M){if(O!="visible"||O===""){this.beforeShowEvent.fire();P=R.length;for(X=0;X<P;X++){L=R[X];if(X===0&&!b(L.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){L.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}L.animateIn();}}}}else{if(O!="visible"||O===""){this.beforeShowEvent.fire();D.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(Q){this.hideMacGeckoScrollbars();}if(U){if(O=="visible"){this.beforeHideEvent.fire();P=R.length;for(W=0;W<P;W++){Z=R[W];if(W===0&&!b(Z.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){Z.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}Z.animateOut();}}else{if(O===""){D.setStyle(this.element,"visibility","hidden");}}}else{if(O=="visible"||O===""){this.beforeHideEvent.fire();D.setStyle(this.element,"visibility","hidden");this.hideEvent.fire();}}}},doCenterOnDOMEvent:function(){if(this.cfg.getProperty("visible")){this.center();}},configFixedCenter:function(O,M,P){var Q=M[0],L=C.alreadySubscribed,N=B.windowResizeEvent,K=B.windowScrollEvent;if(Q){this.center();if(!L(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center);}if(!L(N,this.doCenterOnDOMEvent,this)){N.subscribe(this.doCenterOnDOMEvent,this,true);}if(!L(K,this.doCenterOnDOMEvent,this)){K.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);N.unsubscribe(this.doCenterOnDOMEvent,this);K.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(N,L,O){var K=L[0],M=this.element;D.setStyle(M,"height",K);this.cfg.refireEvent("iframe");},configWidth:function(N,K,O){var M=K[0],L=this.element;D.setStyle(L,"width",M);this.cfg.refireEvent("iframe");},configzIndex:function(M,K,N){var O=K[0],L=this.element;if(!O){O=D.getStyle(L,"zIndex");if(!O||isNaN(O)){O=0;}}if(this.iframe||this.cfg.getProperty("iframe")===true){if(O<=0){O=1;}}D.setStyle(L,"zIndex",O);this.cfg.setProperty("zIndex",O,true);if(this.iframe){this.stackIframe();}},configXY:function(M,L,N){var P=L[0],K=P[0],O=P[1];this.cfg.setProperty("x",K);this.cfg.setProperty("y",O);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},configX:function(M,L,N){var K=L[0],O=this.cfg.getProperty("y");this.cfg.setProperty("x",K,true);this.cfg.setProperty("y",O,true);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");D.setX(this.element,K,true);this.cfg.setProperty("xy",[K,O],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},configY:function(M,L,N){var K=this.cfg.getProperty("x"),O=L[0];this.cfg.setProperty("x",K,true);this.cfg.setProperty("y",O,true);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");D.setY(this.element,O,true);this.cfg.setProperty("xy",[K,O],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},showIframe:function(){var L=this.iframe,K;if(L){K=this.element.parentNode;if(K!=L.parentNode){this._addToParent(K,L);}L.style.display="block";}},hideIframe:function(){if(this.iframe){this.iframe.style.display="none";}},syncIframe:function(){var K=this.iframe,M=this.element,O=B.IFRAME_OFFSET,L=(O*2),N;if(K){K.style.width=(M.offsetWidth+L+"px");K.style.height=(M.offsetHeight+L+"px");N=this.cfg.getProperty("xy");if(!F.isArray(N)||(isNaN(N[0])||isNaN(N[1]))){this.syncPosition();N=this.cfg.getProperty("xy");}D.setXY(K,[(N[0]-O),(N[1]-O)]);}},stackIframe:function(){if(this.iframe){var K=D.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(K)&&!isNaN(K)){D.setStyle(this.iframe,"zIndex",(K-1));}}},configIframe:function(N,M,O){var K=M[0];function P(){var R=this.iframe,S=this.element,T;if(!R){if(!G){G=document.createElement("iframe");if(this.isSecure){G.src=B.IFRAME_SRC;}if(YAHOO.env.ua.ie){G.style.filter="alpha(opacity=0)";G.frameBorder=0;}else{G.style.opacity="0";}G.style.position="absolute";G.style.border="none";G.style.margin="0";G.style.padding="0";G.style.display="none";}R=G.cloneNode(false);T=S.parentNode;var Q=T||document.body;this._addToParent(Q,R);this.iframe=R;}this.showIframe();this.syncIframe();this.stackIframe();if(!this._hasIframeEventListeners){this.showEvent.subscribe(this.showIframe);this.hideEvent.subscribe(this.hideIframe);this.changeContentEvent.subscribe(this.syncIframe);this._hasIframeEventListeners=true;}}function L(){P.call(this);this.beforeShowEvent.unsubscribe(L);this._iframeDeferred=false;}if(K){if(this.cfg.getProperty("visible")){P.call(this);}else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(L);this._iframeDeferred=true;}}}else{this.hideIframe();if(this._hasIframeEventListeners){this.showEvent.unsubscribe(this.showIframe);this.hideEvent.unsubscribe(this.hideIframe);this.changeContentEvent.unsubscribe(this.syncIframe);this._hasIframeEventListeners=false;}}},_primeXYFromDOM:function(){if(YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))){this.syncPosition();this.cfg.refireEvent("xy");this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);}},configConstrainToViewport:function(L,K,M){var N=K[0];if(N){if(!C.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}if(!C.alreadySubscribed(this.beforeShowEvent,this._primeXYFromDOM)){this.beforeShowEvent.subscribe(this._primeXYFromDOM);}}else{this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(M,L,O){var Q=L[0],N,P,K;if(Q){N=Q[0];P=Q[1];K=Q[2];if(N){if(typeof N=="string"){this.cfg.setProperty("context",[document.getElementById(N),P,K],true);}if(P&&K){this.align(P,K);}}}},align:function(L,K){var Q=this.cfg.getProperty("context"),P=this,O,N,R;function M(S,T){switch(L){case B.TOP_LEFT:P.moveTo(T,S);break;case B.TOP_RIGHT:P.moveTo((T-N.offsetWidth),S);break;case B.BOTTOM_LEFT:P.moveTo(T,(S-N.offsetHeight));break;case B.BOTTOM_RIGHT:P.moveTo((T-N.offsetWidth),(S-N.offsetHeight));break;}}if(Q){O=Q[0];N=this.element;P=this;if(!L){L=Q[1];}if(!K){K=Q[2];}if(N&&O){R=D.getRegion(O);switch(K){case B.TOP_LEFT:M(R.top,R.left);break;case B.TOP_RIGHT:M(R.top,R.right);break;case B.BOTTOM_LEFT:M(R.bottom,R.left);break;case B.BOTTOM_RIGHT:M(R.bottom,R.right);break;}}}},enforceConstraints:function(L,K,M){var O=K[0];var N=this.getConstrainedXY(O[0],O[1]);this.cfg.setProperty("x",N[0],true);this.cfg.setProperty("y",N[1],true);this.cfg.setProperty("xy",N,true);},getConstrainedXY:function(V,T){var N=B.VIEWPORT_OFFSET,U=D.getViewportWidth(),Q=D.getViewportHeight(),M=this.element.offsetHeight,S=this.element.offsetWidth,Y=D.getDocumentScrollLeft(),W=D.getDocumentScrollTop();var P=V;var L=T;if(S+N<U){var R=Y+N;var X=Y+U-S-N;if(V<R){P=R;}else{if(V>X){P=X;}}}else{P=N+Y;}if(M+N<Q){var O=W+N;var K=W+Q-M-N;if(T<O){L=O;}else{if(T>K){L=K;}}}else{L=N+W;}return[P,L];},center:function(){var N=B.VIEWPORT_OFFSET,O=this.element.offsetWidth,M=this.element.offsetHeight,L=D.getViewportWidth(),P=D.getViewportHeight(),K,Q;if(O<L){K=(L/2)-(O/2)+D.getDocumentScrollLeft();}else{K=N+D.getDocumentScrollLeft();}if(M<P){Q=(P/2)-(M/2)+D.getDocumentScrollTop();}else{Q=N+D.getDocumentScrollTop();}this.cfg.setProperty("xy",[parseInt(K,10),parseInt(Q,10)]);this.cfg.refireEvent("iframe");},syncPosition:function(){var K=D.getXY(this.element);this.cfg.setProperty("x",K[0],true);this.cfg.setProperty("y",K[1],true);this.cfg.setProperty("xy",K,true);},onDomResize:function(M,L){var K=this;B.superclass.onDomResize.call(this,M,L);setTimeout(function(){K.syncPosition();K.cfg.refireEvent("iframe");K.cfg.refireEvent("context");},0);},bringToTop:function(){var O=[],N=this.element;function R(V,U){var X=D.getStyle(V,"zIndex"),W=D.getStyle(U,"zIndex"),T=(!X||isNaN(X))?0:parseInt(X,10),S=(!W||isNaN(W))?0:parseInt(W,10);if(T>S){return-1;}else{if(T<S){return 1;}else{return 0;}}}function M(U){var S=D.hasClass(U,B.CSS_OVERLAY),T=YAHOO.widget.Panel;if(S&&!D.isAncestor(N,S)){if(T&&D.hasClass(U,T.CSS_PANEL)){O[O.length]=U.parentNode;}else{O[O.length]=U;}}}D.getElementsBy(M,"DIV",document.body);O.sort(R);var K=O[0],Q;if(K){Q=D.getStyle(K,"zIndex");if(!isNaN(Q)){var P=false;if(K!=N){P=true;}else{if(O.length>1){var L=D.getStyle(O[1],"zIndex");if(!isNaN(L)&&(Q==L)){P=true;}}}if(P){this.cfg.setProperty("zindex",(parseInt(Q,10)+2));}}}},destroy:function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}this.iframe=null;B.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);B.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);B.superclass.destroy.call(this);},toString:function(){return"Overlay "+this.id;}});}());(function(){YAHOO.widget.OverlayManager=function(G){this.init(G);};var D=YAHOO.widget.Overlay,C=YAHOO.util.Event,E=YAHOO.util.Dom,B=YAHOO.util.Config,F=YAHOO.util.CustomEvent,A=YAHOO.widget.OverlayManager;A.CSS_FOCUSED="focused";A.prototype={constructor:A,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(I){this.cfg=new B(this);this.initDefaultConfig();if(I){this.cfg.applyConfig(I,true);}this.cfg.fireQueue();var H=null;this.getActive=function(){return H;};this.focus=function(J){var K=this.find(J);if(K){if(H!=K){if(H){H.blur();}this.bringToTop(K);H=K;E.addClass(H.element,A.CSS_FOCUSED);K.focusEvent.fire();}}};this.remove=function(K){var M=this.find(K),J;if(M){if(H==M){H=null;}var L=(M.element===null&&M.cfg===null)?true:false;if(!L){J=E.getStyle(M.element,"zIndex");M.cfg.setProperty("zIndex",-1000,true);}this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,(this.overlays.length-1));M.hideEvent.unsubscribe(M.blur);M.destroyEvent.unsubscribe(this._onOverlayDestroy,M);if(!L){C.removeListener(M.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);M.cfg.setProperty("zIndex",J,true);M.cfg.setProperty("manager",null);}M.focusEvent.unsubscribeAll();M.blurEvent.unsubscribeAll();M.focusEvent=null;M.blurEvent=null;M.focus=null;M.blur=null;}};this.blurAll=function(){var K=this.overlays.length,J;if(K>0){J=K-1;do{this.overlays[J].blur();}while(J--);}};this._onOverlayBlur=function(K,J){H=null;};var G=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}if(G){this.register(G);this.overlays.sort(this.compareZIndexDesc);}},_onOverlayElementFocus:function(I){var G=C.getTarget(I),H=this.close;if(H&&(G==H||E.isAncestor(H,G))){this.blur();}else{this.focus();}},_onOverlayDestroy:function(H,G,I){this.remove(I);},register:function(G){var K=this,L,I,H,J;if(G instanceof D){G.cfg.addProperty("manager",{value:this});G.focusEvent=G.createEvent("focus");G.focusEvent.signature=F.LIST;G.blurEvent=G.createEvent("blur");G.blurEvent.signature=F.LIST;G.focus=function(){K.focus(this);};G.blur=function(){if(K.getActive()==this){E.removeClass(this.element,A.CSS_FOCUSED);this.blurEvent.fire();}};G.blurEvent.subscribe(K._onOverlayBlur);G.hideEvent.subscribe(G.blur);G.destroyEvent.subscribe(this._onOverlayDestroy,G,this);C.on(G.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus,null,G);L=E.getStyle(G.element,"zIndex");if(!isNaN(L)){G.cfg.setProperty("zIndex",parseInt(L,10));}else{G.cfg.setProperty("zIndex",0);}this.overlays.push(G);this.bringToTop(G);return true;}else{if(G instanceof Array){I=0;J=G.length;for(H=0;H<J;H++){if(this.register(G[H])){I++;}}if(I>0){return true;}}else{return false;}}},bringToTop:function(M){var I=this.find(M),L,G,J;if(I){J=this.overlays;J.sort(this.compareZIndexDesc);G=J[0];if(G){L=E.getStyle(G.element,"zIndex");if(!isNaN(L)){var K=false;if(G!==I){K=true;}else{if(J.length>1){var H=E.getStyle(J[1].element,"zIndex");if(!isNaN(H)&&(L==H)){K=true;}}}if(K){I.cfg.setProperty("zindex",(parseInt(L,10)+2));}}J.sort(this.compareZIndexDesc);}}},find:function(G){var I=this.overlays,J=I.length,H;if(J>0){H=J-1;if(G instanceof D){do{if(I[H]==G){return I[H];}}while(H--);}else{if(typeof G=="string"){do{if(I[H].id==G){return I[H];}}while(H--);}}return null;}},compareZIndexDesc:function(J,I){var H=(J.cfg)?J.cfg.getProperty("zIndex"):null,G=(I.cfg)?I.cfg.getProperty("zIndex"):null;if(H===null&&G===null){return 0;}else{if(H===null){return 1;}else{if(G===null){return-1;}else{if(H>G){return-1;}else{if(H<G){return 1;}else{return 0;}}}}}},showAll:function(){var H=this.overlays,I=H.length,G;if(I>0){G=I-1;do{H[G].show();}while(G--);}},hideAll:function(){var H=this.overlays,I=H.length,G;if(I>0){G=I-1;do{H[G].hide();}while(G--);}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.Tooltip=function(N,M){YAHOO.widget.Tooltip.superclass.constructor.call(this,N,M);};var E=YAHOO.lang,L=YAHOO.util.Event,K=YAHOO.util.CustomEvent,C=YAHOO.util.Dom,G=YAHOO.widget.Tooltip,F,H={"PREVENT_OVERLAP":{key:"preventoverlap",value:true,validator:E.isBoolean,supercedes:["x","y","xy"]},"SHOW_DELAY":{key:"showdelay",value:200,validator:E.isNumber},"AUTO_DISMISS_DELAY":{key:"autodismissdelay",value:5000,validator:E.isNumber},"HIDE_DELAY":{key:"hidedelay",value:250,validator:E.isNumber},"TEXT":{key:"text",suppressEvent:true},"CONTAINER":{key:"container"},"DISABLED":{key:"disabled",value:false,suppressEvent:true}},A={"CONTEXT_MOUSE_OVER":"contextMouseOver","CONTEXT_MOUSE_OUT":"contextMouseOut","CONTEXT_TRIGGER":"contextTrigger"};G.CSS_TOOLTIP="yui-tt";function I(N,M,O){var R=O[0],P=O[1],Q=this.cfg,S=Q.getProperty("width");if(S==P){Q.setProperty("width",R);}this.unsubscribe("hide",this._onHide,O);}function D(N,M){var O=document.body,S=this.cfg,R=S.getProperty("width"),P,Q;if((!R||R=="auto")&&(S.getProperty("container")!=O||S.getProperty("x")>=C.getViewportWidth()||S.getProperty("y")>=C.getViewportHeight())){Q=this.element.cloneNode(true);Q.style.visibility="hidden";Q.style.top="0px";Q.style.left="0px";O.appendChild(Q);P=(Q.offsetWidth+"px");O.removeChild(Q);Q=null;S.setProperty("width",P);S.refireEvent("xy");this.subscribe("hide",I,[(R||""),P]);}}function B(N,M,O){this.render(O);}function J(){L.onDOMReady(B,this.cfg.getProperty("container"),this);}YAHOO.extend(G,YAHOO.widget.Overlay,{init:function(N,M){G.superclass.init.call(this,N);this.beforeInitEvent.fire(G);C.addClass(this.element,G.CSS_TOOLTIP);if(M){this.cfg.applyConfig(M,true);}this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.subscribe("beforeShow",D);this.subscribe("init",J);this.subscribe("render",this.onRender);this.initEvent.fire(G);},initEvents:function(){G.superclass.initEvents.call(this);var M=K.LIST;this.contextMouseOverEvent=this.createEvent(A.CONTEXT_MOUSE_OVER);this.contextMouseOverEvent.signature=M;this.contextMouseOutEvent=this.createEvent(A.CONTEXT_MOUSE_OUT);this.contextMouseOutEvent.signature=M;this.contextTriggerEvent=this.createEvent(A.CONTEXT_TRIGGER);this.contextTriggerEvent.signature=M;},initDefaultConfig:function(){G.superclass.initDefaultConfig.call(this);this.cfg.addProperty(H.PREVENT_OVERLAP.key,{value:H.PREVENT_OVERLAP.value,validator:H.PREVENT_OVERLAP.validator,supercedes:H.PREVENT_OVERLAP.supercedes});this.cfg.addProperty(H.SHOW_DELAY.key,{handler:this.configShowDelay,value:200,validator:H.SHOW_DELAY.validator});this.cfg.addProperty(H.AUTO_DISMISS_DELAY.key,{handler:this.configAutoDismissDelay,value:H.AUTO_DISMISS_DELAY.value,validator:H.AUTO_DISMISS_DELAY.validator});this.cfg.addProperty(H.HIDE_DELAY.key,{handler:this.configHideDelay,value:H.HIDE_DELAY.value,validator:H.HIDE_DELAY.validator});this.cfg.addProperty(H.TEXT.key,{handler:this.configText,suppressEvent:H.TEXT.suppressEvent});this.cfg.addProperty(H.CONTAINER.key,{handler:this.configContainer,value:document.body});this.cfg.addProperty(H.DISABLED.key,{handler:this.configContainer,value:H.DISABLED.value,supressEvent:H.DISABLED.suppressEvent});},configText:function(N,M,O){var P=M[0];if(P){this.setBody(P);}},configContainer:function(O,N,P){var M=N[0];if(typeof M=="string"){this.cfg.setProperty("container",document.getElementById(M),true);}},_removeEventListeners:function(){var P=this._context,M,O,N;if(P){M=P.length;if(M>0){N=M-1;do{O=P[N];L.removeListener(O,"mouseover",this.onContextMouseOver);L.removeListener(O,"mousemove",this.onContextMouseMove);L.removeListener(O,"mouseout",this.onContextMouseOut);}while(N--);}}},configContext:function(R,N,S){var Q=N[0],T,M,P,O;if(Q){if(!(Q instanceof Array)){if(typeof Q=="string"){this.cfg.setProperty("context",[document.getElementById(Q)],true);}else{this.cfg.setProperty("context",[Q],true);}Q=this.cfg.getProperty("context");}this._removeEventListeners();this._context=Q;T=this._context;if(T){M=T.length;if(M>0){O=M-1;do{P=T[O];L.on(P,"mouseover",this.onContextMouseOver,this);L.on(P,"mousemove",this.onContextMouseMove,this);L.on(P,"mouseout",this.onContextMouseOut,this);}while(O--);}}}},onContextMouseMove:function(N,M){M.pageX=L.getPageX(N);M.pageY=L.getPageY(N);},onContextMouseOver:function(O,N){var M=this;if(M.title){N._tempTitle=M.title;M.title="";}if(N.fireEvent("contextMouseOver",M,O)!==false&&!N.cfg.getProperty("disabled")){if(N.hideProcId){clearTimeout(N.hideProcId);N.hideProcId=null;}L.on(M,"mousemove",N.onContextMouseMove,N);N.showProcId=N.doShow(O,M);}},onContextMouseOut:function(O,N){var M=this;if(N._tempTitle){M.title=N._tempTitle;N._tempTitle=null;}if(N.showProcId){clearTimeout(N.showProcId);N.showProcId=null;}if(N.hideProcId){clearTimeout(N.hideProcId);N.hideProcId=null;}N.fireEvent("contextMouseOut",M,O);N.hideProcId=setTimeout(function(){N.hide();},N.cfg.getProperty("hidedelay"));},doShow:function(O,M){var P=25,N=this;if(YAHOO.env.ua.opera&&M.tagName&&M.tagName.toUpperCase()=="A"){P+=12;}return setTimeout(function(){var Q=N.cfg.getProperty("text");if(N._tempTitle&&(Q===""||YAHOO.lang.isUndefined(Q)||YAHOO.lang.isNull(Q))){N.setBody(N._tempTitle);}else{N.cfg.refireEvent("text");}N.moveTo(N.pageX,N.pageY+P);if(N.cfg.getProperty("preventoverlap")){N.preventOverlap(N.pageX,N.pageY);}L.removeListener(M,"mousemove",N.onContextMouseMove);N.contextTriggerEvent.fire(M);N.show();N.hideProcId=N.doHide();},this.cfg.getProperty("showdelay"));},doHide:function(){var M=this;return setTimeout(function(){M.hide();},this.cfg.getProperty("autodismissdelay"));},preventOverlap:function(Q,P){var M=this.element.offsetHeight,O=new YAHOO.util.Point(Q,P),N=C.getRegion(this.element);N.top-=5;N.left-=5;N.right+=5;N.bottom+=5;if(N.contains(O)){this.cfg.setProperty("y",(P-M-5));}},onRender:function(Q,P){function R(){var U=this.element,T=this._shadow;if(T){T.style.width=(U.offsetWidth+6)+"px";T.style.height=(U.offsetHeight+1)+"px";}}function N(){C.addClass(this._shadow,"yui-tt-shadow-visible");}function M(){C.removeClass(this._shadow,"yui-tt-shadow-visible");}function S(){var V=this._shadow,U,T,X,W;if(!V){U=this.element;T=YAHOO.widget.Module;X=YAHOO.env.ua.ie;W=this;if(!F){F=document.createElement("div");F.className="yui-tt-shadow";}V=F.cloneNode(false);U.appendChild(V);this._shadow=V;N.call(this);this.subscribe("beforeShow",N);this.subscribe("beforeHide",M);if(X==6||(X==7&&document.compatMode=="BackCompat")){window.setTimeout(function(){R.call(W);},0);this.cfg.subscribeToConfigEvent("width",R);this.cfg.subscribeToConfigEvent("height",R);this.subscribe("changeContent",R);T.textResizeEvent.subscribe(R,this,true);this.subscribe("destroy",function(){T.textResizeEvent.unsubscribe(R,this);});}}}function O(){S.call(this);this.unsubscribe("beforeShow",O);}if(this.cfg.getProperty("visible")){S.call(this);}else{this.subscribe("beforeShow",O);}},destroy:function(){this._removeEventListeners();G.superclass.destroy.call(this);},toString:function(){return"Tooltip "+this.id;}});}());(function(){YAHOO.widget.Panel=function(R,Q){YAHOO.widget.Panel.superclass.constructor.call(this,R,Q);};var I=YAHOO.lang,E=YAHOO.util.DD,F=YAHOO.util.Dom,P=YAHOO.util.Event,B=YAHOO.widget.Overlay,O=YAHOO.util.CustomEvent,C=YAHOO.util.Config,N=YAHOO.widget.Panel,H,L,D,A={"SHOW_MASK":"showMask","HIDE_MASK":"hideMask","DRAG":"drag"},J={"CLOSE":{key:"close",value:true,validator:I.isBoolean,supercedes:["visible"]},"DRAGGABLE":{key:"draggable",value:(E?true:false),validator:I.isBoolean,supercedes:["visible"]},"DRAG_ONLY":{key:"dragonly",value:false,validator:I.isBoolean,supercedes:["draggable"]},"UNDERLAY":{key:"underlay",value:"shadow",supercedes:["visible"]},"MODAL":{key:"modal",value:false,validator:I.isBoolean,supercedes:["visible","zindex"]},"KEY_LISTENERS":{key:"keylisteners",suppressEvent:true,supercedes:["visible"]}};N.CSS_PANEL="yui-panel";N.CSS_PANEL_CONTAINER="yui-panel-container";N.FOCUSABLE=["a","button","select","textarea","input"];function M(R,Q){if(!this.header&&this.cfg.getProperty("draggable")){this.setHeader("&#160;");}}function K(R,Q,S){var V=S[0],T=S[1],U=this.cfg,W=U.getProperty("width");if(W==T){U.setProperty("width",V);}this.unsubscribe("hide",K,S);}function G(R,Q){var V=YAHOO.env.ua.ie,U,T,S;if(V==6||(V==7&&document.compatMode=="BackCompat")){U=this.cfg;T=U.getProperty("width");if(!T||T=="auto"){S=(this.element.offsetWidth+"px");U.setProperty("width",S);this.subscribe("hide",K,[(T||""),S]);}}}YAHOO.extend(N,B,{init:function(R,Q){N.superclass.init.call(this,R);this.beforeInitEvent.fire(N);F.addClass(this.element,N.CSS_PANEL);this.buildWrapper();if(Q){this.cfg.applyConfig(Q,true);}this.subscribe("showMask",this._addFocusHandlers);this.subscribe("hideMask",this._removeFocusHandlers);this.subscribe("beforeRender",M);this.initEvent.fire(N);},_onElementFocus:function(Q){this.blur();},_addFocusHandlers:function(Y,S){var V=this,Z="focus",U="hidden";function X(a){if(a.type!==U&&!F.isAncestor(V.element,a)){P.on(a,Z,V._onElementFocus);return true;}return false;}var W=N.FOCUSABLE,Q=W.length,T=[];for(var R=0;R<Q;R++){T=T.concat(F.getElementsBy(X,W[R]));}this.focusableElements=T;},_removeFocusHandlers:function(T,S){var V=this.focusableElements,Q=V.length,R="focus";if(V){for(var U=0;U<Q;U++){P.removeListener(V[U],R,this._onElementFocus);}}},initEvents:function(){N.superclass.initEvents.call(this);var Q=O.LIST;this.showMaskEvent=this.createEvent(A.SHOW_MASK);this.showMaskEvent.signature=Q;this.hideMaskEvent=this.createEvent(A.HIDE_MASK);this.hideMaskEvent.signature=Q;this.dragEvent=this.createEvent(A.DRAG);this.dragEvent.signature=Q;},initDefaultConfig:function(){N.superclass.initDefaultConfig.call(this);this.cfg.addProperty(J.CLOSE.key,{handler:this.configClose,value:J.CLOSE.value,validator:J.CLOSE.validator,supercedes:J.CLOSE.supercedes});this.cfg.addProperty(J.DRAGGABLE.key,{handler:this.configDraggable,value:J.DRAGGABLE.value,validator:J.DRAGGABLE.validator,supercedes:J.DRAGGABLE.supercedes});this.cfg.addProperty(J.DRAG_ONLY.key,{value:J.DRAG_ONLY.value,validator:J.DRAG_ONLY.validator,supercedes:J.DRAG_ONLY.supercedes});this.cfg.addProperty(J.UNDERLAY.key,{handler:this.configUnderlay,value:J.UNDERLAY.value,supercedes:J.UNDERLAY.supercedes});this.cfg.addProperty(J.MODAL.key,{handler:this.configModal,value:J.MODAL.value,validator:J.MODAL.validator,supercedes:J.MODAL.supercedes});this.cfg.addProperty(J.KEY_LISTENERS.key,{handler:this.configKeyListeners,suppressEvent:J.KEY_LISTENERS.suppressEvent,supercedes:J.KEY_LISTENERS.supercedes});},configClose:function(S,Q,U){var V=Q[0],R=this.close;function T(X,W){W.hide();}if(V){if(!R){if(!D){D=document.createElement("span");D.innerHTML="&#160;";D.className="container-close";}R=D.cloneNode(true);this.innerElement.appendChild(R);P.on(R,"click",T,this);this.close=R;}else{R.style.display="block";}}else{if(R){R.style.display="none";}}},configDraggable:function(R,Q,S){var T=Q[0];if(T){if(!E){this.cfg.setProperty("draggable",false);return;}if(this.header){F.setStyle(this.header,"cursor","move");this.registerDragDrop();}this.subscribe("beforeShow",G);}else{if(this.dd){this.dd.unreg();}if(this.header){F.setStyle(this.header,"cursor","auto");}this.unsubscribe("beforeShow",G);}},configUnderlay:function(b,a,V){var Z=YAHOO.env.ua,X=(this.platform=="mac"&&Z.gecko),Y=(Z.ie==6||(Z.ie==7&&document.compatMode=="BackCompat")),c=a[0].toLowerCase(),R=this.underlay,S=this.element;function d(){var e=this.underlay;F.addClass(e,"yui-force-redraw");window.setTimeout(function(){F.removeClass(e,"yui-force-redraw");},0);}function T(){var e=false;if(!R){if(!L){L=document.createElement("div");L.className="underlay";}R=L.cloneNode(false);this.element.appendChild(R);this.underlay=R;if(Y){this.sizeUnderlay();this.cfg.subscribeToConfigEvent("width",this.sizeUnderlay);this.cfg.subscribeToConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.subscribe(this.sizeUnderlay);YAHOO.widget.Module.textResizeEvent.subscribe(this.sizeUnderlay,this,true);}if(Z.webkit&&Z.webkit<420){this.changeContentEvent.subscribe(d);}e=true;}}function W(){var e=T.call(this);if(!e&&Y){this.sizeUnderlay();}this._underlayDeferred=false;this.beforeShowEvent.unsubscribe(W);}function U(){if(this._underlayDeferred){this.beforeShowEvent.unsubscribe(W);this._underlayDeferred=false;}if(R){this.cfg.unsubscribeFromConfigEvent("width",this.sizeUnderlay);this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.sizeUnderlay);this.changeContentEvent.unsubscribe(d);YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay,this,true);this.element.removeChild(R);this.underlay=null;}}switch(c){case"shadow":F.removeClass(S,"matte");F.addClass(S,"shadow");break;case"matte":if(!X){U.call(this);}F.removeClass(S,"shadow");F.addClass(S,"matte");break;default:if(!X){U.call(this);}F.removeClass(S,"shadow");F.removeClass(S,"matte");break;}if((c=="shadow")||(X&&!R)){if(this.cfg.getProperty("visible")){var Q=T.call(this);if(!Q&&Y){this.sizeUnderlay();}}else{if(!this._underlayDeferred){this.beforeShowEvent.subscribe(W);this._underlayDeferred=true;}}}},configModal:function(R,Q,T){var S=Q[0];if(S){if(!this._hasModalityEventListeners){this.subscribe("beforeShow",this.buildMask);this.subscribe("beforeShow",this.bringToTop);this.subscribe("beforeShow",this.showMask);this.subscribe("hide",this.hideMask);B.windowResizeEvent.subscribe(this.sizeMask,this,true);this._hasModalityEventListeners=true;}}else{if(this._hasModalityEventListeners){if(this.cfg.getProperty("visible")){this.hideMask();this.removeMask();}this.unsubscribe("beforeShow",this.buildMask);this.unsubscribe("beforeShow",this.bringToTop);this.unsubscribe("beforeShow",this.showMask);this.unsubscribe("hide",this.hideMask);B.windowResizeEvent.unsubscribe(this.sizeMask,this);this._hasModalityEventListeners=false;}}},removeMask:function(){var R=this.mask,Q;if(R){this.hideMask();Q=R.parentNode;if(Q){Q.removeChild(R);}this.mask=null;}},configKeyListeners:function(T,Q,W){var S=Q[0],V,U,R;if(S){if(S instanceof Array){U=S.length;for(R=0;R<U;R++){V=S[R];if(!C.alreadySubscribed(this.showEvent,V.enable,V)){this.showEvent.subscribe(V.enable,V,true);}if(!C.alreadySubscribed(this.hideEvent,V.disable,V)){this.hideEvent.subscribe(V.disable,V,true);this.destroyEvent.subscribe(V.disable,V,true);}}}else{if(!C.alreadySubscribed(this.showEvent,S.enable,S)){this.showEvent.subscribe(S.enable,S,true);}if(!C.alreadySubscribed(this.hideEvent,S.disable,S)){this.hideEvent.subscribe(S.disable,S,true);this.destroyEvent.subscribe(S.disable,S,true);}}}},configHeight:function(T,R,U){var Q=R[0],S=this.innerElement;F.setStyle(S,"height",Q);this.cfg.refireEvent("iframe");},configWidth:function(T,Q,U){var S=Q[0],R=this.innerElement;F.setStyle(R,"width",S);this.cfg.refireEvent("iframe");},configzIndex:function(R,Q,T){N.superclass.configzIndex.call(this,R,Q,T);if(this.mask||this.cfg.getProperty("modal")===true){var S=F.getStyle(this.element,"zIndex");if(!S||isNaN(S)){S=0;}if(S===0){this.cfg.setProperty("zIndex",1);}else{this.stackMask();}}},buildWrapper:function(){var S=this.element.parentNode,Q=this.element,R=document.createElement("div");R.className=N.CSS_PANEL_CONTAINER;R.id=Q.id+"_c";if(S){S.insertBefore(R,Q);}R.appendChild(Q);this.element=R;this.innerElement=Q;F.setStyle(this.innerElement,"visibility","inherit");},sizeUnderlay:function(){var R=this.underlay,Q;if(R){Q=this.element;R.style.width=Q.offsetWidth+"px";R.style.height=Q.offsetHeight+"px";}},registerDragDrop:function(){var R=this;if(this.header){if(!E){return;}var Q=(this.cfg.getProperty("dragonly")===true);this.dd=new E(this.element.id,this.id,{dragOnly:Q});if(!this.header.id){this.header.id=this.id+"_h";}this.dd.startDrag=function(){var T,V,S,Y,X,W;if(YAHOO.env.ua.ie==6){F.addClass(R.element,"drag");}if(R.cfg.getProperty("constraintoviewport")){var U=B.VIEWPORT_OFFSET;T=R.element.offsetHeight;V=R.element.offsetWidth;S=F.getViewportWidth();Y=F.getViewportHeight();X=F.getDocumentScrollLeft();W=F.getDocumentScrollTop();if(T+U<Y){this.minY=W+U;this.maxY=W+Y-T-U;}else{this.minY=W+U;this.maxY=W+U;}if(V+U<S){this.minX=X+U;this.maxX=X+S-V-U;}else{this.minX=X+U;this.maxX=X+U;}this.constrainX=true;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}R.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){R.syncPosition();R.cfg.refireEvent("iframe");if(this.platform=="mac"&&YAHOO.env.ua.gecko){this.showMacGeckoScrollbars();}R.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(YAHOO.env.ua.ie==6){F.removeClass(R.element,"drag");}R.dragEvent.fire("endDrag",arguments);R.moveEvent.fire(R.cfg.getProperty("xy"));};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}},buildMask:function(){var Q=this.mask;if(!Q){if(!H){H=document.createElement("div");H.className="mask";H.innerHTML="&#160;";}Q=H.cloneNode(true);Q.id=this.id+"_mask";document.body.insertBefore(Q,document.body.firstChild);this.mask=Q;if(YAHOO.env.ua.gecko&&this.platform=="mac"){F.addClass(this.mask,"block-scrollbars");}this.stackMask();}},hideMask:function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";this.hideMaskEvent.fire();F.removeClass(document.body,"masked");}},showMask:function(){if(this.cfg.getProperty("modal")&&this.mask){F.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}},sizeMask:function(){if(this.mask){this.mask.style.height=F.getDocumentHeight()+"px";this.mask.style.width=F.getDocumentWidth()+"px";}},stackMask:function(){if(this.mask){var Q=F.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(Q)&&!isNaN(Q)){F.setStyle(this.mask,"zIndex",Q-1);}}},render:function(Q){return N.superclass.render.call(this,Q,this.innerElement);},destroy:function(){B.windowResizeEvent.unsubscribe(this.sizeMask,this);this.removeMask();if(this.close){P.purgeElement(this.close);}N.superclass.destroy.call(this);},toString:function(){return"Panel "+this.id;}});}());(function(){YAHOO.widget.Dialog=function(L,K){YAHOO.widget.Dialog.superclass.constructor.call(this,L,K);};var J=YAHOO.util.Event,I=YAHOO.util.CustomEvent,D=YAHOO.util.Dom,B=YAHOO.util.KeyListener,H=YAHOO.util.Connect,F=YAHOO.widget.Dialog,E=YAHOO.lang,A={"BEFORE_SUBMIT":"beforeSubmit","SUBMIT":"submit","MANUAL_SUBMIT":"manualSubmit","ASYNC_SUBMIT":"asyncSubmit","FORM_SUBMIT":"formSubmit","CANCEL":"cancel"},G={"POST_METHOD":{key:"postmethod",value:"async"},"BUTTONS":{key:"buttons",value:"none"},"HIDEAFTERSUBMIT":{key:"hideaftersubmit",value:true}};F.CSS_DIALOG="yui-dialog";function C(){var N=this._aButtons,L,M,K;if(E.isArray(N)){L=N.length;if(L>0){K=L-1;do{M=N[K];if(YAHOO.widget.Button&&M instanceof YAHOO.widget.Button){M.destroy();}else{if(M.tagName.toUpperCase()=="BUTTON"){J.purgeElement(M);J.purgeElement(M,false);}}}while(K--);}}}YAHOO.extend(F,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){F.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty(G.POST_METHOD.key,{handler:this.configPostMethod,value:G.POST_METHOD.value,validator:function(K){if(K!="form"&&K!="async"&&K!="none"&&K!="manual"){return false;}else{return true;}}});this.cfg.addProperty(G.HIDEAFTERSUBMIT.key,{value:G.HIDEAFTERSUBMIT.value});this.cfg.addProperty(G.BUTTONS.key,{handler:this.configButtons,value:G.BUTTONS.value});},initEvents:function(){F.superclass.initEvents.call(this);var K=I.LIST;this.beforeSubmitEvent=this.createEvent(A.BEFORE_SUBMIT);this.beforeSubmitEvent.signature=K;this.submitEvent=this.createEvent(A.SUBMIT);this.submitEvent.signature=K;this.manualSubmitEvent=this.createEvent(A.MANUAL_SUBMIT);this.manualSubmitEvent.signature=K;this.asyncSubmitEvent=this.createEvent(A.ASYNC_SUBMIT);this.asyncSubmitEvent.signature=K;this.formSubmitEvent=this.createEvent(A.FORM_SUBMIT);this.formSubmitEvent.signature=K;this.cancelEvent=this.createEvent(A.CANCEL);this.cancelEvent.signature=K;},init:function(L,K){F.superclass.init.call(this,L);this.beforeInitEvent.fire(F);D.addClass(this.element,F.CSS_DIALOG);this.cfg.setProperty("visible",false);if(K){this.cfg.applyConfig(K,true);}this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.subscribe("changeBody",this.registerForm);this.initEvent.fire(F);},doSubmit:function(){var Q=this.form,O=false,N=false,P,K,M,L;switch(this.cfg.getProperty("postmethod")){case"async":P=Q.elements;K=P.length;if(K>0){M=K-1;do{if(P[M].type=="file"){O=true;break;}}while(M--);}if(O&&YAHOO.env.ua.ie&&this.isSecure){N=true;}L=(Q.getAttribute("method")||"POST").toUpperCase();H.setForm(Q,O,N);H.asyncRequest(L,Q.getAttribute("action"),this.callback);this.asyncSubmitEvent.fire();break;case"form":Q.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}},registerForm:function(){var M=this.element.getElementsByTagName("form")[0],L=this,K,N;if(this.form){if(this.form==M&&D.isAncestor(this.element,this.form)){return;}else{J.purgeElement(this.form);this.form=null;}}if(!M){M=document.createElement("form");M.name="frm_"+this.id;this.body.appendChild(M);}if(M){this.form=M;J.on(M,"submit",function(O){J.stopEvent(O);this.submit();this.form.blur();},this,true);this.firstFormElement=function(){var Q,P,O=M.elements.length;for(Q=0;Q<O;Q++){P=M.elements[Q];if(P.focus&&!P.disabled&&P.type!="hidden"){return P;}}return null;}();this.lastFormElement=function(){var Q,P,O=M.elements.length;for(Q=O-1;Q>=0;Q--){P=M.elements[Q];if(P.focus&&!P.disabled&&P.type!="hidden"){return P;}}return null;}();if(this.cfg.getProperty("modal")){K=this.firstFormElement||this.firstButton;if(K){this.preventBackTab=new B(K,{shift:true,keys:9},{fn:L.focusLast,scope:L,correctScope:true});this.showEvent.subscribe(this.preventBackTab.enable,this.preventBackTab,true);this.hideEvent.subscribe(this.preventBackTab.disable,this.preventBackTab,true);}N=this.lastButton||this.lastFormElement;if(N){this.preventTabOut=new B(N,{shift:false,keys:9},{fn:L.focusFirst,scope:L,correctScope:true});this.showEvent.subscribe(this.preventTabOut.enable,this.preventTabOut,true);this.hideEvent.subscribe(this.preventTabOut.disable,this.preventTabOut,true);}}}},configClose:function(M,K,N){var O=K[0];function L(Q,P){P.cancel();}if(O){if(!this.close){this.close=document.createElement("div");D.addClass(this.close,"container-close");this.close.innerHTML="&#160;";this.innerElement.appendChild(this.close);J.on(this.close,"click",L,this);}else{this.close.style.display="block";}}else{if(this.close){this.close.style.display="none";}}},configButtons:function(U,T,O){var P=YAHOO.widget.Button,W=T[0],M=this.innerElement,V,R,L,S,Q,K,N;C.call(this);this._aButtons=null;if(E.isArray(W)){Q=document.createElement("span");Q.className="button-group";S=W.length;this._aButtons=[];for(N=0;N<S;N++){V=W[N];if(P){L=new P({label:V.text,container:Q});R=L.get("element");if(V.isDefault){L.addClass("default");this.defaultHtmlButton=R;}if(E.isFunction(V.handler)){L.set("onclick",{fn:V.handler,obj:this,scope:this});}else{if(E.isObject(V.handler)&&E.isFunction(V.handler.fn)){L.set("onclick",{fn:V.handler.fn,obj:((!E.isUndefined(V.handler.obj))?V.handler.obj:this),scope:(V.handler.scope||this)});}}this._aButtons[this._aButtons.length]=L;}else{R=document.createElement("button");R.setAttribute("type","button");if(V.isDefault){R.className="default";this.defaultHtmlButton=R;}R.innerHTML=V.text;if(E.isFunction(V.handler)){J.on(R,"click",V.handler,this,true);}else{if(E.isObject(V.handler)&&E.isFunction(V.handler.fn)){J.on(R,"click",V.handler.fn,((!E.isUndefined(V.handler.obj))?V.handler.obj:this),(V.handler.scope||this));}}Q.appendChild(R);this._aButtons[this._aButtons.length]=R;}V.htmlButton=R;if(N===0){this.firstButton=R;}if(N==(S-1)){this.lastButton=R;}}this.setFooter(Q);K=this.footer;if(D.inDocument(this.element)&&!D.isAncestor(M,K)){M.appendChild(K);}this.buttonSpan=Q;}else{Q=this.buttonSpan;K=this.footer;if(Q&&K){K.removeChild(Q);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}this.cfg.refireEvent("iframe");this.cfg.refireEvent("underlay");},getButtons:function(){var K=this._aButtons;if(K){return K;}},focusFirst:function(N,L,P){var M=this.firstFormElement,K;if(L){K=L[1];if(K){J.stopEvent(K);}}if(M){try{M.focus();}catch(O){}}else{this.focusDefaultButton();}},focusLast:function(N,L,P){var Q=this.cfg.getProperty("buttons"),M=this.lastFormElement,K;if(L){K=L[1];if(K){J.stopEvent(K);}}if(Q&&E.isArray(Q)){this.focusLastButton();}else{if(M){try{M.focus();}catch(O){}}}},focusDefaultButton:function(){var K=this.defaultHtmlButton;if(K){try{K.focus();}catch(L){}}},blurButtons:function(){var P=this.cfg.getProperty("buttons"),M,O,L,K;if(P&&E.isArray(P)){M=P.length;if(M>0){K=(M-1);do{O=P[K];if(O){L=O.htmlButton;if(L){try{L.blur();}catch(N){}}}}while(K--);}}},focusFirstButton:function(){var N=this.cfg.getProperty("buttons"),M,K;if(N&&E.isArray(N)){M=N[0];if(M){K=M.htmlButton;if(K){try{K.focus();}catch(L){}}}}},focusLastButton:function(){var O=this.cfg.getProperty("buttons"),L,N,K;if(O&&E.isArray(O)){L=O.length;if(L>0){N=O[(L-1)];if(N){K=N.htmlButton;if(K){try{K.focus();}catch(M){}}}}}},configPostMethod:function(L,K,M){this.registerForm();},validate:function(){return true;},submit:function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();if(this.cfg.getProperty("hideaftersubmit")){this.hide();}return true;}else{return false;}},cancel:function(){this.cancelEvent.fire();this.hide();},getData:function(){var a=this.form,M,T,W,O,U,R,Q,L,X,N,Y,b,K,P,c,Z,V;function S(e){var d=e.tagName.toUpperCase();return((d=="INPUT"||d=="TEXTAREA"||d=="SELECT")&&e.name==O);}if(a){M=a.elements;T=M.length;W={};for(Z=0;Z<T;Z++){O=M[Z].name;U=D.getElementsBy(S,"*",a);R=U.length;if(R>0){if(R==1){U=U[0];Q=U.type;L=U.tagName.toUpperCase();switch(L){case"INPUT":if(Q=="checkbox"){W[O]=U.checked;}else{if(Q!="radio"){W[O]=U.value;}}break;case"TEXTAREA":W[O]=U.value;break;case"SELECT":X=U.options;N=X.length;Y=[];for(V=0;V<N;V++){b=X[V];if(b.selected){K=b.value;if(!K||K===""){K=b.text;}Y[Y.length]=K;}}W[O]=Y;break;}}else{Q=U[0].type;switch(Q){case"radio":for(V=0;V<R;V++){P=U[V];if(P.checked){W[O]=P.value;break;}}break;case"checkbox":Y=[];for(V=0;V<R;V++){c=U[V];if(c.checked){Y[Y.length]=c.value;}}W[O]=Y;break;}}}}}return W;},destroy:function(){C.call(this);this._aButtons=null;var K=this.element.getElementsByTagName("form"),L;if(K.length>0){L=K[0];if(L){J.purgeElement(L);if(L.parentNode){L.parentNode.removeChild(L);}this.form=null;}}F.superclass.destroy.call(this);},toString:function(){return"Dialog "+this.id;}});}());(function(){YAHOO.widget.SimpleDialog=function(E,D){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,E,D);};var C=YAHOO.util.Dom,B=YAHOO.widget.SimpleDialog,A={"ICON":{key:"icon",value:"none",suppressEvent:true},"TEXT":{key:"text",value:"",suppressEvent:true,supercedes:["icon"]}};B.ICON_BLOCK="blckicon";B.ICON_ALARM="alrticon";B.ICON_HELP="hlpicon";B.ICON_INFO="infoicon";B.ICON_WARN="warnicon";B.ICON_TIP="tipicon";B.ICON_CSS_CLASSNAME="yui-icon";B.CSS_SIMPLEDIALOG="yui-simple-dialog";YAHOO.extend(B,YAHOO.widget.Dialog,{initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);this.cfg.addProperty(A.ICON.key,{handler:this.configIcon,value:A.ICON.value,suppressEvent:A.ICON.suppressEvent});this.cfg.addProperty(A.TEXT.key,{handler:this.configText,value:A.TEXT.value,suppressEvent:A.TEXT.suppressEvent,supercedes:A.TEXT.supercedes});},init:function(E,D){B.superclass.init.call(this,E);this.beforeInitEvent.fire(B);C.addClass(this.element,B.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(D){this.cfg.applyConfig(D,true);}this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(B);},registerForm:function(){B.superclass.registerForm.call(this);this.form.innerHTML+='<input type="hidden" name="'+this.id+'" value=""/>';},configIcon:function(F,E,J){var K=E[0],D=this.body,I=B.ICON_CSS_CLASSNAME,H,G;if(K&&K!="none"){H=C.getElementsByClassName(I,"*",D);if(H){G=H.parentNode;if(G){G.removeChild(H);H=null;}}if(K.indexOf(".")==-1){H=document.createElement("span");H.className=(I+" "+K);H.innerHTML="&#160;";}else{H=document.createElement("img");H.src=(this.imageRoot+K);H.className=I;}if(H){D.insertBefore(H,D.firstChild);}}},configText:function(E,D,F){var G=D[0];if(G){this.setBody(G);this.cfg.refireEvent("icon");}},toString:function(){return"SimpleDialog "+this.id;}});}());(function(){YAHOO.widget.ContainerEffect=function(F,I,H,E,G){if(!G){G=YAHOO.util.Anim;}this.overlay=F;this.attrIn=I;this.attrOut=H;this.targetElement=E||F.element;this.animClass=G;};var B=YAHOO.util.Dom,D=YAHOO.util.CustomEvent,C=YAHOO.util.Easing,A=YAHOO.widget.ContainerEffect;A.FADE=function(E,G){var I={attributes:{opacity:{from:0,to:1}},duration:G,method:C.easeIn};var F={attributes:{opacity:{to:0}},duration:G,method:C.easeOut};var H=new A(E,I,F,E.element);H.handleUnderlayStart=function(){var K=this.overlay.underlay;if(K&&YAHOO.env.ua.ie){var J=(K.filters&&K.filters.length>0);if(J){B.addClass(E.element,"yui-effect-fade");}}};H.handleUnderlayComplete=function(){var J=this.overlay.underlay;if(J&&YAHOO.env.ua.ie){B.removeClass(E.element,"yui-effect-fade");}};H.handleStartAnimateIn=function(K,J,L){B.addClass(L.overlay.element,"hide-select");if(!L.overlay.underlay){L.overlay.cfg.refireEvent("underlay");}L.handleUnderlayStart();B.setStyle(L.overlay.element,"visibility","visible");B.setStyle(L.overlay.element,"opacity",0);};H.handleCompleteAnimateIn=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateInCompleteEvent.fire();};H.handleStartAnimateOut=function(K,J,L){B.addClass(L.overlay.element,"hide-select");L.handleUnderlayStart();};H.handleCompleteAnimateOut=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}B.setStyle(L.overlay.element,"visibility","hidden");B.setStyle(L.overlay.element,"opacity",1);L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateOutCompleteEvent.fire();};H.init();return H;};A.SLIDE=function(G,I){var F=G.cfg.getProperty("x")||B.getX(G.element),K=G.cfg.getProperty("y")||B.getY(G.element),J=B.getClientWidth(),H=G.element.offsetWidth,E=new A(G,{attributes:{points:{to:[F,K]}},duration:I,method:C.easeIn},{attributes:{points:{to:[(J+25),K]}},duration:I,method:C.easeOut},G.element,YAHOO.util.Motion);E.handleStartAnimateIn=function(M,L,N){N.overlay.element.style.left=((-25)-H)+"px";N.overlay.element.style.top=K+"px";};E.handleTweenAnimateIn=function(O,N,P){var Q=B.getXY(P.overlay.element),M=Q[0],L=Q[1];if(B.getStyle(P.overlay.element,"visibility")=="hidden"&&M<F){B.setStyle(P.overlay.element,"visibility","visible");}P.overlay.cfg.setProperty("xy",[M,L],true);P.overlay.cfg.refireEvent("iframe");};E.handleCompleteAnimateIn=function(M,L,N){N.overlay.cfg.setProperty("xy",[F,K],true);N.startX=F;N.startY=K;N.overlay.cfg.refireEvent("iframe");N.animateInCompleteEvent.fire();};E.handleStartAnimateOut=function(M,L,P){var N=B.getViewportWidth(),Q=B.getXY(P.overlay.element),O=Q[1];P.animOut.attributes.points.to=[(N+25),O];};E.handleTweenAnimateOut=function(N,M,O){var Q=B.getXY(O.overlay.element),L=Q[0],P=Q[1];O.overlay.cfg.setProperty("xy",[L,P],true);O.overlay.cfg.refireEvent("iframe");};E.handleCompleteAnimateOut=function(M,L,N){B.setStyle(N.overlay.element,"visibility","hidden");N.overlay.cfg.setProperty("xy",[F,K]);N.animateOutCompleteEvent.fire();};E.init();return E;};A.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=D.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=D.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=D.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=D.LIST;this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);},animateIn:function(){this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();},handleStartAnimateIn:function(F,E,G){},handleTweenAnimateIn:function(F,E,G){},handleCompleteAnimateIn:function(F,E,G){},handleStartAnimateOut:function(F,E,G){},handleTweenAnimateOut:function(F,E,G){},handleCompleteAnimateOut:function(F,E,G){},toString:function(){var E="ContainerEffect";if(this.overlay){E+=" ["+this.overlay.toString()+"]";}return E;}};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);})();YAHOO.register("container",YAHOO.widget.Module,{version:"2.5.2",build:"1076"});
function Auth()
{var _instance=this;this.loggedIn=false;this.username='none';this.email='';this.firstname='';this.lastname='';this.init=function()
{YAHOO.util.Connect.asyncRequest("GET","ajax-authentication.php?action=query&random="+(new Date()).getTime(),{success:__callbackAccountQuery,failure:function(){xhtml.auth.accountUpdateUI();}});var fields=['authLoginUsername','authLoginPassword'];for(var x=0;x<fields.length;x++)
{if(document.getElementById(fields[x]).value)
{document.getElementById(fields[x]).className=fields[x].replace('authLogin','').toLowerCase()+'Active';}}
xhtml.addAnimationId(document.getElementById('auth'));}
this.isLoggedIn=function()
{return this.loggedIn;}
this.getUsername=function()
{return this.username;}
this.display=function(name)
{document.getElementById('authLogin').className='invisible';document.getElementById('authSignup').className='invisible';document.getElementById('authRecover').className='invisible';this.updateOverlay();document.getElementById(name).className='';}
this.hideAll=function()
{YAHOO.util.Event.addListener(document,"keyup",__eventHandlerKeyboardNavigation);document.getElementById('authBackground').className='invisible';document.getElementById('authBackground').style.height='1px';document.getElementById('authLogin').className='invisible';document.getElementById('authSignup').className='invisible';document.getElementById('authRecover').className='invisible';document.getElementById('authAccount').className='invisible';}
this.updateOverlay=function()
{var overlay=document.getElementById('authBackground');overlay.style.position='absolute';overlay.style.left='0px';overlay.style.top='0px';overlay.style.background='#000';overlay.style.opacity=0.6;overlay.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=60)';overlay.style.width=document.body.offsetWidth+'px';overlay.style.height=(719<document.documentElement.clientHeight?document.documentElement.clientHeight:719)+'px';overlay.className='';}
this.accountUpdateUI=function()
{document.getElementById('accountLoggedIn').className='invisible';document.getElementById('accountLoggedOut').className='invisible';if(xhtml.auth.loggedIn==true)
{document.body.className=document.body.className.replace('loggedOut','loggedIn');document.getElementById('accountLoggedIn').className='';document.getElementById('accountUsername').firstChild.nodeValue=xhtml.auth.username;}
else
{document.body.className=document.body.className.replace('loggedIn','loggedOut');document.getElementById('accountLoggedOut').className='';document.getElementById('accountUsername').firstChild.nodeValue='%username%';}
xhtml.media.refreshUploaders();xhtml.editorial.refreshCommentForms();}
this.accountLoginOpen=function()
{xhtml.auth.hideAll();xhtml.viewer.hideAll();xhtml.text.hideAll();YAHOO.util.Event.addListener(document,"keyup",__eventHandlerKeyboardNavigation);xhtml.centerDiv(document.getElementById('authLogin'));this.display('authLogin');}
this.accountLoginClose=function()
{this.hideAll();}
this.accountLoginProcess=function()
{var inputs=document.getElementById('loginForm').getElementsByTagName('input');if(inputs[1].value.length<4||inputs[2].value.length<4)
{alert('Please check you have entered your username and password correctly.');return;}
YAHOO.util.Connect.setForm('loginForm');YAHOO.util.Connect.asyncRequest("POST","ajax-authentication.php",{success:__callbackAccountLogin,failure:__callbackAccountLogin});}
this.accountLogoutProcess=function()
{YAHOO.util.Connect.asyncRequest("GET","ajax-authentication.php?action=logout&random="+(new Date()).getTime(),{success:__callbackAccountLogout,failure:__callbackAccountLogout});}
this.accountCreateOpen=function()
{xhtml.auth.hideAll();xhtml.viewer.hideAll();xhtml.text.hideAll();YAHOO.util.Event.addListener(document,"keyup",__eventHandlerKeyboardNavigation);var fields=['authSignupFirstname','authSignupLastname','authSignupUsername','authSignupEmail','authSignupPassword1','authSignupPassword2'];for(var x=0;x<fields.length;x++)
{document.getElementById(fields[x]).value='';}
xhtml.centerDiv(document.getElementById('authSignup'));this.display('authSignup');}
this.accountCreateClose=function()
{this.hideAll();}
this.accountCreateProcess=function()
{var inputs=document.getElementById('createForm').getElementsByTagName('input');if(inputs[1].value.length<4)
{alert('Please check your username, the minimum length is 4 characters.');return;}
var regex=/^[a-z0-9_+-.]+@[a-z0-9_-]*\.?[a-z0-9_-]*\.?[a-z0-9_-]*\.[a-z]+$/i;if(inputs[2].value.length<4||regex.test(inputs[2].value)==false)
{alert('Please check that your email address is valid.');return;}
if(inputs[6].value!=inputs[7].value)
{alert('The passwords entered do not match, please verify your password in both fields and try again.');return;}
if(inputs[6].value.length<4||inputs[7].value.length<4)
{alert('Your password is too short, the minimum length is 4 characters.');return;}
YAHOO.util.Connect.setForm('createForm');YAHOO.util.Connect.asyncRequest("POST","ajax-authentication.php",{success:__callbackAccountCreate,failure:__callbackAccountCreate});}
this.accountRecoverOpen=function()
{xhtml.auth.hideAll();xhtml.viewer.hideAll();xhtml.text.hideAll();YAHOO.util.Event.addListener(document,"keyup",__eventHandlerKeyboardNavigation);document.getElementById('authRecoverEmail').value='';xhtml.centerDiv(document.getElementById('authRecover'));this.display('authRecover');}
this.accountRecoverClose=function()
{if(document.getElementById('dialogRecover'))
{document.body.removeChild(document.getElementById('dialogRecover').parentNode);}
if(document.getElementById('sharePageOverlay'))
{document.getElementById('sharePageOverlay').className='hidden';}
if(xhtml.isTrident6==true)
{var selects=document.getElementsByTagName('select');for(var x=selects.length-1;0<=x;x--)
{selects[x].className=selects[x].className.replace(/\s?hidden/g,'');}}}
this.accountRecoverProcess=function()
{var inputs=document.getElementById('recoverForm').getElementsByTagName('input');var regex=/^[a-z0-9_+-.]+@[a-z0-9_-]*\.?[a-z0-9_-]*\.?[a-z0-9_-]*\.[a-z]+$/i;if(inputs[1].value.length<4||regex.test(inputs[1].value)==false)
{alert('Please check that your email address is valid.');return;}
YAHOO.util.Connect.setForm('recoverForm');YAHOO.util.Connect.asyncRequest("POST","ajax-authentication.php",{success:__callbackAccountRecover});}
this.accountDetailsOpen=function()
{xhtml.auth.hideAll();xhtml.viewer.hideAll();xhtml.text.hideAll();YAHOO.util.Event.addListener(document,"keyup",__eventHandlerKeyboardNavigation);var fields=document.getElementById('accountForm').getElementsByTagName('input');for(var x=1;x<fields.length;x++)
{fields[x].value='';fields[x].className=fields[x].className.replace('Active','');}
var values=['',this.username,this.email,this.firstname,this.lastname];for(var x=1;x<5;x++)
{if(values[x]!='')
{fields[x].value=values[x];fields[x].className+='Active';}}
xhtml.centerDiv(document.getElementById('authAccount'));this.display('authAccount');}
this.accountDetailsProcess=function()
{var inputs=document.getElementById('accountForm').getElementsByTagName('input');if(inputs[1].value.length<4)
{alert('Please check your username, the minimum length is 4 characters.');return;}
var regex=/^[a-z0-9_+-.]+@[a-z0-9_-]*\.?[a-z0-9_-]*\.?[a-z0-9_-]*\.[a-z]+$/i;if(inputs[2].value.length<4||regex.test(inputs[2].value)==false)
{alert('Please check that your email address is valid.');return;}
if(inputs[7].value!='')
{if(inputs[7].value!=inputs[8].value)
{alert('The passwords entered do not match, please verify your password in both fields and try again.');return;}
if(inputs[7].value.length<4||inputs[8].value.length<4)
{alert('Your password is too short, the minimum length is 4 characters.');return;}}
YAHOO.util.Connect.setForm('accountForm');YAHOO.util.Connect.asyncRequest("POST","ajax-authentication.php",{success:__callbackAccountUpdate,failure:__callbackAccountUpdateFail});}
this.accountMyUploads=function()
{xhtml.editorial.hideAll();xhtml.media.loadThumbnailsForUsername(this.getUsername());xhtml.media.layerPhotosThumbnails();}
function __eventHandlerKeyboardNavigation(event)
{var event=!!event?event:window.event;switch(event.keyCode)
{case 27:xhtml.auth.hideAll();break;}}
function __callbackAccountQuery(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{alert('Sorry a server communication error occurred, please try reloading this page again.');return;}
if(typeof(obj)=='object')
{if(obj.status==true)
{if(obj.authenticated=='yes')
{xhtml.auth.loggedIn=true;xhtml.auth.username=obj.username;xhtml.auth.email=obj.email;xhtml.auth.firstname=obj.firstname;xhtml.auth.lastname=obj.lastname;}
else
{xhtml.auth.loggedIn=false;xhtml.auth.username='';xhtml.auth.email='';xhtml.auth.firstname='';xhtml.auth.lastname='';}
xhtml.auth.accountUpdateUI();}
else
{alert('Sorry a server communication error occurred, please try reloading this page again.');}}
else
{alert('Sorry a server communication error occurred, please try reloading this page again.');}}
function __callbackAccountLogin(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{alert('Sorry a server communication error occurred, please try reloading this page again.');return;}
if(typeof(obj)=='object')
{if(obj.status==true)
{xhtml.auth.loggedIn=true;xhtml.auth.username=obj.username;xhtml.auth.email=obj.email;xhtml.auth.firstname=obj.firstname;xhtml.auth.lastname=obj.lastname;xhtml.auth.accountLoginClose();xhtml.auth.accountUpdateUI();}
else
{alert(obj.message);}}
else
{alert('Sorry a server communication error occurred, please try reloading this page again.');}}
function __callbackAccountLogout(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{return;}
if(obj.status&&obj.status==true)
{xhtml.auth.loggedIn=false;xhtml.auth.username='none';xhtml.auth.accountUpdateUI();}}
function __callbackAccountCreate(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{alert('Sorry a server communication error occurred, please try reloading this page again.');return;}
if(typeof(obj)=='object')
{if(obj.status==true)
{xhtml.auth.hideAll();alert(obj.message);}
else
{alert(obj.message);}}
else
{alert('Sorry a server communication error occurred, please try reloading this page again.');}}
function __callbackAccountRecover(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{alert('Sorry a server communication error occurred, please try reloading this page again.');return;}
if(typeof(obj)=='object')
{if(obj.status==true)
{xhtml.auth.hideAll();alert(obj.message);}
else
{alert(obj.message);}}
else
{alert('Sorry a server communication error occurred, please try reloading this page again.');}}
function __callbackAccountUpdate()
{YAHOO.util.Connect.asyncRequest("GET","ajax-authentication.php?action=query&random="+(new Date()).getTime(),{success:__callbackAccountQuery,failure:function(){xhtml.auth.accountUpdateUI();}});xhtml.auth.hideAll();}
function __callbackAccountUpdateFail(callbackObj)
{alert('Sorry we where unable to update your account:\n'+callbackObj.responseText);}}
function Editorial()
{var _instance=this;var _TAB_BLOG=0;var _TAB_STORY=1;var _TAB_TWITTER=2;var _TAB_INFO=3;this.blog={currentInternal:-1,currentExternal:-1,length:0}
this.story={currentInternal:-1,currentExternal:-1,length:0}
this.info={currentInternal:-1,currentExternal:-1,length:0}
this.init=function()
{var json='';xhtml.addAnimationId(document.getElementById('editorial'));json=document.getElementById('jsonTwitter').innerHTML;__callbackTwitterContent({"responseText":json.substring(5,json.length-4)});json=document.getElementById('jsonBlog').innerHTML;__callbackBlogEntriesList({"responseText":json.substring(5,json.length-4)});json=document.getElementById('jsonStory').innerHTML;__callbackStoryEntriesList({"responseText":json.substring(5,json.length-4)});json=document.getElementById('jsonInfo').innerHTML;__callbackInfoEntriesList({"responseText":json.substring(5,json.length-4)});}
this.initTimestamp=function(timestamp,closestMatch)
{if(arguments.length<2)
{var closestMatch=false;}
var tabs=document.getElementById('editorialNav').getElementsByTagName('a');var content=[(closestMatch?1:this.isBlog(timestamp*1)),this.isStory(timestamp*1),1,this.isInfo(timestamp*1)];for(var x=0;x<4;x++)
{if(content[x]!=-1)
{tabs[x].className=tabs[x].className.replace(/\s?disabled/ig,'');}
else
{tabs[x].className+=' disabled';}}}
this.isBlog=function(timestamp,closestMatch)
{if(arguments.length<2)
{var closestMatch=false;}
timestamp=trimTime(timestamp);for(var x=this.blog.length-1,blogDate=null,blogTimestamp=null;0<=x;x--)
{blogTimestamp=trimTime(this.blog[x].timestamp);if(timestamp==blogTimestamp)
{return this.blog[x].id;}}
if(closestMatch==true)
{var difference=9999999999;var closestIndex=-1;for(var x=this.blog.length-1;0<=x;x--)
{var newDifference=Math.abs(timestamp-this.blog[x].timestamp);if(newDifference<difference)
{difference=newDifference;closestIndex=this.blog[x].id;}}
return closestIndex;}
else
{return-1;}}
this.isStory=function(timestamp)
{var cityCode=xhtml.location.timestamp2citycode(timestamp*1);if(cityCode=='none')
{return-1;}
for(var x=this.story.length-1;0<=x;x--)
{if(cityCode==this.story[x].cityCode)
{return this.story[x].id;}}
return-1;}
this.isInfo=function(timestamp)
{var cityCode=xhtml.location.timestamp2citycode(timestamp*1);if(cityCode=='none')
{return-1;}
for(var x=this.info.length-1;0<=x;x--)
{if(cityCode==this.info[x].cityCode)
{return this.info[x].id;}}
return-1;}
this.loadBlog=function(id,scroll)
{if(arguments.length<2)
{var scroll=false;}
if(xhtml.editorial.blog.length==0)
{document.getElementById('editorialBlogArtboard').innerHTML='<h1>No Blog Entries</h1>';return false;}
var validId=false;for(var x=xhtml.editorial.blog.length-1;0<=x;x--)
{if(xhtml.editorial.blog[x].id==id)
{validId=true;}}
if(validId==false)
{document.getElementById('editorialBlogArtboard').innerHTML='<h1>Blog Entry Not Found</h1>';return false;}
document.getElementById('editorialBlogArtboard').innerHTML='<p class="loading">Loading Content...</p>';xhtml.scrollingRegionInit('editorialBlog');YAHOO.util.Connect.asyncRequest("GET","ajax-comments.php?action=list&type=blog&id="+id+"&random="+(new Date()).getTime(),{success:__callbackBlogComments,failure:__callbackBlogComments});if(parseBoolean(scroll)==true)
{xhtml.timeline.scrollToItem('blog',id);}}
this.loadBlogMenu=function()
{_buildBlogMenu();}
this.loadStory=function(id,scroll)
{if(arguments.length<2)
{var scroll=false;}
if(xhtml.editorial.story.length==0)
{document.getElementById('editorialStoryArtboard').innerHTML='<h1>No host story for this city yet</h1>';return false;}
var validId=false;for(var x=xhtml.editorial.story.length-1;0<=x;x--)
{if(xhtml.editorial.story[x].id==id)
{validId=true;}}
if(validId==false)
{document.getElementById('editorialStoryArtboard').innerHTML='<h1>Story Entry Not Found</h1>';return false;}
document.getElementById('editorialStoryArtboard').innerHTML='<p class="loading">Loading Content...</p>';xhtml.scrollingRegionInit('editorialStory');YAHOO.util.Connect.asyncRequest("GET","ajax-comments.php?action=list&type=story&id="+id+"&random="+(new Date()).getTime(),{success:__callbackStoryComments,failure:__callbackStoryComments});if(parseBoolean(scroll)==true)
{xhtml.timeline.scrollToItem('story',id);}}
this.loadInfo=function(id)
{if(xhtml.editorial.info.length==0)
{document.getElementById('editorialInfoArtboard').innerHTML='<h1>No show information for this city yet</h1>';return false;}
var validId=false;for(var x=xhtml.editorial.info.length-1;0<=x;x--)
{if(xhtml.editorial.info[x].id==id)
{validId=true;}}
if(validId==false)
{document.getElementById('editorialInfoArtboard').innerHTML='<h1>Info Entry Not Found</h1>';return false;}
document.getElementById('editorialInfoArtboard').innerHTML='<p class="loading">Loading Content...</p>';xhtml.scrollingRegionInit('editorialInfo');YAHOO.util.Connect.asyncRequest("GET","ajax-comments.php?action=list&type=info&id="+id+"&random="+(new Date()).getTime(),{success:__callbackInfoComments,failure:__callbackInfoComments});}
this.layerBlog=function()
{_fadeInEditorial();xhtml.updateUrlHash('editorial',1);document.getElementById('editorialBlog').className='';document.getElementById('editorialStory').className='invisible';document.getElementById('editorialTwitter').className='invisible';document.getElementById('editorialInfo').className='invisible';_setActiveTab(_TAB_BLOG);}
this.layerStory=function()
{_fadeInEditorial();xhtml.updateUrlHash('editorial',2);document.getElementById('editorialBlog').className='invisible';document.getElementById('editorialStory').className='';document.getElementById('editorialTwitter').className='invisible';document.getElementById('editorialInfo').className='invisible';_setActiveTab(_TAB_STORY);}
this.layerTwitter=function()
{_fadeInEditorial();xhtml.updateUrlHash('editorial',3);document.getElementById('editorialBlog').className='invisible';document.getElementById('editorialStory').className='invisible';document.getElementById('editorialTwitter').className='';document.getElementById('editorialInfo').className='invisible';_setActiveTab(_TAB_TWITTER);}
this.layerInfo=function()
{_fadeInEditorial();xhtml.updateUrlHash('editorial',4);document.getElementById('editorialBlog').className='invisible';document.getElementById('editorialStory').className='invisible';document.getElementById('editorialTwitter').className='invisible';document.getElementById('editorialInfo').className='';_setActiveTab(_TAB_INFO);}
this.hideAll=function()
{var animationTarget=document.getElementById('editorial');try{xhtml.animationReferences[animationTarget.getAttribute('animationId')].stop(false);}catch(err){}
animationTarget.className='animation';xhtml.animationReferences[animationTarget.getAttribute('animationId')]=new YAHOO.util.Anim(animationTarget,{opacity:{to:0}},0.5);xhtml.animationReferences[animationTarget.getAttribute('animationId')].onComplete.subscribe(function()
{document.getElementById('editorial').className='invisible';});xhtml.animationReferences[animationTarget.getAttribute('animationId')].animate();}
this.deleteComment=function(itemId,commentId,type)
{switch(type)
{case'blog':YAHOO.util.Connect.asyncRequest("GET","ajax-comments.php?action=delete&type=blog&id="+commentId+"&itemid="+itemId,{success:__callbackBlogCommentProcessed,failure:function(){alert('Comment Deletion Failed\nPlease check you are logged in and try again.');}});break;case'story':YAHOO.util.Connect.asyncRequest("GET","ajax-comments.php?action=delete&type=story&id="+commentId+"&itemid="+itemId,{success:__callbackStoryCommentProcessed,failure:function(){alert('Comment Deletion Failed\nPlease check you are logged in and try again.');}});break;case'info':YAHOO.util.Connect.asyncRequest("GET","ajax-comments.php?action=delete&type=info&id="+commentId+"&itemid="+itemId,{success:__callbackInfoCommentProcessed,failure:function(){alert('Comment Deletion Failed\nPlease check you are logged in and try again.');}});break;}}
this.inappropriateComment=function(id)
{YAHOO.util.Connect.asyncRequest("GET","ajax-comments.php?action=inappropriate&id="+id,{success:function(){alert('Comment Flagged For Review\nThanks, we\'ll look into this comment as soon as possible.');},failure:function(){alert('Sorry a server communication error occurred, \nplease try again.');}});}
this.addBlogComment=function()
{YAHOO.util.Connect.setForm('editorialBlogCommentForm');YAHOO.util.Connect.asyncRequest("POST","ajax-comments.php",{success:__callbackBlogCommentProcessed,failure:function(){alert('Sorry a server communication error occurred, \nplease try submitting your comment again.');}});}
this.addStoryComment=function()
{YAHOO.util.Connect.setForm('editorialStoryCommentForm');YAHOO.util.Connect.asyncRequest("POST","ajax-comments.php",{success:__callbackStoryCommentProcessed,failure:function(){alert('Sorry a server communication error occurred, \nplease try submitting your comment again.');}});}
this.addInfoComment=function()
{YAHOO.util.Connect.setForm('editorialInfoCommentForm');YAHOO.util.Connect.asyncRequest("POST","ajax-comments.php",{success:__callbackInfoCommentProcessed,failure:function(){alert('Sorry a server communication error occurred, \nplease try submitting your comment again.');}});}
this.refreshCommentForms=function()
{if(document.getElementById('editorialBlogCommentForm'))
{xhtml.scrollingRegionInit('editorialBlog');}
if(document.getElementById('editorialStoryCommentForm'))
{xhtml.scrollingRegionInit('editorialStory');}
if(document.getElementById('editorialInfoCommentForm'))
{xhtml.scrollingRegionInit('editorialInfo');}}
function _setActiveTab(tab)
{var anchors=document.getElementById('editorialNav').getElementsByTagName('a');for(var x=0;x<anchors.length;x++)
{anchors[x].className=anchors[x].className.replace(/\s?active/ig,'');}
anchors[tab].className+=' active';}
function _fadeInEditorial()
{var animationTarget=document.getElementById('editorial');try{xhtml.animationReferences[animationTarget.getAttribute('animationId')].stop(false);}catch(err){}
animationTarget.className='animation';xhtml.animationReferences[animationTarget.getAttribute('animationId')]=new YAHOO.util.Anim(animationTarget,{opacity:{to:1}},0.5);xhtml.animationReferences[animationTarget.getAttribute('animationId')].onComplete.subscribe(function()
{if(xhtml.isTrident==true)
{try{document.getElementById('editorial').style.filter=null;}catch(err){}}
document.getElementById('editorial').className='';});xhtml.animationReferences[animationTarget.getAttribute('animationId')].animate();}
function _buildBlog(id,comments)
{var html=[];var entry=null;for(var x=0;x<xhtml.editorial.blog.length;x++)
{if(xhtml.editorial.blog[x].id==id)
{entry=xhtml.editorial.blog[x];xhtml.editorial.blog.currentInternal=x;xhtml.editorial.blog.currentExternal=id;break;}}
var previousEntryId=(xhtml.editorial.blog.currentInternal==0?null:xhtml.editorial.blog[xhtml.editorial.blog.currentInternal-1].id);var nextEntryId=(xhtml.editorial.blog.currentInternal==(xhtml.editorial.blog.length-1)?null:xhtml.editorial.blog[xhtml.editorial.blog.currentInternal+1].id);if(entry==null)
{return;}
xhtml.updateUrlHash('blog',xhtml.editorial.blog.currentExternal);html.push('<div class="content">');html.push('<h1>'+entry.title+'</h1>');html.push('<h2><b>[</b> by <span class="rollover"><img src="images/editorial-blog-author-neil.jpg" width="200" height="200" alt=""/>'+entry.author+'</span> on '+entry.date+' <b>]</b></h2>');html.push('<div class="navigation">');if(previousEntryId!=null)
{html.push('<a class="prev" href="javascript:;" onclick="xhtml.editorial.loadBlog('+previousEntryId+', true);"></a>');}
else
{html.push('<a class="prevDisabled" href="javascript:;"></a>');}
html.push('<a class="all" href="javascript:;" onclick="xhtml.editorial.loadBlogMenu();"></a>');if(nextEntryId!=null)
{html.push('<a class="next" href="javascript:;" onclick="xhtml.editorial.loadBlog('+nextEntryId+', true);"></a>');}
else
{html.push('<a class="nextDisabled" href="javascript:;"></a>');}
html.push('</div>');html.push('<div class="body">'+entry.content+'</div>');html.push('</div>');html.push('</div>');html.push('<div class="comments">');html.push('<h4>Comments</h4>');if(0<comments.length)
{for(var x=0;x<comments.length;x++)
{html.push('<div class="commentItem">');if(xhtml.auth.isLoggedIn()==true&&((xhtml.auth.getUsername()).replace(/\s+/g,'')).toLowerCase()==(comments[x].username.replace(/\s+/g,'')).toLowerCase())
{html.push('<h6>'+comments[x].username.replace(/<([^>]+)>/ig,'')+', '+xhtml.dateFormattedShort(new Date(comments[x].timestamp))+' <span class="flag">| <a href="javascript:;" onclick="if(confirm(\'Are you sure you wish to flag this comment as inappropriate?\'))xhtml.editorial.inappropriateComment('+comments[x].id+');">report</a></span> <span class="delete">| <a href="javascript:;" onclick="if(confirm(\'Are you sure you wish to delete your comment?\'))xhtml.editorial.deleteComment('+id+','+comments[x].id+',\'blog\');">delete</a></span></h6>');}
else
{html.push('<h6>'+comments[x].username.replace(/<([^>]+)>/ig,'')+', '+xhtml.dateFormattedShort(new Date(comments[x].timestamp))+' <span class="flag">| <a href="javascript:;" onclick="if(confirm(\'Are you sure you wish to flag this comment as inappropriate?\'))xhtml.editorial.inappropriateComment('+comments[x].id+');">report</a></span></h6>');}
html.push('<p>'+comments[x].content.replace(/<([^>]+)>/ig,'')+'</p>');html.push('</div>');}}
else
{html.push('<div class="commentItem">');html.push('<p>No Comments</p>');html.push('</div>');}
html.push('<div class="commentsForm">');html.push('<h5><a href="javascript:;" onclick="xhtml.sharethis.open(this);" rel="'+window.location+'" title="'+entry.title.replace(/<([^>]+)>/ig,'').replace(/\"+/g,'\"')+'"> Share This Page</a><img src="images/editorial-heading-leaveacomment.png" width="136" height="22" alt=""/></h5>');html.push('<p>You must be logged in to comment, please <a href="javascript:;" onclick="xhtml.auth.accountCreateOpen();">Sign Up</a> or <a href="javascript:;" onclick="xhtml.auth.accountLoginOpen();">Login</a> to continue</p>');html.push('<form id="editorialBlogCommentForm" action="javascript:;" method="post" onsubmit="xhtml.editorial.addBlogComment('+id+'); return false;">');html.push('<fieldset>');html.push('<input type="hidden" name="action" value="add"/>');html.push('<input type="hidden" name="type" value="blog"/>');html.push('<input type="hidden" name="id" value="'+id+'"/>');html.push('<textarea name="comment" rows="80" cols="40" onfocus="this.style.background=\'#fff\';"></textarea>');html.push('<input type="image" class="hasRollover" src="images/editorial-button-submit.png" alt="Submit"/>');html.push('</fieldset>');html.push('</form>');html.push('</div>');html.push('</div>');document.getElementById('editorialBlogArtboard').innerHTML=html.join("\n");var spans=YAHOO.util.Dom.getElementsByClassName('rollover','span',document.getElementById('editorialBlogArtboard'));for(var x=spans.length-1;0<=x;x--)
{YAHOO.util.Event.addListener(spans[x],"mouseover",__eventHandlerWordPressImageOver);YAHOO.util.Event.addListener(spans[x],"mouseout",__eventHandlerWordPressImageOut);}
xhtml.initInputButtons();xhtml.scrollingRegionInit('editorialBlog');}
function _buildBlogMenu()
{var html=[];html.push('<div class="content">');html.push('<h1>All Blog Entries</h1>');html.push('<ul class="entriesList">');for(var x=xhtml.editorial.blog.length-1;0<=x;x--)
{html.push('<li>');html.push('<span class="title"><a href="javascript:;" onclick="xhtml.editorial.loadBlog('+xhtml.editorial.blog[x].id+', true);">'+xhtml.editorial.blog[x].title+'</a><span>');html.push('<span class="byline"><b>[</b> by <span>'+xhtml.editorial.blog[x].author+'</span> on '+xhtml.editorial.blog[x].date+' <b>]</b></span>');html.push('</li>');}
if(xhtml.editorial.blog.length==0)
{html.push('<li>');html.push('<span class="title">No Blog Entries Found<span>');html.push('</li>');}
html.push('</ul>');html.push('</div>');document.getElementById('editorialBlogArtboard').innerHTML=html.join("\n");xhtml.scrollingRegionInit('editorialBlog');}
function _buildStory(id,comments)
{var html=[];var entry=null;for(var x=0;x<xhtml.editorial.story.length;x++)
{if(xhtml.editorial.story[x].id==id)
{entry=xhtml.editorial.story[x];xhtml.editorial.story.currentInternal=x;xhtml.editorial.story.currentExternal=id;break;}}
if(entry==null)
{return;}
xhtml.updateUrlHash('story',xhtml.editorial.story.currentExternal);html.push('<div class="content">');html.push('<h1>'+entry.title+'</h1>');html.push('<br/>');html.push('<div class="body">'+entry.content+'</div>');html.push('</div>');html.push('</div>');html.push('<div class="comments">');html.push('<h4>Comments</h4>');if(0<comments.length)
{for(var x=0;x<comments.length;x++)
{html.push('<div class="commentItem">');if(xhtml.auth.isLoggedIn()==true&&((xhtml.auth.getUsername()).replace(/\s+/g,'')).toLowerCase()==(comments[x].username.replace(/\s+/g,'')).toLowerCase())
{html.push('<h6>'+comments[x].username.replace(/<([^>]+)>/ig,'')+', '+xhtml.dateFormattedShort(new Date(comments[x].timestamp))+' <span class="flag">| <a href="javascript:;" onclick="if(confirm(\'Are you sure you wish to flag this comment as inappropriate?\'))xhtml.editorial.inappropriateComment('+comments[x].id+');">report</a></span> <span class="delete">| <a href="javascript:;" onclick="if(confirm(\'Are you sure you wish to delete your comment?\'))xhtml.editorial.deleteComment('+id+','+comments[x].id+',\'story\');">delete</a></span></h6>');}
else
{html.push('<h6>'+comments[x].username.replace(/<([^>]+)>/ig,'')+', '+xhtml.dateFormattedShort(new Date(comments[x].timestamp))+' <span class="flag">| <a href="javascript:;" onclick="if(confirm(\'Are you sure you wish to flag this comment as inappropriate?\'))xhtml.editorial.inappropriateComment('+comments[x].id+');">report</a></span></h6>');}
html.push('<p>'+comments[x].content.replace(/<([^>]+)>/ig,'')+'</p>');html.push('</div>');}}
else
{html.push('<div class="commentItem">');html.push('<p>No Comments</p>');html.push('</div>');}
html.push('<div class="commentsForm">');html.push('<h5><a href="javascript:;" onclick="xhtml.sharethis.open(this);" rel="'+window.location+'" title="'+entry.title.replace(/<([^>]+)>/ig,'').replace(/\"+/g,'\"')+'"> Share This Page</a><img src="images/editorial-heading-leaveacomment.png" width="136" height="22" alt=""/></h5>');html.push('<p>You must be logged in to comment, please <a href="javascript:;" onclick="xhtml.auth.accountCreateOpen();">Sign Up</a> or <a href="javascript:;" onclick="xhtml.auth.accountLoginOpen();">Login</a> to continue</p>');html.push('<form id="editorialStoryCommentForm" action="javascript:;" method="post" onsubmit="xhtml.editorial.addStoryComment('+id+'); return false;">');html.push('<fieldset>');html.push('<input type="hidden" name="action" value="add"/>');html.push('<input type="hidden" name="type" value="story"/>');html.push('<input type="hidden" name="id" value="'+id+'"/>');html.push('<textarea name="comment" rows="80" cols="40" onfocus="this.style.background=\'#fff\';"></textarea>');html.push('<input type="image" class="hasRollover" src="images/editorial-button-submit.png" alt="Submit"/>');html.push('</fieldset>');html.push('</form>');html.push('</div>');html.push('</div>');document.getElementById('editorialStoryArtboard').innerHTML=html.join("\n");var spans=YAHOO.util.Dom.getElementsByClassName('rollover','span',document.getElementById('editorialStoryArtboard'));for(var x=spans.length-1;0<=x;x--)
{YAHOO.util.Event.addListener(spans[x],"mouseover",__eventHandlerWordPressImageOver);YAHOO.util.Event.addListener(spans[x],"mouseout",__eventHandlerWordPressImageOut);}
xhtml.initInputButtons();xhtml.scrollingRegionInit('editorialStory');}
function _buildTwitter(dataset)
{if(0<dataset.length)
{var html=[];if(dataset[0].timestamp<dataset[dataset.length-1].timestamp)
{for(var x=dataset.length-1;0<=x;x--)
{html.push('<p>(<span class="date">'+xhtml.dateFormattedShort(new Date(dataset[x].timestamp))+'</span>): <span class="content">'+dataset[x].content+'</span></p>');}}
else
{for(var x=0;x<dataset.length;x++)
{html.push('<p>(<span class="date">'+xhtml.dateFormattedShort(new Date(dataset[x].timestamp))+'</span>): <span class="content">'+dataset[x].content+'</span></p>');}}
document.getElementById('twitterLatestContent').innerHTML=html[0].replace('<p>','').replace('</p>','');setTimeout("xhtml.toggleTwitterBar();",2000);document.getElementById('editorialTwitterArtboard').innerHTML=html.join("\n");xhtml.scrollingRegionInit('editorialTwitter');var twitterBar=document.getElementById('twitter');twitterBar.setAttribute('animationId2','id'+xhtml.animationReferences.count++);twitterBar.onmouseover=function()
{try{xhtml.animationReferences[this.getAttribute('animationId2')].stop(false);}catch(err){}
xhtml.animationReferences[this.getAttribute('animationId2')]=new YAHOO.util.ColorAnim(this,{color:{to:'#FFFFFF'}},0.3,YAHOO.util.Easing.easeBoth);xhtml.animationReferences[this.getAttribute('animationId2')].animate();}
twitterBar.onmouseout=function()
{try{xhtml.animationReferences[this.getAttribute('animationId2')].stop(false);}catch(err){}
xhtml.animationReferences[this.getAttribute('animationId2')]=new YAHOO.util.ColorAnim(this,{color:{to:'#BEBFBF'}},0.9,YAHOO.util.Easing.easeBoth);xhtml.animationReferences[this.getAttribute('animationId2')].animate();}}}
function _buildInfo(id,comments)
{var html=[];var entry=null;for(var x=0;x<xhtml.editorial.info.length;x++)
{if(xhtml.editorial.info[x].id==id)
{entry=xhtml.editorial.info[x];xhtml.editorial.info.currentInternal=x;xhtml.editorial.info.currentExternal=id;break;}}
if(entry==null)
{return;}
xhtml.updateUrlHash('info',xhtml.editorial.info.currentExternal);html.push('<div class="content">');html.push('<h1>'+entry.title+'</h1>');html.push('<br/>');html.push('<div class="body">'+entry.content+'</div>');html.push('</div>');html.push('</div>');html.push('<div class="comments">');html.push('<h4>Comments</h4>');if(0<comments.length)
{for(var x=0;x<comments.length;x++)
{html.push('<div class="commentItem">');if(xhtml.auth.isLoggedIn()==true&&((xhtml.auth.getUsername()).replace(/\s+/g,'')).toLowerCase()==(comments[x].username.replace(/\s+/g,'')).toLowerCase())
{html.push('<h6>'+comments[x].username.replace(/<([^>]+)>/ig,'')+', '+xhtml.dateFormattedShort(new Date(comments[x].timestamp))+' <span class="flag">| <a href="javascript:;" onclick="if(confirm(\'Are you sure you wish to flag this comment as inappropriate?\'))xhtml.editorial.inappropriateComment('+comments[x].id+');">report</a></span> <span class="delete">| <a href="javascript:;" onclick="if(confirm(\'Are you sure you wish to delete your comment?\'))xhtml.editorial.deleteComment('+id+','+comments[x].id+',\'info\');">delete</a></span></h6>');}
else
{html.push('<h6>'+comments[x].username.replace(/<([^>]+)>/ig,'')+', '+xhtml.dateFormattedShort(new Date(comments[x].timestamp))+' <span class="flag">| <a href="javascript:;" onclick="if(confirm(\'Are you sure you wish to flag this comment as inappropriate?\'))xhtml.editorial.inappropriateComment('+comments[x].id+');">report</a></span></h6>');}
html.push('<p>'+comments[x].content.replace(/<([^>]+)>/ig,'')+'</p>');html.push('</div>');}}
else
{html.push('<div class="commentItem">');html.push('<p>No Comments</p>');html.push('</div>');}
html.push('<div class="commentsForm">');html.push('<h5><a href="javascript:;" onclick="xhtml.sharethis.open(this);" rel="'+window.location+'" title="'+entry.title.replace(/<([^>]+)>/ig,'').replace(/\"+/g,'\"')+'"> Share This Page</a><img src="images/editorial-heading-leaveacomment.png" width="136" height="22" alt=""/></h5>');html.push('<p>You must be logged in to comment, please <a href="javascript:;" onclick="xhtml.auth.accountCreateOpen();">Sign Up</a> or <a href="javascript:;" onclick="xhtml.auth.accountLoginOpen();">Login</a> to continue</p>');html.push('<form id="editorialInfoCommentForm" action="javascript:;" method="post" onsubmit="xhtml.editorial.addInfoComment('+id+'); return false;">');html.push('<fieldset>');html.push('<input type="hidden" name="action" value="add"/>');html.push('<input type="hidden" name="type" value="info"/>');html.push('<input type="hidden" name="id" value="'+id+'"/>');html.push('<textarea name="comment" rows="80" cols="40" onfocus="this.style.background=\'#fff\';"></textarea>');html.push('<input type="image" class="hasRollover" src="images/editorial-button-submit.png" alt="Submit"/>');html.push('</fieldset>');html.push('</form>');html.push('</div>');html.push('</div>');document.getElementById('editorialInfoArtboard').innerHTML=html.join("\n");var spans=YAHOO.util.Dom.getElementsByClassName('rollover','span',document.getElementById('editorialInfoArtboard'));for(var x=spans.length-1;0<=x;x--)
{YAHOO.util.Event.addListener(spans[x],"mouseover",__eventHandlerWordPressImageOver);YAHOO.util.Event.addListener(spans[x],"mouseout",__eventHandlerWordPressImageOut);}
xhtml.initInputButtons();xhtml.scrollingRegionInit('editorialInfo');}
function __eventHandlerWordPressImageOver()
{var imgs=this.getElementsByTagName('img');if(0<imgs.length)
{if(!!document.getElementById('wordpressRollover')==true)
{document.getElementById('wordpressRollover').parentNode.removeChild(document.getElementById('wordpressRollover'));}
var spanLocation=YAHOO.util.Dom.getXY(this);var wrapper=document.createElement('div');wrapper.id='wordpressRollover';wrapper.style.position='absolute';wrapper.style.width='1px';wrapper.style.height='1px';wrapper.style.zIndex=300;wrapper.style.left=Math.floor((this.offsetWidth/2)+spanLocation[0])+'px';wrapper.style.top=Math.floor(spanLocation[1]-10)+'px';document.body.appendChild(wrapper);var newImage=imgs[0].cloneNode(true);var left=-50;try
{left=Math.floor(imgs[0].offsetWidth/2)*-1;}
catch(err)
{}
newImage.style.position='absolute';newImage.style.left=left+'px';newImage.style.bottom='0px';newImage.style.border='2px solid #717171';wrapper.appendChild(newImage);}}
function __eventHandlerWordPressImageOut()
{if(!!document.getElementById('wordpressRollover')==true)
{document.getElementById('wordpressRollover').parentNode.removeChild(document.getElementById('wordpressRollover'));}}
function __callbackBlogEntriesList(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{document.getElementById('editorialBlogArtboard').innerHTML='<h1>Sorry a server communication error occurred, please try reloading this page again.</h1>';return;}
if(typeof(obj)=='object')
{var cleanDataset=[];for(var x=obj.length-1;0<=x;x--)
{obj[x].timestamp=strtotime(obj[x].timestamp);cleanDataset[cleanDataset.length]=obj[x];}
cleanDataset.sort(__sortFuncDatasetTimestamp);xhtml.editorial.blog=cleanDataset;xhtml.editorial.blog.currentInternal=-1;xhtml.editorial.blog.currentExternal=-1;xhtml.timeline.processDataset('blog',cleanDataset);}
else
{document.getElementById('editorialBlogArtboard').innerHTML='<h1>Sorry a server communication error occurred, please try reloading this page again.</h1>';return;}}
function __callbackBlogComments(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{document.getElementById('editorialBlogArtboard').innerHTML='<h1>Sorry a server communication error occurred, please try reloading this page again.</h1>';return;}
if(typeof(obj)=='object')
{for(var x=obj.length-1;0<=x;x--)
{obj[x].timestamp=strtotime(obj[x].timestamp);}
_buildBlog(obj.id,obj);}
else
{document.getElementById('editorialBlogArtboard').innerHTML='<h1>Sorry a server communication error occurred, please try reloading this page again.</h1>';return;}}
function __callbackBlogCommentProcessed(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{return;}
if(typeof(obj)=='object')
{xhtml.editorial.loadBlog(obj.id);}
else
{return;}}
function __callbackStoryEntriesList(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{document.getElementById('editorialStoryArtboard').innerHTML='<h1>Sorry a server communication error occurred, please try reloading this page again.</h1>';return;}
if(typeof(obj)=='object')
{for(var x=obj.length-1;0<=x;x--)
{obj[x].timestamp=strtotime(obj[x].timestamp);}
xhtml.editorial.story=obj;xhtml.editorial.story.currentInternal=-1;xhtml.editorial.story.currentExternal=-1;xhtml.timeline.processDataset('story',obj);}
else
{document.getElementById('editorialStoryArtboard').innerHTML='<h1>Sorry a server communication error occurred, please try reloading this page again.</h1>';return;}}
function __callbackStoryComments(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{document.getElementById('editorialStoryArtboard').innerHTML='<h1>Sorry a server communication error occurred, please try reloading this page again.</h1>';return;}
if(typeof(obj)=='object')
{for(var x=obj.length-1;0<=x;x--)
{obj[x].timestamp=strtotime(obj[x].timestamp);}
_buildStory(obj.id,obj);}
else
{document.getElementById('editorialStoryArtboard').innerHTML='<h1>Sorry a server communication error occurred, please try reloading this page again.</h1>';return;}}
function __callbackStoryCommentProcessed(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{return;}
if(typeof(obj)=='object')
{xhtml.editorial.loadStory(obj.id);}
else
{return;}}
function __callbackTwitterContent(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{document.getElementById('editorialTwitterArtboard').innerHTML='<h1>Sorry a server communication error occurred, please try reloading this page again.</h1>';document.getElementById('twitterLatestContent').innerHTML='Sorry a server communication error occurred, please try reloading this page again.';return;}
if(typeof(obj)=='object')
{for(var x=obj.length-1;0<=x;x--)
{obj[x].timestamp=strtotime(obj[x].timestamp);}
_buildTwitter(obj);}
else
{document.getElementById('editorialTwitterArtboard').innerHTML='<h1>Sorry a server communication error occurred, please try reloading this page again.</h1>';document.getElementById('twitterLatestContent').innerHTML='Sorry a server communication error occurred, please try reloading this page again.';return;}}
function __callbackInfoEntriesList(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{document.getElementById('editorialInfoArtboard').innerHTML='<h1>Sorry a server communication error occurred, please try reloading this page again.</h1>';return;}
if(typeof(obj)=='object')
{for(var x=obj.length-1;0<=x;x--)
{obj[x].timestamp=strtotime(obj[x].timestamp);}
xhtml.editorial.info=obj;xhtml.editorial.info.currentInternal=-1;xhtml.editorial.info.currentExternal=-1;}
else
{document.getElementById('editorialInfoArtboard').innerHTML='<h1>Sorry a server communication error occurred, please try reloading this page again.</h1>';return;}}
function __callbackInfoComments(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{document.getElementById('editorialInfoArtboard').innerHTML='<h1>Sorry a server communication error occurred, please try reloading this page again.</h1>';return;}
if(typeof(obj)=='object')
{for(var x=obj.length-1;0<=x;x--)
{obj[x].timestamp=strtotime(obj[x].timestamp);}
_buildInfo(obj.id,obj);}
else
{document.getElementById('editorialInfoArtboard').innerHTML='<h1>Sorry a server communication error occurred, please try reloading this page again.</h1>';return;}}
function __callbackInfoCommentProcessed(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{return;}
if(typeof(obj)=='object')
{xhtml.editorial.loadInfo(obj.id);}
else
{return;}}
function __sortFuncDatasetTimestamp(itemA,itemB)
{if(itemA.timestamp>itemB.timestamp)return 1;if(itemA.timestamp<itemB.timestamp)return-1;return 0;}}
function Location()
{var _instance=this;this.initialized=false;var monthNamesShort=['jan','feb','mar','apr','may','jun','jul','aug','sept','oct','nov','dec'];var mapping={1:'newyork',2:'newyork2',3:'boston',4:'montreal',5:'toronto',6:'detroit',7:'chicago',8:'minneapolis',9:'denver',10:'saltlakecity',11:'tempe',12:'sandiego',13:'losangeles',14:'berkeley',15:'seattle',16:'portland',17:'vancouver',newyork:1,newyork2:2,boston:3,montreal:4,toronto:5,detroit:6,chicago:7,minneapolis:8,denver:9,saltlakecity:10,tempe:11,sandiego:12,losangeles:13,berkeley:14,seattle:15,portland:16,vancouver:17,none:0,length:17};var firstCity=mapping[1];var lastCity=mapping[length];var timestampList=[strtotime("2008|09|17|0|0|0"),strtotime("2008|09|18|0|0|0"),strtotime("2008|09|19|0|0|0"),strtotime("2008|09|20|0|0|0"),strtotime("2008|09|22|0|0|0"),strtotime("2008|09|23|0|0|0"),strtotime("2008|09|24|0|0|0"),strtotime("2008|09|25|0|0|0"),strtotime("2008|09|27|0|0|0"),strtotime("2008|09|28|0|0|0"),strtotime("2008|09|30|0|0|0"),strtotime("2008|10|01|0|0|0"),strtotime("2008|10|02|0|0|0"),strtotime("2008|10|03|0|0|0"),strtotime("2008|10|05|0|0|0"),strtotime("2008|10|06|0|0|0"),strtotime("2008|10|07|0|0|0")];var timestamps={"newyork":strtotime("2008|09|17|0|0|0"),"newyork2":strtotime("2008|09|18|0|0|0"),"boston":strtotime("2008|09|19|0|0|0"),"montreal":strtotime("2008|09|20|0|0|0"),"toronto":strtotime("2008|09|22|0|0|0"),"detroit":strtotime("2008|09|23|0|0|0"),"chicago":strtotime("2008|09|24|0|0|0"),"minneapolis":strtotime("2008|09|25|0|0|0"),"denver":strtotime("2008|09|27|0|0|0"),"saltlakecity":strtotime("2008|09|28|0|0|0"),"tempe":strtotime("2008|09|30|0|0|0"),"sandiego":strtotime("2008|10|01|0|0|0"),"losangeles":strtotime("2008|10|02|0|0|0"),"berkeley":strtotime("2008|10|03|0|0|0"),"seattle":strtotime("2008|10|05|0|0|0"),"portland":strtotime("2008|10|06|0|0|0"),"vancouver":strtotime("2008|10|07|0|0|0"),"sept17":"newyork","sept18":"newyork2","sept19":"boston","sept20":"montreal","sept22":"toronto","sept23":"detroit","sept24":"chicago","sept25":"minneapolis","sept27":"denver","sept28":"saltlakecity","sept30":"tempe","oct1":"sandiego","oct01":"sandiego","oct2":"losangeles","oct02":"losangeles","oct3":"berkeley","oct03":"berkeley","oct5":"seattle","oct05":"seattle","oct6":"portland","oct06":"portland","oct7":"vancouver","oct07":"vancouver"}
var fullNames={'newyork':'New York','newyork2':'New York','boston':'Boston','montreal':'Montreal','toronto':'Toronto','detroit':'Detroit','chicago':'Chicago','minneapolis':'Minneapolis','denver':'Denver','saltlakecity':'Salt Lake City','tempe':'Tempe','sandiego':'San Diego','losangeles':'Los Angeles','berkeley':'Berkeley','seattle':'Seattle','portland':'Portland','vancouver':'Vancouver'};this.cityPhotos=['newyork','newyork2','montreal','saltlakecity','sandiego','toronto','detroit','boston','denver','tempe','berkeley','minneapolis','chicago','losangeles','seattle','portland','vancouver'];this.currentTimestamp=0;this.currentCityCode='none';this.cityBackgroundTimeout=null;this.init=function()
{var tooltip1=new YAHOO.widget.Tooltip("navigationPrevTooltip",{context:document.getElementById('navigationPrev')});var tooltip2=new YAHOO.widget.Tooltip("navigationNextTooltip",{context:document.getElementById('navigationNext')});var anchors=document.getElementById('globalHeaderLocations').getElementsByTagName('a');for(var x=anchors.length-1;0<=x;x--)
{var tooltip=new YAHOO.widget.Tooltip("globalNavCity"+x,{context:anchors[x]});}
this.initAccountAnimation();this.photoDefaultSrc=document.getElementById('backgroundImage').src;this.initialized=true;}
this.loadCity=function(cityCode)
{if(this.initialized==false)
{return;}
xhtml.auth.hideAll();xhtml.text.hideAll();xhtml.viewer.hideAll();xhtml.timeline.loadCityItem(cityCode);}
this.prev=function()
{if(xhtml.location.currentCityCode=='none')
{var cityCode=mapping[1];for(var x=timestampList.length-1;0<=x;x--)
{if(timestampList[x]<xhtml.location.currentTimestamp)
{var cityCode=this.timestamp2citycode(timestampList[x]);break;}}
this.loadCity(cityCode);}
else
{var newCity=mapping[xhtml.location.currentCityCode]-1;if(newCity<1)
{newCity=mapping.length;}
this.loadCity(mapping[newCity]);}}
this.next=function()
{if(xhtml.location.currentCityCode=='none')
{var cityCode=mapping[mapping.length];for(var x=0;x<timestampList.length;x++)
{if(xhtml.location.currentTimestamp<timestampList[x])
{var cityCode=this.timestamp2citycode(timestampList[x]);break;}}
this.loadCity(cityCode);}
else
{var newCity=mapping[xhtml.location.currentCityCode]+1;if(mapping.length<newCity)
{newCity=1;}
this.loadCity(mapping[newCity]);}}
this.setDate=function(timestamp)
{timestamp=trimTime(timestamp);this.currentTimestamp=timestamp;xhtml.updateUrlHash('timestamp',timestamp);this.currentCityCode=this.timestamp2citycode(timestamp);this.setCityActive(this.currentCityCode);clearTimeout(this.cityBackgroundTimeout);this.cityBackgroundTimeout=setTimeout("xhtml.location.updateBackgroundImage();",250);_updateNavigationButtons();}
this.setCityActive=function(cityCode)
{var anchors=document.getElementById('globalHeaderLocations').getElementsByTagName('a');for(var x=anchors.length-1;0<=x;x--)
{anchors[x].className=anchors[x].className.replace(/\bactive\b/g,'');}
var cityAnchors=YAHOO.util.Dom.getElementsByClassName(cityCode,'a',document.getElementById('globalHeaderLocations'));if(0<cityAnchors.length)
{cityAnchors[0].className+=' active';}}
this.getDateIndex=function()
{try
{return mapping[this.currentCityCode];}
catch(err)
{return 0;}}
this.getFullCityName=function(cityCode)
{try
{return fullNames[cityCode];}
catch(err)
{return'none';}}
this.timestamp2citycode=function(timestamp)
{var itemDate=new Date(timestamp*1);var dateStr=monthNamesShort[itemDate.getMonth()]+itemDate.getDate();if(typeof(timestamps[dateStr])!='undefined')
{return timestamps[dateStr];}
else
{return'none';}}
this.flickrcode2citycode=function(flickrCode)
{if(typeof(timestamps[flickrCode])!='undefined')
{return timestamps[flickrCode];}
else
{return'none';}}
this.citycode2timestamp=function(cityCode)
{if(typeof(timestamps[cityCode])!='undefined')
{return timestamps[cityCode];}
else
{return 0;}}
this.initAccountAnimation=function()
{var links=document.getElementById('globalHeaderAccount').getElementsByTagName('a');for(var x=links.length-1;0<=x;x--)
{xhtml.addAnimationId(links[x]);links[x].onmouseover=function()
{try{xhtml.animationReferences[this.getAttribute('animationId')].stop(false);}catch(err){}
xhtml.animationReferences[this.getAttribute('animationId')]=new YAHOO.util.ColorAnim(this,{color:{to:'#5F8AAA'}},0.3,YAHOO.util.Easing.easeBoth);xhtml.animationReferences[this.getAttribute('animationId')].animate();}
links[x].onmouseout=function()
{try{xhtml.animationReferences[this.getAttribute('animationId')].stop(false);}catch(err){}
xhtml.animationReferences[this.getAttribute('animationId')]=new YAHOO.util.ColorAnim(this,{color:{to:'#000000'}},0.9,YAHOO.util.Easing.easeBoth);xhtml.animationReferences[this.getAttribute('animationId')].animate();}}}
this.updateBackgroundImage=function()
{var cityCode=xhtml.location.currentCityCode;for(var x=xhtml.location.cityPhotos.length-1;0<=x;x--)
{if(xhtml.location.cityPhotos[x]==cityCode)
{document.getElementById('backgroundImage').src='images/content-backgrounds-'+xhtml.location.cityPhotos[x]+'.jpg';return;}}
document.getElementById('backgroundImage').src=this.photoDefaultSrc;}
function _updateNavigationButtons()
{document.getElementById('navigationPrev').className='';document.getElementById('navigationNext').className='';if(xhtml.location.currentCityCode=='none')
{if(xhtml.location.currentTimestamp<timestamps[firstCity])
{document.getElementById('navigationPrev').className='invisible';}}
else
{if(xhtml.location.currentCityCode==mapping[1])
{document.getElementById('navigationPrev').className='invisible';}}
if(xhtml.location.currentCityCode=='none')
{if(timestamps[lastCity]<xhtml.location.currentTimestamp)
{document.getElementById('navigationNext').className='invisible';}}
else
{if(xhtml.location.currentCityCode==mapping[mapping.length])
{document.getElementById('navigationNext').className='invisible';}}}
function __eventHandlerCityAnimationCompleteFadeIn()
{var imgs=document.getElementById('backgroundsCities').getElementsByTagName('img');for(var x=imgs.length-1;0<=x;x--)
{if(imgs[x].className.indexOf(xhtml.location.currentCityCode)==-1)
{imgs[x].className=imgs[x].className.replace(/\s?invisible/g,'')+' invisible';}
imgs[x].style.opacity=1;if(xhtml.isTrident==true)
{try{imgs[x].style.filter=null;}catch(err){}}}}
function __eventHandlerCityAnimationCompleteFadeOut()
{var obj=this.getEl();obj.className+=' invisible';obj.style.opacity=1;if(xhtml.isTrident==true)
{try{obj.style.filter=null;}catch(err){}}
var imgs=document.getElementById('backgroundsCities').getElementsByTagName('img');for(var x=imgs.length-1;0<=x;x--)
{if(imgs[x].className.indexOf(xhtml.location.currentCityCode)==-1)
{imgs[x].className=imgs[x].className.replace(/\s?invisible/g,'')+' invisible';}
imgs[x].style.opacity=1;if(xhtml.isTrident==true)
{try{imgs[x].style.filter=null;}catch(err){}}}}}
function strtotime(str)
{if(typeof(str)=='number')
{return str*1;}
var parts=(str.replace(/\D+/g,'\|')).split('|');for(var x=0;x<parts.length;x++)
{parts[x]=parts[x]*1;}
return(new Date(parts[0],(parts[1]-1),parts[2]*1,parts[3]*1,parts[4]*1,parts[5]*1)).getTime();}
function timetostr(timestamp,encode)
{var timestamp=parseInt(timestamp);if(timestamp<0)
{timestamp=0;}
var dateObj=new Date(timestamp);var str=''+dateObj.getFullYear()+'-'+(dateObj.getMonth()+1<10?'0':'')+(dateObj.getMonth()+1)+'-'+(dateObj.getDate()<10?'0':'')+dateObj.getDate()+' '+(dateObj.getHours()<10?'0':'')+dateObj.getHours()+':'+(dateObj.getMinutes()<10?'0':'')+dateObj.getMinutes()+':'+(dateObj.getSeconds()<10?'0':'')+dateObj.getSeconds();if(arguments.length==2&&encode==false)
{return str;}
else
{return encodeURIComponent(str);}}
function trimTime(timestamp)
{timestamp*=1;var dateObj=new Date(timestamp);return(new Date(dateObj.getFullYear(),dateObj.getMonth(),dateObj.getDate(),0,0,0)).getTime();}
function Media()
{var _instance=this;this.dataset={photos:{length:0},videos:{length:0}}
this.timestamp={photos:0,videos:0}
this.currentView={type:'none',photos:'thumbnails',videos:'thumbnails'}
this.init=function()
{xhtml.addAnimationId(document.getElementById('media'));this.thumbnailOverlay=new Image();this.thumbnailOverlay.src='/images/media-thumbnail-overlay.png';this.spinner=new Image();this.spinner.src='/images/editorial-elements-loading.gif';}
this.displayPhoto=function(cityCode,id,timestamp,title,description,credit,username,keepThumbnails,flickr)
{timestamp=timestamp*1;if(arguments.length<7||keepThumbnails==false)
{this.loadThumbnailsForDate('videos',timestamp);this.loadThumbnailsForDate('photos',timestamp);this.layerPhotosThumbnails();}
switch(arguments.length)
{case 3:var title='';case 4:var description='';case 5:var credit='';}
xhtml.viewer.displayPhoto(id,title,description,credit,username,flickr);}
this.displayVideo=function(cityCode,id,timestamp,title,description,credit,username,keepThumbnails)
{timestamp=timestamp*1;if(arguments.length<7||keepThumbnails==false)
{this.loadThumbnailsForDate('photos',timestamp);this.loadThumbnailsForDate('videos',timestamp);this.layerVideosThumbnails();}
switch(arguments.length)
{case 3:var title='';case 4:var description='';case 5:var credit='';}
xhtml.viewer.displayVideo(id,title,description,credit,username);}
this.loadThumbnailsForDate=function(type,timestamp)
{timestamp=timestamp*1;var cityCode=xhtml.location.timestamp2citycode(timestamp);switch(type)
{case'photos':document.getElementById('mediaPhotosThumbnailsArtboard').innerHTML='<p class="loading">Loading Content...</p>';xhtml.scrollingRegionInit('mediaPhotosThumbnails');xhtml.viewer.navigationReset('photos');YAHOO.util.Connect.asyncRequest("GET","ajax-photos.php?action=list&cityCode="+cityCode+"&timestamp="+timetostr(timestamp)+"&random="+(new Date()).getTime(),{success:__callbackPhotosThumbnailsContent,failure:function(){document.getElementById('mediaPhotosThumbnailsArtboard').innerHTML='<p class="loading">Sorry a server communication error occurred, please try reloading this page again.</p>';}});break;case'videos':document.getElementById('mediaVideosThumbnailsArtboard').innerHTML='<p class="loading">Loading Content...</p>';xhtml.scrollingRegionInit('mediaVideosThumbnails');xhtml.viewer.navigationReset('videos');YAHOO.util.Connect.asyncRequest("GET","ajax-videos.php?action=list&cityCode="+cityCode+"&timestamp="+timetostr(timestamp)+"&random="+(new Date()).getTime(),{success:__callbackVideosThumbnailsContent,failure:function(){document.getElementById('mediaPhotosThumbnailsArtboard').innerHTML='<p class="loading">Sorry a server communication error occurred, please try reloading this page again.</p>';}});break;}}
this.loadThumbnailsForUsername=function(username)
{document.getElementById('mediaPhotosThumbnailsArtboard').innerHTML='<p class="loading">Loading Content...</p>';xhtml.scrollingRegionInit('mediaPhotosThumbnails');xhtml.viewer.navigationReset('photos');YAHOO.util.Connect.asyncRequest("GET","ajax-photos.php?action=user&username="+encodeURIComponent(username)+"&random="+(new Date()).getTime(),{success:__callbackPhotosThumbnailsContent,failure:function(){document.getElementById('mediaPhotosThumbnailsArtboard').innerHTML='<p class="loading">Sorry a server communication error occurred, please try reloading this page again.</p>';}});document.getElementById('mediaVideosThumbnailsArtboard').innerHTML='<p class="loading">Loading Content...</p>';xhtml.scrollingRegionInit('mediaVideosThumbnails');xhtml.viewer.navigationReset('videos');YAHOO.util.Connect.asyncRequest("GET","ajax-videos.php?action=user&username="+encodeURIComponent(username)+"&random="+(new Date()).getTime(),{success:__callbackVideosThumbnailsContent,failure:function(){document.getElementById('mediaPhotosThumbnailsArtboard').innerHTML='<p class="loading">Sorry a server communication error occurred, please try reloading this page again.</p>';}});}
this.reloadThumbnails=function()
{document.getElementById('mediaPhotosThumbnailsArtboard').innerHTML='<p class="loading">Loading Content...</p>';document.getElementById('mediaVideosThumbnailsArtboard').innerHTML='<p class="loading">Loading Content...</p>';xhtml.scrollingRegionInit('mediaPhotosThumbnails');xhtml.scrollingRegionInit('mediaVideosThumbnails');xhtml.viewer.navigationReset('photos');xhtml.viewer.navigationReset('videos');var cityCodePhotos=xhtml.location.timestamp2citycode(xhtml.media.timestamp.photos);var cityCodeVideos=xhtml.location.timestamp2citycode(xhtml.media.timestamp.videos);YAHOO.util.Connect.asyncRequest("GET","ajax-photos.php?action=list&cityCode="+cityCodePhotos+"&timestamp="+timetostr(xhtml.media.timestamp.photos),{success:__callbackPhotosThumbnailsContent,failure:function(){document.getElementById('mediaPhotosThumbnailsArtboard').innerHTML='<p class="loading">Sorry a server communication error occurred, please try reloading this page again.</p>';}});YAHOO.util.Connect.asyncRequest("GET","ajax-videos.php?action=list&cityCode="+cityCodeVideos+"&timestamp="+timetostr(xhtml.media.timestamp.videos),{success:__callbackVideosThumbnailsContent,failure:function(){document.getElementById('mediaPhotosThumbnailsArtboard').innerHTML='<p class="loading">Sorry a server communication error occurred, please try reloading this page again.</p>';}});}
this.layerPhotos=function()
{this.currentView.type='photos';xhtml.updateUrlHash('media','photos');this.unloadUploader('videos');this.refreshUploaders();var animationTarget=document.getElementById('media');try{xhtml.animationReferences[animationTarget.getAttribute('animationId')].stop(false);}catch(err){}
animationTarget.className='animation';xhtml.animationReferences[animationTarget.getAttribute('animationId')]=new YAHOO.util.Anim(animationTarget,{opacity:{to:1}},0.5);xhtml.animationReferences[animationTarget.getAttribute('animationId')].onComplete.subscribe(function()
{if(xhtml.isTrident==true)
{try{document.getElementById('media').style.filter=null;}catch(err){}}
document.getElementById('media').className='';});xhtml.animationReferences[animationTarget.getAttribute('animationId')].animate();document.getElementById('mediaVideos').className='invisible';document.getElementById('mediaPhotos').className='';}
this.layerPhotosThumbnails=function()
{this.currentView.photos='thumbnails';this.layerPhotos();this.unloadUploader('photos');this.unloadUploader('videos');document.getElementById('mediaPhotosThumbnails').className='';document.getElementById('mediaPhotosUpload').className='invisible';xhtml.scrollingRegionInit('mediaPhotosThumbnails');}
this.layerPhotosUpload=function()
{this.currentView.photos='upload';this.layerPhotos();this.loadUploader('photos');document.getElementById('mediaPhotosThumbnails').className='invisible';document.getElementById('mediaPhotosUpload').className='';}
this.layerVideos=function()
{this.currentView.type='videos';xhtml.updateUrlHash('media','videos');this.unloadUploader('photos');this.refreshUploaders();var animationTarget=document.getElementById('media');try{xhtml.animationReferences[animationTarget.getAttribute('animationId')].stop(false);}catch(err){}
animationTarget.className='animation';xhtml.animationReferences[animationTarget.getAttribute('animationId')]=new YAHOO.util.Anim(animationTarget,{opacity:{to:1}},0.5);xhtml.animationReferences[animationTarget.getAttribute('animationId')].onComplete.subscribe(function()
{if(xhtml.isTrident==true)
{try{document.getElementById('media').style.filter=null;}catch(err){}}
document.getElementById('media').className='';});xhtml.animationReferences[animationTarget.getAttribute('animationId')].animate();document.getElementById('mediaVideos').className='';document.getElementById('mediaPhotos').className='invisible';}
this.layerVideosThumbnails=function()
{this.currentView.videos='thumbnails';this.layerVideos();this.unloadUploader('photos');this.unloadUploader('videos');document.getElementById('mediaVideosThumbnails').className='';document.getElementById('mediaVideosUpload').className='invisible';xhtml.scrollingRegionInit('mediaVideosThumbnails');}
this.layerVideosUpload=function()
{this.currentView.videos='upload';this.layerVideos();this.loadUploader('videos');document.getElementById('mediaVideosThumbnails').className='invisible';document.getElementById('mediaVideosUpload').className='';}
this.hideAll=function()
{var animationTarget=document.getElementById('media');try{xhtml.animationReferences[animationTarget.getAttribute('animationId')].stop(false);}catch(err){}
animationTarget.className='animation';xhtml.animationReferences[animationTarget.getAttribute('animationId')]=new YAHOO.util.Anim(animationTarget,{opacity:{to:0}},0.5);xhtml.animationReferences[animationTarget.getAttribute('animationId')].onComplete.subscribe(function()
{document.getElementById('media').className='invisible';});xhtml.animationReferences[animationTarget.getAttribute('animationId')].animate();}
this.photoUploaded=function()
{setTimeout("xhtml.media.reloadThumbnails();",100);setTimeout("xhtml.media.layerPhotosThumbnails();",750);}
this.videoUploaded=function()
{setTimeout("xhtml.media.reloadThumbnails();",100);setTimeout("xhtml.media.layerVideosThumbnails();",750);}
this.refreshUploaders=function()
{if(xhtml.media.currentView.type=='photos'&&xhtml.media.currentView.photos=='upload')
{var dayIndex=xhtml.location.getDateIndex();if(!!document.getElementById('iframePhotos')==false)
{document.getElementById('mediaPhotosUpload').innerHTML='<iframe id="iframePhotos" name="iframePhotos" src="module-photouploader.php?iShow="'+dayIndex+'" scrolling="no" frameborder="0" allowtransparency="true"></iframe>'+document.getElementById('mediaPhotosUpload').innerHTML;}
else
{frames['iframePhotos'].location.href="module-photouploader.php?iShow="+dayIndex;}}
if(xhtml.media.currentView.type=='videos'&&xhtml.media.currentView.videos=='upload')
{var dayIndex=xhtml.location.getDateIndex();if(!!document.getElementById('iframeVideos')==false)
{document.getElementById('mediaVideosUpload').innerHTML='<iframe id="iframeVideos" name="iframeVideos" src="module-videouploader.php?vShow="'+dayIndex+'" scrolling="no" frameborder="0" allowtransparency="true"></iframe>'+document.getElementById('mediaVideosUpload').innerHTML;}
else
{frames['iframeVideos'].location.href="module-videouploader.php?vShow="+dayIndex;}}}
this.loadUploader=function(type)
{switch(type)
{case'photos':var dayIndex=xhtml.location.getDateIndex();if(!!document.getElementById('iframePhotos')==false)
{document.getElementById('mediaPhotosUpload').innerHTML='<iframe id="iframePhotos" name="iframePhotos" src="module-photouploader.php?iShow="'+dayIndex+'" scrolling="no" frameborder="0" allowtransparency="true"></iframe>'+document.getElementById('mediaPhotosUpload').innerHTML;}
else
{frames['iframePhotos'].location.href="module-photouploader.php?iShow="+dayIndex;}
break;case'videos':var dayIndex=xhtml.location.getDateIndex();if(!!document.getElementById('iframeVideos')==false)
{document.getElementById('mediaVideosUpload').innerHTML='<iframe id="iframeVideos" name="iframeVideos" src="module-videouploader.php?vShow="'+dayIndex+'" scrolling="no" frameborder="0" allowtransparency="true"></iframe>'+document.getElementById('mediaVideosUpload').innerHTML;}
else
{frames['iframeVideos'].location.href="module-videouploader.php?vShow="+dayIndex;}
break;}}
this.unloadUploader=function(type)
{switch(type)
{case'photos':if(!!document.getElementById('iframePhotos')==true)
{frames['iframePhotos'].location.href="about:blank";}
break;case'videos':if(!!document.getElementById('iframeVideos')==true)
{frames['iframeVideos'].location.href="about:blank";}
break;}}
function _buildPhotosThumbnails(dataset)
{xhtml.media.dataset.photos=dataset;var html=[];if(typeof(dataset.username)!='undefined')
{html.push('<p class="username">Photos Uploaded by <b>'+dataset.username.replace(/<([^>]+)>/ig,'')+'</b><br class="clear"/></p>');}
if(0<dataset.length)
{for(var x=0;x<dataset.length;x++)
{html.push('<a href="javascript:;" onclick="xhtml.media.displayPhoto(\'\', \''+dataset[x].id+'\', \''+dataset[x].timestamp+'\', \''+dataset[x].title.replace(/\'/g,"\\u0027")+'\', \''+dataset[x].description.replace(/\'/g,"\\u0027")+'\', \''+dataset[x].credit.replace(/\'/g,"\\u0027")+'\', \''+dataset[x].username.replace(/\'/g,"\\u0027")+'\', true, \''+dataset[x].flickr+'\');"><img src="'+dataset[x].url+'" width="121" height="82" alt=""/></a>');}}
else
{if(typeof(dataset.username)=='undefined')
{html.push('<p class="noMedia"><b>No photos for this day as yet</b><br/><a href="javascript:;" onclick="xhtml.media.layerPhotosUpload();">be the first to upload a photo</a></p>');}}
document.getElementById('mediaPhotosThumbnailsArtboard').innerHTML=html.join("\n");if(xhtml.isTrident==false)
{var imgs=document.getElementById('mediaPhotosThumbnailsArtboard').getElementsByTagName('img');for(var x=imgs.length-1;0<=x;x--)
{YAHOO.util.Event.addListener(imgs[x],"mouseover",__eventHandlerThumbnailOver);}}
xhtml.scrollingRegionInit('mediaPhotosThumbnails');if(0<dataset.length)
{xhtml.viewer.navigationInit('photos',dataset);}
xhtml.media.timestamp.photos=dataset.timestamp;}
function _buildVideosThumbnails(dataset)
{xhtml.media.dataset.videos=dataset;var html=[];if(typeof(dataset.username)!='undefined')
{html.push('<p class="username">Videos Uploaded by <b>'+dataset.username.replace(/<([^>]+)>/ig,'')+'</b><br class="clear"/></p>');}
if(0<dataset.length)
{for(var x=0;x<dataset.length;x++)
{html.push('<a href="javascript:;" onclick="xhtml.media.displayVideo(\'\', \''+dataset[x].id+'\', \''+dataset[x].timestamp+'\', \''+dataset[x].title.replace(/\'/g,"\\u0027")+'\', \''+dataset[x].description.replace(/\'/g,"\\u0027")+'\', \''+dataset[x].credit.replace(/\'/g,"\\u0027")+'\', \''+dataset[x].username.replace(/\'/g,"\\u0027")+'\', true);"><img src="'+dataset[x].url+'" width="121" height="82" alt=""/></a>');}}
else
{if(typeof(dataset.username)=='undefined')
{html.push('<p class="noMedia"><b>No videos for this day as yet</b><br/><a href="javascript:;" onclick="xhtml.media.layerVideosUpload();">be the first to upload a video</a></p>');}}
document.getElementById('mediaVideosThumbnailsArtboard').innerHTML=html.join("\n");if(xhtml.isTrident==false)
{var imgs=document.getElementById('mediaVideosThumbnailsArtboard').getElementsByTagName('img');for(var x=imgs.length-1;0<=x;x--)
{YAHOO.util.Event.addListener(imgs[x],"mouseover",__eventHandlerThumbnailOver);}}
xhtml.scrollingRegionInit('mediaVideosThumbnails');if(0<dataset.length)
{xhtml.viewer.navigationInit('videos',dataset);}
xhtml.media.timestamp.videos=dataset.timestamp;}
function __eventHandlerThumbnailOver()
{if(!!document.getElementById('mediaThumbnailsOverlay')==true)
{document.getElementById('mediaThumbnailsOverlay').parentNode.removeChild(document.getElementById('mediaThumbnailsOverlay'));}
var overlay=new Image();overlay.src='images/media-thumbnail-overlay.png';overlay.id='mediaThumbnailsOverlay';overlay.onclick=this.parentNode.onclick;overlay.style.position='absolute';overlay.style.left=this.offsetLeft+'px';overlay.style.top=this.offsetTop+'px';overlay.style.cursor='pointer';overlay.onmouseout=__eventHandlerThumbnailOut;document.getElementById('mediaPhotosThumbnailsArtboard').appendChild(overlay);}
function __eventHandlerThumbnailOut()
{if(!!document.getElementById('mediaThumbnailsOverlay')==true)
{document.getElementById('mediaThumbnailsOverlay').parentNode.removeChild(document.getElementById('mediaThumbnailsOverlay'));}}
function __callbackPhotosThumbnailsContent(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{document.getElementById('mediaPhotosThumbnailsArtboard').innerHTML='<p class="loading">Sorry a server communication error occurred, please try reloading this page again.</p>';return;}
if(typeof(obj)=='object')
{for(var x=obj.length-1;0<=x;x--)
{obj[x].timestamp=strtotime(obj[x].timestamp);}
obj.timestamp=strtotime(obj.timestamp);_buildPhotosThumbnails(obj);}
else
{document.getElementById('mediaPhotosThumbnailsArtboard').innerHTML='<p class="loading">Sorry a server communication error occurred, please try reloading this page again.</p>';return;}}
function __callbackVideosThumbnailsContent(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{document.getElementById('mediaVideosThumbnailsArtboard').innerHTML='<p class="loading">Sorry a server communication error occurred, please try reloading this page again.</p>';return;}
if(typeof(obj)=='object')
{for(var x=obj.length-1;0<=x;x--)
{obj[x].timestamp=strtotime(obj[x].timestamp);}
obj.timestamp=strtotime(obj.timestamp);_buildVideosThumbnails(obj);}
else
{document.getElementById('mediaVideosThumbnailsArtboard').innerHTML='<p class="loading">Sorry a server communication error occurred, please try reloading this page again.</p>';return;}}}
function Text()
{var _instance=this;this.init=function()
{xhtml.scrollingRegionInit('textAbout');xhtml.scrollingRegionInit('textTerms');xhtml.scrollingRegionInit('textGuidelines');xhtml.scrollingRegionInit('textSquirrel');this.initLinkAnimation();xhtml.addAnimationId(document.getElementById('text'));}
this.display=function(name)
{YAHOO.util.Event.addListener(document,"keyup",__eventHandlerKeyboardNavigation);this.updateOverlay();xhtml.centerDiv(document.getElementById(name));document.getElementById(name).className='';}
this.hideAll=function()
{YAHOO.util.Event.addListener(document,"keyup",__eventHandlerKeyboardNavigation);document.getElementById('textBackground').className='invisible';document.getElementById('textBackground').style.height='1px';document.getElementById('textAbout').className='invisible';document.getElementById('textTerms').className='invisible';document.getElementById('textGuidelines').className='invisible';document.getElementById('textSquirrel').className='invisible';}
this.updateOverlay=function()
{var overlay=document.getElementById('textBackground');overlay.style.position='absolute';overlay.style.left='0px';overlay.style.top='0px';overlay.style.background='#000';overlay.style.opacity=0.6;overlay.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=60)';overlay.style.width=document.body.offsetWidth+'px';overlay.style.height=(719<document.documentElement.clientHeight?document.documentElement.clientHeight:719)+'px';overlay.className='';}
this.initLinkAnimation=function()
{var links=document.getElementById('globalFooter').getElementsByTagName('a');for(var x=links.length-1;0<=x;x--)
{xhtml.addAnimationId(links[x]);links[x].onmouseover=function()
{try{xhtml.animationReferences[this.getAttribute('animationId')].stop(false);}catch(err){}
xhtml.animationReferences[this.getAttribute('animationId')]=new YAHOO.util.ColorAnim(this,{color:{to:'#000000'}},0.3,YAHOO.util.Easing.easeBoth);xhtml.animationReferences[this.getAttribute('animationId')].animate();}
links[x].onmouseout=function()
{try{xhtml.animationReferences[this.getAttribute('animationId')].stop(false);}catch(err){}
xhtml.animationReferences[this.getAttribute('animationId')]=new YAHOO.util.ColorAnim(this,{color:{to:'#818181'}},0.9,YAHOO.util.Easing.easeBoth);xhtml.animationReferences[this.getAttribute('animationId')].animate();}}}
function __eventHandlerKeyboardNavigation(event)
{var event=!!event?event:window.event;switch(event.keyCode)
{case 27:xhtml.text.hideAll();break;}}}
function Timeline()
{var _instance=this;__timeline=this;var _DOTTED_LINE_LOCATION=526;this.initialized=false;this.rangeMin=0;this.rangeMax=0;this.position=0;this.beingDragged=false;this.beingScrolled=false;this.previousMouseX=0;this.dataset={loaded:{blog:false,story:false,media:false},raw:{blog:null,story:null,media:null}};this.init=function()
{var json=document.getElementById('jsonTimeline').innerHTML;__callbackTimelineSuccess({"responseText":json.substring(5,json.length-4)});document.getElementById('timelineArtboard').onselect=xhtml.emptyFunction;YAHOO.util.Event.addListener(document.body,"mousemove",__eventHandlerTimelineDragMove);YAHOO.util.Event.addListener(document.body,"mouseup",__eventHandlerTimelineDragEnd);}
this.loadCityItem=function(cityCode)
{if(this.initialized==false)
{return;}
xhtml.media.hideAll();xhtml.editorial.hideAll();var cityDiv=YAHOO.util.Dom.getElementsByClassName(cityCode,'div',document.getElementById('timelineContent'));if(cityDiv.length<1)
{_nonTimelineShowDate(cityCode);}
else
{this.loadDayItem(cityDiv[0],cityCode);}}
this.loadDayItem=function(obj,cityCode)
{if(this.initialized==false)
{return;}
xhtml.media.hideAll();xhtml.editorial.hideAll();if(cityCode!='none')
{_loadShowDate(obj,cityCode);}
else
{_loadRoadTripDate(obj);}}
this.loadHash=function(hash)
{var timelineScrolled=false;var dayItems=document.getElementById('timelineContent').getElementsByTagName('div');var dayObj=null;for(var x=dayItems.length-1;0<=x;x--)
{if(dayItems[x].getAttribute('timestamp')==hash.timestamp)
{dayObj=dayItems[x];break;}}
if(dayObj!=null)
{dayObj.className+=' active';}
var cityCode=xhtml.location.timestamp2citycode(hash.timestamp);if(dayObj!=null)
{var photoItems=YAHOO.util.Dom.getElementsByClassName('photo','img',dayObj);var videoItems=YAHOO.util.Dom.getElementsByClassName('video','img',dayObj);if(0<photoItems.length||0<videoItems.length)
{if(0<photoItems.length)
{xhtml.media.layerPhotosThumbnails();}
else
{xhtml.media.layerVideosThumbnails();}
xhtml.media.loadThumbnailsForDate('videos',hash.timestamp);xhtml.media.loadThumbnailsForDate('photos',hash.timestamp);var items=dayObj.getElementsByTagName('img');for(var x=0;x<items.length;x++)
{if(items[x].className.indexOf('photo')!=-1||items[x].className.indexOf('video')!=-1)
{this.scrollToItem((items[x].className.indexOf('photo')!=-1?'photo':'video'),items[x].className.replace(/\D/g,'')*1);timelineScrolled=true;break;}}}}
else if(cityCode!='none')
{xhtml.media.layerPhotosThumbnails();xhtml.media.loadThumbnailsForDate('videos',hash.timestamp);xhtml.media.loadThumbnailsForDate('photos',hash.timestamp);}
xhtml.editorial.loadBlog(hash.blog,(hash.editorial==1));xhtml.editorial.loadStory(hash.story,(hash.editorial==2));xhtml.editorial.loadInfo(hash.info);if(hash.editorial==1||hash.editorial==2)
{timelineScrolled=true;}
xhtml.editorial.initTimestamp(hash.timestamp,false);switch(hash.editorial)
{case 1:xhtml.editorial.layerBlog();break;case 2:xhtml.editorial.layerStory();break;case 3:xhtml.editorial.layerTwitter();break;case 4:xhtml.editorial.layerInfo();break;}
if(timelineScrolled==false)
{var hashDate=new Date(hash.timestamp);this.scrollToDate(hashDate.getFullYear(),hashDate.getMonth()+1,hashDate.getDate());}
xhtml.location.setDate(hash.timestamp);}
this.scrollToCity=function(cityCode)
{var artboard=document.getElementById('timelineArtboard');var cityDiv=YAHOO.util.Dom.getElementsByClassName(cityCode,'div',document.getElementById('timelineContent'));if(cityDiv.length<1)
{return;}
var itemLocation=cityDiv[0].getElementsByTagName('img')[0].offsetLeft+12;var cityLocation=cityDiv[0].offsetLeft;var newPosition=(cityLocation+itemLocation-_DOTTED_LINE_LOCATION)*-1;if(newPosition<xhtml.timeline.rangeMin)
{newPosition=xhtml.timeline.rangeMin;}
if(xhtml.timeline.rangeMax<newPosition)
{newPosition=xhtml.timeline.rangeMax;}
xhtml.timeline.beingScrolled=true;try{xhtml.animationReferences[artboard.getAttribute('animationId')].stop(false);}catch(err){}
xhtml.animationReferences[artboard.getAttribute('animationId')]=new YAHOO.util.Anim(artboard,{left:{to:newPosition}},1,YAHOO.util.Easing.easeBoth);xhtml.animationReferences[artboard.getAttribute('animationId')].onComplete.subscribe(function()
{xhtml.timeline.position=parseInt(document.getElementById('timelineArtboard').style.left);xhtml.timeline.beingScrolled=false;});xhtml.animationReferences[artboard.getAttribute('animationId')].animate();this.setCityActive(cityCode);}
this.scrollToDate=function(year,month,day)
{var artboard=document.getElementById('timelineArtboard');var dateClass='date'+year+''+(month<10?'0':'')+month+''+(day<10?'0':'')+day;var dateDiv=YAHOO.util.Dom.getElementsByClassName(dateClass,'div',document.getElementById('timelineContent'));if(dateDiv.length<1)
{return;}
var itemLocation=dateDiv[0].getElementsByTagName('img')[0].offsetLeft+12;var dateLocation=dateDiv[0].offsetLeft;var newPosition=(dateLocation+itemLocation-_DOTTED_LINE_LOCATION)*-1;if(newPosition<xhtml.timeline.rangeMin)
{newPosition=xhtml.timeline.rangeMin;}
if(xhtml.timeline.rangeMax<newPosition)
{newPosition=xhtml.timeline.rangeMax;}
xhtml.timeline.beingScrolled=true;try{xhtml.animationReferences[artboard.getAttribute('animationId')].stop(false);}catch(err){}
xhtml.animationReferences[artboard.getAttribute('animationId')]=new YAHOO.util.Anim(artboard,{left:{to:newPosition}},1,YAHOO.util.Easing.easeBoth);xhtml.animationReferences[artboard.getAttribute('animationId')].onComplete.subscribe(function()
{xhtml.timeline.position=parseInt(document.getElementById('timelineArtboard').style.left);xhtml.timeline.beingScrolled=false;});xhtml.animationReferences[artboard.getAttribute('animationId')].animate();}
this.scrollToItem=function(type,id)
{var artboard=document.getElementById('timelineArtboard');var itemNode=YAHOO.util.Dom.getElementsByClassName((type+id),'img',document.getElementById('timelineContent'));if(itemNode.length<1)
{return;}
var itemLocation=itemNode[0].offsetLeft+12;var dateItemLocation=itemNode[0].parentNode.offsetLeft;var newPosition=(dateItemLocation+itemLocation-_DOTTED_LINE_LOCATION)*-1;if(newPosition<xhtml.timeline.rangeMin)
{newPosition=xhtml.timeline.rangeMin;}
if(xhtml.timeline.rangeMax<newPosition)
{newPosition=xhtml.timeline.rangeMax;}
xhtml.timeline.beingScrolled=true;try{xhtml.animationReferences[artboard.getAttribute('animationId')].stop(false);}catch(err){}
xhtml.animationReferences[artboard.getAttribute('animationId')]=new YAHOO.util.Anim(artboard,{left:{to:newPosition}},1,YAHOO.util.Easing.easeBoth);xhtml.animationReferences[artboard.getAttribute('animationId')].onComplete.subscribe(function()
{xhtml.timeline.position=parseInt(document.getElementById('timelineArtboard').style.left);xhtml.timeline.beingScrolled=false;});xhtml.animationReferences[artboard.getAttribute('animationId')].animate();}
this.processDragTimeline=function(event)
{if(event.button!=1&&event.which!=1)
{xhtml.timeline.beingDragged=false;return;}
if(xhtml.isTrident==true)
{var mouseX=window.event.clientX;}
else
{var mouseX=event.pageX;}
xhtml.timeline.position=(((mouseX*1)-(xhtml.timeline.previousMouseX*1))*1)+(xhtml.timeline.position*1);xhtml.timeline.previousMouseX=mouseX;if(xhtml.timeline.position<xhtml.timeline.rangeMin)
{xhtml.timeline.position=xhtml.timeline.rangeMin;}
if(xhtml.timeline.rangeMax<xhtml.timeline.position)
{xhtml.timeline.position=xhtml.timeline.rangeMax;}
document.getElementById('timelineArtboard').style.left=xhtml.timeline.position+'px';}
this.processScrollLeft=function()
{var artboard=document.getElementById('timelineArtboard');xhtml.timeline.beingScrolled=true;try{xhtml.animationReferences[artboard.getAttribute('animationId')].stop(false);}catch(err){}
xhtml.timeline.position=parseInt(document.getElementById('timelineArtboard').style.left);var newPosition=xhtml.timeline.position-300;if(newPosition<xhtml.timeline.rangeMin)
{newPosition=xhtml.timeline.rangeMin;}
if(xhtml.timeline.rangeMax<newPosition)
{newPosition=xhtml.timeline.rangeMax;}
xhtml.animationReferences[artboard.getAttribute('animationId')]=new YAHOO.util.Anim(artboard,{left:{to:newPosition}},0.6,YAHOO.util.Easing.easeOut);xhtml.animationReferences[artboard.getAttribute('animationId')].onComplete.subscribe(function()
{xhtml.timeline.position=parseInt(document.getElementById('timelineArtboard').style.left);xhtml.timeline.beingScrolled=false;});xhtml.animationReferences[artboard.getAttribute('animationId')].animate();}
this.processScrollRight=function()
{var artboard=document.getElementById('timelineArtboard');xhtml.timeline.beingScrolled=true;try{xhtml.animationReferences[artboard.getAttribute('animationId')].stop(false);}catch(err){}
xhtml.timeline.position=parseInt(document.getElementById('timelineArtboard').style.left);var newPosition=xhtml.timeline.position+300;if(newPosition<xhtml.timeline.rangeMin)
{newPosition=xhtml.timeline.rangeMin;}
if(xhtml.timeline.rangeMax<newPosition)
{newPosition=xhtml.timeline.rangeMax;}
xhtml.animationReferences[artboard.getAttribute('animationId')]=new YAHOO.util.Anim(artboard,{left:{to:newPosition}},0.6,YAHOO.util.Easing.easeOut);xhtml.animationReferences[artboard.getAttribute('animationId')].onComplete.subscribe(function()
{xhtml.timeline.position=parseInt(document.getElementById('timelineArtboard').style.left);xhtml.timeline.beingScrolled=false;});xhtml.animationReferences[artboard.getAttribute('animationId')].animate();}
this.processDisplayItem=function(obj,type,id,cityCode,timestamp,title,desc,credit,username)
{timestamp=trimTime(timestamp);this.scrollToItem(type,id);var divs=document.getElementById('timelineContent').getElementsByTagName('div');for(var x=divs.length-1;0<=x;x--)
{divs[x].className=divs[x].className.replace(/\bactive\b/g,'');}
obj.parentNode.className+=' active';xhtml.location.setDate(timestamp);switch(type)
{case'blog':xhtml.editorial.initTimestamp(timestamp);xhtml.editorial.loadBlog(id);xhtml.editorial.layerBlog();if(xhtml.editorial.isStory(timestamp)!=-1)
{xhtml.editorial.loadStory(xhtml.editorial.isStory(timestamp));}
if(xhtml.editorial.isInfo(timestamp)!=-1)
{xhtml.editorial.loadInfo(xhtml.editorial.isInfo(timestamp));}
if(cityCode!='none')
{xhtml.media.loadThumbnailsForDate('videos',timestamp);xhtml.media.loadThumbnailsForDate('photos',timestamp);xhtml.media.layerPhotosThumbnails();}
break;case'story':xhtml.editorial.initTimestamp(timestamp);xhtml.editorial.loadStory(id);xhtml.editorial.layerStory();if(xhtml.editorial.isBlog(timestamp)!=-1)
{xhtml.editorial.loadBlog(xhtml.editorial.isBlog(timestamp));}
if(xhtml.editorial.isInfo(timestamp)!=-1)
{xhtml.editorial.loadInfo(xhtml.editorial.isInfo(timestamp));}
if(cityCode!='none')
{xhtml.media.loadThumbnailsForDate('videos',timestamp);xhtml.media.loadThumbnailsForDate('photos',timestamp);xhtml.media.layerPhotosThumbnails();}
break;case'photo':case'video':switch(type)
{case'photo':xhtml.media.displayPhoto(cityCode,id,timestamp,title,desc,credit,username,false,true);break;case'video':xhtml.media.displayVideo(cityCode,id,timestamp,title,desc,credit,username,false);break;}
xhtml.editorial.initTimestamp(timestamp);var initialEditorialView='twitter';if(xhtml.editorial.isInfo(timestamp)!=-1)
{initialEditorialView='info';xhtml.editorial.loadInfo(xhtml.editorial.isInfo(timestamp));}
if(xhtml.editorial.isStory(timestamp)!=-1)
{initialEditorialView='story';xhtml.editorial.loadStory(xhtml.editorial.isStory(timestamp));}
if(xhtml.editorial.isBlog(timestamp)!=-1)
{initialEditorialView='blog';xhtml.editorial.loadBlog(xhtml.editorial.isBlog(timestamp));}
if(cityCode=='none')
{if(initialEditorialView=='blog')
{xhtml.editorial.layerBlog();}}
else
{switch(initialEditorialView)
{case'blog':xhtml.editorial.layerBlog();break;case'story':xhtml.editorial.layerStory();break;case'twitter':xhtml.editorial.layerTwitter();break;case'info':xhtml.editorial.layerInfo();break;}}
break;}}
this.setCityActive=function(cityCode)
{if(_instance.initialized==false)
{return;}
var divs=document.getElementById('timelineContent').getElementsByTagName('div');for(var x=divs.length-1;0<=x;x--)
{divs[x].className=divs[x].className.replace(/\bactive\b/g,'');}
var cityDivs=YAHOO.util.Dom.getElementsByClassName(cityCode,'div',document.getElementById('timelineContent'));if(cityDivs.length<1)
{return;}
for(var x=cityDivs.length-1;0<=x;x--)
{cityDivs[x].className+=' active';}}
this.processDataset=function(type,dataset)
{this.dataset.loaded[type]=true;this.dataset.raw[type]=dataset;if(this.dataset.loaded.blog==true&&this.dataset.loaded.story==true&&this.dataset.loaded.media==true)
{var source=[];var types=['blog','story','media'];for(var x=2;0<=x;x--)
{for(var y=this.dataset.raw[types[x]].length-1;0<=y;y--)
{source.push(this.dataset.raw[types[x]][y]);}}
source.sort(__sortFuncDatasetTimestamp);_buildTimeline(source);}}
this.initLinkAnimation=function()
{var links=document.getElementById('timelineContent').getElementsByTagName('a');for(var x=links.length-1;0<=x;x--)
{xhtml.addAnimationId(links[x]);links[x].onmouseover=function()
{try{xhtml.animationReferences[this.getAttribute('animationId')].stop(false);}catch(err){}
xhtml.animationReferences[this.getAttribute('animationId')]=new YAHOO.util.ColorAnim(this,{color:{to:'#87B4D6'}},0.3,YAHOO.util.Easing.easeBoth);xhtml.animationReferences[this.getAttribute('animationId')].animate();}
links[x].onmouseout=function()
{try{xhtml.animationReferences[this.getAttribute('animationId')].stop(false);}catch(err){}
xhtml.animationReferences[this.getAttribute('animationId')]=new YAHOO.util.ColorAnim(this,{color:{to:'#FFFFFF'}},0.9,YAHOO.util.Easing.easeBoth);xhtml.animationReferences[this.getAttribute('animationId')].animate();}}}
this.initTimelineTooltips=function()
{var images=document.getElementById('timelineContent').getElementsByTagName('img');for(var x=images.length-1;0<=x;x--)
{var tooltip=new YAHOO.widget.Tooltip("timelineThumbnail"+x,{context:images[x]});}}
function _loadShowDate(obj,cityCode)
{var timestamp=trimTime(obj.getAttribute('timestamp')*1);var blogItems=YAHOO.util.Dom.getElementsByClassName('blog','img',obj);var storyItems=YAHOO.util.Dom.getElementsByClassName('story','img',obj);var photoItems=YAHOO.util.Dom.getElementsByClassName('photo','img',obj);var videoItems=YAHOO.util.Dom.getElementsByClassName('video','img',obj);var infoItem=xhtml.editorial.isInfo(timestamp);var initialEditorialView='twitter';var initialMediaView='photos';var initialItem=null;if(0<blogItems.length)
{initialItem=blogItems[0];initialEditorialView='blog';}
else if(0<storyItems.length)
{initialItem=storyItems[0];initialEditorialView='story';}
else if(0<photoItems.length)
{initialMediaView='photos';}
else if(0<videoItems.length)
{initialMediaView='videos';}
else
{console.warn('Timeline: Load Show Date - No initial item for show date found');}
if(xhtml.editorial.isInfo(timestamp)!=-1)
{initialEditorialView='info';}
xhtml.editorial.initTimestamp(timestamp);if(initialItem==null)
{if(0<blogItems.length&&initialEditorialView!='blog')
{xhtml.editorial.loadBlog(blogItems[0].className.replace(/\D/g,''));}
else
{xhtml.editorial.loadBlog(xhtml.editorial.isBlog(timestamp,false));}
if(0<storyItems.length&&initialEditorialView!='story')
{xhtml.editorial.loadStory(storyItems[0].className.replace(/\D/g,''));}
if(infoItem!=-1)
{xhtml.editorial.loadInfo(infoItem);}}
switch(initialEditorialView)
{case'blog':xhtml.editorial.layerBlog();break;case'story':xhtml.editorial.layerStory();break;case'twitter':xhtml.editorial.layerTwitter();break;case'info':xhtml.editorial.layerInfo();break;}
switch(initialMediaView)
{case'photos':xhtml.media.loadThumbnailsForDate('videos',timestamp);xhtml.media.loadThumbnailsForDate('photos',timestamp);xhtml.media.layerPhotosThumbnails();break;case'videos':xhtml.media.loadThumbnailsForDate('photos',timestamp);xhtml.media.loadThumbnailsForDate('videos',timestamp);xhtml.media.layerVideosThumbnails();break;}
if(initialItem!=null)
{initialItem.onclick();}
else
{xhtml.timeline.scrollToCity(cityCode);xhtml.location.setDate(timestamp);}}
function _loadRoadTripDate(obj)
{var timestamp=trimTime(obj.getAttribute('timestamp')*1);var blogItems=YAHOO.util.Dom.getElementsByClassName('blog','img',obj);var photoItems=YAHOO.util.Dom.getElementsByClassName('photo','img',obj);var videoItems=YAHOO.util.Dom.getElementsByClassName('video','img',obj);if(0<blogItems.length)
{xhtml.editorial.initTimestamp(timestamp);blogItems[0].onclick();xhtml.editorial.layerBlog();if(0<photoItems.length||0<videoItems.length)
{if(0<photoItems.length)
{xhtml.media.layerPhotosThumbnails();}
else
{xhtml.media.layerVideosThumbnails();}
xhtml.media.loadThumbnailsForDate('videos',timestamp);xhtml.media.loadThumbnailsForDate('photos',timestamp);}
return;}
else
{xhtml.editorial.loadBlog(xhtml.editorial.isBlog(timestamp,false));}
var initialItem=null;var initialMediaType=null;if(0<photoItems.length||0<videoItems.length)
{if(0<photoItems.length)
{initialItem=photoItems[0];initialMediaType='photo';}
else
{initialItem=videoItems[0];initialMediaType='video';}
xhtml.media.loadThumbnailsForDate('videos',timestamp);xhtml.media.loadThumbnailsForDate('photos',timestamp);switch(initialMediaType)
{case'photo':xhtml.media.layerPhotosThumbnails();break;case'video':xhtml.media.layerVideosThumbnails();break;}
var divs=document.getElementById('timelineContent').getElementsByTagName('div');for(var x=divs.length-1;0<=x;x--)
{divs[x].className=divs[x].className.replace(/\bactive\b/g,'');}
obj.className+=' active';xhtml.timeline.scrollToItem(initialMediaType,initialItem.className.replace(/\D/g,''));xhtml.location.setDate(timestamp);}}
function _nonTimelineShowDate(cityCode)
{var timestamp=xhtml.location.citycode2timestamp(cityCode);var blogItem=xhtml.editorial.isBlog(timestamp);var storyItem=xhtml.editorial.isStory(timestamp);var infoItem=xhtml.editorial.isInfo(timestamp);var initialEditorialView='twitter';if(blogItem!=-1)
{initialEditorialView='blog';}
else if(storyItem!=-1)
{initialEditorialView='story';}
else if(infoItem!=-1)
{initialEditorialView='info';}
xhtml.editorial.initTimestamp(timestamp);if(blogItem!=-1)
{xhtml.editorial.loadBlog(blogItem);}
if(storyItem!=-1)
{xhtml.editorial.loadStory(storyItem);}
if(infoItem!=-1)
{xhtml.editorial.loadInfo(infoItem);}
switch(initialEditorialView)
{case'blog':xhtml.editorial.layerBlog();break;case'story':xhtml.editorial.layerStory();break;case'twitter':xhtml.editorial.layerTwitter();break;case'info':xhtml.editorial.layerInfo();break;}
xhtml.media.loadThumbnailsForDate('videos',timestamp);xhtml.media.loadThumbnailsForDate('photos',timestamp);xhtml.location.setDate(timestamp);var divs=document.getElementById('timelineContent').getElementsByTagName('div');var scrollPastDay=null;for(var x=0;x<divs.length;x++)
{divs[x].className=divs[x].className.replace(/\bactive\b/g,'');if((divs[x].getAttribute("timestamp")*1)<timestamp)
{scrollPastDay=divs[x];}}
if(scrollPastDay!=null)
{var cityWidth=scrollPastDay.offsetWidth;var cityLocation=scrollPastDay.offsetLeft;var newPosition=(cityLocation+cityWidth-_DOTTED_LINE_LOCATION)*-1;if(newPosition<xhtml.timeline.rangeMin)
{newPosition=xhtml.timeline.rangeMin;}
if(xhtml.timeline.rangeMax<newPosition)
{newPosition=xhtml.timeline.rangeMax;}
xhtml.timeline.beingScrolled=true;var artboard=document.getElementById('timelineArtboard');try{xhtml.animationReferences[artboard.getAttribute('animationId')].stop(false);}catch(err){}
xhtml.animationReferences[artboard.getAttribute('animationId')]=new YAHOO.util.Anim(artboard,{left:{to:newPosition}},1,YAHOO.util.Easing.easeBoth);xhtml.animationReferences[artboard.getAttribute('animationId')].onComplete.subscribe(function()
{xhtml.timeline.position=parseInt(document.getElementById('timelineArtboard').style.left);xhtml.timeline.beingScrolled=false;});xhtml.animationReferences[artboard.getAttribute('animationId')].animate();}}
function _buildTimeline(dataset)
{var monthNamesLong=['January','February','March','April','May','June','July','August','September','October','November','December'];var previousDay=-1;var daysRendered=0;var html=[];html.push('<div id="timelineContent">');html.push('<span>');for(var x=0,itemDate=null,currentDay=null,itemTimestamp=null;x<dataset.length;x++)
{itemTimestamp=trimTime(dataset[x].timestamp);itemDate=new Date(itemTimestamp);currentDay=itemDate.getDate();if(dataset[x].type!='story')
{dataset[x].cityCode=xhtml.location.timestamp2citycode(dataset[x].timestamp);}
if(currentDay!=previousDay)
{previousDay=currentDay;if(0<daysRendered)
{html.push('</div>');}
html.push('<div class="dayItem '+dataset[x].cityCode+' date'+_createDateString(dataset[x].timestamp)+'" timestamp="'+itemTimestamp+'">');if(dataset[x].cityCode!='none')
{html.push('<h3 onclick="xhtml.timeline.loadDayItem(this.parentNode, \''+dataset[x].cityCode+'\');"><span><a href="javascript:;">'+xhtml.location.getFullCityName(dataset[x].cityCode)+'</a> // </span>&nbsp;'+monthNamesLong[itemDate.getMonth()]+' '+itemDate.getDate()+', '+itemDate.getFullYear()+'</h3><br class="clear"/>');}
else
{html.push('<h3 onclick="xhtml.timeline.loadDayItem(this.parentNode, \'none\');">'+monthNamesLong[itemDate.getMonth()]+' '+itemDate.getDate()+', '+itemDate.getFullYear()+'</h3><br class="clear"/>');}
daysRendered++;}
switch(dataset[x].type)
{case'blog':var tooltip='<span><b><span>'+xhtml.timeFormattedShort(new Date(dataset[x].timestamp))+'</span> Blog Entry</b><br/>'+dataset[x].title.replace(/\'/g,"\\u0027").replace(/<([^>]|\n)*>/g,'')+'</span>';html.push('<img class="'+dataset[x].type+' '+dataset[x].type+dataset[x].id+'" src="'+dataset[x].url+'" onclick="xhtml.timeline.processDisplayItem(this,\''+dataset[x].type+'\', \''+dataset[x].id+'\', \''+dataset[x].cityCode+'\', \''+dataset[x].timestamp+'\', \'\', \'\', \'\');" alt="'+dataset[x].tooltip.replace(/\'/g,"\\u0027").replace(/<([^>]|\n)*>/g,'')+'" title="'+tooltip+'"/>');break;case'story':var tooltip='<span><b><span>'+xhtml.timeFormattedShort(new Date(dataset[x].timestamp))+'</span> Host Story</b><br/>'+dataset[x].title.replace(/\'/g,"\\u0027").replace(/<([^>]|\n)*>/g,'')+'</span>';html.push('<img class="'+dataset[x].type+' '+dataset[x].type+dataset[x].id+'" src="'+dataset[x].url+'" onclick="xhtml.timeline.processDisplayItem(this,\''+dataset[x].type+'\', \''+dataset[x].id+'\', \''+dataset[x].cityCode+'\', \''+dataset[x].timestamp+'\', \'\', \'\', \'\');" alt="'+dataset[x].tooltip.replace(/\'/g,"\\u0027").replace(/<([^>]|\n)*>/g,'')+'" title="'+tooltip+'"/>');break;case'photo':var tooltip='<span><b><span>'+xhtml.timeFormattedShort(new Date(dataset[x].timestamp))+'</span> Photo</b><br/>'+dataset[x].title.replace(/\'/g,"\\u0027").replace(/<([^>]|\n)*>/g,'')+'</span>';html.push('<img class="'+dataset[x].type+' '+dataset[x].type+dataset[x].id+'" src="'+dataset[x].url+'" onclick="xhtml.timeline.processDisplayItem(this,\''+dataset[x].type+'\', \''+dataset[x].id+'\', \''+dataset[x].cityCode+'\', \''+dataset[x].timestamp+'\', \''+dataset[x].title.replace(/\'/g,"\\u0027")+'\', \''+dataset[x].description.replace(/\'/g,"\\u0027")+'\', \''+dataset[x].credit.replace(/\'/g,"\\u0027")+'\', \''+dataset[x].username+'\');" alt="'+dataset[x].tooltip.replace(/\'/g,"\\u0027").replace(/<([^>]|\n)*>/g,'')+'" title="'+tooltip+'"/>');break;case'video':var tooltip='<span><b><span>'+xhtml.timeFormattedShort(new Date(dataset[x].timestamp))+'</span> Video</b><br/>'+dataset[x].title.replace(/\'/g,"\\u0027").replace(/<([^>]|\n)*>/g,'')+'</span>';html.push('<img class="'+dataset[x].type+' '+dataset[x].type+dataset[x].id+'" src="'+dataset[x].url+'" onclick="xhtml.timeline.processDisplayItem(this,\''+dataset[x].type+'\', \''+dataset[x].id+'\', \''+dataset[x].cityCode+'\', \''+dataset[x].timestamp+'\', \''+dataset[x].title.replace(/\'/g,"\\u0027")+'\', \''+dataset[x].description.replace(/\'/g,"\\u0027")+'\', \''+dataset[x].credit.replace(/\'/g,"\\u0027")+'\', \''+dataset[x].username+'\');" alt="'+dataset[x].tooltip.replace(/\'/g,"\\u0027").replace(/<([^>]|\n)*>/g,'')+'" title="'+tooltip+'"/>');break;}}
html.push('</div>');html.push('</span>');html.push('</div>');document.getElementById('timelineArtboard').innerHTML=html.join("\n");setTimeout("__timeline.initTimelineTooltips();",1000);_makeDraggableScrollable();_instance.initialized=true;xhtml.readUrlHash();}
function _makeDraggableScrollable()
{var contentWidth=document.getElementById('timelineContent').getElementsByTagName('span')[0].offsetWidth;xhtml.timeline.rangeMin=(contentWidth-_DOTTED_LINE_LOCATION)*-1;xhtml.timeline.rangeMax=_DOTTED_LINE_LOCATION;document.getElementById('timelineArtboard').style.left='0px';xhtml.addAnimationId(document.getElementById('timelineArtboard'));document.getElementById('timelineContent').ondragstart=function(){return false;}
document.getElementById('timelineContent').onmousedown=function(){return false;}
YAHOO.util.Event.addListener(document.getElementById('timelineContent'),"mousedown",__eventHandlerTimelineDragStart);YAHOO.util.Event.addListener(document.getElementById('timelineContent'),"mousewheel",__eventHandlerTimelineMouseWheel);YAHOO.util.Event.addListener(document.getElementById('timelineContent'),"DOMMouseScroll",__eventHandlerTimelineMouseWheel);}
function _createDateString(timestamp)
{var dateObj=new Date(timestamp*1);return dateObj.getFullYear()+''+((dateObj.getMonth()+1)<10?'0':'')+(dateObj.getMonth()+1)+''+(dateObj.getDate()<10?'0':'')+dateObj.getDate();}
function __eventHandlerTimelineDragStart(event)
{if(xhtml.timeline.beingDragged==true||xhtml.timeline.beingScrolled==true)
{return;}
xhtml.timeline.beingDragged=true;xhtml.disableTextSelection();event=!!event?event:window.event;if(xhtml.isTrident==true)
{xhtml.timeline.previousMouseX=window.event.clientX;}
else
{xhtml.timeline.previousMouseX=event.pageX;}}
function __eventHandlerTimelineDragMove(event)
{if(xhtml.timeline.beingDragged==false||xhtml.timeline.beingScrolled==true)
{return;}
xhtml.timeline.processDragTimeline(!!event?event:window.event);}
function __eventHandlerTimelineDragEnd()
{xhtml.timeline.beingDragged=false;xhtml.enableTextSelection();}
function __eventHandlerTimelineMouseWheel(event)
{!!event?event:window.event
var delta=0;if(event.wheelDelta)
{delta=event.wheelDelta/120;if(window.opera)
{delta*=-1;}}
else if(event.detail)
{delta=-event.detail/3;}
if(delta!=0)
{if(delta<0)
{xhtml.timeline.processScrollLeft();}
else
{xhtml.timeline.processScrollRight();}}
__eventHandlerCancelBubbleAndDefault(event);}
function __eventHandlerCancelBubble(event)
{!!event?event:window.event;event.cancelBubble=true;if(event.stopPropagation)
{event.stopPropagation();}}
function __eventHandlerCancelBubbleAndDefault(event)
{!!event?event:window.event;event.cancelBubble=true;if(event.stopPropagation)
{event.stopPropagation();}
if(event.preventDefault)
{event.preventDefault();}
event.returnValue=false;}
function __callbackTimelineSuccess(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{alert('Sorry a server communication error occurred, please try reloading this page again.');return;}
if(typeof(obj)=='object'&&obj.timeline)
{for(var x=obj.timeline.length-1;0<=x;x--)
{if(obj.timeline[x].timestamp=='undefined')throw("no timestamp");obj.timeline[x].timestamp=strtotime(obj.timeline[x].timestamp);}
xhtml.timeline.processDataset('media',obj.timeline);}
else
{alert('Sorry a server communication error occurred, please try reloading this page again.');return;}}
function __callbackTimelineFailure(callbackObj)
{alert('Sorry a server communication error occurred, please try reloading this page again.');return;}
function __sortFuncDatasetTimestamp(itemA,itemB)
{if(itemA.timestamp>itemB.timestamp)return 1;if(itemA.timestamp<itemB.timestamp)return-1;return 0;}}
function Viewer()
{var _instance=this;this.navigation={photos:{current:null,dataset:null},videos:{current:null,dataset:null},type:'none'}
this.displayed={photo:{id:'',title:'',description:'',credit:'',username:'',flickr:''},video:{id:'',title:'',description:'',credit:'',username:''}}
this.keyboardShortcutsEnabled=true;this.init=function()
{this.spinner=new Image();this.spinner.src='/images/viewer-elements-loading.gif';xhtml.addAnimationId(document.getElementById('viewer'));}
this.displayPhoto=function(id,title,description,credit,username,flickr)
{if(xhtml.isTrident6==true)
{var flickrContent='';if(5<arguments.length&&parseBoolean(flickr)==true)
{flickrContent='&flickr=1';}
var viewer=window.open('http://www.30daysontheroad.com/image.html?imageId='+id+'&view=zoomed'+flickrContent,'thirtydayssigurros'+(new Date()).getTime());return;}
switch(arguments.length)
{case 0:return;case 1:var title='';case 2:var description='';case 3:var credit='';case 4:var username='';case 5:var flickr=false;}
this.navigation.photos.current=id;this.displayed.photo={id:id,title:title,description:description,credit:credit,username:username,flickr:flickr}
document.getElementById('viewerPhotos').style.width='400px';document.getElementById('viewerPhotos').style.marginLeft='-210px';var html=[];html.push('<div id="viewerPhotosBodyContent" style="height: 200px; overflow: hidden">');var flickrContent='';if(5<arguments.length&&parseBoolean(flickr)==true)
{flickrContent='&flickr=1';}
html.push('<div class="wrapper"><img style="visibility: hidden" src="image.html?imageId='+id+'&view=zoomed'+flickrContent+'" alt="" onload="xhtml.viewer.positionPhotoViewer();" onclick="xhtml.viewer.navigationNext(\'photos\');"/></div>');html.push('</div>');html.push('<div class="detailsView">');html.push('<h3>'+(!!title?title.replace(/<([^>]+)>/ig,''):'')+'</h3>');html.push('<h6>'+(!!credit?credit.replace(/<([^>]+)>/ig,''):'')+'</h6>');html.push('<p>'+(!!description?description.replace(/<([^>]+)>/ig,''):'')+'</p>');html.push('</div>');html.push('<div id="viewerPhotosBodyComments">');html.push('<div class="content">');html.push('<div id="viewerPhotosBodyCommentsArtboard">');html.push('<h4>Comments</h4>');html.push('<div id="viewerPhotosBodyCommentsItems">');html.push('<div class="commentItem">');html.push('<p>Loading Comments...</p>');html.push('</div>');html.push('</div>');html.push('<div class="commentsForm">');html.push('<h5><img src="images/editorial-heading-leaveacomment.png" width="136" height="22" alt=""/></h5>');html.push('<p>You must be logged in to comment, please <a href="javascript:;" onclick="xhtml.auth.accountCreateOpen();">Sign Up</a> or <a href="javascript:;" onclick="xhtml.auth.accountLoginOpen();">Login</a> to continue</p>')
html.push('<form id="viewerPhotosBodyCommentForm" action="javascript:;" method="post" onsubmit="xhtml.viewer.addPhotoComment('+id+'); return false;">');html.push('<fieldset>');html.push('<input type="hidden" name="action" value="add"/>');html.push('<input type="hidden" name="type" value="'+((parseBoolean(flickr)==true)?'flickr':'photo')+'"/>');html.push('<input type="hidden" name="id" value="'+id+'"/>');html.push('<textarea name="comment" rows="80" cols="40" onfocus="this.style.background=\'#fff\'; xhtml.viewer.disableShortcuts();" onblur="xhtml.viewer.enableShortcuts();"></textarea>');html.push('<input type="image" class="hasRollover" src="images/editorial-button-submit.png" alt="Submit"/>');html.push('<br class="clear"/>');html.push('</fieldset>');html.push('</form>');html.push('</div>');html.push('</div>');html.push('</div>');html.push('</div>');if(xhtml.auth.isLoggedIn()==true&&((xhtml.auth.getUsername()).replace(/\s+/g,'')).toLowerCase()==(username.replace(/\s+/g,'')).toLowerCase())
{html.push('<div class="detailsEdit">');html.push('<h3>Edit Photo Details</h3>');html.push('<form id="viewerPhotosForm" action="#" method="post" onsubmit="xhtml.viewer.processMediaEdit(\'photos\', \'viewerPhotosForm\'); return false;">');html.push('<fieldset>');html.push('<input type="hidden" name="action" value="edit"/>');html.push('<input type="hidden" name="type" value="'+((parseBoolean(flickr)==true)?'flickr':'photo')+'"/>');html.push('<input type="hidden" name="id" value="'+id+'"/>');html.push('<label><b>Title <cite>*</cite></b></label>');html.push('<input class="text" name="title" value="'+(!!title?title.replace(/<([^>]+)>/ig,''):'')+'" maxlength="128" onfocus="xhtml.viewer.disableShortcuts();" onblur="xhtml.viewer.enableShortcuts();"/>');html.push('<br class="clear"/>');html.push('<label><b>Description</b></label>');html.push('<input class="text" name="desc" value="'+(!!description?description.replace(/<([^>]+)>/ig,''):'')+'" maxlength="768" onfocus="xhtml.viewer.disableShortcuts();" onblur="xhtml.viewer.enableShortcuts();"/>');html.push('<br class="clear"/>');html.push('<label><b>Credit</b></label>');html.push('<input class="text" name="credit" value="'+(!!credit?credit.replace(/<([^>]+)>/ig,''):'')+'" maxlength="128" onfocus="xhtml.viewer.disableShortcuts();" onblur="xhtml.viewer.enableShortcuts();"/>');html.push('<br class="clear"/>');html.push('<a class="save" href="javascript:;" onclick="xhtml.viewer.processMediaEdit(\'photos\', \'viewerPhotosForm\');"></a>');html.push('<a class="delete" href="javascript:;" onclick="if(confirm(\'Are you sure you wish to delete this photo?\'))xhtml.viewer.processMediaDelete(\'photos\','+id+');"></a>');html.push('<br class="clear"/>');html.push('</fieldset>');html.push('</form>');html.push('</div>');}
document.getElementById('viewerPhotosBody').innerHTML=html.join("\n");YAHOO.util.Event.addListener(document.getElementById('viewerPhotosBodyContent').getElementsByTagName('img')[0],"load",this.positionPhotoViewer);YAHOO.util.Event.addListener(document,"keyup",__eventHandlerKeyboardNavigation);document.getElementById('html').className='fixed';document.getElementById('viewerPhotos').style.height='auto';document.getElementById('viewerPhotos').className='';this.updateOverlay();window.scrollTo(0,0);this.navigationInit('photos');this.navigation.type='photos';xhtml.initInputButtons();YAHOO.util.Connect.asyncRequest("GET","ajax-comments.php?action=list&type="+((parseBoolean(flickr)==true)?'flickr':'photo')+"&id="+id+"&random="+(new Date()).getTime(),{success:__callbackPhotoComments});}
this.displayVideo=function(id,title,description,credit,username)
{switch(arguments.length)
{case 0:return;case 1:var title='';case 2:var description='';case 3:var credit='';case 4:var username='';}
this.navigation.videos.current=id;this.displayed.video={id:id,title:title,description:description,credit:credit,username:username}
var html=[];html.push('<div id="viewerVideosBodyContent">&nbsp;</div>');html.push('<div class="detailsView">');html.push('<h3>'+(!!title?title.replace(/<([^>]+)>/ig,''):'')+'</h3>');html.push('<h6>'+(!!credit?credit.replace(/<([^>]+)>/ig,''):'')+'</h6>');html.push('<p>'+(!!description?description.replace(/<([^>]+)>/ig,''):'')+'</p>');html.push('</div>');html.push('<div id="viewerVideosBodyComments">');html.push('<div class="content">');html.push('<div id="viewerVideosBodyCommentsArtboard">');html.push('<h4>Comments</h4>');html.push('<div id="viewerVideosBodyCommentsItems">');html.push('<div class="commentItem">');html.push('<p>Loading Comments...</p>');html.push('</div>');html.push('</div>');html.push('<div class="commentsForm">');html.push('<h5><img src="images/editorial-heading-leaveacomment.png" width="136" height="22" alt=""/></h5>');html.push('<p>You must be logged in to comment, please <a href="javascript:;" onclick="xhtml.auth.accountCreateOpen();">Sign Up</a> or <a href="javascript:;" onclick="xhtml.auth.accountLoginOpen();">Login</a> to continue</p>')
html.push('<form id="viewerVideosBodyCommentForm" action="javascript:;" method="post" onsubmit="xhtml.viewer.addVideoComment('+id+'); return false;">');html.push('<fieldset>');html.push('<input type="hidden" name="action" value="add"/>');html.push('<input type="hidden" name="type" value="video"/>');html.push('<input type="hidden" name="id" value="'+id+'"/>');html.push('<textarea name="comment" rows="80" cols="40" onfocus="this.style.background=\'#fff\'; xhtml.viewer.disableShortcuts();" onblur="xhtml.viewer.enableShortcuts();"></textarea>');html.push('<input type="image" class="hasRollover" src="images/editorial-button-submit.png" alt="Submit"/>');html.push('<br class="clear"/>');html.push('</fieldset>');html.push('</form>');html.push('</div>');html.push('</div>');html.push('</div>');html.push('</div>');if(xhtml.auth.isLoggedIn()==true&&((xhtml.auth.getUsername()).replace(/\s+/g,'')).toLowerCase()==(username.replace(/\s+/g,'')).toLowerCase())
{html.push('<div class="detailsEdit">');html.push('<h3>Edit Video Details</h3>');html.push('<form id="viewerVideosForm" action="#" method="post" onsubmit="xhtml.viewer.processMediaEdit(\'videos\', \'viewerVideosForm\'); return false;">');html.push('<fieldset>');html.push('<input type="hidden" name="action" value="edit"/>');html.push('<input type="hidden" name="type" value="video"/>');html.push('<input type="hidden" name="id" value="'+id+'"/>');html.push('<label><b>Title <cite>*</cite></b></label>');html.push('<input class="text" name="title" value="'+(!!title?title.replace(/<([^>]+)>/ig,''):'')+'" maxlength="128" onfocus="xhtml.viewer.disableShortcuts();" onblur="xhtml.viewer.enableShortcuts();"/>');html.push('<br class="clear"/>');html.push('<label><b>Description</b></label>');html.push('<input class="text" name="desc" value="'+(!!description?description.replace(/<([^>]+)>/ig,''):'')+'" maxlength="768" onfocus="xhtml.viewer.disableShortcuts();" onblur="xhtml.viewer.enableShortcuts();"/>');html.push('<br class="clear"/>');html.push('<label><b>Credit</b></label>');html.push('<input class="text" name="credit" value="'+(!!credit?credit.replace(/<([^>]+)>/ig,''):'')+'" maxlength="128" onfocus="xhtml.viewer.disableShortcuts();" onblur="xhtml.viewer.enableShortcuts();"/>');html.push('<br class="clear"/>');html.push('<a class="save" href="javascript:;" onclick="xhtml.viewer.processMediaEdit(\'videos\', \'viewerVideosForm\');"></a>');html.push('<a class="delete" href="javascript:;" onclick="if(confirm(\'Are you sure you wish to delete this video?\'))xhtml.viewer.processMediaDelete(\'video\','+id+');"></a>');html.push('<br class="clear"/>');html.push('</fieldset>');html.push('</form>');html.push('</div>');}
document.getElementById('viewerVideosBody').innerHTML=html.join("\n");document.getElementById('viewerVideosBodyContent').style.zIndex=400;if(xhtml.isFirefox2==false)
{document.getElementById('html').className='fixed';}
document.getElementById('viewerVideos').style.height='auto';document.getElementById('viewerVideos').className='';this.updateOverlay();window.scrollTo(0,0);YAHOO.util.Event.addListener(document,"keyup",__eventHandlerKeyboardNavigation);var so=new SWFObject("../videoplayer/fullvideo.swf","mediaVideo","418","313","8","#000000");so.addParam("wmode","opaque");so.addParam("allowScriptAccess","sameDomain");so.addParam("allowFullScreen","true");so.addVariable("videoPath",'../../videostore/'+id+'.flv');so.write('viewerVideosBodyContent');this.navigationInit('videos');this.navigation.type='videos';xhtml.initInputButtons();YAHOO.util.Connect.asyncRequest("GET","ajax-comments.php?action=list&type=video&id="+id+"&random="+(new Date()).getTime(),{success:__callbackVideoComments});}
this.positionPhotoViewer=function()
{var width=document.getElementById('viewerPhotosBodyContent').getElementsByTagName('img')[0].offsetWidth;if(width<400)
{width=400;}
document.getElementById('viewerPhotos').style.width=width+'px';document.getElementById('viewerPhotos').style.marginLeft='-'+(Math.floor(width/2)+10)+'px';document.getElementById('viewerPhotosBodyContent').style.height='auto';document.getElementById('viewerPhotosBodyContent').style.overflow='visible';document.getElementById('viewerPhotosBodyContent').getElementsByTagName('img')[0].style.visibility='';document.getElementById('viewerPhotosBodyContent').style.background='none';xhtml.viewer.updateOverlay();}
this.processMediaEdit=function(type,formId)
{switch(type)
{case'photos':YAHOO.util.Connect.setForm(formId);YAHOO.util.Connect.asyncRequest("POST","ajax-photos.php",{success:__callbackEditedPhotoDetails,failure:function(){alert('Sorry a server communication error occurred, \nplease try submitting your changes again.');}});break;case'videos':YAHOO.util.Connect.setForm(formId);YAHOO.util.Connect.asyncRequest("POST","ajax-videos.php",{success:__callbackEditedVideoDetails,failure:function(){alert('Sorry a server communication error occurred, \nplease try submitting your changes again.');}});break;}}
this.processMediaDelete=function(type,id)
{switch(type)
{case'photos':YAHOO.util.Connect.asyncRequest("GET","ajax-photos.php?action=delete&type=photo&id="+id+"&random="+(new Date()).getTime(),{success:__callbackDeletedPhoto(),failure:function(){alert('Sorry a server communication error occurred, \nplease try deleting your photo again.');}});break;case'videos':YAHOO.util.Connect.asyncRequest("GET","ajax-videos.php?action=delete&type=video&id="+id+"&random="+(new Date()).getTime(),{success:__callbackDeletedVideo(),failure:function(){alert('Sorry a server communication error occurred, \npplease try deleting your video again.');}});break;}}
this.deleteComment=function(itemId,commentId,type)
{switch(type)
{case'photo':YAHOO.util.Connect.asyncRequest("GET","ajax-comments.php?action=delete&type=photo&id="+commentId+"&itemid="+itemId,{success:__callbackPhotoCommentProcessed,failure:function(){alert('Comment Deletion Failed\nPlease check you are logged in and try again.');}});break;case'video':YAHOO.util.Connect.asyncRequest("GET","ajax-comments.php?action=delete&type=video&id="+commentId+"&itemid="+itemId,{success:__callbackVideoCommentProcessed,failure:function(){alert('Comment Deletion Failed\nPlease check you are logged in and try again.');}});break;}}
this.inappropriateComment=function(id)
{YAHOO.util.Connect.asyncRequest("GET","ajax-comments.php?action=inappropriate&id="+id,{success:function(){alert('Comment Flagged For Review\nThanks, we\'ll look into this comment as soon as possible.');},failure:function(){alert('Sorry a server communication error occurred, \nplease try again.');}});}
this.addPhotoComment=function()
{YAHOO.util.Connect.setForm('viewerPhotosBodyCommentForm');YAHOO.util.Connect.asyncRequest("POST","ajax-comments.php",{success:__callbackPhotoCommentProcessed,failure:function(){alert('Sorry a server communication error occurred, \nplease try submitting your comment again.');}});}
this.addVideoComment=function()
{YAHOO.util.Connect.setForm('viewerVideosBodyCommentForm');YAHOO.util.Connect.asyncRequest("POST","ajax-comments.php",{success:__callbackVideoCommentProcessed,failure:function(){alert('Sorry a server communication error occurred, \nplease try submitting your comment again.');}});}
this.navigationInit=function(type,dataset)
{if(arguments.length<2)
{if(this.navigation[type].dataset==null)
{return;}}
else
{this.navigation[type].dataset=dataset;}
if(this.navigation[type].current==null)
{return;}
if(_getCurrentIndex(type)==-1)
{this.navigationReset(type);return;}
switch(type)
{case'photos':document.getElementById('viewerPhotosNav').className='';this.navigationUpdateButtons(type);break;case'videos':document.getElementById('viewerVideosNav').className='';this.navigationUpdateButtons(type);break;}}
this.navigationReset=function(type)
{switch(type)
{case'photos':this.navigation.photos.current=null;this.navigation.photos.dataset=null;document.getElementById('viewerPhotosNav').className='invisible';break;case'videos':this.navigation.videos.current=null;this.navigation.videos.dataset=null;document.getElementById('viewerVideosNav').className='invisible';break;}}
this.navigationPrev=function(type)
{if(_getCurrentIndex(type)==-1)
{return;}
var newIndex=_getCurrentIndex(type)-1;if(typeof(xhtml.viewer.navigation[type].dataset[newIndex])=='undefined')
{return;}
var item=xhtml.viewer.navigation[type].dataset[newIndex];switch(type)
{case'photos':xhtml.viewer.displayPhoto(item.id,item.title,item.description,item.credit,item.username,item.flickr);break;case'videos':xhtml.viewer.displayVideo(item.id,item.title,item.description,item.credit,item.username);break;}}
this.navigationNext=function(type)
{if(_getCurrentIndex(type)==-1)
{return;}
var newIndex=_getCurrentIndex(type)+1;if(typeof(xhtml.viewer.navigation[type].dataset[newIndex])=='undefined')
{return;}
var item=xhtml.viewer.navigation[type].dataset[newIndex];switch(type)
{case'photos':xhtml.viewer.displayPhoto(item.id,item.title,item.description,item.credit,item.username,item.flickr);break;case'videos':xhtml.viewer.displayVideo(item.id,item.title,item.description,item.credit,item.username);break;}}
this.navigationUpdateButtons=function(type)
{switch(type)
{case'photos':var prefix='viewerPhotosNav';break;case'videos':var prefix='viewerVideosNav';break;}
var current=_getCurrentIndex(type);document.getElementById(prefix+'Prev').className='';document.getElementById(prefix+'Next').className='';if(current==0)
{document.getElementById(prefix+'Prev').className='invisible';}
switch(type)
{case'photos':if(current==xhtml.viewer.navigation.photos.dataset.length-1)
{document.getElementById(prefix+'Next').className='invisible';}
break;case'videos':if(current==xhtml.viewer.navigation.videos.dataset.length-1)
{document.getElementById(prefix+'Next').className='invisible';}
break;}}
this.enableShortcuts=function()
{xhtml.viewer.keyboardShortcutsEnabled=true;}
this.disableShortcuts=function()
{xhtml.viewer.keyboardShortcutsEnabled=false;}
this.hideAll=function()
{document.getElementById('html').className='';YAHOO.util.Event.removeListener(document,"keyup",__eventHandlerKeyboardNavigation);this.navigation.type='none';window.scrollTo(0,0);document.getElementById('viewerBackground').className='invisible';document.getElementById('viewerBackground').style.height='1px';document.getElementById('viewerPhotos').className='invisible';document.getElementById('viewerPhotos').style.height='1px';document.getElementById('viewerVideos').className='invisible';document.getElementById('viewerVideos').style.height='1px';setTimeout("if(document.getElementById('viewerVideosBodyContent'))document.getElementById('viewerVideosBodyContent').innerHTML='&nbsp;';",200);}
this.updateOverlay=function()
{var overlay=document.getElementById('viewerBackground');overlay.style.position='absolute';overlay.style.left='0px';overlay.style.top='0px';overlay.style.background='#000';overlay.style.opacity=0.6;overlay.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=60)';overlay.style.width=document.body.offsetWidth+'px';var height=(719<document.documentElement.clientHeight?document.documentElement.clientHeight:719);if(document.getElementById('viewerPhotos').className!='invisible')
{height=((document.getElementById('viewerPhotos').offsetHeight+40)<height?height:(document.getElementById('viewerPhotos').offsetHeight+40));}
if(document.getElementById('viewerVideos').className!='invisible')
{height=((document.getElementById('viewerVideos').offsetHeight+40)<height?height:(document.getElementById('viewerVideos').offsetHeight+40));}
overlay.style.height=height+'px';overlay.className='';}
function _getCurrentIndex(type)
{if(type!='photos'&&type!='videos')
{return-1;}
try
{var index=null;for(var x=xhtml.viewer.navigation[type].dataset.length-1;0<=x;x--)
{if(xhtml.viewer.navigation[type].current==xhtml.viewer.navigation[type].dataset[x].id)
{return x;}}
return-1;}
catch(err)
{return-1;}}
function _buildPhotoComments(id,comments)
{if(xhtml.viewer.navigation.photos.current!=id)
{return;}
var html=[];if(0<comments.length)
{for(var x=0;x<comments.length;x++)
{html.push('<div class="commentItem">');if(xhtml.auth.isLoggedIn()==true&&((xhtml.auth.getUsername()).replace(/\s+/g,'')).toLowerCase()==(comments[x].username.replace(/\s+/g,'')).toLowerCase())
{html.push('<h6>'+comments[x].username.replace(/<([^>]+)>/ig,'')+', '+xhtml.dateFormattedShort(new Date(comments[x].timestamp))+' <span class="flag">| <a href="javascript:;" onclick="if(confirm(\'Are you sure you wish to flag this comment as inappropriate?\'))xhtml.viewer.inappropriateComment('+comments[x].id+');">report</a></span> <span class="delete">| <a href="javascript:;" onclick="if(confirm(\'Are you sure you wish to delete your comment?\'))xhtml.viewer.deleteComment('+id+','+comments[x].id+',\'photo\');">delete</a></span></h6>');}
else
{html.push('<h6>'+comments[x].username.replace(/<([^>]+)>/ig,'')+', '+xhtml.dateFormattedShort(new Date(comments[x].timestamp))+' <span class="flag">| <a href="javascript:;" onclick="if(confirm(\'Are you sure you wish to flag this comment as inappropriate?\'))xhtml.viewer.inappropriateComment('+comments[x].id+');">report</a></span></h6>');}
html.push('<p>'+comments[x].content.replace(/<([^>]+)>/ig,'')+'</p>');html.push('</div>');}}
else
{html.push('<div class="commentItem">');html.push('<p>No Comments</p>');html.push('</div>');}
document.getElementById('viewerPhotosBodyCommentsItems').innerHTML=html.join("\n");if(0<comments.length)
{xhtml.initInputButtons();xhtml.viewer.updateOverlay();}}
function _buildVideoComments(id,comments)
{if(xhtml.viewer.navigation.videos.current!=id)
{return;}
var html=[];if(0<comments.length)
{for(var x=0;x<comments.length;x++)
{html.push('<div class="commentItem">');if(xhtml.auth.isLoggedIn()==true&&((xhtml.auth.getUsername()).replace(/\s+/g,'')).toLowerCase()==(comments[x].username.replace(/\s+/g,'')).toLowerCase())
{html.push('<h6>'+comments[x].username.replace(/<([^>]+)>/ig,'')+', '+xhtml.dateFormattedShort(new Date(comments[x].timestamp))+' <span class="flag">| <a href="javascript:;" onclick="if(confirm(\'Are you sure you wish to flag this comment as inappropriate?\'))xhtml.viewer.inappropriateComment('+comments[x].id+');">report</a></span> <span class="delete">| <a href="javascript:;" onclick="if(confirm(\'Are you sure you wish to delete your comment?\'))xhtml.viewer.deleteComment('+id+','+comments[x].id+',\'video\');">delete</a></span></h6>');}
else
{html.push('<h6>'+comments[x].username.replace(/<([^>]+)>/ig,'')+', '+xhtml.dateFormattedShort(new Date(comments[x].timestamp))+' <span class="flag">| <a href="javascript:;" onclick="if(confirm(\'Are you sure you wish to flag this comment as inappropriate?\'))xhtml.viewer.inappropriateComment('+comments[x].id+');">report</a></span></h6>');}
html.push('<p>'+comments[x].content.replace(/<([^>]+)>/ig,'')+'</p>');html.push('</div>');}}
else
{html.push('<div class="commentItem">');html.push('<p>No Comments</p>');html.push('</div>');}
document.getElementById('viewerVideosBodyCommentsItems').innerHTML=html.join("\n");if(0<comments.length)
{xhtml.initInputButtons();xhtml.viewer.updateOverlay();}}
function __eventHandlerKeyboardNavigation(event)
{var event=!!event?event:window.event;if(xhtml.viewer.keyboardShortcutsEnabled==false)
{return;}
switch(event.keyCode)
{case 27:__eventHandlerCancelBubbleAndDefault(event);xhtml.viewer.hideAll();break;case 28:case 37:case 80:case 188:case 63234:__eventHandlerCancelBubbleAndDefault(event);YAHOO.util.Event.removeListener(document,"keyup",__eventHandlerKeyboardNavigation);xhtml.viewer.navigationPrev(xhtml.viewer.navigation.type);break;case 29:case 32:case 39:case 78:case 190:case 63235:__eventHandlerCancelBubbleAndDefault(event);YAHOO.util.Event.removeListener(document,"keyup",__eventHandlerKeyboardNavigation);xhtml.viewer.navigationNext(xhtml.viewer.navigation.type);break;}}
function __eventHandlerCancelBubbleAndDefault(event)
{!!event?event:window.event;event.cancelBubble=true;if(event.stopPropagation)
{event.stopPropagation();}
if(event.preventDefault)
{event.preventDefault();}
event.returnValue=false;}
function __callbackPhotoComments(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{alert('Sorry a server communication error occurred, please try reloading this page again.');return;}
if(typeof(obj)=='object')
{for(var x=obj.length-1;0<=x;x--)
{obj[x].timestamp=strtotime(obj[x].timestamp);}
_buildPhotoComments(obj.id,obj);}
else
{alert('Sorry a server communication error occurred, please try reloading this page again.');return;}}
function __callbackPhotoCommentProcessed(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{return;}
if(typeof(obj)=='object')
{if(xhtml.viewer.navigation.photos.current==obj.id)
{xhtml.viewer.displayPhoto(xhtml.viewer.displayed.photo.id,xhtml.viewer.displayed.photo.title,xhtml.viewer.displayed.photo.description,xhtml.viewer.displayed.photo.credit,xhtml.viewer.displayed.photo.username,xhtml.viewer.displayed.photo.flickr);}}
else
{return;}}
function __callbackVideoComments(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{alert('Sorry a server communication error occurred, please try reloading this page again.');return;}
if(typeof(obj)=='object')
{for(var x=obj.length-1;0<=x;x--)
{obj[x].timestamp=strtotime(obj[x].timestamp);}
_buildVideoComments(obj.id,obj);}
else
{alert('Sorry a server communication error occurred, please try reloading this page again.');return;}}
function __callbackVideoCommentProcessed(callbackObj)
{var obj={};try
{obj=JSON.parse(callbackObj.responseText);}
catch(err)
{return;}
if(typeof(obj)=='object')
{if(xhtml.viewer.navigation.videos.current==obj.id)
{xhtml.viewer.displayVideo(xhtml.viewer.displayed.video.id,xhtml.viewer.displayed.video.title,xhtml.viewer.displayed.video.description,xhtml.viewer.displayed.video.credit,xhtml.viewer.displayed.video.username);}}
else
{return;}}
function __callbackEditedPhotoDetails()
{var inputs=document.getElementById('viewerPhotosForm').getElementsByTagName('input');xhtml.viewer.displayed.photo.title=inputs[3].value;xhtml.viewer.displayed.photo.description=inputs[4].value;xhtml.viewer.displayed.photo.credit=inputs[5].value;for(var x=xhtml.viewer.navigation.photos.dataset.length-1;0<=x;x--)
{if(xhtml.viewer.navigation.photos.dataset[x].id==xhtml.viewer.displayed.photo.id)
{xhtml.viewer.navigation.photos.dataset[x].title=inputs[3].value;xhtml.viewer.navigation.photos.dataset[x].description=inputs[4].value;xhtml.viewer.navigation.photos.dataset[x].credit=inputs[5].value;break;}}
setTimeout("xhtml.media.reloadThumbnails();",500);xhtml.viewer.displayPhoto(xhtml.viewer.displayed.photo.id,xhtml.viewer.displayed.photo.title,xhtml.viewer.displayed.photo.description,xhtml.viewer.displayed.photo.credit,xhtml.viewer.displayed.photo.username,xhtml.viewer.displayed.photo.flickr);}
function __callbackEditedVideoDetails()
{var inputs=document.getElementById('viewerVideosForm').getElementsByTagName('input');xhtml.viewer.displayed.video.title=inputs[3].value;xhtml.viewer.displayed.video.description=inputs[4].value;xhtml.viewer.displayed.video.credit=inputs[5].value;for(var x=xhtml.viewer.navigation.videos.dataset.length-1;0<=x;x--)
{if(xhtml.viewer.navigation.videos.dataset[x].id==xhtml.viewer.displayed.video.id)
{xhtml.viewer.navigation.videos.dataset[x].title=inputs[3].value;xhtml.viewer.navigation.videos.dataset[x].description=inputs[4].value;xhtml.viewer.navigation.videos.dataset[x].credit=inputs[5].value;break;}}
setTimeout("xhtml.media.reloadThumbnails();",500);xhtml.viewer.displayVideo(xhtml.viewer.displayed.video.id,xhtml.viewer.displayed.video.title,xhtml.viewer.displayed.video.description,xhtml.viewer.displayed.video.credit,xhtml.viewer.displayed.video.username);}
function __callbackDeletedPhoto()
{setTimeout("xhtml.media.reloadThumbnails();",500);xhtml.viewer.hideAll();}
function __callbackDeletedVideo()
{setTimeout("xhtml.media.reloadThumbnails();",500);xhtml.viewer.hideAll();}}
function ShareThis()
{this.currentTitle=((document.getElementsByTagName('title')[0]&&document.getElementsByTagName('title')[0].firstChild)?encodeURIComponent(document.getElementsByTagName('title')[0].firstChild.nodeValue):''),this.currentUrl=encodeURIComponent(window.location.toString()),this.currentDesc='',this.isTrident6=(!!(window.attachEvent&&!window.opera)&&(navigator.userAgent.toLowerCase()).indexOf('msie 6')!=-1)?true:false,this.defaultTitle="30 Days On The Road";this.bind=function(obj,method)
{return function()
{return method.apply(obj,arguments);}}
this.open=function(obj)
{this.close();try{var defaultTitle=encodeURIComponent(document.getElementsByTagName('title')[0].firstChild.nodeValue);}catch(e){var defaultTitle='';}
this.currentTitle=(!!obj.getAttribute('title')?encodeURIComponent(obj.getAttribute('title')):this.defaultTitle);this.currentUrl=(!!obj.getAttribute('rel')?encodeURIComponent(obj.getAttribute('rel')):encodeURIComponent(window.location.toString()));this.currentDesc=(!!obj.getAttribute('desc')?encodeURIComponent(obj.getAttribute('desc')):this.currentTitle);if(this.isTrident6==true)
{var selects=document.getElementsByTagName('select');for(var x=selects.length-1;0<=x;x--)
{selects[x].className+=' hidden';}}
_updateOverlay();_buildNode(obj);}
this.close=function()
{if(document.getElementById('shareThis'))
{document.body.removeChild(document.getElementById('shareThis'));}
if(document.getElementById('sharePageBackground'))
{document.getElementById('sharePageBackground').className='hidden';}
if(this.isTrident6==true)
{var selects=document.getElementsByTagName('select');for(var x=selects.length-1;0<=x;x--)
{selects[x].className=selects[x].className.replace(/\s?hidden/g,'');}}}
this.social=function(network)
{switch(network)
{case'blinklist':var url='http://blinklist.com/index.php?Action=Blink/addblink.php&Url=%url%&Title=%title%';break;case'delicious':var url='http://del.icio.us/post?url=%url%&title=%title%';break;case'digg':var url='http://digg.com/submit?phase=2&url=%url%&title=%title%&bodytext=%desc%';break;case'facebook':var url='http://www.facebook.com/sharer.php?u=%url%&t=%title%';break;case'furl':var url='http://furl.net/storeIt.jsp?u=%url%&t=%title%';break;case'google':var url='http://www.google.com/bookmarks/mark?op=edit&bkmk=%url%&title=%title%';break;case'magnolia':var url='http://ma.gnolia.com/bookmarklet/add?url=%url%&title=%title%';break;case'netscape':var url='http://www.netscape.com/submit/?U=%url%&T=%title%';break;case'newsvine':var url='http://www.newsvine.com/_wine/save?u=%url%&h=%title%';break;case'reddit':var url='http://reddit.com/submit?url=%url%&title=%title%';break;case'stumbleupon':var url='http://www.stumbleupon.com/submit?url=%url%&title=%title%';break;case'tailrank':var url='http://tailrank.com/share/?link_href=%url%&title=%title%';break;case'technorati':var url='http://www.technorati.com/faves?add=%url%';break;case'windowslive':var url='https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url=%url%&title=%title%&top=1';break;case'yahoomyweb':var url='http://myweb2.search.yahoo.com/myresults/bookmarklet?u=%url%&t=%title%';break;default:return;}
url=url.replace('%url%',this.currentUrl);url=url.replace('%title%',this.currentTitle);url=url.replace('%desc%',this.currentDesc);window.open(url,'_blank');this.close();}
this.email=function()
{var obj=document.getElementById('shareThis');var inputs=obj.getElementsByTagName('input');for(var x=0;x<3;x++)
{if(inputs[x].value=='')
{obj.getElementsByTagName('label')[0].className='missing';return;}}
var regex=/^[a-z0-9_+-.]+@[a-z0-9_-]*\.?[a-z0-9_-]*\.?[a-z0-9_-]*\.[a-z]+$/i;if(regex.test(inputs[0].value)==false||regex.test(inputs[2].value)==false)
{obj.getElementsByTagName('label')[0].className='missing';return;}
YAHOO.util.Connect.asyncRequest("POST","ajax-sharepage.php",{success:function(){},failure:function(){}},_buildFormParams());obj.getElementsByTagName('label')[0].className='hidden';obj.getElementsByTagName('label')[1].className='sending';obj.getElementsByTagName('fieldset')[0].className='hidden';setTimeout("xhtml.sharethis.close();",750);}
function _buildNode(obj)
{var containerTemplate=[];containerTemplate.push("<div class=\"social\">");containerTemplate.push("<h3><img src=\"images/global-elements-sharethis-title-socialweb.png\" width=\"87\" height=\"15\"/></h3>");containerTemplate.push("<ul class=\"list1\">");containerTemplate.push("<li><a class=\"blinklist\" href=\"javascript:;\" onclick=\"xhtml.sharethis.social('blinklist');\">BlinkList</a></li>");containerTemplate.push("<li><a class=\"delicious\" href=\"javascript:;\" onclick=\"xhtml.sharethis.social('delicious');\">del.icio.us</a></li>");containerTemplate.push("<li><a class=\"digg\" href=\"javascript:;\" onclick=\"xhtml.sharethis.social('digg');\">Digg</a></li>");containerTemplate.push("<li><a class=\"facebook\" href=\"javascript:;\" onclick=\"xhtml.sharethis.social('facebook');\">Facebook</a></li>");containerTemplate.push("<li><a class=\"furl\" href=\"javascript:;\" onclick=\"xhtml.sharethis.social('furl');\">Furl</a></li>");containerTemplate.push("<li><a class=\"google\" href=\"javascript:;\" onclick=\"xhtml.sharethis.social('google');\">Google Bookmarks</a></li>");containerTemplate.push("<li><a class=\"magnolia\" href=\"javascript:;\" onclick=\"xhtml.sharethis.social('magnolia');\">ma.gnolia</a></li>");containerTemplate.push("<li><a class=\"netscape\" href=\"javascript:;\" onclick=\"xhtml.sharethis.social('netscape');\">Netscape</a></li>");containerTemplate.push("</ul>");containerTemplate.push("<ul class=\"list2\">");containerTemplate.push("<li><a class=\"newsvine\" href=\"javascript:;\" onclick=\"xhtml.sharethis.social('newsvine');\">Newsvine</a></li>");containerTemplate.push("<li><a class=\"reddit\" href=\"javascript:;\" onclick=\"xhtml.sharethis.social('reddit');\">reddit</a></li>");containerTemplate.push("<li><a class=\"stumbleupon\" href=\"javascript:;\" onclick=\"xhtml.sharethis.social('stumbleupon');\">StumbleUpon</a></li>");containerTemplate.push("<li><a class=\"tailrank\" href=\"javascript:;\" onclick=\"xhtml.sharethis.social('tailrank');\">Tailrank</a></li>");containerTemplate.push("<li><a class=\"technorati\" href=\"javascript:;\" onclick=\"xhtml.sharethis.social('technorati');\">Technorati</a></li>");containerTemplate.push("<li><a class=\"windowslive\" href=\"javascript:;\" onclick=\"xhtml.sharethis.social('windowslive');\">Windows Live</a></li>");containerTemplate.push("<li><a class=\"yahoomyweb\" href=\"javascript:;\" onclick=\"xhtml.sharethis.social('yahoomyweb');\">Yahoo! My Web</a></li>");containerTemplate.push("</ul>");containerTemplate.push("</div>");containerTemplate.push("<div class=\"email\">");containerTemplate.push("<h3><img src=\"images/global-elements-sharethis-title-emailpage.png\" width=\"136\" height=\"21\"/></h3>");containerTemplate.push("<form action=\"#\" method=\"post\" onsubmit=\"return false;\">");containerTemplate.push("<label class=\"hidden\"><b>Missing Information</b><br/>Please complete all three fields and ensure the email addresses are valid.</label>");containerTemplate.push("<label class=\"hidden\"><b>Sending Message</b><br/>Please wait...</label>");containerTemplate.push("<fieldset>");containerTemplate.push("<label>To Address</label>");containerTemplate.push("<input class=\"text\" type=\"text\" name=\"toAddress\" value=\"\"/>");containerTemplate.push("<label>Your Name</label>");containerTemplate.push("<input class=\"text\" type=\"text\" name=\"fromName\" value=\"\"/>");containerTemplate.push("<label>Your Address</label>");containerTemplate.push("<input class=\"text\" type=\"text\" name=\"fromAddress\" value=\"\"/>");containerTemplate.push("<input class=\"submit\" type=\"button\" value=\"Send It\" onclick=\"xhtml.sharethis.email();\"/>");containerTemplate.push("</fieldset>");containerTemplate.push("</form>");containerTemplate.push("</div>");containerTemplate.push("<a class=\"close\" href=\"javascript:;\" onclick=\"xhtml.sharethis.close();\"><img src=\"images/text-button-close.png\" width=\"10\" height=\"11\"/></a>");var node=document.createElement('div');node.id='shareThis';node.innerHTML=containerTemplate.join("\n");var classes=['blinklist','delicious','digg','facebook','furl','google','magnolia','netscape','newsvine','reddit','stumbleupon','tailrank','technorati','windowslive','yahoomyweb'];node.style.visibility='hidden';document.body.appendChild(node);xhtml.centerDiv(node);node.style.visibility='visible';}
function _getObjectPosition(obj)
{var x=0;var y=0;do
{if(obj.offsetLeft)
{x+=obj.offsetLeft;}
if(obj.offsetTop)
{y+=obj.offsetTop;}}
while(obj=obj.offsetParent);return{x:(x*1),y:(y*1)}}
function _positionContainer(obj)
{var position=_getObjectPosition(obj);var left=(position.x-250);var top=(position.y-125);if(left<40)
{left=40;}
if(top<40)
{top=40;}
if((document.body.offsetWidth-540)<left)
{left=(document.body.offsetWidth-540);}
if((document.body.offsetHeight-300)<top)
{top=(document.body.offsetHeight-300);}
return{left:left,top:top}}
function _updateOverlay()
{if(!document.getElementById('sharePageBackground'))
{var overlay=document.createElement('div');overlay.id='sharePageBackground';overlay.style.position='absolute';overlay.style.left='0px';overlay.style.top='0px';overlay.style.background='#000';overlay.style.zIndex=500;overlay.style.opacity=0.6;overlay.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=60)';document.body.appendChild(overlay);}
var overlay=document.getElementById('sharePageBackground');overlay.className='hidden';overlay.style.width=document.body.offsetWidth+'px';overlay.style.height=(719<document.documentElement.clientHeight?document.documentElement.clientHeight:719)+'px';overlay.className='';}
function _buildFormParams()
{var params=[];params.push('url='+xhtml.sharethis.currentUrl);params.push('title='+xhtml.sharethis.currentTitle);var inputs=document.getElementById('shareThis').getElementsByTagName('input');for(var x=0;x<3;x++)
{params.push(encodeURIComponent(inputs[x].name)+'='+encodeURIComponent(inputs[x].value));}
return params.join('&');}}
YAHOO.util.Event.onDOMReady(function()
{xhtml=new WebPage();xhtml.init();});function WebPage()
{var _instance=this;this.initialized=false;this.debug=false;this.emptyFunction=function(){};this.focusFunction=function(){this.focus();};this.animationReferences={count:1};this.auth=new Auth();this.location=new Location();this.media=new Media();this.viewer=new Viewer();this.editorial=new Editorial();this.timeline=new Timeline();this.text=new Text();this.sharethis=new ShareThis();_log=function(msg)
{if(typeof(console)!='undefined')
{console.log(msg);}}
this.scrollbars={contentHeight:{},contentRange:{},grabberY:{},grabberSize:{},grabberRange:{},previousMouseY:0,regionBeingDragged:'',eventHandlersAdded:false};this.hash={timestamp:0,media:'photos',editorial:'blog',blog:0,story:0,info:0,timeout:null}
this.init=function()
{this.initInputButtons();this.initUserAgentBooleans();this.auth.init();this.media.init();this.viewer.init();this.editorial.init();this.timeline.init();this.location.init();this.text.init();YAHOO.util.Event.addListener(document.getElementById('twitter'),"click",__eventHandlerToggleTwitter);this.addAnimationId(document.getElementById('twitterLatest'));if(this.isTrident==true)
{this.hideOutline=function(){this.blur();}
var anchors=document.getElementsByTagName('a');for(var x=anchors.length-1;0<=x;x--)
{anchors[x].onfocus=this.hideOutline;}}
setTimeout("xhtml.initGoogleAnalytics();",20000);this.initialized=true;}
this.initGoogleAnalytics=function()
{var googleAnalytics=document.createElement('div');var html=[];html.push('<script src="'+("https:"==document.location.protocol?"https://ssl.":"http://www.")+'google-analytics.com/ga.js" type="text/javascript"></script>');html.push('<script type="text/javascript"> var pageTracker = _gat._getTracker("UA-31025-19"); pageTracker._trackPageview(); </script>');googleAnalytics.innerHTML=html.join("\n");document.body.appendChild(googleAnalytics);}
this.initInputButtons=function()
{var rolloverCache=[];var inputs=document.getElementsByTagName('input');for(var x=0;x<inputs.length;x++)
{if(inputs[x].type=='image'&&inputs[x].className.indexOf('hasRollover')!=-1)
{inputs[x].onmouseover=function()
{this.src=this.src.replace(/\.(gif|jpg|png)/,'-over.$1');}
inputs[x].onmouseout=function()
{this.src=this.src.replace(/-over\.(gif|jpg|png)/,'.$1');}
var newImage=new Image();newImage.src=inputs[x].src.replace(/\.(gif|jpg|png)/i,'-over.$1');rolloverCache[rolloverCache.length]=newImage;}}}
this.initUserAgentBooleans=function()
{this.renderingEngine='';var ua=navigator.userAgent.toLowerCase();var macintosh=(ua.indexOf("macintosh")!=-1||ua.indexOf("powerpc")!=-1||ua.indexOf("mac os x")!=-1)?1:0;if(this.isPresto=!!window.opera)
{this.renderingEngine='presto';}
if(this.isWebKit=(ua.indexOf('applewebkit')!=-1))
{this.renderingEngine='webkit';}
if(this.isGecko=(ua.indexOf('gecko')!=-1&&ua.indexOf('khtml')==-1))
{this.renderingEngine='gecko';}
if(this.isTrident=!!(window.attachEvent&&!window.opera))
{this.renderingEngine='trident';}
this.isMac=macintosh;this.isTrident5=(this.isTrident&&ua.indexOf('msie 5')!=-1)?1:0;this.isTrident6=(this.isTrident&&ua.indexOf('msie 6')!=-1)?1:0;this.isTrident7=(this.isTrident&&ua.indexOf('msie 7')!=-1)?1:0;this.isSafari=(this.isWebKit&&(ua.indexOf('safari')!=-1));this.isSafari3=(this.isWebKit&&(ua.indexOf('safari')!=-1)&&window.devicePixelRatio&&(ua.indexOf('mobile')==-1));this.isMobileSafari=(this.isWebKit&&(ua.indexOf('safari')!=-1)&&window.devicePixelRatio&&(ua.indexOf('mobile')!=-1));this.isFirefox=(this.isGecko&&(navigator.vendor=="Firefox"||ua.indexOf('firefox')!=-1))?1:0;this.isFirefox2=(this.isGecko&&ua.indexOf('firefox/2')!=-1)?1:0;this.isFirefox1=(this.isGecko&&ua.indexOf('firefox/1')!=-1)?1:0;}
this.readUrlHash=function()
{var hash=window.location.hash;if(1<hash.length)
{var parts=(hash.substring(1,hash.length)).split('|');if(parts.length==6)
{var timestamp=0;if(parts[1].length!=8)
{return;}
try
{timestamp=(new Date(parts[1].substring(0,4),parts[1].substring(4,6)-1,parts[1].substring(6,8))).getTime();}
catch(err)
{return;}
var timestampMin=1201820400000;var timestampMax=1233442800000;if(timestamp<timestampMin||timestampMax<timestamp)
{return;}
this.hash.timestamp=timestamp;switch(parseInt(parts[2]*1))
{case 1:case 2:case 3:case 4:this.hash.editorial=parseInt(parts[2]*1);break;default:return;}
if(''+parseInt(parts[3])!='')
{this.hash.blog=parts[3]*1;}
else
{return;}
if(''+parseInt(parts[4])!='')
{this.hash.story=parts[4]*1;}
else
{return;}
if(''+parseInt(parts[5])!='')
{this.hash.info=parts[5]*1;}
else
{return;}
xhtml.timeline.loadHash(this.hash);}}
else
{xhtml.timeline.scrollToDate(new Date().getFullYear(),new Date().getMonth()+1,new Date().getDate());}}
this.updateUrlHash=function(key,value)
{switch(key)
{case'timestamp':this.hash.timestamp=value*1;break;case'media':this.hash.media=value;break;case'editorial':this.hash.editorial=value*1;break;case'blog':this.hash.blog=value*1;break;case'story':this.hash.story=value*1;break;case'info':this.hash.info=value*1;break;}
if(this.hash.timestamp==0)
{return;}
clearTimeout(this.hash.timeout);this.hash.timeout=setTimeout("window.location='#day|"+encodeURIComponent(_createDateString(this.hash.timestamp))+"|"+encodeURIComponent(this.hash.editorial)+"|"+encodeURIComponent(this.hash.blog)+"|"+encodeURIComponent(this.hash.story)+"|"+encodeURIComponent(this.hash.info)+"';",500);}
this.toggleTwitterBar=function()
{__eventHandlerToggleTwitter();}
this.timeFormattedShort=function(dateObj)
{return(12<dateObj.getHours()?dateObj.getHours()-12:(dateObj.getHours()==0?'12':dateObj.getHours()))+':'+(dateObj.getMinutes()<10?'0':'')+dateObj.getMinutes()+(11<dateObj.getHours()?'pm':'am');}
this.dateFormattedShort=function(dateObj)
{return(dateObj.getMonth()+1)+'/'+dateObj.getDate()+'/'+dateObj.getFullYear()+', '+(12<dateObj.getHours()?dateObj.getHours()-12:(dateObj.getHours()==0?'12':dateObj.getHours()))+':'+(dateObj.getMinutes()<10?'0':'')+dateObj.getMinutes()+(11<dateObj.getHours()?'pm':'am');}
this.dateFormattedLong=function(dateObj)
{var dayNames=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];var monthNames=['January','February','March','April','May','June','July','August','September','October','November','December'];return dayNames[dateObj.getDay()]+', '+monthNames[dateObj.getMonth()]+' '+dateObj.getDate()+', '+dateObj.getFullYear();}
this.addAnimationId=function(obj)
{if(!!obj.getAttribute('animationId')==true)
{return;}
obj.setAttribute('animationId','id'+xhtml.animationReferences.count++);}
this.findParent=function(element,parentTagName)
{if(element==null)
{return null;}
else
{if(element.nodeType==1&&element.tagName.toLowerCase()==parentTagName.toLowerCase())
{return element;}
else
{return this.findParent(element.parentNode,parentTagName);}}}
this.disableTextSelection=function()
{document.body.className=document.body.className.replace('notScrolling','scrolling');document.body.onselectstart=function(){return false;};}
this.enableTextSelection=function()
{document.body.className=document.body.className.replace('scrolling','notScrolling');document.body.onselectstart=null;}
this.centerDiv=function(obj)
{switch(xhtml.renderingEngine)
{case'trident':var scrollPositionY=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;var windowWidth=document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth;var windowHeight=document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight;break;default:var scrollPositionY=window.scrollY;var windowWidth=window.innerWidth;var windowHeight=window.innerHeight;break;}
var width=0;var height=0;try
{var width=obj.offsetWidth
var height=obj.offsetHeight}
catch(err)
{return;}
var left=Math.floor((windowWidth/2)-(width/2));var top=Math.floor(((windowHeight/2)-(height/2))+scrollPositionY);if(left<10)
{left=10;}
if(top<10)
{top=10;}
obj.style.left=left+'px';obj.style.top=top+'px';}
this.scrollingRegionInit=function(region)
{if(xhtml.scrollbars.eventHandlersAdded==false)
{YAHOO.util.Event.addListener(document.body,"mousemove",__eventHandlerScrollBarGrabberMove);YAHOO.util.Event.addListener(document.body,"mouseup",__eventHandlerScrollBarGrabberUp);xhtml.scrollbars.eventHandlersAdded=true;}
var scrollingRegionHeight=document.getElementById(region+'Artboard').parentNode.offsetHeight;var grabberBarHeight=document.getElementById(region+'Grabber').parentNode.offsetHeight;xhtml.scrollbars.contentHeight[region]=parseInt(document.getElementById(region+'Artboard').offsetHeight);xhtml.scrollbars.contentRange[region]=(xhtml.scrollbars.contentHeight[region]-scrollingRegionHeight)<0?0:(xhtml.scrollbars.contentHeight[region]-scrollingRegionHeight);var pages=xhtml.scrollbars.contentHeight[region]/scrollingRegionHeight;pages=(pages<1?1:pages);xhtml.scrollbars.grabberSize[region]=parseInt(grabberBarHeight/pages);xhtml.scrollbars.grabberRange[region]=grabberBarHeight-xhtml.scrollbars.grabberSize[region];document.getElementById(region+'Grabber').ondragstart=function(){return false;}
document.getElementById(region+'Grabber').onmousedown=function(){return false;}
YAHOO.util.Event.removeListener(document.getElementById(region+'Grabber'),"mousedown",__eventHandlerScrollBarGrabberDown);YAHOO.util.Event.addListener(document.getElementById(region+'Grabber'),"mousedown",__eventHandlerScrollBarGrabberDown);YAHOO.util.Event.removeListener(document.getElementById(region+'Artboard'),"mousewheel",__eventHandlerScrollBarGrabberWheel);YAHOO.util.Event.addListener(document.getElementById(region+'Artboard'),"mousewheel",__eventHandlerScrollBarGrabberWheel);YAHOO.util.Event.removeListener(document.getElementById(region+'Artboard'),"DOMMouseScroll",__eventHandlerScrollBarGrabberWheel);YAHOO.util.Event.addListener(document.getElementById(region+'Artboard'),"DOMMouseScroll",__eventHandlerScrollBarGrabberWheel);document.getElementById(region+'Grabber').style.top='0px';document.getElementById(region+'Grabber').style.height=xhtml.scrollbars.grabberSize[region]+'px';xhtml.scrollbars.previousMouseY=0;document.getElementById(region+'Artboard').style.top='0px';if(xhtml.scrollbars.grabberRange[region]==0)
{document.getElementById(region+'Grabber').parentNode.parentNode.className+=' scrollbarDisabled';}
else
{document.getElementById(region+'Grabber').parentNode.parentNode.className=document.getElementById(region+'Grabber').parentNode.parentNode.className.replace(/\s?scrollbarDisabled/g,'');}}
this.scrollingRegionDrag=function(event)
{try
{if(xhtml.isTrident==true)
{var mouseY=window.event.clientY;}
else
{var mouseY=event.pageY;}
var newGrabberPosition=(((mouseY*1)-(xhtml.scrollbars.previousMouseY*1))*1)+(parseInt(document.getElementById(xhtml.scrollbars.regionBeingDragged+'Grabber').style.top)*1);xhtml.scrollbars.previousMouseY=mouseY;if(newGrabberPosition<0)
{newGrabberPosition=0;}
if(xhtml.scrollbars.grabberRange[xhtml.scrollbars.regionBeingDragged]<newGrabberPosition)
{newGrabberPosition=xhtml.scrollbars.grabberRange[xhtml.scrollbars.regionBeingDragged];}
document.getElementById(xhtml.scrollbars.regionBeingDragged+'Grabber').style.top=newGrabberPosition+'px';document.getElementById(xhtml.scrollbars.regionBeingDragged+'Artboard').style.top=(parseInt((newGrabberPosition/xhtml.scrollbars.grabberRange[xhtml.scrollbars.regionBeingDragged])*xhtml.scrollbars.contentRange[xhtml.scrollbars.regionBeingDragged])*-1)+'px';}
catch(err)
{}}
this.scrollingRegionUp=function(region)
{var newGrabberPosition=(parseInt(document.getElementById(region+'Grabber').style.top)*1)-15;if(newGrabberPosition<0)
{newGrabberPosition=0;}
if(xhtml.scrollbars.grabberRange[region]<newGrabberPosition)
{newGrabberPosition=xhtml.scrollbars.grabberRange[region];}
document.getElementById(region+'Grabber').style.top=newGrabberPosition+'px';document.getElementById(region+'Artboard').style.top=(parseInt((newGrabberPosition/xhtml.scrollbars.grabberRange[region])*xhtml.scrollbars.contentRange[region])*-1)+'px';}
this.scrollingRegionDown=function(region)
{var newGrabberPosition=(parseInt(document.getElementById(region+'Grabber').style.top)*1)+15;if(newGrabberPosition<0)
{newGrabberPosition=0;}
if(xhtml.scrollbars.grabberRange[region]<newGrabberPosition)
{newGrabberPosition=xhtml.scrollbars.grabberRange[region];}
document.getElementById(region+'Grabber').style.top=newGrabberPosition+'px';document.getElementById(region+'Artboard').style.top=(parseInt((newGrabberPosition/xhtml.scrollbars.grabberRange[region])*xhtml.scrollbars.contentRange[region])*-1)+'px';}
function _createDateString(timestamp)
{var dateObj=new Date(timestamp*1);return dateObj.getFullYear()+''+((dateObj.getMonth()+1)<10?'0':'')+(dateObj.getMonth()+1)+''+(dateObj.getDate()<10?'0':'')+dateObj.getDate();}
function __eventHandlerScrollBarGrabberDown(event)
{if(xhtml.scrollbars.regionBeingDragged!='')
{return;}
else
{xhtml.disableTextSelection();xhtml.scrollbars.regionBeingDragged=this.id.replace('Grabber','');}
event=!!event?event:window.event;if(xhtml.isTrident==true)
{xhtml.scrollbars.previousMouseY=window.event.clientY;}
else
{xhtml.scrollbars.previousMouseY=event.pageY;}}
function __eventHandlerScrollBarGrabberMove(event)
{if(xhtml.scrollbars.regionBeingDragged=='')
{return;}
xhtml.scrollingRegionDrag(!!event?event:window.event);}
function __eventHandlerScrollBarGrabberWheel(event)
{!!event?event:window.event
var delta=0;if(event.wheelDelta)
{delta=event.wheelDelta/120;if(window.opera)
{delta*=-1;}}
else if(event.detail)
{delta=-event.detail/3;}
if(delta!=0)
{if(delta<0)
{xhtml.scrollingRegionDown(this.id.replace('Artboard',''));}
else
{xhtml.scrollingRegionUp(this.id.replace('Artboard',''));}}
__eventHandlerCancelBubbleAndDefault(event);}
function __eventHandlerScrollBarGrabberUp()
{xhtml.enableTextSelection();xhtml.scrollbars.regionBeingDragged='';}
function __eventHandlerCancelBubbleAndDefault(event)
{!!event?event:window.event;event.cancelBubble=true;if(event.stopPropagation)
{event.stopPropagation();}
if(event.preventDefault)
{event.preventDefault();}
event.returnValue=false;}
function __eventHandlerToggleTwitter()
{if(document.getElementById('twitterLatest').className=='collapsed')
{document.getElementById('twitterLatest').className='expanded';try{xhtml.animationReferences[document.getElementById('twitterLatest').getAttribute('animationId')].stop(false);}catch(err){}
xhtml.animationReferences[document.getElementById('twitterLatest').getAttribute('animationId')]=new YAHOO.util.Anim(document.getElementById('twitterLatest'),{width:{to:975}},0.3,YAHOO.util.Easing.easeBoth);xhtml.animationReferences[document.getElementById('twitterLatest').getAttribute('animationId')].animate();}
else
{document.getElementById('twitterLatest').className='collapsed';try{xhtml.animationReferences[document.getElementById('twitterLatest').getAttribute('animationId')].stop(false);}catch(err){}
xhtml.animationReferences[document.getElementById('twitterLatest').getAttribute('animationId')]=new YAHOO.util.Anim(document.getElementById('twitterLatest'),{width:{to:19}},0.3,YAHOO.util.Easing.easeBoth);xhtml.animationReferences[document.getElementById('twitterLatest').getAttribute('animationId')].animate();}}}
function parseBoolean(value)
{value=(''+value).toLowerCase();if(value=='false'||value=='0')
{return false;}
else
{return true;}}