





/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var b=arguments,g=null,e,c,f;for(e=0;e<b.length;e=e+1){f=(""+b[e]).split(".");g=YAHOO;for(c=(f[0]=="YAHOO")?1:0;c<f.length;c=c+1){g[f[c]]=g[f[c]]||{};g=g[f[c]];}}return g;};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,f,e){var k=YAHOO.env.modules,c,j,h,g,d;if(!k[a]){k[a]={versions:[],builds:[]};}c=k[a];j=e.version;h=e.build;g=YAHOO.env.listeners;c.name=a;c.version=j;c.build=h;c.versions.push(j);c.builds.push(h);c.mainClass=f;for(d=0;d<g.length;d=d+1){g[d](c);}if(f){f.VERSION=j;f.BUILD=h;}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.parseUA=function(d){var e=function(i){var j=0;return parseFloat(i.replace(/\./g,function(){return(j++==1)?"":".";}));},h=navigator,g={ie:0,opera:0,gecko:0,webkit:0,chrome:0,mobile:null,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,webos:0,caja:h&&h.cajaVersion,secure:false,os:null},c=d||(navigator&&navigator.userAgent),f=window&&window.location,b=f&&f.href,a;g.secure=b&&(b.toLowerCase().indexOf("https")===0);if(c){if((/windows|win32/i).test(c)){g.os="windows";}else{if((/macintosh/i).test(c)){g.os="macintosh";}else{if((/rhino/i).test(c)){g.os="rhino";}}}if((/KHTML/).test(c)){g.webkit=1;}a=c.match(/AppleWebKit\/([^\s]*)/);if(a&&a[1]){g.webkit=e(a[1]);if(/ Mobile\//.test(c)){g.mobile="Apple";a=c.match(/OS ([^\s]*)/);if(a&&a[1]){a=e(a[1].replace("_","."));}g.ios=a;g.ipad=g.ipod=g.iphone=0;a=c.match(/iPad|iPod|iPhone/);if(a&&a[0]){g[a[0].toLowerCase()]=g.ios;}}else{a=c.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);if(a){g.mobile=a[0];}if(/webOS/.test(c)){g.mobile="WebOS";a=c.match(/webOS\/([^\s]*);/);if(a&&a[1]){g.webos=e(a[1]);}}if(/ Android/.test(c)){g.mobile="Android";a=c.match(/Android ([^\s]*);/);if(a&&a[1]){g.android=e(a[1]);}}}a=c.match(/Chrome\/([^\s]*)/);if(a&&a[1]){g.chrome=e(a[1]);}else{a=c.match(/AdobeAIR\/([^\s]*)/);if(a){g.air=a[0];}}}if(!g.webkit){a=c.match(/Opera[\s\/]([^\s]*)/);if(a&&a[1]){g.opera=e(a[1]);a=c.match(/Version\/([^\s]*)/);if(a&&a[1]){g.opera=e(a[1]);}a=c.match(/Opera Mini[^;]*/);if(a){g.mobile=a[0];}}else{a=c.match(/MSIE\s([^;]*)/);if(a&&a[1]){g.ie=e(a[1]);}else{a=c.match(/Gecko\/([^\s]*)/);if(a){g.gecko=1;a=c.match(/rv:([^\s\)]*)/);if(a&&a[1]){g.gecko=e(a[1]);}}}}}}return g;};YAHOO.env.ua=YAHOO.env.parseUA();(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++){if(a[c]==b){d=false;break;}}if(d){a.push(b);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var f=YAHOO.lang,a=Object.prototype,c="[object Array]",h="[object Function]",i="[object Object]",b=[],g={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;","`":"&#x60;"},d=["toString","valueOf"],e={isArray:function(j){return a.toString.apply(j)===c;},isBoolean:function(j){return typeof j==="boolean";},isFunction:function(j){return(typeof j==="function")||a.toString.apply(j)===h;},isNull:function(j){return j===null;},isNumber:function(j){return typeof j==="number"&&isFinite(j);},isObject:function(j){return(j&&(typeof j==="object"||f.isFunction(j)))||false;},isString:function(j){return typeof j==="string";},isUndefined:function(j){return typeof j==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(l,k){var j,n,m;for(j=0;j<d.length;j=j+1){n=d[j];m=k[n];if(f.isFunction(m)&&m!=a[n]){l[n]=m;}}}:function(){},escapeHTML:function(j){return j.replace(/[&<>"'\/`]/g,function(k){return g[k];});},extend:function(m,n,l){if(!n||!m){throw new Error("extend failed, please check that "+"all dependencies are included.");}var k=function(){},j;k.prototype=n.prototype;m.prototype=new k();m.prototype.constructor=m;m.superclass=n.prototype;if(n.prototype.constructor==a.constructor){n.prototype.constructor=n;}if(l){for(j in l){if(f.hasOwnProperty(l,j)){m.prototype[j]=l[j];}}f._IEEnumFix(m.prototype,l);}},augmentObject:function(n,m){if(!m||!n){throw new Error("Absorb failed, verify dependencies.");}var j=arguments,l,o,k=j[2];if(k&&k!==true){for(l=2;l<j.length;l=l+1){n[j[l]]=m[j[l]];}}else{for(o in m){if(k||!(o in n)){n[o]=m[o];}}f._IEEnumFix(n,m);}return n;},augmentProto:function(m,l){if(!l||!m){throw new Error("Augment failed, verify dependencies.");}var j=[m.prototype,l.prototype],k;for(k=2;k<arguments.length;k=k+1){j.push(arguments[k]);}f.augmentObject.apply(this,j);return m;},dump:function(j,p){var l,n,r=[],t="{...}",k="f(){...}",q=", ",m=" => ";if(!f.isObject(j)){return j+"";}else{if(j instanceof Date||("nodeType" in j&&"tagName" in j)){return j;}else{if(f.isFunction(j)){return k;}}}p=(f.isNumber(p))?p:3;if(f.isArray(j)){r.push("[");for(l=0,n=j.length;l<n;l=l+1){if(f.isObject(j[l])){r.push((p>0)?f.dump(j[l],p-1):t);}else{r.push(j[l]);}r.push(q);}if(r.length>1){r.pop();}r.push("]");}else{r.push("{");for(l in j){if(f.hasOwnProperty(j,l)){r.push(l+m);if(f.isObject(j[l])){r.push((p>0)?f.dump(j[l],p-1):t);}else{r.push(j[l]);}r.push(q);}}if(r.length>1){r.pop();}r.push("}");}return r.join("");},substitute:function(x,y,E,l){var D,C,B,G,t,u,F=[],p,z=x.length,A="dump",r=" ",q="{",m="}",n,w;for(;;){D=x.lastIndexOf(q,z);if(D<0){break;}C=x.indexOf(m,D);if(D+1>C){break;}p=x.substring(D+1,C);G=p;u=null;B=G.indexOf(r);if(B>-1){u=G.substring(B+1);G=G.substring(0,B);}t=y[G];if(E){t=E(G,t,u);}if(f.isObject(t)){if(f.isArray(t)){t=f.dump(t,parseInt(u,10));}else{u=u||"";n=u.indexOf(A);if(n>-1){u=u.substring(4);}w=t.toString();if(w===i||n>-1){t=f.dump(t,parseInt(u,10));}else{t=w;}}}else{if(!f.isString(t)&&!f.isNumber(t)){t="~-"+F.length+"-~";F[F.length]=p;}}x=x.substring(0,D)+t+x.substring(C+1);if(l===false){z=D-1;}}for(D=F.length-1;D>=0;D=D-1){x=x.replace(new RegExp("~-"+D+"-~"),"{"+F[D]+"}","g");}return x;},trim:function(j){try{return j.replace(/^\s+|\s+$/g,"");}catch(k){return j;
}},merge:function(){var n={},k=arguments,j=k.length,m;for(m=0;m<j;m=m+1){f.augmentObject(n,k[m],true);}return n;},later:function(t,k,u,n,p){t=t||0;k=k||{};var l=u,s=n,q,j;if(f.isString(u)){l=k[u];}if(!l){throw new TypeError("method undefined");}if(!f.isUndefined(n)&&!f.isArray(s)){s=[n];}q=function(){l.apply(k,s||b);};j=(p)?setInterval(q,t):setTimeout(q,t);return{interval:p,cancel:function(){if(this.interval){clearInterval(j);}else{clearTimeout(j);}}};},isValue:function(j){return(f.isObject(j)||f.isString(j)||f.isNumber(j)||f.isBoolean(j));}};f.hasOwnProperty=(a.hasOwnProperty)?function(j,k){return j&&j.hasOwnProperty&&j.hasOwnProperty(k);}:function(j,k){return !f.isUndefined(j[k])&&j.constructor.prototype[k]!==j[k];};e.augmentObject(f,e,true);YAHOO.util.Lang=f;f.augment=f.augmentProto;YAHOO.augment=f.augmentProto;YAHOO.extend=f.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.9.0",build:"2800"});(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var e=YAHOO.util,k=YAHOO.lang,L=YAHOO.env.ua,a=YAHOO.lang.trim,B={},F={},m=/^t(?:able|d|h)$/i,w=/color$/i,j=window.document,v=j.documentElement,C="ownerDocument",M="defaultView",U="documentElement",S="compatMode",z="offsetLeft",o="offsetTop",T="offsetParent",x="parentNode",K="nodeType",c="tagName",n="scrollLeft",H="scrollTop",p="getBoundingClientRect",V="getComputedStyle",y="currentStyle",l="CSS1Compat",A="BackCompat",E="class",f="className",i="",b=" ",R="(?:^|\\s)",J="(?= |$)",t="g",O="position",D="fixed",u="relative",I="left",N="top",Q="medium",P="borderLeftWidth",q="borderTopWidth",d=L.opera,h=L.webkit,g=L.gecko,s=L.ie;e.Dom={CUSTOM_ATTRIBUTES:(!v.hasAttribute)?{"for":"htmlFor","class":f}:{"htmlFor":"for","className":E},DOT_ATTRIBUTES:{checked:true},get:function(aa){var ac,X,ab,Z,W,G,Y=null;if(aa){if(typeof aa=="string"||typeof aa=="number"){ac=aa+"";aa=j.getElementById(aa);G=(aa)?aa.attributes:null;if(aa&&G&&G.id&&G.id.value===ac){return aa;}else{if(aa&&j.all){aa=null;X=j.all[ac];if(X&&X.length){for(Z=0,W=X.length;Z<W;++Z){if(X[Z].id===ac){return X[Z];}}}}}}else{if(e.Element&&aa instanceof e.Element){aa=aa.get("element");}else{if(!aa.nodeType&&"length" in aa){ab=[];for(Z=0,W=aa.length;Z<W;++Z){ab[ab.length]=e.Dom.get(aa[Z]);}aa=ab;}}}Y=aa;}return Y;},getComputedStyle:function(G,W){if(window[V]){return G[C][M][V](G,null)[W];}else{if(G[y]){return e.Dom.IE_ComputedStyle.get(G,W);}}},getStyle:function(G,W){return e.Dom.batch(G,e.Dom._getStyle,W);},_getStyle:function(){if(window[V]){return function(G,Y){Y=(Y==="float")?Y="cssFloat":e.Dom._toCamel(Y);var X=G.style[Y],W;if(!X){W=G[C][M][V](G,null);if(W){X=W[Y];}}return X;};}else{if(v[y]){return function(G,Y){var X;switch(Y){case"opacity":X=100;try{X=G.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(Z){try{X=G.filters("alpha").opacity;}catch(W){}}return X/100;case"float":Y="styleFloat";default:Y=e.Dom._toCamel(Y);X=G[y]?G[y][Y]:null;return(G.style[Y]||X);}};}}}(),setStyle:function(G,W,X){e.Dom.batch(G,e.Dom._setStyle,{prop:W,val:X});},_setStyle:function(){if(!window.getComputedStyle&&j.documentElement.currentStyle){return function(W,G){var X=e.Dom._toCamel(G.prop),Y=G.val;if(W){switch(X){case"opacity":if(Y===""||Y===null||Y===1){W.style.removeAttribute("filter");}else{if(k.isString(W.style.filter)){W.style.filter="alpha(opacity="+Y*100+")";if(!W[y]||!W[y].hasLayout){W.style.zoom=1;}}}break;case"float":X="styleFloat";default:W.style[X]=Y;}}else{}};}else{return function(W,G){var X=e.Dom._toCamel(G.prop),Y=G.val;if(W){if(X=="float"){X="cssFloat";}W.style[X]=Y;}else{}};}}(),getXY:function(G){return e.Dom.batch(G,e.Dom._getXY);},_canPosition:function(G){return(e.Dom._getStyle(G,"display")!=="none"&&e.Dom._inDoc(G));},_getXY:function(W){var X,G,Z,ab,Y,aa,ac=Math.round,ad=false;if(e.Dom._canPosition(W)){Z=W[p]();ab=W[C];X=e.Dom.getDocumentScrollLeft(ab);G=e.Dom.getDocumentScrollTop(ab);ad=[Z[I],Z[N]];if(Y||aa){ad[0]-=aa;ad[1]-=Y;}if((G||X)){ad[0]+=X;ad[1]+=G;}ad[0]=ac(ad[0]);ad[1]=ac(ad[1]);}else{}return ad;},getX:function(G){var W=function(X){return e.Dom.getXY(X)[0];};return e.Dom.batch(G,W,e.Dom,true);},getY:function(G){var W=function(X){return e.Dom.getXY(X)[1];};return e.Dom.batch(G,W,e.Dom,true);},setXY:function(G,X,W){e.Dom.batch(G,e.Dom._setXY,{pos:X,noRetry:W});},_setXY:function(G,Z){var aa=e.Dom._getStyle(G,O),Y=e.Dom.setStyle,ad=Z.pos,W=Z.noRetry,ab=[parseInt(e.Dom.getComputedStyle(G,I),10),parseInt(e.Dom.getComputedStyle(G,N),10)],ac,X;ac=e.Dom._getXY(G);if(!ad||ac===false){return false;}if(aa=="static"){aa=u;Y(G,O,aa);}if(isNaN(ab[0])){ab[0]=(aa==u)?0:G[z];}if(isNaN(ab[1])){ab[1]=(aa==u)?0:G[o];}if(ad[0]!==null){Y(G,I,ad[0]-ac[0]+ab[0]+"px");}if(ad[1]!==null){Y(G,N,ad[1]-ac[1]+ab[1]+"px");}if(!W){X=e.Dom._getXY(G);if((ad[0]!==null&&X[0]!=ad[0])||(ad[1]!==null&&X[1]!=ad[1])){e.Dom._setXY(G,{pos:ad,noRetry:true});}}},setX:function(W,G){e.Dom.setXY(W,[G,null]);},setY:function(G,W){e.Dom.setXY(G,[null,W]);},getRegion:function(G){var W=function(X){var Y=false;if(e.Dom._canPosition(X)){Y=e.Region.getRegion(X);}else{}return Y;};return e.Dom.batch(G,W,e.Dom,true);},getClientWidth:function(){return e.Dom.getViewportWidth();},getClientHeight:function(){return e.Dom.getViewportHeight();},getElementsByClassName:function(ab,af,ac,ae,X,ad){af=af||"*";ac=(ac)?e.Dom.get(ac):null||j;if(!ac){return[];}var W=[],G=ac.getElementsByTagName(af),Z=e.Dom.hasClass;for(var Y=0,aa=G.length;Y<aa;++Y){if(Z(G[Y],ab)){W[W.length]=G[Y];}}if(ae){e.Dom.batch(W,ae,X,ad);}return W;},hasClass:function(W,G){return e.Dom.batch(W,e.Dom._hasClass,G);},_hasClass:function(X,W){var G=false,Y;if(X&&W){Y=e.Dom._getAttribute(X,f)||i;if(Y){Y=Y.replace(/\s+/g,b);}if(W.exec){G=W.test(Y);}else{G=W&&(b+Y+b).indexOf(b+W+b)>-1;}}else{}return G;},addClass:function(W,G){return e.Dom.batch(W,e.Dom._addClass,G);},_addClass:function(X,W){var G=false,Y;if(X&&W){Y=e.Dom._getAttribute(X,f)||i;if(!e.Dom._hasClass(X,W)){e.Dom.setAttribute(X,f,a(Y+b+W));G=true;}}else{}return G;},removeClass:function(W,G){return e.Dom.batch(W,e.Dom._removeClass,G);},_removeClass:function(Y,X){var W=false,aa,Z,G;if(Y&&X){aa=e.Dom._getAttribute(Y,f)||i;e.Dom.setAttribute(Y,f,aa.replace(e.Dom._getClassRegex(X),i));Z=e.Dom._getAttribute(Y,f);if(aa!==Z){e.Dom.setAttribute(Y,f,a(Z));W=true;if(e.Dom._getAttribute(Y,f)===""){G=(Y.hasAttribute&&Y.hasAttribute(E))?E:f;Y.removeAttribute(G);}}}else{}return W;},replaceClass:function(X,W,G){return e.Dom.batch(X,e.Dom._replaceClass,{from:W,to:G});},_replaceClass:function(Y,X){var W,ab,aa,G=false,Z;if(Y&&X){ab=X.from;aa=X.to;if(!aa){G=false;}else{if(!ab){G=e.Dom._addClass(Y,X.to);}else{if(ab!==aa){Z=e.Dom._getAttribute(Y,f)||i;W=(b+Z.replace(e.Dom._getClassRegex(ab),b+aa).replace(/\s+/g,b)).split(e.Dom._getClassRegex(aa));W.splice(1,0,b+aa);e.Dom.setAttribute(Y,f,a(W.join(i)));G=true;}}}}else{}return G;},generateId:function(G,X){X=X||"yui-gen";var W=function(Y){if(Y&&Y.id){return Y.id;}var Z=X+YAHOO.env._id_counter++;
if(Y){if(Y[C]&&Y[C].getElementById(Z)){return e.Dom.generateId(Y,Z+X);}Y.id=Z;}return Z;};return e.Dom.batch(G,W,e.Dom,true)||W.apply(e.Dom,arguments);},isAncestor:function(W,X){W=e.Dom.get(W);X=e.Dom.get(X);var G=false;if((W&&X)&&(W[K]&&X[K])){if(W.contains&&W!==X){G=W.contains(X);}else{if(W.compareDocumentPosition){G=!!(W.compareDocumentPosition(X)&16);}}}else{}return G;},inDocument:function(G,W){return e.Dom._inDoc(e.Dom.get(G),W);},_inDoc:function(W,X){var G=false;if(W&&W[c]){X=X||W[C];G=e.Dom.isAncestor(X[U],W);}else{}return G;},getElementsBy:function(W,af,ab,ad,X,ac,ae){af=af||"*";ab=(ab)?e.Dom.get(ab):null||j;var aa=(ae)?null:[],G;if(ab){G=ab.getElementsByTagName(af);for(var Y=0,Z=G.length;Y<Z;++Y){if(W(G[Y])){if(ae){aa=G[Y];break;}else{aa[aa.length]=G[Y];}}}if(ad){e.Dom.batch(aa,ad,X,ac);}}return aa;},getElementBy:function(X,G,W){return e.Dom.getElementsBy(X,G,W,null,null,null,true);},batch:function(X,ab,aa,Z){var Y=[],W=(Z)?aa:null;X=(X&&(X[c]||X.item))?X:e.Dom.get(X);if(X&&ab){if(X[c]||X.length===undefined){return ab.call(W,X,aa);}for(var G=0;G<X.length;++G){Y[Y.length]=ab.call(W||X[G],X[G],aa);}}else{return false;}return Y;},getDocumentHeight:function(){var W=(j[S]!=l||h)?j.body.scrollHeight:v.scrollHeight,G=Math.max(W,e.Dom.getViewportHeight());return G;},getDocumentWidth:function(){var W=(j[S]!=l||h)?j.body.scrollWidth:v.scrollWidth,G=Math.max(W,e.Dom.getViewportWidth());return G;},getViewportHeight:function(){var G=self.innerHeight,W=j[S];if((W||s)&&!d){G=(W==l)?v.clientHeight:j.body.clientHeight;}return G;},getViewportWidth:function(){var G=self.innerWidth,W=j[S];if(W||s){G=(W==l)?v.clientWidth:j.body.clientWidth;}return G;},getAncestorBy:function(G,W){while((G=G[x])){if(e.Dom._testElement(G,W)){return G;}}return null;},getAncestorByClassName:function(W,G){W=e.Dom.get(W);if(!W){return null;}var X=function(Y){return e.Dom.hasClass(Y,G);};return e.Dom.getAncestorBy(W,X);},getAncestorByTagName:function(W,G){W=e.Dom.get(W);if(!W){return null;}var X=function(Y){return Y[c]&&Y[c].toUpperCase()==G.toUpperCase();};return e.Dom.getAncestorBy(W,X);},getPreviousSiblingBy:function(G,W){while(G){G=G.previousSibling;if(e.Dom._testElement(G,W)){return G;}}return null;},getPreviousSibling:function(G){G=e.Dom.get(G);if(!G){return null;}return e.Dom.getPreviousSiblingBy(G);},getNextSiblingBy:function(G,W){while(G){G=G.nextSibling;if(e.Dom._testElement(G,W)){return G;}}return null;},getNextSibling:function(G){G=e.Dom.get(G);if(!G){return null;}return e.Dom.getNextSiblingBy(G);},getFirstChildBy:function(G,X){var W=(e.Dom._testElement(G.firstChild,X))?G.firstChild:null;return W||e.Dom.getNextSiblingBy(G.firstChild,X);},getFirstChild:function(G,W){G=e.Dom.get(G);if(!G){return null;}return e.Dom.getFirstChildBy(G);},getLastChildBy:function(G,X){if(!G){return null;}var W=(e.Dom._testElement(G.lastChild,X))?G.lastChild:null;return W||e.Dom.getPreviousSiblingBy(G.lastChild,X);},getLastChild:function(G){G=e.Dom.get(G);return e.Dom.getLastChildBy(G);},getChildrenBy:function(W,Y){var X=e.Dom.getFirstChildBy(W,Y),G=X?[X]:[];e.Dom.getNextSiblingBy(X,function(Z){if(!Y||Y(Z)){G[G.length]=Z;}return false;});return G;},getChildren:function(G){G=e.Dom.get(G);if(!G){}return e.Dom.getChildrenBy(G);},getDocumentScrollLeft:function(G){G=G||j;return Math.max(G[U].scrollLeft,G.body.scrollLeft);},getDocumentScrollTop:function(G){G=G||j;return Math.max(G[U].scrollTop,G.body.scrollTop);},insertBefore:function(W,G){W=e.Dom.get(W);G=e.Dom.get(G);if(!W||!G||!G[x]){return null;}return G[x].insertBefore(W,G);},insertAfter:function(W,G){W=e.Dom.get(W);G=e.Dom.get(G);if(!W||!G||!G[x]){return null;}if(G.nextSibling){return G[x].insertBefore(W,G.nextSibling);}else{return G[x].appendChild(W);}},getClientRegion:function(){var X=e.Dom.getDocumentScrollTop(),W=e.Dom.getDocumentScrollLeft(),Y=e.Dom.getViewportWidth()+W,G=e.Dom.getViewportHeight()+X;return new e.Region(X,Y,G,W);},setAttribute:function(W,G,X){e.Dom.batch(W,e.Dom._setAttribute,{attr:G,val:X});},_setAttribute:function(X,W){var G=e.Dom._toCamel(W.attr),Y=W.val;if(X&&X.setAttribute){if(e.Dom.DOT_ATTRIBUTES[G]&&X.tagName&&X.tagName!="BUTTON"){X[G]=Y;}else{G=e.Dom.CUSTOM_ATTRIBUTES[G]||G;X.setAttribute(G,Y);}}else{}},getAttribute:function(W,G){return e.Dom.batch(W,e.Dom._getAttribute,G);},_getAttribute:function(W,G){var X;G=e.Dom.CUSTOM_ATTRIBUTES[G]||G;if(e.Dom.DOT_ATTRIBUTES[G]){X=W[G];}else{if(W&&"getAttribute" in W){if(/^(?:href|src)$/.test(G)){X=W.getAttribute(G,2);}else{X=W.getAttribute(G);}}else{}}return X;},_toCamel:function(W){var X=B;function G(Y,Z){return Z.toUpperCase();}return X[W]||(X[W]=W.indexOf("-")===-1?W:W.replace(/-([a-z])/gi,G));},_getClassRegex:function(W){var G;if(W!==undefined){if(W.exec){G=W;}else{G=F[W];if(!G){W=W.replace(e.Dom._patterns.CLASS_RE_TOKENS,"\\$1");W=W.replace(/\s+/g,b);G=F[W]=new RegExp(R+W+J,t);}}}return G;},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}\\])/g},_testElement:function(G,W){return G&&G[K]==1&&(!W||W(G));},_calcBorders:function(X,Y){var W=parseInt(e.Dom[V](X,q),10)||0,G=parseInt(e.Dom[V](X,P),10)||0;if(g){if(m.test(X[c])){W=0;G=0;}}Y[0]+=G;Y[1]+=W;return Y;}};var r=e.Dom[V];if(L.opera){e.Dom[V]=function(W,G){var X=r(W,G);if(w.test(G)){X=e.Dom.Color.toRGB(X);}return X;};}if(L.webkit){e.Dom[V]=function(W,G){var X=r(W,G);if(X==="rgba(0, 0, 0, 0)"){X="transparent";}return X;};}if(L.ie&&L.ie>=8){e.Dom.DOT_ATTRIBUTES.type=true;}})();YAHOO.util.Region=function(d,e,a,c){this.top=d;this.y=d;this[1]=d;this.right=e;this.bottom=a;this.left=c;this.x=c;this[0]=c;this.width=this.right-this.left;this.height=this.bottom-this.top;};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(f){var d=Math.max(this.top,f.top),e=Math.min(this.right,f.right),a=Math.min(this.bottom,f.bottom),c=Math.max(this.left,f.left);
if(a>=d&&e>=c){return new YAHOO.util.Region(d,e,a,c);}else{return null;}};YAHOO.util.Region.prototype.union=function(f){var d=Math.min(this.top,f.top),e=Math.max(this.right,f.right),a=Math.max(this.bottom,f.bottom),c=Math.min(this.left,f.left);return new YAHOO.util.Region(d,e,a,c);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(e){var g=YAHOO.util.Dom.getXY(e),d=g[1],f=g[0]+e.offsetWidth,a=g[1]+e.offsetHeight,c=g[0];return new YAHOO.util.Region(d,f,a,c);};YAHOO.util.Point=function(a,b){if(YAHOO.lang.isArray(a)){b=a[1];a=a[0];}YAHOO.util.Point.superclass.constructor.call(this,b,a,b,a);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var b=YAHOO.util,a="clientTop",f="clientLeft",j="parentNode",k="right",w="hasLayout",i="px",u="opacity",l="auto",d="borderLeftWidth",g="borderTopWidth",p="borderRightWidth",v="borderBottomWidth",s="visible",q="transparent",n="height",e="width",h="style",t="currentStyle",r=/^width|height$/,o=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,m={get:function(x,z){var y="",A=x[t][z];if(z===u){y=b.Dom.getStyle(x,u);}else{if(!A||(A.indexOf&&A.indexOf(i)>-1)){y=A;}else{if(b.Dom.IE_COMPUTED[z]){y=b.Dom.IE_COMPUTED[z](x,z);}else{if(o.test(A)){y=b.Dom.IE.ComputedStyle.getPixel(x,z);}else{y=A;}}}}return y;},getOffset:function(z,E){var B=z[t][E],x=E.charAt(0).toUpperCase()+E.substr(1),C="offset"+x,y="pixel"+x,A="",D;if(B==l){D=z[C];if(D===undefined){A=0;}A=D;if(r.test(E)){z[h][E]=D;if(z[C]>D){A=D-(z[C]-D);}z[h][E]=l;}}else{if(!z[h][y]&&!z[h][E]){z[h][E]=B;}A=z[h][y];}return A+i;},getBorderWidth:function(x,z){var y=null;if(!x[t][w]){x[h].zoom=1;}switch(z){case g:y=x[a];break;case v:y=x.offsetHeight-x.clientHeight-x[a];break;case d:y=x[f];break;case p:y=x.offsetWidth-x.clientWidth-x[f];break;}return y+i;},getPixel:function(y,x){var A=null,B=y[t][k],z=y[t][x];y[h][k]=z;A=y[h].pixelRight;y[h][k]=B;return A+i;},getMargin:function(y,x){var z;if(y[t][x]==l){z=0+i;}else{z=b.Dom.IE.ComputedStyle.getPixel(y,x);}return z;},getVisibility:function(y,x){var z;while((z=y[t])&&z[x]=="inherit"){y=y[j];}return(z)?z[x]:s;},getColor:function(y,x){return b.Dom.Color.toRGB(y[t][x])||q;},getBorderColor:function(y,x){var z=y[t],A=z[x]||z.color;return b.Dom.Color.toRGB(b.Dom.Color.toHex(A));}},c={};c.top=c.right=c.bottom=c.left=c[e]=c[n]=m.getOffset;c.color=m.getColor;c[g]=c[p]=c[v]=c[d]=m.getBorderWidth;c.marginTop=c.marginRight=c.marginBottom=c.marginLeft=m.getMargin;c.visibility=m.getVisibility;c.borderColor=c.borderTopColor=c.borderRightColor=c.borderBottomColor=c.borderLeftColor=m.getBorderColor;b.Dom.IE_COMPUTED=c;b.Dom.IE_ComputedStyle=m;})();(function(){var c="toString",a=parseInt,b=RegExp,d=YAHOO.util;d.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(e){if(!d.Dom.Color.re_RGB.test(e)){e=d.Dom.Color.toHex(e);}if(d.Dom.Color.re_hex.exec(e)){e="rgb("+[a(b.$1,16),a(b.$2,16),a(b.$3,16)].join(", ")+")";}return e;},toHex:function(f){f=d.Dom.Color.KEYWORDS[f]||f;if(d.Dom.Color.re_RGB.exec(f)){f=[Number(b.$1).toString(16),Number(b.$2).toString(16),Number(b.$3).toString(16)];for(var e=0;e<f.length;e++){if(f[e].length<2){f[e]="0"+f[e];}}f=f.join("");}if(f.length<6){f=f.replace(d.Dom.Color.re_hex3,"$1$1");}if(f!=="transparent"&&f.indexOf("#")<0){f="#"+f;}return f.toUpperCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.9.0",build:"2800"});YAHOO.util.CustomEvent=function(d,c,b,a,e){this.type=d;this.scope=c||window;this.silent=b;this.fireOnce=e;this.fired=false;this.firedWith=null;this.signature=a||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var f="_YUICEOnSubscribe";if(d!==f){this.subscribeEvent=new YAHOO.util.CustomEvent(f,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(b,c,d){if(!b){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(b,c,d);}var a=new YAHOO.util.Subscriber(b,c,d);if(this.fireOnce&&this.fired){this.notify(a,this.firedWith);}else{this.subscribers.push(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 h=[],a=this.subscribers.length;var d=[].slice.call(arguments,0),c=true,f,b=false;if(this.fireOnce){if(this.fired){return true;}else{this.firedWith=d;}}this.fired=true;if(!a&&this.silent){return true;}if(!this.silent){}var e=this.subscribers.slice();for(f=0;f<a;++f){var g=e[f];if(!g||!g.fn){b=true;}else{c=this.notify(g,d);if(false===c){if(!this.silent){}break;}}}return(c!==false);},notify:function(g,c){var b,i=null,f=g.getScope(this.scope),a=YAHOO.util.Event.throwErrors;if(!this.silent){}if(this.signature==YAHOO.util.CustomEvent.FLAT){if(c.length>0){i=c[0];}try{b=g.fn.call(f,i,g.obj);}catch(h){this.lastError=h;if(a){throw h;}}}else{try{b=g.fn.call(f,this.type,c,g.obj);}catch(d){this.lastError=d;if(a){throw d;}}}return b;},unsubscribeAll:function(){var a=this.subscribers.length,b;for(b=a-1;b>-1;b--){this._delete(b);}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+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(a,b,c){this.fn=a;this.obj=YAHOO.lang.isUndefined(b)?null:b;this.overrideContext=c;};YAHOO.util.Subscriber.prototype.getScope=function(a){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}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+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var g=false,h=[],j=[],a=0,e=[],b=0,c={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9},d=YAHOO.env.ua.ie,f="focusin",i="focusout";return{POLL_RETRYS:500,POLL_INTERVAL:40,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:d,_interval:null,_dri:null,_specialTypes:{focusin:(d?"focusin":"focus"),focusout:(d?"focusout":"blur")},DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){this._interval=YAHOO.lang.later(this.POLL_INTERVAL,this,this._tryPreloadAttach,null,true);}},onAvailable:function(q,m,o,p,n){var k=(YAHOO.lang.isString(q))?[q]:q;for(var l=0;l<k.length;l=l+1){e.push({id:k[l],fn:m,obj:o,overrideContext:p,checkReady:n});}a=this.POLL_RETRYS;this.startInterval();},onContentReady:function(n,k,l,m){this.onAvailable(n,k,l,m,true);},onDOMReady:function(){this.DOMReadyEvent.subscribe.apply(this.DOMReadyEvent,arguments);},_addListener:function(m,k,v,p,t,y){if(!v||!v.call){return false;}if(this._isValidCollection(m)){var w=true;for(var q=0,s=m.length;q<s;++q){w=this.on(m[q],k,v,p,t)&&w;}return w;}else{if(YAHOO.lang.isString(m)){var o=this.getEl(m);if(o){m=o;}else{this.onAvailable(m,function(){YAHOO.util.Event._addListener(m,k,v,p,t,y);});return true;}}}if(!m){return false;}if("unload"==k&&p!==this){j[j.length]=[m,k,v,p,t];return true;}var l=m;if(t){if(t===true){l=p;}else{l=t;}}var n=function(z){return v.call(l,YAHOO.util.Event.getEvent(z,m),p);};var x=[m,k,v,n,l,p,t,y];var r=h.length;h[r]=x;try{this._simpleAdd(m,k,n,y);}catch(u){this.lastError=u;this.removeListener(m,k,v);return false;}return true;},_getType:function(k){return this._specialTypes[k]||k;},addListener:function(m,p,l,n,o){var k=((p==f||p==i)&&!YAHOO.env.ua.ie)?true:false;return this._addListener(m,this._getType(p),l,n,o,k);},addFocusListener:function(l,k,m,n){return this.on(l,f,k,m,n);},removeFocusListener:function(l,k){return this.removeListener(l,f,k);},addBlurListener:function(l,k,m,n){return this.on(l,i,k,m,n);},removeBlurListener:function(l,k){return this.removeListener(l,i,k);},removeListener:function(l,k,r){var m,p,u;k=this._getType(k);if(typeof l=="string"){l=this.getEl(l);}else{if(this._isValidCollection(l)){var s=true;for(m=l.length-1;m>-1;m--){s=(this.removeListener(l[m],k,r)&&s);}return s;}}if(!r||!r.call){return this.purgeElement(l,false,k);}if("unload"==k){for(m=j.length-1;m>-1;m--){u=j[m];if(u&&u[0]==l&&u[1]==k&&u[2]==r){j.splice(m,1);return true;}}return false;}var n=null;var o=arguments[3];if("undefined"===typeof o){o=this._getCacheIndex(h,l,k,r);}if(o>=0){n=h[o];}if(!l||!n){return false;}var t=n[this.CAPTURE]===true?true:false;try{this._simpleRemove(l,k,n[this.WFN],t);}catch(q){this.lastError=q;return false;}delete h[o][this.WFN];delete h[o][this.FN];h.splice(o,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 null;}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 c)){k=c[k];}return k;},_getCacheIndex:function(n,q,r,p){for(var o=0,m=n.length;o<m;o=o+1){var k=n[o];if(k&&k[this.FN]==p&&k[this.EL]==q&&k[this.TYPE]==r){return o;}}return -1;},generateId:function(k){var l=k.id;if(!l){l="yuievtautoid-"+b;++b;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",YAHOO,0,0,1),_load:function(l){if(!g){g=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(e.length===0){a=0;if(this._interval){this._interval.cancel();this._interval=null;}return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var q=!g;if(!q){q=(a>0&&e.length>0);}var p=[];var r=function(t,u){var s=t;if(u.overrideContext){if(u.overrideContext===true){s=u.obj;}else{s=u.overrideContext;}}u.fn.call(s,u.obj);};var l,k,o,n,m=[];for(l=0,k=e.length;l<k;l=l+1){o=e[l];if(o){n=this.getEl(o.id);if(n){if(o.checkReady){if(g||n.nextSibling||!q){m.push(o);e[l]=null;}}else{r(n,o);e[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);}a--;if(q){for(l=e.length-1;l>-1;l--){o=e[l];if(!o||!o.id){e.splice(l,1);}}this.startInterval();}else{if(this._interval){this._interval.cancel();this._interval=null;}}this.locked=false;},purgeElement:function(p,q,s){var n=(YAHOO.lang.isString(p))?this.getEl(p):p;var r=this.getListeners(n,s),o,k;if(r){for(o=r.length-1;o>-1;o--){var m=r[o];this.removeListener(n,m.type,m.fn);}}if(q&&n&&n.childNodes){for(o=0,k=n.childNodes.length;o<k;++o){this.purgeElement(n.childNodes[o],q,s);}}},getListeners:function(n,k){var q=[],m;if(!k){m=[h,j];}else{if(k==="unload"){m=[j];}else{k=this._getType(k);m=[h];}}var s=(YAHOO.lang.isString(n))?this.getEl(n):n;for(var p=0;p<m.length;p=p+1){var u=m[p];if(u){for(var r=0,t=u.length;r<t;++r){var o=u[r];if(o&&o[this.EL]===s&&(!k||k===o[this.TYPE])){q.push({type:o[this.TYPE],fn:o[this.FN],obj:o[this.OBJ],adjust:o[this.OVERRIDE],scope:o[this.ADJ_SCOPE],index:r});}}}}return(q.length)?q:null;},_unload:function(s){var m=YAHOO.util.Event,p,o,n,r,q,t=j.slice(),k;for(p=0,r=j.length;p<r;++p){n=t[p];if(n){try{k=window;if(n[m.ADJ_SCOPE]){if(n[m.ADJ_SCOPE]===true){k=n[m.UNLOAD_OBJ];}else{k=n[m.ADJ_SCOPE];}}n[m.FN].call(k,m.getEvent(s,n[m.EL]),n[m.UNLOAD_OBJ]);}catch(w){}t[p]=null;}}n=null;k=null;j=null;if(h){for(o=h.length-1;o>-1;o--){n=h[o];if(n){try{m.removeListener(n[m.EL],n[m.TYPE],n[m.FN],o);}catch(v){}}}n=null;}try{m._simpleRemove(window,"unload",m._unload);m._simpleRemove(window,"load",m._load);}catch(u){}},_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 a=YAHOO.util.Event;a.on=a.addListener;a.onFocus=a.addFocusListener;a.onBlur=a.addBlurListener;
/*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */
if(a.isIE){if(self!==self.top){document.onreadystatechange=function(){if(document.readyState=="complete"){document.onreadystatechange=null;a._ready();}};}else{YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var b=document.createElement("p");a._dri=setInterval(function(){try{b.doScroll("left");clearInterval(a._dri);a._dri=null;a._ready();b=null;}catch(c){}},a.POLL_INTERVAL);}}else{if(a.webkit&&a.webkit<525){a._dri=setInterval(function(){var c=document.readyState;if("loaded"==c||"complete"==c){clearInterval(a._dri);a._dri=null;a._ready();}},a.POLL_INTERVAL);}else{a._simpleAdd(document,"DOMContentLoaded",a._ready);}}a._simpleAdd(window,"load",a._load);a._simpleAdd(window,"unload",a._unload);a._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(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,overrideContext: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(b,g){this.__yui_events=this.__yui_events||{};var e=g||{},d=this.__yui_events,f;if(d[b]){}else{f=new YAHOO.util.CustomEvent(b,e.scope||this,e.silent,YAHOO.util.CustomEvent.FLAT,e.fireOnce);d[b]=f;if(e.onSubscribeCallback){f.subscribeEvent.subscribe(e.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var a=this.__yui_subscribers[b];if(a){for(var c=0;c<a.length;++c){f.subscribe(a[c].fn,a[c].obj,a[c].overrideContext);}}}return d[b];},fireEvent:function(b){this.__yui_events=this.__yui_events||{};var d=this.__yui_events[b];if(!d){return null;}var a=[];for(var c=1;c<arguments.length;++c){a.push(arguments[c]);}return d.fire.apply(d,a);},hasEvent:function(a){if(this.__yui_events){if(this.__yui_events[a]){return true;}}return false;}};(function(){var a=YAHOO.util.Event,c=YAHOO.lang;YAHOO.util.KeyListener=function(d,i,e,f){if(!d){}else{if(!i){}else{if(!e){}}}if(!f){f=YAHOO.util.KeyListener.KEYDOWN;}var g=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(c.isString(d)){d=document.getElementById(d);}if(c.isFunction(e)){g.subscribe(e);}else{g.subscribe(e.fn,e.scope,e.correctScope);}function h(o,n){if(!i.shift){i.shift=false;}if(!i.alt){i.alt=false;}if(!i.ctrl){i.ctrl=false;}if(o.shiftKey==i.shift&&o.altKey==i.alt&&o.ctrlKey==i.ctrl){var j,m=i.keys,l;if(YAHOO.lang.isArray(m)){for(var k=0;k<m.length;k++){j=m[k];l=a.getCharCode(o);if(j==l){g.fire(l,o);break;}}}else{l=a.getCharCode(o);if(m==l){g.fire(l,o);}}}}this.enable=function(){if(!this.enabled){a.on(d,f,h);this.enabledEvent.fire(i);}this.enabled=true;};this.disable=function(){if(this.enabled){a.removeListener(d,f,h);this.disabledEvent.fire(i);}this.enabled=false;};this.toString=function(){return"KeyListener ["+i.keys+"] "+d.tagName+(d.id?"["+d.id+"]":"");};};var b=YAHOO.util.KeyListener;b.KEYDOWN="keydown";b.KEYUP="keyup";b.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.9.0",build:"2800"});YAHOO.register("yahoo-dom-event", YAHOO, {version: "2.9.0", build: "2800"});
/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
(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,f,e){var d=this.getEl();if(this.patterns.noNegatives.test(c)){f=(f>0)?f:0;}if(c in d&&!("style" in d&&c in d.style)){d[c]=f;}else{b.Dom.setStyle(d,c,f+e);}},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("style" in e){if(f||(b.Dom.getStyle(e,"position")=="absolute"&&h)){g=e["offset"+d[0].charAt(0).toUpperCase()+d[0].substr(1)];}else{g=0;}}else{if(c in e){g=e[c];}}return g;},getDefaultUnit:function(c){if(this.patterns.defaultUnit.test(c)){return"px";}return"";},setRuntimeAttribute:function(d){var j;var e;var f=this.attributes;this.runtimeAttributes[d]={};var h=function(i){return(typeof i!=="undefined");};if(!h(f[d]["to"])&&!h(f[d]["by"])){return false;}j=(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(j.constructor==Array){e=[];for(var g=0,c=j.length;g<c;++g){e[g]=j[g]+f[d]["by"][g]*1;}}else{e=j+f[d]["by"]*1;}}}this.runtimeAttributes[d].start=j;this.runtimeAttributes[d].end=e;this.runtimeAttributes[d].unit=(h(f[d].unit))?f[d]["unit"]:this.getDefaultUnit(d);return true;},init:function(f,c,h,i){var d=false;var e=null;var g=0;f=b.Dom.get(f);this.attributes=c||{};this.duration=!YAHOO.lang.isUndefined(h)?h:1;this.method=i||b.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=b.AnimMgr.fps;this.setEl=function(j){f=b.Dom.get(j);};this.getEl=function(){return f;};this.isAnimated=function(){return d;};this.getStartTime=function(){return e;};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(j){if(!this.isAnimated()){return false;}if(j){this.currentFrame=this.totalFrames;this._onTween.fire();}b.AnimMgr.stop(this);};this._handleStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var j in this.attributes){if(this.attributes.hasOwnProperty(j)){this.setRuntimeAttribute(j);}}d=true;g=0;e=new Date();};this._handleTween=function(){var l={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};l.toString=function(){return("duration: "+l.duration+", currentFrame: "+l.currentFrame);};this.onTween.fire(l);var k=this.runtimeAttributes;for(var j in k){if(k.hasOwnProperty(j)){this.setAttribute(j,this.doMethod(j,k[j].start,k[j].end),k[j].unit);}}this.afterTween.fire(l);g+=1;};this._handleComplete=function(){var j=(new Date()-e)/1000;var k={duration:j,frames:g,fps:g/j};k.toString=function(){return("duration: "+k.duration+", frames: "+k.frames+", fps: "+k.fps);};d=false;g=0;this.onComplete.fire(k);};this._onStart=new b.CustomEvent("_start",this,true);this.onStart=new b.CustomEvent("start",this);this.onTween=new b.CustomEvent("tween",this);this.afterTween=new b.CustomEvent("afterTween",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(this._handleStart);this._onTween.subscribe(this._handleTween);this._onComplete.subscribe(this._handleComplete);}};b.Anim=a;})();YAHOO.util.AnimMgr=new function(){var e=null;var c=[];var g=0;this.fps=1000;this.delay=20;this.registerElement=function(j){c[c.length]=j;g+=1;j._onStart.fire();this.start();};var f=[];var d=false;var h=function(){var j=f.shift();b.apply(YAHOO.util.AnimMgr,j);if(f.length){arguments.callee();}};var b=function(k,j){j=j||a(k);if(!k.isAnimated()||j===-1){return false;}k._onComplete.fire();c.splice(j,1);g-=1;if(g<=0){this.stop();}return true;};this.unRegister=function(){f.push(arguments);if(!d){d=true;h();d=false;}};this.start=function(){if(e===null){e=setInterval(this.run,this.delay);}};this.stop=function(l){if(!l){clearInterval(e);for(var k=0,j=c.length;k<j;++k){this.unRegister(c[0],0);}c=[];e=null;g=0;}else{this.unRegister(l);}};this.run=function(){for(var l=0,j=c.length;l<j;++l){var k=c[l];if(!k||!k.isAnimated()){continue;}if(k.currentFrame<k.totalFrames||k.totalFrames===null){k.currentFrame+=1;if(k.useSeconds){i(k);}k._onTween.fire();}else{YAHOO.util.AnimMgr.stop(k,l);}}};var a=function(l){for(var k=0,j=c.length;k<j;++k){if(c[k]===l){return k;}}return -1;};var i=function(k){var n=k.totalFrames;var m=k.currentFrame;var l=(k.currentFrame*k.duration*1000/k.totalFrames);var j=(new Date()-k.getStartTime());var o=0;if(j<k.duration*1000){o=Math.round((j/l-1)*k.currentFrame);}else{o=n-(m+1);}if(o>0&&isFinite(o)){if(k.currentFrame+o>=n){o=n-(m+1);}k.currentFrame+=o;}};this._queue=c;this._getIndex=a;};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";a.DEFAULT_BGCOLOR="#fff";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 i=YAHOO.util.Dom.getStyle(g,e);var h=this;if(this.patterns.transparent.test(i)){var f=YAHOO.util.Dom.getAncestorBy(g,function(j){return !h.patterns.transparent.test(i);});if(f){i=c.Dom.getStyle(f,e);}else{i=a.DEFAULT_BGCOLOR;}}}else{i=d.getAttribute.call(this,e);}return i;};b.doMethod=function(f,k,g){var j;if(this.patterns.color.test(f)){j=[];for(var h=0,e=k.length;h<e;++h){j[h]=d.doMethod.call(this,f,k[h],g[h]);}j="rgb("+Math.floor(j[0])+","+Math.floor(j[1])+","+Math.floor(j[2])+")";}else{j=d.doMethod.call(this,f,k,g);}return j;};b.setRuntimeAttribute=function(f){d.setRuntimeAttribute.call(this,f);if(this.patterns.color.test(f)){var h=this.attributes;var k=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 j=0,e=k.length;j<e;++j){g[j]=k[j]+g[j];}}this.runtimeAttributes[f].start=k;this.runtimeAttributes[f].end=g;}};c.ColorAnim=a;})();
/*!
TERMS OF USE - EASING EQUATIONS
Open source under the BSD License.
Copyright 2001 Robert Penner All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
 * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
YAHOO.util.Easing={easeNone:function(e,a,g,f){return g*e/f+a;},easeIn:function(e,a,g,f){return g*(e/=f)*e+a;},easeOut:function(e,a,g,f){return -g*(e/=f)*(e-2)+a;},easeBoth:function(e,a,g,f){if((e/=f/2)<1){return g/2*e*e+a;}return -g/2*((--e)*(e-2)-1)+a;},easeInStrong:function(e,a,g,f){return g*(e/=f)*e*e*e+a;},easeOutStrong:function(e,a,g,f){return -g*((e=e/f-1)*e*e*e-1)+a;},easeBothStrong:function(e,a,g,f){if((e/=f/2)<1){return g/2*e*e*e*e+a;}return -g/2*((e-=2)*e*e*e-2)+a;},elasticIn:function(g,e,k,j,f,i){if(g==0){return e;}if((g/=j)==1){return e+k;}if(!i){i=j*0.3;}if(!f||f<Math.abs(k)){f=k;var h=i/4;}else{var h=i/(2*Math.PI)*Math.asin(k/f);}return -(f*Math.pow(2,10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i))+e;},elasticOut:function(g,e,k,j,f,i){if(g==0){return e;}if((g/=j)==1){return e+k;}if(!i){i=j*0.3;}if(!f||f<Math.abs(k)){f=k;var h=i/4;}else{var h=i/(2*Math.PI)*Math.asin(k/f);}return f*Math.pow(2,-10*g)*Math.sin((g*j-h)*(2*Math.PI)/i)+k+e;},elasticBoth:function(g,e,k,j,f,i){if(g==0){return e;}if((g/=j/2)==2){return e+k;}if(!i){i=j*(0.3*1.5);}if(!f||f<Math.abs(k)){f=k;var h=i/4;}else{var h=i/(2*Math.PI)*Math.asin(k/f);}if(g<1){return -0.5*(f*Math.pow(2,10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i))+e;}return f*Math.pow(2,-10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i)*0.5+k+e;},backIn:function(e,a,h,g,f){if(typeof f=="undefined"){f=1.70158;}return h*(e/=g)*e*((f+1)*e-f)+a;},backOut:function(e,a,h,g,f){if(typeof f=="undefined"){f=1.70158;}return h*((e=e/g-1)*e*((f+1)*e+f)+1)+a;},backBoth:function(e,a,h,g,f){if(typeof f=="undefined"){f=1.70158;}if((e/=g/2)<1){return h/2*(e*e*(((f*=(1.525))+1)*e-f))+a;}return h/2*((e-=2)*e*(((f*=(1.525))+1)*e+f)+2)+a;},bounceIn:function(e,a,g,f){return g-YAHOO.util.Easing.bounceOut(f-e,0,g,f)+a;},bounceOut:function(e,a,g,f){if((e/=f)<(1/2.75)){return g*(7.5625*e*e)+a;}else{if(e<(2/2.75)){return g*(7.5625*(e-=(1.5/2.75))*e+0.75)+a;}else{if(e<(2.5/2.75)){return g*(7.5625*(e-=(2.25/2.75))*e+0.9375)+a;}}}return g*(7.5625*(e-=(2.625/2.75))*e+0.984375)+a;},bounceBoth:function(e,a,g,f){if(e<f/2){return YAHOO.util.Easing.bounceIn(e*2,0,g,f)*0.5+a;}return YAHOO.util.Easing.bounceOut(e*2-f,0,g,f)*0.5+g*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(q){if(this.patterns.points.test(q)){var h=this.getEl();var k=this.attributes;var g;var m=k["points"]["control"]||[];var j;var n,p;if(m.length>0&&!(m[0] instanceof Array)){m=[m];}else{var l=[];for(n=0,p=m.length;n<p;++n){l[n]=m[n];}m=l;}if(e.Dom.getStyle(h,"position")=="static"){e.Dom.setStyle(h,"position","relative");}if(d(k["points"]["from"])){e.Dom.setXY(h,k["points"]["from"]);}else{e.Dom.setXY(h,e.Dom.getXY(h));}g=this.getAttribute("points");if(d(k["points"]["to"])){j=b.call(this,k["points"]["to"],g);var o=e.Dom.getXY(this.getEl());for(n=0,p=m.length;n<p;++n){m[n]=b.call(this,m[n],g);}}else{if(d(k["points"]["by"])){j=[g[0]+k["points"]["by"][0],g[1]+k["points"]["by"][1]];for(n=0,p=m.length;n<p;++n){m[n]=[g[0]+m[n][0],g[1]+m[n][1]];}}}this.runtimeAttributes[q]=[g];if(m.length>0){this.runtimeAttributes[q]=this.runtimeAttributes[q].concat(m);}this.runtimeAttributes[q][this.runtimeAttributes[q].length]=j;}else{f.setRuntimeAttribute.call(this,q);}};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.9.0",build:"2800"});
/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
(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=this.config,g,e;for(g in f){if(b.hasOwnProperty(f,g)){e=f[g];if(e&&e.event){d[g]=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(d in this.initialConfig){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(v,r){v=v.toLowerCase();var u=this.config[v],l=false,k,g,h,j,p,t,f,n,o,d,m,w,e;if(u&&u.event){if(!b.isUndefined(r)&&u.validator&&!u.validator(r)){return false;}else{if(!b.isUndefined(r)){u.value=r;}else{r=u.value;}l=false;k=this.eventQueue.length;for(m=0;m<k;m++){g=this.eventQueue[m];if(g){h=g[0];j=g[1];if(h==v){this.eventQueue[m]=null;this.eventQueue.push([v,(!b.isUndefined(r)?r:j)]);l=true;break;}}}if(!l&&!b.isUndefined(r)){this.eventQueue.push([v,r]);}}if(u.supercedes){p=u.supercedes.length;for(w=0;w<p;w++){t=u.supercedes[w];f=this.eventQueue.length;for(e=0;e<f;e++){n=this.eventQueue[e];if(n){o=n[0];d=n[1];if(o==t.toLowerCase()){this.eventQueue.push([o,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){if(b.hasOwnProperty(this.config,d)){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.eventQueue[e]=null;this.fireEvent(d,g);}}this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(d,e,g,h){var f=this.config[d.toLowerCase()];if(f&&f.event){if(!a.alreadySubscribed(f.event,e,g)){f.event.subscribe(e,g,h);}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,j){var f=e.subscribers.length,d,g;if(f>0){g=f-1;do{d=e.subscribers[g];if(d&&d.obj==j&&d.fn==h){return true;}}while(g--);}return false;};YAHOO.lang.augmentProto(a,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(r,q){if(r){this.init(r,q);}else{}};var f=YAHOO.util.Dom,d=YAHOO.util.Config,n=YAHOO.util.Event,m=YAHOO.util.CustomEvent,g=YAHOO.widget.Module,i=YAHOO.env.ua,h,p,o,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","DESTROY":"destroy","BEFORE_SHOW":"beforeShow","SHOW":"show","BEFORE_HIDE":"beforeHide","HIDE":"hide"},j={"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.RESIZE_MONITOR_BUFFER=1;g.textResizeEvent=new m("textResize");g.forceDocumentRedraw=function(){var q=document.documentElement;if(q){q.className+=" ";q.className=YAHOO.lang.trim(q.className);}};function l(){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>');p=h.firstChild;o=p.nextSibling;e=o.nextSibling;}return h;}function k(){if(!p){l();}return(p.cloneNode(false));}function b(){if(!o){l();}return(o.cloneNode(false));}function c(){if(!e){l();}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 q=m.LIST;
this.beforeInitEvent=this.createEvent(a.BEFORE_INIT);this.beforeInitEvent.signature=q;this.initEvent=this.createEvent(a.INIT);this.initEvent.signature=q;this.appendEvent=this.createEvent(a.APPEND);this.appendEvent.signature=q;this.beforeRenderEvent=this.createEvent(a.BEFORE_RENDER);this.beforeRenderEvent.signature=q;this.renderEvent=this.createEvent(a.RENDER);this.renderEvent.signature=q;this.changeHeaderEvent=this.createEvent(a.CHANGE_HEADER);this.changeHeaderEvent.signature=q;this.changeBodyEvent=this.createEvent(a.CHANGE_BODY);this.changeBodyEvent.signature=q;this.changeFooterEvent=this.createEvent(a.CHANGE_FOOTER);this.changeFooterEvent.signature=q;this.changeContentEvent=this.createEvent(a.CHANGE_CONTENT);this.changeContentEvent.signature=q;this.destroyEvent=this.createEvent(a.DESTROY);this.destroyEvent.signature=q;this.beforeShowEvent=this.createEvent(a.BEFORE_SHOW);this.beforeShowEvent.signature=q;this.showEvent=this.createEvent(a.SHOW);this.showEvent.signature=q;this.beforeHideEvent=this.createEvent(a.BEFORE_HIDE);this.beforeHideEvent.signature=q;this.hideEvent=this.createEvent(a.HIDE);this.hideEvent.signature=q;},platform:function(){var q=navigator.userAgent.toLowerCase();if(q.indexOf("windows")!=-1||q.indexOf("win32")!=-1){return"windows";}else{if(q.indexOf("macintosh")!=-1){return"mac";}else{return false;}}}(),browser:function(){var q=navigator.userAgent.toLowerCase();if(q.indexOf("opera")!=-1){return"opera";}else{if(q.indexOf("msie 7")!=-1){return"ie7";}else{if(q.indexOf("msie")!=-1){return"ie";}else{if(q.indexOf("safari")!=-1){return"safari";}else{if(q.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(j.VISIBLE.key,{handler:this.configVisible,value:j.VISIBLE.value,validator:j.VISIBLE.validator});this.cfg.addProperty(j.EFFECT.key,{handler:this.configEffect,suppressEvent:j.EFFECT.suppressEvent,supercedes:j.EFFECT.supercedes});this.cfg.addProperty(j.MONITOR_RESIZE.key,{handler:this.configMonitorResize,value:j.MONITOR_RESIZE.value});this.cfg.addProperty(j.APPEND_TO_DOCUMENT_BODY.key,{value:j.APPEND_TO_DOCUMENT_BODY.value});},init:function(v,u){var s,w;this.initEvents();this.beforeInitEvent.fire(g);this.cfg=new d(this);if(this.isSecure){this.imageRoot=g.IMG_ROOT_SSL;}if(typeof v=="string"){s=v;v=document.getElementById(v);if(!v){v=(l()).cloneNode(false);v.id=s;}}this.id=f.generateId(v);this.element=v;w=this.element.firstChild;if(w){var r=false,q=false,t=false;do{if(1==w.nodeType){if(!r&&f.hasClass(w,g.CSS_HEADER)){this.header=w;r=true;}else{if(!q&&f.hasClass(w,g.CSS_BODY)){this.body=w;q=true;}else{if(!t&&f.hasClass(w,g.CSS_FOOTER)){this.footer=w;t=true;}}}}}while((w=w.nextSibling));}this.initDefaultConfig();f.addClass(this.element,g.CSS_MODULE);if(u){this.cfg.applyConfig(u,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 r=(i.gecko&&this.platform=="windows");if(r){var q=this;setTimeout(function(){q._initResizeMonitor();},0);}else{this._initResizeMonitor();}},_initResizeMonitor:function(){var q,s,u;function w(){g.textResizeEvent.fire();}if(!i.opera){s=f.get("_yuiResizeMonitor");var v=this._supportsCWResize();if(!s){s=document.createElement("iframe");if(this.isSecure&&g.RESIZE_MONITOR_SECURE_URL&&i.ie){s.src=g.RESIZE_MONITOR_SECURE_URL;}if(!v){u=["<html><head><script ",'type="text/javascript">',"window.onresize=function(){window.parent.","YAHOO.widget.Module.textResizeEvent.","fire();};<","/script></head>","<body></body></html>"].join("");s.src="data:text/html;charset=utf-8,"+encodeURIComponent(u);}s.id="_yuiResizeMonitor";s.title="Text Resize Monitor";s.tabIndex=-1;s.setAttribute("role","presentation");s.style.position="absolute";s.style.visibility="hidden";var r=document.body,t=r.firstChild;if(t){r.insertBefore(s,t);}else{r.appendChild(s);}s.style.backgroundColor="transparent";s.style.borderWidth="0";s.style.width="2em";s.style.height="2em";s.style.left="0";s.style.top=(-1*(s.offsetHeight+g.RESIZE_MONITOR_BUFFER))+"px";s.style.visibility="visible";if(i.webkit){q=s.contentWindow.document;q.open();q.close();}}if(s&&s.contentWindow){g.textResizeEvent.subscribe(this.onDomResize,this,true);if(!g.textResizeInitialized){if(v){if(!n.on(s.contentWindow,"resize",w)){n.on(s,"resize",w);}}g.textResizeInitialized=true;}this.resizeMonitor=s;}}},_supportsCWResize:function(){var q=true;if(i.gecko&&i.gecko<=1.8){q=false;}return q;},onDomResize:function(s,r){var q=-1*(this.resizeMonitor.offsetHeight+g.RESIZE_MONITOR_BUFFER);this.resizeMonitor.style.top=q+"px";this.resizeMonitor.style.left="0";},setHeader:function(r){var q=this.header||(this.header=k());if(r.nodeName){q.innerHTML="";q.appendChild(r);}else{q.innerHTML=r;}if(this._rendered){this._renderHeader();}this.changeHeaderEvent.fire(r);this.changeContentEvent.fire();},appendToHeader:function(r){var q=this.header||(this.header=k());q.appendChild(r);this.changeHeaderEvent.fire(r);this.changeContentEvent.fire();},setBody:function(r){var q=this.body||(this.body=b());if(r.nodeName){q.innerHTML="";q.appendChild(r);}else{q.innerHTML=r;}if(this._rendered){this._renderBody();}this.changeBodyEvent.fire(r);this.changeContentEvent.fire();},appendToBody:function(r){var q=this.body||(this.body=b());q.appendChild(r);this.changeBodyEvent.fire(r);this.changeContentEvent.fire();},setFooter:function(r){var q=this.footer||(this.footer=c());if(r.nodeName){q.innerHTML="";q.appendChild(r);}else{q.innerHTML=r;}if(this._rendered){this._renderFooter();}this.changeFooterEvent.fire(r);this.changeContentEvent.fire();},appendToFooter:function(r){var q=this.footer||(this.footer=c());q.appendChild(r);this.changeFooterEvent.fire(r);this.changeContentEvent.fire();},render:function(s,q){var t=this;function r(u){if(typeof u=="string"){u=document.getElementById(u);
}if(u){t._addToParent(u,t.element);t.appendEvent.fire();}}this.beforeRenderEvent.fire();if(!q){q=this.element;}if(s){r(s);}else{if(!f.inDocument(this.element)){return false;}}this._renderHeader(q);this._renderBody(q);this._renderFooter(q);this._rendered=true;this.renderEvent.fire();return true;},_renderHeader:function(q){q=q||this.element;if(this.header&&!f.inDocument(this.header)){var r=q.firstChild;if(r){q.insertBefore(this.header,r);}else{q.appendChild(this.header);}}},_renderBody:function(q){q=q||this.element;if(this.body&&!f.inDocument(this.body)){if(this.footer&&f.isAncestor(q,this.footer)){q.insertBefore(this.body,this.footer);}else{q.appendChild(this.body);}}},_renderFooter:function(q){q=q||this.element;if(this.footer&&!f.inDocument(this.footer)){q.appendChild(this.footer);}},destroy:function(q){var r,s=!(q);if(this.element){n.purgeElement(this.element,s);r=this.element.parentNode;}if(r){r.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();},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(r,q,s){var t=q[0];if(t){if(this.beforeShowEvent.fire()){f.setStyle(this.element,"display","block");this.showEvent.fire();}}else{if(this.beforeHideEvent.fire()){f.setStyle(this.element,"display","none");this.hideEvent.fire();}}},configEffect:function(r,q,s){this._cachedEffects=(this.cacheEffects)?this._createEffects(q[0]):null;},cacheEffects:true,_createEffects:function(t){var q=null,u,r,s;if(t){if(t instanceof Array){q=[];u=t.length;for(r=0;r<u;r++){s=t[r];if(s.effect){q[q.length]=s.effect(this,s.duration);}}}else{if(t.effect){q=[t.effect(this,t.duration)];}}}return q;},configMonitorResize:function(s,r,t){var q=r[0];if(q){this.initResizeMonitor();}else{g.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}},_addToParent:function(q,r){if(!this.cfg.getProperty("appendtodocumentbody")&&q===document.body&&q.firstChild){q.insertBefore(r,q.firstChild);}else{q.appendChild(r);}},toString:function(){return"Module "+this.id;}};YAHOO.lang.augmentProto(g,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Overlay=function(p,o){YAHOO.widget.Overlay.superclass.constructor.call(this,p,o);};var i=YAHOO.lang,m=YAHOO.util.CustomEvent,g=YAHOO.widget.Module,n=YAHOO.util.Event,f=YAHOO.util.Dom,d=YAHOO.util.Config,k=YAHOO.env.ua,b=YAHOO.widget.Overlay,h="subscribe",e="unsubscribe",c="contained",j,a={"BEFORE_MOVE":"beforeMove","MOVE":"move"},l={"X":{key:"x",validator:i.isNumber,suppressEvent:true,supercedes:["iframe"]},"Y":{key:"y",validator:i.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,supercedes:["iframe","visible"]},"WIDTH":{key:"width",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"HEIGHT":{key:"height",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"AUTO_FILL_HEIGHT":{key:"autofillheight",supercedes:["height"],value:"body"},"ZINDEX":{key:"zindex",value:null},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:false,validator:i.isBoolean,supercedes:["iframe","x","y","xy"]},"IFRAME":{key:"iframe",value:(k.ie==6?true:false),validator:i.isBoolean,supercedes:["zindex"]},"PREVENT_CONTEXT_OVERLAP":{key:"preventcontextoverlap",value:false,validator:i.isBoolean,supercedes:["constraintoviewport"]}};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.PREVENT_OVERLAP_X={"tltr":true,"blbr":true,"brbl":true,"trtl":true};b.PREVENT_OVERLAP_Y={"trbr":true,"tlbl":true,"bltl":true,"brtr":true};b.CSS_OVERLAY="yui-overlay";b.CSS_HIDDEN="yui-overlay-hidden";b.CSS_IFRAME="yui-overlay-iframe";b.STD_MOD_RE=/^\s*?(body|footer|header)\s*?$/i;b.windowScrollEvent=new m("windowScroll");b.windowResizeEvent=new m("windowResize");b.windowScrollHandler=function(p){var o=n.getTarget(p);if(!o||o===window||o===window.document){if(k.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(o){if(k.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){n.on(window,"scroll",b.windowScrollHandler);n.on(window,"resize",b.windowResizeHandler);b._initialized=true;}b._TRIGGER_MAP={"windowScroll":b.windowScrollEvent,"windowResize":b.windowResizeEvent,"textResize":g.textResizeEvent};YAHOO.extend(b,g,{CONTEXT_TRIGGERS:[],init:function(p,o){b.superclass.init.call(this,p);this.beforeInitEvent.fire(b);f.addClass(this.element,b.CSS_OVERLAY);if(o){this.cfg.applyConfig(o,true);}if(this.platform=="mac"&&k.gecko){if(!d.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}if(!d.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 o=m.LIST;this.beforeMoveEvent=this.createEvent(a.BEFORE_MOVE);this.beforeMoveEvent.signature=o;this.moveEvent=this.createEvent(a.MOVE);this.moveEvent.signature=o;},initDefaultConfig:function(){b.superclass.initDefaultConfig.call(this);var o=this.cfg;o.addProperty(l.X.key,{handler:this.configX,validator:l.X.validator,suppressEvent:l.X.suppressEvent,supercedes:l.X.supercedes});o.addProperty(l.Y.key,{handler:this.configY,validator:l.Y.validator,suppressEvent:l.Y.suppressEvent,supercedes:l.Y.supercedes});
o.addProperty(l.XY.key,{handler:this.configXY,suppressEvent:l.XY.suppressEvent,supercedes:l.XY.supercedes});o.addProperty(l.CONTEXT.key,{handler:this.configContext,suppressEvent:l.CONTEXT.suppressEvent,supercedes:l.CONTEXT.supercedes});o.addProperty(l.FIXED_CENTER.key,{handler:this.configFixedCenter,value:l.FIXED_CENTER.value,validator:l.FIXED_CENTER.validator,supercedes:l.FIXED_CENTER.supercedes});o.addProperty(l.WIDTH.key,{handler:this.configWidth,suppressEvent:l.WIDTH.suppressEvent,supercedes:l.WIDTH.supercedes});o.addProperty(l.HEIGHT.key,{handler:this.configHeight,suppressEvent:l.HEIGHT.suppressEvent,supercedes:l.HEIGHT.supercedes});o.addProperty(l.AUTO_FILL_HEIGHT.key,{handler:this.configAutoFillHeight,value:l.AUTO_FILL_HEIGHT.value,validator:this._validateAutoFill,supercedes:l.AUTO_FILL_HEIGHT.supercedes});o.addProperty(l.ZINDEX.key,{handler:this.configzIndex,value:l.ZINDEX.value});o.addProperty(l.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:l.CONSTRAIN_TO_VIEWPORT.value,validator:l.CONSTRAIN_TO_VIEWPORT.validator,supercedes:l.CONSTRAIN_TO_VIEWPORT.supercedes});o.addProperty(l.IFRAME.key,{handler:this.configIframe,value:l.IFRAME.value,validator:l.IFRAME.validator,supercedes:l.IFRAME.supercedes});o.addProperty(l.PREVENT_CONTEXT_OVERLAP.key,{value:l.PREVENT_CONTEXT_OVERLAP.value,validator:l.PREVENT_CONTEXT_OVERLAP.validator,supercedes:l.PREVENT_CONTEXT_OVERLAP.supercedes});},moveTo:function(o,p){this.cfg.setProperty("xy",[o,p]);},hideMacGeckoScrollbars:function(){f.replaceClass(this.element,"show-scrollbars","hide-scrollbars");},showMacGeckoScrollbars:function(){f.replaceClass(this.element,"hide-scrollbars","show-scrollbars");},_setDomVisibility:function(o){f.setStyle(this.element,"visibility",(o)?"visible":"hidden");var p=b.CSS_HIDDEN;if(o){f.removeClass(this.element,p);}else{f.addClass(this.element,p);}},configVisible:function(x,w,t){var p=w[0],B=f.getStyle(this.element,"visibility"),o=this._cachedEffects||this._createEffects(this.cfg.getProperty("effect")),A=(this.platform=="mac"&&k.gecko),y=d.alreadySubscribed,q,v,s,r,u,z;if(B=="inherit"){v=this.element.parentNode;while(v.nodeType!=9&&v.nodeType!=11){B=f.getStyle(v,"visibility");if(B!="inherit"){break;}v=v.parentNode;}if(B=="inherit"){B="visible";}}if(p){if(A){this.showMacGeckoScrollbars();}if(o){if(p){if(B!="visible"||B===""||this._fadingOut){if(this.beforeShowEvent.fire()){z=o.length;for(s=0;s<z;s++){q=o[s];if(s===0&&!y(q.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){q.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}q.animateIn();}}}}}else{if(B!="visible"||B===""){if(this.beforeShowEvent.fire()){this._setDomVisibility(true);this.cfg.refireEvent("iframe");this.showEvent.fire();}}else{this._setDomVisibility(true);}}}else{if(A){this.hideMacGeckoScrollbars();}if(o){if(B=="visible"||this._fadingIn){if(this.beforeHideEvent.fire()){z=o.length;for(r=0;r<z;r++){u=o[r];if(r===0&&!y(u.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){u.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}u.animateOut();}}}else{if(B===""){this._setDomVisibility(false);}}}else{if(B=="visible"||B===""){if(this.beforeHideEvent.fire()){this._setDomVisibility(false);this.hideEvent.fire();}}else{this._setDomVisibility(false);}}}},doCenterOnDOMEvent:function(){var o=this.cfg,p=o.getProperty("fixedcenter");if(o.getProperty("visible")){if(p&&(p!==c||this.fitsInViewport())){this.center();}}},fitsInViewport:function(){var s=b.VIEWPORT_OFFSET,q=this.element,t=q.offsetWidth,r=q.offsetHeight,o=f.getViewportWidth(),p=f.getViewportHeight();return((t+s<o)&&(r+s<p));},configFixedCenter:function(s,q,t){var u=q[0],p=d.alreadySubscribed,r=b.windowResizeEvent,o=b.windowScrollEvent;if(u){this.center();if(!p(this.beforeShowEvent,this.center)){this.beforeShowEvent.subscribe(this.center);}if(!p(r,this.doCenterOnDOMEvent,this)){r.subscribe(this.doCenterOnDOMEvent,this,true);}if(!p(o,this.doCenterOnDOMEvent,this)){o.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);r.unsubscribe(this.doCenterOnDOMEvent,this);o.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(r,p,s){var o=p[0],q=this.element;f.setStyle(q,"height",o);this.cfg.refireEvent("iframe");},configAutoFillHeight:function(t,s,p){var v=s[0],q=this.cfg,u="autofillheight",w="height",r=q.getProperty(u),o=this._autoFillOnHeightChange;q.unsubscribeFromConfigEvent(w,o);g.textResizeEvent.unsubscribe(o);this.changeContentEvent.unsubscribe(o);if(r&&v!==r&&this[r]){f.setStyle(this[r],w,"");}if(v){v=i.trim(v.toLowerCase());q.subscribeToConfigEvent(w,o,this[v],this);g.textResizeEvent.subscribe(o,this[v],this);this.changeContentEvent.subscribe(o,this[v],this);q.setProperty(u,v,true);}},configWidth:function(r,o,s){var q=o[0],p=this.element;f.setStyle(p,"width",q);this.cfg.refireEvent("iframe");},configzIndex:function(q,o,r){var s=o[0],p=this.element;if(!s){s=f.getStyle(p,"zIndex");if(!s||isNaN(s)){s=0;}}if(this.iframe||this.cfg.getProperty("iframe")===true){if(s<=0){s=1;}}f.setStyle(p,"zIndex",s);this.cfg.setProperty("zIndex",s,true);if(this.iframe){this.stackIframe();}},configXY:function(q,p,r){var t=p[0],o=t[0],s=t[1];this.cfg.setProperty("x",o);this.cfg.setProperty("y",s);this.beforeMoveEvent.fire([o,s]);o=this.cfg.getProperty("x");s=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([o,s]);},configX:function(q,p,r){var o=p[0],s=this.cfg.getProperty("y");this.cfg.setProperty("x",o,true);this.cfg.setProperty("y",s,true);this.beforeMoveEvent.fire([o,s]);o=this.cfg.getProperty("x");s=this.cfg.getProperty("y");f.setX(this.element,o,true);this.cfg.setProperty("xy",[o,s],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([o,s]);},configY:function(q,p,r){var o=this.cfg.getProperty("x"),s=p[0];this.cfg.setProperty("x",o,true);this.cfg.setProperty("y",s,true);this.beforeMoveEvent.fire([o,s]);o=this.cfg.getProperty("x");s=this.cfg.getProperty("y");f.setY(this.element,s,true);
this.cfg.setProperty("xy",[o,s],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([o,s]);},showIframe:function(){var p=this.iframe,o;if(p){o=this.element.parentNode;if(o!=p.parentNode){this._addToParent(o,p);}p.style.display="block";}},hideIframe:function(){if(this.iframe){this.iframe.style.display="none";}},syncIframe:function(){var o=this.iframe,q=this.element,s=b.IFRAME_OFFSET,p=(s*2),r;if(o){o.style.width=(q.offsetWidth+p+"px");o.style.height=(q.offsetHeight+p+"px");r=this.cfg.getProperty("xy");if(!i.isArray(r)||(isNaN(r[0])||isNaN(r[1]))){this.syncPosition();r=this.cfg.getProperty("xy");}f.setXY(o,[(r[0]-s),(r[1]-s)]);}},stackIframe:function(){if(this.iframe){var o=f.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(o)&&!isNaN(o)){f.setStyle(this.iframe,"zIndex",(o-1));}}},configIframe:function(r,q,s){var o=q[0];function t(){var v=this.iframe,w=this.element,x;if(!v){if(!j){j=document.createElement("iframe");if(this.isSecure){j.src=b.IFRAME_SRC;}if(k.ie){j.style.filter="alpha(opacity=0)";j.frameBorder=0;}else{j.style.opacity="0";}j.style.position="absolute";j.style.border="none";j.style.margin="0";j.style.padding="0";j.style.display="none";j.tabIndex=-1;j.className=b.CSS_IFRAME;}v=j.cloneNode(false);v.id=this.id+"_f";x=w.parentNode;var u=x||document.body;this._addToParent(u,v);this.iframe=v;}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 p(){t.call(this);this.beforeShowEvent.unsubscribe(p);this._iframeDeferred=false;}if(o){if(this.cfg.getProperty("visible")){t.call(this);}else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(p);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(p,o,q){var r=o[0];if(r){if(!d.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}if(!d.alreadySubscribed(this.beforeShowEvent,this._primeXYFromDOM)){this.beforeShowEvent.subscribe(this._primeXYFromDOM);}}else{this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(u,t,q){var x=t[0],r,o,v,s,p,w=this.CONTEXT_TRIGGERS;if(x){r=x[0];o=x[1];v=x[2];s=x[3];p=x[4];if(w&&w.length>0){s=(s||[]).concat(w);}if(r){if(typeof r=="string"){this.cfg.setProperty("context",[document.getElementById(r),o,v,s,p],true);}if(o&&v){this.align(o,v,p);}if(this._contextTriggers){this._processTriggers(this._contextTriggers,e,this._alignOnTrigger);}if(s){this._processTriggers(s,h,this._alignOnTrigger);this._contextTriggers=s;}}}},_alignOnTrigger:function(p,o){this.align();},_findTriggerCE:function(o){var p=null;if(o instanceof m){p=o;}else{if(b._TRIGGER_MAP[o]){p=b._TRIGGER_MAP[o];}}return p;},_processTriggers:function(s,v,r){var q,u;for(var p=0,o=s.length;p<o;++p){q=s[p];u=this._findTriggerCE(q);if(u){u[v](r,this,true);}else{this[v](q,r);}}},align:function(p,w,s){var v=this.cfg.getProperty("context"),t=this,o,q,u;function r(z,A){var y=null,x=null;switch(p){case b.TOP_LEFT:y=A;x=z;break;case b.TOP_RIGHT:y=A-q.offsetWidth;x=z;break;case b.BOTTOM_LEFT:y=A;x=z-q.offsetHeight;break;case b.BOTTOM_RIGHT:y=A-q.offsetWidth;x=z-q.offsetHeight;break;}if(y!==null&&x!==null){if(s){y+=s[0];x+=s[1];}t.moveTo(y,x);}}if(v){o=v[0];q=this.element;t=this;if(!p){p=v[1];}if(!w){w=v[2];}if(!s&&v[4]){s=v[4];}if(q&&o){u=f.getRegion(o);switch(w){case b.TOP_LEFT:r(u.top,u.left);break;case b.TOP_RIGHT:r(u.top,u.right);break;case b.BOTTOM_LEFT:r(u.bottom,u.left);break;case b.BOTTOM_RIGHT:r(u.bottom,u.right);break;}}}},enforceConstraints:function(p,o,q){var s=o[0];var r=this.getConstrainedXY(s[0],s[1]);this.cfg.setProperty("x",r[0],true);this.cfg.setProperty("y",r[1],true);this.cfg.setProperty("xy",r,true);},_getConstrainedPos:function(y,p){var t=this.element,r=b.VIEWPORT_OFFSET,A=(y=="x"),z=(A)?t.offsetWidth:t.offsetHeight,s=(A)?f.getViewportWidth():f.getViewportHeight(),D=(A)?f.getDocumentScrollLeft():f.getDocumentScrollTop(),C=(A)?b.PREVENT_OVERLAP_X:b.PREVENT_OVERLAP_Y,o=this.cfg.getProperty("context"),u=(z+r<s),w=this.cfg.getProperty("preventcontextoverlap")&&o&&C[(o[1]+o[2])],v=D+r,B=D+s-z-r,q=p;if(p<v||p>B){if(w){q=this._preventOverlap(y,o[0],z,s,D);}else{if(u){if(p<v){q=v;}else{if(p>B){q=B;}}}else{q=v;}}}return q;},_preventOverlap:function(y,w,z,u,C){var A=(y=="x"),t=b.VIEWPORT_OFFSET,s=this,q=((A)?f.getX(w):f.getY(w))-C,o=(A)?w.offsetWidth:w.offsetHeight,p=q-t,r=(u-(q+o))-t,D=false,v=function(){var x;if((s.cfg.getProperty(y)-C)>q){x=(q-z);}else{x=(q+o);}s.cfg.setProperty(y,(x+C),true);return x;},B=function(){var E=((s.cfg.getProperty(y)-C)>q)?r:p,x;if(z>E){if(D){v();}else{v();D=true;x=B();}}return x;};B();return this.cfg.getProperty(y);},getConstrainedX:function(o){return this._getConstrainedPos("x",o);},getConstrainedY:function(o){return this._getConstrainedPos("y",o);},getConstrainedXY:function(o,p){return[this.getConstrainedX(o),this.getConstrainedY(p)];},center:function(){var r=b.VIEWPORT_OFFSET,s=this.element.offsetWidth,q=this.element.offsetHeight,p=f.getViewportWidth(),t=f.getViewportHeight(),o,u;if(s<p){o=(p/2)-(s/2)+f.getDocumentScrollLeft();}else{o=r+f.getDocumentScrollLeft();}if(q<t){u=(t/2)-(q/2)+f.getDocumentScrollTop();}else{u=r+f.getDocumentScrollTop();}this.cfg.setProperty("xy",[parseInt(o,10),parseInt(u,10)]);this.cfg.refireEvent("iframe");if(k.webkit){this.forceContainerRedraw();}},syncPosition:function(){var o=f.getXY(this.element);
this.cfg.setProperty("x",o[0],true);this.cfg.setProperty("y",o[1],true);this.cfg.setProperty("xy",o,true);},onDomResize:function(q,p){var o=this;b.superclass.onDomResize.call(this,q,p);setTimeout(function(){o.syncPosition();o.cfg.refireEvent("iframe");o.cfg.refireEvent("context");},0);},_getComputedHeight:(function(){if(document.defaultView&&document.defaultView.getComputedStyle){return function(p){var o=null;if(p.ownerDocument&&p.ownerDocument.defaultView){var q=p.ownerDocument.defaultView.getComputedStyle(p,"");if(q){o=parseInt(q.height,10);}}return(i.isNumber(o))?o:null;};}else{return function(p){var o=null;if(p.style.pixelHeight){o=p.style.pixelHeight;}return(i.isNumber(o))?o:null;};}})(),_validateAutoFillHeight:function(o){return(!o)||(i.isString(o)&&b.STD_MOD_RE.test(o));},_autoFillOnHeightChange:function(r,p,q){var o=this.cfg.getProperty("height");if((o&&o!=="auto")||(o===0)){this.fillHeight(q);}},_getPreciseHeight:function(p){var o=p.offsetHeight;if(p.getBoundingClientRect){var q=p.getBoundingClientRect();o=q.bottom-q.top;}return o;},fillHeight:function(r){if(r){var p=this.innerElement||this.element,o=[this.header,this.body,this.footer],v,w=0,x=0,t=0,q=false;for(var u=0,s=o.length;u<s;u++){v=o[u];if(v){if(r!==v){x+=this._getPreciseHeight(v);}else{q=true;}}}if(q){if(k.ie||k.opera){f.setStyle(r,"height",0+"px");}w=this._getComputedHeight(p);if(w===null){f.addClass(p,"yui-override-padding");w=p.clientHeight;f.removeClass(p,"yui-override-padding");}t=Math.max(w-x,0);f.setStyle(r,"height",t+"px");if(r.offsetHeight!=t){t=Math.max(t-(r.offsetHeight-t),0);}f.setStyle(r,"height",t+"px");}}},bringToTop:function(){var s=[],r=this.element;function v(z,y){var B=f.getStyle(z,"zIndex"),A=f.getStyle(y,"zIndex"),x=(!B||isNaN(B))?0:parseInt(B,10),w=(!A||isNaN(A))?0:parseInt(A,10);if(x>w){return -1;}else{if(x<w){return 1;}else{return 0;}}}function q(y){var x=f.hasClass(y,b.CSS_OVERLAY),w=YAHOO.widget.Panel;if(x&&!f.isAncestor(r,y)){if(w&&f.hasClass(y,w.CSS_PANEL)){s[s.length]=y.parentNode;}else{s[s.length]=y;}}}f.getElementsBy(q,"div",document.body);s.sort(v);var o=s[0],u;if(o){u=f.getStyle(o,"zIndex");if(!isNaN(u)){var t=false;if(o!=r){t=true;}else{if(s.length>1){var p=f.getStyle(s[1],"zIndex");if(!isNaN(p)&&(u==p)){t=true;}}}if(t){this.cfg.setProperty("zindex",(parseInt(u,10)+2));}}}},destroy:function(o){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}this.iframe=null;b.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);b.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);g.textResizeEvent.unsubscribe(this._autoFillOnHeightChange);if(this._contextTriggers){this._processTriggers(this._contextTriggers,e,this._alignOnTrigger);}b.superclass.destroy.call(this,o);},forceContainerRedraw:function(){var o=this;f.addClass(o.element,"yui-force-redraw");setTimeout(function(){f.removeClass(o.element,"yui-force-redraw");},0);},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){k.focus();}};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);m.focusEvent.unsubscribe(this._onOverlayFocusHandler,m);m.blurEvent.unsubscribe(this._onOverlayBlurHandler,m);if(!l){c.removeListener(m.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);m.cfg.setProperty("zIndex",j,true);m.cfg.setProperty("manager",null);}if(m.focusEvent._managed){m.focusEvent=null;}if(m.blurEvent._managed){m.blurEvent=null;}if(m.focus._managed){m.focus=null;}if(m.blur._managed){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._manageBlur=function(j){var k=false;if(h==j){e.removeClass(h.element,a.CSS_FOCUSED);h=null;k=true;}return k;};this._manageFocus=function(j){var k=false;if(h!=j){if(h){h.blur();}h=j;this.bringToTop(h);e.addClass(h.element,a.CSS_FOCUSED);k=true;}return k;};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);},_onOverlayFocusHandler:function(h,g,i){this._manageFocus(i);},_onOverlayBlurHandler:function(h,g,i){this._manageBlur(i);},_bindFocus:function(g){var h=this;if(!g.focusEvent){g.focusEvent=g.createEvent("focus");g.focusEvent.signature=f.LIST;g.focusEvent._managed=true;}else{g.focusEvent.subscribe(h._onOverlayFocusHandler,g,h);}if(!g.focus){c.on(g.element,h.cfg.getProperty("focusevent"),h._onOverlayElementFocus,null,g);g.focus=function(){if(h._manageFocus(this)){if(this.cfg.getProperty("visible")&&this.focusFirst){this.focusFirst();}this.focusEvent.fire();}};g.focus._managed=true;}},_bindBlur:function(g){var h=this;if(!g.blurEvent){g.blurEvent=g.createEvent("blur");g.blurEvent.signature=f.LIST;g.focusEvent._managed=true;}else{g.blurEvent.subscribe(h._onOverlayBlurHandler,g,h);}if(!g.blur){g.blur=function(){if(h._manageBlur(this)){this.blurEvent.fire();}};g.blur._managed=true;}g.hideEvent.subscribe(g.blur);
},_bindDestroy:function(g){var h=this;g.destroyEvent.subscribe(h._onOverlayDestroy,g,h);},_syncZIndex:function(g){var h=e.getStyle(g.element,"zIndex");if(!isNaN(h)){g.cfg.setProperty("zIndex",parseInt(h,10));}else{g.cfg.setProperty("zIndex",0);}},register:function(g){var k=false,h,j;if(g instanceof d){g.cfg.addProperty("manager",{value:this});this._bindFocus(g);this._bindBlur(g);this._bindDestroy(g);this._syncZIndex(g);this.overlays.push(g);this.bringToTop(g);k=true;}else{if(g instanceof Array){for(h=0,j=g.length;h<j;h++){k=this.register(g[h])||k;}}}return k;},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 l=g instanceof d,j=this.overlays,p=j.length,k=null,m,h;if(l||typeof g=="string"){for(h=p-1;h>=0;h--){m=j[h];if((l&&(m===g))||(m.id==g)){k=m;break;}}}return k;},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,j=h.length,g;for(g=j-1;g>=0;g--){h[g].show();}},hideAll:function(){var h=this.overlays,j=h.length,g;for(g=j-1;g>=0;g--){h[g].hide();}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.Tooltip=function(p,o){YAHOO.widget.Tooltip.superclass.constructor.call(this,p,o);};var e=YAHOO.lang,n=YAHOO.util.Event,m=YAHOO.util.CustomEvent,c=YAHOO.util.Dom,j=YAHOO.widget.Tooltip,h=YAHOO.env.ua,g=(h.ie&&(h.ie<=6||document.compatMode=="BackCompat")),f,i={"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},"XY_OFFSET":{key:"xyoffset",value:[0,25],suppressEvent:true}},a={"CONTEXT_MOUSE_OVER":"contextMouseOver","CONTEXT_MOUSE_OUT":"contextMouseOut","CONTEXT_TRIGGER":"contextTrigger"};j.CSS_TOOLTIP="yui-tt";function k(q,o){var p=this.cfg,r=p.getProperty("width");if(r==o){p.setProperty("width",q);}}function d(p,o){if("_originalWidth" in this){k.call(this,this._originalWidth,this._forcedWidth);}var q=document.body,u=this.cfg,t=u.getProperty("width"),r,s;if((!t||t=="auto")&&(u.getProperty("container")!=q||u.getProperty("x")>=c.getViewportWidth()||u.getProperty("y")>=c.getViewportHeight())){s=this.element.cloneNode(true);s.style.visibility="hidden";s.style.top="0px";s.style.left="0px";q.appendChild(s);r=(s.offsetWidth+"px");q.removeChild(s);s=null;u.setProperty("width",r);u.refireEvent("xy");this._originalWidth=t||"";this._forcedWidth=r;}}function b(p,o,q){this.render(q);}function l(){n.onDOMReady(b,this.cfg.getProperty("container"),this);}YAHOO.extend(j,YAHOO.widget.Overlay,{init:function(p,o){j.superclass.init.call(this,p);this.beforeInitEvent.fire(j);c.addClass(this.element,j.CSS_TOOLTIP);if(o){this.cfg.applyConfig(o,true);}this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.subscribe("changeContent",d);this.subscribe("init",l);this.subscribe("render",this.onRender);this.initEvent.fire(j);},initEvents:function(){j.superclass.initEvents.call(this);var o=m.LIST;this.contextMouseOverEvent=this.createEvent(a.CONTEXT_MOUSE_OVER);this.contextMouseOverEvent.signature=o;this.contextMouseOutEvent=this.createEvent(a.CONTEXT_MOUSE_OUT);this.contextMouseOutEvent.signature=o;this.contextTriggerEvent=this.createEvent(a.CONTEXT_TRIGGER);this.contextTriggerEvent.signature=o;},initDefaultConfig:function(){j.superclass.initDefaultConfig.call(this);this.cfg.addProperty(i.PREVENT_OVERLAP.key,{value:i.PREVENT_OVERLAP.value,validator:i.PREVENT_OVERLAP.validator,supercedes:i.PREVENT_OVERLAP.supercedes});this.cfg.addProperty(i.SHOW_DELAY.key,{handler:this.configShowDelay,value:200,validator:i.SHOW_DELAY.validator});this.cfg.addProperty(i.AUTO_DISMISS_DELAY.key,{handler:this.configAutoDismissDelay,value:i.AUTO_DISMISS_DELAY.value,validator:i.AUTO_DISMISS_DELAY.validator});this.cfg.addProperty(i.HIDE_DELAY.key,{handler:this.configHideDelay,value:i.HIDE_DELAY.value,validator:i.HIDE_DELAY.validator});this.cfg.addProperty(i.TEXT.key,{handler:this.configText,suppressEvent:i.TEXT.suppressEvent});this.cfg.addProperty(i.CONTAINER.key,{handler:this.configContainer,value:document.body});this.cfg.addProperty(i.DISABLED.key,{handler:this.configContainer,value:i.DISABLED.value,supressEvent:i.DISABLED.suppressEvent});this.cfg.addProperty(i.XY_OFFSET.key,{value:i.XY_OFFSET.value.concat(),supressEvent:i.XY_OFFSET.suppressEvent});},configText:function(p,o,q){var r=o[0];if(r){this.setBody(r);}},configContainer:function(q,p,r){var o=p[0];if(typeof o=="string"){this.cfg.setProperty("container",document.getElementById(o),true);}},_removeEventListeners:function(){var r=this._context,o,q,p;if(r){o=r.length;if(o>0){p=o-1;do{q=r[p];n.removeListener(q,"mouseover",this.onContextMouseOver);n.removeListener(q,"mousemove",this.onContextMouseMove);n.removeListener(q,"mouseout",this.onContextMouseOut);}while(p--);}}},configContext:function(t,p,u){var s=p[0],v,o,r,q;if(s){if(!(s instanceof Array)){if(typeof s=="string"){this.cfg.setProperty("context",[document.getElementById(s)],true);}else{this.cfg.setProperty("context",[s],true);}s=this.cfg.getProperty("context");}this._removeEventListeners();this._context=s;v=this._context;if(v){o=v.length;if(o>0){q=o-1;do{r=v[q];n.on(r,"mouseover",this.onContextMouseOver,this);
n.on(r,"mousemove",this.onContextMouseMove,this);n.on(r,"mouseout",this.onContextMouseOut,this);}while(q--);}}}},onContextMouseMove:function(p,o){o.pageX=n.getPageX(p);o.pageY=n.getPageY(p);},onContextMouseOver:function(q,p){var o=this;if(o.title){p._tempTitle=o.title;o.title="";}if(p.fireEvent("contextMouseOver",o,q)!==false&&!p.cfg.getProperty("disabled")){if(p.hideProcId){clearTimeout(p.hideProcId);p.hideProcId=null;}n.on(o,"mousemove",p.onContextMouseMove,p);p.showProcId=p.doShow(q,o);}},onContextMouseOut:function(q,p){var o=this;if(p._tempTitle){o.title=p._tempTitle;p._tempTitle=null;}if(p.showProcId){clearTimeout(p.showProcId);p.showProcId=null;}if(p.hideProcId){clearTimeout(p.hideProcId);p.hideProcId=null;}p.fireEvent("contextMouseOut",o,q);p.hideProcId=setTimeout(function(){p.hide();},p.cfg.getProperty("hidedelay"));},doShow:function(r,o){var t=this.cfg.getProperty("xyoffset"),p=t[0],s=t[1],q=this;if(h.opera&&o.tagName&&o.tagName.toUpperCase()=="A"){s+=12;}return setTimeout(function(){var u=q.cfg.getProperty("text");if(q._tempTitle&&(u===""||YAHOO.lang.isUndefined(u)||YAHOO.lang.isNull(u))){q.setBody(q._tempTitle);}else{q.cfg.refireEvent("text");}q.moveTo(q.pageX+p,q.pageY+s);if(q.cfg.getProperty("preventoverlap")){q.preventOverlap(q.pageX,q.pageY);}n.removeListener(o,"mousemove",q.onContextMouseMove);q.contextTriggerEvent.fire(o);q.show();q.hideProcId=q.doHide();},this.cfg.getProperty("showdelay"));},doHide:function(){var o=this;return setTimeout(function(){o.hide();},this.cfg.getProperty("autodismissdelay"));},preventOverlap:function(s,r){var o=this.element.offsetHeight,q=new YAHOO.util.Point(s,r),p=c.getRegion(this.element);p.top-=5;p.left-=5;p.right+=5;p.bottom+=5;if(p.contains(q)){this.cfg.setProperty("y",(r-o-5));}},onRender:function(s,r){function t(){var w=this.element,v=this.underlay;if(v){v.style.width=(w.offsetWidth+6)+"px";v.style.height=(w.offsetHeight+1)+"px";}}function p(){c.addClass(this.underlay,"yui-tt-shadow-visible");if(h.ie){this.forceUnderlayRedraw();}}function o(){c.removeClass(this.underlay,"yui-tt-shadow-visible");}function u(){var x=this.underlay,w,v,z,y;if(!x){w=this.element;v=YAHOO.widget.Module;z=h.ie;y=this;if(!f){f=document.createElement("div");f.className="yui-tt-shadow";}x=f.cloneNode(false);w.appendChild(x);this.underlay=x;this._shadow=this.underlay;p.call(this);this.subscribe("beforeShow",p);this.subscribe("hide",o);if(g){window.setTimeout(function(){t.call(y);},0);this.cfg.subscribeToConfigEvent("width",t);this.cfg.subscribeToConfigEvent("height",t);this.subscribe("changeContent",t);v.textResizeEvent.subscribe(t,this,true);this.subscribe("destroy",function(){v.textResizeEvent.unsubscribe(t,this);});}}}function q(){u.call(this);this.unsubscribe("beforeShow",q);}if(this.cfg.getProperty("visible")){u.call(this);}else{this.subscribe("beforeShow",q);}},forceUnderlayRedraw:function(){var o=this;c.addClass(o.underlay,"yui-force-redraw");setTimeout(function(){c.removeClass(o.underlay,"yui-force-redraw");},0);},destroy:function(){this._removeEventListeners();j.superclass.destroy.call(this);},toString:function(){return"Tooltip "+this.id;}});}());(function(){YAHOO.widget.Panel=function(v,u){YAHOO.widget.Panel.superclass.constructor.call(this,v,u);};var s=null;var e=YAHOO.lang,f=YAHOO.util,a=f.Dom,t=f.Event,m=f.CustomEvent,k=YAHOO.util.KeyListener,i=f.Config,h=YAHOO.widget.Overlay,o=YAHOO.widget.Panel,l=YAHOO.env.ua,p=(l.ie&&(l.ie<=6||document.compatMode=="BackCompat")),g,q,c,d={"BEFORE_SHOW_MASK":"beforeShowMask","BEFORE_HIDE_MASK":"beforeHideMask","SHOW_MASK":"showMask","HIDE_MASK":"hideMask","DRAG":"drag"},n={"CLOSE":{key:"close",value:true,validator:e.isBoolean,supercedes:["visible"]},"DRAGGABLE":{key:"draggable",value:(f.DD?true:false),validator:e.isBoolean,supercedes:["visible"]},"DRAG_ONLY":{key:"dragonly",value:false,validator:e.isBoolean,supercedes:["draggable"]},"UNDERLAY":{key:"underlay",value:"shadow",supercedes:["visible"]},"MODAL":{key:"modal",value:false,validator:e.isBoolean,supercedes:["visible","zindex"]},"KEY_LISTENERS":{key:"keylisteners",suppressEvent:true,supercedes:["visible"]},"STRINGS":{key:"strings",supercedes:["close"],validator:e.isObject,value:{close:"Close"}}};o.CSS_PANEL="yui-panel";o.CSS_PANEL_CONTAINER="yui-panel-container";o.FOCUSABLE=["a","button","select","textarea","input","iframe"];function j(v,u){if(!this.header&&this.cfg.getProperty("draggable")){this.setHeader("&#160;");}}function r(v,u,w){var z=w[0],x=w[1],y=this.cfg,A=y.getProperty("width");if(A==x){y.setProperty("width",z);}this.unsubscribe("hide",r,w);}function b(v,u){var y,x,w;if(p){y=this.cfg;x=y.getProperty("width");if(!x||x=="auto"){w=(this.element.offsetWidth+"px");y.setProperty("width",w);this.subscribe("hide",r,[(x||""),w]);}}}YAHOO.extend(o,h,{init:function(v,u){o.superclass.init.call(this,v);this.beforeInitEvent.fire(o);a.addClass(this.element,o.CSS_PANEL);this.buildWrapper();if(u){this.cfg.applyConfig(u,true);}this.subscribe("showMask",this._addFocusHandlers);this.subscribe("hideMask",this._removeFocusHandlers);this.subscribe("beforeRender",j);this.subscribe("render",function(){this.setFirstLastFocusable();this.subscribe("changeContent",this.setFirstLastFocusable);});this.subscribe("show",this._focusOnShow);this.initEvent.fire(o);},_onElementFocus:function(z){if(s===this){var y=t.getTarget(z),x=document.documentElement,v=(y!==x&&y!==window);if(v&&y!==this.element&&y!==this.mask&&!a.isAncestor(this.element,y)){try{this._focusFirstModal();}catch(w){try{if(v&&y!==document.body){y.blur();}}catch(u){}}}}},_focusFirstModal:function(){var u=this.firstElement;if(u){u.focus();}else{if(this._modalFocus){this._modalFocus.focus();}else{this.innerElement.focus();}}},_addFocusHandlers:function(v,u){if(!this.firstElement){if(l.webkit||l.opera){if(!this._modalFocus){this._createHiddenFocusElement();}}else{this.innerElement.tabIndex=0;}}this._setTabLoop(this.firstElement,this.lastElement);t.onFocus(document.documentElement,this._onElementFocus,this,true);s=this;},_createHiddenFocusElement:function(){var u=document.createElement("button");
u.style.height="1px";u.style.width="1px";u.style.position="absolute";u.style.left="-10000em";u.style.opacity=0;u.tabIndex=-1;this.innerElement.appendChild(u);this._modalFocus=u;},_removeFocusHandlers:function(v,u){t.removeFocusListener(document.documentElement,this._onElementFocus,this);if(s==this){s=null;}},_focusOnShow:function(v,u,w){if(u&&u[1]){t.stopEvent(u[1]);}if(!this.focusFirst(v,u,w)){if(this.cfg.getProperty("modal")){this._focusFirstModal();}}},focusFirst:function(w,u,z){var v=this.firstElement,y=false;if(u&&u[1]){t.stopEvent(u[1]);}if(v){try{v.focus();y=true;}catch(x){}}return y;},focusLast:function(w,u,z){var v=this.lastElement,y=false;if(u&&u[1]){t.stopEvent(u[1]);}if(v){try{v.focus();y=true;}catch(x){}}return y;},_setTabLoop:function(u,v){this.setTabLoop(u,v);},setTabLoop:function(x,z){var v=this.preventBackTab,w=this.preventTabOut,u=this.showEvent,y=this.hideEvent;if(v){v.disable();u.unsubscribe(v.enable,v);y.unsubscribe(v.disable,v);v=this.preventBackTab=null;}if(w){w.disable();u.unsubscribe(w.enable,w);y.unsubscribe(w.disable,w);w=this.preventTabOut=null;}if(x){this.preventBackTab=new k(x,{shift:true,keys:9},{fn:this.focusLast,scope:this,correctScope:true});v=this.preventBackTab;u.subscribe(v.enable,v,true);y.subscribe(v.disable,v,true);}if(z){this.preventTabOut=new k(z,{shift:false,keys:9},{fn:this.focusFirst,scope:this,correctScope:true});w=this.preventTabOut;u.subscribe(w.enable,w,true);y.subscribe(w.disable,w,true);}},getFocusableElements:function(v){v=v||this.innerElement;var x={},u=this;for(var w=0;w<o.FOCUSABLE.length;w++){x[o.FOCUSABLE[w]]=true;}return a.getElementsBy(function(y){return u._testIfFocusable(y,x);},null,v);},_testIfFocusable:function(u,v){if(u.focus&&u.type!=="hidden"&&!u.disabled&&v[u.tagName.toLowerCase()]){return true;}return false;},setFirstLastFocusable:function(){this.firstElement=null;this.lastElement=null;var u=this.getFocusableElements();this.focusableElements=u;if(u.length>0){this.firstElement=u[0];this.lastElement=u[u.length-1];}if(this.cfg.getProperty("modal")){this._setTabLoop(this.firstElement,this.lastElement);}},initEvents:function(){o.superclass.initEvents.call(this);var u=m.LIST;this.showMaskEvent=this.createEvent(d.SHOW_MASK);this.showMaskEvent.signature=u;this.beforeShowMaskEvent=this.createEvent(d.BEFORE_SHOW_MASK);this.beforeShowMaskEvent.signature=u;this.hideMaskEvent=this.createEvent(d.HIDE_MASK);this.hideMaskEvent.signature=u;this.beforeHideMaskEvent=this.createEvent(d.BEFORE_HIDE_MASK);this.beforeHideMaskEvent.signature=u;this.dragEvent=this.createEvent(d.DRAG);this.dragEvent.signature=u;},initDefaultConfig:function(){o.superclass.initDefaultConfig.call(this);this.cfg.addProperty(n.CLOSE.key,{handler:this.configClose,value:n.CLOSE.value,validator:n.CLOSE.validator,supercedes:n.CLOSE.supercedes});this.cfg.addProperty(n.DRAGGABLE.key,{handler:this.configDraggable,value:(f.DD)?true:false,validator:n.DRAGGABLE.validator,supercedes:n.DRAGGABLE.supercedes});this.cfg.addProperty(n.DRAG_ONLY.key,{value:n.DRAG_ONLY.value,validator:n.DRAG_ONLY.validator,supercedes:n.DRAG_ONLY.supercedes});this.cfg.addProperty(n.UNDERLAY.key,{handler:this.configUnderlay,value:n.UNDERLAY.value,supercedes:n.UNDERLAY.supercedes});this.cfg.addProperty(n.MODAL.key,{handler:this.configModal,value:n.MODAL.value,validator:n.MODAL.validator,supercedes:n.MODAL.supercedes});this.cfg.addProperty(n.KEY_LISTENERS.key,{handler:this.configKeyListeners,suppressEvent:n.KEY_LISTENERS.suppressEvent,supercedes:n.KEY_LISTENERS.supercedes});this.cfg.addProperty(n.STRINGS.key,{value:n.STRINGS.value,handler:this.configStrings,validator:n.STRINGS.validator,supercedes:n.STRINGS.supercedes});},configClose:function(y,v,z){var A=v[0],x=this.close,u=this.cfg.getProperty("strings"),w;if(A){if(!x){if(!c){c=document.createElement("a");c.className="container-close";c.href="#";}x=c.cloneNode(true);w=this.innerElement.firstChild;if(w){this.innerElement.insertBefore(x,w);}else{this.innerElement.appendChild(x);}x.innerHTML=(u&&u.close)?u.close:"&#160;";t.on(x,"click",this._doClose,this,true);this.close=x;}else{x.style.display="block";}}else{if(x){x.style.display="none";}}},_doClose:function(u){t.preventDefault(u);this.hide();},configDraggable:function(v,u,w){var x=u[0];if(x){if(!f.DD){this.cfg.setProperty("draggable",false);return;}if(this.header){a.setStyle(this.header,"cursor","move");this.registerDragDrop();}this.subscribe("beforeShow",b);}else{if(this.dd){this.dd.unreg();}if(this.header){a.setStyle(this.header,"cursor","auto");}this.unsubscribe("beforeShow",b);}},configUnderlay:function(D,C,z){var B=(this.platform=="mac"&&l.gecko),E=C[0].toLowerCase(),v=this.underlay,w=this.element;function x(){var F=false;if(!v){if(!q){q=document.createElement("div");q.className="underlay";}v=q.cloneNode(false);this.element.appendChild(v);this.underlay=v;if(p){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(l.webkit&&l.webkit<420){this.changeContentEvent.subscribe(this.forceUnderlayRedraw);}F=true;}}function A(){var F=x.call(this);if(!F&&p){this.sizeUnderlay();}this._underlayDeferred=false;this.beforeShowEvent.unsubscribe(A);}function y(){if(this._underlayDeferred){this.beforeShowEvent.unsubscribe(A);this._underlayDeferred=false;}if(v){this.cfg.unsubscribeFromConfigEvent("width",this.sizeUnderlay);this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.forceUnderlayRedraw);YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay,this,true);this.element.removeChild(v);this.underlay=null;}}switch(E){case"shadow":a.removeClass(w,"matte");a.addClass(w,"shadow");break;case"matte":if(!B){y.call(this);}a.removeClass(w,"shadow");a.addClass(w,"matte");break;default:if(!B){y.call(this);
}a.removeClass(w,"shadow");a.removeClass(w,"matte");break;}if((E=="shadow")||(B&&!v)){if(this.cfg.getProperty("visible")){var u=x.call(this);if(!u&&p){this.sizeUnderlay();}}else{if(!this._underlayDeferred){this.beforeShowEvent.subscribe(A);this._underlayDeferred=true;}}}},configModal:function(v,u,x){var w=u[0];if(w){if(!this._hasModalityEventListeners){this.subscribe("beforeShow",this.buildMask);this.subscribe("beforeShow",this.bringToTop);this.subscribe("beforeShow",this.showMask);this.subscribe("hide",this.hideMask);h.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);h.windowResizeEvent.unsubscribe(this.sizeMask,this);this._hasModalityEventListeners=false;}}},removeMask:function(){var v=this.mask,u;if(v){this.hideMask();u=v.parentNode;if(u){u.removeChild(v);}this.mask=null;}},configKeyListeners:function(x,u,A){var w=u[0],z,y,v;if(w){if(w instanceof Array){y=w.length;for(v=0;v<y;v++){z=w[v];if(!i.alreadySubscribed(this.showEvent,z.enable,z)){this.showEvent.subscribe(z.enable,z,true);}if(!i.alreadySubscribed(this.hideEvent,z.disable,z)){this.hideEvent.subscribe(z.disable,z,true);this.destroyEvent.subscribe(z.disable,z,true);}}}else{if(!i.alreadySubscribed(this.showEvent,w.enable,w)){this.showEvent.subscribe(w.enable,w,true);}if(!i.alreadySubscribed(this.hideEvent,w.disable,w)){this.hideEvent.subscribe(w.disable,w,true);this.destroyEvent.subscribe(w.disable,w,true);}}}},configStrings:function(v,u,w){var x=e.merge(n.STRINGS.value,u[0]);this.cfg.setProperty(n.STRINGS.key,x,true);},configHeight:function(x,v,y){var u=v[0],w=this.innerElement;a.setStyle(w,"height",u);this.cfg.refireEvent("iframe");},_autoFillOnHeightChange:function(x,v,w){o.superclass._autoFillOnHeightChange.apply(this,arguments);if(p){var u=this;setTimeout(function(){u.sizeUnderlay();},0);}},configWidth:function(x,u,y){var w=u[0],v=this.innerElement;a.setStyle(v,"width",w);this.cfg.refireEvent("iframe");},configzIndex:function(v,u,x){o.superclass.configzIndex.call(this,v,u,x);if(this.mask||this.cfg.getProperty("modal")===true){var w=a.getStyle(this.element,"zIndex");if(!w||isNaN(w)){w=0;}if(w===0){this.cfg.setProperty("zIndex",1);}else{this.stackMask();}}},buildWrapper:function(){var w=this.element.parentNode,u=this.element,v=document.createElement("div");v.className=o.CSS_PANEL_CONTAINER;v.id=u.id+"_c";if(w){w.insertBefore(v,u);}v.appendChild(u);this.element=v;this.innerElement=u;a.setStyle(this.innerElement,"visibility","inherit");},sizeUnderlay:function(){var v=this.underlay,u;if(v){u=this.element;v.style.width=u.offsetWidth+"px";v.style.height=u.offsetHeight+"px";}},registerDragDrop:function(){var v=this;if(this.header){if(!f.DD){return;}var u=(this.cfg.getProperty("dragonly")===true);this.dd=new f.DD(this.element.id,this.id,{dragOnly:u});if(!this.header.id){this.header.id=this.id+"_h";}this.dd.startDrag=function(){var x,z,w,C,B,A;if(YAHOO.env.ua.ie==6){a.addClass(v.element,"drag");}if(v.cfg.getProperty("constraintoviewport")){var y=h.VIEWPORT_OFFSET;x=v.element.offsetHeight;z=v.element.offsetWidth;w=a.getViewportWidth();C=a.getViewportHeight();B=a.getDocumentScrollLeft();A=a.getDocumentScrollTop();if(x+y<C){this.minY=A+y;this.maxY=A+C-x-y;}else{this.minY=A+y;this.maxY=A+y;}if(z+y<w){this.minX=B+y;this.maxX=B+w-z-y;}else{this.minX=B+y;this.maxX=B+y;}this.constrainX=true;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}v.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){v.syncPosition();v.cfg.refireEvent("iframe");if(this.platform=="mac"&&YAHOO.env.ua.gecko){this.showMacGeckoScrollbars();}v.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(YAHOO.env.ua.ie==6){a.removeClass(v.element,"drag");}v.dragEvent.fire("endDrag",arguments);v.moveEvent.fire(v.cfg.getProperty("xy"));};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}},buildMask:function(){var u=this.mask;if(!u){if(!g){g=document.createElement("div");g.className="mask";g.innerHTML="&#160;";}u=g.cloneNode(true);u.id=this.id+"_mask";document.body.insertBefore(u,document.body.firstChild);this.mask=u;if(YAHOO.env.ua.gecko&&this.platform=="mac"){a.addClass(this.mask,"block-scrollbars");}this.stackMask();}},hideMask:function(){if(this.cfg.getProperty("modal")&&this.mask&&this.beforeHideMaskEvent.fire()){this.mask.style.display="none";a.removeClass(document.body,"masked");this.hideMaskEvent.fire();}},showMask:function(){if(this.cfg.getProperty("modal")&&this.mask&&this.beforeShowMaskEvent.fire()){a.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}},sizeMask:function(){if(this.mask){var v=this.mask,w=a.getViewportWidth(),u=a.getViewportHeight();if(v.offsetHeight>u){v.style.height=u+"px";}if(v.offsetWidth>w){v.style.width=w+"px";}v.style.height=a.getDocumentHeight()+"px";v.style.width=a.getDocumentWidth()+"px";}},stackMask:function(){if(this.mask){var u=a.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(u)&&!isNaN(u)){a.setStyle(this.mask,"zIndex",u-1);}}},render:function(u){return o.superclass.render.call(this,u,this.innerElement);},_renderHeader:function(u){u=u||this.innerElement;o.superclass._renderHeader.call(this,u);},_renderBody:function(u){u=u||this.innerElement;o.superclass._renderBody.call(this,u);},_renderFooter:function(u){u=u||this.innerElement;o.superclass._renderFooter.call(this,u);},destroy:function(u){h.windowResizeEvent.unsubscribe(this.sizeMask,this);this.removeMask();if(this.close){t.purgeElement(this.close);}o.superclass.destroy.call(this,u);},forceUnderlayRedraw:function(){var v=this.underlay;a.addClass(v,"yui-force-redraw");
setTimeout(function(){a.removeClass(v,"yui-force-redraw");},0);},toString:function(){return"Panel "+this.id;}});}());(function(){YAHOO.widget.Dialog=function(j,i){YAHOO.widget.Dialog.superclass.constructor.call(this,j,i);};var b=YAHOO.util.Event,g=YAHOO.util.CustomEvent,e=YAHOO.util.Dom,a=YAHOO.widget.Dialog,f=YAHOO.lang,h={"BEFORE_SUBMIT":"beforeSubmit","SUBMIT":"submit","MANUAL_SUBMIT":"manualSubmit","ASYNC_SUBMIT":"asyncSubmit","FORM_SUBMIT":"formSubmit","CANCEL":"cancel"},c={"POST_METHOD":{key:"postmethod",value:"async"},"POST_DATA":{key:"postdata",value:null},"BUTTONS":{key:"buttons",value:"none",supercedes:["visible"]},"HIDEAFTERSUBMIT":{key:"hideaftersubmit",value:true}};a.CSS_DIALOG="yui-dialog";function d(){var m=this._aButtons,k,l,j;if(f.isArray(m)){k=m.length;if(k>0){j=k-1;do{l=m[j];if(YAHOO.widget.Button&&l instanceof YAHOO.widget.Button){l.destroy();}else{if(l.tagName.toUpperCase()=="BUTTON"){b.purgeElement(l);b.purgeElement(l,false);}}}while(j--);}}}YAHOO.extend(a,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){a.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty(c.POST_METHOD.key,{handler:this.configPostMethod,value:c.POST_METHOD.value,validator:function(i){if(i!="form"&&i!="async"&&i!="none"&&i!="manual"){return false;}else{return true;}}});this.cfg.addProperty(c.POST_DATA.key,{value:c.POST_DATA.value});this.cfg.addProperty(c.HIDEAFTERSUBMIT.key,{value:c.HIDEAFTERSUBMIT.value});this.cfg.addProperty(c.BUTTONS.key,{handler:this.configButtons,value:c.BUTTONS.value,supercedes:c.BUTTONS.supercedes});},initEvents:function(){a.superclass.initEvents.call(this);var i=g.LIST;this.beforeSubmitEvent=this.createEvent(h.BEFORE_SUBMIT);this.beforeSubmitEvent.signature=i;this.submitEvent=this.createEvent(h.SUBMIT);this.submitEvent.signature=i;this.manualSubmitEvent=this.createEvent(h.MANUAL_SUBMIT);this.manualSubmitEvent.signature=i;this.asyncSubmitEvent=this.createEvent(h.ASYNC_SUBMIT);this.asyncSubmitEvent.signature=i;this.formSubmitEvent=this.createEvent(h.FORM_SUBMIT);this.formSubmitEvent.signature=i;this.cancelEvent=this.createEvent(h.CANCEL);this.cancelEvent.signature=i;},init:function(j,i){a.superclass.init.call(this,j);this.beforeInitEvent.fire(a);e.addClass(this.element,a.CSS_DIALOG);this.cfg.setProperty("visible",false);if(i){this.cfg.applyConfig(i,true);}this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.subscribe("changeBody",this.registerForm);this.initEvent.fire(a);},doSubmit:function(){var q=YAHOO.util.Connect,r=this.form,l=false,o=false,s,n,m,j;switch(this.cfg.getProperty("postmethod")){case"async":s=r.elements;n=s.length;if(n>0){m=n-1;do{if(s[m].type=="file"){l=true;break;}}while(m--);}if(l&&YAHOO.env.ua.ie&&this.isSecure){o=true;}j=this._getFormAttributes(r);q.setForm(r,l,o);var k=this.cfg.getProperty("postdata");var p=q.asyncRequest(j.method,j.action,this.callback,k);this.asyncSubmitEvent.fire(p);break;case"form":r.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}},_getFormAttributes:function(k){var i={method:null,action:null};if(k){if(k.getAttributeNode){var j=k.getAttributeNode("action");var l=k.getAttributeNode("method");if(j){i.action=j.value;}if(l){i.method=l.value;}}else{i.action=k.getAttribute("action");i.method=k.getAttribute("method");}}i.method=(f.isString(i.method)?i.method:"POST").toUpperCase();i.action=f.isString(i.action)?i.action:"";return i;},registerForm:function(){var i=this.element.getElementsByTagName("form")[0];if(this.form){if(this.form==i&&e.isAncestor(this.element,this.form)){return;}else{b.purgeElement(this.form);this.form=null;}}if(!i){i=document.createElement("form");i.name="frm_"+this.id;this.body.appendChild(i);}if(i){this.form=i;b.on(i,"submit",this._submitHandler,this,true);}},_submitHandler:function(i){b.stopEvent(i);this.submit();this.form.blur();},setTabLoop:function(i,j){i=i||this.firstButton;j=j||this.lastButton;a.superclass.setTabLoop.call(this,i,j);},_setTabLoop:function(i,j){i=i||this.firstButton;j=this.lastButton||j;this.setTabLoop(i,j);},setFirstLastFocusable:function(){a.superclass.setFirstLastFocusable.call(this);var k,j,m,n=this.focusableElements;this.firstFormElement=null;this.lastFormElement=null;if(this.form&&n&&n.length>0){j=n.length;for(k=0;k<j;++k){m=n[k];if(this.form===m.form){this.firstFormElement=m;break;}}for(k=j-1;k>=0;--k){m=n[k];if(this.form===m.form){this.lastFormElement=m;break;}}}},configClose:function(j,i,k){a.superclass.configClose.apply(this,arguments);},_doClose:function(i){b.preventDefault(i);this.cancel();},configButtons:function(t,s,n){var o=YAHOO.widget.Button,v=s[0],l=this.innerElement,u,q,k,r,p,j,m;d.call(this);this._aButtons=null;if(f.isArray(v)){p=document.createElement("span");p.className="button-group";r=v.length;this._aButtons=[];this.defaultHtmlButton=null;for(m=0;m<r;m++){u=v[m];if(o){k=new o({label:u.text,type:u.type});k.appendTo(p);q=k.get("element");if(u.isDefault){k.addClass("default");this.defaultHtmlButton=q;}if(f.isFunction(u.handler)){k.set("onclick",{fn:u.handler,obj:this,scope:this});}else{if(f.isObject(u.handler)&&f.isFunction(u.handler.fn)){k.set("onclick",{fn:u.handler.fn,obj:((!f.isUndefined(u.handler.obj))?u.handler.obj:this),scope:(u.handler.scope||this)});}}this._aButtons[this._aButtons.length]=k;}else{q=document.createElement("button");q.setAttribute("type","button");if(u.isDefault){q.className="default";this.defaultHtmlButton=q;}q.innerHTML=u.text;if(f.isFunction(u.handler)){b.on(q,"click",u.handler,this,true);}else{if(f.isObject(u.handler)&&f.isFunction(u.handler.fn)){b.on(q,"click",u.handler.fn,((!f.isUndefined(u.handler.obj))?u.handler.obj:this),(u.handler.scope||this));}}p.appendChild(q);this._aButtons[this._aButtons.length]=q;}u.htmlButton=q;if(m===0){this.firstButton=q;}if(m==(r-1)){this.lastButton=q;}}this.setFooter(p);j=this.footer;if(e.inDocument(this.element)&&!e.isAncestor(l,j)){l.appendChild(j);}this.buttonSpan=p;}else{p=this.buttonSpan;
j=this.footer;if(p&&j){j.removeChild(p);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}this.changeContentEvent.fire();},getButtons:function(){return this._aButtons||null;},focusFirst:function(k,i,n){var j=this.firstFormElement,m=false;if(i&&i[1]){b.stopEvent(i[1]);if(i[0]===9&&this.firstElement){j=this.firstElement;}}if(j){try{j.focus();m=true;}catch(l){}}else{if(this.defaultHtmlButton){m=this.focusDefaultButton();}else{m=this.focusFirstButton();}}return m;},focusLast:function(k,i,n){var o=this.cfg.getProperty("buttons"),j=this.lastFormElement,m=false;if(i&&i[1]){b.stopEvent(i[1]);if(i[0]===9&&this.lastElement){j=this.lastElement;}}if(o&&f.isArray(o)){m=this.focusLastButton();}else{if(j){try{j.focus();m=true;}catch(l){}}}return m;},_getButton:function(j){var i=YAHOO.widget.Button;if(i&&j&&j.nodeName&&j.id){j=i.getButton(j.id)||j;}return j;},focusDefaultButton:function(){var i=this._getButton(this.defaultHtmlButton),k=false;if(i){try{i.focus();k=true;}catch(j){}}return k;},blurButtons:function(){var o=this.cfg.getProperty("buttons"),l,n,k,j;if(o&&f.isArray(o)){l=o.length;if(l>0){j=(l-1);do{n=o[j];if(n){k=this._getButton(n.htmlButton);if(k){try{k.blur();}catch(m){}}}}while(j--);}}},focusFirstButton:function(){var m=this.cfg.getProperty("buttons"),k,i,l=false;if(m&&f.isArray(m)){k=m[0];if(k){i=this._getButton(k.htmlButton);if(i){try{i.focus();l=true;}catch(j){}}}}return l;},focusLastButton:function(){var n=this.cfg.getProperty("buttons"),j,l,i,m=false;if(n&&f.isArray(n)){j=n.length;if(j>0){l=n[(j-1)];if(l){i=this._getButton(l.htmlButton);if(i){try{i.focus();m=true;}catch(k){}}}}}return m;},configPostMethod:function(j,i,k){this.registerForm();},validate:function(){return true;},submit:function(){if(this.validate()){if(this.beforeSubmitEvent.fire()){this.doSubmit();this.submitEvent.fire();if(this.cfg.getProperty("hideaftersubmit")){this.hide();}return true;}else{return false;}}else{return false;}},cancel:function(){this.cancelEvent.fire();this.hide();},getData:function(){var A=this.form,k,t,w,m,u,r,q,j,x,l,y,B,p,C,o,z,v;function s(n){var i=n.tagName.toUpperCase();return((i=="INPUT"||i=="TEXTAREA"||i=="SELECT")&&n.name==m);}if(A){k=A.elements;t=k.length;w={};for(z=0;z<t;z++){m=k[z].name;u=e.getElementsBy(s,"*",A);r=u.length;if(r>0){if(r==1){u=u[0];q=u.type;j=u.tagName.toUpperCase();switch(j){case"INPUT":if(q=="checkbox"){w[m]=u.checked;}else{if(q!="radio"){w[m]=u.value;}}break;case"TEXTAREA":w[m]=u.value;break;case"SELECT":x=u.options;l=x.length;y=[];for(v=0;v<l;v++){B=x[v];if(B.selected){o=B.attributes.value;y[y.length]=(o&&o.specified)?B.value:B.text;}}w[m]=y;break;}}else{q=u[0].type;switch(q){case"radio":for(v=0;v<r;v++){p=u[v];if(p.checked){w[m]=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[m]=y;break;}}}}}return w;},destroy:function(i){d.call(this);this._aButtons=null;var j=this.element.getElementsByTagName("form"),k;if(j.length>0){k=j[0];if(k){b.purgeElement(k);if(k.parentNode){k.parentNode.removeChild(k);}this.form=null;}}a.superclass.destroy.call(this,i);},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);var e=this.form.ownerDocument,d=e.createElement("input");d.type="hidden";d.name=this.id;d.value="";this.form.appendChild(d);},configIcon:function(k,j,h){var d=j[0],e=this.body,f=b.ICON_CSS_CLASSNAME,l,i,g;if(d&&d!="none"){l=c.getElementsByClassName(f,"*",e);if(l.length===1){i=l[0];g=i.parentNode;if(g){g.removeChild(i);i=null;}}if(d.indexOf(".")==-1){i=document.createElement("span");i.className=(f+" "+d);i.innerHTML="&#160;";}else{i=document.createElement("img");i.src=(this.imageRoot+d);i.className=f;}if(i){e.insertBefore(i,e.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(e,h,g,d,f){if(!f){f=YAHOO.util.Anim;}this.overlay=e;this.attrIn=h;this.attrOut=g;this.targetElement=d||e.element;this.animClass=f;};var b=YAHOO.util.Dom,c=YAHOO.util.CustomEvent,a=YAHOO.widget.ContainerEffect;a.FADE=function(d,f){var g=YAHOO.util.Easing,i={attributes:{opacity:{from:0,to:1}},duration:f,method:g.easeIn},e={attributes:{opacity:{to:0}},duration:f,method:g.easeOut},h=new a(d,i,e,d.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(d.element,"yui-effect-fade");}}};h.handleUnderlayComplete=function(){var j=this.overlay.underlay;if(j&&YAHOO.env.ua.ie){b.removeClass(d.element,"yui-effect-fade");}};h.handleStartAnimateIn=function(k,j,l){l.overlay._fadingIn=true;b.addClass(l.overlay.element,"hide-select");if(!l.overlay.underlay){l.overlay.cfg.refireEvent("underlay");
}l.handleUnderlayStart();l.overlay._setDomVisibility(true);b.setStyle(l.overlay.element,"opacity",0);};h.handleCompleteAnimateIn=function(k,j,l){l.overlay._fadingIn=false;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){l.overlay._fadingOut=true;b.addClass(l.overlay.element,"hide-select");l.handleUnderlayStart();};h.handleCompleteAnimateOut=function(k,j,l){l.overlay._fadingOut=false;b.removeClass(l.overlay.element,"hide-select");if(l.overlay.element.style.filter){l.overlay.element.style.filter=null;}l.overlay._setDomVisibility(false);b.setStyle(l.overlay.element,"opacity",1);l.handleUnderlayComplete();l.overlay.cfg.refireEvent("iframe");l.animateOutCompleteEvent.fire();};h.init();return h;};a.SLIDE=function(f,d){var i=YAHOO.util.Easing,l=f.cfg.getProperty("x")||b.getX(f.element),k=f.cfg.getProperty("y")||b.getY(f.element),m=b.getClientWidth(),h=f.element.offsetWidth,j={attributes:{points:{to:[l,k]}},duration:d,method:i.easeIn},e={attributes:{points:{to:[(m+25),k]}},duration:d,method:i.easeOut},g=new a(f,j,e,f.element,YAHOO.util.Motion);g.handleStartAnimateIn=function(o,n,p){p.overlay.element.style.left=((-25)-h)+"px";p.overlay.element.style.top=k+"px";};g.handleTweenAnimateIn=function(q,p,r){var s=b.getXY(r.overlay.element),o=s[0],n=s[1];if(b.getStyle(r.overlay.element,"visibility")=="hidden"&&o<l){r.overlay._setDomVisibility(true);}r.overlay.cfg.setProperty("xy",[o,n],true);r.overlay.cfg.refireEvent("iframe");};g.handleCompleteAnimateIn=function(o,n,p){p.overlay.cfg.setProperty("xy",[l,k],true);p.startX=l;p.startY=k;p.overlay.cfg.refireEvent("iframe");p.animateInCompleteEvent.fire();};g.handleStartAnimateOut=function(o,n,r){var p=b.getViewportWidth(),s=b.getXY(r.overlay.element),q=s[1];r.animOut.attributes.points.to=[(p+25),q];};g.handleTweenAnimateOut=function(p,o,q){var s=b.getXY(q.overlay.element),n=s[0],r=s[1];q.overlay.cfg.setProperty("xy",[n,r],true);q.overlay.cfg.refireEvent("iframe");};g.handleCompleteAnimateOut=function(o,n,p){p.overlay._setDomVisibility(false);p.overlay.cfg.setProperty("xy",[l,k]);p.animateOutCompleteEvent.fire();};g.init();return g;};a.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=c.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=c.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=c.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=c.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._stopAnims(this.lastFrameOnStop);this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this._stopAnims(this.lastFrameOnStop);this.beforeAnimateOutEvent.fire();this.animOut.animate();},lastFrameOnStop:true,_stopAnims:function(d){if(this.animOut&&this.animOut.isAnimated()){this.animOut.stop(d);}if(this.animIn&&this.animIn.isAnimated()){this.animIn.stop(d);}},handleStartAnimateIn:function(e,d,f){},handleTweenAnimateIn:function(e,d,f){},handleCompleteAnimateIn:function(e,d,f){},handleStartAnimateOut:function(e,d,f){},handleTweenAnimateOut:function(e,d,f){},handleCompleteAnimateOut:function(e,d,f){},toString:function(){var d="ContainerEffect";if(this.overlay){d+=" ["+this.overlay.toString()+"]";}return d;}};YAHOO.lang.augmentProto(a,YAHOO.util.EventProvider);})();YAHOO.register("container",YAHOO.widget.Module,{version:"2.9.0",build:"2800"});
/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_isFormSubmit:false,_default_headers:{},_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),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);},setDefaultPostHeader:function(a){if(typeof a=="string"){this._default_post_header=a;this._use_default_post_header=true;}else{if(typeof a=="boolean"){this._use_default_post_header=a;}}},setDefaultXhrHeader:function(a){if(typeof a=="string"){this._default_xhr_header=a;}else{this._use_default_xhr_header=a;}},setPollingInterval:function(a){if(typeof a=="number"&&isFinite(a)){this._polling_interval=a;}},createXhrObject:function(g){var d,a,b;try{a=new XMLHttpRequest();d={conn:a,tId:g,xhr:true};}catch(c){for(b=0;b<this._msxml_progid.length;++b){try{a=new ActiveXObject(this._msxml_progid[b]);d={conn:a,tId:g,xhr:true};break;}catch(f){}}}finally{return d;}},getConnectionObject:function(a){var c,d=this._transaction_id;try{if(!a){c=this.createXhrObject(d);}else{c={tId:d};if(a==="xdr"){c.conn=this._transport;c.xdr=true;}else{if(a==="upload"){c.upload=true;}}}if(c){this._transaction_id++;}}catch(b){}return c;},asyncRequest:function(h,d,g,a){var b=g&&g.argument?g.argument:null,e=this,f,c;if(this._isFileUpload){c="upload";}else{if(g&&g.xdr){c="xdr";}}f=this.getConnectionObject(c);if(!f){return null;}else{if(g&&g.customevents){this.initCustomEvents(f,g);}if(this._isFormSubmit){if(this._isFileUpload){window.setTimeout(function(){e.uploadFile(f,g,d,a);},10);return f;}if(h.toUpperCase()=="GET"){if(this._sFormData.length!==0){d+=((d.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(h.toUpperCase()=="POST"){a=a?this._sFormData+"&"+a:this._sFormData;}}}if(h.toUpperCase()=="GET"&&(g&&g.cache===false)){d+=((d.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString();}if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);}}if((h.toUpperCase()==="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);}if(f.xdr){this.xdr(f,h,d,g,a);return f;}f.conn.open(h,d,true);if(this._has_default_headers||this._has_http_headers){this.setHeader(f);}this.handleReadyState(f,g);f.conn.send(a||"");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(f,b);if(f.startEvent){f.startEvent.fire(f,b);}return f;}},initCustomEvents:function(a,c){var b;for(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);a[this._customEvents[b][0]].subscribe(c.customevents[b]);}}},handleReadyState:function(c,d){var b=this,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(b,j,d){var f,a,h=(j&&j.argument)?j.argument:null,c=(b.r&&b.r.statusText==="xdr:success")?true:false,i=(b.r&&b.r.statusText==="xdr:failure")?true:false,k=d;try{if((b.conn.status!==undefined&&b.conn.status!==0)||c){f=b.conn.status;}else{if(i&&!k){f=0;}else{f=13030;}}}catch(g){f=13030;}if((f>=200&&f<300)||f===1223||c){a=b.xdr?b.r:this.createResponseObject(b,h);if(j&&j.success){if(!j.scope){j.success(a);}else{j.success.apply(j.scope,[a]);}}this.successEvent.fire(a);if(b.successEvent){b.successEvent.fire(a);}}else{switch(f){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:a=this.createExceptionObject(b.tId,h,(d?d:false));if(j&&j.failure){if(!j.scope){j.failure(a);}else{j.failure.apply(j.scope,[a]);}}break;default:a=(b.xdr)?b.response:this.createResponseObject(b,h);if(j&&j.failure){if(!j.scope){j.failure(a);}else{j.failure.apply(j.scope,[a]);}}}this.failureEvent.fire(a);if(b.failureEvent){b.failureEvent.fire(a);}}this.releaseObject(b);a=null;},createResponseObject:function(a,h){var d={},k={},f,c,g,b;try{c=a.conn.getAllResponseHeaders();g=c.split("\n");for(f=0;f<g.length;f++){b=g[f].indexOf(":");if(b!=-1){k[g[f].substring(0,b)]=YAHOO.lang.trim(g[f].substring(b+2));}}}catch(j){}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=k;d.getAllResponseHeaders=c;d.responseText=a.conn.responseText;d.responseXML=a.conn.responseXML;if(h){d.argument=h;}return d;},createExceptionObject:function(h,d,a){var f=0,g="communication failure",c=-1,b="transaction aborted",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){var b;if(this._has_default_headers){for(b in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,b)){a.conn.setRequestHeader(b,this._default_headers[b]);
}}}if(this._has_http_headers){for(b in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,b)){a.conn.setRequestHeader(b,this._http_headers[b]);}}this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){this._default_headers={};this._has_default_headers=false;},abort:function(e,g,a){var d,b=(g&&g.argument)?g.argument:null;e=e||{};if(e.conn){if(e.xhr){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.xdr){e.conn.abort(e.tId);d=true;}}}else{if(e.upload){var c="yuiIO"+e.tId;var f=document.getElementById(c);if(f){YAHOO.util.Event.removeListener(f,"load");document.body.removeChild(f);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);}return d;},isCallInProgress:function(a){a=a||{};if(a.xhr&&a.conn){return a.conn.readyState!==4&&a.conn.readyState!==0;}else{if(a.xdr&&a.conn){return a.conn.isCallInProgress(a.tId);}else{if(a.upload===true){return document.getElementById("yuiIO"+a.tId)?true:false;}else{return false;}}}},releaseObject:function(a){if(a&&a.conn){a.conn=null;a=null;}}};(function(){var g=YAHOO.util.Connect,h={};function d(i){var j='<object id="YUIConnectionSwf" type="application/x-shockwave-flash" data="'+i+'" width="0" height="0">'+'<param name="movie" value="'+i+'">'+'<param name="allowScriptAccess" value="always">'+"</object>",k=document.createElement("div");document.body.appendChild(k);k.innerHTML=j;}function b(l,i,j,n,k){h[parseInt(l.tId)]={"o":l,"c":n};if(k){n.method=i;n.data=k;}l.conn.send(j,n,l.tId);}function e(i){d(i);g._transport=document.getElementById("YUIConnectionSwf");}function c(){g.xdrReadyEvent.fire();}function a(j,i){if(j){g.startEvent.fire(j,i.argument);if(j.startEvent){j.startEvent.fire(j,i.argument);}}}function f(j){var k=h[j.tId].o,i=h[j.tId].c;if(j.statusText==="xdr:start"){a(k,i);return;}j.responseText=decodeURI(j.responseText);k.r=j;if(i.argument){k.r.argument=i.argument;}this.handleTransactionResponse(k,i,j.statusText==="xdr:abort"?true:false);delete h[j.tId];}g.xdr=b;g.swf=d;g.transport=e;g.xdrReadyEvent=new YAHOO.util.CustomEvent("xdrReady");g.xdrReady=c;g.handleXdrResponse=f;})();(function(){var e=YAHOO.util.Connect,g=YAHOO.util.Event,a=document.documentMode?document.documentMode:false;e._isFileUpload=false;e._formNode=null;e._sFormData=null;e._submitElementValue=null;e.uploadEvent=new YAHOO.util.CustomEvent("upload");e._hasSubmitListener=function(){if(g){g.addListener(document,"click",function(k){var j=g.getTarget(k),i=j.nodeName.toLowerCase();if((i==="input"||i==="button")&&(j.type&&j.type.toLowerCase()=="submit")){e._submitElementValue=encodeURIComponent(j.name)+"="+encodeURIComponent(j.value);}});return true;}return false;}();function h(w,r,m){var v,l,u,s,z,t=false,p=[],y=0,o,q,n,x,k;this.resetFormState();if(typeof w=="string"){v=(document.getElementById(w)||document.forms[w]);}else{if(typeof w=="object"){v=w;}else{return;}}if(r){this.createFrame(m?m:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=v;return;}for(o=0,q=v.elements.length;o<q;++o){l=v.elements[o];z=l.disabled;u=l.name;if(!z&&u){u=encodeURIComponent(u)+"=";s=encodeURIComponent(l.value);switch(l.type){case"select-one":if(l.selectedIndex>-1){k=l.options[l.selectedIndex];p[y++]=u+encodeURIComponent((k.attributes.value&&k.attributes.value.specified)?k.value:k.text);}break;case"select-multiple":if(l.selectedIndex>-1){for(n=l.selectedIndex,x=l.options.length;n<x;++n){k=l.options[n];if(k.selected){p[y++]=u+encodeURIComponent((k.attributes.value&&k.attributes.value.specified)?k.value:k.text);}}}break;case"radio":case"checkbox":if(l.checked){p[y++]=u+s;}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(t===false){if(this._hasSubmitListener&&this._submitElementValue){p[y++]=this._submitElementValue;}t=true;}break;default:p[y++]=u+s;}}}this._isFormSubmit=true;this._sFormData=p.join("&");this.initHeader("Content-Type",this._default_form_header);return this._sFormData;}function d(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";}function c(i){var j="yuiIO"+this._transaction_id,l=(a===9)?true:false,k;if(YAHOO.env.ua.ie&&!l){k=document.createElement('<iframe id="'+j+'" name="'+j+'" />');if(typeof i=="boolean"){k.src="javascript:false";}}else{k=document.createElement("iframe");k.id=j;k.name=j;}k.style.position="absolute";k.style.top="-1000px";k.style.left="-1000px";document.body.appendChild(k);}function f(j){var m=[],k=j.split("&"),l,n;for(l=0;l<k.length;l++){n=k[l].indexOf("=");if(n!=-1){m[l]=document.createElement("input");m[l].type="hidden";m[l].name=decodeURIComponent(k[l].substring(0,n));m[l].value=decodeURIComponent(k[l].substring(n+1));this._formNode.appendChild(m[l]);}}return m;}function b(m,y,n,l){var t="yuiIO"+m.tId,u="multipart/form-data",w=document.getElementById(t),p=(a>=8)?true:false,z=this,v=(y&&y.argument)?y.argument:null,x,s,k,r,j,q;j={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",n);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",t);if(YAHOO.env.ua.ie&&!p){this._formNode.setAttribute("encoding",u);}else{this._formNode.setAttribute("enctype",u);}if(l){x=this.appendPostData(l);}this._formNode.submit();this.startEvent.fire(m,v);if(m.startEvent){m.startEvent.fire(m,v);}if(y&&y.timeout){this._timeOut[m.tId]=window.setTimeout(function(){z.abort(m,y,true);},y.timeout);}if(x&&x.length>0){for(s=0;s<x.length;s++){this._formNode.removeChild(x[s]);}}for(k in j){if(YAHOO.lang.hasOwnProperty(j,k)){if(j[k]){this._formNode.setAttribute(k,j[k]);}else{this._formNode.removeAttribute(k);}}}this.resetFormState();
q=function(){var i,A,B;if(y&&y.timeout){window.clearTimeout(z._timeOut[m.tId]);delete z._timeOut[m.tId];}z.completeEvent.fire(m,v);if(m.completeEvent){m.completeEvent.fire(m,v);}r={tId:m.tId,argument:v};try{i=w.contentWindow.document.getElementsByTagName("body")[0];A=w.contentWindow.document.getElementsByTagName("pre")[0];if(i){if(A){B=A.textContent?A.textContent:A.innerText;}else{B=i.textContent?i.textContent:i.innerText;}}r.responseText=B;r.responseXML=w.contentWindow.document.XMLDocument?w.contentWindow.document.XMLDocument:w.contentWindow.document;}catch(o){}if(y&&y.upload){if(!y.scope){y.upload(r);}else{y.upload.apply(y.scope,[r]);}}z.uploadEvent.fire(r);if(m.uploadEvent){m.uploadEvent.fire(r);}g.removeListener(w,"load",q);setTimeout(function(){document.body.removeChild(w);z.releaseObject(m);},100);};g.addListener(w,"load",q);}e.setForm=h;e.resetFormState=d;e.createFrame=c;e.appendPostData=f;e.uploadFile=b;})();YAHOO.register("connection",YAHOO.util.Connect,{version:"2.9.0",build:"2800"});
/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
(function(){var lang=YAHOO.lang,util=YAHOO.util,Ev=util.Event;util.DataSourceBase=function(oLiveData,oConfigs){if(oLiveData===null||oLiveData===undefined){return;}this.liveData=oLiveData;this._oQueue={interval:null,conn:null,requests:[]};this.responseSchema={};if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}var maxCacheEntries=this.maxCacheEntries;if(!lang.isNumber(maxCacheEntries)||(maxCacheEntries<0)){maxCacheEntries=0;}this._aIntervals=[];this.createEvent("cacheRequestEvent");this.createEvent("cacheResponseEvent");this.createEvent("requestEvent");this.createEvent("responseEvent");this.createEvent("responseParseEvent");this.createEvent("responseCacheEvent");this.createEvent("dataErrorEvent");this.createEvent("cacheFlushEvent");var DS=util.DataSourceBase;this._sName="DataSource instance"+DS._nIndex;DS._nIndex++;};var DS=util.DataSourceBase;lang.augmentObject(DS,{TYPE_UNKNOWN:-1,TYPE_JSARRAY:0,TYPE_JSFUNCTION:1,TYPE_XHR:2,TYPE_JSON:3,TYPE_XML:4,TYPE_TEXT:5,TYPE_HTMLTABLE:6,TYPE_SCRIPTNODE:7,TYPE_LOCAL:8,ERROR_DATAINVALID:"Invalid data",ERROR_DATANULL:"Null data",_nIndex:0,_nTransactionId:0,_cloneObject:function(o){if(!lang.isValue(o)){return o;}var copy={};if(Object.prototype.toString.apply(o)==="[object RegExp]"){copy=o;}else{if(lang.isFunction(o)){copy=o;}else{if(lang.isArray(o)){var array=[];for(var i=0,len=o.length;i<len;i++){array[i]=DS._cloneObject(o[i]);}copy=array;}else{if(lang.isObject(o)){for(var x in o){if(lang.hasOwnProperty(o,x)){if(lang.isValue(o[x])&&lang.isObject(o[x])||lang.isArray(o[x])){copy[x]=DS._cloneObject(o[x]);}else{copy[x]=o[x];}}}}else{copy=o;}}}}return copy;},_getLocationValue:function(field,context){var locator=field.locator||field.key||field,xmldoc=context.ownerDocument||context,result,res,value=null;try{if(!lang.isUndefined(xmldoc.evaluate)){result=xmldoc.evaluate(locator,context,xmldoc.createNSResolver(!context.ownerDocument?context.documentElement:context.ownerDocument.documentElement),0,null);while(res=result.iterateNext()){value=res.textContent;}}else{xmldoc.setProperty("SelectionLanguage","XPath");result=context.selectNodes(locator)[0];value=result.value||result.text||null;}return value;}catch(e){}},issueCallback:function(callback,params,error,scope){if(lang.isFunction(callback)){callback.apply(scope,params);}else{if(lang.isObject(callback)){scope=callback.scope||scope||window;var callbackFunc=callback.success;if(error){callbackFunc=callback.failure;}if(callbackFunc){callbackFunc.apply(scope,params.concat([callback.argument]));}}}},parseString:function(oData){if(!lang.isValue(oData)){return null;}var string=oData+"";if(lang.isString(string)){return string;}else{return null;}},parseNumber:function(oData){if(!lang.isValue(oData)||(oData==="")){return null;}var number=oData*1;if(lang.isNumber(number)){return number;}else{return null;}},convertNumber:function(oData){return DS.parseNumber(oData);},parseDate:function(oData){var date=null;if(lang.isValue(oData)&&!(oData instanceof Date)){date=new Date(oData);}else{return oData;}if(date instanceof Date){return date;}else{return null;}},convertDate:function(oData){return DS.parseDate(oData);}});DS.Parser={string:DS.parseString,number:DS.parseNumber,date:DS.parseDate};DS.prototype={_sName:null,_aCache:null,_oQueue:null,_aIntervals:null,maxCacheEntries:0,liveData:null,dataType:DS.TYPE_UNKNOWN,responseType:DS.TYPE_UNKNOWN,responseSchema:null,useXPath:false,cloneBeforeCaching:false,toString:function(){return this._sName;},getCachedResponse:function(oRequest,oCallback,oCaller){var aCache=this._aCache;if(this.maxCacheEntries>0){if(!aCache){this._aCache=[];}else{var nCacheLength=aCache.length;if(nCacheLength>0){var oResponse=null;this.fireEvent("cacheRequestEvent",{request:oRequest,callback:oCallback,caller:oCaller});for(var i=nCacheLength-1;i>=0;i--){var oCacheElem=aCache[i];if(this.isCacheHit(oRequest,oCacheElem.request)){oResponse=oCacheElem.response;this.fireEvent("cacheResponseEvent",{request:oRequest,response:oResponse,callback:oCallback,caller:oCaller});if(i<nCacheLength-1){aCache.splice(i,1);this.addToCache(oRequest,oResponse);}oResponse.cached=true;break;}}return oResponse;}}}else{if(aCache){this._aCache=null;}}return null;},isCacheHit:function(oRequest,oCachedRequest){return(oRequest===oCachedRequest);},addToCache:function(oRequest,oResponse){var aCache=this._aCache;if(!aCache){return;}while(aCache.length>=this.maxCacheEntries){aCache.shift();}oResponse=(this.cloneBeforeCaching)?DS._cloneObject(oResponse):oResponse;var oCacheElem={request:oRequest,response:oResponse};aCache[aCache.length]=oCacheElem;this.fireEvent("responseCacheEvent",{request:oRequest,response:oResponse});},flushCache:function(){if(this._aCache){this._aCache=[];this.fireEvent("cacheFlushEvent");}},setInterval:function(nMsec,oRequest,oCallback,oCaller){if(lang.isNumber(nMsec)&&(nMsec>=0)){var oSelf=this;var nId=setInterval(function(){oSelf.makeConnection(oRequest,oCallback,oCaller);},nMsec);this._aIntervals.push(nId);return nId;}else{}},clearInterval:function(nId){var tracker=this._aIntervals||[];for(var i=tracker.length-1;i>-1;i--){if(tracker[i]===nId){tracker.splice(i,1);clearInterval(nId);}}},clearAllIntervals:function(){var tracker=this._aIntervals||[];for(var i=tracker.length-1;i>-1;i--){clearInterval(tracker[i]);}tracker=[];},sendRequest:function(oRequest,oCallback,oCaller){var oCachedResponse=this.getCachedResponse(oRequest,oCallback,oCaller);if(oCachedResponse){DS.issueCallback(oCallback,[oRequest,oCachedResponse],false,oCaller);return null;}return this.makeConnection(oRequest,oCallback,oCaller);},makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=this.liveData;this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);return tId;},handleResponse:function(oRequest,oRawResponse,oCallback,oCaller,tId){this.fireEvent("responseEvent",{tId:tId,request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller});
var xhr=(this.dataType==DS.TYPE_XHR)?true:false;var oParsedResponse=null;var oFullResponse=oRawResponse;if(this.responseType===DS.TYPE_UNKNOWN){var ctype=(oRawResponse&&oRawResponse.getResponseHeader)?oRawResponse.getResponseHeader["Content-Type"]:null;if(ctype){if(ctype.indexOf("text/xml")>-1){this.responseType=DS.TYPE_XML;}else{if(ctype.indexOf("application/json")>-1){this.responseType=DS.TYPE_JSON;}else{if(ctype.indexOf("text/plain")>-1){this.responseType=DS.TYPE_TEXT;}}}}else{if(YAHOO.lang.isArray(oRawResponse)){this.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse&&oRawResponse.nodeType&&(oRawResponse.nodeType===9||oRawResponse.nodeType===1||oRawResponse.nodeType===11)){this.responseType=DS.TYPE_XML;}else{if(oRawResponse&&oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){this.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){this.responseType=DS.TYPE_TEXT;}}}}}}}switch(this.responseType){case DS.TYPE_JSARRAY:if(xhr&&oRawResponse&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}try{if(lang.isString(oFullResponse)){var parseArgs=[oFullResponse].concat(this.parseJSONArgs);if(lang.JSON){oFullResponse=lang.JSON.parse.apply(lang.JSON,parseArgs);}else{if(window.JSON&&JSON.parse){oFullResponse=JSON.parse.apply(JSON,parseArgs);}else{if(oFullResponse.parseJSON){oFullResponse=oFullResponse.parseJSON.apply(oFullResponse,parseArgs.slice(1));}else{while(oFullResponse.length>0&&(oFullResponse.charAt(0)!="{")&&(oFullResponse.charAt(0)!="[")){oFullResponse=oFullResponse.substring(1,oFullResponse.length);}if(oFullResponse.length>0){var arrayEnd=Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));oFullResponse=oFullResponse.substring(0,arrayEnd+1);oFullResponse=eval("("+oFullResponse+")");}}}}}}catch(e1){}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseArrayData(oRequest,oFullResponse);break;case DS.TYPE_JSON:if(xhr&&oRawResponse&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}try{if(lang.isString(oFullResponse)){var parseArgs=[oFullResponse].concat(this.parseJSONArgs);if(lang.JSON){oFullResponse=lang.JSON.parse.apply(lang.JSON,parseArgs);}else{if(window.JSON&&JSON.parse){oFullResponse=JSON.parse.apply(JSON,parseArgs);}else{if(oFullResponse.parseJSON){oFullResponse=oFullResponse.parseJSON.apply(oFullResponse,parseArgs.slice(1));}else{while(oFullResponse.length>0&&(oFullResponse.charAt(0)!="{")&&(oFullResponse.charAt(0)!="[")){oFullResponse=oFullResponse.substring(1,oFullResponse.length);}if(oFullResponse.length>0){var objEnd=Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));oFullResponse=oFullResponse.substring(0,objEnd+1);oFullResponse=eval("("+oFullResponse+")");}}}}}}catch(e){}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseJSONData(oRequest,oFullResponse);break;case DS.TYPE_HTMLTABLE:if(xhr&&oRawResponse.responseText){var el=document.createElement("div");el.innerHTML=oRawResponse.responseText;oFullResponse=el.getElementsByTagName("table")[0];}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseHTMLTableData(oRequest,oFullResponse);break;case DS.TYPE_XML:if(xhr&&oRawResponse.responseXML){oFullResponse=oRawResponse.responseXML;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseXMLData(oRequest,oFullResponse);break;case DS.TYPE_TEXT:if(xhr&&lang.isString(oRawResponse.responseText)){oFullResponse=oRawResponse.responseText;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseTextData(oRequest,oFullResponse);break;default:oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseData(oRequest,oFullResponse);break;}oParsedResponse=oParsedResponse||{};if(!oParsedResponse.results){oParsedResponse.results=[];}if(!oParsedResponse.meta){oParsedResponse.meta={};}if(!oParsedResponse.error){oParsedResponse=this.doBeforeCallback(oRequest,oFullResponse,oParsedResponse,oCallback);this.fireEvent("responseParseEvent",{request:oRequest,response:oParsedResponse,callback:oCallback,caller:oCaller});this.addToCache(oRequest,oParsedResponse);}else{oParsedResponse.error=true;this.fireEvent("dataErrorEvent",{request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller,message:DS.ERROR_DATANULL});}oParsedResponse.tId=tId;DS.issueCallback(oCallback,[oRequest,oParsedResponse],oParsedResponse.error,oCaller);},doBeforeParseData:function(oRequest,oFullResponse,oCallback){return oFullResponse;},doBeforeCallback:function(oRequest,oFullResponse,oParsedResponse,oCallback){return oParsedResponse;},parseData:function(oRequest,oFullResponse){if(lang.isValue(oFullResponse)){var oParsedResponse={results:oFullResponse,meta:{}};return oParsedResponse;}return null;},parseArrayData:function(oRequest,oFullResponse){if(lang.isArray(oFullResponse)){var results=[],i,j,rec,field,data;if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(i=fields.length-1;i>=0;--i){if(typeof fields[i]!=="object"){fields[i]={key:fields[i]};}}var parsers={},p;for(i=fields.length-1;i>=0;--i){p=(typeof fields[i].parser==="function"?fields[i].parser:DS.Parser[fields[i].parser+""])||fields[i].converter;if(p){parsers[fields[i].key]=p;}}var arrType=lang.isArray(oFullResponse[0]);for(i=oFullResponse.length-1;i>-1;i--){var oResult={};rec=oFullResponse[i];if(typeof rec==="object"){for(j=fields.length-1;j>-1;j--){field=fields[j];data=arrType?rec[j]:rec[field.key];if(parsers[field.key]){data=parsers[field.key].call(this,data);}if(data===undefined){data=null;}oResult[field.key]=data;}}else{if(lang.isString(rec)){for(j=fields.length-1;j>-1;j--){field=fields[j];data=rec;if(parsers[field.key]){data=parsers[field.key].call(this,data);}if(data===undefined){data=null;}oResult[field.key]=data;
}}}results[i]=oResult;}}else{results=oFullResponse;}var oParsedResponse={results:results};return oParsedResponse;}return null;},parseTextData:function(oRequest,oFullResponse){if(lang.isString(oFullResponse)){if(lang.isString(this.responseSchema.recordDelim)&&lang.isString(this.responseSchema.fieldDelim)){var oParsedResponse={results:[]};var recDelim=this.responseSchema.recordDelim;var fieldDelim=this.responseSchema.fieldDelim;if(oFullResponse.length>0){var newLength=oFullResponse.length-recDelim.length;if(oFullResponse.substr(newLength)==recDelim){oFullResponse=oFullResponse.substr(0,newLength);}if(oFullResponse.length>0){var recordsarray=oFullResponse.split(recDelim);for(var i=0,len=recordsarray.length,recIdx=0;i<len;++i){var bError=false,sRecord=recordsarray[i];if(lang.isString(sRecord)&&(sRecord.length>0)){var fielddataarray=recordsarray[i].split(fieldDelim);var oResult={};if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(var j=fields.length-1;j>-1;j--){try{var data=fielddataarray[j];if(lang.isString(data)){if(data.charAt(0)=='"'){data=data.substr(1);}if(data.charAt(data.length-1)=='"'){data=data.substr(0,data.length-1);}var field=fields[j];var key=(lang.isValue(field.key))?field.key:field;if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}else{bError=true;}}catch(e){bError=true;}}}else{oResult=fielddataarray;}if(!bError){oParsedResponse.results[recIdx++]=oResult;}}}}}return oParsedResponse;}}return null;},parseXMLResult:function(result){var oResult={},schema=this.responseSchema;try{for(var m=schema.fields.length-1;m>=0;m--){var field=schema.fields[m];var key=(lang.isValue(field.key))?field.key:field;var data=null;if(this.useXPath){data=YAHOO.util.DataSource._getLocationValue(field,result);}else{var xmlAttr=result.attributes.getNamedItem(key);if(xmlAttr){data=xmlAttr.value;}else{var xmlNode=result.getElementsByTagName(key);if(xmlNode&&xmlNode.item(0)){var item=xmlNode.item(0);data=(item)?((item.text)?item.text:(item.textContent)?item.textContent:null):null;if(!data){var datapieces=[];for(var j=0,len=item.childNodes.length;j<len;j++){if(item.childNodes[j].nodeValue){datapieces[datapieces.length]=item.childNodes[j].nodeValue;}}if(datapieces.length>0){data=datapieces.join("");}}}}}if(data===null){data="";}if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}}catch(e){}return oResult;},parseXMLData:function(oRequest,oFullResponse){var bError=false,schema=this.responseSchema,oParsedResponse={meta:{}},xmlList=null,metaNode=schema.metaNode,metaLocators=schema.metaFields||{},i,k,loc,v;try{if(this.useXPath){for(k in metaLocators){oParsedResponse.meta[k]=YAHOO.util.DataSource._getLocationValue(metaLocators[k],oFullResponse);}}else{metaNode=metaNode?oFullResponse.getElementsByTagName(metaNode)[0]:oFullResponse;if(metaNode){for(k in metaLocators){if(lang.hasOwnProperty(metaLocators,k)){loc=metaLocators[k];v=metaNode.getElementsByTagName(loc)[0];if(v){v=v.firstChild.nodeValue;}else{v=metaNode.attributes.getNamedItem(loc);if(v){v=v.value;}}if(lang.isValue(v)){oParsedResponse.meta[k]=v;}}}}}xmlList=(schema.resultNode)?oFullResponse.getElementsByTagName(schema.resultNode):null;}catch(e){}if(!xmlList||!lang.isArray(schema.fields)){bError=true;}else{oParsedResponse.results=[];for(i=xmlList.length-1;i>=0;--i){var oResult=this.parseXMLResult(xmlList.item(i));oParsedResponse.results[i]=oResult;}}if(bError){oParsedResponse.error=true;}else{}return oParsedResponse;},parseJSONData:function(oRequest,oFullResponse){var oParsedResponse={results:[],meta:{}};if(lang.isObject(oFullResponse)&&this.responseSchema.resultsList){var schema=this.responseSchema,fields=schema.fields,resultsList=oFullResponse,results=[],metaFields=schema.metaFields||{},fieldParsers=[],fieldPaths=[],simpleFields=[],bError=false,i,len,j,v,key,parser,path;var buildPath=function(needle){var path=null,keys=[],i=0;if(needle){needle=needle.replace(/\[(['"])(.*?)\1\]/g,function(x,$1,$2){keys[i]=$2;return".@"+(i++);}).replace(/\[(\d+)\]/g,function(x,$1){keys[i]=parseInt($1,10)|0;return".@"+(i++);}).replace(/^\./,"");if(!/[^\w\.\$@]/.test(needle)){path=needle.split(".");for(i=path.length-1;i>=0;--i){if(path[i].charAt(0)==="@"){path[i]=keys[parseInt(path[i].substr(1),10)];}}}else{}}return path;};var walkPath=function(path,origin){var v=origin,i=0,len=path.length;for(;i<len&&v;++i){v=v[path[i]];}return v;};path=buildPath(schema.resultsList);if(path){resultsList=walkPath(path,oFullResponse);if(resultsList===undefined){bError=true;}}else{bError=true;}if(!resultsList){resultsList=[];}if(!lang.isArray(resultsList)){resultsList=[resultsList];}if(!bError){if(schema.fields){var field;for(i=0,len=fields.length;i<len;i++){field=fields[i];key=field.key||field;parser=((typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""])||field.converter;path=buildPath(key);if(parser){fieldParsers[fieldParsers.length]={key:key,parser:parser};}if(path){if(path.length>1){fieldPaths[fieldPaths.length]={key:key,path:path};}else{simpleFields[simpleFields.length]={key:key,path:path[0]};}}else{}}for(i=resultsList.length-1;i>=0;--i){var r=resultsList[i],rec={};if(r){for(j=simpleFields.length-1;j>=0;--j){rec[simpleFields[j].key]=(r[simpleFields[j].path]!==undefined)?r[simpleFields[j].path]:r[j];}for(j=fieldPaths.length-1;j>=0;--j){rec[fieldPaths[j].key]=walkPath(fieldPaths[j].path,r);}for(j=fieldParsers.length-1;j>=0;--j){var p=fieldParsers[j].key;rec[p]=fieldParsers[j].parser.call(this,rec[p]);if(rec[p]===undefined){rec[p]=null;}}}results[i]=rec;}}else{results=resultsList;}for(key in metaFields){if(lang.hasOwnProperty(metaFields,key)){path=buildPath(metaFields[key]);
if(path){v=walkPath(path,oFullResponse);oParsedResponse.meta[key]=v;}}}}else{oParsedResponse.error=true;}oParsedResponse.results=results;}else{oParsedResponse.error=true;}return oParsedResponse;},parseHTMLTableData:function(oRequest,oFullResponse){var bError=false;var elTable=oFullResponse;var fields=this.responseSchema.fields;var oParsedResponse={results:[]};if(lang.isArray(fields)){for(var i=0;i<elTable.tBodies.length;i++){var elTbody=elTable.tBodies[i];for(var j=elTbody.rows.length-1;j>-1;j--){var elRow=elTbody.rows[j];var oResult={};for(var k=fields.length-1;k>-1;k--){var field=fields[k];var key=(lang.isValue(field.key))?field.key:field;var data=elRow.cells[k].innerHTML;if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}oParsedResponse.results[j]=oResult;}}}else{bError=true;}if(bError){oParsedResponse.error=true;}else{}return oParsedResponse;}};lang.augmentProto(DS,util.EventProvider);util.LocalDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_LOCAL;if(oLiveData){if(YAHOO.lang.isArray(oLiveData)){this.responseType=DS.TYPE_JSARRAY;}else{if(oLiveData.nodeType&&oLiveData.nodeType==9){this.responseType=DS.TYPE_XML;}else{if(oLiveData.nodeName&&(oLiveData.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;oLiveData=oLiveData.cloneNode(true);}else{if(YAHOO.lang.isString(oLiveData)){this.responseType=DS.TYPE_TEXT;}else{if(YAHOO.lang.isObject(oLiveData)){this.responseType=DS.TYPE_JSON;}}}}}}else{oLiveData=[];this.responseType=DS.TYPE_JSARRAY;}util.LocalDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.LocalDataSource,DS);lang.augmentObject(util.LocalDataSource,DS);util.FunctionDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_JSFUNCTION;oLiveData=oLiveData||function(){};util.FunctionDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.FunctionDataSource,DS,{scope:null,makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=(this.scope)?this.liveData.call(this.scope,oRequest,this,oCallback):this.liveData(oRequest,oCallback);if(this.responseType===DS.TYPE_UNKNOWN){if(YAHOO.lang.isArray(oRawResponse)){this.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse&&oRawResponse.nodeType&&oRawResponse.nodeType==9){this.responseType=DS.TYPE_XML;}else{if(oRawResponse&&oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){this.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){this.responseType=DS.TYPE_TEXT;}}}}}}this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);return tId;}});lang.augmentObject(util.FunctionDataSource,DS);util.ScriptNodeDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_SCRIPTNODE;oLiveData=oLiveData||"";util.ScriptNodeDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.ScriptNodeDataSource,DS,{getUtility:util.Get,asyncMode:"allowAll",scriptCallbackParam:"callback",generateRequestCallback:function(id){return"&"+this.scriptCallbackParam+"=YAHOO.util.ScriptNodeDataSource.callbacks["+id+"]";},doBeforeGetScriptNode:function(sUri){return sUri;},makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});if(util.ScriptNodeDataSource._nPending===0){util.ScriptNodeDataSource.callbacks=[];util.ScriptNodeDataSource._nId=0;}var id=util.ScriptNodeDataSource._nId;util.ScriptNodeDataSource._nId++;var oSelf=this;util.ScriptNodeDataSource.callbacks[id]=function(oRawResponse){if((oSelf.asyncMode!=="ignoreStaleResponses")||(id===util.ScriptNodeDataSource.callbacks.length-1)){if(oSelf.responseType===DS.TYPE_UNKNOWN){if(YAHOO.lang.isArray(oRawResponse)){oSelf.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse.nodeType&&oRawResponse.nodeType==9){oSelf.responseType=DS.TYPE_XML;}else{if(oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){oSelf.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){oSelf.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){oSelf.responseType=DS.TYPE_TEXT;}}}}}}oSelf.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);}else{}delete util.ScriptNodeDataSource.callbacks[id];};util.ScriptNodeDataSource._nPending++;var sUri=this.liveData+oRequest+this.generateRequestCallback(id);sUri=this.doBeforeGetScriptNode(sUri);this.getUtility.script(sUri,{autopurge:true,onsuccess:util.ScriptNodeDataSource._bumpPendingDown,onfail:util.ScriptNodeDataSource._bumpPendingDown});return tId;}});lang.augmentObject(util.ScriptNodeDataSource,DS);lang.augmentObject(util.ScriptNodeDataSource,{_nId:0,_nPending:0,callbacks:[]});util.XHRDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_XHR;this.connMgr=this.connMgr||util.Connect;oLiveData=oLiveData||"";util.XHRDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.XHRDataSource,DS,{connMgr:null,connXhrMode:"allowAll",connMethodPost:false,connTimeout:0,makeConnection:function(oRequest,oCallback,oCaller){var oRawResponse=null;var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oSelf=this;var oConnMgr=this.connMgr;var oQueue=this._oQueue;var _xhrSuccess=function(oResponse){if(oResponse&&(this.connXhrMode=="ignoreStaleResponses")&&(oResponse.tId!=oQueue.conn.tId)){return null;}else{if(!oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,response:null,callback:oCallback,caller:oCaller,message:DS.ERROR_DATANULL});DS.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller);return null;
}else{if(this.responseType===DS.TYPE_UNKNOWN){var ctype=(oResponse.getResponseHeader)?oResponse.getResponseHeader["Content-Type"]:null;if(ctype){if(ctype.indexOf("text/xml")>-1){this.responseType=DS.TYPE_XML;}else{if(ctype.indexOf("application/json")>-1){this.responseType=DS.TYPE_JSON;}else{if(ctype.indexOf("text/plain")>-1){this.responseType=DS.TYPE_TEXT;}}}}}this.handleResponse(oRequest,oResponse,oCallback,oCaller,tId);}}};var _xhrFailure=function(oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,response:oResponse,callback:oCallback,caller:oCaller,message:DS.ERROR_DATAINVALID});if(lang.isString(this.liveData)&&lang.isString(oRequest)&&(this.liveData.lastIndexOf("?")!==this.liveData.length-1)&&(oRequest.indexOf("?")!==0)){}oResponse=oResponse||{};oResponse.error=true;DS.issueCallback(oCallback,[oRequest,oResponse],true,oCaller);return null;};var _xhrCallback={success:_xhrSuccess,failure:_xhrFailure,scope:this};if(lang.isNumber(this.connTimeout)){_xhrCallback.timeout=this.connTimeout;}if(this.connXhrMode=="cancelStaleRequests"){if(oQueue.conn){if(oConnMgr.abort){oConnMgr.abort(oQueue.conn);oQueue.conn=null;}else{}}}if(oConnMgr&&oConnMgr.asyncRequest){var sLiveData=this.liveData;var isPost=this.connMethodPost;var sMethod=(isPost)?"POST":"GET";var sUri=(isPost||!lang.isValue(oRequest))?sLiveData:sLiveData+oRequest;var sRequest=(isPost)?oRequest:null;if(this.connXhrMode!="queueRequests"){oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}else{if(oQueue.conn){var allRequests=oQueue.requests;allRequests.push({request:oRequest,callback:_xhrCallback});if(!oQueue.interval){oQueue.interval=setInterval(function(){if(oConnMgr.isCallInProgress(oQueue.conn)){return;}else{if(allRequests.length>0){sUri=(isPost||!lang.isValue(allRequests[0].request))?sLiveData:sLiveData+allRequests[0].request;sRequest=(isPost)?allRequests[0].request:null;oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,allRequests[0].callback,sRequest);allRequests.shift();}else{clearInterval(oQueue.interval);oQueue.interval=null;}}},50);}}else{oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}}}else{DS.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller);}return tId;}});lang.augmentObject(util.XHRDataSource,DS);util.DataSource=function(oLiveData,oConfigs){oConfigs=oConfigs||{};var dataType=oConfigs.dataType;if(dataType){if(dataType==DS.TYPE_LOCAL){return new util.LocalDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_XHR){return new util.XHRDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_SCRIPTNODE){return new util.ScriptNodeDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_JSFUNCTION){return new util.FunctionDataSource(oLiveData,oConfigs);}}}}}if(YAHOO.lang.isString(oLiveData)){return new util.XHRDataSource(oLiveData,oConfigs);}else{if(YAHOO.lang.isFunction(oLiveData)){return new util.FunctionDataSource(oLiveData,oConfigs);}else{return new util.LocalDataSource(oLiveData,oConfigs);}}};lang.augmentObject(util.DataSource,DS);})();YAHOO.util.Number={format:function(e,k){if(e===""||e===null||!isFinite(e)){return"";}e=+e;k=YAHOO.lang.merge(YAHOO.util.Number.format.defaults,(k||{}));var j=e+"",l=Math.abs(e),b=k.decimalPlaces||0,r=k.thousandsSeparator,f=k.negativeFormat||("-"+k.format),q,p,g,h;if(f.indexOf("#")>-1){f=f.replace(/#/,k.format);}if(b<0){q=l-(l%1)+"";g=q.length+b;if(g>0){q=Number("."+q).toFixed(g).slice(2)+new Array(q.length-g+1).join("0");}else{q="0";}}else{var a=l+"";if(b>0||a.indexOf(".")>0){var d=Math.pow(10,b);q=Math.round(l*d)/d+"";var c=q.indexOf("."),m,o;if(c<0){m=b;o=(Math.pow(10,m)+"").substring(1);if(b>0){q=q+"."+o;}}else{m=b-(q.length-c-1);o=(Math.pow(10,m)+"").substring(1);q=q+o;}}else{q=l.toFixed(b)+"";}}p=q.split(/\D/);if(l>=1000){g=p[0].length%3||3;p[0]=p[0].slice(0,g)+p[0].slice(g).replace(/(\d{3})/g,r+"$1");}return YAHOO.util.Number.format._applyFormat((e<0?f:k.format),p.join(k.decimalSeparator),k);}};YAHOO.util.Number.format.defaults={format:"{prefix}{number}{suffix}",negativeFormat:null,decimalSeparator:".",decimalPlaces:null,thousandsSeparator:""};YAHOO.util.Number.format._applyFormat=function(a,b,c){return a.replace(/\{(\w+)\}/g,function(d,e){return e==="number"?b:e in c?c[e]:"";});};(function(){var a=function(c,e,d){if(typeof d==="undefined"){d=10;}for(;parseInt(c,10)<d&&d>1;d/=10){c=e.toString()+c;}return c.toString();};var b={formats:{a:function(e,c){return c.a[e.getDay()];},A:function(e,c){return c.A[e.getDay()];},b:function(e,c){return c.b[e.getMonth()];},B:function(e,c){return c.B[e.getMonth()];},C:function(c){return a(parseInt(c.getFullYear()/100,10),0);},d:["getDate","0"],e:["getDate"," "],g:function(c){return a(parseInt(b.formats.G(c)%100,10),0);},G:function(f){var g=f.getFullYear();var e=parseInt(b.formats.V(f),10);var c=parseInt(b.formats.W(f),10);if(c>e){g++;}else{if(c===0&&e>=52){g--;}}return g;},H:["getHours","0"],I:function(e){var c=e.getHours()%12;return a(c===0?12:c,0);},j:function(h){var g=new Date(""+h.getFullYear()+"/1/1 GMT");var e=new Date(""+h.getFullYear()+"/"+(h.getMonth()+1)+"/"+h.getDate()+" GMT");var c=e-g;var f=parseInt(c/60000/60/24,10)+1;return a(f,0,100);},k:["getHours"," "],l:function(e){var c=e.getHours()%12;return a(c===0?12:c," ");},m:function(c){return a(c.getMonth()+1,0);},M:["getMinutes","0"],p:function(e,c){return c.p[e.getHours()>=12?1:0];},P:function(e,c){return c.P[e.getHours()>=12?1:0];},s:function(e,c){return parseInt(e.getTime()/1000,10);},S:["getSeconds","0"],u:function(c){var e=c.getDay();return e===0?7:e;},U:function(g){var c=parseInt(b.formats.j(g),10);var f=6-g.getDay();var e=parseInt((c+f)/7,10);return a(e,0);},V:function(g){var f=parseInt(b.formats.W(g),10);var c=(new Date(""+g.getFullYear()+"/1/1")).getDay();var e=f+(c>4||c<=1?0:1);if(e===53&&(new Date(""+g.getFullYear()+"/12/31")).getDay()<4){e=1;}else{if(e===0){e=b.formats.V(new Date(""+(g.getFullYear()-1)+"/12/31"));}}return a(e,0);},w:"getDay",W:function(g){var c=parseInt(b.formats.j(g),10);var f=7-b.formats.u(g);var e=parseInt((c+f)/7,10);
return a(e,0,10);},y:function(c){return a(c.getFullYear()%100,0);},Y:"getFullYear",z:function(f){var e=f.getTimezoneOffset();var c=a(parseInt(Math.abs(e/60),10),0);var g=a(Math.abs(e%60),0);return(e>0?"-":"+")+c+g;},Z:function(c){var e=c.toString().replace(/^.*:\d\d( GMT[+-]\d+)? \(?([A-Za-z ]+)\)?\d*$/,"$2").replace(/[a-z ]/g,"");if(e.length>4){e=b.formats.z(c);}return e;},"%":function(c){return"%";}},aggregates:{c:"locale",D:"%m/%d/%y",F:"%Y-%m-%d",h:"%b",n:"\n",r:"locale",R:"%H:%M",t:"\t",T:"%H:%M:%S",x:"locale",X:"locale"},format:function(g,f,d){f=f||{};if(!(g instanceof Date)){return YAHOO.lang.isValue(g)?g:"";}var h=f.format||"%m/%d/%Y";if(h==="YYYY/MM/DD"){h="%Y/%m/%d";}else{if(h==="DD/MM/YYYY"){h="%d/%m/%Y";}else{if(h==="MM/DD/YYYY"){h="%m/%d/%Y";}}}d=d||"en";if(!(d in YAHOO.util.DateLocale)){if(d.replace(/-[a-zA-Z]+$/,"") in YAHOO.util.DateLocale){d=d.replace(/-[a-zA-Z]+$/,"");}else{d="en";}}var j=YAHOO.util.DateLocale[d];var c=function(l,k){var m=b.aggregates[k];return(m==="locale"?j[k]:m);};var e=function(l,k){var m=b.formats[k];if(typeof m==="string"){return g[m]();}else{if(typeof m==="function"){return m.call(g,g,j);}else{if(typeof m==="object"&&typeof m[0]==="string"){return a(g[m[0]](),m[1]);}else{return k;}}}};while(h.match(/%[cDFhnrRtTxX]/)){h=h.replace(/%([cDFhnrRtTxX])/g,c);}var i=h.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g,e);c=e=undefined;return i;}};YAHOO.namespace("YAHOO.util");YAHOO.util.Date=b;YAHOO.util.DateLocale={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],r:"%I:%M:%S %p",x:"%d/%m/%y",X:"%T"};YAHOO.util.DateLocale["en"]=YAHOO.lang.merge(YAHOO.util.DateLocale,{});YAHOO.util.DateLocale["en-US"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"],{c:"%a %d %b %Y %I:%M:%S %p %Z",x:"%m/%d/%Y",X:"%I:%M:%S %p"});YAHOO.util.DateLocale["en-GB"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"],{r:"%l:%M:%S %P %Z"});YAHOO.util.DateLocale["en-AU"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"]);})();YAHOO.register("datasource",YAHOO.util.DataSource,{version:"2.9.0",build:"2800"});
/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
YAHOO.widget.DS_JSArray=YAHOO.util.LocalDataSource;YAHOO.widget.DS_JSFunction=YAHOO.util.FunctionDataSource;YAHOO.widget.DS_XHR=function(b,a,d){var c=new YAHOO.util.XHRDataSource(b,d);c._aDeprecatedSchema=a;return c;};YAHOO.widget.DS_ScriptNode=function(b,a,d){var c=new YAHOO.util.ScriptNodeDataSource(b,d);c._aDeprecatedSchema=a;return c;};YAHOO.widget.DS_XHR.TYPE_JSON=YAHOO.util.DataSourceBase.TYPE_JSON;YAHOO.widget.DS_XHR.TYPE_XML=YAHOO.util.DataSourceBase.TYPE_XML;YAHOO.widget.DS_XHR.TYPE_FLAT=YAHOO.util.DataSourceBase.TYPE_TEXT;YAHOO.widget.AutoComplete=function(g,b,j,c){if(g&&b&&j){if(j&&YAHOO.lang.isFunction(j.sendRequest)){this.dataSource=j;}else{return;}this.key=0;var d=j.responseSchema;if(j._aDeprecatedSchema){var k=j._aDeprecatedSchema;if(YAHOO.lang.isArray(k)){if((j.responseType===YAHOO.util.DataSourceBase.TYPE_JSON)||(j.responseType===YAHOO.util.DataSourceBase.TYPE_UNKNOWN)){d.resultsList=k[0];this.key=k[1];d.fields=(k.length<3)?null:k.slice(1);}else{if(j.responseType===YAHOO.util.DataSourceBase.TYPE_XML){d.resultNode=k[0];this.key=k[1];d.fields=k.slice(1);}else{if(j.responseType===YAHOO.util.DataSourceBase.TYPE_TEXT){d.recordDelim=k[0];d.fieldDelim=k[1];}}}j.responseSchema=d;}}if(YAHOO.util.Dom.inDocument(g)){if(YAHOO.lang.isString(g)){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+g;this._elTextbox=document.getElementById(g);}else{this._sName=(g.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+g.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._elTextbox=g;}YAHOO.util.Dom.addClass(this._elTextbox,"yui-ac-input");}else{return;}if(YAHOO.util.Dom.inDocument(b)){if(YAHOO.lang.isString(b)){this._elContainer=document.getElementById(b);}else{this._elContainer=b;}if(this._elContainer.style.display=="none"){}var e=this._elContainer.parentNode;var a=e.tagName.toLowerCase();if(a=="div"){YAHOO.util.Dom.addClass(e,"yui-ac");}else{}}else{return;}if(this.dataSource.dataType===YAHOO.util.DataSourceBase.TYPE_LOCAL){this.applyLocalFilter=true;}if(c&&(c.constructor==Object)){for(var i in c){if(i){this[i]=c[i];}}}this._initContainerEl();this._initProps();this._initListEl();this._initContainerHelperEls();var h=this;var f=this._elTextbox;YAHOO.util.Event.addListener(f,"keyup",h._onTextboxKeyUp,h);YAHOO.util.Event.addListener(f,"keydown",h._onTextboxKeyDown,h);YAHOO.util.Event.addListener(f,"focus",h._onTextboxFocus,h);YAHOO.util.Event.addListener(f,"blur",h._onTextboxBlur,h);YAHOO.util.Event.addListener(b,"mouseover",h._onContainerMouseover,h);YAHOO.util.Event.addListener(b,"mouseout",h._onContainerMouseout,h);YAHOO.util.Event.addListener(b,"click",h._onContainerClick,h);YAHOO.util.Event.addListener(b,"scroll",h._onContainerScroll,h);YAHOO.util.Event.addListener(b,"resize",h._onContainerResize,h);YAHOO.util.Event.addListener(f,"keypress",h._onTextboxKeyPress,h);YAHOO.util.Event.addListener(window,"unload",h._onWindowUnload,h);this.textboxFocusEvent=new YAHOO.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=new YAHOO.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new YAHOO.util.CustomEvent("dataRequest",this);this.dataRequestCancelEvent=new YAHOO.util.CustomEvent("dataRequestCancel",this);this.dataReturnEvent=new YAHOO.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.containerPopulateEvent=new YAHOO.util.CustomEvent("containerPopulate",this);this.containerExpandEvent=new YAHOO.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new YAHOO.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new YAHOO.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=new YAHOO.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new YAHOO.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new YAHOO.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new YAHOO.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new YAHOO.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new YAHOO.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new YAHOO.util.CustomEvent("containerCollapse",this);this.textboxBlurEvent=new YAHOO.util.CustomEvent("textboxBlur",this);this.textboxChangeEvent=new YAHOO.util.CustomEvent("textboxChange",this);f.setAttribute("autocomplete","off");YAHOO.widget.AutoComplete._nIndex++;}else{}};YAHOO.widget.AutoComplete.prototype.dataSource=null;YAHOO.widget.AutoComplete.prototype.applyLocalFilter=null;YAHOO.widget.AutoComplete.prototype.queryMatchCase=false;YAHOO.widget.AutoComplete.prototype.queryMatchContains=false;YAHOO.widget.AutoComplete.prototype.queryMatchSubset=false;YAHOO.widget.AutoComplete.prototype.minQueryLength=1;YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed=10;YAHOO.widget.AutoComplete.prototype.queryDelay=0.2;YAHOO.widget.AutoComplete.prototype.typeAheadDelay=0.5;YAHOO.widget.AutoComplete.prototype.queryInterval=500;YAHOO.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";YAHOO.widget.AutoComplete.prototype.prehighlightClassName=null;YAHOO.widget.AutoComplete.prototype.delimChar=null;YAHOO.widget.AutoComplete.prototype.autoHighlight=true;YAHOO.widget.AutoComplete.prototype.typeAhead=false;YAHOO.widget.AutoComplete.prototype.animHoriz=false;YAHOO.widget.AutoComplete.prototype.animVert=true;YAHOO.widget.AutoComplete.prototype.animSpeed=0.3;YAHOO.widget.AutoComplete.prototype.forceSelection=false;YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete=true;YAHOO.widget.AutoComplete.prototype.alwaysShowContainer=false;YAHOO.widget.AutoComplete.prototype.useIFrame=false;YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.suppressInputUpdate=false;YAHOO.widget.AutoComplete.prototype.resultTypeList=true;YAHOO.widget.AutoComplete.prototype.queryQuestionMark=true;YAHOO.widget.AutoComplete.prototype.autoSnapContainer=true;YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName;};YAHOO.widget.AutoComplete.prototype.getInputEl=function(){return this._elTextbox;
};YAHOO.widget.AutoComplete.prototype.getContainerEl=function(){return this._elContainer;};YAHOO.widget.AutoComplete.prototype.isFocused=function(){return this._bFocused;};YAHOO.widget.AutoComplete.prototype.isContainerOpen=function(){return this._bContainerOpen;};YAHOO.widget.AutoComplete.prototype.getListEl=function(){return this._elList;};YAHOO.widget.AutoComplete.prototype.getListItemMatch=function(a){if(a._sResultMatch){return a._sResultMatch;}else{return null;}};YAHOO.widget.AutoComplete.prototype.getListItemData=function(a){if(a._oResultData){return a._oResultData;}else{return null;}};YAHOO.widget.AutoComplete.prototype.getListItemIndex=function(a){if(YAHOO.lang.isNumber(a._nItemIndex)){return a._nItemIndex;}else{return null;}};YAHOO.widget.AutoComplete.prototype.setHeader=function(b){if(this._elHeader){var a=this._elHeader;if(b){a.innerHTML=b;a.style.display="";}else{a.innerHTML="";a.style.display="none";}}};YAHOO.widget.AutoComplete.prototype.setFooter=function(b){if(this._elFooter){var a=this._elFooter;if(b){a.innerHTML=b;a.style.display="";}else{a.innerHTML="";a.style.display="none";}}};YAHOO.widget.AutoComplete.prototype.setBody=function(a){if(this._elBody){var b=this._elBody;YAHOO.util.Event.purgeElement(b,true);if(a){b.innerHTML=a;b.style.display="";}else{b.innerHTML="";b.style.display="none";}this._elList=null;}};YAHOO.widget.AutoComplete.prototype.generateRequest=function(b){var a=this.dataSource.dataType;if(a===YAHOO.util.DataSourceBase.TYPE_XHR){if(!this.dataSource.connMethodPost){b=(this.queryQuestionMark?"?":"")+(this.dataSource.scriptQueryParam||"query")+"="+b+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"");}else{b=(this.dataSource.scriptQueryParam||"query")+"="+b+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"");}}else{if(a===YAHOO.util.DataSourceBase.TYPE_SCRIPTNODE){b="&"+(this.dataSource.scriptQueryParam||"query")+"="+b+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"");}}return b;};YAHOO.widget.AutoComplete.prototype.sendQuery=function(b){this._bFocused=true;var a=(this.delimChar)?this._elTextbox.value+b:b;this._sendQuery(a);};YAHOO.widget.AutoComplete.prototype.snapContainer=function(){var a=this._elTextbox,b=YAHOO.util.Dom.getXY(a);b[1]+=YAHOO.util.Dom.get(a).offsetHeight+2;YAHOO.util.Dom.setXY(this._elContainer,b);};YAHOO.widget.AutoComplete.prototype.expandContainer=function(){this._toggleContainer(true);};YAHOO.widget.AutoComplete.prototype.collapseContainer=function(){this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype.clearList=function(){var b=this._elList.childNodes,a=b.length-1;for(;a>-1;a--){b[a].style.display="none";}};YAHOO.widget.AutoComplete.prototype.getSubsetMatches=function(e){var d,c,a;for(var b=e.length;b>=this.minQueryLength;b--){a=this.generateRequest(e.substr(0,b));this.dataRequestEvent.fire(this,d,a);c=this.dataSource.getCachedResponse(a);if(c){return this.filterResults.apply(this.dataSource,[e,c,c,{scope:this}]);}}return null;};YAHOO.widget.AutoComplete.prototype.preparseRawResponse=function(c,b,a){var d=((this.responseStripAfter!=="")&&(b.indexOf))?b.indexOf(this.responseStripAfter):-1;if(d!=-1){b=b.substring(0,d);}return b;};YAHOO.widget.AutoComplete.prototype.filterResults=function(l,n,r,m){if(m&&m.argument&&YAHOO.lang.isValue(m.argument.query)){l=m.argument.query;}if(l&&l!==""){r=YAHOO.widget.AutoComplete._cloneObject(r);var j=m.scope,q=this,c=r.results,o=[],b=j.maxResultsDisplayed,k=(q.queryMatchCase||j.queryMatchCase),a=(q.queryMatchContains||j.queryMatchContains);for(var d=0,h=c.length;d<h;d++){var f=c[d];var e=null;if(YAHOO.lang.isString(f)){e=f;}else{if(YAHOO.lang.isArray(f)){e=f[0];}else{if(this.responseSchema.fields){var p=this.responseSchema.fields[0].key||this.responseSchema.fields[0];e=f[p];}else{if(this.key){e=f[this.key];}}}}if(YAHOO.lang.isString(e)){var g=(k)?e.indexOf(decodeURIComponent(l)):e.toLowerCase().indexOf(decodeURIComponent(l).toLowerCase());if((!a&&(g===0))||(a&&(g>-1))){o.push(f);}}if(h>b&&o.length===b){break;}}r.results=o;}else{}return r;};YAHOO.widget.AutoComplete.prototype.handleResponse=function(c,a,b){if((this instanceof YAHOO.widget.AutoComplete)&&this._sName){this._populateList(c,a,b);}};YAHOO.widget.AutoComplete.prototype.doBeforeLoadData=function(c,a,b){return true;};YAHOO.widget.AutoComplete.prototype.formatResult=function(b,d,a){var c=(a)?a:"";return c;};YAHOO.widget.AutoComplete.prototype.formatEscapedResult=function(c,d,b){var a=(b)?b:"";return YAHOO.lang.escapeHTML(a);};YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer=function(d,a,c,b){return true;};YAHOO.widget.AutoComplete.prototype.destroy=function(){var b=this.toString();var a=this._elTextbox;var d=this._elContainer;this.textboxFocusEvent.unsubscribeAll();this.textboxKeyEvent.unsubscribeAll();this.dataRequestEvent.unsubscribeAll();this.dataReturnEvent.unsubscribeAll();this.dataErrorEvent.unsubscribeAll();this.containerPopulateEvent.unsubscribeAll();this.containerExpandEvent.unsubscribeAll();this.typeAheadEvent.unsubscribeAll();this.itemMouseOverEvent.unsubscribeAll();this.itemMouseOutEvent.unsubscribeAll();this.itemArrowToEvent.unsubscribeAll();this.itemArrowFromEvent.unsubscribeAll();this.itemSelectEvent.unsubscribeAll();this.unmatchedItemSelectEvent.unsubscribeAll();this.selectionEnforceEvent.unsubscribeAll();this.containerCollapseEvent.unsubscribeAll();this.textboxBlurEvent.unsubscribeAll();this.textboxChangeEvent.unsubscribeAll();YAHOO.util.Event.purgeElement(a,true);YAHOO.util.Event.purgeElement(d,true);d.innerHTML="";for(var c in this){if(YAHOO.lang.hasOwnProperty(this,c)){this[c]=null;}}};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestCancelEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;
YAHOO.widget.AutoComplete.prototype.containerPopulateEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete.prototype.textboxChangeEvent=null;YAHOO.widget.AutoComplete._nIndex=0;YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._elTextbox=null;YAHOO.widget.AutoComplete.prototype._elContainer=null;YAHOO.widget.AutoComplete.prototype._elContent=null;YAHOO.widget.AutoComplete.prototype._elHeader=null;YAHOO.widget.AutoComplete.prototype._elBody=null;YAHOO.widget.AutoComplete.prototype._elFooter=null;YAHOO.widget.AutoComplete.prototype._elShadow=null;YAHOO.widget.AutoComplete.prototype._elIFrame=null;YAHOO.widget.AutoComplete.prototype._bFocused=false;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._elList=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sPastSelections="";YAHOO.widget.AutoComplete.prototype._sInitInputValue=null;YAHOO.widget.AutoComplete.prototype._elCurListItem=null;YAHOO.widget.AutoComplete.prototype._elCurPrehighlightItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._nTypeAheadDelayID=-1;YAHOO.widget.AutoComplete.prototype._iFrameSrc="javascript:false;";YAHOO.widget.AutoComplete.prototype._queryInterval=null;YAHOO.widget.AutoComplete.prototype._sLastTextboxValue=null;YAHOO.widget.AutoComplete.prototype._initProps=function(){var b=this.minQueryLength;if(!YAHOO.lang.isNumber(b)){this.minQueryLength=1;}var e=this.maxResultsDisplayed;if(!YAHOO.lang.isNumber(e)||(e<1)){this.maxResultsDisplayed=10;}var f=this.queryDelay;if(!YAHOO.lang.isNumber(f)||(f<0)){this.queryDelay=0.2;}var c=this.typeAheadDelay;if(!YAHOO.lang.isNumber(c)||(c<0)){this.typeAheadDelay=0.2;}var a=this.delimChar;if(YAHOO.lang.isString(a)&&(a.length>0)){this.delimChar=[a];}else{if(!YAHOO.lang.isArray(a)){this.delimChar=null;}}var d=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(!YAHOO.lang.isNumber(d)||(d<0)){this.animSpeed=0.3;}if(!this._oAnim){this._oAnim=new YAHOO.util.Anim(this._elContent,{},this.animSpeed);}else{this._oAnim.duration=this.animSpeed;}}if(this.forceSelection&&a){}};YAHOO.widget.AutoComplete.prototype._initContainerHelperEls=function(){if(this.useShadow&&!this._elShadow){var a=document.createElement("div");a.className="yui-ac-shadow";a.style.width=0;a.style.height=0;this._elShadow=this._elContainer.appendChild(a);}if(this.useIFrame&&!this._elIFrame){var b=document.createElement("iframe");b.src=this._iFrameSrc;b.frameBorder=0;b.scrolling="no";b.style.position="absolute";b.style.width=0;b.style.height=0;b.style.padding=0;b.tabIndex=-1;b.role="presentation";b.title="Presentational iframe shim";this._elIFrame=this._elContainer.appendChild(b);}};YAHOO.widget.AutoComplete.prototype._initContainerEl=function(){YAHOO.util.Dom.addClass(this._elContainer,"yui-ac-container");if(!this._elContent){var c=document.createElement("div");c.className="yui-ac-content";c.style.display="none";this._elContent=this._elContainer.appendChild(c);var b=document.createElement("div");b.className="yui-ac-hd";b.style.display="none";this._elHeader=this._elContent.appendChild(b);var d=document.createElement("div");d.className="yui-ac-bd";this._elBody=this._elContent.appendChild(d);var a=document.createElement("div");a.className="yui-ac-ft";a.style.display="none";this._elFooter=this._elContent.appendChild(a);}else{}};YAHOO.widget.AutoComplete.prototype._initListEl=function(){var c=this.maxResultsDisplayed,a=this._elList||document.createElement("ul"),b;while(a.childNodes.length<c){b=document.createElement("li");b.style.display="none";b._nItemIndex=a.childNodes.length;a.appendChild(b);}if(!this._elList){var d=this._elBody;YAHOO.util.Event.purgeElement(d,true);d.innerHTML="";this._elList=d.appendChild(a);}this._elBody.style.display="";};YAHOO.widget.AutoComplete.prototype._focus=function(){var a=this;setTimeout(function(){try{a._elTextbox.focus();}catch(b){}},0);};YAHOO.widget.AutoComplete.prototype._enableIntervalDetection=function(){var a=this;if(!a._queryInterval&&a.queryInterval){a._queryInterval=setInterval(function(){a._onInterval();},a.queryInterval);}};YAHOO.widget.AutoComplete.prototype.enableIntervalDetection=YAHOO.widget.AutoComplete.prototype._enableIntervalDetection;YAHOO.widget.AutoComplete.prototype._onInterval=function(){var a=this._elTextbox.value;var b=this._sLastTextboxValue;if(a!=b){this._sLastTextboxValue=a;this._sendQuery(a);}};YAHOO.widget.AutoComplete.prototype._clearInterval=function(){if(this._queryInterval){clearInterval(this._queryInterval);this._queryInterval=null;}};YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(a){if((a==9)||(a==13)||(a==16)||(a==17)||(a>=18&&a<=20)||(a==27)||(a>=33&&a<=35)||(a>=36&&a<=40)||(a>=44&&a<=45)||(a==229)){return true;}return false;};YAHOO.widget.AutoComplete.prototype._sendQuery=function(d){if(this.minQueryLength<0){this._toggleContainer(false);return;}if(this.delimChar){var a=this._extractQuery(d);d=a.query;this._sPastSelections=a.previous;}if((d&&(d.length<this.minQueryLength))||(!d&&this.minQueryLength>0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);
}this._toggleContainer(false);return;}d=encodeURIComponent(d);this._nDelayID=-1;if(this.dataSource.queryMatchSubset||this.queryMatchSubset){var c=this.getSubsetMatches(d);if(c){this.handleResponse(d,c,{query:d});return;}}if(this.dataSource.responseStripAfter){this.dataSource.doBeforeParseData=this.preparseRawResponse;}if(this.applyLocalFilter){this.dataSource.doBeforeCallback=this.filterResults;}var b=this.generateRequest(d);if(b!==undefined){this.dataRequestEvent.fire(this,d,b);this.dataSource.sendRequest(b,{success:this.handleResponse,failure:this.handleResponse,scope:this,argument:{query:d}});}else{this.dataRequestCancelEvent.fire(this,d);}};YAHOO.widget.AutoComplete.prototype._populateListItem=function(b,a,c){b.innerHTML=this.formatResult(a,c,b._sResultMatch);};YAHOO.widget.AutoComplete.prototype._populateList=function(n,f,c){if(this._nTypeAheadDelayID!=-1){clearTimeout(this._nTypeAheadDelayID);}n=(c&&c.query)?c.query:n;var h=this.doBeforeLoadData(n,f,c);if(h&&!f.error){this.dataReturnEvent.fire(this,n,f.results);if(this._bFocused){var p=decodeURIComponent(n);this._sCurQuery=p;this._bItemSelected=false;var u=f.results,a=Math.min(u.length,this.maxResultsDisplayed),m=(this.dataSource.responseSchema.fields)?(this.dataSource.responseSchema.fields[0].key||this.dataSource.responseSchema.fields[0]):0;if(a>0){if(!this._elList||(this._elList.childNodes.length<a)){this._initListEl();}this._initContainerHelperEls();var l=this._elList.childNodes;for(var t=a-1;t>=0;t--){var s=l[t],e=u[t];if(this.resultTypeList){var b=[];b[0]=(YAHOO.lang.isString(e))?e:e[m]||e[this.key];var o=this.dataSource.responseSchema.fields;if(YAHOO.lang.isArray(o)&&(o.length>1)){for(var q=1,v=o.length;q<v;q++){b[b.length]=e[o[q].key||o[q]];}}else{if(YAHOO.lang.isArray(e)){b=e;}else{if(YAHOO.lang.isString(e)){b=[e];}else{b[1]=e;}}}e=b;}s._sResultMatch=(YAHOO.lang.isString(e))?e:(YAHOO.lang.isArray(e))?e[0]:(e[m]||"");s._oResultData=e;this._populateListItem(s,e,p);s.style.display="";}if(a<l.length){var g;for(var r=l.length-1;r>=a;r--){g=l[r];g.style.display="none";}}this._nDisplayedItems=a;this.containerPopulateEvent.fire(this,n,u);if(this.autoHighlight){var d=this._elList.firstChild;this._toggleHighlight(d,"to");this.itemArrowToEvent.fire(this,d);this._typeAhead(d,n);}else{this._toggleHighlight(this._elCurListItem,"from");}h=this._doBeforeExpandContainer(this._elTextbox,this._elContainer,n,u);this._toggleContainer(h);}else{this._toggleContainer(false);}return;}}else{this.dataErrorEvent.fire(this,n,f);}};YAHOO.widget.AutoComplete.prototype._doBeforeExpandContainer=function(d,a,c,b){if(this.autoSnapContainer){this.snapContainer();}return this.doBeforeExpandContainer(d,a,c,b);};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var a=(this.delimChar)?this._extractQuery(this._elTextbox.value):{previous:"",query:this._elTextbox.value};this._elTextbox.value=a.previous;this.selectionEnforceEvent.fire(this,a.query);};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var a=null;for(var b=0;b<this._nDisplayedItems;b++){var c=this._elList.childNodes[b];var d=(""+c._sResultMatch).toLowerCase();if(d==this._sCurQuery.toLowerCase()){a=c;break;}}return(a);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(b,d){if(!this.typeAhead||(this._nKeyCode==8)){return;}var a=this,c=this._elTextbox;if(c.setSelectionRange||c.createTextRange){this._nTypeAheadDelayID=setTimeout(function(){var f=c.value.length;a._updateValue(b);var g=c.value.length;a._selectText(c,f,g);var e=c.value.substr(f,g);a._sCurQuery=b._sResultMatch;a.typeAheadEvent.fire(a,d,e);},(this.typeAheadDelay*1000));}};YAHOO.widget.AutoComplete.prototype._selectText=function(d,a,b){if(d.setSelectionRange){d.setSelectionRange(a,b);}else{if(d.createTextRange){var c=d.createTextRange();c.moveStart("character",a);c.moveEnd("character",b-d.value.length);c.select();}else{d.select();}}};YAHOO.widget.AutoComplete.prototype._extractQuery=function(h){var c=this.delimChar,f=-1,g,e,b=c.length-1,d;for(;b>=0;b--){g=h.lastIndexOf(c[b]);if(g>f){f=g;}}if(c[b]==" "){for(var a=c.length-1;a>=0;a--){if(h[f-1]==c[a]){f--;break;}}}if(f>-1){e=f+1;while(h.charAt(e)==" "){e+=1;}d=h.substring(0,e);h=h.substr(e);}else{d="";}return{previous:d,query:h};};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(d){var e=this._elContent.offsetWidth+"px";var b=this._elContent.offsetHeight+"px";if(this.useIFrame&&this._elIFrame){var c=this._elIFrame;if(d){c.style.width=e;c.style.height=b;c.style.padding="";}else{c.style.width=0;c.style.height=0;c.style.padding=0;}}if(this.useShadow&&this._elShadow){var a=this._elShadow;if(d){a.style.width=e;a.style.height=b;}else{a.style.width=0;a.style.height=0;}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(i){var d=this._elContainer;if(this.alwaysShowContainer&&this._bContainerOpen){return;}if(!i){this._toggleHighlight(this._elCurListItem,"from");this._nDisplayedItems=0;this._sCurQuery=null;if(this._elContent.style.display=="none"){return;}}var a=this._oAnim;if(a&&a.getEl()&&(this.animHoriz||this.animVert)){if(a.isAnimated()){a.stop(true);}var g=this._elContent.cloneNode(true);d.appendChild(g);g.style.top="-9000px";g.style.width="";g.style.height="";g.style.display="";var f=g.offsetWidth;var c=g.offsetHeight;var b=(this.animHoriz)?0:f;var e=(this.animVert)?0:c;a.attributes=(i)?{width:{to:f},height:{to:c}}:{width:{to:b},height:{to:e}};if(i&&!this._bContainerOpen){this._elContent.style.width=b+"px";this._elContent.style.height=e+"px";}else{this._elContent.style.width=f+"px";this._elContent.style.height=c+"px";}d.removeChild(g);g=null;var h=this;var j=function(){a.onComplete.unsubscribeAll();if(i){h._toggleContainerHelpers(true);h._bContainerOpen=i;h.containerExpandEvent.fire(h);}else{h._elContent.style.display="none";h._bContainerOpen=i;h.containerCollapseEvent.fire(h);}};this._toggleContainerHelpers(false);this._elContent.style.display="";a.onComplete.subscribe(j);a.animate();}else{if(i){this._elContent.style.display="";this._toggleContainerHelpers(true);
this._bContainerOpen=i;this.containerExpandEvent.fire(this);}else{this._toggleContainerHelpers(false);this._elContent.style.display="none";this._bContainerOpen=i;this.containerCollapseEvent.fire(this);}}};YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(a,c){if(a){var b=this.highlightClassName;if(this._elCurListItem){YAHOO.util.Dom.removeClass(this._elCurListItem,b);this._elCurListItem=null;}if((c=="to")&&b){YAHOO.util.Dom.addClass(a,b);this._elCurListItem=a;}}};YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(b,c){var a=this.prehighlightClassName;if(this._elCurPrehighlightItem){YAHOO.util.Dom.removeClass(this._elCurPrehighlightItem,a);}if(b==this._elCurListItem){return;}if((c=="mouseover")&&a){YAHOO.util.Dom.addClass(b,a);this._elCurPrehighlightItem=b;}else{YAHOO.util.Dom.removeClass(b,a);}};YAHOO.widget.AutoComplete.prototype._updateValue=function(c){if(!this.suppressInputUpdate){var f=this._elTextbox;var e=(this.delimChar)?(this.delimChar[0]||this.delimChar):null;var b=c._sResultMatch;var d="";if(e){d=this._sPastSelections;d+=b+e;if(e!=" "){d+=" ";}}else{d=b;}f.value=d;if(f.type=="textarea"){f.scrollTop=f.scrollHeight;}var a=f.value.length;this._selectText(f,a,a);this._elCurListItem=c;}};YAHOO.widget.AutoComplete.prototype._selectItem=function(a){this._bItemSelected=true;this._updateValue(a);this._sPastSelections=this._elTextbox.value;this._clearInterval();this.itemSelectEvent.fire(this,a,a._oResultData);this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(this._elCurListItem){this._selectItem(this._elCurListItem);}else{this._toggleContainer(false);}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(g){if(this._bContainerOpen){var h=this._elCurListItem,d=-1;if(h){d=h._nItemIndex;}var e=(g==40)?(d+1):(d-1);if(e<-2||e>=this._nDisplayedItems){return;}if(h){this._toggleHighlight(h,"from");this.itemArrowFromEvent.fire(this,h);}if(e==-1){if(this.delimChar){this._elTextbox.value=this._sPastSelections+this._sCurQuery;}else{this._elTextbox.value=this._sCurQuery;}return;}if(e==-2){this._toggleContainer(false);return;}var f=this._elList.childNodes[e],b=this._elContent,c=YAHOO.util.Dom.getStyle(b,"overflow"),i=YAHOO.util.Dom.getStyle(b,"overflowY"),a=((c=="auto")||(c=="scroll")||(i=="auto")||(i=="scroll"));if(a&&(e>-1)&&(e<this._nDisplayedItems)){if(g==40){if((f.offsetTop+f.offsetHeight)>(b.scrollTop+b.offsetHeight)){b.scrollTop=(f.offsetTop+f.offsetHeight)-b.offsetHeight;}else{if((f.offsetTop+f.offsetHeight)<b.scrollTop){b.scrollTop=f.offsetTop;}}}else{if(f.offsetTop<b.scrollTop){this._elContent.scrollTop=f.offsetTop;}else{if(f.offsetTop>(b.scrollTop+b.offsetHeight)){this._elContent.scrollTop=(f.offsetTop+f.offsetHeight)-b.offsetHeight;}}}}this._toggleHighlight(f,"to");this.itemArrowToEvent.fire(this,f);if(this.typeAhead){this._updateValue(f);this._sCurQuery=f._sResultMatch;}}};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(a,c){var d=YAHOO.util.Event.getTarget(a);var b=d.nodeName.toLowerCase();while(d&&(b!="table")){switch(b){case"body":return;case"li":if(c.prehighlightClassName){c._togglePrehighlight(d,"mouseover");}else{c._toggleHighlight(d,"to");}c.itemMouseOverEvent.fire(c,d);break;case"div":if(YAHOO.util.Dom.hasClass(d,"yui-ac-container")){c._bOverContainer=true;return;}break;default:break;}d=d.parentNode;if(d){b=d.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(a,c){var d=YAHOO.util.Event.getTarget(a);var b=d.nodeName.toLowerCase();while(d&&(b!="table")){switch(b){case"body":return;case"li":if(c.prehighlightClassName){c._togglePrehighlight(d,"mouseout");}else{c._toggleHighlight(d,"from");}c.itemMouseOutEvent.fire(c,d);break;case"ul":c._toggleHighlight(c._elCurListItem,"to");break;case"div":if(YAHOO.util.Dom.hasClass(d,"yui-ac-container")){c._bOverContainer=false;return;}break;default:break;}d=d.parentNode;if(d){b=d.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerClick=function(a,c){var d=YAHOO.util.Event.getTarget(a);var b=d.nodeName.toLowerCase();while(d&&(b!="table")){switch(b){case"body":return;case"li":c._toggleHighlight(d,"to");c._selectItem(d);return;default:break;}d=d.parentNode;if(d){b=d.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(a,b){b._focus();};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(a,b){b._toggleContainerHelpers(b._bContainerOpen);};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(a,b){var c=a.keyCode;if(b._nTypeAheadDelayID!=-1){clearTimeout(b._nTypeAheadDelayID);}switch(c){case 9:if(!YAHOO.env.ua.opera&&(navigator.userAgent.toLowerCase().indexOf("mac")==-1)||(YAHOO.env.ua.webkit>420)){if(b._elCurListItem){if(b.delimChar&&(b._nKeyCode!=c)){if(b._bContainerOpen){YAHOO.util.Event.stopEvent(a);}}b._selectItem(b._elCurListItem);}else{b._toggleContainer(false);}}break;case 13:if(!YAHOO.env.ua.opera&&(navigator.userAgent.toLowerCase().indexOf("mac")==-1)||(YAHOO.env.ua.webkit>420)){if(b._elCurListItem){if(b._nKeyCode!=c){if(b._bContainerOpen){YAHOO.util.Event.stopEvent(a);}}b._selectItem(b._elCurListItem);}else{b._toggleContainer(false);}}break;case 27:b._toggleContainer(false);return;case 39:b._jumpSelection();break;case 38:if(b._bContainerOpen){YAHOO.util.Event.stopEvent(a);b._moveSelection(c);}break;case 40:if(b._bContainerOpen){YAHOO.util.Event.stopEvent(a);b._moveSelection(c);}break;default:b._bItemSelected=false;b._toggleHighlight(b._elCurListItem,"from");b.textboxKeyEvent.fire(b,c);break;}if(c===18){b._enableIntervalDetection();}b._nKeyCode=c;};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(a,b){var c=a.keyCode;if(YAHOO.env.ua.opera||(navigator.userAgent.toLowerCase().indexOf("mac")!=-1)&&(YAHOO.env.ua.webkit<420)){switch(c){case 9:if(b._bContainerOpen){if(b.delimChar){YAHOO.util.Event.stopEvent(a);}if(b._elCurListItem){b._selectItem(b._elCurListItem);}else{b._toggleContainer(false);}}break;case 13:if(b._bContainerOpen){YAHOO.util.Event.stopEvent(a);
if(b._elCurListItem){b._selectItem(b._elCurListItem);}else{b._toggleContainer(false);}}break;default:break;}}else{if(c==229){b._enableIntervalDetection();}}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(a,c){var b=this.value;c._initProps();var d=a.keyCode;if(c._isIgnoreKey(d)){return;}if(c._nDelayID!=-1){clearTimeout(c._nDelayID);}c._nDelayID=setTimeout(function(){c._sendQuery(b);},(c.queryDelay*1000));};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(a,b){if(!b._bFocused){b._elTextbox.setAttribute("autocomplete","off");b._bFocused=true;b._sInitInputValue=b._elTextbox.value;b.textboxFocusEvent.fire(b);}};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(a,c){if(!c._bOverContainer||(c._nKeyCode==9)){if(!c._bItemSelected){var b=c._textMatchesOption();if(!c._bContainerOpen||(c._bContainerOpen&&(b===null))){if(c.forceSelection){c._clearSelection();}else{c.unmatchedItemSelectEvent.fire(c,c._sCurQuery);}}else{if(c.forceSelection){c._selectItem(b);}}}c._clearInterval();c._bFocused=false;if(c._sInitInputValue!==c._elTextbox.value){c.textboxChangeEvent.fire(c);}c.textboxBlurEvent.fire(c);c._toggleContainer(false);}else{c._focus();}};YAHOO.widget.AutoComplete.prototype._onWindowUnload=function(a,b){if(b&&b._elTextbox&&b.allowBrowserAutocomplete){b._elTextbox.setAttribute("autocomplete","on");}};YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery=function(a){return this.generateRequest(a);};YAHOO.widget.AutoComplete.prototype.getListItems=function(){var c=[],b=this._elList.childNodes;for(var a=b.length-1;a>=0;a--){c[a]=b[a];}return c;};YAHOO.widget.AutoComplete._cloneObject=function(d){if(!YAHOO.lang.isValue(d)){return d;}var f={};if(YAHOO.lang.isFunction(d)){f=d;}else{if(YAHOO.lang.isArray(d)){var e=[];for(var c=0,b=d.length;c<b;c++){e[c]=YAHOO.widget.AutoComplete._cloneObject(d[c]);}f=e;}else{if(YAHOO.lang.isObject(d)){for(var a in d){if(YAHOO.lang.hasOwnProperty(d,a)){if(YAHOO.lang.isValue(d[a])&&YAHOO.lang.isObject(d[a])||YAHOO.lang.isArray(d[a])){f[a]=YAHOO.widget.AutoComplete._cloneObject(d[a]);}else{f[a]=d[a];}}}}else{f=d;}}}return f;};YAHOO.register("autocomplete",YAHOO.widget.AutoComplete,{version:"2.9.0",build:"2800"});
/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
(function(){var l=YAHOO.lang,isFunction=l.isFunction,isObject=l.isObject,isArray=l.isArray,_toStr=Object.prototype.toString,Native=(YAHOO.env.ua.caja?window:this).JSON,_UNICODE_EXCEPTIONS=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_ESCAPES=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,_VALUES=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS=/(?:^|:|,)(?:\s*\[)+/g,_UNSAFE=/[^\],:{}\s]/,_SPECIAL_CHARS=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_CHARS={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},UNDEFINED="undefined",OBJECT="object",NULL="null",STRING="string",NUMBER="number",BOOLEAN="boolean",DATE="date",_allowable={"undefined":UNDEFINED,"string":STRING,"[object String]":STRING,"number":NUMBER,"[object Number]":NUMBER,"boolean":BOOLEAN,"[object Boolean]":BOOLEAN,"[object Date]":DATE,"[object RegExp]":OBJECT},EMPTY="",OPEN_O="{",CLOSE_O="}",OPEN_A="[",CLOSE_A="]",COMMA=",",COMMA_CR=",\n",CR="\n",COLON=":",COLON_SP=": ",QUOTE='"';Native=_toStr.call(Native)==="[object JSON]"&&Native;function _char(c){if(!_CHARS[c]){_CHARS[c]="\\u"+("0000"+(+(c.charCodeAt(0))).toString(16)).slice(-4);}return _CHARS[c];}function _revive(data,reviver){var walk=function(o,key){var k,v,value=o[key];if(value&&typeof value==="object"){for(k in value){if(l.hasOwnProperty(value,k)){v=walk(value,k);if(v===undefined){delete value[k];}else{value[k]=v;}}}}return reviver.call(o,key,value);};return typeof reviver==="function"?walk({"":data},""):data;}function _prepare(s){return s.replace(_UNICODE_EXCEPTIONS,_char);}function _isSafe(str){return l.isString(str)&&!_UNSAFE.test(str.replace(_ESCAPES,"@").replace(_VALUES,"]").replace(_BRACKETS,""));}function _parse(s,reviver){s=_prepare(s);if(_isSafe(s)){return _revive(eval("("+s+")"),reviver);}throw new SyntaxError("JSON.parse");}function _type(o){var t=typeof o;return _allowable[t]||_allowable[_toStr.call(o)]||(t===OBJECT?(o?OBJECT:NULL):UNDEFINED);}function _string(s){return QUOTE+s.replace(_SPECIAL_CHARS,_char)+QUOTE;}function _indent(s,space){return s.replace(/^/gm,space);}function _stringify(o,w,space){if(o===undefined){return undefined;}var replacer=isFunction(w)?w:null,format=_toStr.call(space).match(/String|Number/)||[],_date=YAHOO.lang.JSON.dateToString,stack=[],tmp,i,len;if(replacer||!isArray(w)){w=undefined;}if(w){tmp={};for(i=0,len=w.length;i<len;++i){tmp[w[i]]=true;}w=tmp;}space=format[0]==="Number"?new Array(Math.min(Math.max(0,space),10)+1).join(" "):(space||EMPTY).slice(0,10);function _serialize(h,key){var value=h[key],t=_type(value),a=[],colon=space?COLON_SP:COLON,arr,i,keys,k,v;if(isObject(value)&&isFunction(value.toJSON)){value=value.toJSON(key);}else{if(t===DATE){value=_date(value);}}if(isFunction(replacer)){value=replacer.call(h,key,value);}if(value!==h[key]){t=_type(value);}switch(t){case DATE:case OBJECT:break;case STRING:return _string(value);case NUMBER:return isFinite(value)?value+EMPTY:NULL;case BOOLEAN:return value+EMPTY;case NULL:return NULL;default:return undefined;}for(i=stack.length-1;i>=0;--i){if(stack[i]===value){throw new Error("JSON.stringify. Cyclical reference");}}arr=isArray(value);stack.push(value);if(arr){for(i=value.length-1;i>=0;--i){a[i]=_serialize(value,i)||NULL;}}else{keys=w||value;i=0;for(k in keys){if(l.hasOwnProperty(keys,k)){v=_serialize(value,k);if(v){a[i++]=_string(k)+colon+v;}}}}stack.pop();if(space&&a.length){return arr?OPEN_A+CR+_indent(a.join(COMMA_CR),space)+CR+CLOSE_A:OPEN_O+CR+_indent(a.join(COMMA_CR),space)+CR+CLOSE_O;}else{return arr?OPEN_A+a.join(COMMA)+CLOSE_A:OPEN_O+a.join(COMMA)+CLOSE_O;}}return _serialize({"":o},"");}YAHOO.lang.JSON={useNativeParse:!!Native,useNativeStringify:!!Native,isSafe:function(s){return _isSafe(_prepare(s));},parse:function(s,reviver){if(typeof s!=="string"){s+="";}return Native&&YAHOO.lang.JSON.useNativeParse?Native.parse(s,reviver):_parse(s,reviver);},stringify:function(o,w,space){return Native&&YAHOO.lang.JSON.useNativeStringify?Native.stringify(o,w,space):_stringify(o,w,space);},dateToString:function(d){function _zeroPad(v){return v<10?"0"+v:v;}return d.getUTCFullYear()+"-"+_zeroPad(d.getUTCMonth()+1)+"-"+_zeroPad(d.getUTCDate())+"T"+_zeroPad(d.getUTCHours())+COLON+_zeroPad(d.getUTCMinutes())+COLON+_zeroPad(d.getUTCSeconds())+"Z";},stringToDate:function(str){var m=str.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3}))?Z$/);if(m){var d=new Date();d.setUTCFullYear(m[1],m[2]-1,m[3]);d.setUTCHours(m[4],m[5],m[6],(m[7]||0));return d;}return str;}};YAHOO.lang.JSON.isValid=YAHOO.lang.JSON.isSafe;})();YAHOO.register("json",YAHOO.lang.JSON,{version:"2.9.0",build:"2800"});
/**
 * this files creates the base namespace for all core starwood
 * code -"sw". In addtion, shortcuts are created into the YAHOO.util for ease of coding.
 * @author Danlan
 */

if(YAHOO.util){
    /**
     * create shortcuts into YAHOO lib, allows for easer coding/readability.
     * some of the shortcuts: yuiDom, yuiEvent, yuiAnim, yuiEasing...
     * Same as var yuiDom = YAHOO.util.Dom;
     */
    for(var prop in YAHOO.util){
        window["yui"+ prop] = YAHOO.util[prop];
    }
    if(YAHOO.lang.JSON){
        yuiJSON = YAHOO.lang.JSON;
    }
}
/**
 * create the base "sw" namespace for all core starwood code.
 */
var SW = YAHOO.namespace("SW");

YAHOO.namespace("SW.tools"); // general utility objects and methods
YAHOO.namespace("SW.customEvent"); // custom event models
YAHOO.namespace("SW.widget"); // larger components
YAHOO.namespace("SW.domWidget"); // built in dom scrubbing to gain hooks widgets
YAHOO.namespace("SW.widget.virtualEarth"); // virtualEarth components
YAHOO.namespace("SW.flash"); // adaptors for Flash. When Flash needs to call JS, it uses this namespace. Local flash code should prefix component name with brand (ie SW.flash.SPGTour)
YAHOO.namespace("SW.local"); // namespace for any non-common code. All brand/page specific code resides here
YAHOO.namespace("SW.local.content"); // namespace
YAHOO.namespace("SW.maps");//namespace for map related JS

/**
 * extensions to core JavaScript objects: Function, Array...
 */

/**
 * Class method for copying psuedo-arrays to *real* arrays, such
 * as function arguments and dom node collections (ie, document.getElementsByTagName("div"))
 * @param {Object} original array
 * @return {Array} new *real* array
 */
Array.Copy = function(original){
  var i,result = [];
  for(i=0;i<original.length;i++){
    result.push(original[i]);
  }
  return result;
};
/**
 * alters the context in which a method will run, can be handy when used in conjunction with events
 * @param {Object} context for method to run (sets up the "this" reference)
 * @param... all additional parameters are passed to the bound method as parameters
 * @return {Function} invoking this function in any context will run the method in the correct context
 */
/*
  example:
  var myObject = {
    name:"fred"
  };
  function doTest(param1,param2){
    alert(this.name +'\n'+ param1 +'\n'+ param2);
  }
  var boundMethod = doTest.bind(myObject,"12","jane");
  boundMethod();
*/
Function.prototype.bind = function(context) {
  var method = this;
  var args = Array.Copy(arguments);
  var obj = args.shift();
  return function() {
    return method.apply(obj, args);
  };
};

// JavaScript 1.6 methods
if (!Array.forEach) {
    // perform action on each item of array - used in place of: for(i=0;i<myArray.length;i++) {...}
    /*
     example:
     var myArray = ['apple','banana','pear'];
     myArray.forEach(function(fruit){
     document.write(fruit);
     });
     */
    Array.prototype.forEach = function(fn, thisObj) {
        var i, j, scope = thisObj || window;
        for (i = 0, j = this.length; i < j; ++i) {
            fn.call(scope, this[i], i, this);
        }
    };
}
if (!Array.every) {
    // check if every item in array matches some criteria
    /*
     example:
     var myArray = [
     {name:'apple',type:'fruit'},
     {name:'steak',type:'meat'},
     {name:'pear',type:'fruit'}
     ];
     // returns false
     var allItemsAreFruits = myArray.every(function(food){
     return (food.type == "fruit");
     });
     */
    Array.prototype.every = function(fn, thisObj) {
        var i, j, scope = thisObj || window;
        for (i = 0, j = this.length; i < j; ++i) {
            if (!fn.call(scope, this[i], i, this)) {
                return false;
            }
        }
        return true;
    };
}
if (!Array.some) {
    // check if every item in array matches some criteria
    /*
     example:
     var myArray = [
     {name:'apple',type:'fruit'},
     {name:'steak',type:'meat'},
     {name:'pear',type:'fruit'}
     ];
     // returns true
     var someItemsAreFruits = myArray.some(function(food){
     return (food.type == "fruit");
     });
     */
    Array.prototype.some = function(fn, thisObj) {
        var i, j, scope = thisObj || window;
        for (i = 0, j = this.length; i < j; ++i) {
            if (fn.call(scope, this[i], i, this)) {
                return true;
            }
        }
        return false;
    };
}
if (!Array.map) {
    // create a new array based on contents of original array
    /*
     example:
     var myArray = [
     {name:'apple',type:'fruit'},
     {name:'steak',type:'meat'},
     {name:'pear',type:'fruit'}
     ];
     var arrayOfHtml = myArray.map(function(food){
     return "<div>"+ food.name +" ("+ food.type +")</div>";
     });
     */
    Array.prototype.map = function(fn, thisObj) {
        var i, j, scope = thisObj || window,
            a = [];
        for (i = 0, j = this.length; i < j; ++i) {
            a.push(fn.call(scope, this[i], i, this));
        }
        return a;
    };
}
if (!Array.filter) {
    // create a new array of filtered results
    /*
     example:
     var myArray = [
     {name:'apple',type:'fruit'},
     {name:'steak',type:'meat'},
     {name:'pear',type:'fruit'}
     ];
     // returns true
     var fruits = myArray.map(function(food){
     return (food.type == "fruit");
     });
     */
    Array.prototype.filter = function(fn, thisObj) {
        var i, j, scope = thisObj || window,
            a = [];
        for (i = 0, j = this.length; i < j; ++i) {
            if (!fn.call(scope, this[i], i, this)) {
                continue;
            }
            a.push(this[i]);
        }
        return a;
    };
}
if (!Array.indexOf) {
    // returns index of specified element (-1 if not found)
    Array.prototype.indexOf = function(el, start) {
        var i, j;
        start = start || 0;
        for (i = start, j = this.length; i < j; ++i) {
            if (this[i] === el) {
                return i;
            }
        }
        return -1;
    };
}
if (!Array.lastIndexOf) {
    // returns the last index of specified element (-1 if not found)
    Array.prototype.lastIndexOf = function(el, start) {
        var i;
        start = start || this.length;
        if (start >= this.length) {
            start = this.length;
        }
        if (start < 0) {
            start = this.length + start;
        }
        for (i = start; i >= 0; --i) {
            if (this[i] === el) {
                return i;
            }
        }
        return -1;
    };
}
// more useful array methods
// override commented out as it was conflicting with Bing Maps API
// found no usage of this method in whole codebase except swfAddress library which is 3rd party anyway
/* if(!Array.splice){
 Array.prototype.splice = function (iIndex , iLength ) {
 var i,aResult  = new Array();
 var aRemoved  = new Array();
 for (i=0; i < iIndex; i++){
 aResult.push(this[i]);
 }
 for (i=iIndex; i < iIndex+iLength; i++) {
 aRemoved.push(this[i]);
 }
 if (arguments.length > 2) {
 for (i=2; i < arguments.length; i++) {
 aResult.push(arguments[i]);
 }
 }
 for (i=iIndex+iLength; i < this.length; i++) {
 aResult.push(this[i]);
 }
 for (i=0; i < aResult.length; i++) {
 this[i] = aResult[i];
 }
 this.length = aResult.length;
 return aRemoved;
 }
 } */
if (!Array.remove) {
    Array.prototype.remove = function (vItem) {
        this.removeAt(this.indexOf(vItem));
        return vItem;
    };
}
if (!Array.removeAt) {
    Array.prototype.removeAt = function (iIndex) {
        var vItem = this[iIndex];
        if (vItem) {
            this.splice(iIndex, 1);
        }
        return vItem;
    };
}


// object/JSON sorting
(function() {
    // local object which creates comparator functions for sorting arrays of objects
    var Comparator = {
        cache:{},
        getComparator:function(array,criteria) {
            // if array is empty, we can exit now
            if(array.length == 0){
                return function(){ return 0; }
            }
            // criteria are function arguments, need  to turn into 'real' array
            criteria = Array.Copy(criteria);
            var criteriaId = criteria.join();
            if(!Comparator.cache[criteriaId]){
                // generate function
                // "new Function" is generally not a good idea, but actually provides the best for performance in this case
                var functionBody = [];
                var thisCriteria,i;
                functionBody.push("  var val = 0;");
                for (i = 0; i < criteria.length; i++) {
                    thisCriteria = criteria[i];
                    switch(typeof array[0][thisCriteria]){
                        case "string":
                            functionBody.push("  val = (b."+ thisCriteria +" < a."+ thisCriteria +") - (a."+ thisCriteria +" < b."+ thisCriteria +");");
                            break;
                        case "number":
                            functionBody.push("  val = a."+ thisCriteria +" -  b."+ thisCriteria +";");
                            break;
                        case "boolean":
                            functionBody.push("  val = (a."+ thisCriteria +"*-1) -  (b."+ thisCriteria +"*-1);");
                            break;
                    }
                    functionBody.push("  if (val != 0) {");
                    // look ahead for -1;
                    if(criteria[i+1] === -1){
                        functionBody.push("    return val * -1;");
                    }else{
                        functionBody.push("    return val;");
                    }
                    functionBody.push("  }");
                }
                functionBody.push("  return val;");
                Comparator.cache[criteriaId] = new Function("a","b",functionBody.join("\n"));
            }
            return Comparator.cache[criteriaId];
        }
    };

    /**
        Object sorting (JSON sorting) method. To have a field use reverse order (DESC), make -1 the following parameter (see examples)
        Here is a sample objectSort call for DISTANCE sorting in SPG:
            searchResults.objectSort("isParticipating","favorite","distance","hasCash","cityName","propertyName");
        Simple example - for and array of people, sort by last name, then by first name
            people.sort("lsatName","firstName");
        Simple example - Sort people by age oldest to youngest, then by last name (a-z)
            people.sort("age",-1,"lastName");

    **/
    Array.prototype.objectSort = function() {
        // perform sort and return instance array
        this.sort(Comparator.getComparator(this,arguments));
        return this;
    };
})();

// object/JSON filtering
(function() {
    var FilterManager = {
        cache:{},
        getFilter:function(array,criteria){
            if(array.length === 0 || criteria.length === 0){
                return function(){return true;};
            }
            var criteriaId = criteria.join();
            if(!FilterManager.cache[criteriaId]){
                var functionBody = [],
                    conditions = [],
                    quoteChar = "",
                    thisField,thisValue,thisOperator,i,innerCondition,prefix,suffix;
                for (i = 0; i < criteria.length; i+=3) {
                    prefix = "";
                    suffix = "";
                    thisField = criteria[i];
                    thisValue = criteria[i+1];
                    // if value is not an array, turn it into one
                    if(!(typeof thisValue == "object" && thisValue.length > 0)){
                        thisValue = [thisValue];
                    }
                    thisOperator = criteria[i+2];
                    quoteChar = (typeof array[0][thisField] == "string") ? "\"" : "";
                    switch(thisOperator){
                        case "equals":
                            prefix = "item."+ thisField +" == "+ quoteChar;
                            suffix = quoteChar ;
                            break;
                        case "notEquals":
                            prefix = "item."+ thisField +" != "+ quoteChar;
                            suffix = quoteChar ;
                            break;
                        case "greaterThan":
                            prefix = "item."+ thisField +" > "+ quoteChar;
                            suffix = quoteChar ;
                            break;
                        case "lessThan":
                            prefix = "item."+ thisField +" < "+ quoteChar;
                            suffix = quoteChar ;
                            break;
                        case "greaterThanEquals":
                            prefix = "item."+ thisField +" >= "+ quoteChar;
                            suffix = quoteChar ;
                            break;
                        case "lessThanEquals":
                            prefix = "item."+ thisField +" <= "+ quoteChar;
                            suffix = quoteChar ;
                            break;
                        case "contains":
                            quoteChar = "\"";
                            prefix = "item."+ thisField +".indexOf("+ quoteChar;
                            suffix = quoteChar +") > -1";
                            break;
                        default:
                            // if invalid operator passed, do not use this criteria
                            continue;
                    }
                    innerCondition = [];
                    thisValue.forEach(function(val){
                        innerCondition.push(prefix + val + suffix);
                    });
                    conditions.push("("+ innerCondition.join(" ||  ") +")");
                }
                functionBody.push("if( "+ conditions.join(" && ") +"){");
                functionBody.push("  return true;");
                functionBody.push("}");
                functionBody.push("return false;");
                FilterManager.cache[criteriaId] = new Function("item",functionBody.join("\n"));

            }
            return FilterManager.cache[criteriaId];
        }
    };

    Array.prototype.setFilter = function(field,value,operator) {
        // first time calling setFilter, setup objects and methods
        var criteria = [],
            thisArray = this;
        thisArray.setFilter = function(field,value,operator) {
            if(arguments.length === 0){
                criteria.length = 0;
                return thisArray;
            }
            operator = operator || "equals";
            criteria.push(field,value,operator);
            return thisArray;
        };
        thisArray.objectFilter = function(){
            var result = thisArray.filter(FilterManager.getFilter(thisArray,criteria));
            criteria.length = 0;
            return result;
        };

        // set this filter criteria and return array (note - this code only runs first time setFilter is called)
        thisArray.setFilter(field,value,operator);
        return thisArray;
    };
    // dummy placeholder method... here just in case objectFilter is called before setFilter
    Array.prototype.objectFilter = function() {
        // behave like normal, return copy of this array
        return Array.Copy(this);
    };
})();
/**
 * The utilities.js file provides additional functions, many built on top of yahoo
 * @module starwood utilities
 * @requires yahoo-dom-event
 */


// can be used in place of window.onload or yuiEvent.addListener(window,"load",...).
// In theory, this fires when the closing body tag is drawn (before window.onload).

/**
 * @deprecated
 * @param String url
 * @param String param
 * @param String val
 * @return String
 */
SW.tools.setUrlParameter = function(url,param,val){
    return SW.tools.Url.setParameter(url,param,val);
}
SW.tools.Url = {
    /**
     * used to add or change value of parameter in url
     * var url = SW.tools.setUrlParamter(document.location.href,"propID",mySelect.value);
     * @param url
     * @param param
     * @param val
     * @return String
     */
    setParameter:function(url,param,val){
        var curPairs;
        var paramPair;
        var hashString = "";
        if(url.indexOf("#") > -1){
            hashString = url.substr(url.indexOf("#")+1);
            url = url.substring(0,url.indexOf("#"));
        }
        var allPairs = [];
        var urlParts = url.split('?');

        if(urlParts.length>1){
            curPairs = urlParts[1].split('&');
            curPairs.forEach(function(paramPair){
                var paramParts = paramPair.split('=');
                if(paramParts[0] != param){
                    allPairs.push(paramParts[0] + '=' + (typeof paramParts[1] != "undefined" ? paramParts[1]:'') );
                }
            });
        }
        if(val !== null && typeof val !== 'undefined'){ 
            allPairs.push(param + '=' + val);
        }
        return urlParts[0] + '?' + allPairs.join('&') + (hashString ? "#"+hashString:"");

    },
    getParameter:function(url,param){
        var i,urlParts,curPairs,paramParts;
        if(url.indexOf("#") > -1){
            url = url.substring(0,url.indexOf("#"));
        }
        urlParts = url.split('?');
        if(urlParts.length>1){
            curPairs = urlParts[1].split('&');
            for(i = 0; i < curPairs.length; i++){
                paramPair = curPairs[i];
                paramParts = paramPair.split('=');
                if(paramParts[0] === param){
                    return paramParts[1];
                }
            }
        }
        return null;
    },
    getHash:function(url){
        if(url.indexOf("#") > -1){
           return url.substring(url.indexOf("#")+1);
        }
        return "";
    }
};
/**
 * add to img tags which are using [semi]transparent png's to fix IE6 issue
 * This is only way to avoid *ALL* IE6 issues! (including browser freezing/locking up)
 * sample:
 *      <img src="/path/to/myImage.png" width="233" height="82" onload="SW.tools.iePNGLoader(this);" />
 * @param img
 */
SW.tools.iePNGLoader = function(img){
    if (navigator.userAgent.indexOf("MSIE") > -1 && parseInt(navigator.appVersion) <= 6) {
      var pSrc = img.src;
      img.onload = null;
      img.src = "/common/images/shim.gif";
      img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, src='" + pSrc + "')";
    }
}                                                                   

// Begin Code from YUI: Colorpicker
var HCHARS="0123456789ABCDEF";
/**
 * Converts decimal rgb values into a hex string
 * 255,255,255 -> FFFFFF
 * @method rgb2hex
 * @param r {int|[int, int, int]} the red value, or an
 *        array containing all three parameters
 * @param g {int} the green value
 * @param b {int} the blue value
 * @return {string} the hex string
 */
SW.tools.rgb2hex =  function(r, g, b) {
	var f=this.dec2hex;
	return f(r) + f(g) + f(b);
};

/**
 * Converts an int 0...255 to hex pair 00...FF
 * @method dec2hex
 * @param n {int} the number to convert
 * @return {string} the hex equivalent
 */
SW.tools.dec2hex = function(n) {
	n = parseInt(n, 10);
	n = (n > 255 || n < 0) ? 0 : n;

	return HCHARS.charAt((n - n % 16) / 16) + HCHARS.charAt(n % 16);
};
// End code from YUI: Colorpicker



// used in conjunction with secure json calls
// new yuiConnect( secureJsonUrl("/path/to/myData.jsp?someID=45") );
SW.tools.secureJsonUrl = function(url){
  return SW.tools.Url.setParameter(url,"_jsk",SW.Cookie.get("JSESSIONID"));
}

/*
### set cookie ###
  --> set basic session cookie
    SW.tools.Cookie.set("sid","somevalue");

  --> set permanent cookie
    SW.tools.Cookie.set("sid","somevalue","NEVER");

  --> set cookie to expire sometime in the future
    var exDate = new Date();
    expires.setMonth(expires.getMonth()+1);
    SW.tools.Cookie.set("sid","somevalue",expires);

### get cookie ###
  --> get value of cookie
    SW.tools.Cookie.get("sid");
    
### remove cookie ###
  --> remove cookie
    SW.tools.Cookie.remove("sid");
*/
SW.tools.Cookie = {
  values:[],
  loaded:false,
  set:function(name, value, expires, path, domain, secure){
    var cookieValue = new Array();
    cookieValue.push(name + "=" + escape(value));
    if(typeof expires != "undefined"){
      if(typeof expires == "string"){
        if(expires.toUpperCase() == "NEVER"){
          expires = new Date();
          expires.setFullYear(expires.getFullYear()+10);
        }else if(expires.toUpperCase() == "REMOVE"){
          expires = new Date();
          expires.setFullYear(expires.getFullYear()-1);
        }
      }
      cookieValue.push("expires=" + expires.toGMTString());
    }
    if(typeof path == "undefined"){
      path = "/";
    }
    cookieValue.push("path="+ path);
    if(typeof domain != "undefined"){
      cookieValue.push("domain=" + domain);
    }
    if(secure){
      cookieValue.push("secure");
    }
    document.cookie = cookieValue.join("; ");
    SW.tools.Cookie.loaded = false;
  },
  get:function(name){
    if (!SW.tools.Cookie.loaded) {
      SW.tools.Cookie._readCookie();
    };
    for (var i=0; i<SW.tools.Cookie.values.length; i++) {
      if (SW.tools.Cookie.values[i].name == name) {
        return SW.tools.Cookie.values[i].value;
      };
    }
    return "";
  },
  remove:function(name){
    SW.tools.Cookie.set(name,"","REMOVE");
  },
  // internal method
  _readCookie:function(){
    var cookieString = document.cookie;
    var paramPairs = cookieString.split("; ");
    var i,splitPair;
    SW.tools.Cookie.values = [];
    for (i=0; i<paramPairs.length; i++) {
      splitPair = paramPairs[i].split("=");
      if (splitPair.length == 2) {
        SW.tools.Cookie.values.push({
          name:unescape(splitPair[0]),
          value:unescape(splitPair[1])
        });
      }
    };
    SW.tools.Cookie.loaded = true;
  }
};

SW.tools.getSkinName = function(){
     return document.location.pathname.split("/")[1];
 };

SW.tools.Xml = {
    /**
     *
     * @param node - reference to parent node
     * @param tagname - tagname for which you want to get it's "innerText"
     * @return String
     */
    getSubNodeText:function(node, tagname){
        var returnValue;
        subNode = node.getElementsByTagName(tagname);
        if (subNode[0] != null) {
            returnValue = subNode[0].textContent || subNode[0].text;
            if(typeof returnValue == 'undefined' && subNode[0].firstChild){
                returnValue = subNode[0].firstChild.nodeValue;
            }
        }
        if(!returnValue){
            returnValue = "";
        }
        return returnValue;
    }
};

// helper methods to scrub html for data (taken from results.js - consider making common version)

SW.tools.Html = (function(){
    var yuiDom = YAHOO.util.Dom,
        yuiLang = YAHOO.lang;
    
    function dataToType(data, type, defaultVal) {
        var val = defaultVal;
        switch (type) {
            case "string":
                val = (data === "") ? defaultVal:data;
                break;
            case "array":
                if(data === ""){
                   val = defaultVal;
                }else{
                    val = data.split(",");
                }
                break;
            case "boolean":
                val = (data === "true") ? true:defaultVal;
                break;
            case "float":
                val = parseFloat(data);
                if (isNaN(val)) {
                    val = defaultVal;
                }
                break;
            case "int":
                val = parseInt(data, 10);
                if (isNaN(val)) {
                    val = defaultVal;
                }
                break;
            default:
                break;
        }
        return val;
    }
    var self = {
        getDataFromInput:function(root, className, type, defaultVal) {
            var input = yuiDom.getElementsByClassName(className, "input", root);
            var val = defaultVal;
            if (input && input[0]) {
                val = dataToType(input[0].value, type, defaultVal);
            }
            return val;
        },
        getDataFromTag:function(root, tagName, className, type, defaultVal) {
            var result = yuiDom.getElementsByClassName(className, tagName, root);
            var val = defaultVal;
            if (result && result[0]) {
                val = dataToType(yuiLang.trim(result[0].innerHTML), type, defaultVal);
            }
            return val;
        },
        getClearDiv:function(){
            var div = document.createElement("div");
            yuiDom.addClass(div,"clearDiv");
            return div;
        },
        appendClearDiv:function(parentNode){
            parentNode.appendChild(self.getClearDiv());
        }
    };
    return self;
})();
/**
 * SW.domWidget provides a common interface for Dom manipulation that
 * runs onDOMReady or when a manual refresh call is made to
 * SW.domWidget.update(rootElement).
 * NOTE: Performance is critical when developing new domWidget!
 * @namespace SW.domWidget
 */


/**
 * base widget - copy and paste the following code to start new widget.
 * must include id. This is used for namespacing.
 * should include load and update methods.
 * initialize is a standard naming convention, not required.
 * the following methods are automatically attached:
 *   setConfig - attaches config objects to html elements
 *   getConfig - retreived config object from html element
 *   setEnabled - turns a widget on/off
 *   getEnabled - used internally to determine if widget is enabled
 * all domWidget are disabled by default. To enable a widget, you must call
 *   SW.domWidget.WIDGET_ID.setEnabled(true);
 */
/*
SW.domWidget.add({
  id:"WidgetId",
  initialize:function(){
     // standard function name - manually called - SW.domWidget.WidgetId.initialize(params...);
  },
  load:function(){
    // do load stuff, find elements and setup
  },
  update:function(root){
    // do update stuff, find elements and setup. root element is passed in.
  }
});

*/

SW.domWidget = {
  widgetArray:[],
  initialize:function(){
    yuiEvent.onDOMReady(SW.domWidget.load);
  },
  /**
   * add a new wiget to the domWidget manager
   * @param {Object} widget
   */
  add:function(widget){
    SW.domWidget.widgetArray.push(widget);
    SW.domWidget[widget.id] = widget;
    widget.enabled = false;
    widget.setConfig = function(els,config){
      var self = this;
      if(! (typeof els == "object") || !(els.constructor == Array)){
        els = [els];
      }
      els.forEach(function(el){
        el = yuiDom.get(el);
        if(!el.widgetConfig){ el.widgetConfig = {}; }
        el.widgetConfig[self.id] = config;
      });
    }
    widget.getConfig = function(el){
      if(el && el.widgetConfig && el.widgetConfig[this.id]){
        return el.widgetConfig[this.id];
      }
      return null;
    }
    widget.setEnabled = function(enabled){
      this.enabled = enabled;
    }
    widget.getEnabled = function(){
      return this.enabled;
    }
  },
  /**
   * runs onDOMReady, checks for enabled domWidget and runs each load method
   */
  load:function(){
    SW.domWidget.widgetArray.forEach(function(widget){
      if(widget.getEnabled() && widget.load){
        widget.load();
      }
    });
  },
  /**
   * Manually call this method when creating html on the fly (dom methods or innerHTML).
   * checks for enabled domWidget and runs each update method, passing in the root element.
   * @param {Object} root
   */
  update:function(root){
    SW.domWidget.widgetArray.forEach(function(widget){
      if(widget.getEnabled() && widget.update){
        widget.update(root);
      }
    });
  }
};
/**
 * get things started...
 */
SW.domWidget.initialize();

/**
 * provides "label inside of text input" functionality. Label and class names are removed on click.
 * Include a custom attribute of label on text inputs, eg: label="(enter city)". When this label is showing,
 * a class of "hasDefaultText" will be applied to the input.
 * @namespace SW.domWidget.inputLabels
 */
// begin inputLabels //
SW.domWidget.add({
  id:"inputLabels",
  initialize:function(){

  },
  load:function(){
    this.setup();
  },
  update:function(root){
    this.setup(root);
  },
  /**
   * find all elements and initialize
   * @param {Object} root
   */
  setup:function(root){
    var self = this;
    yuiDom.getElementsBy(function(input){
      if(!!input.getAttribute("label")){
         self.setupInput(input);
      }
    },"input",root);
    yuiDom.getElementsBy(function(input){
      if(!!input.getAttribute("label")){
         self.setupInput(input);
      }
    },"textarea",root);
  },
  /**
   * initialize single input. Adds listeners for focus and blur on the input.
   * Also, adds listeners for form.onsubmit and submitButton.click. More cleanly handles clearing
   * the label out of the value when the form submits.
   * @param {Object} input
   */
  setupInput:function(input){
    var self = this;
    if(!this.getConfig(input)){
      var config = {
        label:input.getAttribute("label")
      };
      this.setConfig(input,config);
      yuiEvent.addListener(input,"focus",this.removeLabelBridge);
      yuiEvent.addListener(input,"blur",this.setLabelBridge);
      if(input.form){
        yuiEvent.addListener(input.form,"submit",self.removeLabelBridge.bind(input));
        // also try to attach to submit buttons - this fire before forom.onsubmit and can help play better with validation functions
        function addSubmitHandler (submitButton){
          if(submitButton.type == "submit"){
            yuiEvent.addListener(submitButton,"click",self.removeLabelBridge.bind(input));
          }
        }
        yuiDom.getElementsBy(addSubmitHandler,"input",input.form);
        yuiDom.getElementsBy(addSubmitHandler,"button",input.form);
      }
    }
    this.setLabel(input);
  },
  /**
   * two main methods for checking, adding & removing label
   */
  removeLabel:function(input){
    var config = this.getConfig(input);
    if(input.value == config.label){
      yuiDom.removeClass(input,"hasDefaultText");
      input.value = "";
    }
  },
  setLabel:function(input){
    var config = this.getConfig(input);
    if(input.value == "" || input.value == config.label){
      yuiDom.addClass(input,"hasDefaultText");
      input.value = config.label;
    }
  },
  /**
   * event handlers/bridging methods. Maintain "this" in *real* methods.
   */
  removeLabelBridge:function(e){
    SW.domWidget.inputLabels.removeLabel(this);
  },
  setLabelBridge:function(e){
    SW.domWidget.inputLabels.setLabel(this);
  }
});

/**
 * provides tool tip/contextual help. Must have a container element with
 * a class of "toolTipTrigger" and an inner element with a class of
 * "toolTip" (Must only be one "toolTip" inside of a trigger!).
 * @namespace SW.domWidget.toolTips
 */
SW.domWidget.add({
  id:"toolTips",
  classSettings:{},
  idSettings:{},
  /**
   * base setttings, if none are provided
   */
  settings:{
    /**
     * appendTipToBody - moves the toolTip element to the body element. Makes absolute positioning easier.
     * set to false to leave the tool tip owned by the toolTipTrigger.
     */
    triggerClassName:"toolTipTrigger",
    tipClassName:"toolTip",
    triggerTagName:"span",
    tipTagName:"div",

    appendTipToBody:true,
    showDelay:0.35,
    hideDelay:0.5,
    showDuration:.175,
    hideDuration:.25,
    showTransition:YAHOO.util.Easing.easeIn,
    hideTransition:YAHOO.util.Easing.easeIn,
    stopEventOnClick:true,
    showAttributes:{
      opacity:{from:0,to:1}
    },
    hideAttributes:{
      opacity:{from:1,to:0}
    },
    setPosition:function(config,e){
      var coords  = yuiEvent.getXY(e);
      var viewPortWidth = yuiDom.getViewportWidth();
      var toolTipWidth = yuiDom.getStyle(config.tip,"width");
      toolTipWidth = toolTipWidth.substring(0,toolTipWidth.length-2);
      if ((coords[0] + toolTipWidth) >= viewPortWidth) coords[0] -= toolTipWidth;
      yuiDom.setStyle(config.tip,"left", coords[0] +"px");
      yuiDom.setStyle(config.tip,"top", coords[1] +"px");
    },
    showOnStart:function(config){
      yuiDom.setStyle(config.tip,"opacity",0);
    },
    showOnComplete:function(config){
      // do nothing
    },
    hideOnStart:function(config){
      // do nothing
    },
    hideOnComplete:function(config){
      // do nothing
    }
  },
  /**
   * global settings, affects all tool tips on a page.
   * @See SW.domWidget.toolTips.settings
   * @param {Object} globalSettings
   */
  initialize:function(globalSettings){
    this.addSettings(globalSettings,"global",null);
  },
  /**
   * class name based settings. The class must be applied to the trigger,
   * for example <span class="toolTipTrigger customToolTip"></span>.
   * These settinsg will only apply to the "customToolTip".
   * @See SW.domWidget.toolTips.settings
   * @param {Object} className
   * @param {Object} classSettings
   */
  addClassSettings:function(className,classSettings){
    classSettings.triggerClassName = className;
    this.addSettings(classSettings,"class",className);
  },
  /**
   * id based settings can be useful for specific placement of toolTip for a
   * single element (ie, when the toolTip might display over a select box)
   * @See SW.domWidget.toolTips.settings
   * @param {Object} id
   * @param {Object} idSettings
   */
  addIdSettings:function(id,idSettings){
    this.addSettings(idSettings,"id",id);
  },
  /**
   * internal function for adding settings.
   * @param {Object} settings
   * @param {Object} type
   * @param {Object} id
   */
  addSettings:function(settings,type,id){
    var curSettings,setting;
    switch(type){
      case "global":
        curSettings = this.settings;
        break;
      case "class":
        curSettings = this.classSettings[id] = {};
        break;
      case "id":
        curSettings = this.idSettings[id] = {};
        break;
    }
    if(curSettings && settings){
      for(setting in settings){
        curSettings[setting] = settings[setting];
      }
    }
  },
  /**
   * internal method to lookup a specific setting
   * @param {Object} config
   * @param {Object} setting
   */
  getSetting:function(config,setting){
    if(config.idSettings && typeof config.idSettings[setting] != "undefined"){
      return config.idSettings[setting];
    }
    if(config.classSettings && typeof config.classSettings[setting] != "undefined"){
      return config.classSettings[setting];
    }
    return this.settings[setting];
  },
  load:function(){
    this.getElements();
  },
  update:function(root){
    this.getElements(root);
  },
  /**
   * find the tool tips
   * @param {Object} root
   */
  getElements:function(root){
    var self = this;
    var el,config,className,id;
    root = root || document;

    for(id in this.idSettings){
      el = yuiDom.get(id);
      if(el){
        config = {
          idSettings:this.idSettings[id]
        };
        for(className in this.classSettings){
          if(yuiDom.hasClass(el,className)){
            config.classSettings = this.classSettings[className];
            break;
          }
        }
        self.setup(el);
      }
    }

    for(className in this.classSettings){
      config = {
        classSettings:this.classSettings[className]
      };
      yuiDom.getElementsByClassName(className,self.getSetting(config,"triggerTagName"),root).forEach(function(element){
        self.setup(element);
      });
    }

    config = {};

    yuiDom.getElementsByClassName(self.getSetting(config,"triggerClassName"),self.getSetting(config,"triggerTagName"),root).forEach(function(element){
      self.setup(element);
    });
  },
  /**
   * initialize single tool tip
   * @param {Object} trigger
   */
  setup:function(trigger){
    var classSettings = null,idSettings = null;
    var tip,tipImage,closeButton;
    var animIn,animOut;
    var self = this;
    var primaryElements = [];
    if(!this.getConfig(trigger)){
//      tip = yuiDom.getElementsByClassName("toolTip",null,trigger)[0];
      closeButton = yuiDom.getElementsByClassName("toolTipClose",null,trigger)[0];

      if(trigger.id && this.idSettings[trigger.id]){
        idSettings = this.idSettings[trigger.id];
      }
      for(var prop in this.classSettings){
        if(yuiDom.hasClass(trigger,prop)){
          classSettings = this.classSettings[prop];
          break;
        }
      }
      /**
       * config object is attached to all import elements using this.setConfig();
       * this contains all pertinent information about this instance.
       */
      var config = {
        trigger:trigger,
        tip:null,
        tipImage:tipImage,
        isShowing:false,
        isOver:false,
        showTimeout:null,
        hideTimeout:null,
        classSettings:classSettings,
        idSettings:idSettings,
        x:0,
        y:0
      };
      tip = yuiDom.getElementsByClassName(self.getSetting(config,"tipClassName"),self.getSetting(config,"tipTagName"),trigger)[0];
      config.tip = tip;
      if(this.getSetting(config,"appendTipToBody")){
        document.body.appendChild(tip);
      }

      animIn = new yuiAnim(tip,this.getSetting(config,"showAttributes"),this.getSetting(config,"showDuration"),this.getSetting(config,"showTransition"));
      animIn.onStart.subscribe(function(){
        self.getSetting(config,"showOnStart")(config);
        yuiDom.addClass(config.tip,"toolTipShowing");
      });
      animIn.onComplete.subscribe(function(){
        self.getSetting(config,"showOnComplete")(config);
      });
      animOut = new yuiAnim(tip,this.getSetting(config,"hideAttributes"),this.getSetting(config,"hideDuration"),this.getSetting(config,"hideTransition"));
      animOut.onStart.subscribe(function(){
        self.getSetting(config,"hideOnStart")(config);
      });
      animOut.onComplete.subscribe(function(){
        self.getSetting(config,"hideOnComplete")(config);
        yuiDom.removeClass(config.tip,"toolTipShowing");
      });

      config.animIn = animIn;
      config.animOut = animOut;

      primaryElements.push(trigger);
      primaryElements.push(tip);
      if(closeButton){
        primaryElements.push(closeButton);
      }
      this.setConfig(primaryElements,config);
      // in future allow config to set mouseover or click for showing
      yuiEvent.addListener(trigger,"mouseover",this.bridge.setShow);
      yuiEvent.addListener(trigger,"mouseout",this.bridge.setHide);
      yuiEvent.addListener(tip,"mouseover",this.bridge.clearHide);
      yuiEvent.addListener(tip,"mouseout",this.bridge.setHide);
      // should the following line be config based? this prevents onlcicks from triggering on parent nodes
      if(this.getSetting(config,"stopEventOnClick")){
        yuiEvent.addListener(tip,"click",this.bridge.stopEvent);
      }
      if(closeButton){
        yuiEvent.addListener(closeButton,"click",this.bridge.hideNow);
      }
    }
  },
  /**
   * main internal methods to show and hide tool tips (using timeouts)
   */
  show:function(config){
    if(yuiDom.hasClass(config.tip,"toolTipShowing")){
      return;
    }
    if(config.isOver && !config.isShowing){
      config.isShowing = true;
      config.animIn.animate();
    }
  },
  hide:function(config){
    config.isShowing = false;
    config.animOut.animate();
  },
  setShow:function(config){
    var self = this;
    config.isOver = true;
    this.clearHide(config);
    if(!config.isShowing){
      config.showTimeout = setTimeout(function(){
        self.show(config);
      },this.getSetting(config,"showDelay")*1000);
    }
  },
  setHide:function(config){
    var self = this;
    config.isOver = false;
    if(!config.hideTimeout && config.isShowing){
      clearTimeout(config.showTimeout);
      config.showTimeout = null;
      config.hideTimeout = setTimeout(function(){
        self.hide(config);
      },this.getSetting(config,"hideDelay")*1000);
    }
  },
  clearHide:function(config){
    if(config.hideTimeout){
      clearTimeout(config.hideTimeout);
      config.hideTimeout = null;
    }
  },
  hideNow:function(config){
    this.hide(config);
  },
  /**
   * bridging methods to seperate event handlers from main methods
   */
  bridge:{
    setShow:function(e){
      var self = SW.domWidget.toolTips;
      var config = self.getConfig(this);

      if(!config.isShowing){
        self.getSetting(config,"setPosition")(config,e);
      }

      self.setShow(config);
    },
    setHide:function(e){
      var self = SW.domWidget.toolTips;
      var config = self.getConfig(this);
      self.setHide(config);
    },
    clearHide:function(e){
      var self = SW.domWidget.toolTips;
      var config = self.getConfig(this);
      self.clearHide(config);
    },
    hideNow:function(e){
      var self = SW.domWidget.toolTips;
      var config = self.getConfig(this);
      self.hideNow(config);
      yuiEvent.stopEvent(e);
    },
    stopEvent:function(e){
      yuiEvent.stopEvent(e);
    }
  }
});


/**
 * handles onchange of select box where the option values are urls.
 * add a class of "urlSelect" to the select box.
 * @namespace SW.domWidget.urlSelect
 */
SW.domWidget.add({
  id:"urlSelect",
  initialize:function(){
  },
  load:function(){
    this.setup();
  },
  update:function(root){
    this.setup(root);
  },
  setup:function(root){
    var self = this;
    yuiDom.getElementsByClassName("urlSelect","select",root).forEach(function(selectBox){
      self.setupSelect(selectBox);
    });
  },
  setupSelect:function(selectBox){
    var config;
    if(!this.getConfig(selectBox)){
      config = {
        input:selectBox
      }
      this.setConfig(selectBox,config);
      yuiEvent.addListener(selectBox,"change",this.selectUrlBridge);
    }
  },
  selectUrl:function(config){
    if(config.input.value){
      document.location.href = config.input.value;
    }
  },
  /**
   * bridging method
   * @param {Object} e
   */
  selectUrlBridge:function(e){
    SW.domWidget.urlSelect.selectUrl(SW.domWidget.urlSelect.getConfig(this));
  }
});

SW.domWidget.add({
  id:"dhtmlSelect",
  container:null,
  trigger:null,
  load:function(){
    this.setup();
  },
  update:function(root){
    this.setup(root);
  },
  setup:function(root){
    var self = this;
    yuiDom.getElementsByClassName("dhtmlSelect","div",root).forEach(function(container){
      if(!self.getConfig(container)){
        var config = {
          container:container,
          trigger:yuiDom.getElementsByClassName("dhtmlSelectTrigger",null,container)[0]
        };
        self.setConfig([config.trigger,config.container],config);
        yuiEvent.addListener(config.trigger,"click",self.showBridge);
        SW.domWidget.bodyClickHandler.add(self.hideBridge,[config.container],config.trigger);
      }
    });
  },
  show:function(config){
    yuiDom.addClass(config.container,"show");
  },
  hide:function(config){
    yuiDom.removeClass(config.container,"show");
  },
  showBridge:function(e){
    var self = SW.domWidget.dhtmlSelect;
    var config = self.getConfig(this);
    self.show(config);
  },
  hideBridge:function(e){
    var self = SW.domWidget.dhtmlSelect;
    var config = self.getConfig(this);
    self.hide(config);
  }
});

/**
 * single handler for detecting body.onclick. Conditionally fires supplied method
 * if the cick did not originate within one of the supplied test elements.
 * Example usage: dhtml drop-down, when a click outside the drop-down is detected, the close method
 * would be called.
 * @namespace SW.domWidget.bodyClickHandler
 */
SW.domWidget.add({
  id:"bodyClickHandler",
  initialized:false,
  handlers:[],
  load:function(){
    yuiEvent.addListener(document.body,"click",this.clickBridge);
  },
  /**
   * add a new handler
   * @param {Object} method - the method to be called, the event object will be passed as the only parameter to this method.
   * @param {Array} testElements - an array of container elements. If click originates inside one of these, the method will not be invoked.
   * @param {Object} context - Optional, supplies context for the method (the "this" object, defaults to window)
   */
  add:function(method,testElements,context){
    context = context || window;
    this.handlers.push({
      method:method,
      context:context,
      testElements:testElements
    });
  },
  click:function(e){
    var clickedElement = yuiEvent.getTarget(e);
    this.handlers.forEach(function(args){
      var isContained = false;
      for(var i=0;i<args.testElements.length;i++){
        if(args.testElements[i]==clickedElement || yuiDom.isAncestor(args.testElements[i],clickedElement)){
          isContained = true;
          break;
        }
      }
      if(!isContained){
        args.method.apply(args.context,[e]);
      }
    });
  },
  /**
   * bridging method
   * @param {Object} e
   */
  clickBridge:function(e){
    var self = SW.domWidget.bodyClickHandler;
    self.click(e);
  }
});
function WebForm() {
	var self = this;
	this.errors = new Array();
	this.addError = function(_x, _y, _z, _a, _b) {
		for (i=0; i < arguments.length; i++) {
			if(arguments[i] != null) {
				self.errors[self.errors.length] = new error(arguments[i]);

			}
		}

	}
	this.hasErrors = function() { return (self.errors.length != 0);	}
	this.resetErrors = function() {
		for (i = 0;  i < self.errors.length; i++) {
			self.errors[i].handle("reset");
		}
		self.errors = new Array();
	}
	this.showErrors = function() {
		for (i = 0;  i < self.errors.length; i++) {
			self.errors[i].handle();
		}
        if ((typeof s != 'undefined') && (typeof s.prop11 != 'undefined')) {
            var s_prop11 = s.prop11;
            s.prop11 += 'Error';
            setOmniVars(s.charSet, s.server, s.channel, s.prop2, s.prop3, s.prop1, "", s.prop11);
            var s_code=s.t();
            s.prop11 = s_prop11;
        }
    }
	function error(_x) {
		var self = this;
		var errorCode;
		self.errorCode = _x;
		this.handle = function(reset) {
			set = (reset==null) ? reset=false : reset=true;
			handleDisplay(self.errorCode, set);
		}
		return this;
	}
	this.collapseErrors = function(errorCode) {
		var count = 0;
		for (i = 0;  i < self.errors.length; i++) {
			if (self.errors[i].errorCode.charAt(0) == "~") { count++; }
		}
		if (count > 1) {
			for (i = 0;  i < self.errors.length; i++) {
				if (self.errors[i].errorCode.charAt(0) == "~") { self.errors[i].errorCode = null; }
			}
			self.errors[self.errors.length] = new error(errorCode);
		}
	}
}

function handleDisplay(_obj, reset) {
	if (_obj != null) {
		if (_obj.charAt(0) == "~") { _obj = _obj.substring(1);	}
		if (_obj.charAt(0) == "!") {
			reset = !reset;
			_obj = _obj.substring(1);
		}
		var obj = document.getElementById(_obj);
        if (obj) {
            if (obj.tagName == "LABEL") {
    			obj.className = reset ? "" : "error";
    		}  else {
    			obj.style.display =  reset ? "none" : "";
    		}
        }
    }
}

function display(obj, state) {
	if (document.getElementById(obj)) {
		document.getElementById(obj).style.display = state;
	}
}

function validDate(_field, dateFormat) {
    var self = this,
        field,
        d,
        _s,
        _d,
        getDate = true;

    if (typeof dateFormat != "undefined") {
        dateFormatString = dateFormat;
    }

    field = _field;
    _s = field.value;

    _d = getDateFromField(field, dateFormatString);
    this.valid = true;
    // safari will not return true for isNaN check even when the date is initialized with day = dd, month = mm, and year = yyyy
    if (isNaN(_d.getDate()) || (field.value.toLowerCase() == dateFormatString.toLowerCase())) {  // Basically, this allows the functions to gracefully return to the format string instead of putting a date in the field.
        this.valid = false;
    }

    this.d = _d;
    this.setField = function() {
        writeDateToField(field, this.d, dateFormatString);
    };
    this.setD = function(_d) {
        self.d = _d
    };
    this.nextDay = function() {
        return this.d.setDate(self.d.getDate() + 1);
    };
    this.diffDate = function(dd) {
        return  Math.round((makeDate(dd).getTime() - makeDate(self.d).getTime()) / (1000 * 60 * 60 * 24));
    };
    function makeDate(md) {
        return new Date(fixYear(md.getYear()), md.getMonth(), md.getDate());
    }
    return this;
}

function fixYear(_y) {
		var y = (_y + 10000) % 100;
		y += (y < 38) ? 2000 : 1900;
		return y
}

function isValidEmail(field) {
	if (field != null && field != ''){
		field = stripCharsInBag (field, ' ')
//        var regexp = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; (oldone)
        var regexp = /^\w+((-\w+)|(\`\w+)|(\.\w+)|('\w+)|(\+\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
        return (field.search(regexp) != -1);
	}
}

function doesUserNameContainHyphen(field) {
	var regExp = /-/;
	return (field.search(regExp) != -1)
}

function isValidZip(field, country){
	if (field != '' && field != null && country != '' && country != null){
		if (country == 'US'){
			var regExp = /(^\d{5}$)|(^\d{5}-\d{4}$)/;
			return (field.search(regExp) != -1)
		} else if (country == 'CA'){
			v = stripCharsInBag(field, "- ");
			var regexp = /^[A-Va-v]|[X,Y,x,y]\d[A-Za-z]\d[A-Za-z]\d$/;
			return (v.length == 6 && !hasChars(v,'D', 'F', 'I', 'O', 'Q', 'U') && v.search(regexp) != -1)
		}
	}
}

function isUSCanZip(zip,country){
	if (zip != '' && zip != null)
		return (country == 'US' || country == 'CA');
}

function isValidPhone(phone,country){
	if (phone != null && phone != '' && country != null && country !=''){
		return (country == 'US' && isUSPhoneNumber (phone)) || (country != 'US' && isInternationalPhoneNumber (phone));
	}
	return true;
}

function isValidName(field){
	var regExp = /[0-9]/;
	if (field != null && field != '')
		return (field.search(regExp) != -1);
}

function isUSPhoneNumber(s){
	var phoneNumberDelimiters = "+.,()-xX# ";
	var digitsInUSPhoneNumber = 15; // allow 10 digits + 1- prefix (i.e +1 digit) + extension # (i.e +4 digits)
	var minDigitsInUSPhoneNumber = 10;
    s1 = stripCharsInBag(s, phoneNumberDelimiters);
    return (isInteger(s1) && (s1.length <= digitsInUSPhoneNumber && s1.length >= minDigitsInUSPhoneNumber));
}

function isInternationalPhoneNumber(s){
	var phoneNumberDelimiters = "+.,()-xX# ";
	s1 = stripCharsInBag(s, phoneNumberDelimiters);
    return (isInteger(s1));
}

function isValidSPGNum(field) {
	if (field != null && field != ''){
		// one optional letter + any number of digits + zero or more whitespace chars at the beginning and at the end
		var re = /^\s*[A-Za-z0-9]\d+\s*$/;
		if (field != null && field != ''){
			return (field.search(re) != -1);
		}
	}
}

function parseDate(_s) {
	try {
		d = Date.parse(_s);
		return d;
	} catch(err) {
		var dateArray = _s.split("/");
		var tempMonth = parseInt(dateArray[0],10);
		var tempDay = parseInt(dateArray[1],10);
		var tempYear = parseInt(dateArray[2],10);
		d = new Date(tempYear,(tempMonth-1),tempDay);
		return d;
	}
}

//--------------------------------------------------------
//Get the Date from a form field - Based on Internationalization Variables
//--------------------------------------------------------
function getDateFromField(formField, dateFormat) {	
	// formField is a reference to a text field
	// dateFormat is a string describing the local date format
	//	Current options for dateFormat:
	//		mm/dd/yyyy - English
	//		dd/mm/yyyy - Non-English, Non-Japanese
	//		yyyy/mm/dd - Japanese, Chinese
    //		dd.mm.yyyy - German
	//		dd-mm-yyyy - For generic format

    var date = new Date(); // Default the date to today ready to be overwritten.
	var currDate = SW.widget.Calendar.Utils.getToday(formField.getAttribute("data-today")); // Today's date and time for comparison's sake.

	dateFormat = dateFormat.toLowerCase();
	var fieldString;
    var hasSlashOrDash = false;
    if (typeof formField == "object") { fieldString= formField.value; } // Get the current value of the field
		else { fieldString = formField; } // We were passed a direct value
  if (fieldString.search("/") > 0) { // check if we have / to delimit
		var dateValues = fieldString.split("/");
        hasSlashOrDash = true;
    } else if (fieldString.search("-") > 0) { // They used - instead of /
		var dateValues = fieldString.split("-");
        hasSlashOrDash = true;
    } else if (fieldString.indexOf(".") >= 0) { // They used . instead of /
		var dateValues = fieldString.split(".");
	}else if (fieldString != "") {  // Assume there are no delimiters, assume one number
		var dateValues = new Array(fieldString);
	} else if (fieldString == "") {  // If there's not data there, assume it was deleted, and throw back a validDate object compatible invalid date.
		date.setTime(Date.parse(dateFormatString));
    return date;
	}

	if (fieldString.toLowerCase() == dateFormatString) {
		date.setTime(Date.parse(fieldString));
    return date;
	}

	var year;
	var month;
	var day;

	switch(dateFormat) {
		case 'mm/dd/yyyy':
			if (dateValues[0]) month = dateValues[0];
			if (dateValues[1]) day = dateValues[1];
			if (dateValues[2]) year = dateValues[2];
			break;
		case 'dd/mm/aaaa':
        case 'jj/mm/aaaa':
        case 'gg/mm/aaaa':
        case 'tt.mm.jjjj':
			if (dateValues[0]) day = dateValues[0];
			if (dateValues[1]) month = dateValues[1];
			if (dateValues[2]) year = dateValues[2];
			break;
		case 'yyyy/mm/dd':
			if (dateValues[0]) year = dateValues[0];
			if (dateValues[1]) month = dateValues[1];
			if (dateValues[2]) day = dateValues[2];
			break;
		case 'yyyy/dd/mm':
			if (dateValues[0]) year = dateValues[0];
			if (dateValues[1]) day = dateValues[1];
			if (dateValues[2]) month = dateValues[2];
			break;
        case 'dd.mm.yyyy':
        case 'dd/mm/yyyy':
            if (dateValues[0]) day = dateValues[0];
			if (dateValues[1]) month = dateValues[1];
			if (dateValues[2]) year = dateValues[2];
			break;
        case "yy\u5E74mm\u6708dd\u65E5":          
            if(!hasSlashOrDash) {
                //dateValues = fieldString.split(" ");
                year = fieldString.substr(0,2);
                month = fieldString.substr(3,2);
                day = fieldString.substr(6,2);
            } else {
                if (dateValues[0]) year = dateValues[0];
			    if (dateValues[1]) month = dateValues[1];
			    if (dateValues[2]) day = dateValues[2];
            }
            break;
		default:  // Default to mm/dd/yyyy
			if (dateValues[0]) month = dateValues[0];
			if (dateValues[1]) day = dateValues[1];
			if (dateValues[2]) year = dateValues[2];
			break;
	}
	if (year) {
		if (year.length == 2) { year = "20" + year; } // Try to make the year 4 digits
		if (year.length == 4) { // If it's not 4 digits, just fall back to using the current year
			date.setFullYear(year);
		}
	}
	date.setDate(1);
  if (month) date.setMonth(month - 1); // setMonth uses a zero-based number
  if (day) date.setDate(day);
  if (date.getTime() < currDate.getTime()) date.setYear(currDate.getFullYear() + 1); // For dates in the past, set to next year.
  // safari will not return true for isNaN check even when the date is initialized with day = dd, month = mm, and year = yyyy
  if(isNaN(month)&&isNaN(day)&&isNaN(year)) {
    if(!isNaN(date.getDate())) {
      date = {
        getDate: function() {
          return NaN;
        }
      }
    }
  }
  writeDateToField(formField, date, dateFormat);
	return date;
}

//--------------------------------------------------------
//Write the date to a form field - Based on Internationalization Variables
//--------------------------------------------------------

function writeDateToField(formField, date, dateFormat) {
// prevent "undefined" string from showing
  var dateString = "";
	if (isNaN(date.getDate())) {
		formField.value = dateString;
		return;
	}

	dateFormat = dateFormat.toLowerCase();
	var month = date.getMonth() + 1;
	month = paddZero(month);
	var day = date.getDate();
	day = paddZero(day);
	var year = date.getFullYear();
	var sep = "/";
	var dot = ".";
	var dash = "-";
	switch(dateFormat) {
		case 'mm/dd/yyyy':
			dateString = month + sep + day + sep + year;
			break;
		case 'dd/mm/aaaa':
        case 'jj/mm/aaaa':
        case 'gg/mm/aaaa':
            dateString = day + sep + month + sep + year;
			break;
        case 'tt.mm.jjjj':
            dateString = day + dot + month + dot + year;
            break;
        case 'yyyy/mm/dd':
			dateString = year + sep + month + sep + day;
			break;
		case 'yyyy/dd/mm':
			dateString = year + sep + day + sep + month;
			break;
		case 'yyyy-mm-dd':
			dateString = year + dash + day + dash + month;
			break;
        case "yy\u5E74mm\u6708dd\u65E5":
            dateString = String(year).substr(2,2) + "\u5E74" + month  + "\u6708" + day  + "\u65E5";
            break;
        default:  // Default to mm/dd/yyyy
			dateString = month + sep + day + sep + year;
			break;
	}

	formField.value = dateString;
}


var defaultDateFrmt = "yyyy-mm-dd";

function getDefaultDateFormat(formField,defaultDateFormat) {
	var date = getDateFromField(formField,dateFormatString);
	// prevent "undefined" string from showing
	  	var dateString = "";
	  	defaultDateFormat = defaultDateFormat.toLowerCase();
		var month = date.getMonth() + 1;
		month = paddZero(month);
		var day = date.getDate();
		day = paddZero(day);
		var year = date.getFullYear();
		var sep = "/";
		var dot = ".";
		var dash = "-";
		switch(defaultDateFormat) {
			case 'mm/dd/yyyy':
				dateString = month + sep + day + sep + year;
				break;
			case 'dd/mm/aaaa':
	        case 'jj/mm/aaaa':
	        case 'gg/mm/aaaa':
	            dateString = day + sep + month + sep + year;
				break;
	        case 'tt.mm.jjjj':
	            dateString = day + dot + month + dot + year;
	            break;
	        case 'yyyy/mm/dd':
				dateString = year + sep + month + sep + day;
				break;
			case 'yyyy/dd/mm':
				dateString = year + sep + day + sep + month;
				break;
			case 'yyyy-mm-dd':
				dateString = year + dash + month + dash + day;
				break;
	        case "yy\u5E74mm\u6708dd\u65E5":
	            dateString = String(year).substr(2,2) + "\u5E74" + month  + "\u6708" + day  + "\u65E5";
	            break;
	        default:  // Default to mm/dd/yyyy
				dateString = month + sep + day + sep + year;
				break;
		}

		return dateString;
	}

//-----------------------------------------------
// padd a zero if string is one char
function paddZero(s)
{
	if(s >= 0 && s <= 9){
	  s = '0' + s;
	}
	return s;
}
//------------------------------------------------------
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */


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;},
/*
  modified version that allows using document.write if no value is passed in. This has
  been created to avoid "operation aborted" errors in IE.
*/
  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"))) {
      if(typeof _20 == "undefined"){
        document.write(this.getSWFHTML());
      }else{
        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;
// System globals
var flash2Installed = false;    // boolean. true if flash 2 is installed
var flash3Installed = false;    // boolean. true if flash 3 is installed
var flash4Installed = false;    // boolean. true if flash 4 is installed
var flash5Installed = false;    // boolean. true if flash 5 is installed
var flash6Installed = false;    // boolean. true if flash 6 is installed
var flash7Installed = false;    // boolean. true if flash 7 is installed
var flash8Installed = false;    // boolean. true if flash 8 is installed
var flash9Installed = false;    // boolean. true if flash 9 is installed
var flash10Installed = false;    // boolean. true if flash 10 is installed
var flash11Installed = false;    // boolean. true if flash 11 is installed
var flash12Installed = false;    // boolean. true if flash 12 is installed

// Vars for Backwards compatibiliy
var flagVar = "";
var flashTrue = "";
var maxVersion = 12;             // highest version we can actually detect
var actualVersion = 0;          // version the user really has
var jsVersion = 1.1;

// Check the browser...we're looking for ie/win
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows

// Write vbscript detection on ie win. IE on Windows doesn't support regular
// JavaScript plugins array detection.
if (isIE && isWin) {
  document.write('<scr' + 'ipt type="text/vbscript"\> \n');
  document.write('on error resume next \n');
  document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
  document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
  document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
  document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
  document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
  document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
  document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
  document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
  document.write('flash10Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10"))) \n');
  document.write('flash11Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.11"))) \n');
  document.write('flash12Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.12"))) \n');
  document.write('</scr' + 'ipt\> \n'); // break up end tag so it doesn't end our script
}

// Next comes the standard javascript detection that uses the
// navigator.plugins array. We pack the detector into a function so it loads
// before we run it.

function flashSniff() {
  // If navigator.plugins exists...
  if (navigator.plugins) {
    // ...then check for flash 2 or flash 3+.
    if (navigator.plugins["Shockwave Flash 2.0"]
        || navigator.plugins["Shockwave Flash"]) {

      // Some version of Flash was found. Time to figure out which.

      // Set convenient references to flash 2 and the plugin description.
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;

      // DEBUGGING: uncomment next line to see the actual description.
      // alert("Flash plugin description: " + flashDescription);

      // A flash plugin-description looks like this: Shockwave Flash 4.0 r5
      // We can get the major version by grabbing the character before the period
      // note that we don't bother with minor version detection.
      // Do that in your movie with $version or getVersion().
      var flashVersion = parseInt(/[0-9]{1,}./.exec(flashDescription));

      // We found the version, now set appropriate version flags. Make sure
      // to use >= on the highest version so we don't prevent future version
      // users from entering the site.
      flash2Installed = flashVersion == 2;
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion == 6;
      flash7Installed = flashVersion == 7;
      flash8Installed = flashVersion == 8;
      flash9Installed = flashVersion == 9;
      flash10Installed = flashVersion == 10;
      flash11Installed = flashVersion == 11;
      flash12Installed = flashVersion >= 12;
    }
  }

  // Loop through all versions we're checking, and
  // set actualVersion to highest detected version.
  for (var i = 2; i <= maxVersion; i++) {
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
  }
  // Vars for backwards support
  if (i > 0) { flagVar = true; flashTrue = true; }
  // We're finished getting the version on all browsers that support detection.
  return actualVersion;
}
function setNonFlashUser(url) {
    document.cookie = 'isNonFlashUser=true; path=/';
    location.replace(url + "?type=nonflash");
}
function addLoadEvent(func) {
	var ssArray = "";
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}


function addResizeEvent(func) {
	var oldresize = window.onresize;
	if (typeof window.onresize != 'function') {
		window.onresize= func;
	} else {
		window.onresize = function() {
			oldresize();
			func();
		}
	}
}

//Function that takes element ID and pixel offset and changes height of elment.

function e(id) {
      return document.getElementById(id);
}

function autoResizeElement(id,bottomOffset) {
      var topOffset = 0;
      for (var elem = document.getElementById(id);
       elem != null;
       elem = elem.offsetParent) {
            topOffset += elem.offsetTop;
      }
      var windowHeight = getViewportHeight();
      var height = windowHeight - topOffset - bottomOffset;
      if (height >= 0) {
            document.getElementById(id).style.height = height + "px";
      }
}

function getViewportHeight() {
      if (window.self && self.innerHeight) {
            return self.innerHeight;
      }
      if (document.documentElement && document.documentElement.clientHeight) {
            return document.documentElement.clientHeight;
      }
      return 0;
}

function getViewportWidth() {
      if (window.self && self.innerWidth) {
            return self.innerWidth;
      }
      if ( (document.documentElement && document.documentElement.clientWidth) || (document.body && document.body.clientWidth) ) {
          if(document.documentElement.clientWidth > 0)   {
            return document.documentElement.clientWidth;
          }
          else if (document.body.clientWidth > 0) {
            return document.body.clientWidth
          }
      }
      return 0;
}


function getDocumentHeight()    {
    if (document.body && document.body.offsetHeight) {
        return document.body.offsetHeight;
      }
    if (document.body.document && document.body.document.height) {
        return document.body.document.height;
    }
    return 0;
}

function getDocumentWidth()    {
    if (document.body && document.body.offsetWidth) {
            return document.body.offsetWidth;
      }
    if (document.body.document && document.body.document.width) {
        return document.body.document.width;
    }
    return 0;
}

// Function that takes a String URL and sets the parent's location to the URL
function goToPage(obj) {
	if (obj.value != null && obj.value != "void" && obj.value != "") {
		parent.location =obj.value;
	}
}

// Generic pop up window function the window features are passed from the parent page
function openBrWindow(theURL,winName,features) {
	var winObj = window.open(theURL,winName,features);
	if (!winObj.opener) winObj.opener = self;
	winObj.focus();
}

// Function that takes in a name, reads that name from a cookie, and returns the value of that name.
function readCookie(name) {
	var cookies = document.cookie;
	var start = cookies.indexOf(name + "=");
	if (start == -1) return null;
	start = cookies.indexOf("=", start) + 1;
	var end = cookies.indexOf(";", start);
	if (end == -1) end = cookies.length;
	var value = unescape(cookies.substring(start, end));
	return value;
}

// Function that takes a name/value pair and sets them to a cookie
/*
   name - name of the cookie
   value - value of the cookie
   [expires] - expiration date of the cookie in days (defaults to end of current session)
   [path] - path for which the cookie is valid (defaults to path of calling document)
   [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
   [domain] - domain for which the cookie is valid (defaults to domain of calling document)
   * an argument defaults when it is assigned null as a placeholder
   * a null placeholder is not required for trailing omitted arguments
*/
function setCookie(name, value, expires, path, secure, domain) {
	var today = new Date();
	today.setTime(today.getTime());
	
	if (expires) { expires = expires * 1000 * 60 * 60 * 24; }
	var expires_date = new Date( today.getTime() + (expires) );

	var curCookie = name + "=" + escape(value) +
	(( expires ) ? "; expires=" + expires_date.toGMTString() : "") + 
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
	document.cookie = curCookie;
}

// Function that deletes a cookie
/*
   name - name of the cookie
   [path] - path of the cookie (must be same as path used to create cookie)
   [domain] - domain of the cookie (must be same as domain used to create cookie)
   * path and domain default if assigned null or omitted if no explicit argument proceeds
*/
function deleteCookie(name, path, domain) {
	if (readCookie(name)) {
		document.cookie = name + "=" +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

// Function to switch current display of id between "block" and "none"
function switchDisplay(elementID, swapType) {
	var element = document.getElementById(elementID);
	if (swapType == 'show'){
		element.style.display = 'block';
	} else {
		element.style.display = 'none';
	}
}

// Function to toggle an elements display
// elementID is the name of the element you want to toggle.
// currentDisplay is a boolean that's passed in and represents the elements current display type.
function toggleDisplay(elementID, currentDisplay) {
	var element = document.getElementById(elementID);
	if (currentDisplay){
		element.style.display = "none";
		currentDisplay = false;
	} else {
		element.style.display = "block";
		currentDisplay = true;
	}
	return currentDisplay;
}

var currentClass;
function classSwitcher(el,stateClass) {
	var element = (typeof el == "object") ? el : document.getElementById(el);
	if(currentClass==undefined || currentClass==stateClass) currentClass = element.className;

	if(element.className == currentClass || element.className == "") {
		element.className = stateClass;
	} else {
		element.className = currentClass;
	}
}
// Function to determine if a field is null
function isNull(fieldValue) {
	if (fieldValue == null) {fieldValue=''};
		return (fieldValue.length == 0);	
}

// Function to determine if two fields match each other
function isMatch(field1,field2) {
	if ((field1 != null && field1 != '') && ( field2 != null && field2 != ''))
		return (field1 == field2);
}

// Function to parse the querystring into useable variables
var parsequery_args = new Object();
function parsequery(qs) {
	if (qs.length > 2) {
		var query = qs.substring(1); // get query string (without initial "?")
		var pairs = query.split("&")  //break at ampersand into pairs
		var re = /\+/g; //the unescape() function does not remove +
		for (var i = 0; i < pairs.length; i++) {
			var pos = pairs[i].indexOf('=');  //look for "name=value"
			if (pos == -1) continue;      //if not found skip
			var argname = pairs[i].substring(0,pos);  //extract the name
			var value = pairs[i].substring(pos + 1);  //extract the value
			parsequery_args[argname] = unescape(value.replace(re," "));  //store as a property
		}
	}
}

// Function that takes a string (s) and 1 character (bag) to strip from the string.
// the function returns the string without the 1 character (bag) in it.
function stripCharsInBag (s, bag){
	var i;
	var returnString = "";
	for (i = 0; i < s.length; i++) {
		var c = s.charAt(i);
		if (bag.indexOf(c) == -1) returnString += c;
	}
	return returnString;
}

// Function that gives you the screen x and screen y, even after the user has scrolled
var scrOfX = 0, scrOfY = 0;
function getScrollXY() {
	if( typeof( window.pageYOffset ) == 'number' ) {
	//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
	//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
	//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
	return [ scrOfX, scrOfY ];
}

// Fixes the IE background-image hover bug
try {
    document.execCommand( "BackgroundImageCache", false, true );
} catch( e ) { };


/**
 * Selects all checkboxes under the given parent node.  Set deep to true
 * to recursively set.
 *
 * @param {Node} parentNode     node under which checkboxes can be found
 * @param {boolean} checked     true to set checkboxes, false to clear (Default: true)
 * @param {boolean} deep        true to recursively set children deeper than one level (Default: true)
 */
function setCheckboxes(parentNode, checked, deep) {
    if(parentNode == null)  return;

    // defaults
    checked = (checked == null) ? true : checked;
    deep = (deep == null) ? true : deep;

    // loop through and select boxes
    for(var i=0; i < parentNode.childNodes.length; i++) {
        var node = parentNode.childNodes[i];

        if(deep) {
            // recursively set deeper child nodes
            if(node.hasChildNodes()) {
                setCheckboxes(node, checked, deep);
            }
        }

        // set checkbox
        if(node.nodeType == 1 && node.getAttribute("type") == "checkbox") {
            node.checked = checked;
        }
    }
}

/**
 * Asynchronously fills a select dropdown with properties given a list of
 * property IDs via an XHR call.
 *
 * @param {String} propSelect       select element containing property list
 * @param {String} propIds          comma delimited list of property ids to populate with
 * @param {String} selectedPropId   optional id of pre-selected property when the list is built
 * @param {function} onFailure      optional reference to a failure callback function
 * @param {function} onSuccess      optional reference to a success callback function
 */
function fillPropertySelect(propSelect, propIds, selectedPropId, onFailure, onSuccess) {
    // clear current select options
    while(propSelect.hasChildNodes()) {
        propSelect.removeChild(propSelect.childNodes[0]);
    }

    // remove spaces between properties in property list
    propIds = propIds.replace(/,\s+/g, ',');
    var url = "/whotels/property/propertyInfoAjax.html?propertyIDs=" + propIds;
    var callback = {
        success: _fillPropertySelectSuccess,
        failure: onFailure,
        argument: {'propSelect':propSelect, 'selectedPropId':selectedPropId, 'onSuccess':onSuccess}
    }

    // make the call
    var request = YAHOO.util.Connect.asyncRequest('GET', url, callback);
}

// success handler for fillPropertySelect XHR call
function _fillPropertySelectSuccess(o) {
    var i,j;

    // get prop select element
    var propSelect = o.argument['propSelect'];
    if(propSelect == null) return;

    // get selected property id
    var selectedPropId = o.argument['selectedPropId'];

    // process response
    var yuiJson = YAHOO.lang.JSON;
    var result = yuiJson.parse(o.responseText);
    var propMap = result.data;

    var propIds = propMap['propIds'];
    var propNames = propMap['propNames'];

    // sort alphabetically by property names
    var sortedPropNames = new Array();
    for(i=0; i<propNames.length; i++) {
        sortedPropNames.push(propNames[i]);
    }
    sortedPropNames.sort();

    // sort ids according to sorted property names
    var sortedPropIds = new Array();
    for(i=0; i<propIds.length; i++) {
        for(j=0; j<propNames.length;j++) {
            if(propNames[j] == sortedPropNames[i]) {
                sortedPropIds.push(propIds[j]);
                break;
            }
        }
    }
    // create options for each property
    var option;

    // create a list of prop id => prop name mappings sorted by name
    for(i=0; i<sortedPropIds.length; i++) {
        option = document.createElement('option');
        option.setAttribute("value", sortedPropIds[i]);

        if(selectedPropId == sortedPropIds[i]) {
            option.setAttribute("selected", "selected");
        }
        
        option.appendChild(document.createTextNode(sortedPropNames[i]));
        propSelect.appendChild(option);
    }

    // call callback method
    if(o.argument['onSuccess']) {
        o.argument['onSuccess']();
    }
}

// function to determine the offsetLeft of an element that is passed in
function getElementOffsetLeft (element) {
    var leftOffset = element.offsetLeft;
    while ((element = element.offsetParent) != null){
        leftOffset  += element.offsetLeft;
    }
    var viewPort = document.documentElement.clientWidth;
    return leftOffset;
}
// function to determine the offsetTop of an element that is passed in
function getElementOffsetTop (element) {
    var topOffset = element.offsetTop;
    while ((element = element.offsetParent) != null){
        topOffset +=element.offsetTop;
    }
    var docHeight = document.documentElement.scrollTop;
    var viewPort = document.documentElement.clientHeight;
    return topOffset;
}

//function to keep check box checked even if clicked
function keepChecked(formElement)  {
    
    if(!formElement.checked)    {
        formElement.checked = true;    
    }
}

//Top destination layer close
function topDestinationsClose()	{
    document.getElementById("topDestinationsList").style.visibility = "hidden";
    document.getElementById("topDestinationsIframeShim").style.display = "none";
}

//Top destination layer open
function topDestinationsOpen()	{                    
    var obj1 = document.getElementById("topDestinationsList");
    var obj2 = document.getElementById("topDestinationsIframeShim");
    obj1.style.visibility = "visible";
    obj2.style.visibility = "visible";
    obj1.style.display = "block";
    obj2.style.display = "block";
}


/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
/**
 * Provides methods to parse JSON strings and convert objects to JSON strings.
 *
 * @module json
 * @class JSON
 * @namespace YAHOO.lang
 * @static
 */
(function () {

var l = YAHOO.lang,
    isFunction = l.isFunction,
    isObject   = l.isObject,
    isArray    = l.isArray,
    _toStr     = Object.prototype.toString,
                 // 'this' is the global object.  window in browser env.  Keep
                 // the code env agnostic.  Caja requies window, unfortunately.
    Native     = (YAHOO.env.ua.caja ? window : this).JSON,

/* Variables used by parse */

    /**
     * Replace certain Unicode characters that JavaScript may handle incorrectly
     * during eval--either by deleting them or treating them as line
     * endings--with escape sequences.
     * IMPORTANT NOTE: This regex will be used to modify the input if a match is
     * found.
     *
     * @property _UNICODE_EXCEPTIONS
     * @type {RegExp}
     * @private
     */
    _UNICODE_EXCEPTIONS = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,

    /**
     * First step in the safety evaluation.  Regex used to replace all escape
     * sequences (i.e. "\\", etc) with '@' characters (a non-JSON character).
     *
     * @property _ESCAPES
     * @type {RegExp}
     * @static
     * @private
     */
    _ESCAPES = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,

    /**
     * Second step in the safety evaluation.  Regex used to replace all simple
     * values with ']' characters.
     *
     * @property _VALUES
     * @type {RegExp}
     * @static
     * @private
     */
    _VALUES  = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,

    /**
     * Third step in the safety evaluation.  Regex used to remove all open
     * square brackets following a colon, comma, or at the beginning of the
     * string.
     *
     * @property _BRACKETS
     * @type {RegExp}
     * @static
     * @private
     */
    _BRACKETS = /(?:^|:|,)(?:\s*\[)+/g,

    /**
     * Final step in the safety evaluation.  Regex used to test the string left
     * after all previous replacements for invalid characters.
     *
     * @property _UNSAFE
     * @type {RegExp}
     * @static
     * @private
     */
    _UNSAFE  = /[^\],:{}\s]/,


/* Variables used by stringify */

    /**
     * Regex used to replace special characters in strings for JSON
     * stringification.
     *
     * @property _SPECIAL_CHARS
     * @type {RegExp}
     * @static
     * @private
     */
    _SPECIAL_CHARS = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,

    /**
     * Character substitution map for common escapes and special characters.
     *
     * @property _CHARS
     * @type {Object}
     * @static
     * @private
     */
    _CHARS = {
        '\b': '\\b',
        '\t': '\\t',
        '\n': '\\n',
        '\f': '\\f',
        '\r': '\\r',
        '"' : '\\"',
        '\\': '\\\\'
    },
    
    UNDEFINED = 'undefined',
    OBJECT    = 'object',
    NULL      = 'null',
    STRING    = 'string',
    NUMBER    = 'number',
    BOOLEAN   = 'boolean',
    DATE      = 'date',
    _allowable = {
        'undefined'        : UNDEFINED,
        'string'           : STRING,
        '[object String]'  : STRING,
        'number'           : NUMBER,
        '[object Number]'  : NUMBER,
        'boolean'          : BOOLEAN,
        '[object Boolean]' : BOOLEAN,
        '[object Date]'    : DATE,
        '[object RegExp]'  : OBJECT
    },
    EMPTY     = '',
    OPEN_O    = '{',
    CLOSE_O   = '}',
    OPEN_A    = '[',
    CLOSE_A   = ']',
    COMMA     = ',',
    COMMA_CR  = ",\n",
    CR        = "\n",
    COLON     = ':',
    COLON_SP  = ': ',
    QUOTE     = '"';

// Only accept JSON objects that report a [[Class]] of JSON
Native = _toStr.call(Native) === '[object JSON]' && Native;

// Escapes a special character to a safe Unicode representation
function _char(c) {
    if (!_CHARS[c]) {
        _CHARS[c] =  '\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4);
    }
    return _CHARS[c];
}


/* functions used by parse */

/**
 * Traverses nested objects, applying a filter or reviver function to
 * each value.  The value returned from the function will replace the
 * original value in the key:value pair.  If the value returned is
 * undefined, the key will be omitted from the returned object.
 *
 * @method _revive
 * @param data {MIXED} Any JavaScript data
 * @param reviver {Function} filter or mutation function
 * @return {MIXED} The results of the filtered/mutated data structure
 * @private
 */
function _revive(data, reviver) {
    var walk = function (o,key) {
        var k,v,value = o[key];
        if (value && typeof value === 'object') {
            for (k in value) {
                if (l.hasOwnProperty(value,k)) {
                    v = walk(value, k);
                    if (v === undefined) {
                        delete value[k];
                    } else {
                        value[k] = v;
                    }
                }
            }
        }
        return reviver.call(o,key,value);
    };

    return typeof reviver === 'function' ? walk({'':data},'') : data;
}

/**
 * Replace certain Unicode characters that may be handled incorrectly by
 * some browser implementations.
 *
 * @method _prepare
 * @param s {String} parse input
 * @return {String} sanitized JSON string ready to be validated/parsed
 * @private
 */
function _prepare(s) {
    return s.replace(_UNICODE_EXCEPTIONS, _char);
}

function _isSafe(str) {
    return l.isString(str) &&
            !_UNSAFE.test(str.replace(_ESCAPES,'@').
                             replace(_VALUES,']').
                             replace(_BRACKETS,''));
}

function _parse(s,reviver) {
    // sanitize
    s = _prepare(s);

    // Ensure valid JSON
    if (_isSafe(s)) {
        // Eval the text into a JavaScript data structure, apply the
        // reviver function if provided, and return
        return _revive( eval('(' + s + ')'), reviver );
    }

    // The text is not valid JSON
    throw new SyntaxError('JSON.parse');
}



/* functions used by stringify */

// Utility function used to determine how to serialize a variable.
function _type(o) {
    var t = typeof o;
    return  _allowable[t] ||              // number, string, boolean, undefined
            _allowable[_toStr.call(o)] || // Number, String, Boolean, Date
            (t === OBJECT ?
                (o ? OBJECT : NULL) :     // object, array, null, misc natives
                UNDEFINED);               // function, unknown
}

// Enclose escaped strings in quotes
function _string(s) {
    return QUOTE + s.replace(_SPECIAL_CHARS, _char) + QUOTE;
}

// Adds the provided space to the beginning of every line in the input string
function _indent(s,space) {
    return s.replace(/^/gm, space);
}

// JavaScript implementation of stringify (see API declaration of stringify)
function _stringify(o,w,space) {
    if (o === undefined) {
        return undefined;
    }

    var replacer = isFunction(w) ? w : null,
        format   = _toStr.call(space).match(/String|Number/) || [],
        _date    = YAHOO.lang.JSON.dateToString,
        stack    = [],
        tmp,i,len;

    if (replacer || !isArray(w)) {
        w = undefined;
    }

    // Ensure whitelist keys are unique (bug 2110391)
    if (w) {
        tmp = {};
        for (i = 0, len = w.length; i < len; ++i) {
            tmp[w[i]] = true;
        }
        w = tmp;
    }

    // Per the spec, strings are truncated to 10 characters and numbers
    // are converted to that number of spaces (max 10)
    space = format[0] === 'Number' ?
                new Array(Math.min(Math.max(0,space),10)+1).join(" ") :
                (space || EMPTY).slice(0,10);

    function _serialize(h,key) {
        var value = h[key],
            t     = _type(value),
            a     = [],
            colon = space ? COLON_SP : COLON,
            arr, i, keys, k, v;

        // Per the ECMA 5 spec, toJSON is applied before the replacer is
        // called.  Also per the spec, Date.prototype.toJSON has been added, so
        // Date instances should be serialized prior to exposure to the
        // replacer.  I disagree with this decision, but the spec is the spec.
        if (isObject(value) && isFunction(value.toJSON)) {
            value = value.toJSON(key);
        } else if (t === DATE) {
            value = _date(value);
        }

        if (isFunction(replacer)) {
            value = replacer.call(h,key,value);
        }

        if (value !== h[key]) {
            t = _type(value);
        }

        switch (t) {
            case DATE    : // intentional fallthrough.  Pre-replacer Dates are
                           // serialized in the toJSON stage.  Dates here would
                           // have been produced by the replacer.
            case OBJECT  : break;
            case STRING  : return _string(value);
            case NUMBER  : return isFinite(value) ? value+EMPTY : NULL;
            case BOOLEAN : return value+EMPTY;
            case NULL    : return NULL;
            default      : return undefined;
        }

        // Check for cyclical references in nested objects
        for (i = stack.length - 1; i >= 0; --i) {
            if (stack[i] === value) {
                throw new Error("JSON.stringify. Cyclical reference");
            }
        }

        arr = isArray(value);

        // Add the object to the processing stack
        stack.push(value);

        if (arr) { // Array
            for (i = value.length - 1; i >= 0; --i) {
                a[i] = _serialize(value, i) || NULL;
            }
        } else {   // Object
            // If whitelist provided, take only those keys
            keys = w || value;
            i = 0;

            for (k in keys) {
                if (l.hasOwnProperty(keys, k)) {
                    v = _serialize(value, k);
                    if (v) {
                        a[i++] = _string(k) + colon + v;
                    }
                }
            }
        }

        // remove the array from the stack
        stack.pop();

        if (space && a.length) {
            return arr ?
                OPEN_A + CR + _indent(a.join(COMMA_CR), space) + CR + CLOSE_A :
                OPEN_O + CR + _indent(a.join(COMMA_CR), space) + CR + CLOSE_O;
        } else {
            return arr ?
                OPEN_A + a.join(COMMA) + CLOSE_A :
                OPEN_O + a.join(COMMA) + CLOSE_O;
        }
    }

    // process the input
    return _serialize({'':o},'');
}


/* Public API */
YAHOO.lang.JSON = {
    /**
     * Leverage native JSON parse if the browser has a native implementation.
     * In general, this is a good idea.  See the Known Issues section in the
     * JSON user guide for caveats.  The default value is true for browsers with
     * native JSON support.
     *
     * @property useNativeParse
     * @type Boolean
     * @default true
     * @static
     */
    useNativeParse : !!Native,

    /**
     * Leverage native JSON stringify if the browser has a native
     * implementation.  In general, this is a good idea.  See the Known Issues
     * section in the JSON user guide for caveats.  The default value is true
     * for browsers with native JSON support.
     *
     * @property useNativeStringify
     * @type Boolean
     * @default true
     * @static
     */
    useNativeStringify : !!Native,

    /**
     * Four step determination whether a string is safe to eval. In three steps,
     * escape sequences, safe values, and properly placed open square brackets
     * are replaced with placeholders or removed.  Then in the final step, the
     * result of all these replacements is checked for invalid characters.
     *
     * @method isSafe
     * @param str {String} JSON string to be tested
     * @return {boolean} is the string safe for eval?
     * @static
     */
    isSafe : function (s) {
        return _isSafe(_prepare(s));
    },

    /**
     * <p>Parse a JSON string, returning the native JavaScript
     * representation.</p>
     *
     * <p>When lang.JSON.useNativeParse is true, this will defer to the native
     * JSON.parse if the browser has a native implementation.  Otherwise, a
     * JavaScript implementation based on http://www.json.org/json2.js
     * is used.</p>
     *
     * @method parse
     * @param s {string} JSON string data
     * @param reviver {function} (optional) function(k,v) passed each key:value
     *          pair of object literals, allowing pruning or altering values
     * @return {MIXED} the native JavaScript representation of the JSON string
     * @throws SyntaxError
     * @static
     */
    parse : function (s,reviver) {
        if (typeof s !== 'string') {
            s += '';
        }

        return Native && YAHOO.lang.JSON.useNativeParse ?
            Native.parse(s,reviver) : _parse(s,reviver);
    },

    /**
     * <p>Converts an arbitrary value to a JSON string representation.</p>
     *
     * <p>Objects with cyclical references will trigger an exception.</p>
     *
     * <p>If a whitelist is provided, only matching object keys will be
     * included.  Alternately, a replacer function may be passed as the
     * second parameter.  This function is executed on every value in the
     * input, and its return value will be used in place of the original value.
     * This is useful to serialize specialized objects or class instances.</p>
     *
     * <p>If a positive integer or non-empty string is passed as the third
     * parameter, the output will be formatted with carriage returns and
     * indentation for readability.  If a String is passed (such as "\t") it
     * will be used once for each indentation level.  If a number is passed,
     * that number of spaces will be used.</p>
     *
     * <p>When lang.JSON.useNativeStringify is true, this will defer to the
     * native JSON.stringify if the browser has a native implementation.
     * Otherwise, a JavaScript implementation is used.</p>
     *
     * @method stringify
     * @param o {MIXED} any arbitrary object to convert to JSON string
     * @param w {Array|Function} (optional) whitelist of acceptable object keys
     *                  to include OR a function(value,key) to alter values
     *                  before serialization
     * @param space {Number|String} (optional) indentation character(s) or
     *                  depthy of spaces to format the output 
     * @return {string} JSON string representation of the input
     * @throws Error
     * @static
     */
    stringify : function (o,w,space) {
        return Native && YAHOO.lang.JSON.useNativeStringify ?
            Native.stringify(o,w,space) : _stringify(o,w,space);
    },

    /**
     * Serializes a Date instance as a UTC date string.  Used internally by
     * the JavaScript implementation of stringify.  If you need a different
     * Date serialization format, override this method.  If you change this,
     * you should also set useNativeStringify to false, since native JSON
     * implementations serialize Dates per the ECMAScript 5 spec.  You've been
     * warned.
     *
     * @method dateToString
     * @param d {Date} The Date to serialize
     * @return {String} stringified Date in UTC format YYYY-MM-DDTHH:mm:SSZ
     * @static
     */
    dateToString : function (d) {
        function _zeroPad(v) {
            return v < 10 ? '0' + v : v;
        }

        return d.getUTCFullYear()         + '-' +
            _zeroPad(d.getUTCMonth() + 1) + '-' +
            _zeroPad(d.getUTCDate())      + 'T' +
            _zeroPad(d.getUTCHours())     + COLON +
            _zeroPad(d.getUTCMinutes())   + COLON +
            _zeroPad(d.getUTCSeconds())   + 'Z';
    },

    /**
     * Reconstitute Date instances from the default JSON UTC serialization.
     * Reference this from a reviver function to rebuild Dates during the
     * parse operation.
     *
     * @method stringToDate
     * @param str {String} String serialization of a Date
     * @return {Date}
     */
    stringToDate : function (str) {
        var m = str.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3}))?Z$/);
        if (m) {
            var d = new Date();
            d.setUTCFullYear(m[1], m[2]-1, m[3]);
            d.setUTCHours(m[4], m[5], m[6], (m[7] || 0));
            return d;
        }
        return str;
    }
};

/**
 * <p>Four step determination whether a string is safe to eval. In three steps,
 * escape sequences, safe values, and properly placed open square brackets
 * are replaced with placeholders or removed.  Then in the final step, the
 * result of all these replacements is checked for invalid characters.</p>
 *
 * <p>This is an alias for isSafe.</p>
 *
 * @method isValid
 * @param str {String} JSON string to be tested
 * @return {boolean} is the string safe for eval?
 * @static
 * @deprecated use isSafe
 */
YAHOO.lang.JSON.isValid = YAHOO.lang.JSON.isSafe;

})();
YAHOO.register("json", YAHOO.lang.JSON, {version: "2.9.0", build: "2800"});

function ScrollMenu(listObject){
    this.ListObj = listObject;
    this.ListObj.className = "fixOverflow";

    this.scrollIncrement = 10;
    this.scrollActive = false;

    this.menuParent = null;
    this.menu = null;
    this.menuTop = null;

    this.createDOM();
    //this.reportHTML();
}

ScrollMenu.prototype.createDOM = function(){
    var menuContentContainer = document.createElement("div");
        menuContentContainer.className = "menuContentContainer";
        var menuContent = document.createElement("div");
            menuContent.className = "menuContent";
            with(this.ListObj){
                while(firstChild){
                    var currentNode = removeChild(firstChild);
                    menuContent.appendChild(currentNode);
                }
            }
        this.menu = menuContent;
        menuContentContainer.appendChild(menuContent);
    this.menuParent = menuContentContainer;
    this.menuTop = menuContentContainer.offsetTop || 0;
    this.ListObj.appendChild(menuContentContainer);

    var currentMenu = this;
    var upArrow = document.createElement("div");
        upArrow.className = "scrollButtonUp";
        upArrow.onmouseover = function(){ currentMenu.activateScroll(1); };
        upArrow.onmouseout = function(){ currentMenu.deactivateScroll(); };
    this.ListObj.insertBefore(upArrow, menuContentContainer);

    var downArrow = document.createElement("div");
        downArrow.className = "scrollButtonDown";
        downArrow.onmouseover = function(){ currentMenu.activateScroll(0); };
        downArrow.onmouseout = function(){ currentMenu.deactivateScroll(); };
    this.ListObj.appendChild(downArrow);
    //this.ListObj.onmouseout = function(){ currentMenu.resetMenuPosition()};
}

ScrollMenu.prototype.activateScroll = function(scrollDirection){
    this.scrollActive = true;
    if(scrollDirection){
        this.scrollMenuUp();
    }
    else{
        this.scrollMenuDown();
    }
}

ScrollMenu.prototype.deactivateScroll = function(){
    this.scrollActive = false;
}

ScrollMenu.prototype.scrollMenuUp = function(){
    if(this.scrollActive){
        if(this.menuTop < 0){
            this.menuTop += this.scrollIncrement;
            this.menu.style.top = this.menuTop + 'px';
            var currentMenu = this;
            setTimeout(function(){currentMenu.scrollMenuUp();}, 30);
        }
        else{
            this.deactivateScroll();
        }
    }
    else{
        this.deactivateScroll();
    }
}

ScrollMenu.prototype.scrollMenuDown = function(){
    if(this.scrollActive){
        if(this.menuTop > -(this.menu.scrollHeight - this.menuParent.offsetHeight)){
            this.menuTop -= this.scrollIncrement;
            this.menu.style.top = this.menuTop + 'px';
            var currentMenu = this;
            setTimeout(function(){currentMenu.scrollMenuDown();}, 30);
        }
        else{
            this.deactivateScroll();
        }
    }
    else{
        this.deactivateScroll();
    }
}

ScrollMenu.prototype.resetMenuPosition = function(){
    this.menuTop = this.menuParent.offsetTop;
    this.menu.style.top = this.menuTop + 'px';
}

ScrollMenu.prototype.reportHTML = function(){
    alert(this.ListObj.innerHTML);
}
<!-- BEGIN IMAGE SWAPPING -->
function MM_findObj(n, d) { //v3.0
var p,i,x;  if(!d) d=document; 
/*if((p=n.indexOf("?"))>0&&parent.frames.length) {
 d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
}*/
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
/* Functions that swaps images. */
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/* Functions that handle preload. */
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
<!-- END IMAGE SWAPPING -->
// System globals
var flash2Installed = false;    // boolean. true if flash 2 is installed
var flash3Installed = false;    // boolean. true if flash 3 is installed
var flash4Installed = false;    // boolean. true if flash 4 is installed
var flash5Installed = false;    // boolean. true if flash 5 is installed
var flash6Installed = false;    // boolean. true if flash 6 is installed
var flash7Installed = false;    // boolean. true if flash 7 is installed
var flash8Installed = false;    // boolean. true if flash 8 is installed
var flash9Installed = false;    // boolean. true if flash 9 is installed
var flash10Installed = false;    // boolean. true if flash 10 is installed
var flash11Installed = false;    // boolean. true if flash 11 is installed
var flash12Installed = false;    // boolean. true if flash 12 is installed

// Vars for Backwards compatibiliy
var flagVar = "";
var flashTrue = "";
var maxVersion = 12;             // highest version we can actually detect
var actualVersion = 0;          // version the user really has
var jsVersion = 1.1;

// Check the browser...we're looking for ie/win
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows

// Write vbscript detection on ie win. IE on Windows doesn't support regular
// JavaScript plugins array detection.
if (isIE && isWin) {
  document.write('<scr' + 'ipt type="text/vbscript"\> \n');
  document.write('on error resume next \n');
  document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
  document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
  document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
  document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
  document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
  document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
  document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
  document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
  document.write('flash10Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10"))) \n');
  document.write('flash11Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.11"))) \n');
  document.write('flash12Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.12"))) \n');
  document.write('</scr' + 'ipt\> \n'); // break up end tag so it doesn't end our script
}

// Next comes the standard javascript detection that uses the
// navigator.plugins array. We pack the detector into a function so it loads
// before we run it.

function flashSniff() {
  // If navigator.plugins exists...
  if (navigator.plugins) {
    // ...then check for flash 2 or flash 3+.
    if (navigator.plugins["Shockwave Flash 2.0"]
        || navigator.plugins["Shockwave Flash"]) {

      // Some version of Flash was found. Time to figure out which.

      // Set convenient references to flash 2 and the plugin description.
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;

      // DEBUGGING: uncomment next line to see the actual description.
      // alert("Flash plugin description: " + flashDescription);

      // A flash plugin-description looks like this: Shockwave Flash 4.0 r5
      // We can get the major version by grabbing the character before the period
      // note that we don't bother with minor version detection.
      // Do that in your movie with $version or getVersion().
      var flashVersion = parseInt(/[0-9]{1,}./.exec(flashDescription));

      // We found the version, now set appropriate version flags. Make sure
      // to use >= on the highest version so we don't prevent future version
      // users from entering the site.
      flash2Installed = flashVersion == 2;
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion == 6;
      flash7Installed = flashVersion == 7;
      flash8Installed = flashVersion == 8;
      flash9Installed = flashVersion == 9;
      flash10Installed = flashVersion == 10;
      flash11Installed = flashVersion == 11;
      flash12Installed = flashVersion >= 12;
    }
  }

  // Loop through all versions we're checking, and
  // set actualVersion to highest detected version.
  for (var i = 2; i <= maxVersion; i++) {
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
  }
  // Vars for backwards support
  if (i > 0) { flagVar = true; flashTrue = true; }
  // We're finished getting the version on all browsers that support detection.
  return actualVersion;
}
function setNonFlashUser(url) {
    document.cookie = 'isNonFlashUser=true; path=/';
    location.replace(url + "?type=nonflash");
}
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
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;
var us_states = [ "AA", "AE","AL","AK","AP","AZ","AR","CA","CO","CT","DE","DC","FL","GA","HI","ID","IL",
	      		  "IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV",
	      		  "NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX",
	      		  "UT","VT","VA","WA","WI","WV", "WI","WY" ];
var ca_prov = [ "AB","BC","LB","MB","NB","NL","NWT","NS","NU","ON","PI","PE","QC","SK","YT" ];
var misc = [ "AS", "GU", "FM", "MH", "MP", "PW", "PR", "VI" ];
var au_prov = [ "ACI","NSW","NT","QLD","SA","TAS","VIC","WAU" ];
var mx_prov = [ "AGS","BCN","BCS","CAMP","CHIS","CHIH","COAH","COL","DGO","MEX","GTO","GRO","HGO","JAL","DF","MICH","MOR","NAY","NL","OAX","PUE","QRO","QROO","SLP","SIN","SON","TAB","TAM","TLAX","VER","YUC","ZAC"  ];

var topCities = ["amsterdam::NL","columbus:OH:US","lake buena vista:FL:US","ottawa:ON:CA","san francisco:CA:US","anaheim:CA:US","costa mesa:CA:US","london::GB","palo alto:CA:US","scottsdale:AZ:US","dallas:TX:US","los angeles:CA:US","pasadena:CA:US","seattle:WA:US","atlanta:GA:US","denver:CO:US","montreal:QC:CA","philadelphia:PA:US","st. louis:MO:US","baltimore:MD:US","fort lauderdale:FL:US","munich::DE","pittsburgh:PA:US","stamford:CT:US","bangkok::TH","frankfurt::DE","new orleans:LA:US","sunnyvale:CA:US","boston:MA:US","honolulu, island of oahu:HI:US","honolulu:HI:US","new york:NY:US","richmond:VA:US","sydney::AU","calgary:AB:CA","houston:TX:US","newark:NJ:US","rosemont:IL:US","toronto:ON:CA","chicago:IL:US","indianapolis:IN:US","san antonio:TX:US","vancouver:BC:CA","cincinnati:OH:US","kansas city:MO:US","orlando:FL:US","san diego:CA:US:","washington:DC:US","paris::FR","abu dhabi::AE","albuquerque:NM:US","amman::JO","anchorage:AK:US","ankara::TR","ann arbor:MI:US","aspen:CO:US","athens::GR","atlantic city:NJ:US","bangor:ME:US","barcelona::ES","baton rouge:LA:US","beijing::CN","beirut::LB","berlin::DE","bilbao::ES","birmingham:AL:US","bogota::CO","braintree:MA:US","brussels::BE","budapest::HU","buenos aires::AR","cairo::EG","calcutta::IN","cancun::MX","cape town::ZA","chapel hill:NC:US","charlotte:NC:US","chattanooga:TN:US","cleveland:OH:US","cologne::DE","copenhagen::DK","cork::IE","crete::GR","danbury:CT:US","des moines:IA:US","detroit:MI:US","dresden::DE","dubai::AE","dublin::IE","dusseldorf::DE","edinburgh::GB","edmonton:AB:CA","fresno:CA:US","florence::IT","ft lauderdale:FL:US","ft. lauderdale:FL:US","geelong::AU","geneva::CH","halifax:NS:CA","hanoi::VN","helsinki::FI","hong kong::CN","jakarta::ID","jeddah::SA","jerusalem::IL","key west:FL:US","kuala lumpur::MY","kuwait city::KW","kyoto::JP","las vegas:NV:US","lima::PE","lisbon::PT","long beach:CA:US","louisville:KY:US","luxembourg::LU","madrid::ES","maui:HI:US","melbourne::AU","mexico city::MX","miami:FL:US","milan::IT","milwaukee:WI:US","minneapolis:MN:US","moscow::RU","mumbai::IN","mykonos::GR","myrtle beach:SC:US","nanjing::CN","nashville:TN:US","nice::FR","norfolk:VA:US","norwalk:CT:US","oklahoma city:OK:US","omaha:NE:US","osaka::JP","palm springs:CA:US", "penang::MY","phoenix:AZ:US","phuket::TH","providence:RI:US","puerto vallarta::MX","raleigh:NC:US","rio de janeiro::BR","riyadh::SA","rome::IT","rotterdam::NL","sacramento:CA:US","salt lake city:UT:US","salzburg::AT","san juan:PR:US","san sebastian::ES","savannah:GA:US","seoul::KR","shanghai::CN","st. john:VI:US","st john:VI:US","saint john:VI:US","st. maarten::AN","st maarten::AN","saint maarten::AN","stockholm::SE","sunnyvale:CA:US","syracuse:NY:US","tacoma:WA:US","taipei::TW","tel aviv::IL","tempe:AZ:US","tokyo::JP","tucson:AZ:US","tuscaloosa:AL:US","venice::IT","versailles::FR","vienna::AT","vieques:PR:US","warsaw::PL","whistler:BC:CA","wichita:KS:US","williamsburg:VA:US","zagreb::HR","zurich::CH","virginia beach:VA:US", "rimini::IT", "turin::IT", "costa smeralda::IT", "bari::IT", "naples::IT", "lecce::IT", "padova::IT", "bologna::IT", "genova::IT", "bolzano::IT","tarrytown:NY:US","macao::CN","macau::CN","limassol::CY","istanbul::TR"];

var topCitiesThreeChar = ["amsterdam::NLD","columbus:OH:USA","lake buena vista:FL:USA","ottawa:ON:CAN","san francisco:CAN:USA","anaheim:CAN:USA","costa mesa:CAN:USA","london::GBR","palo alto:CAN:USA","scottsdale:AZ:USA","dallas:TX:USA","los angeles:CAN:USA","pasadena:CAN:USA","seattle:WA:USA","atlanta:GA:USA","denver:CO:USA","montreal:QC:CAN","philadelphia:PA:USA","st. louis:MO:USA","baltimore:MD:USA","fort lauderdale:FL:USA","munich::DEU","pittsburgh:PA:USA","stamford:CT:USA","bangkok::THA","frankfurt::DEU","new orleans:LA:USA","portland:OR:USA","sunnyvale:CAN:USA","boston:MA:USA","honolulu, island of oahu:HI:USA","honolulu:HI:USA","new york:NY:USA","richmond:VA:USA","sydney::AUS","calgary:AB:CAN","houston:TX:USA","newark:NJ:USA","rosemont:IL:USA","toronto:ON:CAN","chicago:IL:USA","indianapolis:IN:USA","san antonio:TX:USA","vancouver:BC:CAN","cincinnati:OH:USA","kansas city:MO:USA","orlando:FL:USA","san diego:CAN:USA:","washington:DC:USA","paris::FRA","virginia beach:VA:USA","tarrytown:NY:USA"];







// safari work around function for Date.setDate()
function addDays(daysToAdd,date) {
  var x = new Date(2000,1,1);
  var y = new Date(2000,1,1);
  if(x.setDate(128) > y.valueOf())  {
    date.setDate(date.getDate()+daysToAdd);
    return date;
  }
  // Safari setDate(uint8) workaround
  if(daysToAdd < 0) {
    for(var i= -97; daysToAdd < i; daysToAdd-= i) {
      date.setDate(date.getDate()+i);
    }
  }
  else {
    for(var i= 96; daysToAdd > i; daysToAdd-= i) {
      date.setDate(date.getDate()+i);
    }
  }
  date.setDate(date.getDate()+daysToAdd);
  return date;
}

// Static date constants for today (not overwritten by functions)
var mcCalsToDisplay = 2;
var mcMaxBookDays   = 91;
var mcDisplayLimit  = 549;

    
var mcMaxDisplay    = new Date();
// safari fix
    mcMaxDisplay    = addDays(mcDisplayLimit, mcMaxDisplay); //today + 549 days = 550 days to display
var moMonthDayCountArrayCiCo = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

/*  set up language object to display the correct strings on the cal for internationalization (can and should be overwritten on calling page)
    default to english and get populated on the page with the translated strings
 */
var moLanguageObjCiCo = {
    calendarMonthNameArray    : ["January","February","March","April","May","June","July","August","September","October","November","December"],
    calendarShortMonthArray   : ["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],
    calendarShortDayNameArray : ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
    calendarDayNameArray      : ["Su","M","Tu","W","Th","F","Sa"],
    errorArray                : [
                                  
                                    
                                    
                                        "For stays longer than 90 nights, please call 866-539-3446.",
                                    
                                  
                                  "You can only book up to 550 days in advance.",
                                  "Arrival date cannot be earlier than today.",
                                  "Departure date cannot be earlier than arrival date.",
                                  "Arrival and departure date cannot be on the same day.",
                                  "Please select a check-in and checkout date.",
                                  "Please select a checkout date."
                                ],
    pickCheckInText           : "Select check in date above",
    pickCheckOutText          : "Select check out date above",
    checkInText               : "Check in",
    checkOutText              : "Check out",
    clickCheckInTitle         : "Click for this check in",
    clickCheckOutTitle        : "Click for this check out",
    calendarClose             : "Close",
    calendarClear             : "Reset Calendar",
    resetSelectedDate         : "Reset",
    calendarPrev              : "Previous",
    calendarNext              : "Next",
    calendarContinue          : "Continue",
    submitDates               : "Submit dates",
    day                       : "Su",
    year                      : "Year"
};
    // function to determine the offsetLeft of an element that is passed in

function fnGetOffsetLeftCiCo (pElement) {
  var lsLeftOffset = pElement.offsetLeft;

  while ((pElement = pElement.offsetParent) != null){
      lsLeftOffset  += pElement.offsetLeft;
  }
  return lsLeftOffset;
}

// function to determine the offsetTop of an element that is passed in
function fnGetOffsetTopCiCo (pElement) {
  var lsTopOffset = pElement.offsetTop;
  while ((pElement = pElement.offsetParent) != null){
      lsTopOffset +=pElement.offsetTop;
  }
  return lsTopOffset;
}
 
var moCalendarObjCiCo = null;

function CalendarManager(config){
  this.calArray = new Array();
}

//Calendar Manager method to add a new calendar to the array
CalendarManager.prototype.addCalendar = function(pCalendarObj){
  this.calArray[pCalendarObj.calendarId] = pCalendarObj;
}

var calRightArrow = new Image();
calRightArrow.src = "/whotels/images/calendar/rightArrow.gif";
var calLeftArrow = new Image();
  calLeftArrow.src = "/whotels/images/calendar/leftArrow.gif";
var calControlBackground = new Image();
  calControlBackground.src = "/whotels/images/calendar/calendarcontrolbackground.gif";
var calCloseBox = new Image();
  calCloseBox.src = "/whotels/images/calendar/closebox.gif";
var calCells = new Image();
  calCells.src = "/whotels/images/calendar/wh_calendar_cells.gif";

// declare and set module variables
var moCalendarManagerCiCo = new CalendarManager();

/**
 * Availability Calendar Constructor
 * @constructor
 * @param {String} pCalendarId Unique ID for instance of Calendar
 * @param {Object} pCIDate Function to retrieve check in date
 * @param {Object} pCODate Function to retrieve check out date
 * @param {Object} pRetrunFunction Function to set check-in and check-out dates
*/
function multiDisplayCalendar(pCalendarId, pCIDate, pCODate, pReturnFunction, todaySystemDate) {
// backwards compatibility
    this.settings = {
        calendarsToDisplay    : mcCalsToDisplay,
        maxBookDays           : mcMaxBookDays,
        displayLimit          : mcDisplayLimit,
        today                 : SW.widget.Calendar.Utils.getToday(todaySystemDate),
        limitDate             : mcMaxDisplay
    };
    this.settings.firstOfStartMonth = new Date(this.settings.today.getFullYear(), this.settings.today.getMonth(), 1)

    this.isRendered = 0;
    this.isCreated = 0;

    this.handleClass = function(className, tag, root, func, params) {
        var elements = yuiDom.getElementsByClassName(className, tag, root);
        if (func) {
            for (var i = 0; i < elements.length; i++) {
                func(elements[i], params);
            }
        }
    };
    this.userLanguage = "en";
    if (moCalendarManagerCiCo.calArray[pCalendarId]) {
        var loCalendarObj = moCalendarManagerCiCo.calArray[pCalendarId];
        this.getCIDateFunction = pCIDate;
        this.getCODateFunction = pCODate;
        loCalendarObj.ciDateInitial = this.getCIDateFunction();
        loCalendarObj.coDateInitial = this.getCODateFunction();
        loCalendarObj.initializeObject();
        return loCalendarObj;
    } else {
        this.calendarId = pCalendarId;
        this.returnFunction = pReturnFunction;
        this.getCIDateFunction = pCIDate;
        this.getCODateFunction = pCODate;
        this.calLocation = "bottomRight";
        this.checkIn = null;
        this.checkOut = null;
        this.calStartDate = null;
        this.display = 'none';
        this.calendarDivMonth = new Array();
        this.errorMessageDiv = null;
        this.calendarContinue = null;
        this.calendarPrevious = null;
        this.calendarPreviousAction = null;
        this.calendarNext = null;
        this.calendarNextAction = null;
        this.hasError = null;
        this.errorArray = null;
        this.initializeObject();
        this.ciCocalendarIframe = null;
        this.calendarContainer = null;
        this.renderedMonths = {}; // object literal -> store already-rendered months (avoids re-rendering months);

        this.prevButton = document.createElement("div");  // container for prev button
        yuiDom.addClass(this.prevButton, "calendarNavigation");
        yuiDom.addClass(this.prevButton, "calendarNavigationPrevious")
        yuiEvent.addListener(this.prevButton, "click", this.changeMonth, -1, this);

        this.nextButton = document.createElement("div");  // container for next button
        yuiDom.addClass(this.nextButton, "calendarNavigation");
        yuiDom.addClass(this.nextButton, "calendarNavigationNext");
        yuiEvent.addListener(this.nextButton, "click", this.changeMonth, 1, this);

        moCalendarManagerCiCo.addCalendar(this);
        return this;
    }
}

// gets the check-in and check-out from input fields, get calendarStartDate
multiDisplayCalendar.prototype.initializeObject = function(){
  this.checkIn = this.getCIDateFunction();
  this.checkOut = this.getCODateFunction();
  this.calStartDate = this.getCalStartDate();
  this.hasError = false;
}

// get calendar start date based on check-in and check-out
multiDisplayCalendar.prototype.getCalStartDate = function(){
  var calStartDate = new Date(this.settings.firstOfStartMonth);
  var currentCalStartDate = (this.calStartDate) ? new Date(this.calStartDate.getFullYear(), this.calStartDate.getMonth(), 1) : null;
  if(!currentCalStartDate || currentCalStartDate == calStartDate || (this.checkIn && this.checkOut)) {
    return (this.checkIn && this.checkOut) ? new Date(this.checkIn.getFullYear(),this.checkIn.getMonth(), 1) : calStartDate;
  }
  return currentCalStartDate;

}

// toggle between show and hide
multiDisplayCalendar.prototype.toggleDisplay = function(pCalendarIcon, calLocation){
  if(this.display != "block") {
    this.show(pCalendarIcon, calLocation);
  }
  else {
    this.hide();
  }
}

// show calendar, get check-in and check-out, get calendar start date, validate values
multiDisplayCalendar.prototype.show = function(pCalendarIcon, calLocation){
  this.initializeObject();
    if(!this.isCreated) {
        this.createFramework();
        this.isCreated = 1;
    }
  if(this.checkIn && this.checkOut) {
    this.validateCalendar();
  }
  if(this.hasError) {
    this.resetCheckInDate();
    this.resetCheckOutDate();
    this.calStartDate = new Date(this.settings.firstOfStartMonth);

  }
  this.renderCalDisplay();
  this.isRendered = 1;

  this.display = 'block';
  this.calendarContainer.style.display = this.display;
  // set the iframe dimensions, needs to be done after the calendar is displayed
  if(this.display == 'block'){
      this.ciCocalendarIframe.width           = this.calendarContainer.offsetWidth;
      this.ciCocalendarIframe.height          = this.calendarContainer.offsetHeight;
      this.ciCocalendarIframe.style.zIndex    = this.calendarContainer.style.zIndex - 1;
  }
  this.highlight();
  this.ciCocalendarIframe.style.display   = this.display;
    if(pCalendarIcon!=undefined) this.setCalendarPosition(pCalendarIcon, calLocation);
}

// hide calendar
multiDisplayCalendar.prototype.hide = function(event){
  this.display              = 'none';
  this.calendarContainer.style.display  = this.display;
  this.ciCocalendarIframe.style.display     = this.display;
}

// set calendar position based on calendar icon
multiDisplayCalendar.prototype.setCalendarPosition = function(pCalendarIcon, calLocation){
    this.calLocation = calLocation;

  if (this.calLocation == "topLeft") {
      // display to the top left of the icon
      this.calendarContainer.style.top    = (fnGetOffsetTopCiCo(pCalendarIcon, this.calendarContainer) - this.calendarContainer.offsetHeight) + 'px';
      this.calendarContainer.style.left   = (fnGetOffsetLeftCiCo(pCalendarIcon, this.calendarContainer) - this.calendarContainer.offsetWidth) + 'px';
  } else if (this.calLocation == "topRight") {
       // display to the top left of the icon
      this.calendarContainer.style.top    = (fnGetOffsetTopCiCo(pCalendarIcon, this.calendarContainer) - this.calendarContainer.offsetHeight) + 'px';
      this.calendarContainer.style.left   = fnGetOffsetLeftCiCo(pCalendarIcon, this.calendarContainer) + 'px';
  } else if (this.calLocation == "bottomRight") {
      // display below and to the right of the icon
      this.calendarContainer.style.top    = fnGetOffsetTopCiCo(pCalendarIcon, this.calendarContainer) + 'px';
      this.calendarContainer.style.left   = fnGetOffsetLeftCiCo(pCalendarIcon, this.calendarContainer) + 'px';
  } else if (this.calLocation == "bottomLeft") {
       // display below and to the right of the icon
      this.calendarContainer.style.top    = fnGetOffsetTopCiCo(pCalendarIcon, this.calendarContainer) + 'px';
      this.calendarContainer.style.left   = (fnGetOffsetLeftCiCo(pCalendarIcon, this.calendarContainer) - this.calendarContainer.offsetWidth) + 'px';
  } else if (this.calLocation == "centerLeft") {
       // display center and to the left of the icon
      this.calendarContainer.style.top    = fnGetOffsetTopCiCo(pCalendarIcon, this.calendarContainer) - parseFloat(this.calendarContainer.offsetHeight)/2 +  'px';
      this.calendarContainer.style.left   = (fnGetOffsetLeftCiCo(pCalendarIcon, this.calendarContainer) - this.calendarContainer.offsetWidth) + 'px';
  } else if (this.calLocation == "centerRight") {
       // display center and to the right of the icon
      this.calendarContainer.style.top    = fnGetOffsetTopCiCo(pCalendarIcon, this.calendarContainer) - parseFloat(this.calendarContainer.offsetHeight)/2 +  'px';
      this.calendarContainer.style.left   = (fnGetOffsetLeftCiCo(pCalendarIcon, this.calendarContainer) ) + 'px';
  } else {
      // the user tells it where to be placed
      // expecting a string with x and y seperated by a comma
      var laUserLocation = this.calLocation.split(",");
      this.calendarContainer.style.top    =  laUserLocation[1] + 'px';
      this.calendarContainer.style.left   =  laUserLocation[0] + 'px';
  }
  this.ciCocalendarIframe.style.top       = this.calendarContainer.style.top;
  this.ciCocalendarIframe.style.left      = this.calendarContainer.style.left;
}

// create framework of the calendar
multiDisplayCalendar.prototype.createFramework = function(){
  var lsText;
  var loTextNode;

  //create the iframe to sit behind the layer - workaround for IE and select boxes
  var loCalenderHolderIframe = document.createElement("iframe");
      loCalenderHolderIframe.name = "calendarHolder_Iframe";
      loCalenderHolderIframe.id = "calendarHolder_Iframe_" + this.calendarId;
      loCalenderHolderIframe.width = 0;
      loCalenderHolderIframe.height = 0;
      loCalenderHolderIframe.style.zIndex = "99998";
      yuiDom.addClass(loCalenderHolderIframe, 'calendarHolderIframe');
      loCalenderHolderIframe.src = "/common/blank.jsp";
      this.ciCocalendarIframe = loCalenderHolderIframe;
      document.body.appendChild(this.ciCocalendarIframe);
  // create main calendar div

  var loCalenderHolder = document.createElement("div");
  this.calendarContainer = loCalenderHolder;
      loCalenderHolder.style.zIndex = "20000";
      loCalenderHolder.className = "calendarHolder";
      loCalenderHolder.id = "calendarHolder_" + this.calendarId;
      document.body.appendChild(loCalenderHolder);

  var loCalendarSubContainer = document.createElement("div");
      yuiDom.addClass(loCalendarSubContainer,"calendarSubContainer");
      this.calendarContainer.appendChild(loCalendarSubContainer);
      this.calendarContainer.subContainer = loCalendarSubContainer;
      
// create close button
  var loClose = document.createElement("div");
      this.calendarContainer.close = loClose;
      yuiDom.addClass(loClose, 'closeButton');
      var loCloseAction = document.createElement("a");
           loCloseAction.href = "javascript:void(0);";
          loCloseAction.target = "_self";
          // yuiEvent.addListener(loCloseAction,"click",this.close,{},this);
          yuiEvent.addListener(loCloseAction,"click",function(e){
              this.close();
              yuiEvent.preventDefault(e);
          }, this, true);
          loCloseAction.title = moLanguageObjCiCo.calendarClose;
          lsText = moLanguageObjCiCo.calendarClose;
          loTextNode = document.createTextNode(lsText);
          loCloseAction.appendChild(loTextNode);
          var loCloseActionImg = document.createElement("img");
              loCloseActionImg.src = calCloseBox.src;
              loCloseActionImg.border = '0';
              loCloseActionImg.alt = moLanguageObjCiCo.calendarClose;
//            loCloseAction.appendChild(loCloseActionImg);
      loClose.appendChild(loCloseAction);
      this.calendarContainer.subContainer.appendChild(loClose);

  // clear calendar
  var loClearCal = document.createElement("div");
  this.calendarContainer.reset = loClearCal;
  yuiDom.addClass(loClearCal, 'reset')

  var resetButton = document.createElement("div");
  this.calendarContainer.reset.resetButton = resetButton;
  yuiDom.addClass(resetButton,'resetButton');

  this.calendarContainer.reset.appendChild(resetButton);

  var loResetAction = document.createElement("a");
  this.calendarContainer.reset.resetDates = loResetAction;
  loResetAction.href = "javascript:void(0);";
  loResetAction.target = "_self";
  yuiEvent.addListener(loResetAction,"click",this.reset,{},this);
  loResetAction.title = moLanguageObjCiCo.calendarClear;
  lsText = moLanguageObjCiCo.calendarClear;
  loTextNode = document.createTextNode(lsText);
  loResetAction.appendChild(loTextNode);

  this.calendarContainer.reset.resetButton.appendChild(loResetAction);
  this.calendarContainer.subContainer.appendChild(loClearCal);


  // create the main calendar portion
  var loCalendarContainer = document.createElement("div");
      this.calendarContainer.calendarOuterContainer = loCalendarContainer;
      loCalendarContainer.className = "calendarOuterContainer";

      // container

  var loCalendarInnerContainer = document.createElement("div");
      this.calendarContainer.calendarOuterContainer.calendarInnerContainer = loCalendarInnerContainer;
      loCalendarInnerContainer.className = "calendarInnerContainer";

      /* ****************CAL BODY HERE******************* */

      // mcCalsToDisplay --> var to hold number of calendar to be displayed...

      var spacerCount = 1;
      for(var i = 0; i < this.settings.calendarsToDisplay; i++) {
          var calEl = document.createElement("div");
          yuiDom.addClass(calEl, "calendarDiv");
          loCalendarInnerContainer.appendChild(calEl);
          this.calendarDivMonth[i] = calEl;
          spacerCount++;
          if(spacerCount % 2 == 0) {
              var loSpacerDiv = document.createElement("div");
              loSpacerDiv.className = "spacerDiv";
              loCalendarInnerContainer.appendChild(loSpacerDiv);
          }
       }
       var loClearDiv1 = document.createElement("div");
       loClearDiv1.className = "divClear";
       loCalendarInnerContainer.appendChild(loClearDiv1);

/* ****************END CAL BODY******************** */
      // clear div
  var loClearDiv2 = document.createElement("div");
      loClearDiv2.className = "divClear";
      loCalendarContainer.appendChild(loClearDiv2);

  this.calendarContainer.subContainer.appendChild(loCalendarContainer);
  this.calendarContainer.calendarOuterContainer.appendChild(loCalendarInnerContainer);
   // clear div

  var clearDiv = document.createElement("div");
  yuiDom.addClass(clearDiv,'divClear');
  this.calendarContainer.subContainer.appendChild(clearDiv);

  loCalendarContainer.appendChild(loClearDiv2);
  // create menuHolder Div

  var menuHolder = document.createElement("div");
  this.calendarContainer.menuHolder = menuHolder;
  yuiDom.addClass(menuHolder, 'menuHolder');
  this.calendarContainer.subContainer.appendChild(menuHolder);

  // create error display
  var loError = document.createElement("div");
      loError.className = "calendarError";
      loError.id = "calendarError_"+this.calendarId;
      this.errorMessageDiv = loError;
      this.calendarContainer.menuHolder.appendChild(loError);

  // create travel dates display
  var travelDateHolder = document.createElement("div");
  this.calendarContainer.menuHolder.travelDateHolder = travelDateHolder;
  yuiDom.addClass(travelDateHolder,"travelDateHolder");

  var instructions = document.createElement("ol");
  this.calendarContainer.menuHolder.travelDateHolder.instructions = instructions;
  yuiDom.addClass(instructions,"instructions");

  var checkInInstructions = document.createElement("li");
  this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions = checkInInstructions;
  checkInInstructions.id = "checkInInstructions_"+this.calendarId;
  yuiDom.addClass(checkInInstructions, "checkInInstructions")
  yuiDom.addClass(checkInInstructions,"active");
  yuiDom.addClass(checkInInstructions,"checkInInstructionsActive");
  var checkInText = document.createTextNode(moLanguageObjCiCo.pickCheckInText);
  checkInInstructions.appendChild(checkInText);

  var checkOutInstructions = document.createElement("li");
  this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions = checkOutInstructions;
  checkOutInstructions.id = "checkOutInstructions_"+this.calendarId;
  yuiDom.addClass(checkOutInstructions, "checkOutInstructions")
  var checkOutText = document.createTextNode(moLanguageObjCiCo.pickCheckOutText); // code decode
  checkOutInstructions.appendChild(checkOutText);

  var submitInstructions = document.createElement("li");
  this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions = submitInstructions;
  submitInstructions.id = "submitInstructions_"+this.calendarId;
  yuiDom.addClass(submitInstructions, "submitInstructions");
  var submitTextContainer = document.createElement("span");
  yuiDom.addClass(submitTextContainer, "submitInstLabel");
  var submitText = document.createTextNode(moLanguageObjCiCo.submitDates); // code decode
  submitTextContainer.appendChild(submitText);
  submitInstructions.appendChild(submitTextContainer);

  var continueButton = document.createElement("div");
  this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.continueButton = continueButton;
  yuiDom.addClass(continueButton,"continueButton");
  yuiDom.addClass(continueButton,"buttonLink");

  var continueLink = document.createElement("a");
  this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.continueButton.continueLink = continueLink;
  yuiDom.addClass(continueLink,"continueLink");
  continueLink.href = "javascript:void(0);";
  continueLink.target = "_self";
  yuiEvent.addListener(continueLink,"click",this.submit,{checkIn: this.checkIn,checkOut: this.checkOut},this);
  continueLink.title = moLanguageObjCiCo.calendarContinue;
  var continueText = document.createTextNode(moLanguageObjCiCo.calendarContinue);
  continueLink.appendChild(continueText);
  continueButton.appendChild(continueLink);
  this.calendarContainer.menuHolder.travelDateHolder.instructions.appendChild(checkInInstructions);
  this.calendarContainer.menuHolder.travelDateHolder.instructions.appendChild(checkOutInstructions);
  this.calendarContainer.menuHolder.travelDateHolder.instructions.appendChild(submitInstructions);

  this.calendarContainer.menuHolder.travelDateHolder.appendChild(instructions);
  this.calendarContainer.menuHolder.appendChild(travelDateHolder);

  this.checkInToolTip = document.createElement("div");
  yuiDom.addClass(this.checkInToolTip, "calendarToolTip");
  yuiDom.addClass(this.checkInToolTip, "checkInToolTip");
  this.checkInToolTip.innerHTML = moLanguageObjCiCo.clickCheckInTitle;
  document.body.appendChild(this.checkInToolTip)

  this.checkOutToolTip = document.createElement("div");
  yuiDom.addClass(this.checkOutToolTip, "calendarToolTip");
  yuiDom.addClass(this.checkOutToolTip, "checkOutToolTip");
  this.checkOutToolTip.innerHTML = moLanguageObjCiCo.clickCheckOutTitle;
  document.body.appendChild(this.checkOutToolTip)

  return loCalenderHolder;
}
// End createFramework

// render the calendar
multiDisplayCalendar.prototype.renderCalendar = function() {

// clear all child nodes first, never should need to do replaceChild for this.calendarDivMonth[calIndex]
    for(var calIndex = 0; calIndex < this.settings.calendarsToDisplay; calIndex++) {
      if(this.calendarDivMonth[calIndex].firstChild) {
        this.calendarDivMonth[calIndex].removeChild(this.calendarDivMonth[calIndex].firstChild);
      }
    }
    for (var calIndex = 0; calIndex < this.settings.calendarsToDisplay; calIndex++) {
      var columnIndex   = 0;
      var workingDate   = new Date(this.calStartDate);
      workingDate       = new Date(workingDate.setMonth(workingDate.getMonth() + calIndex));
      var currentMonth  = workingDate.getMonth();
      var currentYear   = workingDate.getFullYear();
      var currentDay    = new Date(currentYear,currentMonth,1).getDay();

      if(!this.renderedMonths[currentYear]){
          this.renderedMonths[currentYear] = {};
      }
      var calendarTable;
      if(!this.renderedMonths[currentYear][currentMonth]) {
          //Write the newly constructed table to the div on the page
          calendarTable = this.createMonth(calIndex);
          this.calendarDivMonth[calIndex].appendChild(calendarTable);
          this.renderedMonths[currentYear][currentMonth] = calendarTable;
      }
      else {
        if(this.renderedMonths[currentYear]) {
          if(!this.renderedMonths[currentYear][currentMonth]) {
          // create calendar for the month if not created already
            calendarTable = this.createMonth(calIndex);
            this.renderedMonths[currentYear][currentMonth] = calendarTable;
          }
          if(this.renderedMonths[currentYear][currentMonth].calendarHeader) {
            if(calIndex == 0) {
//              add previous button control for first calendar
              if(this.prevButton.parentNode && this.prevButton.parentNode != this.renderedMonths[currentYear][currentMonth].calendarHeader) {
                 this.prevButton.parentNode.removeChild(this.prevButton);
              }
              if(workingDate > this.settings.today) {
                if(this.renderedMonths[currentYear][currentMonth].calendarHeader.firstChild && this.renderedMonths[currentYear][currentMonth].calendarHeader.firstChild != this.prevButton) {
                  this.renderedMonths[currentYear][currentMonth].calendarHeader.insertBefore(this.prevButton,this.renderedMonths[currentYear][currentMonth].calendarHeader.firstChild);
                }
              }
            }
            if(calIndex == 1) {
//              add next button control first second calendar
              if(this.nextButton.parentNode && this.nextButton.parentNode != this.renderedMonths[currentYear][currentMonth].calendarHeader) {
                this.nextButton.parentNode.removeChild(this.nextButton);
              }
              var limitDateCheck = workingDate.setMonth(workingDate.getMonth()+1);
              if(limitDateCheck < this.settings.limitDate) {
                if(this.renderedMonths[currentYear][currentMonth].calendarHeader.firstChild && this.renderedMonths[currentYear][currentMonth].calendarHeader.firstChild != this.nextButton) {
                  this.renderedMonths[currentYear][currentMonth].calendarHeader.insertBefore(this.nextButton,this.renderedMonths[currentYear][currentMonth].calendarHeader.firstChild);
                }
              }
            }
          }
//          put the month back into container
          this.calendarDivMonth[calIndex].appendChild(this.renderedMonths[currentYear][currentMonth]);
        }
      }
      this.resetHightlight(this.calendarDivMonth[calIndex]);
    }
}

multiDisplayCalendar.prototype.renderCalDisplay = function(){
    this.renderCalendar();
    this.highlight();
}

multiDisplayCalendar.prototype.createMonth = function(calIndex) {
  var columnIndex   = 0;
  var workingDate   = new Date(this.calStartDate);
  workingDate       = new Date(workingDate.setMonth(workingDate.getMonth() + calIndex));
  var currentMonth  = workingDate.getMonth();
  var currentYear   = workingDate.getFullYear();
  var currentDay    = new Date(currentYear,currentMonth,1).getDay();
  // calendarTable - to be returned by this function, main day holder
  var calendarTable        = document.createElement("div");
  yuiDom.addClass(calendarTable, "calendarTable");

  var calendarHeader       = document.createElement("div");
  yuiDom.addClass(calendarHeader, "calendarHeader");

  var clearHdr = document.createElement("div");
  yuiDom.addClass(clearHdr,"divClear");

  var calendarMonth        = document.createElement("div");
  var calendarMonthText    = document.createTextNode(moLanguageObjCiCo.calendarMonthNameArray[currentMonth] + " " + currentYear);
  yuiDom.addClass(calendarMonth, "month");
  calendarMonth.appendChild(calendarMonthText);
  if(calIndex == 0 && this.prevButton.parentNode) {
    this.prevButton.parentNode.removeChild(this.prevButton);
  }
  if(calIndex == 1 && this.nextButton.parentNode) {
    this.nextButton.parentNode.removeChild(this.nextButton);
  }
  if(calIndex == 0 && (workingDate > this.settings.today)) {
    this.calendarPrevious = this.prevButton;
    calendarHeader.appendChild(this.prevButton);
  }
  var dateCheck = workingDate;
  dateCheck.setMonth(workingDate.getMonth()+1);

  if(calIndex == 1 && (dateCheck < this.settings.limitDate)) {
    this.calendarNext = this.nextButton;
    calendarHeader.appendChild(this.nextButton);
  }

  calendarTable.appendChild(calendarHeader);
//  attach calendar header to calendarTable so we can use it as reference when adding next and previous buttons
  calendarTable.calendarHeader = calendarHeader;
  calendarHeader.appendChild(calendarMonth);
  calendarHeader.appendChild(clearHdr);

  var calendarDays   = document.createElement("div");
  yuiDom.addClass(calendarDays,"calendarTableInner");
  calendarTable.appendChild(calendarDays);

  // create day headers
  for (var i = 0; i < 7; i++){
      var day     = document.createElement("div");
      var dayText = document.createTextNode(moLanguageObjCiCo.calendarDayNameArray[i]);
      yuiDom.addClass(day,"daysoftheweek");
      day.appendChild(dayText);
      calendarDays.appendChild(day);
  }

  var clearDiv = document.createElement("div");
  yuiDom.addClass(clearDiv,"divClear");
  calendarDays.appendChild(clearDiv);

  // Figure out if it is a leap year and set accordingly
  moMonthDayCountArrayCiCo[1] = (((currentYear % 4 == 0) && (currentYear % 100 != 0)) || (currentYear % 400 == 0)) ? 29 : 28;
  for (var i=0; i<currentDay; i++, columnIndex++){
      var emptyDay = document.createElement("div");
      yuiDom.addClass(emptyDay,"day");
      yuiDom.addClass(emptyDay,"emptyDay");
      calendarDays.appendChild(emptyDay);
  }
  for (var i=0; i<=moMonthDayCountArrayCiCo[currentMonth]-1; i++, columnIndex++) {
    var currentDate = new Date(currentYear,currentMonth,1);
    currentDate = new Date(currentDate.setDate(currentDate.getDate() + i));
    if(currentDate < this.settings.limitDate && currentDate >= this.settings.today){ // day is valid
        var validDay = document.createElement("div");
        yuiDom.addClass(validDay,"day");
        yuiDom.addClass(validDay,"available");
        yuiEvent.addListener(validDay,"click",this.selectDay,{calendarId:this.calendarId,element: validDay, currentDate:currentDate.getFullYear() + '/' + (currentDate.getMonth()+1) + '/' + currentDate.getDate()},this);
        yuiEvent.addListener(validDay,"mouseover",this.hover,{hover: true,element: validDay},this);
        yuiEvent.addListener(validDay,"mouseout",this.hover,{hover: false,element: validDay},this);
        var dayLink     = document.createElement("a");
        dayLink.href    = "javascript:void(0);";
        dayLink.target = "_self";
        var dayLinkText = document.createTextNode(currentDate.getDate());
        dayLink.appendChild(dayLinkText);
        validDay.appendChild(dayLink);
        validDay.id= currentDate.getFullYear() + "/" + (currentDate.getMonth()+1) + "/" + currentDate.getDate() + "_" + this.calendarId;
        calendarDays.appendChild(validDay);
    }
    else if(currentDate > this.settings.limitDate && currentDate >= this.settings.today){ //day is past the book limit
        var pastBooking = document.createElement("div");
        yuiDom.addClass(pastBooking,"day");
        yuiDom.addClass(pastBooking,"invalidDay");
        var pastBookingText = document.createTextNode(currentDate.getDate());
        pastBooking.appendChild(pastBookingText);
        calendarDays.appendChild(pastBooking);
    }
    if(currentDate < this.settings.today){ // day is less than today
        var pastDay     = document.createElement("div");
        yuiDom.addClass(pastDay,"day");
        yuiDom.addClass(pastDay,"pastDay");
        var pastDayText = document.createTextNode(currentDate.getDate());
        pastDay.appendChild(pastDayText);
        calendarDays.appendChild(pastDay);
    }
    if (columnIndex == 6) {
        var clearWeek = document.createElement("div");
        yuiDom.addClass(clearWeek,"divClear");
        calendarDays.appendChild(clearWeek);
        columnIndex = -1;
    }
  }
  if (columnIndex > 0) {
      for (var i=1; columnIndex<7; i++, columnIndex++){
          var emptyDay = document.createElement("div");
          yuiDom.addClass(emptyDay,"day");
          yuiDom.addClass(emptyDay,"emptyDay");
          calendarDays.appendChild(emptyDay);
      }
  }

  var clearDays = document.createElement("div");
  yuiDom.addClass(clearDays,"divClear");
  calendarDays.appendChild(clearDays);

  calendarTable.appendChild(calendarDays);

  var clearBody = document.createElement("div");
  yuiDom.addClass(clearBody,"divClear");
  calendarTable.appendChild(clearBody);
  return calendarTable;
}

multiDisplayCalendar.prototype.setNavigation = function(){

    var lvWorkingDate   = new Date(this.calStartDate);
        lvWorkingDate   = new Date(lvWorkingDate.setMonth(lvWorkingDate.getMonth() + 1));
    var loMaxDisplay    = new Date(this.settings.limitDate);
    var loDisableArray = new Array(false, false);

    // Prev button
    if(this.calStartDate.getMonth() == this.settings.today.getMonth() && this.calStartDate.getFullYear() == this.settings.today.getFullYear()){
        this.calendarPrevious.className = 'calendarNavigationPrevDisabled';
        this.calendarPrevious.href = "javascript:void(0);";
        yuiEvent.removeListener(this.calendarPrevious,"click",this.changeMonth);
    }
    else{
        this.calendarPrevious.className = 'calendarNavigationPrevActive';
        this.calendarPrevious.href = this.calendarPreviousAction;
        yuiEvent.addListener(this.calendarPrevious,"click",this.changeMonth,-1,this);
    }
    // next button
    if(lvWorkingDate.getMonth() == loMaxDisplay.getMonth() && lvWorkingDate.getFullYear() == loMaxDisplay.getFullYear()){
        this.calendarNext.className = 'calendarNavigationNextDisabled';
        this.calendarNext.href = "javascript:void(0);";
        yuiEvent.removeListener(this.calendarNext,"click",this.changeMonth);
    }
    else{
        this.calendarNext.className = 'calendarNavigationNextActive';
        this.calendarNext.href = this.calendarNextAction;
        yuiEvent.addListener(this.calendarNext,"click",this.changeMonth,1,this);
    }
}

multiDisplayCalendar.prototype.getLengthOfStay = function(startDate,endDate){
  return Math.round(Math.abs(endDate - startDate)/(1000 * 60 * 60 * 24)) +1;
}

multiDisplayCalendar.prototype.changeMonth = function(e, direction){
//    var loCalendarObj = moCalendarManagerCiCo.calArray[pCalendarId];
  var loNewStart = new Date(this.calStartDate);
  var newMonth = loNewStart.getMonth() + direction;
  // safari fix
  if(newMonth < 0) {
    loNewStart.setFullYear(loNewStart.getFullYear()-1);
    newMonth = 11;
  }
  loNewStart.setMonth(newMonth);
  if(loNewStart >=  this.settings.firstOfStartMonth && this.settings.limitDate >= loNewStart ) {
    this.calStartDate = loNewStart;
    this.renderCalDisplay();
  }
}

multiDisplayCalendar.prototype.showToolTip = function(e,tip,element) {
  var coords  = yuiEvent.getXY(e);
  yuiDom.setStyle(tip, "display", "block");
  yuiDom.setStyle(tip, "left", coords[0]+15 +"px");
  yuiDom.setStyle(tip, "top", coords[1]+10 +"px");
}
multiDisplayCalendar.prototype.hover = function(e, params) {

  var hoverDate = new Date(params.element.id.split("_")[0]);

  if(params.hover) { // mouseover

    var coords  = yuiDom.getXY(params.element);
    if(this.checkIn && !this.checkOut) {
      if(this.checkIn<hoverDate) {
        yuiDom.addClass(params.element,"hoverCheckOut");
        this.showToolTip(e,this.checkOutToolTip,params.element);
      }
      else {
        yuiDom.addClass(params.element,"hoverCheckIn");
        this.showToolTip(e,this.checkInToolTip,params.element);
      }
      return;
    }
    else if(this.checkOut && !this.checkIn) {
      if(this.checkOut<hoverDate) {
        yuiDom.addClass(params.element,"hoverCheckOut");
        this.showToolTip(e,this.checkOutToolTip,params.element);
      }
      else {
        yuiDom.addClass(params.element,"hoverCheckIn");
        this.showToolTip(e,this.checkInToolTip,params.element);
      }
      return;
    }
    else if(!this.checkIn) {
      yuiDom.addClass(params.element,"hoverCheckIn");
      this.showToolTip(e,this.checkInToolTip,params.element);
      return;
    }
    else if(!this.checkOut) {
      yuiDom.addClass(params.element,"hoverCheckOut");
        this.showToolTip(e,this.checkOutToolTip,params.element);
      return;
    }

    if((this.checkIn && this.checkOut) && (this.checkIn < hoverDate && this.checkOut > hoverDate)) {
      var daysBetween = Math.round(Math.abs(this.checkOut - this.checkIn)/(1000 * 60 * 60 * 24)) - 1;
      var halfWay = parseInt(daysBetween/2);
      var halfWayDate = new Date(this.checkIn.getFullYear(), this.checkIn.getMonth(), this.checkIn.getDate())
      halfWayDate = addDays(halfWay,halfWayDate);
      if(hoverDate <= halfWayDate) {
        yuiDom.addClass(params.element,"hoverCheckIn");
        this.showToolTip(e,this.checkInToolTip,params.element);
      }
      else {
        yuiDom.addClass(params.element,"hoverCheckOut");
        this.showToolTip(e,this.checkOutToolTip,params.element);
      }
    }
    else if(this.checkIn > hoverDate) {
      yuiDom.addClass(params.element,"hoverCheckIn");
      this.showToolTip(e,this.checkInToolTip,params.element);
    }
    else if(this.checkOut < hoverDate) {
      yuiDom.addClass(params.element,"hoverCheckOut");
      this.showToolTip(e,this.checkOutToolTip,params.element);
    }
  }
  else { // mouseout
    // remove all hover classes
    this.checkInToolTip.style.display = "none";
    this.checkOutToolTip.style.display = "none";
    if(!this.checkIn) {
      yuiDom.removeClass(params.element, "hoverCheckIn");
    }
    else if(!this.checkOut) {
      yuiDom.removeClass(params.element, "hoverCheckOut");
    }

    if(this.checkIn){
      yuiDom.removeClass(params.element,"hoverCheckIn");
    }
    if(this.checkOut){
      yuiDom.removeClass(params.element,"hoverCheckOut");
    }
  }
}

multiDisplayCalendar.prototype.selectDay = function(e,params) {
    yuiEvent.preventDefault(e);
    var selectedDate = new Date(params.currentDate);

    // validate the selectedDate first
    this.validateSelectedDate(selectedDate);
    if(this.hasError) {
      return;
    }
    // no dates selected, treat as checkin
    if(!(this.checkIn&&this.checkOut)) {
      if(!this.checkIn&&!this.checkOut) {
        this.checkIn = selectedDate;
        this.resetHightlight(this.calendarContainer)
        this.highlight();
      }
      // check-in but no check-out
      else if(this.checkIn && !this.checkOut  && (selectedDate > this.checkIn || selectedDate < this.checkIn)) {
        if(selectedDate > this.checkIn) {
          this.checkOut = selectedDate;
        }
        else {
          this.checkOut = this.checkIn;
          this.checkIn  = selectedDate;
        }
        this.resetHightlight(this.calendarContainer)
        this.highlight();
      }
      // check-out but no check-in
      else if(!this.checkIn && this.checkOut && (selectedDate > this.checkOut || selectedDate < this.checkOut)) {
        if(selectedDate < this.checkOut) {
          this.checkIn = selectedDate;
        }
        else {
          this.checkIn = this.checkOut;
          this.checkOut  = selectedDate;
        }
        this.resetHightlight(this.calendarContainer)
        this.highlight();
      }
      return;
    }
    
    // user selects dates between already selected check in and check out dates
    if((this.checkIn && this.checkOut) && (this.checkIn < selectedDate && this.checkOut > selectedDate)) {
      var daysBetween = Math.round(Math.abs(this.checkOut - this.checkIn)/(1000 * 60 * 60 * 24)) - 1;
      var halfWay = parseInt(daysBetween/2);
      var tempCheckInDate = new Date(this.checkIn.getFullYear(),this.checkIn.getMonth(),this.checkIn.getDate());
      tempCheckInDate = addDays(halfWay,tempCheckInDate);
      if(selectedDate <= tempCheckInDate) {
        this.checkIn = selectedDate;
      }
      else {
        this.checkOut = selectedDate;
      }
    }
    else {
      if(this.checkIn > selectedDate) {
        this.checkIn = selectedDate;
      }
      if(this.checkOut < selectedDate) {
        this.checkOut = selectedDate;
      }
    }
    this.resetHightlight(this.calendarContainer)
    this.highlight();
}

// do all the highlighting logic if any dates are selected, while we're at it, set instructions also
multiDisplayCalendar.prototype.highlight = function() {
  if(this.checkIn) {
    var hightlightElementId = this.checkIn.getFullYear() + "/" + (this.checkIn.getMonth()+1) + "/" + (this.checkIn.getDate())+"_"+this.calendarId;
    yuiDom.addClass(yuiDom.get(hightlightElementId), "selectedCheckIn");
    yuiDom.removeClass(yuiDom.get(hightlightElementId), "validCheckOut");
    yuiDom.removeClass(yuiDom.get(hightlightElementId), "unselected");
    var calCheckIn = this.checkIn;
    this.handleClass("available","div",this.calendarContainer,function(element){
      var elementIdDate = new Date(element.id.split("_")[0]);
      if(!yuiDom.hasClass(element,"selectedCheckIn")) {
        if(elementIdDate > calCheckIn) {
          yuiDom.addClass(element,"validCheckOut");
        }
        else {
          yuiDom.addClass(element, "unselected");
        }
      }
    });
        // Chinese & Japanese language support
    if(this.userLanguage == "zh" || this.userLanguage == "ja") {
        this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions.innerHTML = moLanguageObjCiCo.checkInText + " - " + moLanguageObjCiCo.calendarShortDayNameArray[this.checkIn.getDay()]
        + ", " + this.checkIn.getFullYear()
        + " " + moLanguageObjCiCo.year
        + " " + moLanguageObjCiCo.calendarShortMonthArray[this.checkIn.getMonth()]
        + " " + this.checkIn.getDate()
        + " " + moLanguageObjCiCo.day;
    }
    else {
        this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions.innerHTML = moLanguageObjCiCo.checkInText + " - " + moLanguageObjCiCo.calendarShortDayNameArray[this.checkIn.getDay()]
        + ', ' + this.checkIn.getDate()
        + ' ' + moLanguageObjCiCo.calendarShortMonthArray[this.checkIn.getMonth()]
        + ' ' + this.checkIn.getFullYear()
    }
    this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions.innerHTML += ' ' + '<a href="javascript:void(0);" target="_self" class="resetDateLink" id="resetCheckInDateLink_'+this.calendarId+'">'+moLanguageObjCiCo.resetSelectedDate+'</a>';    // display check in date in check in div


    yuiEvent.addListener(yuiDom.get("resetCheckInDateLink_"+this.calendarId), "click", this.resetCheckInDate,yuiDom.get("resetCheckInDateLink_"+this.calendarId),this);
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions, "active"); // remove active class from check in div
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions, "checkInInstructionsActive");
    yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions, "active");   // apply active class to check out div
    yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions, "checkOutInstructionsActive");   // apply active class to check out div
  }
  else {
    this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions.innerHTML = moLanguageObjCiCo.pickCheckInText;
  }

  if(this.checkOut) {
    var hightlightElementId = this.checkOut.getFullYear() + "/" + (this.checkOut.getMonth()+1) + "/" + (this.checkOut.getDate())+"_"+this.calendarId;
    yuiDom.addClass(yuiDom.get(hightlightElementId), "selectedCheckOut");
    yuiDom.removeClass(yuiDom.get(hightlightElementId), "validCheckOut");
    yuiDom.removeClass(yuiDom.get(hightlightElementId), "unselected");
    yuiDom.removeClass(yuiDom.get(hightlightElementId), "selectedInterval");
    var calCheckOut = this.checkOut;
    this.handleClass("available","div",this.calendarContainer,function(element){
      var elementIdDate = new Date(element.id.split("_")[0]);
      yuiDom.removeClass(element,"validCheckOut");
      if(elementIdDate > calCheckOut) {
        yuiDom.addClass(element,"unselected");
      }
    });
        // Chinese & Japanese language support 
    if(this.userLanguage == "zh" || this.userLanguage == "ja") {
        this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions.innerHTML = moLanguageObjCiCo.checkOutText + " - "
        + moLanguageObjCiCo.calendarShortDayNameArray[this.checkOut.getDay()]
        + ", " + this.checkOut.getFullYear()
        + " " + moLanguageObjCiCo.year
        + " " + moLanguageObjCiCo.calendarShortMonthArray[this.checkOut.getMonth()]
        + " " + this.checkOut.getDate()
        + " " + moLanguageObjCiCo.day;
    }
    else {
        this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions.innerHTML = moLanguageObjCiCo.checkOutText + " - "
        + moLanguageObjCiCo.calendarShortDayNameArray[this.checkOut.getDay()]
        + ', ' + this.checkOut.getDate()
        + ' ' + moLanguageObjCiCo.calendarShortMonthArray[this.checkOut.getMonth()]
        + ' ' + this.checkOut.getFullYear();
    }
    this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions.innerHTML += ' '
    + '<a href="javascript:void(0);" target="_self" class="resetDateLink" id="resetCheckOutDateLink_'
    + this.calendarId +'">'
    +moLanguageObjCiCo.resetSelectedDate+'</a>';      // display check out date in check in div

    yuiEvent.addListener(yuiDom.get("resetCheckOutDateLink_"+this.calendarId), "click", this.resetCheckOutDate,yuiDom.get("resetCheckOutDateLink_"+this.calendarId),this);
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions, "active"); // remove active class from check in div
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions, "checkOutInstructionsActive"); // remove active class from check in div
  }
  else {
    this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions.innerHTML = moLanguageObjCiCo.pickCheckOutText;
  }

  if(this.checkIn && this.checkOut) {
    yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions, "active");   // apply active class to check out div
    yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions, "submitInstructionsActive");   // apply active class to check out div
    this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.appendChild(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.continueButton);
    var daysBetween = Math.round(Math.abs(this.checkOut - this.checkIn)/(1000 * 60 * 60 * 24)) - 1;
    var  tempDate = new Date(this.checkIn.getFullYear(), this.checkIn.getMonth(), this.checkIn.getDate())
    for(var i = 1; i <= daysBetween; i++) {
      tempDate = addDays(1,tempDate);
      var highlightInterval = tempDate.getFullYear() + "/" + (tempDate.getMonth()+1) + "/" + (tempDate.getDate())+"_"+this.calendarId;
      yuiDom.addClass(yuiDom.get(highlightInterval),"selectedInterval");
      yuiDom.removeClass(yuiDom.get(highlightInterval),"validCheckOut");
      yuiDom.removeClass(yuiDom.get(highlightInterval),"unselected");
    }
  }
  else {
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions, "active");   // apply active class to check out div
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions, "submitInstructionsActive");   // apply active class to check out div
    if(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.continueButton.parentNode == this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions) {
      this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.removeChild(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.continueButton);
    }
    if(!this.checkIn && !this.checkOut) {
      yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions, "active");   // apply active class to check out div
      yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions, "checkInInstructionsActive");   // apply active class to check out div
    }
  }
}

multiDisplayCalendar.prototype.resetHightlight = function(monthElement) {
  this.handleClass("day","div",monthElement,function(element) {
      yuiDom.removeClass(element,"validCheckOut");
      yuiDom.removeClass(element,"selectedCheckIn");
      yuiDom.removeClass(element,"selectedCheckOut");
      yuiDom.removeClass(element,"selectedInterval");
      yuiDom.removeClass(element,"unselected");
  });
}

multiDisplayCalendar.prototype.validateCalendar = function(pFromContinue){
    this.hasError = false;
    this.errorArray = new Array();

    if(this.checkIn){
      if(this.checkIn > this.settings.limitDate){
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[1];
        this.hasError = true;
      }
      if(this.checkIn < this.settings.today){
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[2];
        this.hasError = true;
      }
    }

    if(this.checkIn && this.checkOut){
      if(this.checkOut > this.settings.limitDate && this.checkIn < this.settings.limitDate){
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[1];
        this.hasError = true;
      }
      if(this.getLengthOfStay(this.checkIn, this.checkOut) > this.settings.maxBookDays){
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[0];
        this.hasError = true;
      }
      if(this.checkOut < this.checkIn){
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[3];
        this.hasError = true;
      }
      if(this.checkIn == this.checkOut){
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[4];
        this.hasError = true;
      }
    }


    if(pFromContinue){
      if(!this.checkIn){
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[5];
        this.hasError = true;
      }
      else if(!this.checkOut){
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[6];
        this.hasError = true;
      }
    }
    this.renderErrors(pFromContinue);
}
   
multiDisplayCalendar.prototype.validateSelectedDate = function(selectedDate) {
    var selectedRange = null;

    if(this.checkIn&&!this.checkOut) {
      if(selectedDate > this.checkIn) {
        selectedRange = this.getLengthOfStay(this.checkIn, selectedDate);
      }
      else {
        selectedRange = this.getLengthOfStay(selectedDate, this.checkIn);
      }
      if(selectedRange > this.settings.maxBookDays) {
        this.errorArray = new Array();
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[0];
        this.hasError = true;
        this.renderErrors();
        return;
      }
    }

    if(this.checkOut&&!this.checkIn) {
      if(selectedDate > this.checkOut) {
        selectedRange = this.getLengthOfStay(this.checkOut,selectedDate);
      }
      else {
        selectedRange = this.getLengthOfStay(selectedDate,this.checkOut);
      }
      if(selectedRange>this.settings.maxBookDays) {
        this.errorArray = new Array();
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[0];
        this.hasError = true;
        this.renderErrors();
        return;
      }
    }

    if(this.checkIn && this.checkOut) {
      if(selectedDate < this.checkOut) {
        selectedRange = this.getLengthOfStay(selectedDate, this.checkOut);
      }
      else if(selectedDate > this.checkIn) {
        selectedRange = this.getLengthOfStay(selectedDate, this.checkIn);
      }
      if(selectedRange>this.settings.maxBookDays) {
        this.errorArray = new Array();
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[0];
        this.hasError = true;
        this.renderErrors();
        return;
      }
    }
    this.errorMessageDiv.innerHTML = "";
    this.errorMessageDiv.style.visibility = 'hidden';
    this.hasError = false;
}

multiDisplayCalendar.prototype.renderErrors = function(pFromContinue){
//    this.validateCalendar(pFromContinue);

    if(this.hasError){
        var lsOutput = '';
        for(var i=0; i<this.errorArray.length; i++){
            lsOutput += '<div>' + this.errorArray[i] +' </div>'
        }
        this.errorMessageDiv.innerHTML = lsOutput;
        this.errorMessageDiv.style.visibility = 'visible';
    }
    else{
       this.errorMessageDiv.style.visibility = 'hidden';
       this.errorMessageDiv.innerHTML = '';
    }
}

multiDisplayCalendar.prototype.resetCheckInDate = function(e) {
  this.checkIn = null;
  this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions.innerHTML = moLanguageObjCiCo.pickCheckInText;
  this.resetHightlight(this.calendarContainer);
  this.highlight();
  yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions,"active");
  yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions,"checkInInstructionsActive");
  yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions,"active");
  yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions,"checkOutInstructionsActive");
  yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions,"active");
  yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions,"submitInstructionsActive");
}

multiDisplayCalendar.prototype.resetCheckOutDate = function(e) {
  this.checkOut = null;
  this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions.innerHTML = moLanguageObjCiCo.pickCheckOutText;

  this.resetHightlight(this.calendarContainer);
  this.highlight();
  if(this.checkIn) {
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions,"active");
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions,"checkInInstructionsActive");
    yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions,"active");
    yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions,"checkOutInstructionsActive");
  }
  else {
    yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions,"active");
    yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions,"checkInInstructionsActive");
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions,"active");
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions,"checkOutInstructionsActive");
  }
  yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions,"active");
  yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions,"submitInstructionsActive");
}

multiDisplayCalendar.prototype.resetInstructionDisplay = function() {

  if(!this.checkOut) {
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions,"active");
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions,"checkOutInstructionsActive");
  }
  if(this.checkIn && this.checkOut) {
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions,"active");
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions,"submitInstructionsActive");
    if(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.continueButton.parentNode == this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions) {
      this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.removeChild(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.continueButton);
    }
  }
  yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions,"active");
  yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions,"checkInInstructionsActive");

  this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions.innerHTML = moLanguageObjCiCo.pickCheckInText;
  this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions.innerHTML = moLanguageObjCiCo.pickCheckOutText;

}

multiDisplayCalendar.prototype.reset = function(e) {
    yuiEvent.preventDefault(e);
    this.resetInstructionDisplay(); // !!! important that this comes before object clearing
    this.clearObject();
    this.renderCalDisplay();
}

// Availability Calendar method to clear the calendar object, used in "Reset"
multiDisplayCalendar.prototype.clearObject = function(){
  this.hasError           = null;
  this.errorMessageDiv.innerHTML = "";
  this.errorMessageDiv.style.visibility = 'hidden';
  this.errorArray         = null;
  this.checkIn            = null;
  this.checkOut           = null;
  this.renderedMonths     = {};
}

multiDisplayCalendar.prototype.close = function() {
    this.toggleDisplay();
}

multiDisplayCalendar.prototype.submit = function(e){
    yuiEvent.preventDefault(e);
    this.renderErrors(true);
    if(!this.hasError){
      this.returnFunction(this.checkIn, this.checkOut, true);
      this.close();
    }
}

var calendarMonthHeaderBackground = new Image();
calendarMonthHeaderBackground.src = "/whotels/images/calendar/monthHeaderBackground.gif";
function getFormatedDate(local, theDate) {

	var sDateFormat	= "";



	var sTheMonth	= theDate.getMonth() + 1;

	sTheMonth		= ((sTheMonth) <= 9) ? "0" + sTheMonth : sTheMonth;



	var sTheDay		= theDate.getDate();

	sTheDay			= (sTheDay <= 9) ? "0" + sTheDay : sTheDay;

	var nTheYear	= theDate.getFullYear();





	if (local == "ja" || local == "zh") {

		// FORMAT: YYYY/MM/DD

		//sDateFormat = nTheYear + "/" + sTheMonth + "/" + sTheDay;
		sDateFormat = String(nTheYear).substr(2,2) + "\u5E74" + sTheMonth  + "\u6708" + sTheDay  + "\u65E5";

	} else if ((local == "es") || (local == "fr") || (local == "it") || (local == "pt")) {

		// FORMAT: DD/MM/YYYY

		sDateFormat = sTheDay + "/" + sTheMonth + "/" + nTheYear;

	} else if (local == "de") {
        sDateFormat = sTheDay + "." + sTheMonth + "." + nTheYear;    
    } else {
		// FORMAT: MM/DD/YYYY

		sDateFormat = sTheMonth + "/" + sTheDay + "/" + nTheYear;

	}

	return sDateFormat;

}



function setDateFromString(local, theDate) {
    if(local.length>2) {
        local = local.split("_")[0];
    }
	var theDateObject   = null;
	var theDateArray    = theDate.split("/");
	if (local == "ja" || local=="zh") {
		// FORMAT: YYYY/MM/DD
        theDateArray    = theDate.split(" ");
		//theDateObject = new Date(theDateArray[0].substr(0,4), theDateArray[1].substr(0,2)-1, theDateArray[2].substr(0,2));
		if(theDate != "") {
			theDateObject = new Date("20"+theDate.substr(0,2), theDate.substr(3,2)-1, theDate.substr(6,2));
		}
	} else if ((local == "es") || (local == "fr") || (local == "it") || (local == "pt")) {
		// FORMAT: DD/MM/YYYY
		theDateObject = new Date(theDateArray[2], theDateArray[1]-1, theDateArray[0]);
	} else if (local == "de") {
        theDateArray    = theDate.split(".");
        theDateObject = new Date(theDateArray[2], theDateArray[1]-1, theDateArray[0]);
    } else {
		// FORMAT: MM/DD/YYYY
		theDateObject = new Date(theDateArray[2], theDateArray[0]-1, theDateArray[1]);
	}
	//alert("theDateObject: " + theDateObject);
	if ((theDateObject == "Invalid Date") || (isNaN(theDateObject))) {
		theDateObject = null;
	}
	return theDateObject;
}



/*

This function is necessary because as of now the multiDisplayCalendar.js needs an empty form to process the curent dates

*/

function fnClearFormField(pDate) {

	if ((pDate == "MM/DD/YYYY") || (pDate == "DD/MM/AAAA") || (pDate == "JJ/MM/AAAA") ||(pDate == "GG/MM/AAAA")
        || (pDate == "TT.MM.JJJJ") || (pDate="YY\u5E74MM\u6708DD\u65E5")) {
        pDate = "";
	}
	return pDate;
}

function fnGetDisplayDate(pDateToFormat){
    var lsFormatDate = null;
    if(pDateToFormat){
        var loDate = new Date(pDateToFormat);
        //var lsYear = loDate.getFullYear().toString().substring(2,4);
        var lsYear = loDate.getFullYear();
        var lsMonth = moLanguageObj.calendarShortMonthArray[loDate.getMonth()]
        lsFormatDate = loDate.getDate() + ' ' + lsMonth + ' ' + lsYear;
    }
    return lsFormatDate;
}

function padZero(pNumber) {
  return (pNumber<0 || pNumber>9 ? "" : "0") + pNumber;
}

function fnGetDateDifference(pCIDay, pCODay){
    var loStartDate = new Date(pCIDay);
    var loEndDate = new Date(pCODay);
    var lnDayDiff = Math.round((loEndDate.getTime() - loStartDate.getTime()) / (1000 * 60 * 60 * 24));
    return Math.abs(lnDayDiff);
}

(function (){
    var yuiDom = YAHOO.util.Dom;

    var yuiEvent = YAHOO.util.Event;

    var SearchFormHandler = (function () {
        var searchForm = null;
        var localeCode = "en_US";
        var dateInputs = null;
        var standardInputs = null;
        var loadingText = "Loading...";
        var cityText = "City";
        var self = {
            initialize: function(params) {
                localeCode = params.localeCode || localeCode;
                loadingText = params.loadingText || loadingText;
                cityText = params.cityText || cityText;
                searchForm = yuiDom.get("findAndBookForm");
                yuiEvent.addListener("fnb_closeErrorIcon","click",function() {
                    yuiDom.setStyle("findAndBookForm_errorContainer", "display", "none");
                });

                dateInputs = {
                    arrivalDate: yuiDom.get("fnb_arrivalDate"),
                    departureDate: yuiDom.get("fnb_departureDate")
                };

                if(localeCode == "zh_CN" || localeCode == "ja_JP") {
                    standardInputs = {
                        city: yuiDom.get("fnb_citySelect"),
                        state: yuiDom.get("fnb_stateSelect"),
                        country: yuiDom.get("fnb_countrySelect")
                    };
                    yuiEvent.addListener(standardInputs.country,"change",self.checkState, {countrySelect: standardInputs.country, stateSelect: standardInputs.state, citySelect: standardInputs.city});
                    yuiEvent.addListener(standardInputs.state,"change",self.getCities);
                }
            },
            getCities: function () {
                standardInputs.city.disabled = true;
                yuiConnect.asyncRequest("GET", "/dp/en_US/common/search/get_cities.jsp?country="
                    + standardInputs.country.value
                    + "&state="
                    + (standardInputs.state.selectedIndex > 0 ? standardInputs.state.value : ""),
                    {
                        success: self.populateSelect
                    }
                );
                standardInputs.city.options[0].text = loadingText;
            },
            populateSelect: function (xhr) {
                var selectOptions = xhr.responseXML.getElementsByTagName("city");

                standardInputs.city.options.length = 1;
                standardInputs.city.selectedIndex = 0;
                standardInputs.city.options[0].text = cityText;
                if (selectOptions.length > 0) {
                    standardInputs.city.disabled = false;
                    for (var i = 0; i < selectOptions.length; i++) {
                        var selected = false;
                        standardInputs.city.options[standardInputs.city.options.length] = new Option(selectOptions[i].firstChild.nodeValue, selectOptions[i].getAttribute("en"), selected);
                    }
                }
            },
            updateCountry: function () {

            },
            checkState: function(e, params) {
                if(params.countrySelect.value == "US" || params.countrySelect.value == "CA") {
                    params.stateSelect.disabled = false;
                    params.citySelect.disabled = true;
                }
                else {
                    params.stateSelect.selectedIndex = 1;
                    params.stateSelect.value = "";
                    params.stateSelect.disabled = true;
                    self.getCities();
                }
            },
            validateForm: function (e,searchForm) {
              //  searchForm.resetErrors();
                yuiDom.getElementsByClassName("topError","li","fnb_Errors").forEach(function(errorBlock){
                    yuiDom.setStyle(errorBlock, "display", "none");
                });
                var errors = false;
                if(searchForm.complexSearchField && (searchForm.complexSearchField.value == "" || searchForm.complexSearchField.value == searchForm.complexSearchField.getAttribute("label"))) {
                    yuiDom.setStyle("fnb_searchCriteriaRequiredError", "display", "block");
                    errors = true;
                }
                else if(localeCode == "ja_JP" || localeCode == "zh_CN") {
                     if((standardInputs.country.value == "")) {
                        yuiDom.setStyle("fnb_searchCriteriaRequiredError", "display", "block");
                        errors = true;
                        }
                }
                if ((dateInputs.arrivalDate.value != "" && dateInputs.departureDate.value != "") && (dateInputs.arrivalDate.value != dateFormatString || dateInputs.departureDate.value != dateFormatString)) {
                    var checkIn = new validDate(dateInputs.arrivalDate);
                    var checkOut = new validDate(dateInputs.departureDate);
                    var datesDelta = checkIn.diffDate(checkOut.d);
                    if (!(checkIn.valid) && (!checkOut.valid)) {
                        yuiDom.setStyle("fnb_ciAnddepartureDatesInvalidError", "display", "block");
                        errors = true;
                    }
                    else if (!checkIn.valid) {
                        yuiDom.setStyle("fnb_arrivalDateInvalidError", "display", "block");
                        errors = true;
                    }
                    else if (!checkOut.valid) {
                        yuiDom.setStyle("fnb_departureDateInvalidError", "display", "block");
                        errors = true;
                    }
                    else if ((checkIn.valid) & (checkOut.valid)) {
                        datesDelta = checkIn.diffDate(checkOut.d);
                        var nowDelta = checkIn.diffDate(new Date());
                        if (nowDelta > 0) {

                        }
                        else if (nowDelta < -548) {
                            yuiDom.setStyle("fnb_bookToFarInFutureError", "display", "block");
                            errors = true;
                        }
                        else if (datesDelta < 0) {
                            yuiDom.setStyle("fnb_departureBeforeArrivalError", "display", "block");
                            errors = true;
                        }
                        else if (datesDelta > 90) {
                            yuiDom.setStyle("fnb_maximumLengthStayExceededError", "display", "block");
                            errors = true;
                        }
                        else if (datesDelta < 1) {
                            yuiDom.setStyle("fnb_arrivalEqualsDepartureError", "display", "block");
                            errors = true;
                        }
                    }
                }

                if(errors) {
                    yuiDom.setStyle("findAndBookForm_errorContainer", "display", "block");
                    yuiEvent.stopPropagation(e);
                }
                return !errors;
            }
        };

        return self;
    })();
    YAHOO.namespace("SW.local.SearchFormHandler");
    SW.local.SearchFormHandler = SearchFormHandler;
})();


(function() {
    var yuiDom = YAHOO.util.Dom;

    var yuiEvent = YAHOO.util.Event;

    var DEFAULT_CONFIG = {
        arrivalDateInput: null,
        departureDateInput: null,
        calendarIcon: null,
        localeCode: "en_US",
        dateFormatString: "MM/DD/YYYY"
    };

    function CalendarMaker (config) {

        if(!config.calendarId){
            throw("no calendarId supplied");
        }

        if(!config.arrivalDateInput){
            throw("no arrivalDateInput supplied");
        }

        if(!config.departureDateInput){
            throw("no departureDateInput supplied");
        }

        if(!config.calendarIcon){
            throw("no calendarIcon supplied");
        }

        for(var prop in DEFAULT_CONFIG){
            if(!config.hasOwnProperty(prop)){
                config[prop] = DEFAULT_CONFIG[prop];
            }
        }

        var calendar = null;
        var arrivalDateInput = config.arrivalDateInput;
        var departureDateInput = config.departureDateInput;
        var calendarIcon = config.calendarIcon;
        var localeCode = config.localeCode || localeCode;
        localeCode = localeCode.split("_")[0];
        var dateFormatString = config.dateFormatString || dateFormatString;

        function getArrivalDate () {
            return setDateFromString(localeCode, arrivalDateInput.value);
        }

        function getDepartureDate () {
            return setDateFromString(localeCode, departureDateInput.value);
        }

        function setDates (arrivalDate, departureDate, fromContinue) {
            arrivalDateInput.value = getFormatedDate(localeCode, arrivalDate);
            yuiDom.removeClass(arrivalDateInput, "hasDefaultText");
            departureDateInput.value = getFormatedDate(localeCode, departureDate);
            yuiDom.removeClass(departureDateInput, "hasDefaultText");
            if (!fromContinue) {
                closeCalendar();
            }
        }

        function checkArrivalDateFocus () {
            if (arrivalDateInput.value == dateFormatString) {
                arrivalDateInput.value = "";
                return;
            }
            var checkIn = new validDate(arrivalDateInput);
            if (!checkIn.valid) {
                arrivalDateInput.value = "";
            }
        }

        function checkArrivalDateBlur () {
            var checkIn = new validDate(arrivalDateInput);
            if (checkIn.valid) {
                checkIn.setField();
                var isValid = true;
                if (departureDateInput.value == dateFormatString) {
                    isValid = false;
                }
                var checkOut = validDate(departureDateInput);
                var before;
                if (!isValid) {
                    departureDateInput.value = dateFormatString;
                }
                if (checkOut.valid) {
                    before = (checkIn.diffDate(checkOut.d) <= 0);
                }

                if (departureDateInput.value == dateFormatString) {
                    checkOut.valid = false;
                }
                if ((! (checkOut.valid)) || before) {
                    checkOut.setD(checkIn.d);
                    checkOut.nextDay();
                    checkOut.setField();
                    yuiDom.removeClass(departureDateInput, "hasDefaultText");
                }
            } else {
                arrivalDateInput.value = dateFormatString;
            }
        }

        function checkDepartureDateFocus () {
            if (departureDateInput.value == dateFormatString) {
                departureDateInput.value = "";
                return;
            }
            var checkOut = new validDate(departureDateInput);
            if (!checkOut.valid) {
                departureDateInput.value = "";
            }
        }

        function checkDepartureDateBlur () {
            var checkOut = new validDate(departureDateInput);
            if (checkOut.valid) {
                checkOut.setField();
            } else {
                departureDateInput.value = dateFormatString;
            }
        }

        var self = {
            toggleCalendar: function (e, calendarPos) {
                if(!calendarPos) {
                    var coords = yuiDom.getXY(this);
                    calendarPos = (coords[0] - 450) + "," + (coords[1] + 20);
                }
                calendar.show(this, calendarPos);
                var e = e || window.event;
                e.cancelBubble = true;
                if (e.stopPropagation) e.stopPropagation();
            },
            closeCalendar: function () {
                if (calendar) {
                    if (calendar.display == "block") {
                        calendar.toggleDisplay();
                    }
                }
            }
        };

        calendar = new multiDisplayCalendar(config.calendarId,
            getArrivalDate,
            getDepartureDate,
            setDates, null);

        yuiEvent.addListener(calendarIcon, "click", self.toggleCalendar, config.calendarPos);
        yuiEvent.addListener(arrivalDateInput, "focus", checkArrivalDateFocus);
        yuiEvent.addListener(arrivalDateInput, "blur", checkArrivalDateBlur);
        yuiEvent.addListener(departureDateInput, "focus", checkDepartureDateFocus);
        yuiEvent.addListener(departureDateInput, "blur", checkDepartureDateBlur);

        return self;
    }

    SW.local.CalendarMaker = function(config){
        return new CalendarMaker(config);
    };

    YAHOO.namespace("SW.local.CalendarMaker");
})();


//SAMPLE USE
// see: /common/js/search/result_map.js
//function ajax_onSubmit() {
//	address = encodeURI(document.moveMap.address.value);
//	addressAjax = new ajax();
//	addressAjax.setURL("/ajax/strutsname");
//	addressAjax.addParameter("name", "value");
//	addressAjax.setSuccessHandler(localFunctionThatTakesAReq);
//	addressAjax.setFailureHandler(localFunctionThatTakesAReq);
//	addressAjax.execute();
//}

function ajax() {

    var req;

    var debugMode = false;
    if (location.search.indexOf("debugAjax") > -1) {
        debugMode = true;
    }
    this.setDebugMode = function(b) {
		debugMode = b;
	}

    this.defaultErrorHandler = function(req){
		window.alert("An Error Occured");
	}

	this.defaultSuccessHandler = function(req){
		window.alert("Request Complete");
	}

	this.defaultLoadingHandler = function(req){
	}

	var url = "";
	this.setURL = function(s) {
		this.url = s;
	}

	//parameters should be stored in an array and then added during request creation
    var parameters = new Array();
    this.addParameter = function(n,v) {
        nVP = new nameValuePair(n,v);
        parameters[parameters.length] = nVP;
	}
    this.buildQueryString = function() {
        var queryString = "";
        for (i = 0; i < parameters.length; i++) {
            if (i > 0) { queryString = queryString + "&"; }
            nVP = parameters[i];
            queryString = queryString + nVP.name + "=" + nVP.value;
        }
        return queryString;
    }

    var successHandler = this.defaultSuccessHandler;
	this.setSuccessHandler = function(f) {
		successHandler = f;
	}

	var failureHandler = this.defaultErrorHandler;
	this.setFailureHandler = function(f) {
		failureHandler = f;
	}
	var loadingHandler = this.defaultLoadingHandler;
	this.setLoadingHandler = function(f) {
		loadingHandler = f;
	}
	var timeStampURL = true;
	this.setTimeStampURL = function(b) {
		timeStampURL = b;
	}
	this.execute = function() {

		if (this.url=="") { window.alert("URL MUST BE SET");  return false;}

		if (timeStampURL) {
			this.addParameter("timestamp", new Date().getTime());
		}

		requestUrl = this.url
		if (this.queryString != "") {
			requestUrl = requestUrl + "?" + this.buildQueryString();
		}

		if (debugMode) {
			window.open(requestUrl, "AJAX_WINDOW", 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=600,height=600');
		}
		// branch for native XMLHttpRequest object
		if (window.XMLHttpRequest) {
			req = new XMLHttpRequest();
			req.onreadystatechange = this.processRequestChange;
			req.open("GET", requestUrl, true);
			req.send(null);
		// branch for IE/Windows ActiveX version
		} else if (window.ActiveXObject) {
			req = new ActiveXObject("Microsoft.XMLHTTP");
			if (req) {
				req.onreadystatechange = this.processRequestChange;
				req.open("GET", requestUrl, true);
				req.send();
			}
		// The browser cannot support dynamic loading - say so
		} else {
			window.alert('Feature Not Supported By Your Browser');
		}
	}
	this.processRequestChange = function() {
		if (debugMode) {
			//window.alert("Request readyState:" +req.readyState);
		}
		if (req.readyState == 1) {
			loadingHandler(req);
		}
		// only if req shows "loaded"
		if (req.readyState == 4) {
			// only if "OK"
			if (req.status == 200) {
				successHandler(req);
			} else {
				failureHandler(req);
			}
		}
	}
}

function nameValuePair(n, v) {
    this.name = n;
    this.value = v;
}

function getSubNodeValue(node, tagname) {
	subNode = node.getElementsByTagName(tagname);
	if (subNode[0] != null) {
		if(subNode[0].firstChild != null) {
			return subNode[0].firstChild.nodeValue;
		}
	}
	return "";
}







/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var b=arguments,g=null,e,c,f;for(e=0;e<b.length;e=e+1){f=(""+b[e]).split(".");g=YAHOO;for(c=(f[0]=="YAHOO")?1:0;c<f.length;c=c+1){g[f[c]]=g[f[c]]||{};g=g[f[c]];}}return g;};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,f,e){var k=YAHOO.env.modules,c,j,h,g,d;if(!k[a]){k[a]={versions:[],builds:[]};}c=k[a];j=e.version;h=e.build;g=YAHOO.env.listeners;c.name=a;c.version=j;c.build=h;c.versions.push(j);c.builds.push(h);c.mainClass=f;for(d=0;d<g.length;d=d+1){g[d](c);}if(f){f.VERSION=j;f.BUILD=h;}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.parseUA=function(d){var e=function(i){var j=0;return parseFloat(i.replace(/\./g,function(){return(j++==1)?"":".";}));},h=navigator,g={ie:0,opera:0,gecko:0,webkit:0,chrome:0,mobile:null,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,webos:0,caja:h&&h.cajaVersion,secure:false,os:null},c=d||(navigator&&navigator.userAgent),f=window&&window.location,b=f&&f.href,a;g.secure=b&&(b.toLowerCase().indexOf("https")===0);if(c){if((/windows|win32/i).test(c)){g.os="windows";}else{if((/macintosh/i).test(c)){g.os="macintosh";}else{if((/rhino/i).test(c)){g.os="rhino";}}}if((/KHTML/).test(c)){g.webkit=1;}a=c.match(/AppleWebKit\/([^\s]*)/);if(a&&a[1]){g.webkit=e(a[1]);if(/ Mobile\//.test(c)){g.mobile="Apple";a=c.match(/OS ([^\s]*)/);if(a&&a[1]){a=e(a[1].replace("_","."));}g.ios=a;g.ipad=g.ipod=g.iphone=0;a=c.match(/iPad|iPod|iPhone/);if(a&&a[0]){g[a[0].toLowerCase()]=g.ios;}}else{a=c.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);if(a){g.mobile=a[0];}if(/webOS/.test(c)){g.mobile="WebOS";a=c.match(/webOS\/([^\s]*);/);if(a&&a[1]){g.webos=e(a[1]);}}if(/ Android/.test(c)){g.mobile="Android";a=c.match(/Android ([^\s]*);/);if(a&&a[1]){g.android=e(a[1]);}}}a=c.match(/Chrome\/([^\s]*)/);if(a&&a[1]){g.chrome=e(a[1]);}else{a=c.match(/AdobeAIR\/([^\s]*)/);if(a){g.air=a[0];}}}if(!g.webkit){a=c.match(/Opera[\s\/]([^\s]*)/);if(a&&a[1]){g.opera=e(a[1]);a=c.match(/Version\/([^\s]*)/);if(a&&a[1]){g.opera=e(a[1]);}a=c.match(/Opera Mini[^;]*/);if(a){g.mobile=a[0];}}else{a=c.match(/MSIE\s([^;]*)/);if(a&&a[1]){g.ie=e(a[1]);}else{a=c.match(/Gecko\/([^\s]*)/);if(a){g.gecko=1;a=c.match(/rv:([^\s\)]*)/);if(a&&a[1]){g.gecko=e(a[1]);}}}}}}return g;};YAHOO.env.ua=YAHOO.env.parseUA();(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++){if(a[c]==b){d=false;break;}}if(d){a.push(b);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var f=YAHOO.lang,a=Object.prototype,c="[object Array]",h="[object Function]",i="[object Object]",b=[],g={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;","`":"&#x60;"},d=["toString","valueOf"],e={isArray:function(j){return a.toString.apply(j)===c;},isBoolean:function(j){return typeof j==="boolean";},isFunction:function(j){return(typeof j==="function")||a.toString.apply(j)===h;},isNull:function(j){return j===null;},isNumber:function(j){return typeof j==="number"&&isFinite(j);},isObject:function(j){return(j&&(typeof j==="object"||f.isFunction(j)))||false;},isString:function(j){return typeof j==="string";},isUndefined:function(j){return typeof j==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(l,k){var j,n,m;for(j=0;j<d.length;j=j+1){n=d[j];m=k[n];if(f.isFunction(m)&&m!=a[n]){l[n]=m;}}}:function(){},escapeHTML:function(j){return j.replace(/[&<>"'\/`]/g,function(k){return g[k];});},extend:function(m,n,l){if(!n||!m){throw new Error("extend failed, please check that "+"all dependencies are included.");}var k=function(){},j;k.prototype=n.prototype;m.prototype=new k();m.prototype.constructor=m;m.superclass=n.prototype;if(n.prototype.constructor==a.constructor){n.prototype.constructor=n;}if(l){for(j in l){if(f.hasOwnProperty(l,j)){m.prototype[j]=l[j];}}f._IEEnumFix(m.prototype,l);}},augmentObject:function(n,m){if(!m||!n){throw new Error("Absorb failed, verify dependencies.");}var j=arguments,l,o,k=j[2];if(k&&k!==true){for(l=2;l<j.length;l=l+1){n[j[l]]=m[j[l]];}}else{for(o in m){if(k||!(o in n)){n[o]=m[o];}}f._IEEnumFix(n,m);}return n;},augmentProto:function(m,l){if(!l||!m){throw new Error("Augment failed, verify dependencies.");}var j=[m.prototype,l.prototype],k;for(k=2;k<arguments.length;k=k+1){j.push(arguments[k]);}f.augmentObject.apply(this,j);return m;},dump:function(j,p){var l,n,r=[],t="{...}",k="f(){...}",q=", ",m=" => ";if(!f.isObject(j)){return j+"";}else{if(j instanceof Date||("nodeType" in j&&"tagName" in j)){return j;}else{if(f.isFunction(j)){return k;}}}p=(f.isNumber(p))?p:3;if(f.isArray(j)){r.push("[");for(l=0,n=j.length;l<n;l=l+1){if(f.isObject(j[l])){r.push((p>0)?f.dump(j[l],p-1):t);}else{r.push(j[l]);}r.push(q);}if(r.length>1){r.pop();}r.push("]");}else{r.push("{");for(l in j){if(f.hasOwnProperty(j,l)){r.push(l+m);if(f.isObject(j[l])){r.push((p>0)?f.dump(j[l],p-1):t);}else{r.push(j[l]);}r.push(q);}}if(r.length>1){r.pop();}r.push("}");}return r.join("");},substitute:function(x,y,E,l){var D,C,B,G,t,u,F=[],p,z=x.length,A="dump",r=" ",q="{",m="}",n,w;for(;;){D=x.lastIndexOf(q,z);if(D<0){break;}C=x.indexOf(m,D);if(D+1>C){break;}p=x.substring(D+1,C);G=p;u=null;B=G.indexOf(r);if(B>-1){u=G.substring(B+1);G=G.substring(0,B);}t=y[G];if(E){t=E(G,t,u);}if(f.isObject(t)){if(f.isArray(t)){t=f.dump(t,parseInt(u,10));}else{u=u||"";n=u.indexOf(A);if(n>-1){u=u.substring(4);}w=t.toString();if(w===i||n>-1){t=f.dump(t,parseInt(u,10));}else{t=w;}}}else{if(!f.isString(t)&&!f.isNumber(t)){t="~-"+F.length+"-~";F[F.length]=p;}}x=x.substring(0,D)+t+x.substring(C+1);if(l===false){z=D-1;}}for(D=F.length-1;D>=0;D=D-1){x=x.replace(new RegExp("~-"+D+"-~"),"{"+F[D]+"}","g");}return x;},trim:function(j){try{return j.replace(/^\s+|\s+$/g,"");}catch(k){return j;
}},merge:function(){var n={},k=arguments,j=k.length,m;for(m=0;m<j;m=m+1){f.augmentObject(n,k[m],true);}return n;},later:function(t,k,u,n,p){t=t||0;k=k||{};var l=u,s=n,q,j;if(f.isString(u)){l=k[u];}if(!l){throw new TypeError("method undefined");}if(!f.isUndefined(n)&&!f.isArray(s)){s=[n];}q=function(){l.apply(k,s||b);};j=(p)?setInterval(q,t):setTimeout(q,t);return{interval:p,cancel:function(){if(this.interval){clearInterval(j);}else{clearTimeout(j);}}};},isValue:function(j){return(f.isObject(j)||f.isString(j)||f.isNumber(j)||f.isBoolean(j));}};f.hasOwnProperty=(a.hasOwnProperty)?function(j,k){return j&&j.hasOwnProperty&&j.hasOwnProperty(k);}:function(j,k){return !f.isUndefined(j[k])&&j.constructor.prototype[k]!==j[k];};e.augmentObject(f,e,true);YAHOO.util.Lang=f;f.augment=f.augmentProto;YAHOO.augment=f.augmentProto;YAHOO.extend=f.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.9.0",build:"2800"});(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var e=YAHOO.util,k=YAHOO.lang,L=YAHOO.env.ua,a=YAHOO.lang.trim,B={},F={},m=/^t(?:able|d|h)$/i,w=/color$/i,j=window.document,v=j.documentElement,C="ownerDocument",M="defaultView",U="documentElement",S="compatMode",z="offsetLeft",o="offsetTop",T="offsetParent",x="parentNode",K="nodeType",c="tagName",n="scrollLeft",H="scrollTop",p="getBoundingClientRect",V="getComputedStyle",y="currentStyle",l="CSS1Compat",A="BackCompat",E="class",f="className",i="",b=" ",R="(?:^|\\s)",J="(?= |$)",t="g",O="position",D="fixed",u="relative",I="left",N="top",Q="medium",P="borderLeftWidth",q="borderTopWidth",d=L.opera,h=L.webkit,g=L.gecko,s=L.ie;e.Dom={CUSTOM_ATTRIBUTES:(!v.hasAttribute)?{"for":"htmlFor","class":f}:{"htmlFor":"for","className":E},DOT_ATTRIBUTES:{checked:true},get:function(aa){var ac,X,ab,Z,W,G,Y=null;if(aa){if(typeof aa=="string"||typeof aa=="number"){ac=aa+"";aa=j.getElementById(aa);G=(aa)?aa.attributes:null;if(aa&&G&&G.id&&G.id.value===ac){return aa;}else{if(aa&&j.all){aa=null;X=j.all[ac];if(X&&X.length){for(Z=0,W=X.length;Z<W;++Z){if(X[Z].id===ac){return X[Z];}}}}}}else{if(e.Element&&aa instanceof e.Element){aa=aa.get("element");}else{if(!aa.nodeType&&"length" in aa){ab=[];for(Z=0,W=aa.length;Z<W;++Z){ab[ab.length]=e.Dom.get(aa[Z]);}aa=ab;}}}Y=aa;}return Y;},getComputedStyle:function(G,W){if(window[V]){return G[C][M][V](G,null)[W];}else{if(G[y]){return e.Dom.IE_ComputedStyle.get(G,W);}}},getStyle:function(G,W){return e.Dom.batch(G,e.Dom._getStyle,W);},_getStyle:function(){if(window[V]){return function(G,Y){Y=(Y==="float")?Y="cssFloat":e.Dom._toCamel(Y);var X=G.style[Y],W;if(!X){W=G[C][M][V](G,null);if(W){X=W[Y];}}return X;};}else{if(v[y]){return function(G,Y){var X;switch(Y){case"opacity":X=100;try{X=G.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(Z){try{X=G.filters("alpha").opacity;}catch(W){}}return X/100;case"float":Y="styleFloat";default:Y=e.Dom._toCamel(Y);X=G[y]?G[y][Y]:null;return(G.style[Y]||X);}};}}}(),setStyle:function(G,W,X){e.Dom.batch(G,e.Dom._setStyle,{prop:W,val:X});},_setStyle:function(){if(!window.getComputedStyle&&j.documentElement.currentStyle){return function(W,G){var X=e.Dom._toCamel(G.prop),Y=G.val;if(W){switch(X){case"opacity":if(Y===""||Y===null||Y===1){W.style.removeAttribute("filter");}else{if(k.isString(W.style.filter)){W.style.filter="alpha(opacity="+Y*100+")";if(!W[y]||!W[y].hasLayout){W.style.zoom=1;}}}break;case"float":X="styleFloat";default:W.style[X]=Y;}}else{}};}else{return function(W,G){var X=e.Dom._toCamel(G.prop),Y=G.val;if(W){if(X=="float"){X="cssFloat";}W.style[X]=Y;}else{}};}}(),getXY:function(G){return e.Dom.batch(G,e.Dom._getXY);},_canPosition:function(G){return(e.Dom._getStyle(G,"display")!=="none"&&e.Dom._inDoc(G));},_getXY:function(W){var X,G,Z,ab,Y,aa,ac=Math.round,ad=false;if(e.Dom._canPosition(W)){Z=W[p]();ab=W[C];X=e.Dom.getDocumentScrollLeft(ab);G=e.Dom.getDocumentScrollTop(ab);ad=[Z[I],Z[N]];if(Y||aa){ad[0]-=aa;ad[1]-=Y;}if((G||X)){ad[0]+=X;ad[1]+=G;}ad[0]=ac(ad[0]);ad[1]=ac(ad[1]);}else{}return ad;},getX:function(G){var W=function(X){return e.Dom.getXY(X)[0];};return e.Dom.batch(G,W,e.Dom,true);},getY:function(G){var W=function(X){return e.Dom.getXY(X)[1];};return e.Dom.batch(G,W,e.Dom,true);},setXY:function(G,X,W){e.Dom.batch(G,e.Dom._setXY,{pos:X,noRetry:W});},_setXY:function(G,Z){var aa=e.Dom._getStyle(G,O),Y=e.Dom.setStyle,ad=Z.pos,W=Z.noRetry,ab=[parseInt(e.Dom.getComputedStyle(G,I),10),parseInt(e.Dom.getComputedStyle(G,N),10)],ac,X;ac=e.Dom._getXY(G);if(!ad||ac===false){return false;}if(aa=="static"){aa=u;Y(G,O,aa);}if(isNaN(ab[0])){ab[0]=(aa==u)?0:G[z];}if(isNaN(ab[1])){ab[1]=(aa==u)?0:G[o];}if(ad[0]!==null){Y(G,I,ad[0]-ac[0]+ab[0]+"px");}if(ad[1]!==null){Y(G,N,ad[1]-ac[1]+ab[1]+"px");}if(!W){X=e.Dom._getXY(G);if((ad[0]!==null&&X[0]!=ad[0])||(ad[1]!==null&&X[1]!=ad[1])){e.Dom._setXY(G,{pos:ad,noRetry:true});}}},setX:function(W,G){e.Dom.setXY(W,[G,null]);},setY:function(G,W){e.Dom.setXY(G,[null,W]);},getRegion:function(G){var W=function(X){var Y=false;if(e.Dom._canPosition(X)){Y=e.Region.getRegion(X);}else{}return Y;};return e.Dom.batch(G,W,e.Dom,true);},getClientWidth:function(){return e.Dom.getViewportWidth();},getClientHeight:function(){return e.Dom.getViewportHeight();},getElementsByClassName:function(ab,af,ac,ae,X,ad){af=af||"*";ac=(ac)?e.Dom.get(ac):null||j;if(!ac){return[];}var W=[],G=ac.getElementsByTagName(af),Z=e.Dom.hasClass;for(var Y=0,aa=G.length;Y<aa;++Y){if(Z(G[Y],ab)){W[W.length]=G[Y];}}if(ae){e.Dom.batch(W,ae,X,ad);}return W;},hasClass:function(W,G){return e.Dom.batch(W,e.Dom._hasClass,G);},_hasClass:function(X,W){var G=false,Y;if(X&&W){Y=e.Dom._getAttribute(X,f)||i;if(Y){Y=Y.replace(/\s+/g,b);}if(W.exec){G=W.test(Y);}else{G=W&&(b+Y+b).indexOf(b+W+b)>-1;}}else{}return G;},addClass:function(W,G){return e.Dom.batch(W,e.Dom._addClass,G);},_addClass:function(X,W){var G=false,Y;if(X&&W){Y=e.Dom._getAttribute(X,f)||i;if(!e.Dom._hasClass(X,W)){e.Dom.setAttribute(X,f,a(Y+b+W));G=true;}}else{}return G;},removeClass:function(W,G){return e.Dom.batch(W,e.Dom._removeClass,G);},_removeClass:function(Y,X){var W=false,aa,Z,G;if(Y&&X){aa=e.Dom._getAttribute(Y,f)||i;e.Dom.setAttribute(Y,f,aa.replace(e.Dom._getClassRegex(X),i));Z=e.Dom._getAttribute(Y,f);if(aa!==Z){e.Dom.setAttribute(Y,f,a(Z));W=true;if(e.Dom._getAttribute(Y,f)===""){G=(Y.hasAttribute&&Y.hasAttribute(E))?E:f;Y.removeAttribute(G);}}}else{}return W;},replaceClass:function(X,W,G){return e.Dom.batch(X,e.Dom._replaceClass,{from:W,to:G});},_replaceClass:function(Y,X){var W,ab,aa,G=false,Z;if(Y&&X){ab=X.from;aa=X.to;if(!aa){G=false;}else{if(!ab){G=e.Dom._addClass(Y,X.to);}else{if(ab!==aa){Z=e.Dom._getAttribute(Y,f)||i;W=(b+Z.replace(e.Dom._getClassRegex(ab),b+aa).replace(/\s+/g,b)).split(e.Dom._getClassRegex(aa));W.splice(1,0,b+aa);e.Dom.setAttribute(Y,f,a(W.join(i)));G=true;}}}}else{}return G;},generateId:function(G,X){X=X||"yui-gen";var W=function(Y){if(Y&&Y.id){return Y.id;}var Z=X+YAHOO.env._id_counter++;
if(Y){if(Y[C]&&Y[C].getElementById(Z)){return e.Dom.generateId(Y,Z+X);}Y.id=Z;}return Z;};return e.Dom.batch(G,W,e.Dom,true)||W.apply(e.Dom,arguments);},isAncestor:function(W,X){W=e.Dom.get(W);X=e.Dom.get(X);var G=false;if((W&&X)&&(W[K]&&X[K])){if(W.contains&&W!==X){G=W.contains(X);}else{if(W.compareDocumentPosition){G=!!(W.compareDocumentPosition(X)&16);}}}else{}return G;},inDocument:function(G,W){return e.Dom._inDoc(e.Dom.get(G),W);},_inDoc:function(W,X){var G=false;if(W&&W[c]){X=X||W[C];G=e.Dom.isAncestor(X[U],W);}else{}return G;},getElementsBy:function(W,af,ab,ad,X,ac,ae){af=af||"*";ab=(ab)?e.Dom.get(ab):null||j;var aa=(ae)?null:[],G;if(ab){G=ab.getElementsByTagName(af);for(var Y=0,Z=G.length;Y<Z;++Y){if(W(G[Y])){if(ae){aa=G[Y];break;}else{aa[aa.length]=G[Y];}}}if(ad){e.Dom.batch(aa,ad,X,ac);}}return aa;},getElementBy:function(X,G,W){return e.Dom.getElementsBy(X,G,W,null,null,null,true);},batch:function(X,ab,aa,Z){var Y=[],W=(Z)?aa:null;X=(X&&(X[c]||X.item))?X:e.Dom.get(X);if(X&&ab){if(X[c]||X.length===undefined){return ab.call(W,X,aa);}for(var G=0;G<X.length;++G){Y[Y.length]=ab.call(W||X[G],X[G],aa);}}else{return false;}return Y;},getDocumentHeight:function(){var W=(j[S]!=l||h)?j.body.scrollHeight:v.scrollHeight,G=Math.max(W,e.Dom.getViewportHeight());return G;},getDocumentWidth:function(){var W=(j[S]!=l||h)?j.body.scrollWidth:v.scrollWidth,G=Math.max(W,e.Dom.getViewportWidth());return G;},getViewportHeight:function(){var G=self.innerHeight,W=j[S];if((W||s)&&!d){G=(W==l)?v.clientHeight:j.body.clientHeight;}return G;},getViewportWidth:function(){var G=self.innerWidth,W=j[S];if(W||s){G=(W==l)?v.clientWidth:j.body.clientWidth;}return G;},getAncestorBy:function(G,W){while((G=G[x])){if(e.Dom._testElement(G,W)){return G;}}return null;},getAncestorByClassName:function(W,G){W=e.Dom.get(W);if(!W){return null;}var X=function(Y){return e.Dom.hasClass(Y,G);};return e.Dom.getAncestorBy(W,X);},getAncestorByTagName:function(W,G){W=e.Dom.get(W);if(!W){return null;}var X=function(Y){return Y[c]&&Y[c].toUpperCase()==G.toUpperCase();};return e.Dom.getAncestorBy(W,X);},getPreviousSiblingBy:function(G,W){while(G){G=G.previousSibling;if(e.Dom._testElement(G,W)){return G;}}return null;},getPreviousSibling:function(G){G=e.Dom.get(G);if(!G){return null;}return e.Dom.getPreviousSiblingBy(G);},getNextSiblingBy:function(G,W){while(G){G=G.nextSibling;if(e.Dom._testElement(G,W)){return G;}}return null;},getNextSibling:function(G){G=e.Dom.get(G);if(!G){return null;}return e.Dom.getNextSiblingBy(G);},getFirstChildBy:function(G,X){var W=(e.Dom._testElement(G.firstChild,X))?G.firstChild:null;return W||e.Dom.getNextSiblingBy(G.firstChild,X);},getFirstChild:function(G,W){G=e.Dom.get(G);if(!G){return null;}return e.Dom.getFirstChildBy(G);},getLastChildBy:function(G,X){if(!G){return null;}var W=(e.Dom._testElement(G.lastChild,X))?G.lastChild:null;return W||e.Dom.getPreviousSiblingBy(G.lastChild,X);},getLastChild:function(G){G=e.Dom.get(G);return e.Dom.getLastChildBy(G);},getChildrenBy:function(W,Y){var X=e.Dom.getFirstChildBy(W,Y),G=X?[X]:[];e.Dom.getNextSiblingBy(X,function(Z){if(!Y||Y(Z)){G[G.length]=Z;}return false;});return G;},getChildren:function(G){G=e.Dom.get(G);if(!G){}return e.Dom.getChildrenBy(G);},getDocumentScrollLeft:function(G){G=G||j;return Math.max(G[U].scrollLeft,G.body.scrollLeft);},getDocumentScrollTop:function(G){G=G||j;return Math.max(G[U].scrollTop,G.body.scrollTop);},insertBefore:function(W,G){W=e.Dom.get(W);G=e.Dom.get(G);if(!W||!G||!G[x]){return null;}return G[x].insertBefore(W,G);},insertAfter:function(W,G){W=e.Dom.get(W);G=e.Dom.get(G);if(!W||!G||!G[x]){return null;}if(G.nextSibling){return G[x].insertBefore(W,G.nextSibling);}else{return G[x].appendChild(W);}},getClientRegion:function(){var X=e.Dom.getDocumentScrollTop(),W=e.Dom.getDocumentScrollLeft(),Y=e.Dom.getViewportWidth()+W,G=e.Dom.getViewportHeight()+X;return new e.Region(X,Y,G,W);},setAttribute:function(W,G,X){e.Dom.batch(W,e.Dom._setAttribute,{attr:G,val:X});},_setAttribute:function(X,W){var G=e.Dom._toCamel(W.attr),Y=W.val;if(X&&X.setAttribute){if(e.Dom.DOT_ATTRIBUTES[G]&&X.tagName&&X.tagName!="BUTTON"){X[G]=Y;}else{G=e.Dom.CUSTOM_ATTRIBUTES[G]||G;X.setAttribute(G,Y);}}else{}},getAttribute:function(W,G){return e.Dom.batch(W,e.Dom._getAttribute,G);},_getAttribute:function(W,G){var X;G=e.Dom.CUSTOM_ATTRIBUTES[G]||G;if(e.Dom.DOT_ATTRIBUTES[G]){X=W[G];}else{if(W&&"getAttribute" in W){if(/^(?:href|src)$/.test(G)){X=W.getAttribute(G,2);}else{X=W.getAttribute(G);}}else{}}return X;},_toCamel:function(W){var X=B;function G(Y,Z){return Z.toUpperCase();}return X[W]||(X[W]=W.indexOf("-")===-1?W:W.replace(/-([a-z])/gi,G));},_getClassRegex:function(W){var G;if(W!==undefined){if(W.exec){G=W;}else{G=F[W];if(!G){W=W.replace(e.Dom._patterns.CLASS_RE_TOKENS,"\\$1");W=W.replace(/\s+/g,b);G=F[W]=new RegExp(R+W+J,t);}}}return G;},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}\\])/g},_testElement:function(G,W){return G&&G[K]==1&&(!W||W(G));},_calcBorders:function(X,Y){var W=parseInt(e.Dom[V](X,q),10)||0,G=parseInt(e.Dom[V](X,P),10)||0;if(g){if(m.test(X[c])){W=0;G=0;}}Y[0]+=G;Y[1]+=W;return Y;}};var r=e.Dom[V];if(L.opera){e.Dom[V]=function(W,G){var X=r(W,G);if(w.test(G)){X=e.Dom.Color.toRGB(X);}return X;};}if(L.webkit){e.Dom[V]=function(W,G){var X=r(W,G);if(X==="rgba(0, 0, 0, 0)"){X="transparent";}return X;};}if(L.ie&&L.ie>=8){e.Dom.DOT_ATTRIBUTES.type=true;}})();YAHOO.util.Region=function(d,e,a,c){this.top=d;this.y=d;this[1]=d;this.right=e;this.bottom=a;this.left=c;this.x=c;this[0]=c;this.width=this.right-this.left;this.height=this.bottom-this.top;};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(f){var d=Math.max(this.top,f.top),e=Math.min(this.right,f.right),a=Math.min(this.bottom,f.bottom),c=Math.max(this.left,f.left);
if(a>=d&&e>=c){return new YAHOO.util.Region(d,e,a,c);}else{return null;}};YAHOO.util.Region.prototype.union=function(f){var d=Math.min(this.top,f.top),e=Math.max(this.right,f.right),a=Math.max(this.bottom,f.bottom),c=Math.min(this.left,f.left);return new YAHOO.util.Region(d,e,a,c);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(e){var g=YAHOO.util.Dom.getXY(e),d=g[1],f=g[0]+e.offsetWidth,a=g[1]+e.offsetHeight,c=g[0];return new YAHOO.util.Region(d,f,a,c);};YAHOO.util.Point=function(a,b){if(YAHOO.lang.isArray(a)){b=a[1];a=a[0];}YAHOO.util.Point.superclass.constructor.call(this,b,a,b,a);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var b=YAHOO.util,a="clientTop",f="clientLeft",j="parentNode",k="right",w="hasLayout",i="px",u="opacity",l="auto",d="borderLeftWidth",g="borderTopWidth",p="borderRightWidth",v="borderBottomWidth",s="visible",q="transparent",n="height",e="width",h="style",t="currentStyle",r=/^width|height$/,o=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,m={get:function(x,z){var y="",A=x[t][z];if(z===u){y=b.Dom.getStyle(x,u);}else{if(!A||(A.indexOf&&A.indexOf(i)>-1)){y=A;}else{if(b.Dom.IE_COMPUTED[z]){y=b.Dom.IE_COMPUTED[z](x,z);}else{if(o.test(A)){y=b.Dom.IE.ComputedStyle.getPixel(x,z);}else{y=A;}}}}return y;},getOffset:function(z,E){var B=z[t][E],x=E.charAt(0).toUpperCase()+E.substr(1),C="offset"+x,y="pixel"+x,A="",D;if(B==l){D=z[C];if(D===undefined){A=0;}A=D;if(r.test(E)){z[h][E]=D;if(z[C]>D){A=D-(z[C]-D);}z[h][E]=l;}}else{if(!z[h][y]&&!z[h][E]){z[h][E]=B;}A=z[h][y];}return A+i;},getBorderWidth:function(x,z){var y=null;if(!x[t][w]){x[h].zoom=1;}switch(z){case g:y=x[a];break;case v:y=x.offsetHeight-x.clientHeight-x[a];break;case d:y=x[f];break;case p:y=x.offsetWidth-x.clientWidth-x[f];break;}return y+i;},getPixel:function(y,x){var A=null,B=y[t][k],z=y[t][x];y[h][k]=z;A=y[h].pixelRight;y[h][k]=B;return A+i;},getMargin:function(y,x){var z;if(y[t][x]==l){z=0+i;}else{z=b.Dom.IE.ComputedStyle.getPixel(y,x);}return z;},getVisibility:function(y,x){var z;while((z=y[t])&&z[x]=="inherit"){y=y[j];}return(z)?z[x]:s;},getColor:function(y,x){return b.Dom.Color.toRGB(y[t][x])||q;},getBorderColor:function(y,x){var z=y[t],A=z[x]||z.color;return b.Dom.Color.toRGB(b.Dom.Color.toHex(A));}},c={};c.top=c.right=c.bottom=c.left=c[e]=c[n]=m.getOffset;c.color=m.getColor;c[g]=c[p]=c[v]=c[d]=m.getBorderWidth;c.marginTop=c.marginRight=c.marginBottom=c.marginLeft=m.getMargin;c.visibility=m.getVisibility;c.borderColor=c.borderTopColor=c.borderRightColor=c.borderBottomColor=c.borderLeftColor=m.getBorderColor;b.Dom.IE_COMPUTED=c;b.Dom.IE_ComputedStyle=m;})();(function(){var c="toString",a=parseInt,b=RegExp,d=YAHOO.util;d.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(e){if(!d.Dom.Color.re_RGB.test(e)){e=d.Dom.Color.toHex(e);}if(d.Dom.Color.re_hex.exec(e)){e="rgb("+[a(b.$1,16),a(b.$2,16),a(b.$3,16)].join(", ")+")";}return e;},toHex:function(f){f=d.Dom.Color.KEYWORDS[f]||f;if(d.Dom.Color.re_RGB.exec(f)){f=[Number(b.$1).toString(16),Number(b.$2).toString(16),Number(b.$3).toString(16)];for(var e=0;e<f.length;e++){if(f[e].length<2){f[e]="0"+f[e];}}f=f.join("");}if(f.length<6){f=f.replace(d.Dom.Color.re_hex3,"$1$1");}if(f!=="transparent"&&f.indexOf("#")<0){f="#"+f;}return f.toUpperCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.9.0",build:"2800"});YAHOO.util.CustomEvent=function(d,c,b,a,e){this.type=d;this.scope=c||window;this.silent=b;this.fireOnce=e;this.fired=false;this.firedWith=null;this.signature=a||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var f="_YUICEOnSubscribe";if(d!==f){this.subscribeEvent=new YAHOO.util.CustomEvent(f,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(b,c,d){if(!b){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(b,c,d);}var a=new YAHOO.util.Subscriber(b,c,d);if(this.fireOnce&&this.fired){this.notify(a,this.firedWith);}else{this.subscribers.push(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 h=[],a=this.subscribers.length;var d=[].slice.call(arguments,0),c=true,f,b=false;if(this.fireOnce){if(this.fired){return true;}else{this.firedWith=d;}}this.fired=true;if(!a&&this.silent){return true;}if(!this.silent){}var e=this.subscribers.slice();for(f=0;f<a;++f){var g=e[f];if(!g||!g.fn){b=true;}else{c=this.notify(g,d);if(false===c){if(!this.silent){}break;}}}return(c!==false);},notify:function(g,c){var b,i=null,f=g.getScope(this.scope),a=YAHOO.util.Event.throwErrors;if(!this.silent){}if(this.signature==YAHOO.util.CustomEvent.FLAT){if(c.length>0){i=c[0];}try{b=g.fn.call(f,i,g.obj);}catch(h){this.lastError=h;if(a){throw h;}}}else{try{b=g.fn.call(f,this.type,c,g.obj);}catch(d){this.lastError=d;if(a){throw d;}}}return b;},unsubscribeAll:function(){var a=this.subscribers.length,b;for(b=a-1;b>-1;b--){this._delete(b);}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+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(a,b,c){this.fn=a;this.obj=YAHOO.lang.isUndefined(b)?null:b;this.overrideContext=c;};YAHOO.util.Subscriber.prototype.getScope=function(a){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}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+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var g=false,h=[],j=[],a=0,e=[],b=0,c={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9},d=YAHOO.env.ua.ie,f="focusin",i="focusout";return{POLL_RETRYS:500,POLL_INTERVAL:40,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:d,_interval:null,_dri:null,_specialTypes:{focusin:(d?"focusin":"focus"),focusout:(d?"focusout":"blur")},DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){this._interval=YAHOO.lang.later(this.POLL_INTERVAL,this,this._tryPreloadAttach,null,true);}},onAvailable:function(q,m,o,p,n){var k=(YAHOO.lang.isString(q))?[q]:q;for(var l=0;l<k.length;l=l+1){e.push({id:k[l],fn:m,obj:o,overrideContext:p,checkReady:n});}a=this.POLL_RETRYS;this.startInterval();},onContentReady:function(n,k,l,m){this.onAvailable(n,k,l,m,true);},onDOMReady:function(){this.DOMReadyEvent.subscribe.apply(this.DOMReadyEvent,arguments);},_addListener:function(m,k,v,p,t,y){if(!v||!v.call){return false;}if(this._isValidCollection(m)){var w=true;for(var q=0,s=m.length;q<s;++q){w=this.on(m[q],k,v,p,t)&&w;}return w;}else{if(YAHOO.lang.isString(m)){var o=this.getEl(m);if(o){m=o;}else{this.onAvailable(m,function(){YAHOO.util.Event._addListener(m,k,v,p,t,y);});return true;}}}if(!m){return false;}if("unload"==k&&p!==this){j[j.length]=[m,k,v,p,t];return true;}var l=m;if(t){if(t===true){l=p;}else{l=t;}}var n=function(z){return v.call(l,YAHOO.util.Event.getEvent(z,m),p);};var x=[m,k,v,n,l,p,t,y];var r=h.length;h[r]=x;try{this._simpleAdd(m,k,n,y);}catch(u){this.lastError=u;this.removeListener(m,k,v);return false;}return true;},_getType:function(k){return this._specialTypes[k]||k;},addListener:function(m,p,l,n,o){var k=((p==f||p==i)&&!YAHOO.env.ua.ie)?true:false;return this._addListener(m,this._getType(p),l,n,o,k);},addFocusListener:function(l,k,m,n){return this.on(l,f,k,m,n);},removeFocusListener:function(l,k){return this.removeListener(l,f,k);},addBlurListener:function(l,k,m,n){return this.on(l,i,k,m,n);},removeBlurListener:function(l,k){return this.removeListener(l,i,k);},removeListener:function(l,k,r){var m,p,u;k=this._getType(k);if(typeof l=="string"){l=this.getEl(l);}else{if(this._isValidCollection(l)){var s=true;for(m=l.length-1;m>-1;m--){s=(this.removeListener(l[m],k,r)&&s);}return s;}}if(!r||!r.call){return this.purgeElement(l,false,k);}if("unload"==k){for(m=j.length-1;m>-1;m--){u=j[m];if(u&&u[0]==l&&u[1]==k&&u[2]==r){j.splice(m,1);return true;}}return false;}var n=null;var o=arguments[3];if("undefined"===typeof o){o=this._getCacheIndex(h,l,k,r);}if(o>=0){n=h[o];}if(!l||!n){return false;}var t=n[this.CAPTURE]===true?true:false;try{this._simpleRemove(l,k,n[this.WFN],t);}catch(q){this.lastError=q;return false;}delete h[o][this.WFN];delete h[o][this.FN];h.splice(o,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 null;}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 c)){k=c[k];}return k;},_getCacheIndex:function(n,q,r,p){for(var o=0,m=n.length;o<m;o=o+1){var k=n[o];if(k&&k[this.FN]==p&&k[this.EL]==q&&k[this.TYPE]==r){return o;}}return -1;},generateId:function(k){var l=k.id;if(!l){l="yuievtautoid-"+b;++b;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",YAHOO,0,0,1),_load:function(l){if(!g){g=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(e.length===0){a=0;if(this._interval){this._interval.cancel();this._interval=null;}return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var q=!g;if(!q){q=(a>0&&e.length>0);}var p=[];var r=function(t,u){var s=t;if(u.overrideContext){if(u.overrideContext===true){s=u.obj;}else{s=u.overrideContext;}}u.fn.call(s,u.obj);};var l,k,o,n,m=[];for(l=0,k=e.length;l<k;l=l+1){o=e[l];if(o){n=this.getEl(o.id);if(n){if(o.checkReady){if(g||n.nextSibling||!q){m.push(o);e[l]=null;}}else{r(n,o);e[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);}a--;if(q){for(l=e.length-1;l>-1;l--){o=e[l];if(!o||!o.id){e.splice(l,1);}}this.startInterval();}else{if(this._interval){this._interval.cancel();this._interval=null;}}this.locked=false;},purgeElement:function(p,q,s){var n=(YAHOO.lang.isString(p))?this.getEl(p):p;var r=this.getListeners(n,s),o,k;if(r){for(o=r.length-1;o>-1;o--){var m=r[o];this.removeListener(n,m.type,m.fn);}}if(q&&n&&n.childNodes){for(o=0,k=n.childNodes.length;o<k;++o){this.purgeElement(n.childNodes[o],q,s);}}},getListeners:function(n,k){var q=[],m;if(!k){m=[h,j];}else{if(k==="unload"){m=[j];}else{k=this._getType(k);m=[h];}}var s=(YAHOO.lang.isString(n))?this.getEl(n):n;for(var p=0;p<m.length;p=p+1){var u=m[p];if(u){for(var r=0,t=u.length;r<t;++r){var o=u[r];if(o&&o[this.EL]===s&&(!k||k===o[this.TYPE])){q.push({type:o[this.TYPE],fn:o[this.FN],obj:o[this.OBJ],adjust:o[this.OVERRIDE],scope:o[this.ADJ_SCOPE],index:r});}}}}return(q.length)?q:null;},_unload:function(s){var m=YAHOO.util.Event,p,o,n,r,q,t=j.slice(),k;for(p=0,r=j.length;p<r;++p){n=t[p];if(n){try{k=window;if(n[m.ADJ_SCOPE]){if(n[m.ADJ_SCOPE]===true){k=n[m.UNLOAD_OBJ];}else{k=n[m.ADJ_SCOPE];}}n[m.FN].call(k,m.getEvent(s,n[m.EL]),n[m.UNLOAD_OBJ]);}catch(w){}t[p]=null;}}n=null;k=null;j=null;if(h){for(o=h.length-1;o>-1;o--){n=h[o];if(n){try{m.removeListener(n[m.EL],n[m.TYPE],n[m.FN],o);}catch(v){}}}n=null;}try{m._simpleRemove(window,"unload",m._unload);m._simpleRemove(window,"load",m._load);}catch(u){}},_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 a=YAHOO.util.Event;a.on=a.addListener;a.onFocus=a.addFocusListener;a.onBlur=a.addBlurListener;
/*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */
if(a.isIE){if(self!==self.top){document.onreadystatechange=function(){if(document.readyState=="complete"){document.onreadystatechange=null;a._ready();}};}else{YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var b=document.createElement("p");a._dri=setInterval(function(){try{b.doScroll("left");clearInterval(a._dri);a._dri=null;a._ready();b=null;}catch(c){}},a.POLL_INTERVAL);}}else{if(a.webkit&&a.webkit<525){a._dri=setInterval(function(){var c=document.readyState;if("loaded"==c||"complete"==c){clearInterval(a._dri);a._dri=null;a._ready();}},a.POLL_INTERVAL);}else{a._simpleAdd(document,"DOMContentLoaded",a._ready);}}a._simpleAdd(window,"load",a._load);a._simpleAdd(window,"unload",a._unload);a._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(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,overrideContext: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(b,g){this.__yui_events=this.__yui_events||{};var e=g||{},d=this.__yui_events,f;if(d[b]){}else{f=new YAHOO.util.CustomEvent(b,e.scope||this,e.silent,YAHOO.util.CustomEvent.FLAT,e.fireOnce);d[b]=f;if(e.onSubscribeCallback){f.subscribeEvent.subscribe(e.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var a=this.__yui_subscribers[b];if(a){for(var c=0;c<a.length;++c){f.subscribe(a[c].fn,a[c].obj,a[c].overrideContext);}}}return d[b];},fireEvent:function(b){this.__yui_events=this.__yui_events||{};var d=this.__yui_events[b];if(!d){return null;}var a=[];for(var c=1;c<arguments.length;++c){a.push(arguments[c]);}return d.fire.apply(d,a);},hasEvent:function(a){if(this.__yui_events){if(this.__yui_events[a]){return true;}}return false;}};(function(){var a=YAHOO.util.Event,c=YAHOO.lang;YAHOO.util.KeyListener=function(d,i,e,f){if(!d){}else{if(!i){}else{if(!e){}}}if(!f){f=YAHOO.util.KeyListener.KEYDOWN;}var g=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(c.isString(d)){d=document.getElementById(d);}if(c.isFunction(e)){g.subscribe(e);}else{g.subscribe(e.fn,e.scope,e.correctScope);}function h(o,n){if(!i.shift){i.shift=false;}if(!i.alt){i.alt=false;}if(!i.ctrl){i.ctrl=false;}if(o.shiftKey==i.shift&&o.altKey==i.alt&&o.ctrlKey==i.ctrl){var j,m=i.keys,l;if(YAHOO.lang.isArray(m)){for(var k=0;k<m.length;k++){j=m[k];l=a.getCharCode(o);if(j==l){g.fire(l,o);break;}}}else{l=a.getCharCode(o);if(m==l){g.fire(l,o);}}}}this.enable=function(){if(!this.enabled){a.on(d,f,h);this.enabledEvent.fire(i);}this.enabled=true;};this.disable=function(){if(this.enabled){a.removeListener(d,f,h);this.disabledEvent.fire(i);}this.enabled=false;};this.toString=function(){return"KeyListener ["+i.keys+"] "+d.tagName+(d.id?"["+d.id+"]":"");};};var b=YAHOO.util.KeyListener;b.KEYDOWN="keydown";b.KEYUP="keyup";b.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.9.0",build:"2800"});YAHOO.register("yahoo-dom-event", YAHOO, {version: "2.9.0", build: "2800"});
/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
(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,f,e){var d=this.getEl();if(this.patterns.noNegatives.test(c)){f=(f>0)?f:0;}if(c in d&&!("style" in d&&c in d.style)){d[c]=f;}else{b.Dom.setStyle(d,c,f+e);}},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("style" in e){if(f||(b.Dom.getStyle(e,"position")=="absolute"&&h)){g=e["offset"+d[0].charAt(0).toUpperCase()+d[0].substr(1)];}else{g=0;}}else{if(c in e){g=e[c];}}return g;},getDefaultUnit:function(c){if(this.patterns.defaultUnit.test(c)){return"px";}return"";},setRuntimeAttribute:function(d){var j;var e;var f=this.attributes;this.runtimeAttributes[d]={};var h=function(i){return(typeof i!=="undefined");};if(!h(f[d]["to"])&&!h(f[d]["by"])){return false;}j=(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(j.constructor==Array){e=[];for(var g=0,c=j.length;g<c;++g){e[g]=j[g]+f[d]["by"][g]*1;}}else{e=j+f[d]["by"]*1;}}}this.runtimeAttributes[d].start=j;this.runtimeAttributes[d].end=e;this.runtimeAttributes[d].unit=(h(f[d].unit))?f[d]["unit"]:this.getDefaultUnit(d);return true;},init:function(f,c,h,i){var d=false;var e=null;var g=0;f=b.Dom.get(f);this.attributes=c||{};this.duration=!YAHOO.lang.isUndefined(h)?h:1;this.method=i||b.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=b.AnimMgr.fps;this.setEl=function(j){f=b.Dom.get(j);};this.getEl=function(){return f;};this.isAnimated=function(){return d;};this.getStartTime=function(){return e;};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(j){if(!this.isAnimated()){return false;}if(j){this.currentFrame=this.totalFrames;this._onTween.fire();}b.AnimMgr.stop(this);};this._handleStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var j in this.attributes){if(this.attributes.hasOwnProperty(j)){this.setRuntimeAttribute(j);}}d=true;g=0;e=new Date();};this._handleTween=function(){var l={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};l.toString=function(){return("duration: "+l.duration+", currentFrame: "+l.currentFrame);};this.onTween.fire(l);var k=this.runtimeAttributes;for(var j in k){if(k.hasOwnProperty(j)){this.setAttribute(j,this.doMethod(j,k[j].start,k[j].end),k[j].unit);}}this.afterTween.fire(l);g+=1;};this._handleComplete=function(){var j=(new Date()-e)/1000;var k={duration:j,frames:g,fps:g/j};k.toString=function(){return("duration: "+k.duration+", frames: "+k.frames+", fps: "+k.fps);};d=false;g=0;this.onComplete.fire(k);};this._onStart=new b.CustomEvent("_start",this,true);this.onStart=new b.CustomEvent("start",this);this.onTween=new b.CustomEvent("tween",this);this.afterTween=new b.CustomEvent("afterTween",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(this._handleStart);this._onTween.subscribe(this._handleTween);this._onComplete.subscribe(this._handleComplete);}};b.Anim=a;})();YAHOO.util.AnimMgr=new function(){var e=null;var c=[];var g=0;this.fps=1000;this.delay=20;this.registerElement=function(j){c[c.length]=j;g+=1;j._onStart.fire();this.start();};var f=[];var d=false;var h=function(){var j=f.shift();b.apply(YAHOO.util.AnimMgr,j);if(f.length){arguments.callee();}};var b=function(k,j){j=j||a(k);if(!k.isAnimated()||j===-1){return false;}k._onComplete.fire();c.splice(j,1);g-=1;if(g<=0){this.stop();}return true;};this.unRegister=function(){f.push(arguments);if(!d){d=true;h();d=false;}};this.start=function(){if(e===null){e=setInterval(this.run,this.delay);}};this.stop=function(l){if(!l){clearInterval(e);for(var k=0,j=c.length;k<j;++k){this.unRegister(c[0],0);}c=[];e=null;g=0;}else{this.unRegister(l);}};this.run=function(){for(var l=0,j=c.length;l<j;++l){var k=c[l];if(!k||!k.isAnimated()){continue;}if(k.currentFrame<k.totalFrames||k.totalFrames===null){k.currentFrame+=1;if(k.useSeconds){i(k);}k._onTween.fire();}else{YAHOO.util.AnimMgr.stop(k,l);}}};var a=function(l){for(var k=0,j=c.length;k<j;++k){if(c[k]===l){return k;}}return -1;};var i=function(k){var n=k.totalFrames;var m=k.currentFrame;var l=(k.currentFrame*k.duration*1000/k.totalFrames);var j=(new Date()-k.getStartTime());var o=0;if(j<k.duration*1000){o=Math.round((j/l-1)*k.currentFrame);}else{o=n-(m+1);}if(o>0&&isFinite(o)){if(k.currentFrame+o>=n){o=n-(m+1);}k.currentFrame+=o;}};this._queue=c;this._getIndex=a;};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";a.DEFAULT_BGCOLOR="#fff";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 i=YAHOO.util.Dom.getStyle(g,e);var h=this;if(this.patterns.transparent.test(i)){var f=YAHOO.util.Dom.getAncestorBy(g,function(j){return !h.patterns.transparent.test(i);});if(f){i=c.Dom.getStyle(f,e);}else{i=a.DEFAULT_BGCOLOR;}}}else{i=d.getAttribute.call(this,e);}return i;};b.doMethod=function(f,k,g){var j;if(this.patterns.color.test(f)){j=[];for(var h=0,e=k.length;h<e;++h){j[h]=d.doMethod.call(this,f,k[h],g[h]);}j="rgb("+Math.floor(j[0])+","+Math.floor(j[1])+","+Math.floor(j[2])+")";}else{j=d.doMethod.call(this,f,k,g);}return j;};b.setRuntimeAttribute=function(f){d.setRuntimeAttribute.call(this,f);if(this.patterns.color.test(f)){var h=this.attributes;var k=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 j=0,e=k.length;j<e;++j){g[j]=k[j]+g[j];}}this.runtimeAttributes[f].start=k;this.runtimeAttributes[f].end=g;}};c.ColorAnim=a;})();
/*!
TERMS OF USE - EASING EQUATIONS
Open source under the BSD License.
Copyright 2001 Robert Penner All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
 * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
YAHOO.util.Easing={easeNone:function(e,a,g,f){return g*e/f+a;},easeIn:function(e,a,g,f){return g*(e/=f)*e+a;},easeOut:function(e,a,g,f){return -g*(e/=f)*(e-2)+a;},easeBoth:function(e,a,g,f){if((e/=f/2)<1){return g/2*e*e+a;}return -g/2*((--e)*(e-2)-1)+a;},easeInStrong:function(e,a,g,f){return g*(e/=f)*e*e*e+a;},easeOutStrong:function(e,a,g,f){return -g*((e=e/f-1)*e*e*e-1)+a;},easeBothStrong:function(e,a,g,f){if((e/=f/2)<1){return g/2*e*e*e*e+a;}return -g/2*((e-=2)*e*e*e-2)+a;},elasticIn:function(g,e,k,j,f,i){if(g==0){return e;}if((g/=j)==1){return e+k;}if(!i){i=j*0.3;}if(!f||f<Math.abs(k)){f=k;var h=i/4;}else{var h=i/(2*Math.PI)*Math.asin(k/f);}return -(f*Math.pow(2,10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i))+e;},elasticOut:function(g,e,k,j,f,i){if(g==0){return e;}if((g/=j)==1){return e+k;}if(!i){i=j*0.3;}if(!f||f<Math.abs(k)){f=k;var h=i/4;}else{var h=i/(2*Math.PI)*Math.asin(k/f);}return f*Math.pow(2,-10*g)*Math.sin((g*j-h)*(2*Math.PI)/i)+k+e;},elasticBoth:function(g,e,k,j,f,i){if(g==0){return e;}if((g/=j/2)==2){return e+k;}if(!i){i=j*(0.3*1.5);}if(!f||f<Math.abs(k)){f=k;var h=i/4;}else{var h=i/(2*Math.PI)*Math.asin(k/f);}if(g<1){return -0.5*(f*Math.pow(2,10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i))+e;}return f*Math.pow(2,-10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i)*0.5+k+e;},backIn:function(e,a,h,g,f){if(typeof f=="undefined"){f=1.70158;}return h*(e/=g)*e*((f+1)*e-f)+a;},backOut:function(e,a,h,g,f){if(typeof f=="undefined"){f=1.70158;}return h*((e=e/g-1)*e*((f+1)*e+f)+1)+a;},backBoth:function(e,a,h,g,f){if(typeof f=="undefined"){f=1.70158;}if((e/=g/2)<1){return h/2*(e*e*(((f*=(1.525))+1)*e-f))+a;}return h/2*((e-=2)*e*(((f*=(1.525))+1)*e+f)+2)+a;},bounceIn:function(e,a,g,f){return g-YAHOO.util.Easing.bounceOut(f-e,0,g,f)+a;},bounceOut:function(e,a,g,f){if((e/=f)<(1/2.75)){return g*(7.5625*e*e)+a;}else{if(e<(2/2.75)){return g*(7.5625*(e-=(1.5/2.75))*e+0.75)+a;}else{if(e<(2.5/2.75)){return g*(7.5625*(e-=(2.25/2.75))*e+0.9375)+a;}}}return g*(7.5625*(e-=(2.625/2.75))*e+0.984375)+a;},bounceBoth:function(e,a,g,f){if(e<f/2){return YAHOO.util.Easing.bounceIn(e*2,0,g,f)*0.5+a;}return YAHOO.util.Easing.bounceOut(e*2-f,0,g,f)*0.5+g*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(q){if(this.patterns.points.test(q)){var h=this.getEl();var k=this.attributes;var g;var m=k["points"]["control"]||[];var j;var n,p;if(m.length>0&&!(m[0] instanceof Array)){m=[m];}else{var l=[];for(n=0,p=m.length;n<p;++n){l[n]=m[n];}m=l;}if(e.Dom.getStyle(h,"position")=="static"){e.Dom.setStyle(h,"position","relative");}if(d(k["points"]["from"])){e.Dom.setXY(h,k["points"]["from"]);}else{e.Dom.setXY(h,e.Dom.getXY(h));}g=this.getAttribute("points");if(d(k["points"]["to"])){j=b.call(this,k["points"]["to"],g);var o=e.Dom.getXY(this.getEl());for(n=0,p=m.length;n<p;++n){m[n]=b.call(this,m[n],g);}}else{if(d(k["points"]["by"])){j=[g[0]+k["points"]["by"][0],g[1]+k["points"]["by"][1]];for(n=0,p=m.length;n<p;++n){m[n]=[g[0]+m[n][0],g[1]+m[n][1]];}}}this.runtimeAttributes[q]=[g];if(m.length>0){this.runtimeAttributes[q]=this.runtimeAttributes[q].concat(m);}this.runtimeAttributes[q][this.runtimeAttributes[q].length]=j;}else{f.setRuntimeAttribute.call(this,q);}};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.9.0",build:"2800"});
/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
(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=this.config,g,e;for(g in f){if(b.hasOwnProperty(f,g)){e=f[g];if(e&&e.event){d[g]=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(d in this.initialConfig){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(v,r){v=v.toLowerCase();var u=this.config[v],l=false,k,g,h,j,p,t,f,n,o,d,m,w,e;if(u&&u.event){if(!b.isUndefined(r)&&u.validator&&!u.validator(r)){return false;}else{if(!b.isUndefined(r)){u.value=r;}else{r=u.value;}l=false;k=this.eventQueue.length;for(m=0;m<k;m++){g=this.eventQueue[m];if(g){h=g[0];j=g[1];if(h==v){this.eventQueue[m]=null;this.eventQueue.push([v,(!b.isUndefined(r)?r:j)]);l=true;break;}}}if(!l&&!b.isUndefined(r)){this.eventQueue.push([v,r]);}}if(u.supercedes){p=u.supercedes.length;for(w=0;w<p;w++){t=u.supercedes[w];f=this.eventQueue.length;for(e=0;e<f;e++){n=this.eventQueue[e];if(n){o=n[0];d=n[1];if(o==t.toLowerCase()){this.eventQueue.push([o,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){if(b.hasOwnProperty(this.config,d)){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.eventQueue[e]=null;this.fireEvent(d,g);}}this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(d,e,g,h){var f=this.config[d.toLowerCase()];if(f&&f.event){if(!a.alreadySubscribed(f.event,e,g)){f.event.subscribe(e,g,h);}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,j){var f=e.subscribers.length,d,g;if(f>0){g=f-1;do{d=e.subscribers[g];if(d&&d.obj==j&&d.fn==h){return true;}}while(g--);}return false;};YAHOO.lang.augmentProto(a,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(r,q){if(r){this.init(r,q);}else{}};var f=YAHOO.util.Dom,d=YAHOO.util.Config,n=YAHOO.util.Event,m=YAHOO.util.CustomEvent,g=YAHOO.widget.Module,i=YAHOO.env.ua,h,p,o,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","DESTROY":"destroy","BEFORE_SHOW":"beforeShow","SHOW":"show","BEFORE_HIDE":"beforeHide","HIDE":"hide"},j={"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.RESIZE_MONITOR_BUFFER=1;g.textResizeEvent=new m("textResize");g.forceDocumentRedraw=function(){var q=document.documentElement;if(q){q.className+=" ";q.className=YAHOO.lang.trim(q.className);}};function l(){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>');p=h.firstChild;o=p.nextSibling;e=o.nextSibling;}return h;}function k(){if(!p){l();}return(p.cloneNode(false));}function b(){if(!o){l();}return(o.cloneNode(false));}function c(){if(!e){l();}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 q=m.LIST;
this.beforeInitEvent=this.createEvent(a.BEFORE_INIT);this.beforeInitEvent.signature=q;this.initEvent=this.createEvent(a.INIT);this.initEvent.signature=q;this.appendEvent=this.createEvent(a.APPEND);this.appendEvent.signature=q;this.beforeRenderEvent=this.createEvent(a.BEFORE_RENDER);this.beforeRenderEvent.signature=q;this.renderEvent=this.createEvent(a.RENDER);this.renderEvent.signature=q;this.changeHeaderEvent=this.createEvent(a.CHANGE_HEADER);this.changeHeaderEvent.signature=q;this.changeBodyEvent=this.createEvent(a.CHANGE_BODY);this.changeBodyEvent.signature=q;this.changeFooterEvent=this.createEvent(a.CHANGE_FOOTER);this.changeFooterEvent.signature=q;this.changeContentEvent=this.createEvent(a.CHANGE_CONTENT);this.changeContentEvent.signature=q;this.destroyEvent=this.createEvent(a.DESTROY);this.destroyEvent.signature=q;this.beforeShowEvent=this.createEvent(a.BEFORE_SHOW);this.beforeShowEvent.signature=q;this.showEvent=this.createEvent(a.SHOW);this.showEvent.signature=q;this.beforeHideEvent=this.createEvent(a.BEFORE_HIDE);this.beforeHideEvent.signature=q;this.hideEvent=this.createEvent(a.HIDE);this.hideEvent.signature=q;},platform:function(){var q=navigator.userAgent.toLowerCase();if(q.indexOf("windows")!=-1||q.indexOf("win32")!=-1){return"windows";}else{if(q.indexOf("macintosh")!=-1){return"mac";}else{return false;}}}(),browser:function(){var q=navigator.userAgent.toLowerCase();if(q.indexOf("opera")!=-1){return"opera";}else{if(q.indexOf("msie 7")!=-1){return"ie7";}else{if(q.indexOf("msie")!=-1){return"ie";}else{if(q.indexOf("safari")!=-1){return"safari";}else{if(q.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(j.VISIBLE.key,{handler:this.configVisible,value:j.VISIBLE.value,validator:j.VISIBLE.validator});this.cfg.addProperty(j.EFFECT.key,{handler:this.configEffect,suppressEvent:j.EFFECT.suppressEvent,supercedes:j.EFFECT.supercedes});this.cfg.addProperty(j.MONITOR_RESIZE.key,{handler:this.configMonitorResize,value:j.MONITOR_RESIZE.value});this.cfg.addProperty(j.APPEND_TO_DOCUMENT_BODY.key,{value:j.APPEND_TO_DOCUMENT_BODY.value});},init:function(v,u){var s,w;this.initEvents();this.beforeInitEvent.fire(g);this.cfg=new d(this);if(this.isSecure){this.imageRoot=g.IMG_ROOT_SSL;}if(typeof v=="string"){s=v;v=document.getElementById(v);if(!v){v=(l()).cloneNode(false);v.id=s;}}this.id=f.generateId(v);this.element=v;w=this.element.firstChild;if(w){var r=false,q=false,t=false;do{if(1==w.nodeType){if(!r&&f.hasClass(w,g.CSS_HEADER)){this.header=w;r=true;}else{if(!q&&f.hasClass(w,g.CSS_BODY)){this.body=w;q=true;}else{if(!t&&f.hasClass(w,g.CSS_FOOTER)){this.footer=w;t=true;}}}}}while((w=w.nextSibling));}this.initDefaultConfig();f.addClass(this.element,g.CSS_MODULE);if(u){this.cfg.applyConfig(u,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 r=(i.gecko&&this.platform=="windows");if(r){var q=this;setTimeout(function(){q._initResizeMonitor();},0);}else{this._initResizeMonitor();}},_initResizeMonitor:function(){var q,s,u;function w(){g.textResizeEvent.fire();}if(!i.opera){s=f.get("_yuiResizeMonitor");var v=this._supportsCWResize();if(!s){s=document.createElement("iframe");if(this.isSecure&&g.RESIZE_MONITOR_SECURE_URL&&i.ie){s.src=g.RESIZE_MONITOR_SECURE_URL;}if(!v){u=["<html><head><script ",'type="text/javascript">',"window.onresize=function(){window.parent.","YAHOO.widget.Module.textResizeEvent.","fire();};<","/script></head>","<body></body></html>"].join("");s.src="data:text/html;charset=utf-8,"+encodeURIComponent(u);}s.id="_yuiResizeMonitor";s.title="Text Resize Monitor";s.tabIndex=-1;s.setAttribute("role","presentation");s.style.position="absolute";s.style.visibility="hidden";var r=document.body,t=r.firstChild;if(t){r.insertBefore(s,t);}else{r.appendChild(s);}s.style.backgroundColor="transparent";s.style.borderWidth="0";s.style.width="2em";s.style.height="2em";s.style.left="0";s.style.top=(-1*(s.offsetHeight+g.RESIZE_MONITOR_BUFFER))+"px";s.style.visibility="visible";if(i.webkit){q=s.contentWindow.document;q.open();q.close();}}if(s&&s.contentWindow){g.textResizeEvent.subscribe(this.onDomResize,this,true);if(!g.textResizeInitialized){if(v){if(!n.on(s.contentWindow,"resize",w)){n.on(s,"resize",w);}}g.textResizeInitialized=true;}this.resizeMonitor=s;}}},_supportsCWResize:function(){var q=true;if(i.gecko&&i.gecko<=1.8){q=false;}return q;},onDomResize:function(s,r){var q=-1*(this.resizeMonitor.offsetHeight+g.RESIZE_MONITOR_BUFFER);this.resizeMonitor.style.top=q+"px";this.resizeMonitor.style.left="0";},setHeader:function(r){var q=this.header||(this.header=k());if(r.nodeName){q.innerHTML="";q.appendChild(r);}else{q.innerHTML=r;}if(this._rendered){this._renderHeader();}this.changeHeaderEvent.fire(r);this.changeContentEvent.fire();},appendToHeader:function(r){var q=this.header||(this.header=k());q.appendChild(r);this.changeHeaderEvent.fire(r);this.changeContentEvent.fire();},setBody:function(r){var q=this.body||(this.body=b());if(r.nodeName){q.innerHTML="";q.appendChild(r);}else{q.innerHTML=r;}if(this._rendered){this._renderBody();}this.changeBodyEvent.fire(r);this.changeContentEvent.fire();},appendToBody:function(r){var q=this.body||(this.body=b());q.appendChild(r);this.changeBodyEvent.fire(r);this.changeContentEvent.fire();},setFooter:function(r){var q=this.footer||(this.footer=c());if(r.nodeName){q.innerHTML="";q.appendChild(r);}else{q.innerHTML=r;}if(this._rendered){this._renderFooter();}this.changeFooterEvent.fire(r);this.changeContentEvent.fire();},appendToFooter:function(r){var q=this.footer||(this.footer=c());q.appendChild(r);this.changeFooterEvent.fire(r);this.changeContentEvent.fire();},render:function(s,q){var t=this;function r(u){if(typeof u=="string"){u=document.getElementById(u);
}if(u){t._addToParent(u,t.element);t.appendEvent.fire();}}this.beforeRenderEvent.fire();if(!q){q=this.element;}if(s){r(s);}else{if(!f.inDocument(this.element)){return false;}}this._renderHeader(q);this._renderBody(q);this._renderFooter(q);this._rendered=true;this.renderEvent.fire();return true;},_renderHeader:function(q){q=q||this.element;if(this.header&&!f.inDocument(this.header)){var r=q.firstChild;if(r){q.insertBefore(this.header,r);}else{q.appendChild(this.header);}}},_renderBody:function(q){q=q||this.element;if(this.body&&!f.inDocument(this.body)){if(this.footer&&f.isAncestor(q,this.footer)){q.insertBefore(this.body,this.footer);}else{q.appendChild(this.body);}}},_renderFooter:function(q){q=q||this.element;if(this.footer&&!f.inDocument(this.footer)){q.appendChild(this.footer);}},destroy:function(q){var r,s=!(q);if(this.element){n.purgeElement(this.element,s);r=this.element.parentNode;}if(r){r.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();},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(r,q,s){var t=q[0];if(t){if(this.beforeShowEvent.fire()){f.setStyle(this.element,"display","block");this.showEvent.fire();}}else{if(this.beforeHideEvent.fire()){f.setStyle(this.element,"display","none");this.hideEvent.fire();}}},configEffect:function(r,q,s){this._cachedEffects=(this.cacheEffects)?this._createEffects(q[0]):null;},cacheEffects:true,_createEffects:function(t){var q=null,u,r,s;if(t){if(t instanceof Array){q=[];u=t.length;for(r=0;r<u;r++){s=t[r];if(s.effect){q[q.length]=s.effect(this,s.duration);}}}else{if(t.effect){q=[t.effect(this,t.duration)];}}}return q;},configMonitorResize:function(s,r,t){var q=r[0];if(q){this.initResizeMonitor();}else{g.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}},_addToParent:function(q,r){if(!this.cfg.getProperty("appendtodocumentbody")&&q===document.body&&q.firstChild){q.insertBefore(r,q.firstChild);}else{q.appendChild(r);}},toString:function(){return"Module "+this.id;}};YAHOO.lang.augmentProto(g,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Overlay=function(p,o){YAHOO.widget.Overlay.superclass.constructor.call(this,p,o);};var i=YAHOO.lang,m=YAHOO.util.CustomEvent,g=YAHOO.widget.Module,n=YAHOO.util.Event,f=YAHOO.util.Dom,d=YAHOO.util.Config,k=YAHOO.env.ua,b=YAHOO.widget.Overlay,h="subscribe",e="unsubscribe",c="contained",j,a={"BEFORE_MOVE":"beforeMove","MOVE":"move"},l={"X":{key:"x",validator:i.isNumber,suppressEvent:true,supercedes:["iframe"]},"Y":{key:"y",validator:i.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,supercedes:["iframe","visible"]},"WIDTH":{key:"width",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"HEIGHT":{key:"height",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"AUTO_FILL_HEIGHT":{key:"autofillheight",supercedes:["height"],value:"body"},"ZINDEX":{key:"zindex",value:null},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:false,validator:i.isBoolean,supercedes:["iframe","x","y","xy"]},"IFRAME":{key:"iframe",value:(k.ie==6?true:false),validator:i.isBoolean,supercedes:["zindex"]},"PREVENT_CONTEXT_OVERLAP":{key:"preventcontextoverlap",value:false,validator:i.isBoolean,supercedes:["constraintoviewport"]}};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.PREVENT_OVERLAP_X={"tltr":true,"blbr":true,"brbl":true,"trtl":true};b.PREVENT_OVERLAP_Y={"trbr":true,"tlbl":true,"bltl":true,"brtr":true};b.CSS_OVERLAY="yui-overlay";b.CSS_HIDDEN="yui-overlay-hidden";b.CSS_IFRAME="yui-overlay-iframe";b.STD_MOD_RE=/^\s*?(body|footer|header)\s*?$/i;b.windowScrollEvent=new m("windowScroll");b.windowResizeEvent=new m("windowResize");b.windowScrollHandler=function(p){var o=n.getTarget(p);if(!o||o===window||o===window.document){if(k.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(o){if(k.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){n.on(window,"scroll",b.windowScrollHandler);n.on(window,"resize",b.windowResizeHandler);b._initialized=true;}b._TRIGGER_MAP={"windowScroll":b.windowScrollEvent,"windowResize":b.windowResizeEvent,"textResize":g.textResizeEvent};YAHOO.extend(b,g,{CONTEXT_TRIGGERS:[],init:function(p,o){b.superclass.init.call(this,p);this.beforeInitEvent.fire(b);f.addClass(this.element,b.CSS_OVERLAY);if(o){this.cfg.applyConfig(o,true);}if(this.platform=="mac"&&k.gecko){if(!d.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}if(!d.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 o=m.LIST;this.beforeMoveEvent=this.createEvent(a.BEFORE_MOVE);this.beforeMoveEvent.signature=o;this.moveEvent=this.createEvent(a.MOVE);this.moveEvent.signature=o;},initDefaultConfig:function(){b.superclass.initDefaultConfig.call(this);var o=this.cfg;o.addProperty(l.X.key,{handler:this.configX,validator:l.X.validator,suppressEvent:l.X.suppressEvent,supercedes:l.X.supercedes});o.addProperty(l.Y.key,{handler:this.configY,validator:l.Y.validator,suppressEvent:l.Y.suppressEvent,supercedes:l.Y.supercedes});
o.addProperty(l.XY.key,{handler:this.configXY,suppressEvent:l.XY.suppressEvent,supercedes:l.XY.supercedes});o.addProperty(l.CONTEXT.key,{handler:this.configContext,suppressEvent:l.CONTEXT.suppressEvent,supercedes:l.CONTEXT.supercedes});o.addProperty(l.FIXED_CENTER.key,{handler:this.configFixedCenter,value:l.FIXED_CENTER.value,validator:l.FIXED_CENTER.validator,supercedes:l.FIXED_CENTER.supercedes});o.addProperty(l.WIDTH.key,{handler:this.configWidth,suppressEvent:l.WIDTH.suppressEvent,supercedes:l.WIDTH.supercedes});o.addProperty(l.HEIGHT.key,{handler:this.configHeight,suppressEvent:l.HEIGHT.suppressEvent,supercedes:l.HEIGHT.supercedes});o.addProperty(l.AUTO_FILL_HEIGHT.key,{handler:this.configAutoFillHeight,value:l.AUTO_FILL_HEIGHT.value,validator:this._validateAutoFill,supercedes:l.AUTO_FILL_HEIGHT.supercedes});o.addProperty(l.ZINDEX.key,{handler:this.configzIndex,value:l.ZINDEX.value});o.addProperty(l.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:l.CONSTRAIN_TO_VIEWPORT.value,validator:l.CONSTRAIN_TO_VIEWPORT.validator,supercedes:l.CONSTRAIN_TO_VIEWPORT.supercedes});o.addProperty(l.IFRAME.key,{handler:this.configIframe,value:l.IFRAME.value,validator:l.IFRAME.validator,supercedes:l.IFRAME.supercedes});o.addProperty(l.PREVENT_CONTEXT_OVERLAP.key,{value:l.PREVENT_CONTEXT_OVERLAP.value,validator:l.PREVENT_CONTEXT_OVERLAP.validator,supercedes:l.PREVENT_CONTEXT_OVERLAP.supercedes});},moveTo:function(o,p){this.cfg.setProperty("xy",[o,p]);},hideMacGeckoScrollbars:function(){f.replaceClass(this.element,"show-scrollbars","hide-scrollbars");},showMacGeckoScrollbars:function(){f.replaceClass(this.element,"hide-scrollbars","show-scrollbars");},_setDomVisibility:function(o){f.setStyle(this.element,"visibility",(o)?"visible":"hidden");var p=b.CSS_HIDDEN;if(o){f.removeClass(this.element,p);}else{f.addClass(this.element,p);}},configVisible:function(x,w,t){var p=w[0],B=f.getStyle(this.element,"visibility"),o=this._cachedEffects||this._createEffects(this.cfg.getProperty("effect")),A=(this.platform=="mac"&&k.gecko),y=d.alreadySubscribed,q,v,s,r,u,z;if(B=="inherit"){v=this.element.parentNode;while(v.nodeType!=9&&v.nodeType!=11){B=f.getStyle(v,"visibility");if(B!="inherit"){break;}v=v.parentNode;}if(B=="inherit"){B="visible";}}if(p){if(A){this.showMacGeckoScrollbars();}if(o){if(p){if(B!="visible"||B===""||this._fadingOut){if(this.beforeShowEvent.fire()){z=o.length;for(s=0;s<z;s++){q=o[s];if(s===0&&!y(q.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){q.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}q.animateIn();}}}}}else{if(B!="visible"||B===""){if(this.beforeShowEvent.fire()){this._setDomVisibility(true);this.cfg.refireEvent("iframe");this.showEvent.fire();}}else{this._setDomVisibility(true);}}}else{if(A){this.hideMacGeckoScrollbars();}if(o){if(B=="visible"||this._fadingIn){if(this.beforeHideEvent.fire()){z=o.length;for(r=0;r<z;r++){u=o[r];if(r===0&&!y(u.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){u.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}u.animateOut();}}}else{if(B===""){this._setDomVisibility(false);}}}else{if(B=="visible"||B===""){if(this.beforeHideEvent.fire()){this._setDomVisibility(false);this.hideEvent.fire();}}else{this._setDomVisibility(false);}}}},doCenterOnDOMEvent:function(){var o=this.cfg,p=o.getProperty("fixedcenter");if(o.getProperty("visible")){if(p&&(p!==c||this.fitsInViewport())){this.center();}}},fitsInViewport:function(){var s=b.VIEWPORT_OFFSET,q=this.element,t=q.offsetWidth,r=q.offsetHeight,o=f.getViewportWidth(),p=f.getViewportHeight();return((t+s<o)&&(r+s<p));},configFixedCenter:function(s,q,t){var u=q[0],p=d.alreadySubscribed,r=b.windowResizeEvent,o=b.windowScrollEvent;if(u){this.center();if(!p(this.beforeShowEvent,this.center)){this.beforeShowEvent.subscribe(this.center);}if(!p(r,this.doCenterOnDOMEvent,this)){r.subscribe(this.doCenterOnDOMEvent,this,true);}if(!p(o,this.doCenterOnDOMEvent,this)){o.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);r.unsubscribe(this.doCenterOnDOMEvent,this);o.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(r,p,s){var o=p[0],q=this.element;f.setStyle(q,"height",o);this.cfg.refireEvent("iframe");},configAutoFillHeight:function(t,s,p){var v=s[0],q=this.cfg,u="autofillheight",w="height",r=q.getProperty(u),o=this._autoFillOnHeightChange;q.unsubscribeFromConfigEvent(w,o);g.textResizeEvent.unsubscribe(o);this.changeContentEvent.unsubscribe(o);if(r&&v!==r&&this[r]){f.setStyle(this[r],w,"");}if(v){v=i.trim(v.toLowerCase());q.subscribeToConfigEvent(w,o,this[v],this);g.textResizeEvent.subscribe(o,this[v],this);this.changeContentEvent.subscribe(o,this[v],this);q.setProperty(u,v,true);}},configWidth:function(r,o,s){var q=o[0],p=this.element;f.setStyle(p,"width",q);this.cfg.refireEvent("iframe");},configzIndex:function(q,o,r){var s=o[0],p=this.element;if(!s){s=f.getStyle(p,"zIndex");if(!s||isNaN(s)){s=0;}}if(this.iframe||this.cfg.getProperty("iframe")===true){if(s<=0){s=1;}}f.setStyle(p,"zIndex",s);this.cfg.setProperty("zIndex",s,true);if(this.iframe){this.stackIframe();}},configXY:function(q,p,r){var t=p[0],o=t[0],s=t[1];this.cfg.setProperty("x",o);this.cfg.setProperty("y",s);this.beforeMoveEvent.fire([o,s]);o=this.cfg.getProperty("x");s=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([o,s]);},configX:function(q,p,r){var o=p[0],s=this.cfg.getProperty("y");this.cfg.setProperty("x",o,true);this.cfg.setProperty("y",s,true);this.beforeMoveEvent.fire([o,s]);o=this.cfg.getProperty("x");s=this.cfg.getProperty("y");f.setX(this.element,o,true);this.cfg.setProperty("xy",[o,s],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([o,s]);},configY:function(q,p,r){var o=this.cfg.getProperty("x"),s=p[0];this.cfg.setProperty("x",o,true);this.cfg.setProperty("y",s,true);this.beforeMoveEvent.fire([o,s]);o=this.cfg.getProperty("x");s=this.cfg.getProperty("y");f.setY(this.element,s,true);
this.cfg.setProperty("xy",[o,s],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([o,s]);},showIframe:function(){var p=this.iframe,o;if(p){o=this.element.parentNode;if(o!=p.parentNode){this._addToParent(o,p);}p.style.display="block";}},hideIframe:function(){if(this.iframe){this.iframe.style.display="none";}},syncIframe:function(){var o=this.iframe,q=this.element,s=b.IFRAME_OFFSET,p=(s*2),r;if(o){o.style.width=(q.offsetWidth+p+"px");o.style.height=(q.offsetHeight+p+"px");r=this.cfg.getProperty("xy");if(!i.isArray(r)||(isNaN(r[0])||isNaN(r[1]))){this.syncPosition();r=this.cfg.getProperty("xy");}f.setXY(o,[(r[0]-s),(r[1]-s)]);}},stackIframe:function(){if(this.iframe){var o=f.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(o)&&!isNaN(o)){f.setStyle(this.iframe,"zIndex",(o-1));}}},configIframe:function(r,q,s){var o=q[0];function t(){var v=this.iframe,w=this.element,x;if(!v){if(!j){j=document.createElement("iframe");if(this.isSecure){j.src=b.IFRAME_SRC;}if(k.ie){j.style.filter="alpha(opacity=0)";j.frameBorder=0;}else{j.style.opacity="0";}j.style.position="absolute";j.style.border="none";j.style.margin="0";j.style.padding="0";j.style.display="none";j.tabIndex=-1;j.className=b.CSS_IFRAME;}v=j.cloneNode(false);v.id=this.id+"_f";x=w.parentNode;var u=x||document.body;this._addToParent(u,v);this.iframe=v;}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 p(){t.call(this);this.beforeShowEvent.unsubscribe(p);this._iframeDeferred=false;}if(o){if(this.cfg.getProperty("visible")){t.call(this);}else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(p);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(p,o,q){var r=o[0];if(r){if(!d.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}if(!d.alreadySubscribed(this.beforeShowEvent,this._primeXYFromDOM)){this.beforeShowEvent.subscribe(this._primeXYFromDOM);}}else{this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(u,t,q){var x=t[0],r,o,v,s,p,w=this.CONTEXT_TRIGGERS;if(x){r=x[0];o=x[1];v=x[2];s=x[3];p=x[4];if(w&&w.length>0){s=(s||[]).concat(w);}if(r){if(typeof r=="string"){this.cfg.setProperty("context",[document.getElementById(r),o,v,s,p],true);}if(o&&v){this.align(o,v,p);}if(this._contextTriggers){this._processTriggers(this._contextTriggers,e,this._alignOnTrigger);}if(s){this._processTriggers(s,h,this._alignOnTrigger);this._contextTriggers=s;}}}},_alignOnTrigger:function(p,o){this.align();},_findTriggerCE:function(o){var p=null;if(o instanceof m){p=o;}else{if(b._TRIGGER_MAP[o]){p=b._TRIGGER_MAP[o];}}return p;},_processTriggers:function(s,v,r){var q,u;for(var p=0,o=s.length;p<o;++p){q=s[p];u=this._findTriggerCE(q);if(u){u[v](r,this,true);}else{this[v](q,r);}}},align:function(p,w,s){var v=this.cfg.getProperty("context"),t=this,o,q,u;function r(z,A){var y=null,x=null;switch(p){case b.TOP_LEFT:y=A;x=z;break;case b.TOP_RIGHT:y=A-q.offsetWidth;x=z;break;case b.BOTTOM_LEFT:y=A;x=z-q.offsetHeight;break;case b.BOTTOM_RIGHT:y=A-q.offsetWidth;x=z-q.offsetHeight;break;}if(y!==null&&x!==null){if(s){y+=s[0];x+=s[1];}t.moveTo(y,x);}}if(v){o=v[0];q=this.element;t=this;if(!p){p=v[1];}if(!w){w=v[2];}if(!s&&v[4]){s=v[4];}if(q&&o){u=f.getRegion(o);switch(w){case b.TOP_LEFT:r(u.top,u.left);break;case b.TOP_RIGHT:r(u.top,u.right);break;case b.BOTTOM_LEFT:r(u.bottom,u.left);break;case b.BOTTOM_RIGHT:r(u.bottom,u.right);break;}}}},enforceConstraints:function(p,o,q){var s=o[0];var r=this.getConstrainedXY(s[0],s[1]);this.cfg.setProperty("x",r[0],true);this.cfg.setProperty("y",r[1],true);this.cfg.setProperty("xy",r,true);},_getConstrainedPos:function(y,p){var t=this.element,r=b.VIEWPORT_OFFSET,A=(y=="x"),z=(A)?t.offsetWidth:t.offsetHeight,s=(A)?f.getViewportWidth():f.getViewportHeight(),D=(A)?f.getDocumentScrollLeft():f.getDocumentScrollTop(),C=(A)?b.PREVENT_OVERLAP_X:b.PREVENT_OVERLAP_Y,o=this.cfg.getProperty("context"),u=(z+r<s),w=this.cfg.getProperty("preventcontextoverlap")&&o&&C[(o[1]+o[2])],v=D+r,B=D+s-z-r,q=p;if(p<v||p>B){if(w){q=this._preventOverlap(y,o[0],z,s,D);}else{if(u){if(p<v){q=v;}else{if(p>B){q=B;}}}else{q=v;}}}return q;},_preventOverlap:function(y,w,z,u,C){var A=(y=="x"),t=b.VIEWPORT_OFFSET,s=this,q=((A)?f.getX(w):f.getY(w))-C,o=(A)?w.offsetWidth:w.offsetHeight,p=q-t,r=(u-(q+o))-t,D=false,v=function(){var x;if((s.cfg.getProperty(y)-C)>q){x=(q-z);}else{x=(q+o);}s.cfg.setProperty(y,(x+C),true);return x;},B=function(){var E=((s.cfg.getProperty(y)-C)>q)?r:p,x;if(z>E){if(D){v();}else{v();D=true;x=B();}}return x;};B();return this.cfg.getProperty(y);},getConstrainedX:function(o){return this._getConstrainedPos("x",o);},getConstrainedY:function(o){return this._getConstrainedPos("y",o);},getConstrainedXY:function(o,p){return[this.getConstrainedX(o),this.getConstrainedY(p)];},center:function(){var r=b.VIEWPORT_OFFSET,s=this.element.offsetWidth,q=this.element.offsetHeight,p=f.getViewportWidth(),t=f.getViewportHeight(),o,u;if(s<p){o=(p/2)-(s/2)+f.getDocumentScrollLeft();}else{o=r+f.getDocumentScrollLeft();}if(q<t){u=(t/2)-(q/2)+f.getDocumentScrollTop();}else{u=r+f.getDocumentScrollTop();}this.cfg.setProperty("xy",[parseInt(o,10),parseInt(u,10)]);this.cfg.refireEvent("iframe");if(k.webkit){this.forceContainerRedraw();}},syncPosition:function(){var o=f.getXY(this.element);
this.cfg.setProperty("x",o[0],true);this.cfg.setProperty("y",o[1],true);this.cfg.setProperty("xy",o,true);},onDomResize:function(q,p){var o=this;b.superclass.onDomResize.call(this,q,p);setTimeout(function(){o.syncPosition();o.cfg.refireEvent("iframe");o.cfg.refireEvent("context");},0);},_getComputedHeight:(function(){if(document.defaultView&&document.defaultView.getComputedStyle){return function(p){var o=null;if(p.ownerDocument&&p.ownerDocument.defaultView){var q=p.ownerDocument.defaultView.getComputedStyle(p,"");if(q){o=parseInt(q.height,10);}}return(i.isNumber(o))?o:null;};}else{return function(p){var o=null;if(p.style.pixelHeight){o=p.style.pixelHeight;}return(i.isNumber(o))?o:null;};}})(),_validateAutoFillHeight:function(o){return(!o)||(i.isString(o)&&b.STD_MOD_RE.test(o));},_autoFillOnHeightChange:function(r,p,q){var o=this.cfg.getProperty("height");if((o&&o!=="auto")||(o===0)){this.fillHeight(q);}},_getPreciseHeight:function(p){var o=p.offsetHeight;if(p.getBoundingClientRect){var q=p.getBoundingClientRect();o=q.bottom-q.top;}return o;},fillHeight:function(r){if(r){var p=this.innerElement||this.element,o=[this.header,this.body,this.footer],v,w=0,x=0,t=0,q=false;for(var u=0,s=o.length;u<s;u++){v=o[u];if(v){if(r!==v){x+=this._getPreciseHeight(v);}else{q=true;}}}if(q){if(k.ie||k.opera){f.setStyle(r,"height",0+"px");}w=this._getComputedHeight(p);if(w===null){f.addClass(p,"yui-override-padding");w=p.clientHeight;f.removeClass(p,"yui-override-padding");}t=Math.max(w-x,0);f.setStyle(r,"height",t+"px");if(r.offsetHeight!=t){t=Math.max(t-(r.offsetHeight-t),0);}f.setStyle(r,"height",t+"px");}}},bringToTop:function(){var s=[],r=this.element;function v(z,y){var B=f.getStyle(z,"zIndex"),A=f.getStyle(y,"zIndex"),x=(!B||isNaN(B))?0:parseInt(B,10),w=(!A||isNaN(A))?0:parseInt(A,10);if(x>w){return -1;}else{if(x<w){return 1;}else{return 0;}}}function q(y){var x=f.hasClass(y,b.CSS_OVERLAY),w=YAHOO.widget.Panel;if(x&&!f.isAncestor(r,y)){if(w&&f.hasClass(y,w.CSS_PANEL)){s[s.length]=y.parentNode;}else{s[s.length]=y;}}}f.getElementsBy(q,"div",document.body);s.sort(v);var o=s[0],u;if(o){u=f.getStyle(o,"zIndex");if(!isNaN(u)){var t=false;if(o!=r){t=true;}else{if(s.length>1){var p=f.getStyle(s[1],"zIndex");if(!isNaN(p)&&(u==p)){t=true;}}}if(t){this.cfg.setProperty("zindex",(parseInt(u,10)+2));}}}},destroy:function(o){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}this.iframe=null;b.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);b.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);g.textResizeEvent.unsubscribe(this._autoFillOnHeightChange);if(this._contextTriggers){this._processTriggers(this._contextTriggers,e,this._alignOnTrigger);}b.superclass.destroy.call(this,o);},forceContainerRedraw:function(){var o=this;f.addClass(o.element,"yui-force-redraw");setTimeout(function(){f.removeClass(o.element,"yui-force-redraw");},0);},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){k.focus();}};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);m.focusEvent.unsubscribe(this._onOverlayFocusHandler,m);m.blurEvent.unsubscribe(this._onOverlayBlurHandler,m);if(!l){c.removeListener(m.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);m.cfg.setProperty("zIndex",j,true);m.cfg.setProperty("manager",null);}if(m.focusEvent._managed){m.focusEvent=null;}if(m.blurEvent._managed){m.blurEvent=null;}if(m.focus._managed){m.focus=null;}if(m.blur._managed){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._manageBlur=function(j){var k=false;if(h==j){e.removeClass(h.element,a.CSS_FOCUSED);h=null;k=true;}return k;};this._manageFocus=function(j){var k=false;if(h!=j){if(h){h.blur();}h=j;this.bringToTop(h);e.addClass(h.element,a.CSS_FOCUSED);k=true;}return k;};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);},_onOverlayFocusHandler:function(h,g,i){this._manageFocus(i);},_onOverlayBlurHandler:function(h,g,i){this._manageBlur(i);},_bindFocus:function(g){var h=this;if(!g.focusEvent){g.focusEvent=g.createEvent("focus");g.focusEvent.signature=f.LIST;g.focusEvent._managed=true;}else{g.focusEvent.subscribe(h._onOverlayFocusHandler,g,h);}if(!g.focus){c.on(g.element,h.cfg.getProperty("focusevent"),h._onOverlayElementFocus,null,g);g.focus=function(){if(h._manageFocus(this)){if(this.cfg.getProperty("visible")&&this.focusFirst){this.focusFirst();}this.focusEvent.fire();}};g.focus._managed=true;}},_bindBlur:function(g){var h=this;if(!g.blurEvent){g.blurEvent=g.createEvent("blur");g.blurEvent.signature=f.LIST;g.focusEvent._managed=true;}else{g.blurEvent.subscribe(h._onOverlayBlurHandler,g,h);}if(!g.blur){g.blur=function(){if(h._manageBlur(this)){this.blurEvent.fire();}};g.blur._managed=true;}g.hideEvent.subscribe(g.blur);
},_bindDestroy:function(g){var h=this;g.destroyEvent.subscribe(h._onOverlayDestroy,g,h);},_syncZIndex:function(g){var h=e.getStyle(g.element,"zIndex");if(!isNaN(h)){g.cfg.setProperty("zIndex",parseInt(h,10));}else{g.cfg.setProperty("zIndex",0);}},register:function(g){var k=false,h,j;if(g instanceof d){g.cfg.addProperty("manager",{value:this});this._bindFocus(g);this._bindBlur(g);this._bindDestroy(g);this._syncZIndex(g);this.overlays.push(g);this.bringToTop(g);k=true;}else{if(g instanceof Array){for(h=0,j=g.length;h<j;h++){k=this.register(g[h])||k;}}}return k;},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 l=g instanceof d,j=this.overlays,p=j.length,k=null,m,h;if(l||typeof g=="string"){for(h=p-1;h>=0;h--){m=j[h];if((l&&(m===g))||(m.id==g)){k=m;break;}}}return k;},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,j=h.length,g;for(g=j-1;g>=0;g--){h[g].show();}},hideAll:function(){var h=this.overlays,j=h.length,g;for(g=j-1;g>=0;g--){h[g].hide();}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.Tooltip=function(p,o){YAHOO.widget.Tooltip.superclass.constructor.call(this,p,o);};var e=YAHOO.lang,n=YAHOO.util.Event,m=YAHOO.util.CustomEvent,c=YAHOO.util.Dom,j=YAHOO.widget.Tooltip,h=YAHOO.env.ua,g=(h.ie&&(h.ie<=6||document.compatMode=="BackCompat")),f,i={"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},"XY_OFFSET":{key:"xyoffset",value:[0,25],suppressEvent:true}},a={"CONTEXT_MOUSE_OVER":"contextMouseOver","CONTEXT_MOUSE_OUT":"contextMouseOut","CONTEXT_TRIGGER":"contextTrigger"};j.CSS_TOOLTIP="yui-tt";function k(q,o){var p=this.cfg,r=p.getProperty("width");if(r==o){p.setProperty("width",q);}}function d(p,o){if("_originalWidth" in this){k.call(this,this._originalWidth,this._forcedWidth);}var q=document.body,u=this.cfg,t=u.getProperty("width"),r,s;if((!t||t=="auto")&&(u.getProperty("container")!=q||u.getProperty("x")>=c.getViewportWidth()||u.getProperty("y")>=c.getViewportHeight())){s=this.element.cloneNode(true);s.style.visibility="hidden";s.style.top="0px";s.style.left="0px";q.appendChild(s);r=(s.offsetWidth+"px");q.removeChild(s);s=null;u.setProperty("width",r);u.refireEvent("xy");this._originalWidth=t||"";this._forcedWidth=r;}}function b(p,o,q){this.render(q);}function l(){n.onDOMReady(b,this.cfg.getProperty("container"),this);}YAHOO.extend(j,YAHOO.widget.Overlay,{init:function(p,o){j.superclass.init.call(this,p);this.beforeInitEvent.fire(j);c.addClass(this.element,j.CSS_TOOLTIP);if(o){this.cfg.applyConfig(o,true);}this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.subscribe("changeContent",d);this.subscribe("init",l);this.subscribe("render",this.onRender);this.initEvent.fire(j);},initEvents:function(){j.superclass.initEvents.call(this);var o=m.LIST;this.contextMouseOverEvent=this.createEvent(a.CONTEXT_MOUSE_OVER);this.contextMouseOverEvent.signature=o;this.contextMouseOutEvent=this.createEvent(a.CONTEXT_MOUSE_OUT);this.contextMouseOutEvent.signature=o;this.contextTriggerEvent=this.createEvent(a.CONTEXT_TRIGGER);this.contextTriggerEvent.signature=o;},initDefaultConfig:function(){j.superclass.initDefaultConfig.call(this);this.cfg.addProperty(i.PREVENT_OVERLAP.key,{value:i.PREVENT_OVERLAP.value,validator:i.PREVENT_OVERLAP.validator,supercedes:i.PREVENT_OVERLAP.supercedes});this.cfg.addProperty(i.SHOW_DELAY.key,{handler:this.configShowDelay,value:200,validator:i.SHOW_DELAY.validator});this.cfg.addProperty(i.AUTO_DISMISS_DELAY.key,{handler:this.configAutoDismissDelay,value:i.AUTO_DISMISS_DELAY.value,validator:i.AUTO_DISMISS_DELAY.validator});this.cfg.addProperty(i.HIDE_DELAY.key,{handler:this.configHideDelay,value:i.HIDE_DELAY.value,validator:i.HIDE_DELAY.validator});this.cfg.addProperty(i.TEXT.key,{handler:this.configText,suppressEvent:i.TEXT.suppressEvent});this.cfg.addProperty(i.CONTAINER.key,{handler:this.configContainer,value:document.body});this.cfg.addProperty(i.DISABLED.key,{handler:this.configContainer,value:i.DISABLED.value,supressEvent:i.DISABLED.suppressEvent});this.cfg.addProperty(i.XY_OFFSET.key,{value:i.XY_OFFSET.value.concat(),supressEvent:i.XY_OFFSET.suppressEvent});},configText:function(p,o,q){var r=o[0];if(r){this.setBody(r);}},configContainer:function(q,p,r){var o=p[0];if(typeof o=="string"){this.cfg.setProperty("container",document.getElementById(o),true);}},_removeEventListeners:function(){var r=this._context,o,q,p;if(r){o=r.length;if(o>0){p=o-1;do{q=r[p];n.removeListener(q,"mouseover",this.onContextMouseOver);n.removeListener(q,"mousemove",this.onContextMouseMove);n.removeListener(q,"mouseout",this.onContextMouseOut);}while(p--);}}},configContext:function(t,p,u){var s=p[0],v,o,r,q;if(s){if(!(s instanceof Array)){if(typeof s=="string"){this.cfg.setProperty("context",[document.getElementById(s)],true);}else{this.cfg.setProperty("context",[s],true);}s=this.cfg.getProperty("context");}this._removeEventListeners();this._context=s;v=this._context;if(v){o=v.length;if(o>0){q=o-1;do{r=v[q];n.on(r,"mouseover",this.onContextMouseOver,this);
n.on(r,"mousemove",this.onContextMouseMove,this);n.on(r,"mouseout",this.onContextMouseOut,this);}while(q--);}}}},onContextMouseMove:function(p,o){o.pageX=n.getPageX(p);o.pageY=n.getPageY(p);},onContextMouseOver:function(q,p){var o=this;if(o.title){p._tempTitle=o.title;o.title="";}if(p.fireEvent("contextMouseOver",o,q)!==false&&!p.cfg.getProperty("disabled")){if(p.hideProcId){clearTimeout(p.hideProcId);p.hideProcId=null;}n.on(o,"mousemove",p.onContextMouseMove,p);p.showProcId=p.doShow(q,o);}},onContextMouseOut:function(q,p){var o=this;if(p._tempTitle){o.title=p._tempTitle;p._tempTitle=null;}if(p.showProcId){clearTimeout(p.showProcId);p.showProcId=null;}if(p.hideProcId){clearTimeout(p.hideProcId);p.hideProcId=null;}p.fireEvent("contextMouseOut",o,q);p.hideProcId=setTimeout(function(){p.hide();},p.cfg.getProperty("hidedelay"));},doShow:function(r,o){var t=this.cfg.getProperty("xyoffset"),p=t[0],s=t[1],q=this;if(h.opera&&o.tagName&&o.tagName.toUpperCase()=="A"){s+=12;}return setTimeout(function(){var u=q.cfg.getProperty("text");if(q._tempTitle&&(u===""||YAHOO.lang.isUndefined(u)||YAHOO.lang.isNull(u))){q.setBody(q._tempTitle);}else{q.cfg.refireEvent("text");}q.moveTo(q.pageX+p,q.pageY+s);if(q.cfg.getProperty("preventoverlap")){q.preventOverlap(q.pageX,q.pageY);}n.removeListener(o,"mousemove",q.onContextMouseMove);q.contextTriggerEvent.fire(o);q.show();q.hideProcId=q.doHide();},this.cfg.getProperty("showdelay"));},doHide:function(){var o=this;return setTimeout(function(){o.hide();},this.cfg.getProperty("autodismissdelay"));},preventOverlap:function(s,r){var o=this.element.offsetHeight,q=new YAHOO.util.Point(s,r),p=c.getRegion(this.element);p.top-=5;p.left-=5;p.right+=5;p.bottom+=5;if(p.contains(q)){this.cfg.setProperty("y",(r-o-5));}},onRender:function(s,r){function t(){var w=this.element,v=this.underlay;if(v){v.style.width=(w.offsetWidth+6)+"px";v.style.height=(w.offsetHeight+1)+"px";}}function p(){c.addClass(this.underlay,"yui-tt-shadow-visible");if(h.ie){this.forceUnderlayRedraw();}}function o(){c.removeClass(this.underlay,"yui-tt-shadow-visible");}function u(){var x=this.underlay,w,v,z,y;if(!x){w=this.element;v=YAHOO.widget.Module;z=h.ie;y=this;if(!f){f=document.createElement("div");f.className="yui-tt-shadow";}x=f.cloneNode(false);w.appendChild(x);this.underlay=x;this._shadow=this.underlay;p.call(this);this.subscribe("beforeShow",p);this.subscribe("hide",o);if(g){window.setTimeout(function(){t.call(y);},0);this.cfg.subscribeToConfigEvent("width",t);this.cfg.subscribeToConfigEvent("height",t);this.subscribe("changeContent",t);v.textResizeEvent.subscribe(t,this,true);this.subscribe("destroy",function(){v.textResizeEvent.unsubscribe(t,this);});}}}function q(){u.call(this);this.unsubscribe("beforeShow",q);}if(this.cfg.getProperty("visible")){u.call(this);}else{this.subscribe("beforeShow",q);}},forceUnderlayRedraw:function(){var o=this;c.addClass(o.underlay,"yui-force-redraw");setTimeout(function(){c.removeClass(o.underlay,"yui-force-redraw");},0);},destroy:function(){this._removeEventListeners();j.superclass.destroy.call(this);},toString:function(){return"Tooltip "+this.id;}});}());(function(){YAHOO.widget.Panel=function(v,u){YAHOO.widget.Panel.superclass.constructor.call(this,v,u);};var s=null;var e=YAHOO.lang,f=YAHOO.util,a=f.Dom,t=f.Event,m=f.CustomEvent,k=YAHOO.util.KeyListener,i=f.Config,h=YAHOO.widget.Overlay,o=YAHOO.widget.Panel,l=YAHOO.env.ua,p=(l.ie&&(l.ie<=6||document.compatMode=="BackCompat")),g,q,c,d={"BEFORE_SHOW_MASK":"beforeShowMask","BEFORE_HIDE_MASK":"beforeHideMask","SHOW_MASK":"showMask","HIDE_MASK":"hideMask","DRAG":"drag"},n={"CLOSE":{key:"close",value:true,validator:e.isBoolean,supercedes:["visible"]},"DRAGGABLE":{key:"draggable",value:(f.DD?true:false),validator:e.isBoolean,supercedes:["visible"]},"DRAG_ONLY":{key:"dragonly",value:false,validator:e.isBoolean,supercedes:["draggable"]},"UNDERLAY":{key:"underlay",value:"shadow",supercedes:["visible"]},"MODAL":{key:"modal",value:false,validator:e.isBoolean,supercedes:["visible","zindex"]},"KEY_LISTENERS":{key:"keylisteners",suppressEvent:true,supercedes:["visible"]},"STRINGS":{key:"strings",supercedes:["close"],validator:e.isObject,value:{close:"Close"}}};o.CSS_PANEL="yui-panel";o.CSS_PANEL_CONTAINER="yui-panel-container";o.FOCUSABLE=["a","button","select","textarea","input","iframe"];function j(v,u){if(!this.header&&this.cfg.getProperty("draggable")){this.setHeader("&#160;");}}function r(v,u,w){var z=w[0],x=w[1],y=this.cfg,A=y.getProperty("width");if(A==x){y.setProperty("width",z);}this.unsubscribe("hide",r,w);}function b(v,u){var y,x,w;if(p){y=this.cfg;x=y.getProperty("width");if(!x||x=="auto"){w=(this.element.offsetWidth+"px");y.setProperty("width",w);this.subscribe("hide",r,[(x||""),w]);}}}YAHOO.extend(o,h,{init:function(v,u){o.superclass.init.call(this,v);this.beforeInitEvent.fire(o);a.addClass(this.element,o.CSS_PANEL);this.buildWrapper();if(u){this.cfg.applyConfig(u,true);}this.subscribe("showMask",this._addFocusHandlers);this.subscribe("hideMask",this._removeFocusHandlers);this.subscribe("beforeRender",j);this.subscribe("render",function(){this.setFirstLastFocusable();this.subscribe("changeContent",this.setFirstLastFocusable);});this.subscribe("show",this._focusOnShow);this.initEvent.fire(o);},_onElementFocus:function(z){if(s===this){var y=t.getTarget(z),x=document.documentElement,v=(y!==x&&y!==window);if(v&&y!==this.element&&y!==this.mask&&!a.isAncestor(this.element,y)){try{this._focusFirstModal();}catch(w){try{if(v&&y!==document.body){y.blur();}}catch(u){}}}}},_focusFirstModal:function(){var u=this.firstElement;if(u){u.focus();}else{if(this._modalFocus){this._modalFocus.focus();}else{this.innerElement.focus();}}},_addFocusHandlers:function(v,u){if(!this.firstElement){if(l.webkit||l.opera){if(!this._modalFocus){this._createHiddenFocusElement();}}else{this.innerElement.tabIndex=0;}}this._setTabLoop(this.firstElement,this.lastElement);t.onFocus(document.documentElement,this._onElementFocus,this,true);s=this;},_createHiddenFocusElement:function(){var u=document.createElement("button");
u.style.height="1px";u.style.width="1px";u.style.position="absolute";u.style.left="-10000em";u.style.opacity=0;u.tabIndex=-1;this.innerElement.appendChild(u);this._modalFocus=u;},_removeFocusHandlers:function(v,u){t.removeFocusListener(document.documentElement,this._onElementFocus,this);if(s==this){s=null;}},_focusOnShow:function(v,u,w){if(u&&u[1]){t.stopEvent(u[1]);}if(!this.focusFirst(v,u,w)){if(this.cfg.getProperty("modal")){this._focusFirstModal();}}},focusFirst:function(w,u,z){var v=this.firstElement,y=false;if(u&&u[1]){t.stopEvent(u[1]);}if(v){try{v.focus();y=true;}catch(x){}}return y;},focusLast:function(w,u,z){var v=this.lastElement,y=false;if(u&&u[1]){t.stopEvent(u[1]);}if(v){try{v.focus();y=true;}catch(x){}}return y;},_setTabLoop:function(u,v){this.setTabLoop(u,v);},setTabLoop:function(x,z){var v=this.preventBackTab,w=this.preventTabOut,u=this.showEvent,y=this.hideEvent;if(v){v.disable();u.unsubscribe(v.enable,v);y.unsubscribe(v.disable,v);v=this.preventBackTab=null;}if(w){w.disable();u.unsubscribe(w.enable,w);y.unsubscribe(w.disable,w);w=this.preventTabOut=null;}if(x){this.preventBackTab=new k(x,{shift:true,keys:9},{fn:this.focusLast,scope:this,correctScope:true});v=this.preventBackTab;u.subscribe(v.enable,v,true);y.subscribe(v.disable,v,true);}if(z){this.preventTabOut=new k(z,{shift:false,keys:9},{fn:this.focusFirst,scope:this,correctScope:true});w=this.preventTabOut;u.subscribe(w.enable,w,true);y.subscribe(w.disable,w,true);}},getFocusableElements:function(v){v=v||this.innerElement;var x={},u=this;for(var w=0;w<o.FOCUSABLE.length;w++){x[o.FOCUSABLE[w]]=true;}return a.getElementsBy(function(y){return u._testIfFocusable(y,x);},null,v);},_testIfFocusable:function(u,v){if(u.focus&&u.type!=="hidden"&&!u.disabled&&v[u.tagName.toLowerCase()]){return true;}return false;},setFirstLastFocusable:function(){this.firstElement=null;this.lastElement=null;var u=this.getFocusableElements();this.focusableElements=u;if(u.length>0){this.firstElement=u[0];this.lastElement=u[u.length-1];}if(this.cfg.getProperty("modal")){this._setTabLoop(this.firstElement,this.lastElement);}},initEvents:function(){o.superclass.initEvents.call(this);var u=m.LIST;this.showMaskEvent=this.createEvent(d.SHOW_MASK);this.showMaskEvent.signature=u;this.beforeShowMaskEvent=this.createEvent(d.BEFORE_SHOW_MASK);this.beforeShowMaskEvent.signature=u;this.hideMaskEvent=this.createEvent(d.HIDE_MASK);this.hideMaskEvent.signature=u;this.beforeHideMaskEvent=this.createEvent(d.BEFORE_HIDE_MASK);this.beforeHideMaskEvent.signature=u;this.dragEvent=this.createEvent(d.DRAG);this.dragEvent.signature=u;},initDefaultConfig:function(){o.superclass.initDefaultConfig.call(this);this.cfg.addProperty(n.CLOSE.key,{handler:this.configClose,value:n.CLOSE.value,validator:n.CLOSE.validator,supercedes:n.CLOSE.supercedes});this.cfg.addProperty(n.DRAGGABLE.key,{handler:this.configDraggable,value:(f.DD)?true:false,validator:n.DRAGGABLE.validator,supercedes:n.DRAGGABLE.supercedes});this.cfg.addProperty(n.DRAG_ONLY.key,{value:n.DRAG_ONLY.value,validator:n.DRAG_ONLY.validator,supercedes:n.DRAG_ONLY.supercedes});this.cfg.addProperty(n.UNDERLAY.key,{handler:this.configUnderlay,value:n.UNDERLAY.value,supercedes:n.UNDERLAY.supercedes});this.cfg.addProperty(n.MODAL.key,{handler:this.configModal,value:n.MODAL.value,validator:n.MODAL.validator,supercedes:n.MODAL.supercedes});this.cfg.addProperty(n.KEY_LISTENERS.key,{handler:this.configKeyListeners,suppressEvent:n.KEY_LISTENERS.suppressEvent,supercedes:n.KEY_LISTENERS.supercedes});this.cfg.addProperty(n.STRINGS.key,{value:n.STRINGS.value,handler:this.configStrings,validator:n.STRINGS.validator,supercedes:n.STRINGS.supercedes});},configClose:function(y,v,z){var A=v[0],x=this.close,u=this.cfg.getProperty("strings"),w;if(A){if(!x){if(!c){c=document.createElement("a");c.className="container-close";c.href="#";}x=c.cloneNode(true);w=this.innerElement.firstChild;if(w){this.innerElement.insertBefore(x,w);}else{this.innerElement.appendChild(x);}x.innerHTML=(u&&u.close)?u.close:"&#160;";t.on(x,"click",this._doClose,this,true);this.close=x;}else{x.style.display="block";}}else{if(x){x.style.display="none";}}},_doClose:function(u){t.preventDefault(u);this.hide();},configDraggable:function(v,u,w){var x=u[0];if(x){if(!f.DD){this.cfg.setProperty("draggable",false);return;}if(this.header){a.setStyle(this.header,"cursor","move");this.registerDragDrop();}this.subscribe("beforeShow",b);}else{if(this.dd){this.dd.unreg();}if(this.header){a.setStyle(this.header,"cursor","auto");}this.unsubscribe("beforeShow",b);}},configUnderlay:function(D,C,z){var B=(this.platform=="mac"&&l.gecko),E=C[0].toLowerCase(),v=this.underlay,w=this.element;function x(){var F=false;if(!v){if(!q){q=document.createElement("div");q.className="underlay";}v=q.cloneNode(false);this.element.appendChild(v);this.underlay=v;if(p){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(l.webkit&&l.webkit<420){this.changeContentEvent.subscribe(this.forceUnderlayRedraw);}F=true;}}function A(){var F=x.call(this);if(!F&&p){this.sizeUnderlay();}this._underlayDeferred=false;this.beforeShowEvent.unsubscribe(A);}function y(){if(this._underlayDeferred){this.beforeShowEvent.unsubscribe(A);this._underlayDeferred=false;}if(v){this.cfg.unsubscribeFromConfigEvent("width",this.sizeUnderlay);this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.forceUnderlayRedraw);YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay,this,true);this.element.removeChild(v);this.underlay=null;}}switch(E){case"shadow":a.removeClass(w,"matte");a.addClass(w,"shadow");break;case"matte":if(!B){y.call(this);}a.removeClass(w,"shadow");a.addClass(w,"matte");break;default:if(!B){y.call(this);
}a.removeClass(w,"shadow");a.removeClass(w,"matte");break;}if((E=="shadow")||(B&&!v)){if(this.cfg.getProperty("visible")){var u=x.call(this);if(!u&&p){this.sizeUnderlay();}}else{if(!this._underlayDeferred){this.beforeShowEvent.subscribe(A);this._underlayDeferred=true;}}}},configModal:function(v,u,x){var w=u[0];if(w){if(!this._hasModalityEventListeners){this.subscribe("beforeShow",this.buildMask);this.subscribe("beforeShow",this.bringToTop);this.subscribe("beforeShow",this.showMask);this.subscribe("hide",this.hideMask);h.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);h.windowResizeEvent.unsubscribe(this.sizeMask,this);this._hasModalityEventListeners=false;}}},removeMask:function(){var v=this.mask,u;if(v){this.hideMask();u=v.parentNode;if(u){u.removeChild(v);}this.mask=null;}},configKeyListeners:function(x,u,A){var w=u[0],z,y,v;if(w){if(w instanceof Array){y=w.length;for(v=0;v<y;v++){z=w[v];if(!i.alreadySubscribed(this.showEvent,z.enable,z)){this.showEvent.subscribe(z.enable,z,true);}if(!i.alreadySubscribed(this.hideEvent,z.disable,z)){this.hideEvent.subscribe(z.disable,z,true);this.destroyEvent.subscribe(z.disable,z,true);}}}else{if(!i.alreadySubscribed(this.showEvent,w.enable,w)){this.showEvent.subscribe(w.enable,w,true);}if(!i.alreadySubscribed(this.hideEvent,w.disable,w)){this.hideEvent.subscribe(w.disable,w,true);this.destroyEvent.subscribe(w.disable,w,true);}}}},configStrings:function(v,u,w){var x=e.merge(n.STRINGS.value,u[0]);this.cfg.setProperty(n.STRINGS.key,x,true);},configHeight:function(x,v,y){var u=v[0],w=this.innerElement;a.setStyle(w,"height",u);this.cfg.refireEvent("iframe");},_autoFillOnHeightChange:function(x,v,w){o.superclass._autoFillOnHeightChange.apply(this,arguments);if(p){var u=this;setTimeout(function(){u.sizeUnderlay();},0);}},configWidth:function(x,u,y){var w=u[0],v=this.innerElement;a.setStyle(v,"width",w);this.cfg.refireEvent("iframe");},configzIndex:function(v,u,x){o.superclass.configzIndex.call(this,v,u,x);if(this.mask||this.cfg.getProperty("modal")===true){var w=a.getStyle(this.element,"zIndex");if(!w||isNaN(w)){w=0;}if(w===0){this.cfg.setProperty("zIndex",1);}else{this.stackMask();}}},buildWrapper:function(){var w=this.element.parentNode,u=this.element,v=document.createElement("div");v.className=o.CSS_PANEL_CONTAINER;v.id=u.id+"_c";if(w){w.insertBefore(v,u);}v.appendChild(u);this.element=v;this.innerElement=u;a.setStyle(this.innerElement,"visibility","inherit");},sizeUnderlay:function(){var v=this.underlay,u;if(v){u=this.element;v.style.width=u.offsetWidth+"px";v.style.height=u.offsetHeight+"px";}},registerDragDrop:function(){var v=this;if(this.header){if(!f.DD){return;}var u=(this.cfg.getProperty("dragonly")===true);this.dd=new f.DD(this.element.id,this.id,{dragOnly:u});if(!this.header.id){this.header.id=this.id+"_h";}this.dd.startDrag=function(){var x,z,w,C,B,A;if(YAHOO.env.ua.ie==6){a.addClass(v.element,"drag");}if(v.cfg.getProperty("constraintoviewport")){var y=h.VIEWPORT_OFFSET;x=v.element.offsetHeight;z=v.element.offsetWidth;w=a.getViewportWidth();C=a.getViewportHeight();B=a.getDocumentScrollLeft();A=a.getDocumentScrollTop();if(x+y<C){this.minY=A+y;this.maxY=A+C-x-y;}else{this.minY=A+y;this.maxY=A+y;}if(z+y<w){this.minX=B+y;this.maxX=B+w-z-y;}else{this.minX=B+y;this.maxX=B+y;}this.constrainX=true;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}v.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){v.syncPosition();v.cfg.refireEvent("iframe");if(this.platform=="mac"&&YAHOO.env.ua.gecko){this.showMacGeckoScrollbars();}v.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(YAHOO.env.ua.ie==6){a.removeClass(v.element,"drag");}v.dragEvent.fire("endDrag",arguments);v.moveEvent.fire(v.cfg.getProperty("xy"));};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}},buildMask:function(){var u=this.mask;if(!u){if(!g){g=document.createElement("div");g.className="mask";g.innerHTML="&#160;";}u=g.cloneNode(true);u.id=this.id+"_mask";document.body.insertBefore(u,document.body.firstChild);this.mask=u;if(YAHOO.env.ua.gecko&&this.platform=="mac"){a.addClass(this.mask,"block-scrollbars");}this.stackMask();}},hideMask:function(){if(this.cfg.getProperty("modal")&&this.mask&&this.beforeHideMaskEvent.fire()){this.mask.style.display="none";a.removeClass(document.body,"masked");this.hideMaskEvent.fire();}},showMask:function(){if(this.cfg.getProperty("modal")&&this.mask&&this.beforeShowMaskEvent.fire()){a.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}},sizeMask:function(){if(this.mask){var v=this.mask,w=a.getViewportWidth(),u=a.getViewportHeight();if(v.offsetHeight>u){v.style.height=u+"px";}if(v.offsetWidth>w){v.style.width=w+"px";}v.style.height=a.getDocumentHeight()+"px";v.style.width=a.getDocumentWidth()+"px";}},stackMask:function(){if(this.mask){var u=a.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(u)&&!isNaN(u)){a.setStyle(this.mask,"zIndex",u-1);}}},render:function(u){return o.superclass.render.call(this,u,this.innerElement);},_renderHeader:function(u){u=u||this.innerElement;o.superclass._renderHeader.call(this,u);},_renderBody:function(u){u=u||this.innerElement;o.superclass._renderBody.call(this,u);},_renderFooter:function(u){u=u||this.innerElement;o.superclass._renderFooter.call(this,u);},destroy:function(u){h.windowResizeEvent.unsubscribe(this.sizeMask,this);this.removeMask();if(this.close){t.purgeElement(this.close);}o.superclass.destroy.call(this,u);},forceUnderlayRedraw:function(){var v=this.underlay;a.addClass(v,"yui-force-redraw");
setTimeout(function(){a.removeClass(v,"yui-force-redraw");},0);},toString:function(){return"Panel "+this.id;}});}());(function(){YAHOO.widget.Dialog=function(j,i){YAHOO.widget.Dialog.superclass.constructor.call(this,j,i);};var b=YAHOO.util.Event,g=YAHOO.util.CustomEvent,e=YAHOO.util.Dom,a=YAHOO.widget.Dialog,f=YAHOO.lang,h={"BEFORE_SUBMIT":"beforeSubmit","SUBMIT":"submit","MANUAL_SUBMIT":"manualSubmit","ASYNC_SUBMIT":"asyncSubmit","FORM_SUBMIT":"formSubmit","CANCEL":"cancel"},c={"POST_METHOD":{key:"postmethod",value:"async"},"POST_DATA":{key:"postdata",value:null},"BUTTONS":{key:"buttons",value:"none",supercedes:["visible"]},"HIDEAFTERSUBMIT":{key:"hideaftersubmit",value:true}};a.CSS_DIALOG="yui-dialog";function d(){var m=this._aButtons,k,l,j;if(f.isArray(m)){k=m.length;if(k>0){j=k-1;do{l=m[j];if(YAHOO.widget.Button&&l instanceof YAHOO.widget.Button){l.destroy();}else{if(l.tagName.toUpperCase()=="BUTTON"){b.purgeElement(l);b.purgeElement(l,false);}}}while(j--);}}}YAHOO.extend(a,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){a.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty(c.POST_METHOD.key,{handler:this.configPostMethod,value:c.POST_METHOD.value,validator:function(i){if(i!="form"&&i!="async"&&i!="none"&&i!="manual"){return false;}else{return true;}}});this.cfg.addProperty(c.POST_DATA.key,{value:c.POST_DATA.value});this.cfg.addProperty(c.HIDEAFTERSUBMIT.key,{value:c.HIDEAFTERSUBMIT.value});this.cfg.addProperty(c.BUTTONS.key,{handler:this.configButtons,value:c.BUTTONS.value,supercedes:c.BUTTONS.supercedes});},initEvents:function(){a.superclass.initEvents.call(this);var i=g.LIST;this.beforeSubmitEvent=this.createEvent(h.BEFORE_SUBMIT);this.beforeSubmitEvent.signature=i;this.submitEvent=this.createEvent(h.SUBMIT);this.submitEvent.signature=i;this.manualSubmitEvent=this.createEvent(h.MANUAL_SUBMIT);this.manualSubmitEvent.signature=i;this.asyncSubmitEvent=this.createEvent(h.ASYNC_SUBMIT);this.asyncSubmitEvent.signature=i;this.formSubmitEvent=this.createEvent(h.FORM_SUBMIT);this.formSubmitEvent.signature=i;this.cancelEvent=this.createEvent(h.CANCEL);this.cancelEvent.signature=i;},init:function(j,i){a.superclass.init.call(this,j);this.beforeInitEvent.fire(a);e.addClass(this.element,a.CSS_DIALOG);this.cfg.setProperty("visible",false);if(i){this.cfg.applyConfig(i,true);}this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.subscribe("changeBody",this.registerForm);this.initEvent.fire(a);},doSubmit:function(){var q=YAHOO.util.Connect,r=this.form,l=false,o=false,s,n,m,j;switch(this.cfg.getProperty("postmethod")){case"async":s=r.elements;n=s.length;if(n>0){m=n-1;do{if(s[m].type=="file"){l=true;break;}}while(m--);}if(l&&YAHOO.env.ua.ie&&this.isSecure){o=true;}j=this._getFormAttributes(r);q.setForm(r,l,o);var k=this.cfg.getProperty("postdata");var p=q.asyncRequest(j.method,j.action,this.callback,k);this.asyncSubmitEvent.fire(p);break;case"form":r.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}},_getFormAttributes:function(k){var i={method:null,action:null};if(k){if(k.getAttributeNode){var j=k.getAttributeNode("action");var l=k.getAttributeNode("method");if(j){i.action=j.value;}if(l){i.method=l.value;}}else{i.action=k.getAttribute("action");i.method=k.getAttribute("method");}}i.method=(f.isString(i.method)?i.method:"POST").toUpperCase();i.action=f.isString(i.action)?i.action:"";return i;},registerForm:function(){var i=this.element.getElementsByTagName("form")[0];if(this.form){if(this.form==i&&e.isAncestor(this.element,this.form)){return;}else{b.purgeElement(this.form);this.form=null;}}if(!i){i=document.createElement("form");i.name="frm_"+this.id;this.body.appendChild(i);}if(i){this.form=i;b.on(i,"submit",this._submitHandler,this,true);}},_submitHandler:function(i){b.stopEvent(i);this.submit();this.form.blur();},setTabLoop:function(i,j){i=i||this.firstButton;j=j||this.lastButton;a.superclass.setTabLoop.call(this,i,j);},_setTabLoop:function(i,j){i=i||this.firstButton;j=this.lastButton||j;this.setTabLoop(i,j);},setFirstLastFocusable:function(){a.superclass.setFirstLastFocusable.call(this);var k,j,m,n=this.focusableElements;this.firstFormElement=null;this.lastFormElement=null;if(this.form&&n&&n.length>0){j=n.length;for(k=0;k<j;++k){m=n[k];if(this.form===m.form){this.firstFormElement=m;break;}}for(k=j-1;k>=0;--k){m=n[k];if(this.form===m.form){this.lastFormElement=m;break;}}}},configClose:function(j,i,k){a.superclass.configClose.apply(this,arguments);},_doClose:function(i){b.preventDefault(i);this.cancel();},configButtons:function(t,s,n){var o=YAHOO.widget.Button,v=s[0],l=this.innerElement,u,q,k,r,p,j,m;d.call(this);this._aButtons=null;if(f.isArray(v)){p=document.createElement("span");p.className="button-group";r=v.length;this._aButtons=[];this.defaultHtmlButton=null;for(m=0;m<r;m++){u=v[m];if(o){k=new o({label:u.text,type:u.type});k.appendTo(p);q=k.get("element");if(u.isDefault){k.addClass("default");this.defaultHtmlButton=q;}if(f.isFunction(u.handler)){k.set("onclick",{fn:u.handler,obj:this,scope:this});}else{if(f.isObject(u.handler)&&f.isFunction(u.handler.fn)){k.set("onclick",{fn:u.handler.fn,obj:((!f.isUndefined(u.handler.obj))?u.handler.obj:this),scope:(u.handler.scope||this)});}}this._aButtons[this._aButtons.length]=k;}else{q=document.createElement("button");q.setAttribute("type","button");if(u.isDefault){q.className="default";this.defaultHtmlButton=q;}q.innerHTML=u.text;if(f.isFunction(u.handler)){b.on(q,"click",u.handler,this,true);}else{if(f.isObject(u.handler)&&f.isFunction(u.handler.fn)){b.on(q,"click",u.handler.fn,((!f.isUndefined(u.handler.obj))?u.handler.obj:this),(u.handler.scope||this));}}p.appendChild(q);this._aButtons[this._aButtons.length]=q;}u.htmlButton=q;if(m===0){this.firstButton=q;}if(m==(r-1)){this.lastButton=q;}}this.setFooter(p);j=this.footer;if(e.inDocument(this.element)&&!e.isAncestor(l,j)){l.appendChild(j);}this.buttonSpan=p;}else{p=this.buttonSpan;
j=this.footer;if(p&&j){j.removeChild(p);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}this.changeContentEvent.fire();},getButtons:function(){return this._aButtons||null;},focusFirst:function(k,i,n){var j=this.firstFormElement,m=false;if(i&&i[1]){b.stopEvent(i[1]);if(i[0]===9&&this.firstElement){j=this.firstElement;}}if(j){try{j.focus();m=true;}catch(l){}}else{if(this.defaultHtmlButton){m=this.focusDefaultButton();}else{m=this.focusFirstButton();}}return m;},focusLast:function(k,i,n){var o=this.cfg.getProperty("buttons"),j=this.lastFormElement,m=false;if(i&&i[1]){b.stopEvent(i[1]);if(i[0]===9&&this.lastElement){j=this.lastElement;}}if(o&&f.isArray(o)){m=this.focusLastButton();}else{if(j){try{j.focus();m=true;}catch(l){}}}return m;},_getButton:function(j){var i=YAHOO.widget.Button;if(i&&j&&j.nodeName&&j.id){j=i.getButton(j.id)||j;}return j;},focusDefaultButton:function(){var i=this._getButton(this.defaultHtmlButton),k=false;if(i){try{i.focus();k=true;}catch(j){}}return k;},blurButtons:function(){var o=this.cfg.getProperty("buttons"),l,n,k,j;if(o&&f.isArray(o)){l=o.length;if(l>0){j=(l-1);do{n=o[j];if(n){k=this._getButton(n.htmlButton);if(k){try{k.blur();}catch(m){}}}}while(j--);}}},focusFirstButton:function(){var m=this.cfg.getProperty("buttons"),k,i,l=false;if(m&&f.isArray(m)){k=m[0];if(k){i=this._getButton(k.htmlButton);if(i){try{i.focus();l=true;}catch(j){}}}}return l;},focusLastButton:function(){var n=this.cfg.getProperty("buttons"),j,l,i,m=false;if(n&&f.isArray(n)){j=n.length;if(j>0){l=n[(j-1)];if(l){i=this._getButton(l.htmlButton);if(i){try{i.focus();m=true;}catch(k){}}}}}return m;},configPostMethod:function(j,i,k){this.registerForm();},validate:function(){return true;},submit:function(){if(this.validate()){if(this.beforeSubmitEvent.fire()){this.doSubmit();this.submitEvent.fire();if(this.cfg.getProperty("hideaftersubmit")){this.hide();}return true;}else{return false;}}else{return false;}},cancel:function(){this.cancelEvent.fire();this.hide();},getData:function(){var A=this.form,k,t,w,m,u,r,q,j,x,l,y,B,p,C,o,z,v;function s(n){var i=n.tagName.toUpperCase();return((i=="INPUT"||i=="TEXTAREA"||i=="SELECT")&&n.name==m);}if(A){k=A.elements;t=k.length;w={};for(z=0;z<t;z++){m=k[z].name;u=e.getElementsBy(s,"*",A);r=u.length;if(r>0){if(r==1){u=u[0];q=u.type;j=u.tagName.toUpperCase();switch(j){case"INPUT":if(q=="checkbox"){w[m]=u.checked;}else{if(q!="radio"){w[m]=u.value;}}break;case"TEXTAREA":w[m]=u.value;break;case"SELECT":x=u.options;l=x.length;y=[];for(v=0;v<l;v++){B=x[v];if(B.selected){o=B.attributes.value;y[y.length]=(o&&o.specified)?B.value:B.text;}}w[m]=y;break;}}else{q=u[0].type;switch(q){case"radio":for(v=0;v<r;v++){p=u[v];if(p.checked){w[m]=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[m]=y;break;}}}}}return w;},destroy:function(i){d.call(this);this._aButtons=null;var j=this.element.getElementsByTagName("form"),k;if(j.length>0){k=j[0];if(k){b.purgeElement(k);if(k.parentNode){k.parentNode.removeChild(k);}this.form=null;}}a.superclass.destroy.call(this,i);},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);var e=this.form.ownerDocument,d=e.createElement("input");d.type="hidden";d.name=this.id;d.value="";this.form.appendChild(d);},configIcon:function(k,j,h){var d=j[0],e=this.body,f=b.ICON_CSS_CLASSNAME,l,i,g;if(d&&d!="none"){l=c.getElementsByClassName(f,"*",e);if(l.length===1){i=l[0];g=i.parentNode;if(g){g.removeChild(i);i=null;}}if(d.indexOf(".")==-1){i=document.createElement("span");i.className=(f+" "+d);i.innerHTML="&#160;";}else{i=document.createElement("img");i.src=(this.imageRoot+d);i.className=f;}if(i){e.insertBefore(i,e.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(e,h,g,d,f){if(!f){f=YAHOO.util.Anim;}this.overlay=e;this.attrIn=h;this.attrOut=g;this.targetElement=d||e.element;this.animClass=f;};var b=YAHOO.util.Dom,c=YAHOO.util.CustomEvent,a=YAHOO.widget.ContainerEffect;a.FADE=function(d,f){var g=YAHOO.util.Easing,i={attributes:{opacity:{from:0,to:1}},duration:f,method:g.easeIn},e={attributes:{opacity:{to:0}},duration:f,method:g.easeOut},h=new a(d,i,e,d.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(d.element,"yui-effect-fade");}}};h.handleUnderlayComplete=function(){var j=this.overlay.underlay;if(j&&YAHOO.env.ua.ie){b.removeClass(d.element,"yui-effect-fade");}};h.handleStartAnimateIn=function(k,j,l){l.overlay._fadingIn=true;b.addClass(l.overlay.element,"hide-select");if(!l.overlay.underlay){l.overlay.cfg.refireEvent("underlay");
}l.handleUnderlayStart();l.overlay._setDomVisibility(true);b.setStyle(l.overlay.element,"opacity",0);};h.handleCompleteAnimateIn=function(k,j,l){l.overlay._fadingIn=false;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){l.overlay._fadingOut=true;b.addClass(l.overlay.element,"hide-select");l.handleUnderlayStart();};h.handleCompleteAnimateOut=function(k,j,l){l.overlay._fadingOut=false;b.removeClass(l.overlay.element,"hide-select");if(l.overlay.element.style.filter){l.overlay.element.style.filter=null;}l.overlay._setDomVisibility(false);b.setStyle(l.overlay.element,"opacity",1);l.handleUnderlayComplete();l.overlay.cfg.refireEvent("iframe");l.animateOutCompleteEvent.fire();};h.init();return h;};a.SLIDE=function(f,d){var i=YAHOO.util.Easing,l=f.cfg.getProperty("x")||b.getX(f.element),k=f.cfg.getProperty("y")||b.getY(f.element),m=b.getClientWidth(),h=f.element.offsetWidth,j={attributes:{points:{to:[l,k]}},duration:d,method:i.easeIn},e={attributes:{points:{to:[(m+25),k]}},duration:d,method:i.easeOut},g=new a(f,j,e,f.element,YAHOO.util.Motion);g.handleStartAnimateIn=function(o,n,p){p.overlay.element.style.left=((-25)-h)+"px";p.overlay.element.style.top=k+"px";};g.handleTweenAnimateIn=function(q,p,r){var s=b.getXY(r.overlay.element),o=s[0],n=s[1];if(b.getStyle(r.overlay.element,"visibility")=="hidden"&&o<l){r.overlay._setDomVisibility(true);}r.overlay.cfg.setProperty("xy",[o,n],true);r.overlay.cfg.refireEvent("iframe");};g.handleCompleteAnimateIn=function(o,n,p){p.overlay.cfg.setProperty("xy",[l,k],true);p.startX=l;p.startY=k;p.overlay.cfg.refireEvent("iframe");p.animateInCompleteEvent.fire();};g.handleStartAnimateOut=function(o,n,r){var p=b.getViewportWidth(),s=b.getXY(r.overlay.element),q=s[1];r.animOut.attributes.points.to=[(p+25),q];};g.handleTweenAnimateOut=function(p,o,q){var s=b.getXY(q.overlay.element),n=s[0],r=s[1];q.overlay.cfg.setProperty("xy",[n,r],true);q.overlay.cfg.refireEvent("iframe");};g.handleCompleteAnimateOut=function(o,n,p){p.overlay._setDomVisibility(false);p.overlay.cfg.setProperty("xy",[l,k]);p.animateOutCompleteEvent.fire();};g.init();return g;};a.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=c.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=c.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=c.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=c.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._stopAnims(this.lastFrameOnStop);this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this._stopAnims(this.lastFrameOnStop);this.beforeAnimateOutEvent.fire();this.animOut.animate();},lastFrameOnStop:true,_stopAnims:function(d){if(this.animOut&&this.animOut.isAnimated()){this.animOut.stop(d);}if(this.animIn&&this.animIn.isAnimated()){this.animIn.stop(d);}},handleStartAnimateIn:function(e,d,f){},handleTweenAnimateIn:function(e,d,f){},handleCompleteAnimateIn:function(e,d,f){},handleStartAnimateOut:function(e,d,f){},handleTweenAnimateOut:function(e,d,f){},handleCompleteAnimateOut:function(e,d,f){},toString:function(){var d="ContainerEffect";if(this.overlay){d+=" ["+this.overlay.toString()+"]";}return d;}};YAHOO.lang.augmentProto(a,YAHOO.util.EventProvider);})();YAHOO.register("container",YAHOO.widget.Module,{version:"2.9.0",build:"2800"});
/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_isFormSubmit:false,_default_headers:{},_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),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);},setDefaultPostHeader:function(a){if(typeof a=="string"){this._default_post_header=a;this._use_default_post_header=true;}else{if(typeof a=="boolean"){this._use_default_post_header=a;}}},setDefaultXhrHeader:function(a){if(typeof a=="string"){this._default_xhr_header=a;}else{this._use_default_xhr_header=a;}},setPollingInterval:function(a){if(typeof a=="number"&&isFinite(a)){this._polling_interval=a;}},createXhrObject:function(g){var d,a,b;try{a=new XMLHttpRequest();d={conn:a,tId:g,xhr:true};}catch(c){for(b=0;b<this._msxml_progid.length;++b){try{a=new ActiveXObject(this._msxml_progid[b]);d={conn:a,tId:g,xhr:true};break;}catch(f){}}}finally{return d;}},getConnectionObject:function(a){var c,d=this._transaction_id;try{if(!a){c=this.createXhrObject(d);}else{c={tId:d};if(a==="xdr"){c.conn=this._transport;c.xdr=true;}else{if(a==="upload"){c.upload=true;}}}if(c){this._transaction_id++;}}catch(b){}return c;},asyncRequest:function(h,d,g,a){var b=g&&g.argument?g.argument:null,e=this,f,c;if(this._isFileUpload){c="upload";}else{if(g&&g.xdr){c="xdr";}}f=this.getConnectionObject(c);if(!f){return null;}else{if(g&&g.customevents){this.initCustomEvents(f,g);}if(this._isFormSubmit){if(this._isFileUpload){window.setTimeout(function(){e.uploadFile(f,g,d,a);},10);return f;}if(h.toUpperCase()=="GET"){if(this._sFormData.length!==0){d+=((d.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(h.toUpperCase()=="POST"){a=a?this._sFormData+"&"+a:this._sFormData;}}}if(h.toUpperCase()=="GET"&&(g&&g.cache===false)){d+=((d.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString();}if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);}}if((h.toUpperCase()==="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);}if(f.xdr){this.xdr(f,h,d,g,a);return f;}f.conn.open(h,d,true);if(this._has_default_headers||this._has_http_headers){this.setHeader(f);}this.handleReadyState(f,g);f.conn.send(a||"");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(f,b);if(f.startEvent){f.startEvent.fire(f,b);}return f;}},initCustomEvents:function(a,c){var b;for(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);a[this._customEvents[b][0]].subscribe(c.customevents[b]);}}},handleReadyState:function(c,d){var b=this,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(b,j,d){var f,a,h=(j&&j.argument)?j.argument:null,c=(b.r&&b.r.statusText==="xdr:success")?true:false,i=(b.r&&b.r.statusText==="xdr:failure")?true:false,k=d;try{if((b.conn.status!==undefined&&b.conn.status!==0)||c){f=b.conn.status;}else{if(i&&!k){f=0;}else{f=13030;}}}catch(g){f=13030;}if((f>=200&&f<300)||f===1223||c){a=b.xdr?b.r:this.createResponseObject(b,h);if(j&&j.success){if(!j.scope){j.success(a);}else{j.success.apply(j.scope,[a]);}}this.successEvent.fire(a);if(b.successEvent){b.successEvent.fire(a);}}else{switch(f){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:a=this.createExceptionObject(b.tId,h,(d?d:false));if(j&&j.failure){if(!j.scope){j.failure(a);}else{j.failure.apply(j.scope,[a]);}}break;default:a=(b.xdr)?b.response:this.createResponseObject(b,h);if(j&&j.failure){if(!j.scope){j.failure(a);}else{j.failure.apply(j.scope,[a]);}}}this.failureEvent.fire(a);if(b.failureEvent){b.failureEvent.fire(a);}}this.releaseObject(b);a=null;},createResponseObject:function(a,h){var d={},k={},f,c,g,b;try{c=a.conn.getAllResponseHeaders();g=c.split("\n");for(f=0;f<g.length;f++){b=g[f].indexOf(":");if(b!=-1){k[g[f].substring(0,b)]=YAHOO.lang.trim(g[f].substring(b+2));}}}catch(j){}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=k;d.getAllResponseHeaders=c;d.responseText=a.conn.responseText;d.responseXML=a.conn.responseXML;if(h){d.argument=h;}return d;},createExceptionObject:function(h,d,a){var f=0,g="communication failure",c=-1,b="transaction aborted",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){var b;if(this._has_default_headers){for(b in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,b)){a.conn.setRequestHeader(b,this._default_headers[b]);
}}}if(this._has_http_headers){for(b in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,b)){a.conn.setRequestHeader(b,this._http_headers[b]);}}this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){this._default_headers={};this._has_default_headers=false;},abort:function(e,g,a){var d,b=(g&&g.argument)?g.argument:null;e=e||{};if(e.conn){if(e.xhr){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.xdr){e.conn.abort(e.tId);d=true;}}}else{if(e.upload){var c="yuiIO"+e.tId;var f=document.getElementById(c);if(f){YAHOO.util.Event.removeListener(f,"load");document.body.removeChild(f);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);}return d;},isCallInProgress:function(a){a=a||{};if(a.xhr&&a.conn){return a.conn.readyState!==4&&a.conn.readyState!==0;}else{if(a.xdr&&a.conn){return a.conn.isCallInProgress(a.tId);}else{if(a.upload===true){return document.getElementById("yuiIO"+a.tId)?true:false;}else{return false;}}}},releaseObject:function(a){if(a&&a.conn){a.conn=null;a=null;}}};(function(){var g=YAHOO.util.Connect,h={};function d(i){var j='<object id="YUIConnectionSwf" type="application/x-shockwave-flash" data="'+i+'" width="0" height="0">'+'<param name="movie" value="'+i+'">'+'<param name="allowScriptAccess" value="always">'+"</object>",k=document.createElement("div");document.body.appendChild(k);k.innerHTML=j;}function b(l,i,j,n,k){h[parseInt(l.tId)]={"o":l,"c":n};if(k){n.method=i;n.data=k;}l.conn.send(j,n,l.tId);}function e(i){d(i);g._transport=document.getElementById("YUIConnectionSwf");}function c(){g.xdrReadyEvent.fire();}function a(j,i){if(j){g.startEvent.fire(j,i.argument);if(j.startEvent){j.startEvent.fire(j,i.argument);}}}function f(j){var k=h[j.tId].o,i=h[j.tId].c;if(j.statusText==="xdr:start"){a(k,i);return;}j.responseText=decodeURI(j.responseText);k.r=j;if(i.argument){k.r.argument=i.argument;}this.handleTransactionResponse(k,i,j.statusText==="xdr:abort"?true:false);delete h[j.tId];}g.xdr=b;g.swf=d;g.transport=e;g.xdrReadyEvent=new YAHOO.util.CustomEvent("xdrReady");g.xdrReady=c;g.handleXdrResponse=f;})();(function(){var e=YAHOO.util.Connect,g=YAHOO.util.Event,a=document.documentMode?document.documentMode:false;e._isFileUpload=false;e._formNode=null;e._sFormData=null;e._submitElementValue=null;e.uploadEvent=new YAHOO.util.CustomEvent("upload");e._hasSubmitListener=function(){if(g){g.addListener(document,"click",function(k){var j=g.getTarget(k),i=j.nodeName.toLowerCase();if((i==="input"||i==="button")&&(j.type&&j.type.toLowerCase()=="submit")){e._submitElementValue=encodeURIComponent(j.name)+"="+encodeURIComponent(j.value);}});return true;}return false;}();function h(w,r,m){var v,l,u,s,z,t=false,p=[],y=0,o,q,n,x,k;this.resetFormState();if(typeof w=="string"){v=(document.getElementById(w)||document.forms[w]);}else{if(typeof w=="object"){v=w;}else{return;}}if(r){this.createFrame(m?m:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=v;return;}for(o=0,q=v.elements.length;o<q;++o){l=v.elements[o];z=l.disabled;u=l.name;if(!z&&u){u=encodeURIComponent(u)+"=";s=encodeURIComponent(l.value);switch(l.type){case"select-one":if(l.selectedIndex>-1){k=l.options[l.selectedIndex];p[y++]=u+encodeURIComponent((k.attributes.value&&k.attributes.value.specified)?k.value:k.text);}break;case"select-multiple":if(l.selectedIndex>-1){for(n=l.selectedIndex,x=l.options.length;n<x;++n){k=l.options[n];if(k.selected){p[y++]=u+encodeURIComponent((k.attributes.value&&k.attributes.value.specified)?k.value:k.text);}}}break;case"radio":case"checkbox":if(l.checked){p[y++]=u+s;}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(t===false){if(this._hasSubmitListener&&this._submitElementValue){p[y++]=this._submitElementValue;}t=true;}break;default:p[y++]=u+s;}}}this._isFormSubmit=true;this._sFormData=p.join("&");this.initHeader("Content-Type",this._default_form_header);return this._sFormData;}function d(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";}function c(i){var j="yuiIO"+this._transaction_id,l=(a===9)?true:false,k;if(YAHOO.env.ua.ie&&!l){k=document.createElement('<iframe id="'+j+'" name="'+j+'" />');if(typeof i=="boolean"){k.src="javascript:false";}}else{k=document.createElement("iframe");k.id=j;k.name=j;}k.style.position="absolute";k.style.top="-1000px";k.style.left="-1000px";document.body.appendChild(k);}function f(j){var m=[],k=j.split("&"),l,n;for(l=0;l<k.length;l++){n=k[l].indexOf("=");if(n!=-1){m[l]=document.createElement("input");m[l].type="hidden";m[l].name=decodeURIComponent(k[l].substring(0,n));m[l].value=decodeURIComponent(k[l].substring(n+1));this._formNode.appendChild(m[l]);}}return m;}function b(m,y,n,l){var t="yuiIO"+m.tId,u="multipart/form-data",w=document.getElementById(t),p=(a>=8)?true:false,z=this,v=(y&&y.argument)?y.argument:null,x,s,k,r,j,q;j={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",n);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",t);if(YAHOO.env.ua.ie&&!p){this._formNode.setAttribute("encoding",u);}else{this._formNode.setAttribute("enctype",u);}if(l){x=this.appendPostData(l);}this._formNode.submit();this.startEvent.fire(m,v);if(m.startEvent){m.startEvent.fire(m,v);}if(y&&y.timeout){this._timeOut[m.tId]=window.setTimeout(function(){z.abort(m,y,true);},y.timeout);}if(x&&x.length>0){for(s=0;s<x.length;s++){this._formNode.removeChild(x[s]);}}for(k in j){if(YAHOO.lang.hasOwnProperty(j,k)){if(j[k]){this._formNode.setAttribute(k,j[k]);}else{this._formNode.removeAttribute(k);}}}this.resetFormState();
q=function(){var i,A,B;if(y&&y.timeout){window.clearTimeout(z._timeOut[m.tId]);delete z._timeOut[m.tId];}z.completeEvent.fire(m,v);if(m.completeEvent){m.completeEvent.fire(m,v);}r={tId:m.tId,argument:v};try{i=w.contentWindow.document.getElementsByTagName("body")[0];A=w.contentWindow.document.getElementsByTagName("pre")[0];if(i){if(A){B=A.textContent?A.textContent:A.innerText;}else{B=i.textContent?i.textContent:i.innerText;}}r.responseText=B;r.responseXML=w.contentWindow.document.XMLDocument?w.contentWindow.document.XMLDocument:w.contentWindow.document;}catch(o){}if(y&&y.upload){if(!y.scope){y.upload(r);}else{y.upload.apply(y.scope,[r]);}}z.uploadEvent.fire(r);if(m.uploadEvent){m.uploadEvent.fire(r);}g.removeListener(w,"load",q);setTimeout(function(){document.body.removeChild(w);z.releaseObject(m);},100);};g.addListener(w,"load",q);}e.setForm=h;e.resetFormState=d;e.createFrame=c;e.appendPostData=f;e.uploadFile=b;})();YAHOO.register("connection",YAHOO.util.Connect,{version:"2.9.0",build:"2800"});
/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
(function(){var lang=YAHOO.lang,util=YAHOO.util,Ev=util.Event;util.DataSourceBase=function(oLiveData,oConfigs){if(oLiveData===null||oLiveData===undefined){return;}this.liveData=oLiveData;this._oQueue={interval:null,conn:null,requests:[]};this.responseSchema={};if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}var maxCacheEntries=this.maxCacheEntries;if(!lang.isNumber(maxCacheEntries)||(maxCacheEntries<0)){maxCacheEntries=0;}this._aIntervals=[];this.createEvent("cacheRequestEvent");this.createEvent("cacheResponseEvent");this.createEvent("requestEvent");this.createEvent("responseEvent");this.createEvent("responseParseEvent");this.createEvent("responseCacheEvent");this.createEvent("dataErrorEvent");this.createEvent("cacheFlushEvent");var DS=util.DataSourceBase;this._sName="DataSource instance"+DS._nIndex;DS._nIndex++;};var DS=util.DataSourceBase;lang.augmentObject(DS,{TYPE_UNKNOWN:-1,TYPE_JSARRAY:0,TYPE_JSFUNCTION:1,TYPE_XHR:2,TYPE_JSON:3,TYPE_XML:4,TYPE_TEXT:5,TYPE_HTMLTABLE:6,TYPE_SCRIPTNODE:7,TYPE_LOCAL:8,ERROR_DATAINVALID:"Invalid data",ERROR_DATANULL:"Null data",_nIndex:0,_nTransactionId:0,_cloneObject:function(o){if(!lang.isValue(o)){return o;}var copy={};if(Object.prototype.toString.apply(o)==="[object RegExp]"){copy=o;}else{if(lang.isFunction(o)){copy=o;}else{if(lang.isArray(o)){var array=[];for(var i=0,len=o.length;i<len;i++){array[i]=DS._cloneObject(o[i]);}copy=array;}else{if(lang.isObject(o)){for(var x in o){if(lang.hasOwnProperty(o,x)){if(lang.isValue(o[x])&&lang.isObject(o[x])||lang.isArray(o[x])){copy[x]=DS._cloneObject(o[x]);}else{copy[x]=o[x];}}}}else{copy=o;}}}}return copy;},_getLocationValue:function(field,context){var locator=field.locator||field.key||field,xmldoc=context.ownerDocument||context,result,res,value=null;try{if(!lang.isUndefined(xmldoc.evaluate)){result=xmldoc.evaluate(locator,context,xmldoc.createNSResolver(!context.ownerDocument?context.documentElement:context.ownerDocument.documentElement),0,null);while(res=result.iterateNext()){value=res.textContent;}}else{xmldoc.setProperty("SelectionLanguage","XPath");result=context.selectNodes(locator)[0];value=result.value||result.text||null;}return value;}catch(e){}},issueCallback:function(callback,params,error,scope){if(lang.isFunction(callback)){callback.apply(scope,params);}else{if(lang.isObject(callback)){scope=callback.scope||scope||window;var callbackFunc=callback.success;if(error){callbackFunc=callback.failure;}if(callbackFunc){callbackFunc.apply(scope,params.concat([callback.argument]));}}}},parseString:function(oData){if(!lang.isValue(oData)){return null;}var string=oData+"";if(lang.isString(string)){return string;}else{return null;}},parseNumber:function(oData){if(!lang.isValue(oData)||(oData==="")){return null;}var number=oData*1;if(lang.isNumber(number)){return number;}else{return null;}},convertNumber:function(oData){return DS.parseNumber(oData);},parseDate:function(oData){var date=null;if(lang.isValue(oData)&&!(oData instanceof Date)){date=new Date(oData);}else{return oData;}if(date instanceof Date){return date;}else{return null;}},convertDate:function(oData){return DS.parseDate(oData);}});DS.Parser={string:DS.parseString,number:DS.parseNumber,date:DS.parseDate};DS.prototype={_sName:null,_aCache:null,_oQueue:null,_aIntervals:null,maxCacheEntries:0,liveData:null,dataType:DS.TYPE_UNKNOWN,responseType:DS.TYPE_UNKNOWN,responseSchema:null,useXPath:false,cloneBeforeCaching:false,toString:function(){return this._sName;},getCachedResponse:function(oRequest,oCallback,oCaller){var aCache=this._aCache;if(this.maxCacheEntries>0){if(!aCache){this._aCache=[];}else{var nCacheLength=aCache.length;if(nCacheLength>0){var oResponse=null;this.fireEvent("cacheRequestEvent",{request:oRequest,callback:oCallback,caller:oCaller});for(var i=nCacheLength-1;i>=0;i--){var oCacheElem=aCache[i];if(this.isCacheHit(oRequest,oCacheElem.request)){oResponse=oCacheElem.response;this.fireEvent("cacheResponseEvent",{request:oRequest,response:oResponse,callback:oCallback,caller:oCaller});if(i<nCacheLength-1){aCache.splice(i,1);this.addToCache(oRequest,oResponse);}oResponse.cached=true;break;}}return oResponse;}}}else{if(aCache){this._aCache=null;}}return null;},isCacheHit:function(oRequest,oCachedRequest){return(oRequest===oCachedRequest);},addToCache:function(oRequest,oResponse){var aCache=this._aCache;if(!aCache){return;}while(aCache.length>=this.maxCacheEntries){aCache.shift();}oResponse=(this.cloneBeforeCaching)?DS._cloneObject(oResponse):oResponse;var oCacheElem={request:oRequest,response:oResponse};aCache[aCache.length]=oCacheElem;this.fireEvent("responseCacheEvent",{request:oRequest,response:oResponse});},flushCache:function(){if(this._aCache){this._aCache=[];this.fireEvent("cacheFlushEvent");}},setInterval:function(nMsec,oRequest,oCallback,oCaller){if(lang.isNumber(nMsec)&&(nMsec>=0)){var oSelf=this;var nId=setInterval(function(){oSelf.makeConnection(oRequest,oCallback,oCaller);},nMsec);this._aIntervals.push(nId);return nId;}else{}},clearInterval:function(nId){var tracker=this._aIntervals||[];for(var i=tracker.length-1;i>-1;i--){if(tracker[i]===nId){tracker.splice(i,1);clearInterval(nId);}}},clearAllIntervals:function(){var tracker=this._aIntervals||[];for(var i=tracker.length-1;i>-1;i--){clearInterval(tracker[i]);}tracker=[];},sendRequest:function(oRequest,oCallback,oCaller){var oCachedResponse=this.getCachedResponse(oRequest,oCallback,oCaller);if(oCachedResponse){DS.issueCallback(oCallback,[oRequest,oCachedResponse],false,oCaller);return null;}return this.makeConnection(oRequest,oCallback,oCaller);},makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=this.liveData;this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);return tId;},handleResponse:function(oRequest,oRawResponse,oCallback,oCaller,tId){this.fireEvent("responseEvent",{tId:tId,request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller});
var xhr=(this.dataType==DS.TYPE_XHR)?true:false;var oParsedResponse=null;var oFullResponse=oRawResponse;if(this.responseType===DS.TYPE_UNKNOWN){var ctype=(oRawResponse&&oRawResponse.getResponseHeader)?oRawResponse.getResponseHeader["Content-Type"]:null;if(ctype){if(ctype.indexOf("text/xml")>-1){this.responseType=DS.TYPE_XML;}else{if(ctype.indexOf("application/json")>-1){this.responseType=DS.TYPE_JSON;}else{if(ctype.indexOf("text/plain")>-1){this.responseType=DS.TYPE_TEXT;}}}}else{if(YAHOO.lang.isArray(oRawResponse)){this.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse&&oRawResponse.nodeType&&(oRawResponse.nodeType===9||oRawResponse.nodeType===1||oRawResponse.nodeType===11)){this.responseType=DS.TYPE_XML;}else{if(oRawResponse&&oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){this.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){this.responseType=DS.TYPE_TEXT;}}}}}}}switch(this.responseType){case DS.TYPE_JSARRAY:if(xhr&&oRawResponse&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}try{if(lang.isString(oFullResponse)){var parseArgs=[oFullResponse].concat(this.parseJSONArgs);if(lang.JSON){oFullResponse=lang.JSON.parse.apply(lang.JSON,parseArgs);}else{if(window.JSON&&JSON.parse){oFullResponse=JSON.parse.apply(JSON,parseArgs);}else{if(oFullResponse.parseJSON){oFullResponse=oFullResponse.parseJSON.apply(oFullResponse,parseArgs.slice(1));}else{while(oFullResponse.length>0&&(oFullResponse.charAt(0)!="{")&&(oFullResponse.charAt(0)!="[")){oFullResponse=oFullResponse.substring(1,oFullResponse.length);}if(oFullResponse.length>0){var arrayEnd=Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));oFullResponse=oFullResponse.substring(0,arrayEnd+1);oFullResponse=eval("("+oFullResponse+")");}}}}}}catch(e1){}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseArrayData(oRequest,oFullResponse);break;case DS.TYPE_JSON:if(xhr&&oRawResponse&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}try{if(lang.isString(oFullResponse)){var parseArgs=[oFullResponse].concat(this.parseJSONArgs);if(lang.JSON){oFullResponse=lang.JSON.parse.apply(lang.JSON,parseArgs);}else{if(window.JSON&&JSON.parse){oFullResponse=JSON.parse.apply(JSON,parseArgs);}else{if(oFullResponse.parseJSON){oFullResponse=oFullResponse.parseJSON.apply(oFullResponse,parseArgs.slice(1));}else{while(oFullResponse.length>0&&(oFullResponse.charAt(0)!="{")&&(oFullResponse.charAt(0)!="[")){oFullResponse=oFullResponse.substring(1,oFullResponse.length);}if(oFullResponse.length>0){var objEnd=Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));oFullResponse=oFullResponse.substring(0,objEnd+1);oFullResponse=eval("("+oFullResponse+")");}}}}}}catch(e){}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseJSONData(oRequest,oFullResponse);break;case DS.TYPE_HTMLTABLE:if(xhr&&oRawResponse.responseText){var el=document.createElement("div");el.innerHTML=oRawResponse.responseText;oFullResponse=el.getElementsByTagName("table")[0];}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseHTMLTableData(oRequest,oFullResponse);break;case DS.TYPE_XML:if(xhr&&oRawResponse.responseXML){oFullResponse=oRawResponse.responseXML;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseXMLData(oRequest,oFullResponse);break;case DS.TYPE_TEXT:if(xhr&&lang.isString(oRawResponse.responseText)){oFullResponse=oRawResponse.responseText;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseTextData(oRequest,oFullResponse);break;default:oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseData(oRequest,oFullResponse);break;}oParsedResponse=oParsedResponse||{};if(!oParsedResponse.results){oParsedResponse.results=[];}if(!oParsedResponse.meta){oParsedResponse.meta={};}if(!oParsedResponse.error){oParsedResponse=this.doBeforeCallback(oRequest,oFullResponse,oParsedResponse,oCallback);this.fireEvent("responseParseEvent",{request:oRequest,response:oParsedResponse,callback:oCallback,caller:oCaller});this.addToCache(oRequest,oParsedResponse);}else{oParsedResponse.error=true;this.fireEvent("dataErrorEvent",{request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller,message:DS.ERROR_DATANULL});}oParsedResponse.tId=tId;DS.issueCallback(oCallback,[oRequest,oParsedResponse],oParsedResponse.error,oCaller);},doBeforeParseData:function(oRequest,oFullResponse,oCallback){return oFullResponse;},doBeforeCallback:function(oRequest,oFullResponse,oParsedResponse,oCallback){return oParsedResponse;},parseData:function(oRequest,oFullResponse){if(lang.isValue(oFullResponse)){var oParsedResponse={results:oFullResponse,meta:{}};return oParsedResponse;}return null;},parseArrayData:function(oRequest,oFullResponse){if(lang.isArray(oFullResponse)){var results=[],i,j,rec,field,data;if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(i=fields.length-1;i>=0;--i){if(typeof fields[i]!=="object"){fields[i]={key:fields[i]};}}var parsers={},p;for(i=fields.length-1;i>=0;--i){p=(typeof fields[i].parser==="function"?fields[i].parser:DS.Parser[fields[i].parser+""])||fields[i].converter;if(p){parsers[fields[i].key]=p;}}var arrType=lang.isArray(oFullResponse[0]);for(i=oFullResponse.length-1;i>-1;i--){var oResult={};rec=oFullResponse[i];if(typeof rec==="object"){for(j=fields.length-1;j>-1;j--){field=fields[j];data=arrType?rec[j]:rec[field.key];if(parsers[field.key]){data=parsers[field.key].call(this,data);}if(data===undefined){data=null;}oResult[field.key]=data;}}else{if(lang.isString(rec)){for(j=fields.length-1;j>-1;j--){field=fields[j];data=rec;if(parsers[field.key]){data=parsers[field.key].call(this,data);}if(data===undefined){data=null;}oResult[field.key]=data;
}}}results[i]=oResult;}}else{results=oFullResponse;}var oParsedResponse={results:results};return oParsedResponse;}return null;},parseTextData:function(oRequest,oFullResponse){if(lang.isString(oFullResponse)){if(lang.isString(this.responseSchema.recordDelim)&&lang.isString(this.responseSchema.fieldDelim)){var oParsedResponse={results:[]};var recDelim=this.responseSchema.recordDelim;var fieldDelim=this.responseSchema.fieldDelim;if(oFullResponse.length>0){var newLength=oFullResponse.length-recDelim.length;if(oFullResponse.substr(newLength)==recDelim){oFullResponse=oFullResponse.substr(0,newLength);}if(oFullResponse.length>0){var recordsarray=oFullResponse.split(recDelim);for(var i=0,len=recordsarray.length,recIdx=0;i<len;++i){var bError=false,sRecord=recordsarray[i];if(lang.isString(sRecord)&&(sRecord.length>0)){var fielddataarray=recordsarray[i].split(fieldDelim);var oResult={};if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(var j=fields.length-1;j>-1;j--){try{var data=fielddataarray[j];if(lang.isString(data)){if(data.charAt(0)=='"'){data=data.substr(1);}if(data.charAt(data.length-1)=='"'){data=data.substr(0,data.length-1);}var field=fields[j];var key=(lang.isValue(field.key))?field.key:field;if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}else{bError=true;}}catch(e){bError=true;}}}else{oResult=fielddataarray;}if(!bError){oParsedResponse.results[recIdx++]=oResult;}}}}}return oParsedResponse;}}return null;},parseXMLResult:function(result){var oResult={},schema=this.responseSchema;try{for(var m=schema.fields.length-1;m>=0;m--){var field=schema.fields[m];var key=(lang.isValue(field.key))?field.key:field;var data=null;if(this.useXPath){data=YAHOO.util.DataSource._getLocationValue(field,result);}else{var xmlAttr=result.attributes.getNamedItem(key);if(xmlAttr){data=xmlAttr.value;}else{var xmlNode=result.getElementsByTagName(key);if(xmlNode&&xmlNode.item(0)){var item=xmlNode.item(0);data=(item)?((item.text)?item.text:(item.textContent)?item.textContent:null):null;if(!data){var datapieces=[];for(var j=0,len=item.childNodes.length;j<len;j++){if(item.childNodes[j].nodeValue){datapieces[datapieces.length]=item.childNodes[j].nodeValue;}}if(datapieces.length>0){data=datapieces.join("");}}}}}if(data===null){data="";}if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}}catch(e){}return oResult;},parseXMLData:function(oRequest,oFullResponse){var bError=false,schema=this.responseSchema,oParsedResponse={meta:{}},xmlList=null,metaNode=schema.metaNode,metaLocators=schema.metaFields||{},i,k,loc,v;try{if(this.useXPath){for(k in metaLocators){oParsedResponse.meta[k]=YAHOO.util.DataSource._getLocationValue(metaLocators[k],oFullResponse);}}else{metaNode=metaNode?oFullResponse.getElementsByTagName(metaNode)[0]:oFullResponse;if(metaNode){for(k in metaLocators){if(lang.hasOwnProperty(metaLocators,k)){loc=metaLocators[k];v=metaNode.getElementsByTagName(loc)[0];if(v){v=v.firstChild.nodeValue;}else{v=metaNode.attributes.getNamedItem(loc);if(v){v=v.value;}}if(lang.isValue(v)){oParsedResponse.meta[k]=v;}}}}}xmlList=(schema.resultNode)?oFullResponse.getElementsByTagName(schema.resultNode):null;}catch(e){}if(!xmlList||!lang.isArray(schema.fields)){bError=true;}else{oParsedResponse.results=[];for(i=xmlList.length-1;i>=0;--i){var oResult=this.parseXMLResult(xmlList.item(i));oParsedResponse.results[i]=oResult;}}if(bError){oParsedResponse.error=true;}else{}return oParsedResponse;},parseJSONData:function(oRequest,oFullResponse){var oParsedResponse={results:[],meta:{}};if(lang.isObject(oFullResponse)&&this.responseSchema.resultsList){var schema=this.responseSchema,fields=schema.fields,resultsList=oFullResponse,results=[],metaFields=schema.metaFields||{},fieldParsers=[],fieldPaths=[],simpleFields=[],bError=false,i,len,j,v,key,parser,path;var buildPath=function(needle){var path=null,keys=[],i=0;if(needle){needle=needle.replace(/\[(['"])(.*?)\1\]/g,function(x,$1,$2){keys[i]=$2;return".@"+(i++);}).replace(/\[(\d+)\]/g,function(x,$1){keys[i]=parseInt($1,10)|0;return".@"+(i++);}).replace(/^\./,"");if(!/[^\w\.\$@]/.test(needle)){path=needle.split(".");for(i=path.length-1;i>=0;--i){if(path[i].charAt(0)==="@"){path[i]=keys[parseInt(path[i].substr(1),10)];}}}else{}}return path;};var walkPath=function(path,origin){var v=origin,i=0,len=path.length;for(;i<len&&v;++i){v=v[path[i]];}return v;};path=buildPath(schema.resultsList);if(path){resultsList=walkPath(path,oFullResponse);if(resultsList===undefined){bError=true;}}else{bError=true;}if(!resultsList){resultsList=[];}if(!lang.isArray(resultsList)){resultsList=[resultsList];}if(!bError){if(schema.fields){var field;for(i=0,len=fields.length;i<len;i++){field=fields[i];key=field.key||field;parser=((typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""])||field.converter;path=buildPath(key);if(parser){fieldParsers[fieldParsers.length]={key:key,parser:parser};}if(path){if(path.length>1){fieldPaths[fieldPaths.length]={key:key,path:path};}else{simpleFields[simpleFields.length]={key:key,path:path[0]};}}else{}}for(i=resultsList.length-1;i>=0;--i){var r=resultsList[i],rec={};if(r){for(j=simpleFields.length-1;j>=0;--j){rec[simpleFields[j].key]=(r[simpleFields[j].path]!==undefined)?r[simpleFields[j].path]:r[j];}for(j=fieldPaths.length-1;j>=0;--j){rec[fieldPaths[j].key]=walkPath(fieldPaths[j].path,r);}for(j=fieldParsers.length-1;j>=0;--j){var p=fieldParsers[j].key;rec[p]=fieldParsers[j].parser.call(this,rec[p]);if(rec[p]===undefined){rec[p]=null;}}}results[i]=rec;}}else{results=resultsList;}for(key in metaFields){if(lang.hasOwnProperty(metaFields,key)){path=buildPath(metaFields[key]);
if(path){v=walkPath(path,oFullResponse);oParsedResponse.meta[key]=v;}}}}else{oParsedResponse.error=true;}oParsedResponse.results=results;}else{oParsedResponse.error=true;}return oParsedResponse;},parseHTMLTableData:function(oRequest,oFullResponse){var bError=false;var elTable=oFullResponse;var fields=this.responseSchema.fields;var oParsedResponse={results:[]};if(lang.isArray(fields)){for(var i=0;i<elTable.tBodies.length;i++){var elTbody=elTable.tBodies[i];for(var j=elTbody.rows.length-1;j>-1;j--){var elRow=elTbody.rows[j];var oResult={};for(var k=fields.length-1;k>-1;k--){var field=fields[k];var key=(lang.isValue(field.key))?field.key:field;var data=elRow.cells[k].innerHTML;if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}oParsedResponse.results[j]=oResult;}}}else{bError=true;}if(bError){oParsedResponse.error=true;}else{}return oParsedResponse;}};lang.augmentProto(DS,util.EventProvider);util.LocalDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_LOCAL;if(oLiveData){if(YAHOO.lang.isArray(oLiveData)){this.responseType=DS.TYPE_JSARRAY;}else{if(oLiveData.nodeType&&oLiveData.nodeType==9){this.responseType=DS.TYPE_XML;}else{if(oLiveData.nodeName&&(oLiveData.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;oLiveData=oLiveData.cloneNode(true);}else{if(YAHOO.lang.isString(oLiveData)){this.responseType=DS.TYPE_TEXT;}else{if(YAHOO.lang.isObject(oLiveData)){this.responseType=DS.TYPE_JSON;}}}}}}else{oLiveData=[];this.responseType=DS.TYPE_JSARRAY;}util.LocalDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.LocalDataSource,DS);lang.augmentObject(util.LocalDataSource,DS);util.FunctionDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_JSFUNCTION;oLiveData=oLiveData||function(){};util.FunctionDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.FunctionDataSource,DS,{scope:null,makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=(this.scope)?this.liveData.call(this.scope,oRequest,this,oCallback):this.liveData(oRequest,oCallback);if(this.responseType===DS.TYPE_UNKNOWN){if(YAHOO.lang.isArray(oRawResponse)){this.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse&&oRawResponse.nodeType&&oRawResponse.nodeType==9){this.responseType=DS.TYPE_XML;}else{if(oRawResponse&&oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){this.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){this.responseType=DS.TYPE_TEXT;}}}}}}this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);return tId;}});lang.augmentObject(util.FunctionDataSource,DS);util.ScriptNodeDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_SCRIPTNODE;oLiveData=oLiveData||"";util.ScriptNodeDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.ScriptNodeDataSource,DS,{getUtility:util.Get,asyncMode:"allowAll",scriptCallbackParam:"callback",generateRequestCallback:function(id){return"&"+this.scriptCallbackParam+"=YAHOO.util.ScriptNodeDataSource.callbacks["+id+"]";},doBeforeGetScriptNode:function(sUri){return sUri;},makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});if(util.ScriptNodeDataSource._nPending===0){util.ScriptNodeDataSource.callbacks=[];util.ScriptNodeDataSource._nId=0;}var id=util.ScriptNodeDataSource._nId;util.ScriptNodeDataSource._nId++;var oSelf=this;util.ScriptNodeDataSource.callbacks[id]=function(oRawResponse){if((oSelf.asyncMode!=="ignoreStaleResponses")||(id===util.ScriptNodeDataSource.callbacks.length-1)){if(oSelf.responseType===DS.TYPE_UNKNOWN){if(YAHOO.lang.isArray(oRawResponse)){oSelf.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse.nodeType&&oRawResponse.nodeType==9){oSelf.responseType=DS.TYPE_XML;}else{if(oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){oSelf.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){oSelf.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){oSelf.responseType=DS.TYPE_TEXT;}}}}}}oSelf.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);}else{}delete util.ScriptNodeDataSource.callbacks[id];};util.ScriptNodeDataSource._nPending++;var sUri=this.liveData+oRequest+this.generateRequestCallback(id);sUri=this.doBeforeGetScriptNode(sUri);this.getUtility.script(sUri,{autopurge:true,onsuccess:util.ScriptNodeDataSource._bumpPendingDown,onfail:util.ScriptNodeDataSource._bumpPendingDown});return tId;}});lang.augmentObject(util.ScriptNodeDataSource,DS);lang.augmentObject(util.ScriptNodeDataSource,{_nId:0,_nPending:0,callbacks:[]});util.XHRDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_XHR;this.connMgr=this.connMgr||util.Connect;oLiveData=oLiveData||"";util.XHRDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.XHRDataSource,DS,{connMgr:null,connXhrMode:"allowAll",connMethodPost:false,connTimeout:0,makeConnection:function(oRequest,oCallback,oCaller){var oRawResponse=null;var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oSelf=this;var oConnMgr=this.connMgr;var oQueue=this._oQueue;var _xhrSuccess=function(oResponse){if(oResponse&&(this.connXhrMode=="ignoreStaleResponses")&&(oResponse.tId!=oQueue.conn.tId)){return null;}else{if(!oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,response:null,callback:oCallback,caller:oCaller,message:DS.ERROR_DATANULL});DS.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller);return null;
}else{if(this.responseType===DS.TYPE_UNKNOWN){var ctype=(oResponse.getResponseHeader)?oResponse.getResponseHeader["Content-Type"]:null;if(ctype){if(ctype.indexOf("text/xml")>-1){this.responseType=DS.TYPE_XML;}else{if(ctype.indexOf("application/json")>-1){this.responseType=DS.TYPE_JSON;}else{if(ctype.indexOf("text/plain")>-1){this.responseType=DS.TYPE_TEXT;}}}}}this.handleResponse(oRequest,oResponse,oCallback,oCaller,tId);}}};var _xhrFailure=function(oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,response:oResponse,callback:oCallback,caller:oCaller,message:DS.ERROR_DATAINVALID});if(lang.isString(this.liveData)&&lang.isString(oRequest)&&(this.liveData.lastIndexOf("?")!==this.liveData.length-1)&&(oRequest.indexOf("?")!==0)){}oResponse=oResponse||{};oResponse.error=true;DS.issueCallback(oCallback,[oRequest,oResponse],true,oCaller);return null;};var _xhrCallback={success:_xhrSuccess,failure:_xhrFailure,scope:this};if(lang.isNumber(this.connTimeout)){_xhrCallback.timeout=this.connTimeout;}if(this.connXhrMode=="cancelStaleRequests"){if(oQueue.conn){if(oConnMgr.abort){oConnMgr.abort(oQueue.conn);oQueue.conn=null;}else{}}}if(oConnMgr&&oConnMgr.asyncRequest){var sLiveData=this.liveData;var isPost=this.connMethodPost;var sMethod=(isPost)?"POST":"GET";var sUri=(isPost||!lang.isValue(oRequest))?sLiveData:sLiveData+oRequest;var sRequest=(isPost)?oRequest:null;if(this.connXhrMode!="queueRequests"){oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}else{if(oQueue.conn){var allRequests=oQueue.requests;allRequests.push({request:oRequest,callback:_xhrCallback});if(!oQueue.interval){oQueue.interval=setInterval(function(){if(oConnMgr.isCallInProgress(oQueue.conn)){return;}else{if(allRequests.length>0){sUri=(isPost||!lang.isValue(allRequests[0].request))?sLiveData:sLiveData+allRequests[0].request;sRequest=(isPost)?allRequests[0].request:null;oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,allRequests[0].callback,sRequest);allRequests.shift();}else{clearInterval(oQueue.interval);oQueue.interval=null;}}},50);}}else{oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}}}else{DS.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller);}return tId;}});lang.augmentObject(util.XHRDataSource,DS);util.DataSource=function(oLiveData,oConfigs){oConfigs=oConfigs||{};var dataType=oConfigs.dataType;if(dataType){if(dataType==DS.TYPE_LOCAL){return new util.LocalDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_XHR){return new util.XHRDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_SCRIPTNODE){return new util.ScriptNodeDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_JSFUNCTION){return new util.FunctionDataSource(oLiveData,oConfigs);}}}}}if(YAHOO.lang.isString(oLiveData)){return new util.XHRDataSource(oLiveData,oConfigs);}else{if(YAHOO.lang.isFunction(oLiveData)){return new util.FunctionDataSource(oLiveData,oConfigs);}else{return new util.LocalDataSource(oLiveData,oConfigs);}}};lang.augmentObject(util.DataSource,DS);})();YAHOO.util.Number={format:function(e,k){if(e===""||e===null||!isFinite(e)){return"";}e=+e;k=YAHOO.lang.merge(YAHOO.util.Number.format.defaults,(k||{}));var j=e+"",l=Math.abs(e),b=k.decimalPlaces||0,r=k.thousandsSeparator,f=k.negativeFormat||("-"+k.format),q,p,g,h;if(f.indexOf("#")>-1){f=f.replace(/#/,k.format);}if(b<0){q=l-(l%1)+"";g=q.length+b;if(g>0){q=Number("."+q).toFixed(g).slice(2)+new Array(q.length-g+1).join("0");}else{q="0";}}else{var a=l+"";if(b>0||a.indexOf(".")>0){var d=Math.pow(10,b);q=Math.round(l*d)/d+"";var c=q.indexOf("."),m,o;if(c<0){m=b;o=(Math.pow(10,m)+"").substring(1);if(b>0){q=q+"."+o;}}else{m=b-(q.length-c-1);o=(Math.pow(10,m)+"").substring(1);q=q+o;}}else{q=l.toFixed(b)+"";}}p=q.split(/\D/);if(l>=1000){g=p[0].length%3||3;p[0]=p[0].slice(0,g)+p[0].slice(g).replace(/(\d{3})/g,r+"$1");}return YAHOO.util.Number.format._applyFormat((e<0?f:k.format),p.join(k.decimalSeparator),k);}};YAHOO.util.Number.format.defaults={format:"{prefix}{number}{suffix}",negativeFormat:null,decimalSeparator:".",decimalPlaces:null,thousandsSeparator:""};YAHOO.util.Number.format._applyFormat=function(a,b,c){return a.replace(/\{(\w+)\}/g,function(d,e){return e==="number"?b:e in c?c[e]:"";});};(function(){var a=function(c,e,d){if(typeof d==="undefined"){d=10;}for(;parseInt(c,10)<d&&d>1;d/=10){c=e.toString()+c;}return c.toString();};var b={formats:{a:function(e,c){return c.a[e.getDay()];},A:function(e,c){return c.A[e.getDay()];},b:function(e,c){return c.b[e.getMonth()];},B:function(e,c){return c.B[e.getMonth()];},C:function(c){return a(parseInt(c.getFullYear()/100,10),0);},d:["getDate","0"],e:["getDate"," "],g:function(c){return a(parseInt(b.formats.G(c)%100,10),0);},G:function(f){var g=f.getFullYear();var e=parseInt(b.formats.V(f),10);var c=parseInt(b.formats.W(f),10);if(c>e){g++;}else{if(c===0&&e>=52){g--;}}return g;},H:["getHours","0"],I:function(e){var c=e.getHours()%12;return a(c===0?12:c,0);},j:function(h){var g=new Date(""+h.getFullYear()+"/1/1 GMT");var e=new Date(""+h.getFullYear()+"/"+(h.getMonth()+1)+"/"+h.getDate()+" GMT");var c=e-g;var f=parseInt(c/60000/60/24,10)+1;return a(f,0,100);},k:["getHours"," "],l:function(e){var c=e.getHours()%12;return a(c===0?12:c," ");},m:function(c){return a(c.getMonth()+1,0);},M:["getMinutes","0"],p:function(e,c){return c.p[e.getHours()>=12?1:0];},P:function(e,c){return c.P[e.getHours()>=12?1:0];},s:function(e,c){return parseInt(e.getTime()/1000,10);},S:["getSeconds","0"],u:function(c){var e=c.getDay();return e===0?7:e;},U:function(g){var c=parseInt(b.formats.j(g),10);var f=6-g.getDay();var e=parseInt((c+f)/7,10);return a(e,0);},V:function(g){var f=parseInt(b.formats.W(g),10);var c=(new Date(""+g.getFullYear()+"/1/1")).getDay();var e=f+(c>4||c<=1?0:1);if(e===53&&(new Date(""+g.getFullYear()+"/12/31")).getDay()<4){e=1;}else{if(e===0){e=b.formats.V(new Date(""+(g.getFullYear()-1)+"/12/31"));}}return a(e,0);},w:"getDay",W:function(g){var c=parseInt(b.formats.j(g),10);var f=7-b.formats.u(g);var e=parseInt((c+f)/7,10);
return a(e,0,10);},y:function(c){return a(c.getFullYear()%100,0);},Y:"getFullYear",z:function(f){var e=f.getTimezoneOffset();var c=a(parseInt(Math.abs(e/60),10),0);var g=a(Math.abs(e%60),0);return(e>0?"-":"+")+c+g;},Z:function(c){var e=c.toString().replace(/^.*:\d\d( GMT[+-]\d+)? \(?([A-Za-z ]+)\)?\d*$/,"$2").replace(/[a-z ]/g,"");if(e.length>4){e=b.formats.z(c);}return e;},"%":function(c){return"%";}},aggregates:{c:"locale",D:"%m/%d/%y",F:"%Y-%m-%d",h:"%b",n:"\n",r:"locale",R:"%H:%M",t:"\t",T:"%H:%M:%S",x:"locale",X:"locale"},format:function(g,f,d){f=f||{};if(!(g instanceof Date)){return YAHOO.lang.isValue(g)?g:"";}var h=f.format||"%m/%d/%Y";if(h==="YYYY/MM/DD"){h="%Y/%m/%d";}else{if(h==="DD/MM/YYYY"){h="%d/%m/%Y";}else{if(h==="MM/DD/YYYY"){h="%m/%d/%Y";}}}d=d||"en";if(!(d in YAHOO.util.DateLocale)){if(d.replace(/-[a-zA-Z]+$/,"") in YAHOO.util.DateLocale){d=d.replace(/-[a-zA-Z]+$/,"");}else{d="en";}}var j=YAHOO.util.DateLocale[d];var c=function(l,k){var m=b.aggregates[k];return(m==="locale"?j[k]:m);};var e=function(l,k){var m=b.formats[k];if(typeof m==="string"){return g[m]();}else{if(typeof m==="function"){return m.call(g,g,j);}else{if(typeof m==="object"&&typeof m[0]==="string"){return a(g[m[0]](),m[1]);}else{return k;}}}};while(h.match(/%[cDFhnrRtTxX]/)){h=h.replace(/%([cDFhnrRtTxX])/g,c);}var i=h.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g,e);c=e=undefined;return i;}};YAHOO.namespace("YAHOO.util");YAHOO.util.Date=b;YAHOO.util.DateLocale={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],r:"%I:%M:%S %p",x:"%d/%m/%y",X:"%T"};YAHOO.util.DateLocale["en"]=YAHOO.lang.merge(YAHOO.util.DateLocale,{});YAHOO.util.DateLocale["en-US"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"],{c:"%a %d %b %Y %I:%M:%S %p %Z",x:"%m/%d/%Y",X:"%I:%M:%S %p"});YAHOO.util.DateLocale["en-GB"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"],{r:"%l:%M:%S %P %Z"});YAHOO.util.DateLocale["en-AU"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"]);})();YAHOO.register("datasource",YAHOO.util.DataSource,{version:"2.9.0",build:"2800"});
/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
YAHOO.widget.DS_JSArray=YAHOO.util.LocalDataSource;YAHOO.widget.DS_JSFunction=YAHOO.util.FunctionDataSource;YAHOO.widget.DS_XHR=function(b,a,d){var c=new YAHOO.util.XHRDataSource(b,d);c._aDeprecatedSchema=a;return c;};YAHOO.widget.DS_ScriptNode=function(b,a,d){var c=new YAHOO.util.ScriptNodeDataSource(b,d);c._aDeprecatedSchema=a;return c;};YAHOO.widget.DS_XHR.TYPE_JSON=YAHOO.util.DataSourceBase.TYPE_JSON;YAHOO.widget.DS_XHR.TYPE_XML=YAHOO.util.DataSourceBase.TYPE_XML;YAHOO.widget.DS_XHR.TYPE_FLAT=YAHOO.util.DataSourceBase.TYPE_TEXT;YAHOO.widget.AutoComplete=function(g,b,j,c){if(g&&b&&j){if(j&&YAHOO.lang.isFunction(j.sendRequest)){this.dataSource=j;}else{return;}this.key=0;var d=j.responseSchema;if(j._aDeprecatedSchema){var k=j._aDeprecatedSchema;if(YAHOO.lang.isArray(k)){if((j.responseType===YAHOO.util.DataSourceBase.TYPE_JSON)||(j.responseType===YAHOO.util.DataSourceBase.TYPE_UNKNOWN)){d.resultsList=k[0];this.key=k[1];d.fields=(k.length<3)?null:k.slice(1);}else{if(j.responseType===YAHOO.util.DataSourceBase.TYPE_XML){d.resultNode=k[0];this.key=k[1];d.fields=k.slice(1);}else{if(j.responseType===YAHOO.util.DataSourceBase.TYPE_TEXT){d.recordDelim=k[0];d.fieldDelim=k[1];}}}j.responseSchema=d;}}if(YAHOO.util.Dom.inDocument(g)){if(YAHOO.lang.isString(g)){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+g;this._elTextbox=document.getElementById(g);}else{this._sName=(g.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+g.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._elTextbox=g;}YAHOO.util.Dom.addClass(this._elTextbox,"yui-ac-input");}else{return;}if(YAHOO.util.Dom.inDocument(b)){if(YAHOO.lang.isString(b)){this._elContainer=document.getElementById(b);}else{this._elContainer=b;}if(this._elContainer.style.display=="none"){}var e=this._elContainer.parentNode;var a=e.tagName.toLowerCase();if(a=="div"){YAHOO.util.Dom.addClass(e,"yui-ac");}else{}}else{return;}if(this.dataSource.dataType===YAHOO.util.DataSourceBase.TYPE_LOCAL){this.applyLocalFilter=true;}if(c&&(c.constructor==Object)){for(var i in c){if(i){this[i]=c[i];}}}this._initContainerEl();this._initProps();this._initListEl();this._initContainerHelperEls();var h=this;var f=this._elTextbox;YAHOO.util.Event.addListener(f,"keyup",h._onTextboxKeyUp,h);YAHOO.util.Event.addListener(f,"keydown",h._onTextboxKeyDown,h);YAHOO.util.Event.addListener(f,"focus",h._onTextboxFocus,h);YAHOO.util.Event.addListener(f,"blur",h._onTextboxBlur,h);YAHOO.util.Event.addListener(b,"mouseover",h._onContainerMouseover,h);YAHOO.util.Event.addListener(b,"mouseout",h._onContainerMouseout,h);YAHOO.util.Event.addListener(b,"click",h._onContainerClick,h);YAHOO.util.Event.addListener(b,"scroll",h._onContainerScroll,h);YAHOO.util.Event.addListener(b,"resize",h._onContainerResize,h);YAHOO.util.Event.addListener(f,"keypress",h._onTextboxKeyPress,h);YAHOO.util.Event.addListener(window,"unload",h._onWindowUnload,h);this.textboxFocusEvent=new YAHOO.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=new YAHOO.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new YAHOO.util.CustomEvent("dataRequest",this);this.dataRequestCancelEvent=new YAHOO.util.CustomEvent("dataRequestCancel",this);this.dataReturnEvent=new YAHOO.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.containerPopulateEvent=new YAHOO.util.CustomEvent("containerPopulate",this);this.containerExpandEvent=new YAHOO.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new YAHOO.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new YAHOO.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=new YAHOO.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new YAHOO.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new YAHOO.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new YAHOO.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new YAHOO.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new YAHOO.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new YAHOO.util.CustomEvent("containerCollapse",this);this.textboxBlurEvent=new YAHOO.util.CustomEvent("textboxBlur",this);this.textboxChangeEvent=new YAHOO.util.CustomEvent("textboxChange",this);f.setAttribute("autocomplete","off");YAHOO.widget.AutoComplete._nIndex++;}else{}};YAHOO.widget.AutoComplete.prototype.dataSource=null;YAHOO.widget.AutoComplete.prototype.applyLocalFilter=null;YAHOO.widget.AutoComplete.prototype.queryMatchCase=false;YAHOO.widget.AutoComplete.prototype.queryMatchContains=false;YAHOO.widget.AutoComplete.prototype.queryMatchSubset=false;YAHOO.widget.AutoComplete.prototype.minQueryLength=1;YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed=10;YAHOO.widget.AutoComplete.prototype.queryDelay=0.2;YAHOO.widget.AutoComplete.prototype.typeAheadDelay=0.5;YAHOO.widget.AutoComplete.prototype.queryInterval=500;YAHOO.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";YAHOO.widget.AutoComplete.prototype.prehighlightClassName=null;YAHOO.widget.AutoComplete.prototype.delimChar=null;YAHOO.widget.AutoComplete.prototype.autoHighlight=true;YAHOO.widget.AutoComplete.prototype.typeAhead=false;YAHOO.widget.AutoComplete.prototype.animHoriz=false;YAHOO.widget.AutoComplete.prototype.animVert=true;YAHOO.widget.AutoComplete.prototype.animSpeed=0.3;YAHOO.widget.AutoComplete.prototype.forceSelection=false;YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete=true;YAHOO.widget.AutoComplete.prototype.alwaysShowContainer=false;YAHOO.widget.AutoComplete.prototype.useIFrame=false;YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.suppressInputUpdate=false;YAHOO.widget.AutoComplete.prototype.resultTypeList=true;YAHOO.widget.AutoComplete.prototype.queryQuestionMark=true;YAHOO.widget.AutoComplete.prototype.autoSnapContainer=true;YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName;};YAHOO.widget.AutoComplete.prototype.getInputEl=function(){return this._elTextbox;
};YAHOO.widget.AutoComplete.prototype.getContainerEl=function(){return this._elContainer;};YAHOO.widget.AutoComplete.prototype.isFocused=function(){return this._bFocused;};YAHOO.widget.AutoComplete.prototype.isContainerOpen=function(){return this._bContainerOpen;};YAHOO.widget.AutoComplete.prototype.getListEl=function(){return this._elList;};YAHOO.widget.AutoComplete.prototype.getListItemMatch=function(a){if(a._sResultMatch){return a._sResultMatch;}else{return null;}};YAHOO.widget.AutoComplete.prototype.getListItemData=function(a){if(a._oResultData){return a._oResultData;}else{return null;}};YAHOO.widget.AutoComplete.prototype.getListItemIndex=function(a){if(YAHOO.lang.isNumber(a._nItemIndex)){return a._nItemIndex;}else{return null;}};YAHOO.widget.AutoComplete.prototype.setHeader=function(b){if(this._elHeader){var a=this._elHeader;if(b){a.innerHTML=b;a.style.display="";}else{a.innerHTML="";a.style.display="none";}}};YAHOO.widget.AutoComplete.prototype.setFooter=function(b){if(this._elFooter){var a=this._elFooter;if(b){a.innerHTML=b;a.style.display="";}else{a.innerHTML="";a.style.display="none";}}};YAHOO.widget.AutoComplete.prototype.setBody=function(a){if(this._elBody){var b=this._elBody;YAHOO.util.Event.purgeElement(b,true);if(a){b.innerHTML=a;b.style.display="";}else{b.innerHTML="";b.style.display="none";}this._elList=null;}};YAHOO.widget.AutoComplete.prototype.generateRequest=function(b){var a=this.dataSource.dataType;if(a===YAHOO.util.DataSourceBase.TYPE_XHR){if(!this.dataSource.connMethodPost){b=(this.queryQuestionMark?"?":"")+(this.dataSource.scriptQueryParam||"query")+"="+b+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"");}else{b=(this.dataSource.scriptQueryParam||"query")+"="+b+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"");}}else{if(a===YAHOO.util.DataSourceBase.TYPE_SCRIPTNODE){b="&"+(this.dataSource.scriptQueryParam||"query")+"="+b+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"");}}return b;};YAHOO.widget.AutoComplete.prototype.sendQuery=function(b){this._bFocused=true;var a=(this.delimChar)?this._elTextbox.value+b:b;this._sendQuery(a);};YAHOO.widget.AutoComplete.prototype.snapContainer=function(){var a=this._elTextbox,b=YAHOO.util.Dom.getXY(a);b[1]+=YAHOO.util.Dom.get(a).offsetHeight+2;YAHOO.util.Dom.setXY(this._elContainer,b);};YAHOO.widget.AutoComplete.prototype.expandContainer=function(){this._toggleContainer(true);};YAHOO.widget.AutoComplete.prototype.collapseContainer=function(){this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype.clearList=function(){var b=this._elList.childNodes,a=b.length-1;for(;a>-1;a--){b[a].style.display="none";}};YAHOO.widget.AutoComplete.prototype.getSubsetMatches=function(e){var d,c,a;for(var b=e.length;b>=this.minQueryLength;b--){a=this.generateRequest(e.substr(0,b));this.dataRequestEvent.fire(this,d,a);c=this.dataSource.getCachedResponse(a);if(c){return this.filterResults.apply(this.dataSource,[e,c,c,{scope:this}]);}}return null;};YAHOO.widget.AutoComplete.prototype.preparseRawResponse=function(c,b,a){var d=((this.responseStripAfter!=="")&&(b.indexOf))?b.indexOf(this.responseStripAfter):-1;if(d!=-1){b=b.substring(0,d);}return b;};YAHOO.widget.AutoComplete.prototype.filterResults=function(l,n,r,m){if(m&&m.argument&&YAHOO.lang.isValue(m.argument.query)){l=m.argument.query;}if(l&&l!==""){r=YAHOO.widget.AutoComplete._cloneObject(r);var j=m.scope,q=this,c=r.results,o=[],b=j.maxResultsDisplayed,k=(q.queryMatchCase||j.queryMatchCase),a=(q.queryMatchContains||j.queryMatchContains);for(var d=0,h=c.length;d<h;d++){var f=c[d];var e=null;if(YAHOO.lang.isString(f)){e=f;}else{if(YAHOO.lang.isArray(f)){e=f[0];}else{if(this.responseSchema.fields){var p=this.responseSchema.fields[0].key||this.responseSchema.fields[0];e=f[p];}else{if(this.key){e=f[this.key];}}}}if(YAHOO.lang.isString(e)){var g=(k)?e.indexOf(decodeURIComponent(l)):e.toLowerCase().indexOf(decodeURIComponent(l).toLowerCase());if((!a&&(g===0))||(a&&(g>-1))){o.push(f);}}if(h>b&&o.length===b){break;}}r.results=o;}else{}return r;};YAHOO.widget.AutoComplete.prototype.handleResponse=function(c,a,b){if((this instanceof YAHOO.widget.AutoComplete)&&this._sName){this._populateList(c,a,b);}};YAHOO.widget.AutoComplete.prototype.doBeforeLoadData=function(c,a,b){return true;};YAHOO.widget.AutoComplete.prototype.formatResult=function(b,d,a){var c=(a)?a:"";return c;};YAHOO.widget.AutoComplete.prototype.formatEscapedResult=function(c,d,b){var a=(b)?b:"";return YAHOO.lang.escapeHTML(a);};YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer=function(d,a,c,b){return true;};YAHOO.widget.AutoComplete.prototype.destroy=function(){var b=this.toString();var a=this._elTextbox;var d=this._elContainer;this.textboxFocusEvent.unsubscribeAll();this.textboxKeyEvent.unsubscribeAll();this.dataRequestEvent.unsubscribeAll();this.dataReturnEvent.unsubscribeAll();this.dataErrorEvent.unsubscribeAll();this.containerPopulateEvent.unsubscribeAll();this.containerExpandEvent.unsubscribeAll();this.typeAheadEvent.unsubscribeAll();this.itemMouseOverEvent.unsubscribeAll();this.itemMouseOutEvent.unsubscribeAll();this.itemArrowToEvent.unsubscribeAll();this.itemArrowFromEvent.unsubscribeAll();this.itemSelectEvent.unsubscribeAll();this.unmatchedItemSelectEvent.unsubscribeAll();this.selectionEnforceEvent.unsubscribeAll();this.containerCollapseEvent.unsubscribeAll();this.textboxBlurEvent.unsubscribeAll();this.textboxChangeEvent.unsubscribeAll();YAHOO.util.Event.purgeElement(a,true);YAHOO.util.Event.purgeElement(d,true);d.innerHTML="";for(var c in this){if(YAHOO.lang.hasOwnProperty(this,c)){this[c]=null;}}};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestCancelEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;
YAHOO.widget.AutoComplete.prototype.containerPopulateEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete.prototype.textboxChangeEvent=null;YAHOO.widget.AutoComplete._nIndex=0;YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._elTextbox=null;YAHOO.widget.AutoComplete.prototype._elContainer=null;YAHOO.widget.AutoComplete.prototype._elContent=null;YAHOO.widget.AutoComplete.prototype._elHeader=null;YAHOO.widget.AutoComplete.prototype._elBody=null;YAHOO.widget.AutoComplete.prototype._elFooter=null;YAHOO.widget.AutoComplete.prototype._elShadow=null;YAHOO.widget.AutoComplete.prototype._elIFrame=null;YAHOO.widget.AutoComplete.prototype._bFocused=false;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._elList=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sPastSelections="";YAHOO.widget.AutoComplete.prototype._sInitInputValue=null;YAHOO.widget.AutoComplete.prototype._elCurListItem=null;YAHOO.widget.AutoComplete.prototype._elCurPrehighlightItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._nTypeAheadDelayID=-1;YAHOO.widget.AutoComplete.prototype._iFrameSrc="javascript:false;";YAHOO.widget.AutoComplete.prototype._queryInterval=null;YAHOO.widget.AutoComplete.prototype._sLastTextboxValue=null;YAHOO.widget.AutoComplete.prototype._initProps=function(){var b=this.minQueryLength;if(!YAHOO.lang.isNumber(b)){this.minQueryLength=1;}var e=this.maxResultsDisplayed;if(!YAHOO.lang.isNumber(e)||(e<1)){this.maxResultsDisplayed=10;}var f=this.queryDelay;if(!YAHOO.lang.isNumber(f)||(f<0)){this.queryDelay=0.2;}var c=this.typeAheadDelay;if(!YAHOO.lang.isNumber(c)||(c<0)){this.typeAheadDelay=0.2;}var a=this.delimChar;if(YAHOO.lang.isString(a)&&(a.length>0)){this.delimChar=[a];}else{if(!YAHOO.lang.isArray(a)){this.delimChar=null;}}var d=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(!YAHOO.lang.isNumber(d)||(d<0)){this.animSpeed=0.3;}if(!this._oAnim){this._oAnim=new YAHOO.util.Anim(this._elContent,{},this.animSpeed);}else{this._oAnim.duration=this.animSpeed;}}if(this.forceSelection&&a){}};YAHOO.widget.AutoComplete.prototype._initContainerHelperEls=function(){if(this.useShadow&&!this._elShadow){var a=document.createElement("div");a.className="yui-ac-shadow";a.style.width=0;a.style.height=0;this._elShadow=this._elContainer.appendChild(a);}if(this.useIFrame&&!this._elIFrame){var b=document.createElement("iframe");b.src=this._iFrameSrc;b.frameBorder=0;b.scrolling="no";b.style.position="absolute";b.style.width=0;b.style.height=0;b.style.padding=0;b.tabIndex=-1;b.role="presentation";b.title="Presentational iframe shim";this._elIFrame=this._elContainer.appendChild(b);}};YAHOO.widget.AutoComplete.prototype._initContainerEl=function(){YAHOO.util.Dom.addClass(this._elContainer,"yui-ac-container");if(!this._elContent){var c=document.createElement("div");c.className="yui-ac-content";c.style.display="none";this._elContent=this._elContainer.appendChild(c);var b=document.createElement("div");b.className="yui-ac-hd";b.style.display="none";this._elHeader=this._elContent.appendChild(b);var d=document.createElement("div");d.className="yui-ac-bd";this._elBody=this._elContent.appendChild(d);var a=document.createElement("div");a.className="yui-ac-ft";a.style.display="none";this._elFooter=this._elContent.appendChild(a);}else{}};YAHOO.widget.AutoComplete.prototype._initListEl=function(){var c=this.maxResultsDisplayed,a=this._elList||document.createElement("ul"),b;while(a.childNodes.length<c){b=document.createElement("li");b.style.display="none";b._nItemIndex=a.childNodes.length;a.appendChild(b);}if(!this._elList){var d=this._elBody;YAHOO.util.Event.purgeElement(d,true);d.innerHTML="";this._elList=d.appendChild(a);}this._elBody.style.display="";};YAHOO.widget.AutoComplete.prototype._focus=function(){var a=this;setTimeout(function(){try{a._elTextbox.focus();}catch(b){}},0);};YAHOO.widget.AutoComplete.prototype._enableIntervalDetection=function(){var a=this;if(!a._queryInterval&&a.queryInterval){a._queryInterval=setInterval(function(){a._onInterval();},a.queryInterval);}};YAHOO.widget.AutoComplete.prototype.enableIntervalDetection=YAHOO.widget.AutoComplete.prototype._enableIntervalDetection;YAHOO.widget.AutoComplete.prototype._onInterval=function(){var a=this._elTextbox.value;var b=this._sLastTextboxValue;if(a!=b){this._sLastTextboxValue=a;this._sendQuery(a);}};YAHOO.widget.AutoComplete.prototype._clearInterval=function(){if(this._queryInterval){clearInterval(this._queryInterval);this._queryInterval=null;}};YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(a){if((a==9)||(a==13)||(a==16)||(a==17)||(a>=18&&a<=20)||(a==27)||(a>=33&&a<=35)||(a>=36&&a<=40)||(a>=44&&a<=45)||(a==229)){return true;}return false;};YAHOO.widget.AutoComplete.prototype._sendQuery=function(d){if(this.minQueryLength<0){this._toggleContainer(false);return;}if(this.delimChar){var a=this._extractQuery(d);d=a.query;this._sPastSelections=a.previous;}if((d&&(d.length<this.minQueryLength))||(!d&&this.minQueryLength>0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);
}this._toggleContainer(false);return;}d=encodeURIComponent(d);this._nDelayID=-1;if(this.dataSource.queryMatchSubset||this.queryMatchSubset){var c=this.getSubsetMatches(d);if(c){this.handleResponse(d,c,{query:d});return;}}if(this.dataSource.responseStripAfter){this.dataSource.doBeforeParseData=this.preparseRawResponse;}if(this.applyLocalFilter){this.dataSource.doBeforeCallback=this.filterResults;}var b=this.generateRequest(d);if(b!==undefined){this.dataRequestEvent.fire(this,d,b);this.dataSource.sendRequest(b,{success:this.handleResponse,failure:this.handleResponse,scope:this,argument:{query:d}});}else{this.dataRequestCancelEvent.fire(this,d);}};YAHOO.widget.AutoComplete.prototype._populateListItem=function(b,a,c){b.innerHTML=this.formatResult(a,c,b._sResultMatch);};YAHOO.widget.AutoComplete.prototype._populateList=function(n,f,c){if(this._nTypeAheadDelayID!=-1){clearTimeout(this._nTypeAheadDelayID);}n=(c&&c.query)?c.query:n;var h=this.doBeforeLoadData(n,f,c);if(h&&!f.error){this.dataReturnEvent.fire(this,n,f.results);if(this._bFocused){var p=decodeURIComponent(n);this._sCurQuery=p;this._bItemSelected=false;var u=f.results,a=Math.min(u.length,this.maxResultsDisplayed),m=(this.dataSource.responseSchema.fields)?(this.dataSource.responseSchema.fields[0].key||this.dataSource.responseSchema.fields[0]):0;if(a>0){if(!this._elList||(this._elList.childNodes.length<a)){this._initListEl();}this._initContainerHelperEls();var l=this._elList.childNodes;for(var t=a-1;t>=0;t--){var s=l[t],e=u[t];if(this.resultTypeList){var b=[];b[0]=(YAHOO.lang.isString(e))?e:e[m]||e[this.key];var o=this.dataSource.responseSchema.fields;if(YAHOO.lang.isArray(o)&&(o.length>1)){for(var q=1,v=o.length;q<v;q++){b[b.length]=e[o[q].key||o[q]];}}else{if(YAHOO.lang.isArray(e)){b=e;}else{if(YAHOO.lang.isString(e)){b=[e];}else{b[1]=e;}}}e=b;}s._sResultMatch=(YAHOO.lang.isString(e))?e:(YAHOO.lang.isArray(e))?e[0]:(e[m]||"");s._oResultData=e;this._populateListItem(s,e,p);s.style.display="";}if(a<l.length){var g;for(var r=l.length-1;r>=a;r--){g=l[r];g.style.display="none";}}this._nDisplayedItems=a;this.containerPopulateEvent.fire(this,n,u);if(this.autoHighlight){var d=this._elList.firstChild;this._toggleHighlight(d,"to");this.itemArrowToEvent.fire(this,d);this._typeAhead(d,n);}else{this._toggleHighlight(this._elCurListItem,"from");}h=this._doBeforeExpandContainer(this._elTextbox,this._elContainer,n,u);this._toggleContainer(h);}else{this._toggleContainer(false);}return;}}else{this.dataErrorEvent.fire(this,n,f);}};YAHOO.widget.AutoComplete.prototype._doBeforeExpandContainer=function(d,a,c,b){if(this.autoSnapContainer){this.snapContainer();}return this.doBeforeExpandContainer(d,a,c,b);};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var a=(this.delimChar)?this._extractQuery(this._elTextbox.value):{previous:"",query:this._elTextbox.value};this._elTextbox.value=a.previous;this.selectionEnforceEvent.fire(this,a.query);};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var a=null;for(var b=0;b<this._nDisplayedItems;b++){var c=this._elList.childNodes[b];var d=(""+c._sResultMatch).toLowerCase();if(d==this._sCurQuery.toLowerCase()){a=c;break;}}return(a);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(b,d){if(!this.typeAhead||(this._nKeyCode==8)){return;}var a=this,c=this._elTextbox;if(c.setSelectionRange||c.createTextRange){this._nTypeAheadDelayID=setTimeout(function(){var f=c.value.length;a._updateValue(b);var g=c.value.length;a._selectText(c,f,g);var e=c.value.substr(f,g);a._sCurQuery=b._sResultMatch;a.typeAheadEvent.fire(a,d,e);},(this.typeAheadDelay*1000));}};YAHOO.widget.AutoComplete.prototype._selectText=function(d,a,b){if(d.setSelectionRange){d.setSelectionRange(a,b);}else{if(d.createTextRange){var c=d.createTextRange();c.moveStart("character",a);c.moveEnd("character",b-d.value.length);c.select();}else{d.select();}}};YAHOO.widget.AutoComplete.prototype._extractQuery=function(h){var c=this.delimChar,f=-1,g,e,b=c.length-1,d;for(;b>=0;b--){g=h.lastIndexOf(c[b]);if(g>f){f=g;}}if(c[b]==" "){for(var a=c.length-1;a>=0;a--){if(h[f-1]==c[a]){f--;break;}}}if(f>-1){e=f+1;while(h.charAt(e)==" "){e+=1;}d=h.substring(0,e);h=h.substr(e);}else{d="";}return{previous:d,query:h};};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(d){var e=this._elContent.offsetWidth+"px";var b=this._elContent.offsetHeight+"px";if(this.useIFrame&&this._elIFrame){var c=this._elIFrame;if(d){c.style.width=e;c.style.height=b;c.style.padding="";}else{c.style.width=0;c.style.height=0;c.style.padding=0;}}if(this.useShadow&&this._elShadow){var a=this._elShadow;if(d){a.style.width=e;a.style.height=b;}else{a.style.width=0;a.style.height=0;}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(i){var d=this._elContainer;if(this.alwaysShowContainer&&this._bContainerOpen){return;}if(!i){this._toggleHighlight(this._elCurListItem,"from");this._nDisplayedItems=0;this._sCurQuery=null;if(this._elContent.style.display=="none"){return;}}var a=this._oAnim;if(a&&a.getEl()&&(this.animHoriz||this.animVert)){if(a.isAnimated()){a.stop(true);}var g=this._elContent.cloneNode(true);d.appendChild(g);g.style.top="-9000px";g.style.width="";g.style.height="";g.style.display="";var f=g.offsetWidth;var c=g.offsetHeight;var b=(this.animHoriz)?0:f;var e=(this.animVert)?0:c;a.attributes=(i)?{width:{to:f},height:{to:c}}:{width:{to:b},height:{to:e}};if(i&&!this._bContainerOpen){this._elContent.style.width=b+"px";this._elContent.style.height=e+"px";}else{this._elContent.style.width=f+"px";this._elContent.style.height=c+"px";}d.removeChild(g);g=null;var h=this;var j=function(){a.onComplete.unsubscribeAll();if(i){h._toggleContainerHelpers(true);h._bContainerOpen=i;h.containerExpandEvent.fire(h);}else{h._elContent.style.display="none";h._bContainerOpen=i;h.containerCollapseEvent.fire(h);}};this._toggleContainerHelpers(false);this._elContent.style.display="";a.onComplete.subscribe(j);a.animate();}else{if(i){this._elContent.style.display="";this._toggleContainerHelpers(true);
this._bContainerOpen=i;this.containerExpandEvent.fire(this);}else{this._toggleContainerHelpers(false);this._elContent.style.display="none";this._bContainerOpen=i;this.containerCollapseEvent.fire(this);}}};YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(a,c){if(a){var b=this.highlightClassName;if(this._elCurListItem){YAHOO.util.Dom.removeClass(this._elCurListItem,b);this._elCurListItem=null;}if((c=="to")&&b){YAHOO.util.Dom.addClass(a,b);this._elCurListItem=a;}}};YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(b,c){var a=this.prehighlightClassName;if(this._elCurPrehighlightItem){YAHOO.util.Dom.removeClass(this._elCurPrehighlightItem,a);}if(b==this._elCurListItem){return;}if((c=="mouseover")&&a){YAHOO.util.Dom.addClass(b,a);this._elCurPrehighlightItem=b;}else{YAHOO.util.Dom.removeClass(b,a);}};YAHOO.widget.AutoComplete.prototype._updateValue=function(c){if(!this.suppressInputUpdate){var f=this._elTextbox;var e=(this.delimChar)?(this.delimChar[0]||this.delimChar):null;var b=c._sResultMatch;var d="";if(e){d=this._sPastSelections;d+=b+e;if(e!=" "){d+=" ";}}else{d=b;}f.value=d;if(f.type=="textarea"){f.scrollTop=f.scrollHeight;}var a=f.value.length;this._selectText(f,a,a);this._elCurListItem=c;}};YAHOO.widget.AutoComplete.prototype._selectItem=function(a){this._bItemSelected=true;this._updateValue(a);this._sPastSelections=this._elTextbox.value;this._clearInterval();this.itemSelectEvent.fire(this,a,a._oResultData);this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(this._elCurListItem){this._selectItem(this._elCurListItem);}else{this._toggleContainer(false);}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(g){if(this._bContainerOpen){var h=this._elCurListItem,d=-1;if(h){d=h._nItemIndex;}var e=(g==40)?(d+1):(d-1);if(e<-2||e>=this._nDisplayedItems){return;}if(h){this._toggleHighlight(h,"from");this.itemArrowFromEvent.fire(this,h);}if(e==-1){if(this.delimChar){this._elTextbox.value=this._sPastSelections+this._sCurQuery;}else{this._elTextbox.value=this._sCurQuery;}return;}if(e==-2){this._toggleContainer(false);return;}var f=this._elList.childNodes[e],b=this._elContent,c=YAHOO.util.Dom.getStyle(b,"overflow"),i=YAHOO.util.Dom.getStyle(b,"overflowY"),a=((c=="auto")||(c=="scroll")||(i=="auto")||(i=="scroll"));if(a&&(e>-1)&&(e<this._nDisplayedItems)){if(g==40){if((f.offsetTop+f.offsetHeight)>(b.scrollTop+b.offsetHeight)){b.scrollTop=(f.offsetTop+f.offsetHeight)-b.offsetHeight;}else{if((f.offsetTop+f.offsetHeight)<b.scrollTop){b.scrollTop=f.offsetTop;}}}else{if(f.offsetTop<b.scrollTop){this._elContent.scrollTop=f.offsetTop;}else{if(f.offsetTop>(b.scrollTop+b.offsetHeight)){this._elContent.scrollTop=(f.offsetTop+f.offsetHeight)-b.offsetHeight;}}}}this._toggleHighlight(f,"to");this.itemArrowToEvent.fire(this,f);if(this.typeAhead){this._updateValue(f);this._sCurQuery=f._sResultMatch;}}};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(a,c){var d=YAHOO.util.Event.getTarget(a);var b=d.nodeName.toLowerCase();while(d&&(b!="table")){switch(b){case"body":return;case"li":if(c.prehighlightClassName){c._togglePrehighlight(d,"mouseover");}else{c._toggleHighlight(d,"to");}c.itemMouseOverEvent.fire(c,d);break;case"div":if(YAHOO.util.Dom.hasClass(d,"yui-ac-container")){c._bOverContainer=true;return;}break;default:break;}d=d.parentNode;if(d){b=d.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(a,c){var d=YAHOO.util.Event.getTarget(a);var b=d.nodeName.toLowerCase();while(d&&(b!="table")){switch(b){case"body":return;case"li":if(c.prehighlightClassName){c._togglePrehighlight(d,"mouseout");}else{c._toggleHighlight(d,"from");}c.itemMouseOutEvent.fire(c,d);break;case"ul":c._toggleHighlight(c._elCurListItem,"to");break;case"div":if(YAHOO.util.Dom.hasClass(d,"yui-ac-container")){c._bOverContainer=false;return;}break;default:break;}d=d.parentNode;if(d){b=d.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerClick=function(a,c){var d=YAHOO.util.Event.getTarget(a);var b=d.nodeName.toLowerCase();while(d&&(b!="table")){switch(b){case"body":return;case"li":c._toggleHighlight(d,"to");c._selectItem(d);return;default:break;}d=d.parentNode;if(d){b=d.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(a,b){b._focus();};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(a,b){b._toggleContainerHelpers(b._bContainerOpen);};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(a,b){var c=a.keyCode;if(b._nTypeAheadDelayID!=-1){clearTimeout(b._nTypeAheadDelayID);}switch(c){case 9:if(!YAHOO.env.ua.opera&&(navigator.userAgent.toLowerCase().indexOf("mac")==-1)||(YAHOO.env.ua.webkit>420)){if(b._elCurListItem){if(b.delimChar&&(b._nKeyCode!=c)){if(b._bContainerOpen){YAHOO.util.Event.stopEvent(a);}}b._selectItem(b._elCurListItem);}else{b._toggleContainer(false);}}break;case 13:if(!YAHOO.env.ua.opera&&(navigator.userAgent.toLowerCase().indexOf("mac")==-1)||(YAHOO.env.ua.webkit>420)){if(b._elCurListItem){if(b._nKeyCode!=c){if(b._bContainerOpen){YAHOO.util.Event.stopEvent(a);}}b._selectItem(b._elCurListItem);}else{b._toggleContainer(false);}}break;case 27:b._toggleContainer(false);return;case 39:b._jumpSelection();break;case 38:if(b._bContainerOpen){YAHOO.util.Event.stopEvent(a);b._moveSelection(c);}break;case 40:if(b._bContainerOpen){YAHOO.util.Event.stopEvent(a);b._moveSelection(c);}break;default:b._bItemSelected=false;b._toggleHighlight(b._elCurListItem,"from");b.textboxKeyEvent.fire(b,c);break;}if(c===18){b._enableIntervalDetection();}b._nKeyCode=c;};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(a,b){var c=a.keyCode;if(YAHOO.env.ua.opera||(navigator.userAgent.toLowerCase().indexOf("mac")!=-1)&&(YAHOO.env.ua.webkit<420)){switch(c){case 9:if(b._bContainerOpen){if(b.delimChar){YAHOO.util.Event.stopEvent(a);}if(b._elCurListItem){b._selectItem(b._elCurListItem);}else{b._toggleContainer(false);}}break;case 13:if(b._bContainerOpen){YAHOO.util.Event.stopEvent(a);
if(b._elCurListItem){b._selectItem(b._elCurListItem);}else{b._toggleContainer(false);}}break;default:break;}}else{if(c==229){b._enableIntervalDetection();}}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(a,c){var b=this.value;c._initProps();var d=a.keyCode;if(c._isIgnoreKey(d)){return;}if(c._nDelayID!=-1){clearTimeout(c._nDelayID);}c._nDelayID=setTimeout(function(){c._sendQuery(b);},(c.queryDelay*1000));};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(a,b){if(!b._bFocused){b._elTextbox.setAttribute("autocomplete","off");b._bFocused=true;b._sInitInputValue=b._elTextbox.value;b.textboxFocusEvent.fire(b);}};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(a,c){if(!c._bOverContainer||(c._nKeyCode==9)){if(!c._bItemSelected){var b=c._textMatchesOption();if(!c._bContainerOpen||(c._bContainerOpen&&(b===null))){if(c.forceSelection){c._clearSelection();}else{c.unmatchedItemSelectEvent.fire(c,c._sCurQuery);}}else{if(c.forceSelection){c._selectItem(b);}}}c._clearInterval();c._bFocused=false;if(c._sInitInputValue!==c._elTextbox.value){c.textboxChangeEvent.fire(c);}c.textboxBlurEvent.fire(c);c._toggleContainer(false);}else{c._focus();}};YAHOO.widget.AutoComplete.prototype._onWindowUnload=function(a,b){if(b&&b._elTextbox&&b.allowBrowserAutocomplete){b._elTextbox.setAttribute("autocomplete","on");}};YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery=function(a){return this.generateRequest(a);};YAHOO.widget.AutoComplete.prototype.getListItems=function(){var c=[],b=this._elList.childNodes;for(var a=b.length-1;a>=0;a--){c[a]=b[a];}return c;};YAHOO.widget.AutoComplete._cloneObject=function(d){if(!YAHOO.lang.isValue(d)){return d;}var f={};if(YAHOO.lang.isFunction(d)){f=d;}else{if(YAHOO.lang.isArray(d)){var e=[];for(var c=0,b=d.length;c<b;c++){e[c]=YAHOO.widget.AutoComplete._cloneObject(d[c]);}f=e;}else{if(YAHOO.lang.isObject(d)){for(var a in d){if(YAHOO.lang.hasOwnProperty(d,a)){if(YAHOO.lang.isValue(d[a])&&YAHOO.lang.isObject(d[a])||YAHOO.lang.isArray(d[a])){f[a]=YAHOO.widget.AutoComplete._cloneObject(d[a]);}else{f[a]=d[a];}}}}else{f=d;}}}return f;};YAHOO.register("autocomplete",YAHOO.widget.AutoComplete,{version:"2.9.0",build:"2800"});
/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
(function(){var l=YAHOO.lang,isFunction=l.isFunction,isObject=l.isObject,isArray=l.isArray,_toStr=Object.prototype.toString,Native=(YAHOO.env.ua.caja?window:this).JSON,_UNICODE_EXCEPTIONS=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_ESCAPES=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,_VALUES=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS=/(?:^|:|,)(?:\s*\[)+/g,_UNSAFE=/[^\],:{}\s]/,_SPECIAL_CHARS=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_CHARS={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},UNDEFINED="undefined",OBJECT="object",NULL="null",STRING="string",NUMBER="number",BOOLEAN="boolean",DATE="date",_allowable={"undefined":UNDEFINED,"string":STRING,"[object String]":STRING,"number":NUMBER,"[object Number]":NUMBER,"boolean":BOOLEAN,"[object Boolean]":BOOLEAN,"[object Date]":DATE,"[object RegExp]":OBJECT},EMPTY="",OPEN_O="{",CLOSE_O="}",OPEN_A="[",CLOSE_A="]",COMMA=",",COMMA_CR=",\n",CR="\n",COLON=":",COLON_SP=": ",QUOTE='"';Native=_toStr.call(Native)==="[object JSON]"&&Native;function _char(c){if(!_CHARS[c]){_CHARS[c]="\\u"+("0000"+(+(c.charCodeAt(0))).toString(16)).slice(-4);}return _CHARS[c];}function _revive(data,reviver){var walk=function(o,key){var k,v,value=o[key];if(value&&typeof value==="object"){for(k in value){if(l.hasOwnProperty(value,k)){v=walk(value,k);if(v===undefined){delete value[k];}else{value[k]=v;}}}}return reviver.call(o,key,value);};return typeof reviver==="function"?walk({"":data},""):data;}function _prepare(s){return s.replace(_UNICODE_EXCEPTIONS,_char);}function _isSafe(str){return l.isString(str)&&!_UNSAFE.test(str.replace(_ESCAPES,"@").replace(_VALUES,"]").replace(_BRACKETS,""));}function _parse(s,reviver){s=_prepare(s);if(_isSafe(s)){return _revive(eval("("+s+")"),reviver);}throw new SyntaxError("JSON.parse");}function _type(o){var t=typeof o;return _allowable[t]||_allowable[_toStr.call(o)]||(t===OBJECT?(o?OBJECT:NULL):UNDEFINED);}function _string(s){return QUOTE+s.replace(_SPECIAL_CHARS,_char)+QUOTE;}function _indent(s,space){return s.replace(/^/gm,space);}function _stringify(o,w,space){if(o===undefined){return undefined;}var replacer=isFunction(w)?w:null,format=_toStr.call(space).match(/String|Number/)||[],_date=YAHOO.lang.JSON.dateToString,stack=[],tmp,i,len;if(replacer||!isArray(w)){w=undefined;}if(w){tmp={};for(i=0,len=w.length;i<len;++i){tmp[w[i]]=true;}w=tmp;}space=format[0]==="Number"?new Array(Math.min(Math.max(0,space),10)+1).join(" "):(space||EMPTY).slice(0,10);function _serialize(h,key){var value=h[key],t=_type(value),a=[],colon=space?COLON_SP:COLON,arr,i,keys,k,v;if(isObject(value)&&isFunction(value.toJSON)){value=value.toJSON(key);}else{if(t===DATE){value=_date(value);}}if(isFunction(replacer)){value=replacer.call(h,key,value);}if(value!==h[key]){t=_type(value);}switch(t){case DATE:case OBJECT:break;case STRING:return _string(value);case NUMBER:return isFinite(value)?value+EMPTY:NULL;case BOOLEAN:return value+EMPTY;case NULL:return NULL;default:return undefined;}for(i=stack.length-1;i>=0;--i){if(stack[i]===value){throw new Error("JSON.stringify. Cyclical reference");}}arr=isArray(value);stack.push(value);if(arr){for(i=value.length-1;i>=0;--i){a[i]=_serialize(value,i)||NULL;}}else{keys=w||value;i=0;for(k in keys){if(l.hasOwnProperty(keys,k)){v=_serialize(value,k);if(v){a[i++]=_string(k)+colon+v;}}}}stack.pop();if(space&&a.length){return arr?OPEN_A+CR+_indent(a.join(COMMA_CR),space)+CR+CLOSE_A:OPEN_O+CR+_indent(a.join(COMMA_CR),space)+CR+CLOSE_O;}else{return arr?OPEN_A+a.join(COMMA)+CLOSE_A:OPEN_O+a.join(COMMA)+CLOSE_O;}}return _serialize({"":o},"");}YAHOO.lang.JSON={useNativeParse:!!Native,useNativeStringify:!!Native,isSafe:function(s){return _isSafe(_prepare(s));},parse:function(s,reviver){if(typeof s!=="string"){s+="";}return Native&&YAHOO.lang.JSON.useNativeParse?Native.parse(s,reviver):_parse(s,reviver);},stringify:function(o,w,space){return Native&&YAHOO.lang.JSON.useNativeStringify?Native.stringify(o,w,space):_stringify(o,w,space);},dateToString:function(d){function _zeroPad(v){return v<10?"0"+v:v;}return d.getUTCFullYear()+"-"+_zeroPad(d.getUTCMonth()+1)+"-"+_zeroPad(d.getUTCDate())+"T"+_zeroPad(d.getUTCHours())+COLON+_zeroPad(d.getUTCMinutes())+COLON+_zeroPad(d.getUTCSeconds())+"Z";},stringToDate:function(str){var m=str.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3}))?Z$/);if(m){var d=new Date();d.setUTCFullYear(m[1],m[2]-1,m[3]);d.setUTCHours(m[4],m[5],m[6],(m[7]||0));return d;}return str;}};YAHOO.lang.JSON.isValid=YAHOO.lang.JSON.isSafe;})();YAHOO.register("json",YAHOO.lang.JSON,{version:"2.9.0",build:"2800"});
/**
 * this files creates the base namespace for all core starwood
 * code -"sw". In addtion, shortcuts are created into the YAHOO.util for ease of coding.
 * @author Danlan
 */

if(YAHOO.util){
    /**
     * create shortcuts into YAHOO lib, allows for easer coding/readability.
     * some of the shortcuts: yuiDom, yuiEvent, yuiAnim, yuiEasing...
     * Same as var yuiDom = YAHOO.util.Dom;
     */
    for(var prop in YAHOO.util){
        window["yui"+ prop] = YAHOO.util[prop];
    }
    if(YAHOO.lang.JSON){
        yuiJSON = YAHOO.lang.JSON;
    }
}
/**
 * create the base "sw" namespace for all core starwood code.
 */
var SW = YAHOO.namespace("SW");

YAHOO.namespace("SW.tools"); // general utility objects and methods
YAHOO.namespace("SW.customEvent"); // custom event models
YAHOO.namespace("SW.widget"); // larger components
YAHOO.namespace("SW.domWidget"); // built in dom scrubbing to gain hooks widgets
YAHOO.namespace("SW.widget.virtualEarth"); // virtualEarth components
YAHOO.namespace("SW.flash"); // adaptors for Flash. When Flash needs to call JS, it uses this namespace. Local flash code should prefix component name with brand (ie SW.flash.SPGTour)
YAHOO.namespace("SW.local"); // namespace for any non-common code. All brand/page specific code resides here
YAHOO.namespace("SW.local.content"); // namespace
YAHOO.namespace("SW.maps");//namespace for map related JS

/**
 * extensions to core JavaScript objects: Function, Array...
 */

/**
 * Class method for copying psuedo-arrays to *real* arrays, such
 * as function arguments and dom node collections (ie, document.getElementsByTagName("div"))
 * @param {Object} original array
 * @return {Array} new *real* array
 */
Array.Copy = function(original){
  var i,result = [];
  for(i=0;i<original.length;i++){
    result.push(original[i]);
  }
  return result;
};
/**
 * alters the context in which a method will run, can be handy when used in conjunction with events
 * @param {Object} context for method to run (sets up the "this" reference)
 * @param... all additional parameters are passed to the bound method as parameters
 * @return {Function} invoking this function in any context will run the method in the correct context
 */
/*
  example:
  var myObject = {
    name:"fred"
  };
  function doTest(param1,param2){
    alert(this.name +'\n'+ param1 +'\n'+ param2);
  }
  var boundMethod = doTest.bind(myObject,"12","jane");
  boundMethod();
*/
Function.prototype.bind = function(context) {
  var method = this;
  var args = Array.Copy(arguments);
  var obj = args.shift();
  return function() {
    return method.apply(obj, args);
  };
};

// JavaScript 1.6 methods
if (!Array.forEach) {
    // perform action on each item of array - used in place of: for(i=0;i<myArray.length;i++) {...}
    /*
     example:
     var myArray = ['apple','banana','pear'];
     myArray.forEach(function(fruit){
     document.write(fruit);
     });
     */
    Array.prototype.forEach = function(fn, thisObj) {
        var i, j, scope = thisObj || window;
        for (i = 0, j = this.length; i < j; ++i) {
            fn.call(scope, this[i], i, this);
        }
    };
}
if (!Array.every) {
    // check if every item in array matches some criteria
    /*
     example:
     var myArray = [
     {name:'apple',type:'fruit'},
     {name:'steak',type:'meat'},
     {name:'pear',type:'fruit'}
     ];
     // returns false
     var allItemsAreFruits = myArray.every(function(food){
     return (food.type == "fruit");
     });
     */
    Array.prototype.every = function(fn, thisObj) {
        var i, j, scope = thisObj || window;
        for (i = 0, j = this.length; i < j; ++i) {
            if (!fn.call(scope, this[i], i, this)) {
                return false;
            }
        }
        return true;
    };
}
if (!Array.some) {
    // check if every item in array matches some criteria
    /*
     example:
     var myArray = [
     {name:'apple',type:'fruit'},
     {name:'steak',type:'meat'},
     {name:'pear',type:'fruit'}
     ];
     // returns true
     var someItemsAreFruits = myArray.some(function(food){
     return (food.type == "fruit");
     });
     */
    Array.prototype.some = function(fn, thisObj) {
        var i, j, scope = thisObj || window;
        for (i = 0, j = this.length; i < j; ++i) {
            if (fn.call(scope, this[i], i, this)) {
                return true;
            }
        }
        return false;
    };
}
if (!Array.map) {
    // create a new array based on contents of original array
    /*
     example:
     var myArray = [
     {name:'apple',type:'fruit'},
     {name:'steak',type:'meat'},
     {name:'pear',type:'fruit'}
     ];
     var arrayOfHtml = myArray.map(function(food){
     return "<div>"+ food.name +" ("+ food.type +")</div>";
     });
     */
    Array.prototype.map = function(fn, thisObj) {
        var i, j, scope = thisObj || window,
            a = [];
        for (i = 0, j = this.length; i < j; ++i) {
            a.push(fn.call(scope, this[i], i, this));
        }
        return a;
    };
}
if (!Array.filter) {
    // create a new array of filtered results
    /*
     example:
     var myArray = [
     {name:'apple',type:'fruit'},
     {name:'steak',type:'meat'},
     {name:'pear',type:'fruit'}
     ];
     // returns true
     var fruits = myArray.map(function(food){
     return (food.type == "fruit");
     });
     */
    Array.prototype.filter = function(fn, thisObj) {
        var i, j, scope = thisObj || window,
            a = [];
        for (i = 0, j = this.length; i < j; ++i) {
            if (!fn.call(scope, this[i], i, this)) {
                continue;
            }
            a.push(this[i]);
        }
        return a;
    };
}
if (!Array.indexOf) {
    // returns index of specified element (-1 if not found)
    Array.prototype.indexOf = function(el, start) {
        var i, j;
        start = start || 0;
        for (i = start, j = this.length; i < j; ++i) {
            if (this[i] === el) {
                return i;
            }
        }
        return -1;
    };
}
if (!Array.lastIndexOf) {
    // returns the last index of specified element (-1 if not found)
    Array.prototype.lastIndexOf = function(el, start) {
        var i;
        start = start || this.length;
        if (start >= this.length) {
            start = this.length;
        }
        if (start < 0) {
            start = this.length + start;
        }
        for (i = start; i >= 0; --i) {
            if (this[i] === el) {
                return i;
            }
        }
        return -1;
    };
}
// more useful array methods
// override commented out as it was conflicting with Bing Maps API
// found no usage of this method in whole codebase except swfAddress library which is 3rd party anyway
/* if(!Array.splice){
 Array.prototype.splice = function (iIndex , iLength ) {
 var i,aResult  = new Array();
 var aRemoved  = new Array();
 for (i=0; i < iIndex; i++){
 aResult.push(this[i]);
 }
 for (i=iIndex; i < iIndex+iLength; i++) {
 aRemoved.push(this[i]);
 }
 if (arguments.length > 2) {
 for (i=2; i < arguments.length; i++) {
 aResult.push(arguments[i]);
 }
 }
 for (i=iIndex+iLength; i < this.length; i++) {
 aResult.push(this[i]);
 }
 for (i=0; i < aResult.length; i++) {
 this[i] = aResult[i];
 }
 this.length = aResult.length;
 return aRemoved;
 }
 } */
if (!Array.remove) {
    Array.prototype.remove = function (vItem) {
        this.removeAt(this.indexOf(vItem));
        return vItem;
    };
}
if (!Array.removeAt) {
    Array.prototype.removeAt = function (iIndex) {
        var vItem = this[iIndex];
        if (vItem) {
            this.splice(iIndex, 1);
        }
        return vItem;
    };
}


// object/JSON sorting
(function() {
    // local object which creates comparator functions for sorting arrays of objects
    var Comparator = {
        cache:{},
        getComparator:function(array,criteria) {
            // if array is empty, we can exit now
            if(array.length == 0){
                return function(){ return 0; }
            }
            // criteria are function arguments, need  to turn into 'real' array
            criteria = Array.Copy(criteria);
            var criteriaId = criteria.join();
            if(!Comparator.cache[criteriaId]){
                // generate function
                // "new Function" is generally not a good idea, but actually provides the best for performance in this case
                var functionBody = [];
                var thisCriteria,i;
                functionBody.push("  var val = 0;");
                for (i = 0; i < criteria.length; i++) {
                    thisCriteria = criteria[i];
                    switch(typeof array[0][thisCriteria]){
                        case "string":
                            functionBody.push("  val = (b."+ thisCriteria +" < a."+ thisCriteria +") - (a."+ thisCriteria +" < b."+ thisCriteria +");");
                            break;
                        case "number":
                            functionBody.push("  val = a."+ thisCriteria +" -  b."+ thisCriteria +";");
                            break;
                        case "boolean":
                            functionBody.push("  val = (a."+ thisCriteria +"*-1) -  (b."+ thisCriteria +"*-1);");
                            break;
                    }
                    functionBody.push("  if (val != 0) {");
                    // look ahead for -1;
                    if(criteria[i+1] === -1){
                        functionBody.push("    return val * -1;");
                    }else{
                        functionBody.push("    return val;");
                    }
                    functionBody.push("  }");
                }
                functionBody.push("  return val;");
                Comparator.cache[criteriaId] = new Function("a","b",functionBody.join("\n"));
            }
            return Comparator.cache[criteriaId];
        }
    };

    /**
        Object sorting (JSON sorting) method. To have a field use reverse order (DESC), make -1 the following parameter (see examples)
        Here is a sample objectSort call for DISTANCE sorting in SPG:
            searchResults.objectSort("isParticipating","favorite","distance","hasCash","cityName","propertyName");
        Simple example - for and array of people, sort by last name, then by first name
            people.sort("lsatName","firstName");
        Simple example - Sort people by age oldest to youngest, then by last name (a-z)
            people.sort("age",-1,"lastName");

    **/
    Array.prototype.objectSort = function() {
        // perform sort and return instance array
        this.sort(Comparator.getComparator(this,arguments));
        return this;
    };
})();

// object/JSON filtering
(function() {
    var FilterManager = {
        cache:{},
        getFilter:function(array,criteria){
            if(array.length === 0 || criteria.length === 0){
                return function(){return true;};
            }
            var criteriaId = criteria.join();
            if(!FilterManager.cache[criteriaId]){
                var functionBody = [],
                    conditions = [],
                    quoteChar = "",
                    thisField,thisValue,thisOperator,i,innerCondition,prefix,suffix;
                for (i = 0; i < criteria.length; i+=3) {
                    prefix = "";
                    suffix = "";
                    thisField = criteria[i];
                    thisValue = criteria[i+1];
                    // if value is not an array, turn it into one
                    if(!(typeof thisValue == "object" && thisValue.length > 0)){
                        thisValue = [thisValue];
                    }
                    thisOperator = criteria[i+2];
                    quoteChar = (typeof array[0][thisField] == "string") ? "\"" : "";
                    switch(thisOperator){
                        case "equals":
                            prefix = "item."+ thisField +" == "+ quoteChar;
                            suffix = quoteChar ;
                            break;
                        case "notEquals":
                            prefix = "item."+ thisField +" != "+ quoteChar;
                            suffix = quoteChar ;
                            break;
                        case "greaterThan":
                            prefix = "item."+ thisField +" > "+ quoteChar;
                            suffix = quoteChar ;
                            break;
                        case "lessThan":
                            prefix = "item."+ thisField +" < "+ quoteChar;
                            suffix = quoteChar ;
                            break;
                        case "greaterThanEquals":
                            prefix = "item."+ thisField +" >= "+ quoteChar;
                            suffix = quoteChar ;
                            break;
                        case "lessThanEquals":
                            prefix = "item."+ thisField +" <= "+ quoteChar;
                            suffix = quoteChar ;
                            break;
                        case "contains":
                            quoteChar = "\"";
                            prefix = "item."+ thisField +".indexOf("+ quoteChar;
                            suffix = quoteChar +") > -1";
                            break;
                        default:
                            // if invalid operator passed, do not use this criteria
                            continue;
                    }
                    innerCondition = [];
                    thisValue.forEach(function(val){
                        innerCondition.push(prefix + val + suffix);
                    });
                    conditions.push("("+ innerCondition.join(" ||  ") +")");
                }
                functionBody.push("if( "+ conditions.join(" && ") +"){");
                functionBody.push("  return true;");
                functionBody.push("}");
                functionBody.push("return false;");
                FilterManager.cache[criteriaId] = new Function("item",functionBody.join("\n"));

            }
            return FilterManager.cache[criteriaId];
        }
    };

    Array.prototype.setFilter = function(field,value,operator) {
        // first time calling setFilter, setup objects and methods
        var criteria = [],
            thisArray = this;
        thisArray.setFilter = function(field,value,operator) {
            if(arguments.length === 0){
                criteria.length = 0;
                return thisArray;
            }
            operator = operator || "equals";
            criteria.push(field,value,operator);
            return thisArray;
        };
        thisArray.objectFilter = function(){
            var result = thisArray.filter(FilterManager.getFilter(thisArray,criteria));
            criteria.length = 0;
            return result;
        };

        // set this filter criteria and return array (note - this code only runs first time setFilter is called)
        thisArray.setFilter(field,value,operator);
        return thisArray;
    };
    // dummy placeholder method... here just in case objectFilter is called before setFilter
    Array.prototype.objectFilter = function() {
        // behave like normal, return copy of this array
        return Array.Copy(this);
    };
})();
/**
 * The utilities.js file provides additional functions, many built on top of yahoo
 * @module starwood utilities
 * @requires yahoo-dom-event
 */


// can be used in place of window.onload or yuiEvent.addListener(window,"load",...).
// In theory, this fires when the closing body tag is drawn (before window.onload).

/**
 * @deprecated
 * @param String url
 * @param String param
 * @param String val
 * @return String
 */
SW.tools.setUrlParameter = function(url,param,val){
    return SW.tools.Url.setParameter(url,param,val);
}
SW.tools.Url = {
    /**
     * used to add or change value of parameter in url
     * var url = SW.tools.setUrlParamter(document.location.href,"propID",mySelect.value);
     * @param url
     * @param param
     * @param val
     * @return String
     */
    setParameter:function(url,param,val){
        var curPairs;
        var paramPair;
        var hashString = "";
        if(url.indexOf("#") > -1){
            hashString = url.substr(url.indexOf("#")+1);
            url = url.substring(0,url.indexOf("#"));
        }
        var allPairs = [];
        var urlParts = url.split('?');

        if(urlParts.length>1){
            curPairs = urlParts[1].split('&');
            curPairs.forEach(function(paramPair){
                var paramParts = paramPair.split('=');
                if(paramParts[0] != param){
                    allPairs.push(paramParts[0] + '=' + (typeof paramParts[1] != "undefined" ? paramParts[1]:'') );
                }
            });
        }
        if(val !== null && typeof val !== 'undefined'){ 
            allPairs.push(param + '=' + val);
        }
        return urlParts[0] + '?' + allPairs.join('&') + (hashString ? "#"+hashString:"");

    },
    getParameter:function(url,param){
        var i,urlParts,curPairs,paramParts;
        if(url.indexOf("#") > -1){
            url = url.substring(0,url.indexOf("#"));
        }
        urlParts = url.split('?');
        if(urlParts.length>1){
            curPairs = urlParts[1].split('&');
            for(i = 0; i < curPairs.length; i++){
                paramPair = curPairs[i];
                paramParts = paramPair.split('=');
                if(paramParts[0] === param){
                    return paramParts[1];
                }
            }
        }
        return null;
    },
    getHash:function(url){
        if(url.indexOf("#") > -1){
           return url.substring(url.indexOf("#")+1);
        }
        return "";
    }
};
/**
 * add to img tags which are using [semi]transparent png's to fix IE6 issue
 * This is only way to avoid *ALL* IE6 issues! (including browser freezing/locking up)
 * sample:
 *      <img src="/path/to/myImage.png" width="233" height="82" onload="SW.tools.iePNGLoader(this);" />
 * @param img
 */
SW.tools.iePNGLoader = function(img){
    if (navigator.userAgent.indexOf("MSIE") > -1 && parseInt(navigator.appVersion) <= 6) {
      var pSrc = img.src;
      img.onload = null;
      img.src = "/common/images/shim.gif";
      img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, src='" + pSrc + "')";
    }
}                                                                   

// Begin Code from YUI: Colorpicker
var HCHARS="0123456789ABCDEF";
/**
 * Converts decimal rgb values into a hex string
 * 255,255,255 -> FFFFFF
 * @method rgb2hex
 * @param r {int|[int, int, int]} the red value, or an
 *        array containing all three parameters
 * @param g {int} the green value
 * @param b {int} the blue value
 * @return {string} the hex string
 */
SW.tools.rgb2hex =  function(r, g, b) {
	var f=this.dec2hex;
	return f(r) + f(g) + f(b);
};

/**
 * Converts an int 0...255 to hex pair 00...FF
 * @method dec2hex
 * @param n {int} the number to convert
 * @return {string} the hex equivalent
 */
SW.tools.dec2hex = function(n) {
	n = parseInt(n, 10);
	n = (n > 255 || n < 0) ? 0 : n;

	return HCHARS.charAt((n - n % 16) / 16) + HCHARS.charAt(n % 16);
};
// End code from YUI: Colorpicker



// used in conjunction with secure json calls
// new yuiConnect( secureJsonUrl("/path/to/myData.jsp?someID=45") );
SW.tools.secureJsonUrl = function(url){
  return SW.tools.Url.setParameter(url,"_jsk",SW.Cookie.get("JSESSIONID"));
}

/*
### set cookie ###
  --> set basic session cookie
    SW.tools.Cookie.set("sid","somevalue");

  --> set permanent cookie
    SW.tools.Cookie.set("sid","somevalue","NEVER");

  --> set cookie to expire sometime in the future
    var exDate = new Date();
    expires.setMonth(expires.getMonth()+1);
    SW.tools.Cookie.set("sid","somevalue",expires);

### get cookie ###
  --> get value of cookie
    SW.tools.Cookie.get("sid");
    
### remove cookie ###
  --> remove cookie
    SW.tools.Cookie.remove("sid");
*/
SW.tools.Cookie = {
  values:[],
  loaded:false,
  set:function(name, value, expires, path, domain, secure){
    var cookieValue = new Array();
    cookieValue.push(name + "=" + escape(value));
    if(typeof expires != "undefined"){
      if(typeof expires == "string"){
        if(expires.toUpperCase() == "NEVER"){
          expires = new Date();
          expires.setFullYear(expires.getFullYear()+10);
        }else if(expires.toUpperCase() == "REMOVE"){
          expires = new Date();
          expires.setFullYear(expires.getFullYear()-1);
        }
      }
      cookieValue.push("expires=" + expires.toGMTString());
    }
    if(typeof path == "undefined"){
      path = "/";
    }
    cookieValue.push("path="+ path);
    if(typeof domain != "undefined"){
      cookieValue.push("domain=" + domain);
    }
    if(secure){
      cookieValue.push("secure");
    }
    document.cookie = cookieValue.join("; ");
    SW.tools.Cookie.loaded = false;
  },
  get:function(name){
    if (!SW.tools.Cookie.loaded) {
      SW.tools.Cookie._readCookie();
    };
    for (var i=0; i<SW.tools.Cookie.values.length; i++) {
      if (SW.tools.Cookie.values[i].name == name) {
        return SW.tools.Cookie.values[i].value;
      };
    }
    return "";
  },
  remove:function(name){
    SW.tools.Cookie.set(name,"","REMOVE");
  },
  // internal method
  _readCookie:function(){
    var cookieString = document.cookie;
    var paramPairs = cookieString.split("; ");
    var i,splitPair;
    SW.tools.Cookie.values = [];
    for (i=0; i<paramPairs.length; i++) {
      splitPair = paramPairs[i].split("=");
      if (splitPair.length == 2) {
        SW.tools.Cookie.values.push({
          name:unescape(splitPair[0]),
          value:unescape(splitPair[1])
        });
      }
    };
    SW.tools.Cookie.loaded = true;
  }
};

SW.tools.getSkinName = function(){
     return document.location.pathname.split("/")[1];
 };

SW.tools.Xml = {
    /**
     *
     * @param node - reference to parent node
     * @param tagname - tagname for which you want to get it's "innerText"
     * @return String
     */
    getSubNodeText:function(node, tagname){
        var returnValue;
        subNode = node.getElementsByTagName(tagname);
        if (subNode[0] != null) {
            returnValue = subNode[0].textContent || subNode[0].text;
            if(typeof returnValue == 'undefined' && subNode[0].firstChild){
                returnValue = subNode[0].firstChild.nodeValue;
            }
        }
        if(!returnValue){
            returnValue = "";
        }
        return returnValue;
    }
};

// helper methods to scrub html for data (taken from results.js - consider making common version)

SW.tools.Html = (function(){
    var yuiDom = YAHOO.util.Dom,
        yuiLang = YAHOO.lang;
    
    function dataToType(data, type, defaultVal) {
        var val = defaultVal;
        switch (type) {
            case "string":
                val = (data === "") ? defaultVal:data;
                break;
            case "array":
                if(data === ""){
                   val = defaultVal;
                }else{
                    val = data.split(",");
                }
                break;
            case "boolean":
                val = (data === "true") ? true:defaultVal;
                break;
            case "float":
                val = parseFloat(data);
                if (isNaN(val)) {
                    val = defaultVal;
                }
                break;
            case "int":
                val = parseInt(data, 10);
                if (isNaN(val)) {
                    val = defaultVal;
                }
                break;
            default:
                break;
        }
        return val;
    }
    var self = {
        getDataFromInput:function(root, className, type, defaultVal) {
            var input = yuiDom.getElementsByClassName(className, "input", root);
            var val = defaultVal;
            if (input && input[0]) {
                val = dataToType(input[0].value, type, defaultVal);
            }
            return val;
        },
        getDataFromTag:function(root, tagName, className, type, defaultVal) {
            var result = yuiDom.getElementsByClassName(className, tagName, root);
            var val = defaultVal;
            if (result && result[0]) {
                val = dataToType(yuiLang.trim(result[0].innerHTML), type, defaultVal);
            }
            return val;
        },
        getClearDiv:function(){
            var div = document.createElement("div");
            yuiDom.addClass(div,"clearDiv");
            return div;
        },
        appendClearDiv:function(parentNode){
            parentNode.appendChild(self.getClearDiv());
        }
    };
    return self;
})();
/**
 * SW.domWidget provides a common interface for Dom manipulation that
 * runs onDOMReady or when a manual refresh call is made to
 * SW.domWidget.update(rootElement).
 * NOTE: Performance is critical when developing new domWidget!
 * @namespace SW.domWidget
 */


/**
 * base widget - copy and paste the following code to start new widget.
 * must include id. This is used for namespacing.
 * should include load and update methods.
 * initialize is a standard naming convention, not required.
 * the following methods are automatically attached:
 *   setConfig - attaches config objects to html elements
 *   getConfig - retreived config object from html element
 *   setEnabled - turns a widget on/off
 *   getEnabled - used internally to determine if widget is enabled
 * all domWidget are disabled by default. To enable a widget, you must call
 *   SW.domWidget.WIDGET_ID.setEnabled(true);
 */
/*
SW.domWidget.add({
  id:"WidgetId",
  initialize:function(){
     // standard function name - manually called - SW.domWidget.WidgetId.initialize(params...);
  },
  load:function(){
    // do load stuff, find elements and setup
  },
  update:function(root){
    // do update stuff, find elements and setup. root element is passed in.
  }
});

*/

SW.domWidget = {
  widgetArray:[],
  initialize:function(){
    yuiEvent.onDOMReady(SW.domWidget.load);
  },
  /**
   * add a new wiget to the domWidget manager
   * @param {Object} widget
   */
  add:function(widget){
    SW.domWidget.widgetArray.push(widget);
    SW.domWidget[widget.id] = widget;
    widget.enabled = false;
    widget.setConfig = function(els,config){
      var self = this;
      if(! (typeof els == "object") || !(els.constructor == Array)){
        els = [els];
      }
      els.forEach(function(el){
        el = yuiDom.get(el);
        if(!el.widgetConfig){ el.widgetConfig = {}; }
        el.widgetConfig[self.id] = config;
      });
    }
    widget.getConfig = function(el){
      if(el && el.widgetConfig && el.widgetConfig[this.id]){
        return el.widgetConfig[this.id];
      }
      return null;
    }
    widget.setEnabled = function(enabled){
      this.enabled = enabled;
    }
    widget.getEnabled = function(){
      return this.enabled;
    }
  },
  /**
   * runs onDOMReady, checks for enabled domWidget and runs each load method
   */
  load:function(){
    SW.domWidget.widgetArray.forEach(function(widget){
      if(widget.getEnabled() && widget.load){
        widget.load();
      }
    });
  },
  /**
   * Manually call this method when creating html on the fly (dom methods or innerHTML).
   * checks for enabled domWidget and runs each update method, passing in the root element.
   * @param {Object} root
   */
  update:function(root){
    SW.domWidget.widgetArray.forEach(function(widget){
      if(widget.getEnabled() && widget.update){
        widget.update(root);
      }
    });
  }
};
/**
 * get things started...
 */
SW.domWidget.initialize();

/**
 * provides "label inside of text input" functionality. Label and class names are removed on click.
 * Include a custom attribute of label on text inputs, eg: label="(enter city)". When this label is showing,
 * a class of "hasDefaultText" will be applied to the input.
 * @namespace SW.domWidget.inputLabels
 */
// begin inputLabels //
SW.domWidget.add({
  id:"inputLabels",
  initialize:function(){

  },
  load:function(){
    this.setup();
  },
  update:function(root){
    this.setup(root);
  },
  /**
   * find all elements and initialize
   * @param {Object} root
   */
  setup:function(root){
    var self = this;
    yuiDom.getElementsBy(function(input){
      if(!!input.getAttribute("label")){
         self.setupInput(input);
      }
    },"input",root);
    yuiDom.getElementsBy(function(input){
      if(!!input.getAttribute("label")){
         self.setupInput(input);
      }
    },"textarea",root);
  },
  /**
   * initialize single input. Adds listeners for focus and blur on the input.
   * Also, adds listeners for form.onsubmit and submitButton.click. More cleanly handles clearing
   * the label out of the value when the form submits.
   * @param {Object} input
   */
  setupInput:function(input){
    var self = this;
    if(!this.getConfig(input)){
      var config = {
        label:input.getAttribute("label")
      };
      this.setConfig(input,config);
      yuiEvent.addListener(input,"focus",this.removeLabelBridge);
      yuiEvent.addListener(input,"blur",this.setLabelBridge);
      if(input.form){
        yuiEvent.addListener(input.form,"submit",self.removeLabelBridge.bind(input));
        // also try to attach to submit buttons - this fire before forom.onsubmit and can help play better with validation functions
        function addSubmitHandler (submitButton){
          if(submitButton.type == "submit"){
            yuiEvent.addListener(submitButton,"click",self.removeLabelBridge.bind(input));
          }
        }
        yuiDom.getElementsBy(addSubmitHandler,"input",input.form);
        yuiDom.getElementsBy(addSubmitHandler,"button",input.form);
      }
    }
    this.setLabel(input);
  },
  /**
   * two main methods for checking, adding & removing label
   */
  removeLabel:function(input){
    var config = this.getConfig(input);
    if(input.value == config.label){
      yuiDom.removeClass(input,"hasDefaultText");
      input.value = "";
    }
  },
  setLabel:function(input){
    var config = this.getConfig(input);
    if(input.value == "" || input.value == config.label){
      yuiDom.addClass(input,"hasDefaultText");
      input.value = config.label;
    }
  },
  /**
   * event handlers/bridging methods. Maintain "this" in *real* methods.
   */
  removeLabelBridge:function(e){
    SW.domWidget.inputLabels.removeLabel(this);
  },
  setLabelBridge:function(e){
    SW.domWidget.inputLabels.setLabel(this);
  }
});

/**
 * provides tool tip/contextual help. Must have a container element with
 * a class of "toolTipTrigger" and an inner element with a class of
 * "toolTip" (Must only be one "toolTip" inside of a trigger!).
 * @namespace SW.domWidget.toolTips
 */
SW.domWidget.add({
  id:"toolTips",
  classSettings:{},
  idSettings:{},
  /**
   * base setttings, if none are provided
   */
  settings:{
    /**
     * appendTipToBody - moves the toolTip element to the body element. Makes absolute positioning easier.
     * set to false to leave the tool tip owned by the toolTipTrigger.
     */
    triggerClassName:"toolTipTrigger",
    tipClassName:"toolTip",
    triggerTagName:"span",
    tipTagName:"div",

    appendTipToBody:true,
    showDelay:0.35,
    hideDelay:0.5,
    showDuration:.175,
    hideDuration:.25,
    showTransition:YAHOO.util.Easing.easeIn,
    hideTransition:YAHOO.util.Easing.easeIn,
    stopEventOnClick:true,
    showAttributes:{
      opacity:{from:0,to:1}
    },
    hideAttributes:{
      opacity:{from:1,to:0}
    },
    setPosition:function(config,e){
      var coords  = yuiEvent.getXY(e);
      var viewPortWidth = yuiDom.getViewportWidth();
      var toolTipWidth = yuiDom.getStyle(config.tip,"width");
      toolTipWidth = toolTipWidth.substring(0,toolTipWidth.length-2);
      if ((coords[0] + toolTipWidth) >= viewPortWidth) coords[0] -= toolTipWidth;
      yuiDom.setStyle(config.tip,"left", coords[0] +"px");
      yuiDom.setStyle(config.tip,"top", coords[1] +"px");
    },
    showOnStart:function(config){
      yuiDom.setStyle(config.tip,"opacity",0);
    },
    showOnComplete:function(config){
      // do nothing
    },
    hideOnStart:function(config){
      // do nothing
    },
    hideOnComplete:function(config){
      // do nothing
    }
  },
  /**
   * global settings, affects all tool tips on a page.
   * @See SW.domWidget.toolTips.settings
   * @param {Object} globalSettings
   */
  initialize:function(globalSettings){
    this.addSettings(globalSettings,"global",null);
  },
  /**
   * class name based settings. The class must be applied to the trigger,
   * for example <span class="toolTipTrigger customToolTip"></span>.
   * These settinsg will only apply to the "customToolTip".
   * @See SW.domWidget.toolTips.settings
   * @param {Object} className
   * @param {Object} classSettings
   */
  addClassSettings:function(className,classSettings){
    classSettings.triggerClassName = className;
    this.addSettings(classSettings,"class",className);
  },
  /**
   * id based settings can be useful for specific placement of toolTip for a
   * single element (ie, when the toolTip might display over a select box)
   * @See SW.domWidget.toolTips.settings
   * @param {Object} id
   * @param {Object} idSettings
   */
  addIdSettings:function(id,idSettings){
    this.addSettings(idSettings,"id",id);
  },
  /**
   * internal function for adding settings.
   * @param {Object} settings
   * @param {Object} type
   * @param {Object} id
   */
  addSettings:function(settings,type,id){
    var curSettings,setting;
    switch(type){
      case "global":
        curSettings = this.settings;
        break;
      case "class":
        curSettings = this.classSettings[id] = {};
        break;
      case "id":
        curSettings = this.idSettings[id] = {};
        break;
    }
    if(curSettings && settings){
      for(setting in settings){
        curSettings[setting] = settings[setting];
      }
    }
  },
  /**
   * internal method to lookup a specific setting
   * @param {Object} config
   * @param {Object} setting
   */
  getSetting:function(config,setting){
    if(config.idSettings && typeof config.idSettings[setting] != "undefined"){
      return config.idSettings[setting];
    }
    if(config.classSettings && typeof config.classSettings[setting] != "undefined"){
      return config.classSettings[setting];
    }
    return this.settings[setting];
  },
  load:function(){
    this.getElements();
  },
  update:function(root){
    this.getElements(root);
  },
  /**
   * find the tool tips
   * @param {Object} root
   */
  getElements:function(root){
    var self = this;
    var el,config,className,id;
    root = root || document;

    for(id in this.idSettings){
      el = yuiDom.get(id);
      if(el){
        config = {
          idSettings:this.idSettings[id]
        };
        for(className in this.classSettings){
          if(yuiDom.hasClass(el,className)){
            config.classSettings = this.classSettings[className];
            break;
          }
        }
        self.setup(el);
      }
    }

    for(className in this.classSettings){
      config = {
        classSettings:this.classSettings[className]
      };
      yuiDom.getElementsByClassName(className,self.getSetting(config,"triggerTagName"),root).forEach(function(element){
        self.setup(element);
      });
    }

    config = {};

    yuiDom.getElementsByClassName(self.getSetting(config,"triggerClassName"),self.getSetting(config,"triggerTagName"),root).forEach(function(element){
      self.setup(element);
    });
  },
  /**
   * initialize single tool tip
   * @param {Object} trigger
   */
  setup:function(trigger){
    var classSettings = null,idSettings = null;
    var tip,tipImage,closeButton;
    var animIn,animOut;
    var self = this;
    var primaryElements = [];
    if(!this.getConfig(trigger)){
//      tip = yuiDom.getElementsByClassName("toolTip",null,trigger)[0];
      closeButton = yuiDom.getElementsByClassName("toolTipClose",null,trigger)[0];

      if(trigger.id && this.idSettings[trigger.id]){
        idSettings = this.idSettings[trigger.id];
      }
      for(var prop in this.classSettings){
        if(yuiDom.hasClass(trigger,prop)){
          classSettings = this.classSettings[prop];
          break;
        }
      }
      /**
       * config object is attached to all import elements using this.setConfig();
       * this contains all pertinent information about this instance.
       */
      var config = {
        trigger:trigger,
        tip:null,
        tipImage:tipImage,
        isShowing:false,
        isOver:false,
        showTimeout:null,
        hideTimeout:null,
        classSettings:classSettings,
        idSettings:idSettings,
        x:0,
        y:0
      };
      tip = yuiDom.getElementsByClassName(self.getSetting(config,"tipClassName"),self.getSetting(config,"tipTagName"),trigger)[0];
      config.tip = tip;
      if(this.getSetting(config,"appendTipToBody")){
        document.body.appendChild(tip);
      }

      animIn = new yuiAnim(tip,this.getSetting(config,"showAttributes"),this.getSetting(config,"showDuration"),this.getSetting(config,"showTransition"));
      animIn.onStart.subscribe(function(){
        self.getSetting(config,"showOnStart")(config);
        yuiDom.addClass(config.tip,"toolTipShowing");
      });
      animIn.onComplete.subscribe(function(){
        self.getSetting(config,"showOnComplete")(config);
      });
      animOut = new yuiAnim(tip,this.getSetting(config,"hideAttributes"),this.getSetting(config,"hideDuration"),this.getSetting(config,"hideTransition"));
      animOut.onStart.subscribe(function(){
        self.getSetting(config,"hideOnStart")(config);
      });
      animOut.onComplete.subscribe(function(){
        self.getSetting(config,"hideOnComplete")(config);
        yuiDom.removeClass(config.tip,"toolTipShowing");
      });

      config.animIn = animIn;
      config.animOut = animOut;

      primaryElements.push(trigger);
      primaryElements.push(tip);
      if(closeButton){
        primaryElements.push(closeButton);
      }
      this.setConfig(primaryElements,config);
      // in future allow config to set mouseover or click for showing
      yuiEvent.addListener(trigger,"mouseover",this.bridge.setShow);
      yuiEvent.addListener(trigger,"mouseout",this.bridge.setHide);
      yuiEvent.addListener(tip,"mouseover",this.bridge.clearHide);
      yuiEvent.addListener(tip,"mouseout",this.bridge.setHide);
      // should the following line be config based? this prevents onlcicks from triggering on parent nodes
      if(this.getSetting(config,"stopEventOnClick")){
        yuiEvent.addListener(tip,"click",this.bridge.stopEvent);
      }
      if(closeButton){
        yuiEvent.addListener(closeButton,"click",this.bridge.hideNow);
      }
    }
  },
  /**
   * main internal methods to show and hide tool tips (using timeouts)
   */
  show:function(config){
    if(yuiDom.hasClass(config.tip,"toolTipShowing")){
      return;
    }
    if(config.isOver && !config.isShowing){
      config.isShowing = true;
      config.animIn.animate();
    }
  },
  hide:function(config){
    config.isShowing = false;
    config.animOut.animate();
  },
  setShow:function(config){
    var self = this;
    config.isOver = true;
    this.clearHide(config);
    if(!config.isShowing){
      config.showTimeout = setTimeout(function(){
        self.show(config);
      },this.getSetting(config,"showDelay")*1000);
    }
  },
  setHide:function(config){
    var self = this;
    config.isOver = false;
    if(!config.hideTimeout && config.isShowing){
      clearTimeout(config.showTimeout);
      config.showTimeout = null;
      config.hideTimeout = setTimeout(function(){
        self.hide(config);
      },this.getSetting(config,"hideDelay")*1000);
    }
  },
  clearHide:function(config){
    if(config.hideTimeout){
      clearTimeout(config.hideTimeout);
      config.hideTimeout = null;
    }
  },
  hideNow:function(config){
    this.hide(config);
  },
  /**
   * bridging methods to seperate event handlers from main methods
   */
  bridge:{
    setShow:function(e){
      var self = SW.domWidget.toolTips;
      var config = self.getConfig(this);

      if(!config.isShowing){
        self.getSetting(config,"setPosition")(config,e);
      }

      self.setShow(config);
    },
    setHide:function(e){
      var self = SW.domWidget.toolTips;
      var config = self.getConfig(this);
      self.setHide(config);
    },
    clearHide:function(e){
      var self = SW.domWidget.toolTips;
      var config = self.getConfig(this);
      self.clearHide(config);
    },
    hideNow:function(e){
      var self = SW.domWidget.toolTips;
      var config = self.getConfig(this);
      self.hideNow(config);
      yuiEvent.stopEvent(e);
    },
    stopEvent:function(e){
      yuiEvent.stopEvent(e);
    }
  }
});


/**
 * handles onchange of select box where the option values are urls.
 * add a class of "urlSelect" to the select box.
 * @namespace SW.domWidget.urlSelect
 */
SW.domWidget.add({
  id:"urlSelect",
  initialize:function(){
  },
  load:function(){
    this.setup();
  },
  update:function(root){
    this.setup(root);
  },
  setup:function(root){
    var self = this;
    yuiDom.getElementsByClassName("urlSelect","select",root).forEach(function(selectBox){
      self.setupSelect(selectBox);
    });
  },
  setupSelect:function(selectBox){
    var config;
    if(!this.getConfig(selectBox)){
      config = {
        input:selectBox
      }
      this.setConfig(selectBox,config);
      yuiEvent.addListener(selectBox,"change",this.selectUrlBridge);
    }
  },
  selectUrl:function(config){
    if(config.input.value){
      document.location.href = config.input.value;
    }
  },
  /**
   * bridging method
   * @param {Object} e
   */
  selectUrlBridge:function(e){
    SW.domWidget.urlSelect.selectUrl(SW.domWidget.urlSelect.getConfig(this));
  }
});

SW.domWidget.add({
  id:"dhtmlSelect",
  container:null,
  trigger:null,
  load:function(){
    this.setup();
  },
  update:function(root){
    this.setup(root);
  },
  setup:function(root){
    var self = this;
    yuiDom.getElementsByClassName("dhtmlSelect","div",root).forEach(function(container){
      if(!self.getConfig(container)){
        var config = {
          container:container,
          trigger:yuiDom.getElementsByClassName("dhtmlSelectTrigger",null,container)[0]
        };
        self.setConfig([config.trigger,config.container],config);
        yuiEvent.addListener(config.trigger,"click",self.showBridge);
        SW.domWidget.bodyClickHandler.add(self.hideBridge,[config.container],config.trigger);
      }
    });
  },
  show:function(config){
    yuiDom.addClass(config.container,"show");
  },
  hide:function(config){
    yuiDom.removeClass(config.container,"show");
  },
  showBridge:function(e){
    var self = SW.domWidget.dhtmlSelect;
    var config = self.getConfig(this);
    self.show(config);
  },
  hideBridge:function(e){
    var self = SW.domWidget.dhtmlSelect;
    var config = self.getConfig(this);
    self.hide(config);
  }
});

/**
 * single handler for detecting body.onclick. Conditionally fires supplied method
 * if the cick did not originate within one of the supplied test elements.
 * Example usage: dhtml drop-down, when a click outside the drop-down is detected, the close method
 * would be called.
 * @namespace SW.domWidget.bodyClickHandler
 */
SW.domWidget.add({
  id:"bodyClickHandler",
  initialized:false,
  handlers:[],
  load:function(){
    yuiEvent.addListener(document.body,"click",this.clickBridge);
  },
  /**
   * add a new handler
   * @param {Object} method - the method to be called, the event object will be passed as the only parameter to this method.
   * @param {Array} testElements - an array of container elements. If click originates inside one of these, the method will not be invoked.
   * @param {Object} context - Optional, supplies context for the method (the "this" object, defaults to window)
   */
  add:function(method,testElements,context){
    context = context || window;
    this.handlers.push({
      method:method,
      context:context,
      testElements:testElements
    });
  },
  click:function(e){
    var clickedElement = yuiEvent.getTarget(e);
    this.handlers.forEach(function(args){
      var isContained = false;
      for(var i=0;i<args.testElements.length;i++){
        if(args.testElements[i]==clickedElement || yuiDom.isAncestor(args.testElements[i],clickedElement)){
          isContained = true;
          break;
        }
      }
      if(!isContained){
        args.method.apply(args.context,[e]);
      }
    });
  },
  /**
   * bridging method
   * @param {Object} e
   */
  clickBridge:function(e){
    var self = SW.domWidget.bodyClickHandler;
    self.click(e);
  }
});
function WebForm() {
	var self = this;
	this.errors = new Array();
	this.addError = function(_x, _y, _z, _a, _b) {
		for (i=0; i < arguments.length; i++) {
			if(arguments[i] != null) {
				self.errors[self.errors.length] = new error(arguments[i]);

			}
		}

	}
	this.hasErrors = function() { return (self.errors.length != 0);	}
	this.resetErrors = function() {
		for (i = 0;  i < self.errors.length; i++) {
			self.errors[i].handle("reset");
		}
		self.errors = new Array();
	}
	this.showErrors = function() {
		for (i = 0;  i < self.errors.length; i++) {
			self.errors[i].handle();
		}
        if ((typeof s != 'undefined') && (typeof s.prop11 != 'undefined')) {
            var s_prop11 = s.prop11;
            s.prop11 += 'Error';
            setOmniVars(s.charSet, s.server, s.channel, s.prop2, s.prop3, s.prop1, "", s.prop11);
            var s_code=s.t();
            s.prop11 = s_prop11;
        }
    }
	function error(_x) {
		var self = this;
		var errorCode;
		self.errorCode = _x;
		this.handle = function(reset) {
			set = (reset==null) ? reset=false : reset=true;
			handleDisplay(self.errorCode, set);
		}
		return this;
	}
	this.collapseErrors = function(errorCode) {
		var count = 0;
		for (i = 0;  i < self.errors.length; i++) {
			if (self.errors[i].errorCode.charAt(0) == "~") { count++; }
		}
		if (count > 1) {
			for (i = 0;  i < self.errors.length; i++) {
				if (self.errors[i].errorCode.charAt(0) == "~") { self.errors[i].errorCode = null; }
			}
			self.errors[self.errors.length] = new error(errorCode);
		}
	}
}

function handleDisplay(_obj, reset) {
	if (_obj != null) {
		if (_obj.charAt(0) == "~") { _obj = _obj.substring(1);	}
		if (_obj.charAt(0) == "!") {
			reset = !reset;
			_obj = _obj.substring(1);
		}
		var obj = document.getElementById(_obj);
        if (obj) {
            if (obj.tagName == "LABEL") {
    			obj.className = reset ? "" : "error";
    		}  else {
    			obj.style.display =  reset ? "none" : "";
    		}
        }
    }
}

function display(obj, state) {
	if (document.getElementById(obj)) {
		document.getElementById(obj).style.display = state;
	}
}

function validDate(_field, dateFormat) {
    var self = this,
        field,
        d,
        _s,
        _d,
        getDate = true;

    if (typeof dateFormat != "undefined") {
        dateFormatString = dateFormat;
    }

    field = _field;
    _s = field.value;

    _d = getDateFromField(field, dateFormatString);
    this.valid = true;
    // safari will not return true for isNaN check even when the date is initialized with day = dd, month = mm, and year = yyyy
    if (isNaN(_d.getDate()) || (field.value.toLowerCase() == dateFormatString.toLowerCase())) {  // Basically, this allows the functions to gracefully return to the format string instead of putting a date in the field.
        this.valid = false;
    }

    this.d = _d;
    this.setField = function() {
        writeDateToField(field, this.d, dateFormatString);
    };
    this.setD = function(_d) {
        self.d = _d
    };
    this.nextDay = function() {
        return this.d.setDate(self.d.getDate() + 1);
    };
    this.diffDate = function(dd) {
        return  Math.round((makeDate(dd).getTime() - makeDate(self.d).getTime()) / (1000 * 60 * 60 * 24));
    };
    function makeDate(md) {
        return new Date(fixYear(md.getYear()), md.getMonth(), md.getDate());
    }
    return this;
}

function fixYear(_y) {
		var y = (_y + 10000) % 100;
		y += (y < 38) ? 2000 : 1900;
		return y
}

function isValidEmail(field) {
	if (field != null && field != ''){
		field = stripCharsInBag (field, ' ')
//        var regexp = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; (oldone)
        var regexp = /^\w+((-\w+)|(\`\w+)|(\.\w+)|('\w+)|(\+\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
        return (field.search(regexp) != -1);
	}
}

function doesUserNameContainHyphen(field) {
	var regExp = /-/;
	return (field.search(regExp) != -1)
}

function isValidZip(field, country){
	if (field != '' && field != null && country != '' && country != null){
		if (country == 'US'){
			var regExp = /(^\d{5}$)|(^\d{5}-\d{4}$)/;
			return (field.search(regExp) != -1)
		} else if (country == 'CA'){
			v = stripCharsInBag(field, "- ");
			var regexp = /^[A-Va-v]|[X,Y,x,y]\d[A-Za-z]\d[A-Za-z]\d$/;
			return (v.length == 6 && !hasChars(v,'D', 'F', 'I', 'O', 'Q', 'U') && v.search(regexp) != -1)
		}
	}
}

function isUSCanZip(zip,country){
	if (zip != '' && zip != null)
		return (country == 'US' || country == 'CA');
}

function isValidPhone(phone,country){
	if (phone != null && phone != '' && country != null && country !=''){
		return (country == 'US' && isUSPhoneNumber (phone)) || (country != 'US' && isInternationalPhoneNumber (phone));
	}
	return true;
}

function isValidName(field){
	var regExp = /[0-9]/;
	if (field != null && field != '')
		return (field.search(regExp) != -1);
}

function isUSPhoneNumber(s){
	var phoneNumberDelimiters = "+.,()-xX# ";
	var digitsInUSPhoneNumber = 15; // allow 10 digits + 1- prefix (i.e +1 digit) + extension # (i.e +4 digits)
	var minDigitsInUSPhoneNumber = 10;
    s1 = stripCharsInBag(s, phoneNumberDelimiters);
    return (isInteger(s1) && (s1.length <= digitsInUSPhoneNumber && s1.length >= minDigitsInUSPhoneNumber));
}

function isInternationalPhoneNumber(s){
	var phoneNumberDelimiters = "+.,()-xX# ";
	s1 = stripCharsInBag(s, phoneNumberDelimiters);
    return (isInteger(s1));
}

function isValidSPGNum(field) {
	if (field != null && field != ''){
		// one optional letter + any number of digits + zero or more whitespace chars at the beginning and at the end
		var re = /^\s*[A-Za-z0-9]\d+\s*$/;
		if (field != null && field != ''){
			return (field.search(re) != -1);
		}
	}
}

function parseDate(_s) {
	try {
		d = Date.parse(_s);
		return d;
	} catch(err) {
		var dateArray = _s.split("/");
		var tempMonth = parseInt(dateArray[0],10);
		var tempDay = parseInt(dateArray[1],10);
		var tempYear = parseInt(dateArray[2],10);
		d = new Date(tempYear,(tempMonth-1),tempDay);
		return d;
	}
}

//--------------------------------------------------------
//Get the Date from a form field - Based on Internationalization Variables
//--------------------------------------------------------
function getDateFromField(formField, dateFormat) {	
	// formField is a reference to a text field
	// dateFormat is a string describing the local date format
	//	Current options for dateFormat:
	//		mm/dd/yyyy - English
	//		dd/mm/yyyy - Non-English, Non-Japanese
	//		yyyy/mm/dd - Japanese, Chinese
    //		dd.mm.yyyy - German
	//		dd-mm-yyyy - For generic format

    var date = new Date(); // Default the date to today ready to be overwritten.
	var currDate = SW.widget.Calendar.Utils.getToday(formField.getAttribute("data-today")); // Today's date and time for comparison's sake.

	dateFormat = dateFormat.toLowerCase();
	var fieldString;
    var hasSlashOrDash = false;
    if (typeof formField == "object") { fieldString= formField.value; } // Get the current value of the field
		else { fieldString = formField; } // We were passed a direct value
  if (fieldString.search("/") > 0) { // check if we have / to delimit
		var dateValues = fieldString.split("/");
        hasSlashOrDash = true;
    } else if (fieldString.search("-") > 0) { // They used - instead of /
		var dateValues = fieldString.split("-");
        hasSlashOrDash = true;
    } else if (fieldString.indexOf(".") >= 0) { // They used . instead of /
		var dateValues = fieldString.split(".");
	}else if (fieldString != "") {  // Assume there are no delimiters, assume one number
		var dateValues = new Array(fieldString);
	} else if (fieldString == "") {  // If there's not data there, assume it was deleted, and throw back a validDate object compatible invalid date.
		date.setTime(Date.parse(dateFormatString));
    return date;
	}

	if (fieldString.toLowerCase() == dateFormatString) {
		date.setTime(Date.parse(fieldString));
    return date;
	}

	var year;
	var month;
	var day;

	switch(dateFormat) {
		case 'mm/dd/yyyy':
			if (dateValues[0]) month = dateValues[0];
			if (dateValues[1]) day = dateValues[1];
			if (dateValues[2]) year = dateValues[2];
			break;
		case 'dd/mm/aaaa':
        case 'jj/mm/aaaa':
        case 'gg/mm/aaaa':
        case 'tt.mm.jjjj':
			if (dateValues[0]) day = dateValues[0];
			if (dateValues[1]) month = dateValues[1];
			if (dateValues[2]) year = dateValues[2];
			break;
		case 'yyyy/mm/dd':
			if (dateValues[0]) year = dateValues[0];
			if (dateValues[1]) month = dateValues[1];
			if (dateValues[2]) day = dateValues[2];
			break;
		case 'yyyy/dd/mm':
			if (dateValues[0]) year = dateValues[0];
			if (dateValues[1]) day = dateValues[1];
			if (dateValues[2]) month = dateValues[2];
			break;
        case 'dd.mm.yyyy':
        case 'dd/mm/yyyy':
            if (dateValues[0]) day = dateValues[0];
			if (dateValues[1]) month = dateValues[1];
			if (dateValues[2]) year = dateValues[2];
			break;
        case "yy\u5E74mm\u6708dd\u65E5":          
            if(!hasSlashOrDash) {
                //dateValues = fieldString.split(" ");
                year = fieldString.substr(0,2);
                month = fieldString.substr(3,2);
                day = fieldString.substr(6,2);
            } else {
                if (dateValues[0]) year = dateValues[0];
			    if (dateValues[1]) month = dateValues[1];
			    if (dateValues[2]) day = dateValues[2];
            }
            break;
		default:  // Default to mm/dd/yyyy
			if (dateValues[0]) month = dateValues[0];
			if (dateValues[1]) day = dateValues[1];
			if (dateValues[2]) year = dateValues[2];
			break;
	}
	if (year) {
		if (year.length == 2) { year = "20" + year; } // Try to make the year 4 digits
		if (year.length == 4) { // If it's not 4 digits, just fall back to using the current year
			date.setFullYear(year);
		}
	}
	date.setDate(1);
  if (month) date.setMonth(month - 1); // setMonth uses a zero-based number
  if (day) date.setDate(day);
  if (date.getTime() < currDate.getTime()) date.setYear(currDate.getFullYear() + 1); // For dates in the past, set to next year.
  // safari will not return true for isNaN check even when the date is initialized with day = dd, month = mm, and year = yyyy
  if(isNaN(month)&&isNaN(day)&&isNaN(year)) {
    if(!isNaN(date.getDate())) {
      date = {
        getDate: function() {
          return NaN;
        }
      }
    }
  }
  writeDateToField(formField, date, dateFormat);
	return date;
}

//--------------------------------------------------------
//Write the date to a form field - Based on Internationalization Variables
//--------------------------------------------------------

function writeDateToField(formField, date, dateFormat) {
// prevent "undefined" string from showing
  var dateString = "";
	if (isNaN(date.getDate())) {
		formField.value = dateString;
		return;
	}

	dateFormat = dateFormat.toLowerCase();
	var month = date.getMonth() + 1;
	month = paddZero(month);
	var day = date.getDate();
	day = paddZero(day);
	var year = date.getFullYear();
	var sep = "/";
	var dot = ".";
	var dash = "-";
	switch(dateFormat) {
		case 'mm/dd/yyyy':
			dateString = month + sep + day + sep + year;
			break;
		case 'dd/mm/aaaa':
        case 'jj/mm/aaaa':
        case 'gg/mm/aaaa':
            dateString = day + sep + month + sep + year;
			break;
        case 'tt.mm.jjjj':
            dateString = day + dot + month + dot + year;
            break;
        case 'yyyy/mm/dd':
			dateString = year + sep + month + sep + day;
			break;
		case 'yyyy/dd/mm':
			dateString = year + sep + day + sep + month;
			break;
		case 'yyyy-mm-dd':
			dateString = year + dash + day + dash + month;
			break;
        case "yy\u5E74mm\u6708dd\u65E5":
            dateString = String(year).substr(2,2) + "\u5E74" + month  + "\u6708" + day  + "\u65E5";
            break;
        default:  // Default to mm/dd/yyyy
			dateString = month + sep + day + sep + year;
			break;
	}

	formField.value = dateString;
}


var defaultDateFrmt = "yyyy-mm-dd";

function getDefaultDateFormat(formField,defaultDateFormat) {
	var date = getDateFromField(formField,dateFormatString);
	// prevent "undefined" string from showing
	  	var dateString = "";
	  	defaultDateFormat = defaultDateFormat.toLowerCase();
		var month = date.getMonth() + 1;
		month = paddZero(month);
		var day = date.getDate();
		day = paddZero(day);
		var year = date.getFullYear();
		var sep = "/";
		var dot = ".";
		var dash = "-";
		switch(defaultDateFormat) {
			case 'mm/dd/yyyy':
				dateString = month + sep + day + sep + year;
				break;
			case 'dd/mm/aaaa':
	        case 'jj/mm/aaaa':
	        case 'gg/mm/aaaa':
	            dateString = day + sep + month + sep + year;
				break;
	        case 'tt.mm.jjjj':
	            dateString = day + dot + month + dot + year;
	            break;
	        case 'yyyy/mm/dd':
				dateString = year + sep + month + sep + day;
				break;
			case 'yyyy/dd/mm':
				dateString = year + sep + day + sep + month;
				break;
			case 'yyyy-mm-dd':
				dateString = year + dash + month + dash + day;
				break;
	        case "yy\u5E74mm\u6708dd\u65E5":
	            dateString = String(year).substr(2,2) + "\u5E74" + month  + "\u6708" + day  + "\u65E5";
	            break;
	        default:  // Default to mm/dd/yyyy
				dateString = month + sep + day + sep + year;
				break;
		}

		return dateString;
	}

//-----------------------------------------------
// padd a zero if string is one char
function paddZero(s)
{
	if(s >= 0 && s <= 9){
	  s = '0' + s;
	}
	return s;
}
//------------------------------------------------------
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */


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;},
/*
  modified version that allows using document.write if no value is passed in. This has
  been created to avoid "operation aborted" errors in IE.
*/
  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"))) {
      if(typeof _20 == "undefined"){
        document.write(this.getSWFHTML());
      }else{
        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;
// System globals
var flash2Installed = false;    // boolean. true if flash 2 is installed
var flash3Installed = false;    // boolean. true if flash 3 is installed
var flash4Installed = false;    // boolean. true if flash 4 is installed
var flash5Installed = false;    // boolean. true if flash 5 is installed
var flash6Installed = false;    // boolean. true if flash 6 is installed
var flash7Installed = false;    // boolean. true if flash 7 is installed
var flash8Installed = false;    // boolean. true if flash 8 is installed
var flash9Installed = false;    // boolean. true if flash 9 is installed
var flash10Installed = false;    // boolean. true if flash 10 is installed
var flash11Installed = false;    // boolean. true if flash 11 is installed
var flash12Installed = false;    // boolean. true if flash 12 is installed

// Vars for Backwards compatibiliy
var flagVar = "";
var flashTrue = "";
var maxVersion = 12;             // highest version we can actually detect
var actualVersion = 0;          // version the user really has
var jsVersion = 1.1;

// Check the browser...we're looking for ie/win
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows

// Write vbscript detection on ie win. IE on Windows doesn't support regular
// JavaScript plugins array detection.
if (isIE && isWin) {
  document.write('<scr' + 'ipt type="text/vbscript"\> \n');
  document.write('on error resume next \n');
  document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
  document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
  document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
  document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
  document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
  document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
  document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
  document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
  document.write('flash10Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10"))) \n');
  document.write('flash11Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.11"))) \n');
  document.write('flash12Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.12"))) \n');
  document.write('</scr' + 'ipt\> \n'); // break up end tag so it doesn't end our script
}

// Next comes the standard javascript detection that uses the
// navigator.plugins array. We pack the detector into a function so it loads
// before we run it.

function flashSniff() {
  // If navigator.plugins exists...
  if (navigator.plugins) {
    // ...then check for flash 2 or flash 3+.
    if (navigator.plugins["Shockwave Flash 2.0"]
        || navigator.plugins["Shockwave Flash"]) {

      // Some version of Flash was found. Time to figure out which.

      // Set convenient references to flash 2 and the plugin description.
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;

      // DEBUGGING: uncomment next line to see the actual description.
      // alert("Flash plugin description: " + flashDescription);

      // A flash plugin-description looks like this: Shockwave Flash 4.0 r5
      // We can get the major version by grabbing the character before the period
      // note that we don't bother with minor version detection.
      // Do that in your movie with $version or getVersion().
      var flashVersion = parseInt(/[0-9]{1,}./.exec(flashDescription));

      // We found the version, now set appropriate version flags. Make sure
      // to use >= on the highest version so we don't prevent future version
      // users from entering the site.
      flash2Installed = flashVersion == 2;
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion == 6;
      flash7Installed = flashVersion == 7;
      flash8Installed = flashVersion == 8;
      flash9Installed = flashVersion == 9;
      flash10Installed = flashVersion == 10;
      flash11Installed = flashVersion == 11;
      flash12Installed = flashVersion >= 12;
    }
  }

  // Loop through all versions we're checking, and
  // set actualVersion to highest detected version.
  for (var i = 2; i <= maxVersion; i++) {
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
  }
  // Vars for backwards support
  if (i > 0) { flagVar = true; flashTrue = true; }
  // We're finished getting the version on all browsers that support detection.
  return actualVersion;
}
function setNonFlashUser(url) {
    document.cookie = 'isNonFlashUser=true; path=/';
    location.replace(url + "?type=nonflash");
}
function addLoadEvent(func) {
	var ssArray = "";
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}


function addResizeEvent(func) {
	var oldresize = window.onresize;
	if (typeof window.onresize != 'function') {
		window.onresize= func;
	} else {
		window.onresize = function() {
			oldresize();
			func();
		}
	}
}

//Function that takes element ID and pixel offset and changes height of elment.

function e(id) {
      return document.getElementById(id);
}

function autoResizeElement(id,bottomOffset) {
      var topOffset = 0;
      for (var elem = document.getElementById(id);
       elem != null;
       elem = elem.offsetParent) {
            topOffset += elem.offsetTop;
      }
      var windowHeight = getViewportHeight();
      var height = windowHeight - topOffset - bottomOffset;
      if (height >= 0) {
            document.getElementById(id).style.height = height + "px";
      }
}

function getViewportHeight() {
      if (window.self && self.innerHeight) {
            return self.innerHeight;
      }
      if (document.documentElement && document.documentElement.clientHeight) {
            return document.documentElement.clientHeight;
      }
      return 0;
}

function getViewportWidth() {
      if (window.self && self.innerWidth) {
            return self.innerWidth;
      }
      if ( (document.documentElement && document.documentElement.clientWidth) || (document.body && document.body.clientWidth) ) {
          if(document.documentElement.clientWidth > 0)   {
            return document.documentElement.clientWidth;
          }
          else if (document.body.clientWidth > 0) {
            return document.body.clientWidth
          }
      }
      return 0;
}


function getDocumentHeight()    {
    if (document.body && document.body.offsetHeight) {
        return document.body.offsetHeight;
      }
    if (document.body.document && document.body.document.height) {
        return document.body.document.height;
    }
    return 0;
}

function getDocumentWidth()    {
    if (document.body && document.body.offsetWidth) {
            return document.body.offsetWidth;
      }
    if (document.body.document && document.body.document.width) {
        return document.body.document.width;
    }
    return 0;
}

// Function that takes a String URL and sets the parent's location to the URL
function goToPage(obj) {
	if (obj.value != null && obj.value != "void" && obj.value != "") {
		parent.location =obj.value;
	}
}

// Generic pop up window function the window features are passed from the parent page
function openBrWindow(theURL,winName,features) {
	var winObj = window.open(theURL,winName,features);
	if (!winObj.opener) winObj.opener = self;
	winObj.focus();
}

// Function that takes in a name, reads that name from a cookie, and returns the value of that name.
function readCookie(name) {
	var cookies = document.cookie;
	var start = cookies.indexOf(name + "=");
	if (start == -1) return null;
	start = cookies.indexOf("=", start) + 1;
	var end = cookies.indexOf(";", start);
	if (end == -1) end = cookies.length;
	var value = unescape(cookies.substring(start, end));
	return value;
}

// Function that takes a name/value pair and sets them to a cookie
/*
   name - name of the cookie
   value - value of the cookie
   [expires] - expiration date of the cookie in days (defaults to end of current session)
   [path] - path for which the cookie is valid (defaults to path of calling document)
   [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
   [domain] - domain for which the cookie is valid (defaults to domain of calling document)
   * an argument defaults when it is assigned null as a placeholder
   * a null placeholder is not required for trailing omitted arguments
*/
function setCookie(name, value, expires, path, secure, domain) {
	var today = new Date();
	today.setTime(today.getTime());
	
	if (expires) { expires = expires * 1000 * 60 * 60 * 24; }
	var expires_date = new Date( today.getTime() + (expires) );

	var curCookie = name + "=" + escape(value) +
	(( expires ) ? "; expires=" + expires_date.toGMTString() : "") + 
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
	document.cookie = curCookie;
}

// Function that deletes a cookie
/*
   name - name of the cookie
   [path] - path of the cookie (must be same as path used to create cookie)
   [domain] - domain of the cookie (must be same as domain used to create cookie)
   * path and domain default if assigned null or omitted if no explicit argument proceeds
*/
function deleteCookie(name, path, domain) {
	if (readCookie(name)) {
		document.cookie = name + "=" +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

// Function to switch current display of id between "block" and "none"
function switchDisplay(elementID, swapType) {
	var element = document.getElementById(elementID);
	if (swapType == 'show'){
		element.style.display = 'block';
	} else {
		element.style.display = 'none';
	}
}

// Function to toggle an elements display
// elementID is the name of the element you want to toggle.
// currentDisplay is a boolean that's passed in and represents the elements current display type.
function toggleDisplay(elementID, currentDisplay) {
	var element = document.getElementById(elementID);
	if (currentDisplay){
		element.style.display = "none";
		currentDisplay = false;
	} else {
		element.style.display = "block";
		currentDisplay = true;
	}
	return currentDisplay;
}

var currentClass;
function classSwitcher(el,stateClass) {
	var element = (typeof el == "object") ? el : document.getElementById(el);
	if(currentClass==undefined || currentClass==stateClass) currentClass = element.className;

	if(element.className == currentClass || element.className == "") {
		element.className = stateClass;
	} else {
		element.className = currentClass;
	}
}
// Function to determine if a field is null
function isNull(fieldValue) {
	if (fieldValue == null) {fieldValue=''};
		return (fieldValue.length == 0);	
}

// Function to determine if two fields match each other
function isMatch(field1,field2) {
	if ((field1 != null && field1 != '') && ( field2 != null && field2 != ''))
		return (field1 == field2);
}

// Function to parse the querystring into useable variables
var parsequery_args = new Object();
function parsequery(qs) {
	if (qs.length > 2) {
		var query = qs.substring(1); // get query string (without initial "?")
		var pairs = query.split("&")  //break at ampersand into pairs
		var re = /\+/g; //the unescape() function does not remove +
		for (var i = 0; i < pairs.length; i++) {
			var pos = pairs[i].indexOf('=');  //look for "name=value"
			if (pos == -1) continue;      //if not found skip
			var argname = pairs[i].substring(0,pos);  //extract the name
			var value = pairs[i].substring(pos + 1);  //extract the value
			parsequery_args[argname] = unescape(value.replace(re," "));  //store as a property
		}
	}
}

// Function that takes a string (s) and 1 character (bag) to strip from the string.
// the function returns the string without the 1 character (bag) in it.
function stripCharsInBag (s, bag){
	var i;
	var returnString = "";
	for (i = 0; i < s.length; i++) {
		var c = s.charAt(i);
		if (bag.indexOf(c) == -1) returnString += c;
	}
	return returnString;
}

// Function that gives you the screen x and screen y, even after the user has scrolled
var scrOfX = 0, scrOfY = 0;
function getScrollXY() {
	if( typeof( window.pageYOffset ) == 'number' ) {
	//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
	//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
	//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
	return [ scrOfX, scrOfY ];
}

// Fixes the IE background-image hover bug
try {
    document.execCommand( "BackgroundImageCache", false, true );
} catch( e ) { };


/**
 * Selects all checkboxes under the given parent node.  Set deep to true
 * to recursively set.
 *
 * @param {Node} parentNode     node under which checkboxes can be found
 * @param {boolean} checked     true to set checkboxes, false to clear (Default: true)
 * @param {boolean} deep        true to recursively set children deeper than one level (Default: true)
 */
function setCheckboxes(parentNode, checked, deep) {
    if(parentNode == null)  return;

    // defaults
    checked = (checked == null) ? true : checked;
    deep = (deep == null) ? true : deep;

    // loop through and select boxes
    for(var i=0; i < parentNode.childNodes.length; i++) {
        var node = parentNode.childNodes[i];

        if(deep) {
            // recursively set deeper child nodes
            if(node.hasChildNodes()) {
                setCheckboxes(node, checked, deep);
            }
        }

        // set checkbox
        if(node.nodeType == 1 && node.getAttribute("type") == "checkbox") {
            node.checked = checked;
        }
    }
}

/**
 * Asynchronously fills a select dropdown with properties given a list of
 * property IDs via an XHR call.
 *
 * @param {String} propSelect       select element containing property list
 * @param {String} propIds          comma delimited list of property ids to populate with
 * @param {String} selectedPropId   optional id of pre-selected property when the list is built
 * @param {function} onFailure      optional reference to a failure callback function
 * @param {function} onSuccess      optional reference to a success callback function
 */
function fillPropertySelect(propSelect, propIds, selectedPropId, onFailure, onSuccess) {
    // clear current select options
    while(propSelect.hasChildNodes()) {
        propSelect.removeChild(propSelect.childNodes[0]);
    }

    // remove spaces between properties in property list
    propIds = propIds.replace(/,\s+/g, ',');
    var url = "/whotels/property/propertyInfoAjax.html?propertyIDs=" + propIds;
    var callback = {
        success: _fillPropertySelectSuccess,
        failure: onFailure,
        argument: {'propSelect':propSelect, 'selectedPropId':selectedPropId, 'onSuccess':onSuccess}
    }

    // make the call
    var request = YAHOO.util.Connect.asyncRequest('GET', url, callback);
}

// success handler for fillPropertySelect XHR call
function _fillPropertySelectSuccess(o) {
    var i,j;

    // get prop select element
    var propSelect = o.argument['propSelect'];
    if(propSelect == null) return;

    // get selected property id
    var selectedPropId = o.argument['selectedPropId'];

    // process response
    var yuiJson = YAHOO.lang.JSON;
    var result = yuiJson.parse(o.responseText);
    var propMap = result.data;

    var propIds = propMap['propIds'];
    var propNames = propMap['propNames'];

    // sort alphabetically by property names
    var sortedPropNames = new Array();
    for(i=0; i<propNames.length; i++) {
        sortedPropNames.push(propNames[i]);
    }
    sortedPropNames.sort();

    // sort ids according to sorted property names
    var sortedPropIds = new Array();
    for(i=0; i<propIds.length; i++) {
        for(j=0; j<propNames.length;j++) {
            if(propNames[j] == sortedPropNames[i]) {
                sortedPropIds.push(propIds[j]);
                break;
            }
        }
    }
    // create options for each property
    var option;

    // create a list of prop id => prop name mappings sorted by name
    for(i=0; i<sortedPropIds.length; i++) {
        option = document.createElement('option');
        option.setAttribute("value", sortedPropIds[i]);

        if(selectedPropId == sortedPropIds[i]) {
            option.setAttribute("selected", "selected");
        }
        
        option.appendChild(document.createTextNode(sortedPropNames[i]));
        propSelect.appendChild(option);
    }

    // call callback method
    if(o.argument['onSuccess']) {
        o.argument['onSuccess']();
    }
}

// function to determine the offsetLeft of an element that is passed in
function getElementOffsetLeft (element) {
    var leftOffset = element.offsetLeft;
    while ((element = element.offsetParent) != null){
        leftOffset  += element.offsetLeft;
    }
    var viewPort = document.documentElement.clientWidth;
    return leftOffset;
}
// function to determine the offsetTop of an element that is passed in
function getElementOffsetTop (element) {
    var topOffset = element.offsetTop;
    while ((element = element.offsetParent) != null){
        topOffset +=element.offsetTop;
    }
    var docHeight = document.documentElement.scrollTop;
    var viewPort = document.documentElement.clientHeight;
    return topOffset;
}

//function to keep check box checked even if clicked
function keepChecked(formElement)  {
    
    if(!formElement.checked)    {
        formElement.checked = true;    
    }
}

//Top destination layer close
function topDestinationsClose()	{
    document.getElementById("topDestinationsList").style.visibility = "hidden";
    document.getElementById("topDestinationsIframeShim").style.display = "none";
}

//Top destination layer open
function topDestinationsOpen()	{                    
    var obj1 = document.getElementById("topDestinationsList");
    var obj2 = document.getElementById("topDestinationsIframeShim");
    obj1.style.visibility = "visible";
    obj2.style.visibility = "visible";
    obj1.style.display = "block";
    obj2.style.display = "block";
}


/*
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/
/**
 * Provides methods to parse JSON strings and convert objects to JSON strings.
 *
 * @module json
 * @class JSON
 * @namespace YAHOO.lang
 * @static
 */
(function () {

var l = YAHOO.lang,
    isFunction = l.isFunction,
    isObject   = l.isObject,
    isArray    = l.isArray,
    _toStr     = Object.prototype.toString,
                 // 'this' is the global object.  window in browser env.  Keep
                 // the code env agnostic.  Caja requies window, unfortunately.
    Native     = (YAHOO.env.ua.caja ? window : this).JSON,

/* Variables used by parse */

    /**
     * Replace certain Unicode characters that JavaScript may handle incorrectly
     * during eval--either by deleting them or treating them as line
     * endings--with escape sequences.
     * IMPORTANT NOTE: This regex will be used to modify the input if a match is
     * found.
     *
     * @property _UNICODE_EXCEPTIONS
     * @type {RegExp}
     * @private
     */
    _UNICODE_EXCEPTIONS = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,

    /**
     * First step in the safety evaluation.  Regex used to replace all escape
     * sequences (i.e. "\\", etc) with '@' characters (a non-JSON character).
     *
     * @property _ESCAPES
     * @type {RegExp}
     * @static
     * @private
     */
    _ESCAPES = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,

    /**
     * Second step in the safety evaluation.  Regex used to replace all simple
     * values with ']' characters.
     *
     * @property _VALUES
     * @type {RegExp}
     * @static
     * @private
     */
    _VALUES  = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,

    /**
     * Third step in the safety evaluation.  Regex used to remove all open
     * square brackets following a colon, comma, or at the beginning of the
     * string.
     *
     * @property _BRACKETS
     * @type {RegExp}
     * @static
     * @private
     */
    _BRACKETS = /(?:^|:|,)(?:\s*\[)+/g,

    /**
     * Final step in the safety evaluation.  Regex used to test the string left
     * after all previous replacements for invalid characters.
     *
     * @property _UNSAFE
     * @type {RegExp}
     * @static
     * @private
     */
    _UNSAFE  = /[^\],:{}\s]/,


/* Variables used by stringify */

    /**
     * Regex used to replace special characters in strings for JSON
     * stringification.
     *
     * @property _SPECIAL_CHARS
     * @type {RegExp}
     * @static
     * @private
     */
    _SPECIAL_CHARS = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,

    /**
     * Character substitution map for common escapes and special characters.
     *
     * @property _CHARS
     * @type {Object}
     * @static
     * @private
     */
    _CHARS = {
        '\b': '\\b',
        '\t': '\\t',
        '\n': '\\n',
        '\f': '\\f',
        '\r': '\\r',
        '"' : '\\"',
        '\\': '\\\\'
    },
    
    UNDEFINED = 'undefined',
    OBJECT    = 'object',
    NULL      = 'null',
    STRING    = 'string',
    NUMBER    = 'number',
    BOOLEAN   = 'boolean',
    DATE      = 'date',
    _allowable = {
        'undefined'        : UNDEFINED,
        'string'           : STRING,
        '[object String]'  : STRING,
        'number'           : NUMBER,
        '[object Number]'  : NUMBER,
        'boolean'          : BOOLEAN,
        '[object Boolean]' : BOOLEAN,
        '[object Date]'    : DATE,
        '[object RegExp]'  : OBJECT
    },
    EMPTY     = '',
    OPEN_O    = '{',
    CLOSE_O   = '}',
    OPEN_A    = '[',
    CLOSE_A   = ']',
    COMMA     = ',',
    COMMA_CR  = ",\n",
    CR        = "\n",
    COLON     = ':',
    COLON_SP  = ': ',
    QUOTE     = '"';

// Only accept JSON objects that report a [[Class]] of JSON
Native = _toStr.call(Native) === '[object JSON]' && Native;

// Escapes a special character to a safe Unicode representation
function _char(c) {
    if (!_CHARS[c]) {
        _CHARS[c] =  '\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4);
    }
    return _CHARS[c];
}


/* functions used by parse */

/**
 * Traverses nested objects, applying a filter or reviver function to
 * each value.  The value returned from the function will replace the
 * original value in the key:value pair.  If the value returned is
 * undefined, the key will be omitted from the returned object.
 *
 * @method _revive
 * @param data {MIXED} Any JavaScript data
 * @param reviver {Function} filter or mutation function
 * @return {MIXED} The results of the filtered/mutated data structure
 * @private
 */
function _revive(data, reviver) {
    var walk = function (o,key) {
        var k,v,value = o[key];
        if (value && typeof value === 'object') {
            for (k in value) {
                if (l.hasOwnProperty(value,k)) {
                    v = walk(value, k);
                    if (v === undefined) {
                        delete value[k];
                    } else {
                        value[k] = v;
                    }
                }
            }
        }
        return reviver.call(o,key,value);
    };

    return typeof reviver === 'function' ? walk({'':data},'') : data;
}

/**
 * Replace certain Unicode characters that may be handled incorrectly by
 * some browser implementations.
 *
 * @method _prepare
 * @param s {String} parse input
 * @return {String} sanitized JSON string ready to be validated/parsed
 * @private
 */
function _prepare(s) {
    return s.replace(_UNICODE_EXCEPTIONS, _char);
}

function _isSafe(str) {
    return l.isString(str) &&
            !_UNSAFE.test(str.replace(_ESCAPES,'@').
                             replace(_VALUES,']').
                             replace(_BRACKETS,''));
}

function _parse(s,reviver) {
    // sanitize
    s = _prepare(s);

    // Ensure valid JSON
    if (_isSafe(s)) {
        // Eval the text into a JavaScript data structure, apply the
        // reviver function if provided, and return
        return _revive( eval('(' + s + ')'), reviver );
    }

    // The text is not valid JSON
    throw new SyntaxError('JSON.parse');
}



/* functions used by stringify */

// Utility function used to determine how to serialize a variable.
function _type(o) {
    var t = typeof o;
    return  _allowable[t] ||              // number, string, boolean, undefined
            _allowable[_toStr.call(o)] || // Number, String, Boolean, Date
            (t === OBJECT ?
                (o ? OBJECT : NULL) :     // object, array, null, misc natives
                UNDEFINED);               // function, unknown
}

// Enclose escaped strings in quotes
function _string(s) {
    return QUOTE + s.replace(_SPECIAL_CHARS, _char) + QUOTE;
}

// Adds the provided space to the beginning of every line in the input string
function _indent(s,space) {
    return s.replace(/^/gm, space);
}

// JavaScript implementation of stringify (see API declaration of stringify)
function _stringify(o,w,space) {
    if (o === undefined) {
        return undefined;
    }

    var replacer = isFunction(w) ? w : null,
        format   = _toStr.call(space).match(/String|Number/) || [],
        _date    = YAHOO.lang.JSON.dateToString,
        stack    = [],
        tmp,i,len;

    if (replacer || !isArray(w)) {
        w = undefined;
    }

    // Ensure whitelist keys are unique (bug 2110391)
    if (w) {
        tmp = {};
        for (i = 0, len = w.length; i < len; ++i) {
            tmp[w[i]] = true;
        }
        w = tmp;
    }

    // Per the spec, strings are truncated to 10 characters and numbers
    // are converted to that number of spaces (max 10)
    space = format[0] === 'Number' ?
                new Array(Math.min(Math.max(0,space),10)+1).join(" ") :
                (space || EMPTY).slice(0,10);

    function _serialize(h,key) {
        var value = h[key],
            t     = _type(value),
            a     = [],
            colon = space ? COLON_SP : COLON,
            arr, i, keys, k, v;

        // Per the ECMA 5 spec, toJSON is applied before the replacer is
        // called.  Also per the spec, Date.prototype.toJSON has been added, so
        // Date instances should be serialized prior to exposure to the
        // replacer.  I disagree with this decision, but the spec is the spec.
        if (isObject(value) && isFunction(value.toJSON)) {
            value = value.toJSON(key);
        } else if (t === DATE) {
            value = _date(value);
        }

        if (isFunction(replacer)) {
            value = replacer.call(h,key,value);
        }

        if (value !== h[key]) {
            t = _type(value);
        }

        switch (t) {
            case DATE    : // intentional fallthrough.  Pre-replacer Dates are
                           // serialized in the toJSON stage.  Dates here would
                           // have been produced by the replacer.
            case OBJECT  : break;
            case STRING  : return _string(value);
            case NUMBER  : return isFinite(value) ? value+EMPTY : NULL;
            case BOOLEAN : return value+EMPTY;
            case NULL    : return NULL;
            default      : return undefined;
        }

        // Check for cyclical references in nested objects
        for (i = stack.length - 1; i >= 0; --i) {
            if (stack[i] === value) {
                throw new Error("JSON.stringify. Cyclical reference");
            }
        }

        arr = isArray(value);

        // Add the object to the processing stack
        stack.push(value);

        if (arr) { // Array
            for (i = value.length - 1; i >= 0; --i) {
                a[i] = _serialize(value, i) || NULL;
            }
        } else {   // Object
            // If whitelist provided, take only those keys
            keys = w || value;
            i = 0;

            for (k in keys) {
                if (l.hasOwnProperty(keys, k)) {
                    v = _serialize(value, k);
                    if (v) {
                        a[i++] = _string(k) + colon + v;
                    }
                }
            }
        }

        // remove the array from the stack
        stack.pop();

        if (space && a.length) {
            return arr ?
                OPEN_A + CR + _indent(a.join(COMMA_CR), space) + CR + CLOSE_A :
                OPEN_O + CR + _indent(a.join(COMMA_CR), space) + CR + CLOSE_O;
        } else {
            return arr ?
                OPEN_A + a.join(COMMA) + CLOSE_A :
                OPEN_O + a.join(COMMA) + CLOSE_O;
        }
    }

    // process the input
    return _serialize({'':o},'');
}


/* Public API */
YAHOO.lang.JSON = {
    /**
     * Leverage native JSON parse if the browser has a native implementation.
     * In general, this is a good idea.  See the Known Issues section in the
     * JSON user guide for caveats.  The default value is true for browsers with
     * native JSON support.
     *
     * @property useNativeParse
     * @type Boolean
     * @default true
     * @static
     */
    useNativeParse : !!Native,

    /**
     * Leverage native JSON stringify if the browser has a native
     * implementation.  In general, this is a good idea.  See the Known Issues
     * section in the JSON user guide for caveats.  The default value is true
     * for browsers with native JSON support.
     *
     * @property useNativeStringify
     * @type Boolean
     * @default true
     * @static
     */
    useNativeStringify : !!Native,

    /**
     * Four step determination whether a string is safe to eval. In three steps,
     * escape sequences, safe values, and properly placed open square brackets
     * are replaced with placeholders or removed.  Then in the final step, the
     * result of all these replacements is checked for invalid characters.
     *
     * @method isSafe
     * @param str {String} JSON string to be tested
     * @return {boolean} is the string safe for eval?
     * @static
     */
    isSafe : function (s) {
        return _isSafe(_prepare(s));
    },

    /**
     * <p>Parse a JSON string, returning the native JavaScript
     * representation.</p>
     *
     * <p>When lang.JSON.useNativeParse is true, this will defer to the native
     * JSON.parse if the browser has a native implementation.  Otherwise, a
     * JavaScript implementation based on http://www.json.org/json2.js
     * is used.</p>
     *
     * @method parse
     * @param s {string} JSON string data
     * @param reviver {function} (optional) function(k,v) passed each key:value
     *          pair of object literals, allowing pruning or altering values
     * @return {MIXED} the native JavaScript representation of the JSON string
     * @throws SyntaxError
     * @static
     */
    parse : function (s,reviver) {
        if (typeof s !== 'string') {
            s += '';
        }

        return Native && YAHOO.lang.JSON.useNativeParse ?
            Native.parse(s,reviver) : _parse(s,reviver);
    },

    /**
     * <p>Converts an arbitrary value to a JSON string representation.</p>
     *
     * <p>Objects with cyclical references will trigger an exception.</p>
     *
     * <p>If a whitelist is provided, only matching object keys will be
     * included.  Alternately, a replacer function may be passed as the
     * second parameter.  This function is executed on every value in the
     * input, and its return value will be used in place of the original value.
     * This is useful to serialize specialized objects or class instances.</p>
     *
     * <p>If a positive integer or non-empty string is passed as the third
     * parameter, the output will be formatted with carriage returns and
     * indentation for readability.  If a String is passed (such as "\t") it
     * will be used once for each indentation level.  If a number is passed,
     * that number of spaces will be used.</p>
     *
     * <p>When lang.JSON.useNativeStringify is true, this will defer to the
     * native JSON.stringify if the browser has a native implementation.
     * Otherwise, a JavaScript implementation is used.</p>
     *
     * @method stringify
     * @param o {MIXED} any arbitrary object to convert to JSON string
     * @param w {Array|Function} (optional) whitelist of acceptable object keys
     *                  to include OR a function(value,key) to alter values
     *                  before serialization
     * @param space {Number|String} (optional) indentation character(s) or
     *                  depthy of spaces to format the output 
     * @return {string} JSON string representation of the input
     * @throws Error
     * @static
     */
    stringify : function (o,w,space) {
        return Native && YAHOO.lang.JSON.useNativeStringify ?
            Native.stringify(o,w,space) : _stringify(o,w,space);
    },

    /**
     * Serializes a Date instance as a UTC date string.  Used internally by
     * the JavaScript implementation of stringify.  If you need a different
     * Date serialization format, override this method.  If you change this,
     * you should also set useNativeStringify to false, since native JSON
     * implementations serialize Dates per the ECMAScript 5 spec.  You've been
     * warned.
     *
     * @method dateToString
     * @param d {Date} The Date to serialize
     * @return {String} stringified Date in UTC format YYYY-MM-DDTHH:mm:SSZ
     * @static
     */
    dateToString : function (d) {
        function _zeroPad(v) {
            return v < 10 ? '0' + v : v;
        }

        return d.getUTCFullYear()         + '-' +
            _zeroPad(d.getUTCMonth() + 1) + '-' +
            _zeroPad(d.getUTCDate())      + 'T' +
            _zeroPad(d.getUTCHours())     + COLON +
            _zeroPad(d.getUTCMinutes())   + COLON +
            _zeroPad(d.getUTCSeconds())   + 'Z';
    },

    /**
     * Reconstitute Date instances from the default JSON UTC serialization.
     * Reference this from a reviver function to rebuild Dates during the
     * parse operation.
     *
     * @method stringToDate
     * @param str {String} String serialization of a Date
     * @return {Date}
     */
    stringToDate : function (str) {
        var m = str.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3}))?Z$/);
        if (m) {
            var d = new Date();
            d.setUTCFullYear(m[1], m[2]-1, m[3]);
            d.setUTCHours(m[4], m[5], m[6], (m[7] || 0));
            return d;
        }
        return str;
    }
};

/**
 * <p>Four step determination whether a string is safe to eval. In three steps,
 * escape sequences, safe values, and properly placed open square brackets
 * are replaced with placeholders or removed.  Then in the final step, the
 * result of all these replacements is checked for invalid characters.</p>
 *
 * <p>This is an alias for isSafe.</p>
 *
 * @method isValid
 * @param str {String} JSON string to be tested
 * @return {boolean} is the string safe for eval?
 * @static
 * @deprecated use isSafe
 */
YAHOO.lang.JSON.isValid = YAHOO.lang.JSON.isSafe;

})();
YAHOO.register("json", YAHOO.lang.JSON, {version: "2.9.0", build: "2800"});

function ScrollMenu(listObject){
    this.ListObj = listObject;
    this.ListObj.className = "fixOverflow";

    this.scrollIncrement = 10;
    this.scrollActive = false;

    this.menuParent = null;
    this.menu = null;
    this.menuTop = null;

    this.createDOM();
    //this.reportHTML();
}

ScrollMenu.prototype.createDOM = function(){
    var menuContentContainer = document.createElement("div");
        menuContentContainer.className = "menuContentContainer";
        var menuContent = document.createElement("div");
            menuContent.className = "menuContent";
            with(this.ListObj){
                while(firstChild){
                    var currentNode = removeChild(firstChild);
                    menuContent.appendChild(currentNode);
                }
            }
        this.menu = menuContent;
        menuContentContainer.appendChild(menuContent);
    this.menuParent = menuContentContainer;
    this.menuTop = menuContentContainer.offsetTop || 0;
    this.ListObj.appendChild(menuContentContainer);

    var currentMenu = this;
    var upArrow = document.createElement("div");
        upArrow.className = "scrollButtonUp";
        upArrow.onmouseover = function(){ currentMenu.activateScroll(1); };
        upArrow.onmouseout = function(){ currentMenu.deactivateScroll(); };
    this.ListObj.insertBefore(upArrow, menuContentContainer);

    var downArrow = document.createElement("div");
        downArrow.className = "scrollButtonDown";
        downArrow.onmouseover = function(){ currentMenu.activateScroll(0); };
        downArrow.onmouseout = function(){ currentMenu.deactivateScroll(); };
    this.ListObj.appendChild(downArrow);
    //this.ListObj.onmouseout = function(){ currentMenu.resetMenuPosition()};
}

ScrollMenu.prototype.activateScroll = function(scrollDirection){
    this.scrollActive = true;
    if(scrollDirection){
        this.scrollMenuUp();
    }
    else{
        this.scrollMenuDown();
    }
}

ScrollMenu.prototype.deactivateScroll = function(){
    this.scrollActive = false;
}

ScrollMenu.prototype.scrollMenuUp = function(){
    if(this.scrollActive){
        if(this.menuTop < 0){
            this.menuTop += this.scrollIncrement;
            this.menu.style.top = this.menuTop + 'px';
            var currentMenu = this;
            setTimeout(function(){currentMenu.scrollMenuUp();}, 30);
        }
        else{
            this.deactivateScroll();
        }
    }
    else{
        this.deactivateScroll();
    }
}

ScrollMenu.prototype.scrollMenuDown = function(){
    if(this.scrollActive){
        if(this.menuTop > -(this.menu.scrollHeight - this.menuParent.offsetHeight)){
            this.menuTop -= this.scrollIncrement;
            this.menu.style.top = this.menuTop + 'px';
            var currentMenu = this;
            setTimeout(function(){currentMenu.scrollMenuDown();}, 30);
        }
        else{
            this.deactivateScroll();
        }
    }
    else{
        this.deactivateScroll();
    }
}

ScrollMenu.prototype.resetMenuPosition = function(){
    this.menuTop = this.menuParent.offsetTop;
    this.menu.style.top = this.menuTop + 'px';
}

ScrollMenu.prototype.reportHTML = function(){
    alert(this.ListObj.innerHTML);
}
<!-- BEGIN IMAGE SWAPPING -->
function MM_findObj(n, d) { //v3.0
var p,i,x;  if(!d) d=document; 
/*if((p=n.indexOf("?"))>0&&parent.frames.length) {
 d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
}*/
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
/* Functions that swaps images. */
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/* Functions that handle preload. */
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
<!-- END IMAGE SWAPPING -->
// System globals
var flash2Installed = false;    // boolean. true if flash 2 is installed
var flash3Installed = false;    // boolean. true if flash 3 is installed
var flash4Installed = false;    // boolean. true if flash 4 is installed
var flash5Installed = false;    // boolean. true if flash 5 is installed
var flash6Installed = false;    // boolean. true if flash 6 is installed
var flash7Installed = false;    // boolean. true if flash 7 is installed
var flash8Installed = false;    // boolean. true if flash 8 is installed
var flash9Installed = false;    // boolean. true if flash 9 is installed
var flash10Installed = false;    // boolean. true if flash 10 is installed
var flash11Installed = false;    // boolean. true if flash 11 is installed
var flash12Installed = false;    // boolean. true if flash 12 is installed

// Vars for Backwards compatibiliy
var flagVar = "";
var flashTrue = "";
var maxVersion = 12;             // highest version we can actually detect
var actualVersion = 0;          // version the user really has
var jsVersion = 1.1;

// Check the browser...we're looking for ie/win
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows

// Write vbscript detection on ie win. IE on Windows doesn't support regular
// JavaScript plugins array detection.
if (isIE && isWin) {
  document.write('<scr' + 'ipt type="text/vbscript"\> \n');
  document.write('on error resume next \n');
  document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
  document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
  document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
  document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
  document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
  document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
  document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
  document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
  document.write('flash10Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10"))) \n');
  document.write('flash11Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.11"))) \n');
  document.write('flash12Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.12"))) \n');
  document.write('</scr' + 'ipt\> \n'); // break up end tag so it doesn't end our script
}

// Next comes the standard javascript detection that uses the
// navigator.plugins array. We pack the detector into a function so it loads
// before we run it.

function flashSniff() {
  // If navigator.plugins exists...
  if (navigator.plugins) {
    // ...then check for flash 2 or flash 3+.
    if (navigator.plugins["Shockwave Flash 2.0"]
        || navigator.plugins["Shockwave Flash"]) {

      // Some version of Flash was found. Time to figure out which.

      // Set convenient references to flash 2 and the plugin description.
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;

      // DEBUGGING: uncomment next line to see the actual description.
      // alert("Flash plugin description: " + flashDescription);

      // A flash plugin-description looks like this: Shockwave Flash 4.0 r5
      // We can get the major version by grabbing the character before the period
      // note that we don't bother with minor version detection.
      // Do that in your movie with $version or getVersion().
      var flashVersion = parseInt(/[0-9]{1,}./.exec(flashDescription));

      // We found the version, now set appropriate version flags. Make sure
      // to use >= on the highest version so we don't prevent future version
      // users from entering the site.
      flash2Installed = flashVersion == 2;
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion == 6;
      flash7Installed = flashVersion == 7;
      flash8Installed = flashVersion == 8;
      flash9Installed = flashVersion == 9;
      flash10Installed = flashVersion == 10;
      flash11Installed = flashVersion == 11;
      flash12Installed = flashVersion >= 12;
    }
  }

  // Loop through all versions we're checking, and
  // set actualVersion to highest detected version.
  for (var i = 2; i <= maxVersion; i++) {
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
  }
  // Vars for backwards support
  if (i > 0) { flagVar = true; flashTrue = true; }
  // We're finished getting the version on all browsers that support detection.
  return actualVersion;
}
function setNonFlashUser(url) {
    document.cookie = 'isNonFlashUser=true; path=/';
    location.replace(url + "?type=nonflash");
}
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
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;
var us_states = [ "AA", "AE","AL","AK","AP","AZ","AR","CA","CO","CT","DE","DC","FL","GA","HI","ID","IL",
	      		  "IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV",
	      		  "NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX",
	      		  "UT","VT","VA","WA","WI","WV", "WI","WY" ];
var ca_prov = [ "AB","BC","LB","MB","NB","NL","NWT","NS","NU","ON","PI","PE","QC","SK","YT" ];
var misc = [ "AS", "GU", "FM", "MH", "MP", "PW", "PR", "VI" ];
var au_prov = [ "ACI","NSW","NT","QLD","SA","TAS","VIC","WAU" ];
var mx_prov = [ "AGS","BCN","BCS","CAMP","CHIS","CHIH","COAH","COL","DGO","MEX","GTO","GRO","HGO","JAL","DF","MICH","MOR","NAY","NL","OAX","PUE","QRO","QROO","SLP","SIN","SON","TAB","TAM","TLAX","VER","YUC","ZAC"  ];

var topCities = ["amsterdam::NL","columbus:OH:US","lake buena vista:FL:US","ottawa:ON:CA","san francisco:CA:US","anaheim:CA:US","costa mesa:CA:US","london::GB","palo alto:CA:US","scottsdale:AZ:US","dallas:TX:US","los angeles:CA:US","pasadena:CA:US","seattle:WA:US","atlanta:GA:US","denver:CO:US","montreal:QC:CA","philadelphia:PA:US","st. louis:MO:US","baltimore:MD:US","fort lauderdale:FL:US","munich::DE","pittsburgh:PA:US","stamford:CT:US","bangkok::TH","frankfurt::DE","new orleans:LA:US","sunnyvale:CA:US","boston:MA:US","honolulu, island of oahu:HI:US","honolulu:HI:US","new york:NY:US","richmond:VA:US","sydney::AU","calgary:AB:CA","houston:TX:US","newark:NJ:US","rosemont:IL:US","toronto:ON:CA","chicago:IL:US","indianapolis:IN:US","san antonio:TX:US","vancouver:BC:CA","cincinnati:OH:US","kansas city:MO:US","orlando:FL:US","san diego:CA:US:","washington:DC:US","paris::FR","abu dhabi::AE","albuquerque:NM:US","amman::JO","anchorage:AK:US","ankara::TR","ann arbor:MI:US","aspen:CO:US","athens::GR","atlantic city:NJ:US","bangor:ME:US","barcelona::ES","baton rouge:LA:US","beijing::CN","beirut::LB","berlin::DE","bilbao::ES","birmingham:AL:US","bogota::CO","braintree:MA:US","brussels::BE","budapest::HU","buenos aires::AR","cairo::EG","calcutta::IN","cancun::MX","cape town::ZA","chapel hill:NC:US","charlotte:NC:US","chattanooga:TN:US","cleveland:OH:US","cologne::DE","copenhagen::DK","cork::IE","crete::GR","danbury:CT:US","des moines:IA:US","detroit:MI:US","dresden::DE","dubai::AE","dublin::IE","dusseldorf::DE","edinburgh::GB","edmonton:AB:CA","fresno:CA:US","florence::IT","ft lauderdale:FL:US","ft. lauderdale:FL:US","geelong::AU","geneva::CH","halifax:NS:CA","hanoi::VN","helsinki::FI","hong kong::CN","jakarta::ID","jeddah::SA","jerusalem::IL","key west:FL:US","kuala lumpur::MY","kuwait city::KW","kyoto::JP","las vegas:NV:US","lima::PE","lisbon::PT","long beach:CA:US","louisville:KY:US","luxembourg::LU","madrid::ES","maui:HI:US","melbourne::AU","mexico city::MX","miami:FL:US","milan::IT","milwaukee:WI:US","minneapolis:MN:US","moscow::RU","mumbai::IN","mykonos::GR","myrtle beach:SC:US","nanjing::CN","nashville:TN:US","nice::FR","norfolk:VA:US","norwalk:CT:US","oklahoma city:OK:US","omaha:NE:US","osaka::JP","palm springs:CA:US", "penang::MY","phoenix:AZ:US","phuket::TH","providence:RI:US","puerto vallarta::MX","raleigh:NC:US","rio de janeiro::BR","riyadh::SA","rome::IT","rotterdam::NL","sacramento:CA:US","salt lake city:UT:US","salzburg::AT","san juan:PR:US","san sebastian::ES","savannah:GA:US","seoul::KR","shanghai::CN","st. john:VI:US","st john:VI:US","saint john:VI:US","st. maarten::AN","st maarten::AN","saint maarten::AN","stockholm::SE","sunnyvale:CA:US","syracuse:NY:US","tacoma:WA:US","taipei::TW","tel aviv::IL","tempe:AZ:US","tokyo::JP","tucson:AZ:US","tuscaloosa:AL:US","venice::IT","versailles::FR","vienna::AT","vieques:PR:US","warsaw::PL","whistler:BC:CA","wichita:KS:US","williamsburg:VA:US","zagreb::HR","zurich::CH","virginia beach:VA:US", "rimini::IT", "turin::IT", "costa smeralda::IT", "bari::IT", "naples::IT", "lecce::IT", "padova::IT", "bologna::IT", "genova::IT", "bolzano::IT","tarrytown:NY:US","macao::CN","macau::CN","limassol::CY","istanbul::TR"];

var topCitiesThreeChar = ["amsterdam::NLD","columbus:OH:USA","lake buena vista:FL:USA","ottawa:ON:CAN","san francisco:CAN:USA","anaheim:CAN:USA","costa mesa:CAN:USA","london::GBR","palo alto:CAN:USA","scottsdale:AZ:USA","dallas:TX:USA","los angeles:CAN:USA","pasadena:CAN:USA","seattle:WA:USA","atlanta:GA:USA","denver:CO:USA","montreal:QC:CAN","philadelphia:PA:USA","st. louis:MO:USA","baltimore:MD:USA","fort lauderdale:FL:USA","munich::DEU","pittsburgh:PA:USA","stamford:CT:USA","bangkok::THA","frankfurt::DEU","new orleans:LA:USA","portland:OR:USA","sunnyvale:CAN:USA","boston:MA:USA","honolulu, island of oahu:HI:USA","honolulu:HI:USA","new york:NY:USA","richmond:VA:USA","sydney::AUS","calgary:AB:CAN","houston:TX:USA","newark:NJ:USA","rosemont:IL:USA","toronto:ON:CAN","chicago:IL:USA","indianapolis:IN:USA","san antonio:TX:USA","vancouver:BC:CAN","cincinnati:OH:USA","kansas city:MO:USA","orlando:FL:USA","san diego:CAN:USA:","washington:DC:USA","paris::FRA","virginia beach:VA:USA","tarrytown:NY:USA"];







// safari work around function for Date.setDate()
function addDays(daysToAdd,date) {
  var x = new Date(2000,1,1);
  var y = new Date(2000,1,1);
  if(x.setDate(128) > y.valueOf())  {
    date.setDate(date.getDate()+daysToAdd);
    return date;
  }
  // Safari setDate(uint8) workaround
  if(daysToAdd < 0) {
    for(var i= -97; daysToAdd < i; daysToAdd-= i) {
      date.setDate(date.getDate()+i);
    }
  }
  else {
    for(var i= 96; daysToAdd > i; daysToAdd-= i) {
      date.setDate(date.getDate()+i);
    }
  }
  date.setDate(date.getDate()+daysToAdd);
  return date;
}

// Static date constants for today (not overwritten by functions)
var mcCalsToDisplay = 2;
var mcMaxBookDays   = 91;
var mcDisplayLimit  = 549;

    
var mcMaxDisplay    = new Date();
// safari fix
    mcMaxDisplay    = addDays(mcDisplayLimit, mcMaxDisplay); //today + 549 days = 550 days to display
var moMonthDayCountArrayCiCo = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

/*  set up language object to display the correct strings on the cal for internationalization (can and should be overwritten on calling page)
    default to english and get populated on the page with the translated strings
 */
var moLanguageObjCiCo = {
    calendarMonthNameArray    : ["January","February","March","April","May","June","July","August","September","October","November","December"],
    calendarShortMonthArray   : ["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],
    calendarShortDayNameArray : ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
    calendarDayNameArray      : ["Su","M","Tu","W","Th","F","Sa"],
    errorArray                : [
                                  
                                    
                                    
                                        "For stays longer than 90 nights, please call 866-539-3446.",
                                    
                                  
                                  "You can only book up to 550 days in advance.",
                                  "Arrival date cannot be earlier than today.",
                                  "Departure date cannot be earlier than arrival date.",
                                  "Arrival and departure date cannot be on the same day.",
                                  "Please select a check-in and checkout date.",
                                  "Please select a checkout date."
                                ],
    pickCheckInText           : "Select check in date above",
    pickCheckOutText          : "Select check out date above",
    checkInText               : "Check in",
    checkOutText              : "Check out",
    clickCheckInTitle         : "Click for this check in",
    clickCheckOutTitle        : "Click for this check out",
    calendarClose             : "Close",
    calendarClear             : "Reset Calendar",
    resetSelectedDate         : "Reset",
    calendarPrev              : "Previous",
    calendarNext              : "Next",
    calendarContinue          : "Continue",
    submitDates               : "Submit dates",
    day                       : "Su",
    year                      : "Year"
};
    // function to determine the offsetLeft of an element that is passed in

function fnGetOffsetLeftCiCo (pElement) {
  var lsLeftOffset = pElement.offsetLeft;

  while ((pElement = pElement.offsetParent) != null){
      lsLeftOffset  += pElement.offsetLeft;
  }
  return lsLeftOffset;
}

// function to determine the offsetTop of an element that is passed in
function fnGetOffsetTopCiCo (pElement) {
  var lsTopOffset = pElement.offsetTop;
  while ((pElement = pElement.offsetParent) != null){
      lsTopOffset +=pElement.offsetTop;
  }
  return lsTopOffset;
}
 
var moCalendarObjCiCo = null;

function CalendarManager(config){
  this.calArray = new Array();
}

//Calendar Manager method to add a new calendar to the array
CalendarManager.prototype.addCalendar = function(pCalendarObj){
  this.calArray[pCalendarObj.calendarId] = pCalendarObj;
}

var calRightArrow = new Image();
calRightArrow.src = "/whotels/images/calendar/rightArrow.gif";
var calLeftArrow = new Image();
  calLeftArrow.src = "/whotels/images/calendar/leftArrow.gif";
var calControlBackground = new Image();
  calControlBackground.src = "/whotels/images/calendar/calendarcontrolbackground.gif";
var calCloseBox = new Image();
  calCloseBox.src = "/whotels/images/calendar/closebox.gif";
var calCells = new Image();
  calCells.src = "/whotels/images/calendar/wh_calendar_cells.gif";

// declare and set module variables
var moCalendarManagerCiCo = new CalendarManager();

/**
 * Availability Calendar Constructor
 * @constructor
 * @param {String} pCalendarId Unique ID for instance of Calendar
 * @param {Object} pCIDate Function to retrieve check in date
 * @param {Object} pCODate Function to retrieve check out date
 * @param {Object} pRetrunFunction Function to set check-in and check-out dates
*/
function multiDisplayCalendar(pCalendarId, pCIDate, pCODate, pReturnFunction, todaySystemDate) {
// backwards compatibility
    this.settings = {
        calendarsToDisplay    : mcCalsToDisplay,
        maxBookDays           : mcMaxBookDays,
        displayLimit          : mcDisplayLimit,
        today                 : SW.widget.Calendar.Utils.getToday(todaySystemDate),
        limitDate             : mcMaxDisplay
    };
    this.settings.firstOfStartMonth = new Date(this.settings.today.getFullYear(), this.settings.today.getMonth(), 1)

    this.isRendered = 0;
    this.isCreated = 0;

    this.handleClass = function(className, tag, root, func, params) {
        var elements = yuiDom.getElementsByClassName(className, tag, root);
        if (func) {
            for (var i = 0; i < elements.length; i++) {
                func(elements[i], params);
            }
        }
    };
    this.userLanguage = "en";
    if (moCalendarManagerCiCo.calArray[pCalendarId]) {
        var loCalendarObj = moCalendarManagerCiCo.calArray[pCalendarId];
        this.getCIDateFunction = pCIDate;
        this.getCODateFunction = pCODate;
        loCalendarObj.ciDateInitial = this.getCIDateFunction();
        loCalendarObj.coDateInitial = this.getCODateFunction();
        loCalendarObj.initializeObject();
        return loCalendarObj;
    } else {
        this.calendarId = pCalendarId;
        this.returnFunction = pReturnFunction;
        this.getCIDateFunction = pCIDate;
        this.getCODateFunction = pCODate;
        this.calLocation = "bottomRight";
        this.checkIn = null;
        this.checkOut = null;
        this.calStartDate = null;
        this.display = 'none';
        this.calendarDivMonth = new Array();
        this.errorMessageDiv = null;
        this.calendarContinue = null;
        this.calendarPrevious = null;
        this.calendarPreviousAction = null;
        this.calendarNext = null;
        this.calendarNextAction = null;
        this.hasError = null;
        this.errorArray = null;
        this.initializeObject();
        this.ciCocalendarIframe = null;
        this.calendarContainer = null;
        this.renderedMonths = {}; // object literal -> store already-rendered months (avoids re-rendering months);

        this.prevButton = document.createElement("div");  // container for prev button
        yuiDom.addClass(this.prevButton, "calendarNavigation");
        yuiDom.addClass(this.prevButton, "calendarNavigationPrevious")
        yuiEvent.addListener(this.prevButton, "click", this.changeMonth, -1, this);

        this.nextButton = document.createElement("div");  // container for next button
        yuiDom.addClass(this.nextButton, "calendarNavigation");
        yuiDom.addClass(this.nextButton, "calendarNavigationNext");
        yuiEvent.addListener(this.nextButton, "click", this.changeMonth, 1, this);

        moCalendarManagerCiCo.addCalendar(this);
        return this;
    }
}

// gets the check-in and check-out from input fields, get calendarStartDate
multiDisplayCalendar.prototype.initializeObject = function(){
  this.checkIn = this.getCIDateFunction();
  this.checkOut = this.getCODateFunction();
  this.calStartDate = this.getCalStartDate();
  this.hasError = false;
}

// get calendar start date based on check-in and check-out
multiDisplayCalendar.prototype.getCalStartDate = function(){
  var calStartDate = new Date(this.settings.firstOfStartMonth);
  var currentCalStartDate = (this.calStartDate) ? new Date(this.calStartDate.getFullYear(), this.calStartDate.getMonth(), 1) : null;
  if(!currentCalStartDate || currentCalStartDate == calStartDate || (this.checkIn && this.checkOut)) {
    return (this.checkIn && this.checkOut) ? new Date(this.checkIn.getFullYear(),this.checkIn.getMonth(), 1) : calStartDate;
  }
  return currentCalStartDate;

}

// toggle between show and hide
multiDisplayCalendar.prototype.toggleDisplay = function(pCalendarIcon, calLocation){
  if(this.display != "block") {
    this.show(pCalendarIcon, calLocation);
  }
  else {
    this.hide();
  }
}

// show calendar, get check-in and check-out, get calendar start date, validate values
multiDisplayCalendar.prototype.show = function(pCalendarIcon, calLocation){
  this.initializeObject();
    if(!this.isCreated) {
        this.createFramework();
        this.isCreated = 1;
    }
  if(this.checkIn && this.checkOut) {
    this.validateCalendar();
  }
  if(this.hasError) {
    this.resetCheckInDate();
    this.resetCheckOutDate();
    this.calStartDate = new Date(this.settings.firstOfStartMonth);

  }
  this.renderCalDisplay();
  this.isRendered = 1;

  this.display = 'block';
  this.calendarContainer.style.display = this.display;
  // set the iframe dimensions, needs to be done after the calendar is displayed
  if(this.display == 'block'){
      this.ciCocalendarIframe.width           = this.calendarContainer.offsetWidth;
      this.ciCocalendarIframe.height          = this.calendarContainer.offsetHeight;
      this.ciCocalendarIframe.style.zIndex    = this.calendarContainer.style.zIndex - 1;
  }
  this.highlight();
  this.ciCocalendarIframe.style.display   = this.display;
    if(pCalendarIcon!=undefined) this.setCalendarPosition(pCalendarIcon, calLocation);
}

// hide calendar
multiDisplayCalendar.prototype.hide = function(event){
  this.display              = 'none';
  this.calendarContainer.style.display  = this.display;
  this.ciCocalendarIframe.style.display     = this.display;
}

// set calendar position based on calendar icon
multiDisplayCalendar.prototype.setCalendarPosition = function(pCalendarIcon, calLocation){
    this.calLocation = calLocation;

  if (this.calLocation == "topLeft") {
      // display to the top left of the icon
      this.calendarContainer.style.top    = (fnGetOffsetTopCiCo(pCalendarIcon, this.calendarContainer) - this.calendarContainer.offsetHeight) + 'px';
      this.calendarContainer.style.left   = (fnGetOffsetLeftCiCo(pCalendarIcon, this.calendarContainer) - this.calendarContainer.offsetWidth) + 'px';
  } else if (this.calLocation == "topRight") {
       // display to the top left of the icon
      this.calendarContainer.style.top    = (fnGetOffsetTopCiCo(pCalendarIcon, this.calendarContainer) - this.calendarContainer.offsetHeight) + 'px';
      this.calendarContainer.style.left   = fnGetOffsetLeftCiCo(pCalendarIcon, this.calendarContainer) + 'px';
  } else if (this.calLocation == "bottomRight") {
      // display below and to the right of the icon
      this.calendarContainer.style.top    = fnGetOffsetTopCiCo(pCalendarIcon, this.calendarContainer) + 'px';
      this.calendarContainer.style.left   = fnGetOffsetLeftCiCo(pCalendarIcon, this.calendarContainer) + 'px';
  } else if (this.calLocation == "bottomLeft") {
       // display below and to the right of the icon
      this.calendarContainer.style.top    = fnGetOffsetTopCiCo(pCalendarIcon, this.calendarContainer) + 'px';
      this.calendarContainer.style.left   = (fnGetOffsetLeftCiCo(pCalendarIcon, this.calendarContainer) - this.calendarContainer.offsetWidth) + 'px';
  } else if (this.calLocation == "centerLeft") {
       // display center and to the left of the icon
      this.calendarContainer.style.top    = fnGetOffsetTopCiCo(pCalendarIcon, this.calendarContainer) - parseFloat(this.calendarContainer.offsetHeight)/2 +  'px';
      this.calendarContainer.style.left   = (fnGetOffsetLeftCiCo(pCalendarIcon, this.calendarContainer) - this.calendarContainer.offsetWidth) + 'px';
  } else if (this.calLocation == "centerRight") {
       // display center and to the right of the icon
      this.calendarContainer.style.top    = fnGetOffsetTopCiCo(pCalendarIcon, this.calendarContainer) - parseFloat(this.calendarContainer.offsetHeight)/2 +  'px';
      this.calendarContainer.style.left   = (fnGetOffsetLeftCiCo(pCalendarIcon, this.calendarContainer) ) + 'px';
  } else {
      // the user tells it where to be placed
      // expecting a string with x and y seperated by a comma
      var laUserLocation = this.calLocation.split(",");
      this.calendarContainer.style.top    =  laUserLocation[1] + 'px';
      this.calendarContainer.style.left   =  laUserLocation[0] + 'px';
  }
  this.ciCocalendarIframe.style.top       = this.calendarContainer.style.top;
  this.ciCocalendarIframe.style.left      = this.calendarContainer.style.left;
}

// create framework of the calendar
multiDisplayCalendar.prototype.createFramework = function(){
  var lsText;
  var loTextNode;

  //create the iframe to sit behind the layer - workaround for IE and select boxes
  var loCalenderHolderIframe = document.createElement("iframe");
      loCalenderHolderIframe.name = "calendarHolder_Iframe";
      loCalenderHolderIframe.id = "calendarHolder_Iframe_" + this.calendarId;
      loCalenderHolderIframe.width = 0;
      loCalenderHolderIframe.height = 0;
      loCalenderHolderIframe.style.zIndex = "99998";
      yuiDom.addClass(loCalenderHolderIframe, 'calendarHolderIframe');
      loCalenderHolderIframe.src = "/common/blank.jsp";
      this.ciCocalendarIframe = loCalenderHolderIframe;
      document.body.appendChild(this.ciCocalendarIframe);
  // create main calendar div

  var loCalenderHolder = document.createElement("div");
  this.calendarContainer = loCalenderHolder;
      loCalenderHolder.style.zIndex = "20000";
      loCalenderHolder.className = "calendarHolder";
      loCalenderHolder.id = "calendarHolder_" + this.calendarId;
      document.body.appendChild(loCalenderHolder);

  var loCalendarSubContainer = document.createElement("div");
      yuiDom.addClass(loCalendarSubContainer,"calendarSubContainer");
      this.calendarContainer.appendChild(loCalendarSubContainer);
      this.calendarContainer.subContainer = loCalendarSubContainer;
      
// create close button
  var loClose = document.createElement("div");
      this.calendarContainer.close = loClose;
      yuiDom.addClass(loClose, 'closeButton');
      var loCloseAction = document.createElement("a");
           loCloseAction.href = "javascript:void(0);";
          loCloseAction.target = "_self";
          // yuiEvent.addListener(loCloseAction,"click",this.close,{},this);
          yuiEvent.addListener(loCloseAction,"click",function(e){
              this.close();
              yuiEvent.preventDefault(e);
          }, this, true);
          loCloseAction.title = moLanguageObjCiCo.calendarClose;
          lsText = moLanguageObjCiCo.calendarClose;
          loTextNode = document.createTextNode(lsText);
          loCloseAction.appendChild(loTextNode);
          var loCloseActionImg = document.createElement("img");
              loCloseActionImg.src = calCloseBox.src;
              loCloseActionImg.border = '0';
              loCloseActionImg.alt = moLanguageObjCiCo.calendarClose;
//            loCloseAction.appendChild(loCloseActionImg);
      loClose.appendChild(loCloseAction);
      this.calendarContainer.subContainer.appendChild(loClose);

  // clear calendar
  var loClearCal = document.createElement("div");
  this.calendarContainer.reset = loClearCal;
  yuiDom.addClass(loClearCal, 'reset')

  var resetButton = document.createElement("div");
  this.calendarContainer.reset.resetButton = resetButton;
  yuiDom.addClass(resetButton,'resetButton');

  this.calendarContainer.reset.appendChild(resetButton);

  var loResetAction = document.createElement("a");
  this.calendarContainer.reset.resetDates = loResetAction;
  loResetAction.href = "javascript:void(0);";
  loResetAction.target = "_self";
  yuiEvent.addListener(loResetAction,"click",this.reset,{},this);
  loResetAction.title = moLanguageObjCiCo.calendarClear;
  lsText = moLanguageObjCiCo.calendarClear;
  loTextNode = document.createTextNode(lsText);
  loResetAction.appendChild(loTextNode);

  this.calendarContainer.reset.resetButton.appendChild(loResetAction);
  this.calendarContainer.subContainer.appendChild(loClearCal);


  // create the main calendar portion
  var loCalendarContainer = document.createElement("div");
      this.calendarContainer.calendarOuterContainer = loCalendarContainer;
      loCalendarContainer.className = "calendarOuterContainer";

      // container

  var loCalendarInnerContainer = document.createElement("div");
      this.calendarContainer.calendarOuterContainer.calendarInnerContainer = loCalendarInnerContainer;
      loCalendarInnerContainer.className = "calendarInnerContainer";

      /* ****************CAL BODY HERE******************* */

      // mcCalsToDisplay --> var to hold number of calendar to be displayed...

      var spacerCount = 1;
      for(var i = 0; i < this.settings.calendarsToDisplay; i++) {
          var calEl = document.createElement("div");
          yuiDom.addClass(calEl, "calendarDiv");
          loCalendarInnerContainer.appendChild(calEl);
          this.calendarDivMonth[i] = calEl;
          spacerCount++;
          if(spacerCount % 2 == 0) {
              var loSpacerDiv = document.createElement("div");
              loSpacerDiv.className = "spacerDiv";
              loCalendarInnerContainer.appendChild(loSpacerDiv);
          }
       }
       var loClearDiv1 = document.createElement("div");
       loClearDiv1.className = "divClear";
       loCalendarInnerContainer.appendChild(loClearDiv1);

/* ****************END CAL BODY******************** */
      // clear div
  var loClearDiv2 = document.createElement("div");
      loClearDiv2.className = "divClear";
      loCalendarContainer.appendChild(loClearDiv2);

  this.calendarContainer.subContainer.appendChild(loCalendarContainer);
  this.calendarContainer.calendarOuterContainer.appendChild(loCalendarInnerContainer);
   // clear div

  var clearDiv = document.createElement("div");
  yuiDom.addClass(clearDiv,'divClear');
  this.calendarContainer.subContainer.appendChild(clearDiv);

  loCalendarContainer.appendChild(loClearDiv2);
  // create menuHolder Div

  var menuHolder = document.createElement("div");
  this.calendarContainer.menuHolder = menuHolder;
  yuiDom.addClass(menuHolder, 'menuHolder');
  this.calendarContainer.subContainer.appendChild(menuHolder);

  // create error display
  var loError = document.createElement("div");
      loError.className = "calendarError";
      loError.id = "calendarError_"+this.calendarId;
      this.errorMessageDiv = loError;
      this.calendarContainer.menuHolder.appendChild(loError);

  // create travel dates display
  var travelDateHolder = document.createElement("div");
  this.calendarContainer.menuHolder.travelDateHolder = travelDateHolder;
  yuiDom.addClass(travelDateHolder,"travelDateHolder");

  var instructions = document.createElement("ol");
  this.calendarContainer.menuHolder.travelDateHolder.instructions = instructions;
  yuiDom.addClass(instructions,"instructions");

  var checkInInstructions = document.createElement("li");
  this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions = checkInInstructions;
  checkInInstructions.id = "checkInInstructions_"+this.calendarId;
  yuiDom.addClass(checkInInstructions, "checkInInstructions")
  yuiDom.addClass(checkInInstructions,"active");
  yuiDom.addClass(checkInInstructions,"checkInInstructionsActive");
  var checkInText = document.createTextNode(moLanguageObjCiCo.pickCheckInText);
  checkInInstructions.appendChild(checkInText);

  var checkOutInstructions = document.createElement("li");
  this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions = checkOutInstructions;
  checkOutInstructions.id = "checkOutInstructions_"+this.calendarId;
  yuiDom.addClass(checkOutInstructions, "checkOutInstructions")
  var checkOutText = document.createTextNode(moLanguageObjCiCo.pickCheckOutText); // code decode
  checkOutInstructions.appendChild(checkOutText);

  var submitInstructions = document.createElement("li");
  this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions = submitInstructions;
  submitInstructions.id = "submitInstructions_"+this.calendarId;
  yuiDom.addClass(submitInstructions, "submitInstructions");
  var submitTextContainer = document.createElement("span");
  yuiDom.addClass(submitTextContainer, "submitInstLabel");
  var submitText = document.createTextNode(moLanguageObjCiCo.submitDates); // code decode
  submitTextContainer.appendChild(submitText);
  submitInstructions.appendChild(submitTextContainer);

  var continueButton = document.createElement("div");
  this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.continueButton = continueButton;
  yuiDom.addClass(continueButton,"continueButton");
  yuiDom.addClass(continueButton,"buttonLink");

  var continueLink = document.createElement("a");
  this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.continueButton.continueLink = continueLink;
  yuiDom.addClass(continueLink,"continueLink");
  continueLink.href = "javascript:void(0);";
  continueLink.target = "_self";
  yuiEvent.addListener(continueLink,"click",this.submit,{checkIn: this.checkIn,checkOut: this.checkOut},this);
  continueLink.title = moLanguageObjCiCo.calendarContinue;
  var continueText = document.createTextNode(moLanguageObjCiCo.calendarContinue);
  continueLink.appendChild(continueText);
  continueButton.appendChild(continueLink);
  this.calendarContainer.menuHolder.travelDateHolder.instructions.appendChild(checkInInstructions);
  this.calendarContainer.menuHolder.travelDateHolder.instructions.appendChild(checkOutInstructions);
  this.calendarContainer.menuHolder.travelDateHolder.instructions.appendChild(submitInstructions);

  this.calendarContainer.menuHolder.travelDateHolder.appendChild(instructions);
  this.calendarContainer.menuHolder.appendChild(travelDateHolder);

  this.checkInToolTip = document.createElement("div");
  yuiDom.addClass(this.checkInToolTip, "calendarToolTip");
  yuiDom.addClass(this.checkInToolTip, "checkInToolTip");
  this.checkInToolTip.innerHTML = moLanguageObjCiCo.clickCheckInTitle;
  document.body.appendChild(this.checkInToolTip)

  this.checkOutToolTip = document.createElement("div");
  yuiDom.addClass(this.checkOutToolTip, "calendarToolTip");
  yuiDom.addClass(this.checkOutToolTip, "checkOutToolTip");
  this.checkOutToolTip.innerHTML = moLanguageObjCiCo.clickCheckOutTitle;
  document.body.appendChild(this.checkOutToolTip)

  return loCalenderHolder;
}
// End createFramework

// render the calendar
multiDisplayCalendar.prototype.renderCalendar = function() {

// clear all child nodes first, never should need to do replaceChild for this.calendarDivMonth[calIndex]
    for(var calIndex = 0; calIndex < this.settings.calendarsToDisplay; calIndex++) {
      if(this.calendarDivMonth[calIndex].firstChild) {
        this.calendarDivMonth[calIndex].removeChild(this.calendarDivMonth[calIndex].firstChild);
      }
    }
    for (var calIndex = 0; calIndex < this.settings.calendarsToDisplay; calIndex++) {
      var columnIndex   = 0;
      var workingDate   = new Date(this.calStartDate);
      workingDate       = new Date(workingDate.setMonth(workingDate.getMonth() + calIndex));
      var currentMonth  = workingDate.getMonth();
      var currentYear   = workingDate.getFullYear();
      var currentDay    = new Date(currentYear,currentMonth,1).getDay();

      if(!this.renderedMonths[currentYear]){
          this.renderedMonths[currentYear] = {};
      }
      var calendarTable;
      if(!this.renderedMonths[currentYear][currentMonth]) {
          //Write the newly constructed table to the div on the page
          calendarTable = this.createMonth(calIndex);
          this.calendarDivMonth[calIndex].appendChild(calendarTable);
          this.renderedMonths[currentYear][currentMonth] = calendarTable;
      }
      else {
        if(this.renderedMonths[currentYear]) {
          if(!this.renderedMonths[currentYear][currentMonth]) {
          // create calendar for the month if not created already
            calendarTable = this.createMonth(calIndex);
            this.renderedMonths[currentYear][currentMonth] = calendarTable;
          }
          if(this.renderedMonths[currentYear][currentMonth].calendarHeader) {
            if(calIndex == 0) {
//              add previous button control for first calendar
              if(this.prevButton.parentNode && this.prevButton.parentNode != this.renderedMonths[currentYear][currentMonth].calendarHeader) {
                 this.prevButton.parentNode.removeChild(this.prevButton);
              }
              if(workingDate > this.settings.today) {
                if(this.renderedMonths[currentYear][currentMonth].calendarHeader.firstChild && this.renderedMonths[currentYear][currentMonth].calendarHeader.firstChild != this.prevButton) {
                  this.renderedMonths[currentYear][currentMonth].calendarHeader.insertBefore(this.prevButton,this.renderedMonths[currentYear][currentMonth].calendarHeader.firstChild);
                }
              }
            }
            if(calIndex == 1) {
//              add next button control first second calendar
              if(this.nextButton.parentNode && this.nextButton.parentNode != this.renderedMonths[currentYear][currentMonth].calendarHeader) {
                this.nextButton.parentNode.removeChild(this.nextButton);
              }
              var limitDateCheck = workingDate.setMonth(workingDate.getMonth()+1);
              if(limitDateCheck < this.settings.limitDate) {
                if(this.renderedMonths[currentYear][currentMonth].calendarHeader.firstChild && this.renderedMonths[currentYear][currentMonth].calendarHeader.firstChild != this.nextButton) {
                  this.renderedMonths[currentYear][currentMonth].calendarHeader.insertBefore(this.nextButton,this.renderedMonths[currentYear][currentMonth].calendarHeader.firstChild);
                }
              }
            }
          }
//          put the month back into container
          this.calendarDivMonth[calIndex].appendChild(this.renderedMonths[currentYear][currentMonth]);
        }
      }
      this.resetHightlight(this.calendarDivMonth[calIndex]);
    }
}

multiDisplayCalendar.prototype.renderCalDisplay = function(){
    this.renderCalendar();
    this.highlight();
}

multiDisplayCalendar.prototype.createMonth = function(calIndex) {
  var columnIndex   = 0;
  var workingDate   = new Date(this.calStartDate);
  workingDate       = new Date(workingDate.setMonth(workingDate.getMonth() + calIndex));
  var currentMonth  = workingDate.getMonth();
  var currentYear   = workingDate.getFullYear();
  var currentDay    = new Date(currentYear,currentMonth,1).getDay();
  // calendarTable - to be returned by this function, main day holder
  var calendarTable        = document.createElement("div");
  yuiDom.addClass(calendarTable, "calendarTable");

  var calendarHeader       = document.createElement("div");
  yuiDom.addClass(calendarHeader, "calendarHeader");

  var clearHdr = document.createElement("div");
  yuiDom.addClass(clearHdr,"divClear");

  var calendarMonth        = document.createElement("div");
  var calendarMonthText    = document.createTextNode(moLanguageObjCiCo.calendarMonthNameArray[currentMonth] + " " + currentYear);
  yuiDom.addClass(calendarMonth, "month");
  calendarMonth.appendChild(calendarMonthText);
  if(calIndex == 0 && this.prevButton.parentNode) {
    this.prevButton.parentNode.removeChild(this.prevButton);
  }
  if(calIndex == 1 && this.nextButton.parentNode) {
    this.nextButton.parentNode.removeChild(this.nextButton);
  }
  if(calIndex == 0 && (workingDate > this.settings.today)) {
    this.calendarPrevious = this.prevButton;
    calendarHeader.appendChild(this.prevButton);
  }
  var dateCheck = workingDate;
  dateCheck.setMonth(workingDate.getMonth()+1);

  if(calIndex == 1 && (dateCheck < this.settings.limitDate)) {
    this.calendarNext = this.nextButton;
    calendarHeader.appendChild(this.nextButton);
  }

  calendarTable.appendChild(calendarHeader);
//  attach calendar header to calendarTable so we can use it as reference when adding next and previous buttons
  calendarTable.calendarHeader = calendarHeader;
  calendarHeader.appendChild(calendarMonth);
  calendarHeader.appendChild(clearHdr);

  var calendarDays   = document.createElement("div");
  yuiDom.addClass(calendarDays,"calendarTableInner");
  calendarTable.appendChild(calendarDays);

  // create day headers
  for (var i = 0; i < 7; i++){
      var day     = document.createElement("div");
      var dayText = document.createTextNode(moLanguageObjCiCo.calendarDayNameArray[i]);
      yuiDom.addClass(day,"daysoftheweek");
      day.appendChild(dayText);
      calendarDays.appendChild(day);
  }

  var clearDiv = document.createElement("div");
  yuiDom.addClass(clearDiv,"divClear");
  calendarDays.appendChild(clearDiv);

  // Figure out if it is a leap year and set accordingly
  moMonthDayCountArrayCiCo[1] = (((currentYear % 4 == 0) && (currentYear % 100 != 0)) || (currentYear % 400 == 0)) ? 29 : 28;
  for (var i=0; i<currentDay; i++, columnIndex++){
      var emptyDay = document.createElement("div");
      yuiDom.addClass(emptyDay,"day");
      yuiDom.addClass(emptyDay,"emptyDay");
      calendarDays.appendChild(emptyDay);
  }
  for (var i=0; i<=moMonthDayCountArrayCiCo[currentMonth]-1; i++, columnIndex++) {
    var currentDate = new Date(currentYear,currentMonth,1);
    currentDate = new Date(currentDate.setDate(currentDate.getDate() + i));
    if(currentDate < this.settings.limitDate && currentDate >= this.settings.today){ // day is valid
        var validDay = document.createElement("div");
        yuiDom.addClass(validDay,"day");
        yuiDom.addClass(validDay,"available");
        yuiEvent.addListener(validDay,"click",this.selectDay,{calendarId:this.calendarId,element: validDay, currentDate:currentDate.getFullYear() + '/' + (currentDate.getMonth()+1) + '/' + currentDate.getDate()},this);
        yuiEvent.addListener(validDay,"mouseover",this.hover,{hover: true,element: validDay},this);
        yuiEvent.addListener(validDay,"mouseout",this.hover,{hover: false,element: validDay},this);
        var dayLink     = document.createElement("a");
        dayLink.href    = "javascript:void(0);";
        dayLink.target = "_self";
        var dayLinkText = document.createTextNode(currentDate.getDate());
        dayLink.appendChild(dayLinkText);
        validDay.appendChild(dayLink);
        validDay.id= currentDate.getFullYear() + "/" + (currentDate.getMonth()+1) + "/" + currentDate.getDate() + "_" + this.calendarId;
        calendarDays.appendChild(validDay);
    }
    else if(currentDate > this.settings.limitDate && currentDate >= this.settings.today){ //day is past the book limit
        var pastBooking = document.createElement("div");
        yuiDom.addClass(pastBooking,"day");
        yuiDom.addClass(pastBooking,"invalidDay");
        var pastBookingText = document.createTextNode(currentDate.getDate());
        pastBooking.appendChild(pastBookingText);
        calendarDays.appendChild(pastBooking);
    }
    if(currentDate < this.settings.today){ // day is less than today
        var pastDay     = document.createElement("div");
        yuiDom.addClass(pastDay,"day");
        yuiDom.addClass(pastDay,"pastDay");
        var pastDayText = document.createTextNode(currentDate.getDate());
        pastDay.appendChild(pastDayText);
        calendarDays.appendChild(pastDay);
    }
    if (columnIndex == 6) {
        var clearWeek = document.createElement("div");
        yuiDom.addClass(clearWeek,"divClear");
        calendarDays.appendChild(clearWeek);
        columnIndex = -1;
    }
  }
  if (columnIndex > 0) {
      for (var i=1; columnIndex<7; i++, columnIndex++){
          var emptyDay = document.createElement("div");
          yuiDom.addClass(emptyDay,"day");
          yuiDom.addClass(emptyDay,"emptyDay");
          calendarDays.appendChild(emptyDay);
      }
  }

  var clearDays = document.createElement("div");
  yuiDom.addClass(clearDays,"divClear");
  calendarDays.appendChild(clearDays);

  calendarTable.appendChild(calendarDays);

  var clearBody = document.createElement("div");
  yuiDom.addClass(clearBody,"divClear");
  calendarTable.appendChild(clearBody);
  return calendarTable;
}

multiDisplayCalendar.prototype.setNavigation = function(){

    var lvWorkingDate   = new Date(this.calStartDate);
        lvWorkingDate   = new Date(lvWorkingDate.setMonth(lvWorkingDate.getMonth() + 1));
    var loMaxDisplay    = new Date(this.settings.limitDate);
    var loDisableArray = new Array(false, false);

    // Prev button
    if(this.calStartDate.getMonth() == this.settings.today.getMonth() && this.calStartDate.getFullYear() == this.settings.today.getFullYear()){
        this.calendarPrevious.className = 'calendarNavigationPrevDisabled';
        this.calendarPrevious.href = "javascript:void(0);";
        yuiEvent.removeListener(this.calendarPrevious,"click",this.changeMonth);
    }
    else{
        this.calendarPrevious.className = 'calendarNavigationPrevActive';
        this.calendarPrevious.href = this.calendarPreviousAction;
        yuiEvent.addListener(this.calendarPrevious,"click",this.changeMonth,-1,this);
    }
    // next button
    if(lvWorkingDate.getMonth() == loMaxDisplay.getMonth() && lvWorkingDate.getFullYear() == loMaxDisplay.getFullYear()){
        this.calendarNext.className = 'calendarNavigationNextDisabled';
        this.calendarNext.href = "javascript:void(0);";
        yuiEvent.removeListener(this.calendarNext,"click",this.changeMonth);
    }
    else{
        this.calendarNext.className = 'calendarNavigationNextActive';
        this.calendarNext.href = this.calendarNextAction;
        yuiEvent.addListener(this.calendarNext,"click",this.changeMonth,1,this);
    }
}

multiDisplayCalendar.prototype.getLengthOfStay = function(startDate,endDate){
  return Math.round(Math.abs(endDate - startDate)/(1000 * 60 * 60 * 24)) +1;
}

multiDisplayCalendar.prototype.changeMonth = function(e, direction){
//    var loCalendarObj = moCalendarManagerCiCo.calArray[pCalendarId];
  var loNewStart = new Date(this.calStartDate);
  var newMonth = loNewStart.getMonth() + direction;
  // safari fix
  if(newMonth < 0) {
    loNewStart.setFullYear(loNewStart.getFullYear()-1);
    newMonth = 11;
  }
  loNewStart.setMonth(newMonth);
  if(loNewStart >=  this.settings.firstOfStartMonth && this.settings.limitDate >= loNewStart ) {
    this.calStartDate = loNewStart;
    this.renderCalDisplay();
  }
}

multiDisplayCalendar.prototype.showToolTip = function(e,tip,element) {
  var coords  = yuiEvent.getXY(e);
  yuiDom.setStyle(tip, "display", "block");
  yuiDom.setStyle(tip, "left", coords[0]+15 +"px");
  yuiDom.setStyle(tip, "top", coords[1]+10 +"px");
}
multiDisplayCalendar.prototype.hover = function(e, params) {

  var hoverDate = new Date(params.element.id.split("_")[0]);

  if(params.hover) { // mouseover

    var coords  = yuiDom.getXY(params.element);
    if(this.checkIn && !this.checkOut) {
      if(this.checkIn<hoverDate) {
        yuiDom.addClass(params.element,"hoverCheckOut");
        this.showToolTip(e,this.checkOutToolTip,params.element);
      }
      else {
        yuiDom.addClass(params.element,"hoverCheckIn");
        this.showToolTip(e,this.checkInToolTip,params.element);
      }
      return;
    }
    else if(this.checkOut && !this.checkIn) {
      if(this.checkOut<hoverDate) {
        yuiDom.addClass(params.element,"hoverCheckOut");
        this.showToolTip(e,this.checkOutToolTip,params.element);
      }
      else {
        yuiDom.addClass(params.element,"hoverCheckIn");
        this.showToolTip(e,this.checkInToolTip,params.element);
      }
      return;
    }
    else if(!this.checkIn) {
      yuiDom.addClass(params.element,"hoverCheckIn");
      this.showToolTip(e,this.checkInToolTip,params.element);
      return;
    }
    else if(!this.checkOut) {
      yuiDom.addClass(params.element,"hoverCheckOut");
        this.showToolTip(e,this.checkOutToolTip,params.element);
      return;
    }

    if((this.checkIn && this.checkOut) && (this.checkIn < hoverDate && this.checkOut > hoverDate)) {
      var daysBetween = Math.round(Math.abs(this.checkOut - this.checkIn)/(1000 * 60 * 60 * 24)) - 1;
      var halfWay = parseInt(daysBetween/2);
      var halfWayDate = new Date(this.checkIn.getFullYear(), this.checkIn.getMonth(), this.checkIn.getDate())
      halfWayDate = addDays(halfWay,halfWayDate);
      if(hoverDate <= halfWayDate) {
        yuiDom.addClass(params.element,"hoverCheckIn");
        this.showToolTip(e,this.checkInToolTip,params.element);
      }
      else {
        yuiDom.addClass(params.element,"hoverCheckOut");
        this.showToolTip(e,this.checkOutToolTip,params.element);
      }
    }
    else if(this.checkIn > hoverDate) {
      yuiDom.addClass(params.element,"hoverCheckIn");
      this.showToolTip(e,this.checkInToolTip,params.element);
    }
    else if(this.checkOut < hoverDate) {
      yuiDom.addClass(params.element,"hoverCheckOut");
      this.showToolTip(e,this.checkOutToolTip,params.element);
    }
  }
  else { // mouseout
    // remove all hover classes
    this.checkInToolTip.style.display = "none";
    this.checkOutToolTip.style.display = "none";
    if(!this.checkIn) {
      yuiDom.removeClass(params.element, "hoverCheckIn");
    }
    else if(!this.checkOut) {
      yuiDom.removeClass(params.element, "hoverCheckOut");
    }

    if(this.checkIn){
      yuiDom.removeClass(params.element,"hoverCheckIn");
    }
    if(this.checkOut){
      yuiDom.removeClass(params.element,"hoverCheckOut");
    }
  }
}

multiDisplayCalendar.prototype.selectDay = function(e,params) {
    yuiEvent.preventDefault(e);
    var selectedDate = new Date(params.currentDate);

    // validate the selectedDate first
    this.validateSelectedDate(selectedDate);
    if(this.hasError) {
      return;
    }
    // no dates selected, treat as checkin
    if(!(this.checkIn&&this.checkOut)) {
      if(!this.checkIn&&!this.checkOut) {
        this.checkIn = selectedDate;
        this.resetHightlight(this.calendarContainer)
        this.highlight();
      }
      // check-in but no check-out
      else if(this.checkIn && !this.checkOut  && (selectedDate > this.checkIn || selectedDate < this.checkIn)) {
        if(selectedDate > this.checkIn) {
          this.checkOut = selectedDate;
        }
        else {
          this.checkOut = this.checkIn;
          this.checkIn  = selectedDate;
        }
        this.resetHightlight(this.calendarContainer)
        this.highlight();
      }
      // check-out but no check-in
      else if(!this.checkIn && this.checkOut && (selectedDate > this.checkOut || selectedDate < this.checkOut)) {
        if(selectedDate < this.checkOut) {
          this.checkIn = selectedDate;
        }
        else {
          this.checkIn = this.checkOut;
          this.checkOut  = selectedDate;
        }
        this.resetHightlight(this.calendarContainer)
        this.highlight();
      }
      return;
    }
    
    // user selects dates between already selected check in and check out dates
    if((this.checkIn && this.checkOut) && (this.checkIn < selectedDate && this.checkOut > selectedDate)) {
      var daysBetween = Math.round(Math.abs(this.checkOut - this.checkIn)/(1000 * 60 * 60 * 24)) - 1;
      var halfWay = parseInt(daysBetween/2);
      var tempCheckInDate = new Date(this.checkIn.getFullYear(),this.checkIn.getMonth(),this.checkIn.getDate());
      tempCheckInDate = addDays(halfWay,tempCheckInDate);
      if(selectedDate <= tempCheckInDate) {
        this.checkIn = selectedDate;
      }
      else {
        this.checkOut = selectedDate;
      }
    }
    else {
      if(this.checkIn > selectedDate) {
        this.checkIn = selectedDate;
      }
      if(this.checkOut < selectedDate) {
        this.checkOut = selectedDate;
      }
    }
    this.resetHightlight(this.calendarContainer)
    this.highlight();
}

// do all the highlighting logic if any dates are selected, while we're at it, set instructions also
multiDisplayCalendar.prototype.highlight = function() {
  if(this.checkIn) {
    var hightlightElementId = this.checkIn.getFullYear() + "/" + (this.checkIn.getMonth()+1) + "/" + (this.checkIn.getDate())+"_"+this.calendarId;
    yuiDom.addClass(yuiDom.get(hightlightElementId), "selectedCheckIn");
    yuiDom.removeClass(yuiDom.get(hightlightElementId), "validCheckOut");
    yuiDom.removeClass(yuiDom.get(hightlightElementId), "unselected");
    var calCheckIn = this.checkIn;
    this.handleClass("available","div",this.calendarContainer,function(element){
      var elementIdDate = new Date(element.id.split("_")[0]);
      if(!yuiDom.hasClass(element,"selectedCheckIn")) {
        if(elementIdDate > calCheckIn) {
          yuiDom.addClass(element,"validCheckOut");
        }
        else {
          yuiDom.addClass(element, "unselected");
        }
      }
    });
        // Chinese & Japanese language support
    if(this.userLanguage == "zh" || this.userLanguage == "ja") {
        this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions.innerHTML = moLanguageObjCiCo.checkInText + " - " + moLanguageObjCiCo.calendarShortDayNameArray[this.checkIn.getDay()]
        + ", " + this.checkIn.getFullYear()
        + " " + moLanguageObjCiCo.year
        + " " + moLanguageObjCiCo.calendarShortMonthArray[this.checkIn.getMonth()]
        + " " + this.checkIn.getDate()
        + " " + moLanguageObjCiCo.day;
    }
    else {
        this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions.innerHTML = moLanguageObjCiCo.checkInText + " - " + moLanguageObjCiCo.calendarShortDayNameArray[this.checkIn.getDay()]
        + ', ' + this.checkIn.getDate()
        + ' ' + moLanguageObjCiCo.calendarShortMonthArray[this.checkIn.getMonth()]
        + ' ' + this.checkIn.getFullYear()
    }
    this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions.innerHTML += ' ' + '<a href="javascript:void(0);" target="_self" class="resetDateLink" id="resetCheckInDateLink_'+this.calendarId+'">'+moLanguageObjCiCo.resetSelectedDate+'</a>';    // display check in date in check in div


    yuiEvent.addListener(yuiDom.get("resetCheckInDateLink_"+this.calendarId), "click", this.resetCheckInDate,yuiDom.get("resetCheckInDateLink_"+this.calendarId),this);
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions, "active"); // remove active class from check in div
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions, "checkInInstructionsActive");
    yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions, "active");   // apply active class to check out div
    yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions, "checkOutInstructionsActive");   // apply active class to check out div
  }
  else {
    this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions.innerHTML = moLanguageObjCiCo.pickCheckInText;
  }

  if(this.checkOut) {
    var hightlightElementId = this.checkOut.getFullYear() + "/" + (this.checkOut.getMonth()+1) + "/" + (this.checkOut.getDate())+"_"+this.calendarId;
    yuiDom.addClass(yuiDom.get(hightlightElementId), "selectedCheckOut");
    yuiDom.removeClass(yuiDom.get(hightlightElementId), "validCheckOut");
    yuiDom.removeClass(yuiDom.get(hightlightElementId), "unselected");
    yuiDom.removeClass(yuiDom.get(hightlightElementId), "selectedInterval");
    var calCheckOut = this.checkOut;
    this.handleClass("available","div",this.calendarContainer,function(element){
      var elementIdDate = new Date(element.id.split("_")[0]);
      yuiDom.removeClass(element,"validCheckOut");
      if(elementIdDate > calCheckOut) {
        yuiDom.addClass(element,"unselected");
      }
    });
        // Chinese & Japanese language support 
    if(this.userLanguage == "zh" || this.userLanguage == "ja") {
        this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions.innerHTML = moLanguageObjCiCo.checkOutText + " - "
        + moLanguageObjCiCo.calendarShortDayNameArray[this.checkOut.getDay()]
        + ", " + this.checkOut.getFullYear()
        + " " + moLanguageObjCiCo.year
        + " " + moLanguageObjCiCo.calendarShortMonthArray[this.checkOut.getMonth()]
        + " " + this.checkOut.getDate()
        + " " + moLanguageObjCiCo.day;
    }
    else {
        this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions.innerHTML = moLanguageObjCiCo.checkOutText + " - "
        + moLanguageObjCiCo.calendarShortDayNameArray[this.checkOut.getDay()]
        + ', ' + this.checkOut.getDate()
        + ' ' + moLanguageObjCiCo.calendarShortMonthArray[this.checkOut.getMonth()]
        + ' ' + this.checkOut.getFullYear();
    }
    this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions.innerHTML += ' '
    + '<a href="javascript:void(0);" target="_self" class="resetDateLink" id="resetCheckOutDateLink_'
    + this.calendarId +'">'
    +moLanguageObjCiCo.resetSelectedDate+'</a>';      // display check out date in check in div

    yuiEvent.addListener(yuiDom.get("resetCheckOutDateLink_"+this.calendarId), "click", this.resetCheckOutDate,yuiDom.get("resetCheckOutDateLink_"+this.calendarId),this);
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions, "active"); // remove active class from check in div
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions, "checkOutInstructionsActive"); // remove active class from check in div
  }
  else {
    this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions.innerHTML = moLanguageObjCiCo.pickCheckOutText;
  }

  if(this.checkIn && this.checkOut) {
    yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions, "active");   // apply active class to check out div
    yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions, "submitInstructionsActive");   // apply active class to check out div
    this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.appendChild(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.continueButton);
    var daysBetween = Math.round(Math.abs(this.checkOut - this.checkIn)/(1000 * 60 * 60 * 24)) - 1;
    var  tempDate = new Date(this.checkIn.getFullYear(), this.checkIn.getMonth(), this.checkIn.getDate())
    for(var i = 1; i <= daysBetween; i++) {
      tempDate = addDays(1,tempDate);
      var highlightInterval = tempDate.getFullYear() + "/" + (tempDate.getMonth()+1) + "/" + (tempDate.getDate())+"_"+this.calendarId;
      yuiDom.addClass(yuiDom.get(highlightInterval),"selectedInterval");
      yuiDom.removeClass(yuiDom.get(highlightInterval),"validCheckOut");
      yuiDom.removeClass(yuiDom.get(highlightInterval),"unselected");
    }
  }
  else {
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions, "active");   // apply active class to check out div
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions, "submitInstructionsActive");   // apply active class to check out div
    if(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.continueButton.parentNode == this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions) {
      this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.removeChild(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.continueButton);
    }
    if(!this.checkIn && !this.checkOut) {
      yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions, "active");   // apply active class to check out div
      yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions, "checkInInstructionsActive");   // apply active class to check out div
    }
  }
}

multiDisplayCalendar.prototype.resetHightlight = function(monthElement) {
  this.handleClass("day","div",monthElement,function(element) {
      yuiDom.removeClass(element,"validCheckOut");
      yuiDom.removeClass(element,"selectedCheckIn");
      yuiDom.removeClass(element,"selectedCheckOut");
      yuiDom.removeClass(element,"selectedInterval");
      yuiDom.removeClass(element,"unselected");
  });
}

multiDisplayCalendar.prototype.validateCalendar = function(pFromContinue){
    this.hasError = false;
    this.errorArray = new Array();

    if(this.checkIn){
      if(this.checkIn > this.settings.limitDate){
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[1];
        this.hasError = true;
      }
      if(this.checkIn < this.settings.today){
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[2];
        this.hasError = true;
      }
    }

    if(this.checkIn && this.checkOut){
      if(this.checkOut > this.settings.limitDate && this.checkIn < this.settings.limitDate){
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[1];
        this.hasError = true;
      }
      if(this.getLengthOfStay(this.checkIn, this.checkOut) > this.settings.maxBookDays){
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[0];
        this.hasError = true;
      }
      if(this.checkOut < this.checkIn){
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[3];
        this.hasError = true;
      }
      if(this.checkIn == this.checkOut){
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[4];
        this.hasError = true;
      }
    }


    if(pFromContinue){
      if(!this.checkIn){
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[5];
        this.hasError = true;
      }
      else if(!this.checkOut){
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[6];
        this.hasError = true;
      }
    }
    this.renderErrors(pFromContinue);
}
   
multiDisplayCalendar.prototype.validateSelectedDate = function(selectedDate) {
    var selectedRange = null;

    if(this.checkIn&&!this.checkOut) {
      if(selectedDate > this.checkIn) {
        selectedRange = this.getLengthOfStay(this.checkIn, selectedDate);
      }
      else {
        selectedRange = this.getLengthOfStay(selectedDate, this.checkIn);
      }
      if(selectedRange > this.settings.maxBookDays) {
        this.errorArray = new Array();
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[0];
        this.hasError = true;
        this.renderErrors();
        return;
      }
    }

    if(this.checkOut&&!this.checkIn) {
      if(selectedDate > this.checkOut) {
        selectedRange = this.getLengthOfStay(this.checkOut,selectedDate);
      }
      else {
        selectedRange = this.getLengthOfStay(selectedDate,this.checkOut);
      }
      if(selectedRange>this.settings.maxBookDays) {
        this.errorArray = new Array();
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[0];
        this.hasError = true;
        this.renderErrors();
        return;
      }
    }

    if(this.checkIn && this.checkOut) {
      if(selectedDate < this.checkOut) {
        selectedRange = this.getLengthOfStay(selectedDate, this.checkOut);
      }
      else if(selectedDate > this.checkIn) {
        selectedRange = this.getLengthOfStay(selectedDate, this.checkIn);
      }
      if(selectedRange>this.settings.maxBookDays) {
        this.errorArray = new Array();
        this.errorArray[this.errorArray.length] = moLanguageObjCiCo.errorArray[0];
        this.hasError = true;
        this.renderErrors();
        return;
      }
    }
    this.errorMessageDiv.innerHTML = "";
    this.errorMessageDiv.style.visibility = 'hidden';
    this.hasError = false;
}

multiDisplayCalendar.prototype.renderErrors = function(pFromContinue){
//    this.validateCalendar(pFromContinue);

    if(this.hasError){
        var lsOutput = '';
        for(var i=0; i<this.errorArray.length; i++){
            lsOutput += '<div>' + this.errorArray[i] +' </div>'
        }
        this.errorMessageDiv.innerHTML = lsOutput;
        this.errorMessageDiv.style.visibility = 'visible';
    }
    else{
       this.errorMessageDiv.style.visibility = 'hidden';
       this.errorMessageDiv.innerHTML = '';
    }
}

multiDisplayCalendar.prototype.resetCheckInDate = function(e) {
  this.checkIn = null;
  this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions.innerHTML = moLanguageObjCiCo.pickCheckInText;
  this.resetHightlight(this.calendarContainer);
  this.highlight();
  yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions,"active");
  yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions,"checkInInstructionsActive");
  yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions,"active");
  yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions,"checkOutInstructionsActive");
  yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions,"active");
  yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions,"submitInstructionsActive");
}

multiDisplayCalendar.prototype.resetCheckOutDate = function(e) {
  this.checkOut = null;
  this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions.innerHTML = moLanguageObjCiCo.pickCheckOutText;

  this.resetHightlight(this.calendarContainer);
  this.highlight();
  if(this.checkIn) {
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions,"active");
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions,"checkInInstructionsActive");
    yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions,"active");
    yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions,"checkOutInstructionsActive");
  }
  else {
    yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions,"active");
    yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions,"checkInInstructionsActive");
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions,"active");
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions,"checkOutInstructionsActive");
  }
  yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions,"active");
  yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions,"submitInstructionsActive");
}

multiDisplayCalendar.prototype.resetInstructionDisplay = function() {

  if(!this.checkOut) {
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions,"active");
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions,"checkOutInstructionsActive");
  }
  if(this.checkIn && this.checkOut) {
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions,"active");
    yuiDom.removeClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions,"submitInstructionsActive");
    if(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.continueButton.parentNode == this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions) {
      this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.removeChild(this.calendarContainer.menuHolder.travelDateHolder.instructions.submitInstructions.continueButton);
    }
  }
  yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions,"active");
  yuiDom.addClass(this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions,"checkInInstructionsActive");

  this.calendarContainer.menuHolder.travelDateHolder.instructions.checkInInstructions.innerHTML = moLanguageObjCiCo.pickCheckInText;
  this.calendarContainer.menuHolder.travelDateHolder.instructions.checkOutInstructions.innerHTML = moLanguageObjCiCo.pickCheckOutText;

}

multiDisplayCalendar.prototype.reset = function(e) {
    yuiEvent.preventDefault(e);
    this.resetInstructionDisplay(); // !!! important that this comes before object clearing
    this.clearObject();
    this.renderCalDisplay();
}

// Availability Calendar method to clear the calendar object, used in "Reset"
multiDisplayCalendar.prototype.clearObject = function(){
  this.hasError           = null;
  this.errorMessageDiv.innerHTML = "";
  this.errorMessageDiv.style.visibility = 'hidden';
  this.errorArray         = null;
  this.checkIn            = null;
  this.checkOut           = null;
  this.renderedMonths     = {};
}

multiDisplayCalendar.prototype.close = function() {
    this.toggleDisplay();
}

multiDisplayCalendar.prototype.submit = function(e){
    yuiEvent.preventDefault(e);
    this.renderErrors(true);
    if(!this.hasError){
      this.returnFunction(this.checkIn, this.checkOut, true);
      this.close();
    }
}

var calendarMonthHeaderBackground = new Image();
calendarMonthHeaderBackground.src = "/whotels/images/calendar/monthHeaderBackground.gif";
function getFormatedDate(local, theDate) {

	var sDateFormat	= "";



	var sTheMonth	= theDate.getMonth() + 1;

	sTheMonth		= ((sTheMonth) <= 9) ? "0" + sTheMonth : sTheMonth;



	var sTheDay		= theDate.getDate();

	sTheDay			= (sTheDay <= 9) ? "0" + sTheDay : sTheDay;

	var nTheYear	= theDate.getFullYear();





	if (local == "ja" || local == "zh") {

		// FORMAT: YYYY/MM/DD

		//sDateFormat = nTheYear + "/" + sTheMonth + "/" + sTheDay;
		sDateFormat = String(nTheYear).substr(2,2) + "\u5E74" + sTheMonth  + "\u6708" + sTheDay  + "\u65E5";

	} else if ((local == "es") || (local == "fr") || (local == "it") || (local == "pt")) {

		// FORMAT: DD/MM/YYYY

		sDateFormat = sTheDay + "/" + sTheMonth + "/" + nTheYear;

	} else if (local == "de") {
        sDateFormat = sTheDay + "." + sTheMonth + "." + nTheYear;    
    } else {
		// FORMAT: MM/DD/YYYY

		sDateFormat = sTheMonth + "/" + sTheDay + "/" + nTheYear;

	}

	return sDateFormat;

}



function setDateFromString(local, theDate) {
    if(local.length>2) {
        local = local.split("_")[0];
    }
	var theDateObject   = null;
	var theDateArray    = theDate.split("/");
	if (local == "ja" || local=="zh") {
		// FORMAT: YYYY/MM/DD
        theDateArray    = theDate.split(" ");
		//theDateObject = new Date(theDateArray[0].substr(0,4), theDateArray[1].substr(0,2)-1, theDateArray[2].substr(0,2));
		if(theDate != "") {
			theDateObject = new Date("20"+theDate.substr(0,2), theDate.substr(3,2)-1, theDate.substr(6,2));
		}
	} else if ((local == "es") || (local == "fr") || (local == "it") || (local == "pt")) {
		// FORMAT: DD/MM/YYYY
		theDateObject = new Date(theDateArray[2], theDateArray[1]-1, theDateArray[0]);
	} else if (local == "de") {
        theDateArray    = theDate.split(".");
        theDateObject = new Date(theDateArray[2], theDateArray[1]-1, theDateArray[0]);
    } else {
		// FORMAT: MM/DD/YYYY
		theDateObject = new Date(theDateArray[2], theDateArray[0]-1, theDateArray[1]);
	}
	//alert("theDateObject: " + theDateObject);
	if ((theDateObject == "Invalid Date") || (isNaN(theDateObject))) {
		theDateObject = null;
	}
	return theDateObject;
}



/*

This function is necessary because as of now the multiDisplayCalendar.js needs an empty form to process the curent dates

*/

function fnClearFormField(pDate) {

	if ((pDate == "MM/DD/YYYY") || (pDate == "DD/MM/AAAA") || (pDate == "JJ/MM/AAAA") ||(pDate == "GG/MM/AAAA")
        || (pDate == "TT.MM.JJJJ") || (pDate="YY\u5E74MM\u6708DD\u65E5")) {
        pDate = "";
	}
	return pDate;
}

function fnGetDisplayDate(pDateToFormat){
    var lsFormatDate = null;
    if(pDateToFormat){
        var loDate = new Date(pDateToFormat);
        //var lsYear = loDate.getFullYear().toString().substring(2,4);
        var lsYear = loDate.getFullYear();
        var lsMonth = moLanguageObj.calendarShortMonthArray[loDate.getMonth()]
        lsFormatDate = loDate.getDate() + ' ' + lsMonth + ' ' + lsYear;
    }
    return lsFormatDate;
}

function padZero(pNumber) {
  return (pNumber<0 || pNumber>9 ? "" : "0") + pNumber;
}

function fnGetDateDifference(pCIDay, pCODay){
    var loStartDate = new Date(pCIDay);
    var loEndDate = new Date(pCODay);
    var lnDayDiff = Math.round((loEndDate.getTime() - loStartDate.getTime()) / (1000 * 60 * 60 * 24));
    return Math.abs(lnDayDiff);
}

(function (){
    var yuiDom = YAHOO.util.Dom;

    var yuiEvent = YAHOO.util.Event;

    var SearchFormHandler = (function () {
        var searchForm = null;
        var localeCode = "en_US";
        var dateInputs = null;
        var standardInputs = null;
        var loadingText = "Loading...";
        var cityText = "City";
        var self = {
            initialize: function(params) {
                localeCode = params.localeCode || localeCode;
                loadingText = params.loadingText || loadingText;
                cityText = params.cityText || cityText;
                searchForm = yuiDom.get("findAndBookForm");
                yuiEvent.addListener("fnb_closeErrorIcon","click",function() {
                    yuiDom.setStyle("findAndBookForm_errorContainer", "display", "none");
                });

                dateInputs = {
                    arrivalDate: yuiDom.get("fnb_arrivalDate"),
                    departureDate: yuiDom.get("fnb_departureDate")
                };

                if(localeCode == "zh_CN" || localeCode == "ja_JP") {
                    standardInputs = {
                        city: yuiDom.get("fnb_citySelect"),
                        state: yuiDom.get("fnb_stateSelect"),
                        country: yuiDom.get("fnb_countrySelect")
                    };
                    yuiEvent.addListener(standardInputs.country,"change",self.checkState, {countrySelect: standardInputs.country, stateSelect: standardInputs.state, citySelect: standardInputs.city});
                    yuiEvent.addListener(standardInputs.state,"change",self.getCities);
                }
            },
            getCities: function () {
                standardInputs.city.disabled = true;
                yuiConnect.asyncRequest("GET", "/dp/en_US/common/search/get_cities.jsp?country="
                    + standardInputs.country.value
                    + "&state="
                    + (standardInputs.state.selectedIndex > 0 ? standardInputs.state.value : ""),
                    {
                        success: self.populateSelect
                    }
                );
                standardInputs.city.options[0].text = loadingText;
            },
            populateSelect: function (xhr) {
                var selectOptions = xhr.responseXML.getElementsByTagName("city");

                standardInputs.city.options.length = 1;
                standardInputs.city.selectedIndex = 0;
                standardInputs.city.options[0].text = cityText;
                if (selectOptions.length > 0) {
                    standardInputs.city.disabled = false;
                    for (var i = 0; i < selectOptions.length; i++) {
                        var selected = false;
                        standardInputs.city.options[standardInputs.city.options.length] = new Option(selectOptions[i].firstChild.nodeValue, selectOptions[i].getAttribute("en"), selected);
                    }
                }
            },
            updateCountry: function () {

            },
            checkState: function(e, params) {
                if(params.countrySelect.value == "US" || params.countrySelect.value == "CA") {
                    params.stateSelect.disabled = false;
                    params.citySelect.disabled = true;
                }
                else {
                    params.stateSelect.selectedIndex = 1;
                    params.stateSelect.value = "";
                    params.stateSelect.disabled = true;
                    self.getCities();
                }
            },
            validateForm: function (e,searchForm) {
              //  searchForm.resetErrors();
                yuiDom.getElementsByClassName("topError","li","fnb_Errors").forEach(function(errorBlock){
                    yuiDom.setStyle(errorBlock, "display", "none");
                });
                var errors = false;
                if(searchForm.complexSearchField && (searchForm.complexSearchField.value == "" || searchForm.complexSearchField.value == searchForm.complexSearchField.getAttribute("label"))) {
                    yuiDom.setStyle("fnb_searchCriteriaRequiredError", "display", "block");
                    errors = true;
                }
                else if(localeCode == "ja_JP" || localeCode == "zh_CN") {
                     if((standardInputs.country.value == "")) {
                        yuiDom.setStyle("fnb_searchCriteriaRequiredError", "display", "block");
                        errors = true;
                        }
                }
                if ((dateInputs.arrivalDate.value != "" && dateInputs.departureDate.value != "") && (dateInputs.arrivalDate.value != dateFormatString || dateInputs.departureDate.value != dateFormatString)) {
                    var checkIn = new validDate(dateInputs.arrivalDate);
                    var checkOut = new validDate(dateInputs.departureDate);
                    var datesDelta = checkIn.diffDate(checkOut.d);
                    if (!(checkIn.valid) && (!checkOut.valid)) {
                        yuiDom.setStyle("fnb_ciAnddepartureDatesInvalidError", "display", "block");
                        errors = true;
                    }
                    else if (!checkIn.valid) {
                        yuiDom.setStyle("fnb_arrivalDateInvalidError", "display", "block");
                        errors = true;
                    }
                    else if (!checkOut.valid) {
                        yuiDom.setStyle("fnb_departureDateInvalidError", "display", "block");
                        errors = true;
                    }
                    else if ((checkIn.valid) & (checkOut.valid)) {
                        datesDelta = checkIn.diffDate(checkOut.d);
                        var nowDelta = checkIn.diffDate(new Date());
                        if (nowDelta > 0) {

                        }
                        else if (nowDelta < -548) {
                            yuiDom.setStyle("fnb_bookToFarInFutureError", "display", "block");
                            errors = true;
                        }
                        else if (datesDelta < 0) {
                            yuiDom.setStyle("fnb_departureBeforeArrivalError", "display", "block");
                            errors = true;
                        }
                        else if (datesDelta > 90) {
                            yuiDom.setStyle("fnb_maximumLengthStayExceededError", "display", "block");
                            errors = true;
                        }
                        else if (datesDelta < 1) {
                            yuiDom.setStyle("fnb_arrivalEqualsDepartureError", "display", "block");
                            errors = true;
                        }
                    }
                }

                if(errors) {
                    yuiDom.setStyle("findAndBookForm_errorContainer", "display", "block");
                    yuiEvent.stopPropagation(e);
                }
                return !errors;
            }
        };

        return self;
    })();
    YAHOO.namespace("SW.local.SearchFormHandler");
    SW.local.SearchFormHandler = SearchFormHandler;
})();


(function() {
    var yuiDom = YAHOO.util.Dom;

    var yuiEvent = YAHOO.util.Event;

    var DEFAULT_CONFIG = {
        arrivalDateInput: null,
        departureDateInput: null,
        calendarIcon: null,
        localeCode: "en_US",
        dateFormatString: "MM/DD/YYYY"
    };

    function CalendarMaker (config) {

        if(!config.calendarId){
            throw("no calendarId supplied");
        }

        if(!config.arrivalDateInput){
            throw("no arrivalDateInput supplied");
        }

        if(!config.departureDateInput){
            throw("no departureDateInput supplied");
        }

        if(!config.calendarIcon){
            throw("no calendarIcon supplied");
        }

        for(var prop in DEFAULT_CONFIG){
            if(!config.hasOwnProperty(prop)){
                config[prop] = DEFAULT_CONFIG[prop];
            }
        }

        var calendar = null;
        var arrivalDateInput = config.arrivalDateInput;
        var departureDateInput = config.departureDateInput;
        var calendarIcon = config.calendarIcon;
        var localeCode = config.localeCode || localeCode;
        localeCode = localeCode.split("_")[0];
        var dateFormatString = config.dateFormatString || dateFormatString;

        function getArrivalDate () {
            return setDateFromString(localeCode, arrivalDateInput.value);
        }

        function getDepartureDate () {
            return setDateFromString(localeCode, departureDateInput.value);
        }

        function setDates (arrivalDate, departureDate, fromContinue) {
            arrivalDateInput.value = getFormatedDate(localeCode, arrivalDate);
            yuiDom.removeClass(arrivalDateInput, "hasDefaultText");
            departureDateInput.value = getFormatedDate(localeCode, departureDate);
            yuiDom.removeClass(departureDateInput, "hasDefaultText");
            if (!fromContinue) {
                closeCalendar();
            }
        }

        function checkArrivalDateFocus () {
            if (arrivalDateInput.value == dateFormatString) {
                arrivalDateInput.value = "";
                return;
            }
            var checkIn = new validDate(arrivalDateInput);
            if (!checkIn.valid) {
                arrivalDateInput.value = "";
            }
        }

        function checkArrivalDateBlur () {
            var checkIn = new validDate(arrivalDateInput);
            if (checkIn.valid) {
                checkIn.setField();
                var isValid = true;
                if (departureDateInput.value == dateFormatString) {
                    isValid = false;
                }
                var checkOut = validDate(departureDateInput);
                var before;
                if (!isValid) {
                    departureDateInput.value = dateFormatString;
                }
                if (checkOut.valid) {
                    before = (checkIn.diffDate(checkOut.d) <= 0);
                }

                if (departureDateInput.value == dateFormatString) {
                    checkOut.valid = false;
                }
                if ((! (checkOut.valid)) || before) {
                    checkOut.setD(checkIn.d);
                    checkOut.nextDay();
                    checkOut.setField();
                    yuiDom.removeClass(departureDateInput, "hasDefaultText");
                }
            } else {
                arrivalDateInput.value = dateFormatString;
            }
        }

        function checkDepartureDateFocus () {
            if (departureDateInput.value == dateFormatString) {
                departureDateInput.value = "";
                return;
            }
            var checkOut = new validDate(departureDateInput);
            if (!checkOut.valid) {
                departureDateInput.value = "";
            }
        }

        function checkDepartureDateBlur () {
            var checkOut = new validDate(departureDateInput);
            if (checkOut.valid) {
                checkOut.setField();
            } else {
                departureDateInput.value = dateFormatString;
            }
        }

        var self = {
            toggleCalendar: function (e, calendarPos) {
                if(!calendarPos) {
                    var coords = yuiDom.getXY(this);
                    calendarPos = (coords[0] - 450) + "," + (coords[1] + 20);
                }
                calendar.show(this, calendarPos);
                var e = e || window.event;
                e.cancelBubble = true;
                if (e.stopPropagation) e.stopPropagation();
            },
            closeCalendar: function () {
                if (calendar) {
                    if (calendar.display == "block") {
                        calendar.toggleDisplay();
                    }
                }
            }
        };

        calendar = new multiDisplayCalendar(config.calendarId,
            getArrivalDate,
            getDepartureDate,
            setDates, null);

        yuiEvent.addListener(calendarIcon, "click", self.toggleCalendar, config.calendarPos);
        yuiEvent.addListener(arrivalDateInput, "focus", checkArrivalDateFocus);
        yuiEvent.addListener(arrivalDateInput, "blur", checkArrivalDateBlur);
        yuiEvent.addListener(departureDateInput, "focus", checkDepartureDateFocus);
        yuiEvent.addListener(departureDateInput, "blur", checkDepartureDateBlur);

        return self;
    }

    SW.local.CalendarMaker = function(config){
        return new CalendarMaker(config);
    };

    YAHOO.namespace("SW.local.CalendarMaker");
})();


//SAMPLE USE
// see: /common/js/search/result_map.js
//function ajax_onSubmit() {
//	address = encodeURI(document.moveMap.address.value);
//	addressAjax = new ajax();
//	addressAjax.setURL("/ajax/strutsname");
//	addressAjax.addParameter("name", "value");
//	addressAjax.setSuccessHandler(localFunctionThatTakesAReq);
//	addressAjax.setFailureHandler(localFunctionThatTakesAReq);
//	addressAjax.execute();
//}

function ajax() {

    var req;

    var debugMode = false;
    if (location.search.indexOf("debugAjax") > -1) {
        debugMode = true;
    }
    this.setDebugMode = function(b) {
		debugMode = b;
	}

    this.defaultErrorHandler = function(req){
		window.alert("An Error Occured");
	}

	this.defaultSuccessHandler = function(req){
		window.alert("Request Complete");
	}

	this.defaultLoadingHandler = function(req){
	}

	var url = "";
	this.setURL = function(s) {
		this.url = s;
	}

	//parameters should be stored in an array and then added during request creation
    var parameters = new Array();
    this.addParameter = function(n,v) {
        nVP = new nameValuePair(n,v);
        parameters[parameters.length] = nVP;
	}
    this.buildQueryString = function() {
        var queryString = "";
        for (i = 0; i < parameters.length; i++) {
            if (i > 0) { queryString = queryString + "&"; }
            nVP = parameters[i];
            queryString = queryString + nVP.name + "=" + nVP.value;
        }
        return queryString;
    }

    var successHandler = this.defaultSuccessHandler;
	this.setSuccessHandler = function(f) {
		successHandler = f;
	}

	var failureHandler = this.defaultErrorHandler;
	this.setFailureHandler = function(f) {
		failureHandler = f;
	}
	var loadingHandler = this.defaultLoadingHandler;
	this.setLoadingHandler = function(f) {
		loadingHandler = f;
	}
	var timeStampURL = true;
	this.setTimeStampURL = function(b) {
		timeStampURL = b;
	}
	this.execute = function() {

		if (this.url=="") { window.alert("URL MUST BE SET");  return false;}

		if (timeStampURL) {
			this.addParameter("timestamp", new Date().getTime());
		}

		requestUrl = this.url
		if (this.queryString != "") {
			requestUrl = requestUrl + "?" + this.buildQueryString();
		}

		if (debugMode) {
			window.open(requestUrl, "AJAX_WINDOW", 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=600,height=600');
		}
		// branch for native XMLHttpRequest object
		if (window.XMLHttpRequest) {
			req = new XMLHttpRequest();
			req.onreadystatechange = this.processRequestChange;
			req.open("GET", requestUrl, true);
			req.send(null);
		// branch for IE/Windows ActiveX version
		} else if (window.ActiveXObject) {
			req = new ActiveXObject("Microsoft.XMLHTTP");
			if (req) {
				req.onreadystatechange = this.processRequestChange;
				req.open("GET", requestUrl, true);
				req.send();
			}
		// The browser cannot support dynamic loading - say so
		} else {
			window.alert('Feature Not Supported By Your Browser');
		}
	}
	this.processRequestChange = function() {
		if (debugMode) {
			//window.alert("Request readyState:" +req.readyState);
		}
		if (req.readyState == 1) {
			loadingHandler(req);
		}
		// only if req shows "loaded"
		if (req.readyState == 4) {
			// only if "OK"
			if (req.status == 200) {
				successHandler(req);
			} else {
				failureHandler(req);
			}
		}
	}
}

function nameValuePair(n, v) {
    this.name = n;
    this.value = v;
}

function getSubNodeValue(node, tagname) {
	subNode = node.getElementsByTagName(tagname);
	if (subNode[0] != null) {
		if(subNode[0].firstChild != null) {
			return subNode[0].firstChild.nodeValue;
		}
	}
	return "";
}
Error 500: Cannot forward. Response already committed.

