]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/javascript/sugar_grp1_yui.js
Release 6.2.0
[Github/sugarcrm.git] / include / javascript / sugar_grp1_yui.js
1 /*
2 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.net/yui/license.txt
5 version: 2.8.0r4
6 */
7 if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=(""+A[C]).split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules,B,H,G,F,C;if(!I[A]){I[A]={versions:[],builds:[]};}B=I[A];H=D.version;G=D.build;F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var D=function(H){var I=0;return parseFloat(H.replace(/\./g,function(){return(I++==1)?"":".";}));},G=navigator,F={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:G.cajaVersion,secure:false,os:null},C=navigator&&navigator.userAgent,E=window&&window.location,B=E&&E.href,A;F.secure=B&&(B.toLowerCase().indexOf("https")===0);if(C){if((/windows|win32/i).test(C)){F.os="windows";}else{if((/macintosh/i).test(C)){F.os="macintosh";}}if((/KHTML/).test(C)){F.webkit=1;}A=C.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){F.webkit=D(A[1]);if(/ Mobile\//.test(C)){F.mobile="Apple";}else{A=C.match(/NokiaN[^\/]*/);if(A){F.mobile=A[0];}}A=C.match(/AdobeAIR\/([^\s]*)/);if(A){F.air=A[0];}}if(!F.webkit){A=C.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){F.opera=D(A[1]);A=C.match(/Opera Mini[^;]*/);if(A){F.mobile=A[0];}}else{A=C.match(/MSIE\s([^;]*)/);if(A&&A[1]){F.ie=D(A[1]);}else{A=C.match(/Gecko\/([^\s]*)/);if(A){F.gecko=1;A=C.match(/rv:([^\s\)]*)/);if(A&&A[1]){F.gecko=D(A[1]);}}}}}}return F;}();(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 B=YAHOO.lang,A=Object.prototype,H="[object Array]",C="[object Function]",G="[object Object]",E=[],F=["toString","valueOf"],D={isArray:function(I){return A.toString.apply(I)===H;},isBoolean:function(I){return typeof I==="boolean";},isFunction:function(I){return(typeof I==="function")||A.toString.apply(I)===C;},isNull:function(I){return I===null;},isNumber:function(I){return typeof I==="number"&&isFinite(I);},isObject:function(I){return(I&&(typeof I==="object"||B.isFunction(I)))||false;},isString:function(I){return typeof I==="string";},isUndefined:function(I){return typeof I==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(K,J){var I,M,L;for(I=0;I<F.length;I=I+1){M=F[I];L=J[M];if(B.isFunction(L)&&L!=A[M]){K[M]=L;}}}:function(){},extend:function(L,M,K){if(!M||!L){throw new Error("extend failed, please check that "+"all dependencies are included.");}var J=function(){},I;J.prototype=M.prototype;L.prototype=new J();L.prototype.constructor=L;L.superclass=M.prototype;if(M.prototype.constructor==A.constructor){M.prototype.constructor=M;}if(K){for(I in K){if(B.hasOwnProperty(K,I)){L.prototype[I]=K[I];}}B._IEEnumFix(L.prototype,K);}},augmentObject:function(M,L){if(!L||!M){throw new Error("Absorb failed, verify dependencies.");}var I=arguments,K,N,J=I[2];if(J&&J!==true){for(K=2;K<I.length;K=K+1){M[I[K]]=L[I[K]];}}else{for(N in L){if(J||!(N in M)){M[N]=L[N];}}B._IEEnumFix(M,L);}},augmentProto:function(L,K){if(!K||!L){throw new Error("Augment failed, verify dependencies.");}var I=[L.prototype,K.prototype],J;for(J=2;J<arguments.length;J=J+1){I.push(arguments[J]);}B.augmentObject.apply(this,I);},dump:function(I,N){var K,M,P=[],Q="{...}",J="f(){...}",O=", ",L=" => ";if(!B.isObject(I)){return I+"";}else{if(I instanceof Date||("nodeType" in I&&"tagName" in I)){return I;}else{if(B.isFunction(I)){return J;}}}N=(B.isNumber(N))?N:3;if(B.isArray(I)){P.push("[");for(K=0,M=I.length;K<M;K=K+1){if(B.isObject(I[K])){P.push((N>0)?B.dump(I[K],N-1):Q);}else{P.push(I[K]);}P.push(O);}if(P.length>1){P.pop();}P.push("]");}else{P.push("{");for(K in I){if(B.hasOwnProperty(I,K)){P.push(K+L);if(B.isObject(I[K])){P.push((N>0)?B.dump(I[K],N-1):Q);}else{P.push(I[K]);}P.push(O);}}if(P.length>1){P.pop();}P.push("}");}return P.join("");},substitute:function(Y,J,R){var N,M,L,U,V,X,T=[],K,O="dump",S=" ",I="{",W="}",Q,P;for(;;){N=Y.lastIndexOf(I);if(N<0){break;}M=Y.indexOf(W,N);if(N+1>=M){break;}K=Y.substring(N+1,M);U=K;X=null;L=U.indexOf(S);if(L>-1){X=U.substring(L+1);U=U.substring(0,L);}V=J[U];if(R){V=R(U,V,X);}if(B.isObject(V)){if(B.isArray(V)){V=B.dump(V,parseInt(X,10));}else{X=X||"";Q=X.indexOf(O);if(Q>-1){X=X.substring(4);}P=V.toString();if(P===G||Q>-1){V=B.dump(V,parseInt(X,10));}else{V=P;}}}else{if(!B.isString(V)&&!B.isNumber(V)){V="~-"+T.length+"-~";T[T.length]=K;}}Y=Y.substring(0,N)+V+Y.substring(M+1);}for(N=T.length-1;N>=0;N=N-1){Y=Y.replace(new RegExp("~-"+N+"-~"),"{"+T[N]+"}","g");}return Y;},trim:function(I){try{return I.replace(/^\s+|\s+$/g,"");}catch(J){return I;}},merge:function(){var L={},J=arguments,I=J.length,K;for(K=0;K<I;K=K+1){B.augmentObject(L,J[K],true);}return L;},later:function(P,J,Q,L,M){P=P||0;J=J||{};var K=Q,O=L,N,I;if(B.isString(Q)){K=J[Q];}if(!K){throw new TypeError("method undefined");}if(O&&!B.isArray(O)){O=[L];}N=function(){K.apply(J,O||E);};I=(M)?setInterval(N,P):setTimeout(N,P);return{interval:M,cancel:function(){if(this.interval){clearInterval(I);}else{clearTimeout(I);}}};},isValue:function(I){return(B.isObject(I)||B.isString(I)||B.isNumber(I)||B.isBoolean(I));}};B.hasOwnProperty=(A.hasOwnProperty)?function(I,J){return I&&I.hasOwnProperty(J);}:function(I,J){return !B.isUndefined(I[J])&&I.constructor.prototype[J]!==I[J];};D.augmentObject(B,D,true);YAHOO.util.Lang=B;B.augment=B.augmentProto;YAHOO.augment=B.augmentProto;YAHOO.extend=B.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.8.0r4",build:"2449"});
8 // End of File include/javascript/yui/build/yahoo/yahoo-min.js
9                                 
10 /*
11 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
12 Code licensed under the BSD License:
13 http://developer.yahoo.net/yui/license.txt
14 version: 2.8.0r4
15 */
16 (function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var E=YAHOO.util,L=YAHOO.lang,m=YAHOO.env.ua,A=YAHOO.lang.trim,d={},h={},N=/^t(?:able|d|h)$/i,X=/color$/i,K=window.document,W=K.documentElement,e="ownerDocument",n="defaultView",v="documentElement",t="compatMode",b="offsetLeft",P="offsetTop",u="offsetParent",Z="parentNode",l="nodeType",C="tagName",O="scrollLeft",i="scrollTop",Q="getBoundingClientRect",w="getComputedStyle",a="currentStyle",M="CSS1Compat",c="BackCompat",g="class",F="className",J="",B=" ",s="(?:^|\\s)",k="(?= |$)",U="g",p="position",f="fixed",V="relative",j="left",o="top",r="medium",q="borderLeftWidth",R="borderTopWidth",D=m.opera,I=m.webkit,H=m.gecko,T=m.ie;E.Dom={CUSTOM_ATTRIBUTES:(!W.hasAttribute)?{"for":"htmlFor","class":F}:{"htmlFor":"for","className":g},DOT_ATTRIBUTES:{},get:function(z){var AB,x,AA,y,Y,G;if(z){if(z[l]||z.item){return z;}if(typeof z==="string"){AB=z;z=K.getElementById(z);G=(z)?z.attributes:null;if(z&&G&&G.id&&G.id.value===AB){return z;}else{if(z&&K.all){z=null;x=K.all[AB];for(y=0,Y=x.length;y<Y;++y){if(x[y].id===AB){return x[y];}}}}return z;}if(YAHOO.util.Element&&z instanceof YAHOO.util.Element){z=z.get("element");}if("length" in z){AA=[];for(y=0,Y=z.length;y<Y;++y){AA[AA.length]=E.Dom.get(z[y]);}return AA;}return z;}return null;},getComputedStyle:function(G,Y){if(window[w]){return G[e][n][w](G,null)[Y];}else{if(G[a]){return E.Dom.IE_ComputedStyle.get(G,Y);}}},getStyle:function(G,Y){return E.Dom.batch(G,E.Dom._getStyle,Y);},_getStyle:function(){if(window[w]){return function(G,y){y=(y==="float")?y="cssFloat":E.Dom._toCamel(y);var x=G.style[y],Y;if(!x){Y=G[e][n][w](G,null);if(Y){x=Y[y];}}return x;};}else{if(W[a]){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(Y){}}return x/100;case"float":y="styleFloat";default:y=E.Dom._toCamel(y);x=G[a]?G[a][y]:null;return(G.style[y]||x);}};}}}(),setStyle:function(G,Y,x){E.Dom.batch(G,E.Dom._setStyle,{prop:Y,val:x});},_setStyle:function(){if(T){return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){switch(x){case"opacity":if(L.isString(Y.style.filter)){Y.style.filter="alpha(opacity="+y*100+")";if(!Y[a]||!Y[a].hasLayout){Y.style.zoom=1;}}break;case"float":x="styleFloat";default:Y.style[x]=y;}}else{}};}else{return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){if(x=="float"){x="cssFloat";}Y.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(){if(K[v][Q]){return function(y){var z,Y,AA,AF,AE,AD,AC,G,x,AB=Math.floor,AG=false;if(E.Dom._canPosition(y)){AA=y[Q]();AF=y[e];z=E.Dom.getDocumentScrollLeft(AF);Y=E.Dom.getDocumentScrollTop(AF);AG=[AB(AA[j]),AB(AA[o])];if(T&&m.ie<8){AE=2;AD=2;AC=AF[t];if(m.ie===6){if(AC!==c){AE=0;AD=0;}}if((AC===c)){G=S(AF[v],q);x=S(AF[v],R);if(G!==r){AE=parseInt(G,10);}if(x!==r){AD=parseInt(x,10);}}AG[0]-=AE;AG[1]-=AD;}if((Y||z)){AG[0]+=z;AG[1]+=Y;}AG[0]=AB(AG[0]);AG[1]=AB(AG[1]);}else{}return AG;};}else{return function(y){var x,Y,AA,AB,AC,z=false,G=y;if(E.Dom._canPosition(y)){z=[y[b],y[P]];x=E.Dom.getDocumentScrollLeft(y[e]);Y=E.Dom.getDocumentScrollTop(y[e]);AC=((H||m.webkit>519)?true:false);while((G=G[u])){z[0]+=G[b];z[1]+=G[P];if(AC){z=E.Dom._calcBorders(G,z);}}if(E.Dom._getStyle(y,p)!==f){G=y;while((G=G[Z])&&G[C]){AA=G[i];AB=G[O];if(H&&(E.Dom._getStyle(G,"overflow")!=="visible")){z=E.Dom._calcBorders(G,z);}if(AA||AB){z[0]-=AB;z[1]-=AA;}}z[0]+=x;z[1]+=Y;}else{if(D){z[0]-=x;z[1]-=Y;}else{if(I||H){z[0]+=x;z[1]+=Y;}}}z[0]=Math.floor(z[0]);z[1]=Math.floor(z[1]);}else{}return z;};}}(),getX:function(G){var Y=function(x){return E.Dom.getXY(x)[0];};return E.Dom.batch(G,Y,E.Dom,true);},getY:function(G){var Y=function(x){return E.Dom.getXY(x)[1];};return E.Dom.batch(G,Y,E.Dom,true);},setXY:function(G,x,Y){E.Dom.batch(G,E.Dom._setXY,{pos:x,noRetry:Y});},_setXY:function(G,z){var AA=E.Dom._getStyle(G,p),y=E.Dom.setStyle,AD=z.pos,Y=z.noRetry,AB=[parseInt(E.Dom.getComputedStyle(G,j),10),parseInt(E.Dom.getComputedStyle(G,o),10)],AC,x;if(AA=="static"){AA=V;y(G,p,AA);}AC=E.Dom._getXY(G);if(!AD||AC===false){return false;}if(isNaN(AB[0])){AB[0]=(AA==V)?0:G[b];}if(isNaN(AB[1])){AB[1]=(AA==V)?0:G[P];}if(AD[0]!==null){y(G,j,AD[0]-AC[0]+AB[0]+"px");}if(AD[1]!==null){y(G,o,AD[1]-AC[1]+AB[1]+"px");}if(!Y){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(Y,G){E.Dom.setXY(Y,[G,null]);},setY:function(G,Y){E.Dom.setXY(G,[null,Y]);},getRegion:function(G){var Y=function(x){var y=false;if(E.Dom._canPosition(x)){y=E.Region.getRegion(x);}else{}return y;};return E.Dom.batch(G,Y,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||K;if(!AC){return[];}var Y=[],G=AC.getElementsByTagName(AF),z=E.Dom.hasClass;for(var y=0,AA=G.length;y<AA;++y){if(z(G[y],AB)){Y[Y.length]=G[y];}}if(AE){E.Dom.batch(Y,AE,x,AD);}return Y;},hasClass:function(Y,G){return E.Dom.batch(Y,E.Dom._hasClass,G);},_hasClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom._getAttribute(x,F)||J;if(Y.exec){G=Y.test(y);}else{G=Y&&(B+y+B).indexOf(B+Y+B)>-1;}}else{}return G;},addClass:function(Y,G){return E.Dom.batch(Y,E.Dom._addClass,G);},_addClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom._getAttribute(x,F)||J;if(!E.Dom._hasClass(x,Y)){E.Dom.setAttribute(x,F,A(y+B+Y));G=true;}}else{}return G;},removeClass:function(Y,G){return E.Dom.batch(Y,E.Dom._removeClass,G);},_removeClass:function(y,x){var Y=false,AA,z,G;if(y&&x){AA=E.Dom._getAttribute(y,F)||J;E.Dom.setAttribute(y,F,AA.replace(E.Dom._getClassRegex(x),J));z=E.Dom._getAttribute(y,F);if(AA!==z){E.Dom.setAttribute(y,F,A(z));Y=true;if(E.Dom._getAttribute(y,F)===""){G=(y.hasAttribute&&y.hasAttribute(g))?g:F;
17 y.removeAttribute(G);}}}else{}return Y;},replaceClass:function(x,Y,G){return E.Dom.batch(x,E.Dom._replaceClass,{from:Y,to:G});},_replaceClass:function(y,x){var Y,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)||J;Y=(B+z.replace(E.Dom._getClassRegex(AB),B+AA)).split(E.Dom._getClassRegex(AA));Y.splice(1,0,B+AA);E.Dom.setAttribute(y,F,A(Y.join(J)));G=true;}}}}else{}return G;},generateId:function(G,x){x=x||"yui-gen";var Y=function(y){if(y&&y.id){return y.id;}var z=x+YAHOO.env._id_counter++;if(y){if(y[e]&&y[e].getElementById(z)){return E.Dom.generateId(y,z+x);}y.id=z;}return z;};return E.Dom.batch(G,Y,E.Dom,true)||Y.apply(E.Dom,arguments);},isAncestor:function(Y,x){Y=E.Dom.get(Y);x=E.Dom.get(x);var G=false;if((Y&&x)&&(Y[l]&&x[l])){if(Y.contains&&Y!==x){G=Y.contains(x);}else{if(Y.compareDocumentPosition){G=!!(Y.compareDocumentPosition(x)&16);}}}else{}return G;},inDocument:function(G,Y){return E.Dom._inDoc(E.Dom.get(G),Y);},_inDoc:function(Y,x){var G=false;if(Y&&Y[C]){x=x||Y[e];G=E.Dom.isAncestor(x[v],Y);}else{}return G;},getElementsBy:function(Y,AF,AB,AD,y,AC,AE){AF=AF||"*";AB=(AB)?E.Dom.get(AB):null||K;if(!AB){return[];}var x=[],G=AB.getElementsByTagName(AF);for(var z=0,AA=G.length;z<AA;++z){if(Y(G[z])){if(AE){x=G[z];break;}else{x[x.length]=G[z];}}}if(AD){E.Dom.batch(x,AD,y,AC);}return x;},getElementBy:function(x,G,Y){return E.Dom.getElementsBy(x,G,Y,null,null,null,true);},batch:function(x,AB,AA,z){var y=[],Y=(z)?AA:window;x=(x&&(x[C]||x.item))?x:E.Dom.get(x);if(x&&AB){if(x[C]||x.length===undefined){return AB.call(Y,x,AA);}for(var G=0;G<x.length;++G){y[y.length]=AB.call(Y,x[G],AA);}}else{return false;}return y;},getDocumentHeight:function(){var Y=(K[t]!=M||I)?K.body.scrollHeight:W.scrollHeight,G=Math.max(Y,E.Dom.getViewportHeight());return G;},getDocumentWidth:function(){var Y=(K[t]!=M||I)?K.body.scrollWidth:W.scrollWidth,G=Math.max(Y,E.Dom.getViewportWidth());return G;},getViewportHeight:function(){var G=self.innerHeight,Y=K[t];if((Y||T)&&!D){G=(Y==M)?W.clientHeight:K.body.clientHeight;}return G;},getViewportWidth:function(){var G=self.innerWidth,Y=K[t];if(Y||T){G=(Y==M)?W.clientWidth:K.body.clientWidth;}return G;},getAncestorBy:function(G,Y){while((G=G[Z])){if(E.Dom._testElement(G,Y)){return G;}}return null;},getAncestorByClassName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return E.Dom.hasClass(y,G);};return E.Dom.getAncestorBy(Y,x);},getAncestorByTagName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return y[C]&&y[C].toUpperCase()==G.toUpperCase();};return E.Dom.getAncestorBy(Y,x);},getPreviousSiblingBy:function(G,Y){while(G){G=G.previousSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getPreviousSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getPreviousSiblingBy(G);},getNextSiblingBy:function(G,Y){while(G){G=G.nextSibling;if(E.Dom._testElement(G,Y)){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 Y=(E.Dom._testElement(G.firstChild,x))?G.firstChild:null;return Y||E.Dom.getNextSiblingBy(G.firstChild,x);},getFirstChild:function(G,Y){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getFirstChildBy(G);},getLastChildBy:function(G,x){if(!G){return null;}var Y=(E.Dom._testElement(G.lastChild,x))?G.lastChild:null;return Y||E.Dom.getPreviousSiblingBy(G.lastChild,x);},getLastChild:function(G){G=E.Dom.get(G);return E.Dom.getLastChildBy(G);},getChildrenBy:function(Y,y){var x=E.Dom.getFirstChildBy(Y,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||K;return Math.max(G[v].scrollLeft,G.body.scrollLeft);},getDocumentScrollTop:function(G){G=G||K;return Math.max(G[v].scrollTop,G.body.scrollTop);},insertBefore:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}return G[Z].insertBefore(Y,G);},insertAfter:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}if(G.nextSibling){return G[Z].insertBefore(Y,G.nextSibling);}else{return G[Z].appendChild(Y);}},getClientRegion:function(){var x=E.Dom.getDocumentScrollTop(),Y=E.Dom.getDocumentScrollLeft(),y=E.Dom.getViewportWidth()+Y,G=E.Dom.getViewportHeight()+x;return new E.Region(x,y,G,Y);},setAttribute:function(Y,G,x){E.Dom.batch(Y,E.Dom._setAttribute,{attr:G,val:x});},_setAttribute:function(x,Y){var G=E.Dom._toCamel(Y.attr),y=Y.val;if(x&&x.setAttribute){if(E.Dom.DOT_ATTRIBUTES[G]){x[G]=y;}else{G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;x.setAttribute(G,y);}}else{}},getAttribute:function(Y,G){return E.Dom.batch(Y,E.Dom._getAttribute,G);},_getAttribute:function(Y,G){var x;G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;if(Y&&Y.getAttribute){x=Y.getAttribute(G,2);}else{}return x;},_toCamel:function(Y){var x=d;function G(y,z){return z.toUpperCase();}return x[Y]||(x[Y]=Y.indexOf("-")===-1?Y:Y.replace(/-([a-z])/gi,G));},_getClassRegex:function(Y){var G;if(Y!==undefined){if(Y.exec){G=Y;}else{G=h[Y];if(!G){Y=Y.replace(E.Dom._patterns.CLASS_RE_TOKENS,"\\$1");G=h[Y]=new RegExp(s+Y+k,U);}}}return G;},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}\\])/g},_testElement:function(G,Y){return G&&G[l]==1&&(!Y||Y(G));},_calcBorders:function(x,y){var Y=parseInt(E.Dom[w](x,R),10)||0,G=parseInt(E.Dom[w](x,q),10)||0;if(H){if(N.test(x[C])){Y=0;G=0;}}y[0]+=G;y[1]+=Y;return y;}};var S=E.Dom[w];if(m.opera){E.Dom[w]=function(Y,G){var x=S(Y,G);if(X.test(G)){x=E.Dom.Color.toRGB(x);}return x;};}if(m.webkit){E.Dom[w]=function(Y,G){var x=S(Y,G);if(x==="rgba(0, 0, 0, 0)"){x="transparent";}return x;};}if(m.ie&&m.ie>=8&&K.documentElement.hasAttribute){E.Dom.DOT_ATTRIBUTES.type=true;}})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this.y=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this.x=B;this[0]=B;
18 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(E){var C=Math.max(this.top,E.top),D=Math.min(this.right,E.right),A=Math.min(this.bottom,E.bottom),B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top),D=Math.max(this.right,E.right),A=Math.max(this.bottom,E.bottom),B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D),C=F[1],E=F[0]+D.offsetWidth,A=F[1]+D.offsetHeight,B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}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(H){H=D.Dom.Color.KEYWORDS[H]||H;if(D.Dom.Color.re_RGB.exec(H)){var G=(B.$1.length===1)?"0"+B.$1:Number(B.$1),F=(B.$2.length===1)?"0"+B.$2:Number(B.$2),E=(B.$3.length===1)?"0"+B.$3:Number(B.$3);H=[G[C](16),F[C](16),E[C](16)].join("");}if(H.length<6){H=H.replace(D.Dom.Color.re_hex3,"$1$1");}if(H!=="transparent"&&H.indexOf("#")<0){H="#"+H;}return H.toLowerCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.8.0r4",build:"2449"});// End of File include/javascript/yui/build/dom/dom-min.js
19                                 
20 /*
21 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
22 Code licensed under the BSD License:
23 http://developer.yahoo.net/yui/license.txt
24 version: 2.8.0r4
25 */
26 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){B=true;}else{C=this.notify(G,D);if(false===C){if(!this.silent){}break;}}}return(C!==false);},notify:function(F,C){var B,H=null,E=F.getScope(this.scope),A=YAHOO.util.Event.throwErrors;if(!this.silent){}if(this.signature==YAHOO.util.CustomEvent.FLAT){if(C.length>0){H=C[0];}try{B=F.fn.call(E,H,F.obj);}catch(G){this.lastError=G;if(A){throw G;}}}else{try{B=F.fn.call(E,this.type,C,F.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 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;
27 }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(M,P,Q,O){for(var N=0,L=M.length;N<L;N=N+1){var K=M[N];if(K&&K[this.FN]==O&&K[this.EL]==P&&K[this.TYPE]==Q){return N;}}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(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[H,J];}else{if(K==="unload"){L=[J];}else{K=this._getType(K);L=[H];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(R){var L=YAHOO.util.Event,O,N,M,Q,P,S=J.slice(),K;for(O=0,Q=J.length;O<Q;++O){M=S[O];if(M){K=window;if(M[L.ADJ_SCOPE]){if(M[L.ADJ_SCOPE]===true){K=M[L.UNLOAD_OBJ];}else{K=M[L.ADJ_SCOPE];}}M[L.FN].call(K,L.getEvent(R,M[L.EL]),M[L.UNLOAD_OBJ]);S[O]=null;}}M=null;K=null;J=null;if(H){for(N=H.length-1;N>-1;N--){M=H[N];if(M){L.removeListener(M[L.EL],M[L.TYPE],M[L.FN],N);}}M=null;}L._simpleRemove(window,"unload",L._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener;
28 /* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */
29 if(EU.isIE){if(self!==self.top){document.onreadystatechange=function(){if(document.readyState=="complete"){document.onreadystatechange=null;EU._ready();}};}else{YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,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);
30 },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.8.0r4",build:"2449"});// End of File include/javascript/yui/build/event/event-min.js
31                                 
32 /*
33 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
34 Code licensed under the BSD License:
35 http://developer.yahoo.net/yui/license.txt
36 version: 2.8.0r4
37 */
38 YAHOO.widget.LogMsg=function(A){this.msg=this.time=this.category=this.source=this.sourceDetail=null;if(A&&(A.constructor==Object)){for(var B in A){if(A.hasOwnProperty(B)){this[B]=A[B];}}}};YAHOO.widget.LogWriter=function(A){if(!A){YAHOO.log("Could not instantiate LogWriter due to invalid source.","error","LogWriter");return;}this._source=A;};YAHOO.widget.LogWriter.prototype.toString=function(){return"LogWriter "+this._sSource;};YAHOO.widget.LogWriter.prototype.log=function(A,B){YAHOO.widget.Logger.log(A,B,this._source);};YAHOO.widget.LogWriter.prototype.getSource=function(){return this._source;};YAHOO.widget.LogWriter.prototype.setSource=function(A){if(!A){YAHOO.log("Could not set source due to invalid source.","error",this.toString());return;}else{this._source=A;}};YAHOO.widget.LogWriter.prototype._source=null;if(!YAHOO.widget.Logger){YAHOO.widget.Logger={loggerEnabled:true,_browserConsoleEnabled:false,categories:["info","warn","error","time","window"],sources:["global"],_stack:[],maxStackEntries:2500,_startTime:new Date().getTime(),_lastTime:null,_windowErrorsHandled:false,_origOnWindowError:null};YAHOO.widget.Logger.log=function(B,F,G){if(this.loggerEnabled){if(!F){F="info";}else{F=F.toLocaleLowerCase();if(this._isNewCategory(F)){this._createNewCategory(F);}}var C="global";var A=null;if(G){var D=G.indexOf(" ");if(D>0){C=G.substring(0,D);A=G.substring(D,G.length);}else{C=G;}if(this._isNewSource(C)){this._createNewSource(C);}}var H=new Date();var J=new YAHOO.widget.LogMsg({msg:B,time:H,category:F,source:C,sourceDetail:A});var I=this._stack;var E=this.maxStackEntries;if(E&&!isNaN(E)&&(I.length>=E)){I.shift();}I.push(J);this.newLogEvent.fire(J);if(this._browserConsoleEnabled){this._printToBrowserConsole(J);}return true;}else{return false;}};YAHOO.widget.Logger.reset=function(){this._stack=[];this._startTime=new Date().getTime();this.loggerEnabled=true;this.log("Logger reset");this.logResetEvent.fire();};YAHOO.widget.Logger.getStack=function(){return this._stack;};YAHOO.widget.Logger.getStartTime=function(){return this._startTime;};YAHOO.widget.Logger.disableBrowserConsole=function(){YAHOO.log("Logger output to the function console.log() has been disabled.");this._browserConsoleEnabled=false;};YAHOO.widget.Logger.enableBrowserConsole=function(){this._browserConsoleEnabled=true;YAHOO.log("Logger output to the function console.log() has been enabled.");};YAHOO.widget.Logger.handleWindowErrors=function(){if(!YAHOO.widget.Logger._windowErrorsHandled){if(window.error){YAHOO.widget.Logger._origOnWindowError=window.onerror;}window.onerror=YAHOO.widget.Logger._onWindowError;YAHOO.widget.Logger._windowErrorsHandled=true;YAHOO.log("Logger handling of window.onerror has been enabled.");}else{YAHOO.log("Logger handling of window.onerror had already been enabled.");}};YAHOO.widget.Logger.unhandleWindowErrors=function(){if(YAHOO.widget.Logger._windowErrorsHandled){if(YAHOO.widget.Logger._origOnWindowError){window.onerror=YAHOO.widget.Logger._origOnWindowError;YAHOO.widget.Logger._origOnWindowError=null;}else{window.onerror=null;}YAHOO.widget.Logger._windowErrorsHandled=false;YAHOO.log("Logger handling of window.onerror has been disabled.");}else{YAHOO.log("Logger handling of window.onerror had already been disabled.");}};YAHOO.widget.Logger.categoryCreateEvent=new YAHOO.util.CustomEvent("categoryCreate",this,true);YAHOO.widget.Logger.sourceCreateEvent=new YAHOO.util.CustomEvent("sourceCreate",this,true);YAHOO.widget.Logger.newLogEvent=new YAHOO.util.CustomEvent("newLog",this,true);YAHOO.widget.Logger.logResetEvent=new YAHOO.util.CustomEvent("logReset",this,true);YAHOO.widget.Logger._createNewCategory=function(A){this.categories.push(A);this.categoryCreateEvent.fire(A);};YAHOO.widget.Logger._isNewCategory=function(B){for(var A=0;A<this.categories.length;A++){if(B==this.categories[A]){return false;}}return true;};YAHOO.widget.Logger._createNewSource=function(A){this.sources.push(A);this.sourceCreateEvent.fire(A);};YAHOO.widget.Logger._isNewSource=function(A){if(A){for(var B=0;B<this.sources.length;B++){if(A==this.sources[B]){return false;}}return true;}};YAHOO.widget.Logger._printToBrowserConsole=function(C){if(window.console&&console.log){var E=C.category;var D=C.category.substring(0,4).toUpperCase();var G=C.time;var F;if(G.toLocaleTimeString){F=G.toLocaleTimeString();}else{F=G.toString();}var H=G.getTime();var B=(YAHOO.widget.Logger._lastTime)?(H-YAHOO.widget.Logger._lastTime):0;YAHOO.widget.Logger._lastTime=H;var A=F+" ("+B+"ms): "+C.source+": ";if(YAHOO.env.ua.webkit){A+=C.msg;}console.log(A,C.msg);}};YAHOO.widget.Logger._onWindowError=function(A,C,B){try{YAHOO.widget.Logger.log(A+" ("+C+", line "+B+")","window");if(YAHOO.widget.Logger._origOnWindowError){YAHOO.widget.Logger._origOnWindowError();}}catch(D){return false;}};YAHOO.widget.Logger.log("Logger initialized");}(function(){var C=YAHOO.widget.Logger,D=YAHOO.util,E=D.Dom,A=D.Event,G=document;function B(I,H){I=G.createElement(I);if(H){for(var J in H){if(H.hasOwnProperty(J)){I[J]=H[J];}}}return I;}function F(I,H){this._sName=F._index;F._index++;this._init.apply(this,arguments);if(this.autoRender!==false){this.render();}}YAHOO.lang.augmentObject(F,{_index:0,ENTRY_TEMPLATE:(function(){return B("pre",{className:"yui-log-entry"});})(),VERBOSE_TEMPLATE:"<p><span class='{category}'>{label}</span> {totalTime}ms (+{elapsedTime}) {localTime}:</p><p>{sourceAndDetail}</p><p>{message}</p>",BASIC_TEMPLATE:"<p><span class='{category}'>{label}</span> {totalTime}ms (+{elapsedTime}) {localTime}: {sourceAndDetail}: {message}</p>"});F.prototype={logReaderEnabled:true,width:null,height:null,top:null,left:null,right:null,bottom:null,fontSize:null,footerEnabled:true,verboseOutput:true,entryFormat:null,newestOnTop:true,outputBuffer:100,thresholdMax:500,thresholdMin:100,isCollapsed:false,isPaused:false,draggable:true,toString:function(){return"LogReader instance"+this._sName;},pause:function(){this.isPaused=true;this._timeout=null;this.logReaderEnabled=false;if(this._btnPause){this._btnPause.value="Resume";
39 }},resume:function(){this.isPaused=false;this.logReaderEnabled=true;this._printBuffer();if(this._btnPause){this._btnPause.value="Pause";}},render:function(){if(this.rendered){return;}this._initContainerEl();this._initHeaderEl();this._initConsoleEl();this._initFooterEl();this._initCategories();this._initSources();this._initDragDrop();C.newLogEvent.subscribe(this._onNewLog,this);C.logResetEvent.subscribe(this._onReset,this);C.categoryCreateEvent.subscribe(this._onCategoryCreate,this);C.sourceCreateEvent.subscribe(this._onSourceCreate,this);this.rendered=true;this._filterLogs();},destroy:function(){A.purgeElement(this._elContainer,true);this._elContainer.innerHTML="";this._elContainer.parentNode.removeChild(this._elContainer);this.rendered=false;},hide:function(){this._elContainer.style.display="none";},show:function(){this._elContainer.style.display="block";},collapse:function(){this._elConsole.style.display="none";if(this._elFt){this._elFt.style.display="none";}this._btnCollapse.value="Expand";this.isCollapsed=true;},expand:function(){this._elConsole.style.display="block";if(this._elFt){this._elFt.style.display="block";}this._btnCollapse.value="Collapse";this.isCollapsed=false;},getCheckbox:function(H){return this._filterCheckboxes[H];},getCategories:function(){return this._categoryFilters;},showCategory:function(I){var K=this._categoryFilters;if(K.indexOf){if(K.indexOf(I)>-1){return;}}else{for(var H=0;H<K.length;H++){if(K[H]===I){return;}}}this._categoryFilters.push(I);this._filterLogs();var J=this.getCheckbox(I);if(J){J.checked=true;}},hideCategory:function(I){var K=this._categoryFilters;for(var H=0;H<K.length;H++){if(I==K[H]){K.splice(H,1);break;}}this._filterLogs();var J=this.getCheckbox(I);if(J){J.checked=false;}},getSources:function(){return this._sourceFilters;},showSource:function(H){var K=this._sourceFilters;if(K.indexOf){if(K.indexOf(H)>-1){return;}}else{for(var I=0;I<K.length;I++){if(H==K[I]){return;}}}K.push(H);this._filterLogs();var J=this.getCheckbox(H);if(J){J.checked=true;}},hideSource:function(H){var K=this._sourceFilters;for(var I=0;I<K.length;I++){if(H==K[I]){K.splice(I,1);break;}}this._filterLogs();var J=this.getCheckbox(H);if(J){J.checked=false;}},clearConsole:function(){this._timeout=null;this._buffer=[];this._consoleMsgCount=0;var H=this._elConsole;H.innerHTML="";},setTitle:function(H){this._title.innerHTML=this.html2Text(H);},getLastTime:function(){return this._lastTime;},formatMsg:function(I){var H=this.entryFormat||(this.verboseOutput?F.VERBOSE_TEMPLATE:F.BASIC_TEMPLATE),J={category:I.category,label:I.category.substring(0,4).toUpperCase(),sourceAndDetail:I.sourceDetail?I.source+" "+I.sourceDetail:I.source,message:this.html2Text(I.msg||I.message||"")};if(I.time&&I.time.getTime){J.localTime=I.time.toLocaleTimeString?I.time.toLocaleTimeString():I.time.toString();J.elapsedTime=I.time.getTime()-this.getLastTime();J.totalTime=I.time.getTime()-C.getStartTime();}var K=F.ENTRY_TEMPLATE.cloneNode(true);if(this.verboseOutput){K.className+=" yui-log-verbose";}K.innerHTML=H.replace(/\{(\w+)\}/g,function(L,M){return(M in J)?J[M]:"";});return K;},html2Text:function(H){if(H){H+="";return H.replace(/&/g,"&#38;").replace(/</g,"&#60;").replace(/>/g,"&#62;");}return"";},_sName:null,_buffer:null,_consoleMsgCount:0,_lastTime:null,_timeout:null,_filterCheckboxes:null,_categoryFilters:null,_sourceFilters:null,_elContainer:null,_elHd:null,_elCollapse:null,_btnCollapse:null,_title:null,_elConsole:null,_elFt:null,_elBtns:null,_elCategoryFilters:null,_elSourceFilters:null,_btnPause:null,_btnClear:null,_init:function(H,I){this._buffer=[];this._filterCheckboxes={};this._lastTime=C.getStartTime();if(I&&(I.constructor==Object)){for(var J in I){if(I.hasOwnProperty(J)){this[J]=I[J];}}}this._elContainer=E.get(H);YAHOO.log("LogReader initialized",null,this.toString());},_initContainerEl:function(){if(!this._elContainer||!/div$/i.test(this._elContainer.tagName)){this._elContainer=G.body.insertBefore(B("div"),G.body.firstChild);E.addClass(this._elContainer,"yui-log-container");}E.addClass(this._elContainer,"yui-log");var J=this._elContainer.style,H=["width","right","top","fontSize"],K,I;for(I=H.length-1;I>=0;--I){K=H[I];if(this[K]){J[K]=this[K];}}if(this.left){J.left=this.left;J.right="auto";}if(this.bottom){J.bottom=this.bottom;J.top="auto";}if(YAHOO.env.ua.opera){G.body.style+="";}},_initHeaderEl:function(){if(this._elHd){A.purgeElement(this._elHd,true);this._elHd.innerHTML="";}this._elHd=B("div",{id:"yui-log-hd"+this._sName,className:"yui-log-hd"});this._elCollapse=B("div",{className:"yui-log-btns"});this._btnCollapse=B("input",{type:"button",className:"yui-log-button",value:"Collapse"});A.on(this._btnCollapse,"click",this._onClickCollapseBtn,this);this._title=B("h4",{innerHTML:"Logger Console"});this._elCollapse.appendChild(this._btnCollapse);this._elHd.appendChild(this._elCollapse);this._elHd.appendChild(this._title);this._elContainer.appendChild(this._elHd);},_initConsoleEl:function(){if(this._elConsole){A.purgeElement(this._elConsole,true);this._elConsole.innerHTML="";}this._elConsole=B("div",{className:"yui-log-bd"});if(this.height){this._elConsole.style.height=this.height;}this._elContainer.appendChild(this._elConsole);},_initFooterEl:function(){if(this.footerEnabled){if(this._elFt){A.purgeElement(this._elFt,true);this._elFt.innerHTML="";}this._elFt=B("div",{className:"yui-log-ft"});this._elBtns=B("div",{className:"yui-log-btns"});this._btnPause=B("input",{type:"button",className:"yui-log-button",value:"Pause"});A.on(this._btnPause,"click",this._onClickPauseBtn,this);this._btnClear=B("input",{type:"button",className:"yui-log-button",value:"Clear"});A.on(this._btnClear,"click",this._onClickClearBtn,this);this._elCategoryFilters=B("div",{className:"yui-log-categoryfilters"});this._elSourceFilters=B("div",{className:"yui-log-sourcefilters"});this._elBtns.appendChild(this._btnPause);this._elBtns.appendChild(this._btnClear);this._elFt.appendChild(this._elBtns);this._elFt.appendChild(this._elCategoryFilters);
40 this._elFt.appendChild(this._elSourceFilters);this._elContainer.appendChild(this._elFt);}},_initDragDrop:function(){if(D.DD&&this.draggable&&this._elHd){var H=new D.DD(this._elContainer);H.setHandleElId(this._elHd.id);this._elHd.style.cursor="move";}},_initCategories:function(){this._categoryFilters=[];var J=C.categories;for(var H=0;H<J.length;H++){var I=J[H];this._categoryFilters.push(I);if(this._elCategoryFilters){this._createCategoryCheckbox(I);}}},_initSources:function(){this._sourceFilters=[];var J=C.sources;for(var I=0;I<J.length;I++){var H=J[I];this._sourceFilters.push(H);if(this._elSourceFilters){this._createSourceCheckbox(H);}}},_createCategoryCheckbox:function(K){if(this._elFt){var J=B("span",{className:"yui-log-filtergrp"}),H=B("input",{id:"yui-log-filter-"+K+this._sName,className:"yui-log-filter-"+K,type:"checkbox",category:K}),I=B("label",{htmlFor:H.id,className:K,innerHTML:K});A.on(H,"click",this._onCheckCategory,this);this._filterCheckboxes[K]=H;J.appendChild(H);J.appendChild(I);this._elCategoryFilters.appendChild(J);H.checked=true;}},_createSourceCheckbox:function(H){if(this._elFt){var K=B("span",{className:"yui-log-filtergrp"}),I=B("input",{id:"yui-log-filter-"+H+this._sName,className:"yui-log-filter-"+H,type:"checkbox",source:H}),J=B("label",{htmlFor:I.id,className:H,innerHTML:H});A.on(I,"click",this._onCheckSource,this);this._filterCheckboxes[H]=I;K.appendChild(I);K.appendChild(J);this._elSourceFilters.appendChild(K);I.checked=true;}},_filterLogs:function(){if(this._elConsole!==null){this.clearConsole();this._printToConsole(C.getStack());}},_printBuffer:function(){this._timeout=null;if(this._elConsole!==null){var I=this.thresholdMax;I=(I&&!isNaN(I))?I:500;if(this._consoleMsgCount<I){var H=[];for(var J=0;J<this._buffer.length;J++){H[J]=this._buffer[J];}this._buffer=[];this._printToConsole(H);}else{this._filterLogs();}if(!this.newestOnTop){this._elConsole.scrollTop=this._elConsole.scrollHeight;}}},_printToConsole:function(P){var I=P.length,T=G.createDocumentFragment(),W=[],X=this.thresholdMin,J=this._sourceFilters.length,U=this._categoryFilters.length,R,O,N,M,S;if(isNaN(X)||(X>this.thresholdMax)){X=0;}R=(I>X)?(I-X):0;for(O=R;O<I;O++){var L=false,Q=false,V=P[O],H=V.source,K=V.category;for(N=0;N<J;N++){if(H==this._sourceFilters[N]){Q=true;break;}}if(Q){for(N=0;N<U;N++){if(K==this._categoryFilters[N]){L=true;break;}}}if(L){if(this._consoleMsgCount===0){this._lastTime=V.time.getTime();}M=this.formatMsg(V);if(typeof M==="string"){W[W.length]=M;}else{T.insertBefore(M,this.newestOnTop?T.firstChild||null:null);}this._consoleMsgCount++;this._lastTime=V.time.getTime();}}if(W.length){W.splice(0,0,this._elConsole.innerHTML);this._elConsole.innerHTML=this.newestOnTop?W.reverse().join(""):W.join("");}else{if(T.firstChild){this._elConsole.insertBefore(T,this.newestOnTop?this._elConsole.firstChild||null:null);}}},_onCategoryCreate:function(K,J,H){var I=J[0];H._categoryFilters.push(I);if(H._elFt){H._createCategoryCheckbox(I);}},_onSourceCreate:function(K,J,H){var I=J[0];H._sourceFilters.push(I);if(H._elFt){H._createSourceCheckbox(I);}},_onCheckCategory:function(H,I){var J=this.category;if(!this.checked){I.hideCategory(J);}else{I.showCategory(J);}},_onCheckSource:function(H,I){var J=this.source;if(!this.checked){I.hideSource(J);}else{I.showSource(J);}},_onClickCollapseBtn:function(H,I){if(!I.isCollapsed){I.collapse();}else{I.expand();}},_onClickPauseBtn:function(H,I){if(!I.isPaused){I.pause();}else{I.resume();}},_onClickClearBtn:function(H,I){I.clearConsole();},_onNewLog:function(K,J,H){var I=J[0];H._buffer.push(I);if(H.logReaderEnabled===true&&H._timeout===null){H._timeout=setTimeout(function(){H._printBuffer();},H.outputBuffer);}},_onReset:function(J,I,H){H._filterLogs();}};YAHOO.widget.LogReader=F;})();YAHOO.register("logger",YAHOO.widget.Logger,{version:"2.8.0r4",build:"2449"});// End of File include/javascript/yui/build/logger/logger-min.js
41                                 
42 /*
43 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
44 Code licensed under the BSD License:
45 http://developer.yahoo.net/yui/license.txt
46 version: 2.8.0r4
47 */
48 (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 I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined");};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false;}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"];}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G<C;++G){E[G]=I[G]+F[D]["by"][G]*1;}}else{E=I+F[D]["by"]*1;}}}this.runtimeAttributes[D].start=I;this.runtimeAttributes[D].end=E;this.runtimeAttributes[D].unit=(H(F[D].unit))?F[D]["unit"]:this.getDefaultUnit(D);return true;},init:function(E,J,I,C){var D=false;var F=null;var H=0;E=B.Dom.get(E);this.attributes=J||{};this.duration=!YAHOO.lang.isUndefined(I)?I:1;this.method=C||B.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=B.AnimMgr.fps;this.setEl=function(M){E=B.Dom.get(M);};this.getEl=function(){return E;};this.isAnimated=function(){return D;};this.getStartTime=function(){return F;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(B.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}B.AnimMgr.registerElement(this);return true;};this.stop=function(M){if(!this.isAnimated()){return false;}if(M){this.currentFrame=this.totalFrames;this._onTween.fire();}B.AnimMgr.stop(this);};var L=function(){this.onStart.fire();this.runtimeAttributes={};for(var M in this.attributes){this.setRuntimeAttribute(M);}D=true;H=0;F=new Date();};var K=function(){var O={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};O.toString=function(){return("duration: "+O.duration+", currentFrame: "+O.currentFrame);};this.onTween.fire(O);var N=this.runtimeAttributes;for(var M in N){this.setAttribute(M,this.doMethod(M,N[M].start,N[M].end),N[M].unit);}H+=1;};var G=function(){var M=(new Date()-F)/1000;var N={duration:M,frames:H,fps:H/M};N.toString=function(){return("duration: "+N.duration+", frames: "+N.frames+", fps: "+N.fps);};D=false;H=0;this.onComplete.fire(N);};this._onStart=new B.CustomEvent("_start",this,true);this.onStart=new B.CustomEvent("start",this);this.onTween=new B.CustomEvent("tween",this);this._onTween=new B.CustomEvent("_tween",this,true);this.onComplete=new B.CustomEvent("complete",this);this._onComplete=new B.CustomEvent("_complete",this,true);this._onStart.subscribe(L);this._onTween.subscribe(K);this._onComplete.subscribe(G);}};B.Anim=A;})();YAHOO.util.AnimMgr=new function(){var C=null;var B=[];var A=0;this.fps=1000;this.delay=1;this.registerElement=function(F){B[B.length]=F;A+=1;F._onStart.fire();this.start();};this.unRegister=function(G,F){F=F||E(G);if(!G.isAnimated()||F===-1){return false;}G._onComplete.fire();B.splice(F,1);A-=1;if(A<=0){this.stop();}return true;};this.start=function(){if(C===null){C=setInterval(this.run,this.delay);}};this.stop=function(H){if(!H){clearInterval(C);for(var G=0,F=B.length;G<F;++G){this.unRegister(B[0],0);}B=[];C=null;A=0;}else{this.unRegister(H);}};this.run=function(){for(var H=0,F=B.length;H<F;++H){var G=B[H];if(!G||!G.isAnimated()){continue;}if(G.currentFrame<G.totalFrames||G.totalFrames===null){G.currentFrame+=1;if(G.useSeconds){D(G);}G._onTween.fire();}else{YAHOO.util.AnimMgr.stop(G,H);}}};var E=function(H){for(var G=0,F=B.length;G<F;++G){if(B[G]===H){return G;}}return -1;};var D=function(G){var J=G.totalFrames;var I=G.currentFrame;var H=(G.currentFrame*G.duration*1000/G.totalFrames);var F=(new Date()-G.getStartTime());var K=0;if(F<G.duration*1000){K=Math.round((F/H-1)*G.currentFrame);}else{K=J-(I+1);}if(K>0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};this._queue=B;this._getIndex=E;};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)];
49 }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,J,G){var I;if(this.patterns.color.test(F)){I=[];for(var H=0,E=J.length;H<E;++H){I[H]=D.doMethod.call(this,F,J[H],G[H]);}I="rgb("+Math.floor(I[0])+","+Math.floor(I[1])+","+Math.floor(I[2])+")";}else{I=D.doMethod.call(this,F,J,G);}return I;};B.setRuntimeAttribute=function(F){D.setRuntimeAttribute.call(this,F);if(this.patterns.color.test(F)){var H=this.attributes;var J=this.parseColor(this.runtimeAttributes[F].start);var G=this.parseColor(this.runtimeAttributes[F].end);if(typeof H[F]["to"]==="undefined"&&typeof H[F]["by"]!=="undefined"){G=this.parseColor(H[F].by);for(var I=0,E=J.length;I<E;++I){G[I]=J[I]+G[I];}}this.runtimeAttributes[F].start=J;this.runtimeAttributes[F].end=G;}};C.ColorAnim=A;})();
50 /*
51 TERMS OF USE - EASING EQUATIONS
52 Open source under the BSD License.
53 Copyright 2001 Robert Penner All rights reserved.
54
55 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
56
57  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
58  * 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.
59  * 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.
60
61 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.
62 */
63 YAHOO.util.Easing={easeNone:function(B,A,D,C){return D*B/C+A;},easeIn:function(B,A,D,C){return D*(B/=C)*B+A;},easeOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A;},easeBoth:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A;}return -D/2*((--B)*(B-2)-1)+A;},easeInStrong:function(B,A,D,C){return D*(B/=C)*B*B*B+A;},easeOutStrong:function(B,A,D,C){return -D*((B=B/C-1)*B*B*B-1)+A;},easeBothStrong:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B*B+A;}return -D/2*((B-=2)*B*B*B-2)+A;},elasticIn:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return -(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;},elasticOut:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return B*Math.pow(2,-10*C)*Math.sin((C*F-D)*(2*Math.PI)/E)+G+A;},elasticBoth:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F/2)==2){return A+G;}if(!E){E=F*(0.3*1.5);}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}if(C<1){return -0.5*(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;}return B*Math.pow(2,-10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E)*0.5+G+A;},backIn:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*(B/=D)*B*((C+1)*B-C)+A;},backOut:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*((B=B/D-1)*B*((C+1)*B+C)+1)+A;},backBoth:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}if((B/=D/2)<1){return E/2*(B*B*(((C*=(1.525))+1)*B-C))+A;}return E/2*((B-=2)*B*(((C*=(1.525))+1)*B+C)+2)+A;},bounceIn:function(B,A,D,C){return D-YAHOO.util.Easing.bounceOut(C-B,0,D,C)+A;},bounceOut:function(B,A,D,C){if((B/=C)<(1/2.75)){return D*(7.5625*B*B)+A;}else{if(B<(2/2.75)){return D*(7.5625*(B-=(1.5/2.75))*B+0.75)+A;}else{if(B<(2.5/2.75)){return D*(7.5625*(B-=(2.25/2.75))*B+0.9375)+A;}}}return D*(7.5625*(B-=(2.625/2.75))*B+0.984375)+A;},bounceBoth:function(B,A,D,C){if(B<C/2){return YAHOO.util.Easing.bounceIn(B*2,0,D,C)*0.5+A;}return YAHOO.util.Easing.bounceOut(B*2-C,0,D,C)*0.5+D*0.5+A;}};(function(){var A=function(H,G,I,J){if(H){A.superclass.constructor.call(this,H,G,I,J);}};A.NAME="Motion";var E=YAHOO.util;YAHOO.extend(A,E.ColorAnim);var F=A.superclass;var C=A.prototype;C.patterns.points=/^points$/i;C.setAttribute=function(G,I,H){if(this.patterns.points.test(G)){H=H||"px";F.setAttribute.call(this,"left",I[0],H);F.setAttribute.call(this,"top",I[1],H);}else{F.setAttribute.call(this,G,I,H);}};C.getAttribute=function(G){if(this.patterns.points.test(G)){var H=[F.getAttribute.call(this,"left"),F.getAttribute.call(this,"top")];}else{H=F.getAttribute.call(this,G);}return H;};C.doMethod=function(G,K,H){var J=null;if(this.patterns.points.test(G)){var I=this.method(this.currentFrame,0,100,this.totalFrames)/100;J=E.Bezier.getPosition(this.runtimeAttributes[G],I);}else{J=F.doMethod.call(this,G,K,H);}return J;};C.setRuntimeAttribute=function(P){if(this.patterns.points.test(P)){var H=this.getEl();var J=this.attributes;var G;var L=J["points"]["control"]||[];var I;var M,O;if(L.length>0&&!(L[0] instanceof Array)){L=[L];}else{var K=[];for(M=0,O=L.length;M<O;++M){K[M]=L[M];}L=K;}if(E.Dom.getStyle(H,"position")=="static"){E.Dom.setStyle(H,"position","relative");}if(D(J["points"]["from"])){E.Dom.setXY(H,J["points"]["from"]);
64 }else{E.Dom.setXY(H,E.Dom.getXY(H));}G=this.getAttribute("points");if(D(J["points"]["to"])){I=B.call(this,J["points"]["to"],G);var N=E.Dom.getXY(this.getEl());for(M=0,O=L.length;M<O;++M){L[M]=B.call(this,L[M],G);}}else{if(D(J["points"]["by"])){I=[G[0]+J["points"]["by"][0],G[1]+J["points"]["by"][1]];for(M=0,O=L.length;M<O;++M){L[M]=[G[0]+L[M][0],G[1]+L[M][1]];}}}this.runtimeAttributes[P]=[G];if(L.length>0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L);}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I;}else{F.setRuntimeAttribute.call(this,P);}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G;};var D=function(G){return(typeof G!=="undefined");};E.Motion=A;})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H);}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)];}else{G=C.doMethod.call(this,E,H,F);}return G;};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop];}else{G=C.getAttribute.call(this,E);}return G;};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1];}else{C.setAttribute.call(this,E,H,G);}};B.Scroll=D;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.8.0r4",build:"2449"});// End of File include/javascript/yui/build/animation/animation-min.js
65                                 
66 /*
67 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
68 Code licensed under the BSD License:
69 http://developer.yahoo.net/yui/license.txt
70 version: 2.8.0r4
71 */
72 YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_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;}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(F){var D,A,B;try{A=new XMLHttpRequest();D={conn:A,tId:F,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:F,xhr:true};break;}catch(E){}}}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(G,D,F,A){var E,C,B=(F&&F.argument)?F.argument:null;if(this._isFileUpload){C="upload";}else{if(F.xdr){C="xdr";}}E=this.getConnectionObject(C);if(!E){return null;}else{if(F&&F.customevents){this.initCustomEvents(E,F);}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(E,F,D,A);return E;}if(G.toUpperCase()=="GET"){if(this._sFormData.length!==0){D+=((D.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(G.toUpperCase()=="POST"){A=A?this._sFormData+"&"+A:this._sFormData;}}}if(G.toUpperCase()=="GET"&&(F&&F.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((G.toUpperCase()==="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);}if(E.xdr){this.xdr(E,G,D,F,A);return E;}E.conn.open(G,D,true);if(this._has_default_headers||this._has_http_headers){this.setHeader(E);}this.handleReadyState(E,F);E.conn.send(A||"");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(E,B);if(E.startEvent){E.startEvent.fire(E,B);}return E;}},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,I,D){var E,A,G=(I&&I.argument)?I.argument:null,C=(B.r&&B.r.statusText==="xdr:success")?true:false,H=(B.r&&B.r.statusText==="xdr:failure")?true:false,J=D;try{if((B.conn.status!==undefined&&B.conn.status!==0)||C){E=B.conn.status;}else{if(H&&!J){E=0;}else{E=13030;}}}catch(F){E=13030;}if((E>=200&&E<300)||E===1223||C){A=B.xdr?B.r:this.createResponseObject(B,G);if(I&&I.success){if(!I.scope){I.success(A);}else{I.success.apply(I.scope,[A]);}}this.successEvent.fire(A);if(B.successEvent){B.successEvent.fire(A);}}else{switch(E){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:A=this.createExceptionObject(B.tId,G,(D?D:false));if(I&&I.failure){if(!I.scope){I.failure(A);}else{I.failure.apply(I.scope,[A]);}}break;default:A=(B.xdr)?B.response:this.createResponseObject(B,G);if(I&&I.failure){if(!I.scope){I.failure(A);}else{I.failure.apply(I.scope,[A]);}}}this.failureEvent.fire(A);if(B.failureEvent){B.failureEvent.fire(A);}}this.releaseObject(B);A=null;},createResponseObject:function(A,G){var D={},I={},E,C,F,B;try{C=A.conn.getAllResponseHeaders();F=C.split("\n");for(E=0;E<F.length;E++){B=F[E].indexOf(":");if(B!=-1){I[F[E].substring(0,B)]=YAHOO.lang.trim(F[E].substring(B+2));}}}catch(H){}D.tId=A.tId;D.status=(A.conn.status==1223)?204:A.conn.status;D.statusText=(A.conn.status==1223)?"No Content":A.conn.statusText;D.getResponseHeader=I;D.getAllResponseHeaders=C;D.responseText=A.conn.responseText;D.responseXML=A.conn.responseXML;if(G){D.argument=G;}return D;},createExceptionObject:function(H,D,A){var F=0,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]);
73 }}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,M,K){H[parseInt(L.tId)]={"o":L,"c":M};if(K){M.method=I;M.data=K;}L.conn.send(J,M,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 D=YAHOO.util.Connect,F=YAHOO.util.Event;D._isFormSubmit=false;D._isFileUpload=false;D._formNode=null;D._sFormData=null;D._submitElementValue=null;D.uploadEvent=new YAHOO.util.CustomEvent("upload"),D._hasSubmitListener=function(){if(F){F.addListener(document,"click",function(J){var I=F.getTarget(J),H=I.nodeName.toLowerCase();if((H==="input"||H==="button")&&(I.type&&I.type.toLowerCase()=="submit")){D._submitElementValue=encodeURIComponent(I.name)+"="+encodeURIComponent(I.value);}});return true;}return false;}();function G(T,O,J){var S,I,R,P,W,Q=false,M=[],V=0,L,N,K,U,H;this.resetFormState();if(typeof T=="string"){S=(document.getElementById(T)||document.forms[T]);}else{if(typeof T=="object"){S=T;}else{return;}}if(O){this.createFrame(J?J:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=S;return;}for(L=0,N=S.elements.length;L<N;++L){I=S.elements[L];W=I.disabled;R=I.name;if(!W&&R){R=encodeURIComponent(R)+"=";P=encodeURIComponent(I.value);switch(I.type){case"select-one":if(I.selectedIndex>-1){H=I.options[I.selectedIndex];M[V++]=R+encodeURIComponent((H.attributes.value&&H.attributes.value.specified)?H.value:H.text);}break;case"select-multiple":if(I.selectedIndex>-1){for(K=I.selectedIndex,U=I.options.length;K<U;++K){H=I.options[K];if(H.selected){M[V++]=R+encodeURIComponent((H.attributes.value&&H.attributes.value.specified)?H.value:H.text);}}}break;case"radio":case"checkbox":if(I.checked){M[V++]=R+P;}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(Q===false){if(this._hasSubmitListener&&this._submitElementValue){M[V++]=this._submitElementValue;}Q=true;}break;default:M[V++]=R+P;}}}this._isFormSubmit=true;this._sFormData=M.join("&");this.initHeader("Content-Type",this._default_form_header);return this._sFormData;}function C(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";}function B(H){var I="yuiIO"+this._transaction_id,J;if(YAHOO.env.ua.ie){J=document.createElement('<iframe id="'+I+'" name="'+I+'" />');if(typeof H=="boolean"){J.src="javascript:false";}}else{J=document.createElement("iframe");J.id=I;J.name=I;}J.style.position="absolute";J.style.top="-1000px";J.style.left="-1000px";document.body.appendChild(J);}function E(H){var K=[],I=H.split("&"),J,L;for(J=0;J<I.length;J++){L=I[J].indexOf("=");if(L!=-1){K[J]=document.createElement("input");K[J].type="hidden";K[J].name=decodeURIComponent(I[J].substring(0,L));K[J].value=decodeURIComponent(I[J].substring(L+1));this._formNode.appendChild(K[J]);}}return K;}function A(K,V,L,J){var Q="yuiIO"+K.tId,R="multipart/form-data",T=document.getElementById(Q),M=(document.documentMode&&document.documentMode===8)?true:false,W=this,S=(V&&V.argument)?V.argument:null,U,P,I,O,H,N;H={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",L);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",Q);if(YAHOO.env.ua.ie&&!M){this._formNode.setAttribute("encoding",R);}else{this._formNode.setAttribute("enctype",R);}if(J){U=this.appendPostData(J);}this._formNode.submit();this.startEvent.fire(K,S);if(K.startEvent){K.startEvent.fire(K,S);}if(V&&V.timeout){this._timeOut[K.tId]=window.setTimeout(function(){W.abort(K,V,true);},V.timeout);}if(U&&U.length>0){for(P=0;P<U.length;P++){this._formNode.removeChild(U[P]);}}for(I in H){if(YAHOO.lang.hasOwnProperty(H,I)){if(H[I]){this._formNode.setAttribute(I,H[I]);}else{this._formNode.removeAttribute(I);}}}this.resetFormState();N=function(){if(V&&V.timeout){window.clearTimeout(W._timeOut[K.tId]);delete W._timeOut[K.tId];}W.completeEvent.fire(K,S);if(K.completeEvent){K.completeEvent.fire(K,S);
74 }O={tId:K.tId,argument:V.argument};try{O.responseText=T.contentWindow.document.body?T.contentWindow.document.body.innerHTML:T.contentWindow.document.documentElement.textContent;O.responseXML=T.contentWindow.document.XMLDocument?T.contentWindow.document.XMLDocument:T.contentWindow.document;}catch(X){}if(V&&V.upload){if(!V.scope){V.upload(O);}else{V.upload.apply(V.scope,[O]);}}W.uploadEvent.fire(O);if(K.uploadEvent){K.uploadEvent.fire(O);}F.removeListener(T,"load",N);setTimeout(function(){document.body.removeChild(T);W.releaseObject(K);},100);};F.addListener(T,"load",N);}D.setForm=G;D.resetFormState=C;D.createFrame=B;D.appendPostData=E;D.uploadFile=A;})();YAHOO.register("connection",YAHOO.util.Connect,{version:"2.8.0r4",build:"2449"});// End of File include/javascript/yui/build/connection/connection-min.js
75                                 
76 /*
77 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
78 Code licensed under the BSD License:
79 http://developer.yahoo.net/yui/license.txt
80 version: 2.8.0r4
81 */
82 if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var A=YAHOO.util.Event,B=YAHOO.util.Dom;return{useShim:false,_shimActive:false,_shimState:false,_debugShim:false,_createShim:function(){var C=document.createElement("div");C.id="yui-ddm-shim";if(document.body.firstChild){document.body.insertBefore(C,document.body.firstChild);}else{document.body.appendChild(C);}C.style.display="none";C.style.backgroundColor="red";C.style.position="absolute";C.style.zIndex="99999";B.setStyle(C,"opacity","0");this._shim=C;A.on(C,"mouseup",this.handleMouseUp,this,true);A.on(C,"mousemove",this.handleMouseMove,this,true);A.on(window,"scroll",this._sizeShim,this,true);},_sizeShim:function(){if(this._shimActive){var C=this._shim;C.style.height=B.getDocumentHeight()+"px";C.style.width=B.getDocumentWidth()+"px";C.style.top="0";C.style.left="0";}},_activateShim:function(){if(this.useShim){if(!this._shim){this._createShim();}this._shimActive=true;var C=this._shim,D="0";if(this._debugShim){D=".5";}B.setStyle(C,"opacity",D);this._sizeShim();C.style.display="block";}},_deactivateShim:function(){this._shim.style.display="none";this._shimActive=false;},_shim:null,ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(E,D){for(var F in this.ids){for(var C in this.ids[F]){var G=this.ids[F][C];if(!this.isTypeOfDD(G)){continue;}G[E].apply(G,D);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(C){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(D,C){if(!this.initialized){this.init();}if(!this.ids[C]){this.ids[C]={};}this.ids[C][D.id]=D;},removeDDFromGroup:function(E,C){if(!this.ids[C]){this.ids[C]={};}var D=this.ids[C];if(D&&D[E.id]){delete D[E.id];}},_remove:function(E){for(var D in E.groups){if(D){var C=this.ids[D];if(C&&C[E.id]){delete C[E.id];}}}delete this.handleIds[E.id];},regHandle:function(D,C){if(!this.handleIds[D]){this.handleIds[D]={};}this.handleIds[D][C]=C;},isDragDrop:function(C){return(this.getDDById(C))?true:false;},getRelated:function(H,D){var G=[];for(var F in H.groups){for(var E in this.ids[F]){var C=this.ids[F][E];if(!this.isTypeOfDD(C)){continue;}if(!D||C.isTarget){G[G.length]=C;}}}return G;},isLegalTarget:function(G,F){var D=this.getRelated(G,true);for(var E=0,C=D.length;E<C;++E){if(D[E].id==F.id){return true;}}return false;},isTypeOfDD:function(C){return(C&&C.__ygDragDrop);},isHandle:function(D,C){return(this.handleIds[D]&&this.handleIds[D][C]);},getDDById:function(D){for(var C in this.ids){if(this.ids[C][D]){return this.ids[C][D];}}return null;},handleMouseDown:function(E,D){this.currentTarget=YAHOO.util.Event.getTarget(E);this.dragCurrent=D;var C=D.getEl();this.startX=YAHOO.util.Event.getPageX(E);this.startY=YAHOO.util.Event.getPageY(E);this.deltaX=this.startX-C.offsetLeft;this.deltaY=this.startY-C.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var F=YAHOO.util.DDM;F.startDrag(F.startX,F.startY);F.fromTimeout=true;},this.clickTimeThresh);},startDrag:function(C,E){if(this.dragCurrent&&this.dragCurrent.useShim){this._shimState=this.useShim;this.useShim=true;}this._activateShim();clearTimeout(this.clickTimeout);var D=this.dragCurrent;if(D&&D.events.b4StartDrag){D.b4StartDrag(C,E);D.fireEvent("b4StartDragEvent",{x:C,y:E});}if(D&&D.events.startDrag){D.startDrag(C,E);D.fireEvent("startDragEvent",{x:C,y:E});}this.dragThreshMet=true;},handleMouseUp:function(C){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.fromTimeout=false;this.handleMouseMove(C);}this.fromTimeout=false;this.fireEvents(C,true);}else{}this.stopDrag(C);this.stopEvent(C);}},stopEvent:function(C){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(C);}if(this.preventDefault){YAHOO.util.Event.preventDefault(C);}},stopDrag:function(E,D){var C=this.dragCurrent;if(C&&!D){if(this.dragThreshMet){if(C.events.b4EndDrag){C.b4EndDrag(E);C.fireEvent("b4EndDragEvent",{e:E});}if(C.events.endDrag){C.endDrag(E);C.fireEvent("endDragEvent",{e:E});}}if(C.events.mouseUp){C.onMouseUp(E);C.fireEvent("mouseUpEvent",{e:E});}}if(this._shimActive){this._deactivateShim();if(this.dragCurrent&&this.dragCurrent.useShim){this.useShim=this._shimState;this._shimState=false;}}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(F){var C=this.dragCurrent;if(C){if(YAHOO.util.Event.isIE&&!F.button){this.stopEvent(F);return this.handleMouseUp(F);}else{if(F.clientX<0||F.clientY<0){}}if(!this.dragThreshMet){var E=Math.abs(this.startX-YAHOO.util.Event.getPageX(F));var D=Math.abs(this.startY-YAHOO.util.Event.getPageY(F));if(E>this.clickPixelThresh||D>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){if(C&&C.events.b4Drag){C.b4Drag(F);C.fireEvent("b4DragEvent",{e:F});}if(C&&C.events.drag){C.onDrag(F);C.fireEvent("dragEvent",{e:F});}if(C){this.fireEvents(F,false);}}this.stopEvent(F);}},fireEvents:function(V,L){var a=this.dragCurrent;if(!a||a.isLocked()||a.dragOnly){return;}var N=YAHOO.util.Event.getPageX(V),M=YAHOO.util.Event.getPageY(V),P=new YAHOO.util.Point(N,M),K=a.getTargetCoord(P.x,P.y),F=a.getDragEl(),E=["out","over","drop","enter"],U=new YAHOO.util.Region(K.y,K.x+F.offsetWidth,K.y+F.offsetHeight,K.x),I=[],D={},Q=[],c={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var S in this.dragOvers){var d=this.dragOvers[S];if(!this.isTypeOfDD(d)){continue;
83 }if(!this.isOverTarget(P,d,this.mode,U)){c.outEvts.push(d);}I[S]=true;delete this.dragOvers[S];}for(var R in a.groups){if("string"!=typeof R){continue;}for(S in this.ids[R]){var G=this.ids[R][S];if(!this.isTypeOfDD(G)){continue;}if(G.isTarget&&!G.isLocked()&&G!=a){if(this.isOverTarget(P,G,this.mode,U)){D[R]=true;if(L){c.dropEvts.push(G);}else{if(!I[G.id]){c.enterEvts.push(G);}else{c.overEvts.push(G);}this.dragOvers[G.id]=G;}}}}}this.interactionInfo={out:c.outEvts,enter:c.enterEvts,over:c.overEvts,drop:c.dropEvts,point:P,draggedRegion:U,sourceRegion:this.locationCache[a.id],validDrop:L};for(var C in D){Q.push(C);}if(L&&!c.dropEvts.length){this.interactionInfo.validDrop=false;if(a.events.invalidDrop){a.onInvalidDrop(V);a.fireEvent("invalidDropEvent",{e:V});}}for(S=0;S<E.length;S++){var Y=null;if(c[E[S]+"Evts"]){Y=c[E[S]+"Evts"];}if(Y&&Y.length){var H=E[S].charAt(0).toUpperCase()+E[S].substr(1),X="onDrag"+H,J="b4Drag"+H,O="drag"+H+"Event",W="drag"+H;if(this.mode){if(a.events[J]){a[J](V,Y,Q);a.fireEvent(J+"Event",{event:V,info:Y,group:Q});}if(a.events[W]){a[X](V,Y,Q);a.fireEvent(O,{event:V,info:Y,group:Q});}}else{for(var Z=0,T=Y.length;Z<T;++Z){if(a.events[J]){a[J](V,Y[Z].id,Q[0]);a.fireEvent(J+"Event",{event:V,info:Y[Z].id,group:Q[0]});}if(a.events[W]){a[X](V,Y[Z].id,Q[0]);a.fireEvent(O,{event:V,info:Y[Z].id,group:Q[0]});}}}}}},getBestMatch:function(E){var G=null;var D=E.length;if(D==1){G=E[0];}else{for(var F=0;F<D;++F){var C=E[F];if(this.mode==this.INTERSECT&&C.cursorIsOver){G=C;break;}else{if(!G||!G.overlap||(C.overlap&&G.overlap.getArea()<C.overlap.getArea())){G=C;}}}}return G;},refreshCache:function(D){var F=D||this.ids;for(var C in F){if("string"!=typeof C){continue;}for(var E in this.ids[C]){var G=this.ids[C][E];if(this.isTypeOfDD(G)){var H=this.getLocation(G);if(H){this.locationCache[G.id]=H;}else{delete this.locationCache[G.id];}}}}},verifyEl:function(D){try{if(D){var C=D.offsetParent;if(C){return true;}}}catch(E){}return false;},getLocation:function(H){if(!this.isTypeOfDD(H)){return null;}var F=H.getEl(),K,E,D,M,L,N,C,J,G;try{K=YAHOO.util.Dom.getXY(F);}catch(I){}if(!K){return null;}E=K[0];D=E+F.offsetWidth;M=K[1];L=M+F.offsetHeight;N=M-H.padding[0];C=D+H.padding[1];J=L+H.padding[2];G=E-H.padding[3];return new YAHOO.util.Region(N,C,J,G);},isOverTarget:function(K,C,E,F){var G=this.locationCache[C.id];if(!G||!this.useCache){G=this.getLocation(C);this.locationCache[C.id]=G;}if(!G){return false;}C.cursorIsOver=G.contains(K);var J=this.dragCurrent;if(!J||(!E&&!J.constrainX&&!J.constrainY)){return C.cursorIsOver;}C.overlap=null;if(!F){var H=J.getTargetCoord(K.x,K.y);var D=J.getDragEl();F=new YAHOO.util.Region(H.y,H.x+D.offsetWidth,H.y+D.offsetHeight,H.x);}var I=F.intersect(G);if(I){C.overlap=I;return(E)?true:C.cursorIsOver;}else{return false;}},_onUnload:function(D,C){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);this.ids={};},elementCache:{},getElWrapper:function(D){var C=this.elementCache[D];if(!C||!C.el){C=this.elementCache[D]=new this.ElementWrapper(YAHOO.util.Dom.get(D));}return C;},getElement:function(C){return YAHOO.util.Dom.get(C);},getCss:function(D){var C=YAHOO.util.Dom.get(D);return(C)?C.style:null;},ElementWrapper:function(C){this.el=C||null;this.id=this.el&&C.id;this.css=this.el&&C.style;},getPosX:function(C){return YAHOO.util.Dom.getX(C);},getPosY:function(C){return YAHOO.util.Dom.getY(C);},swapNode:function(E,C){if(E.swapNode){E.swapNode(C);}else{var F=C.parentNode;var D=C.nextSibling;if(D==E){F.insertBefore(E,C);}else{if(C==E.nextSibling){F.insertBefore(C,E);}else{E.parentNode.replaceChild(C,E);F.insertBefore(E,D);}}}},getScroll:function(){var E,C,F=document.documentElement,D=document.body;if(F&&(F.scrollTop||F.scrollLeft)){E=F.scrollTop;C=F.scrollLeft;}else{if(D){E=D.scrollTop;C=D.scrollLeft;}else{}}return{top:E,left:C};},getStyle:function(D,C){return YAHOO.util.Dom.getStyle(D,C);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(C,E){var D=YAHOO.util.Dom.getXY(E);YAHOO.util.Dom.setXY(C,D);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(D,C){return(D-C);},_timeoutCount:0,_addListeners:function(){var C=YAHOO.util.DDM;if(YAHOO.util.Event&&document){C._onLoad();}else{if(C._timeoutCount>2000){}else{setTimeout(C._addListeners,10);if(document&&document.body){C._timeoutCount+=1;}}}},handleWasClicked:function(C,E){if(this.isHandle(E,C.id)){return true;}else{var D=C.parentNode;while(D){if(this.isHandle(E,D.id)){return true;}else{D=D.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,useShim:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id);
84 }return this._domRef;},getDragEl:function(){return B.get(this.dragElId);},init:function(F,C,D){this.initTarget(F,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var E in this.events){this.createEvent(E+"Event");}},initTarget:function(E,C,D){this.config=D||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E);}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var C in this.config.events){if(this.config.events[C]===false){this.events[C]=false;}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);this.useShim=((this.config.useShim===true)?true:false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E];}else{if(!F&&0!==F){this.padding=[E,C,E,C];}else{this.padding=[E,C,F,D];}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){if(G&&G.style&&(G.style.display=="none")){}else{}return;}var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H);},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(C){this.dragElId=C;},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.handleElId=C;this.DDM.regHandle(this.id,C);},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);this.hasOuterHandles=true;},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(J,I){var D=J.which||J.button;if(this.primaryButtonOnly&&D>1){return;}if(this.isLocked()){return;}var C=this.b4MouseDown(J),F=true;if(this.events.b4MouseDown){F=this.fireEvent("b4MouseDownEvent",J);}var E=this.onMouseDown(J),H=true;if(this.events.mouseDown){H=this.fireEvent("mouseDownEvent",J);}if((C===false)||(E===false)||(F===false)||(H===false)){return;}this.DDM.refreshCache(this.groups);var G=new YAHOO.util.Point(A.getPageX(J),A.getPageY(J));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(G,this)){}else{if(this.clickValidator(J)){this.setStartPosition();this.DDM.handleMouseDown(J,this);this.DDM.stopEvent(J);}else{}}},clickValidator:function(D){var C=YAHOO.util.Event.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(C<this.minX){C=this.minX;}if(C>this.maxX){C=this.maxX;}}if(this.constrainY){if(F<this.minY){F=this.minY;}if(F>this.maxY){F=this.maxY;}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F};},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.invalidHandleIds[C]=C;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}delete this.invalidHandleIds[C];},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E];}}},isValidHandleChild:function(F){var E=true;var H;try{H=F.nodeName.toUpperCase();}catch(G){H=F.nodeName;}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!B.hasClass(F,this.invalidHandleClasses[D]);}return E;},setXTicks:function(F,C){this.xTicks=[];this.xTickSize=C;var E={};for(var D=this.initPageX;D>=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D);
85 }this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(I,F){if(!F){return I;}else{if(F[0]>=I){return F[0];}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E];}}return F[F.length-1];}}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D);},setDelta:function(B,A){this.deltaX=B;this.deltaY=A;},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B);},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y];}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px");}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth);},0);},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A;}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A);}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A);}if(M>B&&F<C){window.scrollTo(D+A,N);}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(A){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},b4Drag:function(A){this.setDragElPos(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(C,A,B){if(C){this.init(C,A,B);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this,A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame();},50);return;}var F=this.getDragEl(),E=YAHOO.util.Dom;if(!F){F=document.createElement("div");F.id=this.dragElId;var D=F.style;D.position="absolute";D.visibility="hidden";D.cursor="move";D.border="2px solid #aaa";D.zIndex=999;D.height="25px";D.width="25px";var C=document.createElement("div");E.setStyle(C,"height","100%");E.setStyle(C,"width","100%");E.setStyle(C,"background-color","#ccc");E.setStyle(C,"opacity","0");F.appendChild(C);A.insertBefore(F,A.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2));}this.setDragElPos(E,D);YAHOO.util.Dom.setStyle(A,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var H=YAHOO.util.Dom;var B=this.getEl();var C=this.getDragEl();var G=parseInt(H.getStyle(C,"borderTopWidth"),10);var I=parseInt(H.getStyle(C,"borderRightWidth"),10);var F=parseInt(H.getStyle(C,"borderBottomWidth"),10);var D=parseInt(H.getStyle(C,"borderLeftWidth"),10);if(isNaN(G)){G=0;}if(isNaN(I)){I=0;}if(isNaN(F)){F=0;}if(isNaN(D)){D=0;}var E=Math.max(0,B.offsetWidth-I-D);var A=Math.max(0,B.offsetHeight-G-F);H.setStyle(C,"width",E+"px");H.setStyle(C,"height",A+"px");}},b4MouseDown:function(B){this.setStartPosition();var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.autoOffset(A,C);},b4StartDrag:function(A,B){this.showFrame(A,B);},b4EndDrag:function(A){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(D){var C=YAHOO.util.Dom;var B=this.getEl();var A=this.getDragEl();C.setStyle(A,"visibility","");C.setStyle(B,"visibility","hidden");YAHOO.util.DDM.moveToEl(B,A);C.setStyle(A,"visibility","hidden");C.setStyle(B,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(C,A,B){if(C){this.initTarget(C,A,B);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.8.0r4",build:"2449"});// End of File include/javascript/yui/build/dragdrop/dragdrop-min.js
86                                 
87 /*
88 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
89 Code licensed under the BSD License:
90 http://developer.yahoo.net/yui/license.txt
91 version: 2.8.0r4
92 */
93 (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(this.initialConfig[D]&&!B.isUndefined(this.initialConfig[D])){this.setProperty(D,this.initialConfig[D]);return true;}}else{return false;}},setProperty:function(E,G,D){var F;E=E.toLowerCase();if(this.queueInProgress&&!D){this.queueProperty(E,G);return true;}else{F=this.config[E];if(F&&F.event){if(F.validator&&!F.validator(G)){return false;}else{F.value=G;if(!D){this.fireEvent(E,G);this.configChangedEvent.fire([E,G]);}return true;}}else{return false;}}},queueProperty:function(S,P){S=S.toLowerCase();var R=this.config[S],K=false,J,G,H,I,O,Q,F,M,N,D,L,T,E;if(R&&R.event){if(!B.isUndefined(P)&&R.validator&&!R.validator(P)){return false;}else{if(!B.isUndefined(P)){R.value=P;}else{P=R.value;}K=false;J=this.eventQueue.length;for(L=0;L<J;L++){G=this.eventQueue[L];if(G){H=G[0];I=G[1];if(H==S){this.eventQueue[L]=null;this.eventQueue.push([S,(!B.isUndefined(P)?P:I)]);K=true;break;}}}if(!K&&!B.isUndefined(P)){this.eventQueue.push([S,P]);}}if(R.supercedes){O=R.supercedes.length;for(T=0;T<O;T++){Q=R.supercedes[T];F=this.eventQueue.length;for(E=0;E<F;E++){M=this.eventQueue[E];if(M){N=M[0];D=M[1];if(N==Q.toLowerCase()){this.eventQueue.push([N,D]);this.eventQueue[E]=null;break;}}}}}return true;}else{return false;}},refireEvent:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event&&!B.isUndefined(E.value)){if(this.queueInProgress){this.queueProperty(D);}else{this.fireEvent(D,E.value);}}},applyConfig:function(D,G){var F,E;if(G){E={};for(F in D){if(B.hasOwnProperty(D,F)){E[F.toLowerCase()]=D[F];}}this.initialConfig=E;}for(F in D){if(B.hasOwnProperty(D,F)){this.queueProperty(F,D[F]);}}},refresh:function(){var D;for(D in this.config){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,I){var F=E.subscribers.length,D,G;if(F>0){G=F-1;do{D=E.subscribers[G];if(D&&D.obj==I&&D.fn==H){return true;}}while(G--);}return false;};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(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;
94 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,{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.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();
95 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(){var Q;if(this.element){N.purgeElement(this.element,true);Q=this.element.parentNode;}if(Q){Q.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){this.beforeShowEvent.fire();F.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();F.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(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});
96 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(R,O,X){var Q=O[0],S=F.getStyle(this.element,"visibility"),Y=this.cfg.getProperty("effect"),V=[],U=(this.platform=="mac"&&K.gecko),g=D.alreadySubscribed,W,P,f,c,b,a,d,Z,T;if(S=="inherit"){f=this.element.parentNode;while(f.nodeType!=9&&f.nodeType!=11){S=F.getStyle(f,"visibility");if(S!="inherit"){break;}f=f.parentNode;}if(S=="inherit"){S="visible";}}if(Y){if(Y instanceof Array){Z=Y.length;for(c=0;c<Z;c++){W=Y[c];V[V.length]=W.effect(this,W.duration);}}else{V[V.length]=Y.effect(this,Y.duration);}}if(Q){if(U){this.showMacGeckoScrollbars();}if(Y){if(Q){if(S!="visible"||S===""){this.beforeShowEvent.fire();T=V.length;for(b=0;b<T;b++){P=V[b];if(b===0&&!g(P.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){P.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}P.animateIn();}}}}else{if(S!="visible"||S===""){this.beforeShowEvent.fire();this._setDomVisibility(true);this.cfg.refireEvent("iframe");this.showEvent.fire();}else{this._setDomVisibility(true);}}}else{if(U){this.hideMacGeckoScrollbars();}if(Y){if(S=="visible"){this.beforeHideEvent.fire();T=V.length;for(a=0;a<T;a++){d=V[a];if(a===0&&!g(d.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){d.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}d.animateOut();}}else{if(S===""){this._setDomVisibility(false);}}}else{if(S=="visible"||S===""){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");
97 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,U,R){var Q,T;for(var P=0,O=S.length;P<O;++P){Q=S[P];T=this._findTriggerCE(Q);if(T){T[U](R,this,true);}else{this[U](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(X,P){var T=this.element,R=B.VIEWPORT_OFFSET,Z=(X=="x"),Y=(Z)?T.offsetWidth:T.offsetHeight,S=(Z)?F.getViewportWidth():F.getViewportHeight(),c=(Z)?F.getDocumentScrollLeft():F.getDocumentScrollTop(),b=(Z)?B.PREVENT_OVERLAP_X:B.PREVENT_OVERLAP_Y,O=this.cfg.getProperty("context"),U=(Y+R<S),W=this.cfg.getProperty("preventcontextoverlap")&&O&&b[(O[1]+O[2])],V=c+R,a=c+S-Y-R,Q=P;if(P<V||P>a){if(W){Q=this._preventOverlap(X,O[0],Y,S,c);}else{if(U){if(P<V){Q=V;}else{if(P>a){Q=a;}}}else{Q=V;}}}return Q;},_preventOverlap:function(X,W,Y,U,b){var Z=(X=="x"),T=B.VIEWPORT_OFFSET,S=this,Q=((Z)?F.getX(W):F.getY(W))-b,O=(Z)?W.offsetWidth:W.offsetHeight,P=Q-T,R=(U-(Q+O))-T,c=false,V=function(){var d;if((S.cfg.getProperty(X)-b)>Q){d=(Q-Y);}else{d=(Q+O);}S.cfg.setProperty(X,(d+b),true);return d;},a=function(){var e=((S.cfg.getProperty(X)-b)>Q)?R:P,d;if(Y>e){if(c){V();}else{V();c=true;d=a();}}return d;};a();return this.cfg.getProperty(X);},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;
98 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(){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);},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 J=false,H,I;if(G instanceof D){G.cfg.addProperty("manager",{value:this});this._bindFocus(G);this._bindBlur(G);this._bindDestroy(G);
99 this._syncZIndex(G);this.overlays.push(G);this.bringToTop(G);J=true;}else{if(G instanceof Array){for(H=0,I=G.length;H<I;H++){J=this.register(G[H])||J;}}}return J;},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 K=G instanceof D,I=this.overlays,M=I.length,J=null,L,H;if(K||typeof G=="string"){for(H=M-1;H>=0;H--){L=I[H];if((K&&(L===G))||(L.id==G)){J=L;break;}}}return J;},compareZIndexDesc:function(J,I){var H=(J.cfg)?J.cfg.getProperty("zIndex"):null,G=(I.cfg)?I.cfg.getProperty("zIndex"):null;if(H===null&&G===null){return 0;}else{if(H===null){return 1;}else{if(G===null){return -1;}else{if(H>G){return -1;}else{if(H<G){return 1;}else{return 0;}}}}}},showAll:function(){var H=this.overlays,I=H.length,G;for(G=I-1;G>=0;G--){H[G].show();}},hideAll:function(){var H=this.overlays,I=H.length,G;for(G=I-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);
100 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={"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.focusFirst);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{if(this.firstElement){this.firstElement.focus();}else{if(this._modalFocus){this._modalFocus.focus();}else{this.innerElement.focus();}}}catch(W){try{if(V&&Y!==document.body){Y.blur();}}catch(U){}}}}},_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;}},focusFirst:function(W,U,Y){var V=this.firstElement;if(U&&U[1]){T.stopEvent(U[1]);}if(V){try{V.focus();}catch(X){}}},focusLast:function(W,U,Y){var V=this.lastElement;
101 if(U&&U[1]){T.stopEvent(U[1]);}if(V){try{V.focus();}catch(X){}}},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(U){U=U||this.innerElement;var X={};for(var W=0;W<O.FOCUSABLE.length;W++){X[O.FOCUSABLE[W]]=true;}function V(Y){if(Y.focus&&Y.type!=="hidden"&&!Y.disabled&&X[Y.tagName.toLowerCase()]){return true;}return false;}return A.getElementsBy(V,null,U);},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.hideMaskEvent=this.createEvent(D.HIDE_MASK);this.hideMaskEvent.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(X,V,Y){var Z=V[0],W=this.close,U=this.cfg.getProperty("strings");if(Z){if(!W){if(!C){C=document.createElement("a");C.className="container-close";C.href="#";}W=C.cloneNode(true);this.innerElement.appendChild(W);W.innerHTML=(U&&U.close)?U.close:"&#160;";T.on(W,"click",this._doClose,this,true);this.close=W;}else{W.style.display="block";}}else{if(W){W.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;
102 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.mask.style.display="none";A.removeClass(document.body,"masked");this.hideMaskEvent.fire();}},showMask:function(){if(this.cfg.getProperty("modal")&&this.mask){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(){H.windowResizeEvent.unsubscribe(this.sizeMask,this);this.removeMask();if(this.close){T.purgeElement(this.close);}O.superclass.destroy.call(this);},forceUnderlayRedraw:function(){var U=this.underlay;A.addClass(U,"yui-force-redraw");setTimeout(function(){A.removeClass(U,"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 L=this._aButtons,J,K,I;if(F.isArray(L)){J=L.length;if(J>0){I=J-1;do{K=L[I];if(YAHOO.widget.Button&&K instanceof YAHOO.widget.Button){K.destroy();}else{if(K.tagName.toUpperCase()=="BUTTON"){B.purgeElement(K);B.purgeElement(K,false);}}}while(I--);}}}YAHOO.extend(A,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){A.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};
103 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.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.subscribe("changeBody",this.registerForm);this.initEvent.fire(A);},doSubmit:function(){var P=YAHOO.util.Connect,Q=this.form,K=false,N=false,R,M,L,I;switch(this.cfg.getProperty("postmethod")){case"async":R=Q.elements;M=R.length;if(M>0){L=M-1;do{if(R[L].type=="file"){K=true;break;}}while(L--);}if(K&&YAHOO.env.ua.ie&&this.isSecure){N=true;}I=this._getFormAttributes(Q);P.setForm(Q,K,N);var J=this.cfg.getProperty("postdata");var O=P.asyncRequest(I.method,I.action,this.callback,J);this.asyncSubmitEvent.fire(O);break;case"form":Q.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=this.lastButton||J;A.superclass.setTabLoop.call(this,I,J);},setFirstLastFocusable:function(){A.superclass.setFirstLastFocusable.call(this);var J,I,K,L=this.focusableElements;this.firstFormElement=null;this.lastFormElement=null;if(this.form&&L&&L.length>0){I=L.length;for(J=0;J<I;++J){K=L[J];if(this.form===K.form){this.firstFormElement=K;break;}}for(J=I-1;J>=0;--J){K=L[J];if(this.form===K.form){this.lastFormElement=K;break;}}}},configClose:function(J,I,K){A.superclass.configClose.apply(this,arguments);},_doClose:function(I){B.preventDefault(I);this.cancel();},configButtons:function(S,R,M){var N=YAHOO.widget.Button,U=R[0],K=this.innerElement,T,P,J,Q,O,I,L;D.call(this);this._aButtons=null;if(F.isArray(U)){O=document.createElement("span");O.className="button-group";Q=U.length;this._aButtons=[];this.defaultHtmlButton=null;for(L=0;L<Q;L++){T=U[L];if(N){J=new N({label:T.text});J.appendTo(O);P=J.get("element");if(T.isDefault){J.addClass("default");this.defaultHtmlButton=P;}if(F.isFunction(T.handler)){J.set("onclick",{fn:T.handler,obj:this,scope:this});}else{if(F.isObject(T.handler)&&F.isFunction(T.handler.fn)){J.set("onclick",{fn:T.handler.fn,obj:((!F.isUndefined(T.handler.obj))?T.handler.obj:this),scope:(T.handler.scope||this)});}}this._aButtons[this._aButtons.length]=J;}else{P=document.createElement("button");P.setAttribute("type","button");if(T.isDefault){P.className="default";this.defaultHtmlButton=P;}P.innerHTML=T.text;if(F.isFunction(T.handler)){B.on(P,"click",T.handler,this,true);}else{if(F.isObject(T.handler)&&F.isFunction(T.handler.fn)){B.on(P,"click",T.handler.fn,((!F.isUndefined(T.handler.obj))?T.handler.obj:this),(T.handler.scope||this));}}O.appendChild(P);this._aButtons[this._aButtons.length]=P;}T.htmlButton=P;if(L===0){this.firstButton=P;}if(L==(Q-1)){this.lastButton=P;}}this.setFooter(O);I=this.footer;if(E.inDocument(this.element)&&!E.isAncestor(K,I)){K.appendChild(I);}this.buttonSpan=O;}else{O=this.buttonSpan;I=this.footer;if(O&&I){I.removeChild(O);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,M){var J=this.firstFormElement;if(I&&I[1]){B.stopEvent(I[1]);}if(J){try{J.focus();}catch(L){}}else{if(this.defaultHtmlButton){this.focusDefaultButton();}else{this.focusFirstButton();}}},focusLast:function(K,I,M){var N=this.cfg.getProperty("buttons"),J=this.lastFormElement;if(I&&I[1]){B.stopEvent(I[1]);}if(N&&F.isArray(N)){this.focusLastButton();}else{if(J){try{J.focus();}catch(L){}}}},_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);if(I){try{I.focus();}catch(J){}}},blurButtons:function(){var N=this.cfg.getProperty("buttons"),K,M,J,I;if(N&&F.isArray(N)){K=N.length;if(K>0){I=(K-1);do{M=N[I];if(M){J=this._getButton(M.htmlButton);if(J){try{J.blur();}catch(L){}}}}while(I--);}}},focusFirstButton:function(){var L=this.cfg.getProperty("buttons"),K,I;if(L&&F.isArray(L)){K=L[0];if(K){I=this._getButton(K.htmlButton);
104 if(I){try{I.focus();}catch(J){}}}}},focusLastButton:function(){var M=this.cfg.getProperty("buttons"),J,L,I;if(M&&F.isArray(M)){J=M.length;if(J>0){L=M[(J-1)];if(L){I=this._getButton(L.htmlButton);if(I){try{I.focus();}catch(K){}}}}}},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 Y=this.form,J,R,U,L,S,P,O,I,V,K,W,Z,N,a,M,X,T;function Q(c){var b=c.tagName.toUpperCase();return((b=="INPUT"||b=="TEXTAREA"||b=="SELECT")&&c.name==L);}if(Y){J=Y.elements;R=J.length;U={};for(X=0;X<R;X++){L=J[X].name;S=E.getElementsBy(Q,"*",Y);P=S.length;if(P>0){if(P==1){S=S[0];O=S.type;I=S.tagName.toUpperCase();switch(I){case"INPUT":if(O=="checkbox"){U[L]=S.checked;}else{if(O!="radio"){U[L]=S.value;}}break;case"TEXTAREA":U[L]=S.value;break;case"SELECT":V=S.options;K=V.length;W=[];for(T=0;T<K;T++){Z=V[T];if(Z.selected){M=Z.attributes.value;W[W.length]=(M&&M.specified)?Z.value:Z.text;}}U[L]=W;break;}}else{O=S[0].type;switch(O){case"radio":for(T=0;T<P;T++){N=S[T];if(N.checked){U[L]=N.value;break;}}break;case"checkbox":W=[];for(T=0;T<P;T++){a=S[T];if(a.checked){W[W.length]=a.value;}}U[L]=W;break;}}}}}return U;},destroy:function(){D.call(this);this._aButtons=null;var I=this.element.getElementsByTagName("form"),J;if(I.length>0){J=I[0];if(J){B.purgeElement(J);if(J.parentNode){J.parentNode.removeChild(J);}this.form=null;}}A.superclass.destroy.call(this);},toString:function(){return"Dialog "+this.id;}});}());(function(){YAHOO.widget.SimpleDialog=function(E,D){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,E,D);};var C=YAHOO.util.Dom,B=YAHOO.widget.SimpleDialog,A={"ICON":{key:"icon",value:"none",suppressEvent:true},"TEXT":{key:"text",value:"",suppressEvent:true,supercedes:["icon"]}};B.ICON_BLOCK="blckicon";B.ICON_ALARM="alrticon";B.ICON_HELP="hlpicon";B.ICON_INFO="infoicon";B.ICON_WARN="warnicon";B.ICON_TIP="tipicon";B.ICON_CSS_CLASSNAME="yui-icon";B.CSS_SIMPLEDIALOG="yui-simple-dialog";YAHOO.extend(B,YAHOO.widget.Dialog,{initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);this.cfg.addProperty(A.ICON.key,{handler:this.configIcon,value:A.ICON.value,suppressEvent:A.ICON.suppressEvent});this.cfg.addProperty(A.TEXT.key,{handler:this.configText,value:A.TEXT.value,suppressEvent:A.TEXT.suppressEvent,supercedes:A.TEXT.supercedes});},init:function(E,D){B.superclass.init.call(this,E);this.beforeInitEvent.fire(B);C.addClass(this.element,B.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(D){this.cfg.applyConfig(D,true);}this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(B);},registerForm:function(){B.superclass.registerForm.call(this);this.form.innerHTML+='<input type="hidden" name="'+this.id+'" value=""/>';},configIcon:function(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){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){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateInCompleteEvent.fire();};H.handleStartAnimateOut=function(K,J,L){B.addClass(L.overlay.element,"hide-select");L.handleUnderlayStart();};H.handleCompleteAnimateOut=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}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);
105 }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.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();},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.8.0r4",build:"2449"});// End of File include/javascript/yui/build/container/container-min.js
106                                 
107 /*
108 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
109 Code licensed under the BSD License:
110 http://developer.yahoo.net/yui/license.txt
111 version: 2.8.0r4
112 */
113 (function(){var A=YAHOO.util;A.Selector={_foundCache:[],_regexCache:{},_re:{nth:/^(?:([-]?\d*)(n){1}|(odd|even)$)*([-+]?\d*)$/,attr:/(\[.*\])/g,urls:/^(?:href|src)/},document:window.document,attrAliases:{},shorthand:{"\\#(-?[_a-z]+[-\\w]*)":"[id=$1]","\\.(-?[_a-z]+[-\\w]*)":"[class~=$1]"},operators:{"=":function(B,C){return B===C;},"!=":function(B,C){return B!==C;},"~=":function(B,D){var C=" ";return(C+B+C).indexOf((C+D+C))>-1;},"|=":function(B,C){return B===C||B.slice(0,C.length+1)===C+"-";},"^=":function(B,C){return B.indexOf(C)===0;},"$=":function(B,C){return B.slice(-C.length)===C;},"*=":function(B,C){return B.indexOf(C)>-1;},"":function(B,C){return B;}},pseudos:{"root":function(B){return B===B.ownerDocument.documentElement;},"nth-child":function(B,C){return A.Selector._getNth(B,C);},"nth-last-child":function(B,C){return A.Selector._getNth(B,C,null,true);},"nth-of-type":function(B,C){return A.Selector._getNth(B,C,B.tagName);},"nth-last-of-type":function(B,C){return A.Selector._getNth(B,C,B.tagName,true);},"first-child":function(B){return A.Selector._getChildren(B.parentNode)[0]===B;},"last-child":function(C){var B=A.Selector._getChildren(C.parentNode);return B[B.length-1]===C;},"first-of-type":function(B,C){return A.Selector._getChildren(B.parentNode,B.tagName)[0];},"last-of-type":function(C,D){var B=A.Selector._getChildren(C.parentNode,C.tagName);return B[B.length-1];},"only-child":function(C){var B=A.Selector._getChildren(C.parentNode);return B.length===1&&B[0]===C;},"only-of-type":function(B){return A.Selector._getChildren(B.parentNode,B.tagName).length===1;},"empty":function(B){return B.childNodes.length===0;},"not":function(B,C){return !A.Selector.test(B,C);},"contains":function(B,D){var C=B.innerText||B.textContent||"";return C.indexOf(D)>-1;},"checked":function(B){return B.checked===true;}},test:function(F,D){F=A.Selector.document.getElementById(F)||F;if(!F){return false;}var C=D?D.split(","):[];if(C.length){for(var E=0,B=C.length;E<B;++E){if(A.Selector._test(F,C[E])){return true;}}return false;}return A.Selector._test(F,D);},_test:function(D,G,F,E){F=F||A.Selector._tokenize(G).pop()||{};if(!D.tagName||(F.tag!=="*"&&D.tagName!==F.tag)||(E&&D._found)){return false;}if(F.attributes.length){var B,H,C=A.Selector._re.urls;if(!D.attributes||!D.attributes.length){return false;}for(var I=0,K;K=F.attributes[I++];){H=(C.test(K[0]))?2:0;B=D.getAttribute(K[0],H);if(B===null||B===undefined){return false;}if(A.Selector.operators[K[1]]&&!A.Selector.operators[K[1]](B,K[2])){return false;}}}if(F.pseudos.length){for(var I=0,J=F.pseudos.length;I<J;++I){if(A.Selector.pseudos[F.pseudos[I][0]]&&!A.Selector.pseudos[F.pseudos[I][0]](D,F.pseudos[I][1])){return false;}}}return(F.previous&&F.previous.combinator!==",")?A.Selector._combinators[F.previous.combinator](D,F):true;},filter:function(E,D){E=E||[];var G,C=[],H=A.Selector._tokenize(D);if(!E.item){for(var F=0,B=E.length;F<B;++F){if(!E[F].tagName){G=A.Selector.document.getElementById(E[F]);if(G){E[F]=G;}else{}}}}C=A.Selector._filter(E,A.Selector._tokenize(D)[0]);return C;},_filter:function(E,G,H,D){var C=H?null:[],I=A.Selector._foundCache;for(var F=0,B=E.length;F<B;F++){if(!A.Selector._test(E[F],"",G,D)){continue;}if(H){return E[F];}if(D){if(E[F]._found){continue;}E[F]._found=true;I[I.length]=E[F];}C[C.length]=E[F];}return C;},query:function(C,D,E){var B=A.Selector._query(C,D,E);return B;},_query:function(H,M,N,F){var P=(N)?null:[],E;if(!H){return P;}var D=H.split(",");if(D.length>1){var O;for(var I=0,J=D.length;I<J;++I){O=A.Selector._query(D[I],M,N,true);P=N?O:P.concat(O);}A.Selector._clearFoundCache();return P;}if(M&&!M.nodeName){M=A.Selector.document.getElementById(M);if(!M){return P;}}M=M||A.Selector.document;if(M.nodeName!=="#document"){A.Dom.generateId(M);H=M.tagName+"#"+M.id+" "+H;E=M;M=M.ownerDocument;}var L=A.Selector._tokenize(H);var K=L[A.Selector._getIdTokenIndex(L)],B=[],C,G=L.pop()||{};if(K){C=A.Selector._getId(K.attributes);}if(C){E=E||A.Selector.document.getElementById(C);if(E&&(M.nodeName==="#document"||A.Dom.isAncestor(M,E))){if(A.Selector._test(E,null,K)){if(K===G){B=[E];}else{if(K.combinator===" "||K.combinator===">"){M=E;}}}}else{return P;}}if(M&&!B.length){B=M.getElementsByTagName(G.tag);}if(B.length){P=A.Selector._filter(B,G,N,F);}return P;},_clearFoundCache:function(){var E=A.Selector._foundCache;for(var C=0,B=E.length;C<B;++C){try{delete E[C]._found;}catch(D){E[C].removeAttribute("_found");}}E=[];},_getRegExp:function(D,B){var C=A.Selector._regexCache;B=B||"";if(!C[D+B]){C[D+B]=new RegExp(D,B);}return C[D+B];},_getChildren:function(){if(document.documentElement.children&&document.documentElement.children.tags){return function(C,B){return(B)?C.children.tags(B):C.children||[];};}else{return function(F,C){var E=[],G=F.childNodes;for(var D=0,B=G.length;D<B;++D){if(G[D].tagName){if(!C||G[D].tagName===C){E.push(G[D]);}}}return E;};}}(),_combinators:{" ":function(C,B){while((C=C.parentNode)){if(A.Selector._test(C,"",B.previous)){return true;}}return false;},">":function(C,B){return A.Selector._test(C.parentNode,null,B.previous);},"+":function(D,C){var B=D.previousSibling;while(B&&B.nodeType!==1){B=B.previousSibling;}if(B&&A.Selector._test(B,null,C.previous)){return true;}return false;},"~":function(D,C){var B=D.previousSibling;while(B){if(B.nodeType===1&&A.Selector._test(B,null,C.previous)){return true;}B=B.previousSibling;}return false;}},_getNth:function(C,L,N,G){A.Selector._re.nth.test(L);var K=parseInt(RegExp.$1,10),B=RegExp.$2,H=RegExp.$3,I=parseInt(RegExp.$4,10)||0,M=[],E;var J=A.Selector._getChildren(C.parentNode,N);if(H){K=2;E="+";B="n";I=(H==="odd")?1:0;}else{if(isNaN(K)){K=(B)?1:0;}}if(K===0){if(G){I=J.length-I+1;}if(J[I-1]===C){return true;}else{return false;}}else{if(K<0){G=!!G;K=Math.abs(K);}}if(!G){for(var D=I-1,F=J.length;D<F;D+=K){if(D>=0&&J[D]===C){return true;}}}else{for(var D=J.length-I,F=J.length;D>=0;D-=K){if(D<F&&J[D]===C){return true;}}}return false;},_getId:function(C){for(var D=0,B=C.length;D<B;++D){if(C[D][0]=="id"&&C[D][1]==="="){return C[D][2];
114 }}},_getIdTokenIndex:function(D){for(var C=0,B=D.length;C<B;++C){if(A.Selector._getId(D[C].attributes)){return C;}}return -1;},_patterns:{tag:/^((?:-?[_a-z]+[\w-]*)|\*)/i,attributes:/^\[([a-z]+\w*)+([~\|\^\$\*!=]=?)?['"]?([^\]]*?)['"]?\]/i,pseudos:/^:([-\w]+)(?:\(['"]?(.+)['"]?\))*/i,combinator:/^\s*([>+~]|\s)\s*/},_tokenize:function(B){var D={},H=[],I,G=false,F=A.Selector._patterns,C;B=A.Selector._replaceShorthand(B);do{G=false;for(var E in F){if(YAHOO.lang.hasOwnProperty(F,E)){if(E!="tag"&&E!="combinator"){D[E]=D[E]||[];}if((C=F[E].exec(B))){G=true;if(E!="tag"&&E!="combinator"){if(E==="attributes"&&C[1]==="id"){D.id=C[3];}D[E].push(C.slice(1));}else{D[E]=C[1];}B=B.replace(C[0],"");if(E==="combinator"||!B.length){D.attributes=A.Selector._fixAttributes(D.attributes);D.pseudos=D.pseudos||[];D.tag=D.tag?D.tag.toUpperCase():"*";H.push(D);D={previous:D};}}}}}while(G);return H;},_fixAttributes:function(C){var D=A.Selector.attrAliases;C=C||[];for(var E=0,B=C.length;E<B;++E){if(D[C[E][0]]){C[E][0]=D[C[E][0]];}if(!C[E][1]){C[E][1]="";}}return C;},_replaceShorthand:function(C){var D=A.Selector.shorthand;var E=C.match(A.Selector._re.attr);if(E){C=C.replace(A.Selector._re.attr,"REPLACED_ATTRIBUTE");}for(var G in D){if(YAHOO.lang.hasOwnProperty(D,G)){C=C.replace(A.Selector._getRegExp(G,"gi"),D[G]);}}if(E){for(var F=0,B=E.length;F<B;++F){C=C.replace("REPLACED_ATTRIBUTE",E[F]);}}return C;}};if(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<8){A.Selector.attrAliases["class"]="className";A.Selector.attrAliases["for"]="htmlFor";}})();YAHOO.register("selector",YAHOO.util.Selector,{version:"2.8.0r4",build:"2449"});// End of File include/javascript/yui/build/selector/selector-min.js
115                                 
116
117 /* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
118
119 /**
120  * @class a YAHOO.util.DDProxy implementation. During the drag over event, the
121  * dragged element is inserted before the dragged-over element.
122  *
123  * @extends YAHOO.util.DDProxy
124  * @constructor
125  * @param {String} id the id of the linked element
126  * @param {String} sGroup the group of related DragDrop objects
127  */
128 function ygDDList(id, sGroup) {
129
130         if (id) {
131                 this.init(id, sGroup);
132                 this.initFrame();
133                 //this.logger = new ygLogger("ygDDList");
134         }
135
136         var s = this.getDragEl().style;
137         s.borderColor = "transparent";
138         s.backgroundColor = "#f6f5e5";
139         s.opacity = 0.76;
140         s.filter = "alpha(opacity=76)";
141 }
142
143 ygDDList.prototype = new YAHOO.util.DDProxy();
144
145 ygDDList.prototype.borderDiv = null;
146 ygDDList.prototype.originalDisplayProperties = Array();
147
148 ygDDList.prototype.startDrag = function(x, y) {
149         //this.logger.debug(this.id + " startDrag");
150
151         var dragEl = this.getDragEl();
152         var clickEl = this.getEl();
153
154         dragEl.innerHTML = clickEl.innerHTML;
155         dragElObjects = dragEl.getElementsByTagName('object');
156
157         
158         dragEl.className = clickEl.className;
159         dragEl.style.color = clickEl.style.color;
160         dragEl.style.border = "1px solid #aaa";
161
162         // save the style of the object 
163         clickElRegion = YAHOO.util.Dom.getRegion(clickEl);
164         
165         this.borderDiv = document.createElement('div'); // create a div to display border
166         this.borderDiv.style.height = (clickElRegion.bottom - clickElRegion.top) + 'px';
167         this.borderDiv.style.border = '2px dashed #cccccc';
168         
169         for(i in clickEl.childNodes) { // hide contents of the target elements contents
170                 if(typeof clickEl.childNodes[i].style != 'undefined') {
171                         this.originalDisplayProperties[i] = clickEl.childNodes[i].style.display;
172                         clickEl.childNodes[i].style.display = 'none';
173                 }
174
175         }
176         clickEl.appendChild(this.borderDiv);
177 };
178
179 ygDDList.prototype.endDrag = function(e) {
180         // disable moving the linked element
181         var clickEl = this.getEl();
182
183         clickEl.removeChild(this.borderDiv); // remove border div
184         
185         for(i in clickEl.childNodes) { // show target elements contents
186                 if(typeof clickEl.childNodes[i].style != 'undefined') {
187                         clickEl.childNodes[i].style.display = this.originalDisplayProperties[i];
188                 }
189         }
190         
191         if(this.clickHeight) 
192             clickEl.style.height = this.clickHeight;
193         else 
194                 clickEl.style.height = '';
195         
196         if(this.clickBorder) 
197             clickEl.style.border = this.clickBorder;
198         else 
199                 clickEl.style.border = '';
200                 
201         dragEl = this.getDragEl();
202         dragEl.innerHTML = '';
203
204         this.afterEndDrag(e);
205 };
206
207 ygDDList.prototype.afterEndDrag = function(e) {
208
209 }
210
211 ygDDList.prototype.onDrag = function(e, id) {
212     
213 };
214
215 ygDDList.prototype.onDragOver = function(e, id) {
216         // this.logger.debug(this.id.toString() + " onDragOver " + id);
217         var el;
218         
219     if ("string" == typeof id) {
220         el = YAHOO.util.DDM.getElement(id);
221     } else { 
222         el = YAHOO.util.DDM.getBestMatch(id).getEl();
223     }
224     
225         dragEl = this.getDragEl();
226         elRegion = YAHOO.util.Dom.getRegion(el);
227             
228 //    this.logger.debug('id: ' + el.id);
229 //    this.logger.debug('size: ' + (elRegion.bottom - elRegion.top));
230 //    this.logger.debug('getPosY: ' + YAHOO.util.DDM.getPosY(el));
231         var mid = YAHOO.util.DDM.getPosY(el) + (Math.floor((elRegion.bottom - elRegion.top) / 2));
232 //    this.logger.debug('mid: ' + mid);
233         
234 //    this.logger.debug(YAHOO.util.DDM.getPosY(dragEl) + " <  " + mid);
235 //    this.logger.debug("Y: " + YAHOO.util.Event.getPageY(e));
236         
237         if (YAHOO.util.DDM.getPosY(dragEl) < mid ) { // insert on top triggering item
238                 var el2 = this.getEl();
239                 var p = el.parentNode;
240                 p.insertBefore(el2, el);
241         }
242         if (YAHOO.util.DDM.getPosY(dragEl) >= mid ) { // insert below triggered item
243                 var el2 = this.getEl();
244                 var p = el.parentNode;
245                 p.insertBefore(el2, el.nextSibling);
246         }
247 };
248
249 ygDDList.prototype.onDragEnter = function(e, id) {
250         // this.logger.debug(this.id.toString() + " onDragEnter " + id);
251         // this.getDragEl().style.border = "1px solid #449629";
252 };
253
254 ygDDList.prototype.onDragOut = function(e, id) {
255     // I need to know when we are over nothing
256         // this.getDragEl().style.border = "1px solid #964428";
257 }
258
259 /////////////////////////////////////////////////////////////////////////////
260
261 function ygDDListBoundary(id, sGroup) {
262         if (id) {
263                 this.init(id, sGroup);
264                 //this.logger = new ygLogger("ygDDListBoundary");
265                 this.isBoundary = true;
266         }
267 }
268
269 ygDDListBoundary.prototype = new YAHOO.util.DDTarget();
270 // End of File include/javascript/yui/ygDDList.js
271                                 
272 /*
273 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
274 Code licensed under the BSD License:
275 http://developer.yahoo.net/yui/license.txt
276 version: 2.8.0r4
277 */
278 (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,_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(!(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,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();}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;
279 }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);
280 }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(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;
281 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):this.liveData(oRequest);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||{};
282 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){lang.augmentObject(util.DataSource,util.LocalDataSource);return new util.LocalDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_XHR){lang.augmentObject(util.DataSource,util.XHRDataSource);return new util.XHRDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_SCRIPTNODE){lang.augmentObject(util.DataSource,util.ScriptNodeDataSource);return new util.ScriptNodeDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_JSFUNCTION){lang.augmentObject(util.DataSource,util.FunctionDataSource);return new util.FunctionDataSource(oLiveData,oConfigs);}}}}}if(YAHOO.lang.isString(oLiveData)){lang.augmentObject(util.DataSource,util.XHRDataSource);return new util.XHRDataSource(oLiveData,oConfigs);}else{if(YAHOO.lang.isFunction(oLiveData)){lang.augmentObject(util.DataSource,util.FunctionDataSource);return new util.FunctionDataSource(oLiveData,oConfigs);}else{lang.augmentObject(util.DataSource,util.LocalDataSource);return new util.LocalDataSource(oLiveData,oConfigs);}}};lang.augmentObject(util.DataSource,DS);})();YAHOO.util.Number={format:function(B,E){if(!isFinite(+B)){return"";}B=!isFinite(+B)?0:+B;E=YAHOO.lang.merge(YAHOO.util.Number.format.defaults,(E||{}));var C=B<0,F=Math.abs(B),A=E.decimalPlaces,I=E.thousandsSeparator,H,G,D;if(A<0){H=F-(F%1)+"";D=H.length+A;if(D>0){H=Number("."+H).toFixed(D).slice(2)+new Array(H.length-D+1).join("0");}else{H="0";}}else{H=F<1&&F>=0.5&&!A?"1":F.toFixed(A);}if(F>1000){G=H.split(/\D/);D=G[0].length%3||3;G[0]=G[0].slice(0,D)+G[0].slice(D).replace(/(\d{3})/g,I+"$1");H=G.join(E.decimalSeparator);}H=E.prefix+H+E.suffix;return C?E.negativeFormat.replace(/#/,H):H;}};YAHOO.util.Number.format.defaults={decimalSeparator:".",decimalPlaces:null,thousandsSeparator:"",prefix:"",suffix:"",negativeFormat:"-#"};(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(D,C){return C.a[D.getDay()];},A:function(D,C){return C.A[D.getDay()];},b:function(D,C){return C.b[D.getMonth()];},B:function(D,C){return C.B[D.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(E){var F=E.getFullYear();var D=parseInt(B.formats.V(E),10);var C=parseInt(B.formats.W(E),10);if(C>D){F++;}else{if(C===0&&D>=52){F--;}}return F;},H:["getHours","0"],I:function(D){var C=D.getHours()%12;return A(C===0?12:C,0);},j:function(G){var F=new Date(""+G.getFullYear()+"/1/1 GMT");var D=new Date(""+G.getFullYear()+"/"+(G.getMonth()+1)+"/"+G.getDate()+" GMT");var C=D-F;var E=parseInt(C/60000/60/24,10)+1;return A(E,0,100);},k:["getHours"," "],l:function(D){var C=D.getHours()%12;return A(C===0?12:C," ");},m:function(C){return A(C.getMonth()+1,0);},M:["getMinutes","0"],p:function(D,C){return C.p[D.getHours()>=12?1:0];},P:function(D,C){return C.P[D.getHours()>=12?1:0];},s:function(D,C){return parseInt(D.getTime()/1000,10);},S:["getSeconds","0"],u:function(C){var D=C.getDay();return D===0?7:D;},U:function(F){var C=parseInt(B.formats.j(F),10);var E=6-F.getDay();var D=parseInt((C+E)/7,10);return A(D,0);},V:function(F){var E=parseInt(B.formats.W(F),10);var C=(new Date(""+F.getFullYear()+"/1/1")).getDay();var D=E+(C>4||C<=1?0:1);if(D===53&&(new Date(""+F.getFullYear()+"/12/31")).getDay()<4){D=1;}else{if(D===0){D=B.formats.V(new Date(""+(F.getFullYear()-1)+"/12/31"));}}return A(D,0);},w:"getDay",W:function(F){var C=parseInt(B.formats.j(F),10);var E=7-B.formats.u(F);var D=parseInt((C+E)/7,10);return A(D,0,10);},y:function(C){return A(C.getFullYear()%100,0);},Y:"getFullYear",z:function(E){var D=E.getTimezoneOffset();var C=A(parseInt(Math.abs(D/60),10),0);var F=A(Math.abs(D%60),0);return(D>0?"-":"+")+C+F;},Z:function(C){var D=C.toString().replace(/^.*:\d\d( GMT[+-]\d+)? \(?([A-Za-z ]+)\)?\d*$/,"$2").replace(/[a-z ]/g,"");if(D.length>4){D=B.formats.z(C);}return D;},"%":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]+$/,"");
283 }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.8.0r4",build:"2449"});// End of File include/javascript/yui/build/datasource/datasource-min.js
284                                 
285 /*
286 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
287 Code licensed under the BSD License:
288 http://developer.yahoo.net/yui/license.txt
289 version: 2.8.0r4
290 */
291 (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(keys.hasOwnProperty(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){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.8.0r4",build:"2449"});// End of File include/javascript/yui/build/json/json-min.js
292                                 
293 /*
294 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
295 Code licensed under the BSD License:
296 http://developer.yahoo.net/yui/license.txt
297 version: 2.8.0r4
298 */
299 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.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;
300 };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(K,M,Q,L){if(L&&L.argument&&L.argument.query){K=L.argument.query;}if(K&&K!==""){Q=YAHOO.widget.AutoComplete._cloneObject(Q);var I=L.scope,P=this,C=Q.results,N=[],B=I.maxResultsDisplayed,J=(P.queryMatchCase||I.queryMatchCase),A=(P.queryMatchContains||I.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 O=this.responseSchema.fields[0].key||this.responseSchema.fields[0];E=F[O];}else{if(this.key){E=F[this.key];}}}}if(YAHOO.lang.isString(E)){var G=(J)?E.indexOf(decodeURIComponent(K)):E.toLowerCase().indexOf(decodeURIComponent(K).toLowerCase());if((!A&&(G===0))||(A&&(G>-1))){N.push(F);}}if(H>B&&N.length===B){break;}}Q.results=N;}else{}return Q;};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.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.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;
301 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;
302 }}if(this.dataSource.responseStripAfter){this.dataSource.doBeforeParseData=this.preparseRawResponse;}if(this.applyLocalFilter){this.dataSource.doBeforeCallback=this.filterResults;}var B=this.generateRequest(D);this.dataRequestEvent.fire(this,D,B);this.dataSource.sendRequest(B,{success:this.handleResponse,failure:this.handleResponse,scope:this,argument:{query:D}});};YAHOO.widget.AutoComplete.prototype._populateListItem=function(B,A,C){B.innerHTML=this.formatResult(A,C,B._sResultMatch);};YAHOO.widget.AutoComplete.prototype._populateList=function(K,F,C){if(this._nTypeAheadDelayID!=-1){clearTimeout(this._nTypeAheadDelayID);}K=(C&&C.query)?C.query:K;var H=this.doBeforeLoadData(K,F,C);if(H&&!F.error){this.dataReturnEvent.fire(this,K,F.results);if(this._bFocused){var M=decodeURIComponent(K);this._sCurQuery=M;this._bItemSelected=false;var R=F.results,A=Math.min(R.length,this.maxResultsDisplayed),J=(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 I=this._elList.childNodes;for(var Q=A-1;Q>=0;Q--){var P=I[Q],E=R[Q];if(this.resultTypeList){var B=[];B[0]=(YAHOO.lang.isString(E))?E:E[J]||E[this.key];var L=this.dataSource.responseSchema.fields;if(YAHOO.lang.isArray(L)&&(L.length>1)){for(var N=1,S=L.length;N<S;N++){B[B.length]=E[L[N].key||L[N]];}}else{if(YAHOO.lang.isArray(E)){B=E;}else{if(YAHOO.lang.isString(E)){B=[E];}else{B[1]=E;}}}E=B;}P._sResultMatch=(YAHOO.lang.isString(E))?E:(YAHOO.lang.isArray(E))?E[0]:(E[J]||"");P._oResultData=E;this._populateListItem(P,E,M);P.style.display="";}if(A<I.length){var G;for(var O=I.length-1;O>=A;O--){G=I[O];G.style.display="none";}}this._nDisplayedItems=A;this.containerPopulateEvent.fire(this,K,R);if(this.autoHighlight){var D=this._elList.firstChild;this._toggleHighlight(D,"to");this.itemArrowToEvent.fire(this,D);this._typeAhead(D,K);}else{this._toggleHighlight(this._elCurListItem,"from");}H=this._doBeforeExpandContainer(this._elTextbox,this._elContainer,K,R);this._toggleContainer(H);}else{this._toggleContainer(false);}return;}}else{this.dataErrorEvent.fire(this,K,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.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;
303 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);}}};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;
304 }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.8.0r4",build:"2449"});// End of File include/javascript/yui/build/autocomplete/autocomplete-min.js
305                                 
306 /*********************************************************************************
307  * SugarCRM Community Edition is a customer relationship management program developed by
308  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
309  *
310  * This program is free software; you can redistribute it and/or modify it under
311  * the terms of the GNU Affero General Public License version 3 as published by the
312  * Free Software Foundation with the addition of the following permission added
313  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
314  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
315  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
316  *
317  * This program is distributed in the hope that it will be useful, but WITHOUT
318  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
319  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
320  * details.
321  *
322  * You should have received a copy of the GNU Affero General Public License along with
323  * this program; if not, see http://www.gnu.org/licenses or write to the Free
324  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
325  * 02110-1301 USA.
326  *
327  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
328  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
329  *
330  * The interactive user interfaces in modified source and object code versions
331  * of this program must display Appropriate Legal Notices, as required under
332  * Section 5 of the GNU Affero General Public License version 3.
333  *
334  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
335  * these Appropriate Legal Notices must retain the display of the "Powered by
336  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
337  * technical reasons, the Appropriate Legal Notices must display the words
338  * "Powered by SugarCRM".
339  ********************************************************************************/
340 function enableQS(noReload){YAHOO.util.Event.onDOMReady(function(){if(typeof sqs_objects=='undefined'){return;}
341 var Dom=YAHOO.util.Dom;var qsFields=Dom.getElementsByClassName('sqsEnabled');for(qsField in qsFields){if(typeof qsFields[qsField]=='function'||typeof qsFields[qsField].id=='undefined'){continue;}
342 form_id=qsFields[qsField].form.getAttribute('id');if(typeof form_id=='object'&&qsFields[qsField].form.getAttribute('real_id')){form_id=qsFields[qsField].form.getAttribute('real_id');}
343 qs_index_id=form_id+'_'+qsFields[qsField].name;if(typeof sqs_objects[qs_index_id]=='undefined'){qs_index_id=qsFields[qsField].name;if(typeof sqs_objects[qs_index_id]=='undefined'){continue;}}
344 if(QSProcessedFieldsArray[qs_index_id]){continue;}
345 var qs_obj=sqs_objects[qs_index_id];var loaded=false;if(!document.forms[qs_obj.form]){continue;}
346 if(!document.forms[qs_obj.form].elements[qsFields[qsField].id].readOnly&&qs_obj['disable']!=true){combo_id=qs_obj.form+'_'+qsFields[qsField].id;if(Dom.get(combo_id+"_results")){loaded=true}
347 if(!loaded){QSProcessedFieldsArray[qs_index_id]=true;qsFields[qsField].form_id=form_id;var sqs=sqs_objects[qs_index_id];var resultDiv=document.createElement('div');resultDiv.id=combo_id+"_results";Dom.insertAfter(resultDiv,qsFields[qsField]);var fields=qs_obj.field_list.slice();fields[fields.length]="module";var ds=new YAHOO.util.DataSource("index.php?",{responseType:YAHOO.util.XHRDataSource.TYPE_JSON,responseSchema:{resultsList:'fields',total:'totalCount',fields:fields,metaNode:"fields",metaFields:{total:'totalCount',fields:"fields"}},connMethodPost:true});var forceSelect=!((qsFields[qsField].form&&typeof(qsFields[qsField].form)=='object'&&qsFields[qsField].form.name=='search_form')||qsFields[qsField].className.match('sqsNoAutofill')!=null);var search=new YAHOO.widget.AutoComplete(qsFields[qsField],resultDiv,ds,{typeAhead:forceSelect,forceSelection:forceSelect,fields:fields,sqs:sqs,animSpeed:0.25,qs_obj:qs_obj,inputElement:qsFields[qsField],generateRequest:function(sQuery){var out=SUGAR.util.paramsToUrl({to_pdf:'true',module:'Home',action:'quicksearchQuery',data:encodeURIComponent(YAHOO.lang.JSON.stringify(this.sqs)),query:sQuery});return out;},setFields:function(data,filter){this.updateFields(data,filter);},updateFields:function(data,filter){for(var i in this.fields){for(var key in this.qs_obj.field_list){if(this.fields[i]==this.qs_obj.field_list[key]&&document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]]&&this.qs_obj.populate_list[key].match(filter)){var displayValue=data[i].replace(/&amp;/gi,'&').replace(/&lt;/gi,'<').replace(/&gt;/gi,'>').replace(/&#039;/gi,'\'').replace(/&quot;/gi,'"');document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]].value=displayValue;}}}},clearFields:function(){for(var key in this.qs_obj.field_list){if(document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]]){document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]].value="";}}
348 this.oldValue="";}});if(/^(billing_|shipping_)?account_name$/.exec(qsFields[qsField].name))
349 {search.clearFields=function(){};search.setFields=function(data,filter)
350 {var label_str='';var label_data_str='';var current_label_data_str='';var label_data_hash=new Array();for(var i in this.fields){for(var key in this.qs_obj.field_list){if(this.fields[i]==this.qs_obj.field_list[key]&&document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]]&&document.getElementById(this.qs_obj.populate_list[key]+'_label')&&this.qs_obj.populate_list[key].match(filter)){var displayValue=data[i].replace(/&amp;/gi,'&').replace(/&lt;/gi,'<').replace(/&gt;/gi,'>').replace(/&#039;/gi,'\'').replace(/&quot;/gi,'"');var data_label=document.getElementById(this.qs_obj.populate_list[key]+'_label').innerHTML.replace(/\n/gi,'');label_and_data=data_label+' '+displayValue;if(document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]]&&!label_data_hash[data_label])
351 {label_str+=data_label+' \n';label_data_str+=label_and_data+'\n';label_data_hash[data_label]=true;current_label_data_str+=data_label+' '+document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]].value+'\n';}}}}
352 if(label_str!=current_label_data_str&&current_label_data_str!=label_data_str){module_key=(typeof document.forms[form_id].elements['module']!='undefined')?document.forms[form_id].elements['module'].value:'app_strings';warning_label=SUGAR.language.translate(module_key,'NTC_OVERWRITE_ADDRESS_PHONE_CONFIRM')+'\n\n'+label_data_str;if(!confirm(warning_label))
353 {this.updateFields(data,/account_id/);}else{if(Dom.get('shipping_checkbox'))
354 {if(this.inputElement.id=='shipping_account_name')
355 {filter=Dom.get('shipping_checkbox').checked?/(account_id|office_phone)/:filter;}else if(this.inputElement.id=='billing_account_name'){filter=Dom.get('shipping_checkbox').checked?filter:/(account_id|office_phone|billing)/;}}else if(Dom.get('alt_checkbox')){filter=Dom.get('alt_checkbox').checked?filter:/^(?!alt)/;}
356 this.updateFields(data,filter);}}else{this.updateFields(data,filter);}};}
357 if(typeof(SUGAR.config.quicksearch_querydelay)!='undefined'){search.queryDelay=SUGAR.config.quicksearch_querydelay;}
358 search.itemSelectEvent.subscribe(function(e,args){var data=args[2];var fields=this.fields;this.setFields(data,/\S/);if(typeof(this.qs_obj['post_onblur_function'])!='undefined'){collection_extended=new Array();for(var i in fields){for(var key in this.qs_obj.field_list){if(fields[i]==this.qs_obj.field_list[key]){collection_extended[this.qs_obj.field_list[key]]=data[i];}}}
359 eval(this.qs_obj['post_onblur_function']+'(collection_extended, this.qs_obj.id)');}});search.textboxFocusEvent.subscribe(function(){this.oldValue=this.getInputEl().value;});search.selectionEnforceEvent.subscribe(function(e,args){if(this.oldValue!=args[1]){this.clearFields();}else{this.getInputEl().value=this.oldValue;}});search.dataReturnEvent.subscribe(function(e,args){if(this.getInputEl().value.length==0&&args[2].length>0){var data=[];for(var key in this.qs_obj.field_list){data[data.length]=args[2][0][this.qs_obj.field_list[key]];}
360 this.getInputEl().value=data[this.key];this.itemSelectEvent.fire(this,"",data);}});search.typeAheadEvent.subscribe(function(e,args){this.getInputEl().value=this.getInputEl().value.replace(/&amp;/gi,'&').replace(/&lt;/gi,'<').replace(/&gt;/gi,'>').replace(/&#039;/gi,'\'').replace(/&quot;/gi,'"');});if(typeof QSFieldsArray[combo_id]=='undefined'&&qsFields[qsField].id){QSFieldsArray[combo_id]=search;}}}}});}
361 function registerSingleSmartInputListener(input){if((c=input.className)&&(c.indexOf("sqsEnabled")!=-1)){enableQS(true);}}
362 if(typeof QSFieldsArray=='undefined'){QSFieldsArray=new Array();QSProcessedFieldsArray=new Array();}// End of File include/javascript/quicksearch.js
363                                 
364 /*
365 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
366 Code licensed under the BSD License:
367 http://developer.yahoo.net/yui/license.txt
368 version: 2.8.0r4
369 */
370 (function(){var K=YAHOO.env.ua,C=YAHOO.util.Dom,Z=YAHOO.util.Event,H=YAHOO.lang,T="DIV",P="hd",M="bd",O="ft",X="LI",A="disabled",D="mouseover",F="mouseout",U="mousedown",G="mouseup",V="click",B="keydown",N="keyup",I="keypress",L="clicktohide",S="position",Q="dynamic",Y="showdelay",J="selected",E="visible",W="UL",R="MenuManager";YAHOO.widget.MenuManager=function(){var l=false,d={},o={},h={},c={"click":"clickEvent","mousedown":"mouseDownEvent","mouseup":"mouseUpEvent","mouseover":"mouseOverEvent","mouseout":"mouseOutEvent","keydown":"keyDownEvent","keyup":"keyUpEvent","keypress":"keyPressEvent","focus":"focusEvent","focusin":"focusEvent","blur":"blurEvent","focusout":"blurEvent"},i=null;function b(r){var p,q;if(r&&r.tagName){switch(r.tagName.toUpperCase()){case T:p=r.parentNode;if((C.hasClass(r,P)||C.hasClass(r,M)||C.hasClass(r,O))&&p&&p.tagName&&p.tagName.toUpperCase()==T){q=p;}else{q=r;}break;case X:q=r;break;default:p=r.parentNode;if(p){q=b(p);}break;}}return q;}function e(t){var p=Z.getTarget(t),q=b(p),u=true,w=t.type,x,r,s,z,y;if(q){r=q.tagName.toUpperCase();if(r==X){s=q.id;if(s&&h[s]){z=h[s];y=z.parent;}}else{if(r==T){if(q.id){y=d[q.id];}}}}if(y){x=c[w];if(w=="click"&&(K.gecko&&y.platform!="mac")&&t.button>0){u=false;}if(u&&z&&!z.cfg.getProperty(A)){z[x].fire(t);}if(u){y[x].fire(t,z);}}else{if(w==U){for(var v in o){if(H.hasOwnProperty(o,v)){y=o[v];if(y.cfg.getProperty(L)&&!(y instanceof YAHOO.widget.MenuBar)&&y.cfg.getProperty(S)==Q){y.hide();if(K.ie&&p.focus){p.setActive();}}else{if(y.cfg.getProperty(Y)>0){y._cancelShowDelay();}if(y.activeItem){y.activeItem.blur();y.activeItem.cfg.setProperty(J,false);y.activeItem=null;}}}}}}}function n(q,p,r){if(d[r.id]){this.removeMenu(r);}}function k(q,p){var r=p[1];if(r){i=r;}}function f(q,p){i=null;}function a(r,q){var p=q[0],s=this.id;if(p){o[s]=this;}else{if(o[s]){delete o[s];}}}function j(q,p){m(this);}function m(q){var p=q.id;if(p&&h[p]){if(i==q){i=null;}delete h[p];q.destroyEvent.unsubscribe(j);}}function g(q,p){var s=p[0],r;if(s instanceof YAHOO.widget.MenuItem){r=s.id;if(!h[r]){h[r]=s;s.destroyEvent.subscribe(j);}}}return{addMenu:function(q){var p;if(q instanceof YAHOO.widget.Menu&&q.id&&!d[q.id]){d[q.id]=q;if(!l){p=document;Z.on(p,D,e,this,true);Z.on(p,F,e,this,true);Z.on(p,U,e,this,true);Z.on(p,G,e,this,true);Z.on(p,V,e,this,true);Z.on(p,B,e,this,true);Z.on(p,N,e,this,true);Z.on(p,I,e,this,true);Z.onFocus(p,e,this,true);Z.onBlur(p,e,this,true);l=true;}q.cfg.subscribeToConfigEvent(E,a);q.destroyEvent.subscribe(n,q,this);q.itemAddedEvent.subscribe(g);q.focusEvent.subscribe(k);q.blurEvent.subscribe(f);}},removeMenu:function(s){var q,p,r;if(s){q=s.id;if((q in d)&&(d[q]==s)){p=s.getItems();if(p&&p.length>0){r=p.length-1;do{m(p[r]);}while(r--);}delete d[q];if((q in o)&&(o[q]==s)){delete o[q];}if(s.cfg){s.cfg.unsubscribeFromConfigEvent(E,a);}s.destroyEvent.unsubscribe(n,s);s.itemAddedEvent.unsubscribe(g);s.focusEvent.unsubscribe(k);s.blurEvent.unsubscribe(f);}}},hideVisible:function(){var p;for(var q in o){if(H.hasOwnProperty(o,q)){p=o[q];if(!(p instanceof YAHOO.widget.MenuBar)&&p.cfg.getProperty(S)==Q){p.hide();}}}},getVisible:function(){return o;},getMenus:function(){return d;},getMenu:function(q){var p;if(q in d){p=d[q];}return p;},getMenuItem:function(q){var p;if(q in h){p=h[q];}return p;},getMenuItemGroup:function(t){var q=C.get(t),p,v,u,r,s;if(q&&q.tagName&&q.tagName.toUpperCase()==W){v=q.firstChild;if(v){p=[];do{r=v.id;if(r){u=this.getMenuItem(r);if(u){p[p.length]=u;}}}while((v=v.nextSibling));if(p.length>0){s=p;}}}return s;},getFocusedMenuItem:function(){return i;},getFocusedMenu:function(){var p;if(i){p=i.parent.getRoot();}return p;},toString:function(){return R;}};}();})();(function(){var AM=YAHOO.lang,Aq="Menu",G="DIV",K="div",Am="id",AH="SELECT",e="xy",R="y",Ax="UL",L="ul",AJ="first-of-type",k="LI",h="OPTGROUP",Az="OPTION",Ah="disabled",AY="none",y="selected",At="groupindex",i="index",O="submenu",Au="visible",AX="hidedelay",Ac="position",AD="dynamic",C="static",An=AD+","+C,Q="url",M="#",V="target",AU="maxheight",T="topscrollbar",x="bottomscrollbar",d="_",P=T+d+Ah,E=x+d+Ah,b="mousemove",Av="showdelay",c="submenuhidedelay",AF="iframe",w="constraintoviewport",A4="preventcontextoverlap",AO="submenualignment",Z="autosubmenudisplay",AC="clicktohide",g="container",j="scrollincrement",Aj="minscrollheight",A2="classname",Ag="shadow",Ar="keepopen",A0="hd",D="hastitle",p="context",u="",Ak="mousedown",Ae="keydown",Ao="height",U="width",AQ="px",Ay="effect",AE="monitorresize",AW="display",AV="block",J="visibility",z="absolute",AS="zindex",l="yui-menu-body-scrolled",AK="&#32;",A1=" ",Ai="mouseover",H="mouseout",AR="itemAdded",n="itemRemoved",AL="hidden",s="yui-menu-shadow",AG=s+"-visible",m=s+A1+AG;YAHOO.widget.Menu=function(A6,A5){if(A5){this.parent=A5.parent;this.lazyLoad=A5.lazyLoad||A5.lazyload;this.itemData=A5.itemData||A5.itemdata;}YAHOO.widget.Menu.superclass.constructor.call(this,A6,A5);};function B(A6){var A5=false;if(AM.isString(A6)){A5=(An.indexOf((A6.toLowerCase()))!=-1);}return A5;}var f=YAHOO.util.Dom,AA=YAHOO.util.Event,Aw=YAHOO.widget.Module,AB=YAHOO.widget.Overlay,r=YAHOO.widget.Menu,A3=YAHOO.widget.MenuManager,F=YAHOO.util.CustomEvent,As=YAHOO.env.ua,Ap,AT=false,Ad,Ab=[["mouseOverEvent",Ai],["mouseOutEvent",H],["mouseDownEvent",Ak],["mouseUpEvent","mouseup"],["clickEvent","click"],["keyPressEvent","keypress"],["keyDownEvent",Ae],["keyUpEvent","keyup"],["focusEvent","focus"],["blurEvent","blur"],["itemAddedEvent",AR],["itemRemovedEvent",n]],AZ={key:Au,value:false,validator:AM.isBoolean},AP={key:w,value:true,validator:AM.isBoolean,supercedes:[AF,"x",R,e]},AI={key:A4,value:true,validator:AM.isBoolean,supercedes:[w]},S={key:Ac,value:AD,validator:B,supercedes:[Au,AF]},A={key:AO,value:["tl","tr"]},t={key:Z,value:true,validator:AM.isBoolean,suppressEvent:true},Y={key:Av,value:250,validator:AM.isNumber,suppressEvent:true},q={key:AX,value:0,validator:AM.isNumber,suppressEvent:true},v={key:c,value:250,validator:AM.isNumber,suppressEvent:true},o={key:AC,value:true,validator:AM.isBoolean,suppressEvent:true},AN={key:g,suppressEvent:true},Af={key:j,value:1,validator:AM.isNumber,supercedes:[AU],suppressEvent:true},N={key:Aj,value:90,validator:AM.isNumber,supercedes:[AU],suppressEvent:true},X={key:AU,value:0,validator:AM.isNumber,supercedes:[AF],suppressEvent:true},W={key:A2,value:null,validator:AM.isString,suppressEvent:true},a={key:Ah,value:false,validator:AM.isBoolean,suppressEvent:true},I={key:Ag,value:true,validator:AM.isBoolean,suppressEvent:true,supercedes:[Au]},Al={key:Ar,value:false,validator:AM.isBoolean};
371 function Aa(A5){Ad=AA.getTarget(A5);}YAHOO.lang.extend(r,AB,{CSS_CLASS_NAME:"yuimenu",ITEM_TYPE:null,GROUP_TITLE_TAG_NAME:"h6",OFF_SCREEN_POSITION:"-999em",_useHideDelay:false,_bHandledMouseOverEvent:false,_bHandledMouseOutEvent:false,_aGroupTitleElements:null,_aItemGroups:null,_aListElements:null,_nCurrentMouseX:0,_bStopMouseEventHandlers:false,_sClassName:null,lazyLoad:false,itemData:null,activeItem:null,parent:null,srcElement:null,init:function(A7,A6){this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuItem;}var A5;if(AM.isString(A7)){A5=f.get(A7);}else{if(A7.tagName){A5=A7;}}if(A5&&A5.tagName){switch(A5.tagName.toUpperCase()){case G:this.srcElement=A5;if(!A5.id){A5.setAttribute(Am,f.generateId());}r.superclass.init.call(this,A5);this.beforeInitEvent.fire(r);break;case AH:this.srcElement=A5;r.superclass.init.call(this,f.generateId());this.beforeInitEvent.fire(r);break;}}else{r.superclass.init.call(this,A7);this.beforeInitEvent.fire(r);}if(this.element){f.addClass(this.element,this.CSS_CLASS_NAME);this.initEvent.subscribe(this._onInit);this.beforeRenderEvent.subscribe(this._onBeforeRender);this.renderEvent.subscribe(this._onRender);this.beforeShowEvent.subscribe(this._onBeforeShow);this.hideEvent.subscribe(this._onHide);this.showEvent.subscribe(this._onShow);this.beforeHideEvent.subscribe(this._onBeforeHide);this.mouseOverEvent.subscribe(this._onMouseOver);this.mouseOutEvent.subscribe(this._onMouseOut);this.clickEvent.subscribe(this._onClick);this.keyDownEvent.subscribe(this._onKeyDown);this.keyPressEvent.subscribe(this._onKeyPress);this.blurEvent.subscribe(this._onBlur);if(!AT){AA.onFocus(document,Aa);AT=true;}if((As.gecko&&As.gecko<1.9)||As.webkit){this.cfg.subscribeToConfigEvent(R,this._onYChange);}if(A6){this.cfg.applyConfig(A6,true);}A3.addMenu(this);this.initEvent.fire(r);}},_initSubTree:function(){var A6=this.srcElement,A5,A8,BB,BC,BA,A9,A7;if(A6){A5=(A6.tagName&&A6.tagName.toUpperCase());if(A5==G){BC=this.body.firstChild;if(BC){A8=0;BB=this.GROUP_TITLE_TAG_NAME.toUpperCase();do{if(BC&&BC.tagName){switch(BC.tagName.toUpperCase()){case BB:this._aGroupTitleElements[A8]=BC;break;case Ax:this._aListElements[A8]=BC;this._aItemGroups[A8]=[];A8++;break;}}}while((BC=BC.nextSibling));if(this._aListElements[0]){f.addClass(this._aListElements[0],AJ);}}}BC=null;if(A5){switch(A5){case G:BA=this._aListElements;A9=BA.length;if(A9>0){A7=A9-1;do{BC=BA[A7].firstChild;if(BC){do{if(BC&&BC.tagName&&BC.tagName.toUpperCase()==k){this.addItem(new this.ITEM_TYPE(BC,{parent:this}),A7);}}while((BC=BC.nextSibling));}}while(A7--);}break;case AH:BC=A6.firstChild;do{if(BC&&BC.tagName){switch(BC.tagName.toUpperCase()){case h:case Az:this.addItem(new this.ITEM_TYPE(BC,{parent:this}));break;}}}while((BC=BC.nextSibling));break;}}}},_getFirstEnabledItem:function(){var A5=this.getItems(),A9=A5.length,A8,A7;for(var A6=0;A6<A9;A6++){A8=A5[A6];if(A8&&!A8.cfg.getProperty(Ah)&&A8.element.style.display!=AY){A7=A8;break;}}return A7;},_addItemToGroup:function(BA,BB,BF){var BD,BG,A8,BE,A9,A6,A7,BC;function A5(BH,BI){return(BH[BI]||A5(BH,(BI+1)));}if(BB instanceof this.ITEM_TYPE){BD=BB;BD.parent=this;}else{if(AM.isString(BB)){BD=new this.ITEM_TYPE(BB,{parent:this});}else{if(AM.isObject(BB)){BB.parent=this;BD=new this.ITEM_TYPE(BB.text,BB);}}}if(BD){if(BD.cfg.getProperty(y)){this.activeItem=BD;}BG=AM.isNumber(BA)?BA:0;A8=this._getItemGroup(BG);if(!A8){A8=this._createItemGroup(BG);}if(AM.isNumber(BF)){A9=(BF>=A8.length);if(A8[BF]){A8.splice(BF,0,BD);}else{A8[BF]=BD;}BE=A8[BF];if(BE){if(A9&&(!BE.element.parentNode||BE.element.parentNode.nodeType==11)){this._aListElements[BG].appendChild(BE.element);}else{A6=A5(A8,(BF+1));if(A6&&(!BE.element.parentNode||BE.element.parentNode.nodeType==11)){this._aListElements[BG].insertBefore(BE.element,A6.element);}}BE.parent=this;this._subscribeToItemEvents(BE);this._configureSubmenu(BE);this._updateItemProperties(BG);this.itemAddedEvent.fire(BE);this.changeContentEvent.fire();BC=BE;}}else{A7=A8.length;A8[A7]=BD;BE=A8[A7];if(BE){if(!f.isAncestor(this._aListElements[BG],BE.element)){this._aListElements[BG].appendChild(BE.element);}BE.element.setAttribute(At,BG);BE.element.setAttribute(i,A7);BE.parent=this;BE.index=A7;BE.groupIndex=BG;this._subscribeToItemEvents(BE);this._configureSubmenu(BE);if(A7===0){f.addClass(BE.element,AJ);}this.itemAddedEvent.fire(BE);this.changeContentEvent.fire();BC=BE;}}}return BC;},_removeItemFromGroupByIndex:function(A8,A6){var A7=AM.isNumber(A8)?A8:0,A9=this._getItemGroup(A7),BB,BA,A5;if(A9){BB=A9.splice(A6,1);BA=BB[0];if(BA){this._updateItemProperties(A7);if(A9.length===0){A5=this._aListElements[A7];if(this.body&&A5){this.body.removeChild(A5);}this._aItemGroups.splice(A7,1);this._aListElements.splice(A7,1);A5=this._aListElements[0];if(A5){f.addClass(A5,AJ);}}this.itemRemovedEvent.fire(BA);this.changeContentEvent.fire();}}return BA;},_removeItemFromGroupByValue:function(A8,A5){var BA=this._getItemGroup(A8),BB,A9,A7,A6;if(BA){BB=BA.length;A9=-1;if(BB>0){A6=BB-1;do{if(BA[A6]==A5){A9=A6;break;}}while(A6--);if(A9>-1){A7=this._removeItemFromGroupByIndex(A8,A9);}}}return A7;},_updateItemProperties:function(A6){var A7=this._getItemGroup(A6),BA=A7.length,A9,A8,A5;if(BA>0){A5=BA-1;do{A9=A7[A5];if(A9){A8=A9.element;A9.index=A5;A9.groupIndex=A6;A8.setAttribute(At,A6);A8.setAttribute(i,A5);f.removeClass(A8,AJ);}}while(A5--);if(A8){f.addClass(A8,AJ);}}},_createItemGroup:function(A7){var A5,A6;if(!this._aItemGroups[A7]){this._aItemGroups[A7]=[];A5=document.createElement(L);this._aListElements[A7]=A5;A6=this._aItemGroups[A7];}return A6;},_getItemGroup:function(A7){var A5=AM.isNumber(A7)?A7:0,A8=this._aItemGroups,A6;if(A5 in A8){A6=A8[A5];}return A6;},_configureSubmenu:function(A5){var A6=A5.cfg.getProperty(O);if(A6){this.cfg.configChangedEvent.subscribe(this._onParentMenuConfigChange,A6,true);this.renderEvent.subscribe(this._onParentMenuRender,A6,true);}},_subscribeToItemEvents:function(A5){A5.destroyEvent.subscribe(this._onMenuItemDestroy,A5,this);
372 A5.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange,A5,this);},_onVisibleChange:function(A7,A6){var A5=A6[0];if(A5){f.addClass(this.element,Au);}else{f.removeClass(this.element,Au);}},_cancelHideDelay:function(){var A5=this.getRoot()._hideDelayTimer;if(A5){A5.cancel();}},_execHideDelay:function(){this._cancelHideDelay();var A5=this.getRoot();A5._hideDelayTimer=AM.later(A5.cfg.getProperty(AX),this,function(){if(A5.activeItem){if(A5.hasFocus()){A5.activeItem.focus();}A5.clearActiveItem();}if(A5==this&&!(this instanceof YAHOO.widget.MenuBar)&&this.cfg.getProperty(Ac)==AD){this.hide();}});},_cancelShowDelay:function(){var A5=this.getRoot()._showDelayTimer;if(A5){A5.cancel();}},_execSubmenuHideDelay:function(A7,A6,A5){A7._submenuHideDelayTimer=AM.later(50,this,function(){if(this._nCurrentMouseX>(A6+10)){A7._submenuHideDelayTimer=AM.later(A5,A7,function(){this.hide();});}else{A7.hide();}});},_disableScrollHeader:function(){if(!this._bHeaderDisabled){f.addClass(this.header,P);this._bHeaderDisabled=true;}},_disableScrollFooter:function(){if(!this._bFooterDisabled){f.addClass(this.footer,E);this._bFooterDisabled=true;}},_enableScrollHeader:function(){if(this._bHeaderDisabled){f.removeClass(this.header,P);this._bHeaderDisabled=false;}},_enableScrollFooter:function(){if(this._bFooterDisabled){f.removeClass(this.footer,E);this._bFooterDisabled=false;}},_onMouseOver:function(BH,BA){var BI=BA[0],BE=BA[1],A5=AA.getTarget(BI),A9=this.getRoot(),BG=this._submenuHideDelayTimer,A6,A8,BD,A7,BC,BB;var BF=function(){if(this.parent.cfg.getProperty(y)){this.show();}};if(!this._bStopMouseEventHandlers){if(!this._bHandledMouseOverEvent&&(A5==this.element||f.isAncestor(this.element,A5))){if(this._useHideDelay){this._cancelHideDelay();}this._nCurrentMouseX=0;AA.on(this.element,b,this._onMouseMove,this,true);if(!(BE&&f.isAncestor(BE.element,AA.getRelatedTarget(BI)))){this.clearActiveItem();}if(this.parent&&BG){BG.cancel();this.parent.cfg.setProperty(y,true);A6=this.parent.parent;A6._bHandledMouseOutEvent=true;A6._bHandledMouseOverEvent=false;}this._bHandledMouseOverEvent=true;this._bHandledMouseOutEvent=false;}if(BE&&!BE.handledMouseOverEvent&&!BE.cfg.getProperty(Ah)&&(A5==BE.element||f.isAncestor(BE.element,A5))){A8=this.cfg.getProperty(Av);BD=(A8>0);if(BD){this._cancelShowDelay();}A7=this.activeItem;if(A7){A7.cfg.setProperty(y,false);}BC=BE.cfg;BC.setProperty(y,true);if(this.hasFocus()||A9._hasFocus){BE.focus();A9._hasFocus=false;}if(this.cfg.getProperty(Z)){BB=BC.getProperty(O);if(BB){if(BD){A9._showDelayTimer=AM.later(A9.cfg.getProperty(Av),BB,BF);}else{BB.show();}}}BE.handledMouseOverEvent=true;BE.handledMouseOutEvent=false;}}},_onMouseOut:function(BD,A7){var BE=A7[0],BB=A7[1],A8=AA.getRelatedTarget(BE),BC=false,BA,A9,A5,A6;if(!this._bStopMouseEventHandlers){if(BB&&!BB.cfg.getProperty(Ah)){BA=BB.cfg;A9=BA.getProperty(O);if(A9&&(A8==A9.element||f.isAncestor(A9.element,A8))){BC=true;}if(!BB.handledMouseOutEvent&&((A8!=BB.element&&!f.isAncestor(BB.element,A8))||BC)){if(!BC){BB.cfg.setProperty(y,false);if(A9){A5=this.cfg.getProperty(c);A6=this.cfg.getProperty(Av);if(!(this instanceof YAHOO.widget.MenuBar)&&A5>0&&A6>=A5){this._execSubmenuHideDelay(A9,AA.getPageX(BE),A5);}else{A9.hide();}}}BB.handledMouseOutEvent=true;BB.handledMouseOverEvent=false;}}if(!this._bHandledMouseOutEvent&&((A8!=this.element&&!f.isAncestor(this.element,A8))||BC)){if(this._useHideDelay){this._execHideDelay();}AA.removeListener(this.element,b,this._onMouseMove);this._nCurrentMouseX=AA.getPageX(BE);this._bHandledMouseOutEvent=true;this._bHandledMouseOverEvent=false;}}},_onMouseMove:function(A6,A5){if(!this._bStopMouseEventHandlers){this._nCurrentMouseX=AA.getPageX(A6);}},_onClick:function(BG,A7){var BH=A7[0],BB=A7[1],BD=false,A9,BE,A6,A5,BA,BC,BF;var A8=function(){A6=this.getRoot();if(A6 instanceof YAHOO.widget.MenuBar||A6.cfg.getProperty(Ac)==C){A6.clearActiveItem();}else{A6.hide();}};if(BB){if(BB.cfg.getProperty(Ah)){AA.preventDefault(BH);A8.call(this);}else{A9=BB.cfg.getProperty(O);BA=BB.cfg.getProperty(Q);if(BA){BC=BA.indexOf(M);BF=BA.length;if(BC!=-1){BA=BA.substr(BC,BF);BF=BA.length;if(BF>1){A5=BA.substr(1,BF);BE=YAHOO.widget.MenuManager.getMenu(A5);if(BE){BD=(this.getRoot()===BE.getRoot());}}else{if(BF===1){BD=true;}}}}if(BD&&!BB.cfg.getProperty(V)){AA.preventDefault(BH);if(As.webkit){BB.focus();}else{BB.focusEvent.fire();}}if(!A9&&!this.cfg.getProperty(Ar)){A8.call(this);}}}},_onKeyDown:function(BK,BE){var BH=BE[0],BG=BE[1],BD,BI,A6,BA,BL,A5,BO,A9,BJ,A8,BF,BN,BB,BC;if(this._useHideDelay){this._cancelHideDelay();}function A7(){this._bStopMouseEventHandlers=true;AM.later(10,this,function(){this._bStopMouseEventHandlers=false;});}if(BG&&!BG.cfg.getProperty(Ah)){BI=BG.cfg;A6=this.parent;switch(BH.keyCode){case 38:case 40:BL=(BH.keyCode==38)?BG.getPreviousEnabledSibling():BG.getNextEnabledSibling();if(BL){this.clearActiveItem();BL.cfg.setProperty(y,true);BL.focus();if(this.cfg.getProperty(AU)>0){A5=this.body;BO=A5.scrollTop;A9=A5.offsetHeight;BJ=this.getItems();A8=BJ.length-1;BF=BL.element.offsetTop;if(BH.keyCode==40){if(BF>=(A9+BO)){A5.scrollTop=BF-A9;}else{if(BF<=BO){A5.scrollTop=0;}}if(BL==BJ[A8]){A5.scrollTop=BL.element.offsetTop;}}else{if(BF<=BO){A5.scrollTop=BF-BL.element.offsetHeight;}else{if(BF>=(BO+A9)){A5.scrollTop=BF;}}if(BL==BJ[0]){A5.scrollTop=0;}}BO=A5.scrollTop;BN=A5.scrollHeight-A5.offsetHeight;if(BO===0){this._disableScrollHeader();this._enableScrollFooter();}else{if(BO==BN){this._enableScrollHeader();this._disableScrollFooter();}else{this._enableScrollHeader();this._enableScrollFooter();}}}}AA.preventDefault(BH);A7();break;case 39:BD=BI.getProperty(O);if(BD){if(!BI.getProperty(y)){BI.setProperty(y,true);}BD.show();BD.setInitialFocus();BD.setInitialSelection();}else{BA=this.getRoot();if(BA instanceof YAHOO.widget.MenuBar){BL=BA.activeItem.getNextEnabledSibling();if(BL){BA.clearActiveItem();BL.cfg.setProperty(y,true);BD=BL.cfg.getProperty(O);if(BD){BD.show();BD.setInitialFocus();}else{BL.focus();}}}}AA.preventDefault(BH);
373 A7();break;case 37:if(A6){BB=A6.parent;if(BB instanceof YAHOO.widget.MenuBar){BL=BB.activeItem.getPreviousEnabledSibling();if(BL){BB.clearActiveItem();BL.cfg.setProperty(y,true);BD=BL.cfg.getProperty(O);if(BD){BD.show();BD.setInitialFocus();}else{BL.focus();}}}else{this.hide();A6.focus();}}AA.preventDefault(BH);A7();break;}}if(BH.keyCode==27){if(this.cfg.getProperty(Ac)==AD){this.hide();if(this.parent){this.parent.focus();}else{BC=this._focusedElement;if(BC&&BC.focus){try{BC.focus();}catch(BM){}}}}else{if(this.activeItem){BD=this.activeItem.cfg.getProperty(O);if(BD&&BD.cfg.getProperty(Au)){BD.hide();this.activeItem.focus();}else{this.activeItem.blur();this.activeItem.cfg.setProperty(y,false);}}}AA.preventDefault(BH);}},_onKeyPress:function(A7,A6){var A5=A6[0];if(A5.keyCode==40||A5.keyCode==38){AA.preventDefault(A5);}},_onBlur:function(A6,A5){if(this._hasFocus){this._hasFocus=false;}},_onYChange:function(A6,A5){var A8=this.parent,BA,A7,A9;if(A8){BA=A8.parent.body.scrollTop;if(BA>0){A9=(this.cfg.getProperty(R)-BA);f.setY(this.element,A9);A7=this.iframe;if(A7){f.setY(A7,A9);}this.cfg.setProperty(R,A9,true);}}},_onScrollTargetMouseOver:function(BB,BE){var BD=this._bodyScrollTimer;if(BD){BD.cancel();}this._cancelHideDelay();var A7=AA.getTarget(BB),A9=this.body,A8=this.cfg.getProperty(j),A5,A6;function BC(){var BF=A9.scrollTop;if(BF<A5){A9.scrollTop=(BF+A8);this._enableScrollHeader();}else{A9.scrollTop=A5;this._bodyScrollTimer.cancel();this._disableScrollFooter();}}function BA(){var BF=A9.scrollTop;if(BF>0){A9.scrollTop=(BF-A8);this._enableScrollFooter();}else{A9.scrollTop=0;this._bodyScrollTimer.cancel();this._disableScrollHeader();}}if(f.hasClass(A7,A0)){A6=BA;}else{A5=A9.scrollHeight-A9.offsetHeight;A6=BC;}this._bodyScrollTimer=AM.later(10,this,A6,null,true);},_onScrollTargetMouseOut:function(A7,A5){var A6=this._bodyScrollTimer;if(A6){A6.cancel();}this._cancelHideDelay();},_onInit:function(A6,A5){this.cfg.subscribeToConfigEvent(Au,this._onVisibleChange);var A7=!this.parent,A8=this.lazyLoad;if(((A7&&!A8)||(A7&&(this.cfg.getProperty(Au)||this.cfg.getProperty(Ac)==C))||(!A7&&!A8))&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree();}if(this.itemData){this.addItems(this.itemData);}}else{if(A8){this.cfg.fireQueue();}}},_onBeforeRender:function(A8,A7){var A9=this.element,BC=this._aListElements.length,A6=true,BB=0,A5,BA;if(BC>0){do{A5=this._aListElements[BB];if(A5){if(A6){f.addClass(A5,AJ);A6=false;}if(!f.isAncestor(A9,A5)){this.appendToBody(A5);}BA=this._aGroupTitleElements[BB];if(BA){if(!f.isAncestor(A9,BA)){A5.parentNode.insertBefore(BA,A5);}f.addClass(A5,D);}}BB++;}while(BB<BC);}},_onRender:function(A6,A5){if(this.cfg.getProperty(Ac)==AD){if(!this.cfg.getProperty(Au)){this.positionOffScreen();}}},_onBeforeShow:function(A7,A6){var A9,BC,A8,BA=this.cfg.getProperty(g);if(this.lazyLoad&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree();}if(this.itemData){if(this.parent&&this.parent.parent&&this.parent.parent.srcElement&&this.parent.parent.srcElement.tagName.toUpperCase()==AH){A9=this.itemData.length;for(BC=0;BC<A9;BC++){if(this.itemData[BC].tagName){this.addItem((new this.ITEM_TYPE(this.itemData[BC])));}}}else{this.addItems(this.itemData);}}A8=this.srcElement;if(A8){if(A8.tagName.toUpperCase()==AH){if(f.inDocument(A8)){this.render(A8.parentNode);}else{this.render(BA);}}else{this.render();}}else{if(this.parent){this.render(this.parent.element);}else{this.render(BA);}}}var BB=this.parent,A5;if(!BB&&this.cfg.getProperty(Ac)==AD){this.cfg.refireEvent(e);}if(BB){A5=BB.parent.cfg.getProperty(AO);this.cfg.setProperty(p,[BB.element,A5[0],A5[1]]);this.align();}},getConstrainedY:function(BH){var BS=this,BO=BS.cfg.getProperty(p),BV=BS.cfg.getProperty(AU),BR,BG={"trbr":true,"tlbl":true,"bltl":true,"brtr":true},BA=(BO&&BG[BO[1]+BO[2]]),BC=BS.element,BW=BC.offsetHeight,BQ=AB.VIEWPORT_OFFSET,BL=f.getViewportHeight(),BP=f.getDocumentScrollTop(),BM=(BS.cfg.getProperty(Aj)+BQ<BL),BU,BD,BJ,BK,BF=false,BE,A7,BI=BP+BQ,A9=BP+BL-BW-BQ,A5=BH;var BB=function(){var BX;if((BS.cfg.getProperty(R)-BP)>BJ){BX=(BJ-BW);}else{BX=(BJ+BK);}BS.cfg.setProperty(R,(BX+BP),true);return BX;};var A8=function(){if((BS.cfg.getProperty(R)-BP)>BJ){return(A7-BQ);}else{return(BE-BQ);}};var BN=function(){var BX;if((BS.cfg.getProperty(R)-BP)>BJ){BX=(BJ+BK);}else{BX=(BJ-BC.offsetHeight);}BS.cfg.setProperty(R,(BX+BP),true);};var A6=function(){BS._setScrollHeight(this.cfg.getProperty(AU));BS.hideEvent.unsubscribe(A6);};var BT=function(){var Ba=A8(),BX=(BS.getItems().length>0),BZ,BY;if(BW>Ba){BZ=BX?BS.cfg.getProperty(Aj):BW;if((Ba>BZ)&&BX){BR=Ba;}else{BR=BV;}BS._setScrollHeight(BR);BS.hideEvent.subscribe(A6);BN();if(Ba<BZ){if(BF){BB();}else{BB();BF=true;BY=BT();}}}else{if(BR&&(BR!==BV)){BS._setScrollHeight(BV);BS.hideEvent.subscribe(A6);BN();}}return BY;};if(BH<BI||BH>A9){if(BM){if(BS.cfg.getProperty(A4)&&BA){BD=BO[0];BK=BD.offsetHeight;BJ=(f.getY(BD)-BP);BE=BJ;A7=(BL-(BJ+BK));BT();A5=BS.cfg.getProperty(R);}else{if(!(BS instanceof YAHOO.widget.MenuBar)&&BW>=BL){BU=(BL-(BQ*2));if(BU>BS.cfg.getProperty(Aj)){BS._setScrollHeight(BU);BS.hideEvent.subscribe(A6);BN();A5=BS.cfg.getProperty(R);}}else{if(BH<BI){A5=BI;}else{if(BH>A9){A5=A9;}}}}}else{A5=BQ+BP;}}return A5;},_onHide:function(A6,A5){if(this.cfg.getProperty(Ac)===AD){this.positionOffScreen();}},_onShow:function(BD,BB){var A5=this.parent,A7,A8,BA,A6;function A9(BF){var BE;if(BF.type==Ak||(BF.type==Ae&&BF.keyCode==27)){BE=AA.getTarget(BF);if(BE!=A7.element||!f.isAncestor(A7.element,BE)){A7.cfg.setProperty(Z,false);AA.removeListener(document,Ak,A9);AA.removeListener(document,Ae,A9);}}}function BC(BF,BE,BG){this.cfg.setProperty(U,u);this.hideEvent.unsubscribe(BC,BG);}if(A5){A7=A5.parent;if(!A7.cfg.getProperty(Z)&&(A7 instanceof YAHOO.widget.MenuBar||A7.cfg.getProperty(Ac)==C)){A7.cfg.setProperty(Z,true);AA.on(document,Ak,A9);AA.on(document,Ae,A9);}if((this.cfg.getProperty("x")<A7.cfg.getProperty("x"))&&(As.gecko&&As.gecko<1.9)&&!this.cfg.getProperty(U)){A8=this.element;
374 BA=A8.offsetWidth;A8.style.width=BA+AQ;A6=(BA-(A8.offsetWidth-BA))+AQ;this.cfg.setProperty(U,A6);this.hideEvent.subscribe(BC,A6);}}if(this===this.getRoot()&&this.cfg.getProperty(Ac)===AD){this._focusedElement=Ad;this.focus();}},_onBeforeHide:function(A7,A6){var A5=this.activeItem,A9=this.getRoot(),BA,A8;if(A5){BA=A5.cfg;BA.setProperty(y,false);A8=BA.getProperty(O);if(A8){A8.hide();}}if(As.ie&&this.cfg.getProperty(Ac)===AD&&this.parent){A9._hasFocus=this.hasFocus();}if(A9==this){A9.blur();}},_onParentMenuConfigChange:function(A6,A5,A9){var A7=A5[0][0],A8=A5[0][1];switch(A7){case AF:case w:case AX:case Av:case c:case AC:case Ay:case A2:case j:case AU:case Aj:case AE:case Ag:case A4:case Ar:A9.cfg.setProperty(A7,A8);break;case AO:if(!(this.parent.parent instanceof YAHOO.widget.MenuBar)){A9.cfg.setProperty(A7,A8);}break;}},_onParentMenuRender:function(A6,A5,BB){var A8=BB.parent.parent,A7=A8.cfg,A9={constraintoviewport:A7.getProperty(w),xy:[0,0],clicktohide:A7.getProperty(AC),effect:A7.getProperty(Ay),showdelay:A7.getProperty(Av),hidedelay:A7.getProperty(AX),submenuhidedelay:A7.getProperty(c),classname:A7.getProperty(A2),scrollincrement:A7.getProperty(j),maxheight:A7.getProperty(AU),minscrollheight:A7.getProperty(Aj),iframe:A7.getProperty(AF),shadow:A7.getProperty(Ag),preventcontextoverlap:A7.getProperty(A4),monitorresize:A7.getProperty(AE),keepopen:A7.getProperty(Ar)},BA;if(!(A8 instanceof YAHOO.widget.MenuBar)){A9[AO]=A7.getProperty(AO);}BB.cfg.applyConfig(A9);if(!this.lazyLoad){BA=this.parent.element;if(this.element.parentNode==BA){this.render();}else{this.render(BA);}}},_onMenuItemDestroy:function(A7,A6,A5){this._removeItemFromGroupByValue(A5.groupIndex,A5);},_onMenuItemConfigChange:function(A7,A6,A5){var A9=A6[0][0],BA=A6[0][1],A8;switch(A9){case y:if(BA===true){this.activeItem=A5;}break;case O:A8=A6[0][1];if(A8){this._configureSubmenu(A5);}break;}},configVisible:function(A7,A6,A8){var A5,A9;if(this.cfg.getProperty(Ac)==AD){r.superclass.configVisible.call(this,A7,A6,A8);}else{A5=A6[0];A9=f.getStyle(this.element,AW);f.setStyle(this.element,J,Au);if(A5){if(A9!=AV){this.beforeShowEvent.fire();f.setStyle(this.element,AW,AV);this.showEvent.fire();}}else{if(A9==AV){this.beforeHideEvent.fire();f.setStyle(this.element,AW,AY);this.hideEvent.fire();}}}},configPosition:function(A7,A6,BA){var A9=this.element,A8=A6[0]==C?C:z,BB=this.cfg,A5;f.setStyle(A9,Ac,A8);if(A8==C){f.setStyle(A9,AW,AV);BB.setProperty(Au,true);}else{f.setStyle(A9,J,AL);}if(A8==z){A5=BB.getProperty(AS);if(!A5||A5===0){BB.setProperty(AS,1);}}},configIframe:function(A6,A5,A7){if(this.cfg.getProperty(Ac)==AD){r.superclass.configIframe.call(this,A6,A5,A7);}},configHideDelay:function(A6,A5,A7){var A8=A5[0];this._useHideDelay=(A8>0);},configContainer:function(A6,A5,A8){var A7=A5[0];if(AM.isString(A7)){this.cfg.setProperty(g,f.get(A7),true);}},_clearSetWidthFlag:function(){this._widthSetForScroll=false;this.cfg.unsubscribeFromConfigEvent(U,this._clearSetWidthFlag);},_setScrollHeight:function(BG){var BC=BG,BB=false,BH=false,A8,A9,BF,A6,BE,BI,A5,BD,BA,A7;if(this.getItems().length>0){A8=this.element;A9=this.body;BF=this.header;A6=this.footer;BE=this._onScrollTargetMouseOver;BI=this._onScrollTargetMouseOut;A5=this.cfg.getProperty(Aj);if(BC>0&&BC<A5){BC=A5;}f.setStyle(A9,Ao,u);f.removeClass(A9,l);A9.scrollTop=0;BH=((As.gecko&&As.gecko<1.9)||As.ie);if(BC>0&&BH&&!this.cfg.getProperty(U)){BA=A8.offsetWidth;A8.style.width=BA+AQ;A7=(BA-(A8.offsetWidth-BA))+AQ;this.cfg.unsubscribeFromConfigEvent(U,this._clearSetWidthFlag);this.cfg.setProperty(U,A7);this._widthSetForScroll=true;this.cfg.subscribeToConfigEvent(U,this._clearSetWidthFlag);}if(BC>0&&(!BF&&!A6)){this.setHeader(AK);this.setFooter(AK);BF=this.header;A6=this.footer;f.addClass(BF,T);f.addClass(A6,x);A8.insertBefore(BF,A9);A8.appendChild(A6);}BD=BC;if(BF&&A6){BD=(BD-(BF.offsetHeight+A6.offsetHeight));}if((BD>0)&&(A9.offsetHeight>BC)){f.addClass(A9,l);f.setStyle(A9,Ao,(BD+AQ));if(!this._hasScrollEventHandlers){AA.on(BF,Ai,BE,this,true);AA.on(BF,H,BI,this,true);AA.on(A6,Ai,BE,this,true);AA.on(A6,H,BI,this,true);this._hasScrollEventHandlers=true;}this._disableScrollHeader();this._enableScrollFooter();BB=true;}else{if(BF&&A6){if(this._widthSetForScroll){this._widthSetForScroll=false;this.cfg.unsubscribeFromConfigEvent(U,this._clearSetWidthFlag);this.cfg.setProperty(U,u);}this._enableScrollHeader();this._enableScrollFooter();if(this._hasScrollEventHandlers){AA.removeListener(BF,Ai,BE);AA.removeListener(BF,H,BI);AA.removeListener(A6,Ai,BE);AA.removeListener(A6,H,BI);this._hasScrollEventHandlers=false;}A8.removeChild(BF);A8.removeChild(A6);this.header=null;this.footer=null;BB=true;}}if(BB){this.cfg.refireEvent(AF);this.cfg.refireEvent(Ag);}}},_setMaxHeight:function(A6,A5,A7){this._setScrollHeight(A7);this.renderEvent.unsubscribe(this._setMaxHeight);},configMaxHeight:function(A6,A5,A7){var A8=A5[0];if(this.lazyLoad&&!this.body&&A8>0){this.renderEvent.subscribe(this._setMaxHeight,A8,this);}else{this._setScrollHeight(A8);}},configClassName:function(A7,A6,A8){var A5=A6[0];if(this._sClassName){f.removeClass(this.element,this._sClassName);}f.addClass(this.element,A5);this._sClassName=A5;},_onItemAdded:function(A6,A5){var A7=A5[0];if(A7){A7.cfg.setProperty(Ah,true);}},configDisabled:function(A7,A6,BA){var A9=A6[0],A5=this.getItems(),BB,A8;if(AM.isArray(A5)){BB=A5.length;if(BB>0){A8=BB-1;do{A5[A8].cfg.setProperty(Ah,A9);}while(A8--);}if(A9){this.clearActiveItem(true);f.addClass(this.element,Ah);this.itemAddedEvent.subscribe(this._onItemAdded);}else{f.removeClass(this.element,Ah);this.itemAddedEvent.unsubscribe(this._onItemAdded);}}},configShadow:function(BD,A7,BC){var BB=function(){var BG=this.element,BF=this._shadow;if(BF&&BG){if(BF.style.width&&BF.style.height){BF.style.width=u;BF.style.height=u;}BF.style.width=(BG.offsetWidth+6)+AQ;BF.style.height=(BG.offsetHeight+1)+AQ;}};var BE=function(){this.element.appendChild(this._shadow);};var A9=function(){f.addClass(this._shadow,AG);};var BA=function(){f.removeClass(this._shadow,AG);
375 };var A6=function(){var BG=this._shadow,BF;if(!BG){BF=this.element;if(!Ap){Ap=document.createElement(K);Ap.className=m;}BG=Ap.cloneNode(false);BF.appendChild(BG);this._shadow=BG;this.beforeShowEvent.subscribe(A9);this.beforeHideEvent.subscribe(BA);if(As.ie){AM.later(0,this,function(){BB.call(this);this.syncIframe();});this.cfg.subscribeToConfigEvent(U,BB);this.cfg.subscribeToConfigEvent(Ao,BB);this.cfg.subscribeToConfigEvent(AU,BB);this.changeContentEvent.subscribe(BB);Aw.textResizeEvent.subscribe(BB,this,true);this.destroyEvent.subscribe(function(){Aw.textResizeEvent.unsubscribe(BB,this);});}this.cfg.subscribeToConfigEvent(AU,BE);}};var A8=function(){if(this._shadow){BE.call(this);if(As.ie){BB.call(this);}}else{A6.call(this);}this.beforeShowEvent.unsubscribe(A8);};var A5=A7[0];if(A5&&this.cfg.getProperty(Ac)==AD){if(this.cfg.getProperty(Au)){if(this._shadow){BE.call(this);if(As.ie){BB.call(this);}}else{A6.call(this);}}else{this.beforeShowEvent.subscribe(A8);}}},initEvents:function(){r.superclass.initEvents.call(this);var A6=Ab.length-1,A7,A5;do{A7=Ab[A6];A5=this.createEvent(A7[1]);A5.signature=F.LIST;this[A7[0]]=A5;}while(A6--);},positionOffScreen:function(){var A6=this.iframe,A7=this.element,A5=this.OFF_SCREEN_POSITION;A7.style.top=u;A7.style.left=u;if(A6){A6.style.top=A5;A6.style.left=A5;}},getRoot:function(){var A7=this.parent,A6,A5;if(A7){A6=A7.parent;A5=A6?A6.getRoot():this;}else{A5=this;}return A5;},toString:function(){var A6=Aq,A5=this.id;if(A5){A6+=(A1+A5);}return A6;},setItemGroupTitle:function(BA,A9){var A8,A7,A6,A5;if(AM.isString(BA)&&BA.length>0){A8=AM.isNumber(A9)?A9:0;A7=this._aGroupTitleElements[A8];if(A7){A7.innerHTML=BA;}else{A7=document.createElement(this.GROUP_TITLE_TAG_NAME);A7.innerHTML=BA;this._aGroupTitleElements[A8]=A7;}A6=this._aGroupTitleElements.length-1;do{if(this._aGroupTitleElements[A6]){f.removeClass(this._aGroupTitleElements[A6],AJ);A5=A6;}}while(A6--);if(A5!==null){f.addClass(this._aGroupTitleElements[A5],AJ);}this.changeContentEvent.fire();}},addItem:function(A5,A6){return this._addItemToGroup(A6,A5);},addItems:function(A9,A8){var BB,A5,BA,A6,A7;if(AM.isArray(A9)){BB=A9.length;A5=[];for(A6=0;A6<BB;A6++){BA=A9[A6];if(BA){if(AM.isArray(BA)){A5[A5.length]=this.addItems(BA,A6);}else{A5[A5.length]=this._addItemToGroup(A8,BA);}}}if(A5.length){A7=A5;}}return A7;},insertItem:function(A5,A6,A7){return this._addItemToGroup(A7,A5,A6);},removeItem:function(A5,A7){var A8,A6;if(!AM.isUndefined(A5)){if(A5 instanceof YAHOO.widget.MenuItem){A8=this._removeItemFromGroupByValue(A7,A5);}else{if(AM.isNumber(A5)){A8=this._removeItemFromGroupByIndex(A7,A5);}}if(A8){A8.destroy();A6=A8;}}return A6;},getItems:function(){var A8=this._aItemGroups,A6,A7,A5=[];if(AM.isArray(A8)){A6=A8.length;A7=((A6==1)?A8[0]:(Array.prototype.concat.apply(A5,A8)));}return A7;},getItemGroups:function(){return this._aItemGroups;},getItem:function(A6,A7){var A8,A5;if(AM.isNumber(A6)){A8=this._getItemGroup(A7);if(A8){A5=A8[A6];}}return A5;},getSubmenus:function(){var A6=this.getItems(),BA=A6.length,A5,A7,A9,A8;if(BA>0){A5=[];for(A8=0;A8<BA;A8++){A9=A6[A8];if(A9){A7=A9.cfg.getProperty(O);if(A7){A5[A5.length]=A7;}}}}return A5;},clearContent:function(){var A9=this.getItems(),A6=A9.length,A7=this.element,A8=this.body,BD=this.header,A5=this.footer,BC,BB,BA;if(A6>0){BA=A6-1;do{BC=A9[BA];if(BC){BB=BC.cfg.getProperty(O);if(BB){this.cfg.configChangedEvent.unsubscribe(this._onParentMenuConfigChange,BB);this.renderEvent.unsubscribe(this._onParentMenuRender,BB);}this.removeItem(BC,BC.groupIndex);}}while(BA--);}if(BD){AA.purgeElement(BD);A7.removeChild(BD);}if(A5){AA.purgeElement(A5);A7.removeChild(A5);}if(A8){AA.purgeElement(A8);A8.innerHTML=u;}this.activeItem=null;this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];this.cfg.setProperty(U,null);},destroy:function(){this.clearContent();this._aItemGroups=null;this._aListElements=null;this._aGroupTitleElements=null;r.superclass.destroy.call(this);},setInitialFocus:function(){var A5=this._getFirstEnabledItem();if(A5){A5.focus();}},setInitialSelection:function(){var A5=this._getFirstEnabledItem();if(A5){A5.cfg.setProperty(y,true);}},clearActiveItem:function(A7){if(this.cfg.getProperty(Av)>0){this._cancelShowDelay();}var A5=this.activeItem,A8,A6;if(A5){A8=A5.cfg;if(A7){A5.blur();this.getRoot()._hasFocus=true;}A8.setProperty(y,false);A6=A8.getProperty(O);if(A6){A6.hide();}this.activeItem=null;}},focus:function(){if(!this.hasFocus()){this.setInitialFocus();}},blur:function(){var A5;if(this.hasFocus()){A5=A3.getFocusedMenuItem();if(A5){A5.blur();}}},hasFocus:function(){return(A3.getFocusedMenu()==this.getRoot());},_doItemSubmenuSubscribe:function(A6,A5,A8){var A9=A5[0],A7=A9.cfg.getProperty(O);if(A7){A7.subscribe.apply(A7,A8);}},_doSubmenuSubscribe:function(A6,A5,A8){var A7=this.cfg.getProperty(O);if(A7){A7.subscribe.apply(A7,A8);}},subscribe:function(){r.superclass.subscribe.apply(this,arguments);r.superclass.subscribe.call(this,AR,this._doItemSubmenuSubscribe,arguments);var A5=this.getItems(),A9,A8,A6,A7;if(A5){A9=A5.length;if(A9>0){A7=A9-1;do{A8=A5[A7];A6=A8.cfg.getProperty(O);if(A6){A6.subscribe.apply(A6,arguments);}else{A8.cfg.subscribeToConfigEvent(O,this._doSubmenuSubscribe,arguments);}}while(A7--);}}},unsubscribe:function(){r.superclass.unsubscribe.apply(this,arguments);r.superclass.unsubscribe.call(this,AR,this._doItemSubmenuSubscribe,arguments);var A5=this.getItems(),A9,A8,A6,A7;if(A5){A9=A5.length;if(A9>0){A7=A9-1;do{A8=A5[A7];A6=A8.cfg.getProperty(O);if(A6){A6.unsubscribe.apply(A6,arguments);}else{A8.cfg.unsubscribeFromConfigEvent(O,this._doSubmenuSubscribe,arguments);}}while(A7--);}}},initDefaultConfig:function(){r.superclass.initDefaultConfig.call(this);var A5=this.cfg;A5.addProperty(AZ.key,{handler:this.configVisible,value:AZ.value,validator:AZ.validator});A5.addProperty(AP.key,{handler:this.configConstrainToViewport,value:AP.value,validator:AP.validator,supercedes:AP.supercedes});A5.addProperty(AI.key,{value:AI.value,validator:AI.validator,supercedes:AI.supercedes});
376 A5.addProperty(S.key,{handler:this.configPosition,value:S.value,validator:S.validator,supercedes:S.supercedes});A5.addProperty(A.key,{value:A.value,suppressEvent:A.suppressEvent});A5.addProperty(t.key,{value:t.value,validator:t.validator,suppressEvent:t.suppressEvent});A5.addProperty(Y.key,{value:Y.value,validator:Y.validator,suppressEvent:Y.suppressEvent});A5.addProperty(q.key,{handler:this.configHideDelay,value:q.value,validator:q.validator,suppressEvent:q.suppressEvent});A5.addProperty(v.key,{value:v.value,validator:v.validator,suppressEvent:v.suppressEvent});A5.addProperty(o.key,{value:o.value,validator:o.validator,suppressEvent:o.suppressEvent});A5.addProperty(AN.key,{handler:this.configContainer,value:document.body,suppressEvent:AN.suppressEvent});A5.addProperty(Af.key,{value:Af.value,validator:Af.validator,supercedes:Af.supercedes,suppressEvent:Af.suppressEvent});A5.addProperty(N.key,{value:N.value,validator:N.validator,supercedes:N.supercedes,suppressEvent:N.suppressEvent});A5.addProperty(X.key,{handler:this.configMaxHeight,value:X.value,validator:X.validator,suppressEvent:X.suppressEvent,supercedes:X.supercedes});A5.addProperty(W.key,{handler:this.configClassName,value:W.value,validator:W.validator,supercedes:W.supercedes});A5.addProperty(a.key,{handler:this.configDisabled,value:a.value,validator:a.validator,suppressEvent:a.suppressEvent});A5.addProperty(I.key,{handler:this.configShadow,value:I.value,validator:I.validator});A5.addProperty(Al.key,{value:Al.value,validator:Al.validator});}});})();(function(){YAHOO.widget.MenuItem=function(AS,AR){if(AS){if(AR){this.parent=AR.parent;this.value=AR.value;this.id=AR.id;}this.init(AS,AR);}};var x=YAHOO.util.Dom,j=YAHOO.widget.Module,AB=YAHOO.widget.Menu,c=YAHOO.widget.MenuItem,AK=YAHOO.util.CustomEvent,k=YAHOO.env.ua,AQ=YAHOO.lang,AL="text",O="#",Q="-",L="helptext",n="url",AH="target",A="emphasis",N="strongemphasis",b="checked",w="submenu",H="disabled",B="selected",P="hassubmenu",U="checked-disabled",AI="hassubmenu-disabled",AD="hassubmenu-selected",T="checked-selected",q="onclick",J="classname",AJ="",i="OPTION",v="OPTGROUP",K="LI",AE="href",r="SELECT",X="DIV",AN='<em class="helptext">',a="<em>",I="</em>",W="<strong>",y="</strong>",Y="preventcontextoverlap",h="obj",AG="scope",t="none",V="visible",E=" ",m="MenuItem",AA="click",D="show",M="hide",S="li",AF='<a href="#"></a>',p=[["mouseOverEvent","mouseover"],["mouseOutEvent","mouseout"],["mouseDownEvent","mousedown"],["mouseUpEvent","mouseup"],["clickEvent",AA],["keyPressEvent","keypress"],["keyDownEvent","keydown"],["keyUpEvent","keyup"],["focusEvent","focus"],["blurEvent","blur"],["destroyEvent","destroy"]],o={key:AL,value:AJ,validator:AQ.isString,suppressEvent:true},s={key:L,supercedes:[AL],suppressEvent:true},G={key:n,value:O,suppressEvent:true},AO={key:AH,suppressEvent:true},AP={key:A,value:false,validator:AQ.isBoolean,suppressEvent:true,supercedes:[AL]},d={key:N,value:false,validator:AQ.isBoolean,suppressEvent:true,supercedes:[AL]},l={key:b,value:false,validator:AQ.isBoolean,suppressEvent:true,supercedes:[H,B]},F={key:w,suppressEvent:true,supercedes:[H,B]},AM={key:H,value:false,validator:AQ.isBoolean,suppressEvent:true,supercedes:[AL,B]},f={key:B,value:false,validator:AQ.isBoolean,suppressEvent:true},u={key:q,suppressEvent:true},AC={key:J,value:null,validator:AQ.isString,suppressEvent:true},z={key:"keylistener",value:null,suppressEvent:true},C=null,e={};var Z=function(AU,AT){var AR=e[AU];if(!AR){e[AU]={};AR=e[AU];}var AS=AR[AT];if(!AS){AS=AU+Q+AT;AR[AT]=AS;}return AS;};var g=function(AR){x.addClass(this.element,Z(this.CSS_CLASS_NAME,AR));x.addClass(this._oAnchor,Z(this.CSS_LABEL_CLASS_NAME,AR));};var R=function(AR){x.removeClass(this.element,Z(this.CSS_CLASS_NAME,AR));x.removeClass(this._oAnchor,Z(this.CSS_LABEL_CLASS_NAME,AR));};c.prototype={CSS_CLASS_NAME:"yuimenuitem",CSS_LABEL_CLASS_NAME:"yuimenuitemlabel",SUBMENU_TYPE:null,_oAnchor:null,_oHelpTextEM:null,_oSubmenu:null,_oOnclickAttributeValue:null,_sClassName:null,constructor:c,index:null,groupIndex:null,parent:null,element:null,srcElement:null,value:null,browser:j.prototype.browser,id:null,init:function(AR,Ab){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=AB;}this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();var AX=this.cfg,AY=O,AT,Aa,AZ,AS,AV,AU,AW;if(AQ.isString(AR)){this._createRootNodeStructure();AX.queueProperty(AL,AR);}else{if(AR&&AR.tagName){switch(AR.tagName.toUpperCase()){case i:this._createRootNodeStructure();AX.queueProperty(AL,AR.text);AX.queueProperty(H,AR.disabled);this.value=AR.value;this.srcElement=AR;break;case v:this._createRootNodeStructure();AX.queueProperty(AL,AR.label);AX.queueProperty(H,AR.disabled);this.srcElement=AR;this._initSubTree();break;case K:AZ=x.getFirstChild(AR);if(AZ){AY=AZ.getAttribute(AE,2);AS=AZ.getAttribute(AH);AV=AZ.innerHTML;}this.srcElement=AR;this.element=AR;this._oAnchor=AZ;AX.setProperty(AL,AV,true);AX.setProperty(n,AY,true);AX.setProperty(AH,AS,true);this._initSubTree();break;}}}if(this.element){AU=(this.srcElement||this.element).id;if(!AU){AU=this.id||x.generateId();this.element.id=AU;}this.id=AU;x.addClass(this.element,this.CSS_CLASS_NAME);x.addClass(this._oAnchor,this.CSS_LABEL_CLASS_NAME);AW=p.length-1;do{Aa=p[AW];AT=this.createEvent(Aa[1]);AT.signature=AK.LIST;this[Aa[0]]=AT;}while(AW--);if(Ab){AX.applyConfig(Ab);}AX.fireQueue();}},_createRootNodeStructure:function(){var AR,AS;if(!C){C=document.createElement(S);C.innerHTML=AF;}AR=C.cloneNode(true);AR.className=this.CSS_CLASS_NAME;AS=AR.firstChild;AS.className=this.CSS_LABEL_CLASS_NAME;this.element=AR;this._oAnchor=AS;},_initSubTree:function(){var AX=this.srcElement,AT=this.cfg,AV,AU,AS,AR,AW;if(AX.childNodes.length>0){if(this.parent.lazyLoad&&this.parent.srcElement&&this.parent.srcElement.tagName.toUpperCase()==r){AT.setProperty(w,{id:x.generateId(),itemdata:AX.childNodes});}else{AV=AX.firstChild;AU=[];do{if(AV&&AV.tagName){switch(AV.tagName.toUpperCase()){case X:AT.setProperty(w,AV);break;case i:AU[AU.length]=AV;break;}}}while((AV=AV.nextSibling));
377 AS=AU.length;if(AS>0){AR=new this.SUBMENU_TYPE(x.generateId());AT.setProperty(w,AR);for(AW=0;AW<AS;AW++){AR.addItem((new AR.ITEM_TYPE(AU[AW])));}}}}},configText:function(Aa,AT,AV){var AS=AT[0],AU=this.cfg,AY=this._oAnchor,AR=AU.getProperty(L),AZ=AJ,AW=AJ,AX=AJ;if(AS){if(AR){AZ=AN+AR+I;}if(AU.getProperty(A)){AW=a;AX=I;}if(AU.getProperty(N)){AW=W;AX=y;}AY.innerHTML=(AW+AS+AX+AZ);}},configHelpText:function(AT,AS,AR){this.cfg.refireEvent(AL);},configURL:function(AT,AS,AR){var AV=AS[0];if(!AV){AV=O;}var AU=this._oAnchor;if(k.opera){AU.removeAttribute(AE);}AU.setAttribute(AE,AV);},configTarget:function(AU,AT,AS){var AR=AT[0],AV=this._oAnchor;if(AR&&AR.length>0){AV.setAttribute(AH,AR);}else{AV.removeAttribute(AH);}},configEmphasis:function(AT,AS,AR){var AV=AS[0],AU=this.cfg;if(AV&&AU.getProperty(N)){AU.setProperty(N,false);}AU.refireEvent(AL);},configStrongEmphasis:function(AU,AT,AS){var AR=AT[0],AV=this.cfg;if(AR&&AV.getProperty(A)){AV.setProperty(A,false);}AV.refireEvent(AL);},configChecked:function(AT,AS,AR){var AV=AS[0],AU=this.cfg;if(AV){g.call(this,b);}else{R.call(this,b);}AU.refireEvent(AL);if(AU.getProperty(H)){AU.refireEvent(H);}if(AU.getProperty(B)){AU.refireEvent(B);}},configDisabled:function(AT,AS,AR){var AV=AS[0],AW=this.cfg,AU=AW.getProperty(w),AX=AW.getProperty(b);if(AV){if(AW.getProperty(B)){AW.setProperty(B,false);}g.call(this,H);if(AU){g.call(this,AI);}if(AX){g.call(this,U);}}else{R.call(this,H);if(AU){R.call(this,AI);}if(AX){R.call(this,U);}}},configSelected:function(AT,AS,AR){var AX=this.cfg,AW=this._oAnchor,AV=AS[0],AY=AX.getProperty(b),AU=AX.getProperty(w);if(k.opera){AW.blur();}if(AV&&!AX.getProperty(H)){g.call(this,B);if(AU){g.call(this,AD);}if(AY){g.call(this,T);}}else{R.call(this,B);if(AU){R.call(this,AD);}if(AY){R.call(this,T);}}if(this.hasFocus()&&k.opera){AW.focus();}},_onSubmenuBeforeHide:function(AU,AT){var AV=this.parent,AR;function AS(){AV._oAnchor.blur();AR.beforeHideEvent.unsubscribe(AS);}if(AV.hasFocus()){AR=AV.parent;AR.beforeHideEvent.subscribe(AS);}},configSubmenu:function(AY,AT,AW){var AV=AT[0],AU=this.cfg,AS=this.parent&&this.parent.lazyLoad,AX,AZ,AR;if(AV){if(AV instanceof AB){AX=AV;AX.parent=this;AX.lazyLoad=AS;}else{if(AQ.isObject(AV)&&AV.id&&!AV.nodeType){AZ=AV.id;AR=AV;AR.lazyload=AS;AR.parent=this;AX=new this.SUBMENU_TYPE(AZ,AR);AU.setProperty(w,AX,true);}else{AX=new this.SUBMENU_TYPE(AV,{lazyload:AS,parent:this});AU.setProperty(w,AX,true);}}if(AX){AX.cfg.setProperty(Y,true);g.call(this,P);if(AU.getProperty(n)===O){AU.setProperty(n,(O+AX.id));}this._oSubmenu=AX;if(k.opera){AX.beforeHideEvent.subscribe(this._onSubmenuBeforeHide);}}}else{R.call(this,P);if(this._oSubmenu){this._oSubmenu.destroy();}}if(AU.getProperty(H)){AU.refireEvent(H);}if(AU.getProperty(B)){AU.refireEvent(B);}},configOnClick:function(AT,AS,AR){var AU=AS[0];if(this._oOnclickAttributeValue&&(this._oOnclickAttributeValue!=AU)){this.clickEvent.unsubscribe(this._oOnclickAttributeValue.fn,this._oOnclickAttributeValue.obj);this._oOnclickAttributeValue=null;}if(!this._oOnclickAttributeValue&&AQ.isObject(AU)&&AQ.isFunction(AU.fn)){this.clickEvent.subscribe(AU.fn,((h in AU)?AU.obj:this),((AG in AU)?AU.scope:null));this._oOnclickAttributeValue=AU;}},configClassName:function(AU,AT,AS){var AR=AT[0];if(this._sClassName){x.removeClass(this.element,this._sClassName);}x.addClass(this.element,AR);this._sClassName=AR;},_dispatchClickEvent:function(){var AT=this,AS,AR;if(!AT.cfg.getProperty(H)){AS=x.getFirstChild(AT.element);if(k.ie){AS.fireEvent(q);}else{if((k.gecko&&k.gecko>=1.9)||k.opera||k.webkit){AR=document.createEvent("HTMLEvents");AR.initEvent(AA,true,true);}else{AR=document.createEvent("MouseEvents");AR.initMouseEvent(AA,true,true,window,0,0,0,0,0,false,false,false,false,0,null);}AS.dispatchEvent(AR);}}},_createKeyListener:function(AU,AT,AW){var AV=this,AS=AV.parent;var AR=new YAHOO.util.KeyListener(AS.element.ownerDocument,AW,{fn:AV._dispatchClickEvent,scope:AV,correctScope:true});if(AS.cfg.getProperty(V)){AR.enable();}AS.subscribe(D,AR.enable,null,AR);AS.subscribe(M,AR.disable,null,AR);AV._keyListener=AR;AS.unsubscribe(D,AV._createKeyListener,AW);},configKeyListener:function(AT,AS){var AV=AS[0],AU=this,AR=AU.parent;if(AU._keyData){AR.unsubscribe(D,AU._createKeyListener,AU._keyData);AU._keyData=null;}if(AU._keyListener){AR.unsubscribe(D,AU._keyListener.enable);AR.unsubscribe(M,AU._keyListener.disable);AU._keyListener.disable();AU._keyListener=null;}if(AV){AU._keyData=AV;AR.subscribe(D,AU._createKeyListener,AV,AU);}},initDefaultConfig:function(){var AR=this.cfg;AR.addProperty(o.key,{handler:this.configText,value:o.value,validator:o.validator,suppressEvent:o.suppressEvent});AR.addProperty(s.key,{handler:this.configHelpText,supercedes:s.supercedes,suppressEvent:s.suppressEvent});AR.addProperty(G.key,{handler:this.configURL,value:G.value,suppressEvent:G.suppressEvent});AR.addProperty(AO.key,{handler:this.configTarget,suppressEvent:AO.suppressEvent});AR.addProperty(AP.key,{handler:this.configEmphasis,value:AP.value,validator:AP.validator,suppressEvent:AP.suppressEvent,supercedes:AP.supercedes});AR.addProperty(d.key,{handler:this.configStrongEmphasis,value:d.value,validator:d.validator,suppressEvent:d.suppressEvent,supercedes:d.supercedes});AR.addProperty(l.key,{handler:this.configChecked,value:l.value,validator:l.validator,suppressEvent:l.suppressEvent,supercedes:l.supercedes});AR.addProperty(AM.key,{handler:this.configDisabled,value:AM.value,validator:AM.validator,suppressEvent:AM.suppressEvent});AR.addProperty(f.key,{handler:this.configSelected,value:f.value,validator:f.validator,suppressEvent:f.suppressEvent});AR.addProperty(F.key,{handler:this.configSubmenu,supercedes:F.supercedes,suppressEvent:F.suppressEvent});AR.addProperty(u.key,{handler:this.configOnClick,suppressEvent:u.suppressEvent});AR.addProperty(AC.key,{handler:this.configClassName,value:AC.value,validator:AC.validator,suppressEvent:AC.suppressEvent});AR.addProperty(z.key,{handler:this.configKeyListener,value:z.value,suppressEvent:z.suppressEvent});
378 },getNextSibling:function(){var AR=function(AX){return(AX.nodeName.toLowerCase()==="ul");},AV=this.element,AU=x.getNextSibling(AV),AT,AS,AW;if(!AU){AT=AV.parentNode;AS=x.getNextSiblingBy(AT,AR);if(AS){AW=AS;}else{AW=x.getFirstChildBy(AT.parentNode,AR);}AU=x.getFirstChild(AW);}return YAHOO.widget.MenuManager.getMenuItem(AU.id);},getNextEnabledSibling:function(){var AR=this.getNextSibling();return(AR.cfg.getProperty(H)||AR.element.style.display==t)?AR.getNextEnabledSibling():AR;},getPreviousSibling:function(){var AR=function(AX){return(AX.nodeName.toLowerCase()==="ul");},AV=this.element,AU=x.getPreviousSibling(AV),AT,AS,AW;if(!AU){AT=AV.parentNode;AS=x.getPreviousSiblingBy(AT,AR);if(AS){AW=AS;}else{AW=x.getLastChildBy(AT.parentNode,AR);}AU=x.getLastChild(AW);}return YAHOO.widget.MenuManager.getMenuItem(AU.id);},getPreviousEnabledSibling:function(){var AR=this.getPreviousSibling();return(AR.cfg.getProperty(H)||AR.element.style.display==t)?AR.getPreviousEnabledSibling():AR;},focus:function(){var AU=this.parent,AT=this._oAnchor,AR=AU.activeItem;function AS(){try{if(!(k.ie&&!document.hasFocus())){if(AR){AR.blurEvent.fire();}AT.focus();this.focusEvent.fire();}}catch(AV){}}if(!this.cfg.getProperty(H)&&AU&&AU.cfg.getProperty(V)&&this.element.style.display!=t){AQ.later(0,this,AS);}},blur:function(){var AR=this.parent;if(!this.cfg.getProperty(H)&&AR&&AR.cfg.getProperty(V)){AQ.later(0,this,function(){try{this._oAnchor.blur();this.blurEvent.fire();}catch(AS){}},0);}},hasFocus:function(){return(YAHOO.widget.MenuManager.getFocusedMenuItem()==this);},destroy:function(){var AT=this.element,AS,AR,AV,AU;if(AT){AS=this.cfg.getProperty(w);if(AS){AS.destroy();}AR=AT.parentNode;if(AR){AR.removeChild(AT);this.destroyEvent.fire();}AU=p.length-1;do{AV=p[AU];this[AV[0]].unsubscribeAll();}while(AU--);this.cfg.configChangedEvent.unsubscribeAll();}},toString:function(){var AS=m,AR=this.id;if(AR){AS+=(E+AR);}return AS;}};AQ.augmentProto(c,YAHOO.util.EventProvider);})();(function(){var B="xy",C="mousedown",F="ContextMenu",J=" ";YAHOO.widget.ContextMenu=function(L,K){YAHOO.widget.ContextMenu.superclass.constructor.call(this,L,K);};var I=YAHOO.util.Event,E=YAHOO.env.ua,G=YAHOO.widget.ContextMenu,A={"TRIGGER_CONTEXT_MENU":"triggerContextMenu","CONTEXT_MENU":(E.opera?C:"contextmenu"),"CLICK":"click"},H={key:"trigger",suppressEvent:true};function D(L,K,M){this.cfg.setProperty(B,M);this.beforeShowEvent.unsubscribe(D,M);}YAHOO.lang.extend(G,YAHOO.widget.Menu,{_oTrigger:null,_bCancelled:false,contextEventTarget:null,triggerContextMenuEvent:null,init:function(L,K){G.superclass.init.call(this,L);this.beforeInitEvent.fire(G);if(K){this.cfg.applyConfig(K,true);}this.initEvent.fire(G);},initEvents:function(){G.superclass.initEvents.call(this);this.triggerContextMenuEvent=this.createEvent(A.TRIGGER_CONTEXT_MENU);this.triggerContextMenuEvent.signature=YAHOO.util.CustomEvent.LIST;},cancel:function(){this._bCancelled=true;},_removeEventHandlers:function(){var K=this._oTrigger;if(K){I.removeListener(K,A.CONTEXT_MENU,this._onTriggerContextMenu);if(E.opera){I.removeListener(K,A.CLICK,this._onTriggerClick);}}},_onTriggerClick:function(L,K){if(L.ctrlKey){I.stopEvent(L);}},_onTriggerContextMenu:function(M,K){var L;if(!(M.type==C&&!M.ctrlKey)){this.contextEventTarget=I.getTarget(M);this.triggerContextMenuEvent.fire(M);if(!this._bCancelled){I.stopEvent(M);YAHOO.widget.MenuManager.hideVisible();L=I.getXY(M);if(!YAHOO.util.Dom.inDocument(this.element)){this.beforeShowEvent.subscribe(D,L);}else{this.cfg.setProperty(B,L);}this.show();}this._bCancelled=false;}},toString:function(){var L=F,K=this.id;if(K){L+=(J+K);}return L;},initDefaultConfig:function(){G.superclass.initDefaultConfig.call(this);this.cfg.addProperty(H.key,{handler:this.configTrigger,suppressEvent:H.suppressEvent});},destroy:function(){this._removeEventHandlers();G.superclass.destroy.call(this);},configTrigger:function(L,K,N){var M=K[0];if(M){if(this._oTrigger){this._removeEventHandlers();}this._oTrigger=M;I.on(M,A.CONTEXT_MENU,this._onTriggerContextMenu,this,true);if(E.opera){I.on(M,A.CLICK,this._onTriggerClick,this,true);}}else{this._removeEventHandlers();}}});}());YAHOO.widget.ContextMenuItem=YAHOO.widget.MenuItem;(function(){var D=YAHOO.lang,N="static",M="dynamic,"+N,A="disabled",F="selected",B="autosubmenudisplay",G="submenu",C="visible",Q=" ",H="submenutoggleregion",P="MenuBar";YAHOO.widget.MenuBar=function(T,S){YAHOO.widget.MenuBar.superclass.constructor.call(this,T,S);};function O(T){var S=false;if(D.isString(T)){S=(M.indexOf((T.toLowerCase()))!=-1);}return S;}var R=YAHOO.util.Event,L=YAHOO.widget.MenuBar,K={key:"position",value:N,validator:O,supercedes:[C]},E={key:"submenualignment",value:["tl","bl"]},J={key:B,value:false,validator:D.isBoolean,suppressEvent:true},I={key:H,value:false,validator:D.isBoolean};D.extend(L,YAHOO.widget.Menu,{init:function(T,S){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuBarItem;}L.superclass.init.call(this,T);this.beforeInitEvent.fire(L);if(S){this.cfg.applyConfig(S,true);}this.initEvent.fire(L);},CSS_CLASS_NAME:"yuimenubar",SUBMENU_TOGGLE_REGION_WIDTH:20,_onKeyDown:function(U,T,Y){var S=T[0],Z=T[1],W,X,V;if(Z&&!Z.cfg.getProperty(A)){X=Z.cfg;switch(S.keyCode){case 37:case 39:if(Z==this.activeItem&&!X.getProperty(F)){X.setProperty(F,true);}else{V=(S.keyCode==37)?Z.getPreviousEnabledSibling():Z.getNextEnabledSibling();if(V){this.clearActiveItem();V.cfg.setProperty(F,true);W=V.cfg.getProperty(G);if(W){W.show();W.setInitialFocus();}else{V.focus();}}}R.preventDefault(S);break;case 40:if(this.activeItem!=Z){this.clearActiveItem();X.setProperty(F,true);Z.focus();}W=X.getProperty(G);if(W){if(W.cfg.getProperty(C)){W.setInitialSelection();W.setInitialFocus();}else{W.show();W.setInitialFocus();}}R.preventDefault(S);break;}}if(S.keyCode==27&&this.activeItem){W=this.activeItem.cfg.getProperty(G);if(W&&W.cfg.getProperty(C)){W.hide();this.activeItem.focus();}else{this.activeItem.cfg.setProperty(F,false);this.activeItem.blur();}R.preventDefault(S);}},_onClick:function(e,Y,b){L.superclass._onClick.call(this,e,Y,b);
379 var d=Y[1],T=true,S,f,U,W,Z,a,c,V;var X=function(){if(a.cfg.getProperty(C)){a.hide();}else{a.show();}};if(d&&!d.cfg.getProperty(A)){f=Y[0];U=R.getTarget(f);W=this.activeItem;Z=this.cfg;if(W&&W!=d){this.clearActiveItem();}d.cfg.setProperty(F,true);a=d.cfg.getProperty(G);if(a){S=d.element;c=YAHOO.util.Dom.getX(S);V=c+(S.offsetWidth-this.SUBMENU_TOGGLE_REGION_WIDTH);if(Z.getProperty(H)){if(R.getPageX(f)>V){X();R.preventDefault(f);T=false;}}else{X();}}}return T;},configSubmenuToggle:function(U,T){var S=T[0];if(S){this.cfg.setProperty(B,false);}},toString:function(){var T=P,S=this.id;if(S){T+=(Q+S);}return T;},initDefaultConfig:function(){L.superclass.initDefaultConfig.call(this);var S=this.cfg;S.addProperty(K.key,{handler:this.configPosition,value:K.value,validator:K.validator,supercedes:K.supercedes});S.addProperty(E.key,{value:E.value,suppressEvent:E.suppressEvent});S.addProperty(J.key,{value:J.value,validator:J.validator,suppressEvent:J.suppressEvent});S.addProperty(I.key,{value:I.value,validator:I.validator,handler:this.configSubmenuToggle});}});}());YAHOO.widget.MenuBarItem=function(B,A){YAHOO.widget.MenuBarItem.superclass.constructor.call(this,B,A);};YAHOO.lang.extend(YAHOO.widget.MenuBarItem,YAHOO.widget.MenuItem,{init:function(B,A){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.Menu;}YAHOO.widget.MenuBarItem.superclass.init.call(this,B);var C=this.cfg;if(A){C.applyConfig(A,true);}C.fireQueue();},CSS_CLASS_NAME:"yuimenubaritem",CSS_LABEL_CLASS_NAME:"yuimenubaritemlabel",toString:function(){var A="MenuBarItem";if(this.cfg&&this.cfg.getProperty("text")){A+=(": "+this.cfg.getProperty("text"));}return A;}});YAHOO.register("menu",YAHOO.widget.Menu,{version:"2.8.0r4",build:"2449"});// End of File include/javascript/yui/build/menu/menu-min.js
380                                 
381 /*********************************************************************************
382  * SugarCRM Community Edition is a customer relationship management program developed by
383  * SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
384  *
385  * This program is free software; you can redistribute it and/or modify it under
386  * the terms of the GNU Affero General Public License version 3 as published by the
387  * Free Software Foundation with the addition of the following permission added
388  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
389  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
390  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
391  *
392  * This program is distributed in the hope that it will be useful, but WITHOUT
393  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
394  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
395  * details.
396  *
397  * You should have received a copy of the GNU Affero General Public License along with
398  * this program; if not, see http://www.gnu.org/licenses or write to the Free
399  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
400  * 02110-1301 USA.
401  *
402  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
403  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
404  *
405  * The interactive user interfaces in modified source and object code versions
406  * of this program must display Appropriate Legal Notices, as required under
407  * Section 5 of the GNU Affero General Public License version 3.
408  *
409  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
410  * these Appropriate Legal Notices must retain the display of the "Powered by
411  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
412  * technical reasons, the Appropriate Legal Notices must display the words
413  * "Powered by SugarCRM".
414  ********************************************************************************/
415 SUGAR_callsInProgress=0;YAHOO.util.Connect.completeEvent.subscribe(function(event,data){SUGAR_callsInProgress--;if(SUGAR.util.isLoginPage(data[0].conn.responseText))
416 return false;});YAHOO.util.Connect.startEvent.subscribe(function(event,data)
417 {SUGAR_callsInProgress++;});// End of File include/javascript/sugar_connection_event_listener.js
418                                 
419 /*
420 Copyright (c) 2009, Yahoo! Inc. All rights reserved.
421 Code licensed under the BSD License:
422 http://developer.yahoo.net/yui/license.txt
423 version: 2.8.0r4
424 */
425 (function () {
426
427     /**
428     * Config is a utility used within an Object to allow the implementer to
429     * maintain a list of local configuration properties and listen for changes 
430     * to those properties dynamically using CustomEvent. The initial values are 
431     * also maintained so that the configuration can be reset at any given point 
432     * to its initial state.
433     * @namespace YAHOO.util
434     * @class Config
435     * @constructor
436     * @param {Object} owner The owner Object to which this Config Object belongs
437     */
438     YAHOO.util.Config = function (owner) {
439
440         if (owner) {
441             this.init(owner);
442         }
443
444
445     };
446
447
448     var Lang = YAHOO.lang,
449         CustomEvent = YAHOO.util.CustomEvent,
450         Config = YAHOO.util.Config;
451
452
453     /**
454      * Constant representing the CustomEvent type for the config changed event.
455      * @property YAHOO.util.Config.CONFIG_CHANGED_EVENT
456      * @private
457      * @static
458      * @final
459      */
460     Config.CONFIG_CHANGED_EVENT = "configChanged";
461     
462     /**
463      * Constant representing the boolean type string
464      * @property YAHOO.util.Config.BOOLEAN_TYPE
465      * @private
466      * @static
467      * @final
468      */
469     Config.BOOLEAN_TYPE = "boolean";
470     
471     Config.prototype = {
472      
473         /**
474         * Object reference to the owner of this Config Object
475         * @property owner
476         * @type Object
477         */
478         owner: null,
479         
480         /**
481         * Boolean flag that specifies whether a queue is currently 
482         * being executed
483         * @property queueInProgress
484         * @type Boolean
485         */
486         queueInProgress: false,
487         
488         /**
489         * Maintains the local collection of configuration property objects and 
490         * their specified values
491         * @property config
492         * @private
493         * @type Object
494         */ 
495         config: null,
496         
497         /**
498         * Maintains the local collection of configuration property objects as 
499         * they were initially applied.
500         * This object is used when resetting a property.
501         * @property initialConfig
502         * @private
503         * @type Object
504         */ 
505         initialConfig: null,
506         
507         /**
508         * Maintains the local, normalized CustomEvent queue
509         * @property eventQueue
510         * @private
511         * @type Object
512         */ 
513         eventQueue: null,
514         
515         /**
516         * Custom Event, notifying subscribers when Config properties are set 
517         * (setProperty is called without the silent flag
518         * @event configChangedEvent
519         */
520         configChangedEvent: null,
521     
522         /**
523         * Initializes the configuration Object and all of its local members.
524         * @method init
525         * @param {Object} owner The owner Object to which this Config 
526         * Object belongs
527         */
528         init: function (owner) {
529     
530             this.owner = owner;
531     
532             this.configChangedEvent = 
533                 this.createEvent(Config.CONFIG_CHANGED_EVENT);
534     
535             this.configChangedEvent.signature = CustomEvent.LIST;
536             this.queueInProgress = false;
537             this.config = {};
538             this.initialConfig = {};
539             this.eventQueue = [];
540         
541         },
542         
543         /**
544         * Validates that the value passed in is a Boolean.
545         * @method checkBoolean
546         * @param {Object} val The value to validate
547         * @return {Boolean} true, if the value is valid
548         */ 
549         checkBoolean: function (val) {
550             return (typeof val == Config.BOOLEAN_TYPE);
551         },
552         
553         /**
554         * Validates that the value passed in is a number.
555         * @method checkNumber
556         * @param {Object} val The value to validate
557         * @return {Boolean} true, if the value is valid
558         */
559         checkNumber: function (val) {
560             return (!isNaN(val));
561         },
562         
563         /**
564         * Fires a configuration property event using the specified value. 
565         * @method fireEvent
566         * @private
567         * @param {String} key The configuration property's name
568         * @param {value} Object The value of the correct type for the property
569         */ 
570         fireEvent: function ( key, value ) {
571             var property = this.config[key];
572         
573             if (property && property.event) {
574                 property.event.fire(value);
575             } 
576         },
577         
578         /**
579         * Adds a property to the Config Object's private config hash.
580         * @method addProperty
581         * @param {String} key The configuration property's name
582         * @param {Object} propertyObject The Object containing all of this 
583         * property's arguments
584         */
585         addProperty: function ( key, propertyObject ) {
586             key = key.toLowerCase();
587         
588             this.config[key] = propertyObject;
589         
590             propertyObject.event = this.createEvent(key, { scope: this.owner });
591             propertyObject.event.signature = CustomEvent.LIST;
592             
593             
594             propertyObject.key = key;
595         
596             if (propertyObject.handler) {
597                 propertyObject.event.subscribe(propertyObject.handler, 
598                     this.owner);
599             }
600         
601             this.setProperty(key, propertyObject.value, true);
602             
603             if (! propertyObject.suppressEvent) {
604                 this.queueProperty(key, propertyObject.value);
605             }
606             
607         },
608         
609         /**
610         * Returns a key-value configuration map of the values currently set in  
611         * the Config Object.
612         * @method getConfig
613         * @return {Object} The current config, represented in a key-value map
614         */
615         getConfig: function () {
616         
617             var cfg = {},
618                 currCfg = this.config,
619                 prop,
620                 property;
621                 
622             for (prop in currCfg) {
623                 if (Lang.hasOwnProperty(currCfg, prop)) {
624                     property = currCfg[prop];
625                     if (property && property.event) {
626                         cfg[prop] = property.value;
627                     }
628                 }
629             }
630
631             return cfg;
632         },
633         
634         /**
635         * Returns the value of specified property.
636         * @method getProperty
637         * @param {String} key The name of the property
638         * @return {Object}  The value of the specified property
639         */
640         getProperty: function (key) {
641             var property = this.config[key.toLowerCase()];
642             if (property && property.event) {
643                 return property.value;
644             } else {
645                 return undefined;
646             }
647         },
648         
649         /**
650         * Resets the specified property's value to its initial value.
651         * @method resetProperty
652         * @param {String} key The name of the property
653         * @return {Boolean} True is the property was reset, false if not
654         */
655         resetProperty: function (key) {
656     
657             key = key.toLowerCase();
658         
659             var property = this.config[key];
660     
661             if (property && property.event) {
662     
663                 if (this.initialConfig[key] && 
664                     !Lang.isUndefined(this.initialConfig[key])) {
665     
666                     this.setProperty(key, this.initialConfig[key]);
667
668                     return true;
669     
670                 }
671     
672             } else {
673     
674                 return false;
675             }
676     
677         },
678         
679         /**
680         * Sets the value of a property. If the silent property is passed as 
681         * true, the property's event will not be fired.
682         * @method setProperty
683         * @param {String} key The name of the property
684         * @param {String} value The value to set the property to
685         * @param {Boolean} silent Whether the value should be set silently, 
686         * without firing the property event.
687         * @return {Boolean} True, if the set was successful, false if it failed.
688         */
689         setProperty: function (key, value, silent) {
690         
691             var property;
692         
693             key = key.toLowerCase();
694         
695             if (this.queueInProgress && ! silent) {
696                 // Currently running through a queue... 
697                 this.queueProperty(key,value);
698                 return true;
699     
700             } else {
701                 property = this.config[key];
702                 if (property && property.event) {
703                     if (property.validator && !property.validator(value)) {
704                         return false;
705                     } else {
706                         property.value = value;
707                         if (! silent) {
708                             this.fireEvent(key, value);
709                             this.configChangedEvent.fire([key, value]);
710                         }
711                         return true;
712                     }
713                 } else {
714                     return false;
715                 }
716             }
717         },
718         
719         /**
720         * Sets the value of a property and queues its event to execute. If the 
721         * event is already scheduled to execute, it is
722         * moved from its current position to the end of the queue.
723         * @method queueProperty
724         * @param {String} key The name of the property
725         * @param {String} value The value to set the property to
726         * @return {Boolean}  true, if the set was successful, false if 
727         * it failed.
728         */ 
729         queueProperty: function (key, value) {
730         
731             key = key.toLowerCase();
732         
733             var property = this.config[key],
734                 foundDuplicate = false,
735                 iLen,
736                 queueItem,
737                 queueItemKey,
738                 queueItemValue,
739                 sLen,
740                 supercedesCheck,
741                 qLen,
742                 queueItemCheck,
743                 queueItemCheckKey,
744                 queueItemCheckValue,
745                 i,
746                 s,
747                 q;
748                                 
749             if (property && property.event) {
750     
751                 if (!Lang.isUndefined(value) && property.validator && 
752                     !property.validator(value)) { // validator
753                     return false;
754                 } else {
755         
756                     if (!Lang.isUndefined(value)) {
757                         property.value = value;
758                     } else {
759                         value = property.value;
760                     }
761         
762                     foundDuplicate = false;
763                     iLen = this.eventQueue.length;
764         
765                     for (i = 0; i < iLen; i++) {
766                         queueItem = this.eventQueue[i];
767         
768                         if (queueItem) {
769                             queueItemKey = queueItem[0];
770                             queueItemValue = queueItem[1];
771
772                             if (queueItemKey == key) {
773     
774                                 /*
775                                     found a dupe... push to end of queue, null 
776                                     current item, and break
777                                 */
778     
779                                 this.eventQueue[i] = null;
780     
781                                 this.eventQueue.push(
782                                     [key, (!Lang.isUndefined(value) ? 
783                                     value : queueItemValue)]);
784     
785                                 foundDuplicate = true;
786                                 break;
787                             }
788                         }
789                     }
790                     
791                     // this is a refire, or a new property in the queue
792     
793                     if (! foundDuplicate && !Lang.isUndefined(value)) { 
794                         this.eventQueue.push([key, value]);
795                     }
796                 }
797         
798                 if (property.supercedes) {
799
800                     sLen = property.supercedes.length;
801
802                     for (s = 0; s < sLen; s++) {
803
804                         supercedesCheck = property.supercedes[s];
805                         qLen = this.eventQueue.length;
806
807                         for (q = 0; q < qLen; q++) {
808                             queueItemCheck = this.eventQueue[q];
809
810                             if (queueItemCheck) {
811                                 queueItemCheckKey = queueItemCheck[0];
812                                 queueItemCheckValue = queueItemCheck[1];
813
814                                 if (queueItemCheckKey == 
815                                     supercedesCheck.toLowerCase() ) {
816
817                                     this.eventQueue.push([queueItemCheckKey, 
818                                         queueItemCheckValue]);
819
820                                     this.eventQueue[q] = null;
821                                     break;
822
823                                 }
824                             }
825                         }
826                     }
827                 }
828
829
830                 return true;
831             } else {
832                 return false;
833             }
834         },
835         
836         /**
837         * Fires the event for a property using the property's current value.
838         * @method refireEvent
839         * @param {String} key The name of the property
840         */
841         refireEvent: function (key) {
842     
843             key = key.toLowerCase();
844         
845             var property = this.config[key];
846     
847             if (property && property.event && 
848     
849                 !Lang.isUndefined(property.value)) {
850     
851                 if (this.queueInProgress) {
852     
853                     this.queueProperty(key);
854     
855                 } else {
856     
857                     this.fireEvent(key, property.value);
858     
859                 }
860     
861             }
862         },
863         
864         /**
865         * Applies a key-value Object literal to the configuration, replacing  
866         * any existing values, and queueing the property events.
867         * Although the values will be set, fireQueue() must be called for their 
868         * associated events to execute.
869         * @method applyConfig
870         * @param {Object} userConfig The configuration Object literal
871         * @param {Boolean} init  When set to true, the initialConfig will 
872         * be set to the userConfig passed in, so that calling a reset will 
873         * reset the properties to the passed values.
874         */
875         applyConfig: function (userConfig, init) {
876         
877             var sKey,
878                 oConfig;
879
880             if (init) {
881                 oConfig = {};
882                 for (sKey in userConfig) {
883                     if (Lang.hasOwnProperty(userConfig, sKey)) {
884                         oConfig[sKey.toLowerCase()] = userConfig[sKey];
885                     }
886                 }
887                 this.initialConfig = oConfig;
888             }
889
890             for (sKey in userConfig) {
891                 if (Lang.hasOwnProperty(userConfig, sKey)) {
892                     this.queueProperty(sKey, userConfig[sKey]);
893                 }
894             }
895         },
896         
897         /**
898         * Refires the events for all configuration properties using their 
899         * current values.
900         * @method refresh
901         */
902         refresh: function () {
903
904             var prop;
905
906             for (prop in this.config) {
907                 if (Lang.hasOwnProperty(this.config, prop)) {
908                     this.refireEvent(prop);
909                 }
910             }
911         },
912         
913         /**
914         * Fires the normalized list of queued property change events
915         * @method fireQueue
916         */
917         fireQueue: function () {
918         
919             var i, 
920                 queueItem,
921                 key,
922                 value,
923                 property;
924         
925             this.queueInProgress = true;
926             for (i = 0;i < this.eventQueue.length; i++) {
927                 queueItem = this.eventQueue[i];
928                 if (queueItem) {
929         
930                     key = queueItem[0];
931                     value = queueItem[1];
932                     property = this.config[key];
933
934                     property.value = value;
935
936                     // Clear out queue entry, to avoid it being 
937                     // re-added to the queue by any queueProperty/supercedes
938                     // calls which are invoked during fireEvent
939                     this.eventQueue[i] = null;
940
941                     this.fireEvent(key,value);
942                 }
943             }
944             
945             this.queueInProgress = false;
946             this.eventQueue = [];
947         },
948         
949         /**
950         * Subscribes an external handler to the change event for any 
951         * given property. 
952         * @method subscribeToConfigEvent
953         * @param {String} key The property name
954         * @param {Function} handler The handler function to use subscribe to 
955         * the property's event
956         * @param {Object} obj The Object to use for scoping the event handler 
957         * (see CustomEvent documentation)
958         * @param {Boolean} overrideContext Optional. If true, will override
959         * "this" within the handler to map to the scope Object passed into the
960         * method.
961         * @return {Boolean} True, if the subscription was successful, 
962         * otherwise false.
963         */ 
964         subscribeToConfigEvent: function (key, handler, obj, overrideContext) {
965     
966             var property = this.config[key.toLowerCase()];
967     
968             if (property && property.event) {
969                 if (!Config.alreadySubscribed(property.event, handler, obj)) {
970                     property.event.subscribe(handler, obj, overrideContext);
971                 }
972                 return true;
973             } else {
974                 return false;
975             }
976     
977         },
978         
979         /**
980         * Unsubscribes an external handler from the change event for any 
981         * given property. 
982         * @method unsubscribeFromConfigEvent
983         * @param {String} key The property name
984         * @param {Function} handler The handler function to use subscribe to 
985         * the property's event
986         * @param {Object} obj The Object to use for scoping the event 
987         * handler (see CustomEvent documentation)
988         * @return {Boolean} True, if the unsubscription was successful, 
989         * otherwise false.
990         */
991         unsubscribeFromConfigEvent: function (key, handler, obj) {
992             var property = this.config[key.toLowerCase()];
993             if (property && property.event) {
994                 return property.event.unsubscribe(handler, obj);
995             } else {
996                 return false;
997             }
998         },
999         
1000         /**
1001         * Returns a string representation of the Config object
1002         * @method toString
1003         * @return {String} The Config object in string format.
1004         */
1005         toString: function () {
1006             var output = "Config";
1007             if (this.owner) {
1008                 output += " [" + this.owner.toString() + "]";
1009             }
1010             return output;
1011         },
1012         
1013         /**
1014         * Returns a string representation of the Config object's current 
1015         * CustomEvent queue
1016         * @method outputEventQueue
1017         * @return {String} The string list of CustomEvents currently queued 
1018         * for execution
1019         */
1020         outputEventQueue: function () {
1021
1022             var output = "",
1023                 queueItem,
1024                 q,
1025                 nQueue = this.eventQueue.length;
1026               
1027             for (q = 0; q < nQueue; q++) {
1028                 queueItem = this.eventQueue[q];
1029                 if (queueItem) {
1030                     output += queueItem[0] + "=" + queueItem[1] + ", ";
1031                 }
1032             }
1033             return output;
1034         },
1035
1036         /**
1037         * Sets all properties to null, unsubscribes all listeners from each 
1038         * property's change event and all listeners from the configChangedEvent.
1039         * @method destroy
1040         */
1041         destroy: function () {
1042
1043             var oConfig = this.config,
1044                 sProperty,
1045                 oProperty;
1046
1047
1048             for (sProperty in oConfig) {
1049             
1050                 if (Lang.hasOwnProperty(oConfig, sProperty)) {
1051
1052                     oProperty = oConfig[sProperty];
1053
1054                     oProperty.event.unsubscribeAll();
1055                     oProperty.event = null;
1056
1057                 }
1058             
1059             }
1060             
1061             this.configChangedEvent.unsubscribeAll();
1062             
1063             this.configChangedEvent = null;
1064             this.owner = null;
1065             this.config = null;
1066             this.initialConfig = null;
1067             this.eventQueue = null;
1068         
1069         }
1070
1071     };
1072     
1073     
1074     
1075     /**
1076     * Checks to determine if a particular function/Object pair are already 
1077     * subscribed to the specified CustomEvent
1078     * @method YAHOO.util.Config.alreadySubscribed
1079     * @static
1080     * @param {YAHOO.util.CustomEvent} evt The CustomEvent for which to check 
1081     * the subscriptions
1082     * @param {Function} fn The function to look for in the subscribers list
1083     * @param {Object} obj The execution scope Object for the subscription
1084     * @return {Boolean} true, if the function/Object pair is already subscribed 
1085     * to the CustomEvent passed in
1086     */
1087     Config.alreadySubscribed = function (evt, fn, obj) {
1088     
1089         var nSubscribers = evt.subscribers.length,
1090             subsc,
1091             i;
1092
1093         if (nSubscribers > 0) {
1094             i = nSubscribers - 1;
1095             do {
1096                 subsc = evt.subscribers[i];
1097                 if (subsc && subsc.obj == obj && subsc.fn == fn) {
1098                     return true;
1099                 }
1100             }
1101             while (i--);
1102         }
1103
1104         return false;
1105
1106     };
1107
1108     YAHOO.lang.augmentProto(Config, YAHOO.util.EventProvider);
1109
1110 }());
1111 /**
1112 * The datemath module provides utility methods for basic JavaScript Date object manipulation and 
1113 * comparison. 
1114
1115 * @module datemath
1116 */
1117
1118 /**
1119 * YAHOO.widget.DateMath is used for simple date manipulation. The class is a static utility
1120 * used for adding, subtracting, and comparing dates.
1121 * @namespace YAHOO.widget
1122 * @class DateMath
1123 */
1124 YAHOO.widget.DateMath = {
1125     /**
1126     * Constant field representing Day
1127     * @property DAY
1128     * @static
1129     * @final
1130     * @type String
1131     */
1132     DAY : "D",
1133
1134     /**
1135     * Constant field representing Week
1136     * @property WEEK
1137     * @static
1138     * @final
1139     * @type String
1140     */
1141     WEEK : "W",
1142
1143     /**
1144     * Constant field representing Year
1145     * @property YEAR
1146     * @static
1147     * @final
1148     * @type String
1149     */
1150     YEAR : "Y",
1151
1152     /**
1153     * Constant field representing Month
1154     * @property MONTH
1155     * @static
1156     * @final
1157     * @type String
1158     */
1159     MONTH : "M",
1160
1161     /**
1162     * Constant field representing one day, in milliseconds
1163     * @property ONE_DAY_MS
1164     * @static
1165     * @final
1166     * @type Number
1167     */
1168     ONE_DAY_MS : 1000*60*60*24,
1169     
1170     /**
1171      * Constant field representing the date in first week of January
1172      * which identifies the first week of the year.
1173      * <p>
1174      * In the U.S, Jan 1st is normally used based on a Sunday start of week.
1175      * ISO 8601, used widely throughout Europe, uses Jan 4th, based on a Monday start of week.
1176      * </p>
1177      * @property WEEK_ONE_JAN_DATE
1178      * @static
1179      * @type Number
1180      */
1181     WEEK_ONE_JAN_DATE : 1,
1182
1183     /**
1184     * Adds the specified amount of time to the this instance.
1185     * @method add
1186     * @param {Date} date The JavaScript Date object to perform addition on
1187     * @param {String} field The field constant to be used for performing addition.
1188     * @param {Number} amount The number of units (measured in the field constant) to add to the date.
1189     * @return {Date} The resulting Date object
1190     */
1191     add : function(date, field, amount) {
1192         var d = new Date(date.getTime());
1193         switch (field) {
1194             case this.MONTH:
1195                 var newMonth = date.getMonth() + amount;
1196                 var years = 0;
1197
1198                 if (newMonth < 0) {
1199                     while (newMonth < 0) {
1200                         newMonth += 12;
1201                         years -= 1;
1202                     }
1203                 } else if (newMonth > 11) {
1204                     while (newMonth > 11) {
1205                         newMonth -= 12;
1206                         years += 1;
1207                     }
1208                 }
1209
1210                 d.setMonth(newMonth);
1211                 d.setFullYear(date.getFullYear() + years);
1212                 break;
1213             case this.DAY:
1214                 this._addDays(d, amount);
1215                 // d.setDate(date.getDate() + amount);
1216                 break;
1217             case this.YEAR:
1218                 d.setFullYear(date.getFullYear() + amount);
1219                 break;
1220             case this.WEEK:
1221                 this._addDays(d, (amount * 7));
1222                 // d.setDate(date.getDate() + (amount * 7));
1223                 break;
1224         }
1225         return d;
1226     },
1227
1228     /**
1229      * Private helper method to account for bug in Safari 2 (webkit < 420)
1230      * when Date.setDate(n) is called with n less than -128 or greater than 127.
1231      * <p>
1232      * Fix approach and original findings are available here:
1233      * http://brianary.blogspot.com/2006/03/safari-date-bug.html
1234      * </p>
1235      * @method _addDays
1236      * @param {Date} d JavaScript date object
1237      * @param {Number} nDays The number of days to add to the date object (can be negative)
1238      * @private
1239      */
1240     _addDays : function(d, nDays) {
1241         if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420) {
1242             if (nDays < 0) {
1243                 // Ensure we don't go below -128 (getDate() is always 1 to 31, so we won't go above 127)
1244                 for(var min = -128; nDays < min; nDays -= min) {
1245                     d.setDate(d.getDate() + min);
1246                 }
1247             } else {
1248                 // Ensure we don't go above 96 + 31 = 127
1249                 for(var max = 96; nDays > max; nDays -= max) {
1250                     d.setDate(d.getDate() + max);
1251                 }
1252             }
1253             // nDays should be remainder between -128 and 96
1254         }
1255         d.setDate(d.getDate() + nDays);
1256     },
1257
1258     /**
1259     * Subtracts the specified amount of time from the this instance.
1260     * @method subtract
1261     * @param {Date} date The JavaScript Date object to perform subtraction on
1262     * @param {Number} field The this field constant to be used for performing subtraction.
1263     * @param {Number} amount The number of units (measured in the field constant) to subtract from the date.
1264     * @return {Date} The resulting Date object
1265     */
1266     subtract : function(date, field, amount) {
1267         return this.add(date, field, (amount*-1));
1268     },
1269
1270     /**
1271     * Determines whether a given date is before another date on the calendar.
1272     * @method before
1273     * @param {Date} date  The Date object to compare with the compare argument
1274     * @param {Date} compareTo The Date object to use for the comparison
1275     * @return {Boolean} true if the date occurs before the compared date; false if not.
1276     */
1277     before : function(date, compareTo) {
1278         var ms = compareTo.getTime();
1279         if (date.getTime() < ms) {
1280             return true;
1281         } else {
1282             return false;
1283         }
1284     },
1285
1286     /**
1287     * Determines whether a given date is after another date on the calendar.
1288     * @method after
1289     * @param {Date} date  The Date object to compare with the compare argument
1290     * @param {Date} compareTo The Date object to use for the comparison
1291     * @return {Boolean} true if the date occurs after the compared date; false if not.
1292     */
1293     after : function(date, compareTo) {
1294         var ms = compareTo.getTime();
1295         if (date.getTime() > ms) {
1296             return true;
1297         } else {
1298             return false;
1299         }
1300     },
1301
1302     /**
1303     * Determines whether a given date is between two other dates on the calendar.
1304     * @method between
1305     * @param {Date} date  The date to check for
1306     * @param {Date} dateBegin The start of the range
1307     * @param {Date} dateEnd  The end of the range
1308     * @return {Boolean} true if the date occurs between the compared dates; false if not.
1309     */
1310     between : function(date, dateBegin, dateEnd) {
1311         if (this.after(date, dateBegin) && this.before(date, dateEnd)) {
1312             return true;
1313         } else {
1314             return false;
1315         }
1316     },
1317     
1318     /**
1319     * Retrieves a JavaScript Date object representing January 1 of any given year.
1320     * @method getJan1
1321     * @param {Number} calendarYear  The calendar year for which to retrieve January 1
1322     * @return {Date} January 1 of the calendar year specified.
1323     */
1324     getJan1 : function(calendarYear) {
1325         return this.getDate(calendarYear,0,1);
1326     },
1327
1328     /**
1329     * Calculates the number of days the specified date is from January 1 of the specified calendar year.
1330     * Passing January 1 to this function would return an offset value of zero.
1331     * @method getDayOffset
1332     * @param {Date} date The JavaScript date for which to find the offset
1333     * @param {Number} calendarYear The calendar year to use for determining the offset
1334     * @return {Number} The number of days since January 1 of the given year
1335     */
1336     getDayOffset : function(date, calendarYear) {
1337         var beginYear = this.getJan1(calendarYear); // Find the start of the year. This will be in week 1.
1338         
1339         // Find the number of days the passed in date is away from the calendar year start
1340         var dayOffset = Math.ceil((date.getTime()-beginYear.getTime()) / this.ONE_DAY_MS);
1341         return dayOffset;
1342     },
1343
1344     /**
1345     * Calculates the week number for the given date. Can currently support standard
1346     * U.S. week numbers, based on Jan 1st defining the 1st week of the year, and 
1347     * ISO8601 week numbers, based on Jan 4th defining the 1st week of the year.
1348     * 
1349     * @method getWeekNumber
1350     * @param {Date} date The JavaScript date for which to find the week number
1351     * @param {Number} firstDayOfWeek The index of the first day of the week (0 = Sun, 1 = Mon ... 6 = Sat).
1352     * Defaults to 0
1353     * @param {Number} janDate The date in the first week of January which defines week one for the year
1354     * Defaults to the value of YAHOO.widget.DateMath.WEEK_ONE_JAN_DATE, which is 1 (Jan 1st). 
1355     * For the U.S, this is normally Jan 1st. ISO8601 uses Jan 4th to define the first week of the year.
1356     * 
1357     * @return {Number} The number of the week containing the given date.
1358     */
1359     getWeekNumber : function(date, firstDayOfWeek, janDate) {
1360
1361         // Setup Defaults
1362         firstDayOfWeek = firstDayOfWeek || 0;
1363         janDate = janDate || this.WEEK_ONE_JAN_DATE;
1364
1365         var targetDate = this.clearTime(date),
1366             startOfWeek,
1367             endOfWeek;
1368
1369         if (targetDate.getDay() === firstDayOfWeek) { 
1370             startOfWeek = targetDate;
1371         } else {
1372             startOfWeek = this.getFirstDayOfWeek(targetDate, firstDayOfWeek);
1373         }
1374
1375         var startYear = startOfWeek.getFullYear();
1376
1377         // DST shouldn't be a problem here, math is quicker than setDate();
1378         endOfWeek = new Date(startOfWeek.getTime() + 6*this.ONE_DAY_MS);
1379
1380         var weekNum;
1381         if (startYear !== endOfWeek.getFullYear() && endOfWeek.getDate() >= janDate) {
1382             // If years don't match, endOfWeek is in Jan. and if the 
1383             // week has WEEK_ONE_JAN_DATE in it, it's week one by definition.
1384             weekNum = 1;
1385         } else {
1386             // Get the 1st day of the 1st week, and 
1387             // find how many days away we are from it.
1388             var weekOne = this.clearTime(this.getDate(startYear, 0, janDate)),
1389                 weekOneDayOne = this.getFirstDayOfWeek(weekOne, firstDayOfWeek);
1390
1391             // Round days to smoothen out 1 hr DST diff
1392             var daysDiff  = Math.round((targetDate.getTime() - weekOneDayOne.getTime())/this.ONE_DAY_MS);
1393
1394             // Calc. Full Weeks
1395             var rem = daysDiff % 7;
1396             var weeksDiff = (daysDiff - rem)/7;
1397             weekNum = weeksDiff + 1;
1398         }
1399         return weekNum;
1400     },
1401
1402     /**
1403      * Get the first day of the week, for the give date. 
1404      * @param {Date} dt The date in the week for which the first day is required.
1405      * @param {Number} startOfWeek The index for the first day of the week, 0 = Sun, 1 = Mon ... 6 = Sat (defaults to 0)
1406      * @return {Date} The first day of the week
1407      */
1408     getFirstDayOfWeek : function (dt, startOfWeek) {
1409         startOfWeek = startOfWeek || 0;
1410         var dayOfWeekIndex = dt.getDay(),
1411             dayOfWeek = (dayOfWeekIndex - startOfWeek + 7) % 7;
1412
1413         return this.subtract(dt, this.DAY, dayOfWeek);
1414     },
1415
1416     /**
1417     * Determines if a given week overlaps two different years.
1418     * @method isYearOverlapWeek
1419     * @param {Date} weekBeginDate The JavaScript Date representing the first day of the week.
1420     * @return {Boolean} true if the date overlaps two different years.
1421     */
1422     isYearOverlapWeek : function(weekBeginDate) {
1423         var overlaps = false;
1424         var nextWeek = this.add(weekBeginDate, this.DAY, 6);
1425         if (nextWeek.getFullYear() != weekBeginDate.getFullYear()) {
1426             overlaps = true;
1427         }
1428         return overlaps;
1429     },
1430
1431     /**
1432     * Determines if a given week overlaps two different months.
1433     * @method isMonthOverlapWeek
1434     * @param {Date} weekBeginDate The JavaScript Date representing the first day of the week.
1435     * @return {Boolean} true if the date overlaps two different months.
1436     */
1437     isMonthOverlapWeek : function(weekBeginDate) {
1438         var overlaps = false;
1439         var nextWeek = this.add(weekBeginDate, this.DAY, 6);
1440         if (nextWeek.getMonth() != weekBeginDate.getMonth()) {
1441             overlaps = true;
1442         }
1443         return overlaps;
1444     },
1445
1446     /**
1447     * Gets the first day of a month containing a given date.
1448     * @method findMonthStart
1449     * @param {Date} date The JavaScript Date used to calculate the month start
1450     * @return {Date}  The JavaScript Date representing the first day of the month
1451     */
1452     findMonthStart : function(date) {
1453         var start = this.getDate(date.getFullYear(), date.getMonth(), 1);
1454         return start;
1455     },
1456
1457     /**
1458     * Gets the last day of a month containing a given date.
1459     * @method findMonthEnd
1460     * @param {Date} date The JavaScript Date used to calculate the month end
1461     * @return {Date}  The JavaScript Date representing the last day of the month
1462     */
1463     findMonthEnd : function(date) {
1464         var start = this.findMonthStart(date);
1465         var nextMonth = this.add(start, this.MONTH, 1);
1466         var end = this.subtract(nextMonth, this.DAY, 1);
1467         return end;
1468     },
1469
1470     /**
1471     * Clears the time fields from a given date, effectively setting the time to 12 noon.
1472     * @method clearTime
1473     * @param {Date} date The JavaScript Date for which the time fields will be cleared
1474     * @return {Date}  The JavaScript Date cleared of all time fields
1475     */
1476     clearTime : function(date) {
1477         date.setHours(12,0,0,0);
1478         return date;
1479     },
1480
1481     /**
1482      * Returns a new JavaScript Date object, representing the given year, month and date. Time fields (hr, min, sec, ms) on the new Date object
1483      * are set to 0. The method allows Date instances to be created with the a year less than 100. "new Date(year, month, date)" implementations 
1484      * set the year to 19xx if a year (xx) which is less than 100 is provided.
1485      * <p>
1486      * <em>NOTE:</em>Validation on argument values is not performed. It is the caller's responsibility to ensure
1487      * arguments are valid as per the ECMAScript-262 Date object specification for the new Date(year, month[, date]) constructor.
1488      * </p>
1489      * @method getDate
1490      * @param {Number} y Year.
1491      * @param {Number} m Month index from 0 (Jan) to 11 (Dec).
1492      * @param {Number} d (optional) Date from 1 to 31. If not provided, defaults to 1.
1493      * @return {Date} The JavaScript date object with year, month, date set as provided.
1494      */
1495     getDate : function(y, m, d) {
1496         var dt = null;
1497         if (YAHOO.lang.isUndefined(d)) {
1498             d = 1;
1499         }
1500         if (y >= 100) {
1501             dt = new Date(y, m, d);
1502         } else {
1503             dt = new Date();
1504             dt.setFullYear(y);
1505             dt.setMonth(m);
1506             dt.setDate(d);
1507             dt.setHours(0,0,0,0);
1508         }
1509         return dt;
1510     }
1511 };
1512 /**
1513 * The Calendar component is a UI control that enables users to choose one or more dates from a graphical calendar presented in a one-month or
1514 * multi-month interface. Calendars are generated entirely via script and can be navigated without any page refreshes.
1515 * @module    calendar
1516 * @title    Calendar
1517 * @namespace  YAHOO.widget
1518 * @requires  yahoo,dom,event
1519 */
1520 (function(){
1521
1522     var Dom = YAHOO.util.Dom,
1523         Event = YAHOO.util.Event,
1524         Lang = YAHOO.lang,
1525         DateMath = YAHOO.widget.DateMath;
1526
1527 /**
1528 * Calendar is the base class for the Calendar widget. In its most basic
1529 * implementation, it has the ability to render a calendar widget on the page
1530 * that can be manipulated to select a single date, move back and forth between
1531 * months and years.
1532 * <p>To construct the placeholder for the calendar widget, the code is as
1533 * follows:
1534 *   <xmp>
1535 *       <div id="calContainer"></div>
1536 *   </xmp>
1537 * </p>
1538 * <p>
1539 * <strong>NOTE: As of 2.4.0, the constructor's ID argument is optional.</strong>
1540 * The Calendar can be constructed by simply providing a container ID string, 
1541 * or a reference to a container DIV HTMLElement (the element needs to exist 
1542 * in the document).
1543
1544 * E.g.:
1545 *   <xmp>
1546 *       var c = new YAHOO.widget.Calendar("calContainer", configOptions);
1547 *   </xmp>
1548 * or:
1549 *   <xmp>
1550 *       var containerDiv = YAHOO.util.Dom.get("calContainer");
1551 *       var c = new YAHOO.widget.Calendar(containerDiv, configOptions);
1552 *   </xmp>
1553 * </p>
1554 * <p>
1555 * If not provided, the ID will be generated from the container DIV ID by adding an "_t" suffix.
1556 * For example if an ID is not provided, and the container's ID is "calContainer", the Calendar's ID will be set to "calContainer_t".
1557 * </p>
1558
1559 * @namespace YAHOO.widget
1560 * @class Calendar
1561 * @constructor
1562 * @param {String} id optional The id of the table element that will represent the Calendar widget. As of 2.4.0, this argument is optional.
1563 * @param {String | HTMLElement} container The id of the container div element that will wrap the Calendar table, or a reference to a DIV element which exists in the document.
1564 * @param {Object} config optional The configuration object containing the initial configuration values for the Calendar.
1565 */
1566 function Calendar(id, containerId, config) {
1567     this.init.apply(this, arguments);
1568 }
1569
1570 /**
1571 * The path to be used for images loaded for the Calendar
1572 * @property YAHOO.widget.Calendar.IMG_ROOT
1573 * @static
1574 * @deprecated   You can now customize images by overriding the calclose, calnavleft and calnavright default CSS classes for the close icon, left arrow and right arrow respectively
1575 * @type String
1576 */
1577 Calendar.IMG_ROOT = null;
1578
1579 /**
1580 * Type constant used for renderers to represent an individual date (M/D/Y)
1581 * @property YAHOO.widget.Calendar.DATE
1582 * @static
1583 * @final
1584 * @type String
1585 */
1586 Calendar.DATE = "D";
1587
1588 /**
1589 * Type constant used for renderers to represent an individual date across any year (M/D)
1590 * @property YAHOO.widget.Calendar.MONTH_DAY
1591 * @static
1592 * @final
1593 * @type String
1594 */
1595 Calendar.MONTH_DAY = "MD";
1596
1597 /**
1598 * Type constant used for renderers to represent a weekday
1599 * @property YAHOO.widget.Calendar.WEEKDAY
1600 * @static
1601 * @final
1602 * @type String
1603 */
1604 Calendar.WEEKDAY = "WD";
1605
1606 /**
1607 * Type constant used for renderers to represent a range of individual dates (M/D/Y-M/D/Y)
1608 * @property YAHOO.widget.Calendar.RANGE
1609 * @static
1610 * @final
1611 * @type String
1612 */
1613 Calendar.RANGE = "R";
1614
1615 /**
1616 * Type constant used for renderers to represent a month across any year
1617 * @property YAHOO.widget.Calendar.MONTH
1618 * @static
1619 * @final
1620 * @type String
1621 */
1622 Calendar.MONTH = "M";
1623
1624 /**
1625 * Constant that represents the total number of date cells that are displayed in a given month
1626 * @property YAHOO.widget.Calendar.DISPLAY_DAYS
1627 * @static
1628 * @final
1629 * @type Number
1630 */
1631 Calendar.DISPLAY_DAYS = 42;
1632
1633 /**
1634 * Constant used for halting the execution of the remainder of the render stack
1635 * @property YAHOO.widget.Calendar.STOP_RENDER
1636 * @static
1637 * @final
1638 * @type String
1639 */
1640 Calendar.STOP_RENDER = "S";
1641
1642 /**
1643 * Constant used to represent short date field string formats (e.g. Tu or Feb)
1644 * @property YAHOO.widget.Calendar.SHORT
1645 * @static
1646 * @final
1647 * @type String
1648 */
1649 Calendar.SHORT = "short";
1650
1651 /**
1652 * Constant used to represent long date field string formats (e.g. Monday or February)
1653 * @property YAHOO.widget.Calendar.LONG
1654 * @static
1655 * @final
1656 * @type String
1657 */
1658 Calendar.LONG = "long";
1659
1660 /**
1661 * Constant used to represent medium date field string formats (e.g. Mon)
1662 * @property YAHOO.widget.Calendar.MEDIUM
1663 * @static
1664 * @final
1665 * @type String
1666 */
1667 Calendar.MEDIUM = "medium";
1668
1669 /**
1670 * Constant used to represent single character date field string formats (e.g. M, T, W)
1671 * @property YAHOO.widget.Calendar.ONE_CHAR
1672 * @static
1673 * @final
1674 * @type String
1675 */
1676 Calendar.ONE_CHAR = "1char";
1677
1678 /**
1679 * The set of default Config property keys and values for the Calendar.
1680 *
1681 * <p>
1682 * NOTE: This property is made public in order to allow users to change 
1683 * the default values of configuration properties. Users should not 
1684 * modify the key string, unless they are overriding the Calendar implementation
1685 * </p>
1686 *
1687 * <p>
1688 * The property is an object with key/value pairs, the key being the 
1689 * uppercase configuration property name and the value being an object 
1690 * literal with a key string property, and a value property, specifying the 
1691 * default value of the property. To override a default value, you can set
1692 * the value property, for example, <code>YAHOO.widget.Calendar.DEFAULT_CONFIG.MULTI_SELECT.value = true;</code>
1693
1694 * @property YAHOO.widget.Calendar.DEFAULT_CONFIG
1695 * @static
1696 * @type Object
1697 */
1698
1699 Calendar.DEFAULT_CONFIG = {
1700     YEAR_OFFSET : {key:"year_offset", value:0, supercedes:["pagedate", "selected", "mindate","maxdate"]},
1701     TODAY : {key:"today", value:new Date(), supercedes:["pagedate"]}, 
1702     PAGEDATE : {key:"pagedate", value:null},
1703     SELECTED : {key:"selected", value:[]},
1704     TITLE : {key:"title", value:""},
1705     CLOSE : {key:"close", value:false},
1706     IFRAME : {key:"iframe", value:(YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) ? true : false},
1707     MINDATE : {key:"mindate", value:null},
1708     MAXDATE : {key:"maxdate", value:null},
1709     MULTI_SELECT : {key:"multi_select", value:false},
1710     START_WEEKDAY : {key:"start_weekday", value:0},
1711     SHOW_WEEKDAYS : {key:"show_weekdays", value:true},
1712     SHOW_WEEK_HEADER : {key:"show_week_header", value:false},
1713     SHOW_WEEK_FOOTER : {key:"show_week_footer", value:false},
1714     HIDE_BLANK_WEEKS : {key:"hide_blank_weeks", value:false},
1715     NAV_ARROW_LEFT: {key:"nav_arrow_left", value:null} ,
1716     NAV_ARROW_RIGHT : {key:"nav_arrow_right", value:null} ,
1717     MONTHS_SHORT : {key:"months_short", value:["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]},
1718     MONTHS_LONG: {key:"months_long", value:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]},
1719     WEEKDAYS_1CHAR: {key:"weekdays_1char", value:["S", "M", "T", "W", "T", "F", "S"]},
1720     WEEKDAYS_SHORT: {key:"weekdays_short", value:["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]},
1721     WEEKDAYS_MEDIUM: {key:"weekdays_medium", value:["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]},
1722     WEEKDAYS_LONG: {key:"weekdays_long", value:["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]},
1723     LOCALE_MONTHS:{key:"locale_months", value:"long"},
1724     LOCALE_WEEKDAYS:{key:"locale_weekdays", value:"short"},
1725     DATE_DELIMITER:{key:"date_delimiter", value:","},
1726     DATE_FIELD_DELIMITER:{key:"date_field_delimiter", value:"/"},
1727     DATE_RANGE_DELIMITER:{key:"date_range_delimiter", value:"-"},
1728     MY_MONTH_POSITION:{key:"my_month_position", value:1},
1729     MY_YEAR_POSITION:{key:"my_year_position", value:2},
1730     MD_MONTH_POSITION:{key:"md_month_position", value:1},
1731     MD_DAY_POSITION:{key:"md_day_position", value:2},
1732     MDY_MONTH_POSITION:{key:"mdy_month_position", value:1},
1733     MDY_DAY_POSITION:{key:"mdy_day_position", value:2},
1734     MDY_YEAR_POSITION:{key:"mdy_year_position", value:3},
1735     MY_LABEL_MONTH_POSITION:{key:"my_label_month_position", value:1},
1736     MY_LABEL_YEAR_POSITION:{key:"my_label_year_position", value:2},
1737     MY_LABEL_MONTH_SUFFIX:{key:"my_label_month_suffix", value:" "},
1738     MY_LABEL_YEAR_SUFFIX:{key:"my_label_year_suffix", value:""},
1739     NAV: {key:"navigator", value: null},
1740     STRINGS : { 
1741         key:"strings",
1742         value: {
1743             previousMonth : "Previous Month",
1744             nextMonth : "Next Month",
1745             close: "Close"
1746         },
1747         supercedes : ["close", "title"]
1748     }
1749 };
1750
1751 /**
1752 * The set of default Config property keys and values for the Calendar
1753 * @property YAHOO.widget.Calendar._DEFAULT_CONFIG
1754 * @deprecated Made public. See the public DEFAULT_CONFIG property for details
1755 * @final
1756 * @static
1757 * @private
1758 * @type Object
1759 */
1760 Calendar._DEFAULT_CONFIG = Calendar.DEFAULT_CONFIG;
1761
1762 var DEF_CFG = Calendar.DEFAULT_CONFIG;
1763
1764 /**
1765 * The set of Custom Event types supported by the Calendar
1766 * @property YAHOO.widget.Calendar._EVENT_TYPES
1767 * @final
1768 * @static
1769 * @private
1770 * @type Object
1771 */
1772 Calendar._EVENT_TYPES = {
1773     BEFORE_SELECT : "beforeSelect", 
1774     SELECT : "select",
1775     BEFORE_DESELECT : "beforeDeselect",
1776     DESELECT : "deselect",
1777     CHANGE_PAGE : "changePage",
1778     BEFORE_RENDER : "beforeRender",
1779     RENDER : "render",
1780     BEFORE_DESTROY : "beforeDestroy",
1781     DESTROY : "destroy",
1782     RESET : "reset",
1783     CLEAR : "clear",
1784     BEFORE_HIDE : "beforeHide",
1785     HIDE : "hide",
1786     BEFORE_SHOW : "beforeShow",
1787     SHOW : "show",
1788     BEFORE_HIDE_NAV : "beforeHideNav",
1789     HIDE_NAV : "hideNav",
1790     BEFORE_SHOW_NAV : "beforeShowNav",
1791     SHOW_NAV : "showNav",
1792     BEFORE_RENDER_NAV : "beforeRenderNav",
1793     RENDER_NAV : "renderNav"
1794 };
1795
1796 /**
1797 * The set of default style constants for the Calendar
1798 * @property YAHOO.widget.Calendar.STYLES
1799 * @static
1800 * @type Object An object with name/value pairs for the class name identifier/value.
1801 */
1802 Calendar.STYLES = {
1803     CSS_ROW_HEADER: "calrowhead",
1804     CSS_ROW_FOOTER: "calrowfoot",
1805     CSS_CELL : "calcell",
1806     CSS_CELL_SELECTOR : "selector",
1807     CSS_CELL_SELECTED : "selected",
1808     CSS_CELL_SELECTABLE : "selectable",
1809     CSS_CELL_RESTRICTED : "restricted",
1810     CSS_CELL_TODAY : "today",
1811     CSS_CELL_OOM : "oom",
1812     CSS_CELL_OOB : "previous",
1813     CSS_HEADER : "calheader",
1814     CSS_HEADER_TEXT : "calhead",
1815     CSS_BODY : "calbody",
1816     CSS_WEEKDAY_CELL : "calweekdaycell",
1817     CSS_WEEKDAY_ROW : "calweekdayrow",
1818     CSS_FOOTER : "calfoot",
1819     CSS_CALENDAR : "yui-calendar",
1820     CSS_SINGLE : "single",
1821     CSS_CONTAINER : "yui-calcontainer",
1822     CSS_NAV_LEFT : "calnavleft",
1823     CSS_NAV_RIGHT : "calnavright",
1824     CSS_NAV : "calnav",
1825     CSS_CLOSE : "calclose",
1826     CSS_CELL_TOP : "calcelltop",
1827     CSS_CELL_LEFT : "calcellleft",
1828     CSS_CELL_RIGHT : "calcellright",
1829     CSS_CELL_BOTTOM : "calcellbottom",
1830     CSS_CELL_HOVER : "calcellhover",
1831     CSS_CELL_HIGHLIGHT1 : "highlight1",
1832     CSS_CELL_HIGHLIGHT2 : "highlight2",
1833     CSS_CELL_HIGHLIGHT3 : "highlight3",
1834     CSS_CELL_HIGHLIGHT4 : "highlight4",
1835     CSS_WITH_TITLE: "withtitle",
1836     CSS_FIXED_SIZE: "fixedsize",
1837     CSS_LINK_CLOSE: "link-close"
1838 };
1839
1840 /**
1841 * The set of default style constants for the Calendar
1842 * @property YAHOO.widget.Calendar._STYLES
1843 * @deprecated Made public. See the public STYLES property for details
1844 * @final
1845 * @static
1846 * @private
1847 * @type Object
1848 */
1849 Calendar._STYLES = Calendar.STYLES;
1850
1851 Calendar.prototype = {
1852
1853     /**
1854     * The configuration object used to set up the calendars various locale and style options.
1855     * @property Config
1856     * @private
1857     * @deprecated Configuration properties should be set by calling Calendar.cfg.setProperty.
1858     * @type Object
1859     */
1860     Config : null,
1861
1862     /**
1863     * The parent CalendarGroup, only to be set explicitly by the parent group
1864     * @property parent
1865     * @type CalendarGroup
1866     */ 
1867     parent : null,
1868
1869     /**
1870     * The index of this item in the parent group
1871     * @property index
1872     * @type Number
1873     */
1874     index : -1,
1875
1876     /**
1877     * The collection of calendar table cells
1878     * @property cells
1879     * @type HTMLTableCellElement[]
1880     */
1881     cells : null,
1882
1883     /**
1884     * The collection of calendar cell dates that is parallel to the cells collection. The array contains dates field arrays in the format of [YYYY, M, D].
1885     * @property cellDates
1886     * @type Array[](Number[])
1887     */
1888     cellDates : null,
1889
1890     /**
1891     * The id that uniquely identifies this Calendar.
1892     * @property id
1893     * @type String
1894     */
1895     id : null,
1896
1897     /**
1898     * The unique id associated with the Calendar's container
1899     * @property containerId
1900     * @type String
1901     */
1902     containerId: null,
1903
1904     /**
1905     * The DOM element reference that points to this calendar's container element. The calendar will be inserted into this element when the shell is rendered.
1906     * @property oDomContainer
1907     * @type HTMLElement
1908     */
1909     oDomContainer : null,
1910
1911     /**
1912     * A Date object representing today's date.
1913     * @deprecated Use the "today" configuration property
1914     * @property today
1915     * @type Date
1916     */
1917     today : null,
1918
1919     /**
1920     * The list of render functions, along with required parameters, used to render cells. 
1921     * @property renderStack
1922     * @type Array[]
1923     */
1924     renderStack : null,
1925
1926     /**
1927     * A copy of the initial render functions created before rendering.
1928     * @property _renderStack
1929     * @private
1930     * @type Array
1931     */
1932     _renderStack : null,
1933
1934     /**
1935     * A reference to the CalendarNavigator instance created for this Calendar.
1936     * Will be null if the "navigator" configuration property has not been set
1937     * @property oNavigator
1938     * @type CalendarNavigator
1939     */
1940     oNavigator : null,
1941
1942     /**
1943     * The private list of initially selected dates.
1944     * @property _selectedDates
1945     * @private
1946     * @type Array
1947     */
1948     _selectedDates : null,
1949
1950     /**
1951     * A map of DOM event handlers to attach to cells associated with specific CSS class names
1952     * @property domEventMap
1953     * @type Object
1954     */
1955     domEventMap : null,
1956
1957     /**
1958      * Protected helper used to parse Calendar constructor/init arguments.
1959      *
1960      * As of 2.4.0, Calendar supports a simpler constructor 
1961      * signature. This method reconciles arguments
1962      * received in the pre 2.4.0 and 2.4.0 formats.
1963      * 
1964      * @protected
1965      * @method _parseArgs
1966      * @param {Array} Function "arguments" array
1967      * @return {Object} Object with id, container, config properties containing
1968      * the reconciled argument values.
1969      **/
1970     _parseArgs : function(args) {
1971         /*
1972            2.4.0 Constructors signatures
1973
1974            new Calendar(String)
1975            new Calendar(HTMLElement)
1976            new Calendar(String, ConfigObject)
1977            new Calendar(HTMLElement, ConfigObject)
1978
1979            Pre 2.4.0 Constructor signatures
1980
1981            new Calendar(String, String)
1982            new Calendar(String, HTMLElement)
1983            new Calendar(String, String, ConfigObject)
1984            new Calendar(String, HTMLElement, ConfigObject)
1985          */
1986         var nArgs = {id:null, container:null, config:null};
1987
1988         if (args && args.length && args.length > 0) {
1989             switch (args.length) {
1990                 case 1:
1991                     nArgs.id = null;
1992                     nArgs.container = args[0];
1993                     nArgs.config = null;
1994                     break;
1995                 case 2:
1996                     if (Lang.isObject(args[1]) && !args[1].tagName && !(args[1] instanceof String)) {
1997                         nArgs.id = null;
1998                         nArgs.container = args[0];
1999                         nArgs.config = args[1];
2000                     } else {
2001                         nArgs.id = args[0];
2002                         nArgs.container = args[1];
2003                         nArgs.config = null;
2004                     }
2005                     break;
2006                 default: // 3+
2007                     nArgs.id = args[0];
2008                     nArgs.container = args[1];
2009                     nArgs.config = args[2];
2010                     break;
2011             }
2012         } else {
2013         }
2014         return nArgs;
2015     },
2016
2017     /**
2018     * Initializes the Calendar widget.
2019     * @method init
2020     *
2021     * @param {String} id optional The id of the table element that will represent the Calendar widget. As of 2.4.0, this argument is optional.
2022     * @param {String | HTMLElement} container The id of the container div element that will wrap the Calendar table, or a reference to a DIV element which exists in the document.
2023     * @param {Object} config optional The configuration object containing the initial configuration values for the Calendar.
2024     */
2025     init : function(id, container, config) {
2026         // Normalize 2.4.0, pre 2.4.0 args
2027         var nArgs = this._parseArgs(arguments);
2028
2029         id = nArgs.id;
2030         container = nArgs.container;
2031         config = nArgs.config;
2032
2033         this.oDomContainer = Dom.get(container);
2034
2035         if (!this.oDomContainer.id) {
2036             this.oDomContainer.id = Dom.generateId();
2037         }
2038         if (!id) {
2039             id = this.oDomContainer.id + "_t";
2040         }
2041
2042         this.id = id;
2043         this.containerId = this.oDomContainer.id;
2044
2045         this.initEvents();
2046
2047         /**
2048         * The Config object used to hold the configuration variables for the Calendar
2049         * @property cfg
2050         * @type YAHOO.util.Config
2051         */
2052         this.cfg = new YAHOO.util.Config(this);
2053
2054         /**
2055         * The local object which contains the Calendar's options
2056         * @property Options
2057         * @type Object
2058         */
2059         this.Options = {};
2060
2061         /**
2062         * The local object which contains the Calendar's locale settings
2063         * @property Locale
2064         * @type Object
2065         */
2066         this.Locale = {};
2067
2068         this.initStyles();
2069
2070         Dom.addClass(this.oDomContainer, this.Style.CSS_CONTAINER);
2071         Dom.addClass(this.oDomContainer, this.Style.CSS_SINGLE);
2072
2073         this.cellDates = [];
2074         this.cells = [];
2075         this.renderStack = [];
2076         this._renderStack = [];
2077
2078         this.setupConfig();
2079
2080         if (config) {
2081             this.cfg.applyConfig(config, true);
2082         }
2083
2084         this.cfg.fireQueue();
2085
2086         this.today = this.cfg.getProperty("today");
2087     },
2088
2089     /**
2090     * Default Config listener for the iframe property. If the iframe config property is set to true, 
2091     * renders the built-in IFRAME shim if the container is relatively or absolutely positioned.
2092     * 
2093     * @method configIframe
2094     */
2095     configIframe : function(type, args, obj) {
2096         var useIframe = args[0];
2097     
2098         if (!this.parent) {
2099             if (Dom.inDocument(this.oDomContainer)) {
2100                 if (useIframe) {
2101                     var pos = Dom.getStyle(this.oDomContainer, "position");
2102                     
2103                     if (pos == "absolute" || pos == "relative") {
2104                         
2105                         if (!Dom.inDocument(this.iframe)) {
2106                             this.iframe = document.createElement("iframe");
2107                             this.iframe.src = "javascript:false;";
2108     
2109                             Dom.setStyle(this.iframe, "opacity", "0");
2110     
2111                             if (YAHOO.env.ua.ie && YAHOO.env.ua.ie <= 6) {
2112                                 Dom.addClass(this.iframe, this.Style.CSS_FIXED_SIZE);
2113                             }
2114     
2115                             this.oDomContainer.insertBefore(this.iframe, this.oDomContainer.firstChild);
2116                         }
2117                     }
2118                 } else {
2119                     if (this.iframe) {
2120                         if (this.iframe.parentNode) {
2121                             this.iframe.parentNode.removeChild(this.iframe);
2122                         }
2123                         this.iframe = null;
2124                     }
2125                 }
2126             }
2127         }
2128     },
2129
2130     /**
2131     * Default handler for the "title" property
2132     * @method configTitle
2133     */
2134     configTitle : function(type, args, obj) {
2135         var title = args[0];
2136
2137         // "" disables title bar
2138         if (title) {
2139             this.createTitleBar(title);
2140         } else {
2141             var close = this.cfg.getProperty(DEF_CFG.CLOSE.key);
2142             if (!close) {
2143                 this.removeTitleBar();
2144             } else {
2145                 this.createTitleBar("&#160;");
2146             }
2147         }
2148     },
2149     
2150     /**
2151     * Default handler for the "close" property
2152     * @method configClose
2153     */
2154     configClose : function(type, args, obj) {
2155         var close = args[0],
2156             title = this.cfg.getProperty(DEF_CFG.TITLE.key);
2157     
2158         if (close) {
2159             if (!title) {
2160                 this.createTitleBar("&#160;");
2161             }
2162             this.createCloseButton();
2163         } else {
2164             this.removeCloseButton();
2165             if (!title) {
2166                 this.removeTitleBar();
2167             }
2168         }
2169     },
2170
2171     /**
2172     * Initializes Calendar's built-in CustomEvents
2173     * @method initEvents
2174     */
2175     initEvents : function() {
2176
2177         var defEvents = Calendar._EVENT_TYPES,
2178             CE = YAHOO.util.CustomEvent,
2179             cal = this; // To help with minification
2180
2181         /**
2182         * Fired before a date selection is made
2183         * @event beforeSelectEvent
2184         */
2185         cal.beforeSelectEvent = new CE(defEvents.BEFORE_SELECT); 
2186
2187         /**
2188         * Fired when a date selection is made
2189         * @event selectEvent
2190         * @param {Array} Array of Date field arrays in the format [YYYY, MM, DD].
2191         */
2192         cal.selectEvent = new CE(defEvents.SELECT);
2193
2194         /**
2195         * Fired before a date or set of dates is deselected
2196         * @event beforeDeselectEvent
2197         */
2198         cal.beforeDeselectEvent = new CE(defEvents.BEFORE_DESELECT);
2199
2200         /**
2201         * Fired when a date or set of dates is deselected
2202         * @event deselectEvent
2203         * @param {Array} Array of Date field arrays in the format [YYYY, MM, DD].
2204         */
2205         cal.deselectEvent = new CE(defEvents.DESELECT);
2206     
2207         /**
2208         * Fired when the Calendar page is changed
2209         * @event changePageEvent
2210         * @param {Date} prevDate The date before the page was changed
2211         * @param {Date} newDate The date after the page was changed
2212         */
2213         cal.changePageEvent = new CE(defEvents.CHANGE_PAGE);
2214     
2215         /**
2216         * Fired before the Calendar is rendered
2217         * @event beforeRenderEvent
2218         */
2219         cal.beforeRenderEvent = new CE(defEvents.BEFORE_RENDER);
2220     
2221         /**
2222         * Fired when the Calendar is rendered
2223         * @event renderEvent
2224         */
2225         cal.renderEvent = new CE(defEvents.RENDER);
2226
2227         /**
2228         * Fired just before the Calendar is to be destroyed
2229         * @event beforeDestroyEvent
2230         */
2231         cal.beforeDestroyEvent = new CE(defEvents.BEFORE_DESTROY);
2232
2233         /**
2234         * Fired after the Calendar is destroyed. This event should be used
2235         * for notification only. When this event is fired, important Calendar instance
2236         * properties, dom references and event listeners have already been 
2237         * removed/dereferenced, and hence the Calendar instance is not in a usable 
2238         * state.
2239         *
2240         * @event destroyEvent
2241         */
2242         cal.destroyEvent = new CE(defEvents.DESTROY);
2243
2244         /**
2245         * Fired when the Calendar is reset
2246         * @event resetEvent
2247         */
2248         cal.resetEvent = new CE(defEvents.RESET);
2249
2250         /**
2251         * Fired when the Calendar is cleared
2252         * @event clearEvent
2253         */
2254         cal.clearEvent = new CE(defEvents.CLEAR);
2255
2256         /**
2257         * Fired just before the Calendar is to be shown
2258         * @event beforeShowEvent
2259         */
2260         cal.beforeShowEvent = new CE(defEvents.BEFORE_SHOW);
2261
2262         /**
2263         * Fired after the Calendar is shown
2264         * @event showEvent
2265         */
2266         cal.showEvent = new CE(defEvents.SHOW);
2267
2268         /**
2269         * Fired just before the Calendar is to be hidden
2270         * @event beforeHideEvent
2271         */
2272         cal.beforeHideEvent = new CE(defEvents.BEFORE_HIDE);
2273
2274         /**
2275         * Fired after the Calendar is hidden
2276         * @event hideEvent
2277         */
2278         cal.hideEvent = new CE(defEvents.HIDE);
2279
2280         /**
2281         * Fired just before the CalendarNavigator is to be shown
2282         * @event beforeShowNavEvent
2283         */
2284         cal.beforeShowNavEvent = new CE(defEvents.BEFORE_SHOW_NAV);
2285     
2286         /**
2287         * Fired after the CalendarNavigator is shown
2288         * @event showNavEvent
2289         */
2290         cal.showNavEvent = new CE(defEvents.SHOW_NAV);
2291     
2292         /**
2293         * Fired just before the CalendarNavigator is to be hidden
2294         * @event beforeHideNavEvent
2295         */
2296         cal.beforeHideNavEvent = new CE(defEvents.BEFORE_HIDE_NAV);
2297     
2298         /**
2299         * Fired after the CalendarNavigator is hidden
2300         * @event hideNavEvent
2301         */
2302         cal.hideNavEvent = new CE(defEvents.HIDE_NAV);
2303
2304         /**
2305         * Fired just before the CalendarNavigator is to be rendered
2306         * @event beforeRenderNavEvent
2307         */
2308         cal.beforeRenderNavEvent = new CE(defEvents.BEFORE_RENDER_NAV);
2309
2310         /**
2311         * Fired after the CalendarNavigator is rendered
2312         * @event renderNavEvent
2313         */
2314         cal.renderNavEvent = new CE(defEvents.RENDER_NAV);
2315
2316         cal.beforeSelectEvent.subscribe(cal.onBeforeSelect, this, true);
2317         cal.selectEvent.subscribe(cal.onSelect, this, true);
2318         cal.beforeDeselectEvent.subscribe(cal.onBeforeDeselect, this, true);
2319         cal.deselectEvent.subscribe(cal.onDeselect, this, true);
2320         cal.changePageEvent.subscribe(cal.onChangePage, this, true);
2321         cal.renderEvent.subscribe(cal.onRender, this, true);
2322         cal.resetEvent.subscribe(cal.onReset, this, true);
2323         cal.clearEvent.subscribe(cal.onClear, this, true);
2324     },
2325
2326     /**
2327     * The default event handler for clicks on the "Previous Month" navigation UI
2328     *
2329     * @method doPreviousMonthNav
2330     * @param {DOMEvent} e The DOM event
2331     * @param {Calendar} cal A reference to the calendar
2332     */
2333     doPreviousMonthNav : function(e, cal) {
2334         Event.preventDefault(e);
2335         // previousMonth invoked in a timeout, to allow
2336         // event to bubble up, with correct target. Calling
2337         // previousMonth, will call render which will remove 
2338         // HTML which generated the event, resulting in an 
2339         // invalid event target in certain browsers.
2340         setTimeout(function() {
2341             cal.previousMonth();
2342             var navs = Dom.getElementsByClassName(cal.Style.CSS_NAV_LEFT, "a", cal.oDomContainer);
2343             if (navs && navs[0]) {
2344                 try {
2345                     navs[0].focus();
2346                 } catch (ex) {
2347                     // ignore
2348                 }
2349             }
2350         }, 0);
2351     },
2352
2353     /**
2354      * The default event handler for clicks on the "Next Month" navigation UI
2355      *
2356      * @method doNextMonthNav
2357      * @param {DOMEvent} e The DOM event
2358      * @param {Calendar} cal A reference to the calendar
2359      */
2360     doNextMonthNav : function(e, cal) {
2361         Event.preventDefault(e);
2362         setTimeout(function() {
2363             cal.nextMonth();
2364             var navs = Dom.getElementsByClassName(cal.Style.CSS_NAV_RIGHT, "a", cal.oDomContainer);
2365             if (navs && navs[0]) {
2366                 try {
2367                     navs[0].focus();
2368                 } catch (ex) {
2369                     // ignore
2370                 }
2371             }
2372         }, 0);
2373     },
2374
2375     /**
2376     * The default event handler for date cell selection. Currently attached to 
2377     * the Calendar's bounding box, referenced by it's <a href="#property_oDomContainer">oDomContainer</a> property.
2378     *
2379     * @method doSelectCell
2380     * @param {DOMEvent} e The DOM event
2381     * @param {Calendar} cal A reference to the calendar
2382     */
2383     doSelectCell : function(e, cal) {
2384         var cell, d, date, index;
2385
2386         var target = Event.getTarget(e),
2387             tagName = target.tagName.toLowerCase(),
2388             defSelector = false;
2389
2390         while (tagName != "td" && !Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
2391
2392             if (!defSelector && tagName == "a" && Dom.hasClass(target, cal.Style.CSS_CELL_SELECTOR)) {
2393                 defSelector = true;
2394             }
2395
2396             target = target.parentNode;
2397             tagName = target.tagName.toLowerCase();
2398
2399             if (target == this.oDomContainer || tagName == "html") {
2400                 return;
2401             }
2402         }
2403
2404         if (defSelector) {
2405             // Stop link href navigation for default renderer
2406             Event.preventDefault(e);
2407         }
2408     
2409         cell = target;
2410
2411         if (Dom.hasClass(cell, cal.Style.CSS_CELL_SELECTABLE)) {
2412             index = cal.getIndexFromId(cell.id);
2413             if (index > -1) {
2414                 d = cal.cellDates[index];
2415                 if (d) {
2416                     date = DateMath.getDate(d[0],d[1]-1,d[2]);
2417                 
2418                     var link;
2419
2420                     if (cal.Options.MULTI_SELECT) {
2421                         link = cell.getElementsByTagName("a")[0];
2422                         if (link) {
2423                             link.blur();
2424                         }
2425
2426                         var cellDate = cal.cellDates[index];
2427                         var cellDateIndex = cal._indexOfSelectedFieldArray(cellDate);
2428
2429                         if (cellDateIndex > -1) { 
2430                             cal.deselectCell(index);
2431                         } else {
2432                             cal.selectCell(index);
2433                         } 
2434
2435                     } else {
2436                         link = cell.getElementsByTagName("a")[0];
2437                         if (link) {
2438                             link.blur();
2439                         }
2440                         cal.selectCell(index);
2441                     }
2442                 }
2443             }
2444         }
2445     },
2446
2447     /**
2448     * The event that is executed when the user hovers over a cell
2449     * @method doCellMouseOver
2450     * @param {DOMEvent} e The event
2451     * @param {Calendar} cal A reference to the calendar passed by the Event utility
2452     */
2453     doCellMouseOver : function(e, cal) {
2454         var target;
2455         if (e) {
2456             target = Event.getTarget(e);
2457         } else {
2458             target = this;
2459         }
2460
2461         while (target.tagName && target.tagName.toLowerCase() != "td") {
2462             target = target.parentNode;
2463             if (!target.tagName || target.tagName.toLowerCase() == "html") {
2464                 return;
2465             }
2466         }
2467
2468         if (Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
2469             Dom.addClass(target, cal.Style.CSS_CELL_HOVER);
2470         }
2471     },
2472
2473     /**
2474     * The event that is executed when the user moves the mouse out of a cell
2475     * @method doCellMouseOut
2476     * @param {DOMEvent} e The event
2477     * @param {Calendar} cal A reference to the calendar passed by the Event utility
2478     */
2479     doCellMouseOut : function(e, cal) {
2480         var target;
2481         if (e) {
2482             target = Event.getTarget(e);
2483         } else {
2484             target = this;
2485         }
2486
2487         while (target.tagName && target.tagName.toLowerCase() != "td") {
2488             target = target.parentNode;
2489             if (!target.tagName || target.tagName.toLowerCase() == "html") {
2490                 return;
2491             }
2492         }
2493
2494         if (Dom.hasClass(target, cal.Style.CSS_CELL_SELECTABLE)) {
2495             Dom.removeClass(target, cal.Style.CSS_CELL_HOVER);
2496         }
2497     },
2498
2499     setupConfig : function() {
2500
2501         var cfg = this.cfg;
2502
2503         /**
2504         * The date to use to represent "Today".
2505         *
2506         * @config today
2507         * @type Date
2508         * @default The client side date (new Date()) when the Calendar is instantiated.
2509         */
2510         cfg.addProperty(DEF_CFG.TODAY.key, { value: new Date(DEF_CFG.TODAY.value.getTime()), supercedes:DEF_CFG.TODAY.supercedes, handler:this.configToday, suppressEvent:true } );
2511
2512         /**
2513         * The month/year representing the current visible Calendar date (mm/yyyy)
2514         * @config pagedate
2515         * @type String | Date
2516         * @default Today's date
2517         */
2518         cfg.addProperty(DEF_CFG.PAGEDATE.key, { value: DEF_CFG.PAGEDATE.value || new Date(DEF_CFG.TODAY.value.getTime()), handler:this.configPageDate } );
2519
2520         /**
2521         * The date or range of dates representing the current Calendar selection
2522         * @config selected
2523         * @type String
2524         * @default []
2525         */
2526         cfg.addProperty(DEF_CFG.SELECTED.key, { value:DEF_CFG.SELECTED.value.concat(), handler:this.configSelected } );
2527
2528         /**
2529         * The title to display above the Calendar's month header
2530         * @config title
2531         * @type String
2532         * @default ""
2533         */
2534         cfg.addProperty(DEF_CFG.TITLE.key, { value:DEF_CFG.TITLE.value, handler:this.configTitle } );
2535
2536         /**
2537         * Whether or not a close button should be displayed for this Calendar
2538         * @config close
2539         * @type Boolean
2540         * @default false
2541         */
2542         cfg.addProperty(DEF_CFG.CLOSE.key, { value:DEF_CFG.CLOSE.value, handler:this.configClose } );
2543
2544         /**
2545         * Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
2546         * This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be 
2547         * enabled if required.
2548         * 
2549         * @config iframe
2550         * @type Boolean
2551         * @default true for IE6 and below, false for all other browsers
2552         */
2553         cfg.addProperty(DEF_CFG.IFRAME.key, { value:DEF_CFG.IFRAME.value, handler:this.configIframe, validator:cfg.checkBoolean } );
2554
2555         /**
2556         * The minimum selectable date in the current Calendar (mm/dd/yyyy)
2557         * @config mindate
2558         * @type String | Date
2559         * @default null
2560         */
2561         cfg.addProperty(DEF_CFG.MINDATE.key, { value:DEF_CFG.MINDATE.value, handler:this.configMinDate } );
2562
2563         /**
2564         * The maximum selectable date in the current Calendar (mm/dd/yyyy)
2565         * @config maxdate
2566         * @type String | Date
2567         * @default null
2568         */
2569         cfg.addProperty(DEF_CFG.MAXDATE.key, { value:DEF_CFG.MAXDATE.value, handler:this.configMaxDate } );
2570
2571         // Options properties
2572     
2573         /**
2574         * True if the Calendar should allow multiple selections. False by default.
2575         * @config MULTI_SELECT
2576         * @type Boolean
2577         * @default false
2578         */
2579         cfg.addProperty(DEF_CFG.MULTI_SELECT.key, { value:DEF_CFG.MULTI_SELECT.value, handler:this.configOptions, validator:cfg.checkBoolean } );
2580
2581         /**
2582         * The weekday the week begins on. Default is 0 (Sunday = 0, Monday = 1 ... Saturday = 6).
2583         * @config START_WEEKDAY
2584         * @type number
2585         * @default 0
2586         */
2587         cfg.addProperty(DEF_CFG.START_WEEKDAY.key, { value:DEF_CFG.START_WEEKDAY.value, handler:this.configOptions, validator:cfg.checkNumber  } );
2588     
2589         /**
2590         * True if the Calendar should show weekday labels. True by default.
2591         * @config SHOW_WEEKDAYS
2592         * @type Boolean
2593         * @default true
2594         */
2595         cfg.addProperty(DEF_CFG.SHOW_WEEKDAYS.key, { value:DEF_CFG.SHOW_WEEKDAYS.value, handler:this.configOptions, validator:cfg.checkBoolean  } );
2596     
2597         /**
2598         * True if the Calendar should show week row headers. False by default.
2599         * @config SHOW_WEEK_HEADER
2600         * @type Boolean
2601         * @default false
2602         */
2603         cfg.addProperty(DEF_CFG.SHOW_WEEK_HEADER.key, { value:DEF_CFG.SHOW_WEEK_HEADER.value, handler:this.configOptions, validator:cfg.checkBoolean } );
2604     
2605         /**
2606         * True if the Calendar should show week row footers. False by default.
2607         * @config SHOW_WEEK_FOOTER
2608         * @type Boolean
2609         * @default false
2610         */ 
2611         cfg.addProperty(DEF_CFG.SHOW_WEEK_FOOTER.key,{ value:DEF_CFG.SHOW_WEEK_FOOTER.value, handler:this.configOptions, validator:cfg.checkBoolean } );
2612     
2613         /**
2614         * True if the Calendar should suppress weeks that are not a part of the current month. False by default.
2615         * @config HIDE_BLANK_WEEKS
2616         * @type Boolean
2617         * @default false
2618         */ 
2619         cfg.addProperty(DEF_CFG.HIDE_BLANK_WEEKS.key, { value:DEF_CFG.HIDE_BLANK_WEEKS.value, handler:this.configOptions, validator:cfg.checkBoolean } );
2620         
2621         /**
2622         * The image that should be used for the left navigation arrow.
2623         * @config NAV_ARROW_LEFT
2624         * @type String
2625         * @deprecated You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"  
2626         * @default null
2627         */ 
2628         cfg.addProperty(DEF_CFG.NAV_ARROW_LEFT.key, { value:DEF_CFG.NAV_ARROW_LEFT.value, handler:this.configOptions } );
2629     
2630         /**
2631         * The image that should be used for the right navigation arrow.
2632         * @config NAV_ARROW_RIGHT
2633         * @type String
2634         * @deprecated You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
2635         * @default null
2636         */ 
2637         cfg.addProperty(DEF_CFG.NAV_ARROW_RIGHT.key, { value:DEF_CFG.NAV_ARROW_RIGHT.value, handler:this.configOptions } );
2638     
2639         // Locale properties
2640     
2641         /**
2642         * The short month labels for the current locale.
2643         * @config MONTHS_SHORT
2644         * @type String[]
2645         * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
2646         */
2647         cfg.addProperty(DEF_CFG.MONTHS_SHORT.key, { value:DEF_CFG.MONTHS_SHORT.value, handler:this.configLocale } );
2648         
2649         /**
2650         * The long month labels for the current locale.
2651         * @config MONTHS_LONG
2652         * @type String[]
2653         * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
2654         */ 
2655         cfg.addProperty(DEF_CFG.MONTHS_LONG.key,  { value:DEF_CFG.MONTHS_LONG.value, handler:this.configLocale } );
2656
2657         /**
2658         * The 1-character weekday labels for the current locale.
2659         * @config WEEKDAYS_1CHAR
2660         * @type String[]
2661         * @default ["S", "M", "T", "W", "T", "F", "S"]
2662         */ 
2663         cfg.addProperty(DEF_CFG.WEEKDAYS_1CHAR.key, { value:DEF_CFG.WEEKDAYS_1CHAR.value, handler:this.configLocale } );
2664         
2665         /**
2666         * The short weekday labels for the current locale.
2667         * @config WEEKDAYS_SHORT
2668         * @type String[]
2669         * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
2670         */ 
2671         cfg.addProperty(DEF_CFG.WEEKDAYS_SHORT.key, { value:DEF_CFG.WEEKDAYS_SHORT.value, handler:this.configLocale } );
2672         
2673         /**
2674         * The medium weekday labels for the current locale.
2675         * @config WEEKDAYS_MEDIUM
2676         * @type String[]
2677         * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
2678         */ 
2679         cfg.addProperty(DEF_CFG.WEEKDAYS_MEDIUM.key, { value:DEF_CFG.WEEKDAYS_MEDIUM.value, handler:this.configLocale } );
2680         
2681         /**
2682         * The long weekday labels for the current locale.
2683         * @config WEEKDAYS_LONG
2684         * @type String[]
2685         * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
2686         */ 
2687         cfg.addProperty(DEF_CFG.WEEKDAYS_LONG.key, { value:DEF_CFG.WEEKDAYS_LONG.value, handler:this.configLocale } );
2688
2689         /**
2690         * Refreshes the locale values used to build the Calendar.
2691         * @method refreshLocale
2692         * @private
2693         */
2694         var refreshLocale = function() {
2695             cfg.refireEvent(DEF_CFG.LOCALE_MONTHS.key);
2696             cfg.refireEvent(DEF_CFG.LOCALE_WEEKDAYS.key);
2697         };
2698     
2699         cfg.subscribeToConfigEvent(DEF_CFG.START_WEEKDAY.key, refreshLocale, this, true);
2700         cfg.subscribeToConfigEvent(DEF_CFG.MONTHS_SHORT.key, refreshLocale, this, true);
2701         cfg.subscribeToConfigEvent(DEF_CFG.MONTHS_LONG.key, refreshLocale, this, true);
2702         cfg.subscribeToConfigEvent(DEF_CFG.WEEKDAYS_1CHAR.key, refreshLocale, this, true);
2703         cfg.subscribeToConfigEvent(DEF_CFG.WEEKDAYS_SHORT.key, refreshLocale, this, true);
2704         cfg.subscribeToConfigEvent(DEF_CFG.WEEKDAYS_MEDIUM.key, refreshLocale, this, true);
2705         cfg.subscribeToConfigEvent(DEF_CFG.WEEKDAYS_LONG.key, refreshLocale, this, true);
2706        
2707         /**
2708         * The setting that determines which length of month labels should be used. Possible values are "short" and "long".
2709         * @config LOCALE_MONTHS
2710         * @type String
2711         * @default "long"
2712         */ 
2713         cfg.addProperty(DEF_CFG.LOCALE_MONTHS.key, { value:DEF_CFG.LOCALE_MONTHS.value, handler:this.configLocaleValues } );
2714         
2715         /**
2716         * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
2717         * @config LOCALE_WEEKDAYS
2718         * @type String
2719         * @default "short"
2720         */ 
2721         cfg.addProperty(DEF_CFG.LOCALE_WEEKDAYS.key, { value:DEF_CFG.LOCALE_WEEKDAYS.value, handler:this.configLocaleValues } );
2722
2723         /**
2724         * The positive or negative year offset from the Gregorian calendar year (assuming a January 1st rollover) to 
2725         * be used when displaying and parsing dates. NOTE: All JS Date objects returned by methods, or expected as input by
2726         * methods will always represent the Gregorian year, in order to maintain date/month/week values. 
2727         *
2728         * @config YEAR_OFFSET
2729         * @type Number
2730         * @default 0
2731         */
2732         cfg.addProperty(DEF_CFG.YEAR_OFFSET.key, { value:DEF_CFG.YEAR_OFFSET.value, supercedes:DEF_CFG.YEAR_OFFSET.supercedes, handler:this.configLocale  } );
2733     
2734         /**
2735         * The value used to delimit individual dates in a date string passed to various Calendar functions.
2736         * @config DATE_DELIMITER
2737         * @type String
2738         * @default ","
2739         */ 
2740         cfg.addProperty(DEF_CFG.DATE_DELIMITER.key,  { value:DEF_CFG.DATE_DELIMITER.value, handler:this.configLocale } );
2741     
2742         /**
2743         * The value used to delimit date fields in a date string passed to various Calendar functions.
2744         * @config DATE_FIELD_DELIMITER
2745         * @type String
2746         * @default "/"
2747         */ 
2748         cfg.addProperty(DEF_CFG.DATE_FIELD_DELIMITER.key, { value:DEF_CFG.DATE_FIELD_DELIMITER.value, handler:this.configLocale } );
2749     
2750         /**
2751         * The value used to delimit date ranges in a date string passed to various Calendar functions.
2752         * @config DATE_RANGE_DELIMITER
2753         * @type String
2754         * @default "-"
2755         */
2756         cfg.addProperty(DEF_CFG.DATE_RANGE_DELIMITER.key, { value:DEF_CFG.DATE_RANGE_DELIMITER.value, handler:this.configLocale } );
2757     
2758         /**
2759         * The position of the month in a month/year date string
2760         * @config MY_MONTH_POSITION
2761         * @type Number
2762         * @default 1
2763         */
2764         cfg.addProperty(DEF_CFG.MY_MONTH_POSITION.key, { value:DEF_CFG.MY_MONTH_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } );
2765     
2766         /**
2767         * The position of the year in a month/year date string
2768         * @config MY_YEAR_POSITION
2769         * @type Number
2770         * @default 2
2771         */
2772         cfg.addProperty(DEF_CFG.MY_YEAR_POSITION.key, { value:DEF_CFG.MY_YEAR_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } );
2773     
2774         /**
2775         * The position of the month in a month/day date string
2776         * @config MD_MONTH_POSITION
2777         * @type Number
2778         * @default 1
2779         */
2780         cfg.addProperty(DEF_CFG.MD_MONTH_POSITION.key, { value:DEF_CFG.MD_MONTH_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } );
2781     
2782         /**
2783         * The position of the day in a month/year date string
2784         * @config MD_DAY_POSITION
2785         * @type Number
2786         * @default 2
2787         */
2788         cfg.addProperty(DEF_CFG.MD_DAY_POSITION.key,  { value:DEF_CFG.MD_DAY_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } );
2789     
2790         /**
2791         * The position of the month in a month/day/year date string
2792         * @config MDY_MONTH_POSITION
2793         * @type Number
2794         * @default 1
2795         */
2796         cfg.addProperty(DEF_CFG.MDY_MONTH_POSITION.key, { value:DEF_CFG.MDY_MONTH_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } );
2797     
2798         /**
2799         * The position of the day in a month/day/year date string
2800         * @config MDY_DAY_POSITION
2801         * @type Number
2802         * @default 2
2803         */
2804         cfg.addProperty(DEF_CFG.MDY_DAY_POSITION.key, { value:DEF_CFG.MDY_DAY_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } );
2805     
2806         /**
2807         * The position of the year in a month/day/year date string
2808         * @config MDY_YEAR_POSITION
2809         * @type Number
2810         * @default 3
2811         */
2812         cfg.addProperty(DEF_CFG.MDY_YEAR_POSITION.key, { value:DEF_CFG.MDY_YEAR_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } );
2813         
2814         /**
2815         * The position of the month in the month year label string used as the Calendar header
2816         * @config MY_LABEL_MONTH_POSITION
2817         * @type Number
2818         * @default 1
2819         */
2820         cfg.addProperty(DEF_CFG.MY_LABEL_MONTH_POSITION.key, { value:DEF_CFG.MY_LABEL_MONTH_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } );
2821     
2822         /**
2823         * The position of the year in the month year label string used as the Calendar header
2824         * @config MY_LABEL_YEAR_POSITION
2825         * @type Number
2826         * @default 2
2827         */
2828         cfg.addProperty(DEF_CFG.MY_LABEL_YEAR_POSITION.key, { value:DEF_CFG.MY_LABEL_YEAR_POSITION.value, handler:this.configLocale, validator:cfg.checkNumber } );
2829         
2830         /**
2831         * The suffix used after the month when rendering the Calendar header
2832         * @config MY_LABEL_MONTH_SUFFIX
2833         * @type String
2834         * @default " "
2835         */
2836         cfg.addProperty(DEF_CFG.MY_LABEL_MONTH_SUFFIX.key, { value:DEF_CFG.MY_LABEL_MONTH_SUFFIX.value, handler:this.configLocale } );
2837         
2838         /**
2839         * The suffix used after the year when rendering the Calendar header
2840         * @config MY_LABEL_YEAR_SUFFIX
2841         * @type String
2842         * @default ""
2843         */
2844         cfg.addProperty(DEF_CFG.MY_LABEL_YEAR_SUFFIX.key, { value:DEF_CFG.MY_LABEL_YEAR_SUFFIX.value, handler:this.configLocale } );
2845
2846         /**
2847         * Configuration for the Month/Year CalendarNavigator UI which allows the user to jump directly to a 
2848         * specific Month/Year without having to scroll sequentially through months.
2849         * <p>
2850         * Setting this property to null (default value) or false, will disable the CalendarNavigator UI.
2851         * </p>
2852         * <p>
2853         * Setting this property to true will enable the CalendarNavigatior UI with the default CalendarNavigator configuration values.
2854         * </p>
2855         * <p>
2856         * This property can also be set to an object literal containing configuration properties for the CalendarNavigator UI.
2857         * The configuration object expects the the following case-sensitive properties, with the "strings" property being a nested object.
2858         * Any properties which are not provided will use the default values (defined in the CalendarNavigator class).
2859         * </p>
2860         * <dl>
2861         * <dt>strings</dt>
2862         * <dd><em>Object</em> :  An object with the properties shown below, defining the string labels to use in the Navigator's UI
2863         *     <dl>
2864         *         <dt>month</dt><dd><em>String</em> : The string to use for the month label. Defaults to "Month".</dd>
2865         *         <dt>year</dt><dd><em>String</em> : The string to use for the year label. Defaults to "Year".</dd>
2866         *         <dt>submit</dt><dd><em>String</em> : The string to use for the submit button label. Defaults to "Okay".</dd>
2867         *         <dt>cancel</dt><dd><em>String</em> : The string to use for the cancel button label. Defaults to "Cancel".</dd>
2868         *         <dt>invalidYear</dt><dd><em>String</em> : The string to use for invalid year values. Defaults to "Year needs to be a number".</dd>
2869         *     </dl>
2870         * </dd>
2871         * <dt>monthFormat</dt><dd><em>String</em> : The month format to use. Either YAHOO.widget.Calendar.LONG, or YAHOO.widget.Calendar.SHORT. Defaults to YAHOO.widget.Calendar.LONG</dd>
2872         * <dt>initialFocus</dt><dd><em>String</em> : Either "year" or "month" specifying which input control should get initial focus. Defaults to "year"</dd>
2873         * </dl>
2874         * <p>E.g.</p>
2875         * <pre>
2876         * var navConfig = {
2877         *   strings: {
2878         *    month:"Calendar Month",
2879         *    year:"Calendar Year",
2880         *    submit: "Submit",
2881         *    cancel: "Cancel",
2882         *    invalidYear: "Please enter a valid year"
2883         *   },
2884         *   monthFormat: YAHOO.widget.Calendar.SHORT,
2885         *   initialFocus: "month"
2886         * }
2887         * </pre>
2888         * @config navigator
2889         * @type {Object|Boolean}
2890         * @default null
2891         */
2892         cfg.addProperty(DEF_CFG.NAV.key, { value:DEF_CFG.NAV.value, handler:this.configNavigator } );
2893
2894         /**
2895          * The map of UI strings which the Calendar UI uses.
2896          *
2897          * @config strings
2898          * @type {Object}
2899          * @default An object with the properties shown below:
2900          *     <dl>
2901          *         <dt>previousMonth</dt><dd><em>String</em> : The string to use for the "Previous Month" navigation UI. Defaults to "Previous Month".</dd>
2902          *         <dt>nextMonth</dt><dd><em>String</em> : The string to use for the "Next Month" navigation UI. Defaults to "Next Month".</dd>
2903          *         <dt>close</dt><dd><em>String</em> : The string to use for the close button label. Defaults to "Close".</dd>
2904          *     </dl>
2905          */
2906         cfg.addProperty(DEF_CFG.STRINGS.key, { 
2907             value:DEF_CFG.STRINGS.value,
2908             handler:this.configStrings,
2909             validator: function(val) {
2910                 return Lang.isObject(val);
2911             },
2912             supercedes:DEF_CFG.STRINGS.supercedes
2913         });
2914     },
2915
2916     /**
2917     * The default handler for the "strings" property
2918     * @method configStrings
2919     */
2920     configStrings : function(type, args, obj) {
2921         var val = Lang.merge(DEF_CFG.STRINGS.value, args[0]);
2922         this.cfg.setProperty(DEF_CFG.STRINGS.key, val, true);
2923     },
2924
2925     /**
2926     * The default handler for the "pagedate" property
2927     * @method configPageDate
2928     */
2929     configPageDate : function(type, args, obj) {
2930         this.cfg.setProperty(DEF_CFG.PAGEDATE.key, this._parsePageDate(args[0]), true);
2931     },
2932
2933     /**
2934     * The default handler for the "mindate" property
2935     * @method configMinDate
2936     */
2937     configMinDate : function(type, args, obj) {
2938         var val = args[0];
2939         if (Lang.isString(val)) {
2940             val = this._parseDate(val);
2941             this.cfg.setProperty(DEF_CFG.MINDATE.key, DateMath.getDate(val[0],(val[1]-1),val[2]));
2942         }
2943     },
2944
2945     /**
2946     * The default handler for the "maxdate" property
2947     * @method configMaxDate
2948     */
2949     configMaxDate : function(type, args, obj) {
2950         var val = args[0];
2951         if (Lang.isString(val)) {
2952             val = this._parseDate(val);
2953             this.cfg.setProperty(DEF_CFG.MAXDATE.key, DateMath.getDate(val[0],(val[1]-1),val[2]));
2954         }
2955     },
2956
2957     /**
2958     * The default handler for the "today" property
2959     * @method configToday
2960     */
2961     configToday : function(type, args, obj) {
2962         // Only do this for initial set. Changing the today property after the initial
2963         // set, doesn't affect pagedate
2964         var val = args[0];
2965         if (Lang.isString(val)) {
2966             val = this._parseDate(val);
2967         }
2968         var today = DateMath.clearTime(val);
2969         if (!this.cfg.initialConfig[DEF_CFG.PAGEDATE.key]) {
2970             this.cfg.setProperty(DEF_CFG.PAGEDATE.key, today);
2971         }
2972         this.today = today;
2973         this.cfg.setProperty(DEF_CFG.TODAY.key, today, true);
2974     },
2975
2976     /**
2977     * The default handler for the "selected" property
2978     * @method configSelected
2979     */
2980     configSelected : function(type, args, obj) {
2981         var selected = args[0],
2982             cfgSelected = DEF_CFG.SELECTED.key;
2983         
2984         if (selected) {
2985             if (Lang.isString(selected)) {
2986                 this.cfg.setProperty(cfgSelected, this._parseDates(selected), true);
2987             } 
2988         }
2989         if (! this._selectedDates) {
2990             this._selectedDates = this.cfg.getProperty(cfgSelected);
2991         }
2992     },
2993     
2994     /**
2995     * The default handler for all configuration options properties
2996     * @method configOptions
2997     */
2998     configOptions : function(type, args, obj) {
2999         this.Options[type.toUpperCase()] = args[0];
3000     },
3001
3002     /**
3003     * The default handler for all configuration locale properties
3004     * @method configLocale
3005     */
3006     configLocale : function(type, args, obj) {
3007         this.Locale[type.toUpperCase()] = args[0];
3008
3009         this.cfg.refireEvent(DEF_CFG.LOCALE_MONTHS.key);
3010         this.cfg.refireEvent(DEF_CFG.LOCALE_WEEKDAYS.key);
3011     },
3012     
3013     /**
3014     * The default handler for all configuration locale field length properties
3015     * @method configLocaleValues
3016     */
3017     configLocaleValues : function(type, args, obj) {
3018
3019         type = type.toLowerCase();
3020
3021         var val = args[0],
3022             cfg = this.cfg,
3023             Locale = this.Locale;
3024
3025         switch (type) {
3026             case DEF_CFG.LOCALE_MONTHS.key:
3027                 switch (val) {
3028                     case Calendar.SHORT:
3029                         Locale.LOCALE_MONTHS = cfg.getProperty(DEF_CFG.MONTHS_SHORT.key).concat();
3030                         break;
3031                     case Calendar.LONG:
3032                         Locale.LOCALE_MONTHS = cfg.getProperty(DEF_CFG.MONTHS_LONG.key).concat();
3033                         break;
3034                 }
3035                 break;
3036             case DEF_CFG.LOCALE_WEEKDAYS.key:
3037                 switch (val) {
3038                     case Calendar.ONE_CHAR:
3039                         Locale.LOCALE_WEEKDAYS = cfg.getProperty(DEF_CFG.WEEKDAYS_1CHAR.key).concat();
3040                         break;
3041                     case Calendar.SHORT:
3042                         Locale.LOCALE_WEEKDAYS = cfg.getProperty(DEF_CFG.WEEKDAYS_SHORT.key).concat();
3043                         break;
3044                     case Calendar.MEDIUM:
3045                         Locale.LOCALE_WEEKDAYS = cfg.getProperty(DEF_CFG.WEEKDAYS_MEDIUM.key).concat();
3046                         break;
3047                     case Calendar.LONG:
3048                         Locale.LOCALE_WEEKDAYS = cfg.getProperty(DEF_CFG.WEEKDAYS_LONG.key).concat();
3049                         break;
3050                 }
3051                 
3052                 var START_WEEKDAY = cfg.getProperty(DEF_CFG.START_WEEKDAY.key);
3053     
3054                 if (START_WEEKDAY > 0) {
3055                     for (var w=0; w < START_WEEKDAY; ++w) {
3056                         Locale.LOCALE_WEEKDAYS.push(Locale.LOCALE_WEEKDAYS.shift());
3057                     }
3058                 }
3059                 break;
3060         }
3061     },
3062
3063     /**
3064      * The default handler for the "navigator" property
3065      * @method configNavigator
3066      */
3067     configNavigator : function(type, args, obj) {
3068         var val = args[0];
3069         if (YAHOO.widget.CalendarNavigator && (val === true || Lang.isObject(val))) {
3070             if (!this.oNavigator) {
3071                 this.oNavigator = new YAHOO.widget.CalendarNavigator(this);
3072                 // Cleanup DOM Refs/Events before innerHTML is removed.
3073                 this.beforeRenderEvent.subscribe(function () {
3074                     if (!this.pages) {
3075                         this.oNavigator.erase();
3076                     }
3077                 }, this, true);
3078             }
3079         } else {
3080             if (this.oNavigator) {
3081                 this.oNavigator.destroy();
3082                 this.oNavigator = null;
3083             }
3084         }
3085     },
3086
3087     /**
3088     * Defines the style constants for the Calendar
3089     * @method initStyles
3090     */
3091     initStyles : function() {
3092
3093         var defStyle = Calendar.STYLES;
3094
3095         this.Style = {
3096             /**
3097             * @property Style.CSS_ROW_HEADER
3098             */
3099             CSS_ROW_HEADER: defStyle.CSS_ROW_HEADER,
3100             /**
3101             * @property Style.CSS_ROW_FOOTER
3102             */
3103             CSS_ROW_FOOTER: defStyle.CSS_ROW_FOOTER,
3104             /**
3105             * @property Style.CSS_CELL
3106             */
3107             CSS_CELL : defStyle.CSS_CELL,
3108             /**
3109             * @property Style.CSS_CELL_SELECTOR
3110             */
3111             CSS_CELL_SELECTOR : defStyle.CSS_CELL_SELECTOR,
3112             /**
3113             * @property Style.CSS_CELL_SELECTED
3114             */
3115             CSS_CELL_SELECTED : defStyle.CSS_CELL_SELECTED,
3116             /**
3117             * @property Style.CSS_CELL_SELECTABLE
3118             */
3119             CSS_CELL_SELECTABLE : defStyle.CSS_CELL_SELECTABLE,
3120             /**
3121             * @property Style.CSS_CELL_RESTRICTED
3122             */
3123             CSS_CELL_RESTRICTED : defStyle.CSS_CELL_RESTRICTED,
3124             /**
3125             * @property Style.CSS_CELL_TODAY
3126             */
3127             CSS_CELL_TODAY : defStyle.CSS_CELL_TODAY,
3128             /**
3129             * @property Style.CSS_CELL_OOM
3130             */
3131             CSS_CELL_OOM : defStyle.CSS_CELL_OOM,
3132             /**
3133             * @property Style.CSS_CELL_OOB
3134             */
3135             CSS_CELL_OOB : defStyle.CSS_CELL_OOB,
3136             /**
3137             * @property Style.CSS_HEADER
3138             */
3139             CSS_HEADER : defStyle.CSS_HEADER,
3140             /**
3141             * @property Style.CSS_HEADER_TEXT
3142             */
3143             CSS_HEADER_TEXT : defStyle.CSS_HEADER_TEXT,
3144             /**
3145             * @property Style.CSS_BODY
3146             */
3147             CSS_BODY : defStyle.CSS_BODY,
3148             /**
3149             * @property Style.CSS_WEEKDAY_CELL
3150             */
3151             CSS_WEEKDAY_CELL : defStyle.CSS_WEEKDAY_CELL,
3152             /**
3153             * @property Style.CSS_WEEKDAY_ROW
3154             */
3155             CSS_WEEKDAY_ROW : defStyle.CSS_WEEKDAY_ROW,
3156             /**
3157             * @property Style.CSS_FOOTER
3158             */
3159             CSS_FOOTER : defStyle.CSS_FOOTER,
3160             /**
3161             * @property Style.CSS_CALENDAR
3162             */
3163             CSS_CALENDAR : defStyle.CSS_CALENDAR,
3164             /**
3165             * @property Style.CSS_SINGLE
3166             */
3167             CSS_SINGLE : defStyle.CSS_SINGLE,
3168             /**
3169             * @property Style.CSS_CONTAINER
3170             */
3171             CSS_CONTAINER : defStyle.CSS_CONTAINER,
3172             /**
3173             * @property Style.CSS_NAV_LEFT
3174             */
3175             CSS_NAV_LEFT : defStyle.CSS_NAV_LEFT,
3176             /**
3177             * @property Style.CSS_NAV_RIGHT
3178             */
3179             CSS_NAV_RIGHT : defStyle.CSS_NAV_RIGHT,
3180             /**
3181             * @property Style.CSS_NAV
3182             */
3183             CSS_NAV : defStyle.CSS_NAV,
3184             /**
3185             * @property Style.CSS_CLOSE
3186             */
3187             CSS_CLOSE : defStyle.CSS_CLOSE,
3188             /**
3189             * @property Style.CSS_CELL_TOP
3190             */
3191             CSS_CELL_TOP : defStyle.CSS_CELL_TOP,
3192             /**
3193             * @property Style.CSS_CELL_LEFT
3194             */
3195             CSS_CELL_LEFT : defStyle.CSS_CELL_LEFT,
3196             /**
3197             * @property Style.CSS_CELL_RIGHT
3198             */
3199             CSS_CELL_RIGHT : defStyle.CSS_CELL_RIGHT,
3200             /**
3201             * @property Style.CSS_CELL_BOTTOM
3202             */
3203             CSS_CELL_BOTTOM : defStyle.CSS_CELL_BOTTOM,
3204             /**
3205             * @property Style.CSS_CELL_HOVER
3206             */
3207             CSS_CELL_HOVER : defStyle.CSS_CELL_HOVER,
3208             /**
3209             * @property Style.CSS_CELL_HIGHLIGHT1
3210             */
3211             CSS_CELL_HIGHLIGHT1 : defStyle.CSS_CELL_HIGHLIGHT1,
3212             /**
3213             * @property Style.CSS_CELL_HIGHLIGHT2
3214             */
3215             CSS_CELL_HIGHLIGHT2 : defStyle.CSS_CELL_HIGHLIGHT2,
3216             /**
3217             * @property Style.CSS_CELL_HIGHLIGHT3
3218             */
3219             CSS_CELL_HIGHLIGHT3 : defStyle.CSS_CELL_HIGHLIGHT3,
3220             /**
3221             * @property Style.CSS_CELL_HIGHLIGHT4
3222             */
3223             CSS_CELL_HIGHLIGHT4 : defStyle.CSS_CELL_HIGHLIGHT4,
3224             /**
3225              * @property Style.CSS_WITH_TITLE
3226              */
3227             CSS_WITH_TITLE : defStyle.CSS_WITH_TITLE,
3228              /**
3229              * @property Style.CSS_FIXED_SIZE
3230              */
3231             CSS_FIXED_SIZE : defStyle.CSS_FIXED_SIZE,
3232              /**
3233              * @property Style.CSS_LINK_CLOSE
3234              */
3235             CSS_LINK_CLOSE : defStyle.CSS_LINK_CLOSE
3236         };
3237     },
3238
3239     /**
3240     * Builds the date label that will be displayed in the calendar header or
3241     * footer, depending on configuration.
3242     * @method buildMonthLabel
3243     * @return {String} The formatted calendar month label
3244     */
3245     buildMonthLabel : function() {
3246         return this._buildMonthLabel(this.cfg.getProperty(DEF_CFG.PAGEDATE.key));
3247     },
3248
3249     /**
3250      * Helper method, to format a Month Year string, given a JavaScript Date, based on the 
3251      * Calendar localization settings
3252      * 
3253      * @method _buildMonthLabel
3254      * @private
3255      * @param {Date} date
3256      * @return {String} Formated month, year string
3257      */
3258     _buildMonthLabel : function(date) {
3259         var monthLabel  = this.Locale.LOCALE_MONTHS[date.getMonth()] + this.Locale.MY_LABEL_MONTH_SUFFIX,
3260             yearLabel = (date.getFullYear() + this.Locale.YEAR_OFFSET) + this.Locale.MY_LABEL_YEAR_SUFFIX;
3261
3262         if (this.Locale.MY_LABEL_MONTH_POSITION == 2 || this.Locale.MY_LABEL_YEAR_POSITION == 1) {
3263             return yearLabel + monthLabel;
3264         } else {
3265             return monthLabel + yearLabel;
3266         }
3267     },
3268     
3269     /**
3270     * Builds the date digit that will be displayed in calendar cells
3271     * @method buildDayLabel
3272     * @param {Date} workingDate The current working date
3273     * @return {String} The formatted day label
3274     */
3275     buildDayLabel : function(workingDate) {
3276         return workingDate.getDate();
3277     },
3278     
3279     /**
3280      * Creates the title bar element and adds it to Calendar container DIV
3281      * 
3282      * @method createTitleBar
3283      * @param {String} strTitle The title to display in the title bar
3284      * @return The title bar element
3285      */
3286     createTitleBar : function(strTitle) {
3287         var tDiv = Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || document.createElement("div");
3288         tDiv.className = YAHOO.widget.CalendarGroup.CSS_2UPTITLE;
3289         tDiv.innerHTML = strTitle;
3290         this.oDomContainer.insertBefore(tDiv, this.oDomContainer.firstChild);
3291     
3292         Dom.addClass(this.oDomContainer, this.Style.CSS_WITH_TITLE);
3293     
3294         return tDiv;
3295     },
3296     
3297     /**
3298      * Removes the title bar element from the DOM
3299      * 
3300      * @method removeTitleBar
3301      */
3302     removeTitleBar : function() {
3303         var tDiv = Dom.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE, "div", this.oDomContainer)[0] || null;
3304         if (tDiv) {
3305             Event.purgeElement(tDiv);
3306             this.oDomContainer.removeChild(tDiv);
3307         }
3308         Dom.removeClass(this.oDomContainer, this.Style.CSS_WITH_TITLE);
3309     },
3310     
3311     /**
3312      * Creates the close button HTML element and adds it to Calendar container DIV
3313      * 
3314      * @method createCloseButton
3315      * @return The close HTML element created
3316      */
3317     createCloseButton : function() {
3318         var cssClose = YAHOO.widget.CalendarGroup.CSS_2UPCLOSE,
3319             cssLinkClose = this.Style.CSS_LINK_CLOSE,
3320             DEPR_CLOSE_PATH = "us/my/bn/x_d.gif",
3321             
3322             lnk = Dom.getElementsByClassName(cssLinkClose, "a", this.oDomContainer)[0],
3323             strings = this.cfg.getProperty(DEF_CFG.STRINGS.key),
3324             closeStr = (strings && strings.close) ? strings.close : "";
3325
3326         if (!lnk) {
3327             lnk = document.createElement("a");
3328             Event.addListener(lnk, "click", function(e, cal) {
3329                 cal.hide(); 
3330                 Event.preventDefault(e);
3331             }, this);
3332         }
3333
3334         lnk.href = "#";
3335         lnk.className = cssLinkClose;
3336
3337         if (Calendar.IMG_ROOT !== null) {
3338             var img = Dom.getElementsByClassName(cssClose, "img", lnk)[0] || document.createElement("img");
3339             img.src = Calendar.IMG_ROOT + DEPR_CLOSE_PATH;
3340             img.className = cssClose;
3341             lnk.appendChild(img);
3342         } else {
3343             lnk.innerHTML = '<span class="' + cssClose + ' ' + this.Style.CSS_CLOSE + '">' + closeStr + '</span>';
3344         }
3345         this.oDomContainer.appendChild(lnk);
3346
3347         return lnk;
3348     },
3349     
3350     /**
3351      * Removes the close button HTML element from the DOM
3352      * 
3353      * @method removeCloseButton
3354      */
3355     removeCloseButton : function() {
3356         var btn = Dom.getElementsByClassName(this.Style.CSS_LINK_CLOSE, "a", this.oDomContainer)[0] || null;
3357         if (btn) {
3358             Event.purgeElement(btn);
3359             this.oDomContainer.removeChild(btn);
3360         }
3361     },
3362
3363     /**
3364     * Renders the calendar header.
3365     * @method renderHeader
3366     * @param {Array} html The current working HTML array
3367     * @return {Array} The current working HTML array
3368     */
3369     renderHeader : function(html) {
3370
3371
3372         var colSpan = 7,
3373             DEPR_NAV_LEFT = "us/tr/callt.gif",
3374             DEPR_NAV_RIGHT = "us/tr/calrt.gif",
3375             cfg = this.cfg,
3376             pageDate = cfg.getProperty(DEF_CFG.PAGEDATE.key),
3377             strings= cfg.getProperty(DEF_CFG.STRINGS.key),
3378             prevStr = (strings && strings.previousMonth) ?  strings.previousMonth : "",
3379             nextStr = (strings && strings.nextMonth) ? strings.nextMonth : "",
3380             monthLabel;
3381
3382         if (cfg.getProperty(DEF_CFG.SHOW_WEEK_HEADER.key)) {
3383             colSpan += 1;
3384         }
3385     
3386         if (cfg.getProperty(DEF_CFG.SHOW_WEEK_FOOTER.key)) {
3387             colSpan += 1;
3388         }
3389
3390         html[html.length] = "<thead>";
3391         html[html.length] =  "<tr>";
3392         html[html.length] =   '<th colspan="' + colSpan + '" class="' + this.Style.CSS_HEADER_TEXT + '">';
3393         html[html.length] =    '<div class="' + this.Style.CSS_HEADER + '">';
3394
3395         var renderLeft, renderRight = false;
3396
3397         if (this.parent) {
3398             if (this.index === 0) {
3399                 renderLeft = true;
3400             }
3401             if (this.index == (this.parent.cfg.getProperty("pages") -1)) {
3402                 renderRight = true;
3403             }
3404         } else {
3405             renderLeft = true;
3406             renderRight = true;
3407         }
3408
3409         if (renderLeft) {
3410             monthLabel  = this._buildMonthLabel(DateMath.subtract(pageDate, DateMath.MONTH, 1));
3411
3412             var leftArrow = cfg.getProperty(DEF_CFG.NAV_ARROW_LEFT.key);
3413             // Check for deprecated customization - If someone set IMG_ROOT, but didn't set NAV_ARROW_LEFT, then set NAV_ARROW_LEFT to the old deprecated value
3414             if (leftArrow === null && Calendar.IMG_ROOT !== null) {
3415                 leftArrow = Calendar.IMG_ROOT + DEPR_NAV_LEFT;
3416             }
3417             var leftStyle = (leftArrow === null) ? "" : ' style="background-image:url(' + leftArrow + ')"';
3418             html[html.length] = '<a class="' + this.Style.CSS_NAV_LEFT + '"' + leftStyle + ' href="#">' + prevStr + ' (' + monthLabel + ')' + '</a>';
3419         }
3420
3421         var lbl = this.buildMonthLabel();
3422         var cal = this.parent || this;
3423         if (cal.cfg.getProperty("navigator")) {
3424             lbl = "<a class=\"" + this.Style.CSS_NAV + "\" href=\"#\">" + lbl + "</a>";
3425         }
3426         html[html.length] = lbl;
3427
3428         if (renderRight) {
3429             monthLabel  = this._buildMonthLabel(DateMath.add(pageDate, DateMath.MONTH, 1));
3430
3431             var rightArrow = cfg.getProperty(DEF_CFG.NAV_ARROW_RIGHT.key);
3432             if (rightArrow === null && Calendar.IMG_ROOT !== null) {
3433                 rightArrow = Calendar.IMG_ROOT + DEPR_NAV_RIGHT;
3434             }
3435             var rightStyle = (rightArrow === null) ? "" : ' style="background-image:url(' + rightArrow + ')"';
3436             html[html.length] = '<a class="' + this.Style.CSS_NAV_RIGHT + '"' + rightStyle + ' href="#">' + nextStr + ' (' + monthLabel + ')' + '</a>';
3437         }
3438
3439         html[html.length] = '</div>\n</th>\n</tr>';
3440
3441         if (cfg.getProperty(DEF_CFG.SHOW_WEEKDAYS.key)) {
3442             html = this.buildWeekdays(html);
3443         }
3444         
3445         html[html.length] = '</thead>';
3446     
3447         return html;
3448     },
3449     
3450     /**
3451     * Renders the Calendar's weekday headers.
3452     * @method buildWeekdays
3453     * @param {Array} html The current working HTML array
3454     * @return {Array} The current working HTML array
3455     */
3456     buildWeekdays : function(html) {
3457
3458         html[html.length] = '<tr class="' + this.Style.CSS_WEEKDAY_ROW + '">';
3459
3460         if (this.cfg.getProperty(DEF_CFG.SHOW_WEEK_HEADER.key)) {
3461             html[html.length] = '<th>&#160;</th>';
3462         }
3463
3464         for(var i=0;i < this.Locale.LOCALE_WEEKDAYS.length; ++i) {
3465             html[html.length] = '<th class="' + this.Style.CSS_WEEKDAY_CELL + '">' + this.Locale.LOCALE_WEEKDAYS[i] + '</th>';
3466         }
3467
3468         if (this.cfg.getProperty(DEF_CFG.SHOW_WEEK_FOOTER.key)) {
3469             html[html.length] = '<th>&#160;</th>';
3470         }
3471
3472         html[html.length] = '</tr>';
3473
3474         return html;
3475     },
3476     
3477     /**
3478     * Renders the calendar body.
3479     * @method renderBody
3480     * @param {Date} workingDate The current working Date being used for the render process
3481     * @param {Array} html The current working HTML array
3482     * @return {Array} The current working HTML array
3483     */
3484     renderBody : function(workingDate, html) {
3485
3486         var startDay = this.cfg.getProperty(DEF_CFG.START_WEEKDAY.key);
3487
3488         this.preMonthDays = workingDate.getDay();
3489         if (startDay > 0) {
3490             this.preMonthDays -= startDay;
3491         }
3492         if (this.preMonthDays < 0) {
3493             this.preMonthDays += 7;
3494         }
3495
3496         this.monthDays = DateMath.findMonthEnd(workingDate).getDate();
3497         this.postMonthDays = Calendar.DISPLAY_DAYS-this.preMonthDays-this.monthDays;
3498
3499
3500         workingDate = DateMath.subtract(workingDate, DateMath.DAY, this.preMonthDays);
3501     
3502         var weekNum,
3503             weekClass,
3504             weekPrefix = "w",
3505             cellPrefix = "_cell",
3506             workingDayPrefix = "wd",
3507             dayPrefix = "d",
3508             cellRenderers,
3509             renderer,
3510             t = this.today,
3511             cfg = this.cfg,
3512             todayYear = t.getFullYear(),
3513             todayMonth = t.getMonth(),
3514             todayDate = t.getDate(),
3515             useDate = cfg.getProperty(DEF_CFG.PAGEDATE.key),
3516             hideBlankWeeks = cfg.getProperty(DEF_CFG.HIDE_BLANK_WEEKS.key),
3517             showWeekFooter = cfg.getProperty(DEF_CFG.SHOW_WEEK_FOOTER.key),
3518             showWeekHeader = cfg.getProperty(DEF_CFG.SHOW_WEEK_HEADER.key),
3519             mindate = cfg.getProperty(DEF_CFG.MINDATE.key),
3520             maxdate = cfg.getProperty(DEF_CFG.MAXDATE.key),
3521             yearOffset = this.Locale.YEAR_OFFSET;
3522
3523         if (mindate) {
3524             mindate = DateMath.clearTime(mindate);
3525         }
3526         if (maxdate) {
3527             maxdate = DateMath.clearTime(maxdate);
3528         }
3529
3530         html[html.length] = '<tbody class="m' + (useDate.getMonth()+1) + ' ' + this.Style.CSS_BODY + '">';
3531
3532         var i = 0,
3533             tempDiv = document.createElement("div"),
3534             cell = document.createElement("td");
3535
3536         tempDiv.appendChild(cell);
3537
3538         var cal = this.parent || this;
3539
3540         for (var r=0;r<6;r++) {
3541             weekNum = DateMath.getWeekNumber(workingDate, startDay);
3542             weekClass = weekPrefix + weekNum;
3543
3544             // Local OOM check for performance, since we already have pagedate
3545             if (r !== 0 && hideBlankWeeks === true && workingDate.getMonth() != useDate.getMonth()) {
3546                 break;
3547             } else {
3548                 html[html.length] = '<tr class="' + weekClass + '">';
3549
3550                 if (showWeekHeader) { html = this.renderRowHeader(weekNum, html); }
3551
3552                 for (var d=0; d < 7; d++){ // Render actual days
3553
3554                     cellRenderers = [];
3555
3556                     this.clearElement(cell);
3557                     cell.className = this.Style.CSS_CELL;
3558                     cell.id = this.id + cellPrefix + i;
3559
3560                     if (workingDate.getDate()  == todayDate && 
3561                         workingDate.getMonth()  == todayMonth &&
3562                         workingDate.getFullYear() == todayYear) {
3563                         cellRenderers[cellRenderers.length]=cal.renderCellStyleToday;
3564                     }
3565
3566                     var workingArray = [workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()];
3567                     this.cellDates[this.cellDates.length] = workingArray; // Add this date to cellDates
3568
3569                     // Local OOM check for performance, since we already have pagedate
3570                     if (workingDate.getMonth() != useDate.getMonth()) {
3571                         cellRenderers[cellRenderers.length]=cal.renderCellNotThisMonth;
3572                     } else {
3573                         Dom.addClass(cell, workingDayPrefix + workingDate.getDay());
3574                         Dom.addClass(cell, dayPrefix + workingDate.getDate());
3575
3576                         for (var s=0;s<this.renderStack.length;++s) {
3577
3578                             renderer = null;
3579
3580                             var rArray = this.renderStack[s],
3581                                 type = rArray[0],
3582                                 month,
3583                                 day,
3584                                 year;
3585
3586                             switch (type) {
3587                                 case Calendar.DATE:
3588                                     month = rArray[1][1];
3589                                     day = rArray[1][2];
3590                                     year = rArray[1][0];
3591
3592                                     if (workingDate.getMonth()+1 == month && workingDate.getDate() == day && workingDate.getFullYear() == year) {
3593                                         renderer = rArray[2];
3594                                         this.renderStack.splice(s,1);
3595                                     }
3596                                     break;
3597                                 case Calendar.MONTH_DAY:
3598                                     month = rArray[1][0];
3599                                     day = rArray[1][1];
3600
3601                                     if (workingDate.getMonth()+1 == month && workingDate.getDate() == day) {
3602                                         renderer = rArray[2];
3603                                         this.renderStack.splice(s,1);
3604                                     }
3605                                     break;
3606                                 case Calendar.RANGE:
3607                                     var date1 = rArray[1][0],
3608                                         date2 = rArray[1][1],
3609                                         d1month = date1[1],
3610                                         d1day = date1[2],
3611                                         d1year = date1[0],
3612                                         d1 = DateMath.getDate(d1year, d1month-1, d1day),
3613                                         d2month = date2[1],
3614                                         d2day = date2[2],
3615                                         d2year = date2[0],
3616                                         d2 = DateMath.getDate(d2year, d2month-1, d2day);
3617
3618                                     if (workingDate.getTime() >= d1.getTime() && workingDate.getTime() <= d2.getTime()) {
3619                                         renderer = rArray[2];
3620
3621                                         if (workingDate.getTime()==d2.getTime()) { 
3622                                             this.renderStack.splice(s,1);
3623                                         }
3624                                     }
3625                                     break;
3626                                 case Calendar.WEEKDAY:
3627                                     var weekday = rArray[1][0];
3628                                     if (workingDate.getDay()+1 == weekday) {
3629                                         renderer = rArray[2];
3630                                     }
3631                                     break;
3632                                 case Calendar.MONTH:
3633                                     month = rArray[1][0];
3634                                     if (workingDate.getMonth()+1 == month) {
3635                                         renderer = rArray[2];
3636                                     }
3637                                     break;
3638                             }
3639
3640                             if (renderer) {
3641                                 cellRenderers[cellRenderers.length]=renderer;
3642                             }
3643                         }
3644
3645                     }
3646
3647                     if (this._indexOfSelectedFieldArray(workingArray) > -1) {
3648                         cellRenderers[cellRenderers.length]=cal.renderCellStyleSelected; 
3649                     }
3650
3651                     if ((mindate && (workingDate.getTime() < mindate.getTime())) ||
3652                         (maxdate && (workingDate.getTime() > maxdate.getTime()))
3653                     ) {
3654                         cellRenderers[cellRenderers.length]=cal.renderOutOfBoundsDate;
3655                     } else {
3656                         cellRenderers[cellRenderers.length]=cal.styleCellDefault;
3657                         cellRenderers[cellRenderers.length]=cal.renderCellDefault; 
3658                     }
3659
3660                     for (var x=0; x < cellRenderers.length; ++x) {
3661                         if (cellRenderers[x].call(cal, workingDate, cell) == Calendar.STOP_RENDER) {
3662                             break;
3663                         }
3664                     }
3665
3666                     workingDate.setTime(workingDate.getTime() + DateMath.ONE_DAY_MS);
3667                     // Just in case we crossed DST/Summertime boundaries
3668                     workingDate = DateMath.clearTime(workingDate);
3669
3670                     if (i >= 0 && i <= 6) {
3671                         Dom.addClass(cell, this.Style.CSS_CELL_TOP);
3672                     }
3673                     if ((i % 7) === 0) {
3674                         Dom.addClass(cell, this.Style.CSS_CELL_LEFT);
3675                     }
3676                     if (((i+1) % 7) === 0) {
3677                         Dom.addClass(cell, this.Style.CSS_CELL_RIGHT);
3678                     }
3679
3680                     var postDays = this.postMonthDays; 
3681                     if (hideBlankWeeks && postDays >= 7) {
3682                         var blankWeeks = Math.floor(postDays/7);
3683                         for (var p=0;p<blankWeeks;++p) {
3684                             postDays -= 7;
3685                         }
3686                     }
3687                     
3688                     if (i >= ((this.preMonthDays+postDays+this.monthDays)-7)) {
3689                         Dom.addClass(cell, this.Style.CSS_CELL_BOTTOM);
3690                     }
3691     
3692                     html[html.length] = tempDiv.innerHTML;
3693                     i++;
3694                 }
3695     
3696                 if (showWeekFooter) { html = this.renderRowFooter(weekNum, html); }
3697     
3698                 html[html.length] = '</tr>';
3699             }
3700         }
3701     
3702         html[html.length] = '</tbody>';
3703     
3704         return html;
3705     },
3706     
3707     /**
3708     * Renders the calendar footer. In the default implementation, there is
3709     * no footer.
3710     * @method renderFooter
3711     * @param {Array} html The current working HTML array
3712     * @return {Array} The current working HTML array
3713     */
3714     renderFooter : function(html) { return html; },
3715     
3716     /**
3717     * Renders the calendar after it has been configured. The render() method has a specific call chain that will execute
3718     * when the method is called: renderHeader, renderBody, renderFooter.
3719     * Refer to the documentation for those methods for information on 
3720     * individual render tasks.
3721     * @method render
3722     */
3723     render : function() {
3724         this.beforeRenderEvent.fire();
3725
3726         // Find starting day of the current month
3727         var workingDate = DateMath.findMonthStart(this.cfg.getProperty(DEF_CFG.PAGEDATE.key));
3728
3729         this.resetRenderers();
3730         this.cellDates.length = 0;
3731
3732         Event.purgeElement(this.oDomContainer, true);
3733
3734         var html = [];
3735
3736         html[html.length] = '<table cellSpacing="0" class="' + this.Style.CSS_CALENDAR + ' y' + (workingDate.getFullYear() + this.Locale.YEAR_OFFSET) +'" id="' + this.id + '">';
3737         html = this.renderHeader(html);
3738         html = this.renderBody(workingDate, html);
3739         html = this.renderFooter(html);
3740         html[html.length] = '</table>';
3741
3742         this.oDomContainer.innerHTML = html.join("\n");
3743
3744         this.applyListeners();
3745         this.cells = Dom.getElementsByClassName(this.Style.CSS_CELL, "td", this.id);
3746     
3747         this.cfg.refireEvent(DEF_CFG.TITLE.key);
3748         this.cfg.refireEvent(DEF_CFG.CLOSE.key);
3749         this.cfg.refireEvent(DEF_CFG.IFRAME.key);
3750
3751         this.renderEvent.fire();
3752     },
3753
3754     /**
3755     * Applies the Calendar's DOM listeners to applicable elements.
3756     * @method applyListeners
3757     */
3758     applyListeners : function() {
3759         var root = this.oDomContainer,
3760             cal = this.parent || this,
3761             anchor = "a",
3762             click = "click";
3763
3764         var linkLeft = Dom.getElementsByClassName(this.Style.CSS_NAV_LEFT, anchor, root),
3765             linkRight = Dom.getElementsByClassName(this.Style.CSS_NAV_RIGHT, anchor, root);
3766
3767         if (linkLeft && linkLeft.length > 0) {
3768             this.linkLeft = linkLeft[0];
3769             Event.addListener(this.linkLeft, click, this.doPreviousMonthNav, cal, true);
3770         }
3771
3772         if (linkRight && linkRight.length > 0) {
3773             this.linkRight = linkRight[0];
3774             Event.addListener(this.linkRight, click, this.doNextMonthNav, cal, true);
3775         }
3776
3777         if (cal.cfg.getProperty("navigator") !== null) {
3778             this.applyNavListeners();
3779         }
3780
3781         if (this.domEventMap) {
3782             var el,elements;
3783             for (var cls in this.domEventMap) { 
3784                 if (Lang.hasOwnProperty(this.domEventMap, cls)) {
3785                     var items = this.domEventMap[cls];
3786     
3787                     if (! (items instanceof Array)) {
3788                         items = [items];
3789                     }
3790     
3791                     for (var i=0;i<items.length;i++) {
3792                         var item = items[i];
3793                         elements = Dom.getElementsByClassName(cls, item.tag, this.oDomContainer);
3794     
3795                         for (var c=0;c<elements.length;c++) {
3796                             el = elements[c];
3797                              Event.addListener(el, item.event, item.handler, item.scope, item.correct );
3798                         }
3799                     }
3800                 }
3801             }
3802         }
3803
3804         Event.addListener(this.oDomContainer, "click", this.doSelectCell, this);
3805         Event.addListener(this.oDomContainer, "mouseover", this.doCellMouseOver, this);
3806         Event.addListener(this.oDomContainer, "mouseout", this.doCellMouseOut, this);
3807     },
3808
3809     applyNavListeners : function() {
3810         var calParent = this.parent || this,
3811             cal = this,
3812             navBtns = Dom.getElementsByClassName(this.Style.CSS_NAV, "a", this.oDomContainer);
3813
3814         if (navBtns.length > 0) {
3815
3816             Event.addListener(navBtns, "click", function (e, obj) {
3817                 var target = Event.getTarget(e);
3818                 // this == navBtn
3819                 if (this === target || Dom.isAncestor(this, target)) {
3820                     Event.preventDefault(e);
3821                 }
3822                 var navigator = calParent.oNavigator;
3823                 if (navigator) {
3824                     var pgdate = cal.cfg.getProperty("pagedate");
3825                     navigator.setYear(pgdate.getFullYear() + cal.Locale.YEAR_OFFSET);
3826                     navigator.setMonth(pgdate.getMonth());
3827                     navigator.show();
3828                 }
3829             });
3830         }
3831     },
3832
3833     /**
3834     * Retrieves the Date object for the specified Calendar cell
3835     * @method getDateByCellId
3836     * @param {String} id The id of the cell
3837     * @return {Date} The Date object for the specified Calendar cell
3838     */
3839     getDateByCellId : function(id) {
3840         var date = this.getDateFieldsByCellId(id);
3841         return (date) ? DateMath.getDate(date[0],date[1]-1,date[2]) : null;
3842     },
3843     
3844     /**
3845     * Retrieves the Date object for the specified Calendar cell
3846     * @method getDateFieldsByCellId
3847     * @param {String} id The id of the cell
3848     * @return {Array} The array of Date fields for the specified Calendar cell
3849     */
3850     getDateFieldsByCellId : function(id) {
3851         id = this.getIndexFromId(id);
3852         return (id > -1) ? this.cellDates[id] : null;
3853     },
3854
3855     /**
3856      * Find the Calendar's cell index for a given date.
3857      * If the date is not found, the method returns -1.
3858      * <p>
3859      * The returned index can be used to lookup the cell HTMLElement  
3860      * using the Calendar's cells array or passed to selectCell to select 
3861      * cells by index. 
3862      * </p>
3863      *
3864      * See <a href="#cells">cells</a>, <a href="#selectCell">selectCell</a>.
3865      *
3866      * @method getCellIndex
3867      * @param {Date} date JavaScript Date object, for which to find a cell index.
3868      * @return {Number} The index of the date in Calendars cellDates/cells arrays, or -1 if the date 
3869      * is not on the curently rendered Calendar page.
3870      */
3871     getCellIndex : function(date) {
3872         var idx = -1;
3873         if (date) {
3874             var m = date.getMonth(),
3875                 y = date.getFullYear(),
3876                 d = date.getDate(),
3877                 dates = this.cellDates;
3878
3879             for (var i = 0; i < dates.length; ++i) {
3880                 var cellDate = dates[i];
3881                 if (cellDate[0] === y && cellDate[1] === m+1 && cellDate[2] === d) {
3882                     idx = i;
3883                     break;
3884                 }
3885             }
3886         }
3887         return idx;
3888     },
3889
3890     /**
3891      * Given the id used to mark each Calendar cell, this method
3892      * extracts the index number from the id.
3893      * 
3894      * @param {String} strId The cell id
3895      * @return {Number} The index of the cell, or -1 if id does not contain an index number
3896      */
3897     getIndexFromId : function(strId) {
3898         var idx = -1,
3899             li = strId.lastIndexOf("_cell");
3900
3901         if (li > -1) {
3902             idx = parseInt(strId.substring(li + 5), 10);
3903         }
3904
3905         return idx;
3906     },
3907     
3908     // BEGIN BUILT-IN TABLE CELL RENDERERS
3909     
3910     /**
3911     * Renders a cell that falls before the minimum date or after the maximum date.
3912     * widget class.
3913     * @method renderOutOfBoundsDate
3914     * @param {Date}     workingDate  The current working Date object being used to generate the calendar
3915     * @param {HTMLTableCellElement} cell   The current working cell in the calendar
3916     * @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
3917     *   should not be terminated
3918     */
3919     renderOutOfBoundsDate : function(workingDate, cell) {
3920         Dom.addClass(cell, this.Style.CSS_CELL_OOB);
3921         cell.innerHTML = workingDate.getDate();
3922         return Calendar.STOP_RENDER;
3923     },
3924
3925     /**
3926     * Renders the row header for a week.
3927     * @method renderRowHeader
3928     * @param {Number} weekNum The week number of the current row
3929     * @param {Array} cell The current working HTML array
3930     */
3931     renderRowHeader : function(weekNum, html) {
3932         html[html.length] = '<th class="' + this.Style.CSS_ROW_HEADER + '">' + weekNum + '</th>';
3933         return html;
3934     },
3935
3936     /**
3937     * Renders the row footer for a week.
3938     * @method renderRowFooter
3939     * @param {Number} weekNum The week number of the current row
3940     * @param {Array} cell The current working HTML array
3941     */
3942     renderRowFooter : function(weekNum, html) {
3943         html[html.length] = '<th class="' + this.Style.CSS_ROW_FOOTER + '">' + weekNum + '</th>';
3944         return html;
3945     },
3946     
3947     /**
3948     * Renders a single standard calendar cell in the calendar widget table.
3949     * All logic for determining how a standard default cell will be rendered is 
3950     * encapsulated in this method, and must be accounted for when extending the
3951     * widget class.
3952     * @method renderCellDefault
3953     * @param {Date}     workingDate  The current working Date object being used to generate the calendar
3954     * @param {HTMLTableCellElement} cell   The current working cell in the calendar
3955     */
3956     renderCellDefault : function(workingDate, cell) {
3957         cell.innerHTML = '<a href="#" class="' + this.Style.CSS_CELL_SELECTOR + '">' + this.buildDayLabel(workingDate) + "</a>";
3958     },
3959     
3960     /**
3961     * Styles a selectable cell.
3962     * @method styleCellDefault
3963     * @param {Date}     workingDate  The current working Date object being used to generate the calendar
3964     * @param {HTMLTableCellElement} cell   The current working cell in the calendar
3965     */
3966     styleCellDefault : function(workingDate, cell) {
3967         Dom.addClass(cell, this.Style.CSS_CELL_SELECTABLE);
3968     },
3969     
3970     
3971     /**
3972     * Renders a single standard calendar cell using the CSS hightlight1 style
3973     * @method renderCellStyleHighlight1
3974     * @param {Date}     workingDate  The current working Date object being used to generate the calendar
3975     * @param {HTMLTableCellElement} cell   The current working cell in the calendar
3976     */
3977     renderCellStyleHighlight1 : function(workingDate, cell) {
3978         Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT1);
3979     },
3980     
3981     /**
3982     * Renders a single standard calendar cell using the CSS hightlight2 style
3983     * @method renderCellStyleHighlight2
3984     * @param {Date}     workingDate  The current working Date object being used to generate the calendar
3985     * @param {HTMLTableCellElement} cell   The current working cell in the calendar
3986     */
3987     renderCellStyleHighlight2 : function(workingDate, cell) {
3988         Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT2);
3989     },
3990     
3991     /**
3992     * Renders a single standard calendar cell using the CSS hightlight3 style
3993     * @method renderCellStyleHighlight3
3994     * @param {Date}     workingDate  The current working Date object being used to generate the calendar
3995     * @param {HTMLTableCellElement} cell   The current working cell in the calendar
3996     */
3997     renderCellStyleHighlight3 : function(workingDate, cell) {
3998         Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT3);
3999     },
4000     
4001     /**
4002     * Renders a single standard calendar cell using the CSS hightlight4 style
4003     * @method renderCellStyleHighlight4
4004     * @param {Date}     workingDate  The current working Date object being used to generate the calendar
4005     * @param {HTMLTableCellElement} cell   The current working cell in the calendar
4006     */
4007     renderCellStyleHighlight4 : function(workingDate, cell) {
4008         Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT4);
4009     },
4010     
4011     /**
4012     * Applies the default style used for rendering today's date to the current calendar cell
4013     * @method renderCellStyleToday
4014     * @param {Date}     workingDate  The current working Date object being used to generate the calendar
4015     * @param {HTMLTableCellElement} cell   The current working cell in the calendar
4016     */
4017     renderCellStyleToday : function(workingDate, cell) {
4018         Dom.addClass(cell, this.Style.CSS_CELL_TODAY);
4019     },
4020
4021     /**
4022     * Applies the default style used for rendering selected dates to the current calendar cell
4023     * @method renderCellStyleSelected
4024     * @param {Date}     workingDate  The current working Date object being used to generate the calendar
4025     * @param {HTMLTableCellElement} cell   The current working cell in the calendar
4026     * @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
4027     *   should not be terminated
4028     */
4029     renderCellStyleSelected : function(workingDate, cell) {
4030         Dom.addClass(cell, this.Style.CSS_CELL_SELECTED);
4031     },
4032     
4033     /**
4034     * Applies the default style used for rendering dates that are not a part of the current
4035     * month (preceding or trailing the cells for the current month)
4036     * @method renderCellNotThisMonth
4037     * @param {Date}     workingDate  The current working Date object being used to generate the calendar
4038     * @param {HTMLTableCellElement} cell   The current working cell in the calendar
4039     * @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
4040     *   should not be terminated
4041     */
4042     renderCellNotThisMonth : function(workingDate, cell) {
4043         Dom.addClass(cell, this.Style.CSS_CELL_OOM);
4044         cell.innerHTML=workingDate.getDate();
4045         return Calendar.STOP_RENDER;
4046     },
4047     
4048     /**
4049     * Renders the current calendar cell as a non-selectable "black-out" date using the default
4050     * restricted style.
4051     * @method renderBodyCellRestricted
4052     * @param {Date}     workingDate  The current working Date object being used to generate the calendar
4053     * @param {HTMLTableCellElement} cell   The current working cell in the calendar
4054     * @return {String} YAHOO.widget.Calendar.STOP_RENDER if rendering should stop with this style, null or nothing if rendering
4055     *   should not be terminated
4056     */
4057     renderBodyCellRestricted : function(workingDate, cell) {
4058         Dom.addClass(cell, this.Style.CSS_CELL);
4059         Dom.addClass(cell, this.Style.CSS_CELL_RESTRICTED);
4060         cell.innerHTML=workingDate.getDate();
4061         return Calendar.STOP_RENDER;
4062     },
4063     
4064     // END BUILT-IN TABLE CELL RENDERERS
4065     
4066     // BEGIN MONTH NAVIGATION METHODS
4067
4068     /**
4069     * Adds the designated number of months to the current calendar month, and sets the current
4070     * calendar page date to the new month.
4071     * @method addMonths
4072     * @param {Number} count The number of months to add to the current calendar
4073     */
4074     addMonths : function(count) {
4075         var cfgPageDate = DEF_CFG.PAGEDATE.key,
4076
4077         prevDate = this.cfg.getProperty(cfgPageDate),
4078         newDate = DateMath.add(prevDate, DateMath.MONTH, count);
4079
4080         this.cfg.setProperty(cfgPageDate, newDate);
4081         this.resetRenderers();
4082         this.changePageEvent.fire(prevDate, newDate);
4083     },
4084
4085     /**
4086     * Subtracts the designated number of months from the current calendar month, and sets the current
4087     * calendar page date to the new month.
4088     * @method subtractMonths
4089     * @param {Number} count The number of months to subtract from the current calendar
4090     */
4091     subtractMonths : function(count) {
4092         this.addMonths(-1*count);
4093     },
4094
4095     /**
4096     * Adds the designated number of years to the current calendar, and sets the current
4097     * calendar page date to the new month.
4098     * @method addYears
4099     * @param {Number} count The number of years to add to the current calendar
4100     */
4101     addYears : function(count) {
4102         var cfgPageDate = DEF_CFG.PAGEDATE.key,
4103
4104         prevDate = this.cfg.getProperty(cfgPageDate),
4105         newDate = DateMath.add(prevDate, DateMath.YEAR, count);
4106
4107         this.cfg.setProperty(cfgPageDate, newDate);
4108         this.resetRenderers();
4109         this.changePageEvent.fire(prevDate, newDate);
4110     },
4111
4112     /**
4113     * Subtcats the designated number of years from the current calendar, and sets the current
4114     * calendar page date to the new month.
4115     * @method subtractYears
4116     * @param {Number} count The number of years to subtract from the current calendar
4117     */
4118     subtractYears : function(count) {
4119         this.addYears(-1*count);
4120     },
4121
4122     /**
4123     * Navigates to the next month page in the calendar widget.
4124     * @method nextMonth
4125     */
4126     nextMonth : function() {
4127         this.addMonths(1);
4128     },
4129     
4130     /**
4131     * Navigates to the previous month page in the calendar widget.
4132     * @method previousMonth
4133     */
4134     previousMonth : function() {
4135         this.addMonths(-1);
4136     },
4137     
4138     /**
4139     * Navigates to the next year in the currently selected month in the calendar widget.
4140     * @method nextYear
4141     */
4142     nextYear : function() {
4143         this.addYears(1);
4144     },
4145     
4146     /**
4147     * Navigates to the previous year in the currently selected month in the calendar widget.
4148     * @method previousYear
4149     */
4150     previousYear : function() {
4151         this.addYears(-1);
4152     },
4153
4154     // END MONTH NAVIGATION METHODS
4155     
4156     // BEGIN SELECTION METHODS
4157     
4158     /**
4159     * Resets the calendar widget to the originally selected month and year, and 
4160     * sets the calendar to the initial selection(s).
4161     * @method reset
4162     */
4163     reset : function() {
4164         this.cfg.resetProperty(DEF_CFG.SELECTED.key);
4165         this.cfg.resetProperty(DEF_CFG.PAGEDATE.key);
4166         this.resetEvent.fire();
4167     },
4168     
4169     /**
4170     * Clears the selected dates in the current calendar widget and sets the calendar
4171     * to the current month and year.
4172     * @method clear
4173     */
4174     clear : function() {
4175         this.cfg.setProperty(DEF_CFG.SELECTED.key, []);
4176         this.cfg.setProperty(DEF_CFG.PAGEDATE.key, new Date(this.today.getTime()));
4177         this.clearEvent.fire();
4178     },
4179     
4180     /**
4181     * Selects a date or a collection of dates on the current calendar. This method, by default,
4182     * does not call the render method explicitly. Once selection has completed, render must be 
4183     * called for the changes to be reflected visually.
4184     *
4185     * Any dates which are OOB (out of bounds, not selectable) will not be selected and the array of 
4186     * selected dates passed to the selectEvent will not contain OOB dates.
4187     * 
4188     * If all dates are OOB, the no state change will occur; beforeSelect and select events will not be fired.
4189     *
4190     * @method select
4191     * @param {String/Date/Date[]} date The date string of dates to select in the current calendar. Valid formats are
4192     *        individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
4193     *        Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
4194     *        This method can also take a JavaScript Date object or an array of Date objects.
4195     * @return {Date[]}   Array of JavaScript Date objects representing all individual dates that are currently selected.
4196     */
4197     select : function(date) {
4198
4199         var aToBeSelected = this._toFieldArray(date),
4200             validDates = [],
4201             selected = [],
4202             cfgSelected = DEF_CFG.SELECTED.key;
4203
4204         
4205         for (var a=0; a < aToBeSelected.length; ++a) {
4206             var toSelect = aToBeSelected[a];
4207
4208             if (!this.isDateOOB(this._toDate(toSelect))) {
4209
4210                 if (validDates.length === 0) {
4211                     this.beforeSelectEvent.fire();
4212                     selected = this.cfg.getProperty(cfgSelected);
4213                 }
4214                 validDates.push(toSelect);
4215
4216                 if (this._indexOfSelectedFieldArray(toSelect) == -1) { 
4217                     selected[selected.length] = toSelect;
4218                 }
4219             }
4220         }
4221
4222
4223         if (validDates.length > 0) {
4224             if (this.parent) {
4225                 this.parent.cfg.setProperty(cfgSelected, selected);
4226             } else {
4227                 this.cfg.setProperty(cfgSelected, selected);
4228             }
4229             this.selectEvent.fire(validDates);
4230         }
4231
4232         return this.getSelectedDates();
4233     },
4234     
4235     /**
4236     * Selects a date on the current calendar by referencing the index of the cell that should be selected.
4237     * This method is used to easily select a single cell (usually with a mouse click) without having to do
4238     * a full render. The selected style is applied to the cell directly.
4239     *
4240     * If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month 
4241     * or out of bounds cells), it will not be selected and in such a case beforeSelect and select events will not be fired.
4242     * 
4243     * @method selectCell
4244     * @param {Number} cellIndex The index of the cell to select in the current calendar. 
4245     * @return {Date[]} Array of JavaScript Date objects representing all individual dates that are currently selected.
4246     */
4247     selectCell : function(cellIndex) {
4248
4249         var cell = this.cells[cellIndex],
4250             cellDate = this.cellDates[cellIndex],
4251             dCellDate = this._toDate(cellDate),
4252             selectable = Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE);
4253
4254
4255         if (selectable) {
4256     
4257             this.beforeSelectEvent.fire();
4258     
4259             var cfgSelected = DEF_CFG.SELECTED.key;
4260             var selected = this.cfg.getProperty(cfgSelected);
4261     
4262             var selectDate = cellDate.concat();
4263     
4264             if (this._indexOfSelectedFieldArray(selectDate) == -1) {
4265                 selected[selected.length] = selectDate;
4266             }
4267             if (this.parent) {
4268                 this.parent.cfg.setProperty(cfgSelected, selected);
4269             } else {
4270                 this.cfg.setProperty(cfgSelected, selected);
4271             }
4272             this.renderCellStyleSelected(dCellDate,cell);
4273             this.selectEvent.fire([selectDate]);
4274     
4275             this.doCellMouseOut.call(cell, null, this);  
4276         }
4277     
4278         return this.getSelectedDates();
4279     },
4280     
4281     /**
4282     * Deselects a date or a collection of dates on the current calendar. This method, by default,
4283     * does not call the render method explicitly. Once deselection has completed, render must be 
4284     * called for the changes to be reflected visually.
4285     * 
4286     * The method will not attempt to deselect any dates which are OOB (out of bounds, and hence not selectable) 
4287     * and the array of deselected dates passed to the deselectEvent will not contain any OOB dates.
4288     * 
4289     * If all dates are OOB, beforeDeselect and deselect events will not be fired.
4290     * 
4291     * @method deselect
4292     * @param {String/Date/Date[]} date The date string of dates to deselect in the current calendar. Valid formats are
4293     *        individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
4294     *        Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
4295     *        This method can also take a JavaScript Date object or an array of Date objects. 
4296     * @return {Date[]}   Array of JavaScript Date objects representing all individual dates that are currently selected.
4297     */
4298     deselect : function(date) {
4299
4300         var aToBeDeselected = this._toFieldArray(date),
4301             validDates = [],
4302             selected = [],
4303             cfgSelected = DEF_CFG.SELECTED.key;
4304
4305
4306         for (var a=0; a < aToBeDeselected.length; ++a) {
4307             var toDeselect = aToBeDeselected[a];
4308     
4309             if (!this.isDateOOB(this._toDate(toDeselect))) {
4310     
4311                 if (validDates.length === 0) {
4312                     this.beforeDeselectEvent.fire();
4313                     selected = this.cfg.getProperty(cfgSelected);
4314                 }
4315     
4316                 validDates.push(toDeselect);
4317     
4318                 var index = this._indexOfSelectedFieldArray(toDeselect);
4319                 if (index != -1) { 
4320                     selected.splice(index,1);
4321                 }
4322             }
4323         }
4324     
4325     
4326         if (validDates.length > 0) {
4327             if (this.parent) {
4328                 this.parent.cfg.setProperty(cfgSelected, selected);
4329             } else {
4330                 this.cfg.setProperty(cfgSelected, selected);
4331             }
4332             this.deselectEvent.fire(validDates);
4333         }
4334     
4335         return this.getSelectedDates();
4336     },
4337     
4338     /**
4339     * Deselects a date on the current calendar by referencing the index of the cell that should be deselected.
4340     * This method is used to easily deselect a single cell (usually with a mouse click) without having to do
4341     * a full render. The selected style is removed from the cell directly.
4342     * 
4343     * If the cell is not marked with the CSS_CELL_SELECTABLE class (as is the case by default for out of month 
4344     * or out of bounds cells), the method will not attempt to deselect it and in such a case, beforeDeselect and 
4345     * deselect events will not be fired.
4346     * 
4347     * @method deselectCell
4348     * @param {Number} cellIndex The index of the cell to deselect in the current calendar. 
4349     * @return {Date[]} Array of JavaScript Date objects representing all individual dates that are currently selected.
4350     */
4351     deselectCell : function(cellIndex) {
4352         var cell = this.cells[cellIndex],
4353             cellDate = this.cellDates[cellIndex],
4354             cellDateIndex = this._indexOfSelectedFieldArray(cellDate);
4355
4356         var selectable = Dom.hasClass(cell, this.Style.CSS_CELL_SELECTABLE);
4357
4358         if (selectable) {
4359
4360             this.beforeDeselectEvent.fire();
4361
4362             var selected = this.cfg.getProperty(DEF_CFG.SELECTED.key),
4363                 dCellDate = this._toDate(cellDate),
4364                 selectDate = cellDate.concat();
4365
4366             if (cellDateIndex > -1) {
4367                 if (this.cfg.getProperty(DEF_CFG.PAGEDATE.key).getMonth() == dCellDate.getMonth() &&
4368                     this.cfg.getProperty(DEF_CFG.PAGEDATE.key).getFullYear() == dCellDate.getFullYear()) {
4369                     Dom.removeClass(cell, this.Style.CSS_CELL_SELECTED);
4370                 }
4371                 selected.splice(cellDateIndex, 1);
4372             }
4373
4374             if (this.parent) {
4375                 this.parent.cfg.setProperty(DEF_CFG.SELECTED.key, selected);
4376             } else {
4377                 this.cfg.setProperty(DEF_CFG.SELECTED.key, selected);
4378             }
4379
4380             this.deselectEvent.fire([selectDate]);
4381         }
4382
4383         return this.getSelectedDates();
4384     },
4385
4386     /**
4387     * Deselects all dates on the current calendar.
4388     * @method deselectAll
4389     * @return {Date[]}  Array of JavaScript Date objects representing all individual dates that are currently selected.
4390     *      Assuming that this function executes properly, the return value should be an empty array.
4391     *      However, the empty array is returned for the sake of being able to check the selection status
4392     *      of the calendar.
4393     */
4394     deselectAll : function() {
4395         this.beforeDeselectEvent.fire();
4396         
4397         var cfgSelected = DEF_CFG.SELECTED.key,
4398             selected = this.cfg.getProperty(cfgSelected),
4399             count = selected.length,
4400             sel = selected.concat();
4401
4402         if (this.parent) {
4403             this.parent.cfg.setProperty(cfgSelected, []);
4404         } else {
4405             this.cfg.setProperty(cfgSelected, []);
4406         }
4407         
4408         if (count > 0) {
4409             this.deselectEvent.fire(sel);
4410         }
4411     
4412         return this.getSelectedDates();
4413     },
4414     
4415     // END SELECTION METHODS
4416     
4417     // BEGIN TYPE CONVERSION METHODS
4418     
4419     /**
4420     * Converts a date (either a JavaScript Date object, or a date string) to the internal data structure
4421     * used to represent dates: [[yyyy,mm,dd],[yyyy,mm,dd]].
4422     * @method _toFieldArray
4423     * @private
4424     * @param {String/Date/Date[]} date The date string of dates to deselect in the current calendar. Valid formats are
4425     *        individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
4426     *        Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
4427     *        This method can also take a JavaScript Date object or an array of Date objects. 
4428     * @return {Array[](Number[])} Array of date field arrays
4429     */
4430     _toFieldArray : function(date) {
4431         var returnDate = [];
4432     
4433         if (date instanceof Date) {
4434             returnDate = [[date.getFullYear(), date.getMonth()+1, date.getDate()]];
4435         } else if (Lang.isString(date)) {
4436             returnDate = this._parseDates(date);
4437         } else if (Lang.isArray(date)) {
4438             for (var i=0;i<date.length;++i) {
4439                 var d = date[i];
4440                 returnDate[returnDate.length] = [d.getFullYear(),d.getMonth()+1,d.getDate()];
4441             }
4442         }
4443         
4444         return returnDate;
4445     },
4446     
4447     /**
4448     * Converts a date field array [yyyy,mm,dd] to a JavaScript Date object. The date field array
4449     * is the format in which dates are as provided as arguments to selectEvent and deselectEvent listeners.
4450     * 
4451     * @method toDate
4452     * @param {Number[]} dateFieldArray The date field array to convert to a JavaScript Date.
4453     * @return {Date} JavaScript Date object representing the date field array.
4454     */
4455     toDate : function(dateFieldArray) {
4456         return this._toDate(dateFieldArray);
4457     },
4458     
4459     /**
4460     * Converts a date field array [yyyy,mm,dd] to a JavaScript Date object.
4461     * @method _toDate
4462     * @private
4463     * @deprecated Made public, toDate 
4464     * @param {Number[]}  dateFieldArray The date field array to convert to a JavaScript Date.
4465     * @return {Date} JavaScript Date object representing the date field array
4466     */
4467     _toDate : function(dateFieldArray) {
4468         if (dateFieldArray instanceof Date) {
4469             return dateFieldArray;
4470         } else {
4471             return DateMath.getDate(dateFieldArray[0],dateFieldArray[1]-1,dateFieldArray[2]);
4472         }
4473     },
4474     
4475     // END TYPE CONVERSION METHODS 
4476     
4477     // BEGIN UTILITY METHODS
4478     
4479     /**
4480     * Determines if 2 field arrays are equal.
4481     * @method _fieldArraysAreEqual
4482     * @private
4483     * @param {Number[]} array1 The first date field array to compare
4484     * @param {Number[]} array2 The first date field array to compare
4485     * @return {Boolean} The boolean that represents the equality of the two arrays
4486     */
4487     _fieldArraysAreEqual : function(array1, array2) {
4488         var match = false;
4489     
4490         if (array1[0]==array2[0]&&array1[1]==array2[1]&&array1[2]==array2[2]) {
4491             match=true; 
4492         }
4493     
4494         return match;
4495     },
4496     
4497     /**
4498     * Gets the index of a date field array [yyyy,mm,dd] in the current list of selected dates.
4499     * @method _indexOfSelectedFieldArray
4500     * @private
4501     * @param {Number[]}  find The date field array to search for
4502     * @return {Number}   The index of the date field array within the collection of selected dates.
4503     *        -1 will be returned if the date is not found.
4504     */
4505     _indexOfSelectedFieldArray : function(find) {
4506         var selected = -1,
4507             seldates = this.cfg.getProperty(DEF_CFG.SELECTED.key);
4508     
4509         for (var s=0;s<seldates.length;++s) {
4510             var sArray = seldates[s];
4511             if (find[0]==sArray[0]&&find[1]==sArray[1]&&find[2]==sArray[2]) {
4512                 selected = s;
4513                 break;
4514             }
4515         }
4516     
4517         return selected;
4518     },
4519     
4520     /**
4521     * Determines whether a given date is OOM (out of month).
4522     * @method isDateOOM
4523     * @param {Date} date The JavaScript Date object for which to check the OOM status
4524     * @return {Boolean} true if the date is OOM
4525     */
4526     isDateOOM : function(date) {
4527         return (date.getMonth() != this.cfg.getProperty(DEF_CFG.PAGEDATE.key).getMonth());
4528     },
4529     
4530     /**
4531     * Determines whether a given date is OOB (out of bounds - less than the mindate or more than the maxdate).
4532     *
4533     * @method isDateOOB
4534     * @param {Date} date The JavaScript Date object for which to check the OOB status
4535     * @return {Boolean} true if the date is OOB
4536     */
4537     isDateOOB : function(date) {
4538         var minDate = this.cfg.getProperty(DEF_CFG.MINDATE.key),
4539             maxDate = this.cfg.getProperty(DEF_CFG.MAXDATE.key),
4540             dm = DateMath;
4541         
4542         if (minDate) {
4543             minDate = dm.clearTime(minDate);
4544         } 
4545         if (maxDate) {
4546             maxDate = dm.clearTime(maxDate);
4547         }
4548     
4549         var clearedDate = new Date(date.getTime());
4550         clearedDate = dm.clearTime(clearedDate);
4551     
4552         return ((minDate && clearedDate.getTime() < minDate.getTime()) || (maxDate && clearedDate.getTime() > maxDate.getTime()));
4553     },
4554     
4555     /**
4556      * Parses a pagedate configuration property value. The value can either be specified as a string of form "mm/yyyy" or a Date object 
4557      * and is parsed into a Date object normalized to the first day of the month. If no value is passed in, the month and year from today's date are used to create the Date object 
4558      * @method _parsePageDate
4559      * @private
4560      * @param {Date|String} date Pagedate value which needs to be parsed
4561      * @return {Date} The Date object representing the pagedate
4562      */
4563     _parsePageDate : function(date) {
4564         var parsedDate;
4565
4566         if (date) {
4567             if (date instanceof Date) {
4568                 parsedDate = DateMath.findMonthStart(date);
4569             } else {
4570                 var month, year, aMonthYear;
4571                 aMonthYear = date.split(this.cfg.getProperty(DEF_CFG.DATE_FIELD_DELIMITER.key));
4572                 month = parseInt(aMonthYear[this.cfg.getProperty(DEF_CFG.MY_MONTH_POSITION.key)-1], 10)-1;
4573                 year = parseInt(aMonthYear[this.cfg.getProperty(DEF_CFG.MY_YEAR_POSITION.key)-1], 10) - this.Locale.YEAR_OFFSET;
4574
4575                 parsedDate = DateMath.getDate(year, month, 1);
4576             }
4577         } else {
4578             parsedDate = DateMath.getDate(this.today.getFullYear(), this.today.getMonth(), 1);
4579         }
4580         return parsedDate;
4581     },
4582     
4583     // END UTILITY METHODS
4584     
4585     // BEGIN EVENT HANDLERS
4586     
4587     /**
4588     * Event executed before a date is selected in the calendar widget.
4589     * @deprecated Event handlers for this event should be susbcribed to beforeSelectEvent.
4590     */
4591     onBeforeSelect : function() {
4592         if (this.cfg.getProperty(DEF_CFG.MULTI_SELECT.key) === false) {
4593             if (this.parent) {
4594                 this.parent.callChildFunction("clearAllBodyCellStyles", this.Style.CSS_CELL_SELECTED);
4595                 this.parent.deselectAll();
4596             } else {
4597                 this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);
4598                 this.deselectAll();
4599             }
4600         }
4601     },
4602     
4603     /**
4604     * Event executed when a date is selected in the calendar widget.
4605     * @param {Array} selected An array of date field arrays representing which date or dates were selected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]
4606     * @deprecated Event handlers for this event should be susbcribed to selectEvent.
4607     */
4608     onSelect : function(selected) { },
4609     
4610     /**
4611     * Event executed before a date is deselected in the calendar widget.
4612     * @deprecated Event handlers for this event should be susbcribed to beforeDeselectEvent.
4613     */
4614     onBeforeDeselect : function() { },
4615     
4616     /**
4617     * Event executed when a date is deselected in the calendar widget.
4618     * @param {Array} selected An array of date field arrays representing which date or dates were deselected. Example: [ [2006,8,6],[2006,8,7],[2006,8,8] ]
4619     * @deprecated Event handlers for this event should be susbcribed to deselectEvent.
4620     */
4621     onDeselect : function(deselected) { },
4622     
4623     /**
4624     * Event executed when the user navigates to a different calendar page.
4625     * @deprecated Event handlers for this event should be susbcribed to changePageEvent.
4626     */
4627     onChangePage : function() {
4628         this.render();
4629     },
4630
4631     /**
4632     * Event executed when the calendar widget is rendered.
4633     * @deprecated Event handlers for this event should be susbcribed to renderEvent.
4634     */
4635     onRender : function() { },
4636
4637     /**
4638     * Event executed when the calendar widget is reset to its original state.
4639     * @deprecated Event handlers for this event should be susbcribed to resetEvemt.
4640     */
4641     onReset : function() { this.render(); },
4642
4643     /**
4644     * Event executed when the calendar widget is completely cleared to the current month with no selections.
4645     * @deprecated Event handlers for this event should be susbcribed to clearEvent.
4646     */
4647     onClear : function() { this.render(); },
4648     
4649     /**
4650     * Validates the calendar widget. This method has no default implementation
4651     * and must be extended by subclassing the widget.
4652     * @return Should return true if the widget validates, and false if
4653     * it doesn't.
4654     * @type Boolean
4655     */
4656     validate : function() { return true; },
4657     
4658     // END EVENT HANDLERS
4659     
4660     // BEGIN DATE PARSE METHODS
4661     
4662     /**
4663     * Converts a date string to a date field array
4664     * @private
4665     * @param {String} sDate   Date string. Valid formats are mm/dd and mm/dd/yyyy.
4666     * @return    A date field array representing the string passed to the method
4667     * @type Array[](Number[])
4668     */
4669     _parseDate : function(sDate) {
4670         var aDate = sDate.split(this.Locale.DATE_FIELD_DELIMITER),
4671             rArray;
4672
4673         if (aDate.length == 2) {
4674             rArray = [aDate[this.Locale.MD_MONTH_POSITION-1],aDate[this.Locale.MD_DAY_POSITION-1]];
4675             rArray.type = Calendar.MONTH_DAY;
4676         } else {
4677             rArray = [aDate[this.Locale.MDY_YEAR_POSITION-1] - this.Locale.YEAR_OFFSET, aDate[this.Locale.MDY_MONTH_POSITION-1],aDate[this.Locale.MDY_DAY_POSITION-1]];
4678             rArray.type = Calendar.DATE;
4679         }
4680
4681         for (var i=0;i<rArray.length;i++) {
4682             rArray[i] = parseInt(rArray[i], 10);
4683         }
4684     
4685         return rArray;
4686     },
4687     
4688     /**
4689     * Converts a multi or single-date string to an array of date field arrays
4690     * @private
4691     * @param {String} sDates  Date string with one or more comma-delimited dates. Valid formats are mm/dd, mm/dd/yyyy, mm/dd/yyyy-mm/dd/yyyy
4692     * @return       An array of date field arrays
4693     * @type Array[](Number[])
4694     */
4695     _parseDates : function(sDates) {
4696         var aReturn = [],
4697             aDates = sDates.split(this.Locale.DATE_DELIMITER);
4698         
4699         for (var d=0;d<aDates.length;++d) {
4700             var sDate = aDates[d];
4701     
4702             if (sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER) != -1) {
4703                 // This is a range
4704                 var aRange = sDate.split(this.Locale.DATE_RANGE_DELIMITER),
4705                     dateStart = this._parseDate(aRange[0]),
4706                     dateEnd = this._parseDate(aRange[1]),
4707                     fullRange = this._parseRange(dateStart, dateEnd);
4708
4709                 aReturn = aReturn.concat(fullRange);
4710             } else {
4711                 // This is not a range
4712                 var aDate = this._parseDate(sDate);
4713                 aReturn.push(aDate);
4714             }
4715         }
4716         return aReturn;
4717     },
4718     
4719     /**
4720     * Converts a date range to the full list of included dates
4721     * @private
4722     * @param {Number[]} startDate Date field array representing the first date in the range
4723     * @param {Number[]} endDate  Date field array representing the last date in the range
4724     * @return       An array of date field arrays
4725     * @type Array[](Number[])
4726     */
4727     _parseRange : function(startDate, endDate) {
4728         var dCurrent = DateMath.add(DateMath.getDate(startDate[0],startDate[1]-1,startDate[2]),DateMath.DAY,1),
4729             dEnd     = DateMath.getDate(endDate[0],  endDate[1]-1,  endDate[2]),
4730             results = [];
4731
4732         results.push(startDate);
4733         while (dCurrent.getTime() <= dEnd.getTime()) {
4734             results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);
4735             dCurrent = DateMath.add(dCurrent,DateMath.DAY,1);
4736         }
4737         return results;
4738     },
4739     
4740     // END DATE PARSE METHODS
4741     
4742     // BEGIN RENDERER METHODS
4743     
4744     /**
4745     * Resets the render stack of the current calendar to its original pre-render value.
4746     */
4747     resetRenderers : function() {
4748         this.renderStack = this._renderStack.concat();
4749     },
4750     
4751     /**
4752      * Removes all custom renderers added to the Calendar through the addRenderer, addMonthRenderer and 
4753      * addWeekdayRenderer methods. Calendar's render method needs to be called after removing renderers 
4754      * to re-render the Calendar without custom renderers applied.
4755      */
4756     removeRenderers : function() {
4757         this._renderStack = [];
4758         this.renderStack = [];
4759     },
4760
4761     /**
4762     * Clears the inner HTML, CSS class and style information from the specified cell.
4763     * @method clearElement
4764     * @param {HTMLTableCellElement} cell The cell to clear
4765     */ 
4766     clearElement : function(cell) {
4767         cell.innerHTML = "&#160;";
4768         cell.className="";
4769     },
4770     
4771     /**
4772     * Adds a renderer to the render stack. The function reference passed to this method will be executed
4773     * when a date cell matches the conditions specified in the date string for this renderer.
4774     * @method addRenderer
4775     * @param {String} sDates  A date string to associate with the specified renderer. Valid formats
4776     *         include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)
4777     * @param {Function} fnRender The function executed to render cells that match the render rules for this renderer.
4778     */
4779     addRenderer : function(sDates, fnRender) {
4780         var aDates = this._parseDates(sDates);
4781         for (var i=0;i<aDates.length;++i) {
4782             var aDate = aDates[i];
4783         
4784             if (aDate.length == 2) { // this is either a range or a month/day combo
4785                 if (aDate[0] instanceof Array) { // this is a range
4786                     this._addRenderer(Calendar.RANGE,aDate,fnRender);
4787                 } else { // this is a month/day combo
4788                     this._addRenderer(Calendar.MONTH_DAY,aDate,fnRender);
4789                 }
4790             } else if (aDate.length == 3) {
4791                 this._addRenderer(Calendar.DATE,aDate,fnRender);
4792             }
4793         }
4794     },
4795     
4796     /**
4797     * The private method used for adding cell renderers to the local render stack.
4798     * This method is called by other methods that set the renderer type prior to the method call.
4799     * @method _addRenderer
4800     * @private
4801     * @param {String} type  The type string that indicates the type of date renderer being added.
4802     *         Values are YAHOO.widget.Calendar.DATE, YAHOO.widget.Calendar.MONTH_DAY, YAHOO.widget.Calendar.WEEKDAY,
4803     *         YAHOO.widget.Calendar.RANGE, YAHOO.widget.Calendar.MONTH
4804     * @param {Array}  aDates  An array of dates used to construct the renderer. The format varies based
4805     *         on the renderer type
4806     * @param {Function} fnRender The function executed to render cells that match the render rules for this renderer.
4807     */
4808     _addRenderer : function(type, aDates, fnRender) {
4809         var add = [type,aDates,fnRender];
4810         this.renderStack.unshift(add); 
4811         this._renderStack = this.renderStack.concat();
4812     },
4813
4814     /**
4815     * Adds a month to the render stack. The function reference passed to this method will be executed
4816     * when a date cell matches the month passed to this method.
4817     * @method addMonthRenderer
4818     * @param {Number} month  The month (1-12) to associate with this renderer
4819     * @param {Function} fnRender The function executed to render cells that match the render rules for this renderer.
4820     */
4821     addMonthRenderer : function(month, fnRender) {
4822         this._addRenderer(Calendar.MONTH,[month],fnRender);
4823     },
4824
4825     /**
4826     * Adds a weekday to the render stack. The function reference passed to this method will be executed
4827     * when a date cell matches the weekday passed to this method.
4828     * @method addWeekdayRenderer
4829     * @param {Number} weekday  The weekday (Sunday = 1, Monday = 2 ... Saturday = 7) to associate with this renderer
4830     * @param {Function} fnRender The function executed to render cells that match the render rules for this renderer.
4831     */
4832     addWeekdayRenderer : function(weekday, fnRender) {
4833         this._addRenderer(Calendar.WEEKDAY,[weekday],fnRender);
4834     },
4835
4836     // END RENDERER METHODS
4837     
4838     // BEGIN CSS METHODS
4839     
4840     /**
4841     * Removes all styles from all body cells in the current calendar table.
4842     * @method clearAllBodyCellStyles
4843     * @param {style} style The CSS class name to remove from all calendar body cells
4844     */
4845     clearAllBodyCellStyles : function(style) {
4846         for (var c=0;c<this.cells.length;++c) {
4847             Dom.removeClass(this.cells[c],style);
4848         }
4849     },
4850     
4851     // END CSS METHODS
4852     
4853     // BEGIN GETTER/SETTER METHODS
4854     /**
4855     * Sets the calendar's month explicitly
4856     * @method setMonth
4857     * @param {Number} month  The numeric month, from 0 (January) to 11 (December)
4858     */
4859     setMonth : function(month) {
4860         var cfgPageDate = DEF_CFG.PAGEDATE.key,
4861             current = this.cfg.getProperty(cfgPageDate);
4862         current.setMonth(parseInt(month, 10));
4863         this.cfg.setProperty(cfgPageDate, current);
4864     },
4865
4866     /**
4867     * Sets the calendar's year explicitly.
4868     * @method setYear
4869     * @param {Number} year  The numeric 4-digit year
4870     */
4871     setYear : function(year) {
4872         var cfgPageDate = DEF_CFG.PAGEDATE.key,
4873             current = this.cfg.getProperty(cfgPageDate);
4874
4875         current.setFullYear(parseInt(year, 10) - this.Locale.YEAR_OFFSET);
4876         this.cfg.setProperty(cfgPageDate, current);
4877     },
4878
4879     /**
4880     * Gets the list of currently selected dates from the calendar.
4881     * @method getSelectedDates
4882     * @return {Date[]} An array of currently selected JavaScript Date objects.
4883     */
4884     getSelectedDates : function() {
4885         var returnDates = [],
4886             selected = this.cfg.getProperty(DEF_CFG.SELECTED.key);
4887
4888         for (var d=0;d<selected.length;++d) {
4889             var dateArray = selected[d];
4890
4891             var date = DateMath.getDate(dateArray[0],dateArray[1]-1,dateArray[2]);
4892             returnDates.push(date);
4893         }
4894
4895         returnDates.sort( function(a,b) { return a-b; } );
4896         return returnDates;
4897     },
4898
4899     /// END GETTER/SETTER METHODS ///
4900     
4901     /**
4902     * Hides the Calendar's outer container from view.
4903     * @method hide
4904     */
4905     hide : function() {
4906         if (this.beforeHideEvent.fire()) {
4907             this.oDomContainer.style.display = "none";
4908             this.hideEvent.fire();
4909         }
4910     },
4911
4912     /**
4913     * Shows the Calendar's outer container.
4914     * @method show
4915     */
4916     show : function() {
4917         if (this.beforeShowEvent.fire()) {
4918             this.oDomContainer.style.display = "block";
4919             this.showEvent.fire();
4920         }
4921     },
4922
4923     /**
4924     * Returns a string representing the current browser.
4925     * @deprecated As of 2.3.0, environment information is available in YAHOO.env.ua
4926     * @see YAHOO.env.ua
4927     * @property browser
4928     * @type String
4929     */
4930     browser : (function() {
4931                 var ua = navigator.userAgent.toLowerCase();
4932                       if (ua.indexOf('opera')!=-1) { // Opera (check first in case of spoof)
4933                          return 'opera';
4934                       } else if (ua.indexOf('msie 7')!=-1) { // IE7
4935                          return 'ie7';
4936                       } else if (ua.indexOf('msie') !=-1) { // IE
4937                          return 'ie';
4938                       } else if (ua.indexOf('safari')!=-1) { // Safari (check before Gecko because it includes "like Gecko")
4939                          return 'safari';
4940                       } else if (ua.indexOf('gecko') != -1) { // Gecko
4941                          return 'gecko';
4942                       } else {
4943                          return false;
4944                       }
4945                 })(),
4946     /**
4947     * Returns a string representation of the object.
4948     * @method toString
4949     * @return {String} A string representation of the Calendar object.
4950     */
4951     toString : function() {
4952         return "Calendar " + this.id;
4953     },
4954
4955     /**
4956      * Destroys the Calendar instance. The method will remove references
4957      * to HTML elements, remove any event listeners added by the Calendar,
4958      * and destroy the Config and CalendarNavigator instances it has created.
4959      *
4960      * @method destroy
4961      */
4962     destroy : function() {
4963
4964         if (this.beforeDestroyEvent.fire()) {
4965             var cal = this;
4966
4967             // Child objects
4968             if (cal.navigator) {
4969                 cal.navigator.destroy();
4970             }
4971
4972             if (cal.cfg) {
4973                 cal.cfg.destroy();
4974             }
4975
4976             // DOM event listeners
4977             Event.purgeElement(cal.oDomContainer, true);
4978
4979             // Generated markup/DOM - Not removing the container DIV since we didn't create it.
4980             Dom.removeClass(cal.oDomContainer, cal.Style.CSS_WITH_TITLE);
4981             Dom.removeClass(cal.oDomContainer, cal.Style.CSS_CONTAINER);
4982             Dom.removeClass(cal.oDomContainer, cal.Style.CSS_SINGLE);
4983             cal.oDomContainer.innerHTML = "";
4984
4985             // JS-to-DOM references
4986             cal.oDomContainer = null;
4987             cal.cells = null;
4988
4989             this.destroyEvent.fire();
4990         }
4991     }
4992 };
4993
4994 YAHOO.widget.Calendar = Calendar;
4995
4996 /**
4997 * @namespace YAHOO.widget
4998 * @class Calendar_Core
4999 * @extends YAHOO.widget.Calendar
5000 * @deprecated The old Calendar_Core class is no longer necessary.
5001 */
5002 YAHOO.widget.Calendar_Core = YAHOO.widget.Calendar;
5003
5004 YAHOO.widget.Cal_Core = YAHOO.widget.Calendar;
5005
5006 })();
5007 (function() {
5008
5009     var Dom = YAHOO.util.Dom,
5010         DateMath = YAHOO.widget.DateMath,
5011         Event = YAHOO.util.Event,
5012         Lang = YAHOO.lang,
5013         Calendar = YAHOO.widget.Calendar;
5014
5015 /**
5016 * YAHOO.widget.CalendarGroup is a special container class for YAHOO.widget.Calendar. This class facilitates
5017 * the ability to have multi-page calendar views that share a single dataset and are
5018 * dependent on each other.
5019 *
5020 * The calendar group instance will refer to each of its elements using a 0-based index.
5021 * For example, to construct the placeholder for a calendar group widget with id "cal1" and
5022 * containerId of "cal1Container", the markup would be as follows:
5023 *   <xmp>
5024 *       <div id="cal1Container_0"></div>
5025 *       <div id="cal1Container_1"></div>
5026 *   </xmp>
5027 * The tables for the calendars ("cal1_0" and "cal1_1") will be inserted into those containers.
5028 *
5029 * <p>
5030 * <strong>NOTE: As of 2.4.0, the constructor's ID argument is optional.</strong>
5031 * The CalendarGroup can be constructed by simply providing a container ID string, 
5032 * or a reference to a container DIV HTMLElement (the element needs to exist 
5033 * in the document).
5034
5035 * E.g.:
5036 *   <xmp>
5037 *       var c = new YAHOO.widget.CalendarGroup("calContainer", configOptions);
5038 *   </xmp>
5039 * or:
5040 *   <xmp>
5041 *       var containerDiv = YAHOO.util.Dom.get("calContainer");
5042 *       var c = new YAHOO.widget.CalendarGroup(containerDiv, configOptions);
5043 *   </xmp>
5044 * </p>
5045 * <p>
5046 * If not provided, the ID will be generated from the container DIV ID by adding an "_t" suffix.
5047 * For example if an ID is not provided, and the container's ID is "calContainer", the CalendarGroup's ID will be set to "calContainer_t".
5048 * </p>
5049
5050 * @namespace YAHOO.widget
5051 * @class CalendarGroup
5052 * @constructor
5053 * @param {String} id optional The id of the table element that will represent the CalendarGroup widget. As of 2.4.0, this argument is optional.
5054 * @param {String | HTMLElement} container The id of the container div element that will wrap the CalendarGroup table, or a reference to a DIV element which exists in the document.
5055 * @param {Object} config optional The configuration object containing the initial configuration values for the CalendarGroup.
5056 */
5057 function CalendarGroup(id, containerId, config) {
5058     if (arguments.length > 0) {
5059         this.init.apply(this, arguments);
5060     }
5061 }
5062
5063 /**
5064 * The set of default Config property keys and values for the CalendarGroup.
5065
5066 * <p>
5067 * NOTE: This property is made public in order to allow users to change 
5068 * the default values of configuration properties. Users should not 
5069 * modify the key string, unless they are overriding the Calendar implementation
5070 * </p>
5071 *
5072 * @property YAHOO.widget.CalendarGroup.DEFAULT_CONFIG
5073 * @static
5074 * @type Object An object with key/value pairs, the key being the 
5075 * uppercase configuration property name and the value being an objec 
5076 * literal with a key string property, and a value property, specifying the 
5077 * default value of the property 
5078 */
5079
5080 /**
5081 * The set of default Config property keys and values for the CalendarGroup
5082 * @property YAHOO.widget.CalendarGroup._DEFAULT_CONFIG
5083 * @deprecated Made public. See the public DEFAULT_CONFIG property for details
5084 * @private
5085 * @static
5086 * @type Object
5087 */
5088 CalendarGroup.DEFAULT_CONFIG = CalendarGroup._DEFAULT_CONFIG = Calendar.DEFAULT_CONFIG;
5089 CalendarGroup.DEFAULT_CONFIG.PAGES = {key:"pages", value:2};
5090
5091 var DEF_CFG = CalendarGroup.DEFAULT_CONFIG;
5092
5093 CalendarGroup.prototype = {
5094
5095     /**
5096     * Initializes the calendar group. All subclasses must call this method in order for the
5097     * group to be initialized properly.
5098     * @method init
5099     * @param {String} id optional The id of the table element that will represent the CalendarGroup widget. As of 2.4.0, this argument is optional.
5100     * @param {String | HTMLElement} container The id of the container div element that will wrap the CalendarGroup table, or a reference to a DIV element which exists in the document.
5101     * @param {Object} config optional The configuration object containing the initial configuration values for the CalendarGroup.
5102     */
5103     init : function(id, container, config) {
5104
5105         // Normalize 2.4.0, pre 2.4.0 args
5106         var nArgs = this._parseArgs(arguments);
5107
5108         id = nArgs.id;
5109         container = nArgs.container;
5110         config = nArgs.config;
5111
5112         this.oDomContainer = Dom.get(container);
5113
5114         if (!this.oDomContainer.id) {
5115             this.oDomContainer.id = Dom.generateId();
5116         }
5117         if (!id) {
5118             id = this.oDomContainer.id + "_t";
5119         }
5120
5121         /**
5122         * The unique id associated with the CalendarGroup
5123         * @property id
5124         * @type String
5125         */
5126         this.id = id;
5127
5128         /**
5129         * The unique id associated with the CalendarGroup container
5130         * @property containerId
5131         * @type String
5132         */
5133         this.containerId = this.oDomContainer.id;
5134
5135         this.initEvents();
5136         this.initStyles();
5137
5138         /**
5139         * The collection of Calendar pages contained within the CalendarGroup
5140         * @property pages
5141         * @type YAHOO.widget.Calendar[]
5142         */
5143         this.pages = [];
5144
5145         Dom.addClass(this.oDomContainer, CalendarGroup.CSS_CONTAINER);
5146         Dom.addClass(this.oDomContainer, CalendarGroup.CSS_MULTI_UP);
5147
5148         /**
5149         * The Config object used to hold the configuration variables for the CalendarGroup
5150         * @property cfg
5151         * @type YAHOO.util.Config
5152         */
5153         this.cfg = new YAHOO.util.Config(this);
5154
5155         /**
5156         * The local object which contains the CalendarGroup's options
5157         * @property Options
5158         * @type Object
5159         */
5160         this.Options = {};
5161
5162         /**
5163         * The local object which contains the CalendarGroup's locale settings
5164         * @property Locale
5165         * @type Object
5166         */
5167         this.Locale = {};
5168
5169         this.setupConfig();
5170
5171         if (config) {
5172             this.cfg.applyConfig(config, true);
5173         }
5174
5175         this.cfg.fireQueue();
5176
5177         // OPERA HACK FOR MISWRAPPED FLOATS
5178         if (YAHOO.env.ua.opera){
5179             this.renderEvent.subscribe(this._fixWidth, this, true);
5180             this.showEvent.subscribe(this._fixWidth, this, true);
5181         }
5182
5183     },
5184
5185     setupConfig : function() {
5186
5187         var cfg = this.cfg;
5188
5189         /**
5190         * The number of pages to include in the CalendarGroup. This value can only be set once, in the CalendarGroup's constructor arguments.
5191         * @config pages
5192         * @type Number
5193         * @default 2
5194         */
5195         cfg.addProperty(DEF_CFG.PAGES.key, { value:DEF_CFG.PAGES.value, validator:cfg.checkNumber, handler:this.configPages } );
5196
5197         /**
5198         * The positive or negative year offset from the Gregorian calendar year (assuming a January 1st rollover) to 
5199         * be used when displaying or parsing dates.  NOTE: All JS Date objects returned by methods, or expected as input by
5200         * methods will always represent the Gregorian year, in order to maintain date/month/week values.
5201         *
5202         * @config year_offset
5203         * @type Number
5204         * @default 0
5205         */
5206         cfg.addProperty(DEF_CFG.YEAR_OFFSET.key, { value:DEF_CFG.YEAR_OFFSET.value, handler: this.delegateConfig, supercedes:DEF_CFG.YEAR_OFFSET.supercedes, suppressEvent:true } );
5207
5208         /**
5209         * The date to use to represent "Today".
5210         *
5211         * @config today
5212         * @type Date
5213         * @default Today's date
5214         */
5215         cfg.addProperty(DEF_CFG.TODAY.key, { value: new Date(DEF_CFG.TODAY.value.getTime()), supercedes:DEF_CFG.TODAY.supercedes, handler: this.configToday, suppressEvent:false } );
5216
5217         /**
5218         * The month/year representing the current visible Calendar date (mm/yyyy)
5219         * @config pagedate
5220         * @type String | Date
5221         * @default Today's date
5222         */
5223         cfg.addProperty(DEF_CFG.PAGEDATE.key, { value: DEF_CFG.PAGEDATE.value || new Date(DEF_CFG.TODAY.value.getTime()), handler:this.configPageDate } );
5224
5225         /**
5226         * The date or range of dates representing the current Calendar selection
5227         *
5228         * @config selected
5229         * @type String
5230         * @default []
5231         */
5232         cfg.addProperty(DEF_CFG.SELECTED.key, { value:[], handler:this.configSelected } );
5233
5234         /**
5235         * The title to display above the CalendarGroup's month header
5236         * @config title
5237         * @type String
5238         * @default ""
5239         */
5240         cfg.addProperty(DEF_CFG.TITLE.key, { value:DEF_CFG.TITLE.value, handler:this.configTitle } );
5241
5242         /**
5243         * Whether or not a close button should be displayed for this CalendarGroup
5244         * @config close
5245         * @type Boolean
5246         * @default false
5247         */
5248         cfg.addProperty(DEF_CFG.CLOSE.key, { value:DEF_CFG.CLOSE.value, handler:this.configClose } );
5249
5250         /**
5251         * Whether or not an iframe shim should be placed under the Calendar to prevent select boxes from bleeding through in Internet Explorer 6 and below.
5252         * This property is enabled by default for IE6 and below. It is disabled by default for other browsers for performance reasons, but can be 
5253         * enabled if required.
5254         * 
5255         * @config iframe
5256         * @type Boolean
5257         * @default true for IE6 and below, false for all other browsers
5258         */
5259         cfg.addProperty(DEF_CFG.IFRAME.key, { value:DEF_CFG.IFRAME.value, handler:this.configIframe, validator:cfg.checkBoolean } );
5260
5261         /**
5262         * The minimum selectable date in the current Calendar (mm/dd/yyyy)
5263         * @config mindate
5264         * @type String | Date
5265         * @default null
5266         */
5267         cfg.addProperty(DEF_CFG.MINDATE.key, { value:DEF_CFG.MINDATE.value, handler:this.delegateConfig } );
5268
5269         /**
5270         * The maximum selectable date in the current Calendar (mm/dd/yyyy)
5271         * @config maxdate
5272         * @type String | Date
5273         * @default null
5274         */
5275         cfg.addProperty(DEF_CFG.MAXDATE.key, { value:DEF_CFG.MAXDATE.value, handler:this.delegateConfig  } );
5276
5277         // Options properties
5278
5279         /**
5280         * True if the Calendar should allow multiple selections. False by default.
5281         * @config MULTI_SELECT
5282         * @type Boolean
5283         * @default false
5284         */
5285         cfg.addProperty(DEF_CFG.MULTI_SELECT.key, { value:DEF_CFG.MULTI_SELECT.value, handler:this.delegateConfig, validator:cfg.checkBoolean } );
5286
5287         /**
5288         * The weekday the week begins on. Default is 0 (Sunday).
5289         * @config START_WEEKDAY
5290         * @type number
5291         * @default 0
5292         */ 
5293         cfg.addProperty(DEF_CFG.START_WEEKDAY.key, { value:DEF_CFG.START_WEEKDAY.value, handler:this.delegateConfig, validator:cfg.checkNumber  } );
5294         
5295         /**
5296         * True if the Calendar should show weekday labels. True by default.
5297         * @config SHOW_WEEKDAYS
5298         * @type Boolean
5299         * @default true
5300         */ 
5301         cfg.addProperty(DEF_CFG.SHOW_WEEKDAYS.key, { value:DEF_CFG.SHOW_WEEKDAYS.value, handler:this.delegateConfig, validator:cfg.checkBoolean } );
5302         
5303         /**
5304         * True if the Calendar should show week row headers. False by default.
5305         * @config SHOW_WEEK_HEADER
5306         * @type Boolean
5307         * @default false
5308         */ 
5309         cfg.addProperty(DEF_CFG.SHOW_WEEK_HEADER.key,{ value:DEF_CFG.SHOW_WEEK_HEADER.value, handler:this.delegateConfig, validator:cfg.checkBoolean } );
5310         
5311         /**
5312         * True if the Calendar should show week row footers. False by default.
5313         * @config SHOW_WEEK_FOOTER
5314         * @type Boolean
5315         * @default false
5316         */
5317         cfg.addProperty(DEF_CFG.SHOW_WEEK_FOOTER.key,{ value:DEF_CFG.SHOW_WEEK_FOOTER.value, handler:this.delegateConfig, validator:cfg.checkBoolean } );
5318         
5319         /**
5320         * True if the Calendar should suppress weeks that are not a part of the current month. False by default.
5321         * @config HIDE_BLANK_WEEKS
5322         * @type Boolean
5323         * @default false
5324         */  
5325         cfg.addProperty(DEF_CFG.HIDE_BLANK_WEEKS.key,{ value:DEF_CFG.HIDE_BLANK_WEEKS.value, handler:this.delegateConfig, validator:cfg.checkBoolean } );
5326         
5327         /**
5328         * The image that should be used for the left navigation arrow.
5329         * @config NAV_ARROW_LEFT
5330         * @type String
5331         * @deprecated You can customize the image by overriding the default CSS class for the left arrow - "calnavleft"
5332         * @default null
5333         */  
5334         cfg.addProperty(DEF_CFG.NAV_ARROW_LEFT.key, { value:DEF_CFG.NAV_ARROW_LEFT.value, handler:this.delegateConfig } );
5335         
5336         /**
5337         * The image that should be used for the right navigation arrow.
5338         * @config NAV_ARROW_RIGHT
5339         * @type String
5340         * @deprecated You can customize the image by overriding the default CSS class for the right arrow - "calnavright"
5341         * @default null
5342         */  
5343         cfg.addProperty(DEF_CFG.NAV_ARROW_RIGHT.key, { value:DEF_CFG.NAV_ARROW_RIGHT.value, handler:this.delegateConfig } );
5344     
5345         // Locale properties
5346         
5347         /**
5348         * The short month labels for the current locale.
5349         * @config MONTHS_SHORT
5350         * @type String[]
5351         * @default ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
5352         */
5353         cfg.addProperty(DEF_CFG.MONTHS_SHORT.key, { value:DEF_CFG.MONTHS_SHORT.value, handler:this.delegateConfig } );
5354         
5355         /**
5356         * The long month labels for the current locale.
5357         * @config MONTHS_LONG
5358         * @type String[]
5359         * @default ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
5360         */  
5361         cfg.addProperty(DEF_CFG.MONTHS_LONG.key,  { value:DEF_CFG.MONTHS_LONG.value, handler:this.delegateConfig } );
5362         
5363         /**
5364         * The 1-character weekday labels for the current locale.
5365         * @config WEEKDAYS_1CHAR
5366         * @type String[]
5367         * @default ["S", "M", "T", "W", "T", "F", "S"]
5368         */  
5369         cfg.addProperty(DEF_CFG.WEEKDAYS_1CHAR.key, { value:DEF_CFG.WEEKDAYS_1CHAR.value, handler:this.delegateConfig } );
5370         
5371         /**
5372         * The short weekday labels for the current locale.
5373         * @config WEEKDAYS_SHORT
5374         * @type String[]
5375         * @default ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
5376         */  
5377         cfg.addProperty(DEF_CFG.WEEKDAYS_SHORT.key, { value:DEF_CFG.WEEKDAYS_SHORT.value, handler:this.delegateConfig } );
5378         
5379         /**
5380         * The medium weekday labels for the current locale.
5381         * @config WEEKDAYS_MEDIUM
5382         * @type String[]
5383         * @default ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
5384         */  
5385         cfg.addProperty(DEF_CFG.WEEKDAYS_MEDIUM.key, { value:DEF_CFG.WEEKDAYS_MEDIUM.value, handler:this.delegateConfig } );
5386         
5387         /**
5388         * The long weekday labels for the current locale.
5389         * @config WEEKDAYS_LONG
5390         * @type String[]
5391         * @default ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
5392         */  
5393         cfg.addProperty(DEF_CFG.WEEKDAYS_LONG.key, { value:DEF_CFG.WEEKDAYS_LONG.value, handler:this.delegateConfig } );
5394     
5395         /**
5396         * The setting that determines which length of month labels should be used. Possible values are "short" and "long".
5397         * @config LOCALE_MONTHS
5398         * @type String
5399         * @default "long"
5400         */
5401         cfg.addProperty(DEF_CFG.LOCALE_MONTHS.key, { value:DEF_CFG.LOCALE_MONTHS.value, handler:this.delegateConfig } );
5402     
5403         /**
5404         * The setting that determines which length of weekday labels should be used. Possible values are "1char", "short", "medium", and "long".
5405         * @config LOCALE_WEEKDAYS
5406         * @type String
5407         * @default "short"
5408         */ 
5409         cfg.addProperty(DEF_CFG.LOCALE_WEEKDAYS.key, { value:DEF_CFG.LOCALE_WEEKDAYS.value, handler:this.delegateConfig } );
5410     
5411         /**
5412         * The value used to delimit individual dates in a date string passed to various Calendar functions.
5413         * @config DATE_DELIMITER
5414         * @type String
5415         * @default ","
5416         */
5417         cfg.addProperty(DEF_CFG.DATE_DELIMITER.key,  { value:DEF_CFG.DATE_DELIMITER.value, handler:this.delegateConfig } );
5418     
5419         /**
5420         * The value used to delimit date fields in a date string passed to various Calendar functions.
5421         * @config DATE_FIELD_DELIMITER
5422         * @type String
5423         * @default "/"
5424         */ 
5425         cfg.addProperty(DEF_CFG.DATE_FIELD_DELIMITER.key,{ value:DEF_CFG.DATE_FIELD_DELIMITER.value, handler:this.delegateConfig } );
5426     
5427         /**
5428         * The value used to delimit date ranges in a date string passed to various Calendar functions.
5429         * @config DATE_RANGE_DELIMITER
5430         * @type String
5431         * @default "-"
5432         */
5433         cfg.addProperty(DEF_CFG.DATE_RANGE_DELIMITER.key,{ value:DEF_CFG.DATE_RANGE_DELIMITER.value, handler:this.delegateConfig } );
5434     
5435         /**
5436         * The position of the month in a month/year date string
5437         * @config MY_MONTH_POSITION
5438         * @type Number
5439         * @default 1
5440         */
5441         cfg.addProperty(DEF_CFG.MY_MONTH_POSITION.key, { value:DEF_CFG.MY_MONTH_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } );
5442         
5443         /**
5444         * The position of the year in a month/year date string
5445         * @config MY_YEAR_POSITION
5446         * @type Number
5447         * @default 2
5448         */ 
5449         cfg.addProperty(DEF_CFG.MY_YEAR_POSITION.key, { value:DEF_CFG.MY_YEAR_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } );
5450         
5451         /**
5452         * The position of the month in a month/day date string
5453         * @config MD_MONTH_POSITION
5454         * @type Number
5455         * @default 1
5456         */ 
5457         cfg.addProperty(DEF_CFG.MD_MONTH_POSITION.key, { value:DEF_CFG.MD_MONTH_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } );
5458         
5459         /**
5460         * The position of the day in a month/year date string
5461         * @config MD_DAY_POSITION
5462         * @type Number
5463         * @default 2
5464         */ 
5465         cfg.addProperty(DEF_CFG.MD_DAY_POSITION.key,  { value:DEF_CFG.MD_DAY_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } );
5466         
5467         /**
5468         * The position of the month in a month/day/year date string
5469         * @config MDY_MONTH_POSITION
5470         * @type Number
5471         * @default 1
5472         */ 
5473         cfg.addProperty(DEF_CFG.MDY_MONTH_POSITION.key, { value:DEF_CFG.MDY_MONTH_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } );
5474         
5475         /**
5476         * The position of the day in a month/day/year date string
5477         * @config MDY_DAY_POSITION
5478         * @type Number
5479         * @default 2
5480         */ 
5481         cfg.addProperty(DEF_CFG.MDY_DAY_POSITION.key, { value:DEF_CFG.MDY_DAY_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } );
5482         
5483         /**
5484         * The position of the year in a month/day/year date string
5485         * @config MDY_YEAR_POSITION
5486         * @type Number
5487         * @default 3
5488         */ 
5489         cfg.addProperty(DEF_CFG.MDY_YEAR_POSITION.key, { value:DEF_CFG.MDY_YEAR_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } );
5490     
5491         /**
5492         * The position of the month in the month year label string used as the Calendar header
5493         * @config MY_LABEL_MONTH_POSITION
5494         * @type Number
5495         * @default 1
5496         */
5497         cfg.addProperty(DEF_CFG.MY_LABEL_MONTH_POSITION.key, { value:DEF_CFG.MY_LABEL_MONTH_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } );
5498     
5499         /**
5500         * The position of the year in the month year label string used as the Calendar header
5501         * @config MY_LABEL_YEAR_POSITION
5502         * @type Number
5503         * @default 2
5504         */
5505         cfg.addProperty(DEF_CFG.MY_LABEL_YEAR_POSITION.key, { value:DEF_CFG.MY_LABEL_YEAR_POSITION.value, handler:this.delegateConfig, validator:cfg.checkNumber } );
5506
5507         /**
5508         * The suffix used after the month when rendering the Calendar header
5509         * @config MY_LABEL_MONTH_SUFFIX
5510         * @type String
5511         * @default " "
5512         */
5513         cfg.addProperty(DEF_CFG.MY_LABEL_MONTH_SUFFIX.key, { value:DEF_CFG.MY_LABEL_MONTH_SUFFIX.value, handler:this.delegateConfig } );
5514         
5515         /**
5516         * The suffix used after the year when rendering the Calendar header
5517         * @config MY_LABEL_YEAR_SUFFIX
5518         * @type String
5519         * @default ""
5520         */
5521         cfg.addProperty(DEF_CFG.MY_LABEL_YEAR_SUFFIX.key, { value:DEF_CFG.MY_LABEL_YEAR_SUFFIX.value, handler:this.delegateConfig } );
5522
5523         /**
5524         * Configuration for the Month Year Navigation UI. By default it is disabled
5525         * @config NAV
5526         * @type Object
5527         * @default null
5528         */
5529         cfg.addProperty(DEF_CFG.NAV.key, { value:DEF_CFG.NAV.value, handler:this.configNavigator } );
5530
5531         /**
5532          * The map of UI strings which the CalendarGroup UI uses.
5533          *
5534          * @config strings
5535          * @type {Object}
5536          * @default An object with the properties shown below:
5537          *     <dl>
5538          *         <dt>previousMonth</dt><dd><em>String</em> : The string to use for the "Previous Month" navigation UI. Defaults to "Previous Month".</dd>
5539          *         <dt>nextMonth</dt><dd><em>String</em> : The string to use for the "Next Month" navigation UI. Defaults to "Next Month".</dd>
5540          *         <dt>close</dt><dd><em>String</em> : The string to use for the close button label. Defaults to "Close".</dd>
5541          *     </dl>
5542          */
5543         cfg.addProperty(DEF_CFG.STRINGS.key, { 
5544             value:DEF_CFG.STRINGS.value, 
5545             handler:this.configStrings, 
5546             validator: function(val) {
5547                 return Lang.isObject(val);
5548             },
5549             supercedes: DEF_CFG.STRINGS.supercedes
5550         });
5551     },
5552
5553     /**
5554     * Initializes CalendarGroup's built-in CustomEvents
5555     * @method initEvents
5556     */
5557     initEvents : function() {
5558
5559         var me = this,
5560             strEvent = "Event",
5561             CE = YAHOO.util.CustomEvent;
5562
5563         /**
5564         * Proxy subscriber to subscribe to the CalendarGroup's child Calendars' CustomEvents
5565         * @method sub
5566         * @private
5567         * @param {Function} fn The function to subscribe to this CustomEvent
5568         * @param {Object} obj The CustomEvent's scope object
5569         * @param {Boolean} bOverride Whether or not to apply scope correction
5570         */
5571         var sub = function(fn, obj, bOverride) {
5572             for (var p=0;p<me.pages.length;++p) {
5573                 var cal = me.pages[p];
5574                 cal[this.type + strEvent].subscribe(fn, obj, bOverride);
5575             }
5576         };
5577
5578         /**
5579         * Proxy unsubscriber to unsubscribe from the CalendarGroup's child Calendars' CustomEvents
5580         * @method unsub
5581         * @private
5582         * @param {Function} fn The function to subscribe to this CustomEvent
5583         * @param {Object} obj The CustomEvent's scope object
5584         */
5585         var unsub = function(fn, obj) {
5586             for (var p=0;p<me.pages.length;++p) {
5587                 var cal = me.pages[p];
5588                 cal[this.type + strEvent].unsubscribe(fn, obj);
5589             }
5590         };
5591
5592         var defEvents = Calendar._EVENT_TYPES;
5593
5594         /**
5595         * Fired before a date selection is made
5596         * @event beforeSelectEvent
5597         */
5598         me.beforeSelectEvent = new CE(defEvents.BEFORE_SELECT);
5599         me.beforeSelectEvent.subscribe = sub; me.beforeSelectEvent.unsubscribe = unsub;
5600
5601         /**
5602         * Fired when a date selection is made
5603         * @event selectEvent
5604         * @param {Array} Array of Date field arrays in the format [YYYY, MM, DD].
5605         */
5606         me.selectEvent = new CE(defEvents.SELECT); 
5607         me.selectEvent.subscribe = sub; me.selectEvent.unsubscribe = unsub;
5608
5609         /**
5610         * Fired before a date or set of dates is deselected
5611         * @event beforeDeselectEvent
5612         */
5613         me.beforeDeselectEvent = new CE(defEvents.BEFORE_DESELECT); 
5614         me.beforeDeselectEvent.subscribe = sub; me.beforeDeselectEvent.unsubscribe = unsub;
5615
5616         /**
5617         * Fired when a date or set of dates has been deselected
5618         * @event deselectEvent
5619         * @param {Array} Array of Date field arrays in the format [YYYY, MM, DD].
5620         */
5621         me.deselectEvent = new CE(defEvents.DESELECT); 
5622         me.deselectEvent.subscribe = sub; me.deselectEvent.unsubscribe = unsub;
5623         
5624         /**
5625         * Fired when the Calendar page is changed
5626         * @event changePageEvent
5627         */
5628         me.changePageEvent = new CE(defEvents.CHANGE_PAGE); 
5629         me.changePageEvent.subscribe = sub; me.changePageEvent.unsubscribe = unsub;
5630
5631         /**
5632         * Fired before the Calendar is rendered
5633         * @event beforeRenderEvent
5634         */
5635         me.beforeRenderEvent = new CE(defEvents.BEFORE_RENDER);
5636         me.beforeRenderEvent.subscribe = sub; me.beforeRenderEvent.unsubscribe = unsub;
5637     
5638         /**
5639         * Fired when the Calendar is rendered
5640         * @event renderEvent
5641         */
5642         me.renderEvent = new CE(defEvents.RENDER);
5643         me.renderEvent.subscribe = sub; me.renderEvent.unsubscribe = unsub;
5644     
5645         /**
5646         * Fired when the Calendar is reset
5647         * @event resetEvent
5648         */
5649         me.resetEvent = new CE(defEvents.RESET); 
5650         me.resetEvent.subscribe = sub; me.resetEvent.unsubscribe = unsub;
5651     
5652         /**
5653         * Fired when the Calendar is cleared
5654         * @event clearEvent
5655         */
5656         me.clearEvent = new CE(defEvents.CLEAR);
5657         me.clearEvent.subscribe = sub; me.clearEvent.unsubscribe = unsub;
5658
5659         /**
5660         * Fired just before the CalendarGroup is to be shown
5661         * @event beforeShowEvent
5662         */
5663         me.beforeShowEvent = new CE(defEvents.BEFORE_SHOW);
5664     
5665         /**
5666         * Fired after the CalendarGroup is shown
5667         * @event showEvent
5668         */
5669         me.showEvent = new CE(defEvents.SHOW);
5670     
5671         /**
5672         * Fired just before the CalendarGroup is to be hidden
5673         * @event beforeHideEvent
5674         */
5675         me.beforeHideEvent = new CE(defEvents.BEFORE_HIDE);
5676     
5677         /**
5678         * Fired after the CalendarGroup is hidden
5679         * @event hideEvent
5680         */
5681         me.hideEvent = new CE(defEvents.HIDE);
5682
5683         /**
5684         * Fired just before the CalendarNavigator is to be shown
5685         * @event beforeShowNavEvent
5686         */
5687         me.beforeShowNavEvent = new CE(defEvents.BEFORE_SHOW_NAV);
5688     
5689         /**
5690         * Fired after the CalendarNavigator is shown
5691         * @event showNavEvent
5692         */
5693         me.showNavEvent = new CE(defEvents.SHOW_NAV);
5694     
5695         /**
5696         * Fired just before the CalendarNavigator is to be hidden
5697         * @event beforeHideNavEvent
5698         */
5699         me.beforeHideNavEvent = new CE(defEvents.BEFORE_HIDE_NAV);
5700
5701         /**
5702         * Fired after the CalendarNavigator is hidden
5703         * @event hideNavEvent
5704         */
5705         me.hideNavEvent = new CE(defEvents.HIDE_NAV);
5706
5707         /**
5708         * Fired just before the CalendarNavigator is to be rendered
5709         * @event beforeRenderNavEvent
5710         */
5711         me.beforeRenderNavEvent = new CE(defEvents.BEFORE_RENDER_NAV);
5712
5713         /**
5714         * Fired after the CalendarNavigator is rendered
5715         * @event renderNavEvent
5716         */
5717         me.renderNavEvent = new CE(defEvents.RENDER_NAV);
5718
5719         /**
5720         * Fired just before the CalendarGroup is to be destroyed
5721         * @event beforeDestroyEvent
5722         */
5723         me.beforeDestroyEvent = new CE(defEvents.BEFORE_DESTROY);
5724
5725         /**
5726         * Fired after the CalendarGroup is destroyed. This event should be used
5727         * for notification only. When this event is fired, important CalendarGroup instance
5728         * properties, dom references and event listeners have already been 
5729         * removed/dereferenced, and hence the CalendarGroup instance is not in a usable 
5730         * state.
5731         *
5732         * @event destroyEvent
5733         */
5734         me.destroyEvent = new CE(defEvents.DESTROY);
5735     },
5736     
5737     /**
5738     * The default Config handler for the "pages" property
5739     * @method configPages
5740     * @param {String} type The CustomEvent type (usually the property name)
5741     * @param {Object[]} args The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
5742     * @param {Object} obj The scope object. For configuration handlers, this will usually equal the owner.
5743     */
5744     configPages : function(type, args, obj) {
5745         var pageCount = args[0],
5746             cfgPageDate = DEF_CFG.PAGEDATE.key,
5747             sep = "_",
5748             caldate,
5749             firstPageDate = null,
5750             groupCalClass = "groupcal",
5751             firstClass = "first-of-type",
5752             lastClass = "last-of-type";
5753
5754         for (var p=0;p<pageCount;++p) {
5755             var calId = this.id + sep + p,
5756                 calContainerId = this.containerId + sep + p,
5757                 childConfig = this.cfg.getConfig();
5758
5759             childConfig.close = false;
5760             childConfig.title = false;
5761             childConfig.navigator = null;
5762
5763             if (p > 0) {
5764                 caldate = new Date(firstPageDate);
5765                 this._setMonthOnDate(caldate, caldate.getMonth() + p);
5766                 childConfig.pageDate = caldate;
5767             }
5768
5769             var cal = this.constructChild(calId, calContainerId, childConfig);
5770
5771             Dom.removeClass(cal.oDomContainer, this.Style.CSS_SINGLE);
5772             Dom.addClass(cal.oDomContainer, groupCalClass);
5773
5774             if (p===0) {
5775                 firstPageDate = cal.cfg.getProperty(cfgPageDate);
5776                 Dom.addClass(cal.oDomContainer, firstClass);
5777             }
5778     
5779             if (p==(pageCount-1)) {
5780                 Dom.addClass(cal.oDomContainer, lastClass);
5781             }
5782     
5783             cal.parent = this;
5784             cal.index = p; 
5785     
5786             this.pages[this.pages.length] = cal;
5787         }
5788     },
5789     
5790     /**
5791     * The default Config handler for the "pagedate" property
5792     * @method configPageDate
5793     * @param {String} type The CustomEvent type (usually the property name)
5794     * @param {Object[]} args The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
5795     * @param {Object} obj The scope object. For configuration handlers, this will usually equal the owner.
5796     */
5797     configPageDate : function(type, args, obj) {
5798         var val = args[0],
5799             firstPageDate;
5800
5801         var cfgPageDate = DEF_CFG.PAGEDATE.key;
5802         
5803         for (var p=0;p<this.pages.length;++p) {
5804             var cal = this.pages[p];
5805             if (p === 0) {
5806                 firstPageDate = cal._parsePageDate(val);
5807                 cal.cfg.setProperty(cfgPageDate, firstPageDate);
5808             } else {
5809                 var pageDate = new Date(firstPageDate);
5810                 this._setMonthOnDate(pageDate, pageDate.getMonth() + p);
5811                 cal.cfg.setProperty(cfgPageDate, pageDate);
5812             }
5813         }
5814     },
5815     
5816     /**
5817     * The default Config handler for the CalendarGroup "selected" property
5818     * @method configSelected
5819     * @param {String} type The CustomEvent type (usually the property name)
5820     * @param {Object[]} args The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
5821     * @param {Object} obj The scope object. For configuration handlers, this will usually equal the owner.
5822     */
5823     configSelected : function(type, args, obj) {
5824         var cfgSelected = DEF_CFG.SELECTED.key;
5825         this.delegateConfig(type, args, obj);
5826         var selected = (this.pages.length > 0) ? this.pages[0].cfg.getProperty(cfgSelected) : []; 
5827         this.cfg.setProperty(cfgSelected, selected, true);
5828     },
5829
5830     
5831     /**
5832     * Delegates a configuration property to the CustomEvents associated with the CalendarGroup's children
5833     * @method delegateConfig
5834     * @param {String} type The CustomEvent type (usually the property name)
5835     * @param {Object[]} args The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.
5836     * @param {Object} obj The scope object. For configuration handlers, this will usually equal the owner.
5837     */
5838     delegateConfig : function(type, args, obj) {
5839         var val = args[0];
5840         var cal;
5841     
5842         for (var p=0;p<this.pages.length;p++) {
5843             cal = this.pages[p];
5844             cal.cfg.setProperty(type, val);
5845         }
5846     },
5847
5848     /**
5849     * Adds a function to all child Calendars within this CalendarGroup.
5850     * @method setChildFunction
5851     * @param {String}  fnName  The name of the function
5852     * @param {Function}  fn   The function to apply to each Calendar page object
5853     */
5854     setChildFunction : function(fnName, fn) {
5855         var pageCount = this.cfg.getProperty(DEF_CFG.PAGES.key);
5856     
5857         for (var p=0;p<pageCount;++p) {
5858             this.pages[p][fnName] = fn;
5859         }
5860     },
5861
5862     /**
5863     * Calls a function within all child Calendars within this CalendarGroup.
5864     * @method callChildFunction
5865     * @param {String}  fnName  The name of the function
5866     * @param {Array}  args  The arguments to pass to the function
5867     */
5868     callChildFunction : function(fnName, args) {
5869         var pageCount = this.cfg.getProperty(DEF_CFG.PAGES.key);
5870
5871         for (var p=0;p<pageCount;++p) {
5872             var page = this.pages[p];
5873             if (page[fnName]) {
5874                 var fn = page[fnName];
5875                 fn.call(page, args);
5876             }
5877         } 
5878     },
5879
5880     /**
5881     * Constructs a child calendar. This method can be overridden if a subclassed version of the default
5882     * calendar is to be used.
5883     * @method constructChild
5884     * @param {String} id   The id of the table element that will represent the calendar widget
5885     * @param {String} containerId The id of the container div element that will wrap the calendar table
5886     * @param {Object} config  The configuration object containing the Calendar's arguments
5887     * @return {YAHOO.widget.Calendar} The YAHOO.widget.Calendar instance that is constructed
5888     */
5889     constructChild : function(id,containerId,config) {
5890         var container = document.getElementById(containerId);
5891         if (! container) {
5892             container = document.createElement("div");
5893             container.id = containerId;
5894             this.oDomContainer.appendChild(container);
5895         }
5896         return new Calendar(id,containerId,config);
5897     },
5898     
5899     /**
5900     * Sets the calendar group's month explicitly. This month will be set into the first
5901     * page of the multi-page calendar, and all other months will be iterated appropriately.
5902     * @method setMonth
5903     * @param {Number} month  The numeric month, from 0 (January) to 11 (December)
5904     */
5905     setMonth : function(month) {
5906         month = parseInt(month, 10);
5907         var currYear;
5908
5909         var cfgPageDate = DEF_CFG.PAGEDATE.key;
5910
5911         for (var p=0; p<this.pages.length; ++p) {
5912             var cal = this.pages[p];
5913             var pageDate = cal.cfg.getProperty(cfgPageDate);
5914             if (p === 0) {
5915                 currYear = pageDate.getFullYear();
5916             } else {
5917                 pageDate.setFullYear(currYear);
5918             }
5919             this._setMonthOnDate(pageDate, month+p); 
5920             cal.cfg.setProperty(cfgPageDate, pageDate);
5921         }
5922     },
5923
5924     /**
5925     * Sets the calendar group's year explicitly. This year will be set into the first
5926     * page of the multi-page calendar, and all other months will be iterated appropriately.
5927     * @method setYear
5928     * @param {Number} year  The numeric 4-digit year
5929     */
5930     setYear : function(year) {
5931     
5932         var cfgPageDate = DEF_CFG.PAGEDATE.key;
5933     
5934         year = parseInt(year, 10);
5935         for (var p=0;p<this.pages.length;++p) {
5936             var cal = this.pages[p];
5937             var pageDate = cal.cfg.getProperty(cfgPageDate);
5938     
5939             if ((pageDate.getMonth()+1) == 1 && p>0) {
5940                 year+=1;
5941             }
5942             cal.setYear(year);
5943         }
5944     },
5945
5946     /**
5947     * Calls the render function of all child calendars within the group.
5948     * @method render
5949     */
5950     render : function() {
5951         this.renderHeader();
5952         for (var p=0;p<this.pages.length;++p) {
5953             var cal = this.pages[p];
5954             cal.render();
5955         }
5956         this.renderFooter();
5957     },
5958
5959     /**
5960     * Selects a date or a collection of dates on the current calendar. This method, by default,
5961     * does not call the render method explicitly. Once selection has completed, render must be 
5962     * called for the changes to be reflected visually.
5963     * @method select
5964     * @param    {String/Date/Date[]}    date    The date string of dates to select in the current calendar. Valid formats are
5965     *                               individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
5966     *                               Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
5967     *                               This method can also take a JavaScript Date object or an array of Date objects.
5968     * @return {Date[]} Array of JavaScript Date objects representing all individual dates that are currently selected.
5969     */
5970     select : function(date) {
5971         for (var p=0;p<this.pages.length;++p) {
5972             var cal = this.pages[p];
5973             cal.select(date);
5974         }
5975         return this.getSelectedDates();
5976     },
5977
5978     /**
5979     * Selects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
5980     * The value of the MULTI_SELECT Configuration attribute will determine the set of dates which get selected. 
5981     * <ul>
5982     *    <li>If MULTI_SELECT is false, selectCell will select the cell at the specified index for only the last displayed Calendar page.</li>
5983     *    <li>If MULTI_SELECT is true, selectCell will select the cell at the specified index, on each displayed Calendar page.</li>
5984     * </ul>
5985     * @method selectCell
5986     * @param {Number} cellIndex The index of the cell to be selected. 
5987     * @return {Date[]} Array of JavaScript Date objects representing all individual dates that are currently selected.
5988     */
5989     selectCell : function(cellIndex) {
5990         for (var p=0;p<this.pages.length;++p) {
5991             var cal = this.pages[p];
5992             cal.selectCell(cellIndex);
5993         }
5994         return this.getSelectedDates();
5995     },
5996     
5997     /**
5998     * Deselects a date or a collection of dates on the current calendar. This method, by default,
5999     * does not call the render method explicitly. Once deselection has completed, render must be 
6000     * called for the changes to be reflected visually.
6001     * @method deselect
6002     * @param {String/Date/Date[]} date The date string of dates to deselect in the current calendar. Valid formats are
6003     *        individual date(s) (12/24/2005,12/26/2005) or date range(s) (12/24/2005-1/1/2006).
6004     *        Multiple comma-delimited dates can also be passed to this method (12/24/2005,12/11/2005-12/13/2005).
6005     *        This method can also take a JavaScript Date object or an array of Date objects. 
6006     * @return {Date[]}   Array of JavaScript Date objects representing all individual dates that are currently selected.
6007     */
6008     deselect : function(date) {
6009         for (var p=0;p<this.pages.length;++p) {
6010             var cal = this.pages[p];
6011             cal.deselect(date);
6012         }
6013         return this.getSelectedDates();
6014     },
6015     
6016     /**
6017     * Deselects all dates on the current calendar.
6018     * @method deselectAll
6019     * @return {Date[]}  Array of JavaScript Date objects representing all individual dates that are currently selected.
6020     *      Assuming that this function executes properly, the return value should be an empty array.
6021     *      However, the empty array is returned for the sake of being able to check the selection status
6022     *      of the calendar.
6023     */
6024     deselectAll : function() {
6025         for (var p=0;p<this.pages.length;++p) {
6026             var cal = this.pages[p];
6027             cal.deselectAll();
6028         }
6029         return this.getSelectedDates();
6030     },
6031
6032     /**
6033     * Deselects dates in the CalendarGroup based on the cell index provided. This method is used to select cells without having to do a full render. The selected style is applied to the cells directly.
6034     * deselectCell will deselect the cell at the specified index on each displayed Calendar page.
6035     *
6036     * @method deselectCell
6037     * @param {Number} cellIndex The index of the cell to deselect. 
6038     * @return {Date[]} Array of JavaScript Date objects representing all individual dates that are currently selected.
6039     */
6040     deselectCell : function(cellIndex) {
6041         for (var p=0;p<this.pages.length;++p) {
6042             var cal = this.pages[p];
6043             cal.deselectCell(cellIndex);
6044         }
6045         return this.getSelectedDates();
6046     },
6047
6048     /**
6049     * Resets the calendar widget to the originally selected month and year, and 
6050     * sets the calendar to the initial selection(s).
6051     * @method reset
6052     */
6053     reset : function() {
6054         for (var p=0;p<this.pages.length;++p) {
6055             var cal = this.pages[p];
6056             cal.reset();
6057         }
6058     },
6059
6060     /**
6061     * Clears the selected dates in the current calendar widget and sets the calendar
6062     * to the current month and year.
6063     * @method clear
6064     */
6065     clear : function() {
6066         for (var p=0;p<this.pages.length;++p) {
6067             var cal = this.pages[p];
6068             cal.clear();
6069         }
6070
6071         this.cfg.setProperty(DEF_CFG.SELECTED.key, []);
6072         this.cfg.setProperty(DEF_CFG.PAGEDATE.key, new Date(this.pages[0].today.getTime()));
6073         this.render();
6074     },
6075
6076     /**
6077     * Navigates to the next month page in the calendar widget.
6078     * @method nextMonth
6079     */
6080     nextMonth : function() {
6081         for (var p=0;p<this.pages.length;++p) {
6082             var cal = this.pages[p];
6083             cal.nextMonth();
6084         }
6085     },
6086     
6087     /**
6088     * Navigates to the previous month page in the calendar widget.
6089     * @method previousMonth
6090     */
6091     previousMonth : function() {
6092         for (var p=this.pages.length-1;p>=0;--p) {
6093             var cal = this.pages[p];
6094             cal.previousMonth();
6095         }
6096     },
6097     
6098     /**
6099     * Navigates to the next year in the currently selected month in the calendar widget.
6100     * @method nextYear
6101     */
6102     nextYear : function() {
6103         for (var p=0;p<this.pages.length;++p) {
6104             var cal = this.pages[p];
6105             cal.nextYear();
6106         }
6107     },
6108
6109     /**
6110     * Navigates to the previous year in the currently selected month in the calendar widget.
6111     * @method previousYear
6112     */
6113     previousYear : function() {
6114         for (var p=0;p<this.pages.length;++p) {
6115             var cal = this.pages[p];
6116             cal.previousYear();
6117         }
6118     },
6119
6120     /**
6121     * Gets the list of currently selected dates from the calendar.
6122     * @return   An array of currently selected JavaScript Date objects.
6123     * @type Date[]
6124     */
6125     getSelectedDates : function() { 
6126         var returnDates = [];
6127         var selected = this.cfg.getProperty(DEF_CFG.SELECTED.key);
6128         for (var d=0;d<selected.length;++d) {
6129             var dateArray = selected[d];
6130
6131             var date = DateMath.getDate(dateArray[0],dateArray[1]-1,dateArray[2]);
6132             returnDates.push(date);
6133         }
6134
6135         returnDates.sort( function(a,b) { return a-b; } );
6136         return returnDates;
6137     },
6138
6139     /**
6140     * Adds a renderer to the render stack. The function reference passed to this method will be executed
6141     * when a date cell matches the conditions specified in the date string for this renderer.
6142     * @method addRenderer
6143     * @param {String} sDates  A date string to associate with the specified renderer. Valid formats
6144     *         include date (12/24/2005), month/day (12/24), and range (12/1/2004-1/1/2005)
6145     * @param {Function} fnRender The function executed to render cells that match the render rules for this renderer.
6146     */
6147     addRenderer : function(sDates, fnRender) {
6148         for (var p=0;p<this.pages.length;++p) {
6149             var cal = this.pages[p];
6150             cal.addRenderer(sDates, fnRender);
6151         }
6152     },
6153
6154     /**
6155     * Adds a month to the render stack. The function reference passed to this method will be executed
6156     * when a date cell matches the month passed to this method.
6157     * @method addMonthRenderer
6158     * @param {Number} month  The month (1-12) to associate with this renderer
6159     * @param {Function} fnRender The function executed to render cells that match the render rules for this renderer.
6160     */
6161     addMonthRenderer : function(month, fnRender) {
6162         for (var p=0;p<this.pages.length;++p) {
6163             var cal = this.pages[p];
6164             cal.addMonthRenderer(month, fnRender);
6165         }
6166     },
6167
6168     /**
6169     * Adds a weekday to the render stack. The function reference passed to this method will be executed
6170     * when a date cell matches the weekday passed to this method.
6171     * @method addWeekdayRenderer
6172     * @param {Number} weekday  The weekday (1-7) to associate with this renderer. 1=Sunday, 2=Monday etc.
6173     * @param {Function} fnRender The function executed to render cells that match the render rules for this renderer.
6174     */
6175     addWeekdayRenderer : function(weekday, fnRender) {
6176         for (var p=0;p<this.pages.length;++p) {
6177             var cal = this.pages[p];
6178             cal.addWeekdayRenderer(weekday, fnRender);
6179         }
6180     },
6181
6182     /**
6183      * Removes all custom renderers added to the CalendarGroup through the addRenderer, addMonthRenderer and 
6184      * addWeekRenderer methods. CalendarGroup's render method needs to be called to after removing renderers 
6185      * to see the changes applied.
6186      * 
6187      * @method removeRenderers
6188      */
6189     removeRenderers : function() {
6190         this.callChildFunction("removeRenderers");
6191     },
6192
6193     /**
6194     * Renders the header for the CalendarGroup.
6195     * @method renderHeader
6196     */
6197     renderHeader : function() {
6198         // EMPTY DEFAULT IMPL
6199     },
6200
6201     /**
6202     * Renders a footer for the 2-up calendar container. By default, this method is
6203     * unimplemented.
6204     * @method renderFooter
6205     */
6206     renderFooter : function() {
6207         // EMPTY DEFAULT IMPL
6208     },
6209
6210     /**
6211     * Adds the designated number of months to the current calendar month, and sets the current
6212     * calendar page date to the new month.
6213     * @method addMonths
6214     * @param {Number} count The number of months to add to the current calendar
6215     */
6216     addMonths : function(count) {
6217         this.callChildFunction("addMonths", count);
6218     },
6219     
6220     /**
6221     * Subtracts the designated number of months from the current calendar month, and sets the current
6222     * calendar page date to the new month.
6223     * @method subtractMonths
6224     * @param {Number} count The number of months to subtract from the current calendar
6225     */
6226     subtractMonths : function(count) {
6227         this.callChildFunction("subtractMonths", count);
6228     },
6229
6230     /**
6231     * Adds the designated number of years to the current calendar, and sets the current
6232     * calendar page date to the new month.
6233     * @method addYears
6234     * @param {Number} count The number of years to add to the current calendar
6235     */
6236     addYears : function(count) {
6237         this.callChildFunction("addYears", count);
6238     },
6239
6240     /**
6241     * Subtcats the designated number of years from the current calendar, and sets the current
6242     * calendar page date to the new month.
6243     * @method subtractYears
6244     * @param {Number} count The number of years to subtract from the current calendar
6245     */
6246     subtractYears : function(count) {
6247         this.callChildFunction("subtractYears", count);
6248     },
6249
6250     /**
6251      * Returns the Calendar page instance which has a pagedate (month/year) matching the given date. 
6252      * Returns null if no match is found.
6253      * 
6254      * @method getCalendarPage
6255      * @param {Date} date The JavaScript Date object for which a Calendar page is to be found.
6256      * @return {Calendar} The Calendar page instance representing the month to which the date 
6257      * belongs.
6258      */
6259     getCalendarPage : function(date) {
6260         var cal = null;
6261         if (date) {
6262             var y = date.getFullYear(),
6263                 m = date.getMonth();
6264
6265             var pages = this.pages;
6266             for (var i = 0; i < pages.length; ++i) {
6267                 var pageDate = pages[i].cfg.getProperty("pagedate");
6268                 if (pageDate.getFullYear() === y && pageDate.getMonth() === m) {
6269                     cal = pages[i];
6270                     break;
6271                 }
6272             }
6273         }
6274         return cal;
6275     },
6276
6277     /**
6278     * Sets the month on a Date object, taking into account year rollover if the month is less than 0 or greater than 11.
6279     * The Date object passed in is modified. It should be cloned before passing it into this method if the original value needs to be maintained
6280     * @method _setMonthOnDate
6281     * @private
6282     * @param {Date} date The Date object on which to set the month index
6283     * @param {Number} iMonth The month index to set
6284     */
6285     _setMonthOnDate : function(date, iMonth) {
6286         // Bug in Safari 1.3, 2.0 (WebKit build < 420), Date.setMonth does not work consistently if iMonth is not 0-11
6287         if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420 && (iMonth < 0 || iMonth > 11)) {
6288             var newDate = DateMath.add(date, DateMath.MONTH, iMonth-date.getMonth());
6289             date.setTime(newDate.getTime());
6290         } else {
6291             date.setMonth(iMonth);
6292         }
6293     },
6294     
6295     /**
6296      * Fixes the width of the CalendarGroup container element, to account for miswrapped floats
6297      * @method _fixWidth
6298      * @private
6299      */
6300     _fixWidth : function() {
6301         var w = 0;
6302         for (var p=0;p<this.pages.length;++p) {
6303             var cal = this.pages[p];
6304             w += cal.oDomContainer.offsetWidth;
6305         }
6306         if (w > 0) {
6307             this.oDomContainer.style.width = w + "px";
6308         }
6309     },
6310     
6311     /**
6312     * Returns a string representation of the object.
6313     * @method toString
6314     * @return {String} A string representation of the CalendarGroup object.
6315     */
6316     toString : function() {
6317         return "CalendarGroup " + this.id;
6318     },
6319
6320     /**
6321      * Destroys the CalendarGroup instance. The method will remove references
6322      * to HTML elements, remove any event listeners added by the CalendarGroup.
6323      * 
6324      * It will also destroy the Config and CalendarNavigator instances created by the 
6325      * CalendarGroup and the individual Calendar instances created for each page.
6326      *
6327      * @method destroy
6328      */
6329     destroy : function() {
6330
6331         if (this.beforeDestroyEvent.fire()) {
6332
6333             var cal = this;
6334     
6335             // Child objects
6336             if (cal.navigator) {
6337                 cal.navigator.destroy();
6338             }
6339     
6340             if (cal.cfg) {
6341                 cal.cfg.destroy();
6342             }
6343     
6344             // DOM event listeners
6345             Event.purgeElement(cal.oDomContainer, true);
6346     
6347             // Generated markup/DOM - Not removing the container DIV since we didn't create it.
6348             Dom.removeClass(cal.oDomContainer, CalendarGroup.CSS_CONTAINER);
6349             Dom.removeClass(cal.oDomContainer, CalendarGroup.CSS_MULTI_UP);
6350             
6351             for (var i = 0, l = cal.pages.length; i < l; i++) {
6352                 cal.pages[i].destroy();
6353                 cal.pages[i] = null;
6354             }
6355     
6356             cal.oDomContainer.innerHTML = "";
6357     
6358             // JS-to-DOM references
6359             cal.oDomContainer = null;
6360     
6361             this.destroyEvent.fire();
6362         }
6363     }
6364 };
6365
6366 /**
6367 * CSS class representing the container for the calendar
6368 * @property YAHOO.widget.CalendarGroup.CSS_CONTAINER
6369 * @static
6370 * @final
6371 * @type String
6372 */
6373 CalendarGroup.CSS_CONTAINER = "yui-calcontainer";
6374
6375 /**
6376 * CSS class representing the container for the calendar
6377 * @property YAHOO.widget.CalendarGroup.CSS_MULTI_UP
6378 * @static
6379 * @final
6380 * @type String
6381 */
6382 CalendarGroup.CSS_MULTI_UP = "multi";
6383
6384 /**
6385 * CSS class representing the title for the 2-up calendar
6386 * @property YAHOO.widget.CalendarGroup.CSS_2UPTITLE
6387 * @static
6388 * @final
6389 * @type String
6390 */
6391 CalendarGroup.CSS_2UPTITLE = "title";
6392
6393 /**
6394 * CSS class representing the close icon for the 2-up calendar
6395 * @property YAHOO.widget.CalendarGroup.CSS_2UPCLOSE
6396 * @static
6397 * @final
6398 * @deprecated Along with Calendar.IMG_ROOT and NAV_ARROW_LEFT, NAV_ARROW_RIGHT configuration properties.
6399 *     Calendar's <a href="YAHOO.widget.Calendar.html#Style.CSS_CLOSE">Style.CSS_CLOSE</a> property now represents the CSS class used to render the close icon
6400 * @type String
6401 */
6402 CalendarGroup.CSS_2UPCLOSE = "close-icon";
6403
6404 YAHOO.lang.augmentProto(CalendarGroup, Calendar, "buildDayLabel",
6405                                                  "buildMonthLabel",
6406                                                  "renderOutOfBoundsDate",
6407                                                  "renderRowHeader",
6408                                                  "renderRowFooter",
6409                                                  "renderCellDefault",
6410                                                  "styleCellDefault",
6411                                                  "renderCellStyleHighlight1",
6412                                                  "renderCellStyleHighlight2",
6413                                                  "renderCellStyleHighlight3",
6414                                                  "renderCellStyleHighlight4",
6415                                                  "renderCellStyleToday",
6416                                                  "renderCellStyleSelected",
6417                                                  "renderCellNotThisMonth",
6418                                                  "renderBodyCellRestricted",
6419                                                  "initStyles",
6420                                                  "configTitle",
6421                                                  "configClose",
6422                                                  "configIframe",
6423                                                  "configStrings",
6424                                                  "configToday",
6425                                                  "configNavigator",
6426                                                  "createTitleBar",
6427                                                  "createCloseButton",
6428                                                  "removeTitleBar",
6429                                                  "removeCloseButton",
6430                                                  "hide",
6431                                                  "show",
6432                                                  "toDate",
6433                                                  "_toDate",
6434                                                  "_parseArgs",
6435                                                  "browser");
6436
6437 YAHOO.widget.CalGrp = CalendarGroup;
6438 YAHOO.widget.CalendarGroup = CalendarGroup;
6439
6440 /**
6441 * @class YAHOO.widget.Calendar2up
6442 * @extends YAHOO.widget.CalendarGroup
6443 * @deprecated The old Calendar2up class is no longer necessary, since CalendarGroup renders in a 2up view by default.
6444 */
6445 YAHOO.widget.Calendar2up = function(id, containerId, config) {
6446     this.init(id, containerId, config);
6447 };
6448
6449 YAHOO.extend(YAHOO.widget.Calendar2up, CalendarGroup);
6450
6451 /**
6452 * @deprecated The old Calendar2up class is no longer necessary, since CalendarGroup renders in a 2up view by default.
6453 */
6454 YAHOO.widget.Cal2up = YAHOO.widget.Calendar2up;
6455
6456 })();
6457 /**
6458  * The CalendarNavigator is used along with a Calendar/CalendarGroup to 
6459  * provide a Month/Year popup navigation control, allowing the user to navigate 
6460  * to a specific month/year in the Calendar/CalendarGroup without having to 
6461  * scroll through months sequentially
6462  *
6463  * @namespace YAHOO.widget
6464  * @class CalendarNavigator
6465  * @constructor
6466  * @param {Calendar|CalendarGroup} cal The instance of the Calendar or CalendarGroup to which this CalendarNavigator should be attached.
6467  */
6468 YAHOO.widget.CalendarNavigator = function(cal) {
6469     this.init(cal);
6470 };
6471
6472 (function() {
6473     // Setup static properties (inside anon fn, so that we can use shortcuts)
6474     var CN = YAHOO.widget.CalendarNavigator;
6475
6476     /**
6477      * YAHOO.widget.CalendarNavigator.CLASSES contains constants
6478      * for the class values applied to the CalendarNaviatgator's 
6479      * DOM elements
6480      * @property YAHOO.widget.CalendarNavigator.CLASSES
6481      * @type Object
6482      * @static
6483      */
6484     CN.CLASSES = {
6485         /**
6486          * Class applied to the Calendar Navigator's bounding box
6487          * @property YAHOO.widget.CalendarNavigator.CLASSES.NAV
6488          * @type String
6489          * @static
6490          */
6491         NAV :"yui-cal-nav",
6492         /**
6493          * Class applied to the Calendar/CalendarGroup's bounding box to indicate
6494          * the Navigator is currently visible
6495          * @property YAHOO.widget.CalendarNavigator.CLASSES.NAV_VISIBLE
6496          * @type String
6497          * @static
6498          */
6499         NAV_VISIBLE: "yui-cal-nav-visible",
6500         /**
6501          * Class applied to the Navigator mask's bounding box
6502          * @property YAHOO.widget.CalendarNavigator.CLASSES.MASK
6503          * @type String
6504          * @static
6505          */
6506         MASK : "yui-cal-nav-mask",
6507         /**
6508          * Class applied to the year label/control bounding box
6509          * @property YAHOO.widget.CalendarNavigator.CLASSES.YEAR
6510          * @type String
6511          * @static
6512          */
6513         YEAR : "yui-cal-nav-y",
6514         /**
6515          * Class applied to the month label/control bounding box
6516          * @property YAHOO.widget.CalendarNavigator.CLASSES.MONTH
6517          * @type String
6518          * @static
6519          */
6520         MONTH : "yui-cal-nav-m",
6521         /**
6522          * Class applied to the submit/cancel button's bounding box
6523          * @property YAHOO.widget.CalendarNavigator.CLASSES.BUTTONS
6524          * @type String
6525          * @static
6526          */
6527         BUTTONS : "yui-cal-nav-b",
6528         /**
6529          * Class applied to buttons wrapping element
6530          * @property YAHOO.widget.CalendarNavigator.CLASSES.BUTTON
6531          * @type String
6532          * @static
6533          */
6534         BUTTON : "yui-cal-nav-btn",
6535         /**
6536          * Class applied to the validation error area's bounding box
6537          * @property YAHOO.widget.CalendarNavigator.CLASSES.ERROR
6538          * @type String
6539          * @static
6540          */
6541         ERROR : "yui-cal-nav-e",
6542         /**
6543          * Class applied to the year input control
6544          * @property YAHOO.widget.CalendarNavigator.CLASSES.YEAR_CTRL
6545          * @type String
6546          * @static
6547          */
6548         YEAR_CTRL : "yui-cal-nav-yc",
6549         /**
6550          * Class applied to the month input control
6551          * @property YAHOO.widget.CalendarNavigator.CLASSES.MONTH_CTRL
6552          * @type String
6553          * @static
6554          */
6555         MONTH_CTRL : "yui-cal-nav-mc",
6556         /**
6557          * Class applied to controls with invalid data (e.g. a year input field with invalid an year)
6558          * @property YAHOO.widget.CalendarNavigator.CLASSES.INVALID
6559          * @type String
6560          * @static
6561          */
6562         INVALID : "yui-invalid",
6563         /**
6564          * Class applied to default controls
6565          * @property YAHOO.widget.CalendarNavigator.CLASSES.DEFAULT
6566          * @type String
6567          * @static
6568          */
6569         DEFAULT : "yui-default"
6570     };
6571
6572     /**
6573      * Object literal containing the default configuration values for the CalendarNavigator
6574      * The configuration object is expected to follow the format below, with the properties being
6575      * case sensitive.
6576      * <dl>
6577      * <dt>strings</dt>
6578      * <dd><em>Object</em> :  An object with the properties shown below, defining the string labels to use in the Navigator's UI
6579      *     <dl>
6580      *         <dt>month</dt><dd><em>String</em> : The string to use for the month label. Defaults to "Month".</dd>
6581      *         <dt>year</dt><dd><em>String</em> : The string to use for the year label. Defaults to "Year".</dd>
6582      *         <dt>submit</dt><dd><em>String</em> : The string to use for the submit button label. Defaults to "Okay".</dd>
6583      *         <dt>cancel</dt><dd><em>String</em> : The string to use for the cancel button label. Defaults to "Cancel".</dd>
6584      *         <dt>invalidYear</dt><dd><em>String</em> : The string to use for invalid year values. Defaults to "Year needs to be a number".</dd>
6585      *     </dl>
6586      * </dd>
6587      * <dt>monthFormat</dt><dd><em>String</em> : The month format to use. Either YAHOO.widget.Calendar.LONG, or YAHOO.widget.Calendar.SHORT. Defaults to YAHOO.widget.Calendar.LONG</dd>
6588      * <dt>initialFocus</dt><dd><em>String</em> : Either "year" or "month" specifying which input control should get initial focus. Defaults to "year"</dd>
6589      * </dl>
6590      * @property DEFAULT_CONFIG
6591      * @type Object
6592      * @static
6593      */
6594     CN.DEFAULT_CONFIG = {
6595         strings : {
6596             month: "Month",
6597             year: "Year",
6598             submit: "Okay",
6599             cancel: "Cancel",
6600             invalidYear : "Year needs to be a number"
6601         },
6602         monthFormat: YAHOO.widget.Calendar.LONG,
6603         initialFocus: "year"
6604     };
6605     
6606     /**
6607      * Object literal containing the default configuration values for the CalendarNavigator
6608      * @property _DEFAULT_CFG
6609      * @protected
6610      * @deprecated Made public. See the public DEFAULT_CONFIG property
6611      * @type Object
6612      * @static
6613      */
6614     CN._DEFAULT_CFG = CN.DEFAULT_CONFIG;
6615
6616
6617     /**
6618      * The suffix added to the Calendar/CalendarGroup's ID, to generate
6619      * a unique ID for the Navigator and it's bounding box.
6620      * @property YAHOO.widget.CalendarNavigator.ID_SUFFIX
6621      * @static
6622      * @type String
6623      * @final
6624      */
6625     CN.ID_SUFFIX = "_nav";
6626     /**
6627      * The suffix added to the Navigator's ID, to generate
6628      * a unique ID for the month control.
6629      * @property YAHOO.widget.CalendarNavigator.MONTH_SUFFIX
6630      * @static
6631      * @type String 
6632      * @final
6633      */
6634     CN.MONTH_SUFFIX = "_month";
6635     /**
6636      * The suffix added to the Navigator's ID, to generate
6637      * a unique ID for the year control.
6638      * @property YAHOO.widget.CalendarNavigator.YEAR_SUFFIX
6639      * @static
6640      * @type String
6641      * @final
6642      */
6643     CN.YEAR_SUFFIX = "_year";
6644     /**
6645      * The suffix added to the Navigator's ID, to generate
6646      * a unique ID for the error bounding box.
6647      * @property YAHOO.widget.CalendarNavigator.ERROR_SUFFIX
6648      * @static
6649      * @type String
6650      * @final
6651      */
6652     CN.ERROR_SUFFIX = "_error";
6653     /**
6654      * The suffix added to the Navigator's ID, to generate
6655      * a unique ID for the "Cancel" button.
6656      * @property YAHOO.widget.CalendarNavigator.CANCEL_SUFFIX
6657      * @static
6658      * @type String
6659      * @final
6660      */
6661     CN.CANCEL_SUFFIX = "_cancel";
6662     /**
6663      * The suffix added to the Navigator's ID, to generate
6664      * a unique ID for the "Submit" button.
6665      * @property YAHOO.widget.CalendarNavigator.SUBMIT_SUFFIX
6666      * @static
6667      * @type String
6668      * @final
6669      */
6670     CN.SUBMIT_SUFFIX = "_submit";
6671
6672     /**
6673      * The number of digits to which the year input control is to be limited.
6674      * @property YAHOO.widget.CalendarNavigator.YR_MAX_DIGITS
6675      * @static
6676      * @type Number
6677      */
6678     CN.YR_MAX_DIGITS = 4;
6679
6680     /**
6681      * The amount by which to increment the current year value,
6682      * when the arrow up/down key is pressed on the year control
6683      * @property YAHOO.widget.CalendarNavigator.YR_MINOR_INC
6684      * @static
6685      * @type Number
6686      */
6687     CN.YR_MINOR_INC = 1;
6688
6689     /**
6690      * The amount by which to increment the current year value,
6691      * when the page up/down key is pressed on the year control
6692      * @property YAHOO.widget.CalendarNavigator.YR_MAJOR_INC
6693      * @static
6694      * @type Number
6695      */
6696     CN.YR_MAJOR_INC = 10;
6697
6698     /**
6699      * Artificial delay (in ms) between the time the Navigator is hidden
6700      * and the Calendar/CalendarGroup state is updated. Allows the user
6701      * the see the Calendar/CalendarGroup page changing. If set to 0
6702      * the Calendar/CalendarGroup page will be updated instantly
6703      * @property YAHOO.widget.CalendarNavigator.UPDATE_DELAY
6704      * @static
6705      * @type Number
6706      */
6707     CN.UPDATE_DELAY = 50;
6708
6709     /**
6710      * Regular expression used to validate the year input
6711      * @property YAHOO.widget.CalendarNavigator.YR_PATTERN
6712      * @static
6713      * @type RegExp
6714      */
6715     CN.YR_PATTERN = /^\d+$/;
6716     /**
6717      * Regular expression used to trim strings
6718      * @property YAHOO.widget.CalendarNavigator.TRIM
6719      * @static
6720      * @type RegExp
6721      */
6722     CN.TRIM = /^\s*(.*?)\s*$/;
6723 })();
6724
6725 YAHOO.widget.CalendarNavigator.prototype = {
6726
6727     /**
6728      * The unique ID for this CalendarNavigator instance
6729      * @property id
6730      * @type String
6731      */
6732     id : null,
6733
6734     /**
6735      * The Calendar/CalendarGroup instance to which the navigator belongs
6736      * @property cal
6737      * @type {Calendar|CalendarGroup}
6738      */
6739     cal : null,
6740
6741     /**
6742      * Reference to the HTMLElement used to render the navigator's bounding box
6743      * @property navEl
6744      * @type HTMLElement
6745      */
6746     navEl : null,
6747
6748     /**
6749      * Reference to the HTMLElement used to render the navigator's mask
6750      * @property maskEl
6751      * @type HTMLElement
6752      */
6753     maskEl : null,
6754
6755     /**
6756      * Reference to the HTMLElement used to input the year
6757      * @property yearEl
6758      * @type HTMLElement
6759      */
6760     yearEl : null,
6761
6762     /**
6763      * Reference to the HTMLElement used to input the month
6764      * @property monthEl
6765      * @type HTMLElement
6766      */
6767     monthEl : null,
6768
6769     /**
6770      * Reference to the HTMLElement used to display validation errors
6771      * @property errorEl
6772      * @type HTMLElement
6773      */
6774     errorEl : null,
6775
6776     /**
6777      * Reference to the HTMLElement used to update the Calendar/Calendar group
6778      * with the month/year values
6779      * @property submitEl
6780      * @type HTMLElement
6781      */
6782     submitEl : null,
6783     
6784     /**
6785      * Reference to the HTMLElement used to hide the navigator without updating the 
6786      * Calendar/Calendar group
6787      * @property cancelEl
6788      * @type HTMLElement
6789      */
6790     cancelEl : null,
6791
6792     /** 
6793      * Reference to the first focusable control in the navigator (by default monthEl)
6794      * @property firstCtrl
6795      * @type HTMLElement
6796      */
6797     firstCtrl : null,
6798     
6799     /** 
6800      * Reference to the last focusable control in the navigator (by default cancelEl)
6801      * @property lastCtrl
6802      * @type HTMLElement
6803      */
6804     lastCtrl : null,
6805
6806     /**
6807      * The document containing the Calendar/Calendar group instance
6808      * @protected
6809      * @property _doc
6810      * @type HTMLDocument
6811      */
6812     _doc : null,
6813
6814     /**
6815      * Internal state property for the current year displayed in the navigator
6816      * @protected
6817      * @property _year
6818      * @type Number
6819      */
6820     _year: null,
6821     
6822     /**
6823      * Internal state property for the current month index displayed in the navigator
6824      * @protected
6825      * @property _month
6826      * @type Number
6827      */
6828     _month: 0,
6829
6830     /**
6831      * Private internal state property which indicates whether or not the 
6832      * Navigator has been rendered.
6833      * @private
6834      * @property __rendered
6835      * @type Boolean
6836      */
6837     __rendered: false,
6838
6839     /**
6840      * Init lifecycle method called as part of construction
6841      * 
6842      * @method init
6843      * @param {Calendar} cal The instance of the Calendar or CalendarGroup to which this CalendarNavigator should be attached
6844      */
6845     init : function(cal) {
6846         var calBox = cal.oDomContainer;
6847
6848         this.cal = cal;
6849         this.id = calBox.id + YAHOO.widget.CalendarNavigator.ID_SUFFIX;
6850         this._doc = calBox.ownerDocument;
6851
6852         /**
6853          * Private flag, to identify IE Quirks
6854          * @private
6855          * @property __isIEQuirks
6856          */
6857         var ie = YAHOO.env.ua.ie;
6858         this.__isIEQuirks = (ie && ((ie <= 6) || (this._doc.compatMode == "BackCompat")));
6859     },
6860
6861     /**
6862      * Displays the navigator and mask, updating the input controls to reflect the 
6863      * currently set month and year. The show method will invoke the render method
6864      * if the navigator has not been renderered already, allowing for lazy rendering
6865      * of the control.
6866      * 
6867      * The show method will fire the Calendar/CalendarGroup's beforeShowNav and showNav events
6868      * 
6869      * @method show
6870      */
6871     show : function() {
6872         var CLASSES = YAHOO.widget.CalendarNavigator.CLASSES;
6873
6874         if (this.cal.beforeShowNavEvent.fire()) {
6875             if (!this.__rendered) {
6876                 this.render();
6877             }
6878             this.clearErrors();
6879
6880             this._updateMonthUI();
6881             this._updateYearUI();
6882             this._show(this.navEl, true);
6883
6884             this.setInitialFocus();
6885             this.showMask();
6886
6887             YAHOO.util.Dom.addClass(this.cal.oDomContainer, CLASSES.NAV_VISIBLE);
6888             this.cal.showNavEvent.fire();
6889         }
6890     },
6891
6892     /**
6893      * Hides the navigator and mask
6894      * 
6895      * The show method will fire the Calendar/CalendarGroup's beforeHideNav event and hideNav events
6896      * @method hide
6897      */
6898     hide : function() {
6899         var CLASSES = YAHOO.widget.CalendarNavigator.CLASSES;
6900
6901         if (this.cal.beforeHideNavEvent.fire()) {
6902             this._show(this.navEl, false);
6903             this.hideMask();
6904             YAHOO.util.Dom.removeClass(this.cal.oDomContainer, CLASSES.NAV_VISIBLE);
6905             this.cal.hideNavEvent.fire();
6906         }
6907     },
6908     
6909
6910     /**
6911      * Displays the navigator's mask element
6912      * 
6913      * @method showMask
6914      */
6915     showMask : function() {
6916         this._show(this.maskEl, true);
6917         if (this.__isIEQuirks) {
6918             this._syncMask();
6919         }
6920     },
6921
6922     /**
6923      * Hides the navigator's mask element
6924      * 
6925      * @method hideMask
6926      */
6927     hideMask : function() {
6928         this._show(this.maskEl, false);
6929     },
6930
6931     /**
6932      * Returns the current month set on the navigator
6933      * 
6934      * Note: This may not be the month set in the UI, if 
6935      * the UI contains an invalid value.
6936      * 
6937      * @method getMonth
6938      * @return {Number} The Navigator's current month index
6939      */
6940     getMonth: function() {
6941         return this._month;
6942     },
6943
6944     /**
6945      * Returns the current year set on the navigator
6946      * 
6947      * Note: This may not be the year set in the UI, if 
6948      * the UI contains an invalid value.
6949      * 
6950      * @method getYear
6951      * @return {Number} The Navigator's current year value
6952      */
6953     getYear: function() {
6954         return this._year;
6955     },
6956
6957     /**
6958      * Sets the current month on the Navigator, and updates the UI
6959      * 
6960      * @method setMonth
6961      * @param {Number} nMonth The month index, from 0 (Jan) through 11 (Dec).
6962      */
6963     setMonth : function(nMonth) {
6964         if (nMonth >= 0 && nMonth < 12) {
6965             this._month = nMonth;
6966         }
6967         this._updateMonthUI();
6968     },
6969
6970     /**
6971      * Sets the current year on the Navigator, and updates the UI. If the 
6972      * provided year is invalid, it will not be set.
6973      * 
6974      * @method setYear
6975      * @param {Number} nYear The full year value to set the Navigator to.
6976      */
6977     setYear : function(nYear) {
6978         var yrPattern = YAHOO.widget.CalendarNavigator.YR_PATTERN;
6979         if (YAHOO.lang.isNumber(nYear) && yrPattern.test(nYear+"")) {
6980             this._year = nYear;
6981         }
6982         this._updateYearUI();
6983     },
6984
6985     /**
6986      * Renders the HTML for the navigator, adding it to the 
6987      * document and attaches event listeners if it has not 
6988      * already been rendered.
6989      * 
6990      * @method render
6991      */
6992     render: function() {
6993         this.cal.beforeRenderNavEvent.fire();
6994         if (!this.__rendered) {
6995             this.createNav();
6996             this.createMask();
6997             this.applyListeners();
6998             this.__rendered = true;
6999         }
7000         this.cal.renderNavEvent.fire();
7001     },
7002
7003     /**
7004      * Creates the navigator's containing HTMLElement, it's contents, and appends 
7005      * the containg element to the Calendar/CalendarGroup's container.
7006      * 
7007      * @method createNav
7008      */
7009     createNav : function() {
7010         var NAV = YAHOO.widget.CalendarNavigator;
7011         var doc = this._doc;
7012
7013         var d = doc.createElement("div");
7014         d.className = NAV.CLASSES.NAV;
7015
7016         var htmlBuf = this.renderNavContents([]);
7017
7018         d.innerHTML = htmlBuf.join('');
7019         this.cal.oDomContainer.appendChild(d);
7020
7021         this.navEl = d;
7022
7023         this.yearEl = doc.getElementById(this.id + NAV.YEAR_SUFFIX);
7024         this.monthEl = doc.getElementById(this.id + NAV.MONTH_SUFFIX);
7025         this.errorEl = doc.getElementById(this.id + NAV.ERROR_SUFFIX);
7026         this.submitEl = doc.getElementById(this.id + NAV.SUBMIT_SUFFIX);
7027         this.cancelEl = doc.getElementById(this.id + NAV.CANCEL_SUFFIX);
7028
7029         if (YAHOO.env.ua.gecko && this.yearEl && this.yearEl.type == "text") {
7030             // Avoid XUL error on focus, select [ https://bugzilla.mozilla.org/show_bug.cgi?id=236791, 
7031             // supposedly fixed in 1.8.1, but there are reports of it still being around for methods other than blur ]
7032             this.yearEl.setAttribute("autocomplete", "off");
7033         }
7034
7035         this._setFirstLastElements();
7036     },
7037
7038     /**
7039      * Creates the Mask HTMLElement and appends it to the Calendar/CalendarGroups
7040      * container.
7041      * 
7042      * @method createMask
7043      */
7044     createMask : function() {
7045         var C = YAHOO.widget.CalendarNavigator.CLASSES;
7046
7047         var d = this._doc.createElement("div");
7048         d.className = C.MASK;
7049
7050         this.cal.oDomContainer.appendChild(d);
7051         this.maskEl = d;
7052     },
7053
7054     /**
7055      * Used to set the width/height of the mask in pixels to match the Calendar Container.
7056      * Currently only used for IE6 or IE in quirks mode. The other A-Grade browser are handled using CSS (width/height 100%).
7057      * <p>
7058      * The method is also registered as an HTMLElement resize listener on the Calendars container element.
7059      * </p>
7060      * @protected
7061      * @method _syncMask
7062      */
7063     _syncMask : function() {
7064         var c = this.cal.oDomContainer;
7065         if (c && this.maskEl) {
7066             var r = YAHOO.util.Dom.getRegion(c);
7067             YAHOO.util.Dom.setStyle(this.maskEl, "width", r.right - r.left + "px");
7068             YAHOO.util.Dom.setStyle(this.maskEl, "height", r.bottom - r.top + "px");
7069         }
7070     },
7071
7072     /**
7073      * Renders the contents of the navigator
7074      * 
7075      * @method renderNavContents
7076      * 
7077      * @param {Array} html The HTML buffer to append the HTML to.
7078      * @return {Array} A reference to the buffer passed in.
7079      */
7080     renderNavContents : function(html) {
7081         var NAV = YAHOO.widget.CalendarNavigator,
7082             C = NAV.CLASSES,
7083             h = html; // just to use a shorter name
7084
7085         h[h.length] = '<div class="' + C.MONTH + '">';
7086         this.renderMonth(h);
7087         h[h.length] = '</div>';
7088         h[h.length] = '<div class="' + C.YEAR + '">';
7089         this.renderYear(h);
7090         h[h.length] = '</div>';
7091         h[h.length] = '<div class="' + C.BUTTONS + '">';
7092         this.renderButtons(h);
7093         h[h.length] = '</div>';
7094         h[h.length] = '<div class="' + C.ERROR + '" id="' + this.id + NAV.ERROR_SUFFIX + '"></div>';
7095
7096         return h;
7097     },
7098
7099     /**
7100      * Renders the month label and control for the navigator
7101      * 
7102      * @method renderNavContents
7103      * @param {Array} html The HTML buffer to append the HTML to.
7104      * @return {Array} A reference to the buffer passed in.
7105      */
7106     renderMonth : function(html) {
7107         var NAV = YAHOO.widget.CalendarNavigator,
7108             C = NAV.CLASSES;
7109
7110         var id = this.id + NAV.MONTH_SUFFIX,
7111             mf = this.__getCfg("monthFormat"),
7112             months = this.cal.cfg.getProperty((mf == YAHOO.widget.Calendar.SHORT) ? "MONTHS_SHORT" : "MONTHS_LONG"),
7113             h = html;
7114
7115         if (months && months.length > 0) {
7116             h[h.length] = '<label for="' + id + '">';
7117             h[h.length] = this.__getCfg("month", true);
7118             h[h.length] = '</label>';
7119             h[h.length] = '<select name="' + id + '" id="' + id + '" class="' + C.MONTH_CTRL + '">';
7120             for (var i = 0; i < months.length; i++) {
7121                 h[h.length] = '<option value="' + i + '">';
7122                 h[h.length] = months[i];
7123                 h[h.length] = '</option>';
7124             }
7125             h[h.length] = '</select>';
7126         }
7127         return h;
7128     },
7129
7130     /**
7131      * Renders the year label and control for the navigator
7132      * 
7133      * @method renderYear
7134      * @param {Array} html The HTML buffer to append the HTML to.
7135      * @return {Array} A reference to the buffer passed in.
7136      */
7137     renderYear : function(html) {
7138         var NAV = YAHOO.widget.CalendarNavigator,
7139             C = NAV.CLASSES;
7140
7141         var id = this.id + NAV.YEAR_SUFFIX,
7142             size = NAV.YR_MAX_DIGITS,
7143             h = html;
7144
7145         h[h.length] = '<label for="' + id + '">';
7146         h[h.length] = this.__getCfg("year", true);
7147         h[h.length] = '</label>';
7148         h[h.length] = '<input type="text" name="' + id + '" id="' + id + '" class="' + C.YEAR_CTRL + '" maxlength="' + size + '"/>';
7149         return h;
7150     },
7151
7152     /**
7153      * Renders the submit/cancel buttons for the navigator
7154      * 
7155      * @method renderButton
7156      * @return {String} The HTML created for the Button UI
7157      */
7158     renderButtons : function(html) {
7159         var C = YAHOO.widget.CalendarNavigator.CLASSES;
7160         var h = html;
7161
7162         h[h.length] = '<span class="' + C.BUTTON + ' ' + C.DEFAULT + '">';
7163         h[h.length] = '<button type="button" id="' + this.id + '_submit' + '">';
7164         h[h.length] = this.__getCfg("submit", true);
7165         h[h.length] = '</button>';
7166         h[h.length] = '</span>';
7167         h[h.length] = '<span class="' + C.BUTTON +'">';
7168         h[h.length] = '<button type="button" id="' + this.id + '_cancel' + '">';
7169         h[h.length] = this.__getCfg("cancel", true);
7170         h[h.length] = '</button>';
7171         h[h.length] = '</span>';
7172
7173         return h;
7174     },
7175
7176     /**
7177      * Attaches DOM event listeners to the rendered elements
7178      * <p>
7179      * The method will call applyKeyListeners, to setup keyboard specific 
7180      * listeners
7181      * </p>
7182      * @method applyListeners
7183      */
7184     applyListeners : function() {
7185         var E = YAHOO.util.Event;
7186
7187         function yearUpdateHandler() {
7188             if (this.validate()) {
7189                 this.setYear(this._getYearFromUI());
7190             }
7191         }
7192
7193         function monthUpdateHandler() {
7194             this.setMonth(this._getMonthFromUI());
7195         }
7196
7197         E.on(this.submitEl, "click", this.submit, this, true);
7198         E.on(this.cancelEl, "click", this.cancel, this, true);
7199         E.on(this.yearEl, "blur", yearUpdateHandler, this, true);
7200         E.on(this.monthEl, "change", monthUpdateHandler, this, true);
7201
7202         if (this.__isIEQuirks) {
7203             YAHOO.util.Event.on(this.cal.oDomContainer, "resize", this._syncMask, this, true);
7204         }
7205
7206         this.applyKeyListeners();
7207     },
7208
7209     /**
7210      * Removes/purges DOM event listeners from the rendered elements
7211      * 
7212      * @method purgeListeners
7213      */
7214     purgeListeners : function() {
7215         var E = YAHOO.util.Event;
7216         E.removeListener(this.submitEl, "click", this.submit);
7217         E.removeListener(this.cancelEl, "click", this.cancel);
7218         E.removeListener(this.yearEl, "blur");
7219         E.removeListener(this.monthEl, "change");
7220         if (this.__isIEQuirks) {
7221             E.removeListener(this.cal.oDomContainer, "resize", this._syncMask);
7222         }
7223
7224         this.purgeKeyListeners();
7225     },
7226
7227     /**
7228      * Attaches DOM listeners for keyboard support. 
7229      * Tab/Shift-Tab looping, Enter Key Submit on Year element,
7230      * Up/Down/PgUp/PgDown year increment on Year element
7231      * <p>
7232      * NOTE: MacOSX Safari 2.x doesn't let you tab to buttons and 
7233      * MacOSX Gecko does not let you tab to buttons or select controls,
7234      * so for these browsers, Tab/Shift-Tab looping is limited to the 
7235      * elements which can be reached using the tab key.
7236      * </p>
7237      * @method applyKeyListeners
7238      */
7239     applyKeyListeners : function() {
7240         var E = YAHOO.util.Event,
7241             ua = YAHOO.env.ua;
7242
7243         // IE/Safari 3.1 doesn't fire keypress for arrow/pg keys (non-char keys)
7244         var arrowEvt = (ua.ie || ua.webkit) ? "keydown" : "keypress";
7245
7246         // - IE/Safari 3.1 doesn't fire keypress for non-char keys
7247         // - Opera doesn't allow us to cancel keydown or keypress for tab, but 
7248         //   changes focus successfully on keydown (keypress is too late to change focus - opera's already moved on).
7249         var tabEvt = (ua.ie || ua.opera || ua.webkit) ? "keydown" : "keypress";
7250
7251         // Everyone likes keypress for Enter (char keys) - whoo hoo!
7252         E.on(this.yearEl, "keypress", this._handleEnterKey, this, true);
7253
7254         E.on(this.yearEl, arrowEvt, this._handleDirectionKeys, this, true);
7255         E.on(this.lastCtrl, tabEvt, this._handleTabKey, this, true);
7256         E.on(this.firstCtrl, tabEvt, this._handleShiftTabKey, this, true);
7257     },
7258
7259     /**
7260      * Removes/purges DOM listeners for keyboard support
7261      *
7262      * @method purgeKeyListeners
7263      */
7264     purgeKeyListeners : function() {
7265         var E = YAHOO.util.Event,
7266             ua = YAHOO.env.ua;
7267
7268         var arrowEvt = (ua.ie || ua.webkit) ? "keydown" : "keypress";
7269         var tabEvt = (ua.ie || ua.opera || ua.webkit) ? "keydown" : "keypress";
7270
7271         E.removeListener(this.yearEl, "keypress", this._handleEnterKey);
7272         E.removeListener(this.yearEl, arrowEvt, this._handleDirectionKeys);
7273         E.removeListener(this.lastCtrl, tabEvt, this._handleTabKey);
7274         E.removeListener(this.firstCtrl, tabEvt, this._handleShiftTabKey);
7275     },
7276
7277     /**
7278      * Updates the Calendar/CalendarGroup's pagedate with the currently set month and year if valid.
7279      * <p>
7280      * If the currently set month/year is invalid, a validation error will be displayed and the 
7281      * Calendar/CalendarGroup's pagedate will not be updated.
7282      * </p>
7283      * @method submit
7284      */
7285     submit : function() {
7286         if (this.validate()) {
7287             this.hide();
7288
7289             this.setMonth(this._getMonthFromUI());
7290             this.setYear(this._getYearFromUI());
7291
7292             var cal = this.cal;
7293
7294             // Artificial delay, just to help the user see something changed
7295             var delay = YAHOO.widget.CalendarNavigator.UPDATE_DELAY;
7296             if (delay > 0) {
7297                 var nav = this;
7298                 window.setTimeout(function(){ nav._update(cal); }, delay);
7299             } else {
7300                 this._update(cal);
7301             }
7302         }
7303     },
7304
7305     /**
7306      * Updates the Calendar rendered state, based on the state of the CalendarNavigator
7307      * @method _update
7308      * @param cal The Calendar instance to update
7309      * @protected
7310      */
7311     _update : function(cal) {
7312         var date = YAHOO.widget.DateMath.getDate(this.getYear() - cal.cfg.getProperty("YEAR_OFFSET"), this.getMonth(), 1);
7313         cal.cfg.setProperty("pagedate", date);
7314         cal.render();
7315     },
7316
7317     /**
7318      * Hides the navigator and mask, without updating the Calendar/CalendarGroup's state
7319      * 
7320      * @method cancel
7321      */
7322     cancel : function() {
7323         this.hide();
7324     },
7325
7326     /**
7327      * Validates the current state of the UI controls
7328      * 
7329      * @method validate
7330      * @return {Boolean} true, if the current UI state contains valid values, false if not
7331      */
7332     validate : function() {
7333         if (this._getYearFromUI() !== null) {
7334             this.clearErrors();
7335             return true;
7336         } else {
7337             this.setYearError();
7338             this.setError(this.__getCfg("invalidYear", true));
7339             return false;
7340         }
7341     },
7342
7343     /**
7344      * Displays an error message in the Navigator's error panel
7345      * @method setError
7346      * @param {String} msg The error message to display
7347      */
7348     setError : function(msg) {
7349         if (this.errorEl) {
7350             this.errorEl.innerHTML = msg;
7351             this._show(this.errorEl, true);
7352         }
7353     },
7354
7355     /**
7356      * Clears the navigator's error message and hides the error panel
7357      * @method clearError 
7358      */
7359     clearError : function() {
7360         if (this.errorEl) {
7361             this.errorEl.innerHTML = "";
7362             this._show(this.errorEl, false);
7363         }
7364     },
7365
7366     /**
7367      * Displays the validation error UI for the year control
7368      * @method setYearError
7369      */
7370     setYearError : function() {
7371         YAHOO.util.Dom.addClass(this.yearEl, YAHOO.widget.CalendarNavigator.CLASSES.INVALID);
7372     },
7373
7374     /**
7375      * Removes the validation error UI for the year control
7376      * @method clearYearError
7377      */
7378     clearYearError : function() {
7379         YAHOO.util.Dom.removeClass(this.yearEl, YAHOO.widget.CalendarNavigator.CLASSES.INVALID);
7380     },
7381
7382     /**
7383      * Clears all validation and error messages in the UI
7384      * @method clearErrors
7385      */
7386     clearErrors : function() {
7387         this.clearError();
7388         this.clearYearError();
7389     },
7390
7391     /**
7392      * Sets the initial focus, based on the configured value
7393      * @method setInitialFocus
7394      */
7395     setInitialFocus : function() {
7396         var el = this.submitEl,
7397             f = this.__getCfg("initialFocus");
7398
7399         if (f && f.toLowerCase) {
7400             f = f.toLowerCase();
7401             if (f == "year") {
7402                 el = this.yearEl;
7403                 try {
7404                     this.yearEl.select();
7405                 } catch (selErr) {
7406                     // Ignore;
7407                 }
7408             } else if (f == "month") {
7409                 el = this.monthEl;
7410             }
7411         }
7412
7413         if (el && YAHOO.lang.isFunction(el.focus)) {
7414             try {
7415                 el.focus();
7416             } catch (focusErr) {
7417                 // TODO: Fall back if focus fails?
7418             }
7419         }
7420     },
7421
7422     /**
7423      * Removes all renderered HTML elements for the Navigator from
7424      * the DOM, purges event listeners and clears (nulls) any property
7425      * references to HTML references
7426      * @method erase
7427      */
7428     erase : function() {
7429         if (this.__rendered) {
7430             this.purgeListeners();
7431
7432             // Clear out innerHTML references
7433             this.yearEl = null;
7434             this.monthEl = null;
7435             this.errorEl = null;
7436             this.submitEl = null;
7437             this.cancelEl = null;
7438             this.firstCtrl = null;
7439             this.lastCtrl = null;
7440             if (this.navEl) {
7441                 this.navEl.innerHTML = "";
7442             }
7443
7444             var p = this.navEl.parentNode;
7445             if (p) {
7446                 p.removeChild(this.navEl);
7447             }
7448             this.navEl = null;
7449
7450             var pm = this.maskEl.parentNode;
7451             if (pm) {
7452                 pm.removeChild(this.maskEl);
7453             }
7454             this.maskEl = null;
7455             this.__rendered = false;
7456         }
7457     },
7458
7459     /**
7460      * Destroys the Navigator object and any HTML references
7461      * @method destroy
7462      */
7463     destroy : function() {
7464         this.erase();
7465         this._doc = null;
7466         this.cal = null;
7467         this.id = null;
7468     },
7469
7470     /**
7471      * Protected implementation to handle how UI elements are 
7472      * hidden/shown.
7473      *
7474      * @method _show
7475      * @protected
7476      */
7477     _show : function(el, bShow) {
7478         if (el) {
7479             YAHOO.util.Dom.setStyle(el, "display", (bShow) ? "block" : "none");
7480         }
7481     },
7482
7483     /**
7484      * Returns the month value (index), from the month UI element
7485      * @protected
7486      * @method _getMonthFromUI
7487      * @return {Number} The month index, or 0 if a UI element for the month
7488      * is not found
7489      */
7490     _getMonthFromUI : function() {
7491         if (this.monthEl) {
7492             return this.monthEl.selectedIndex;
7493         } else {
7494             return 0; // Default to Jan
7495         }
7496     },
7497
7498     /**
7499      * Returns the year value, from the Navitator's year UI element
7500      * @protected
7501      * @method _getYearFromUI
7502      * @return {Number} The year value set in the UI, if valid. null is returned if 
7503      * the UI does not contain a valid year value.
7504      */
7505     _getYearFromUI : function() {
7506         var NAV = YAHOO.widget.CalendarNavigator;
7507
7508         var yr = null;
7509         if (this.yearEl) {
7510             var value = this.yearEl.value;
7511             value = value.replace(NAV.TRIM, "$1");
7512
7513             if (NAV.YR_PATTERN.test(value)) {
7514                 yr = parseInt(value, 10);
7515             }
7516         }
7517         return yr;
7518     },
7519
7520     /**
7521      * Updates the Navigator's year UI, based on the year value set on the Navigator object
7522      * @protected
7523      * @method _updateYearUI
7524      */
7525     _updateYearUI : function() {
7526         if (this.yearEl && this._year !== null) {
7527             this.yearEl.value = this._year;
7528         }
7529     },
7530
7531     /**
7532      * Updates the Navigator's month UI, based on the month value set on the Navigator object
7533      * @protected
7534      * @method _updateMonthUI
7535      */
7536     _updateMonthUI : function() {
7537         if (this.monthEl) {
7538             this.monthEl.selectedIndex = this._month;
7539         }
7540     },
7541
7542     /**
7543      * Sets up references to the first and last focusable element in the Navigator's UI
7544      * in terms of tab order (Naviagator's firstEl and lastEl properties). The references
7545      * are used to control modality by looping around from the first to the last control
7546      * and visa versa for tab/shift-tab navigation.
7547      * <p>
7548      * See <a href="#applyKeyListeners">applyKeyListeners</a>
7549      * </p>
7550      * @protected
7551      * @method _setFirstLastElements
7552      */
7553     _setFirstLastElements : function() {
7554         this.firstCtrl = this.monthEl;
7555         this.lastCtrl = this.cancelEl;
7556
7557         // Special handling for MacOSX.
7558         // - Safari 2.x can't focus on buttons
7559         // - Gecko can't focus on select boxes or buttons
7560         if (this.__isMac) {
7561             if (YAHOO.env.ua.webkit && YAHOO.env.ua.webkit < 420){
7562                 this.firstCtrl = this.monthEl;
7563                 this.lastCtrl = this.yearEl;
7564             }
7565             if (YAHOO.env.ua.gecko) {
7566                 this.firstCtrl = this.yearEl;
7567                 this.lastCtrl = this.yearEl;
7568             }
7569         }
7570     },
7571
7572     /**
7573      * Default Keyboard event handler to capture Enter 
7574      * on the Navigator's year control (yearEl)
7575      * 
7576      * @method _handleEnterKey
7577      * @protected
7578      * @param {Event} e The DOM event being handled
7579      */
7580     _handleEnterKey : function(e) {
7581         var KEYS = YAHOO.util.KeyListener.KEY;
7582
7583         if (YAHOO.util.Event.getCharCode(e) == KEYS.ENTER) {
7584             YAHOO.util.Event.preventDefault(e);
7585             this.submit();
7586         }
7587     },
7588
7589     /**
7590      * Default Keyboard event handler to capture up/down/pgup/pgdown
7591      * on the Navigator's year control (yearEl).
7592      * 
7593      * @method _handleDirectionKeys
7594      * @protected
7595      * @param {Event} e The DOM event being handled
7596      */
7597     _handleDirectionKeys : function(e) {
7598         var E = YAHOO.util.Event,
7599             KEYS = YAHOO.util.KeyListener.KEY,
7600             NAV = YAHOO.widget.CalendarNavigator;
7601
7602         var value = (this.yearEl.value) ? parseInt(this.yearEl.value, 10) : null;
7603         if (isFinite(value)) {
7604             var dir = false;
7605             switch(E.getCharCode(e)) {
7606                 case KEYS.UP:
7607                     this.yearEl.value = value + NAV.YR_MINOR_INC;
7608                     dir = true;
7609                     break;
7610                 case KEYS.DOWN:
7611                     this.yearEl.value = Math.max(value - NAV.YR_MINOR_INC, 0);
7612                     dir = true;
7613                     break;
7614                 case KEYS.PAGE_UP:
7615                     this.yearEl.value = value + NAV.YR_MAJOR_INC;
7616                     dir = true;
7617                     break;
7618                 case KEYS.PAGE_DOWN:
7619                     this.yearEl.value = Math.max(value - NAV.YR_MAJOR_INC, 0);
7620                     dir = true;
7621                     break;
7622                 default:
7623                     break;
7624             }
7625             if (dir) {
7626                 E.preventDefault(e);
7627                 try {
7628                     this.yearEl.select();
7629                 } catch(err) {
7630                     // Ignore
7631                 }
7632             }
7633         }
7634     },
7635
7636     /**
7637      * Default Keyboard event handler to capture Tab 
7638      * on the last control (lastCtrl) in the Navigator.
7639      * 
7640      * @method _handleTabKey
7641      * @protected
7642      * @param {Event} e The DOM event being handled
7643      */
7644     _handleTabKey : function(e) {
7645         var E = YAHOO.util.Event,
7646             KEYS = YAHOO.util.KeyListener.KEY;
7647
7648         if (E.getCharCode(e) == KEYS.TAB && !e.shiftKey) {
7649             try {
7650                 E.preventDefault(e);
7651                 this.firstCtrl.focus();
7652             } catch (err) {
7653                 // Ignore - mainly for focus edge cases
7654             }
7655         }
7656     },
7657
7658     /**
7659      * Default Keyboard event handler to capture Shift-Tab 
7660      * on the first control (firstCtrl) in the Navigator.
7661      * 
7662      * @method _handleShiftTabKey
7663      * @protected
7664      * @param {Event} e The DOM event being handled
7665      */
7666     _handleShiftTabKey : function(e) {
7667         var E = YAHOO.util.Event,
7668             KEYS = YAHOO.util.KeyListener.KEY;
7669
7670         if (e.shiftKey && E.getCharCode(e) == KEYS.TAB) {
7671             try {
7672                 E.preventDefault(e);
7673                 this.lastCtrl.focus();
7674             } catch (err) {
7675                 // Ignore - mainly for focus edge cases
7676             }
7677         }
7678     },
7679
7680     /**
7681      * Retrieve Navigator configuration values from 
7682      * the parent Calendar/CalendarGroup's config value.
7683      * <p>
7684      * If it has not been set in the user provided configuration, the method will 
7685      * return the default value of the configuration property, as set in DEFAULT_CONFIG
7686      * </p>
7687      * @private
7688      * @method __getCfg
7689      * @param {String} Case sensitive property name.
7690      * @param {Boolean} true, if the property is a string property, false if not.
7691      * @return The value of the configuration property
7692      */
7693     __getCfg : function(prop, bIsStr) {
7694         var DEF_CFG = YAHOO.widget.CalendarNavigator.DEFAULT_CONFIG;
7695         var cfg = this.cal.cfg.getProperty("navigator");
7696
7697         if (bIsStr) {
7698             return (cfg !== true && cfg.strings && cfg.strings[prop]) ? cfg.strings[prop] : DEF_CFG.strings[prop];
7699         } else {
7700             return (cfg !== true && cfg[prop]) ? cfg[prop] : DEF_CFG[prop];
7701         }
7702     },
7703
7704     /**
7705      * Private flag, to identify MacOS
7706      * @private
7707      * @property __isMac
7708      */
7709     __isMac : (navigator.userAgent.toLowerCase().indexOf("macintosh") != -1)
7710
7711 };
7712 YAHOO.register("calendar", YAHOO.widget.Calendar, {version: "2.8.0r4", build: "2449"});
7713 // End of File include/javascript/yui/build/calendar/calendar.js
7714