
				/*
					Genearated file, do not edit! Generated by build.xml's "js.concatenate" target
					$Id$
				*/
			if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={}}YAHOO.namespace=function(){var a=arguments,b=null,d,e,c;for(d=0;d<a.length;d=d+1){c=(""+a[d]).split(".");b=YAHOO;for(e=(c[0]=="YAHOO")?1:0;e<c.length;e=e+1){b[c[e]]=b[c[e]]||{};b=b[c[e]]}}return b};YAHOO.log=function(b,a,c){var d=YAHOO.widget.Logger;if(d&&d.log){return d.log(b,a,c)}else{return false}};YAHOO.register=function(d,i,a){var e=YAHOO.env.modules,c,f,g,h,b;if(!e[d]){e[d]={versions:[],builds:[]}}c=e[d];f=a.version;g=a.build;h=YAHOO.env.listeners;c.name=d;c.version=f;c.build=g;c.versions.push(f);c.builds.push(g);c.mainClass=i;for(b=0;b<h.length;b=b+1){h[b](c)}if(i){i.VERSION=f;i.BUILD=g}else{YAHOO.log("mainClass is undefined for module "+d,"warn")}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(a){return YAHOO.env.modules[a]||null};YAHOO.env.ua=function(){var b={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:0},c=navigator.userAgent,a;if((/KHTML/).test(c)){b.webkit=1}a=c.match(/AppleWebKit\/([^\s]*)/);
if(a&&a[1]){b.webkit=parseFloat(a[1]);if(/ Mobile\//.test(c)){b.mobile="Apple"}else{a=c.match(/NokiaN[^\/]*/);if(a){b.mobile=a[0]}}a=c.match(/AdobeAIR\/([^\s]*)/);if(a){b.air=a[0]}}if(!b.webkit){a=c.match(/Opera[\s\/]([^\s]*)/);if(a&&a[1]){b.opera=parseFloat(a[1]);a=c.match(/Opera Mini[^;]*/);if(a){b.mobile=a[0]}}else{a=c.match(/MSIE\s([^;]*)/);if(a&&a[1]){b.ie=parseFloat(a[1])}else{a=c.match(/Gecko\/([^\s]*)/);if(a){b.gecko=1;a=c.match(/rv:([^\s\)]*)/);if(a&&a[1]){b.gecko=parseFloat(a[1])}}}}}a=c.match(/Caja\/([^\s]*)/);if(a&&a[1]){b.caja=parseFloat(a[1])}return b}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var d=YAHOO_config.listener,a=YAHOO.env.listeners,b=true,c;if(d){for(c=0;c<a.length;c=c+1){if(a[c]==d){b=false;break}}if(b){a.push(d)}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var f=YAHOO.lang,b="[object Array]",e="[object Function]",a=Object.prototype,c=["toString","valueOf"],d={isArray:function(g){return a.toString.apply(g)===b
},isBoolean:function(g){return typeof g==="boolean"},isFunction:function(g){return a.toString.apply(g)===e},isNull:function(g){return g===null},isNumber:function(g){return typeof g==="number"&&isFinite(g)},isObject:function(g){return(g&&(typeof g==="object"||f.isFunction(g)))||false},isString:function(g){return typeof g==="string"},isUndefined:function(g){return typeof g==="undefined"},_IEEnumFix:(YAHOO.env.ua.ie)?function(i,j){var k,g,h;for(k=0;k<c.length;k=k+1){g=c[k];h=j[g];if(f.isFunction(h)&&h!=a[g]){i[g]=h}}}:function(){},extend:function(h,g,i){if(!g||!h){throw new Error("extend failed, please check that all dependencies are included.")}var j=function(){},k;j.prototype=g.prototype;h.prototype=new j();h.prototype.constructor=h;h.superclass=g.prototype;if(g.prototype.constructor==a.constructor){g.prototype.constructor=g}if(i){for(k in i){if(f.hasOwnProperty(i,k)){h.prototype[k]=i[k]}}f._IEEnumFix(h.prototype,i)}},augmentObject:function(h,i){if(!i||!h){throw new Error("Absorb failed, verify dependencies.")
}var l=arguments,j,g,k=l[2];if(k&&k!==true){for(j=2;j<l.length;j=j+1){h[l[j]]=i[l[j]]}}else{for(g in i){if(k||!(g in h)){h[g]=i[g]}}f._IEEnumFix(h,i)}},augmentProto:function(g,h){if(!h||!g){throw new Error("Augment failed, verify dependencies.")}var j=[g.prototype,h.prototype],i;for(i=2;i<arguments.length;i=i+1){j.push(arguments[i])}f.augmentObject.apply(this,j)},dump:function(o,j){var m,k,h=[],g="{...}",n="f(){...}",i=", ",l=" => ";if(!f.isObject(o)){return o+""}else{if(o instanceof Date||("nodeType" in o&&"tagName" in o)){return o}else{if(f.isFunction(o)){return n}}}j=(f.isNumber(j))?j:3;if(f.isArray(o)){h.push("[");for(m=0,k=o.length;m<k;m=m+1){if(f.isObject(o[m])){h.push((j>0)?f.dump(o[m],j-1):g)}else{h.push(o[m])}h.push(i)}if(h.length>1){h.pop()}h.push("]")}else{h.push("{");for(m in o){if(f.hasOwnProperty(o,m)){h.push(m+l);if(f.isObject(o[m])){h.push((j>0)?f.dump(o[m],j-1):g)}else{h.push(o[m])}h.push(i)}}if(h.length>1){h.pop()}h.push("}")}return h.join("")},substitute:function(g,u,n){var q,r,s,k,j,h,l=[],t,p="dump",m=" ",v="{",i="}",o;
for(;;){q=g.lastIndexOf(v);if(q<0){break}r=g.indexOf(i,q);if(q+1>=r){break}t=g.substring(q+1,r);k=t;h=null;s=k.indexOf(m);if(s>-1){h=k.substring(s+1);k=k.substring(0,s)}j=u[k];if(n){j=n(k,j,h)}if(f.isObject(j)){if(f.isArray(j)){j=f.dump(j,parseInt(h,10))}else{h=h||"";o=h.indexOf(p);if(o>-1){h=h.substring(4)}if(j.toString===a.toString||o>-1){j=f.dump(j,parseInt(h,10))}else{j=j.toString()}}}else{if(!f.isString(j)&&!f.isNumber(j)){j="~-"+l.length+"-~";l[l.length]=t}}g=g.substring(0,q)+j+g.substring(r+1)}for(q=l.length-1;q>=0;q=q-1){g=g.replace(new RegExp("~-"+q+"-~"),"{"+l[q]+"}","g")}return g},trim:function(h){try{return h.replace(/^\s+|\s+$/g,"")}catch(g){return h}},merge:function(){var g={},i=arguments,j=i.length,h;for(h=0;h<j;h=h+1){f.augmentObject(g,i[h],true)}return g},later:function(h,n,g,l,k){h=h||0;n=n||{};var m=g,i=l,j,o;if(f.isString(g)){m=n[g]}if(!m){throw new TypeError("method undefined")}if(!f.isArray(i)){i=[l]}j=function(){m.apply(n,i)};o=(k)?setInterval(j,h):setTimeout(j,h);
return{interval:k,cancel:function(){if(this.interval){clearInterval(o)}else{clearTimeout(o)}}}},isValue:function(g){return(f.isObject(g)||f.isString(g)||f.isNumber(g)||f.isBoolean(g))}};f.hasOwnProperty=(a.hasOwnProperty)?function(h,g){return h&&h.hasOwnProperty(g)}:function(h,g){return !f.isUndefined(h[g])&&h.constructor.prototype[g]!==h[g]};d.augmentObject(f,d,true);YAHOO.util.Lang=f;f.augment=f.augmentProto;YAHOO.augment=f.augmentProto;YAHOO.extend=f.extend})();YAHOO.register("yahoo",YAHOO,{version:"2.7.0",build:"1799"});(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var ao=YAHOO.util,ai=YAHOO.lang,aE=YAHOO.env.ua,at=YAHOO.lang.trim,aN={},aJ={},ag=/^t(?:able|d|h)$/i,y=/color$/i,aj=window.document,z=aj.documentElement,aM="ownerDocument",aD="defaultView",av="documentElement",ax="compatMode",aP="offsetLeft",ae="offsetTop",aw="offsetParent",x="parentNode",aF="nodeType",aq="tagName",af="scrollLeft",aI="scrollTop",ad="getBoundingClientRect",au="getComputedStyle",aQ="currentStyle",ah="CSS1Compat",aO="BackCompat",aK="class",an="className",ak="",ar=" ",ay="(?:^|\\s)",aG="(?= |$)",Y="g",aB="position",aL="fixed",G="relative",aH="left",aC="top",az="medium",aA="borderLeftWidth",ac="borderTopWidth",ap=aE.opera,al=aE.webkit,am=aE.gecko,aa=aE.ie;
ao.Dom={CUSTOM_ATTRIBUTES:(!z.hasAttribute)?{"for":"htmlFor","class":an}:{htmlFor:"for",className:aK},get:function(f){var e,d,c,a,b;if(f){if(f[aF]||f.item){return f}if(typeof f==="string"){e=f;f=aj.getElementById(f);if(f&&f.id===e){return f}else{if(f&&aj.all){f=null;d=aj.all[e];for(a=0,b=d.length;a<b;++a){if(d[a].id===e){return d[a]}}}}return f}if(f.DOM_EVENTS){f=f.get("element")}if("length" in f){c=[];for(a=0,b=f.length;a<b;++a){c[c.length]=ao.Dom.get(f[a])}return c}return f}return null},getComputedStyle:function(a,b){if(window[au]){return a[aM][aD][au](a,null)[b]}else{if(a[aQ]){return ao.Dom.IE_ComputedStyle.get(a,b)}}},getStyle:function(a,b){return ao.Dom.batch(a,ao.Dom._getStyle,b)},_getStyle:function(){if(window[au]){return function(b,d){d=(d==="float")?d="cssFloat":ao.Dom._toCamel(d);var a=b.style[d],c;if(!a){c=b[aM][aD][au](b,null);if(c){a=c[d]}}return a}}else{if(z[aQ]){return function(b,e){var a;switch(e){case"opacity":a=100;try{a=b.filters["DXImageTransform.Microsoft.Alpha"].opacity
}catch(d){try{a=b.filters("alpha").opacity}catch(c){}}return a/100;case"float":e="styleFloat";default:e=ao.Dom._toCamel(e);a=b[aQ]?b[aQ][e]:null;return(b.style[e]||a)}}}}}(),setStyle:function(b,c,a){ao.Dom.batch(b,ao.Dom._setStyle,{prop:c,val:a})},_setStyle:function(){if(aa){return function(c,b){var a=ao.Dom._toCamel(b.prop),d=b.val;if(c){switch(a){case"opacity":if(ai.isString(c.style.filter)){c.style.filter="alpha(opacity="+d*100+")";if(!c[aQ]||!c[aQ].hasLayout){c.style.zoom=1}}break;case"float":a="styleFloat";default:c.style[a]=d}}else{}}}else{return function(c,b){var a=ao.Dom._toCamel(b.prop),d=b.val;if(c){if(a=="float"){a="cssFloat"}c.style[a]=d}else{}}}}(),getXY:function(a){return ao.Dom.batch(a,ao.Dom._getXY)},_canPosition:function(a){return(ao.Dom._getStyle(a,"display")!=="none"&&ao.Dom._inDoc(a))},_getXY:function(){if(aj[av][ad]){return function(j){var i,a,h,c,d,e,f,l,k,g=Math.floor,b=false;if(ao.Dom._canPosition(j)){h=j[ad]();c=j[aM];i=ao.Dom.getDocumentScrollLeft(c);a=ao.Dom.getDocumentScrollTop(c);
b=[g(h[aH]),g(h[aC])];if(aa&&aE.ie<8){d=2;e=2;f=c[ax];l=ab(c[av],aA);k=ab(c[av],ac);if(aE.ie===6){if(f!==aO){d=0;e=0}}if((f==aO)){if(l!==az){d=parseInt(l,10)}if(k!==az){e=parseInt(k,10)}}b[0]-=d;b[1]-=e}if((a||i)){b[0]+=i;b[1]+=a}b[0]=g(b[0]);b[1]=g(b[1])}else{}return b}}else{return function(h){var a,g,f,d,c,e=false,b=h;if(ao.Dom._canPosition(h)){e=[h[aP],h[ae]];a=ao.Dom.getDocumentScrollLeft(h[aM]);g=ao.Dom.getDocumentScrollTop(h[aM]);c=((am||aE.webkit>519)?true:false);while((b=b[aw])){e[0]+=b[aP];e[1]+=b[ae];if(c){e=ao.Dom._calcBorders(b,e)}}if(ao.Dom._getStyle(h,aB)!==aL){b=h;while((b=b[x])&&b[aq]){f=b[aI];d=b[af];if(am&&(ao.Dom._getStyle(b,"overflow")!=="visible")){e=ao.Dom._calcBorders(b,e)}if(f||d){e[0]-=d;e[1]-=f}}e[0]+=a;e[1]+=g}else{if(ap){e[0]-=a;e[1]-=g}else{if(al||am){e[0]+=a;e[1]+=g}}}e[0]=Math.floor(e[0]);e[1]=Math.floor(e[1])}else{}return e}}}(),getX:function(a){var b=function(c){return ao.Dom.getXY(c)[0]};return ao.Dom.batch(a,b,ao.Dom,true)},getY:function(a){var b=function(c){return ao.Dom.getXY(c)[1]
};return ao.Dom.batch(a,b,ao.Dom,true)},setXY:function(b,a,c){ao.Dom.batch(b,ao.Dom._setXY,{pos:a,noRetry:c})},_setXY:function(i,f){var e=ao.Dom._getStyle(i,aB),g=ao.Dom.setStyle,b=f.pos,a=f.noRetry,d=[parseInt(ao.Dom.getComputedStyle(i,aH),10),parseInt(ao.Dom.getComputedStyle(i,aC),10)],c,h;if(e=="static"){e=G;g(i,aB,e)}c=ao.Dom._getXY(i);if(!b||c===false){return false}if(isNaN(d[0])){d[0]=(e==G)?0:i[aP]}if(isNaN(d[1])){d[1]=(e==G)?0:i[ae]}if(b[0]!==null){g(i,aH,b[0]-c[0]+d[0]+"px")}if(b[1]!==null){g(i,aC,b[1]-c[1]+d[1]+"px")}if(!a){h=ao.Dom._getXY(i);if((b[0]!==null&&h[0]!=b[0])||(b[1]!==null&&h[1]!=b[1])){ao.Dom._setXY(i,{pos:b,noRetry:true})}}},setX:function(b,a){ao.Dom.setXY(b,[a,null])},setY:function(a,b){ao.Dom.setXY(a,[null,b])},getRegion:function(a){var b=function(c){var d=false;if(ao.Dom._canPosition(c)){d=ao.Region.getRegion(c)}else{}return d};return ao.Dom.batch(a,b,ao.Dom,true)},getClientWidth:function(){return ao.Dom.getViewportWidth()},getClientHeight:function(){return ao.Dom.getViewportHeight()
},getElementsByClassName:function(f,b,e,c,j,d){f=ai.trim(f);b=b||"*";e=(e)?ao.Dom.get(e):null||aj;if(!e){return[]}var a=[],k=e.getElementsByTagName(b),h=ao.Dom.hasClass;for(var i=0,g=k.length;i<g;++i){if(h(k[i],f)){a[a.length]=k[i]}}if(c){ao.Dom.batch(a,c,j,d)}return a},hasClass:function(b,a){return ao.Dom.batch(b,ao.Dom._hasClass,a)},_hasClass:function(a,c){var b=false,d;if(a&&c){d=ao.Dom.getAttribute(a,an)||ak;if(c.exec){b=c.test(d)}else{b=c&&(ar+d+ar).indexOf(ar+c+ar)>-1}}else{}return b},addClass:function(b,a){return ao.Dom.batch(b,ao.Dom._addClass,a)},_addClass:function(a,c){var b=false,d;if(a&&c){d=ao.Dom.getAttribute(a,an)||ak;if(!ao.Dom._hasClass(a,c)){ao.Dom.setAttribute(a,an,at(d+ar+c));b=true}}else{}return b},removeClass:function(b,a){return ao.Dom.batch(b,ao.Dom._removeClass,a)},_removeClass:function(f,a){var e=false,d,c,b;if(f&&a){d=ao.Dom.getAttribute(f,an)||ak;ao.Dom.setAttribute(f,an,d.replace(ao.Dom._getClassRegex(a),ak));c=ao.Dom.getAttribute(f,an);if(d!==c){ao.Dom.setAttribute(f,an,at(c));
e=true;if(ao.Dom.getAttribute(f,an)===""){b=(f.hasAttribute&&f.hasAttribute(aK))?aK:an;f.removeAttribute(b)}}}else{}return e},replaceClass:function(a,c,b){return ao.Dom.batch(a,ao.Dom._replaceClass,{from:c,to:b})},_replaceClass:function(g,a){var f,c,e,b=false,d;if(g&&a){c=a.from;e=a.to;if(!e){b=false}else{if(!c){b=ao.Dom._addClass(g,a.to)}else{if(c!==e){d=ao.Dom.getAttribute(g,an)||ak;f=(ar+d.replace(ao.Dom._getClassRegex(c),ar+e)).split(ao.Dom._getClassRegex(e));f.splice(1,0,ar+e);ao.Dom.setAttribute(g,an,at(f.join(ak)));b=true}}}}else{}return b},generateId:function(b,a){a=a||"yui-gen";var c=function(e){if(e&&e.id){return e.id}var d=a+YAHOO.env._id_counter++;if(e){if(e[aM].getElementById(d)){return ao.Dom.generateId(e,d+a)}e.id=d}return d};return ao.Dom.batch(b,c,ao.Dom,true)||c.apply(ao.Dom,arguments)},isAncestor:function(c,a){c=ao.Dom.get(c);a=ao.Dom.get(a);var b=false;if((c&&a)&&(c[aF]&&a[aF])){if(c.contains&&c!==a){b=c.contains(a)}else{if(c.compareDocumentPosition){b=!!(c.compareDocumentPosition(a)&16)
}}}else{}return b},inDocument:function(a,b){return ao.Dom._inDoc(ao.Dom.get(a),b)},_inDoc:function(c,a){var b=false;if(c&&c[aq]){a=a||c[aM];b=ao.Dom.isAncestor(a[av],c)}else{}return b},getElementsBy:function(a,b,f,d,i,e,c){b=b||"*";f=(f)?ao.Dom.get(f):null||aj;if(!f){return[]}var j=[],k=f.getElementsByTagName(b);for(var h=0,g=k.length;h<g;++h){if(a(k[h])){if(c){j=k[h];break}else{j[j.length]=k[h]}}}if(d){ao.Dom.batch(j,d,i,e)}return j},getElementBy:function(a,b,c){return ao.Dom.getElementsBy(a,b,c,null,null,null,true)},batch:function(a,c,f,e){var g=[],d=(e)?f:window;a=(a&&(a[aq]||a.item))?a:ao.Dom.get(a);if(a&&c){if(a[aq]||a.length===undefined){return c.call(d,a,f)}for(var b=0;b<a.length;++b){g[g.length]=c.call(d,a[b],f)}}else{return false}return g},getDocumentHeight:function(){var b=(aj[ax]!=ah||al)?aj.body.scrollHeight:z.scrollHeight,a=Math.max(b,ao.Dom.getViewportHeight());return a},getDocumentWidth:function(){var b=(aj[ax]!=ah||al)?aj.body.scrollWidth:z.scrollWidth,a=Math.max(b,ao.Dom.getViewportWidth());
return a},getViewportHeight:function(){var a=self.innerHeight,b=aj[ax];if((b||aa)&&!ap){a=(b==ah)?z.clientHeight:aj.body.clientHeight}return a},getViewportWidth:function(){var a=self.innerWidth,b=aj[ax];if(b||aa){a=(b==ah)?z.clientWidth:aj.body.clientWidth}return a},getAncestorBy:function(a,b){while((a=a[x])){if(ao.Dom._testElement(a,b)){return a}}return null},getAncestorByClassName:function(c,b){c=ao.Dom.get(c);if(!c){return null}var a=function(d){return ao.Dom.hasClass(d,b)};return ao.Dom.getAncestorBy(c,a)},getAncestorByTagName:function(c,b){c=ao.Dom.get(c);if(!c){return null}var a=function(d){return d[aq]&&d[aq].toUpperCase()==b.toUpperCase()};return ao.Dom.getAncestorBy(c,a)},getPreviousSiblingBy:function(a,b){while(a){a=a.previousSibling;if(ao.Dom._testElement(a,b)){return a}}return null},getPreviousSibling:function(a){a=ao.Dom.get(a);if(!a){return null}return ao.Dom.getPreviousSiblingBy(a)},getNextSiblingBy:function(a,b){while(a){a=a.nextSibling;if(ao.Dom._testElement(a,b)){return a
}}return null},getNextSibling:function(a){a=ao.Dom.get(a);if(!a){return null}return ao.Dom.getNextSiblingBy(a)},getFirstChildBy:function(b,a){var c=(ao.Dom._testElement(b.firstChild,a))?b.firstChild:null;return c||ao.Dom.getNextSiblingBy(b.firstChild,a)},getFirstChild:function(a,b){a=ao.Dom.get(a);if(!a){return null}return ao.Dom.getFirstChildBy(a)},getLastChildBy:function(b,a){if(!b){return null}var c=(ao.Dom._testElement(b.lastChild,a))?b.lastChild:null;return c||ao.Dom.getPreviousSiblingBy(b.lastChild,a)},getLastChild:function(a){a=ao.Dom.get(a);return ao.Dom.getLastChildBy(a)},getChildrenBy:function(c,d){var a=ao.Dom.getFirstChildBy(c,d),b=a?[a]:[];ao.Dom.getNextSiblingBy(a,function(e){if(!d||d(e)){b[b.length]=e}return false});return b},getChildren:function(a){a=ao.Dom.get(a);if(!a){}return ao.Dom.getChildrenBy(a)},getDocumentScrollLeft:function(a){a=a||aj;return Math.max(a[av].scrollLeft,a.body.scrollLeft)},getDocumentScrollTop:function(a){a=a||aj;return Math.max(a[av].scrollTop,a.body.scrollTop)
},insertBefore:function(b,a){b=ao.Dom.get(b);a=ao.Dom.get(a);if(!b||!a||!a[x]){return null}return a[x].insertBefore(b,a)},insertAfter:function(b,a){b=ao.Dom.get(b);a=ao.Dom.get(a);if(!b||!a||!a[x]){return null}if(a.nextSibling){return a[x].insertBefore(b,a.nextSibling)}else{return a[x].appendChild(b)}},getClientRegion:function(){var a=ao.Dom.getDocumentScrollTop(),c=ao.Dom.getDocumentScrollLeft(),d=ao.Dom.getViewportWidth()+c,b=ao.Dom.getViewportHeight()+a;return new ao.Region(a,d,b,c)},setAttribute:function(c,b,a){b=ao.Dom.CUSTOM_ATTRIBUTES[b]||b;c.setAttribute(b,a)},getAttribute:function(b,a){a=ao.Dom.CUSTOM_ATTRIBUTES[a]||a;return b.getAttribute(a)},_toCamel:function(c){var a=aN;function b(e,d){return d.toUpperCase()}return a[c]||(a[c]=c.indexOf("-")===-1?c:c.replace(/-([a-z])/gi,b))},_getClassRegex:function(b){var a;if(b!==undefined){if(b.exec){a=b}else{a=aJ[b];if(!a){b=b.replace(ao.Dom._patterns.CLASS_RE_TOKENS,"\\$1");a=aJ[b]=new RegExp(ay+b+aG,Y)}}}return a},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}])/g},_testElement:function(a,b){return a&&a[aF]==1&&(!b||b(a))
},_calcBorders:function(a,d){var c=parseInt(ao.Dom[au](a,ac),10)||0,b=parseInt(ao.Dom[au](a,aA),10)||0;if(am){if(ag.test(a[aq])){c=0;b=0}}d[0]+=b;d[1]+=c;return d}};var ab=ao.Dom[au];if(aE.opera){ao.Dom[au]=function(c,b){var a=ab(c,b);if(y.test(b)){a=ao.Dom.Color.toRGB(a)}return a}}if(aE.webkit){ao.Dom[au]=function(c,b){var a=ab(c,b);if(a==="rgba(0, 0, 0, 0)"){a="transparent"}return a}}})();YAHOO.util.Region=function(c,b,a,d){this.top=c;this.y=c;this[1]=c;this.right=b;this.bottom=a;this.left=d;this.x=d;this[0]=d;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(b){var d=Math.max(this.top,b.top),c=Math.min(this.right,b.right),a=Math.min(this.bottom,b.bottom),e=Math.max(this.left,b.left);if(a>=d&&c>=e){return new YAHOO.util.Region(d,c,a,e)
}else{return null}};YAHOO.util.Region.prototype.union=function(b){var d=Math.min(this.top,b.top),c=Math.max(this.right,b.right),a=Math.max(this.bottom,b.bottom),e=Math.min(this.left,b.left);return new YAHOO.util.Region(d,c,a,e)};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 b=YAHOO.util.Dom.getXY(d),e=b[1],c=b[0]+d.offsetWidth,a=b[1]+d.offsetHeight,f=b[0];return new YAHOO.util.Region(e,c,a,f)};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 v=YAHOO.util,w="clientTop",r="clientLeft",n="parentNode",m="right",a="hasLayout",o="px",c="opacity",l="auto",t="borderLeftWidth",q="borderTopWidth",h="borderRightWidth",b="borderBottomWidth",e="visible",g="transparent",j="height",s="width",p="style",d="currentStyle",f=/^width|height$/,i=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,k={get:function(A,y){var z="",x=A[d][y];
if(y===c){z=v.Dom.getStyle(A,c)}else{if(!x||(x.indexOf&&x.indexOf(o)>-1)){z=x}else{if(v.Dom.IE_COMPUTED[y]){z=v.Dom.IE_COMPUTED[y](A,y)}else{if(i.test(x)){z=v.Dom.IE.ComputedStyle.getPixel(A,y)}else{z=x}}}}return z},getOffset:function(A,z){var x=A[d][z],E=z.charAt(0).toUpperCase()+z.substr(1),D="offset"+E,C="pixel"+E,y="",B;if(x==l){B=A[D];if(B===undefined){y=0}y=B;if(f.test(z)){A[p][z]=B;if(A[D]>B){y=B-(A[D]-B)}A[p][z]=l}}else{if(!A[p][C]&&!A[p][z]){A[p][z]=x}y=A[p][C]}return y+o},getBorderWidth:function(z,x){var y=null;if(!z[d][a]){z[p].zoom=1}switch(x){case q:y=z[w];break;case b:y=z.offsetHeight-z.clientHeight-z[w];break;case t:y=z[r];break;case h:y=z.offsetWidth-z.clientWidth-z[r];break}return y+o},getPixel:function(A,B){var y=null,x=A[d][m],z=A[d][B];A[p][m]=z;y=A[p].pixelRight;A[p][m]=x;return y+o},getMargin:function(y,z){var x;if(y[d][z]==l){x=0+o}else{x=v.Dom.IE.ComputedStyle.getPixel(y,z)}return x},getVisibility:function(y,z){var x;while((x=y[d])&&x[z]=="inherit"){y=y[n]}return(x)?x[z]:e
},getColor:function(x,y){return v.Dom.Color.toRGB(x[d][y])||g},getBorderColor:function(z,A){var y=z[d],x=y[A]||y.color;return v.Dom.Color.toRGB(v.Dom.Color.toHex(x))}},u={};u.top=u.right=u.bottom=u.left=u[s]=u[j]=k.getOffset;u.color=k.getColor;u[q]=u[h]=u[b]=u[t]=k.getBorderWidth;u.marginTop=u.marginRight=u.marginBottom=u.marginLeft=k.getMargin;u.visibility=k.getVisibility;u.borderColor=u.borderTopColor=u.borderRightColor=u.borderBottomColor=u.borderLeftColor=k.getBorderColor;v.Dom.IE_COMPUTED=u;v.Dom.IE_ComputedStyle=k})();(function(){var c="toString",a=parseInt,d=RegExp,b=YAHOO.util;b.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(!b.Dom.Color.re_RGB.test(e)){e=b.Dom.Color.toHex(e)
}if(b.Dom.Color.re_hex.exec(e)){e="rgb("+[a(d.$1,16),a(d.$2,16),a(d.$3,16)].join(", ")+")"}return e},toHex:function(e){e=b.Dom.Color.KEYWORDS[e]||e;if(b.Dom.Color.re_RGB.exec(e)){var f=(d.$1.length===1)?"0"+d.$1:Number(d.$1),g=(d.$2.length===1)?"0"+d.$2:Number(d.$2),h=(d.$3.length===1)?"0"+d.$3:Number(d.$3);e=[f[c](16),g[c](16),h[c](16)].join("")}if(e.length<6){e=e.replace(b.Dom.Color.re_hex3,"$1$1")}if(e!=="transparent"&&e.indexOf("#")<0){e="#"+e}return e.toLowerCase()}}}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.7.0",build:"1799"});YAHOO.util.CustomEvent=function(c,d,e,a){this.type=c;this.scope=d||window;this.silent=e;this.signature=a||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var b="_YUICEOnSubscribe";if(c!==b){this.subscribeEvent=new YAHOO.util.CustomEvent(b,this,true)}this.lastError=null};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(a,c,b){if(!a){throw new Error("Invalid callback for subscriber to '"+this.type+"'")
}if(this.subscribeEvent){this.subscribeEvent.fire(a,c,b)}this.subscribers.push(new YAHOO.util.Subscriber(a,c,b))},unsubscribe:function(d,b){if(!d){return this.unsubscribeAll()}var c=false;for(var f=0,a=this.subscribers.length;f<a;++f){var e=this.subscribers[f];if(e&&e.contains(d,b)){this._delete(f);c=true}}return c},fire:function(){this.lastError=null;var g=[],m=this.subscribers.length;if(!m&&this.silent){return true}var i=[].slice.call(arguments,0),k=true,a,h=false;if(!this.silent){}var b=this.subscribers.slice(),d=YAHOO.util.Event.throwErrors;for(a=0;a<m;++a){var e=b[a];if(!e){h=true}else{if(!this.silent){}var f=e.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var c=null;if(i.length>0){c=i[0]}try{k=e.fn.call(f,c,e.obj)}catch(l){this.lastError=l;if(d){throw l}}}else{try{k=e.fn.call(f,this.type,i,e.obj)}catch(j){this.lastError=j;if(d){throw j}}}if(false===k){if(!this.silent){}break}}}return(k!==false)},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,c,b){this.fn=a;this.obj=YAHOO.lang.isUndefined(c)?null:c;this.overrideContext=b};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 i=false;var h=[];var g=[];var j=[];var l=[];var b=0;var k=[];var c=[];var d=0;var a={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var f=YAHOO.env.ua.ie?"focusin":"focus";
var e=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var n=this;var m=function(){n._tryPreloadAttach()};this._interval=setInterval(m,this.POLL_INTERVAL)}},onAvailable:function(m,q,o,n,p){var s=(YAHOO.lang.isString(m))?[m]:m;for(var r=0;r<s.length;r=r+1){k.push({id:s[r],fn:q,obj:o,overrideContext:n,checkReady:p})}b=this.POLL_RETRYS;this.startInterval()},onContentReady:function(m,p,o,n){this.onAvailable(m,p,o,n,true)},onDOMReady:function(o,n,m){if(this.DOMReady){setTimeout(function(){var p=window;if(m){if(m===true){p=n}else{p=m}}o.call(p,"DOMReady",[],n)},0)}else{this.DOMReadyEvent.subscribe(o,n,m)}},_addListener:function(x,z,n,t,p,A){if(!n||!n.call){return false}if(this._isValidCollection(x)){var m=true;for(var s=0,q=x.length;
s<q;++s){m=this.on(x[s],z,n,t,p)&&m}return m}else{if(YAHOO.lang.isString(x)){var u=this.getEl(x);if(u){x=u}else{this.onAvailable(x,function(){YAHOO.util.Event.on(x,z,n,t,p)});return true}}}if(!x){return false}if("unload"==z&&t!==this){g[g.length]=[x,z,n,t,p];return true}var y=x;if(p){if(p===true){y=t}else{y=p}}var w=function(C){return n.call(y,YAHOO.util.Event.getEvent(C,x),t)};var B=[x,z,n,w,y,t,p];var r=h.length;h[r]=B;if(this.useLegacyEvent(x,z)){var v=this.getLegacyIndex(x,z);if(v==-1||x!=j[v][0]){v=j.length;c[x.id+z]=v;j[v]=[x,z,x["on"+z]];l[v]=[];x["on"+z]=function(C){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(C),v)}}l[v].push(B)}else{try{this._simpleAdd(x,z,w,A)}catch(o){this.lastError=o;this.removeListener(x,z,n);return false}}return true},addListener:function(p,m,q,o,n){return this._addListener(p,m,q,o,n,false)},addFocusListener:function(o,p,n,m){return this._addListener(o,f,p,n,m,true)},removeFocusListener:function(m,n){return this.removeListener(m,f,n)},addBlurListener:function(o,p,n,m){return this._addListener(o,e,p,n,m,true)
},removeBlurListener:function(m,n){return this.removeListener(m,e,n)},fireLegacyEvent:function(q,s){var o=true,v,m,n,u,p;m=l[s].slice();for(var t=0,r=m.length;t<r;++t){n=m[t];if(n&&n[this.WFN]){u=n[this.ADJ_SCOPE];p=n[this.WFN].call(u,q);o=(o&&p)}}v=j[s];if(v&&v[2]){v[2](q)}return o},getLegacyIndex:function(n,m){var o=this.generateId(n)+m;if(typeof c[o]=="undefined"){return -1}else{return c[o]}},useLegacyEvent:function(n,m){return(this.webkit&&this.webkit<419&&("click"==m||"dblclick"==m))},removeListener:function(w,x,o){var t,q,m;if(typeof w=="string"){w=this.getEl(w)}else{if(this._isValidCollection(w)){var n=true;for(t=w.length-1;t>-1;t--){n=(this.removeListener(w[t],x,o)&&n)}return n}}if(!o||!o.call){return this.purgeElement(w,false,x)}if("unload"==x){for(t=g.length-1;t>-1;t--){m=g[t];if(m&&m[0]==w&&m[1]==x&&m[2]==o){g.splice(t,1);return true}}return false}var s=null;var r=arguments[3];if("undefined"===typeof r){r=this._getCacheIndex(w,x,o)}if(r>=0){s=h[r]}if(!w||!s){return false}if(this.useLegacyEvent(w,x)){var u=this.getLegacyIndex(w,x);
var v=l[u];if(v){for(t=0,q=v.length;t<q;++t){m=v[t];if(m&&m[this.EL]==w&&m[this.TYPE]==x&&m[this.FN]==o){v.splice(t,1);break}}}}else{try{this._simpleRemove(w,x,s[this.WFN],false)}catch(p){this.lastError=p;return false}}delete h[r][this.WFN];delete h[r][this.FN];h.splice(r,1);return true},getTarget:function(m,n){var o=m.target||m.srcElement;return this.resolveTextNode(o)},resolveTextNode:function(m){try{if(m&&3==m.nodeType){return m.parentNode}}catch(n){}return m},getPageX:function(m){var n=m.pageX;if(!n&&0!==n){n=m.clientX||0;if(this.isIE){n+=this._getScrollLeft()}}return n},getPageY:function(n){var m=n.pageY;if(!m&&0!==m){m=n.clientY||0;if(this.isIE){m+=this._getScrollTop()}}return m},getXY:function(m){return[this.getPageX(m),this.getPageY(m)]},getRelatedTarget:function(m){var n=m.relatedTarget;if(!n){if(m.type=="mouseout"){n=m.toElement}else{if(m.type=="mouseover"){n=m.fromElement}}}return this.resolveTextNode(n)},getTime:function(m){if(!m.time){var n=new Date().getTime();try{m.time=n
}catch(o){this.lastError=o;return n}}return m.time},stopEvent:function(m){this.stopPropagation(m);this.preventDefault(m)},stopPropagation:function(m){if(m.stopPropagation){m.stopPropagation()}else{m.cancelBubble=true}},preventDefault:function(m){if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}},getEvent:function(n,p){var o=n||window.event;if(!o){var m=this.getEvent.caller;while(m){o=m.arguments[0];if(o&&Event==o.constructor){break}m=m.caller}}return o},getCharCode:function(m){var n=m.keyCode||m.charCode||0;if(YAHOO.env.ua.webkit&&(n in a)){n=a[n]}return n},_getCacheIndex:function(n,m,o){for(var p=0,q=h.length;p<q;p=p+1){var r=h[p];if(r&&r[this.FN]==o&&r[this.EL]==n&&r[this.TYPE]==m){return p}}return -1},generateId:function(n){var m=n.id;if(!m){m="yuievtautoid-"+d;++d;n.id=m}return m},_isValidCollection:function(m){try{return(m&&typeof m!=="string"&&m.length&&!m.tagName&&!m.alert&&typeof m[0]!=="undefined")}catch(n){return false}},elCache:{},getEl:function(m){return(typeof m==="string")?document.getElementById(m):m
},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(m){if(!i){i=true;var n=YAHOO.util.Event;n._ready();n._tryPreloadAttach()}},_ready:function(m){var n=YAHOO.util.Event;if(!n.DOMReady){n.DOMReady=true;n.DOMReadyEvent.fire();n._simpleRemove(document,"DOMContentLoaded",n._ready)}},_tryPreloadAttach:function(){if(k.length===0){b=0;if(this._interval){clearInterval(this._interval);this._interval=null}return}if(this.locked){return}if(this.isIE){if(!this.DOMReady){this.startInterval();return}}this.locked=true;var n=!i;if(!n){n=(b>0&&k.length>0)}var o=[];var m=function(v,u){var w=v;if(u.overrideContext){if(u.overrideContext===true){w=u.obj}else{w=u.overrideContext}}u.fn.call(w,u.obj)};var s,t,p,q,r=[];for(s=0,t=k.length;s<t;s=s+1){p=k[s];if(p){q=this.getEl(p.id);if(q){if(p.checkReady){if(i||q.nextSibling||!n){r.push(p);k[s]=null}}else{m(q,p);k[s]=null}}else{o.push(p)}}}for(s=0,t=r.length;s<t;s=s+1){p=r[s];m(this.getEl(p.id),p)}b--;if(n){for(s=k.length-1;
s>-1;s--){p=k[s];if(!p||!p.id){k.splice(s,1)}}this.startInterval()}else{if(this._interval){clearInterval(this._interval);this._interval=null}}this.locked=false},purgeElement:function(p,o,m){var r=(YAHOO.lang.isString(p))?this.getEl(p):p;var n=this.getListeners(r,m),q,t;if(n){for(q=n.length-1;q>-1;q--){var s=n[q];this.removeListener(r,s.type,s.fn)}}if(o&&r&&r.childNodes){for(q=0,t=r.childNodes.length;q<t;++q){this.purgeElement(r.childNodes[q],o,m)}}},getListeners:function(t,v){var q=[],u;if(!v){u=[h,g]}else{if(v==="unload"){u=[g]}else{u=[h]}}var o=(YAHOO.lang.isString(t))?this.getEl(t):t;for(var r=0;r<u.length;r=r+1){var m=u[r];if(m){for(var p=0,n=m.length;p<n;++p){var s=m[p];if(s&&s[this.EL]===o&&(!v||v===s[this.TYPE])){q.push({type:s[this.TYPE],fn:s[this.FN],obj:s[this.OBJ],adjust:s[this.OVERRIDE],scope:s[this.ADJ_SCOPE],index:p})}}}}return(q.length)?q:null},_unload:function(n){var t=YAHOO.util.Event,q,r,s,o,p,m=g.slice(),u;for(q=0,o=g.length;q<o;++q){s=m[q];if(s){u=window;if(s[t.ADJ_SCOPE]){if(s[t.ADJ_SCOPE]===true){u=s[t.UNLOAD_OBJ]
}else{u=s[t.ADJ_SCOPE]}}s[t.FN].call(u,t.getEvent(n,s[t.EL]),s[t.UNLOAD_OBJ]);m[q]=null}}s=null;u=null;g=null;if(h){for(r=h.length-1;r>-1;r--){s=h[r];if(s){t.removeListener(s[t.EL],s[t.TYPE],s[t.FN],r)}}s=null}j=null;t._simpleRemove(window,"unload",t._unload)},_getScrollLeft:function(){return this._getScroll()[1]},_getScrollTop:function(){return this._getScroll()[0]},_getScroll:function(){var n=document.documentElement,m=document.body;if(n&&(n.scrollTop||n.scrollLeft)){return[n.scrollTop,n.scrollLeft]}else{if(m){return[m.scrollTop,m.scrollLeft]}else{return[0,0]}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(n,m,o,p){n.addEventListener(m,o,(p))}}else{if(window.attachEvent){return function(n,m,o,p){n.attachEvent("on"+m,o)}}else{return function(){}}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(n,m,o,p){n.removeEventListener(m,o,(p))}}else{if(window.detachEvent){return function(n,m,o){n.detachEvent("on"+m,o)}}else{return function(){}
}}}()}}();(function(){var a=YAHOO.util.Event;a.on=a.addListener;a.onFocus=a.addFocusListener;a.onBlur=a.addBlurListener;if(a.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var b=document.createElement("p");a._dri=setInterval(function(){try{b.doScroll("left");clearInterval(a._dri);a._dri=null;a._ready();b=null}catch(c){}},a.POLL_INTERVAL)}else{if(a.webkit&&a.webkit<525){a._dri=setInterval(function(){var c=document.readyState;if("loaded"==c||"complete"==c){clearInterval(a._dri);a._dri=null;a._ready()}},a.POLL_INTERVAL)}else{a._simpleAdd(document,"DOMContentLoaded",a._ready)}}a._simpleAdd(window,"load",a._load);a._simpleAdd(window,"unload",a._unload);a._tryPreloadAttach()})()}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(a,e,b,c){this.__yui_events=this.__yui_events||{};var d=this.__yui_events[a];if(d){d.subscribe(e,b,c)}else{this.__yui_subscribers=this.__yui_subscribers||{};
var f=this.__yui_subscribers;if(!f[a]){f[a]=[]}f[a].push({fn:e,obj:b,overrideContext:c})}},unsubscribe:function(f,d,b){this.__yui_events=this.__yui_events||{};var a=this.__yui_events;if(f){var c=a[f];if(c){return c.unsubscribe(d,b)}}else{var g=true;for(var e in a){if(YAHOO.lang.hasOwnProperty(a,e)){g=g&&a[e].unsubscribe(d,b)}}return g}return false},unsubscribeAll:function(a){return this.unsubscribe(a)},createEvent:function(g,a){this.__yui_events=this.__yui_events||{};var d=a||{};var e=this.__yui_events;if(e[g]){}else{var f=d.scope||this;var i=(d.silent);var c=new YAHOO.util.CustomEvent(g,f,i,YAHOO.util.CustomEvent.FLAT);e[g]=c;if(d.onSubscribeCallback){c.subscribeEvent.subscribe(d.onSubscribeCallback)}this.__yui_subscribers=this.__yui_subscribers||{};var h=this.__yui_subscribers[g];if(h){for(var b=0;b<h.length;++b){c.subscribe(h[b].fn,h[b].obj,h[b].overrideContext)}}}return e[g]},fireEvent:function(d,e,a,f){this.__yui_events=this.__yui_events||{};var b=this.__yui_events[d];if(!b){return null
}var g=[];for(var c=1;c<arguments.length;++c){g.push(arguments[c])}return b.fire.apply(b,g)},hasEvent:function(a){if(this.__yui_events){if(this.__yui_events[a]){return true}}return false}};(function(){var a=YAHOO.util.Event,b=YAHOO.lang;YAHOO.util.KeyListener=function(i,d,h,g){if(!i){}else{if(!d){}else{if(!h){}}}if(!g){g=YAHOO.util.KeyListener.KEYDOWN}var f=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(b.isString(i)){i=document.getElementById(i)}if(b.isFunction(h)){f.subscribe(h)}else{f.subscribe(h.fn,h.scope,h.correctScope)}function e(m,n){if(!d.shift){d.shift=false}if(!d.alt){d.alt=false}if(!d.ctrl){d.ctrl=false}if(m.shiftKey==d.shift&&m.altKey==d.alt&&m.ctrlKey==d.ctrl){var l,o=d.keys,j;if(YAHOO.lang.isArray(o)){for(var k=0;k<o.length;k++){l=o[k];j=a.getCharCode(m);if(l==j){f.fire(j,m);break}}}else{j=a.getCharCode(m);if(o==j){f.fire(j,m)}}}}this.enable=function(){if(!this.enabled){a.on(i,g,e);
this.enabledEvent.fire(d)}this.enabled=true};this.disable=function(){if(this.enabled){a.removeListener(i,g,e);this.disabledEvent.fire(d)}this.enabled=false};this.toString=function(){return"KeyListener ["+d.keys+"] "+i.tagName+(i.id?"["+i.id+"]":"")}};var c=YAHOO.util.KeyListener;c.KEYDOWN="keydown";c.KEYUP="keyup";c.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.7.0",build:"1799"});YAHOO.register("yahoo-dom-event",YAHOO,{version:"2.7.0",build:"1799"});YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function(){if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,"click",function(c){var b=YAHOO.util.Event.getTarget(c),a=b.nodeName.toLowerCase();
if((a==="input"||a==="button")&&(b.type&&b.type.toLowerCase()=="submit")){YAHOO.util.Connect._submitElementValue=encodeURIComponent(b.name)+"="+encodeURIComponent(b.value)}});return true}return false})(),startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),uploadEvent:new YAHOO.util.CustomEvent("upload"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(a){this._msxml_progid.unshift(a)},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(g){var f,a;try{a=new XMLHttpRequest();f={conn:a,tId:g}}catch(d){for(var b=0;b<this._msxml_progid.length;++b){try{a=new ActiveXObject(this._msxml_progid[b]);f={conn:a,tId:g};break}catch(c){}}}finally{return f}},getConnectionObject:function(a){var c;var d=this._transaction_id;try{if(!a){c=this.createXhrObject(d)}else{c={};c.tId=d;c.isUpload=true}if(c){this._transaction_id++}}catch(b){}finally{return c}},asyncRequest:function(f,c,e,a){var d=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();var b=(e&&e.argument)?e.argument:null;if(!d){return null}else{if(e&&e.customevents){this.initCustomEvents(d,e)}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(d,e,c,a);return d}if(f.toUpperCase()=="GET"){if(this._sFormData.length!==0){c+=((c.indexOf("?")==-1)?"?":"&")+this._sFormData}}else{if(f.toUpperCase()=="POST"){a=a?this._sFormData+"&"+a:this._sFormData
}}}if(f.toUpperCase()=="GET"&&(e&&e.cache===false)){c+=((c.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString()}d.conn.open(f,c,true);if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true)}}if((f.toUpperCase()==="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header)}if(this._has_default_headers||this._has_http_headers){this.setHeader(d)}this.handleReadyState(d,e);d.conn.send(a||"");if(this._isFormSubmit===true){this.resetFormState()}this.startEvent.fire(d,b);if(d.startEvent){d.startEvent.fire(d,b)}return d}},initCustomEvents:function(a,c){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;var a=(d&&d.argument)?d.argument:null;
if(d&&d.timeout){this._timeOut[c.tId]=window.setTimeout(function(){b.abort(c,d,true)},d.timeout)}this._poll[c.tId]=window.setInterval(function(){if(c.conn&&c.conn.readyState===4){window.clearInterval(b._poll[c.tId]);delete b._poll[c.tId];if(d&&d.timeout){window.clearTimeout(b._timeOut[c.tId]);delete b._timeOut[c.tId]}b.completeEvent.fire(c,a);if(c.completeEvent){c.completeEvent.fire(c,a)}b.handleTransactionResponse(c,d)}},this._polling_interval)},handleTransactionResponse:function(g,h,a){var d,c;var b=(h&&h.argument)?h.argument:null;try{if(g.conn.status!==undefined&&g.conn.status!==0){d=g.conn.status}else{d=13030}}catch(f){d=13030}if(d>=200&&d<300||d===1223){c=this.createResponseObject(g,b);if(h&&h.success){if(!h.scope){h.success(c)}else{h.success.apply(h.scope,[c])}}this.successEvent.fire(c);if(g.successEvent){g.successEvent.fire(c)}}else{switch(d){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:c=this.createExceptionObject(g.tId,b,(a?a:false));if(h&&h.failure){if(!h.scope){h.failure(c)
}else{h.failure.apply(h.scope,[c])}}break;default:c=this.createResponseObject(g,b);if(h&&h.failure){if(!h.scope){h.failure(c)}else{h.failure.apply(h.scope,[c])}}}this.failureEvent.fire(c);if(g.failureEvent){g.failureEvent.fire(c)}}this.releaseObject(g);c=null},createResponseObject:function(a,h){var d={};var k={};try{var c=a.conn.getAllResponseHeaders();var g=c.split("\n");for(var f=0;f<g.length;f++){var b=g[f].indexOf(":");if(b!=-1){k[g[f].substring(0,b)]=g[f].substring(b+2)}}}catch(j){}d.tId=a.tId;d.status=(a.conn.status==1223)?204:a.conn.status;d.statusText=(a.conn.status==1223)?"No Content":a.conn.statusText;d.getResponseHeader=k;d.getAllResponseHeaders=c;d.responseText=a.conn.responseText;d.responseXML=a.conn.responseXML;if(h){d.argument=h}return d},createExceptionObject:function(h,d,a){var f=0;var g="communication failure";var c=-1;var b="transaction aborted";var e={};e.tId=h;if(a){e.status=c;e.statusText=b}else{e.status=f;e.statusText=g}if(d){e.argument=d}return e},initHeader:function(a,d,c){var b=(c)?this._default_headers:this._http_headers;
b[a]=d;if(c){this._has_default_headers=true}else{this._has_http_headers=true}},setHeader:function(a){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])}}delete this._http_headers;this._http_headers={};this._has_http_headers=false}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false},setForm:function(o,h,c){var n,b,m,k,r,l=false,f=[],q=0,e,g,d,p,a;this.resetFormState();if(typeof o=="string"){n=(document.getElementById(o)||document.forms[o])}else{if(typeof o=="object"){n=o}else{return}}if(h){this.createFrame(c?c:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=n;return}for(e=0,g=n.elements.length;e<g;++e){b=n.elements[e];r=b.disabled;
m=b.name;if(!r&&m){m=encodeURIComponent(m)+"=";k=encodeURIComponent(b.value);switch(b.type){case"select-one":if(b.selectedIndex>-1){a=b.options[b.selectedIndex];f[q++]=m+encodeURIComponent((a.attributes.value&&a.attributes.value.specified)?a.value:a.text)}break;case"select-multiple":if(b.selectedIndex>-1){for(d=b.selectedIndex,p=b.options.length;d<p;++d){a=b.options[d];if(a.selected){f[q++]=m+encodeURIComponent((a.attributes.value&&a.attributes.value.specified)?a.value:a.text)}}}break;case"radio":case"checkbox":if(b.checked){f[q++]=m+k}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(l===false){if(this._hasSubmitListener&&this._submitElementValue){f[q++]=this._submitElementValue}l=true}break;default:f[q++]=m+k}}}this._isFormSubmit=true;this._sFormData=f.join("&");this.initHeader("Content-Type",this._default_form_header);return this._sFormData},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData=""},createFrame:function(a){var b="yuiIO"+this._transaction_id;
var c;if(YAHOO.env.ua.ie){c=document.createElement('<iframe id="'+b+'" name="'+b+'" />');if(typeof a=="boolean"){c.src="javascript:false"}}else{c=document.createElement("iframe");c.id=b;c.name=b}c.style.position="absolute";c.style.top="-1000px";c.style.left="-1000px";document.body.appendChild(c)},appendPostData:function(a){var d=[],b=a.split("&"),c,e;for(c=0;c<b.length;c++){e=b[c].indexOf("=");if(e!=-1){d[c]=document.createElement("input");d[c].type="hidden";d[c].name=decodeURIComponent(b[c].substring(0,e));d[c].value=decodeURIComponent(b[c].substring(e+1));this._formNode.appendChild(d[c])}}return d},uploadFile:function(d,p,e,c){var j="yuiIO"+d.tId,k="multipart/form-data",m=document.getElementById(j),q=this,l=(p&&p.argument)?p.argument:null,n,h,b,g;var a={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",e);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",j);
if(YAHOO.env.ua.ie){this._formNode.setAttribute("encoding",k)}else{this._formNode.setAttribute("enctype",k)}if(c){n=this.appendPostData(c)}this._formNode.submit();this.startEvent.fire(d,l);if(d.startEvent){d.startEvent.fire(d,l)}if(p&&p.timeout){this._timeOut[d.tId]=window.setTimeout(function(){q.abort(d,p,true)},p.timeout)}if(n&&n.length>0){for(h=0;h<n.length;h++){this._formNode.removeChild(n[h])}}for(b in a){if(YAHOO.lang.hasOwnProperty(a,b)){if(a[b]){this._formNode.setAttribute(b,a[b])}else{this._formNode.removeAttribute(b)}}}this.resetFormState();var f=function(){if(p&&p.timeout){window.clearTimeout(q._timeOut[d.tId]);delete q._timeOut[d.tId]}q.completeEvent.fire(d,l);if(d.completeEvent){d.completeEvent.fire(d,l)}g={tId:d.tId,argument:p.argument};try{g.responseText=m.contentWindow.document.body?m.contentWindow.document.body.innerHTML:m.contentWindow.document.documentElement.textContent;g.responseXML=m.contentWindow.document.XMLDocument?m.contentWindow.document.XMLDocument:m.contentWindow.document
}catch(i){}if(p&&p.upload){if(!p.scope){p.upload(g)}else{p.upload.apply(p.scope,[g])}}q.uploadEvent.fire(g);if(d.uploadEvent){d.uploadEvent.fire(g)}YAHOO.util.Event.removeListener(m,"load",f);setTimeout(function(){document.body.removeChild(m);q.releaseObject(d)},100)};YAHOO.util.Event.addListener(m,"load",f)},abort:function(e,g,a){var d;var b=(g&&g.argument)?g.argument:null;if(e&&e.conn){if(this.isCallInProgress(e)){e.conn.abort();window.clearInterval(this._poll[e.tId]);delete this._poll[e.tId];if(a){window.clearTimeout(this._timeOut[e.tId]);delete this._timeOut[e.tId]}d=true}}else{if(e&&e.isUpload===true){var c="yuiIO"+e.tId;var f=document.getElementById(c);if(f){YAHOO.util.Event.removeListener(f,"load");document.body.removeChild(f);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(b){if(b&&b.conn){return b.conn.readyState!==4&&b.conn.readyState!==0
}else{if(b&&b.isUpload===true){var a="yuiIO"+b.tId;return document.getElementById(a)?true:false}else{return false}}},releaseObject:function(a){if(a&&a.conn){a.conn=null;a=null}}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.7.0",build:"1799"});(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,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,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}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}}}}}}}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&&!oParsedResponse.error){oParsedResponse=this.doBeforeCallback(oRequest,oFullResponse,oParsedResponse,oCallback);this.fireEvent("responseParseEvent",{request:oRequest,response:oParsedResponse,callback:oCallback,caller:oCaller});
this.addToCache(oRequest,oParsedResponse)}else{oParsedResponse.error=true;this.fireEvent("dataErrorEvent",{request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller,message:DS.ERROR_DATANULL})}oParsedResponse.tId=tId;DS.issueCallback(oCallback,[oRequest,oParsedResponse],oParsedResponse.error,oCaller)},doBeforeParseData:function(oRequest,oFullResponse,oCallback){return oFullResponse},doBeforeCallback:function(oRequest,oFullResponse,oParsedResponse,oCallback){return oParsedResponse},parseData:function(oRequest,oFullResponse){if(lang.isValue(oFullResponse)){var oParsedResponse={results:oFullResponse,meta:{}};return oParsedResponse}return null},parseArrayData:function(oRequest,oFullResponse){if(lang.isArray(oFullResponse)){var results=[],i,j,rec,field,data;if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(i=fields.length-1;i>=0;--i){if(typeof fields[i]!=="object"){fields[i]={key:fields[i]}}}var parsers={},p;for(i=fields.length-1;i>=0;--i){p=(typeof fields[i].parser==="function"?fields[i].parser:DS.Parser[fields[i].parser+""])||fields[i].converter;
if(p){parsers[fields[i].key]=p}}var arrType=lang.isArray(oFullResponse[0]);for(i=oFullResponse.length-1;i>-1;i--){var oResult={};rec=oFullResponse[i];if(typeof rec==="object"){for(j=fields.length-1;j>-1;j--){field=fields[j];data=arrType?rec[j]:rec[field.key];if(parsers[field.key]){data=parsers[field.key].call(this,data)}if(data===undefined){data=null}oResult[field.key]=data}}else{if(lang.isString(rec)){for(j=fields.length-1;j>-1;j--){field=fields[j];data=rec;if(parsers[field.key]){data=parsers[field.key].call(this,data)}if(data===undefined){data=null}oResult[field.key]=data}}}results[i]=oResult}}else{results=oFullResponse}var oParsedResponse={results:results};return oParsedResponse}return null},parseTextData:function(oRequest,oFullResponse){if(lang.isString(oFullResponse)){if(lang.isString(this.responseSchema.recordDelim)&&lang.isString(this.responseSchema.fieldDelim)){var oParsedResponse={results:[]};var recDelim=this.responseSchema.recordDelim;var fieldDelim=this.responseSchema.fieldDelim;
if(oFullResponse.length>0){var newLength=oFullResponse.length-recDelim.length;if(oFullResponse.substr(newLength)==recDelim){oFullResponse=oFullResponse.substr(0,newLength)}if(oFullResponse.length>0){var recordsarray=oFullResponse.split(recDelim);for(var i=0,len=recordsarray.length,recIdx=0;i<len;++i){var bError=false,sRecord=recordsarray[i];if(lang.isString(sRecord)&&(sRecord.length>0)){var fielddataarray=recordsarray[i].split(fieldDelim);var oResult={};if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(var j=fields.length-1;j>-1;j--){try{var data=fielddataarray[j];if(lang.isString(data)){if(data.charAt(0)=='"'){data=data.substr(1)}if(data.charAt(data.length-1)=='"'){data=data.substr(0,data.length-1)}var field=fields[j];var key=(lang.isValue(field.key))?field.key:field;if(!field.parser&&field.converter){field.parser=field.converter}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data)
}if(data===undefined){data=null}oResult[key]=data}else{bError=true}}catch(e){bError=true}}}else{oResult=fielddataarray}if(!bError){oParsedResponse.results[recIdx++]=oResult}}}}}return oParsedResponse}}return null},parseXMLResult:function(result){var oResult={},schema=this.responseSchema;try{for(var m=schema.fields.length-1;m>=0;m--){var field=schema.fields[m];var key=(lang.isValue(field.key))?field.key:field;var data=null;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{xmlList=(schema.resultNode)?oFullResponse.getElementsByTagName(schema.resultNode):null;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}}}}}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;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,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,callback:oCallback,caller:oCaller,message:DS.ERROR_DATAINVALID});if(lang.isString(this.liveData)&&lang.isString(oRequest)&&(this.liveData.lastIndexOf("?")!==this.liveData.length-1)&&(oRequest.indexOf("?")!==0)){}oResponse=oResponse||{};oResponse.error=true;DS.issueCallback(oCallback,[oRequest,oResponse],true,oCaller);return null};var _xhrCallback={success:_xhrSuccess,failure:_xhrFailure,scope:this};if(lang.isNumber(this.connTimeout)){_xhrCallback.timeout=this.connTimeout}if(this.connXhrMode=="cancelStaleRequests"){if(oQueue.conn){if(oConnMgr.abort){oConnMgr.abort(oQueue.conn);oQueue.conn=null}else{}}}if(oConnMgr&&oConnMgr.asyncRequest){var sLiveData=this.liveData;var isPost=this.connMethodPost;
var sMethod=(isPost)?"POST":"GET";var sUri=(isPost||!lang.isValue(oRequest))?sLiveData:sLiveData+oRequest;var sRequest=(isPost)?oRequest:null;if(this.connXhrMode!="queueRequests"){oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest)}else{if(oQueue.conn){var allRequests=oQueue.requests;allRequests.push({request:oRequest,callback:_xhrCallback});if(!oQueue.interval){oQueue.interval=setInterval(function(){if(oConnMgr.isCallInProgress(oQueue.conn)){return}else{if(allRequests.length>0){sUri=(isPost||!lang.isValue(allRequests[0].request))?sLiveData:sLiveData+allRequests[0].request;sRequest=(isPost)?allRequests[0].request:null;oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,allRequests[0].callback,sRequest);allRequests.shift()}else{clearInterval(oQueue.interval);oQueue.interval=null}}},50)}}else{oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest)}}}else{DS.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller)}return tId}});lang.augmentObject(util.XHRDataSource,DS);
util.DataSource=function(oLiveData,oConfigs){oConfigs=oConfigs||{};var dataType=oConfigs.dataType;if(dataType){if(dataType==DS.TYPE_LOCAL){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(c,g){var b=YAHOO.lang;if(!b.isValue(c)||(c==="")){return""}g=g||{};if(!b.isNumber(c)){c*=1}if(b.isNumber(c)){var e=(c<0);var l=c+"";var h=(g.decimalSeparator)?g.decimalSeparator:".";var j;if(b.isNumber(g.decimalPlaces)){var k=g.decimalPlaces;var d=Math.pow(10,k);l=Math.round(c*d)/d+"";j=l.lastIndexOf(".");if(k>0){if(j<0){l+=h;j=l.length-1}else{if(h!=="."){l=l.replace(".",h)}}while((l.length-1-j)<k){l+="0"}}}if(g.thousandsSeparator){var n=g.thousandsSeparator;j=l.lastIndexOf(h);j=(j>-1)?j:l.length;var m=l.substring(j);var a=-1;for(var f=j;f>0;f--){a++;if((a%3===0)&&(f!==j)&&(!e||(f>1))){m=n+m}m=l.charAt(f-1)+m}l=m}l=(g.prefix)?g.prefix+l:l;l=(g.suffix)?l+g.suffix:l;return l}else{return c}}};(function(){var a=function(c,e,d){if(typeof d==="undefined"){d=10}for(;parseInt(c,10)<d&&d>1;d/=10){c=e.toString()+c}return c.toString()};var b={formats:{a:function(e,c){return c.a[e.getDay()]
},A:function(e,c){return c.A[e.getDay()]},b:function(e,c){return c.b[e.getMonth()]},B:function(e,c){return c.B[e.getMonth()]},C:function(c){return a(parseInt(c.getFullYear()/100,10),0)},d:["getDate","0"],e:["getDate"," "],g:function(c){return a(parseInt(b.formats.G(c)%100,10),0)},G:function(f){var g=f.getFullYear();var e=parseInt(b.formats.V(f),10);var c=parseInt(b.formats.W(f),10);if(c>e){g++}else{if(c===0&&e>=52){g--}}return g},H:["getHours","0"],I:function(e){var c=e.getHours()%12;return a(c===0?12:c,0)},j:function(h){var g=new Date(""+h.getFullYear()+"/1/1 GMT");var e=new Date(""+h.getFullYear()+"/"+(h.getMonth()+1)+"/"+h.getDate()+" GMT");var c=e-g;var f=parseInt(c/60000/60/24,10)+1;return a(f,0,100)},k:["getHours"," "],l:function(e){var c=e.getHours()%12;return a(c===0?12:c," ")},m:function(c){return a(c.getMonth()+1,0)},M:["getMinutes","0"],p:function(e,c){return c.p[e.getHours()>=12?1:0]},P:function(e,c){return c.P[e.getHours()>=12?1:0]},s:function(e,c){return parseInt(e.getTime()/1000,10)
},S:["getSeconds","0"],u:function(c){var e=c.getDay();return e===0?7:e},U:function(g){var c=parseInt(b.formats.j(g),10);var f=6-g.getDay();var e=parseInt((c+f)/7,10);return a(e,0)},V:function(g){var f=parseInt(b.formats.W(g),10);var c=(new Date(""+g.getFullYear()+"/1/1")).getDay();var e=f+(c>4||c<=1?0:1);if(e===53&&(new Date(""+g.getFullYear()+"/12/31")).getDay()<4){e=1}else{if(e===0){e=b.formats.V(new Date(""+(g.getFullYear()-1)+"/12/31"))}}return a(e,0)},w:"getDay",W:function(g){var c=parseInt(b.formats.j(g),10);var f=7-b.formats.u(g);var e=parseInt((c+f)/7,10);return a(e,0,10)},y:function(c){return a(c.getFullYear()%100,0)},Y:"getFullYear",z:function(f){var e=f.getTimezoneOffset();var c=a(parseInt(Math.abs(e/60),10),0);var g=a(Math.abs(e%60),0);return(e>0?"-":"+")+c+g},Z:function(c){var e=c.toString().replace(/^.*:\d\d( GMT[+-]\d+)? \(?([A-Za-z ]+)\)?\d*$/,"$2").replace(/[a-z ]/g,"");if(e.length>4){e=b.formats.z(c)}return e},"%":function(c){return"%"}},aggregates:{c:"locale",D:"%m/%d/%y",F:"%Y-%m-%d",h:"%b",n:"\n",r:"locale",R:"%H:%M",t:"\t",T:"%H:%M:%S",x:"locale",X:"locale"},format:function(g,f,d){f=f||{};
if(!(g instanceof Date)){return YAHOO.lang.isValue(g)?g:""}var h=f.format||"%m/%d/%Y";if(h==="YYYY/MM/DD"){h="%Y/%m/%d"}else{if(h==="DD/MM/YYYY"){h="%d/%m/%Y"}else{if(h==="MM/DD/YYYY"){h="%m/%d/%Y"}}}d=d||"en";if(!(d in YAHOO.util.DateLocale)){if(d.replace(/-[a-zA-Z]+$/,"") in YAHOO.util.DateLocale){d=d.replace(/-[a-zA-Z]+$/,"")}else{d="en"}}var j=YAHOO.util.DateLocale[d];var c=function(l,k){var m=b.aggregates[k];return(m==="locale"?j[k]:m)};var e=function(l,k){var m=b.formats[k];if(typeof m==="string"){return g[m]()}else{if(typeof m==="function"){return m.call(g,g,j)}else{if(typeof m==="object"&&typeof m[0]==="string"){return a(g[m[0]](),m[1])}else{return k}}}};while(h.match(/%[cDFhnrRtTxX]/)){h=h.replace(/%([cDFhnrRtTxX])/g,c)}var i=h.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g,e);c=e=undefined;return i}};YAHOO.namespace("YAHOO.util");YAHOO.util.Date=b;YAHOO.util.DateLocale={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],r:"%I:%M:%S %p",x:"%d/%m/%y",X:"%T"};
YAHOO.util.DateLocale.en=YAHOO.lang.merge(YAHOO.util.DateLocale,{});YAHOO.util.DateLocale["en-US"]=YAHOO.lang.merge(YAHOO.util.DateLocale.en,{c:"%a %d %b %Y %I:%M:%S %p %Z",x:"%m/%d/%Y",X:"%I:%M:%S %p"});YAHOO.util.DateLocale["en-GB"]=YAHOO.lang.merge(YAHOO.util.DateLocale.en,{r:"%l:%M:%S %P %Z"});YAHOO.util.DateLocale["en-AU"]=YAHOO.lang.merge(YAHOO.util.DateLocale.en)})();YAHOO.register("datasource",YAHOO.util.DataSource,{version:"2.7.0",build:"1799"});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 instanceof YAHOO.util.DataSourceBase){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.toString=function(){return"AutoComplete "+this._sName
};YAHOO.widget.AutoComplete.prototype.getInputEl=function(){return this._elTextbox};YAHOO.widget.AutoComplete.prototype.getContainerEl=function(){return this._elContainer};YAHOO.widget.AutoComplete.prototype.isFocused=function(){return(this._bFocused===null)?false: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="block"}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="block"}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="block"}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=null;var a=(this.delimChar)?this._elTextbox.value+b:b;this._sendQuery(a)};YAHOO.widget.AutoComplete.prototype.collapseContainer=function(){this._toggleContainer(false)};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 h=l.scope,p=this,b=q.results,n=[],d=false,j=(p.queryMatchCase||h.queryMatchCase),a=(p.queryMatchContains||h.queryMatchContains);
for(var c=b.length-1;c>=0;c--){var f=b[c];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.unshift(f)}}}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;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=null;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._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.tabIndex=-1;b.style.padding=0;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;var a=this._elList||document.createElement("ul");var 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)}};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._onInterval=function(){var a=this._elTextbox.value;
var b=this._sLastTextboxValue;if(a!=b){this._sLastTextboxValue=a;this._sendQuery(a)}};YAHOO.widget.AutoComplete.prototype._clearInterval=function(){if(this._queryInterval){clearInterval(this._queryInterval);this._queryInterval=null}};YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(a){if((a==9)||(a==13)||(a==16)||(a==17)||(a>=18&&a<=20)||(a==27)||(a>=33&&a<=35)||(a>=36&&a<=40)||(a>=44&&a<=45)||(a==229)){return true}return false};YAHOO.widget.AutoComplete.prototype._sendQuery=function(d){if(this.minQueryLength<0){this._toggleContainer(false);return}if(this.delimChar){var a=this._extractQuery(d);d=a.query;this._sPastSelections=a.previous}if((d&&(d.length<this.minQueryLength))||(!d&&this.minQueryLength>0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID)}this._toggleContainer(false);return}d=encodeURIComponent(d);this._nDelayID=-1;if(this.dataSource.queryMatchSubset||this.queryMatchSubset){var c=this.getSubsetMatches(d);if(c){this.handleResponse(d,c,{query:d});return}}if(this.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._populateList=function(n,f,c){if(this._nTypeAheadDelayID!=-1){clearTimeout(this._nTypeAheadDelayID)}n=(c&&c.query)?c.query:n;var h=this.doBeforeLoadData(n,f,c);if(h&&!f.error){this.dataReturnEvent.fire(this,n,f.results);if(this._bFocused||(this._bFocused===null)){var p=decodeURIComponent(n);this._sCurQuery=p;this._bItemSelected=false;var u=f.results,a=Math.min(u.length,this.maxResultsDisplayed),m=(this.dataSource.responseSchema.fields)?(this.dataSource.responseSchema.fields[0].key||this.dataSource.responseSchema.fields[0]):0;if(a>0){if(!this._elList||(this._elList.childNodes.length<a)){this._initListEl()}this._initContainerHelperEls();var l=this._elList.childNodes;for(var t=a-1;t>=0;t--){var s=l[t],e=u[t];
if(this.resultTypeList){var b=[];b[0]=(YAHOO.lang.isString(e))?e:e[m]||e[this.key];var o=this.dataSource.responseSchema.fields;if(YAHOO.lang.isArray(o)&&(o.length>1)){for(var q=1,v=o.length;q<v;q++){b[b.length]=e[o[q].key||o[q]]}}else{if(YAHOO.lang.isArray(e)){b=e}else{if(YAHOO.lang.isString(e)){b=[e]}else{b[1]=e}}}e=b}s._sResultMatch=(YAHOO.lang.isString(e))?e:(YAHOO.lang.isArray(e))?e[0]:(e[m]||"");s._oResultData=e;s.innerHTML=this.formatResult(e,p,s._sResultMatch);s.style.display=""}if(a<l.length){var g;for(var r=l.length-1;r>=a;r--){g=l[r];g.style.display="none"}}this._nDisplayedItems=a;this.containerPopulateEvent.fire(this,n,u);if(this.autoHighlight){var d=this._elList.firstChild;this._toggleHighlight(d,"to");this.itemArrowToEvent.fire(this,d);this._typeAhead(d,n)}else{this._toggleHighlight(this._elCurListItem,"from")}h=this.doBeforeExpandContainer(this._elTextbox,this._elContainer,n,u);this._toggleContainer(h)}else{this._toggleContainer(false)}return}}else{this.dataErrorEvent.fire(this,n)
}};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;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){if(b==this._elCurListItem){return}var a=this.prehighlightClassName;if((c=="mouseover")&&a){YAHOO.util.Dom.addClass(b,a)}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}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.7.0",build:"1799"});
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={}}YAHOO.namespace=function(){var b=arguments,g=null,e,c,f;for(e=0;e<b.length;e=e+1){f=(""+b[e]).split(".");g=YAHOO;for(c=(f[0]=="YAHOO")?1:0;c<f.length;c=c+1){g[f[c]]=g[f[c]]||{};g=g[f[c]]}}return g};YAHOO.log=function(d,a,c){var b=YAHOO.widget.Logger;if(b&&b.log){return b.log(d,a,c)}else{return false}};YAHOO.register=function(a,f,e){var k=YAHOO.env.modules,c,j,h,g,d;if(!k[a]){k[a]={versions:[],builds:[]}}c=k[a];j=e.version;h=e.build;g=YAHOO.env.listeners;c.name=a;c.version=j;c.build=h;c.versions.push(j);c.builds.push(h);c.mainClass=f;for(d=0;d<g.length;d=d+1){g[d](c)}if(f){f.VERSION=j;f.BUILD=h}else{YAHOO.log("mainClass is undefined for module "+a,"warn")}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(a){return YAHOO.env.modules[a]||null};YAHOO.env.ua=function(){var c={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:0},b=navigator.userAgent,a;if((/KHTML/).test(b)){c.webkit=1}a=b.match(/AppleWebKit\/([^\s]*)/);
if(a&&a[1]){c.webkit=parseFloat(a[1]);if(/ Mobile\//.test(b)){c.mobile="Apple"}else{a=b.match(/NokiaN[^\/]*/);if(a){c.mobile=a[0]}}a=b.match(/AdobeAIR\/([^\s]*)/);if(a){c.air=a[0]}}if(!c.webkit){a=b.match(/Opera[\s\/]([^\s]*)/);if(a&&a[1]){c.opera=parseFloat(a[1]);a=b.match(/Opera Mini[^;]*/);if(a){c.mobile=a[0]}}else{a=b.match(/MSIE\s([^;]*)/);if(a&&a[1]){c.ie=parseFloat(a[1])}else{a=b.match(/Gecko\/([^\s]*)/);if(a){c.gecko=1;a=b.match(/rv:([^\s\)]*)/);if(a&&a[1]){c.gecko=parseFloat(a[1])}}}}}a=b.match(/Caja\/([^\s]*)/);if(a&&a[1]){c.caja=parseFloat(a[1])}return c}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var b=YAHOO_config.listener,a=YAHOO.env.listeners,d=true,c;if(b){for(c=0;c<a.length;c=c+1){if(a[c]==b){d=false;break}}if(d){a.push(b)}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var b=YAHOO.lang,f="[object Array]",c="[object Function]",a=Object.prototype,e=["toString","valueOf"],d={isArray:function(g){return a.toString.apply(g)===f
},isBoolean:function(g){return typeof g==="boolean"},isFunction:function(g){return a.toString.apply(g)===c},isNull:function(g){return g===null},isNumber:function(g){return typeof g==="number"&&isFinite(g)},isObject:function(g){return(g&&(typeof g==="object"||b.isFunction(g)))||false},isString:function(g){return typeof g==="string"},isUndefined:function(g){return typeof g==="undefined"},_IEEnumFix:(YAHOO.env.ua.ie)?function(j,h){var g,l,k;for(g=0;g<e.length;g=g+1){l=e[g];k=h[l];if(b.isFunction(k)&&k!=a[l]){j[l]=k}}}:function(){},extend:function(k,l,j){if(!l||!k){throw new Error("extend failed, please check that all dependencies are included.")}var h=function(){},g;h.prototype=l.prototype;k.prototype=new h();k.prototype.constructor=k;k.superclass=l.prototype;if(l.prototype.constructor==a.constructor){l.prototype.constructor=l}if(j){for(g in j){if(b.hasOwnProperty(j,g)){k.prototype[g]=j[g]}}b._IEEnumFix(k.prototype,j)}},augmentObject:function(l,k){if(!k||!l){throw new Error("Absorb failed, verify dependencies.")
}var g=arguments,j,m,h=g[2];if(h&&h!==true){for(j=2;j<g.length;j=j+1){l[g[j]]=k[g[j]]}}else{for(m in k){if(h||!(m in l)){l[m]=k[m]}}b._IEEnumFix(l,k)}},augmentProto:function(k,j){if(!j||!k){throw new Error("Augment failed, verify dependencies.")}var g=[k.prototype,j.prototype],h;for(h=2;h<arguments.length;h=h+1){g.push(arguments[h])}b.augmentObject.apply(this,g)},dump:function(g,m){var j,l,p=[],q="{...}",h="f(){...}",n=", ",k=" => ";if(!b.isObject(g)){return g+""}else{if(g instanceof Date||("nodeType" in g&&"tagName" in g)){return g}else{if(b.isFunction(g)){return h}}}m=(b.isNumber(m))?m:3;if(b.isArray(g)){p.push("[");for(j=0,l=g.length;j<l;j=j+1){if(b.isObject(g[j])){p.push((m>0)?b.dump(g[j],m-1):q)}else{p.push(g[j])}p.push(n)}if(p.length>1){p.pop()}p.push("]")}else{p.push("{");for(j in g){if(b.hasOwnProperty(g,j)){p.push(j+k);if(b.isObject(g[j])){p.push((m>0)?b.dump(g[j],m-1):q)}else{p.push(g[j])}p.push(n)}}if(p.length>1){p.pop()}p.push("}")}return p.join("")},substitute:function(B,h,t){var p,n,m,x,y,A,w=[],l,q="dump",u=" ",g="{",z="}",r;
for(;;){p=B.lastIndexOf(g);if(p<0){break}n=B.indexOf(z,p);if(p+1>=n){break}l=B.substring(p+1,n);x=l;A=null;m=x.indexOf(u);if(m>-1){A=x.substring(m+1);x=x.substring(0,m)}y=h[x];if(t){y=t(x,y,A)}if(b.isObject(y)){if(b.isArray(y)){y=b.dump(y,parseInt(A,10))}else{A=A||"";r=A.indexOf(q);if(r>-1){A=A.substring(4)}if(y.toString===a.toString||r>-1){y=b.dump(y,parseInt(A,10))}else{y=y.toString()}}}else{if(!b.isString(y)&&!b.isNumber(y)){y="~-"+w.length+"-~";w[w.length]=l}}B=B.substring(0,p)+y+B.substring(n+1)}for(p=w.length-1;p>=0;p=p-1){B=B.replace(new RegExp("~-"+p+"-~"),"{"+w[p]+"}","g")}return B},trim:function(g){try{return g.replace(/^\s+|\s+$/g,"")}catch(h){return g}},merge:function(){var k={},h=arguments,g=h.length,j;for(j=0;j<g;j=j+1){b.augmentObject(k,h[j],true)}return k},later:function(p,h,q,j,k){p=p||0;h=h||{};var i=q,n=j,l,g;if(b.isString(q)){i=h[q]}if(!i){throw new TypeError("method undefined")}if(!b.isArray(n)){n=[j]}l=function(){i.apply(h,n)};g=(k)?setInterval(l,p):setTimeout(l,p);
return{interval:k,cancel:function(){if(this.interval){clearInterval(g)}else{clearTimeout(g)}}}},isValue:function(g){return(b.isObject(g)||b.isString(g)||b.isNumber(g)||b.isBoolean(g))}};b.hasOwnProperty=(a.hasOwnProperty)?function(g,h){return g&&g.hasOwnProperty(h)}:function(g,h){return !b.isUndefined(g[h])&&g.constructor.prototype[h]!==g[h]};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.7.0",build:"1799"});YAHOO.util.CustomEvent=function(d,c,b,a){this.type=d;this.scope=c||window;this.silent=b;this.signature=a||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var e="_YUICEOnSubscribe";if(d!==e){this.subscribeEvent=new YAHOO.util.CustomEvent(e,this,true)}this.lastError=null};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(a,b,c){if(!a){throw new Error("Invalid callback for subscriber to '"+this.type+"'")
}if(this.subscribeEvent){this.subscribeEvent.fire(a,b,c)}this.subscribers.push(new YAHOO.util.Subscriber(a,b,c))},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 m=[],f=this.subscribers.length;if(!f&&this.silent){return true}var k=[].slice.call(arguments,0),h=true,d,l=false;if(!this.silent){}var c=this.subscribers.slice(),a=YAHOO.util.Event.throwErrors;for(d=0;d<f;++d){var o=c[d];if(!o){l=true}else{if(!this.silent){}var n=o.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var b=null;if(k.length>0){b=k[0]}try{h=o.fn.call(n,b,o.obj)}catch(g){this.lastError=g;if(a){throw g}}}else{try{h=o.fn.call(n,this.type,k,o.obj)}catch(j){this.lastError=j;if(a){throw j}}}if(false===h){if(!this.silent){}break}}}return(h!==false)},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 h=false;var i=[];var j=[];var g=[];var e=[];var c=0;var f=[];var b=[];var a=0;var d={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var k=YAHOO.env.ua.ie?"focusin":"focus";
var l=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var m=this;var n=function(){m._tryPreloadAttach()};this._interval=setInterval(n,this.POLL_INTERVAL)}},onAvailable:function(s,o,q,r,p){var m=(YAHOO.lang.isString(s))?[s]:s;for(var n=0;n<m.length;n=n+1){f.push({id:m[n],fn:o,obj:q,overrideContext:r,checkReady:p})}c=this.POLL_RETRYS;this.startInterval()},onContentReady:function(p,m,n,o){this.onAvailable(p,m,n,o,true)},onDOMReady:function(m,n,o){if(this.DOMReady){setTimeout(function(){var p=window;if(o){if(o===true){p=n}else{p=o}}m.call(p,"DOMReady",[],n)},0)}else{this.DOMReadyEvent.subscribe(m,n,o)}},_addListener:function(o,m,y,s,w,B){if(!y||!y.call){return false}if(this._isValidCollection(o)){var z=true;for(var t=0,v=o.length;
t<v;++t){z=this.on(o[t],m,y,s,w)&&z}return z}else{if(YAHOO.lang.isString(o)){var r=this.getEl(o);if(r){o=r}else{this.onAvailable(o,function(){YAHOO.util.Event.on(o,m,y,s,w)});return true}}}if(!o){return false}if("unload"==m&&s!==this){j[j.length]=[o,m,y,s,w];return true}var n=o;if(w){if(w===true){n=s}else{n=w}}var p=function(C){return y.call(n,YAHOO.util.Event.getEvent(C,o),s)};var A=[o,m,y,p,n,s,w];var u=i.length;i[u]=A;if(this.useLegacyEvent(o,m)){var q=this.getLegacyIndex(o,m);if(q==-1||o!=g[q][0]){q=g.length;b[o.id+m]=q;g[q]=[o,m,o["on"+m]];e[q]=[];o["on"+m]=function(C){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(C),q)}}e[q].push(A)}else{try{this._simpleAdd(o,m,p,B)}catch(x){this.lastError=x;this.removeListener(o,m,y);return false}}return true},addListener:function(n,q,m,o,p){return this._addListener(n,q,m,o,p,false)},addFocusListener:function(n,m,o,p){return this._addListener(n,k,m,o,p,true)},removeFocusListener:function(n,m){return this.removeListener(n,k,m)},addBlurListener:function(n,m,o,p){return this._addListener(n,l,m,o,p,true)
},removeBlurListener:function(n,m){return this.removeListener(n,l,m)},fireLegacyEvent:function(r,p){var t=true,m,v,u,n,s;v=e[p].slice();for(var o=0,q=v.length;o<q;++o){u=v[o];if(u&&u[this.WFN]){n=u[this.ADJ_SCOPE];s=u[this.WFN].call(n,r);t=(t&&s)}}m=g[p];if(m&&m[2]){m[2](r)}return t},getLegacyIndex:function(n,o){var m=this.generateId(n)+o;if(typeof b[m]=="undefined"){return -1}else{return b[m]}},useLegacyEvent:function(m,n){return(this.webkit&&this.webkit<419&&("click"==n||"dblclick"==n))},removeListener:function(n,m,v){var q,t,x;if(typeof n=="string"){n=this.getEl(n)}else{if(this._isValidCollection(n)){var w=true;for(q=n.length-1;q>-1;q--){w=(this.removeListener(n[q],m,v)&&w)}return w}}if(!v||!v.call){return this.purgeElement(n,false,m)}if("unload"==m){for(q=j.length-1;q>-1;q--){x=j[q];if(x&&x[0]==n&&x[1]==m&&x[2]==v){j.splice(q,1);return true}}return false}var r=null;var s=arguments[3];if("undefined"===typeof s){s=this._getCacheIndex(n,m,v)}if(s>=0){r=i[s]}if(!n||!r){return false}if(this.useLegacyEvent(n,m)){var p=this.getLegacyIndex(n,m);
var o=e[p];if(o){for(q=0,t=o.length;q<t;++q){x=o[q];if(x&&x[this.EL]==n&&x[this.TYPE]==m&&x[this.FN]==v){o.splice(q,1);break}}}}else{try{this._simpleRemove(n,m,r[this.WFN],false)}catch(u){this.lastError=u;return false}}delete i[s][this.WFN];delete i[s][this.FN];i.splice(s,1);return true},getTarget:function(o,n){var m=o.target||o.srcElement;return this.resolveTextNode(m)},resolveTextNode:function(o){try{if(o&&3==o.nodeType){return o.parentNode}}catch(m){}return o},getPageX:function(n){var m=n.pageX;if(!m&&0!==m){m=n.clientX||0;if(this.isIE){m+=this._getScrollLeft()}}return m},getPageY:function(m){var n=m.pageY;if(!n&&0!==n){n=m.clientY||0;if(this.isIE){n+=this._getScrollTop()}}return n},getXY:function(m){return[this.getPageX(m),this.getPageY(m)]},getRelatedTarget:function(n){var m=n.relatedTarget;if(!m){if(n.type=="mouseout"){m=n.toElement}else{if(n.type=="mouseover"){m=n.fromElement}}}return this.resolveTextNode(m)},getTime:function(o){if(!o.time){var n=new Date().getTime();try{o.time=n
}catch(m){this.lastError=m;return n}}return o.time},stopEvent:function(m){this.stopPropagation(m);this.preventDefault(m)},stopPropagation:function(m){if(m.stopPropagation){m.stopPropagation()}else{m.cancelBubble=true}},preventDefault:function(m){if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}},getEvent:function(o,m){var n=o||window.event;if(!n){var p=this.getEvent.caller;while(p){n=p.arguments[0];if(n&&Event==n.constructor){break}p=p.caller}}return n},getCharCode:function(n){var m=n.keyCode||n.charCode||0;if(YAHOO.env.ua.webkit&&(m in d)){m=d[m]}return m},_getCacheIndex:function(q,r,p){for(var o=0,n=i.length;o<n;o=o+1){var m=i[o];if(m&&m[this.FN]==p&&m[this.EL]==q&&m[this.TYPE]==r){return o}}return -1},generateId:function(m){var n=m.id;if(!n){n="yuievtautoid-"+a;++a;m.id=n}return n},_isValidCollection:function(n){try{return(n&&typeof n!=="string"&&n.length&&!n.tagName&&!n.alert&&typeof n[0]!=="undefined")}catch(m){return false}},elCache:{},getEl:function(m){return(typeof m==="string")?document.getElementById(m):m
},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(n){if(!h){h=true;var m=YAHOO.util.Event;m._ready();m._tryPreloadAttach()}},_ready:function(n){var m=YAHOO.util.Event;if(!m.DOMReady){m.DOMReady=true;m.DOMReadyEvent.fire();m._simpleRemove(document,"DOMContentLoaded",m._ready)}},_tryPreloadAttach:function(){if(f.length===0){c=0;if(this._interval){clearInterval(this._interval);this._interval=null}return}if(this.locked){return}if(this.isIE){if(!this.DOMReady){this.startInterval();return}}this.locked=true;var s=!h;if(!s){s=(c>0&&f.length>0)}var r=[];var t=function(v,w){var u=v;if(w.overrideContext){if(w.overrideContext===true){u=w.obj}else{u=w.overrideContext}}w.fn.call(u,w.obj)};var n,m,q,p,o=[];for(n=0,m=f.length;n<m;n=n+1){q=f[n];if(q){p=this.getEl(q.id);if(p){if(q.checkReady){if(h||p.nextSibling||!s){o.push(q);f[n]=null}}else{t(p,q);f[n]=null}}else{r.push(q)}}}for(n=0,m=o.length;n<m;n=n+1){q=o[n];t(this.getEl(q.id),q)}c--;if(s){for(n=f.length-1;
n>-1;n--){q=f[n];if(!q||!q.id){f.splice(n,1)}}this.startInterval()}else{if(this._interval){clearInterval(this._interval);this._interval=null}}this.locked=false},purgeElement:function(q,r,t){var o=(YAHOO.lang.isString(q))?this.getEl(q):q;var s=this.getListeners(o,t),p,m;if(s){for(p=s.length-1;p>-1;p--){var n=s[p];this.removeListener(o,n.type,n.fn)}}if(r&&o&&o.childNodes){for(p=0,m=o.childNodes.length;p<m;++p){this.purgeElement(o.childNodes[p],r,t)}}},getListeners:function(o,m){var r=[],n;if(!m){n=[i,j]}else{if(m==="unload"){n=[j]}else{n=[i]}}var t=(YAHOO.lang.isString(o))?this.getEl(o):o;for(var q=0;q<n.length;q=q+1){var v=n[q];if(v){for(var s=0,u=v.length;s<u;++s){var p=v[s];if(p&&p[this.EL]===t&&(!m||m===p[this.TYPE])){r.push({type:p[this.TYPE],fn:p[this.FN],obj:p[this.OBJ],adjust:p[this.OVERRIDE],scope:p[this.ADJ_SCOPE],index:s})}}}}return(r.length)?r:null},_unload:function(t){var n=YAHOO.util.Event,q,p,o,s,r,u=j.slice(),m;for(q=0,s=j.length;q<s;++q){o=u[q];if(o){m=window;if(o[n.ADJ_SCOPE]){if(o[n.ADJ_SCOPE]===true){m=o[n.UNLOAD_OBJ]
}else{m=o[n.ADJ_SCOPE]}}o[n.FN].call(m,n.getEvent(t,o[n.EL]),o[n.UNLOAD_OBJ]);u[q]=null}}o=null;m=null;j=null;if(i){for(p=i.length-1;p>-1;p--){o=i[p];if(o){n.removeListener(o[n.EL],o[n.TYPE],o[n.FN],p)}}o=null}g=null;n._simpleRemove(window,"unload",n._unload)},_getScrollLeft:function(){return this._getScroll()[1]},_getScrollTop:function(){return this._getScroll()[0]},_getScroll:function(){var m=document.documentElement,n=document.body;if(m&&(m.scrollTop||m.scrollLeft)){return[m.scrollTop,m.scrollLeft]}else{if(n){return[n.scrollTop,n.scrollLeft]}else{return[0,0]}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(o,p,n,m){o.addEventListener(p,n,(m))}}else{if(window.attachEvent){return function(o,p,n,m){o.attachEvent("on"+p,n)}}else{return function(){}}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(o,p,n,m){o.removeEventListener(p,n,(m))}}else{if(window.detachEvent){return function(n,o,m){n.detachEvent("on"+o,m)}}else{return function(){}
}}}()}}();(function(){var a=YAHOO.util.Event;a.on=a.addListener;a.onFocus=a.addFocusListener;a.onBlur=a.addBlurListener;
/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
if(a.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var b=document.createElement("p");a._dri=setInterval(function(){try{b.doScroll("left");clearInterval(a._dri);a._dri=null;a._ready();b=null}catch(c){}},a.POLL_INTERVAL)}else{if(a.webkit&&a.webkit<525){a._dri=setInterval(function(){var c=document.readyState;if("loaded"==c||"complete"==c){clearInterval(a._dri);a._dri=null;a._ready()}},a.POLL_INTERVAL)}else{a._simpleAdd(document,"DOMContentLoaded",a._ready)}}a._simpleAdd(window,"load",a._load);a._simpleAdd(window,"unload",a._unload);a._tryPreloadAttach()})()}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(a,c,f,e){this.__yui_events=this.__yui_events||{};var d=this.__yui_events[a];
if(d){d.subscribe(c,f,e)}else{this.__yui_subscribers=this.__yui_subscribers||{};var b=this.__yui_subscribers;if(!b[a]){b[a]=[]}b[a].push({fn:c,obj:f,overrideContext:e})}},unsubscribe:function(c,e,g){this.__yui_events=this.__yui_events||{};var a=this.__yui_events;if(c){var f=a[c];if(f){return f.unsubscribe(e,g)}}else{var b=true;for(var d in a){if(YAHOO.lang.hasOwnProperty(a,d)){b=b&&a[d].unsubscribe(e,g)}}return b}return false},unsubscribeAll:function(a){return this.unsubscribe(a)},createEvent:function(g,d){this.__yui_events=this.__yui_events||{};var a=d||{};var j=this.__yui_events;if(j[g]){}else{var h=a.scope||this;var e=(a.silent);var b=new YAHOO.util.CustomEvent(g,h,e,YAHOO.util.CustomEvent.FLAT);j[g]=b;if(a.onSubscribeCallback){b.subscribeEvent.subscribe(a.onSubscribeCallback)}this.__yui_subscribers=this.__yui_subscribers||{};var f=this.__yui_subscribers[g];if(f){for(var c=0;c<f.length;++c){b.subscribe(f[c].fn,f[c].obj,f[c].overrideContext)}}}return j[g]},fireEvent:function(e,d,a,c){this.__yui_events=this.__yui_events||{};
var g=this.__yui_events[e];if(!g){return null}var b=[];for(var f=1;f<arguments.length;++f){b.push(arguments[f])}return g.fire.apply(g,b)},hasEvent:function(a){if(this.__yui_events){if(this.__yui_events[a]){return true}}return false}};(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.7.0",build:"1799"});(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var e=YAHOO.util,k=YAHOO.lang,L=YAHOO.env.ua,a=YAHOO.lang.trim,B={},F={},m=/^t(?:able|d|h)$/i,w=/color$/i,j=window.document,v=j.documentElement,C="ownerDocument",M="defaultView",U="documentElement",S="compatMode",z="offsetLeft",o="offsetTop",T="offsetParent",x="parentNode",K="nodeType",c="tagName",n="scrollLeft",H="scrollTop",p="getBoundingClientRect",V="getComputedStyle",y="currentStyle",l="CSS1Compat",A="BackCompat",E="class",f="className",i="",b=" ",R="(?:^|\\s)",J="(?= |$)",t="g",O="position",D="fixed",u="relative",I="left",N="top",Q="medium",P="borderLeftWidth",q="borderTopWidth",d=L.opera,h=L.webkit,g=L.gecko,s=L.ie;
e.Dom={CUSTOM_ATTRIBUTES:(!v.hasAttribute)?{"for":"htmlFor","class":f}:{htmlFor:"for",className:E},get:function(Y){var aa,W,Z,X,G;if(Y){if(Y[K]||Y.item){return Y}if(typeof Y==="string"){aa=Y;Y=j.getElementById(Y);if(Y&&Y.id===aa){return Y}else{if(Y&&j.all){Y=null;W=j.all[aa];for(X=0,G=W.length;X<G;++X){if(W[X].id===aa){return W[X]}}}}return Y}if(Y.DOM_EVENTS){Y=Y.get("element")}if("length" in Y){Z=[];for(X=0,G=Y.length;X<G;++X){Z[Z.length]=e.Dom.get(Y[X])}return Z}return Y}return null},getComputedStyle:function(G,W){if(window[V]){return G[C][M][V](G,null)[W]}else{if(G[y]){return e.Dom.IE_ComputedStyle.get(G,W)}}},getStyle:function(G,W){return e.Dom.batch(G,e.Dom._getStyle,W)},_getStyle:function(){if(window[V]){return function(G,Y){Y=(Y==="float")?Y="cssFloat":e.Dom._toCamel(Y);var X=G.style[Y],W;if(!X){W=G[C][M][V](G,null);if(W){X=W[Y]}}return X}}else{if(v[y]){return function(G,Y){var X;switch(Y){case"opacity":X=100;try{X=G.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(Z){try{X=G.filters("alpha").opacity
}catch(W){}}return X/100;case"float":Y="styleFloat";default:Y=e.Dom._toCamel(Y);X=G[y]?G[y][Y]:null;return(G.style[Y]||X)}}}}}(),setStyle:function(G,W,X){e.Dom.batch(G,e.Dom._setStyle,{prop:W,val:X})},_setStyle:function(){if(s){return function(W,G){var X=e.Dom._toCamel(G.prop),Y=G.val;if(W){switch(X){case"opacity":if(k.isString(W.style.filter)){W.style.filter="alpha(opacity="+Y*100+")";if(!W[y]||!W[y].hasLayout){W.style.zoom=1}}break;case"float":X="styleFloat";default:W.style[X]=Y}}else{}}}else{return function(W,G){var X=e.Dom._toCamel(G.prop),Y=G.val;if(W){if(X=="float"){X="cssFloat"}W.style[X]=Y}else{}}}}(),getXY:function(G){return e.Dom.batch(G,e.Dom._getXY)},_canPosition:function(G){return(e.Dom._getStyle(G,"display")!=="none"&&e.Dom._inDoc(G))},_getXY:function(){if(j[U][p]){return function(Y){var Z,W,aa,af,ae,ad,ac,G,X,ab=Math.floor,ag=false;if(e.Dom._canPosition(Y)){aa=Y[p]();af=Y[C];Z=e.Dom.getDocumentScrollLeft(af);W=e.Dom.getDocumentScrollTop(af);ag=[ab(aa[I]),ab(aa[N])];if(s&&L.ie<8){ae=2;
ad=2;ac=af[S];G=r(af[U],P);X=r(af[U],q);if(L.ie===6){if(ac!==A){ae=0;ad=0}}if((ac==A)){if(G!==Q){ae=parseInt(G,10)}if(X!==Q){ad=parseInt(X,10)}}ag[0]-=ae;ag[1]-=ad}if((W||Z)){ag[0]+=Z;ag[1]+=W}ag[0]=ab(ag[0]);ag[1]=ab(ag[1])}else{}return ag}}else{return function(Y){var X,W,aa,ab,ac,Z=false,G=Y;if(e.Dom._canPosition(Y)){Z=[Y[z],Y[o]];X=e.Dom.getDocumentScrollLeft(Y[C]);W=e.Dom.getDocumentScrollTop(Y[C]);ac=((g||L.webkit>519)?true:false);while((G=G[T])){Z[0]+=G[z];Z[1]+=G[o];if(ac){Z=e.Dom._calcBorders(G,Z)}}if(e.Dom._getStyle(Y,O)!==D){G=Y;while((G=G[x])&&G[c]){aa=G[H];ab=G[n];if(g&&(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]+=W}else{if(d){Z[0]-=X;Z[1]-=W}else{if(h||g){Z[0]+=X;Z[1]+=W}}}Z[0]=Math.floor(Z[0]);Z[1]=Math.floor(Z[1])}else{}return Z}}}(),getX:function(G){var W=function(X){return e.Dom.getXY(X)[0]};return e.Dom.batch(G,W,e.Dom,true)},getY:function(G){var W=function(X){return e.Dom.getXY(X)[1]};return e.Dom.batch(G,W,e.Dom,true)
},setXY:function(G,X,W){e.Dom.batch(G,e.Dom._setXY,{pos:X,noRetry:W})},_setXY:function(G,Z){var aa=e.Dom._getStyle(G,O),Y=e.Dom.setStyle,ad=Z.pos,W=Z.noRetry,ab=[parseInt(e.Dom.getComputedStyle(G,I),10),parseInt(e.Dom.getComputedStyle(G,N),10)],ac,X;if(aa=="static"){aa=u;Y(G,O,aa)}ac=e.Dom._getXY(G);if(!ad||ac===false){return false}if(isNaN(ab[0])){ab[0]=(aa==u)?0:G[z]}if(isNaN(ab[1])){ab[1]=(aa==u)?0:G[o]}if(ad[0]!==null){Y(G,I,ad[0]-ac[0]+ab[0]+"px")}if(ad[1]!==null){Y(G,N,ad[1]-ac[1]+ab[1]+"px")}if(!W){X=e.Dom._getXY(G);if((ad[0]!==null&&X[0]!=ad[0])||(ad[1]!==null&&X[1]!=ad[1])){e.Dom._setXY(G,{pos:ad,noRetry:true})}}},setX:function(W,G){e.Dom.setXY(W,[G,null])},setY:function(G,W){e.Dom.setXY(G,[null,W])},getRegion:function(G){var W=function(X){var Y=false;if(e.Dom._canPosition(X)){Y=e.Region.getRegion(X)}else{}return Y};return e.Dom.batch(G,W,e.Dom,true)},getClientWidth:function(){return e.Dom.getViewportWidth()},getClientHeight:function(){return e.Dom.getViewportHeight()},getElementsByClassName:function(ab,af,ac,ae,X,ad){ab=k.trim(ab);
af=af||"*";ac=(ac)?e.Dom.get(ac):null||j;if(!ac){return[]}var W=[],G=ac.getElementsByTagName(af),Z=e.Dom.hasClass;for(var Y=0,aa=G.length;Y<aa;++Y){if(Z(G[Y],ab)){W[W.length]=G[Y]}}if(ae){e.Dom.batch(W,ae,X,ad)}return W},hasClass:function(W,G){return e.Dom.batch(W,e.Dom._hasClass,G)},_hasClass:function(X,W){var G=false,Y;if(X&&W){Y=e.Dom.getAttribute(X,f)||i;if(W.exec){G=W.test(Y)}else{G=W&&(b+Y+b).indexOf(b+W+b)>-1}}else{}return G},addClass:function(W,G){return e.Dom.batch(W,e.Dom._addClass,G)},_addClass:function(X,W){var G=false,Y;if(X&&W){Y=e.Dom.getAttribute(X,f)||i;if(!e.Dom._hasClass(X,W)){e.Dom.setAttribute(X,f,a(Y+b+W));G=true}}else{}return G},removeClass:function(W,G){return e.Dom.batch(W,e.Dom._removeClass,G)},_removeClass:function(Y,X){var W=false,aa,Z,G;if(Y&&X){aa=e.Dom.getAttribute(Y,f)||i;e.Dom.setAttribute(Y,f,aa.replace(e.Dom._getClassRegex(X),i));Z=e.Dom.getAttribute(Y,f);if(aa!==Z){e.Dom.setAttribute(Y,f,a(Z));W=true;if(e.Dom.getAttribute(Y,f)===""){G=(Y.hasAttribute&&Y.hasAttribute(E))?E:f;
Y.removeAttribute(G)}}}else{}return W},replaceClass:function(X,W,G){return e.Dom.batch(X,e.Dom._replaceClass,{from:W,to:G})},_replaceClass:function(Y,X){var W,ab,aa,G=false,Z;if(Y&&X){ab=X.from;aa=X.to;if(!aa){G=false}else{if(!ab){G=e.Dom._addClass(Y,X.to)}else{if(ab!==aa){Z=e.Dom.getAttribute(Y,f)||i;W=(b+Z.replace(e.Dom._getClassRegex(ab),b+aa)).split(e.Dom._getClassRegex(aa));W.splice(1,0,b+aa);e.Dom.setAttribute(Y,f,a(W.join(i)));G=true}}}}else{}return G},generateId:function(G,X){X=X||"yui-gen";var W=function(Y){if(Y&&Y.id){return Y.id}var Z=X+YAHOO.env._id_counter++;if(Y){if(Y[C].getElementById(Z)){return e.Dom.generateId(Y,Z+X)}Y.id=Z}return Z};return e.Dom.batch(G,W,e.Dom,true)||W.apply(e.Dom,arguments)},isAncestor:function(W,X){W=e.Dom.get(W);X=e.Dom.get(X);var G=false;if((W&&X)&&(W[K]&&X[K])){if(W.contains&&W!==X){G=W.contains(X)}else{if(W.compareDocumentPosition){G=!!(W.compareDocumentPosition(X)&16)}}}else{}return G},inDocument:function(G,W){return e.Dom._inDoc(e.Dom.get(G),W)
},_inDoc:function(W,X){var G=false;if(W&&W[c]){X=X||W[C];G=e.Dom.isAncestor(X[U],W)}else{}return G},getElementsBy:function(W,af,ab,ad,Y,ac,ae){af=af||"*";ab=(ab)?e.Dom.get(ab):null||j;if(!ab){return[]}var X=[],G=ab.getElementsByTagName(af);for(var Z=0,aa=G.length;Z<aa;++Z){if(W(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,W){return e.Dom.getElementsBy(X,G,W,null,null,null,true)},batch:function(X,ab,aa,Z){var Y=[],W=(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(W,X,aa)}for(var G=0;G<X.length;++G){Y[Y.length]=ab.call(W,X[G],aa)}}else{return false}return Y},getDocumentHeight:function(){var W=(j[S]!=l||h)?j.body.scrollHeight:v.scrollHeight,G=Math.max(W,e.Dom.getViewportHeight());return G},getDocumentWidth:function(){var W=(j[S]!=l||h)?j.body.scrollWidth:v.scrollWidth,G=Math.max(W,e.Dom.getViewportWidth());return G},getViewportHeight:function(){var G=self.innerHeight,W=j[S];
if((W||s)&&!d){G=(W==l)?v.clientHeight:j.body.clientHeight}return G},getViewportWidth:function(){var G=self.innerWidth,W=j[S];if(W||s){G=(W==l)?v.clientWidth:j.body.clientWidth}return G},getAncestorBy:function(G,W){while((G=G[x])){if(e.Dom._testElement(G,W)){return G}}return null},getAncestorByClassName:function(W,G){W=e.Dom.get(W);if(!W){return null}var X=function(Y){return e.Dom.hasClass(Y,G)};return e.Dom.getAncestorBy(W,X)},getAncestorByTagName:function(W,G){W=e.Dom.get(W);if(!W){return null}var X=function(Y){return Y[c]&&Y[c].toUpperCase()==G.toUpperCase()};return e.Dom.getAncestorBy(W,X)},getPreviousSiblingBy:function(G,W){while(G){G=G.previousSibling;if(e.Dom._testElement(G,W)){return G}}return null},getPreviousSibling:function(G){G=e.Dom.get(G);if(!G){return null}return e.Dom.getPreviousSiblingBy(G)},getNextSiblingBy:function(G,W){while(G){G=G.nextSibling;if(e.Dom._testElement(G,W)){return G}}return null},getNextSibling:function(G){G=e.Dom.get(G);if(!G){return null}return e.Dom.getNextSiblingBy(G)
},getFirstChildBy:function(G,X){var W=(e.Dom._testElement(G.firstChild,X))?G.firstChild:null;return W||e.Dom.getNextSiblingBy(G.firstChild,X)},getFirstChild:function(G,W){G=e.Dom.get(G);if(!G){return null}return e.Dom.getFirstChildBy(G)},getLastChildBy:function(G,X){if(!G){return null}var W=(e.Dom._testElement(G.lastChild,X))?G.lastChild:null;return W||e.Dom.getPreviousSiblingBy(G.lastChild,X)},getLastChild:function(G){G=e.Dom.get(G);return e.Dom.getLastChildBy(G)},getChildrenBy:function(W,Y){var X=e.Dom.getFirstChildBy(W,Y),G=X?[X]:[];e.Dom.getNextSiblingBy(X,function(Z){if(!Y||Y(Z)){G[G.length]=Z}return false});return G},getChildren:function(G){G=e.Dom.get(G);if(!G){}return e.Dom.getChildrenBy(G)},getDocumentScrollLeft:function(G){G=G||j;return Math.max(G[U].scrollLeft,G.body.scrollLeft)},getDocumentScrollTop:function(G){G=G||j;return Math.max(G[U].scrollTop,G.body.scrollTop)},insertBefore:function(W,G){W=e.Dom.get(W);G=e.Dom.get(G);if(!W||!G||!G[x]){return null}return G[x].insertBefore(W,G)
},insertAfter:function(W,G){W=e.Dom.get(W);G=e.Dom.get(G);if(!W||!G||!G[x]){return null}if(G.nextSibling){return G[x].insertBefore(W,G.nextSibling)}else{return G[x].appendChild(W)}},getClientRegion:function(){var X=e.Dom.getDocumentScrollTop(),W=e.Dom.getDocumentScrollLeft(),Y=e.Dom.getViewportWidth()+W,G=e.Dom.getViewportHeight()+X;return new e.Region(X,Y,G,W)},setAttribute:function(W,G,X){G=e.Dom.CUSTOM_ATTRIBUTES[G]||G;W.setAttribute(G,X)},getAttribute:function(W,G){G=e.Dom.CUSTOM_ATTRIBUTES[G]||G;return W.getAttribute(G)},_toCamel:function(W){var X=B;function G(Y,Z){return Z.toUpperCase()}return X[W]||(X[W]=W.indexOf("-")===-1?W:W.replace(/-([a-z])/gi,G))},_getClassRegex:function(W){var G;if(W!==undefined){if(W.exec){G=W}else{G=F[W];if(!G){W=W.replace(e.Dom._patterns.CLASS_RE_TOKENS,"\\$1");G=F[W]=new RegExp(R+W+J,t)}}}return G},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}])/g},_testElement:function(G,W){return G&&G[K]==1&&(!W||W(G))},_calcBorders:function(X,Y){var W=parseInt(e.Dom[V](X,q),10)||0,G=parseInt(e.Dom[V](X,P),10)||0;
if(g){if(m.test(X[c])){W=0;G=0}}Y[0]+=G;Y[1]+=W;return Y}};var r=e.Dom[V];if(L.opera){e.Dom[V]=function(W,G){var X=r(W,G);if(w.test(G)){X=e.Dom.Color.toRGB(X)}return X}}if(L.webkit){e.Dom[V]=function(W,G){var X=r(W,G);if(X==="rgba(0, 0, 0, 0)"){X="transparent"}return X}}})();YAHOO.util.Region=function(d,e,a,c){this.top=d;this.y=d;this[1]=d;this.right=e;this.bottom=a;this.left=c;this.x=c;this[0]=c;this.width=this.right-this.left;this.height=this.bottom-this.top};YAHOO.util.Region.prototype.contains=function(a){return(a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom)};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left))};YAHOO.util.Region.prototype.intersect=function(f){var d=Math.max(this.top,f.top),e=Math.min(this.right,f.right),a=Math.min(this.bottom,f.bottom),c=Math.max(this.left,f.left);if(a>=d&&e>=c){return new YAHOO.util.Region(d,e,a,c)}else{return null}};YAHOO.util.Region.prototype.union=function(f){var d=Math.min(this.top,f.top),e=Math.max(this.right,f.right),a=Math.max(this.bottom,f.bottom),c=Math.min(this.left,f.left);
return new YAHOO.util.Region(d,e,a,c)};YAHOO.util.Region.prototype.toString=function(){return("Region {top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}")};YAHOO.util.Region.getRegion=function(e){var g=YAHOO.util.Dom.getXY(e),d=g[1],f=g[0]+e.offsetWidth,a=g[1]+e.offsetHeight,c=g[0];return new YAHOO.util.Region(d,f,a,c)};YAHOO.util.Point=function(a,b){if(YAHOO.lang.isArray(a)){b=a[1];a=a[0]}YAHOO.util.Point.superclass.constructor.call(this,b,a,b,a)};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var b=YAHOO.util,a="clientTop",f="clientLeft",j="parentNode",k="right",w="hasLayout",i="px",u="opacity",l="auto",d="borderLeftWidth",g="borderTopWidth",p="borderRightWidth",v="borderBottomWidth",s="visible",q="transparent",n="height",e="width",h="style",t="currentStyle",r=/^width|height$/,o=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,m={get:function(x,z){var y="",A=x[t][z];
if(z===u){y=b.Dom.getStyle(x,u)}else{if(!A||(A.indexOf&&A.indexOf(i)>-1)){y=A}else{if(b.Dom.IE_COMPUTED[z]){y=b.Dom.IE_COMPUTED[z](x,z)}else{if(o.test(A)){y=b.Dom.IE.ComputedStyle.getPixel(x,z)}else{y=A}}}}return y},getOffset:function(z,E){var B=z[t][E],x=E.charAt(0).toUpperCase()+E.substr(1),C="offset"+x,y="pixel"+x,A="",D;if(B==l){D=z[C];if(D===undefined){A=0}A=D;if(r.test(E)){z[h][E]=D;if(z[C]>D){A=D-(z[C]-D)}z[h][E]=l}}else{if(!z[h][y]&&!z[h][E]){z[h][E]=B}A=z[h][y]}return A+i},getBorderWidth:function(x,z){var y=null;if(!x[t][w]){x[h].zoom=1}switch(z){case g:y=x[a];break;case v:y=x.offsetHeight-x.clientHeight-x[a];break;case d:y=x[f];break;case p:y=x.offsetWidth-x.clientWidth-x[f];break}return y+i},getPixel:function(y,x){var A=null,B=y[t][k],z=y[t][x];y[h][k]=z;A=y[h].pixelRight;y[h][k]=B;return A+i},getMargin:function(y,x){var z;if(y[t][x]==l){z=0+i}else{z=b.Dom.IE.ComputedStyle.getPixel(y,x)}return z},getVisibility:function(y,x){var z;while((z=y[t])&&z[x]=="inherit"){y=y[j]}return(z)?z[x]:s
},getColor:function(y,x){return b.Dom.Color.toRGB(y[t][x])||q},getBorderColor:function(y,x){var z=y[t],A=z[x]||z.color;return b.Dom.Color.toRGB(b.Dom.Color.toHex(A))}},c={};c.top=c.right=c.bottom=c.left=c[e]=c[n]=m.getOffset;c.color=m.getColor;c[g]=c[p]=c[v]=c[d]=m.getBorderWidth;c.marginTop=c.marginRight=c.marginBottom=c.marginLeft=m.getMargin;c.visibility=m.getVisibility;c.borderColor=c.borderTopColor=c.borderRightColor=c.borderBottomColor=c.borderLeftColor=m.getBorderColor;b.Dom.IE_COMPUTED=c;b.Dom.IE_ComputedStyle=m})();(function(){var c="toString",a=parseInt,b=RegExp,d=YAHOO.util;d.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(e){if(!d.Dom.Color.re_RGB.test(e)){e=d.Dom.Color.toHex(e)
}if(d.Dom.Color.re_hex.exec(e)){e="rgb("+[a(b.$1,16),a(b.$2,16),a(b.$3,16)].join(", ")+")"}return e},toHex:function(i){i=d.Dom.Color.KEYWORDS[i]||i;if(d.Dom.Color.re_RGB.exec(i)){var h=(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);i=[h[c](16),f[c](16),e[c](16)].join("")}if(i.length<6){i=i.replace(d.Dom.Color.re_hex3,"$1$1")}if(i!=="transparent"&&i.indexOf("#")<0){i="#"+i}return i.toLowerCase()}}}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.7.0",build:"1799"});YAHOO.util.Attribute=function(b,a){if(a){this.owner=a;this.configure(b,true)}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,setter:null,getter:null,validator:null,getValue:function(){var a=this.value;if(this.getter){a=this.getter.call(this.owner,this.name)}return a},setValue:function(f,b){var e,a=this.owner,c=this.name;var d={type:c,prevValue:this.getValue(),newValue:f};
if(this.readOnly||(this.writeOnce&&this._written)){return false}if(this.validator&&!this.validator.call(a,f)){return false}if(!b){e=a.fireBeforeChangeEvent(d);if(e===false){return false}}if(this.setter){f=this.setter.call(a,f,this.name);if(f===undefined){}}if(this.method){this.method.call(a,f,this.name)}this.value=f;this._written=true;d.type=c;if(!b){this.owner.fireChangeEvent(d)}return true},configure:function(b,c){b=b||{};if(c){this._written=false}this._initialConfig=this._initialConfig||{};for(var a in b){if(b.hasOwnProperty(a)){this[a]=b[a];if(c){this._initialConfig[a]=b[a]}}}},resetValue:function(){return this.setValue(this._initialConfig.value)},resetConfig:function(){this.configure(this._initialConfig,true)},refresh:function(a){this.setValue(this.value,a)}};(function(){var a=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(c){this._configs=this._configs||{};var b=this._configs[c];if(!b||!this._configs.hasOwnProperty(c)){return null
}return b.getValue()},set:function(d,e,b){this._configs=this._configs||{};var c=this._configs[d];if(!c){return false}return c.setValue(e,b)},getAttributeKeys:function(){this._configs=this._configs;var c=[],b;for(b in this._configs){if(a.hasOwnProperty(this._configs,b)&&!a.isUndefined(this._configs[b])){c[c.length]=b}}return c},setAttributes:function(d,b){for(var c in d){if(a.hasOwnProperty(d,c)){this.set(c,d[c],b)}}},resetValue:function(c,b){this._configs=this._configs||{};if(this._configs[c]){this.set(c,this._configs[c]._initialConfig.value,b);return true}return false},refresh:function(e,c){this._configs=this._configs||{};var f=this._configs;e=((a.isString(e))?[e]:e)||this.getAttributeKeys();for(var d=0,b=e.length;d<b;++d){if(f.hasOwnProperty(e[d])){this._configs[e[d]].refresh(c)}}},register:function(b,c){this.setAttributeConfig(b,c)},getAttributeConfig:function(c){this._configs=this._configs||{};var b=this._configs[c]||{};var d={};for(c in b){if(a.hasOwnProperty(b,c)){d[c]=b[c]}}return d
},setAttributeConfig:function(b,c,d){this._configs=this._configs||{};c=c||{};if(!this._configs[b]){c.name=b;this._configs[b]=this.createAttribute(c)}else{this._configs[b].configure(c,d)}},configureAttribute:function(b,c,d){this.setAttributeConfig(b,c,d)},resetAttributeConfig:function(b){this._configs=this._configs||{};this._configs[b].resetConfig()},subscribe:function(b,c){this._events=this._events||{};if(!(b in this._events)){this._events[b]=this.createEvent(b)}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments)},on:function(){this.subscribe.apply(this,arguments)},addListener:function(){this.subscribe.apply(this,arguments)},fireBeforeChangeEvent:function(c){var b="before";b+=c.type.charAt(0).toUpperCase()+c.type.substr(1)+"Change";c.type=b;return this.fireEvent(c.type,c)},fireChangeEvent:function(b){b.type+="Change";return this.fireEvent(b.type,b)},createAttribute:function(b){return new YAHOO.util.Attribute(b,this)}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider)
})();(function(){var b=YAHOO.util.Dom,c=YAHOO.util.AttributeProvider;var a=function(d,e){this.init.apply(this,arguments)};a.DOM_EVENTS={click:true,dblclick:true,keydown:true,keypress:true,keyup:true,mousedown:true,mousemove:true,mouseout:true,mouseover:true,mouseup:true,focus:true,blur:true,submit:true,change:true};a.prototype={DOM_EVENTS:null,DEFAULT_HTML_SETTER:function(f,d){var e=this.get("element");if(e){e[d]=f}},DEFAULT_HTML_GETTER:function(d){var e=this.get("element"),f;if(e){f=e[d]}return f},appendChild:function(d){d=d.get?d.get("element"):d;return this.get("element").appendChild(d)},getElementsByTagName:function(d){return this.get("element").getElementsByTagName(d)},hasChildNodes:function(){return this.get("element").hasChildNodes()},insertBefore:function(d,e){d=d.get?d.get("element"):d;e=(e&&e.get)?e.get("element"):e;return this.get("element").insertBefore(d,e)},removeChild:function(d){d=d.get?d.get("element"):d;return this.get("element").removeChild(d)},replaceChild:function(d,e){d=d.get?d.get("element"):d;
e=e.get?e.get("element"):e;return this.get("element").replaceChild(d,e)},initAttributes:function(d){},addListener:function(h,g,i,f){var e=this.get("element")||this.get("id");f=f||this;var d=this;if(!this._events[h]){if(e&&this.DOM_EVENTS[h]){YAHOO.util.Event.addListener(e,h,function(j){if(j.srcElement&&!j.target){j.target=j.srcElement}d.fireEvent(h,j)},i,f)}this.createEvent(h,this)}return YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments)},on:function(){return this.addListener.apply(this,arguments)},subscribe:function(){return this.addListener.apply(this,arguments)},removeListener:function(e,d){return this.unsubscribe.apply(this,arguments)},addClass:function(d){b.addClass(this.get("element"),d)},getElementsByClassName:function(e,d){return b.getElementsByClassName(e,d,this.get("element"))},hasClass:function(d){return b.hasClass(this.get("element"),d)},removeClass:function(d){return b.removeClass(this.get("element"),d)},replaceClass:function(e,d){return b.replaceClass(this.get("element"),e,d)
},setStyle:function(e,d){return b.setStyle(this.get("element"),e,d)},getStyle:function(d){return b.getStyle(this.get("element"),d)},fireQueue:function(){var e=this._queue;for(var f=0,d=e.length;f<d;++f){this[e[f][0]].apply(this,e[f][1])}},appendTo:function(e,f){e=(e.get)?e.get("element"):b.get(e);this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:e});f=(f&&f.get)?f.get("element"):b.get(f);var d=this.get("element");if(!d){return false}if(!e){return false}if(d.parent!=e){if(f){e.insertBefore(d,f)}else{e.appendChild(d)}}this.fireEvent("appendTo",{type:"appendTo",target:e});return d},get:function(d){var f=this._configs||{},e=f.element;if(e&&!f[d]&&!YAHOO.lang.isUndefined(e.value[d])){this._setHTMLAttrConfig(d)}return c.prototype.get.call(this,d)},setAttributes:function(k,g){var e={},h=this._configOrder;for(var j=0,d=h.length;j<d;++j){if(k[h[j]]!==undefined){e[h[j]]=true;this.set(h[j],k[h[j]],g)}}for(var f in k){if(k.hasOwnProperty(f)&&!e[f]){this.set(f,k[f],g)}}},set:function(e,g,d){var f=this.get("element");
if(!f){this._queue[this._queue.length]=["set",arguments];if(this._configs[e]){this._configs[e].value=g}return}if(!this._configs[e]&&!YAHOO.lang.isUndefined(f[e])){this._setHTMLAttrConfig(e)}return c.prototype.set.apply(this,arguments)},setAttributeConfig:function(d,e,f){this._configOrder.push(d);c.prototype.setAttributeConfig.apply(this,arguments)},createEvent:function(e,d){this._events[e]=true;return c.prototype.createEvent.apply(this,arguments)},init:function(e,d){this._initElement(e,d)},destroy:function(){var d=this.get("element");YAHOO.util.Event.purgeElement(d,true);this.unsubscribeAll();if(d&&d.parentNode){d.parentNode.removeChild(d)}this._queue=[];this._events={};this._configs={};this._configOrder=[]},_initElement:function(f,e){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];e=e||{};e.element=e.element||f||null;var h=false;var d=a.DOM_EVENTS;this.DOM_EVENTS=this.DOM_EVENTS||{};for(var g in d){if(d.hasOwnProperty(g)){this.DOM_EVENTS[g]=d[g]
}}if(typeof e.element==="string"){this._setHTMLAttrConfig("id",{value:e.element})}if(b.get(e.element)){h=true;this._initHTMLElement(e);this._initContent(e)}YAHOO.util.Event.onAvailable(e.element,function(){if(!h){this._initHTMLElement(e)}this.fireEvent("available",{type:"available",target:b.get(e.element)})},this,true);YAHOO.util.Event.onContentReady(e.element,function(){if(!h){this._initContent(e)}this.fireEvent("contentReady",{type:"contentReady",target:b.get(e.element)})},this,true)},_initHTMLElement:function(d){this.setAttributeConfig("element",{value:b.get(d.element),readOnly:true})},_initContent:function(d){this.initAttributes(d);this.setAttributes(d,true);this.fireQueue()},_setHTMLAttrConfig:function(d,f){var e=this.get("element");f=f||{};f.name=d;f.setter=f.setter||this.DEFAULT_HTML_SETTER;f.getter=f.getter||this.DEFAULT_HTML_GETTER;f.value=f.value||e[d];this._configs[d]=new YAHOO.util.Attribute(f,this)}};YAHOO.augment(a,c);YAHOO.util.Element=a})();YAHOO.register("element",YAHOO.util.Element,{version:"2.7.0",build:"1799"});
(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("style" in d){b.Dom.setStyle(d,c,f+e)}else{if(c in d){d[c]=f}}},getAttribute:function(c){var e=this.getEl();var g=b.Dom.getStyle(e,c);if(g!=="auto"&&!this.patterns.offsetUnit.test(g)){return parseFloat(g)}var d=this.patterns.offsetAttribute.exec(c)||[];var h=!!(d[3]);var f=!!(d[2]);if("style" in e){if(f||(b.Dom.getStyle(e,"position")=="absolute"&&h)){g=e["offset"+d[0].charAt(0).toUpperCase()+d[0].substr(1)]
}else{g=0}}else{if(c in e){g=e[c]}}return g},getDefaultUnit:function(c){if(this.patterns.defaultUnit.test(c)){return"px"}return""},setRuntimeAttribute:function(d){var j;var e;var f=this.attributes;this.runtimeAttributes[d]={};var h=function(i){return(typeof i!=="undefined")};if(!h(f[d]["to"])&&!h(f[d]["by"])){return false}j=(h(f[d]["from"]))?f[d]["from"]:this.getAttribute(d);if(h(f[d]["to"])){e=f[d]["to"]}else{if(h(f[d]["by"])){if(j.constructor==Array){e=[];for(var g=0,c=j.length;g<c;++g){e[g]=j[g]+f[d]["by"][g]*1}}else{e=j+f[d]["by"]*1}}}this.runtimeAttributes[d].start=j;this.runtimeAttributes[d].end=e;this.runtimeAttributes[d].unit=(h(f[d].unit))?f[d]["unit"]:this.getDefaultUnit(d);return true},init:function(e,j,i,c){var d=false;var f=null;var h=0;e=b.Dom.get(e);this.attributes=j||{};this.duration=!YAHOO.lang.isUndefined(i)?i:1;this.method=c||b.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=b.AnimMgr.fps;this.setEl=function(m){e=b.Dom.get(m)};this.getEl=function(){return e
};this.isAnimated=function(){return d};this.getStartTime=function(){return f};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(b.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1}b.AnimMgr.registerElement(this);return true};this.stop=function(m){if(!this.isAnimated()){return false}if(m){this.currentFrame=this.totalFrames;this._onTween.fire()}b.AnimMgr.stop(this)};var l=function(){this.onStart.fire();this.runtimeAttributes={};for(var m in this.attributes){this.setRuntimeAttribute(m)}d=true;h=0;f=new Date()};var k=function(){var o={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};o.toString=function(){return("duration: "+o.duration+", currentFrame: "+o.currentFrame)};this.onTween.fire(o);var n=this.runtimeAttributes;for(var m in n){this.setAttribute(m,this.doMethod(m,n[m].start,n[m].end),n[m].unit)}h+=1};var g=function(){var m=(new Date()-f)/1000;
var n={duration:m,frames:h,fps:h/m};n.toString=function(){return("duration: "+n.duration+", frames: "+n.frames+", fps: "+n.fps)};d=false;h=0;this.onComplete.fire(n)};this._onStart=new b.CustomEvent("_start",this,true);this.onStart=new b.CustomEvent("start",this);this.onTween=new b.CustomEvent("tween",this);this._onTween=new b.CustomEvent("_tween",this,true);this.onComplete=new b.CustomEvent("complete",this);this._onComplete=new b.CustomEvent("_complete",this,true);this._onStart.subscribe(l);this._onTween.subscribe(k);this._onComplete.subscribe(g)}};b.Anim=a})();YAHOO.util.AnimMgr=new function(){var c=null;var b=[];var a=0;this.fps=1000;this.delay=1;this.registerElement=function(f){b[b.length]=f;a+=1;f._onStart.fire();this.start()};this.unRegister=function(g,f){f=f||e(g);if(!g.isAnimated()||f==-1){return false}g._onComplete.fire();b.splice(f,1);a-=1;if(a<=0){this.stop()}return true};this.start=function(){if(c===null){c=setInterval(this.run,this.delay)}};this.stop=function(h){if(!h){clearInterval(c);
for(var g=0,f=b.length;g<f;++g){this.unRegister(b[0],0)}b=[];c=null;a=0}else{this.unRegister(h)}};this.run=function(){for(var h=0,f=b.length;h<f;++h){var g=b[h];if(!g||!g.isAnimated()){continue}if(g.currentFrame<g.totalFrames||g.totalFrames===null){g.currentFrame+=1;if(g.useSeconds){d(g)}g._onTween.fire()}else{YAHOO.util.AnimMgr.stop(g,h)}}};var e=function(h){for(var g=0,f=b.length;g<f;++g){if(b[g]==h){return g}}return -1};var d=function(g){var j=g.totalFrames;var i=g.currentFrame;var h=(g.currentFrame*g.duration*1000/g.totalFrames);var f=(new Date()-g.getStartTime());var k=0;if(f<g.duration*1000){k=Math.round((f/h-1)*g.currentFrame)}else{k=j-(i+1)}if(k>0&&isFinite(k)){if(g.currentFrame+k>=j){k=j-(i+1)}g.currentFrame+=k}}};YAHOO.util.Bezier=new function(){this.getPosition=function(e,d){var f=e.length;var c=[];for(var b=0;b<f;++b){c[b]=[e[b][0],e[b][1]]}for(var a=1;a<f;++a){for(b=0;b<f-a;++b){c[b][0]=(1-d)*c[b][0]+d*c[parseInt(b+1,10)][0];c[b][1]=(1-d)*c[b][1]+d*c[parseInt(b+1,10)][1]}}return[c[0][0],c[0][1]]
}};(function(){var a=function(f,e,g,h){a.superclass.constructor.call(this,f,e,g,h)};a.NAME="ColorAnim";a.DEFAULT_BGCOLOR="#fff";var c=YAHOO.util;YAHOO.extend(a,c.Anim);var d=a.superclass;var b=a.prototype;b.patterns.color=/color$/i;b.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;b.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;b.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;b.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;b.parseColor=function(e){if(e.length==3){return e}var f=this.patterns.hex.exec(e);if(f&&f.length==4){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}f=this.patterns.rgb.exec(e);if(f&&f.length==4){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}f=this.patterns.hex3.exec(e);if(f&&f.length==4){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}return null};b.getAttribute=function(e){var g=this.getEl();if(this.patterns.color.test(e)){var i=YAHOO.util.Dom.getStyle(g,e);
var h=this;if(this.patterns.transparent.test(i)){var f=YAHOO.util.Dom.getAncestorBy(g,function(j){return !h.patterns.transparent.test(i)});if(f){i=c.Dom.getStyle(f,e)}else{i=a.DEFAULT_BGCOLOR}}}else{i=d.getAttribute.call(this,e)}return i};b.doMethod=function(f,k,g){var j;if(this.patterns.color.test(f)){j=[];for(var h=0,e=k.length;h<e;++h){j[h]=d.doMethod.call(this,f,k[h],g[h])}j="rgb("+Math.floor(j[0])+","+Math.floor(j[1])+","+Math.floor(j[2])+")"}else{j=d.doMethod.call(this,f,k,g)}return j};b.setRuntimeAttribute=function(f){d.setRuntimeAttribute.call(this,f);if(this.patterns.color.test(f)){var h=this.attributes;var k=this.parseColor(this.runtimeAttributes[f].start);var g=this.parseColor(this.runtimeAttributes[f].end);if(typeof h[f]["to"]==="undefined"&&typeof h[f]["by"]!=="undefined"){g=this.parseColor(h[f].by);for(var j=0,e=k.length;j<e;++j){g[j]=k[j]+g[j]}}this.runtimeAttributes[f].start=k;this.runtimeAttributes[f].end=g}};c.ColorAnim=a})();
/*
TERMS OF USE - EASING EQUATIONS
Open source under the BSD License.
Copyright 2001 Robert Penner All rights reserved.

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

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

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
YAHOO.util.Easing={easeNone:function(e,a,g,f){return g*e/f+a
},easeIn:function(e,a,g,f){return g*(e/=f)*e+a},easeOut:function(e,a,g,f){return -g*(e/=f)*(e-2)+a},easeBoth:function(e,a,g,f){if((e/=f/2)<1){return g/2*e*e+a}return -g/2*((--e)*(e-2)-1)+a},easeInStrong:function(e,a,g,f){return g*(e/=f)*e*e*e+a},easeOutStrong:function(e,a,g,f){return -g*((e=e/f-1)*e*e*e-1)+a},easeBothStrong:function(e,a,g,f){if((e/=f/2)<1){return g/2*e*e*e*e+a}return -g/2*((e-=2)*e*e*e-2)+a},elasticIn:function(g,e,k,j,f,i){if(g==0){return e}if((g/=j)==1){return e+k}if(!i){i=j*0.3}if(!f||f<Math.abs(k)){f=k;var h=i/4}else{var h=i/(2*Math.PI)*Math.asin(k/f)}return -(f*Math.pow(2,10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i))+e},elasticOut:function(g,e,k,j,f,i){if(g==0){return e}if((g/=j)==1){return e+k}if(!i){i=j*0.3}if(!f||f<Math.abs(k)){f=k;var h=i/4}else{var h=i/(2*Math.PI)*Math.asin(k/f)}return f*Math.pow(2,-10*g)*Math.sin((g*j-h)*(2*Math.PI)/i)+k+e},elasticBoth:function(g,e,k,j,f,i){if(g==0){return e}if((g/=j/2)==2){return e+k}if(!i){i=j*(0.3*1.5)}if(!f||f<Math.abs(k)){f=k;
var h=i/4}else{var h=i/(2*Math.PI)*Math.asin(k/f)}if(g<1){return -0.5*(f*Math.pow(2,10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i))+e}return f*Math.pow(2,-10*(g-=1))*Math.sin((g*j-h)*(2*Math.PI)/i)*0.5+k+e},backIn:function(e,a,h,g,f){if(typeof f=="undefined"){f=1.70158}return h*(e/=g)*e*((f+1)*e-f)+a},backOut:function(e,a,h,g,f){if(typeof f=="undefined"){f=1.70158}return h*((e=e/g-1)*e*((f+1)*e+f)+1)+a},backBoth:function(e,a,h,g,f){if(typeof f=="undefined"){f=1.70158}if((e/=g/2)<1){return h/2*(e*e*(((f*=(1.525))+1)*e-f))+a}return h/2*((e-=2)*e*(((f*=(1.525))+1)*e+f)+2)+a},bounceIn:function(e,a,g,f){return g-YAHOO.util.Easing.bounceOut(f-e,0,g,f)+a},bounceOut:function(e,a,g,f){if((e/=f)<(1/2.75)){return g*(7.5625*e*e)+a}else{if(e<(2/2.75)){return g*(7.5625*(e-=(1.5/2.75))*e+0.75)+a}else{if(e<(2.5/2.75)){return g*(7.5625*(e-=(2.25/2.75))*e+0.9375)+a}}}return g*(7.5625*(e-=(2.625/2.75))*e+0.984375)+a},bounceBoth:function(e,a,g,f){if(e<f/2){return YAHOO.util.Easing.bounceIn(e*2,0,g,f)*0.5+a}return YAHOO.util.Easing.bounceOut(e*2-f,0,g,f)*0.5+g*0.5+a
}};(function(){var a=function(h,g,i,j){if(h){a.superclass.constructor.call(this,h,g,i,j)}};a.NAME="Motion";var e=YAHOO.util;YAHOO.extend(a,e.ColorAnim);var f=a.superclass;var c=a.prototype;c.patterns.points=/^points$/i;c.setAttribute=function(g,i,h){if(this.patterns.points.test(g)){h=h||"px";f.setAttribute.call(this,"left",i[0],h);f.setAttribute.call(this,"top",i[1],h)}else{f.setAttribute.call(this,g,i,h)}};c.getAttribute=function(g){if(this.patterns.points.test(g)){var h=[f.getAttribute.call(this,"left"),f.getAttribute.call(this,"top")]}else{h=f.getAttribute.call(this,g)}return h};c.doMethod=function(g,k,h){var j=null;if(this.patterns.points.test(g)){var i=this.method(this.currentFrame,0,100,this.totalFrames)/100;j=e.Bezier.getPosition(this.runtimeAttributes[g],i)}else{j=f.doMethod.call(this,g,k,h)}return j};c.setRuntimeAttribute=function(q){if(this.patterns.points.test(q)){var h=this.getEl();var k=this.attributes;var g;var m=k.points["control"]||[];var j;var n,p;if(m.length>0&&!(m[0] instanceof Array)){m=[m]
}else{var l=[];for(n=0,p=m.length;n<p;++n){l[n]=m[n]}m=l}if(e.Dom.getStyle(h,"position")=="static"){e.Dom.setStyle(h,"position","relative")}if(d(k.points["from"])){e.Dom.setXY(h,k.points["from"])}else{e.Dom.setXY(h,e.Dom.getXY(h))}g=this.getAttribute("points");if(d(k.points["to"])){j=b.call(this,k.points["to"],g);var o=e.Dom.getXY(this.getEl());for(n=0,p=m.length;n<p;++n){m[n]=b.call(this,m[n],g)}}else{if(d(k.points["by"])){j=[g[0]+k.points["by"][0],g[1]+k.points["by"][1]];for(n=0,p=m.length;n<p;++n){m[n]=[g[0]+m[n][0],g[1]+m[n][1]]}}}this.runtimeAttributes[q]=[g];if(m.length>0){this.runtimeAttributes[q]=this.runtimeAttributes[q].concat(m)}this.runtimeAttributes[q][this.runtimeAttributes[q].length]=j}else{f.setRuntimeAttribute.call(this,q)}};var b=function(g,i){var h=e.Dom.getXY(this.getEl());g=[g[0]-h[0]+i[0],g[1]-h[1]+i[1]];return g};var d=function(g){return(typeof g!=="undefined")};e.Motion=a})();(function(){var d=function(f,e,g,h){if(f){d.superclass.constructor.call(this,f,e,g,h)}};
d.NAME="Scroll";var b=YAHOO.util;YAHOO.extend(d,b.ColorAnim);var c=d.superclass;var a=d.prototype;a.doMethod=function(e,h,f){var g=null;if(e=="scroll"){g=[this.method(this.currentFrame,h[0],f[0]-h[0],this.totalFrames),this.method(this.currentFrame,h[1],f[1]-h[1],this.totalFrames)]}else{g=c.doMethod.call(this,e,h,f)}return g};a.getAttribute=function(e){var g=null;var f=this.getEl();if(e=="scroll"){g=[f.scrollLeft,f.scrollTop]}else{g=c.getAttribute.call(this,e)}return g};a.setAttribute=function(e,h,g){var f=this.getEl();if(e=="scroll"){f.scrollLeft=h[0];f.scrollTop=h[1]}else{c.setAttribute.call(this,e,h,g)}};b.Scroll=d})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.7.0",build:"1799"});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(f,d){this.currentTarget=YAHOO.util.Event.getTarget(f);this.dragCurrent=d;var c=d.getEl();this.startX=YAHOO.util.Event.getPageX(f);this.startY=YAHOO.util.Event.getPageY(f);this.deltaX=this.startX-c.offsetLeft;this.deltaY=this.startY-c.offsetTop;
this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var e=YAHOO.util.DDM;e.startDrag(e.startX,e.startY);e.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(f,d){var c=this.dragCurrent;
if(c&&!d){if(this.dragThreshMet){if(c.events.b4EndDrag){c.b4EndDrag(f);c.fireEvent("b4EndDragEvent",{e:f})}if(c.events.endDrag){c.endDrag(f);c.fireEvent("endDragEvent",{e:f})}}if(c.events.mouseUp){c.onMouseUp(f);c.fireEvent("mouseUpEvent",{e:f})}}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(g){var c=this.dragCurrent;if(c){if(YAHOO.util.Event.isIE&&!g.button){this.stopEvent(g);return this.handleMouseUp(g)}else{if(g.clientX<0||g.clientY<0){}}if(!this.dragThreshMet){var f=Math.abs(this.startX-YAHOO.util.Event.getPageX(g));var d=Math.abs(this.startY-YAHOO.util.Event.getPageY(g));if(f>this.clickPixelThresh||d>this.clickPixelThresh){this.startDrag(this.startX,this.startY)}}if(this.dragThreshMet){if(c&&c.events.b4Drag){c.b4Drag(g);c.fireEvent("b4DragEvent",{e:g})}if(c&&c.events.drag){c.onDrag(g);c.fireEvent("dragEvent",{e:g})}if(c){this.fireEvents(g,false)
}}this.stopEvent(g)}},fireEvents:function(z,n){var E=this.dragCurrent;if(!E||E.isLocked()||E.dragOnly){return}var p=YAHOO.util.Event.getPageX(z),o=YAHOO.util.Event.getPageY(z),r=new YAHOO.util.Point(p,o),m=E.getTargetCoord(r.x,r.y),g=E.getDragEl(),f=["out","over","drop","enter"],w=new YAHOO.util.Region(m.y,m.x+g.offsetWidth,m.y+g.offsetHeight,m.x),k=[],d={},s=[],F={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var u in this.dragOvers){var G=this.dragOvers[u];if(!this.isTypeOfDD(G)){continue}if(!this.isOverTarget(r,G,this.mode,w)){F.outEvts.push(G)}k[u]=true;delete this.dragOvers[u]}for(var t in E.groups){if("string"!=typeof t){continue}for(u in this.ids[t]){var h=this.ids[t][u];if(!this.isTypeOfDD(h)){continue}if(h.isTarget&&!h.isLocked()&&h!=E){if(this.isOverTarget(r,h,this.mode,w)){d[t]=true;if(n){F.dropEvts.push(h)}else{if(!k[h.id]){F.enterEvts.push(h)}else{F.overEvts.push(h)}this.dragOvers[h.id]=h}}}}}this.interactionInfo={out:F.outEvts,enter:F.enterEvts,over:F.overEvts,drop:F.dropEvts,point:r,draggedRegion:w,sourceRegion:this.locationCache[E.id],validDrop:n};
for(var c in d){s.push(c)}if(n&&!F.dropEvts.length){this.interactionInfo.validDrop=false;if(E.events.invalidDrop){E.onInvalidDrop(z);E.fireEvent("invalidDropEvent",{e:z})}}for(u=0;u<f.length;u++){var C=null;if(F[f[u]+"Evts"]){C=F[f[u]+"Evts"]}if(C&&C.length){var j=f[u].charAt(0).toUpperCase()+f[u].substr(1),B="onDrag"+j,l="b4Drag"+j,q="drag"+j+"Event",A="drag"+j;if(this.mode){if(E.events[l]){E[l](z,C,s);E.fireEvent(l+"Event",{event:z,info:C,group:s})}if(E.events[A]){E[B](z,C,s);E.fireEvent(q,{event:z,info:C,group:s})}}else{for(var D=0,v=C.length;D<v;++D){if(E.events[l]){E[l](z,C[D].id,s[0]);E.fireEvent(l+"Event",{event:z,info:C[D].id,group:s[0]})}if(E.events[A]){E[B](z,C[D].id,s[0]);E.fireEvent(q,{event:z,info:C[D].id,group:s[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 h=this.ids[c][e];if(this.isTypeOfDD(h)){var j=this.getLocation(h);if(j){this.locationCache[h.id]=j}else{delete this.locationCache[h.id]}}}}},verifyEl:function(d){try{if(d){var c=d.offsetParent;if(c){return true}}}catch(f){}return false},getLocation:function(i){if(!this.isTypeOfDD(i)){return null}var g=i.getEl(),m,f,d,o,n,p,c,k,h;try{m=YAHOO.util.Dom.getXY(g)}catch(j){}if(!m){return null}f=m[0];d=f+g.offsetWidth;o=m[1];n=o+g.offsetHeight;p=o-i.padding[0];c=d+i.padding[1];k=n+i.padding[2];h=f-i.padding[3];return new YAHOO.util.Region(p,c,k,h)},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)
}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(k,j){var d=k.which||k.button;if(this.primaryButtonOnly&&d>1){return}if(this.isLocked()){return}var c=this.b4MouseDown(k),g=true;if(this.events.b4MouseDown){g=this.fireEvent("b4MouseDownEvent",k)}var f=this.onMouseDown(k),i=true;if(this.events.mouseDown){i=this.fireEvent("mouseDownEvent",k)}if((c===false)||(f===false)||(g===false)||(i===false)){return}this.DDM.refreshCache(this.groups);
var h=new YAHOO.util.Point(a.getPageX(k),a.getPageY(k));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(h,this)){}else{if(this.clickValidator(k)){this.setStartPosition();this.DDM.handleMouseDown(k,this);this.DDM.stopEvent(k)}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(g){var f=true;var j;try{j=g.nodeName.toUpperCase()}catch(h){j=g.nodeName}f=f&&!this.invalidHandleTypes[j];f=f&&!this.invalidHandleIds[g.id];for(var d=0,c=this.invalidHandleClasses.length;f&&d<c;++d){f=!b.hasClass(g,this.invalidHandleClasses[d])}return f},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)}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(j,f){if(!f){return j}else{if(f[0]>=j){return f[0]}else{for(var d=0,c=f.length;d<c;++d){var e=d+1;if(f[e]&&f[e]>=j){var h=j-f[d];var g=f[e]-j;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(k,j,e,l){if(this.scroll){var m=this.DDM.getClientHeight();var b=this.DDM.getClientWidth();var o=this.DDM.getScrollTop();var d=this.DDM.getScrollLeft();var i=e+j;var n=l+k;var g=(m+o-j-this.deltaY);var f=(b+d-k-this.deltaX);var c=40;var a=(document.all)?80:30;if(i>m&&g<c){window.scrollTo(d,o+a)}if(j<o&&o>0&&j-o<c){window.scrollTo(d,o-a)}if(n>b&&f<c){window.scrollTo(d+a,o)}if(k<d&&d>0&&k-d<c){window.scrollTo(d-a,o)
}}},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.7.0",build:"1799"});
(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(v,r){v=v.toLowerCase();var u=this.config[v],l=false,k,g,h,j,p,t,f,n,o,d,m,w,e;if(u&&u.event){if(!b.isUndefined(r)&&u.validator&&!u.validator(r)){return false}else{if(!b.isUndefined(r)){u.value=r}else{r=u.value}l=false;k=this.eventQueue.length;for(m=0;
m<k;m++){g=this.eventQueue[m];if(g){h=g[0];j=g[1];if(h==v){this.eventQueue[m]=null;this.eventQueue.push([v,(!b.isUndefined(r)?r:j)]);l=true;break}}}if(!l&&!b.isUndefined(r)){this.eventQueue.push([v,r])}}if(u.supercedes){p=u.supercedes.length;for(w=0;w<p;w++){t=u.supercedes[w];f=this.eventQueue.length;for(e=0;e<f;e++){n=this.eventQueue[e];if(n){o=n[0];d=n[1];if(o==t.toLowerCase()){this.eventQueue.push([o,d]);this.eventQueue[e]=null;break}}}}}return true}else{return false}},refireEvent:function(d){d=d.toLowerCase();var e=this.config[d];if(e&&e.event&&!b.isUndefined(e.value)){if(this.queueInProgress){this.queueProperty(d)}else{this.fireEvent(d,e.value)}}},applyConfig:function(d,g){var f,e;if(g){e={};for(f in d){if(b.hasOwnProperty(d,f)){e[f.toLowerCase()]=d[f]}}this.initialConfig=e}for(f in d){if(b.hasOwnProperty(d,f)){this.queueProperty(f,d[f])}}},refresh:function(){var d;for(d in this.config){if(b.hasOwnProperty(this.config,d)){this.refireEvent(d)}}},fireQueue:function(){var e,h,d,g,f;this.queueInProgress=true;
for(e=0;e<this.eventQueue.length;e++){h=this.eventQueue[e];if(h){d=h[0];g=h[1];f=this.config[d];f.value=g;this.eventQueue[e]=null;this.fireEvent(d,g)}}this.queueInProgress=false;this.eventQueue=[]},subscribeToConfigEvent:function(e,f,h,d){var g=this.config[e.toLowerCase()];if(g&&g.event){if(!a.alreadySubscribed(g.event,f,h)){g.event.subscribe(f,h,d)}return true}else{return false}},unsubscribeFromConfigEvent:function(d,e,g){var f=this.config[d.toLowerCase()];if(f&&f.event){return f.event.unsubscribe(e,g)}else{return false}},toString:function(){var d="Config";if(this.owner){d+=" ["+this.owner.toString()+"]"}return d},outputEventQueue:function(){var d="",g,e,f=this.eventQueue.length;for(e=0;e<f;e++){g=this.eventQueue[e];if(g){d+=g[0]+"="+g[1]+", "}}return d},destroy:function(){var e=this.config,d,f;for(d in e){if(b.hasOwnProperty(e,d)){f=e[d];f.event.unsubscribeAll();f.event=null}}this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;
this.eventQueue=null}};a.alreadySubscribed=function(e,h,j){var f=e.subscribers.length,d,g;if(f>0){g=f-1;do{d=e.subscribers[g];if(d&&d.obj==j&&d.fn==h){return true}}while(g--)}return false};YAHOO.lang.augmentProto(a,YAHOO.util.EventProvider)}());(function(){YAHOO.widget.Module=function(r,q){if(r){this.init(r,q)}else{}};var f=YAHOO.util.Dom,d=YAHOO.util.Config,n=YAHOO.util.Event,m=YAHOO.util.CustomEvent,g=YAHOO.widget.Module,i=YAHOO.env.ua,h,p,o,e,a={BEFORE_INIT:"beforeInit",INIT:"init",APPEND:"append",BEFORE_RENDER:"beforeRender",RENDER:"render",CHANGE_HEADER:"changeHeader",CHANGE_BODY:"changeBody",CHANGE_FOOTER:"changeFooter",CHANGE_CONTENT:"changeContent",DESTORY:"destroy",BEFORE_SHOW:"beforeShow",SHOW:"show",BEFORE_HIDE:"beforeHide",HIDE:"hide"},j={VISIBLE:{key:"visible",value:true,validator:YAHOO.lang.isBoolean},EFFECT:{key:"effect",suppressEvent:true,supercedes:["visible"]},MONITOR_RESIZE:{key:"monitorresize",value:true},APPEND_TO_DOCUMENT_BODY:{key:"appendtodocumentbody",value:false}};
g.IMG_ROOT=null;g.IMG_ROOT_SSL=null;g.CSS_MODULE="yui-module";g.CSS_HEADER="hd";g.CSS_BODY="bd";g.CSS_FOOTER="ft";g.RESIZE_MONITOR_SECURE_URL="javascript:false;";g.RESIZE_MONITOR_BUFFER=1;g.textResizeEvent=new m("textResize");g.forceDocumentRedraw=function(){var q=document.documentElement;if(q){q.className+=" ";q.className=YAHOO.lang.trim(q.className)}};function l(){if(!h){h=document.createElement("div");h.innerHTML=('<div class="'+g.CSS_HEADER+'"></div><div class="'+g.CSS_BODY+'"></div><div class="'+g.CSS_FOOTER+'"></div>');p=h.firstChild;o=p.nextSibling;e=o.nextSibling}return h}function k(){if(!p){l()}return(p.cloneNode(false))}function b(){if(!o){l()}return(o.cloneNode(false))}function c(){if(!e){l()}return(e.cloneNode(false))}g.prototype={constructor:g,element:null,header:null,body:null,footer:null,id:null,imageRoot:g.IMG_ROOT,initEvents:function(){var q=m.LIST;this.beforeInitEvent=this.createEvent(a.BEFORE_INIT);this.beforeInitEvent.signature=q;this.initEvent=this.createEvent(a.INIT);
this.initEvent.signature=q;this.appendEvent=this.createEvent(a.APPEND);this.appendEvent.signature=q;this.beforeRenderEvent=this.createEvent(a.BEFORE_RENDER);this.beforeRenderEvent.signature=q;this.renderEvent=this.createEvent(a.RENDER);this.renderEvent.signature=q;this.changeHeaderEvent=this.createEvent(a.CHANGE_HEADER);this.changeHeaderEvent.signature=q;this.changeBodyEvent=this.createEvent(a.CHANGE_BODY);this.changeBodyEvent.signature=q;this.changeFooterEvent=this.createEvent(a.CHANGE_FOOTER);this.changeFooterEvent.signature=q;this.changeContentEvent=this.createEvent(a.CHANGE_CONTENT);this.changeContentEvent.signature=q;this.destroyEvent=this.createEvent(a.DESTORY);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.width="2em";s.style.height="2em";s.style.top=(-1*(s.offsetHeight+g.RESIZE_MONITOR_BUFFER))+"px";s.style.left="0";s.style.borderWidth="0";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}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}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}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,u;function r(v){if(typeof v=="string"){v=document.getElementById(v)}if(v){t._addToParent(v,t.element);t.appendEvent.fire()}}this.beforeRenderEvent.fire();if(!q){q=this.element}if(s){r(s)}else{if(!f.inDocument(this.element)){return false}}if(this.header&&!f.inDocument(this.header)){u=q.firstChild;if(u){q.insertBefore(this.header,u)}else{q.appendChild(this.header)}}if(this.body&&!f.inDocument(this.body)){if(this.footer&&f.isAncestor(this.moduleElement,this.footer)){q.insertBefore(this.body,this.footer)}else{q.appendChild(this.body)}}if(this.footer&&!f.inDocument(this.footer)){q.appendChild(this.footer)
}this.renderEvent.fire();return true},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.CSS_OVERLAY="yui-overlay";b.STD_MOD_RE=/^\s*?(body|footer|header)\s*?$/i;b.windowScrollEvent=new m("windowScroll");b.windowResizeEvent=new m("windowResize");b.windowScrollHandler=function(p){var o=n.getTarget(p);if(!o||o===window||o===window.document){if(k.ie){if(!window.scrollEnd){window.scrollEnd=-1}clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){b.windowScrollEvent.fire()},1)}else{b.windowScrollEvent.fire()}}};b.windowResizeHandler=function(o){if(k.ie){if(!window.resizeEnd){window.resizeEnd=-1}clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){b.windowResizeEvent.fire()},100)}else{b.windowResizeEvent.fire()}};b._initialized=null;if(b._initialized===null){n.on(window,"scroll",b.windowScrollHandler);n.on(window,"resize",b.windowResizeHandler);b._initialized=true}b._TRIGGER_MAP={windowScroll:b.windowScrollEvent,windowResize:b.windowResizeEvent,textResize:g.textResizeEvent};
YAHOO.extend(b,g,{CONTEXT_TRIGGERS:[],init:function(p,o){b.superclass.init.call(this,p);this.beforeInitEvent.fire(b);f.addClass(this.element,b.CSS_OVERLAY);if(o){this.cfg.applyConfig(o,true)}if(this.platform=="mac"&&k.gecko){if(!d.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true)}if(!d.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true)}}this.initEvent.fire(b)},initEvents:function(){b.superclass.initEvents.call(this);var o=m.LIST;this.beforeMoveEvent=this.createEvent(a.BEFORE_MOVE);this.beforeMoveEvent.signature=o;this.moveEvent=this.createEvent(a.MOVE);this.moveEvent.signature=o},initDefaultConfig:function(){b.superclass.initDefaultConfig.call(this);var o=this.cfg;o.addProperty(l.X.key,{handler:this.configX,validator:l.X.validator,suppressEvent:l.X.suppressEvent,supercedes:l.X.supercedes});o.addProperty(l.Y.key,{handler:this.configY,validator:l.Y.validator,suppressEvent:l.Y.suppressEvent,supercedes:l.Y.supercedes});
o.addProperty(l.XY.key,{handler:this.configXY,suppressEvent:l.XY.suppressEvent,supercedes:l.XY.supercedes});o.addProperty(l.CONTEXT.key,{handler:this.configContext,suppressEvent:l.CONTEXT.suppressEvent,supercedes:l.CONTEXT.supercedes});o.addProperty(l.FIXED_CENTER.key,{handler:this.configFixedCenter,value:l.FIXED_CENTER.value,validator:l.FIXED_CENTER.validator,supercedes:l.FIXED_CENTER.supercedes});o.addProperty(l.WIDTH.key,{handler:this.configWidth,suppressEvent:l.WIDTH.suppressEvent,supercedes:l.WIDTH.supercedes});o.addProperty(l.HEIGHT.key,{handler:this.configHeight,suppressEvent:l.HEIGHT.suppressEvent,supercedes:l.HEIGHT.supercedes});o.addProperty(l.AUTO_FILL_HEIGHT.key,{handler:this.configAutoFillHeight,value:l.AUTO_FILL_HEIGHT.value,validator:this._validateAutoFill,supercedes:l.AUTO_FILL_HEIGHT.supercedes});o.addProperty(l.ZINDEX.key,{handler:this.configzIndex,value:l.ZINDEX.value});o.addProperty(l.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:l.CONSTRAIN_TO_VIEWPORT.value,validator:l.CONSTRAIN_TO_VIEWPORT.validator,supercedes:l.CONSTRAIN_TO_VIEWPORT.supercedes});
o.addProperty(l.IFRAME.key,{handler:this.configIframe,value:l.IFRAME.value,validator:l.IFRAME.validator,supercedes:l.IFRAME.supercedes});o.addProperty(l.PREVENT_CONTEXT_OVERLAP.key,{value:l.PREVENT_CONTEXT_OVERLAP.value,validator:l.PREVENT_CONTEXT_OVERLAP.validator,supercedes:l.PREVENT_CONTEXT_OVERLAP.supercedes})},moveTo:function(o,p){this.cfg.setProperty("xy",[o,p])},hideMacGeckoScrollbars:function(){f.replaceClass(this.element,"show-scrollbars","hide-scrollbars")},showMacGeckoScrollbars:function(){f.replaceClass(this.element,"hide-scrollbars","show-scrollbars")},_setDomVisibility:function(o){f.setStyle(this.element,"visibility",(o)?"visible":"hidden");if(o){f.removeClass(this.element,"yui-overlay-hidden")}else{f.addClass(this.element,"yui-overlay-hidden")}},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),F=d.alreadySubscribed,w,p,E,C,B,A,D,z,t;if(s=="inherit"){E=this.element.parentNode;
while(E.nodeType!=9&&E.nodeType!=11){s=f.getStyle(E,"visibility");if(s!="inherit"){break}E=E.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&&!F(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&&!F(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");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
}v=j.cloneNode(false);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(t,s,p){var w=s[0],q,o,u,r,v=this.CONTEXT_TRIGGERS;if(w){q=w[0];o=w[1];u=w[2];r=w[3];if(v&&v.length>0){r=(r||[]).concat(v)}if(q){if(typeof q=="string"){this.cfg.setProperty("context",[document.getElementById(q),o,u,r],true)}if(o&&u){this.align(o,u)}if(this._contextTriggers){this._processTriggers(this._contextTriggers,e,this._alignOnTrigger)}if(r){this._processTriggers(r,h,this._alignOnTrigger);this._contextTriggers=r}}}},_alignOnTrigger:function(p,o){this.align()},_findTriggerCE:function(o){var p=null;if(o instanceof m){p=o
}else{if(b._TRIGGER_MAP[o]){p=b._TRIGGER_MAP[o]}}return p},_processTriggers:function(s,v,r){var q,u;for(var p=0,o=s.length;p<o;++p){q=s[p];u=this._findTriggerCE(q);if(u){u[v](r,this,true)}else{this[v](q,r)}}},align:function(p,o){var u=this.cfg.getProperty("context"),t=this,s,r,v;function q(w,x){switch(p){case b.TOP_LEFT:t.moveTo(x,w);break;case b.TOP_RIGHT:t.moveTo((x-r.offsetWidth),w);break;case b.BOTTOM_LEFT:t.moveTo(x,(w-r.offsetHeight));break;case b.BOTTOM_RIGHT:t.moveTo((x-r.offsetWidth),(w-r.offsetHeight));break}}if(u){s=u[0];r=this.element;t=this;if(!p){p=u[1]}if(!o){o=u[2]}if(r&&s){v=f.getRegion(s);switch(o){case b.TOP_LEFT:q(v.top,v.left);break;case b.TOP_RIGHT:q(v.top,v.right);break;case b.BOTTOM_LEFT:q(v.bottom,v.left);break;case b.BOTTOM_RIGHT:q(v.bottom,v.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)},getConstrainedX:function(v){var s=this,o=s.element,F=o.offsetWidth,D=b.VIEWPORT_OFFSET,I=f.getViewportWidth(),E=f.getDocumentScrollLeft(),z=(F+D<I),C=this.cfg.getProperty("context"),q,y,K,t=false,G,w,H=E+D,p=E+I-F-D,J=v,u={tltr:true,blbr:true,brbl:true,trtl:true};
var A=function(){var x;if((s.cfg.getProperty("x")-E)>y){x=(y-F)}else{x=(y+K)}s.cfg.setProperty("x",(x+E),true);return x};var r=function(){if((s.cfg.getProperty("x")-E)>y){return(w-D)}else{return(G-D)}};var B=function(){var x=r(),L;if(F>x){if(t){A()}else{A();t=true;L=B()}}return L};if(v<H||v>p){if(z){if(this.cfg.getProperty("preventcontextoverlap")&&C&&u[(C[1]+C[2])]){q=C[0];y=f.getX(q)-E;K=q.offsetWidth;G=y;w=(I-(y+K));B();J=this.cfg.getProperty("x")}else{if(v<H){J=H}else{if(v>p){J=p}}}}else{J=D+E}}return J},getConstrainedY:function(A){var w=this,p=w.element,J=p.offsetHeight,I=b.VIEWPORT_OFFSET,E=f.getViewportHeight(),H=f.getDocumentScrollTop(),F=(J+I<E),G=this.cfg.getProperty("context"),u,B,C,x=false,v,q,D=H+I,s=H+E-J-I,o=A,z={trbr:true,tlbl:true,bltl:true,brtr:true};var t=function(){var y;if((w.cfg.getProperty("y")-H)>B){y=(B-J)}else{y=(B+C)}w.cfg.setProperty("y",(y+H),true);return y};var r=function(){if((w.cfg.getProperty("y")-H)>B){return(q-I)}else{return(v-I)}};var K=function(){var L=r(),y;
if(J>L){if(x){t()}else{t();x=true;y=K()}}return y};if(A<D||A>s){if(F){if(this.cfg.getProperty("preventcontextoverlap")&&G&&z[(G[1]+G[2])]){u=G[0];C=u.offsetHeight;B=(f.getY(u)-H);v=B;q=(E-(B+C));K();o=w.cfg.getProperty("y")}else{if(A<D){o=D}else{if(A>s){o=s}}}}else{o=I+H}}return o},getConstrainedXY:function(o,p){return[this.getConstrainedX(o),this.getConstrainedY(p)]},center:function(){var r=b.VIEWPORT_OFFSET,s=this.element.offsetWidth,q=this.element.offsetHeight,p=f.getViewportWidth(),t=f.getViewportHeight(),o,u;if(s<p){o=(p/2)-(s/2)+f.getDocumentScrollLeft()}else{o=r+f.getDocumentScrollLeft()}if(q<t){u=(t/2)-(q/2)+f.getDocumentScrollTop()}else{u=r+f.getDocumentScrollTop()}this.cfg.setProperty("xy",[parseInt(o,10),parseInt(u,10)]);this.cfg.refireEvent("iframe");if(k.webkit){this.forceContainerRedraw()}},syncPosition:function(){var o=f.getXY(this.element);this.cfg.setProperty("x",o[0],true);this.cfg.setProperty("y",o[1],true);this.cfg.setProperty("xy",o,true)},onDomResize:function(q,p){var o=this;
b.superclass.onDomResize.call(this,q,p);setTimeout(function(){o.syncPosition();o.cfg.refireEvent("iframe");o.cfg.refireEvent("context")},0)},_getComputedHeight:(function(){if(document.defaultView&&document.defaultView.getComputedStyle){return function(p){var o=null;if(p.ownerDocument&&p.ownerDocument.defaultView){var q=p.ownerDocument.defaultView.getComputedStyle(p,"");if(q){o=parseInt(q.height,10)}}return(i.isNumber(o))?o:null}}else{return function(p){var o=null;if(p.style.pixelHeight){o=p.style.pixelHeight}return(i.isNumber(o))?o:null}}})(),_validateAutoFillHeight:function(o){return(!o)||(i.isString(o)&&b.STD_MOD_RE.test(o))},_autoFillOnHeightChange:function(r,p,q){var o=this.cfg.getProperty("height");if((o&&o!=="auto")||(o===0)){this.fillHeight(q)}},_getPreciseHeight:function(p){var o=p.offsetHeight;if(p.getBoundingClientRect){var q=p.getBoundingClientRect();o=q.bottom-q.top}return o},fillHeight:function(r){if(r){var p=this.innerElement||this.element,o=[this.header,this.body,this.footer],v,w=0,x=0,t=0,q=false;
for(var u=0,s=o.length;u<s;u++){v=o[u];if(v){if(r!==v){x+=this._getPreciseHeight(v)}else{q=true}}}if(q){if(k.ie||k.opera){f.setStyle(r,"height",0+"px")}w=this._getComputedHeight(p);if(w===null){f.addClass(p,"yui-override-padding");w=p.clientHeight;f.removeClass(p,"yui-override-padding")}t=Math.max(w-x,0);f.setStyle(r,"height",t+"px");if(r.offsetHeight!=t){t=Math.max(t-(r.offsetHeight-t),0)}f.setStyle(r,"height",t+"px")}}},bringToTop:function(){var s=[],r=this.element;function v(z,y){var B=f.getStyle(z,"zIndex"),A=f.getStyle(y,"zIndex"),x=(!B||isNaN(B))?0:parseInt(B,10),w=(!A||isNaN(A))?0:parseInt(A,10);if(x>w){return -1}else{if(x<w){return 1}else{return 0}}}function q(y){var x=f.hasClass(y,b.CSS_OVERLAY),w=YAHOO.widget.Panel;if(x&&!f.isAncestor(r,y)){if(w&&f.hasClass(y,w.CSS_PANEL)){s[s.length]=y.parentNode}else{s[s.length]=y}}}f.getElementsBy(q,"DIV",document.body);s.sort(v);var o=s[0],u;if(o){u=f.getStyle(o,"zIndex");if(!isNaN(u)){var t=false;if(o!=r){t=true}else{if(s.length>1){var p=f.getStyle(s[1],"zIndex");
if(!isNaN(p)&&(u==p)){t=true}}}if(t){this.cfg.setProperty("zindex",(parseInt(u,10)+2))}}}},destroy:function(){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);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 k=false,h,j;if(g instanceof d){g.cfg.addProperty("manager",{value:this});this._bindFocus(g);this._bindBlur(g);this._bindDestroy(g);this._syncZIndex(g);
this.overlays.push(g);this.bringToTop(g);k=true}else{if(g instanceof Array){for(h=0,j=g.length;h<j;h++){k=this.register(g[h])||k}}}return k},bringToTop:function(m){var i=this.find(m),l,g,j;if(i){j=this.overlays;j.sort(this.compareZIndexDesc);g=j[0];if(g){l=e.getStyle(g.element,"zIndex");if(!isNaN(l)){var k=false;if(g!==i){k=true}else{if(j.length>1){var h=e.getStyle(j[1].element,"zIndex");if(!isNaN(h)&&(l==h)){k=true}}}if(k){i.cfg.setProperty("zindex",(parseInt(l,10)+2))}}j.sort(this.compareZIndexDesc)}}},find:function(g){var l=g instanceof d,j=this.overlays,p=j.length,k=null,m,h;if(l||typeof g=="string"){for(h=p-1;h>=0;h--){m=j[h];if((l&&(m===g))||(m.id==g)){k=m;break}}}return k},compareZIndexDesc:function(j,i){var h=(j.cfg)?j.cfg.getProperty("zIndex"):null,g=(i.cfg)?i.cfg.getProperty("zIndex"):null;if(h===null&&g===null){return 0}else{if(h===null){return 1}else{if(g===null){return -1}else{if(h>g){return -1}else{if(h<g){return 1}else{return 0}}}}}},showAll:function(){var h=this.overlays,j=h.length,g;
for(g=j-1;g>=0;g--){h[g].show()}},hideAll:function(){var h=this.overlays,j=h.length,g;for(g=j-1;g>=0;g--){h[g].hide()}},toString:function(){return"OverlayManager"}}}());(function(){YAHOO.widget.Tooltip=function(p,o){YAHOO.widget.Tooltip.superclass.constructor.call(this,p,o)};var e=YAHOO.lang,n=YAHOO.util.Event,m=YAHOO.util.CustomEvent,c=YAHOO.util.Dom,j=YAHOO.widget.Tooltip,h=YAHOO.env.ua,g=(h.ie&&(h.ie<=6||document.compatMode=="BackCompat")),f,i={PREVENT_OVERLAP:{key:"preventoverlap",value:true,validator:e.isBoolean,supercedes:["x","y","xy"]},SHOW_DELAY:{key:"showdelay",value:200,validator:e.isNumber},AUTO_DISMISS_DELAY:{key:"autodismissdelay",value:5000,validator:e.isNumber},HIDE_DELAY:{key:"hidedelay",value:250,validator:e.isNumber},TEXT:{key:"text",suppressEvent:true},CONTAINER:{key:"container"},DISABLED:{key:"disabled",value:false,suppressEvent:true}},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})},configText:function(p,o,q){var r=o[0];if(r){this.setBody(r)}},configContainer:function(q,p,r){var o=p[0];if(typeof o=="string"){this.cfg.setProperty("container",document.getElementById(o),true)}},_removeEventListeners:function(){var r=this._context,o,q,p;if(r){o=r.length;if(o>0){p=o-1;do{q=r[p];n.removeListener(q,"mouseover",this.onContextMouseOver);n.removeListener(q,"mousemove",this.onContextMouseMove);n.removeListener(q,"mouseout",this.onContextMouseOut)}while(p--)}}},configContext:function(t,p,u){var s=p[0],v,o,r,q;if(s){if(!(s instanceof Array)){if(typeof s=="string"){this.cfg.setProperty("context",[document.getElementById(s)],true)
}else{this.cfg.setProperty("context",[s],true)}s=this.cfg.getProperty("context")}this._removeEventListeners();this._context=s;v=this._context;if(v){o=v.length;if(o>0){q=o-1;do{r=v[q];n.on(r,"mouseover",this.onContextMouseOver,this);n.on(r,"mousemove",this.onContextMouseMove,this);n.on(r,"mouseout",this.onContextMouseOut,this)}while(q--)}}}},onContextMouseMove:function(p,o){o.pageX=n.getPageX(p);o.pageY=n.getPageY(p)},onContextMouseOver:function(q,p){var o=this;if(o.title){p._tempTitle=o.title;o.title=""}if(p.fireEvent("contextMouseOver",o,q)!==false&&!p.cfg.getProperty("disabled")){if(p.hideProcId){clearTimeout(p.hideProcId);p.hideProcId=null}n.on(o,"mousemove",p.onContextMouseMove,p);p.showProcId=p.doShow(q,o)}},onContextMouseOut:function(q,p){var o=this;if(p._tempTitle){o.title=p._tempTitle;p._tempTitle=null}if(p.showProcId){clearTimeout(p.showProcId);p.showProcId=null}if(p.hideProcId){clearTimeout(p.hideProcId);p.hideProcId=null}p.fireEvent("contextMouseOut",o,q);p.hideProcId=setTimeout(function(){p.hide()
},p.cfg.getProperty("hidedelay"))},doShow:function(q,o){var r=25,p=this;if(h.opera&&o.tagName&&o.tagName.toUpperCase()=="A"){r+=12}return setTimeout(function(){var s=p.cfg.getProperty("text");if(p._tempTitle&&(s===""||YAHOO.lang.isUndefined(s)||YAHOO.lang.isNull(s))){p.setBody(p._tempTitle)}else{p.cfg.refireEvent("text")}p.moveTo(p.pageX,p.pageY+r);if(p.cfg.getProperty("preventoverlap")){p.preventOverlap(p.pageX,p.pageY)}n.removeListener(o,"mousemove",p.onContextMouseMove);p.contextTriggerEvent.fire(o);p.show();p.hideProcId=p.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;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;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)},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 v=this.underlay;a.addClass(v,"yui-force-redraw");setTimeout(function(){a.removeClass(v,"yui-force-redraw")},0)},toString:function(){return"Panel "+this.id}})}());(function(){YAHOO.widget.Dialog=function(j,i){YAHOO.widget.Dialog.superclass.constructor.call(this,j,i)};var b=YAHOO.util.Event,g=YAHOO.util.CustomEvent,e=YAHOO.util.Dom,a=YAHOO.widget.Dialog,f=YAHOO.lang,h={BEFORE_SUBMIT:"beforeSubmit",SUBMIT:"submit",MANUAL_SUBMIT:"manualSubmit",ASYNC_SUBMIT:"asyncSubmit",FORM_SUBMIT:"formSubmit",CANCEL:"cancel"},c={POST_METHOD:{key:"postmethod",value:"async"},POST_DATA:{key:"postdata",value:null},BUTTONS:{key:"buttons",value:"none",supercedes:["visible"]},HIDEAFTERSUBMIT:{key:"hideaftersubmit",value:true}};
a.CSS_DIALOG="yui-dialog";function d(){var m=this._aButtons,k,l,j;if(f.isArray(m)){k=m.length;if(k>0){j=k-1;do{l=m[j];if(YAHOO.widget.Button&&l instanceof YAHOO.widget.Button){l.destroy()}else{if(l.tagName.toUpperCase()=="BUTTON"){b.purgeElement(l);b.purgeElement(l,false)}}}while(j--)}}}YAHOO.extend(a,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){a.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty(c.POST_METHOD.key,{handler:this.configPostMethod,value:c.POST_METHOD.value,validator:function(i){if(i!="form"&&i!="async"&&i!="none"&&i!="manual"){return false}else{return true}}});this.cfg.addProperty(c.POST_DATA.key,{value:c.POST_DATA.value});this.cfg.addProperty(c.HIDEAFTERSUBMIT.key,{value:c.HIDEAFTERSUBMIT.value});this.cfg.addProperty(c.BUTTONS.key,{handler:this.configButtons,value:c.BUTTONS.value,supercedes:c.BUTTONS.supercedes})},initEvents:function(){a.superclass.initEvents.call(this);var i=g.LIST;this.beforeSubmitEvent=this.createEvent(h.BEFORE_SUBMIT);
this.beforeSubmitEvent.signature=i;this.submitEvent=this.createEvent(h.SUBMIT);this.submitEvent.signature=i;this.manualSubmitEvent=this.createEvent(h.MANUAL_SUBMIT);this.manualSubmitEvent.signature=i;this.asyncSubmitEvent=this.createEvent(h.ASYNC_SUBMIT);this.asyncSubmitEvent.signature=i;this.formSubmitEvent=this.createEvent(h.FORM_SUBMIT);this.formSubmitEvent.signature=i;this.cancelEvent=this.createEvent(h.CANCEL);this.cancelEvent.signature=i},init:function(j,i){a.superclass.init.call(this,j);this.beforeInitEvent.fire(a);e.addClass(this.element,a.CSS_DIALOG);this.cfg.setProperty("visible",false);if(i){this.cfg.applyConfig(i,true)}this.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 q=YAHOO.util.Connect,r=this.form,l=false,o=false,s,n,m,j;switch(this.cfg.getProperty("postmethod")){case"async":s=r.elements;n=s.length;if(n>0){m=n-1;do{if(s[m].type=="file"){l=true;
break}}while(m--)}if(l&&YAHOO.env.ua.ie&&this.isSecure){o=true}j=this._getFormAttributes(r);q.setForm(r,l,o);var k=this.cfg.getProperty("postdata");var p=q.asyncRequest(j.method,j.action,this.callback,k);this.asyncSubmitEvent.fire(p);break;case"form":r.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break}},_getFormAttributes:function(k){var i={method:null,action:null};if(k){if(k.getAttributeNode){var j=k.getAttributeNode("action");var l=k.getAttributeNode("method");if(j){i.action=j.value}if(l){i.method=l.value}}else{i.action=k.getAttribute("action");i.method=k.getAttribute("method")}}i.method=(f.isString(i.method)?i.method:"POST").toUpperCase();i.action=f.isString(i.action)?i.action:"";return i},registerForm:function(){var i=this.element.getElementsByTagName("form")[0];if(this.form){if(this.form==i&&e.isAncestor(this.element,this.form)){return}else{b.purgeElement(this.form);this.form=null}}if(!i){i=document.createElement("form");i.name="frm_"+this.id;
this.body.appendChild(i)}if(i){this.form=i;b.on(i,"submit",this._submitHandler,this,true)}},_submitHandler:function(i){b.stopEvent(i);this.submit();this.form.blur()},setTabLoop:function(i,j){i=i||this.firstButton;j=this.lastButton||j;a.superclass.setTabLoop.call(this,i,j)},setFirstLastFocusable:function(){a.superclass.setFirstLastFocusable.call(this);var k,j,m,n=this.focusableElements;this.firstFormElement=null;this.lastFormElement=null;if(this.form&&n&&n.length>0){j=n.length;for(k=0;k<j;++k){m=n[k];if(this.form===m.form){this.firstFormElement=m;break}}for(k=j-1;k>=0;--k){m=n[k];if(this.form===m.form){this.lastFormElement=m;break}}}},configClose:function(j,i,k){a.superclass.configClose.apply(this,arguments)},_doClose:function(i){b.preventDefault(i);this.cancel()},configButtons:function(t,s,n){var o=YAHOO.widget.Button,v=s[0],l=this.innerElement,u,q,k,r,p,j,m;d.call(this);this._aButtons=null;if(f.isArray(v)){p=document.createElement("span");p.className="button-group";r=v.length;this._aButtons=[];
this.defaultHtmlButton=null;for(m=0;m<r;m++){u=v[m];if(o){k=new o({label:u.text});k.appendTo(p);q=k.get("element");if(u.isDefault){k.addClass("default");this.defaultHtmlButton=q}if(f.isFunction(u.handler)){k.set("onclick",{fn:u.handler,obj:this,scope:this})}else{if(f.isObject(u.handler)&&f.isFunction(u.handler.fn)){k.set("onclick",{fn:u.handler.fn,obj:((!f.isUndefined(u.handler.obj))?u.handler.obj:this),scope:(u.handler.scope||this)})}}this._aButtons[this._aButtons.length]=k}else{q=document.createElement("button");q.setAttribute("type","button");if(u.isDefault){q.className="default";this.defaultHtmlButton=q}q.innerHTML=u.text;if(f.isFunction(u.handler)){b.on(q,"click",u.handler,this,true)}else{if(f.isObject(u.handler)&&f.isFunction(u.handler.fn)){b.on(q,"click",u.handler.fn,((!f.isUndefined(u.handler.obj))?u.handler.obj:this),(u.handler.scope||this))}}p.appendChild(q);this._aButtons[this._aButtons.length]=q}u.htmlButton=q;if(m===0){this.firstButton=q}if(m==(r-1)){this.lastButton=q}}this.setFooter(p);
j=this.footer;if(e.inDocument(this.element)&&!e.isAncestor(l,j)){l.appendChild(j)}this.buttonSpan=p}else{p=this.buttonSpan;j=this.footer;if(p&&j){j.removeChild(p);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null}}this.changeContentEvent.fire()},getButtons:function(){return this._aButtons||null},focusFirst:function(k,i,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 o=this.cfg.getProperty("buttons"),l,n,k,j;
if(o&&f.isArray(o)){l=o.length;if(l>0){j=(l-1);do{n=o[j];if(n){k=this._getButton(n.htmlButton);if(k){try{k.blur()}catch(m){}}}}while(j--)}}},focusFirstButton:function(){var l=this.cfg.getProperty("buttons"),k,i;if(l&&f.isArray(l)){k=l[0];if(k){i=this._getButton(k.htmlButton);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()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();if(this.cfg.getProperty("hideaftersubmit")){this.hide()}return true}else{return false}},cancel:function(){this.cancelEvent.fire();this.hide()},getData:function(){var A=this.form,l,t,w,o,u,r,q,k,x,m,y,B,j,p,C,z,v;function s(n){var i=n.tagName.toUpperCase();return((i=="INPUT"||i=="TEXTAREA"||i=="SELECT")&&n.name==o)
}if(A){l=A.elements;t=l.length;w={};for(z=0;z<t;z++){o=l[z].name;u=e.getElementsBy(s,"*",A);r=u.length;if(r>0){if(r==1){u=u[0];q=u.type;k=u.tagName.toUpperCase();switch(k){case"INPUT":if(q=="checkbox"){w[o]=u.checked}else{if(q!="radio"){w[o]=u.value}}break;case"TEXTAREA":w[o]=u.value;break;case"SELECT":x=u.options;m=x.length;y=[];for(v=0;v<m;v++){B=x[v];if(B.selected){j=B.value;if(!j||j===""){j=B.text}y[y.length]=j}}w[o]=y;break}}else{q=u[0].type;switch(q){case"radio":for(v=0;v<r;v++){p=u[v];if(p.checked){w[o]=p.value;break}}break;case"checkbox":y=[];for(v=0;v<r;v++){C=u[v];if(C.checked){y[y.length]=C.value}}w[o]=y;break}}}}}return w},destroy:function(){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(f,e,j){var k=e[0],d=this.body,i=b.ICON_CSS_CLASSNAME,h,g;if(k&&k!="none"){h=c.getElementsByClassName(i,"*",d);if(h){g=h.parentNode;if(g){g.removeChild(h);h=null}}if(k.indexOf(".")==-1){h=document.createElement("span");h.className=(i+" "+k);h.innerHTML="&#160;"}else{h=document.createElement("img");h.src=(this.imageRoot+k);h.className=i}if(h){d.insertBefore(h,d.firstChild)}}},configText:function(e,d,f){var g=d[0];if(g){this.setBody(g);this.cfg.refireEvent("icon")}},toString:function(){return"SimpleDialog "+this.id}})}());(function(){YAHOO.widget.ContainerEffect=function(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)}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.7.0",build:"1799"});(function(){var s="DIV",o="hd",k="bd",n="ft",x="LI",a="disabled",d="mouseover",f="mouseout",u="mousedown",g="mouseup",r=YAHOO.env.ua.ie?"focusin":"focus",v="click",b="keydown",m="keyup",i="keypress",l="clicktohide",t="position",p="dynamic",y="showdelay",j="selected",e="visible",w="UL",q="MenuManager",c=YAHOO.util.Dom,z=YAHOO.util.Event,h=YAHOO.lang;YAHOO.widget.MenuManager=function(){var A=false,C={},R={},D={},N={click:"clickEvent",mousedown:"mouseDownEvent",mouseup:"mouseUpEvent",mouseover:"mouseOverEvent",mouseout:"mouseOutEvent",keydown:"keyDownEvent",keyup:"keyUpEvent",keypress:"keyPressEvent",focus:"focusEvent",focusin:"focusEvent",blur:"blurEvent",focusout:"blurEvent"},M=null,K=null;function O(U){var S,T;if(U&&U.tagName){switch(U.tagName.toUpperCase()){case s:S=U.parentNode;if((c.hasClass(U,o)||c.hasClass(U,k)||c.hasClass(U,n))&&S&&S.tagName&&S.tagName.toUpperCase()==s){T=S
}else{T=U}break;case x:T=U;break;default:S=U.parentNode;if(S){T=O(S)}break}}return T}function Q(W){var S=z.getTarget(W),T=O(S),Y,U,V,aa,Z;if(T){U=T.tagName.toUpperCase();if(U==x){V=T.id;if(V&&D[V]){aa=D[V];Z=aa.parent}}else{if(U==s){if(T.id){Z=C[T.id]}}}}if(Z){Y=N[W.type];if(aa&&!aa.cfg.getProperty(a)){aa[Y].fire(W)}Z[Y].fire(W,aa)}else{if(W.type==u){for(var X in R){if(h.hasOwnProperty(R,X)){Z=R[X];if(Z.cfg.getProperty(l)&&!(Z instanceof YAHOO.widget.MenuBar)&&Z.cfg.getProperty(t)==p){Z.hide()}else{if(Z.cfg.getProperty(y)>0){Z._cancelShowDelay()}if(Z.activeItem){Z.activeItem.blur();Z.activeItem.cfg.setProperty(j,false);Z.activeItem=null}}}}}else{if(W.type==r){M=S}}}}function F(T,S,U){if(C[U.id]){this.removeMenu(U)}}function J(T,S){var U=S[1];if(U){K=U}}function I(T,S){K=null}function B(T,S,V){if(V&&V.focus){try{V.focus()}catch(U){}}this.hideEvent.unsubscribe(B,V)}function L(T,S){if(this===this.getRoot()&&this.cfg.getProperty(t)===p){this.hideEvent.subscribe(B,M);this.focus()}}function G(U,T){var S=T[0],V=this.id;
if(S){R[V]=this}else{if(R[V]){delete R[V]}}}function H(T,S){P(this)}function P(T){var S=T.id;if(S&&D[S]){if(K==T){K=null}delete D[S];T.destroyEvent.unsubscribe(H)}}function E(T,S){var V=S[0],U;if(V instanceof YAHOO.widget.MenuItem){U=V.id;if(!D[U]){D[U]=V;V.destroyEvent.subscribe(H)}}}return{addMenu:function(T){var S;if(T instanceof YAHOO.widget.Menu&&T.id&&!C[T.id]){C[T.id]=T;if(!A){S=document;z.on(S,d,Q,this,true);z.on(S,f,Q,this,true);z.on(S,u,Q,this,true);z.on(S,g,Q,this,true);z.on(S,v,Q,this,true);z.on(S,b,Q,this,true);z.on(S,m,Q,this,true);z.on(S,i,Q,this,true);z.onFocus(S,Q,this,true);z.onBlur(S,Q,this,true);A=true}T.cfg.subscribeToConfigEvent(e,G);T.destroyEvent.subscribe(F,T,this);T.itemAddedEvent.subscribe(E);T.focusEvent.subscribe(J);T.blurEvent.subscribe(I);T.showEvent.subscribe(L)}},removeMenu:function(V){var T,S,U;if(V){T=V.id;if((T in C)&&(C[T]==V)){S=V.getItems();if(S&&S.length>0){U=S.length-1;do{P(S[U])}while(U--)}delete C[T];if((T in R)&&(R[T]==V)){delete R[T]}if(V.cfg){V.cfg.unsubscribeFromConfigEvent(e,G)
}V.destroyEvent.unsubscribe(F,V);V.itemAddedEvent.unsubscribe(E);V.focusEvent.unsubscribe(J);V.blurEvent.unsubscribe(I)}}},hideVisible:function(){var S;for(var T in R){if(h.hasOwnProperty(R,T)){S=R[T];if(!(S instanceof YAHOO.widget.MenuBar)&&S.cfg.getProperty(t)==p){S.hide()}}}},getVisible:function(){return R},getMenus:function(){return C},getMenu:function(T){var S;if(T in C){S=C[T]}return S},getMenuItem:function(T){var S;if(T in D){S=D[T]}return S},getMenuItemGroup:function(W){var T=c.get(W),S,Y,X,U,V;if(T&&T.tagName&&T.tagName.toUpperCase()==w){Y=T.firstChild;if(Y){S=[];do{U=Y.id;if(U){X=this.getMenuItem(U);if(X){S[S.length]=X}}}while((Y=Y.nextSibling));if(S.length>0){V=S}}}return V},getFocusedMenuItem:function(){return K},getFocusedMenu:function(){var S;if(K){S=K.parent.getRoot()}return S},toString:function(){return q}}}()})();(function(){var an=YAHOO.lang,aP="Menu",h="DIV",k="div",aL="id",ai="SELECT",F="xy",r="y",aW="UL",l="ul",ak="first-of-type",L="LI",I="OPTGROUP",aY="OPTION",aG="disabled",az="none",Z="selected",aS="groupindex",J="index",o="submenu",aT="visible",ay="hidedelay",aC="position",ae="dynamic",c="static",aM=ae+","+c,y="windows",q="url",m="#",v="target",av="maxheight",t="topscrollbar",Y="bottomscrollbar",E="_",p=t+E+aG,e=Y+E+aG,C="mousemove",aU="showdelay",D="submenuhidedelay",ag="iframe",X="constraintoviewport",a3="preventcontextoverlap",ap="submenualignment",A="autosubmenudisplay",ad="clicktohide",H="container",K="scrollincrement",aI="minscrollheight",a1="classname",aF="shadow",aQ="keepopen",aZ="hd",d="hastitle",Q="context",V="",aJ="mousedown",aD="keydown",aN="height",u="width",ar="px",aX="effect",af="monitorresize",ax="display",aw="block",j="visibility",aa="absolute",au="zindex",M="yui-menu-body-scrolled",al="&#32;",a0=" ",aH="mouseover",g="mouseout",at="itemAdded",O="itemRemoved",am="hidden",T="yui-menu-shadow",ah=T+"-visible",N=T+a0+ah;
YAHOO.widget.Menu=function(a5,a4){if(a4){this.parent=a4.parent;this.lazyLoad=a4.lazyLoad||a4.lazyload;this.itemData=a4.itemData||a4.itemdata}YAHOO.widget.Menu.superclass.constructor.call(this,a5,a4)};function b(a5){var a4=false;if(an.isString(a5)){a4=(aM.indexOf((a5.toLowerCase()))!=-1)}return a4}var G=YAHOO.util.Dom,ab=YAHOO.util.Event,aV=YAHOO.widget.Module,ac=YAHOO.widget.Overlay,S=YAHOO.widget.Menu,a2=YAHOO.widget.MenuManager,f=YAHOO.util.CustomEvent,aR=YAHOO.env.ua,aO,aB=[["mouseOverEvent",aH],["mouseOutEvent",g],["mouseDownEvent",aJ],["mouseUpEvent","mouseup"],["clickEvent","click"],["keyPressEvent","keypress"],["keyDownEvent",aD],["keyUpEvent","keyup"],["focusEvent","focus"],["blurEvent","blur"],["itemAddedEvent",at],["itemRemovedEvent",O]],aA={key:aT,value:false,validator:an.isBoolean},aq={key:X,value:true,validator:an.isBoolean,supercedes:[ag,"x",r,F]},aj={key:a3,value:true,validator:an.isBoolean,supercedes:[X]},s={key:aC,value:ae,validator:b,supercedes:[aT,ag]},a={key:ap,value:["tl","tr"]},U={key:A,value:true,validator:an.isBoolean,suppressEvent:true},z={key:aU,value:250,validator:an.isNumber,suppressEvent:true},R={key:ay,value:0,validator:an.isNumber,suppressEvent:true},W={key:D,value:250,validator:an.isNumber,suppressEvent:true},P={key:ad,value:true,validator:an.isBoolean,suppressEvent:true},ao={key:H,suppressEvent:true},aE={key:K,value:1,validator:an.isNumber,supercedes:[av],suppressEvent:true},n={key:aI,value:90,validator:an.isNumber,supercedes:[av],suppressEvent:true},x={key:av,value:0,validator:an.isNumber,supercedes:[ag],suppressEvent:true},w={key:a1,value:null,validator:an.isString,suppressEvent:true},B={key:aG,value:false,validator:an.isBoolean,suppressEvent:true},i={key:aF,value:true,validator:an.isBoolean,suppressEvent:true,supercedes:[aT]},aK={key:aQ,value:false,validator:an.isBoolean};
YAHOO.lang.extend(S,ac,{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(a6,a5){this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuItem}var a4;if(an.isString(a6)){a4=G.get(a6)}else{if(a6.tagName){a4=a6}}if(a4&&a4.tagName){switch(a4.tagName.toUpperCase()){case h:this.srcElement=a4;if(!a4.id){a4.setAttribute(aL,G.generateId())}S.superclass.init.call(this,a4);this.beforeInitEvent.fire(S);break;case ai:this.srcElement=a4;S.superclass.init.call(this,G.generateId());this.beforeInitEvent.fire(S);break}}else{S.superclass.init.call(this,a6);this.beforeInitEvent.fire(S)}if(this.element){G.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((aR.gecko&&aR.gecko<1.9)||aR.webkit){this.cfg.subscribeToConfigEvent(r,this._onYChange)}if(a5){this.cfg.applyConfig(a5,true)}a2.addMenu(this);this.initEvent.fire(S)}},_initSubTree:function(){var a5=this.srcElement,a4,a7,ba,bb,a9,a8,a6;if(a5){a4=(a5.tagName&&a5.tagName.toUpperCase());if(a4==h){bb=this.body.firstChild;if(bb){a7=0;ba=this.GROUP_TITLE_TAG_NAME.toUpperCase();do{if(bb&&bb.tagName){switch(bb.tagName.toUpperCase()){case ba:this._aGroupTitleElements[a7]=bb;
break;case aW:this._aListElements[a7]=bb;this._aItemGroups[a7]=[];a7++;break}}}while((bb=bb.nextSibling));if(this._aListElements[0]){G.addClass(this._aListElements[0],ak)}}}bb=null;if(a4){switch(a4){case h:a9=this._aListElements;a8=a9.length;if(a8>0){a6=a8-1;do{bb=a9[a6].firstChild;if(bb){do{if(bb&&bb.tagName&&bb.tagName.toUpperCase()==L){this.addItem(new this.ITEM_TYPE(bb,{parent:this}),a6)}}while((bb=bb.nextSibling))}}while(a6--)}break;case ai:bb=a5.firstChild;do{if(bb&&bb.tagName){switch(bb.tagName.toUpperCase()){case I:case aY:this.addItem(new this.ITEM_TYPE(bb,{parent:this}));break}}}while((bb=bb.nextSibling));break}}}},_getFirstEnabledItem:function(){var a4=this.getItems(),a8=a4.length,a7,a6;for(var a5=0;a5<a8;a5++){a7=a4[a5];if(a7&&!a7.cfg.getProperty(aG)&&a7.element.style.display!=az){a6=a7;break}}return a6},_addItemToGroup:function(a9,ba,be){var bc,bf,a7,bd,a8,a5,a6,bb;function a4(bg,bh){return(bg[bh]||a4(bg,(bh+1)))}if(ba instanceof this.ITEM_TYPE){bc=ba;bc.parent=this}else{if(an.isString(ba)){bc=new this.ITEM_TYPE(ba,{parent:this})
}else{if(an.isObject(ba)){ba.parent=this;bc=new this.ITEM_TYPE(ba.text,ba)}}}if(bc){if(bc.cfg.getProperty(Z)){this.activeItem=bc}bf=an.isNumber(a9)?a9:0;a7=this._getItemGroup(bf);if(!a7){a7=this._createItemGroup(bf)}if(an.isNumber(be)){a8=(be>=a7.length);if(a7[be]){a7.splice(be,0,bc)}else{a7[be]=bc}bd=a7[be];if(bd){if(a8&&(!bd.element.parentNode||bd.element.parentNode.nodeType==11)){this._aListElements[bf].appendChild(bd.element)}else{a5=a4(a7,(be+1));if(a5&&(!bd.element.parentNode||bd.element.parentNode.nodeType==11)){this._aListElements[bf].insertBefore(bd.element,a5.element)}}bd.parent=this;this._subscribeToItemEvents(bd);this._configureSubmenu(bd);this._updateItemProperties(bf);this.itemAddedEvent.fire(bd);this.changeContentEvent.fire();bb=bd}}else{a6=a7.length;a7[a6]=bc;bd=a7[a6];if(bd){if(!G.isAncestor(this._aListElements[bf],bd.element)){this._aListElements[bf].appendChild(bd.element)}bd.element.setAttribute(aS,bf);bd.element.setAttribute(J,a6);bd.parent=this;bd.index=a6;bd.groupIndex=bf;
this._subscribeToItemEvents(bd);this._configureSubmenu(bd);if(a6===0){G.addClass(bd.element,ak)}this.itemAddedEvent.fire(bd);this.changeContentEvent.fire();bb=bd}}}return bb},_removeItemFromGroupByIndex:function(a7,a5){var a6=an.isNumber(a7)?a7:0,a8=this._getItemGroup(a6),ba,a9,a4;if(a8){ba=a8.splice(a5,1);a9=ba[0];if(a9){this._updateItemProperties(a6);if(a8.length===0){a4=this._aListElements[a6];if(this.body&&a4){this.body.removeChild(a4)}this._aItemGroups.splice(a6,1);this._aListElements.splice(a6,1);a4=this._aListElements[0];if(a4){G.addClass(a4,ak)}}this.itemRemovedEvent.fire(a9);this.changeContentEvent.fire()}}return a9},_removeItemFromGroupByValue:function(a7,a4){var a9=this._getItemGroup(a7),ba,a8,a6,a5;if(a9){ba=a9.length;a8=-1;if(ba>0){a5=ba-1;do{if(a9[a5]==a4){a8=a5;break}}while(a5--);if(a8>-1){a6=this._removeItemFromGroupByIndex(a7,a8)}}}return a6},_updateItemProperties:function(a5){var a6=this._getItemGroup(a5),a9=a6.length,a8,a7,a4;if(a9>0){a4=a9-1;do{a8=a6[a4];if(a8){a7=a8.element;
a8.index=a4;a8.groupIndex=a5;a7.setAttribute(aS,a5);a7.setAttribute(J,a4);G.removeClass(a7,ak)}}while(a4--);if(a7){G.addClass(a7,ak)}}},_createItemGroup:function(a6){var a4,a5;if(!this._aItemGroups[a6]){this._aItemGroups[a6]=[];a4=document.createElement(l);this._aListElements[a6]=a4;a5=this._aItemGroups[a6]}return a5},_getItemGroup:function(a6){var a4=an.isNumber(a6)?a6:0,a7=this._aItemGroups,a5;if(a4 in a7){a5=a7[a4]}return a5},_configureSubmenu:function(a4){var a5=a4.cfg.getProperty(o);if(a5){this.cfg.configChangedEvent.subscribe(this._onParentMenuConfigChange,a5,true);this.renderEvent.subscribe(this._onParentMenuRender,a5,true)}},_subscribeToItemEvents:function(a4){a4.destroyEvent.subscribe(this._onMenuItemDestroy,a4,this);a4.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange,a4,this)},_onVisibleChange:function(a6,a5){var a4=a5[0];if(a4){G.addClass(this.element,aT)}else{G.removeClass(this.element,aT)}},_cancelHideDelay:function(){var a4=this.getRoot()._hideDelayTimer;if(a4){a4.cancel()
}},_execHideDelay:function(){this._cancelHideDelay();var a4=this.getRoot();a4._hideDelayTimer=an.later(a4.cfg.getProperty(ay),this,function(){if(a4.activeItem){if(a4.hasFocus()){a4.activeItem.focus()}a4.clearActiveItem()}if(a4==this&&!(this instanceof YAHOO.widget.MenuBar)&&this.cfg.getProperty(aC)==ae){this.hide()}})},_cancelShowDelay:function(){var a4=this.getRoot()._showDelayTimer;if(a4){a4.cancel()}},_execSubmenuHideDelay:function(a6,a5,a4){a6._submenuHideDelayTimer=an.later(50,this,function(){if(this._nCurrentMouseX>(a5+10)){a6._submenuHideDelayTimer=an.later(a4,a6,function(){this.hide()})}else{a6.hide()}})},_disableScrollHeader:function(){if(!this._bHeaderDisabled){G.addClass(this.header,p);this._bHeaderDisabled=true}},_disableScrollFooter:function(){if(!this._bFooterDisabled){G.addClass(this.footer,e);this._bFooterDisabled=true}},_enableScrollHeader:function(){if(this._bHeaderDisabled){G.removeClass(this.header,p);this._bHeaderDisabled=false}},_enableScrollFooter:function(){if(this._bFooterDisabled){G.removeClass(this.footer,e);
this._bFooterDisabled=false}},_onMouseOver:function(bg,a9){var bh=a9[0],bd=a9[1],a4=ab.getTarget(bh),a8=this.getRoot(),bf=this._submenuHideDelayTimer,a5,a7,bc,a6,bb,ba;var be=function(){if(this.parent.cfg.getProperty(Z)){this.show()}};if(!this._bStopMouseEventHandlers){if(!this._bHandledMouseOverEvent&&(a4==this.element||G.isAncestor(this.element,a4))){if(this._useHideDelay){this._cancelHideDelay()}this._nCurrentMouseX=0;ab.on(this.element,C,this._onMouseMove,this,true);if(!(bd&&G.isAncestor(bd.element,ab.getRelatedTarget(bh)))){this.clearActiveItem()}if(this.parent&&bf){bf.cancel();this.parent.cfg.setProperty(Z,true);a5=this.parent.parent;a5._bHandledMouseOutEvent=true;a5._bHandledMouseOverEvent=false}this._bHandledMouseOverEvent=true;this._bHandledMouseOutEvent=false}if(bd&&!bd.handledMouseOverEvent&&!bd.cfg.getProperty(aG)&&(a4==bd.element||G.isAncestor(bd.element,a4))){a7=this.cfg.getProperty(aU);bc=(a7>0);if(bc){this._cancelShowDelay()}a6=this.activeItem;if(a6){a6.cfg.setProperty(Z,false)
}bb=bd.cfg;bb.setProperty(Z,true);if(this.hasFocus()||a8._hasFocus){bd.focus();a8._hasFocus=false}if(this.cfg.getProperty(A)){ba=bb.getProperty(o);if(ba){if(bc){a8._showDelayTimer=an.later(a8.cfg.getProperty(aU),ba,be)}else{ba.show()}}}bd.handledMouseOverEvent=true;bd.handledMouseOutEvent=false}}},_onMouseOut:function(bc,a6){var bd=a6[0],ba=a6[1],a7=ab.getRelatedTarget(bd),bb=false,a9,a8,a4,a5;if(!this._bStopMouseEventHandlers){if(ba&&!ba.cfg.getProperty(aG)){a9=ba.cfg;a8=a9.getProperty(o);if(a8&&(a7==a8.element||G.isAncestor(a8.element,a7))){bb=true}if(!ba.handledMouseOutEvent&&((a7!=ba.element&&!G.isAncestor(ba.element,a7))||bb)){if(!bb){ba.cfg.setProperty(Z,false);if(a8){a4=this.cfg.getProperty(D);a5=this.cfg.getProperty(aU);if(!(this instanceof YAHOO.widget.MenuBar)&&a4>0&&a5>=a4){this._execSubmenuHideDelay(a8,ab.getPageX(bd),a4)}else{a8.hide()}}}ba.handledMouseOutEvent=true;ba.handledMouseOverEvent=false}}if(!this._bHandledMouseOutEvent&&((a7!=this.element&&!G.isAncestor(this.element,a7))||bb)){if(this._useHideDelay){this._execHideDelay()
}ab.removeListener(this.element,C,this._onMouseMove);this._nCurrentMouseX=ab.getPageX(bd);this._bHandledMouseOutEvent=true;this._bHandledMouseOverEvent=false}}},_onMouseMove:function(a5,a4){if(!this._bStopMouseEventHandlers){this._nCurrentMouseX=ab.getPageX(a5)}},_onClick:function(bf,a6){var bg=a6[0],ba=a6[1],bc=false,a8,bd,a5,a4,a9,bb,be;var a7=function(){if(!((aR.gecko&&this.platform==y)&&bg.button>0)){a5=this.getRoot();if(a5 instanceof YAHOO.widget.MenuBar||a5.cfg.getProperty(aC)==c){a5.clearActiveItem()}else{a5.hide()}}};if(ba){if(ba.cfg.getProperty(aG)){ab.preventDefault(bg);a7.call(this)}else{a8=ba.cfg.getProperty(o);a9=ba.cfg.getProperty(q);if(a9){bb=a9.indexOf(m);be=a9.length;if(bb!=-1){a9=a9.substr(bb,be);be=a9.length;if(be>1){a4=a9.substr(1,be);bd=YAHOO.widget.MenuManager.getMenu(a4);if(bd){bc=(this.getRoot()===bd.getRoot())}}else{if(be===1){bc=true}}}}if(bc&&!ba.cfg.getProperty(v)){ab.preventDefault(bg);if(aR.webkit){ba.focus()}else{ba.focusEvent.fire()}}if(!a8&&!this.cfg.getProperty(aQ)){a7.call(this)
}}}},_onKeyDown:function(bi,bc){var bf=bc[0],be=bc[1],bb,bg,a5,a9,bj,a4,bl,a8,bh,a7,bd,bk,ba;if(this._useHideDelay){this._cancelHideDelay()}function a6(){this._bStopMouseEventHandlers=true;an.later(10,this,function(){this._bStopMouseEventHandlers=false})}if(be&&!be.cfg.getProperty(aG)){bg=be.cfg;a5=this.parent;switch(bf.keyCode){case 38:case 40:bj=(bf.keyCode==38)?be.getPreviousEnabledSibling():be.getNextEnabledSibling();if(bj){this.clearActiveItem();bj.cfg.setProperty(Z,true);bj.focus();if(this.cfg.getProperty(av)>0){a4=this.body;bl=a4.scrollTop;a8=a4.offsetHeight;bh=this.getItems();a7=bh.length-1;bd=bj.element.offsetTop;if(bf.keyCode==40){if(bd>=(a8+bl)){a4.scrollTop=bd-a8}else{if(bd<=bl){a4.scrollTop=0}}if(bj==bh[a7]){a4.scrollTop=bj.element.offsetTop}}else{if(bd<=bl){a4.scrollTop=bd-bj.element.offsetHeight}else{if(bd>=(bl+a8)){a4.scrollTop=bd}}if(bj==bh[0]){a4.scrollTop=0}}bl=a4.scrollTop;bk=a4.scrollHeight-a4.offsetHeight;if(bl===0){this._disableScrollHeader();this._enableScrollFooter()
}else{if(bl==bk){this._enableScrollHeader();this._disableScrollFooter()}else{this._enableScrollHeader();this._enableScrollFooter()}}}}ab.preventDefault(bf);a6();break;case 39:bb=bg.getProperty(o);if(bb){if(!bg.getProperty(Z)){bg.setProperty(Z,true)}bb.show();bb.setInitialFocus();bb.setInitialSelection()}else{a9=this.getRoot();if(a9 instanceof YAHOO.widget.MenuBar){bj=a9.activeItem.getNextEnabledSibling();if(bj){a9.clearActiveItem();bj.cfg.setProperty(Z,true);bb=bj.cfg.getProperty(o);if(bb){bb.show();bb.setInitialFocus()}else{bj.focus()}}}}ab.preventDefault(bf);a6();break;case 37:if(a5){ba=a5.parent;if(ba instanceof YAHOO.widget.MenuBar){bj=ba.activeItem.getPreviousEnabledSibling();if(bj){ba.clearActiveItem();bj.cfg.setProperty(Z,true);bb=bj.cfg.getProperty(o);if(bb){bb.show();bb.setInitialFocus()}else{bj.focus()}}}else{this.hide();a5.focus()}}ab.preventDefault(bf);a6();break}}if(bf.keyCode==27){if(this.cfg.getProperty(aC)==ae){this.hide();if(this.parent){this.parent.focus()}}else{if(this.activeItem){bb=this.activeItem.cfg.getProperty(o);
if(bb&&bb.cfg.getProperty(aT)){bb.hide();this.activeItem.focus()}else{this.activeItem.blur();this.activeItem.cfg.setProperty(Z,false)}}}ab.preventDefault(bf)}},_onKeyPress:function(a6,a5){var a4=a5[0];if(a4.keyCode==40||a4.keyCode==38){ab.preventDefault(a4)}},_onBlur:function(a5,a4){if(this._hasFocus){this._hasFocus=false}},_onYChange:function(a5,a4){var a7=this.parent,a9,a6,a8;if(a7){a9=a7.parent.body.scrollTop;if(a9>0){a8=(this.cfg.getProperty(r)-a9);G.setY(this.element,a8);a6=this.iframe;if(a6){G.setY(a6,a8)}this.cfg.setProperty(r,a8,true)}}},_onScrollTargetMouseOver:function(ba,bd){var bc=this._bodyScrollTimer;if(bc){bc.cancel()}this._cancelHideDelay();var a6=ab.getTarget(ba),a8=this.body,a7=this.cfg.getProperty(K),a4,a5;function bb(){var be=a8.scrollTop;if(be<a4){a8.scrollTop=(be+a7);this._enableScrollHeader()}else{a8.scrollTop=a4;this._bodyScrollTimer.cancel();this._disableScrollFooter()}}function a9(){var be=a8.scrollTop;if(be>0){a8.scrollTop=(be-a7);this._enableScrollFooter()}else{a8.scrollTop=0;
this._bodyScrollTimer.cancel();this._disableScrollHeader()}}if(G.hasClass(a6,aZ)){a5=a9}else{a4=a8.scrollHeight-a8.offsetHeight;a5=bb}this._bodyScrollTimer=an.later(10,this,a5,null,true)},_onScrollTargetMouseOut:function(a6,a4){var a5=this._bodyScrollTimer;if(a5){a5.cancel()}this._cancelHideDelay()},_onInit:function(a5,a4){this.cfg.subscribeToConfigEvent(aT,this._onVisibleChange);var a6=!this.parent,a7=this.lazyLoad;if(((a6&&!a7)||(a6&&(this.cfg.getProperty(aT)||this.cfg.getProperty(aC)==c))||(!a6&&!a7))&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree()}if(this.itemData){this.addItems(this.itemData)}}else{if(a7){this.cfg.fireQueue()}}},_onBeforeRender:function(a7,a6){var a8=this.element,bb=this._aListElements.length,a5=true,ba=0,a4,a9;if(bb>0){do{a4=this._aListElements[ba];if(a4){if(a5){G.addClass(a4,ak);a5=false}if(!G.isAncestor(a8,a4)){this.appendToBody(a4)}a9=this._aGroupTitleElements[ba];if(a9){if(!G.isAncestor(a8,a9)){a4.parentNode.insertBefore(a9,a4)}G.addClass(a4,d)
}}ba++}while(ba<bb)}},_onRender:function(a5,a4){if(this.cfg.getProperty(aC)==ae){if(!this.cfg.getProperty(aT)){this.positionOffScreen()}}},_onBeforeShow:function(a6,a5){var a8,bb,a7,a9=this.cfg.getProperty(H);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()==ai){a8=this.itemData.length;for(bb=0;bb<a8;bb++){if(this.itemData[bb].tagName){this.addItem((new this.ITEM_TYPE(this.itemData[bb])))}}}else{this.addItems(this.itemData)}}a7=this.srcElement;if(a7){if(a7.tagName.toUpperCase()==ai){if(G.inDocument(a7)){this.render(a7.parentNode)}else{this.render(a9)}}else{this.render()}}else{if(this.parent){this.render(this.parent.element)}else{this.render(a9)}}}var ba=this.parent,a4;if(!ba&&this.cfg.getProperty(aC)==ae){this.cfg.refireEvent(F)}if(ba){a4=ba.parent.cfg.getProperty(ap);this.cfg.setProperty(Q,[ba.element,a4[0],a4[1]]);
this.align()}},getConstrainedY:function(bg){var br=this,bn=br.cfg.getProperty(Q),bu=br.cfg.getProperty(av),bq,bf={trbr:true,tlbl:true,bltl:true,brtr:true},a9=(bn&&bf[bn[1]+bn[2]]),bb=br.element,bv=bb.offsetHeight,bp=ac.VIEWPORT_OFFSET,bk=G.getViewportHeight(),bo=G.getDocumentScrollTop(),bl=(br.cfg.getProperty(aI)+bp<bk),bt,bc,bi,bj,be=false,bd,a6,bh=bo+bp,a8=bo+bk-bv-bp,a4=bg;var ba=function(){var bw;if((br.cfg.getProperty(r)-bo)>bi){bw=(bi-bv)}else{bw=(bi+bj)}br.cfg.setProperty(r,(bw+bo),true);return bw};var a7=function(){if((br.cfg.getProperty(r)-bo)>bi){return(a6-bp)}else{return(bd-bp)}};var bm=function(){var bw;if((br.cfg.getProperty(r)-bo)>bi){bw=(bi+bj)}else{bw=(bi-bb.offsetHeight)}br.cfg.setProperty(r,(bw+bo),true)};var a5=function(){br._setScrollHeight(this.cfg.getProperty(av));br.hideEvent.unsubscribe(a5)};var bs=function(){var bz=a7(),bw=(br.getItems().length>0),by,bx;if(bv>bz){by=bw?br.cfg.getProperty(aI):bv;if((bz>by)&&bw){bq=bz}else{bq=bu}br._setScrollHeight(bq);br.hideEvent.subscribe(a5);
bm();if(bz<by){if(be){ba()}else{ba();be=true;bx=bs()}}}else{if(bq&&(bq!==bu)){br._setScrollHeight(bu);br.hideEvent.subscribe(a5);bm()}}return bx};if(bg<bh||bg>a8){if(bl){if(br.cfg.getProperty(a3)&&a9){bc=bn[0];bj=bc.offsetHeight;bi=(G.getY(bc)-bo);bd=bi;a6=(bk-(bi+bj));bs();a4=br.cfg.getProperty(r)}else{if(!(br instanceof YAHOO.widget.MenuBar)&&bv>=bk){bt=(bk-(bp*2));if(bt>br.cfg.getProperty(aI)){br._setScrollHeight(bt);br.hideEvent.subscribe(a5);bm();a4=br.cfg.getProperty(r)}}else{if(bg<bh){a4=bh}else{if(bg>a8){a4=a8}}}}}else{a4=bp+bo}}return a4},_onHide:function(a5,a4){if(this.cfg.getProperty(aC)===ae){this.positionOffScreen()}},_onShow:function(bc,ba){var a4=this.parent,a6,a7,a9,a5;function a8(be){var bd;if(be.type==aJ||(be.type==aD&&be.keyCode==27)){bd=ab.getTarget(be);if(bd!=a6.element||!G.isAncestor(a6.element,bd)){a6.cfg.setProperty(A,false);ab.removeListener(document,aJ,a8);ab.removeListener(document,aD,a8)}}}function bb(be,bd,bf){this.cfg.setProperty(u,V);this.hideEvent.unsubscribe(bb,bf)
}if(a4){a6=a4.parent;if(!a6.cfg.getProperty(A)&&(a6 instanceof YAHOO.widget.MenuBar||a6.cfg.getProperty(aC)==c)){a6.cfg.setProperty(A,true);ab.on(document,aJ,a8);ab.on(document,aD,a8)}if((this.cfg.getProperty("x")<a6.cfg.getProperty("x"))&&(aR.gecko&&aR.gecko<1.9)&&!this.cfg.getProperty(u)){a7=this.element;a9=a7.offsetWidth;a7.style.width=a9+ar;a5=(a9-(a7.offsetWidth-a9))+ar;this.cfg.setProperty(u,a5);this.hideEvent.subscribe(bb,a5)}}},_onBeforeHide:function(a6,a5){var a4=this.activeItem,a8=this.getRoot(),a9,a7;if(a4){a9=a4.cfg;a9.setProperty(Z,false);a7=a9.getProperty(o);if(a7){a7.hide()}}if(aR.ie&&this.cfg.getProperty(aC)===ae&&this.parent){a8._hasFocus=this.hasFocus()}if(a8==this){a8.blur()}},_onParentMenuConfigChange:function(a5,a4,a8){var a6=a4[0][0],a7=a4[0][1];switch(a6){case ag:case X:case ay:case aU:case D:case ad:case aX:case a1:case K:case av:case aI:case af:case aF:case a3:a8.cfg.setProperty(a6,a7);break;case ap:if(!(this.parent.parent instanceof YAHOO.widget.MenuBar)){a8.cfg.setProperty(a6,a7)
}break}},_onParentMenuRender:function(a5,a4,ba){var a7=ba.parent.parent,a6=a7.cfg,a8={constraintoviewport:a6.getProperty(X),xy:[0,0],clicktohide:a6.getProperty(ad),effect:a6.getProperty(aX),showdelay:a6.getProperty(aU),hidedelay:a6.getProperty(ay),submenuhidedelay:a6.getProperty(D),classname:a6.getProperty(a1),scrollincrement:a6.getProperty(K),maxheight:a6.getProperty(av),minscrollheight:a6.getProperty(aI),iframe:a6.getProperty(ag),shadow:a6.getProperty(aF),preventcontextoverlap:a6.getProperty(a3),monitorresize:a6.getProperty(af)},a9;if(!(a7 instanceof YAHOO.widget.MenuBar)){a8[ap]=a6.getProperty(ap)}ba.cfg.applyConfig(a8);if(!this.lazyLoad){a9=this.parent.element;if(this.element.parentNode==a9){this.render()}else{this.render(a9)}}},_onMenuItemDestroy:function(a6,a5,a4){this._removeItemFromGroupByValue(a4.groupIndex,a4)},_onMenuItemConfigChange:function(a6,a5,a4){var a8=a5[0][0],a9=a5[0][1],a7;switch(a8){case Z:if(a9===true){this.activeItem=a4}break;case o:a7=a5[0][1];if(a7){this._configureSubmenu(a4)
}break}},configVisible:function(a6,a5,a7){var a4,a8;if(this.cfg.getProperty(aC)==ae){S.superclass.configVisible.call(this,a6,a5,a7)}else{a4=a5[0];a8=G.getStyle(this.element,ax);G.setStyle(this.element,j,aT);if(a4){if(a8!=aw){this.beforeShowEvent.fire();G.setStyle(this.element,ax,aw);this.showEvent.fire()}}else{if(a8==aw){this.beforeHideEvent.fire();G.setStyle(this.element,ax,az);this.hideEvent.fire()}}}},configPosition:function(a6,a5,a9){var a8=this.element,a7=a5[0]==c?c:aa,ba=this.cfg,a4;G.setStyle(a8,aC,a7);if(a7==c){G.setStyle(a8,ax,aw);ba.setProperty(aT,true)}else{G.setStyle(a8,j,am)}if(a7==aa){a4=ba.getProperty(au);if(!a4||a4===0){ba.setProperty(au,1)}}},configIframe:function(a5,a4,a6){if(this.cfg.getProperty(aC)==ae){S.superclass.configIframe.call(this,a5,a4,a6)}},configHideDelay:function(a5,a4,a6){var a7=a4[0];this._useHideDelay=(a7>0)},configContainer:function(a5,a4,a7){var a6=a4[0];if(an.isString(a6)){this.cfg.setProperty(H,G.get(a6),true)}},_clearSetWidthFlag:function(){this._widthSetForScroll=false;
this.cfg.unsubscribeFromConfigEvent(u,this._clearSetWidthFlag)},_setScrollHeight:function(bf){var bb=bf,ba=false,bg=false,a7,a8,be,a5,bd,bh,a4,bc,a9,a6;if(this.getItems().length>0){a7=this.element;a8=this.body;be=this.header;a5=this.footer;bd=this._onScrollTargetMouseOver;bh=this._onScrollTargetMouseOut;a4=this.cfg.getProperty(aI);if(bb>0&&bb<a4){bb=a4}G.setStyle(a8,aN,V);G.removeClass(a8,M);a8.scrollTop=0;bg=((aR.gecko&&aR.gecko<1.9)||aR.ie);if(bb>0&&bg&&!this.cfg.getProperty(u)){a9=a7.offsetWidth;a7.style.width=a9+ar;a6=(a9-(a7.offsetWidth-a9))+ar;this.cfg.unsubscribeFromConfigEvent(u,this._clearSetWidthFlag);this.cfg.setProperty(u,a6);this._widthSetForScroll=true;this.cfg.subscribeToConfigEvent(u,this._clearSetWidthFlag)}if(bb>0&&(!be&&!a5)){this.setHeader(al);this.setFooter(al);be=this.header;a5=this.footer;G.addClass(be,t);G.addClass(a5,Y);a7.insertBefore(be,a8);a7.appendChild(a5)}bc=bb;if(be&&a5){bc=(bc-(be.offsetHeight+a5.offsetHeight))}if((bc>0)&&(a8.offsetHeight>bb)){G.addClass(a8,M);
G.setStyle(a8,aN,(bc+ar));if(!this._hasScrollEventHandlers){ab.on(be,aH,bd,this,true);ab.on(be,g,bh,this,true);ab.on(a5,aH,bd,this,true);ab.on(a5,g,bh,this,true);this._hasScrollEventHandlers=true}this._disableScrollHeader();this._enableScrollFooter();ba=true}else{if(be&&a5){if(this._widthSetForScroll){this._widthSetForScroll=false;this.cfg.unsubscribeFromConfigEvent(u,this._clearSetWidthFlag);this.cfg.setProperty(u,V)}this._enableScrollHeader();this._enableScrollFooter();if(this._hasScrollEventHandlers){ab.removeListener(be,aH,bd);ab.removeListener(be,g,bh);ab.removeListener(a5,aH,bd);ab.removeListener(a5,g,bh);this._hasScrollEventHandlers=false}a7.removeChild(be);a7.removeChild(a5);this.header=null;this.footer=null;ba=true}}if(ba){this.cfg.refireEvent(ag);this.cfg.refireEvent(aF)}}},_setMaxHeight:function(a5,a4,a6){this._setScrollHeight(a6);this.renderEvent.unsubscribe(this._setMaxHeight)},configMaxHeight:function(a5,a4,a6){var a7=a4[0];if(this.lazyLoad&&!this.body&&a7>0){this.renderEvent.subscribe(this._setMaxHeight,a7,this)
}else{this._setScrollHeight(a7)}},configClassName:function(a6,a5,a7){var a4=a5[0];if(this._sClassName){G.removeClass(this.element,this._sClassName)}G.addClass(this.element,a4);this._sClassName=a4},_onItemAdded:function(a5,a4){var a6=a4[0];if(a6){a6.cfg.setProperty(aG,true)}},configDisabled:function(a6,a5,a9){var a8=a5[0],a4=this.getItems(),ba,a7;if(an.isArray(a4)){ba=a4.length;if(ba>0){a7=ba-1;do{a4[a7].cfg.setProperty(aG,a8)}while(a7--)}if(a8){this.clearActiveItem(true);G.addClass(this.element,aG);this.itemAddedEvent.subscribe(this._onItemAdded)}else{G.removeClass(this.element,aG);this.itemAddedEvent.unsubscribe(this._onItemAdded)}}},configShadow:function(bc,a6,bb){var ba=function(){var bf=this.element,be=this._shadow;if(be&&bf){if(be.style.width&&be.style.height){be.style.width=V;be.style.height=V}be.style.width=(bf.offsetWidth+6)+ar;be.style.height=(bf.offsetHeight+1)+ar}};var bd=function(){this.element.appendChild(this._shadow)};var a8=function(){G.addClass(this._shadow,ah)};var a9=function(){G.removeClass(this._shadow,ah)
};var a5=function(){var bf=this._shadow,be;if(!bf){be=this.element;if(!aO){aO=document.createElement(k);aO.className=N}bf=aO.cloneNode(false);be.appendChild(bf);this._shadow=bf;this.beforeShowEvent.subscribe(a8);this.beforeHideEvent.subscribe(a9);if(aR.ie){an.later(0,this,function(){ba.call(this);this.syncIframe()});this.cfg.subscribeToConfigEvent(u,ba);this.cfg.subscribeToConfigEvent(aN,ba);this.cfg.subscribeToConfigEvent(av,ba);this.changeContentEvent.subscribe(ba);aV.textResizeEvent.subscribe(ba,this,true);this.destroyEvent.subscribe(function(){aV.textResizeEvent.unsubscribe(ba,this)})}this.cfg.subscribeToConfigEvent(av,bd)}};var a7=function(){if(this._shadow){bd.call(this);if(aR.ie){ba.call(this)}}else{a5.call(this)}this.beforeShowEvent.unsubscribe(a7)};var a4=a6[0];if(a4&&this.cfg.getProperty(aC)==ae){if(this.cfg.getProperty(aT)){if(this._shadow){bd.call(this);if(aR.ie){ba.call(this)}}else{a5.call(this)}}else{this.beforeShowEvent.subscribe(a7)}}},initEvents:function(){S.superclass.initEvents.call(this);
var a5=aB.length-1,a6,a4;do{a6=aB[a5];a4=this.createEvent(a6[1]);a4.signature=f.LIST;this[a6[0]]=a4}while(a5--)},positionOffScreen:function(){var a5=this.iframe,a6=this.element,a4=this.OFF_SCREEN_POSITION;a6.style.top=V;a6.style.left=V;if(a5){a5.style.top=a4;a5.style.left=a4}},getRoot:function(){var a6=this.parent,a5,a4;if(a6){a5=a6.parent;a4=a5?a5.getRoot():this}else{a4=this}return a4},toString:function(){var a5=aP,a4=this.id;if(a4){a5+=(a0+a4)}return a5},setItemGroupTitle:function(a9,a8){var a7,a6,a5,a4;if(an.isString(a9)&&a9.length>0){a7=an.isNumber(a8)?a8:0;a6=this._aGroupTitleElements[a7];if(a6){a6.innerHTML=a9}else{a6=document.createElement(this.GROUP_TITLE_TAG_NAME);a6.innerHTML=a9;this._aGroupTitleElements[a7]=a6}a5=this._aGroupTitleElements.length-1;do{if(this._aGroupTitleElements[a5]){G.removeClass(this._aGroupTitleElements[a5],ak);a4=a5}}while(a5--);if(a4!==null){G.addClass(this._aGroupTitleElements[a4],ak)}this.changeContentEvent.fire()}},addItem:function(a4,a5){return this._addItemToGroup(a5,a4)
},addItems:function(a8,a7){var ba,a4,a9,a5,a6;if(an.isArray(a8)){ba=a8.length;a4=[];for(a5=0;a5<ba;a5++){a9=a8[a5];if(a9){if(an.isArray(a9)){a4[a4.length]=this.addItems(a9,a5)}else{a4[a4.length]=this._addItemToGroup(a7,a9)}}}if(a4.length){a6=a4}}return a6},insertItem:function(a4,a5,a6){return this._addItemToGroup(a6,a4,a5)},removeItem:function(a4,a6){var a7,a5;if(!an.isUndefined(a4)){if(a4 instanceof YAHOO.widget.MenuItem){a7=this._removeItemFromGroupByValue(a6,a4)}else{if(an.isNumber(a4)){a7=this._removeItemFromGroupByIndex(a6,a4)}}if(a7){a7.destroy();a5=a7}}return a5},getItems:function(){var a7=this._aItemGroups,a5,a6,a4=[];if(an.isArray(a7)){a5=a7.length;a6=((a5==1)?a7[0]:(Array.prototype.concat.apply(a4,a7)))}return a6},getItemGroups:function(){return this._aItemGroups},getItem:function(a5,a6){var a7,a4;if(an.isNumber(a5)){a7=this._getItemGroup(a6);if(a7){a4=a7[a5]}}return a4},getSubmenus:function(){var a5=this.getItems(),a9=a5.length,a4,a6,a8,a7;if(a9>0){a4=[];for(a7=0;a7<a9;a7++){a8=a5[a7];
if(a8){a6=a8.cfg.getProperty(o);if(a6){a4[a4.length]=a6}}}}return a4},clearContent:function(){var a8=this.getItems(),a5=a8.length,a6=this.element,a7=this.body,bc=this.header,a4=this.footer,bb,ba,a9;if(a5>0){a9=a5-1;do{bb=a8[a9];if(bb){ba=bb.cfg.getProperty(o);if(ba){this.cfg.configChangedEvent.unsubscribe(this._onParentMenuConfigChange,ba);this.renderEvent.unsubscribe(this._onParentMenuRender,ba)}this.removeItem(bb,bb.groupIndex)}}while(a9--)}if(bc){ab.purgeElement(bc);a6.removeChild(bc)}if(a4){ab.purgeElement(a4);a6.removeChild(a4)}if(a7){ab.purgeElement(a7);a7.innerHTML=V}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;S.superclass.destroy.call(this)},setInitialFocus:function(){var a4=this._getFirstEnabledItem();if(a4){a4.focus()}},setInitialSelection:function(){var a4=this._getFirstEnabledItem();
if(a4){a4.cfg.setProperty(Z,true)}},clearActiveItem:function(a6){if(this.cfg.getProperty(aU)>0){this._cancelShowDelay()}var a4=this.activeItem,a7,a5;if(a4){a7=a4.cfg;if(a6){a4.blur();this.getRoot()._hasFocus=true}a7.setProperty(Z,false);a5=a7.getProperty(o);if(a5){a5.hide()}this.activeItem=null}},focus:function(){if(!this.hasFocus()){this.setInitialFocus()}},blur:function(){var a4;if(this.hasFocus()){a4=a2.getFocusedMenuItem();if(a4){a4.blur()}}},hasFocus:function(){return(a2.getFocusedMenu()==this.getRoot())},subscribe:function(){function a7(bc,bb,be){var bf=bb[0],bd=bf.cfg.getProperty(o);if(bd){bd.subscribe.apply(bd,be)}}function ba(bc,bb,be){var bd=this.cfg.getProperty(o);if(bd){bd.subscribe.apply(bd,be)}}S.superclass.subscribe.apply(this,arguments);S.superclass.subscribe.call(this,at,a7,arguments);var a4=this.getItems(),a9,a8,a5,a6;if(a4){a9=a4.length;if(a9>0){a6=a9-1;do{a8=a4[a6];a5=a8.cfg.getProperty(o);if(a5){a5.subscribe.apply(a5,arguments)}else{a8.cfg.subscribeToConfigEvent(o,ba,arguments)
}}while(a6--)}}},initDefaultConfig:function(){S.superclass.initDefaultConfig.call(this);var a4=this.cfg;a4.addProperty(aA.key,{handler:this.configVisible,value:aA.value,validator:aA.validator});a4.addProperty(aq.key,{handler:this.configConstrainToViewport,value:aq.value,validator:aq.validator,supercedes:aq.supercedes});a4.addProperty(aj.key,{value:aj.value,validator:aj.validator,supercedes:aj.supercedes});a4.addProperty(s.key,{handler:this.configPosition,value:s.value,validator:s.validator,supercedes:s.supercedes});a4.addProperty(a.key,{value:a.value,suppressEvent:a.suppressEvent});a4.addProperty(U.key,{value:U.value,validator:U.validator,suppressEvent:U.suppressEvent});a4.addProperty(z.key,{value:z.value,validator:z.validator,suppressEvent:z.suppressEvent});a4.addProperty(R.key,{handler:this.configHideDelay,value:R.value,validator:R.validator,suppressEvent:R.suppressEvent});a4.addProperty(W.key,{value:W.value,validator:W.validator,suppressEvent:W.suppressEvent});a4.addProperty(P.key,{value:P.value,validator:P.validator,suppressEvent:P.suppressEvent});
a4.addProperty(ao.key,{handler:this.configContainer,value:document.body,suppressEvent:ao.suppressEvent});a4.addProperty(aE.key,{value:aE.value,validator:aE.validator,supercedes:aE.supercedes,suppressEvent:aE.suppressEvent});a4.addProperty(n.key,{value:n.value,validator:n.validator,supercedes:n.supercedes,suppressEvent:n.suppressEvent});a4.addProperty(x.key,{handler:this.configMaxHeight,value:x.value,validator:x.validator,suppressEvent:x.suppressEvent,supercedes:x.supercedes});a4.addProperty(w.key,{handler:this.configClassName,value:w.value,validator:w.validator,supercedes:w.supercedes});a4.addProperty(B.key,{handler:this.configDisabled,value:B.value,validator:B.validator,suppressEvent:B.suppressEvent});a4.addProperty(i.key,{handler:this.configShadow,value:i.value,validator:i.validator});a4.addProperty(aK.key,{value:aK.value,validator:aK.validator})}})})();(function(){YAHOO.widget.MenuItem=function(at,ar){if(at){if(ar){this.parent=ar.parent;this.value=ar.value;this.id=ar.id}this.init(at,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(av,au){var ar=E[av];if(!ar){E[av]={};ar=E[av]}var at=ar[au];if(!at){at=av+q+au;ar[au]=at}return at};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,aC){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=ab}this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();var ay=this.cfg,az=o,au,aB,aA,at,aw,av,ax;if(aq.isString(ar)){this._createRootNodeStructure();ay.queueProperty(al,ar)}else{if(ar&&ar.tagName){switch(ar.tagName.toUpperCase()){case I:this._createRootNodeStructure();
ay.queueProperty(al,ar.text);ay.queueProperty(h,ar.disabled);this.value=ar.value;this.srcElement=ar;break;case V:this._createRootNodeStructure();ay.queueProperty(al,ar.label);ay.queueProperty(h,ar.disabled);this.srcElement=ar;this._initSubTree();break;case k:aA=X.getFirstChild(ar);if(aA){az=aA.getAttribute(ae,2);at=aA.getAttribute(ah);aw=aA.innerHTML}this.srcElement=ar;this.element=ar;this._oAnchor=aA;ay.setProperty(al,aw,true);ay.setProperty(N,az,true);ay.setProperty(ah,at,true);this._initSubTree();break}}}if(this.element){av=(this.srcElement||this.element).id;if(!av){av=this.id||X.generateId();this.element.id=av}this.id=av;X.addClass(this.element,this.CSS_CLASS_NAME);X.addClass(this._oAnchor,this.CSS_LABEL_CLASS_NAME);ax=P.length-1;do{aB=P[ax];au=this.createEvent(aB[1]);au.signature=ak.LIST;this[aB[0]]=au}while(ax--);if(aC){ay.applyConfig(aC)}ay.fireQueue()}},_createRootNodeStructure:function(){var ar,at;if(!c){c=document.createElement(s);c.innerHTML=af}ar=c.cloneNode(true);ar.className=this.CSS_CLASS_NAME;
at=ar.firstChild;at.className=this.CSS_LABEL_CLASS_NAME;this.element=ar;this._oAnchor=at},_initSubTree:function(){var ay=this.srcElement,au=this.cfg,aw,av,at,ar,ax;if(ay.childNodes.length>0){if(this.parent.lazyLoad&&this.parent.srcElement&&this.parent.srcElement.tagName.toUpperCase()==R){au.setProperty(W,{id:X.generateId(),itemdata:ay.childNodes})}else{aw=ay.firstChild;av=[];do{if(aw&&aw.tagName){switch(aw.tagName.toUpperCase()){case x:au.setProperty(W,aw);break;case I:av[av.length]=aw;break}}}while((aw=aw.nextSibling));at=av.length;if(at>0){ar=new this.SUBMENU_TYPE(X.generateId());au.setProperty(W,ar);for(ax=0;ax<at;ax++){ar.addItem((new ar.ITEM_TYPE(av[ax])))}}}}},configText:function(aB,au,aw){var at=au[0],av=this.cfg,az=this._oAnchor,ar=av.getProperty(l),aA=aj,ax=aj,ay=aj;if(at){if(ar){aA=an+ar+i}if(av.getProperty(a)){ax=A;ay=i}if(av.getProperty(n)){ax=w;ay=Y}az.innerHTML=(ax+at+ay+aA)}},configHelpText:function(au,at,ar){this.cfg.refireEvent(al)},configURL:function(au,at,ar){var aw=at[0];
if(!aw){aw=o}var av=this._oAnchor;if(K.opera){av.removeAttribute(ae)}av.setAttribute(ae,aw)},configTarget:function(av,au,at){var ar=au[0],aw=this._oAnchor;if(ar&&ar.length>0){aw.setAttribute(ah,ar)}else{aw.removeAttribute(ah)}},configEmphasis:function(au,at,ar){var aw=at[0],av=this.cfg;if(aw&&av.getProperty(n)){av.setProperty(n,false)}av.refireEvent(al)},configStrongEmphasis:function(av,au,at){var ar=au[0],aw=this.cfg;if(ar&&aw.getProperty(a)){aw.setProperty(a,false)}aw.refireEvent(al)},configChecked:function(au,at,ar){var aw=at[0],av=this.cfg;if(aw){G.call(this,B)}else{r.call(this,B)}av.refireEvent(al);if(av.getProperty(h)){av.refireEvent(h)}if(av.getProperty(b)){av.refireEvent(b)}},configDisabled:function(au,at,ar){var aw=at[0],ax=this.cfg,av=ax.getProperty(W),ay=ax.getProperty(B);if(aw){if(ax.getProperty(b)){ax.setProperty(b,false)}G.call(this,h);if(av){G.call(this,ai)}if(ay){G.call(this,u)}}else{r.call(this,h);if(av){r.call(this,ai)}if(ay){r.call(this,u)}}},configSelected:function(au,at,ar){var ay=this.cfg,ax=this._oAnchor,aw=at[0],az=ay.getProperty(B),av=ay.getProperty(W);
if(K.opera){ax.blur()}if(aw&&!ay.getProperty(h)){G.call(this,b);if(av){G.call(this,ad)}if(az){G.call(this,t)}}else{r.call(this,b);if(av){r.call(this,ad)}if(az){r.call(this,t)}}if(this.hasFocus()&&K.opera){ax.focus()}},_onSubmenuBeforeHide:function(av,au){var aw=this.parent,ar;function at(){aw._oAnchor.blur();ar.beforeHideEvent.unsubscribe(at)}if(aw.hasFocus()){ar=aw.parent;ar.beforeHideEvent.subscribe(at)}},configSubmenu:function(az,au,ax){var aw=au[0],av=this.cfg,at=this.parent&&this.parent.lazyLoad,ay,aA,ar;if(aw){if(aw instanceof ab){ay=aw;ay.parent=this;ay.lazyLoad=at}else{if(aq.isObject(aw)&&aw.id&&!aw.nodeType){aA=aw.id;ar=aw;ar.lazyload=at;ar.parent=this;ay=new this.SUBMENU_TYPE(aA,ar);av.setProperty(W,ay,true)}else{ay=new this.SUBMENU_TYPE(aw,{lazyload:at,parent:this});av.setProperty(W,ay,true)}}if(ay){ay.cfg.setProperty(y,true);G.call(this,p);if(av.getProperty(N)===o){av.setProperty(N,(o+ay.id))}this._oSubmenu=ay;if(K.opera){ay.beforeHideEvent.subscribe(this._onSubmenuBeforeHide)
}}}else{r.call(this,p);if(this._oSubmenu){this._oSubmenu.destroy()}}if(av.getProperty(h)){av.refireEvent(h)}if(av.getProperty(b)){av.refireEvent(b)}},configOnClick:function(au,at,ar){var av=at[0];if(this._oOnclickAttributeValue&&(this._oOnclickAttributeValue!=av)){this.clickEvent.unsubscribe(this._oOnclickAttributeValue.fn,this._oOnclickAttributeValue.obj);this._oOnclickAttributeValue=null}if(!this._oOnclickAttributeValue&&aq.isObject(av)&&aq.isFunction(av.fn)){this.clickEvent.subscribe(av.fn,((H in av)?av.obj:this),((ag in av)?av.scope:null));this._oOnclickAttributeValue=av}},configClassName:function(av,au,at){var ar=au[0];if(this._sClassName){X.removeClass(this.element,this._sClassName)}X.addClass(this.element,ar);this._sClassName=ar},_dispatchClickEvent:function(){var au=this,at,ar;if(!au.cfg.getProperty(h)){at=X.getFirstChild(au.element);if(K.ie){at.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)}at.dispatchEvent(ar)}}},_createKeyListener:function(av,au,ax){var aw=this,at=aw.parent;var ar=new YAHOO.util.KeyListener(at.element.ownerDocument,ax,{fn:aw._dispatchClickEvent,scope:aw,correctScope:true});if(at.cfg.getProperty(v)){ar.enable()}at.subscribe(d,ar.enable,null,ar);at.subscribe(m,ar.disable,null,ar);aw._keyListener=ar;at.unsubscribe(d,aw._createKeyListener,ax)},configKeyListener:function(au,at){var aw=at[0],av=this,ar=av.parent;if(av._keyData){ar.unsubscribe(d,av._createKeyListener,av._keyData);av._keyData=null}if(av._keyListener){ar.unsubscribe(d,av._keyListener.enable);ar.unsubscribe(m,av._keyListener.disable);av._keyListener.disable();av._keyListener=null}if(aw){av._keyData=aw;ar.subscribe(d,av._createKeyListener,aw,av)}},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})},getNextEnabledSibling:function(){var av,ay,ar,ax,aw,at;function au(az,aA){return az[aA]||au(az,(aA+1))}if(this.parent instanceof ab){av=this.groupIndex;ay=this.parent.getItemGroups();if(this.index<(ay[av].length-1)){ar=au(ay[av],(this.index+1))}else{if(av<(ay.length-1)){ax=av+1}else{ax=0}aw=au(ay,ax);ar=au(aw,0)}at=(ar.cfg.getProperty(h)||ar.element.style.display==T)?ar.getNextEnabledSibling():ar}return at},getPreviousEnabledSibling:function(){var ax,az,at,ar,aw,av;function ay(aA,aB){return aA[aB]||ay(aA,(aB-1))}function au(aA,aB){return aA[aB]?aB:au(aA,(aB+1))}if(this.parent instanceof ab){ax=this.groupIndex;az=this.parent.getItemGroups();if(this.index>au(az[ax],0)){at=ay(az[ax],(this.index-1))}else{if(ax>au(az,0)){ar=ax-1}else{ar=az.length-1}aw=ay(az,ar);at=ay(aw,(aw.length-1))
}av=(at.cfg.getProperty(h)||at.element.style.display==T)?at.getPreviousEnabledSibling():at}return av},focus:function(){var av=this.parent,au=this._oAnchor,ar=av.activeItem;function at(){try{if(!(K.ie&&!document.hasFocus())){if(ar){ar.blurEvent.fire()}au.focus();this.focusEvent.fire()}}catch(aw){}}if(!this.cfg.getProperty(h)&&av&&av.cfg.getProperty(v)&&this.element.style.display!=T){aq.later(0,this,at)}},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(at){}},0)}},hasFocus:function(){return(YAHOO.widget.MenuManager.getFocusedMenuItem()==this)},destroy:function(){var au=this.element,at,ar,aw,av;if(au){at=this.cfg.getProperty(W);if(at){at.destroy()}ar=au.parentNode;if(ar){ar.removeChild(au);this.destroyEvent.fire()}av=P.length-1;do{aw=P[av];this[aw[0]].unsubscribeAll()}while(av--);this.cfg.configChangedEvent.unsubscribeAll()}},toString:function(){var at=M,ar=this.id;if(ar){at+=(e+ar)
}return at}};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);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.7.0",build:"1799"});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;YAHOO.widget.LogReader=function(b,a){this._sName=YAHOO.widget.LogReader._index;YAHOO.widget.LogReader._index++;this._buffer=[];this._filterCheckboxes={};this._lastTime=YAHOO.widget.Logger.getStartTime();if(a&&(a.constructor==Object)){for(var c in a){if(a.hasOwnProperty(c)){this[c]=a[c]}}}this._initContainerEl(b);if(!this._elContainer){YAHOO.log("Could not instantiate LogReader due to an invalid container element "+b,"error",this.toString());return}this._initHeaderEl();this._initConsoleEl();this._initFooterEl();
this._initDragDrop();this._initCategories();this._initSources();YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog,this);YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset,this);YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate,this);YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate,this);this._filterLogs();YAHOO.log("LogReader initialized",null,this.toString())};YAHOO.lang.augmentObject(YAHOO.widget.LogReader,{_index:0,ENTRY_TEMPLATE:(function(){var a=document.createElement("pre");YAHOO.util.Dom.addClass(a,"yui-log-entry");return a})(),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>"});YAHOO.widget.LogReader.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"}},resume:function(){this.isPaused=false;this.logReaderEnabled=true;this._printBuffer();if(this._btnPause){this._btnPause.value="Pause"}},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(a){return this._filterCheckboxes[a]},getCategories:function(){return this._categoryFilters},showCategory:function(b){var d=this._categoryFilters;if(d.indexOf){if(d.indexOf(b)>-1){return}}else{for(var a=0;a<d.length;a++){if(d[a]===b){return}}}this._categoryFilters.push(b);this._filterLogs();
var c=this.getCheckbox(b);if(c){c.checked=true}},hideCategory:function(b){var d=this._categoryFilters;for(var a=0;a<d.length;a++){if(b==d[a]){d.splice(a,1);break}}this._filterLogs();var c=this.getCheckbox(b);if(c){c.checked=false}},getSources:function(){return this._sourceFilters},showSource:function(a){var d=this._sourceFilters;if(d.indexOf){if(d.indexOf(a)>-1){return}}else{for(var b=0;b<d.length;b++){if(a==d[b]){return}}}d.push(a);this._filterLogs();var c=this.getCheckbox(a);if(c){c.checked=true}},hideSource:function(a){var d=this._sourceFilters;for(var b=0;b<d.length;b++){if(a==d[b]){d.splice(b,1);break}}this._filterLogs();var c=this.getCheckbox(a);if(c){c.checked=false}},clearConsole:function(){this._timeout=null;this._buffer=[];this._consoleMsgCount=0;var a=this._elConsole;a.innerHTML=""},setTitle:function(a){this._title.innerHTML=this.html2Text(a)},getLastTime:function(){return this._lastTime},formatMsg:function(c){var b=YAHOO.widget.LogReader,a=this.entryFormat||(this.verboseOutput?b.VERBOSE_TEMPLATE:b.BASIC_TEMPLATE),d={category:c.category,label:c.category.substring(0,4).toUpperCase(),sourceAndDetail:c.sourceDetail?c.source+" "+c.sourceDetail:c.source,message:this.html2Text(c.msg||c.message||"")};
if(c.time&&c.time.getTime){d.localTime=c.time.toLocaleTimeString?c.time.toLocaleTimeString():c.time.toString();d.elapsedTime=c.time.getTime()-this.getLastTime();d.totalTime=c.time.getTime()-YAHOO.widget.Logger.getStartTime()}var e=b.ENTRY_TEMPLATE.cloneNode(true);if(this.verboseOutput){e.className+=" yui-log-verbose"}e.innerHTML=a.replace(/\{(\w+)\}/g,function(f,g){return(g in d)?d[g]:""});return e},html2Text:function(a){if(a){a+="";return a.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,_initContainerEl:function(b){b=YAHOO.util.Dom.get(b);if(b&&b.tagName&&(b.tagName.toLowerCase()=="div")){this._elContainer=b;YAHOO.util.Dom.addClass(this._elContainer,"yui-log")
}else{this._elContainer=document.body.appendChild(document.createElement("div"));YAHOO.util.Dom.addClass(this._elContainer,"yui-log");YAHOO.util.Dom.addClass(this._elContainer,"yui-log-container");var a=this._elContainer.style;if(this.width){a.width=this.width}if(this.right){a.right=this.right}if(this.top){a.top=this.top}if(this.left){a.left=this.left;a.right="auto"}if(this.bottom){a.bottom=this.bottom;a.top="auto"}if(this.fontSize){a.fontSize=this.fontSize}if(navigator.userAgent.toLowerCase().indexOf("opera")!=-1){document.body.style+=""}}},_initHeaderEl:function(){var a=this;if(this._elHd){YAHOO.util.Event.purgeElement(this._elHd,true);this._elHd.innerHTML=""}this._elHd=this._elContainer.appendChild(document.createElement("div"));this._elHd.id="yui-log-hd"+this._sName;this._elHd.className="yui-log-hd";this._elCollapse=this._elHd.appendChild(document.createElement("div"));this._elCollapse.className="yui-log-btns";this._btnCollapse=document.createElement("input");this._btnCollapse.type="button";
this._btnCollapse.className="yui-log-button";this._btnCollapse.value="Collapse";this._btnCollapse=this._elCollapse.appendChild(this._btnCollapse);YAHOO.util.Event.addListener(a._btnCollapse,"click",a._onClickCollapseBtn,a);this._title=this._elHd.appendChild(document.createElement("h4"));this._title.innerHTML="Logger Console"},_initConsoleEl:function(){if(this._elConsole){YAHOO.util.Event.purgeElement(this._elConsole,true);this._elConsole.innerHTML=""}this._elConsole=this._elContainer.appendChild(document.createElement("div"));this._elConsole.className="yui-log-bd";if(this.height){this._elConsole.style.height=this.height}},_initFooterEl:function(){var a=this;if(this.footerEnabled){if(this._elFt){YAHOO.util.Event.purgeElement(this._elFt,true);this._elFt.innerHTML=""}this._elFt=this._elContainer.appendChild(document.createElement("div"));this._elFt.className="yui-log-ft";this._elBtns=this._elFt.appendChild(document.createElement("div"));this._elBtns.className="yui-log-btns";this._btnPause=document.createElement("input");
this._btnPause.type="button";this._btnPause.className="yui-log-button";this._btnPause.value="Pause";this._btnPause=this._elBtns.appendChild(this._btnPause);YAHOO.util.Event.addListener(a._btnPause,"click",a._onClickPauseBtn,a);this._btnClear=document.createElement("input");this._btnClear.type="button";this._btnClear.className="yui-log-button";this._btnClear.value="Clear";this._btnClear=this._elBtns.appendChild(this._btnClear);YAHOO.util.Event.addListener(a._btnClear,"click",a._onClickClearBtn,a);this._elCategoryFilters=this._elFt.appendChild(document.createElement("div"));this._elCategoryFilters.className="yui-log-categoryfilters";this._elSourceFilters=this._elFt.appendChild(document.createElement("div"));this._elSourceFilters.className="yui-log-sourcefilters"}},_initDragDrop:function(){if(YAHOO.util.DD&&this.draggable&&this._elHd){var a=new YAHOO.util.DD(this._elContainer);a.setHandleElId(this._elHd.id);this._elHd.style.cursor="move"}},_initCategories:function(){this._categoryFilters=[];
var c=YAHOO.widget.Logger.categories;for(var a=0;a<c.length;a++){var b=c[a];this._categoryFilters.push(b);if(this._elCategoryFilters){this._createCategoryCheckbox(b)}}},_initSources:function(){this._sourceFilters=[];var c=YAHOO.widget.Logger.sources;for(var b=0;b<c.length;b++){var a=c[b];this._sourceFilters.push(a);if(this._elSourceFilters){this._createSourceCheckbox(a)}}},_createCategoryCheckbox:function(b){var a=this;if(this._elFt){var e=this._elCategoryFilters;var d=e.appendChild(document.createElement("span"));d.className="yui-log-filtergrp";var c=document.createElement("input");c.id="yui-log-filter-"+b+this._sName;c.className="yui-log-filter-"+b;c.type="checkbox";c.category=b;c=d.appendChild(c);c.checked=true;YAHOO.util.Event.addListener(c,"click",a._onCheckCategory,a);var f=d.appendChild(document.createElement("label"));f.htmlFor=c.id;f.className=b;f.innerHTML=b;this._filterCheckboxes[b]=c}},_createSourceCheckbox:function(a){var d=this;if(this._elFt){var f=this._elSourceFilters;var e=f.appendChild(document.createElement("span"));
e.className="yui-log-filtergrp";var c=document.createElement("input");c.id="yui-log-filter"+a+this._sName;c.className="yui-log-filter"+a;c.type="checkbox";c.source=a;c=e.appendChild(c);c.checked=true;YAHOO.util.Event.addListener(c,"click",d._onCheckSource,d);var b=e.appendChild(document.createElement("label"));b.htmlFor=c.id;b.className=a;b.innerHTML=a;this._filterCheckboxes[a]=c}},_filterLogs:function(){if(this._elConsole!==null){this.clearConsole();this._printToConsole(YAHOO.widget.Logger.getStack())}},_printBuffer:function(){this._timeout=null;if(this._elConsole!==null){var b=this.thresholdMax;b=(b&&!isNaN(b))?b:500;if(this._consoleMsgCount<b){var a=[];for(var c=0;c<this._buffer.length;c++){a[c]=this._buffer[c]}this._buffer=[];this._printToConsole(a)}else{this._filterLogs()}if(!this.newestOnTop){this._elConsole.scrollTop=this._elConsole.scrollHeight}}},_printToConsole:function(k){var b=k.length,o=document.createDocumentFragment(),r=[],s=this.thresholdMin,c=this._sourceFilters.length,p=this._categoryFilters.length,m,h,g,f,n;
if(isNaN(s)||(s>this.thresholdMax)){s=0}m=(b>s)?(b-s):0;for(h=m;h<b;h++){var e=false;var l=false;var q=k[h];var a=q.source;var d=q.category;for(g=0;g<c;g++){if(a==this._sourceFilters[g]){l=true;break}}if(l){for(g=0;g<p;g++){if(d==this._categoryFilters[g]){e=true;break}}}if(e){f=this.formatMsg(q);if(typeof f==="string"){r[r.length]=f}else{o.insertBefore(f,this.newestOnTop?o.firstChild||null:null)}this._consoleMsgCount++;this._lastTime=q.time.getTime()}}if(r.length){r.splice(0,0,this._elConsole.innerHTML);this._elConsole.innerHTML=this.newestOnTop?r.reverse().join(""):r.join("")}else{if(o.firstChild){this._elConsole.insertBefore(o,this.newestOnTop?this._elConsole.firstChild||null:null)}}},_onCategoryCreate:function(d,c,a){var b=c[0];a._categoryFilters.push(b);if(a._elFt){a._createCategoryCheckbox(b)}},_onSourceCreate:function(d,c,a){var b=c[0];a._sourceFilters.push(b);if(a._elFt){a._createSourceCheckbox(b)}},_onCheckCategory:function(a,b){var c=this.category;if(!this.checked){b.hideCategory(c)
}else{b.showCategory(c)}},_onCheckSource:function(a,b){var c=this.source;if(!this.checked){b.hideSource(c)}else{b.showSource(c)}},_onClickCollapseBtn:function(a,b){if(!b.isCollapsed){b.collapse()}else{b.expand()}},_onClickPauseBtn:function(a,b){if(!b.isPaused){b.pause()}else{b.resume()}},_onClickClearBtn:function(a,b){b.clearConsole()},_onNewLog:function(d,c,a){var b=c[0];a._buffer.push(b);if(a.logReaderEnabled===true&&a._timeout===null){a._timeout=setTimeout(function(){a._printBuffer()},a.outputBuffer)}},_onReset:function(c,b,a){a._filterLogs()}};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")}YAHOO.register("logger",YAHOO.widget.Logger,{version:"2.7.0",build:"1799"});(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(v,r){v=v.toLowerCase();var u=this.config[v],l=false,k,g,h,j,p,t,f,n,o,d,m,w,e;if(u&&u.event){if(!b.isUndefined(r)&&u.validator&&!u.validator(r)){return false}else{if(!b.isUndefined(r)){u.value=r}else{r=u.value}l=false;k=this.eventQueue.length;for(m=0;m<k;m++){g=this.eventQueue[m];if(g){h=g[0];j=g[1];if(h==v){this.eventQueue[m]=null;this.eventQueue.push([v,(!b.isUndefined(r)?r:j)]);l=true;break}}}if(!l&&!b.isUndefined(r)){this.eventQueue.push([v,r])}}if(u.supercedes){p=u.supercedes.length;for(w=0;w<p;w++){t=u.supercedes[w];f=this.eventQueue.length;for(e=0;e<f;e++){n=this.eventQueue[e];if(n){o=n[0];d=n[1];if(o==t.toLowerCase()){this.eventQueue.push([o,d]);this.eventQueue[e]=null;break}}}}}return true
}else{return false}},refireEvent:function(d){d=d.toLowerCase();var e=this.config[d];if(e&&e.event&&!b.isUndefined(e.value)){if(this.queueInProgress){this.queueProperty(d)}else{this.fireEvent(d,e.value)}}},applyConfig:function(d,g){var f,e;if(g){e={};for(f in d){if(b.hasOwnProperty(d,f)){e[f.toLowerCase()]=d[f]}}this.initialConfig=e}for(f in d){if(b.hasOwnProperty(d,f)){this.queueProperty(f,d[f])}}},refresh:function(){var d;for(d in this.config){if(b.hasOwnProperty(this.config,d)){this.refireEvent(d)}}},fireQueue:function(){var e,h,d,g,f;this.queueInProgress=true;for(e=0;e<this.eventQueue.length;e++){h=this.eventQueue[e];if(h){d=h[0];g=h[1];f=this.config[d];f.value=g;this.eventQueue[e]=null;this.fireEvent(d,g)}}this.queueInProgress=false;this.eventQueue=[]},subscribeToConfigEvent:function(e,f,h,d){var g=this.config[e.toLowerCase()];if(g&&g.event){if(!a.alreadySubscribed(g.event,f,h)){g.event.subscribe(f,h,d)}return true}else{return false}},unsubscribeFromConfigEvent:function(d,e,g){var f=this.config[d.toLowerCase()];
if(f&&f.event){return f.event.unsubscribe(e,g)}else{return false}},toString:function(){var d="Config";if(this.owner){d+=" ["+this.owner.toString()+"]"}return d},outputEventQueue:function(){var d="",g,e,f=this.eventQueue.length;for(e=0;e<f;e++){g=this.eventQueue[e];if(g){d+=g[0]+"="+g[1]+", "}}return d},destroy:function(){var e=this.config,d,f;for(d in e){if(b.hasOwnProperty(e,d)){f=e[d];f.event.unsubscribeAll();f.event=null}}this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null}};a.alreadySubscribed=function(e,h,j){var f=e.subscribers.length,d,g;if(f>0){g=f-1;do{d=e.subscribers[g];if(d&&d.obj==j&&d.fn==h){return true}}while(g--)}return false};YAHOO.lang.augmentProto(a,YAHOO.util.EventProvider)}());YAHOO.widget.DateMath={DAY:"D",WEEK:"W",YEAR:"Y",MONTH:"M",ONE_DAY_MS:1000*60*60*24,WEEK_ONE_JAN_DATE:1,add:function(a,e,c){var g=new Date(a.getTime());switch(e){case this.MONTH:var f=a.getMonth()+c;var b=0;
if(f<0){while(f<0){f+=12;b-=1}}else{if(f>11){while(f>11){f-=12;b+=1}}}g.setMonth(f);g.setFullYear(a.getFullYear()+b);break;case this.DAY:this._addDays(g,c);break;case this.YEAR:g.setFullYear(a.getFullYear()+c);break;case this.WEEK:this._addDays(g,(c*7));break}return g},_addDays:function(e,c){if(YAHOO.env.ua.webkit&&YAHOO.env.ua.webkit<420){if(c<0){for(var b=-128;c<b;c-=b){e.setDate(e.getDate()+b)}}else{for(var a=96;c>a;c-=a){e.setDate(e.getDate()+a)}}}e.setDate(e.getDate()+c)},subtract:function(a,c,b){return this.add(a,c,(b*-1))},before:function(c,b){var a=b.getTime();if(c.getTime()<a){return true}else{return false}},after:function(c,b){var a=b.getTime();if(c.getTime()>a){return true}else{return false}},between:function(b,a,c){if(this.after(b,a)&&this.before(b,c)){return true}else{return false}},getJan1:function(a){return this.getDate(a,0,1)},getDayOffset:function(b,d){var c=this.getJan1(d);var a=Math.ceil((b.getTime()-c.getTime())/this.ONE_DAY_MS);return a},getWeekNumber:function(e,b,h){b=b||0;
h=h||this.WEEK_ONE_JAN_DATE;var i=this.clearTime(e),m,n;if(i.getDay()===b){m=i}else{m=this.getFirstDayOfWeek(i,b)}var j=m.getFullYear(),c=m.getTime();n=new Date(m.getTime()+6*this.ONE_DAY_MS);var g;if(j!==n.getFullYear()&&n.getDate()>=h){g=1}else{var f=this.clearTime(this.getDate(j,0,h)),a=this.getFirstDayOfWeek(f,b);var k=Math.round((i.getTime()-a.getTime())/this.ONE_DAY_MS);var l=k%7;var d=(k-l)/7;g=d+1}return g},getFirstDayOfWeek:function(d,a){a=a||0;var b=d.getDay(),c=(b-a+7)%7;return this.subtract(d,this.DAY,c)},isYearOverlapWeek:function(a){var c=false;var b=this.add(a,this.DAY,6);if(b.getFullYear()!=a.getFullYear()){c=true}return c},isMonthOverlapWeek:function(a){var c=false;var b=this.add(a,this.DAY,6);if(b.getMonth()!=a.getMonth()){c=true}return c},findMonthStart:function(a){var b=this.getDate(a.getFullYear(),a.getMonth(),1);return b},findMonthEnd:function(b){var d=this.findMonthStart(b);var c=this.add(d,this.MONTH,1);var a=this.subtract(c,this.DAY,1);return a},clearTime:function(a){a.setHours(12,0,0,0);
return a},getDate:function(e,a,c){var b=null;if(YAHOO.lang.isUndefined(c)){c=1}if(e>=100){b=new Date(e,a,c)}else{b=new Date();b.setFullYear(e);b.setMonth(a);b.setDate(c);b.setHours(0,0,0,0)}return b}};(function(){var c=YAHOO.util.Dom,a=YAHOO.util.Event,e=YAHOO.lang,d=YAHOO.widget.DateMath;function f(i,g,h){this.init.apply(this,arguments)}f.IMG_ROOT=null;f.DATE="D";f.MONTH_DAY="MD";f.WEEKDAY="WD";f.RANGE="R";f.MONTH="M";f.DISPLAY_DAYS=42;f.STOP_RENDER="S";f.SHORT="short";f.LONG="long";f.MEDIUM="medium";f.ONE_CHAR="1char";f._DEFAULT_CONFIG={PAGEDATE:{key:"pagedate",value:null},SELECTED:{key:"selected",value:null},TITLE:{key:"title",value:""},CLOSE:{key:"close",value:false},IFRAME:{key:"iframe",value:(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<=6)?true:false},MINDATE:{key:"mindate",value:null},MAXDATE:{key:"maxdate",value:null},MULTI_SELECT:{key:"multi_select",value:false},START_WEEKDAY:{key:"start_weekday",value:0},SHOW_WEEKDAYS:{key:"show_weekdays",value:true},SHOW_WEEK_HEADER:{key:"show_week_header",value:false},SHOW_WEEK_FOOTER:{key:"show_week_footer",value:false},HIDE_BLANK_WEEKS:{key:"hide_blank_weeks",value:false},NAV_ARROW_LEFT:{key:"nav_arrow_left",value:null},NAV_ARROW_RIGHT:{key:"nav_arrow_right",value:null},MONTHS_SHORT:{key:"months_short",value:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},MONTHS_LONG:{key:"months_long",value:["January","February","March","April","May","June","July","August","September","October","November","December"]},WEEKDAYS_1CHAR:{key:"weekdays_1char",value:["S","M","T","W","T","F","S"]},WEEKDAYS_SHORT:{key:"weekdays_short",value:["Su","Mo","Tu","We","Th","Fr","Sa"]},WEEKDAYS_MEDIUM:{key:"weekdays_medium",value:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},WEEKDAYS_LONG:{key:"weekdays_long",value:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},LOCALE_MONTHS:{key:"locale_months",value:"long"},LOCALE_WEEKDAYS:{key:"locale_weekdays",value:"short"},DATE_DELIMITER:{key:"date_delimiter",value:","},DATE_FIELD_DELIMITER:{key:"date_field_delimiter",value:"/"},DATE_RANGE_DELIMITER:{key:"date_range_delimiter",value:"-"},MY_MONTH_POSITION:{key:"my_month_position",value:1},MY_YEAR_POSITION:{key:"my_year_position",value:2},MD_MONTH_POSITION:{key:"md_month_position",value:1},MD_DAY_POSITION:{key:"md_day_position",value:2},MDY_MONTH_POSITION:{key:"mdy_month_position",value:1},MDY_DAY_POSITION:{key:"mdy_day_position",value:2},MDY_YEAR_POSITION:{key:"mdy_year_position",value:3},MY_LABEL_MONTH_POSITION:{key:"my_label_month_position",value:1},MY_LABEL_YEAR_POSITION:{key:"my_label_year_position",value:2},MY_LABEL_MONTH_SUFFIX:{key:"my_label_month_suffix",value:" "},MY_LABEL_YEAR_SUFFIX:{key:"my_label_year_suffix",value:""},NAV:{key:"navigator",value:null},STRINGS:{key:"strings",value:{previousMonth:"Previous Month",nextMonth:"Next Month",close:"Close"},supercedes:["close","title"]}};
var b=f._DEFAULT_CONFIG;f._EVENT_TYPES={BEFORE_SELECT:"beforeSelect",SELECT:"select",BEFORE_DESELECT:"beforeDeselect",DESELECT:"deselect",CHANGE_PAGE:"changePage",BEFORE_RENDER:"beforeRender",RENDER:"render",BEFORE_DESTROY:"beforeDestroy",DESTROY:"destroy",RESET:"reset",CLEAR:"clear",BEFORE_HIDE:"beforeHide",HIDE:"hide",BEFORE_SHOW:"beforeShow",SHOW:"show",BEFORE_HIDE_NAV:"beforeHideNav",HIDE_NAV:"hideNav",BEFORE_SHOW_NAV:"beforeShowNav",SHOW_NAV:"showNav",BEFORE_RENDER_NAV:"beforeRenderNav",RENDER_NAV:"renderNav"};f._STYLES={CSS_ROW_HEADER:"calrowhead",CSS_ROW_FOOTER:"calrowfoot",CSS_CELL:"calcell",CSS_CELL_SELECTOR:"selector",CSS_CELL_SELECTED:"selected",CSS_CELL_SELECTABLE:"selectable",CSS_CELL_RESTRICTED:"restricted",CSS_CELL_TODAY:"today",CSS_CELL_OOM:"oom",CSS_CELL_OOB:"previous",CSS_HEADER:"calheader",CSS_HEADER_TEXT:"calhead",CSS_BODY:"calbody",CSS_WEEKDAY_CELL:"calweekdaycell",CSS_WEEKDAY_ROW:"calweekdayrow",CSS_FOOTER:"calfoot",CSS_CALENDAR:"yui-calendar",CSS_SINGLE:"single",CSS_CONTAINER:"yui-calcontainer",CSS_NAV_LEFT:"calnavleft",CSS_NAV_RIGHT:"calnavright",CSS_NAV:"calnav",CSS_CLOSE:"calclose",CSS_CELL_TOP:"calcelltop",CSS_CELL_LEFT:"calcellleft",CSS_CELL_RIGHT:"calcellright",CSS_CELL_BOTTOM:"calcellbottom",CSS_CELL_HOVER:"calcellhover",CSS_CELL_HIGHLIGHT1:"highlight1",CSS_CELL_HIGHLIGHT2:"highlight2",CSS_CELL_HIGHLIGHT3:"highlight3",CSS_CELL_HIGHLIGHT4:"highlight4"};
f.prototype={Config:null,parent:null,index:-1,cells:null,cellDates:null,id:null,containerId:null,oDomContainer:null,today:null,renderStack:null,_renderStack:null,oNavigator:null,_selectedDates:null,domEventMap:null,_parseArgs:function(h){var g={id:null,container:null,config:null};if(h&&h.length&&h.length>0){switch(h.length){case 1:g.id=null;g.container=h[0];g.config=null;break;case 2:if(e.isObject(h[1])&&!h[1].tagName&&!(h[1] instanceof String)){g.id=null;g.container=h[0];g.config=h[1]}else{g.id=h[0];g.container=h[1];g.config=null}break;default:g.id=h[0];g.container=h[1];g.config=h[2];break}}else{}return g},init:function(j,h,i){var g=this._parseArgs(arguments);j=g.id;h=g.container;i=g.config;this.oDomContainer=c.get(h);if(!this.oDomContainer.id){this.oDomContainer.id=c.generateId()}if(!j){j=this.oDomContainer.id+"_t"}this.id=j;this.containerId=this.oDomContainer.id;this.initEvents();this.today=new Date();d.clearTime(this.today);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};
this.initStyles();c.addClass(this.oDomContainer,this.Style.CSS_CONTAINER);c.addClass(this.oDomContainer,this.Style.CSS_SINGLE);this.cellDates=[];this.cells=[];this.renderStack=[];this._renderStack=[];this.setupConfig();if(i){this.cfg.applyConfig(i,true)}this.cfg.fireQueue()},configIframe:function(i,h,j){var g=h[0];if(!this.parent){if(c.inDocument(this.oDomContainer)){if(g){var k=c.getStyle(this.oDomContainer,"position");if(k=="absolute"||k=="relative"){if(!c.inDocument(this.iframe)){this.iframe=document.createElement("iframe");this.iframe.src="javascript:false;";c.setStyle(this.iframe,"opacity","0");if(YAHOO.env.ua.ie&&YAHOO.env.ua.ie<=6){c.addClass(this.iframe,"fixedsize")}this.oDomContainer.insertBefore(this.iframe,this.oDomContainer.firstChild)}}}else{if(this.iframe){if(this.iframe.parentNode){this.iframe.parentNode.removeChild(this.iframe)}this.iframe=null}}}}},configTitle:function(h,g,i){var k=g[0];if(k){this.createTitleBar(k)}else{var j=this.cfg.getProperty(b.CLOSE.key);if(!j){this.removeTitleBar()
}else{this.createTitleBar("&#160;")}}},configClose:function(h,g,i){var k=g[0],j=this.cfg.getProperty(b.TITLE.key);if(k){if(!j){this.createTitleBar("&#160;")}this.createCloseButton()}else{this.removeCloseButton();if(!j){this.removeTitleBar()}}},initEvents:function(){var g=f._EVENT_TYPES,i=YAHOO.util.CustomEvent,h=this;h.beforeSelectEvent=new i(g.BEFORE_SELECT);h.selectEvent=new i(g.SELECT);h.beforeDeselectEvent=new i(g.BEFORE_DESELECT);h.deselectEvent=new i(g.DESELECT);h.changePageEvent=new i(g.CHANGE_PAGE);h.beforeRenderEvent=new i(g.BEFORE_RENDER);h.renderEvent=new i(g.RENDER);h.beforeDestroyEvent=new i(g.BEFORE_DESTROY);h.destroyEvent=new i(g.DESTROY);h.resetEvent=new i(g.RESET);h.clearEvent=new i(g.CLEAR);h.beforeShowEvent=new i(g.BEFORE_SHOW);h.showEvent=new i(g.SHOW);h.beforeHideEvent=new i(g.BEFORE_HIDE);h.hideEvent=new i(g.HIDE);h.beforeShowNavEvent=new i(g.BEFORE_SHOW_NAV);h.showNavEvent=new i(g.SHOW_NAV);h.beforeHideNavEvent=new i(g.BEFORE_HIDE_NAV);h.hideNavEvent=new i(g.HIDE_NAV);
h.beforeRenderNavEvent=new i(g.BEFORE_RENDER_NAV);h.renderNavEvent=new i(g.RENDER_NAV);h.beforeSelectEvent.subscribe(h.onBeforeSelect,this,true);h.selectEvent.subscribe(h.onSelect,this,true);h.beforeDeselectEvent.subscribe(h.onBeforeDeselect,this,true);h.deselectEvent.subscribe(h.onDeselect,this,true);h.changePageEvent.subscribe(h.onChangePage,this,true);h.renderEvent.subscribe(h.onRender,this,true);h.resetEvent.subscribe(h.onReset,this,true);h.clearEvent.subscribe(h.onClear,this,true)},doPreviousMonthNav:function(h,g){a.preventDefault(h);setTimeout(function(){g.previousMonth();var i=c.getElementsByClassName(g.Style.CSS_NAV_LEFT,"a",g.oDomContainer);if(i&&i[0]){try{i[0].focus()}catch(j){}}},0)},doNextMonthNav:function(h,g){a.preventDefault(h);setTimeout(function(){g.nextMonth();var i=c.getElementsByClassName(g.Style.CSS_NAV_RIGHT,"a",g.oDomContainer);if(i&&i[0]){try{i[0].focus()}catch(j){}}},0)},doSelectCell:function(m,g){var r,o,i,l;var n=a.getTarget(m),h=n.tagName.toLowerCase(),k=false;
while(h!="td"&&!c.hasClass(n,g.Style.CSS_CELL_SELECTABLE)){if(!k&&h=="a"&&c.hasClass(n,g.Style.CSS_CELL_SELECTOR)){k=true}n=n.parentNode;h=n.tagName.toLowerCase();if(n==this.oDomContainer||h=="html"){return}}if(k){a.preventDefault(m)}r=n;if(c.hasClass(r,g.Style.CSS_CELL_SELECTABLE)){l=g.getIndexFromId(r.id);if(l>-1){o=g.cellDates[l];if(o){i=d.getDate(o[0],o[1]-1,o[2]);var q;if(g.Options.MULTI_SELECT){q=r.getElementsByTagName("a")[0];if(q){q.blur()}var j=g.cellDates[l];var p=g._indexOfSelectedFieldArray(j);if(p>-1){g.deselectCell(l)}else{g.selectCell(l)}}else{q=r.getElementsByTagName("a")[0];if(q){q.blur()}g.selectCell(l)}}}}},doCellMouseOver:function(i,h){var g;if(i){g=a.getTarget(i)}else{g=this}while(g.tagName&&g.tagName.toLowerCase()!="td"){g=g.parentNode;if(!g.tagName||g.tagName.toLowerCase()=="html"){return}}if(c.hasClass(g,h.Style.CSS_CELL_SELECTABLE)){c.addClass(g,h.Style.CSS_CELL_HOVER)}},doCellMouseOut:function(i,h){var g;if(i){g=a.getTarget(i)}else{g=this}while(g.tagName&&g.tagName.toLowerCase()!="td"){g=g.parentNode;
if(!g.tagName||g.tagName.toLowerCase()=="html"){return}}if(c.hasClass(g,h.Style.CSS_CELL_SELECTABLE)){c.removeClass(g,h.Style.CSS_CELL_HOVER)}},setupConfig:function(){var g=this.cfg;g.addProperty(b.PAGEDATE.key,{value:new Date(),handler:this.configPageDate});g.addProperty(b.SELECTED.key,{value:[],handler:this.configSelected});g.addProperty(b.TITLE.key,{value:b.TITLE.value,handler:this.configTitle});g.addProperty(b.CLOSE.key,{value:b.CLOSE.value,handler:this.configClose});g.addProperty(b.IFRAME.key,{value:b.IFRAME.value,handler:this.configIframe,validator:g.checkBoolean});g.addProperty(b.MINDATE.key,{value:b.MINDATE.value,handler:this.configMinDate});g.addProperty(b.MAXDATE.key,{value:b.MAXDATE.value,handler:this.configMaxDate});g.addProperty(b.MULTI_SELECT.key,{value:b.MULTI_SELECT.value,handler:this.configOptions,validator:g.checkBoolean});g.addProperty(b.START_WEEKDAY.key,{value:b.START_WEEKDAY.value,handler:this.configOptions,validator:g.checkNumber});g.addProperty(b.SHOW_WEEKDAYS.key,{value:b.SHOW_WEEKDAYS.value,handler:this.configOptions,validator:g.checkBoolean});
g.addProperty(b.SHOW_WEEK_HEADER.key,{value:b.SHOW_WEEK_HEADER.value,handler:this.configOptions,validator:g.checkBoolean});g.addProperty(b.SHOW_WEEK_FOOTER.key,{value:b.SHOW_WEEK_FOOTER.value,handler:this.configOptions,validator:g.checkBoolean});g.addProperty(b.HIDE_BLANK_WEEKS.key,{value:b.HIDE_BLANK_WEEKS.value,handler:this.configOptions,validator:g.checkBoolean});g.addProperty(b.NAV_ARROW_LEFT.key,{value:b.NAV_ARROW_LEFT.value,handler:this.configOptions});g.addProperty(b.NAV_ARROW_RIGHT.key,{value:b.NAV_ARROW_RIGHT.value,handler:this.configOptions});g.addProperty(b.MONTHS_SHORT.key,{value:b.MONTHS_SHORT.value,handler:this.configLocale});g.addProperty(b.MONTHS_LONG.key,{value:b.MONTHS_LONG.value,handler:this.configLocale});g.addProperty(b.WEEKDAYS_1CHAR.key,{value:b.WEEKDAYS_1CHAR.value,handler:this.configLocale});g.addProperty(b.WEEKDAYS_SHORT.key,{value:b.WEEKDAYS_SHORT.value,handler:this.configLocale});g.addProperty(b.WEEKDAYS_MEDIUM.key,{value:b.WEEKDAYS_MEDIUM.value,handler:this.configLocale});
g.addProperty(b.WEEKDAYS_LONG.key,{value:b.WEEKDAYS_LONG.value,handler:this.configLocale});var h=function(){g.refireEvent(b.LOCALE_MONTHS.key);g.refireEvent(b.LOCALE_WEEKDAYS.key)};g.subscribeToConfigEvent(b.START_WEEKDAY.key,h,this,true);g.subscribeToConfigEvent(b.MONTHS_SHORT.key,h,this,true);g.subscribeToConfigEvent(b.MONTHS_LONG.key,h,this,true);g.subscribeToConfigEvent(b.WEEKDAYS_1CHAR.key,h,this,true);g.subscribeToConfigEvent(b.WEEKDAYS_SHORT.key,h,this,true);g.subscribeToConfigEvent(b.WEEKDAYS_MEDIUM.key,h,this,true);g.subscribeToConfigEvent(b.WEEKDAYS_LONG.key,h,this,true);g.addProperty(b.LOCALE_MONTHS.key,{value:b.LOCALE_MONTHS.value,handler:this.configLocaleValues});g.addProperty(b.LOCALE_WEEKDAYS.key,{value:b.LOCALE_WEEKDAYS.value,handler:this.configLocaleValues});g.addProperty(b.DATE_DELIMITER.key,{value:b.DATE_DELIMITER.value,handler:this.configLocale});g.addProperty(b.DATE_FIELD_DELIMITER.key,{value:b.DATE_FIELD_DELIMITER.value,handler:this.configLocale});g.addProperty(b.DATE_RANGE_DELIMITER.key,{value:b.DATE_RANGE_DELIMITER.value,handler:this.configLocale});
g.addProperty(b.MY_MONTH_POSITION.key,{value:b.MY_MONTH_POSITION.value,handler:this.configLocale,validator:g.checkNumber});g.addProperty(b.MY_YEAR_POSITION.key,{value:b.MY_YEAR_POSITION.value,handler:this.configLocale,validator:g.checkNumber});g.addProperty(b.MD_MONTH_POSITION.key,{value:b.MD_MONTH_POSITION.value,handler:this.configLocale,validator:g.checkNumber});g.addProperty(b.MD_DAY_POSITION.key,{value:b.MD_DAY_POSITION.value,handler:this.configLocale,validator:g.checkNumber});g.addProperty(b.MDY_MONTH_POSITION.key,{value:b.MDY_MONTH_POSITION.value,handler:this.configLocale,validator:g.checkNumber});g.addProperty(b.MDY_DAY_POSITION.key,{value:b.MDY_DAY_POSITION.value,handler:this.configLocale,validator:g.checkNumber});g.addProperty(b.MDY_YEAR_POSITION.key,{value:b.MDY_YEAR_POSITION.value,handler:this.configLocale,validator:g.checkNumber});g.addProperty(b.MY_LABEL_MONTH_POSITION.key,{value:b.MY_LABEL_MONTH_POSITION.value,handler:this.configLocale,validator:g.checkNumber});g.addProperty(b.MY_LABEL_YEAR_POSITION.key,{value:b.MY_LABEL_YEAR_POSITION.value,handler:this.configLocale,validator:g.checkNumber});
g.addProperty(b.MY_LABEL_MONTH_SUFFIX.key,{value:b.MY_LABEL_MONTH_SUFFIX.value,handler:this.configLocale});g.addProperty(b.MY_LABEL_YEAR_SUFFIX.key,{value:b.MY_LABEL_YEAR_SUFFIX.value,handler:this.configLocale});g.addProperty(b.NAV.key,{value:b.NAV.value,handler:this.configNavigator});g.addProperty(b.STRINGS.key,{value:b.STRINGS.value,handler:this.configStrings,validator:function(i){return e.isObject(i)},supercedes:b.STRINGS.supercedes})},configStrings:function(h,g,i){var j=e.merge(b.STRINGS.value,g[0]);this.cfg.setProperty(b.STRINGS.key,j,true)},configPageDate:function(h,g,i){this.cfg.setProperty(b.PAGEDATE.key,this._parsePageDate(g[0]),true)},configMinDate:function(h,g,i){var j=g[0];if(e.isString(j)){j=this._parseDate(j);this.cfg.setProperty(b.MINDATE.key,d.getDate(j[0],(j[1]-1),j[2]))}},configMaxDate:function(h,g,i){var j=g[0];if(e.isString(j)){j=this._parseDate(j);this.cfg.setProperty(b.MAXDATE.key,d.getDate(j[0],(j[1]-1),j[2]))}},configSelected:function(i,g,k){var h=g[0],j=b.SELECTED.key;
if(h){if(e.isString(h)){this.cfg.setProperty(j,this._parseDates(h),true)}}if(!this._selectedDates){this._selectedDates=this.cfg.getProperty(j)}},configOptions:function(h,g,i){this.Options[h.toUpperCase()]=g[0]},configLocale:function(h,g,i){this.Locale[h.toUpperCase()]=g[0];this.cfg.refireEvent(b.LOCALE_MONTHS.key);this.cfg.refireEvent(b.LOCALE_WEEKDAYS.key)},configLocaleValues:function(j,i,k){j=j.toLowerCase();var m=i[0],h=this.cfg,n=this.Locale;switch(j){case b.LOCALE_MONTHS.key:switch(m){case f.SHORT:n.LOCALE_MONTHS=h.getProperty(b.MONTHS_SHORT.key).concat();break;case f.LONG:n.LOCALE_MONTHS=h.getProperty(b.MONTHS_LONG.key).concat();break}break;case b.LOCALE_WEEKDAYS.key:switch(m){case f.ONE_CHAR:n.LOCALE_WEEKDAYS=h.getProperty(b.WEEKDAYS_1CHAR.key).concat();break;case f.SHORT:n.LOCALE_WEEKDAYS=h.getProperty(b.WEEKDAYS_SHORT.key).concat();break;case f.MEDIUM:n.LOCALE_WEEKDAYS=h.getProperty(b.WEEKDAYS_MEDIUM.key).concat();break;case f.LONG:n.LOCALE_WEEKDAYS=h.getProperty(b.WEEKDAYS_LONG.key).concat();
break}var l=h.getProperty(b.START_WEEKDAY.key);if(l>0){for(var g=0;g<l;++g){n.LOCALE_WEEKDAYS.push(n.LOCALE_WEEKDAYS.shift())}}break}},configNavigator:function(h,g,i){var j=g[0];if(YAHOO.widget.CalendarNavigator&&(j===true||e.isObject(j))){if(!this.oNavigator){this.oNavigator=new YAHOO.widget.CalendarNavigator(this);this.beforeRenderEvent.subscribe(function(){if(!this.pages){this.oNavigator.erase()}},this,true)}}else{if(this.oNavigator){this.oNavigator.destroy();this.oNavigator=null}}},initStyles:function(){var g=f._STYLES;this.Style={CSS_ROW_HEADER:g.CSS_ROW_HEADER,CSS_ROW_FOOTER:g.CSS_ROW_FOOTER,CSS_CELL:g.CSS_CELL,CSS_CELL_SELECTOR:g.CSS_CELL_SELECTOR,CSS_CELL_SELECTED:g.CSS_CELL_SELECTED,CSS_CELL_SELECTABLE:g.CSS_CELL_SELECTABLE,CSS_CELL_RESTRICTED:g.CSS_CELL_RESTRICTED,CSS_CELL_TODAY:g.CSS_CELL_TODAY,CSS_CELL_OOM:g.CSS_CELL_OOM,CSS_CELL_OOB:g.CSS_CELL_OOB,CSS_HEADER:g.CSS_HEADER,CSS_HEADER_TEXT:g.CSS_HEADER_TEXT,CSS_BODY:g.CSS_BODY,CSS_WEEKDAY_CELL:g.CSS_WEEKDAY_CELL,CSS_WEEKDAY_ROW:g.CSS_WEEKDAY_ROW,CSS_FOOTER:g.CSS_FOOTER,CSS_CALENDAR:g.CSS_CALENDAR,CSS_SINGLE:g.CSS_SINGLE,CSS_CONTAINER:g.CSS_CONTAINER,CSS_NAV_LEFT:g.CSS_NAV_LEFT,CSS_NAV_RIGHT:g.CSS_NAV_RIGHT,CSS_NAV:g.CSS_NAV,CSS_CLOSE:g.CSS_CLOSE,CSS_CELL_TOP:g.CSS_CELL_TOP,CSS_CELL_LEFT:g.CSS_CELL_LEFT,CSS_CELL_RIGHT:g.CSS_CELL_RIGHT,CSS_CELL_BOTTOM:g.CSS_CELL_BOTTOM,CSS_CELL_HOVER:g.CSS_CELL_HOVER,CSS_CELL_HIGHLIGHT1:g.CSS_CELL_HIGHLIGHT1,CSS_CELL_HIGHLIGHT2:g.CSS_CELL_HIGHLIGHT2,CSS_CELL_HIGHLIGHT3:g.CSS_CELL_HIGHLIGHT3,CSS_CELL_HIGHLIGHT4:g.CSS_CELL_HIGHLIGHT4}
},buildMonthLabel:function(){return this._buildMonthLabel(this.cfg.getProperty(b.PAGEDATE.key))},_buildMonthLabel:function(g){var i=this.Locale.LOCALE_MONTHS[g.getMonth()]+this.Locale.MY_LABEL_MONTH_SUFFIX,h=g.getFullYear()+this.Locale.MY_LABEL_YEAR_SUFFIX;if(this.Locale.MY_LABEL_MONTH_POSITION==2||this.Locale.MY_LABEL_YEAR_POSITION==1){return h+i}else{return i+h}},buildDayLabel:function(g){return g.getDate()},createTitleBar:function(g){var h=c.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE,"div",this.oDomContainer)[0]||document.createElement("div");h.className=YAHOO.widget.CalendarGroup.CSS_2UPTITLE;h.innerHTML=g;this.oDomContainer.insertBefore(h,this.oDomContainer.firstChild);c.addClass(this.oDomContainer,"withtitle");return h},removeTitleBar:function(){var g=c.getElementsByClassName(YAHOO.widget.CalendarGroup.CSS_2UPTITLE,"div",this.oDomContainer)[0]||null;if(g){a.purgeElement(g);this.oDomContainer.removeChild(g)}c.removeClass(this.oDomContainer,"withtitle")},createCloseButton:function(){var j=YAHOO.widget.CalendarGroup.CSS_2UPCLOSE,l="us/my/bn/x_d.gif",k=c.getElementsByClassName("link-close","a",this.oDomContainer)[0],g=this.cfg.getProperty(b.STRINGS.key),h=(g&&g.close)?g.close:"";
if(!k){k=document.createElement("a");a.addListener(k,"click",function(n,m){m.hide();a.preventDefault(n)},this)}k.href="#";k.className="link-close";if(f.IMG_ROOT!==null){var i=c.getElementsByClassName(j,"img",k)[0]||document.createElement("img");i.src=f.IMG_ROOT+l;i.className=j;k.appendChild(i)}else{k.innerHTML='<span class="'+j+" "+this.Style.CSS_CLOSE+'">'+h+"</span>"}this.oDomContainer.appendChild(k);return k},removeCloseButton:function(){var g=c.getElementsByClassName("link-close","a",this.oDomContainer)[0]||null;if(g){a.purgeElement(g);this.oDomContainer.removeChild(g)}},renderHeader:function(q){var p=7,o="us/tr/callt.gif",g="us/tr/calrt.gif",n=this.cfg,k=n.getProperty(b.PAGEDATE.key),l=n.getProperty(b.STRINGS.key),v=(l&&l.previousMonth)?l.previousMonth:"",h=(l&&l.nextMonth)?l.nextMonth:"",m;if(n.getProperty(b.SHOW_WEEK_HEADER.key)){p+=1}if(n.getProperty(b.SHOW_WEEK_FOOTER.key)){p+=1}q[q.length]="<thead>";q[q.length]="<tr>";q[q.length]='<th colspan="'+p+'" class="'+this.Style.CSS_HEADER_TEXT+'">';
q[q.length]='<div class="'+this.Style.CSS_HEADER+'">';var x,u=false;if(this.parent){if(this.index===0){x=true}if(this.index==(this.parent.cfg.getProperty("pages")-1)){u=true}}else{x=true;u=true}if(x){m=this._buildMonthLabel(d.subtract(k,d.MONTH,1));var r=n.getProperty(b.NAV_ARROW_LEFT.key);if(r===null&&f.IMG_ROOT!==null){r=f.IMG_ROOT+o}var i=(r===null)?"":' style="background-image:url('+r+')"';q[q.length]='<a class="'+this.Style.CSS_NAV_LEFT+'"'+i+' href="#">'+v+" ("+m+")</a>"}var w=this.buildMonthLabel();var s=this.parent||this;if(s.cfg.getProperty("navigator")){w='<a class="'+this.Style.CSS_NAV+'" href="#">'+w+"</a>"}q[q.length]=w;if(u){m=this._buildMonthLabel(d.add(k,d.MONTH,1));var t=n.getProperty(b.NAV_ARROW_RIGHT.key);if(t===null&&f.IMG_ROOT!==null){t=f.IMG_ROOT+g}var j=(t===null)?"":' style="background-image:url('+t+')"';q[q.length]='<a class="'+this.Style.CSS_NAV_RIGHT+'"'+j+' href="#">'+h+" ("+m+")</a>"}q[q.length]="</div>\n</th>\n</tr>";if(n.getProperty(b.SHOW_WEEKDAYS.key)){q=this.buildWeekdays(q)
}q[q.length]="</thead>";return q},buildWeekdays:function(h){h[h.length]='<tr class="'+this.Style.CSS_WEEKDAY_ROW+'">';if(this.cfg.getProperty(b.SHOW_WEEK_HEADER.key)){h[h.length]="<th>&#160;</th>"}for(var g=0;g<this.Locale.LOCALE_WEEKDAYS.length;++g){h[h.length]='<th class="calweekdaycell">'+this.Locale.LOCALE_WEEKDAYS[g]+"</th>"}if(this.cfg.getProperty(b.SHOW_WEEK_FOOTER.key)){h[h.length]="<th>&#160;</th>"}h[h.length]="</tr>";return h},renderBody:function(P,N){var ai=this.cfg.getProperty(b.START_WEEKDAY.key);this.preMonthDays=P.getDay();if(ai>0){this.preMonthDays-=ai}if(this.preMonthDays<0){this.preMonthDays+=7}this.monthDays=d.findMonthEnd(P).getDate();this.postMonthDays=f.DISPLAY_DAYS-this.preMonthDays-this.monthDays;P=d.subtract(P,d.DAY,this.preMonthDays);var D,o,n="w",J="_cell",H="wd",V="d",u,T,aa=this.today,q=this.cfg,B=aa.getFullYear(),U=aa.getMonth(),k=aa.getDate(),Z=q.getProperty(b.PAGEDATE.key),j=q.getProperty(b.HIDE_BLANK_WEEKS.key),M=q.getProperty(b.SHOW_WEEK_FOOTER.key),G=q.getProperty(b.SHOW_WEEK_HEADER.key),z=q.getProperty(b.MINDATE.key),F=q.getProperty(b.MAXDATE.key);
if(z){z=d.clearTime(z)}if(F){F=d.clearTime(F)}N[N.length]='<tbody class="m'+(Z.getMonth()+1)+" "+this.Style.CSS_BODY+'">';var ag=0,v=document.createElement("div"),O=document.createElement("td");v.appendChild(O);var Y=this.parent||this;for(var ac=0;ac<6;ac++){D=d.getWeekNumber(P,ai);o=n+D;if(ac!==0&&j===true&&P.getMonth()!=Z.getMonth()){break}else{N[N.length]='<tr class="'+o+'">';if(G){N=this.renderRowHeader(D,N)}for(var ah=0;ah<7;ah++){u=[];this.clearElement(O);O.className=this.Style.CSS_CELL;O.id=this.id+J+ag;if(P.getDate()==k&&P.getMonth()==U&&P.getFullYear()==B){u[u.length]=Y.renderCellStyleToday}var E=[P.getFullYear(),P.getMonth()+1,P.getDate()];this.cellDates[this.cellDates.length]=E;if(P.getMonth()!=Z.getMonth()){u[u.length]=Y.renderCellNotThisMonth}else{c.addClass(O,H+P.getDay());c.addClass(O,V+P.getDate());for(var ab=0;ab<this.renderStack.length;++ab){T=null;var W=this.renderStack[ab],aj=W[0],h,I,m;switch(aj){case f.DATE:h=W[1][1];I=W[1][2];m=W[1][0];if(P.getMonth()+1==h&&P.getDate()==I&&P.getFullYear()==m){T=W[2];
this.renderStack.splice(ab,1)}break;case f.MONTH_DAY:h=W[1][0];I=W[1][1];if(P.getMonth()+1==h&&P.getDate()==I){T=W[2];this.renderStack.splice(ab,1)}break;case f.RANGE:var L=W[1][0],K=W[1][1],Q=L[1],y=L[2],C=L[0],af=d.getDate(C,Q-1,y),l=K[1],S=K[2],g=K[0],ae=d.getDate(g,l-1,S);if(P.getTime()>=af.getTime()&&P.getTime()<=ae.getTime()){T=W[2];if(P.getTime()==ae.getTime()){this.renderStack.splice(ab,1)}}break;case f.WEEKDAY:var w=W[1][0];if(P.getDay()+1==w){T=W[2]}break;case f.MONTH:h=W[1][0];if(P.getMonth()+1==h){T=W[2]}break}if(T){u[u.length]=T}}}if(this._indexOfSelectedFieldArray(E)>-1){u[u.length]=Y.renderCellStyleSelected}if((z&&(P.getTime()<z.getTime()))||(F&&(P.getTime()>F.getTime()))){u[u.length]=Y.renderOutOfBoundsDate}else{u[u.length]=Y.styleCellDefault;u[u.length]=Y.renderCellDefault}for(var X=0;X<u.length;++X){if(u[X].call(Y,P,O)==f.STOP_RENDER){break}}P.setTime(P.getTime()+d.ONE_DAY_MS);P=d.clearTime(P);if(ag>=0&&ag<=6){c.addClass(O,this.Style.CSS_CELL_TOP)}if((ag%7)===0){c.addClass(O,this.Style.CSS_CELL_LEFT)
}if(((ag+1)%7)===0){c.addClass(O,this.Style.CSS_CELL_RIGHT)}var R=this.postMonthDays;if(j&&R>=7){var A=Math.floor(R/7);for(var ad=0;ad<A;++ad){R-=7}}if(ag>=((this.preMonthDays+R+this.monthDays)-7)){c.addClass(O,this.Style.CSS_CELL_BOTTOM)}N[N.length]=v.innerHTML;ag++}if(M){N=this.renderRowFooter(D,N)}N[N.length]="</tr>"}}N[N.length]="</tbody>";return N},renderFooter:function(g){return g},render:function(){this.beforeRenderEvent.fire();var h=d.findMonthStart(this.cfg.getProperty(b.PAGEDATE.key));this.resetRenderers();this.cellDates.length=0;a.purgeElement(this.oDomContainer,true);var g=[];g[g.length]='<table cellSpacing="0" class="'+this.Style.CSS_CALENDAR+" y"+h.getFullYear()+'" id="'+this.id+'">';g=this.renderHeader(g);g=this.renderBody(h,g);g=this.renderFooter(g);g[g.length]="</table>";this.oDomContainer.innerHTML=g.join("\n");this.applyListeners();this.cells=this.oDomContainer.getElementsByTagName("td");this.cfg.refireEvent(b.TITLE.key);this.cfg.refireEvent(b.CLOSE.key);this.cfg.refireEvent(b.IFRAME.key);
this.renderEvent.fire()},applyListeners:function(){var q=this.oDomContainer,h=this.parent||this,m="a",t="click";var n=c.getElementsByClassName(this.Style.CSS_NAV_LEFT,m,q),j=c.getElementsByClassName(this.Style.CSS_NAV_RIGHT,m,q);if(n&&n.length>0){this.linkLeft=n[0];a.addListener(this.linkLeft,t,this.doPreviousMonthNav,h,true)}if(j&&j.length>0){this.linkRight=j[0];a.addListener(this.linkRight,t,this.doNextMonthNav,h,true)}if(h.cfg.getProperty("navigator")!==null){this.applyNavListeners()}if(this.domEventMap){var k,g;for(var s in this.domEventMap){if(e.hasOwnProperty(this.domEventMap,s)){var o=this.domEventMap[s];if(!(o instanceof Array)){o=[o]}for(var l=0;l<o.length;l++){var r=o[l];g=c.getElementsByClassName(s,r.tag,this.oDomContainer);for(var p=0;p<g.length;p++){k=g[p];a.addListener(k,r.event,r.handler,r.scope,r.correct)}}}}}a.addListener(this.oDomContainer,"click",this.doSelectCell,this);a.addListener(this.oDomContainer,"mouseover",this.doCellMouseOver,this);a.addListener(this.oDomContainer,"mouseout",this.doCellMouseOut,this)
},applyNavListeners:function(){var h=this.parent||this,i=this,g=c.getElementsByClassName(this.Style.CSS_NAV,"a",this.oDomContainer);if(g.length>0){a.addListener(g,"click",function(n,m){var l=a.getTarget(n);if(this===l||c.isAncestor(this,l)){a.preventDefault(n)}var j=h.oNavigator;if(j){var k=i.cfg.getProperty("pagedate");j.setYear(k.getFullYear());j.setMonth(k.getMonth());j.show()}})}},getDateByCellId:function(h){var g=this.getDateFieldsByCellId(h);return(g)?d.getDate(g[0],g[1]-1,g[2]):null},getDateFieldsByCellId:function(g){g=this.getIndexFromId(g);return(g>-1)?this.cellDates[g]:null},getCellIndex:function(j){var h=-1;if(j){var g=j.getMonth(),p=j.getFullYear(),o=j.getDate(),l=this.cellDates;for(var k=0;k<l.length;++k){var n=l[k];if(n[0]===p&&n[1]===g+1&&n[2]===o){h=k;break}}}return h},getIndexFromId:function(i){var h=-1,g=i.lastIndexOf("_cell");if(g>-1){h=parseInt(i.substring(g+5),10)}return h},renderOutOfBoundsDate:function(h,g){c.addClass(g,this.Style.CSS_CELL_OOB);g.innerHTML=h.getDate();
return f.STOP_RENDER},renderRowHeader:function(h,g){g[g.length]='<th class="calrowhead">'+h+"</th>";return g},renderRowFooter:function(h,g){g[g.length]='<th class="calrowfoot">'+h+"</th>";return g},renderCellDefault:function(h,g){g.innerHTML='<a href="#" class="'+this.Style.CSS_CELL_SELECTOR+'">'+this.buildDayLabel(h)+"</a>"},styleCellDefault:function(h,g){c.addClass(g,this.Style.CSS_CELL_SELECTABLE)},renderCellStyleHighlight1:function(h,g){c.addClass(g,this.Style.CSS_CELL_HIGHLIGHT1)},renderCellStyleHighlight2:function(h,g){c.addClass(g,this.Style.CSS_CELL_HIGHLIGHT2)},renderCellStyleHighlight3:function(h,g){c.addClass(g,this.Style.CSS_CELL_HIGHLIGHT3)},renderCellStyleHighlight4:function(h,g){c.addClass(g,this.Style.CSS_CELL_HIGHLIGHT4)},renderCellStyleToday:function(h,g){c.addClass(g,this.Style.CSS_CELL_TODAY)},renderCellStyleSelected:function(h,g){c.addClass(g,this.Style.CSS_CELL_SELECTED)},renderCellNotThisMonth:function(h,g){c.addClass(g,this.Style.CSS_CELL_OOM);g.innerHTML=h.getDate();
return f.STOP_RENDER},renderBodyCellRestricted:function(h,g){c.addClass(g,this.Style.CSS_CELL);c.addClass(g,this.Style.CSS_CELL_RESTRICTED);g.innerHTML=h.getDate();return f.STOP_RENDER},addMonths:function(h){var g=b.PAGEDATE.key;this.cfg.setProperty(g,d.add(this.cfg.getProperty(g),d.MONTH,h));this.resetRenderers();this.changePageEvent.fire()},subtractMonths:function(h){var g=b.PAGEDATE.key;this.cfg.setProperty(g,d.subtract(this.cfg.getProperty(g),d.MONTH,h));this.resetRenderers();this.changePageEvent.fire()},addYears:function(h){var g=b.PAGEDATE.key;this.cfg.setProperty(g,d.add(this.cfg.getProperty(g),d.YEAR,h));this.resetRenderers();this.changePageEvent.fire()},subtractYears:function(h){var g=b.PAGEDATE.key;this.cfg.setProperty(g,d.subtract(this.cfg.getProperty(g),d.YEAR,h));this.resetRenderers();this.changePageEvent.fire()},nextMonth:function(){this.addMonths(1)},previousMonth:function(){this.subtractMonths(1)},nextYear:function(){this.addYears(1)},previousYear:function(){this.subtractYears(1)
},reset:function(){this.cfg.resetProperty(b.SELECTED.key);this.cfg.resetProperty(b.PAGEDATE.key);this.resetEvent.fire()},clear:function(){this.cfg.setProperty(b.SELECTED.key,[]);this.cfg.setProperty(b.PAGEDATE.key,new Date(this.today.getTime()));this.clearEvent.fire()},select:function(i){var l=this._toFieldArray(i),h=[],k=[],m=b.SELECTED.key;for(var g=0;g<l.length;++g){var j=l[g];if(!this.isDateOOB(this._toDate(j))){if(h.length===0){this.beforeSelectEvent.fire();k=this.cfg.getProperty(m)}h.push(j);if(this._indexOfSelectedFieldArray(j)==-1){k[k.length]=j}}}if(h.length>0){if(this.parent){this.parent.cfg.setProperty(m,k)}else{this.cfg.setProperty(m,k)}this.selectEvent.fire(h)}return this.getSelectedDates()},selectCell:function(j){var h=this.cells[j],n=this.cellDates[j],m=this._toDate(n),i=c.hasClass(h,this.Style.CSS_CELL_SELECTABLE);if(i){this.beforeSelectEvent.fire();var l=b.SELECTED.key;var k=this.cfg.getProperty(l);var g=n.concat();if(this._indexOfSelectedFieldArray(g)==-1){k[k.length]=g
}if(this.parent){this.parent.cfg.setProperty(l,k)}else{this.cfg.setProperty(l,k)}this.renderCellStyleSelected(m,h);this.selectEvent.fire([g]);this.doCellMouseOut.call(h,null,this)}return this.getSelectedDates()},deselect:function(k){var g=this._toFieldArray(k),j=[],m=[],n=b.SELECTED.key;for(var h=0;h<g.length;++h){var l=g[h];if(!this.isDateOOB(this._toDate(l))){if(j.length===0){this.beforeDeselectEvent.fire();m=this.cfg.getProperty(n)}j.push(l);var i=this._indexOfSelectedFieldArray(l);if(i!=-1){m.splice(i,1)}}}if(j.length>0){if(this.parent){this.parent.cfg.setProperty(n,m)}else{this.cfg.setProperty(n,m)}this.deselectEvent.fire(j)}return this.getSelectedDates()},deselectCell:function(k){var h=this.cells[k],n=this.cellDates[k],i=this._indexOfSelectedFieldArray(n);var j=c.hasClass(h,this.Style.CSS_CELL_SELECTABLE);if(j){this.beforeDeselectEvent.fire();var l=this.cfg.getProperty(b.SELECTED.key),m=this._toDate(n),g=n.concat();if(i>-1){if(this.cfg.getProperty(b.PAGEDATE.key).getMonth()==m.getMonth()&&this.cfg.getProperty(b.PAGEDATE.key).getFullYear()==m.getFullYear()){c.removeClass(h,this.Style.CSS_CELL_SELECTED)
}l.splice(i,1)}if(this.parent){this.parent.cfg.setProperty(b.SELECTED.key,l)}else{this.cfg.setProperty(b.SELECTED.key,l)}this.deselectEvent.fire([g])}return this.getSelectedDates()},deselectAll:function(){this.beforeDeselectEvent.fire();var j=b.SELECTED.key,g=this.cfg.getProperty(j),h=g.length,i=g.concat();if(this.parent){this.parent.cfg.setProperty(j,[])}else{this.cfg.setProperty(j,[])}if(h>0){this.deselectEvent.fire(i)}return this.getSelectedDates()},_toFieldArray:function(h){var g=[];if(h instanceof Date){g=[[h.getFullYear(),h.getMonth()+1,h.getDate()]]}else{if(e.isString(h)){g=this._parseDates(h)}else{if(e.isArray(h)){for(var j=0;j<h.length;++j){var k=h[j];g[g.length]=[k.getFullYear(),k.getMonth()+1,k.getDate()]}}}}return g},toDate:function(g){return this._toDate(g)},_toDate:function(g){if(g instanceof Date){return g}else{return d.getDate(g[0],g[1]-1,g[2])}},_fieldArraysAreEqual:function(i,h){var g=false;if(i[0]==h[0]&&i[1]==h[1]&&i[2]==h[2]){g=true}return g},_indexOfSelectedFieldArray:function(k){var j=-1,g=this.cfg.getProperty(b.SELECTED.key);
for(var i=0;i<g.length;++i){var h=g[i];if(k[0]==h[0]&&k[1]==h[1]&&k[2]==h[2]){j=i;break}}return j},isDateOOM:function(g){return(g.getMonth()!=this.cfg.getProperty(b.PAGEDATE.key).getMonth())},isDateOOB:function(i){var j=this.cfg.getProperty(b.MINDATE.key),k=this.cfg.getProperty(b.MAXDATE.key),h=d;if(j){j=h.clearTime(j)}if(k){k=h.clearTime(k)}var g=new Date(i.getTime());g=h.clearTime(g);return((j&&g.getTime()<j.getTime())||(k&&g.getTime()>k.getTime()))},_parsePageDate:function(g){var j;if(g){if(g instanceof Date){j=d.findMonthStart(g)}else{var k,i,h;h=g.split(this.cfg.getProperty(b.DATE_FIELD_DELIMITER.key));k=parseInt(h[this.cfg.getProperty(b.MY_MONTH_POSITION.key)-1],10)-1;i=parseInt(h[this.cfg.getProperty(b.MY_YEAR_POSITION.key)-1],10);j=d.getDate(i,k,1)}}else{j=d.getDate(this.today.getFullYear(),this.today.getMonth(),1)}return j},onBeforeSelect:function(){if(this.cfg.getProperty(b.MULTI_SELECT.key)===false){if(this.parent){this.parent.callChildFunction("clearAllBodyCellStyles",this.Style.CSS_CELL_SELECTED);
this.parent.deselectAll()}else{this.clearAllBodyCellStyles(this.Style.CSS_CELL_SELECTED);this.deselectAll()}}},onSelect:function(g){},onBeforeDeselect:function(){},onDeselect:function(g){},onChangePage:function(){this.render()},onRender:function(){},onReset:function(){this.render()},onClear:function(){this.render()},validate:function(){return true},_parseDate:function(j){var k=j.split(this.Locale.DATE_FIELD_DELIMITER),g;if(k.length==2){g=[k[this.Locale.MD_MONTH_POSITION-1],k[this.Locale.MD_DAY_POSITION-1]];g.type=f.MONTH_DAY}else{g=[k[this.Locale.MDY_YEAR_POSITION-1],k[this.Locale.MDY_MONTH_POSITION-1],k[this.Locale.MDY_DAY_POSITION-1]];g.type=f.DATE}for(var h=0;h<g.length;h++){g[h]=parseInt(g[h],10)}return g},_parseDates:function(h){var o=[],n=h.split(this.Locale.DATE_DELIMITER);for(var m=0;m<n.length;++m){var l=n[m];if(l.indexOf(this.Locale.DATE_RANGE_DELIMITER)!=-1){var g=l.split(this.Locale.DATE_RANGE_DELIMITER),k=this._parseDate(g[0]),p=this._parseDate(g[1]),j=this._parseRange(k,p);
o=o.concat(j)}else{var i=this._parseDate(l);o.push(i)}}return o},_parseRange:function(g,k){var h=d.add(d.getDate(g[0],g[1]-1,g[2]),d.DAY,1),j=d.getDate(k[0],k[1]-1,k[2]),i=[];i.push(g);while(h.getTime()<=j.getTime()){i.push([h.getFullYear(),h.getMonth()+1,h.getDate()]);h=d.add(h,d.DAY,1)}return i},resetRenderers:function(){this.renderStack=this._renderStack.concat()},removeRenderers:function(){this._renderStack=[];this.renderStack=[]},clearElement:function(g){g.innerHTML="&#160;";g.className=""},addRenderer:function(g,h){var k=this._parseDates(g);for(var j=0;j<k.length;++j){var l=k[j];if(l.length==2){if(l[0] instanceof Array){this._addRenderer(f.RANGE,l,h)}else{this._addRenderer(f.MONTH_DAY,l,h)}}else{if(l.length==3){this._addRenderer(f.DATE,l,h)}}}},_addRenderer:function(h,i,g){var j=[h,i,g];this.renderStack.unshift(j);this._renderStack=this.renderStack.concat()},addMonthRenderer:function(h,g){this._addRenderer(f.MONTH,[h],g)},addWeekdayRenderer:function(h,g){this._addRenderer(f.WEEKDAY,[h],g)
},clearAllBodyCellStyles:function(g){for(var h=0;h<this.cells.length;++h){c.removeClass(this.cells[h],g)}},setMonth:function(i){var g=b.PAGEDATE.key,h=this.cfg.getProperty(g);h.setMonth(parseInt(i,10));this.cfg.setProperty(g,h)},setYear:function(h){var g=b.PAGEDATE.key,i=this.cfg.getProperty(g);i.setFullYear(parseInt(h,10));this.cfg.setProperty(g,i)},getSelectedDates:function(){var i=[],h=this.cfg.getProperty(b.SELECTED.key);for(var k=0;k<h.length;++k){var j=h[k];var g=d.getDate(j[0],j[1]-1,j[2]);i.push(g)}i.sort(function(m,l){return m-l});return i},hide:function(){if(this.beforeHideEvent.fire()){this.oDomContainer.style.display="none";this.hideEvent.fire()}},show:function(){if(this.beforeShowEvent.fire()){this.oDomContainer.style.display="block";this.showEvent.fire()}},browser:(function(){var g=navigator.userAgent.toLowerCase();if(g.indexOf("opera")!=-1){return"opera"}else{if(g.indexOf("msie 7")!=-1){return"ie7"}else{if(g.indexOf("msie")!=-1){return"ie"}else{if(g.indexOf("safari")!=-1){return"safari"
}else{if(g.indexOf("gecko")!=-1){return"gecko"}else{return false}}}}}})(),toString:function(){return"Calendar "+this.id},destroy:function(){if(this.beforeDestroyEvent.fire()){var g=this;if(g.navigator){g.navigator.destroy()}if(g.cfg){g.cfg.destroy()}a.purgeElement(g.oDomContainer,true);c.removeClass(g.oDomContainer,"withtitle");c.removeClass(g.oDomContainer,g.Style.CSS_CONTAINER);c.removeClass(g.oDomContainer,g.Style.CSS_SINGLE);g.oDomContainer.innerHTML="";g.oDomContainer=null;g.cells=null;this.destroyEvent.fire()}}};YAHOO.widget.Calendar=f;YAHOO.widget.Calendar_Core=YAHOO.widget.Calendar;YAHOO.widget.Cal_Core=YAHOO.widget.Calendar})();(function(){var d=YAHOO.util.Dom,f=YAHOO.widget.DateMath,a=YAHOO.util.Event,e=YAHOO.lang,g=YAHOO.widget.Calendar;function b(j,h,i){if(arguments.length>0){this.init.apply(this,arguments)}}b._DEFAULT_CONFIG=g._DEFAULT_CONFIG;b._DEFAULT_CONFIG.PAGES={key:"pages",value:2};var c=b._DEFAULT_CONFIG;b.prototype={init:function(k,i,j){var h=this._parseArgs(arguments);
k=h.id;i=h.container;j=h.config;this.oDomContainer=d.get(i);if(!this.oDomContainer.id){this.oDomContainer.id=d.generateId()}if(!k){k=this.oDomContainer.id+"_t"}this.id=k;this.containerId=this.oDomContainer.id;this.initEvents();this.initStyles();this.pages=[];d.addClass(this.oDomContainer,b.CSS_CONTAINER);d.addClass(this.oDomContainer,b.CSS_MULTI_UP);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};this.setupConfig();if(j){this.cfg.applyConfig(j,true)}this.cfg.fireQueue();if(YAHOO.env.ua.opera){this.renderEvent.subscribe(this._fixWidth,this,true);this.showEvent.subscribe(this._fixWidth,this,true)}},setupConfig:function(){var h=this.cfg;h.addProperty(c.PAGES.key,{value:c.PAGES.value,validator:h.checkNumber,handler:this.configPages});h.addProperty(c.PAGEDATE.key,{value:new Date(),handler:this.configPageDate});h.addProperty(c.SELECTED.key,{value:[],handler:this.configSelected});h.addProperty(c.TITLE.key,{value:c.TITLE.value,handler:this.configTitle});h.addProperty(c.CLOSE.key,{value:c.CLOSE.value,handler:this.configClose});
h.addProperty(c.IFRAME.key,{value:c.IFRAME.value,handler:this.configIframe,validator:h.checkBoolean});h.addProperty(c.MINDATE.key,{value:c.MINDATE.value,handler:this.delegateConfig});h.addProperty(c.MAXDATE.key,{value:c.MAXDATE.value,handler:this.delegateConfig});h.addProperty(c.MULTI_SELECT.key,{value:c.MULTI_SELECT.value,handler:this.delegateConfig,validator:h.checkBoolean});h.addProperty(c.START_WEEKDAY.key,{value:c.START_WEEKDAY.value,handler:this.delegateConfig,validator:h.checkNumber});h.addProperty(c.SHOW_WEEKDAYS.key,{value:c.SHOW_WEEKDAYS.value,handler:this.delegateConfig,validator:h.checkBoolean});h.addProperty(c.SHOW_WEEK_HEADER.key,{value:c.SHOW_WEEK_HEADER.value,handler:this.delegateConfig,validator:h.checkBoolean});h.addProperty(c.SHOW_WEEK_FOOTER.key,{value:c.SHOW_WEEK_FOOTER.value,handler:this.delegateConfig,validator:h.checkBoolean});h.addProperty(c.HIDE_BLANK_WEEKS.key,{value:c.HIDE_BLANK_WEEKS.value,handler:this.delegateConfig,validator:h.checkBoolean});h.addProperty(c.NAV_ARROW_LEFT.key,{value:c.NAV_ARROW_LEFT.value,handler:this.delegateConfig});
h.addProperty(c.NAV_ARROW_RIGHT.key,{value:c.NAV_ARROW_RIGHT.value,handler:this.delegateConfig});h.addProperty(c.MONTHS_SHORT.key,{value:c.MONTHS_SHORT.value,handler:this.delegateConfig});h.addProperty(c.MONTHS_LONG.key,{value:c.MONTHS_LONG.value,handler:this.delegateConfig});h.addProperty(c.WEEKDAYS_1CHAR.key,{value:c.WEEKDAYS_1CHAR.value,handler:this.delegateConfig});h.addProperty(c.WEEKDAYS_SHORT.key,{value:c.WEEKDAYS_SHORT.value,handler:this.delegateConfig});h.addProperty(c.WEEKDAYS_MEDIUM.key,{value:c.WEEKDAYS_MEDIUM.value,handler:this.delegateConfig});h.addProperty(c.WEEKDAYS_LONG.key,{value:c.WEEKDAYS_LONG.value,handler:this.delegateConfig});h.addProperty(c.LOCALE_MONTHS.key,{value:c.LOCALE_MONTHS.value,handler:this.delegateConfig});h.addProperty(c.LOCALE_WEEKDAYS.key,{value:c.LOCALE_WEEKDAYS.value,handler:this.delegateConfig});h.addProperty(c.DATE_DELIMITER.key,{value:c.DATE_DELIMITER.value,handler:this.delegateConfig});h.addProperty(c.DATE_FIELD_DELIMITER.key,{value:c.DATE_FIELD_DELIMITER.value,handler:this.delegateConfig});
h.addProperty(c.DATE_RANGE_DELIMITER.key,{value:c.DATE_RANGE_DELIMITER.value,handler:this.delegateConfig});h.addProperty(c.MY_MONTH_POSITION.key,{value:c.MY_MONTH_POSITION.value,handler:this.delegateConfig,validator:h.checkNumber});h.addProperty(c.MY_YEAR_POSITION.key,{value:c.MY_YEAR_POSITION.value,handler:this.delegateConfig,validator:h.checkNumber});h.addProperty(c.MD_MONTH_POSITION.key,{value:c.MD_MONTH_POSITION.value,handler:this.delegateConfig,validator:h.checkNumber});h.addProperty(c.MD_DAY_POSITION.key,{value:c.MD_DAY_POSITION.value,handler:this.delegateConfig,validator:h.checkNumber});h.addProperty(c.MDY_MONTH_POSITION.key,{value:c.MDY_MONTH_POSITION.value,handler:this.delegateConfig,validator:h.checkNumber});h.addProperty(c.MDY_DAY_POSITION.key,{value:c.MDY_DAY_POSITION.value,handler:this.delegateConfig,validator:h.checkNumber});h.addProperty(c.MDY_YEAR_POSITION.key,{value:c.MDY_YEAR_POSITION.value,handler:this.delegateConfig,validator:h.checkNumber});h.addProperty(c.MY_LABEL_MONTH_POSITION.key,{value:c.MY_LABEL_MONTH_POSITION.value,handler:this.delegateConfig,validator:h.checkNumber});
h.addProperty(c.MY_LABEL_YEAR_POSITION.key,{value:c.MY_LABEL_YEAR_POSITION.value,handler:this.delegateConfig,validator:h.checkNumber});h.addProperty(c.MY_LABEL_MONTH_SUFFIX.key,{value:c.MY_LABEL_MONTH_SUFFIX.value,handler:this.delegateConfig});h.addProperty(c.MY_LABEL_YEAR_SUFFIX.key,{value:c.MY_LABEL_YEAR_SUFFIX.value,handler:this.delegateConfig});h.addProperty(c.NAV.key,{value:c.NAV.value,handler:this.configNavigator});h.addProperty(c.STRINGS.key,{value:c.STRINGS.value,handler:this.configStrings,validator:function(i){return e.isObject(i)},supercedes:c.STRINGS.supercedes})},initEvents:function(){var j=this,l="Event",m=YAHOO.util.CustomEvent;var i=function(o,s,n){for(var r=0;r<j.pages.length;++r){var q=j.pages[r];q[this.type+l].subscribe(o,s,n)}};var h=function(n,r){for(var q=0;q<j.pages.length;++q){var o=j.pages[q];o[this.type+l].unsubscribe(n,r)}};var k=g._EVENT_TYPES;j.beforeSelectEvent=new m(k.BEFORE_SELECT);j.beforeSelectEvent.subscribe=i;j.beforeSelectEvent.unsubscribe=h;j.selectEvent=new m(k.SELECT);
j.selectEvent.subscribe=i;j.selectEvent.unsubscribe=h;j.beforeDeselectEvent=new m(k.BEFORE_DESELECT);j.beforeDeselectEvent.subscribe=i;j.beforeDeselectEvent.unsubscribe=h;j.deselectEvent=new m(k.DESELECT);j.deselectEvent.subscribe=i;j.deselectEvent.unsubscribe=h;j.changePageEvent=new m(k.CHANGE_PAGE);j.changePageEvent.subscribe=i;j.changePageEvent.unsubscribe=h;j.beforeRenderEvent=new m(k.BEFORE_RENDER);j.beforeRenderEvent.subscribe=i;j.beforeRenderEvent.unsubscribe=h;j.renderEvent=new m(k.RENDER);j.renderEvent.subscribe=i;j.renderEvent.unsubscribe=h;j.resetEvent=new m(k.RESET);j.resetEvent.subscribe=i;j.resetEvent.unsubscribe=h;j.clearEvent=new m(k.CLEAR);j.clearEvent.subscribe=i;j.clearEvent.unsubscribe=h;j.beforeShowEvent=new m(k.BEFORE_SHOW);j.showEvent=new m(k.SHOW);j.beforeHideEvent=new m(k.BEFORE_HIDE);j.hideEvent=new m(k.HIDE);j.beforeShowNavEvent=new m(k.BEFORE_SHOW_NAV);j.showNavEvent=new m(k.SHOW_NAV);j.beforeHideNavEvent=new m(k.BEFORE_HIDE_NAV);j.hideNavEvent=new m(k.HIDE_NAV);
j.beforeRenderNavEvent=new m(k.BEFORE_RENDER_NAV);j.renderNavEvent=new m(k.RENDER_NAV);j.beforeDestroyEvent=new m(k.BEFORE_DESTROY);j.destroyEvent=new m(k.DESTROY)},configPages:function(u,s,n){var l=s[0],j=c.PAGEDATE.key,x="_",m,o=null,t="groupcal",w="first-of-type",k="last-of-type";for(var i=0;i<l;++i){var v=this.id+x+i,r=this.containerId+x+i,q=this.cfg.getConfig();q.close=false;q.title=false;q.navigator=null;if(i>0){m=new Date(o);this._setMonthOnDate(m,m.getMonth()+i);q.pageDate=m}var h=this.constructChild(v,r,q);d.removeClass(h.oDomContainer,this.Style.CSS_SINGLE);d.addClass(h.oDomContainer,t);if(i===0){o=h.cfg.getProperty(j);d.addClass(h.oDomContainer,w)}if(i==(l-1)){d.addClass(h.oDomContainer,k)}h.parent=this;h.index=i;this.pages[this.pages.length]=h}},configPageDate:function(o,n,l){var j=n[0],m;var k=c.PAGEDATE.key;for(var i=0;i<this.pages.length;++i){var h=this.pages[i];if(i===0){m=h._parsePageDate(j);h.cfg.setProperty(k,m)}else{var q=new Date(m);this._setMonthOnDate(q,q.getMonth()+i);
h.cfg.setProperty(k,q)}}},configSelected:function(j,h,l){var k=c.SELECTED.key;this.delegateConfig(j,h,l);var i=(this.pages.length>0)?this.pages[0].cfg.getProperty(k):[];this.cfg.setProperty(k,i,true)},delegateConfig:function(i,h,l){var m=h[0];var k;for(var j=0;j<this.pages.length;j++){k=this.pages[j];k.cfg.setProperty(i,m)}},setChildFunction:function(k,i){var h=this.cfg.getProperty(c.PAGES.key);for(var j=0;j<h;++j){this.pages[j][k]=i}},callChildFunction:function(m,i){var h=this.cfg.getProperty(c.PAGES.key);for(var l=0;l<h;++l){var k=this.pages[l];if(k[m]){var j=k[m];j.call(k,i)}}},constructChild:function(k,i,j){var h=document.getElementById(i);if(!h){h=document.createElement("div");h.id=i;this.oDomContainer.appendChild(h)}return new g(k,i,j)},setMonth:function(l){l=parseInt(l,10);var m;var i=c.PAGEDATE.key;for(var k=0;k<this.pages.length;++k){var j=this.pages[k];var h=j.cfg.getProperty(i);if(k===0){m=h.getFullYear()}else{h.setFullYear(m)}this._setMonthOnDate(h,l+k);j.cfg.setProperty(i,h)
}},setYear:function(j){var i=c.PAGEDATE.key;j=parseInt(j,10);for(var l=0;l<this.pages.length;++l){var k=this.pages[l];var h=k.cfg.getProperty(i);if((h.getMonth()+1)==1&&l>0){j+=1}k.setYear(j)}},render:function(){this.renderHeader();for(var i=0;i<this.pages.length;++i){var h=this.pages[i];h.render()}this.renderFooter()},select:function(h){for(var j=0;j<this.pages.length;++j){var i=this.pages[j];i.select(h)}return this.getSelectedDates()},selectCell:function(h){for(var j=0;j<this.pages.length;++j){var i=this.pages[j];i.selectCell(h)}return this.getSelectedDates()},deselect:function(h){for(var j=0;j<this.pages.length;++j){var i=this.pages[j];i.deselect(h)}return this.getSelectedDates()},deselectAll:function(){for(var i=0;i<this.pages.length;++i){var h=this.pages[i];h.deselectAll()}return this.getSelectedDates()},deselectCell:function(h){for(var j=0;j<this.pages.length;++j){var i=this.pages[j];i.deselectCell(h)}return this.getSelectedDates()},reset:function(){for(var i=0;i<this.pages.length;
++i){var h=this.pages[i];h.reset()}},clear:function(){for(var i=0;i<this.pages.length;++i){var h=this.pages[i];h.clear()}this.cfg.setProperty(c.SELECTED.key,[]);this.cfg.setProperty(c.PAGEDATE.key,new Date(this.pages[0].today.getTime()));this.render()},nextMonth:function(){for(var i=0;i<this.pages.length;++i){var h=this.pages[i];h.nextMonth()}},previousMonth:function(){for(var i=this.pages.length-1;i>=0;--i){var h=this.pages[i];h.previousMonth()}},nextYear:function(){for(var i=0;i<this.pages.length;++i){var h=this.pages[i];h.nextYear()}},previousYear:function(){for(var i=0;i<this.pages.length;++i){var h=this.pages[i];h.previousYear()}},getSelectedDates:function(){var j=[];var i=this.cfg.getProperty(c.SELECTED.key);for(var l=0;l<i.length;++l){var k=i[l];var h=f.getDate(k[0],k[1]-1,k[2]);j.push(h)}j.sort(function(n,m){return n-m});return j},addRenderer:function(h,i){for(var k=0;k<this.pages.length;++k){var j=this.pages[k];j.addRenderer(h,i)}},addMonthRenderer:function(k,h){for(var j=0;j<this.pages.length;
++j){var i=this.pages[j];i.addMonthRenderer(k,h)}},addWeekdayRenderer:function(i,h){for(var k=0;k<this.pages.length;++k){var j=this.pages[k];j.addWeekdayRenderer(i,h)}},removeRenderers:function(){this.callChildFunction("removeRenderers")},renderHeader:function(){},renderFooter:function(){},addMonths:function(h){this.callChildFunction("addMonths",h)},subtractMonths:function(h){this.callChildFunction("subtractMonths",h)},addYears:function(h){this.callChildFunction("addYears",h)},subtractYears:function(h){this.callChildFunction("subtractYears",h)},getCalendarPage:function(l){var o=null;if(l){var p=l.getFullYear(),k=l.getMonth();var j=this.pages;for(var n=0;n<j.length;++n){var h=j[n].cfg.getProperty("pagedate");if(h.getFullYear()===p&&h.getMonth()===k){o=j[n];break}}}return o},_setMonthOnDate:function(i,j){if(YAHOO.env.ua.webkit&&YAHOO.env.ua.webkit<420&&(j<0||j>11)){var h=f.add(i,f.MONTH,j-i.getMonth());i.setTime(h.getTime())}else{i.setMonth(j)}},_fixWidth:function(){var h=0;for(var j=0;j<this.pages.length;
++j){var i=this.pages[j];h+=i.oDomContainer.offsetWidth}if(h>0){this.oDomContainer.style.width=h+"px"}},toString:function(){return"CalendarGroup "+this.id},destroy:function(){if(this.beforeDestroyEvent.fire()){var k=this;if(k.navigator){k.navigator.destroy()}if(k.cfg){k.cfg.destroy()}a.purgeElement(k.oDomContainer,true);d.removeClass(k.oDomContainer,b.CSS_CONTAINER);d.removeClass(k.oDomContainer,b.CSS_MULTI_UP);for(var j=0,h=k.pages.length;j<h;j++){k.pages[j].destroy();k.pages[j]=null}k.oDomContainer.innerHTML="";k.oDomContainer=null;this.destroyEvent.fire()}}};b.CSS_CONTAINER="yui-calcontainer";b.CSS_MULTI_UP="multi";b.CSS_2UPTITLE="title";b.CSS_2UPCLOSE="close-icon";YAHOO.lang.augmentProto(b,g,"buildDayLabel","buildMonthLabel","renderOutOfBoundsDate","renderRowHeader","renderRowFooter","renderCellDefault","styleCellDefault","renderCellStyleHighlight1","renderCellStyleHighlight2","renderCellStyleHighlight3","renderCellStyleHighlight4","renderCellStyleToday","renderCellStyleSelected","renderCellNotThisMonth","renderBodyCellRestricted","initStyles","configTitle","configClose","configIframe","configStrings","configNavigator","createTitleBar","createCloseButton","removeTitleBar","removeCloseButton","hide","show","toDate","_toDate","_parseArgs","browser");
YAHOO.widget.CalGrp=b;YAHOO.widget.CalendarGroup=b;YAHOO.widget.Calendar2up=function(j,h,i){this.init(j,h,i)};YAHOO.extend(YAHOO.widget.Calendar2up,b);YAHOO.widget.Cal2up=YAHOO.widget.Calendar2up})();YAHOO.widget.CalendarNavigator=function(a){this.init(a)};(function(){var a=YAHOO.widget.CalendarNavigator;a.CLASSES={NAV:"yui-cal-nav",NAV_VISIBLE:"yui-cal-nav-visible",MASK:"yui-cal-nav-mask",YEAR:"yui-cal-nav-y",MONTH:"yui-cal-nav-m",BUTTONS:"yui-cal-nav-b",BUTTON:"yui-cal-nav-btn",ERROR:"yui-cal-nav-e",YEAR_CTRL:"yui-cal-nav-yc",MONTH_CTRL:"yui-cal-nav-mc",INVALID:"yui-invalid",DEFAULT:"yui-default"};a._DEFAULT_CFG={strings:{month:"Month",year:"Year",submit:"Okay",cancel:"Cancel",invalidYear:"Year needs to be a number"},monthFormat:YAHOO.widget.Calendar.LONG,initialFocus:"year"};a.ID_SUFFIX="_nav";a.MONTH_SUFFIX="_month";a.YEAR_SUFFIX="_year";a.ERROR_SUFFIX="_error";a.CANCEL_SUFFIX="_cancel";a.SUBMIT_SUFFIX="_submit";a.YR_MAX_DIGITS=4;a.YR_MINOR_INC=1;a.YR_MAJOR_INC=10;a.UPDATE_DELAY=50;
a.YR_PATTERN=/^\d+$/;a.TRIM=/^\s*(.*?)\s*$/})();YAHOO.widget.CalendarNavigator.prototype={id:null,cal:null,navEl:null,maskEl:null,yearEl:null,monthEl:null,errorEl:null,submitEl:null,cancelEl:null,firstCtrl:null,lastCtrl:null,_doc:null,_year:null,_month:0,__rendered:false,init:function(a){var c=a.oDomContainer;this.cal=a;this.id=c.id+YAHOO.widget.CalendarNavigator.ID_SUFFIX;this._doc=c.ownerDocument;var b=YAHOO.env.ua.ie;this.__isIEQuirks=(b&&((b<=6)||(this._doc.compatMode=="BackCompat")))},show:function(){var a=YAHOO.widget.CalendarNavigator.CLASSES;if(this.cal.beforeShowNavEvent.fire()){if(!this.__rendered){this.render()}this.clearErrors();this._updateMonthUI();this._updateYearUI();this._show(this.navEl,true);this.setInitialFocus();this.showMask();YAHOO.util.Dom.addClass(this.cal.oDomContainer,a.NAV_VISIBLE);this.cal.showNavEvent.fire()}},hide:function(){var a=YAHOO.widget.CalendarNavigator.CLASSES;if(this.cal.beforeHideNavEvent.fire()){this._show(this.navEl,false);this.hideMask();YAHOO.util.Dom.removeClass(this.cal.oDomContainer,a.NAV_VISIBLE);
this.cal.hideNavEvent.fire()}},showMask:function(){this._show(this.maskEl,true);if(this.__isIEQuirks){this._syncMask()}},hideMask:function(){this._show(this.maskEl,false)},getMonth:function(){return this._month},getYear:function(){return this._year},setMonth:function(a){if(a>=0&&a<12){this._month=a}this._updateMonthUI()},setYear:function(b){var a=YAHOO.widget.CalendarNavigator.YR_PATTERN;if(YAHOO.lang.isNumber(b)&&a.test(b+"")){this._year=b}this._updateYearUI()},render:function(){this.cal.beforeRenderNavEvent.fire();if(!this.__rendered){this.createNav();this.createMask();this.applyListeners();this.__rendered=true}this.cal.renderNavEvent.fire()},createNav:function(){var b=YAHOO.widget.CalendarNavigator;var c=this._doc;var e=c.createElement("div");e.className=b.CLASSES.NAV;var a=this.renderNavContents([]);e.innerHTML=a.join("");this.cal.oDomContainer.appendChild(e);this.navEl=e;this.yearEl=c.getElementById(this.id+b.YEAR_SUFFIX);this.monthEl=c.getElementById(this.id+b.MONTH_SUFFIX);this.errorEl=c.getElementById(this.id+b.ERROR_SUFFIX);
this.submitEl=c.getElementById(this.id+b.SUBMIT_SUFFIX);this.cancelEl=c.getElementById(this.id+b.CANCEL_SUFFIX);if(YAHOO.env.ua.gecko&&this.yearEl&&this.yearEl.type=="text"){this.yearEl.setAttribute("autocomplete","off")}this._setFirstLastElements()},createMask:function(){var b=YAHOO.widget.CalendarNavigator.CLASSES;var a=this._doc.createElement("div");a.className=b.MASK;this.cal.oDomContainer.appendChild(a);this.maskEl=a},_syncMask:function(){var b=this.cal.oDomContainer;if(b&&this.maskEl){var a=YAHOO.util.Dom.getRegion(b);YAHOO.util.Dom.setStyle(this.maskEl,"width",a.right-a.left+"px");YAHOO.util.Dom.setStyle(this.maskEl,"height",a.bottom-a.top+"px")}},renderNavContents:function(a){var c=YAHOO.widget.CalendarNavigator,d=c.CLASSES,b=a;b[b.length]='<div class="'+d.MONTH+'">';this.renderMonth(b);b[b.length]="</div>";b[b.length]='<div class="'+d.YEAR+'">';this.renderYear(b);b[b.length]="</div>";b[b.length]='<div class="'+d.BUTTONS+'">';this.renderButtons(b);b[b.length]="</div>";b[b.length]='<div class="'+d.ERROR+'" id="'+this.id+c.ERROR_SUFFIX+'"></div>';
return b},renderMonth:function(c){var f=YAHOO.widget.CalendarNavigator,g=f.CLASSES;var j=this.id+f.MONTH_SUFFIX,e=this.__getCfg("monthFormat"),a=this.cal.cfg.getProperty((e==YAHOO.widget.Calendar.SHORT)?"MONTHS_SHORT":"MONTHS_LONG"),d=c;if(a&&a.length>0){d[d.length]='<label for="'+j+'">';d[d.length]=this.__getCfg("month",true);d[d.length]="</label>";d[d.length]='<select name="'+j+'" id="'+j+'" class="'+g.MONTH_CTRL+'">';for(var b=0;b<a.length;b++){d[d.length]='<option value="'+b+'">';d[d.length]=a[b];d[d.length]="</option>"}d[d.length]="</select>"}return d},renderYear:function(b){var d=YAHOO.widget.CalendarNavigator,e=d.CLASSES;var f=this.id+d.YEAR_SUFFIX,a=d.YR_MAX_DIGITS,c=b;c[c.length]='<label for="'+f+'">';c[c.length]=this.__getCfg("year",true);c[c.length]="</label>";c[c.length]='<input type="text" name="'+f+'" id="'+f+'" class="'+e.YEAR_CTRL+'" maxlength="'+a+'"/>';return c},renderButtons:function(a){var c=YAHOO.widget.CalendarNavigator.CLASSES;var b=a;b[b.length]='<span class="'+c.BUTTON+" "+c.DEFAULT+'">';
b[b.length]='<button type="button" id="'+this.id+'_submit">';b[b.length]=this.__getCfg("submit",true);b[b.length]="</button>";b[b.length]="</span>";b[b.length]='<span class="'+c.BUTTON+'">';b[b.length]='<button type="button" id="'+this.id+'_cancel">';b[b.length]=this.__getCfg("cancel",true);b[b.length]="</button>";b[b.length]="</span>";return b},applyListeners:function(){var b=YAHOO.util.Event;function a(){if(this.validate()){this.setYear(this._getYearFromUI())}}function c(){this.setMonth(this._getMonthFromUI())}b.on(this.submitEl,"click",this.submit,this,true);b.on(this.cancelEl,"click",this.cancel,this,true);b.on(this.yearEl,"blur",a,this,true);b.on(this.monthEl,"change",c,this,true);if(this.__isIEQuirks){YAHOO.util.Event.on(this.cal.oDomContainer,"resize",this._syncMask,this,true)}this.applyKeyListeners()},purgeListeners:function(){var a=YAHOO.util.Event;a.removeListener(this.submitEl,"click",this.submit);a.removeListener(this.cancelEl,"click",this.cancel);a.removeListener(this.yearEl,"blur");
a.removeListener(this.monthEl,"change");if(this.__isIEQuirks){a.removeListener(this.cal.oDomContainer,"resize",this._syncMask)}this.purgeKeyListeners()},applyKeyListeners:function(){var d=YAHOO.util.Event,a=YAHOO.env.ua;var c=(a.ie||a.webkit)?"keydown":"keypress";var b=(a.ie||a.opera||a.webkit)?"keydown":"keypress";d.on(this.yearEl,"keypress",this._handleEnterKey,this,true);d.on(this.yearEl,c,this._handleDirectionKeys,this,true);d.on(this.lastCtrl,b,this._handleTabKey,this,true);d.on(this.firstCtrl,b,this._handleShiftTabKey,this,true)},purgeKeyListeners:function(){var d=YAHOO.util.Event,a=YAHOO.env.ua;var c=(a.ie||a.webkit)?"keydown":"keypress";var b=(a.ie||a.opera||a.webkit)?"keydown":"keypress";d.removeListener(this.yearEl,"keypress",this._handleEnterKey);d.removeListener(this.yearEl,c,this._handleDirectionKeys);d.removeListener(this.lastCtrl,b,this._handleTabKey);d.removeListener(this.firstCtrl,b,this._handleShiftTabKey)},submit:function(){if(this.validate()){this.hide();this.setMonth(this._getMonthFromUI());
this.setYear(this._getYearFromUI());var b=this.cal;var a=YAHOO.widget.CalendarNavigator.UPDATE_DELAY;if(a>0){var c=this;window.setTimeout(function(){c._update(b)},a)}else{this._update(b)}}},_update:function(a){a.setYear(this.getYear());a.setMonth(this.getMonth());a.render()},cancel:function(){this.hide()},validate:function(){if(this._getYearFromUI()!==null){this.clearErrors();return true}else{this.setYearError();this.setError(this.__getCfg("invalidYear",true));return false}},setError:function(a){if(this.errorEl){this.errorEl.innerHTML=a;this._show(this.errorEl,true)}},clearError:function(){if(this.errorEl){this.errorEl.innerHTML="";this._show(this.errorEl,false)}},setYearError:function(){YAHOO.util.Dom.addClass(this.yearEl,YAHOO.widget.CalendarNavigator.CLASSES.INVALID)},clearYearError:function(){YAHOO.util.Dom.removeClass(this.yearEl,YAHOO.widget.CalendarNavigator.CLASSES.INVALID)},clearErrors:function(){this.clearError();this.clearYearError()},setInitialFocus:function(){var a=this.submitEl,c=this.__getCfg("initialFocus");
if(c&&c.toLowerCase){c=c.toLowerCase();if(c=="year"){a=this.yearEl;try{this.yearEl.select()}catch(b){}}else{if(c=="month"){a=this.monthEl}}}if(a&&YAHOO.lang.isFunction(a.focus)){try{a.focus()}catch(d){}}},erase:function(){if(this.__rendered){this.purgeListeners();this.yearEl=null;this.monthEl=null;this.errorEl=null;this.submitEl=null;this.cancelEl=null;this.firstCtrl=null;this.lastCtrl=null;if(this.navEl){this.navEl.innerHTML=""}var b=this.navEl.parentNode;if(b){b.removeChild(this.navEl)}this.navEl=null;var a=this.maskEl.parentNode;if(a){a.removeChild(this.maskEl)}this.maskEl=null;this.__rendered=false}},destroy:function(){this.erase();this._doc=null;this.cal=null;this.id=null},_show:function(b,a){if(b){YAHOO.util.Dom.setStyle(b,"display",(a)?"block":"none")}},_getMonthFromUI:function(){if(this.monthEl){return this.monthEl.selectedIndex}else{return 0}},_getYearFromUI:function(){var b=YAHOO.widget.CalendarNavigator;var a=null;if(this.yearEl){var c=this.yearEl.value;c=c.replace(b.TRIM,"$1");
if(b.YR_PATTERN.test(c)){a=parseInt(c,10)}}return a},_updateYearUI:function(){if(this.yearEl&&this._year!==null){this.yearEl.value=this._year}},_updateMonthUI:function(){if(this.monthEl){this.monthEl.selectedIndex=this._month}},_setFirstLastElements:function(){this.firstCtrl=this.monthEl;this.lastCtrl=this.cancelEl;if(this.__isMac){if(YAHOO.env.ua.webkit&&YAHOO.env.ua.webkit<420){this.firstCtrl=this.monthEl;this.lastCtrl=this.yearEl}if(YAHOO.env.ua.gecko){this.firstCtrl=this.yearEl;this.lastCtrl=this.yearEl}}},_handleEnterKey:function(b){var a=YAHOO.util.KeyListener.KEY;if(YAHOO.util.Event.getCharCode(b)==a.ENTER){YAHOO.util.Event.preventDefault(b);this.submit()}},_handleDirectionKeys:function(h){var g=YAHOO.util.Event,a=YAHOO.util.KeyListener.KEY,d=YAHOO.widget.CalendarNavigator;var f=(this.yearEl.value)?parseInt(this.yearEl.value,10):null;if(isFinite(f)){var b=false;switch(g.getCharCode(h)){case a.UP:this.yearEl.value=f+d.YR_MINOR_INC;b=true;break;case a.DOWN:this.yearEl.value=Math.max(f-d.YR_MINOR_INC,0);
b=true;break;case a.PAGE_UP:this.yearEl.value=f+d.YR_MAJOR_INC;b=true;break;case a.PAGE_DOWN:this.yearEl.value=Math.max(f-d.YR_MAJOR_INC,0);b=true;break;default:break}if(b){g.preventDefault(h);try{this.yearEl.select()}catch(c){}}}},_handleTabKey:function(d){var c=YAHOO.util.Event,a=YAHOO.util.KeyListener.KEY;if(c.getCharCode(d)==a.TAB&&!d.shiftKey){try{c.preventDefault(d);this.firstCtrl.focus()}catch(b){}}},_handleShiftTabKey:function(d){var c=YAHOO.util.Event,a=YAHOO.util.KeyListener.KEY;if(d.shiftKey&&c.getCharCode(d)==a.TAB){try{c.preventDefault(d);this.lastCtrl.focus()}catch(b){}}},__getCfg:function(d,b){var c=YAHOO.widget.CalendarNavigator._DEFAULT_CFG;var a=this.cal.cfg.getProperty("navigator");if(b){return(a!==true&&a.strings&&a.strings[d])?a.strings[d]:c.strings[d]}else{return(a!==true&&a[d])?a[d]:c[d]}},__isMac:(navigator.userAgent.toLowerCase().indexOf("macintosh")!=-1)};YAHOO.register("calendar",YAHOO.widget.Calendar,{version:"2.7.0",build:"1799"});(function(){var d=YAHOO.util.Dom,b=YAHOO.util.Event,f=YAHOO.lang,e=YAHOO.widget;
YAHOO.widget.TreeView=function(h,g){if(h){this.init(h)}if(g){if(!f.isArray(g)){g=[g]}this.buildTreeFromObject(g)}else{if(f.trim(this._el.innerHTML)){this.buildTreeFromMarkup(h)}}};var c=e.TreeView;c.prototype={id:null,_el:null,_nodes:null,locked:false,_expandAnim:null,_collapseAnim:null,_animCount:0,maxAnim:2,_hasDblClickSubscriber:false,_dblClickTimer:null,currentFocus:null,singleNodeHighlight:false,_currentlyHighlighted:null,setExpandAnim:function(g){this._expandAnim=(e.TVAnim.isValid(g))?g:null},setCollapseAnim:function(g){this._collapseAnim=(e.TVAnim.isValid(g))?g:null},animateExpand:function(i,j){if(this._expandAnim&&this._animCount<this.maxAnim){var g=this;var h=e.TVAnim.getAnim(this._expandAnim,i,function(){g.expandComplete(j)});if(h){++this._animCount;this.fireEvent("animStart",{node:j,type:"expand"});h.animate()}return true}return false},animateCollapse:function(i,j){if(this._collapseAnim&&this._animCount<this.maxAnim){var g=this;var h=e.TVAnim.getAnim(this._collapseAnim,i,function(){g.collapseComplete(j)
});if(h){++this._animCount;this.fireEvent("animStart",{node:j,type:"collapse"});h.animate()}return true}return false},expandComplete:function(g){--this._animCount;this.fireEvent("animComplete",{node:g,type:"expand"})},collapseComplete:function(g){--this._animCount;this.fireEvent("animComplete",{node:g,type:"collapse"})},init:function(i){this._el=d.get(i);this.id=d.generateId(this._el,"yui-tv-auto-id-");this.createEvent("animStart",this);this.createEvent("animComplete",this);this.createEvent("collapse",this);this.createEvent("collapseComplete",this);this.createEvent("expand",this);this.createEvent("expandComplete",this);this.createEvent("enterKeyPressed",this);this.createEvent("clickEvent",this);this.createEvent("focusChanged",this);var g=this;this.createEvent("dblClickEvent",{scope:this,onSubscribeCallback:function(){g._hasDblClickSubscriber=true}});this.createEvent("labelClick",this);this.createEvent("highlightEvent",this);this._nodes=[];c.trees[this.id]=this;this.root=new e.RootNode(this);
var h=e.LogWriter},buildTreeFromObject:function(g){var h=function(q,n){var m,r,l,k,p,j,o;for(m=0;m<n.length;m++){r=n[m];if(f.isString(r)){l=new e.TextNode(r,q)}else{if(f.isObject(r)){k=r.children;delete r.children;p=r.type||"text";delete r.type;switch(f.isString(p)&&p.toLowerCase()){case"text":l=new e.TextNode(r,q);break;case"menu":l=new e.MenuNode(r,q);break;case"html":l=new e.HTMLNode(r,q);break;default:if(f.isString(p)){j=e[p]}else{j=p}if(f.isObject(j)){for(o=j;o&&o!==e.Node;o=o.superclass.constructor){}if(o){l=new j(r,q)}else{}}else{}}if(k){h(l,k)}}else{}}}};h(this.root,g)},buildTreeFromMarkup:function(i){var h=function(j){var n,q,m=[],l={},k,o;for(n=d.getFirstChild(j);n;n=d.getNextSibling(n)){switch(n.tagName.toUpperCase()){case"LI":k="";l={expanded:d.hasClass(n,"expanded"),title:n.title||n.alt||null,className:f.trim(n.className.replace(/\bexpanded\b/,""))||null};q=n.firstChild;if(q.nodeType==3){k=f.trim(q.nodeValue.replace(/[\n\t\r]*/g,""));if(k){l.type="text";l.label=k}else{q=d.getNextSibling(q)
}}if(!k){if(q.tagName.toUpperCase()=="A"){l.type="text";l.label=q.innerHTML;l.href=q.href;l.target=q.target;l.title=q.title||q.alt||l.title}else{l.type="html";var p=document.createElement("div");p.appendChild(q.cloneNode(true));l.html=p.innerHTML;l.hasIcon=true}}q=d.getNextSibling(q);switch(q&&q.tagName.toUpperCase()){case"UL":case"OL":l.children=h(q);break}if(YAHOO.lang.JSON){o=n.getAttribute("yuiConfig");if(o){o=YAHOO.lang.JSON.parse(o);l=YAHOO.lang.merge(l,o)}}m.push(l);break;case"UL":case"OL":l={type:"text",label:"",children:h(q)};m.push(l);break}}return m};var g=d.getChildrenBy(d.get(i),function(k){var j=k.tagName.toUpperCase();return j=="UL"||j=="OL"});if(g.length){this.buildTreeFromObject(h(g[0]))}else{}},_getEventTargetTdEl:function(h){var i=b.getTarget(h);while(i&&!(i.tagName.toUpperCase()=="TD"&&d.hasClass(i.parentNode,"ygtvrow"))){i=d.getAncestorByTagName(i,"td")}if(f.isNull(i)){return null}if(/\bygtv(blank)?depthcell/.test(i.className)){return null}if(i.id){var g=i.id.match(/\bygtv([^\d]*)(.*)/);
if(g&&g[2]&&this._nodes[g[2]]){return i}}return null},_onClickEvent:function(j){var h=this,l=this._getEventTargetTdEl(j),i,k,g=function(){i.toggle();i.focus();try{b.preventDefault(j)}catch(m){}};if(!l){return}i=this.getNodeByElement(l);if(!i){return}k=b.getTarget(j);if(d.hasClass(k,i.labelStyle)||d.getAncestorByClassName(k,i.labelStyle)){this.fireEvent("labelClick",i)}if(/\bygtv[tl][mp]h?h?/.test(l.className)){g()}else{if(this._dblClickTimer){window.clearTimeout(this._dblClickTimer);this._dblClickTimer=null}else{if(this._hasDblClickSubscriber){this._dblClickTimer=window.setTimeout(function(){h._dblClickTimer=null;if(h.fireEvent("clickEvent",{event:j,node:i})!==false){g()}},200)}else{if(h.fireEvent("clickEvent",{event:j,node:i})!==false){g()}}}}},_onDblClickEvent:function(g){if(!this._hasDblClickSubscriber){return}var h=this._getEventTargetTdEl(g);if(!h){return}if(!(/\bygtv[tl][mp]h?h?/.test(h.className))){this.fireEvent("dblClickEvent",{event:g,node:this.getNodeByElement(h)});if(this._dblClickTimer){window.clearTimeout(this._dblClickTimer);
this._dblClickTimer=null}}},_onMouseOverEvent:function(g){var h;if((h=this._getEventTargetTdEl(g))&&(h=this.getNodeByElement(h))&&(h=h.getToggleEl())){h.className=h.className.replace(/\bygtv([lt])([mp])\b/gi,"ygtv$1$2h")}},_onMouseOutEvent:function(g){var h;if((h=this._getEventTargetTdEl(g))&&(h=this.getNodeByElement(h))&&(h=h.getToggleEl())){h.className=h.className.replace(/\bygtv([lt])([mp])h\b/gi,"ygtv$1$2")}},_onKeyDownEvent:function(j){var k=b.getTarget(j),i=this.getNodeByElement(k),h=i,g=YAHOO.util.KeyListener.KEY;switch(j.keyCode){case g.UP:do{if(h.previousSibling){h=h.previousSibling}else{h=h.parent}}while(h&&!h._canHaveFocus());if(h){h.focus()}b.preventDefault(j);break;case g.DOWN:do{if(h.nextSibling){h=h.nextSibling}else{h.expand();h=(h.children.length||null)&&h.children[0]}}while(h&&!h._canHaveFocus);if(h){h.focus()}b.preventDefault(j);break;case g.LEFT:do{if(h.parent){h=h.parent}else{h=h.previousSibling}}while(h&&!h._canHaveFocus());if(h){h.focus()}b.preventDefault(j);break;
case g.RIGHT:do{h.expand();if(h.children.length){h=h.children[0]}else{h=h.nextSibling}}while(h&&!h._canHaveFocus());if(h){h.focus()}b.preventDefault(j);break;case g.ENTER:if(i.href){if(i.target){window.open(i.href,i.target)}else{window.location(i.href)}}else{i.toggle()}this.fireEvent("enterKeyPressed",i);b.preventDefault(j);break;case g.HOME:h=this.getRoot();if(h.children.length){h=h.children[0]}if(h._canHaveFocus()){h.focus()}b.preventDefault(j);break;case g.END:h=h.parent.children;h=h[h.length-1];if(h._canHaveFocus()){h.focus()}b.preventDefault(j);break;case 107:if(j.shiftKey){i.parent.expandAll()}else{i.expand()}break;case 109:if(j.shiftKey){i.parent.collapseAll()}else{i.collapse()}break;default:break}},render:function(){var g=this.root.getHtml(),h=this.getEl();h.innerHTML=g;if(!this._hasEvents){b.on(h,"click",this._onClickEvent,this,true);b.on(h,"dblclick",this._onDblClickEvent,this,true);b.on(h,"mouseover",this._onMouseOverEvent,this,true);b.on(h,"mouseout",this._onMouseOutEvent,this,true);
b.on(h,"keydown",this._onKeyDownEvent,this,true)}this._hasEvents=true},getEl:function(){if(!this._el){this._el=d.get(this.id)}return this._el},regNode:function(g){this._nodes[g.index]=g},getRoot:function(){return this.root},setDynamicLoad:function(g,h){this.root.setDynamicLoad(g,h)},expandAll:function(){if(!this.locked){this.root.expandAll()}},collapseAll:function(){if(!this.locked){this.root.collapseAll()}},getNodeByIndex:function(h){var g=this._nodes[h];return(g)?g:null},getNodeByProperty:function(j,h){for(var g in this._nodes){if(this._nodes.hasOwnProperty(g)){var k=this._nodes[g];if((j in k&&k[j]==h)||(k.data&&h==k.data[j])){return k}}}return null},getNodesByProperty:function(k,j){var g=[];for(var h in this._nodes){if(this._nodes.hasOwnProperty(h)){var l=this._nodes[h];if((k in l&&l[k]==j)||(l.data&&j==l.data[k])){g.push(l)}}}return(g.length)?g:null},getNodeByElement:function(i){var j=i,g,h=/ygtv([^\d]*)(.*)/;do{if(j&&j.id){g=j.id.match(h);if(g&&g[2]){return this.getNodeByIndex(g[2])
}}j=j.parentNode;if(!j||!j.tagName){break}}while(j.id!==this.id&&j.tagName.toLowerCase()!=="body");return null},removeNode:function(h,g){if(h.isRoot()){return false}var i=h.parent;if(i.parent){i=i.parent}this._deleteNode(h);if(g&&i&&i.childrenRendered){i.refresh()}return true},_removeChildren_animComplete:function(g){this.unsubscribe(this._removeChildren_animComplete);this.removeChildren(g.node)},removeChildren:function(g){if(g.expanded){if(this._collapseAnim){this.subscribe("animComplete",this._removeChildren_animComplete,this,true);e.Node.prototype.collapse.call(g);return}g.collapse()}while(g.children.length){this._deleteNode(g.children[0])}if(g.isRoot()){e.Node.prototype.expand.call(g)}g.childrenRendered=false;g.dynamicLoadComplete=false;g.updateIcon()},_deleteNode:function(g){this.removeChildren(g);this.popNode(g)},popNode:function(k){var l=k.parent;var h=[];for(var j=0,g=l.children.length;j<g;++j){if(l.children[j]!=k){h[h.length]=l.children[j]}}l.children=h;l.childrenRendered=false;
if(k.previousSibling){k.previousSibling.nextSibling=k.nextSibling}if(k.nextSibling){k.nextSibling.previousSibling=k.previousSibling}k.parent=null;k.previousSibling=null;k.nextSibling=null;k.tree=null;delete this._nodes[k.index]},destroy:function(){if(this._destroyEditor){this._destroyEditor()}var h=this.getEl();b.removeListener(h,"click");b.removeListener(h,"dblclick");b.removeListener(h,"mouseover");b.removeListener(h,"mouseout");b.removeListener(h,"keydown");for(var g=0;g<this._nodes.length;g++){var j=this._nodes[g];if(j&&j.destroy){j.destroy()}}h.innerHTML="";this._hasEvents=false},toString:function(){return"TreeView "+this.id},getNodeCount:function(){return this.getRoot().getNodeCount()},getTreeDefinition:function(){return this.getRoot().getNodeDefinition()},onExpand:function(g){},onCollapse:function(g){},setNodesProperty:function(g,i,h){this.root.setNodesProperty(g,i);if(h){this.root.refresh()}},onEventToggleHighlight:function(h){var g;if("node" in h&&h.node instanceof e.Node){g=h.node
}else{if(h instanceof e.Node){g=h}else{return false}}g.toggleHighlight();return false}};var a=c.prototype;a.draw=a.render;YAHOO.augment(c,YAHOO.util.EventProvider);c.nodeCount=0;c.trees=[];c.getTree=function(h){var g=c.trees[h];return(g)?g:null};c.getNode=function(h,i){var g=c.getTree(h);return(g)?g.getNodeByIndex(i):null};c.FOCUS_CLASS_NAME="ygtvfocus";c.preload=function(m,l){l=l||"ygtv";var j=["tn","tm","tmh","tp","tph","ln","lm","lmh","lp","lph","loading"];var n=[];for(var g=1;g<j.length;g=g+1){n[n.length]='<span class="'+l+j[g]+'">&#160;</span>'}var k=document.createElement("div");var h=k.style;h.className=l+j[0];h.position="absolute";h.height="1px";h.width="1px";h.top="-1000px";h.left="-1000px";k.innerHTML=n.join("");document.body.appendChild(k);b.removeListener(window,"load",c.preload)};b.addListener(window,"load",c.preload)})();(function(){var b=YAHOO.util.Dom,c=YAHOO.lang,a=YAHOO.util.Event;YAHOO.widget.Node=function(f,e,d){if(f){this.init(f,e,d)}};YAHOO.widget.Node.prototype={index:0,children:null,tree:null,data:null,parent:null,depth:-1,expanded:false,multiExpand:true,renderHidden:false,childrenRendered:false,dynamicLoadComplete:false,previousSibling:null,nextSibling:null,_dynLoad:false,dataLoader:null,isLoading:false,hasIcon:true,iconMode:0,nowrap:false,isLeaf:false,contentStyle:"",contentElId:null,enableHighlight:true,highlightState:0,propagateHighlightUp:false,propagateHighlightDown:false,className:null,_type:"Node",init:function(g,f,d){this.data={};
this.children=[];this.index=YAHOO.widget.TreeView.nodeCount;++YAHOO.widget.TreeView.nodeCount;this.contentElId="ygtvcontentel"+this.index;if(c.isObject(g)){for(var e in g){if(g.hasOwnProperty(e)){if(e.charAt(0)!="_"&&!c.isUndefined(this[e])&&!c.isFunction(this[e])){this[e]=g[e]}else{this.data[e]=g[e]}}}}if(!c.isUndefined(d)){this.expanded=d}this.createEvent("parentChange",this);if(f){f.appendChild(this)}},applyParent:function(e){if(!e){return false}this.tree=e.tree;this.parent=e;this.depth=e.depth+1;this.tree.regNode(this);e.childrenRendered=false;for(var f=0,d=this.children.length;f<d;++f){this.children[f].applyParent(this)}this.fireEvent("parentChange");return true},appendChild:function(e){if(this.hasChildren()){var d=this.children[this.children.length-1];d.nextSibling=e;e.previousSibling=d}this.children[this.children.length]=e;e.applyParent(this);if(this.childrenRendered&&this.expanded){this.getChildrenEl().style.display=""}return e},appendTo:function(d){return d.appendChild(this)},insertBefore:function(d){var f=d.parent;
if(f){if(this.tree){this.tree.popNode(this)}var e=d.isChildOf(f);f.children.splice(e,0,this);if(d.previousSibling){d.previousSibling.nextSibling=this}this.previousSibling=d.previousSibling;this.nextSibling=d;d.previousSibling=this;this.applyParent(f)}return this},insertAfter:function(d){var f=d.parent;if(f){if(this.tree){this.tree.popNode(this)}var e=d.isChildOf(f);if(!d.nextSibling){this.nextSibling=null;return this.appendTo(f)}f.children.splice(e+1,0,this);d.nextSibling.previousSibling=this;this.previousSibling=d;this.nextSibling=d.nextSibling;d.nextSibling=this;this.applyParent(f)}return this},isChildOf:function(e){if(e&&e.children){for(var f=0,d=e.children.length;f<d;++f){if(e.children[f]===this){return f}}}return -1},getSiblings:function(){var d=this.parent.children.slice(0);for(var e=0;e<d.length&&d[e]!=this;e++){}d.splice(e,1);if(d.length){return d}return null},showChildren:function(){if(!this.tree.animateExpand(this.getChildrenEl(),this)){if(this.hasChildren()){this.getChildrenEl().style.display=""
}}},hideChildren:function(){if(!this.tree.animateCollapse(this.getChildrenEl(),this)){this.getChildrenEl().style.display="none"}},getElId:function(){return"ygtv"+this.index},getChildrenElId:function(){return"ygtvc"+this.index},getToggleElId:function(){return"ygtvt"+this.index},getEl:function(){return b.get(this.getElId())},getChildrenEl:function(){return b.get(this.getChildrenElId())},getToggleEl:function(){return b.get(this.getToggleElId())},getContentEl:function(){return b.get(this.contentElId)},collapse:function(){if(!this.expanded){return}var d=this.tree.onCollapse(this);if(false===d){return}d=this.tree.fireEvent("collapse",this);if(false===d){return}if(!this.getEl()){this.expanded=false}else{this.hideChildren();this.expanded=false;this.updateIcon()}d=this.tree.fireEvent("collapseComplete",this)},expand:function(f){if(this.expanded&&!f){return}var d=true;if(!f){d=this.tree.onExpand(this);if(false===d){return}d=this.tree.fireEvent("expand",this)}if(false===d){return}if(!this.getEl()){this.expanded=true;
return}if(!this.childrenRendered){this.getChildrenEl().innerHTML=this.renderChildren()}else{}this.expanded=true;this.updateIcon();if(this.isLoading){this.expanded=false;return}if(!this.multiExpand){var g=this.getSiblings();for(var e=0;g&&e<g.length;++e){if(g[e]!=this&&g[e].expanded){g[e].collapse()}}}this.showChildren();d=this.tree.fireEvent("expandComplete",this)},updateIcon:function(){if(this.hasIcon){var d=this.getToggleEl();if(d){d.className=d.className.replace(/\bygtv(([tl][pmn]h?)|(loading))\b/gi,this.getStyle())}}},getStyle:function(){if(this.isLoading){return"ygtvloading"}else{var e=(this.nextSibling)?"t":"l";var d="n";if(this.hasChildren(true)||(this.isDynamic()&&!this.getIconMode())){d=(this.expanded)?"m":"p"}return"ygtv"+e+d}},getHoverStyle:function(){var d=this.getStyle();if(this.hasChildren(true)&&!this.isLoading){d+="h"}return d},expandAll:function(){var d=this.children.length;for(var e=0;e<d;++e){var f=this.children[e];if(f.isDynamic()){break}else{if(!f.multiExpand){break
}else{f.expand();f.expandAll()}}}},collapseAll:function(){for(var d=0;d<this.children.length;++d){this.children[d].collapse();this.children[d].collapseAll()}},setDynamicLoad:function(d,e){if(d){this.dataLoader=d;this._dynLoad=true}else{this.dataLoader=null;this._dynLoad=false}if(e){this.iconMode=e}},isRoot:function(){return(this==this.tree.root)},isDynamic:function(){if(this.isLeaf){return false}else{return(!this.isRoot()&&(this._dynLoad||this.tree.root._dynLoad))}},getIconMode:function(){return(this.iconMode||this.tree.root.iconMode)},hasChildren:function(d){if(this.isLeaf){return false}else{return(this.children.length>0||(d&&this.isDynamic()&&!this.dynamicLoadComplete))}},toggle:function(){if(!this.tree.locked&&(this.hasChildren(true)||this.isDynamic())){if(this.expanded){this.collapse()}else{this.expand()}}},getHtml:function(){this.childrenRendered=false;return['<div class="ygtvitem" id="',this.getElId(),'">',this.getNodeHtml(),this.getChildrenHtml(),"</div>"].join("")},getChildrenHtml:function(){var d=[];
d[d.length]='<div class="ygtvchildren" id="'+this.getChildrenElId()+'"';if(!this.expanded||!this.hasChildren()){d[d.length]=' style="display:none;"'}d[d.length]=">";if((this.hasChildren(true)&&this.expanded)||(this.renderHidden&&!this.isDynamic())){d[d.length]=this.renderChildren()}d[d.length]="</div>";return d.join("")},renderChildren:function(){var d=this;if(this.isDynamic()&&!this.dynamicLoadComplete){this.isLoading=true;this.tree.locked=true;if(this.dataLoader){setTimeout(function(){d.dataLoader(d,function(){d.loadComplete()})},10)}else{if(this.tree.root.dataLoader){setTimeout(function(){d.tree.root.dataLoader(d,function(){d.loadComplete()})},10)}else{return"Error: data loader not found or not specified."}}return""}else{return this.completeRender()}},completeRender:function(){var e=[];for(var d=0;d<this.children.length;++d){e[e.length]=this.children[d].getHtml()}this.childrenRendered=true;return e.join("")},loadComplete:function(){this.getChildrenEl().innerHTML=this.completeRender();
this.dynamicLoadComplete=true;this.isLoading=false;this.expand(true);this.tree.locked=false},getAncestor:function(e){if(e>=this.depth||e<0){return null}var d=this.parent;while(d.depth>e){d=d.parent}return d},getDepthStyle:function(d){return(this.getAncestor(d).nextSibling)?"ygtvdepthcell":"ygtvblankdepthcell"},getNodeHtml:function(){var e=[];e[e.length]='<table id="ygtvtableel'+this.index+'"border="0" cellpadding="0" cellspacing="0" class="ygtvtable ygtvdepth'+this.depth;if(this.enableHighlight){e[e.length]=" ygtv-highlight"+this.highlightState}if(this.className){e[e.length]=" "+this.className}e[e.length]='"><tr class="ygtvrow">';for(var d=0;d<this.depth;++d){e[e.length]='<td class="ygtvcell '+this.getDepthStyle(d)+'"><div class="ygtvspacer"></div></td>'}if(this.hasIcon){e[e.length]='<td id="'+this.getToggleElId();e[e.length]='" class="ygtvcell ';e[e.length]=this.getStyle();e[e.length]='"><a href="#" class="ygtvspacer">&nbsp;</a></td>'}e[e.length]='<td id="'+this.contentElId;e[e.length]='" class="ygtvcell ';
e[e.length]=this.contentStyle+' ygtvcontent" ';e[e.length]=(this.nowrap)?' nowrap="nowrap" ':"";e[e.length]=" >";e[e.length]=this.getContentHtml();e[e.length]="</td></tr></table>";return e.join("")},getContentHtml:function(){return""},refresh:function(){this.getChildrenEl().innerHTML=this.completeRender();if(this.hasIcon){var d=this.getToggleEl();if(d){d.className=d.className.replace(/\bygtv[lt][nmp]h*\b/gi,this.getStyle())}}},toString:function(){return this._type+" ("+this.index+")"},_focusHighlightedItems:[],_focusedItem:null,_canHaveFocus:function(){return this.getEl().getElementsByTagName("a").length>0},_removeFocus:function(){if(this._focusedItem){a.removeListener(this._focusedItem,"blur");this._focusedItem=null}var d;while((d=this._focusHighlightedItems.shift())){b.removeClass(d,YAHOO.widget.TreeView.FOCUS_CLASS_NAME)}},focus:function(){var f=false,d=this;if(this.tree.currentFocus){this.tree.currentFocus._removeFocus()}var e=function(g){if(g.parent){e(g.parent);g.parent.expand()}};
e(this);b.getElementsBy(function(g){return/ygtv(([tl][pmn]h?)|(content))/.test(g.className)},"td",d.getEl().firstChild,function(h){b.addClass(h,YAHOO.widget.TreeView.FOCUS_CLASS_NAME);if(!f){var g=h.getElementsByTagName("a");if(g.length){g=g[0];g.focus();d._focusedItem=g;a.on(g,"blur",function(){d.tree.fireEvent("focusChanged",{oldNode:d.tree.currentFocus,newNode:null});d.tree.currentFocus=null;d._removeFocus()});f=true}}d._focusHighlightedItems.push(h)});if(f){this.tree.fireEvent("focusChanged",{oldNode:this.tree.currentFocus,newNode:this});this.tree.currentFocus=this}else{this.tree.fireEvent("focusChanged",{oldNode:d.tree.currentFocus,newNode:null});this.tree.currentFocus=null;this._removeFocus()}return f},getNodeCount:function(){for(var d=0,e=0;d<this.children.length;d++){e+=this.children[d].getNodeCount()}return e+1},getNodeDefinition:function(){if(this.isDynamic()){return false}var g,d=c.merge(this.data),f=[];if(this.expanded){d.expanded=this.expanded}if(!this.multiExpand){d.multiExpand=this.multiExpand
}if(!this.renderHidden){d.renderHidden=this.renderHidden}if(!this.hasIcon){d.hasIcon=this.hasIcon}if(this.nowrap){d.nowrap=this.nowrap}if(this.className){d.className=this.className}if(this.editable){d.editable=this.editable}if(this.enableHighlight){d.enableHighlight=this.enableHighlight}if(this.highlightState){d.highlightState=this.highlightState}if(this.propagateHighlightUp){d.propagateHighlightUp=this.propagateHighlightUp}if(this.propagateHighlightDown){d.propagateHighlightDown=this.propagateHighlightDown}d.type=this._type;for(var e=0;e<this.children.length;e++){g=this.children[e].getNodeDefinition();if(g===false){return false}f.push(g)}if(f.length){d.children=f}return d},getToggleLink:function(){return"return false;"},setNodesProperty:function(d,g,f){if(d.charAt(0)!="_"&&!c.isUndefined(this[d])&&!c.isFunction(this[d])){this[d]=g}else{this.data[d]=g}for(var e=0;e<this.children.length;e++){this.children[e].setNodesProperty(d,g)}if(f){this.refresh()}},toggleHighlight:function(){if(this.enableHighlight){if(this.highlightState==1){this.unhighlight()
}else{this.highlight()}}},highlight:function(e){if(this.enableHighlight){if(this.tree.singleNodeHighlight){if(this.tree._currentlyHighlighted){this.tree._currentlyHighlighted.unhighlight()}this.tree._currentlyHighlighted=this}this.highlightState=1;this._setHighlightClassName();if(this.propagateHighlightDown){for(var d=0;d<this.children.length;d++){this.children[d].highlight(true)}}if(this.propagateHighlightUp){if(this.parent){this.parent._childrenHighlighted()}}if(!e){this.tree.fireEvent("highlightEvent",this)}}},unhighlight:function(e){if(this.enableHighlight){this.highlightState=0;this._setHighlightClassName();if(this.propagateHighlightDown){for(var d=0;d<this.children.length;d++){this.children[d].unhighlight(true)}}if(this.propagateHighlightUp){if(this.parent){this.parent._childrenHighlighted()}}if(!e){this.tree.fireEvent("highlightEvent",this)}}},_childrenHighlighted:function(){var f=false,e=false;if(this.enableHighlight){for(var d=0;d<this.children.length;d++){switch(this.children[d].highlightState){case 0:e=true;
break;case 1:f=true;break;case 2:f=e=true;break}}if(f&&e){this.highlightState=2}else{if(f){this.highlightState=1}else{this.highlightState=0}}this._setHighlightClassName();if(this.propagateHighlightUp){if(this.parent){this.parent._childrenHighlighted()}}}},_setHighlightClassName:function(){var d=b.get("ygtvtableel"+this.index);if(d){d.className=d.className.replace(/\bygtv-highlight\d\b/gi,"ygtv-highlight"+this.highlightState)}}};YAHOO.augment(YAHOO.widget.Node,YAHOO.util.EventProvider)})();YAHOO.widget.RootNode=function(a){this.init(null,null,true);this.tree=a};YAHOO.extend(YAHOO.widget.RootNode,YAHOO.widget.Node,{_type:"RootNode",getNodeHtml:function(){return""},toString:function(){return this._type},loadComplete:function(){this.tree.draw()},getNodeCount:function(){for(var a=0,b=0;a<this.children.length;a++){b+=this.children[a].getNodeCount()}return b},getNodeDefinition:function(){for(var c,a=[],b=0;b<this.children.length;b++){c=this.children[b].getNodeDefinition();if(c===false){return false
}a.push(c)}return a},collapse:function(){},expand:function(){},getSiblings:function(){return null},focus:function(){}});(function(){var b=YAHOO.util.Dom,c=YAHOO.lang,a=YAHOO.util.Event;YAHOO.widget.TextNode=function(f,e,d){if(f){if(c.isString(f)){f={label:f}}this.init(f,e,d);this.setUpLabel(f)}};YAHOO.extend(YAHOO.widget.TextNode,YAHOO.widget.Node,{labelStyle:"ygtvlabel",labelElId:null,label:null,title:null,href:null,target:"_self",_type:"TextNode",setUpLabel:function(d){if(c.isString(d)){d={label:d}}else{if(d.style){this.labelStyle=d.style}}this.label=d.label;this.labelElId="ygtvlabelel"+this.index},getLabelEl:function(){return b.get(this.labelElId)},getContentHtml:function(){var d=[];d[d.length]=this.href?"<a":"<span";d[d.length]=' id="'+this.labelElId+'"';d[d.length]=' class="'+this.labelStyle+'"';if(this.href){d[d.length]=' href="'+this.href+'"';d[d.length]=' target="'+this.target+'"'}if(this.title){d[d.length]=' title="'+this.title+'"'}d[d.length]=" >";d[d.length]=this.label;d[d.length]=this.href?"</a>":"</span>";
return d.join("")},getNodeDefinition:function(){var d=YAHOO.widget.TextNode.superclass.getNodeDefinition.call(this);if(d===false){return false}d.label=this.label;if(this.labelStyle!="ygtvlabel"){d.style=this.labelStyle}if(this.title){d.title=this.title}if(this.href){d.href=this.href}if(this.target!="_self"){d.target=this.target}return d},toString:function(){return YAHOO.widget.TextNode.superclass.toString.call(this)+": "+this.label},onLabelClick:function(){return false},refresh:function(){YAHOO.widget.TextNode.superclass.refresh.call(this);var d=this.getLabelEl();d.innerHTML=this.label;if(d.tagName.toUpperCase()=="A"){d.href=this.href;d.target=this.target}}})})();YAHOO.widget.MenuNode=function(c,b,a){YAHOO.widget.MenuNode.superclass.constructor.call(this,c,b,a);this.multiExpand=false};YAHOO.extend(YAHOO.widget.MenuNode,YAHOO.widget.TextNode,{_type:"MenuNode"});(function(){var b=YAHOO.util.Dom,c=YAHOO.lang,a=YAHOO.util.Event;YAHOO.widget.HTMLNode=function(g,f,e,d){if(g){this.init(g,f,e);
this.initContent(g,d)}};YAHOO.extend(YAHOO.widget.HTMLNode,YAHOO.widget.Node,{contentStyle:"ygtvhtml",html:null,_type:"HTMLNode",initContent:function(e,d){this.setHtml(e);this.contentElId="ygtvcontentel"+this.index;if(!c.isUndefined(d)){this.hasIcon=d}},setHtml:function(e){this.html=(typeof e==="string")?e:e.html;var d=this.getContentEl();if(d){d.innerHTML=this.html}},getContentHtml:function(){return this.html},getNodeDefinition:function(){var d=YAHOO.widget.HTMLNode.superclass.getNodeDefinition.call(this);if(d===false){return false}d.html=this.html;return d}})})();(function(){var b=YAHOO.util.Dom,c=YAHOO.lang,a=YAHOO.util.Event,d=YAHOO.widget.Calendar;YAHOO.widget.DateNode=function(g,f,e){YAHOO.widget.DateNode.superclass.constructor.call(this,g,f,e)};YAHOO.extend(YAHOO.widget.DateNode,YAHOO.widget.TextNode,{_type:"DateNode",calendarConfig:null,fillEditorContainer:function(g){var h,f=g.inputContainer;if(c.isUndefined(d)){b.replaceClass(g.editorPanel,"ygtv-edit-DateNode","ygtv-edit-TextNode");
YAHOO.widget.DateNode.superclass.fillEditorContainer.call(this,g);return}if(g.nodeType!=this._type){g.nodeType=this._type;g.saveOnEnter=false;g.node.destroyEditorContents(g);g.inputObject=h=new d(f.appendChild(document.createElement("div")));if(this.calendarConfig){h.cfg.applyConfig(this.calendarConfig,true);h.cfg.fireQueue()}h.selectEvent.subscribe(function(){this.tree._closeEditor(true)},this,true)}else{h=g.inputObject}h.cfg.setProperty("selected",this.label,false);var i=h.cfg.getProperty("DATE_FIELD_DELIMITER");var e=this.label.split(i);h.cfg.setProperty("pagedate",e[h.cfg.getProperty("MDY_MONTH_POSITION")-1]+i+e[h.cfg.getProperty("MDY_YEAR_POSITION")-1]);h.cfg.fireQueue();h.render();h.oDomContainer.focus()},saveEditorValue:function(f){var i=f.node,h=i.tree.validator,j;if(c.isUndefined(d)){j=f.inputElement.value}else{var k=f.inputObject,g=k.getSelectedDates()[0],e=[];e[k.cfg.getProperty("MDY_DAY_POSITION")-1]=g.getDate();e[k.cfg.getProperty("MDY_MONTH_POSITION")-1]=g.getMonth()+1;e[k.cfg.getProperty("MDY_YEAR_POSITION")-1]=g.getFullYear();
j=e.join(k.cfg.getProperty("DATE_FIELD_DELIMITER"))}if(c.isFunction(h)){j=h(j,i.label,i);if(c.isUndefined(j)){return false}}i.label=j;i.getLabelEl().innerHTML=j},getNodeDefinition:function(){var e=YAHOO.widget.DateNode.superclass.getNodeDefinition.call(this);if(e===false){return false}if(this.calendarConfig){e.calendarConfig=this.calendarConfig}return e}})})();(function(){var e=YAHOO.util.Dom,f=YAHOO.lang,b=YAHOO.util.Event,d=YAHOO.widget.TreeView,c=d.prototype;d.editorData={active:false,whoHasIt:null,nodeType:null,editorPanel:null,inputContainer:null,buttonsContainer:null,node:null,saveOnEnter:true};c.validator=null;c._nodeEditing=function(m){if(m.fillEditorContainer&&m.editable){var i,k,l,j,h=d.editorData;h.active=true;h.whoHasIt=this;if(!h.nodeType){h.editorPanel=i=document.body.appendChild(document.createElement("div"));e.addClass(i,"ygtv-label-editor");l=h.buttonsContainer=i.appendChild(document.createElement("div"));e.addClass(l,"ygtv-button-container");j=l.appendChild(document.createElement("button"));
e.addClass(j,"ygtvok");j.innerHTML=" ";j=l.appendChild(document.createElement("button"));e.addClass(j,"ygtvcancel");j.innerHTML=" ";b.on(l,"click",function(o){var p=b.getTarget(o);var n=d.editorData.node;if(e.hasClass(p,"ygtvok")){b.stopEvent(o);this._closeEditor(true)}if(e.hasClass(p,"ygtvcancel")){b.stopEvent(o);this._closeEditor(false)}},this,true);h.inputContainer=i.appendChild(document.createElement("div"));e.addClass(h.inputContainer,"ygtv-input");b.on(i,"keydown",function(p){var o=d.editorData,n=YAHOO.util.KeyListener.KEY;switch(p.keyCode){case n.ENTER:b.stopEvent(p);if(o.saveOnEnter){this._closeEditor(true)}break;case n.ESCAPE:b.stopEvent(p);this._closeEditor(false);break}},this,true)}else{i=h.editorPanel}h.node=m;if(h.nodeType){e.removeClass(i,"ygtv-edit-"+h.nodeType)}e.addClass(i," ygtv-edit-"+m._type);k=e.getXY(m.getContentEl());e.setStyle(i,"left",k[0]+"px");e.setStyle(i,"top",k[1]+"px");e.setStyle(i,"display","block");i.focus();m.fillEditorContainer(h);return true}};c.onEventEditNode=function(h){if(h instanceof YAHOO.widget.Node){h.editNode()
}else{if(h.node instanceof YAHOO.widget.Node){h.node.editNode()}}};c._closeEditor=function(j){var h=d.editorData,i=h.node,k=true;if(j){k=h.node.saveEditorValue(h)!==false}if(k){e.setStyle(h.editorPanel,"display","none");h.active=false;i.focus()}};c._destroyEditor=function(){var h=d.editorData;if(h&&h.nodeType&&(!h.active||h.whoHasIt===this)){b.removeListener(h.editorPanel,"keydown");b.removeListener(h.buttonContainer,"click");h.node.destroyEditorContents(h);document.body.removeChild(h.editorPanel);h.nodeType=h.editorPanel=h.inputContainer=h.buttonsContainer=h.whoHasIt=h.node=null;h.active=false}};var g=YAHOO.widget.Node.prototype;g.editable=false;g.editNode=function(){this.tree._nodeEditing(this)};g.fillEditorContainer=null;g.destroyEditorContents=function(h){b.purgeElement(h.inputContainer,true);h.inputContainer.innerHTML=""};g.saveEditorValue=function(h){};var a=YAHOO.widget.TextNode.prototype;a.fillEditorContainer=function(i){var h;if(i.nodeType!=this._type){i.nodeType=this._type;i.saveOnEnter=true;
i.node.destroyEditorContents(i);i.inputElement=h=i.inputContainer.appendChild(document.createElement("input"))}else{h=i.inputElement}h.value=this.label;h.focus();h.select()};a.saveEditorValue=function(h){var j=h.node,k=h.inputElement.value,i=j.tree.validator;if(f.isFunction(i)){k=i(k,j.label,j);if(f.isUndefined(k)){return false}}j.label=k;j.getLabelEl().innerHTML=k};a.destroyEditorContents=function(h){h.inputContainer.innerHTML=""}})();YAHOO.register("treeview",YAHOO.widget.TreeView,{version:"2.7.0",build:"1799"});YAHOO.lang.JSON=(function(){var l=YAHOO.lang,_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,_INVALID=/^[\],:{}\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",'"':'\\"',"\\":"\\\\"};
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 _char(c){if(!_CHARS[c]){_CHARS[c]="\\u"+("0000"+(+(c.charCodeAt(0))).toString(16)).slice(-4)}return _CHARS[c]}function _prepare(s){return s.replace(_UNICODE_EXCEPTIONS,_char)}function _isValid(str){return l.isString(str)&&_INVALID.test(str.replace(_ESCAPES,"@").replace(_VALUES,"]").replace(_BRACKETS,""))}function _string(s){return'"'+s.replace(_SPECIAL_CHARS,_char)+'"'}function _stringify(h,key,d,w,pstack){var o=typeof w==="function"?w.call(h,key,h[key]):h[key],i,len,j,k,v,isArray,a;if(o instanceof Date){o=l.JSON.dateToString(o)}else{if(o instanceof String||o instanceof Boolean||o instanceof Number){o=o.valueOf()}}switch(typeof o){case"string":return _string(o);case"number":return isFinite(o)?String(o):"null";
case"boolean":return String(o);case"object":if(o===null){return"null"}for(i=pstack.length-1;i>=0;--i){if(pstack[i]===o){return"null"}}pstack[pstack.length]=o;a=[];isArray=l.isArray(o);if(d>0){if(isArray){for(i=o.length-1;i>=0;--i){a[i]=_stringify(o,i,d-1,w,pstack)||"null"}}else{j=0;if(l.isArray(w)){for(i=0,len=w.length;i<len;++i){k=w[i];v=_stringify(o,k,d-1,w,pstack);if(v){a[j++]=_string(k)+":"+v}}}else{for(k in o){if(typeof k==="string"&&l.hasOwnProperty(o,k)){v=_stringify(o,k,d-1,w,pstack);if(v){a[j++]=_string(k)+":"+v}}}}a.sort()}}pstack.pop();return isArray?"["+a.join(",")+"]":"{"+a.join(",")+"}"}return undefined}return{isValid:function(s){return _isValid(_prepare(s))},parse:function(s,reviver){s=_prepare(s);if(_isValid(s)){return _revive(eval("("+s+")"),reviver)}throw new SyntaxError("parseJSON")},stringify:function(o,w,d){if(o!==undefined){if(l.isArray(w)){w=(function(a){var uniq=[],map={},v,i,j,len;for(i=0,j=0,len=a.length;i<len;++i){v=a[i];if(typeof v==="string"&&map[v]===undefined){uniq[(map[v]=j++)]=v
}}return uniq})(w)}d=d>=0?d:1/0;return _stringify({"":o},"",d,w,[])}return undefined},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())+":"+_zeroPad(d.getUTCMinutes())+":"+_zeroPad(d.getUTCSeconds())+"Z"},stringToDate:function(str){if(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/.test(str)){var d=new Date();d.setUTCFullYear(RegExp.$1,(RegExp.$2|0)-1,RegExp.$3);d.setUTCHours(RegExp.$4,RegExp.$5,RegExp.$6);return d}return str}}})();YAHOO.register("json",YAHOO.lang.JSON,{version:"2.7.0",build:"1799"});(function(){var d=YAHOO.util.Dom,a=YAHOO.util.Event,c=YAHOO.lang;var b=function(f,e){var g={element:f,attributes:e||{}};b.superclass.constructor.call(this,g.element,g.attributes)};b._instances={};b.getResizeById=function(e){if(b._instances[e]){return b._instances[e]}return false};YAHOO.extend(b,YAHOO.util.Element,{CSS_RESIZE:"yui-resize",CSS_DRAG:"yui-draggable",CSS_HOVER:"yui-resize-hover",CSS_PROXY:"yui-resize-proxy",CSS_WRAP:"yui-resize-wrap",CSS_KNOB:"yui-resize-knob",CSS_HIDDEN:"yui-resize-hidden",CSS_HANDLE:"yui-resize-handle",CSS_STATUS:"yui-resize-status",CSS_GHOST:"yui-resize-ghost",CSS_RESIZING:"yui-resize-resizing",_resizeEvent:null,dd:null,browser:YAHOO.env.ua,_locked:null,_positioned:null,_dds:null,_wrap:null,_proxy:null,_handles:null,_currentHandle:null,_currentDD:null,_cache:null,_active:null,_createProxy:function(){if(this.get("proxy")){this._proxy=document.createElement("div");
this._proxy.className=this.CSS_PROXY;this._proxy.style.height=this.get("element").clientHeight+"px";this._proxy.style.width=this.get("element").clientWidth+"px";this._wrap.parentNode.appendChild(this._proxy)}else{this.set("animate",false)}},_createWrap:function(){this._positioned=false;if(this.get("wrap")===false){switch(this.get("element").tagName.toLowerCase()){case"img":case"textarea":case"input":case"iframe":case"select":this.set("wrap",true);break}}if(this.get("wrap")===true){this._wrap=document.createElement("div");this._wrap.id=this.get("element").id+"_wrap";this._wrap.className=this.CSS_WRAP;if(this.get("element").tagName.toLowerCase()=="textarea"){d.addClass(this._wrap,"yui-resize-textarea")}d.setStyle(this._wrap,"width",this.get("width")+"px");d.setStyle(this._wrap,"height",this.get("height")+"px");d.setStyle(this._wrap,"z-index",this.getStyle("z-index"));this.setStyle("z-index",0);var f=d.getStyle(this.get("element"),"position");d.setStyle(this._wrap,"position",((f=="static")?"relative":f));
d.setStyle(this._wrap,"top",d.getStyle(this.get("element"),"top"));d.setStyle(this._wrap,"left",d.getStyle(this.get("element"),"left"));if(d.getStyle(this.get("element"),"position")=="absolute"){this._positioned=true;d.setStyle(this.get("element"),"position","relative");d.setStyle(this.get("element"),"top","0");d.setStyle(this.get("element"),"left","0")}var e=this.get("element").parentNode;e.replaceChild(this._wrap,this.get("element"));this._wrap.appendChild(this.get("element"))}else{this._wrap=this.get("element");if(d.getStyle(this._wrap,"position")=="absolute"){this._positioned=true}}if(this.get("draggable")){this._setupDragDrop()}if(this.get("hover")){d.addClass(this._wrap,this.CSS_HOVER)}if(this.get("knobHandles")){d.addClass(this._wrap,this.CSS_KNOB)}if(this.get("hiddenHandles")){d.addClass(this._wrap,this.CSS_HIDDEN)}d.addClass(this._wrap,this.CSS_RESIZE)},_setupDragDrop:function(){d.addClass(this._wrap,this.CSS_DRAG);this.dd=new YAHOO.util.DD(this._wrap,this.get("id")+"-resize",{dragOnly:true,useShim:this.get("useShim")});
this.dd.on("dragEvent",function(){this.fireEvent("dragEvent",arguments)},this,true)},_createHandles:function(){this._handles={};this._dds={};var g=this.get("handles");for(var f=0;f<g.length;f++){this._handles[g[f]]=document.createElement("div");this._handles[g[f]].id=d.generateId(this._handles[g[f]]);this._handles[g[f]].className=this.CSS_HANDLE+" "+this.CSS_HANDLE+"-"+g[f];var e=document.createElement("div");e.className=this.CSS_HANDLE+"-inner-"+g[f];this._handles[g[f]].appendChild(e);this._wrap.appendChild(this._handles[g[f]]);a.on(this._handles[g[f]],"mouseover",this._handleMouseOver,this,true);a.on(this._handles[g[f]],"mouseout",this._handleMouseOut,this,true);this._dds[g[f]]=new YAHOO.util.DragDrop(this._handles[g[f]],this.get("id")+"-handle-"+g,{useShim:this.get("useShim")});this._dds[g[f]].setPadding(15,15,15,15);this._dds[g[f]].on("startDragEvent",this._handleStartDrag,this._dds[g[f]],this);this._dds[g[f]].on("mouseDownEvent",this._handleMouseDown,this._dds[g[f]],this)}this._status=document.createElement("span");
this._status.className=this.CSS_STATUS;document.body.insertBefore(this._status,document.body.firstChild)},_ieSelectFix:function(){return false},_ieSelectBack:null,_setAutoRatio:function(e){if(this.get("autoRatio")){if(e&&e.shiftKey){this.set("ratio",true)}else{this.set("ratio",this._configs.ratio._initialConfig.value)}}},_handleMouseDown:function(e){if(this._locked){return false}if(d.getStyle(this._wrap,"position")=="absolute"){this._positioned=true}if(e){this._setAutoRatio(e)}if(this.browser.ie){this._ieSelectBack=document.body.onselectstart;document.body.onselectstart=this._ieSelectFix}},_handleMouseOver:function(g){if(this._locked){return false}d.removeClass(this._wrap,this.CSS_RESIZE);if(this.get("hover")){d.removeClass(this._wrap,this.CSS_HOVER)}var e=a.getTarget(g);if(!d.hasClass(e,this.CSS_HANDLE)){e=e.parentNode}if(d.hasClass(e,this.CSS_HANDLE)&&!this._active){d.addClass(e,this.CSS_HANDLE+"-active");for(var f in this._handles){if(c.hasOwnProperty(this._handles,f)){if(this._handles[f]==e){d.addClass(e,this.CSS_HANDLE+"-"+f+"-active");
break}}}}d.addClass(this._wrap,this.CSS_RESIZE)},_handleMouseOut:function(g){d.removeClass(this._wrap,this.CSS_RESIZE);if(this.get("hover")&&!this._active){d.addClass(this._wrap,this.CSS_HOVER)}var e=a.getTarget(g);if(!d.hasClass(e,this.CSS_HANDLE)){e=e.parentNode}if(d.hasClass(e,this.CSS_HANDLE)&&!this._active){d.removeClass(e,this.CSS_HANDLE+"-active");for(var f in this._handles){if(c.hasOwnProperty(this._handles,f)){if(this._handles[f]==e){d.removeClass(e,this.CSS_HANDLE+"-"+f+"-active");break}}}}d.addClass(this._wrap,this.CSS_RESIZE)},_handleStartDrag:function(g,f){var e=f.getDragEl();if(d.hasClass(e,this.CSS_HANDLE)){if(d.getStyle(this._wrap,"position")=="absolute"){this._positioned=true}this._active=true;this._currentDD=f;if(this._proxy){this._proxy.style.visibility="visible";this._proxy.style.zIndex="1000";this._proxy.style.height=this.get("element").clientHeight+"px";this._proxy.style.width=this.get("element").clientWidth+"px"}for(var h in this._handles){if(c.hasOwnProperty(this._handles,h)){if(this._handles[h]==e){this._currentHandle=h;
var j="_handle_for_"+h;d.addClass(e,this.CSS_HANDLE+"-"+h+"-active");f.on("dragEvent",this[j],this,true);f.on("mouseUpEvent",this._handleMouseUp,this,true);break}}}d.addClass(e,this.CSS_HANDLE+"-active");if(this.get("proxy")){var k=d.getXY(this.get("element"));d.setXY(this._proxy,k);if(this.get("ghost")){this.addClass(this.CSS_GHOST)}}d.addClass(this._wrap,this.CSS_RESIZING);this._setCache();this._updateStatus(this._cache.height,this._cache.width,this._cache.top,this._cache.left);this.fireEvent("startResize",{type:"startresize",target:this})}},_setCache:function(){this._cache.xy=d.getXY(this._wrap);d.setXY(this._wrap,this._cache.xy);this._cache.height=this.get("clientHeight");this._cache.width=this.get("clientWidth");this._cache.start.height=this._cache.height;this._cache.start.width=this._cache.width;this._cache.start.top=this._cache.xy[1];this._cache.start.left=this._cache.xy[0];this._cache.top=this._cache.xy[1];this._cache.left=this._cache.xy[0];this.set("height",this._cache.height,true);
this.set("width",this._cache.width,true)},_handleMouseUp:function(f){this._active=false;var g="_handle_for_"+this._currentHandle;this._currentDD.unsubscribe("dragEvent",this[g],this,true);this._currentDD.unsubscribe("mouseUpEvent",this._handleMouseUp,this,true);if(this._proxy){this._proxy.style.visibility="hidden";this._proxy.style.zIndex="-1";if(this.get("setSize")){this.resize(f,this._cache.height,this._cache.width,this._cache.top,this._cache.left,true)}else{this.fireEvent("resize",{ev:"resize",target:this,height:this._cache.height,width:this._cache.width,top:this._cache.top,left:this._cache.left})}if(this.get("ghost")){this.removeClass(this.CSS_GHOST)}}if(this.get("hover")){d.addClass(this._wrap,this.CSS_HOVER)}if(this._status){d.setStyle(this._status,"display","none")}if(this.browser.ie){document.body.onselectstart=this._ieSelectBack}if(this.browser.ie){d.removeClass(this._wrap,this.CSS_RESIZE)}for(var e in this._handles){if(c.hasOwnProperty(this._handles,e)){d.removeClass(this._handles[e],this.CSS_HANDLE+"-active")
}}if(this.get("hover")&&!this._active){d.addClass(this._wrap,this.CSS_HOVER)}d.removeClass(this._wrap,this.CSS_RESIZING);d.removeClass(this._handles[this._currentHandle],this.CSS_HANDLE+"-"+this._currentHandle+"-active");d.removeClass(this._handles[this._currentHandle],this.CSS_HANDLE+"-active");if(this.browser.ie){d.addClass(this._wrap,this.CSS_RESIZE)}this._resizeEvent=null;this._currentHandle=null;if(!this.get("animate")){this.set("height",this._cache.height,true);this.set("width",this._cache.width,true)}this.fireEvent("endResize",{ev:"endResize",target:this,height:this._cache.height,width:this._cache.width,top:this._cache.top,left:this._cache.left})},_setRatio:function(m,p,s,j){var q=m,g=p;if(this.get("ratio")){var r=this._cache.height,i=this._cache.width,f=parseInt(this.get("height"),10),n=parseInt(this.get("width"),10),o=this.get("maxHeight"),u=this.get("minHeight"),e=this.get("maxWidth"),k=this.get("minWidth");switch(this._currentHandle){case"l":m=f*(p/n);m=Math.min(Math.max(u,m),o);
p=n*(m/f);s=(this._cache.start.top-(-((f-m)/2)));j=(this._cache.start.left-(-((n-p))));break;case"r":m=f*(p/n);m=Math.min(Math.max(u,m),o);p=n*(m/f);s=(this._cache.start.top-(-((f-m)/2)));break;case"t":p=n*(m/f);m=f*(p/n);j=(this._cache.start.left-(-((n-p)/2)));s=(this._cache.start.top-(-((f-m))));break;case"b":p=n*(m/f);m=f*(p/n);j=(this._cache.start.left-(-((n-p)/2)));break;case"bl":m=f*(p/n);p=n*(m/f);j=(this._cache.start.left-(-((n-p))));break;case"br":m=f*(p/n);p=n*(m/f);break;case"tl":m=f*(p/n);p=n*(m/f);j=(this._cache.start.left-(-((n-p))));s=(this._cache.start.top-(-((f-m))));break;case"tr":m=f*(p/n);p=n*(m/f);j=(this._cache.start.left);s=(this._cache.start.top-(-((f-m))));break}q=this._checkHeight(m);g=this._checkWidth(p);if((q!=m)||(g!=p)){s=0;j=0;if(q!=m){g=this._cache.width}if(g!=p){q=this._cache.height}}}return[q,g,s,j]},_updateStatus:function(m,g,k,f){if(this._resizeEvent&&(!c.isString(this._resizeEvent))){m=((m===0)?this._cache.start.height:m);g=((g===0)?this._cache.start.width:g);
var j=parseInt(this.get("height"),10),e=parseInt(this.get("width"),10);if(isNaN(j)){j=parseInt(m,10)}if(isNaN(e)){e=parseInt(g,10)}var n=(parseInt(m,10)-j);var i=(parseInt(g,10)-e);this._cache.offsetHeight=n;this._cache.offsetWidth=i;if(this.get("status")){d.setStyle(this._status,"display","inline");this._status.innerHTML="<strong>"+parseInt(m,10)+" x "+parseInt(g,10)+"</strong><em>"+((n>0)?"+":"")+n+" x "+((i>0)?"+":"")+i+"</em>";d.setXY(this._status,[a.getPageX(this._resizeEvent)+12,a.getPageY(this._resizeEvent)+12])}}},lock:function(e){this._locked=true;if(e&&this.dd){d.removeClass(this._wrap,"yui-draggable");this.dd.lock()}return this},unlock:function(e){this._locked=false;if(e&&this.dd){d.addClass(this._wrap,"yui-draggable");this.dd.unlock()}return this},isLocked:function(){return this._locked},reset:function(){this.resize(null,this._cache.start.height,this._cache.start.width,this._cache.start.top,this._cache.start.left,true);return this},resize:function(o,k,r,s,i,f,m){if(this._locked){return false
}this._resizeEvent=o;var g=this._wrap,j=this.get("animate"),q=true;if(this._proxy&&!f){g=this._proxy;j=false}this._setAutoRatio(o);if(this._positioned){if(this._proxy){s=this._cache.top-s;i=this._cache.left-i}}var n=this._setRatio(k,r,s,i);k=parseInt(n[0],10);r=parseInt(n[1],10);s=parseInt(n[2],10);i=parseInt(n[3],10);if(s==0){s=d.getY(g)}if(i==0){i=d.getX(g)}if(this._positioned){if(this._proxy&&f){if(!j){g.style.top=this._proxy.style.top;g.style.left=this._proxy.style.left}else{s=this._proxy.style.top;i=this._proxy.style.left}}else{if(!this.get("ratio")&&!this._proxy){s=this._cache.top+-(s);i=this._cache.left+-(i)}if(s){if(this.get("minY")){if(s<this.get("minY")){s=this.get("minY")}}if(this.get("maxY")){if(s>this.get("maxY")){s=this.get("maxY")}}}if(i){if(this.get("minX")){if(i<this.get("minX")){i=this.get("minX")}}if(this.get("maxX")){if((i+r)>this.get("maxX")){i=(this.get("maxX")-r)}}}}}if(!m){var p=this.fireEvent("beforeResize",{ev:"beforeResize",target:this,height:k,width:r,top:s,left:i});
if(p===false){return false}}this._updateStatus(k,r,s,i);if(this._positioned){if(this._proxy&&f){}else{if(s){d.setY(g,s);this._cache.top=s}if(i){d.setX(g,i);this._cache.left=i}}}if(k){if(!j){q=true;if(this._proxy&&f){if(!this.get("setSize")){q=false}}if(q){g.style.height=k+"px"}if((this._proxy&&f)||!this._proxy){if(this._wrap!=this.get("element")){this.get("element").style.height=k+"px"}}}this._cache.height=k}if(r){this._cache.width=r;if(!j){q=true;if(this._proxy&&f){if(!this.get("setSize")){q=false}}if(q){g.style.width=r+"px"}if((this._proxy&&f)||!this._proxy){if(this._wrap!=this.get("element")){this.get("element").style.width=r+"px"}}}}if(j){if(YAHOO.util.Anim){var e=new YAHOO.util.Anim(g,{height:{to:this._cache.height},width:{to:this._cache.width}},this.get("animateDuration"),this.get("animateEasing"));if(this._positioned){if(s){e.attributes.top={to:parseInt(s,10)}}if(i){e.attributes.left={to:parseInt(i,10)}}}if(this._wrap!=this.get("element")){e.onTween.subscribe(function(){this.get("element").style.height=g.style.height;
this.get("element").style.width=g.style.width},this,true)}e.onComplete.subscribe(function(){this.set("height",k);this.set("width",r);this.fireEvent("resize",{ev:"resize",target:this,height:k,width:r,top:s,left:i})},this,true);e.animate()}}else{if(this._proxy&&!f){this.fireEvent("proxyResize",{ev:"proxyresize",target:this,height:k,width:r,top:s,left:i})}else{this.fireEvent("resize",{ev:"resize",target:this,height:k,width:r,top:s,left:i})}}return this},_handle_for_br:function(f){var g=this._setWidth(f.e);var e=this._setHeight(f.e);this.resize(f.e,e,g,0,0)},_handle_for_bl:function(g){var h=this._setWidth(g.e,true);var f=this._setHeight(g.e);var e=(h-this._cache.width);this.resize(g.e,f,h,0,e)},_handle_for_tl:function(g){var i=this._setWidth(g.e,true);var f=this._setHeight(g.e,true);var h=(f-this._cache.height);var e=(i-this._cache.width);this.resize(g.e,f,i,h,e)},_handle_for_tr:function(f){var h=this._setWidth(f.e);var e=this._setHeight(f.e,true);var g=(e-this._cache.height);this.resize(f.e,e,h,g,0)
},_handle_for_r:function(e){this._dds.r.setYConstraint(0,0);var f=this._setWidth(e.e);this.resize(e.e,0,f,0,0)},_handle_for_l:function(f){this._dds.l.setYConstraint(0,0);var g=this._setWidth(f.e,true);var e=(g-this._cache.width);this.resize(f.e,0,g,0,e)},_handle_for_b:function(f){this._dds.b.setXConstraint(0,0);var e=this._setHeight(f.e);this.resize(f.e,e,0,0,0)},_handle_for_t:function(f){this._dds.t.setXConstraint(0,0);var e=this._setHeight(f.e,true);var g=(e-this._cache.height);this.resize(f.e,e,0,g,0)},_setWidth:function(h,j){var i=this._cache.xy[0],g=this._cache.width,e=a.getPageX(h),f=(e-i);if(j){f=(i-e)+parseInt(this.get("width"),10)}f=this._snapTick(f,this.get("xTicks"));f=this._checkWidth(f);return f},_checkWidth:function(e){if(this.get("minWidth")){if(e<=this.get("minWidth")){e=this.get("minWidth")}}if(this.get("maxWidth")){if(e>=this.get("maxWidth")){e=this.get("maxWidth")}}return e},_checkHeight:function(e){if(this.get("minHeight")){if(e<=this.get("minHeight")){e=this.get("minHeight")
}}if(this.get("maxHeight")){if(e>=this.get("maxHeight")){e=this.get("maxHeight")}}return e},_setHeight:function(g,j){var i=this._cache.xy[1],f=this._cache.height,k=a.getPageY(g),e=(k-i);if(j){e=(i-k)+parseInt(this.get("height"),10)}e=this._snapTick(e,this.get("yTicks"));e=this._checkHeight(e);return e},_snapTick:function(g,f){if(!g||!f){return g}var h=g;var e=g%f;if(e>0){if(e>(f/2)){h=g+(f-e)}else{h=g-e}}return h},init:function(i,f){this._locked=false;this._cache={xy:[],height:0,width:0,top:0,left:0,offsetHeight:0,offsetWidth:0,start:{height:0,width:0,top:0,left:0}};b.superclass.init.call(this,i,f);this.set("setSize",this.get("setSize"));if(f.height){this.set("height",parseInt(f.height,10))}else{var g=this.getStyle("height");if(g=="auto"){this.set("height",parseInt(this.get("element").offsetHeight,10))}}if(f.width){this.set("width",parseInt(f.width,10))}else{var e=this.getStyle("width");if(e=="auto"){this.set("width",parseInt(this.get("element").offsetWidth,10))}}var j=i;if(!c.isString(j)){j=d.generateId(j)
}b._instances[j]=this;this._active=false;this._createWrap();this._createProxy();this._createHandles()},getProxyEl:function(){return this._proxy},getWrapEl:function(){return this._wrap},getStatusEl:function(){return this._status},getActiveHandleEl:function(){return this._handles[this._currentHandle]},isActive:function(){return((this._active)?true:false)},initAttributes:function(e){b.superclass.initAttributes.call(this,e);this.setAttributeConfig("useShim",{value:((e.useShim===true)?true:false),validator:YAHOO.lang.isBoolean,method:function(f){for(var g in this._dds){if(c.hasOwnProperty(this._dds,g)){this._dds[g].useShim=f}}if(this.dd){this.dd.useShim=f}}});this.setAttributeConfig("setSize",{value:((e.setSize===false)?false:true),validator:YAHOO.lang.isBoolean});this.setAttributeConfig("wrap",{writeOnce:true,validator:YAHOO.lang.isBoolean,value:e.wrap||false});this.setAttributeConfig("handles",{writeOnce:true,value:e.handles||["r","b","br"],validator:function(f){if(c.isString(f)&&f.toLowerCase()=="all"){f=["t","b","r","l","bl","br","tl","tr"]
}if(!c.isArray(f)){f=f.replace(/, /g,",");f=f.split(",")}this._configs.handles.value=f}});this.setAttributeConfig("width",{value:e.width||parseInt(this.getStyle("width"),10),validator:YAHOO.lang.isNumber,method:function(f){f=parseInt(f,10);if(f>0){if(this.get("setSize")){this.setStyle("width",f+"px")}this._cache.width=f;this._configs.width.value=f}}});this.setAttributeConfig("height",{value:e.height||parseInt(this.getStyle("height"),10),validator:YAHOO.lang.isNumber,method:function(f){f=parseInt(f,10);if(f>0){if(this.get("setSize")){this.setStyle("height",f+"px")}this._cache.height=f;this._configs.height.value=f}}});this.setAttributeConfig("minWidth",{value:e.minWidth||15,validator:YAHOO.lang.isNumber});this.setAttributeConfig("minHeight",{value:e.minHeight||15,validator:YAHOO.lang.isNumber});this.setAttributeConfig("maxWidth",{value:e.maxWidth||10000,validator:YAHOO.lang.isNumber});this.setAttributeConfig("maxHeight",{value:e.maxHeight||10000,validator:YAHOO.lang.isNumber});this.setAttributeConfig("minY",{value:e.minY||false});
this.setAttributeConfig("minX",{value:e.minX||false});this.setAttributeConfig("maxY",{value:e.maxY||false});this.setAttributeConfig("maxX",{value:e.maxX||false});this.setAttributeConfig("animate",{value:e.animate||false,validator:function(g){var f=true;if(!YAHOO.util.Anim){f=false}return f}});this.setAttributeConfig("animateEasing",{value:e.animateEasing||function(){var f=false;if(YAHOO.util.Easing&&YAHOO.util.Easing.easeOut){f=YAHOO.util.Easing.easeOut}return f}()});this.setAttributeConfig("animateDuration",{value:e.animateDuration||0.5});this.setAttributeConfig("proxy",{value:e.proxy||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("ratio",{value:e.ratio||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("ghost",{value:e.ghost||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("draggable",{value:e.draggable||false,validator:YAHOO.lang.isBoolean,method:function(f){if(f&&this._wrap){this._setupDragDrop()}else{if(this.dd){d.removeClass(this._wrap,this.CSS_DRAG);
this.dd.unreg()}}}});this.setAttributeConfig("hover",{value:e.hover||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("hiddenHandles",{value:e.hiddenHandles||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("knobHandles",{value:e.knobHandles||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("xTicks",{value:e.xTicks||false});this.setAttributeConfig("yTicks",{value:e.yTicks||false});this.setAttributeConfig("status",{value:e.status||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("autoRatio",{value:e.autoRatio||false,validator:YAHOO.lang.isBoolean})},destroy:function(){for(var f in this._handles){if(c.hasOwnProperty(this._handles,f)){a.purgeElement(this._handles[f]);this._handles[f].parentNode.removeChild(this._handles[f])}}if(this._proxy){this._proxy.parentNode.removeChild(this._proxy)}if(this._status){this._status.parentNode.removeChild(this._status)}if(this.dd){this.dd.unreg();d.removeClass(this._wrap,this.CSS_DRAG)}if(this._wrap!=this.get("element")){this.setStyle("position","");
this.setStyle("top","");this.setStyle("left","");this._wrap.parentNode.replaceChild(this.get("element"),this._wrap)}this.removeClass(this.CSS_RESIZE);delete YAHOO.util.Resize._instances[this.get("id")];for(var e in this){if(c.hasOwnProperty(this,e)){this[e]=null;delete this[e]}}},toString:function(){if(this.get){return"Resize (#"+this.get("id")+")"}return"Resize Utility"}});YAHOO.util.Resize=b})();YAHOO.register("resize",YAHOO.util.Resize,{version:"2.7.0",build:"1799"});(function(){var c=YAHOO.util.Dom,a=YAHOO.util.Event,d=YAHOO.lang;var b=function(f,e){if(d.isObject(f)&&!f.tagName){e=f;f=null}if(d.isString(f)){if(c.get(f)){f=c.get(f)}}if(!f){f=document.body}var g={element:f,attributes:e||{}};b.superclass.constructor.call(this,g.element,g.attributes)};b._instances={};b.getLayoutById=function(e){if(b._instances[e]){return b._instances[e]}return false};YAHOO.extend(b,YAHOO.util.Element,{browser:function(){var e=YAHOO.env.ua;e.standardsMode=false;e.secure=false;return e}(),_units:null,_rendered:null,_zIndex:null,_sizes:null,_setBodySize:function(g){var f=0,e=0;
g=((g===false)?false:true);if(this._isBody){f=c.getClientHeight();e=c.getClientWidth()}else{f=parseInt(this.getStyle("height"),10);e=parseInt(this.getStyle("width"),10);if(isNaN(e)){e=this.get("element").clientWidth}if(isNaN(f)){f=this.get("element").clientHeight}}if(this.get("minWidth")){if(e<this.get("minWidth")){e=this.get("minWidth")}}if(this.get("minHeight")){if(f<this.get("minHeight")){f=this.get("minHeight")}}if(g){c.setStyle(this._doc,"height",f+"px");c.setStyle(this._doc,"width",e+"px")}this._sizes.doc={h:f,w:e};this._setSides(g)},_setSides:function(k){var i=((this._units.top)?this._units.top.get("height"):0),g=((this._units.bottom)?this._units.bottom.get("height"):0),j=this._sizes.doc.h,e=this._sizes.doc.w;k=((k===false)?false:true);this._sizes.top={h:i,w:((this._units.top)?e:0),t:0};this._sizes.bottom={h:g,w:((this._units.bottom)?e:0)};var f=(j-(i+g));this._sizes.left={h:f,w:((this._units.left)?this._units.left.get("width"):0)};this._sizes.right={h:f,w:((this._units.right)?this._units.right.get("width"):0),l:((this._units.right)?(e-this._units.right.get("width")):0),t:((this._units.top)?this._sizes.top.h:0)};
if(this._units.right&&k){this._units.right.set("top",this._sizes.right.t);if(!this._units.right._collapsing){this._units.right.set("left",this._sizes.right.l)}this._units.right.set("height",this._sizes.right.h,true)}if(this._units.left){this._sizes.left.l=0;if(this._units.top){this._sizes.left.t=this._sizes.top.h}else{this._sizes.left.t=0}if(k){this._units.left.set("top",this._sizes.left.t);this._units.left.set("height",this._sizes.left.h,true);this._units.left.set("left",0)}}if(this._units.bottom){this._sizes.bottom.t=this._sizes.top.h+this._sizes.left.h;if(k){this._units.bottom.set("top",this._sizes.bottom.t);this._units.bottom.set("width",this._sizes.bottom.w,true)}}if(this._units.top){if(k){this._units.top.set("width",this._sizes.top.w,true)}}this._setCenter(k)},_setCenter:function(g){g=((g===false)?false:true);var f=this._sizes.left.h;var e=(this._sizes.doc.w-(this._sizes.left.w+this._sizes.right.w));if(g){this._units.center.set("height",f,true);this._units.center.set("width",e,true);
this._units.center.set("top",this._sizes.top.h);this._units.center.set("left",this._sizes.left.w)}this._sizes.center={h:f,w:e,t:this._sizes.top.h,l:this._sizes.left.w}},getSizes:function(){return this._sizes},getUnitById:function(e){return YAHOO.widget.LayoutUnit.getLayoutUnitById(e)},getUnitByPosition:function(e){if(e){e=e.toLowerCase();if(this._units[e]){return this._units[e]}return false}return false},removeUnit:function(e){delete this._units[e.get("position")];this.resize()},addUnit:function(g){if(!g.position){return false}if(this._units[g.position]){return false}var i=null,k=null;if(g.id){if(c.get(g.id)){i=c.get(g.id);delete g.id}}if(g.element){i=g.element}if(!k){k=document.createElement("div");var m=c.generateId();k.id=m}if(!i){i=document.createElement("div")}c.addClass(i,"yui-layout-wrap");if(this.browser.ie&&!this.browser.standardsMode){k.style.zoom=1;i.style.zoom=1}if(k.firstChild){k.insertBefore(i,k.firstChild)}else{k.appendChild(i)}this._doc.appendChild(k);var j=false,f=false;
if(g.height){j=parseInt(g.height,10)}if(g.width){f=parseInt(g.width,10)}var e={};YAHOO.lang.augmentObject(e,g);e.parent=this;e.wrap=i;e.height=j;e.width=f;var l=new YAHOO.widget.LayoutUnit(k,e);l.on("heightChange",this.resize,this,true);l.on("widthChange",this.resize,this,true);l.on("gutterChange",this.resize,this,true);this._units[g.position]=l;if(this._rendered){this.resize()}return l},_createUnits:function(){var e=this.get("units");for(var f in e){if(d.hasOwnProperty(e,f)){this.addUnit(e[f])}}},resize:function(f){f=((f===false)?false:true);if(f){var e=this.fireEvent("beforeResize");if(e===false){f=false}if(this.browser.ie){if(this._isBody){c.removeClass(document.documentElement,"yui-layout");c.addClass(document.documentElement,"yui-layout")}else{this.removeClass("yui-layout");this.addClass("yui-layout")}}}this._setBodySize(f);if(f){this.fireEvent("resize",{target:this,sizes:this._sizes})}return this},_setupBodyElements:function(){this._doc=c.get("layout-doc");if(!this._doc){this._doc=document.createElement("div");
this._doc.id="layout-doc";if(document.body.firstChild){document.body.insertBefore(this._doc,document.body.firstChild)}else{document.body.appendChild(this._doc)}}this._createUnits();this._setBodySize();a.on(window,"resize",this.resize,this,true);c.addClass(this._doc,"yui-layout-doc")},_setupElements:function(){this._doc=this.getElementsByClassName("yui-layout-doc")[0];if(!this._doc){this._doc=document.createElement("div");this.get("element").appendChild(this._doc)}this._createUnits();this._setBodySize();c.addClass(this._doc,"yui-layout-doc")},_isBody:null,_doc:null,init:function(f,e){this._zIndex=0;b.superclass.init.call(this,f,e);if(this.get("parent")){this._zIndex=this.get("parent")._zIndex+10}this._sizes={};this._units={};var g=f;if(!d.isString(g)){g=c.generateId(g)}b._instances[g]=this},render:function(){this._stamp();var e=this.get("element");if(e&&e.tagName&&(e.tagName.toLowerCase()=="body")){this._isBody=true;c.addClass(document.body,"yui-layout");if(c.hasClass(document.body,"yui-skin-sam")){c.addClass(document.documentElement,"yui-skin-sam");
c.removeClass(document.body,"yui-skin-sam")}this._setupBodyElements()}else{this._isBody=false;this.addClass("yui-layout");this._setupElements()}this.resize();this._rendered=true;this.fireEvent("render");return this},_stamp:function(){if(document.compatMode=="CSS1Compat"){this.browser.standardsMode=true}if(window.location.href.toLowerCase().indexOf("https")===0){c.addClass(document.documentElement,"secure");this.browser.secure=true}},initAttributes:function(e){b.superclass.initAttributes.call(this,e);this.setAttributeConfig("units",{writeOnce:true,validator:YAHOO.lang.isArray,value:e.units||[]});this.setAttributeConfig("minHeight",{value:e.minHeight||false,validator:YAHOO.lang.isNumber});this.setAttributeConfig("minWidth",{value:e.minWidth||false,validator:YAHOO.lang.isNumber});this.setAttributeConfig("height",{value:e.height||false,validator:YAHOO.lang.isNumber,method:function(f){this.setStyle("height",f+"px")}});this.setAttributeConfig("width",{value:e.width||false,validator:YAHOO.lang.isNumber,method:function(f){this.setStyle("width",f+"px")
}});this.setAttributeConfig("parent",{writeOnce:true,value:e.parent||false,method:function(f){if(f){f.on("resize",this.resize,this,true)}}})},destroy:function(){var g=this.get("parent");if(g){g.removeListener("resize",this.resize,this,true)}a.removeListener(window,"resize",this.resize,this,true);this.unsubscribeAll();for(var e in this._units){if(d.hasOwnProperty(this._units,e)){if(this._units[e]){this._units[e].destroy(true)}}}a.purgeElement(this.get("element"));this.get("parentNode").removeChild(this.get("element"));delete YAHOO.widget.Layout._instances[this.get("id")];for(var f in this){if(d.hasOwnProperty(this,f)){this[f]=null;delete this[f]}}if(g){g.resize()}},toString:function(){if(this.get){return"Layout #"+this.get("id")}return"Layout"}});YAHOO.widget.Layout=b})();(function(){var d=YAHOO.util.Dom,c=YAHOO.util.Selector,a=YAHOO.util.Event,e=YAHOO.lang;var b=function(g,f){var h={element:g,attributes:f||{}};b.superclass.constructor.call(this,h.element,h.attributes)};b._instances={};b.getLayoutUnitById=function(f){if(b._instances[f]){return b._instances[f]
}return false};YAHOO.extend(b,YAHOO.util.Element,{STR_CLOSE:"Click to close this pane.",STR_COLLAPSE:"Click to collapse this pane.",STR_EXPAND:"Click to expand this pane.",LOADING_CLASSNAME:"loading",browser:null,_sizes:null,_anim:null,_resize:null,_clip:null,_gutter:null,header:null,body:null,footer:null,_collapsed:null,_collapsing:null,_lastWidth:null,_lastHeight:null,_lastTop:null,_lastLeft:null,_lastScroll:null,_lastCenterScroll:null,_lastScrollTop:null,resize:function(f){var g=this.fireEvent("beforeResize");if(g===false){return this}if(!this._collapsing||(f===true)){var n=this.get("scroll");this.set("scroll",false);var k=this._getBoxSize(this.header),j=this._getBoxSize(this.footer),l=[this.get("height"),this.get("width")];var h=(l[0]-k[0]-j[0])-(this._gutter.top+this._gutter.bottom),m=l[1]-(this._gutter.left+this._gutter.right);var o=(h+(k[0]+j[0])),i=m;if(this._collapsed&&!this._collapsing){this._setHeight(this._clip,o);this._setWidth(this._clip,i);d.setStyle(this._clip,"top",this.get("top")+this._gutter.top+"px");
d.setStyle(this._clip,"left",this.get("left")+this._gutter.left+"px")}else{if(!this._collapsed||(this._collapsed&&this._collapsing)){o=this._setHeight(this.get("wrap"),o);i=this._setWidth(this.get("wrap"),i);this._sizes.wrap.h=o;this._sizes.wrap.w=i;d.setStyle(this.get("wrap"),"top",this._gutter.top+"px");d.setStyle(this.get("wrap"),"left",this._gutter.left+"px");this._sizes.header.w=this._setWidth(this.header,i);this._sizes.header.h=k[0];this._sizes.footer.w=this._setWidth(this.footer,i);this._sizes.footer.h=j[0];d.setStyle(this.footer,"bottom","0px");this._sizes.body.h=this._setHeight(this.body,(o-(k[0]+j[0])));this._sizes.body.w=this._setWidth(this.body,i);d.setStyle(this.body,"top",k[0]+"px");this.set("scroll",n);this.fireEvent("resize")}}}return this},_setWidth:function(h,g){if(h){var f=this._getBorderSizes(h);g=(g-(f[1]+f[3]));g=this._fixQuirks(h,g,"w");if(g<0){g=0}d.setStyle(h,"width",g+"px")}return g},_setHeight:function(i,g){if(i){var f=this._getBorderSizes(i);g=(g-(f[0]+f[2]));
g=this._fixQuirks(i,g,"h");if(g<0){g=0}d.setStyle(i,"height",g+"px")}return g},_fixQuirks:function(i,l,g){var k=0,h=2;if(g=="w"){k=1;h=3}if(this.browser.ie&&!this.browser.standardsMode){var f=this._getBorderSizes(i),j=this._getBorderSizes(i.parentNode);if((f[k]===0)&&(f[h]===0)){if((j[k]!==0)&&(j[h]!==0)){l=(l-(j[k]+j[h]))}}else{if((j[k]===0)&&(j[h]===0)){l=(l+(f[k]+f[h]))}}}return l},_getBoxSize:function(h){var g=[0,0];if(h){if(this.browser.ie&&!this.browser.standardsMode){h.style.zoom=1}var f=this._getBorderSizes(h);g[0]=h.clientHeight+(f[0]+f[2]);g[1]=h.clientWidth+(f[1]+f[3])}return g},_getBorderSizes:function(h){var g=[];h=h||this.get("element");if(this.browser.ie&&!this.browser.standardsMode){h.style.zoom=1}g[0]=parseInt(d.getStyle(h,"borderTopWidth"),10);g[1]=parseInt(d.getStyle(h,"borderRightWidth"),10);g[2]=parseInt(d.getStyle(h,"borderBottomWidth"),10);g[3]=parseInt(d.getStyle(h,"borderLeftWidth"),10);for(var f=0;f<g.length;f++){if(isNaN(g[f])){g[f]=0}}return g},_createClip:function(){if(!this._clip){this._clip=document.createElement("div");
this._clip.className="yui-layout-clip yui-layout-clip-"+this.get("position");this._clip.innerHTML='<div class="collapse"></div>';var f=this._clip.firstChild;f.title=this.STR_EXPAND;a.on(f,"click",this.expand,this,true);this.get("element").parentNode.appendChild(this._clip)}},_toggleClip:function(){if(!this._collapsed){var j=this._getBoxSize(this.header),k=this._getBoxSize(this.footer),i=[this.get("height"),this.get("width")];var h=(i[0]-j[0]-k[0])-(this._gutter.top+this._gutter.bottom),f=i[1]-(this._gutter.left+this._gutter.right),g=(h+(j[0]+k[0]));switch(this.get("position")){case"top":case"bottom":this._setWidth(this._clip,f);this._setHeight(this._clip,this.get("collapseSize"));d.setStyle(this._clip,"left",(this._lastLeft+this._gutter.left)+"px");if(this.get("position")=="bottom"){d.setStyle(this._clip,"top",((this._lastTop+this._lastHeight)-(this.get("collapseSize")-this._gutter.top))+"px")}else{d.setStyle(this._clip,"top",this.get("top")+this._gutter.top+"px")}break;case"left":case"right":this._setWidth(this._clip,this.get("collapseSize"));
this._setHeight(this._clip,g);d.setStyle(this._clip,"top",(this.get("top")+this._gutter.top)+"px");if(this.get("position")=="right"){d.setStyle(this._clip,"left",(((this._lastLeft+this._lastWidth)-this.get("collapseSize"))-this._gutter.left)+"px")}else{d.setStyle(this._clip,"left",(this.get("left")+this._gutter.left)+"px")}break}d.setStyle(this._clip,"display","block");this.setStyle("display","none")}else{d.setStyle(this._clip,"display","none")}},getSizes:function(){return this._sizes},toggle:function(){if(this._collapsed){this.expand()}else{this.collapse()}return this},expand:function(){if(!this._collapsed){return this}var l=this.fireEvent("beforeExpand");if(l===false){return this}this._collapsing=true;this.setStyle("zIndex",this.get("parent")._zIndex+1);if(this._anim){this.setStyle("display","none");var f={},h;switch(this.get("position")){case"left":case"right":this.set("width",this._lastWidth,true);this.setStyle("width",this._lastWidth+"px");this.get("parent").resize(false);h=this.get("parent").getSizes()[this.get("position")];
this.set("height",h.h,true);var k=h.l;f={left:{to:k}};if(this.get("position")=="left"){f.left.from=(k-h.w);this.setStyle("left",(k-h.w)+"px")}break;case"top":case"bottom":this.set("height",this._lastHeight,true);this.setStyle("height",this._lastHeight+"px");this.get("parent").resize(false);h=this.get("parent").getSizes()[this.get("position")];this.set("width",h.w,true);var j=h.t;f={top:{to:j}};if(this.get("position")=="top"){this.setStyle("top",(j-h.h)+"px");f.top.from=(j-h.h)}break}this._anim.attributes=f;var i=function(){this.setStyle("display","block");this.resize(true);this._anim.onStart.unsubscribe(i,this,true)};var g=function(){this._collapsing=false;this.setStyle("zIndex",this.get("parent")._zIndex);this.set("width",this._lastWidth);this.set("height",this._lastHeight);this._collapsed=false;this.resize();this.set("scroll",this._lastScroll);if(this._lastScrollTop>0){this.body.scrollTop=this._lastScrollTop}this._anim.onComplete.unsubscribe(g,this,true);this.fireEvent("expand")};this._anim.onStart.subscribe(i,this,true);
this._anim.onComplete.subscribe(g,this,true);this._anim.animate();this._toggleClip()}else{this._collapsing=false;this._toggleClip();this._collapsed=false;this.setStyle("zIndex",this.get("parent")._zIndex);this.setStyle("display","block");this.set("width",this._lastWidth);this.set("height",this._lastHeight);this.resize();this.set("scroll",this._lastScroll);if(this._lastScrollTop>0){this.body.scrollTop=this._lastScrollTop}this.fireEvent("expand")}return this},collapse:function(){if(this._collapsed){return this}var k=this.fireEvent("beforeCollapse");if(k===false){return this}if(!this._clip){this._createClip()}this._collapsing=true;var g=this.get("width"),i=this.get("height"),f={};this._lastWidth=g;this._lastHeight=i;this._lastScroll=this.get("scroll");this._lastScrollTop=this.body.scrollTop;this.set("scroll",false,true);this._lastLeft=parseInt(this.get("element").style.left,10);this._lastTop=parseInt(this.get("element").style.top,10);if(isNaN(this._lastTop)){this._lastTop=0;this.set("top",0)
}if(isNaN(this._lastLeft)){this._lastLeft=0;this.set("left",0)}this.setStyle("zIndex",this.get("parent")._zIndex+1);var l=this.get("position");switch(l){case"top":case"bottom":this.set("height",(this.get("collapseSize")+(this._gutter.top+this._gutter.bottom)));f={top:{to:(this.get("top")-i)}};if(l=="bottom"){f.top.to=(this.get("top")+i)}break;case"left":case"right":this.set("width",(this.get("collapseSize")+(this._gutter.left+this._gutter.right)));f={left:{to:-(this._lastWidth)}};if(l=="right"){f.left={to:(this.get("left")+g)}}break}if(this._anim){this._anim.attributes=f;var j=function(){this._collapsing=false;this._toggleClip();this.setStyle("zIndex",this.get("parent")._zIndex);this._collapsed=true;this.get("parent").resize();this._anim.onComplete.unsubscribe(j,this,true);this.fireEvent("collapse")};this._anim.onComplete.subscribe(j,this,true);this._anim.animate()}else{this._collapsing=false;this.setStyle("display","none");this._toggleClip();this.setStyle("zIndex",this.get("parent")._zIndex);
this.get("parent").resize();this._collapsed=true;this.fireEvent("collapse")}return this},close:function(){this.setStyle("display","none");this.get("parent").removeUnit(this);this.fireEvent("close");if(this._clip){this._clip.parentNode.removeChild(this._clip);this._clip=null}return this.get("parent")},loadHandler:{success:function(f){this.body.innerHTML=f.responseText;this.resize(true)},failure:function(f){}},dataConnection:null,_loading:false,loadContent:function(){if(YAHOO.util.Connect&&this.get("dataSrc")&&!this._loading&&!this.get("dataLoaded")){this._loading=true;d.addClass(this.body,this.LOADING_CLASSNAME);this.dataConnection=YAHOO.util.Connect.asyncRequest(this.get("loadMethod"),this.get("dataSrc"),{success:function(f){this.loadHandler.success.call(this,f);this.set("dataLoaded",true);this.dataConnection=null;d.removeClass(this.body,this.LOADING_CLASSNAME);this._loading=false;this.fireEvent("load")},failure:function(f){this.loadHandler.failure.call(this,f);this.dataConnection=null;
d.removeClass(this.body,this.LOADING_CLASSNAME);this._loading=false;this.fireEvent("loadError",{error:f})},scope:this,timeout:this.get("dataTimeout")});return this.dataConnection}return false},init:function(h,g){this._gutter={left:0,right:0,top:0,bottom:0};this._sizes={wrap:{h:0,w:0},header:{h:0,w:0},body:{h:0,w:0},footer:{h:0,w:0}};b.superclass.init.call(this,h,g);this.browser=this.get("parent").browser;var k=h;if(!e.isString(k)){k=d.generateId(k)}b._instances[k]=this;this.setStyle("position","absolute");this.addClass("yui-layout-unit");this.addClass("yui-layout-unit-"+this.get("position"));var j=this.getElementsByClassName("yui-layout-hd","div")[0];if(j){this.header=j}var f=this.getElementsByClassName("yui-layout-bd","div")[0];if(f){this.body=f}var i=this.getElementsByClassName("yui-layout-ft","div")[0];if(i){this.footer=i}this.on("contentChange",this.resize,this,true);this._lastScrollTop=0;this.set("animate",this.get("animate"))},initAttributes:function(f){b.superclass.initAttributes.call(this,f);
this.setAttributeConfig("wrap",{value:f.wrap||null,method:function(g){if(g){var h=d.generateId(g);b._instances[h]=this}}});this.setAttributeConfig("grids",{value:f.grids||false});this.setAttributeConfig("top",{value:f.top||0,validator:e.isNumber,method:function(g){if(!this._collapsing){this.setStyle("top",g+"px")}}});this.setAttributeConfig("left",{value:f.left||0,validator:e.isNumber,method:function(g){if(!this._collapsing){this.setStyle("left",g+"px")}}});this.setAttributeConfig("minWidth",{value:f.minWidth||false,validator:YAHOO.lang.isNumber});this.setAttributeConfig("maxWidth",{value:f.maxWidth||false,validator:YAHOO.lang.isNumber});this.setAttributeConfig("minHeight",{value:f.minHeight||false,validator:YAHOO.lang.isNumber});this.setAttributeConfig("maxHeight",{value:f.maxHeight||false,validator:YAHOO.lang.isNumber});this.setAttributeConfig("height",{value:f.height,validator:e.isNumber,method:function(g){if(!this._collapsing){if(g<0){g=0}this.setStyle("height",g+"px")}}});this.setAttributeConfig("width",{value:f.width,validator:e.isNumber,method:function(g){if(!this._collapsing){if(g<0){g=0
}this.setStyle("width",g+"px")}}});this.setAttributeConfig("zIndex",{value:f.zIndex||false,method:function(g){this.setStyle("zIndex",g)}});this.setAttributeConfig("position",{value:f.position});this.setAttributeConfig("gutter",{value:f.gutter||0,validator:YAHOO.lang.isString,method:function(h){var g=h.split(" ");if(g.length){this._gutter.top=parseInt(g[0],10);if(g[1]){this._gutter.right=parseInt(g[1],10)}else{this._gutter.right=this._gutter.top}if(g[2]){this._gutter.bottom=parseInt(g[2],10)}else{this._gutter.bottom=this._gutter.top}if(g[3]){this._gutter.left=parseInt(g[3],10)}else{if(g[1]){this._gutter.left=this._gutter.right}else{this._gutter.left=this._gutter.top}}}}});this.setAttributeConfig("parent",{writeOnce:true,value:f.parent||false,method:function(g){if(g){g.on("resize",this.resize,this,true)}}});this.setAttributeConfig("collapseSize",{value:f.collapseSize||25,validator:YAHOO.lang.isNumber});this.setAttributeConfig("duration",{value:f.duration||0.5});this.setAttributeConfig("easing",{value:f.easing||((YAHOO.util&&YAHOO.util.Easing)?YAHOO.util.Easing.BounceIn:"false")});
this.setAttributeConfig("animate",{value:((f.animate===false)?false:true),validator:function(){var g=false;if(YAHOO.util.Anim){g=true}return g},method:function(g){if(g){this._anim=new YAHOO.util.Anim(this.get("element"),{},this.get("duration"),this.get("easing"))}else{this._anim=false}}});this.setAttributeConfig("header",{value:f.header||false,method:function(g){if(g===false){if(this.header){d.addClass(this.body,"yui-layout-bd-nohd");this.header.parentNode.removeChild(this.header);this.header=null}}else{if(!this.header){var j=this.getElementsByClassName("yui-layout-hd","div")[0];if(!j){j=this._createHeader()}this.header=j}var i=this.header.getElementsByTagName("h2")[0];if(!i){i=document.createElement("h2");this.header.appendChild(i)}i.innerHTML=g;if(this.body){d.removeClass(this.body,"yui-layout-bd-nohd")}}this.fireEvent("contentChange",{target:"header"})}});this.setAttributeConfig("proxy",{writeOnce:true,value:((f.proxy===false)?false:true)});this.setAttributeConfig("body",{value:f.body||false,method:function(i){if(!this.body){var g=this.getElementsByClassName("yui-layout-bd","div")[0];
if(g){this.body=g}else{g=document.createElement("div");g.className="yui-layout-bd";this.body=g;this.get("wrap").appendChild(g)}}if(!this.header){d.addClass(this.body,"yui-layout-bd-nohd")}d.addClass(this.body,"yui-layout-bd-noft");var h=null;if(e.isString(i)){h=d.get(i)}else{if(i&&i.tagName){h=i}}if(h){var j=d.generateId(h);b._instances[j]=this;this.body.appendChild(h)}else{this.body.innerHTML=i}this._cleanGrids();this.fireEvent("contentChange",{target:"body"})}});this.setAttributeConfig("footer",{value:f.footer||false,method:function(h){if(h===false){if(this.footer){d.addClass(this.body,"yui-layout-bd-noft");this.footer.parentNode.removeChild(this.footer);this.footer=null}}else{if(!this.footer){var i=this.getElementsByClassName("yui-layout-ft","div")[0];if(!i){i=document.createElement("div");i.className="yui-layout-ft";this.footer=i;this.get("wrap").appendChild(i)}else{this.footer=i}}var g=null;if(e.isString(h)){g=d.get(h)}else{if(h&&h.tagName){g=h}}if(g){this.footer.appendChild(g)}else{this.footer.innerHTML=h
}d.removeClass(this.body,"yui-layout-bd-noft")}this.fireEvent("contentChange",{target:"footer"})}});this.setAttributeConfig("close",{value:f.close||false,method:function(g){if(this.get("position")=="center"){return false}if(!this.header){this._createHeader()}var h=d.getElementsByClassName("close","div",this.header)[0];if(g){if(!this.get("header")){this.set("header","&nbsp;")}if(!h){h=document.createElement("div");h.className="close";this.header.appendChild(h);a.on(h,"click",this.close,this,true)}h.title=this.STR_CLOSE}else{if(h){a.purgeElement(h);h.parentNode.removeChild(h)}}this._configs.close.value=g;this.set("collapse",this.get("collapse"))}});this.setAttributeConfig("collapse",{value:f.collapse||false,method:function(g){if(this.get("position")=="center"){return false}if(!this.header){this._createHeader()}var h=d.getElementsByClassName("collapse","div",this.header)[0];if(g){if(!this.get("header")){this.set("header","&nbsp;")}if(!h){h=document.createElement("div");this.header.appendChild(h);
a.on(h,"click",this.collapse,this,true)}h.title=this.STR_COLLAPSE;h.className="collapse"+((this.get("close"))?" collapse-close":"")}else{if(h){a.purgeElement(h);h.parentNode.removeChild(h)}}}});this.setAttributeConfig("scroll",{value:(((f.scroll===true)||(f.scroll===false)||(f.scroll===null))?f.scroll:false),method:function(g){if((g===false)&&!this._collapsed){if(this.body){if(this.body.scrollTop>0){this._lastScrollTop=this.body.scrollTop}}}if(g===true){this.addClass("yui-layout-scroll");this.removeClass("yui-layout-noscroll");if(this._lastScrollTop>0){if(this.body){this.body.scrollTop=this._lastScrollTop}}}else{if(g===false){this.removeClass("yui-layout-scroll");this.addClass("yui-layout-noscroll")}else{if(g===null){this.removeClass("yui-layout-scroll");this.removeClass("yui-layout-noscroll")}}}}});this.setAttributeConfig("hover",{writeOnce:true,value:f.hover||false,validator:YAHOO.lang.isBoolean});this.setAttributeConfig("useShim",{value:f.useShim||false,validator:YAHOO.lang.isBoolean,method:function(g){if(this._resize){this._resize.set("useShim",g)
}}});this.setAttributeConfig("resize",{value:f.resize||false,validator:function(g){if(YAHOO.util&&YAHOO.util.Resize){return true}return false},method:function(g){if(g&&!this._resize){if(this.get("position")=="center"){return false}var i=false;switch(this.get("position")){case"top":i="b";break;case"bottom":i="t";break;case"right":i="l";break;case"left":i="r";break}this.setStyle("position","absolute");if(i){this._resize=new YAHOO.util.Resize(this.get("element"),{proxy:this.get("proxy"),hover:this.get("hover"),status:false,autoRatio:false,handles:[i],minWidth:this.get("minWidth"),maxWidth:this.get("maxWidth"),minHeight:this.get("minHeight"),maxHeight:this.get("maxHeight"),height:this.get("height"),width:this.get("width"),setSize:false,useShim:this.get("useShim"),wrap:false});this._resize._handles[i].innerHTML='<div class="yui-layout-resize-knob"></div>';if(this.get("proxy")){var h=this._resize.getProxyEl();h.innerHTML='<div class="yui-layout-handle-'+i+'"></div>'}this._resize.on("startResize",function(j){this._lastScroll=this.get("scroll");
this.set("scroll",false);if(this.get("parent")){this.get("parent").fireEvent("startResize");var k=this.get("parent").getUnitByPosition("center");this._lastCenterScroll=k.get("scroll");k.addClass(this._resize.CSS_RESIZING);k.set("scroll",false)}this.fireEvent("startResize")},this,true);this._resize.on("resize",function(j){this.set("height",j.height);this.set("width",j.width)},this,true);this._resize.on("endResize",function(j){this.set("scroll",this._lastScroll);if(this.get("parent")){var k=this.get("parent").getUnitByPosition("center");k.set("scroll",this._lastCenterScroll);k.removeClass(this._resize.CSS_RESIZING)}this.resize();this.fireEvent("endResize")},this,true)}}else{if(this._resize){this._resize.destroy()}}}});this.setAttributeConfig("dataSrc",{value:f.dataSrc});this.setAttributeConfig("loadMethod",{value:f.loadMethod||"GET",validator:YAHOO.lang.isString});this.setAttributeConfig("dataLoaded",{value:false,validator:YAHOO.lang.isBoolean,writeOnce:true});this.setAttributeConfig("dataTimeout",{value:f.dataTimeout||null,validator:YAHOO.lang.isNumber})
},_cleanGrids:function(){if(this.get("grids")){var f=c.query("div.yui-b",this.body,true);if(f){d.removeClass(f,"yui-b")}a.onAvailable("yui-main",function(){d.setStyle(c.query("#yui-main"),"margin-left","0");d.setStyle(c.query("#yui-main"),"margin-right","0")})}},_createHeader:function(){var f=document.createElement("div");f.className="yui-layout-hd";if(this.get("firstChild")){this.get("wrap").insertBefore(f,this.get("wrap").firstChild)}else{this.get("wrap").appendChild(f)}this.header=f;return f},destroy:function(h){if(this._resize){this._resize.destroy()}var g=this.get("parent");this.setStyle("display","none");if(this._clip){this._clip.parentNode.removeChild(this._clip);this._clip=null}if(!h){g.removeUnit(this)}if(g){g.removeListener("resize",this.resize,this,true)}this.unsubscribeAll();a.purgeElement(this.get("element"));this.get("parentNode").removeChild(this.get("element"));delete YAHOO.widget.LayoutUnit._instances[this.get("id")];for(var f in this){if(e.hasOwnProperty(this,f)){this[f]=null;
delete this[f]}}return g},toString:function(){if(this.get){return"LayoutUnit #"+this.get("id")+" ("+this.get("position")+")"}return"LayoutUnit"}});YAHOO.widget.LayoutUnit=b})();YAHOO.register("layout",YAHOO.widget.Layout,{version:"2.7.0",build:"1799"});var globalErrorsId="global_errors";var fieldErrorIdSuffix="_error";if(!Array.prototype.push){Array.prototype.push=function(){var b=this.length;for(var a=0;a<arguments.length;a++){this[b+a]=arguments[a]}return this.length}}if(!Function.prototype.apply){Function.prototype.apply=function(object,parameters){var parameterStrings=new Array();if(!object){object=window}if(!parameters){parameters=new Array()}for(var i=0;i<parameters.length;i++){parameterStrings[i]="parameters["+i+"]"}object.__apply__=this;var result=eval("object.__apply__("+parameterStrings.join(", ")+")");object.__apply__=null;return result}}var ValangValidator=function(a,b,c){this.name=a;this.rules=c;this.form=this._findForm(a);if(b){this._installSelfWithForm()}};ValangValidator.prototype={validate:function(){return this._validateAndReturnFailedRules().length>0
},validateAndShowFeedback:function(){var a=this._validateAndReturnFailedRules();if(a.length>0){this.showValidationFeedback(a)}return a.length===0},showValidationFeedback:function(e){var b=new Array();for(var d=0;d<e.length;d++){var a=e[d].field+fieldErrorIdSuffix;var h=document.getElementById(a);if(h!=null){h.innerHTML=e[d].getErrorMessage()}else{b.push(e[d])}}var c=document.getElementById(globalErrorsId);if(c!=null){var g=document.createElement("ul");for(var d=0;d<b.length;d++){var k=document.createElement("li");k.innerHTML=b[d].getErrorMessage();g.appendChild(k)}c.appendChild(g)}else{var j="";for(var d=0;d<b.length;d++){j=j+b[d].getErrorMessage()+"\n"}alert(j)}var f=this.form.getFieldsWithName(e[0].field);if(f.length>0){f[0].activate()}},_findForm:function(a){var c=document.getElementById(a);if(!c||c.tagName.toLowerCase()!="form"){c=document.getElementById(a+"ValangValidator")}if(!c||c.tagName.toLowerCase()!="script"){throw"unable to find form with ID '"+a+"' or script element with ID '"+a+"ValangValidator'"
}var b=c;while(c&&c.tagName.toLowerCase()!="form"){c=c.parentNode}if(!c){throw"unable to find FORM element enclosing element with ID '"+b.id+"'"}return new ValangValidator.Form(c)},_installSelfWithForm:function(){var c=window.onload;var b=this.form.formElement.onsubmit;var a=this;window.onload=function(){ValangValidator.Logger.log("Installing ValangValidator '"+a.name+"' as onsubmit handler");try{if(c){c()}}finally{a.form.formElement.onsubmit=function(){if(!b||b()){return a.validateAndShowFeedback()}}}}},_validateAndReturnFailedRules:function(){this._clearGlobalErrors();ValangValidator.Logger.push("Starting validation");var a=new Array();for(var b=0;b<this.rules.length;b++){var c=this.rules[b];this._clearErrorIfExists(c.field);ValangValidator.Logger.push("Evaluating rule for field ["+c.field+"]");c.form=this.form;if(!c.validate()){ValangValidator.Logger.pop("Failed");a.push(c)}else{ValangValidator.Logger.pop("Passed")}}ValangValidator.Logger.pop("Finshed - "+a.length+" failed rules");return this._giveRulesSameOrderAsFormFields(a)
},_clearErrorIfExists:function(b){var a=document.getElementById(b+fieldErrorIdSuffix);if(a!=null){a.innerHTML=""}},_clearGlobalErrors:function(){var a=document.getElementById(globalErrorsId);if(a!=null){a.innerHTML=""}},_giveRulesSameOrderAsFormFields:function(c){var e=new Array();var a=this.form.getFields();for(var d=0;d<a.length;d++){var f=a[d].name;for(var b=0;b<c.length;b++){if(c[b]&&c[b].field==f){e.push(c[b]);c[b]=null}}}for(var d=0;d<c.length;d++){if(c[d]){e.push(c[d])}}return e}};ValangValidator.Logger={log:function(c){var a=document.getElementById("valangLogDiv");if(a){var b=a.innerHTML;a.innerHTML=this._indentString("&nbsp;")+c+(b.length>0?"<br>"+b:"")}},push:function(a){this.log(a);this._indent++},pop:function(a){this._indent--;this.log(a)},logFunctionCalls:function(b){for(var a in b){var c=b[a];if(typeof c=="function"){b[a]=this._wrapFunctionCallWithLog(a,c)}}},_indent:0,_indentString:function(c){var a="";for(var b=0;b<this._indent*5;b++){a+=c}return a},_wrapFunctionCallWithLog:function(a,b){return function(){ValangValidator.Logger.push("calling "+a+"("+arguments[0]+", "+arguments[1]+")");
try{var c=b.apply(this,arguments)}catch(d){ValangValidator.Logger.pop("threw "+d);throw d}ValangValidator.Logger.pop("result = "+c);return c}}};ValangValidator.Form=function(a){this.formElement=a};ValangValidator.Form.prototype={getValue:function(d){var a=this.getFieldsWithName(d);var c=new Array();for(var b=0;b<a.length;b++){if(a[b].getValue()){c.push(a[b].getValue())}}if(c.length==1){return c[0]}else{if(c.length>1){return c}}},getFieldsWithName:function(e){var d=new Array();var a=this.getFields();for(var b=0;b<a.length;b++){var c=a[b];if(c.name==e){d.push(c)}}return d},getFields:function(){var a=new Array();var c=this.formElement.elements;for(var b=0;b<c.length;b++){a.push(new ValangValidator.Field(c[b]))}return a},disable:function(){var a=this.getFields();for(var b=0;b<a.length;b++){a[b].disable()}},enable:function(){var a=this.getFields();for(var b=0;b<a.length;b++){a[b].enable()}},focusFirstElement:function(c){var a=this.getFields();for(var b=0;b<a.length;b++){var d=a[b];if(d.type!="hidden"&&!d.isDisabled()){d.activate();
break}}}};ValangValidator.Field=function(a){this.id=a.id;this.name=a.name;this.type=a.type.toLowerCase();this.tagName=a.tagName.toLowerCase();this.fieldElement=a;if(ValangValidator.Field.ValueGetters[this.tagName]){this.getValue=ValangValidator.Field.ValueGetters[this.tagName]}else{if(this.tagName=="input"){switch(this.type){case"submit":case"hidden":case"password":case"text":this.getValue=ValangValidator.Field.ValueGetters.textarea;break;case"checkbox":case"radio":this.getValue=ValangValidator.Field.ValueGetters.inputSelector;break;default:throw"unexpected input field type '"+this.type+"'"}}else{throw"unexpected form field tag name '"+this.tagName+"'"}}};ValangValidator.Field.prototype={clear:function(){this.fieldElement.value=""},focus:function(){this.fieldElement.focus()},select:function(){if(this.fieldElement.select){this.fieldElement.select()}},activate:function(){this.focus();this.select()},isDisabled:function(){return element.disabled},disable:function(){element.blur();element.disabled="true"
},enable:function(){element.disabled=""}};ValangValidator.Field.ValueGetters={inputSelector:function(){if(this.fieldElement.checked){return this.fieldElement.value}},textarea:function(){return this.fieldElement.value},select:function(){var d="";if(this.fieldElement.type=="select-one"){var a=this.fieldElement.selectedIndex;if(a>=0){d=this.fieldElement.options[a].value}}else{d=new Array();for(var b=0;b<element.length;b++){var c=this.fieldElement.options[b];if(c.selected){d.push(c.value)}}}return d}};ValangValidator.Rule=function(d,b,c,a){this.field=d;this.valang=b;this.errorMessage=c;this.validate=a};ValangValidator.Rule.prototype={getErrorMessage:function(){return this.errorMessage},getPropertyValue:function(a,b){return this.form.getValue(a)},_assertHasLength:function(a){if(!a.length){throw"value '"+a+"' does not have length"}},_assertLength:function(b,a){this._assertHasLength(b);if(b.length!=a){throw"value's length != '"+a+"'"}},_throwError:function(a){throw a},_makeCompatible:function(a,e){try{this._forceNumber(e);
return this._forceNumber(a)}catch(b){}var c=typeof a;var d=typeof e;if(c==d){return a}else{if(c=="number"||d=="number"){return this._forceNumber(a)}else{throw"unable to convert ["+a+"] and ["+e+"] to compatible types"}}},_forceNumber:function(value){if(typeof value!="number"){try{var newValue=eval(value.toString())}catch(ex){}if(newValue&&typeof newValue=="number"){return newValue}throw"unable to convert value ["+value+"] to number"}return value},lengthOf:function(a){return(a!=null)?a.length:0},lowerCase:function(a){return(a!=null)?a.toLowerCase():null},upperCase:function(a){return(a!=null)?a.toUpperCase():null},equals:function(a,b){if((a==null&&b!=null)||(b==null&&a!=null)){return false}if(a==b){return true}a=this._makeCompatible(a,b);b=this._makeCompatible(b,a);return a===b},lessThan:function(a,b){a=this._makeCompatible(a,b);b=this._makeCompatible(b,a);return a<b},lessThanOrEquals:function(a,b){a=this._makeCompatible(a,b);b=this._makeCompatible(b,a);return a<=b},moreThan:function(a,b){a=this._makeCompatible(a,b);
b=this._makeCompatible(b,a);return a>b},moreThanOrEquals:function(a,b){a=this._makeCompatible(a,b);b=this._makeCompatible(b,a);return a>=b},inFunc:function(a,d){for(var b=0;b<d.length;b++){var c=d[b];if(a==c){return true}}return false},between:function(a,b){this._assertLength(b,2);a=this._makeCompatible(a,b[0]);b[0]=this._makeCompatible(b[0],a);b[1]=this._makeCompatible(b[1],a);return a>=b[0]&&a<=b[1]},nullFunc:function(a,b){return a===null||typeof a=="undefined"},hasText:function(a,b){return a&&a.replace(/\s/g,"").length>0},hasLength:function(a,b){return a&&a.length>0},isBlank:function(a,b){return !a||a.length===0},isWord:function(a,b){return a&&a.replace(/\s/g,"")==a},isUpper:function(a,b){return a&&a.toUpperCase()==a},isLower:function(a,b){return a&&a.toLowerCase()==a},add:function(a,b){return this._forceNumber(a)+this._forceNumber(b)},divide:function(a,b){return this._forceNumber(a)/this._forceNumber(b)},modulo:function(a,b){return this._forceNumber(a)%this._forceNumber(b)},multiply:function(a,b){return this._forceNumber(a)*this._forceNumber(b)
},subtract:function(a,b){return this._forceNumber(a)-this._forceNumber(b)},RegExFunction:function(b,a){if(!a.match){throw"don't know how to apply regexp to value '"+a+"'"}return a.match(b)[0]==a},EmailFunction:function(b){var a=/^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6}$/;return a.test(b)}};// $Revision$ $Date$

function readCookie(cookieName) {
	var theCookie=""+document.cookie;
	var ind=theCookie.indexOf(cookieName);
	if (ind==-1 || cookieName=="") return "";
	var ind1=theCookie.indexOf(';',ind);
	if (ind1==-1) ind1=theCookie.length;
	return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

function setCookie(cookieName,cookieValue,nDays) {
	var today = new Date();
	var expire = new Date();
	if (nDays==null || nDays==0) nDays=1;
	expire.setTime(today.getTime() + 3600000*24*nDays);
	document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString();
}

function checkCookie() {
	var cookieName = "CB_COOKIES_ENABLED";
	setCookie(cookieName,"anything");
	var mycookie = readCookie(cookieName);
	if (mycookie == null || mycookie == '') {
		document.write('<FONT SIZE="+3" COLOR="red"><STRONG>Cookies are currently not enabled in your browser, please enable them!</STRONG></FONT><P>')
	} else {
		setCookie(cookieName, "");
	}
}
//$Revision$ $Date$

function cb_help_window(url) {
	window.open('' + url,'CBHelpWindow','scrollbars=yes,resizable=yes,toolbar=no,height=410,width=500');
}

function launch_url(gotourl, geometry, window_name) {
	var window_features = "toobar=no,location=no,directories=no,status=no,"
		+ "menubar=no,scrollbars=yes,resizable=yes";

	var width = null;
	var height = null;
	var min_height = null;
	if (geometry == null) {
		width = Math.round(screen.width *  6 / 10);
		height = Math.round(screen.height * 6 / 10);
		min_height = 600;
	} else if (geometry == 'half_half') {
		width = Math.round(screen.width *  5 / 10);
		height = Math.round(screen.height * 5 / 10);
		min_height = 100;
	} else if (geometry == 'thin_wide') {
		width = Math.round(screen.width *  5 / 10);
		height = Math.round(screen.height * 3 / 10);
		min_height = 100;
	} else if (geometry == 'small_wide') {
		width = Math.round(screen.width *  45 / 100);
		height = Math.round(screen.height * 5 / 10);
		min_height = 100;
	} else if (geometry == 'minimal') {
		width = 1;
		height = 1;
	} else if (geometry == 'full_half') {	// a full width, but "nearly-half" height
		width = screen.width;
		height = Math.round(screen.height * 0.6);
	} else {
		width = Math.round(screen.width *  5 / 10);
		height = Math.round(screen.height * 5 / 10);
		min_height = 300;
	}
	if (height < min_height) {
		height = min_height;
	}

	window_features += ",width=" + width + ",height=" + height;

	if (window_name == null) {
		window_name = '_blank';
	}

	window.open(gotourl, window_name, window_features);
	return false;
}

function setAllStatesByValue(selector, property) {
	var val = selector.checked;
	var frm = selector.form;

	var length = frm.elements.length;
	var endsWith = property.indexOf('*') == 0;
	if (endsWith) {
		property = property.substring(1);
	}

	if (!property) {
		return;
	}

	for (var i=0; i < length; i++) {
		var e = frm.elements[i];
		// check if the form elem has value property, for example "fieldset" does not have it
		if (e.value) {
			if (endsWith) {
				if(e.value.endsWith(property)) {
					setChecked(e, val);
				}
			} else {
				if(e.value.indexOf(property) == 0) {
					setChecked(e, val);
				}
			}
		}
	}
}

/**
 * Set all states from all checkboxes to same value as a checkbox
 * @param fromSelect The orginal checkbox to copy values from
 * @param property The property name filter, only checkboxes with this name will change
 * @param filter Optional closure function, determines if the checkbox is checked
 */
function setAllStatesFrom(fromSelector, property, closure) {
	var val = fromSelector.checked;
	var frm = fromSelector.form;

	var length = frm.elements.length;
	for (var i=0; i < length; i++) {
		var e = frm.elements[i];
		// check if the form elem has name property, for example "fieldset" does not have it
		var match = (e.name && e.name.indexOf(property) != -1);
		// call the closure (if provided) to see if value changes
		match = match && (closure == null || closure.call(this,e));
		if (match) {
			setChecked(e, val);
		}
	}
}

/**
 * closure function class matches elements within the same table table as an original element.
 * Use as below, where the element, the element which is in the current table to filter for...
 * var closureFunc = new InSameTableClosure(element);
 *
 * @param element The reference element of-which the other elements must be in the same table
 * @return the closure function to call with other elements.
 */
function InSameTableClosure(element) {
	this.parentTable = this.findParentTable(element);
	var THIS = this;
	return function(e) {
			return THIS.isInSameTable.call(THIS, e);
		};
}

// functions for InSameTableClosure class
InSameTableClosure.prototype = {
	// parent table found
	parentTable: null,

	// function finds parent table
	// @param element The element to start at
	// @return the parent table, or null if not found
	findParentTable: function(element) {
		while (element != null && element.tagName != "TABLE") {
			element = element.parentNode;
		}
		return element;
	},

	// closure function checks if the given element is in the same table as the original
	isInSameTable: function(element) {
		var elemParentTable = this.findParentTable(element);
		return elemParentTable == this.parentTable;
	}

}

/**
 * Sets all checkbox states of a certain property.
 * @param frm The form
 * @param the checkboxes with this name will get the new value
 * @param forcedValue Boolean: if not null this value will be set as value to all checkboxes, if null then the current value of the 1st checkbox is copied to the others
 */
function setAllStates(frm, property, forcedValue) {
	var val = false;
	var firstOccurrence = true;
	if (typeof forcedValue != 'undefined') {
		firstOccurrence = false;
		val = forcedValue;
	}

	var length = frm.elements.length;
	for (var i=0; i < length; i++) {
		var e = frm.elements[i];
		// check if the form elem has name property, for example "fieldset" does not have it
		if(e.name && e.name.indexOf(property) != -1) {
			if (firstOccurrence) {
				firstOccurrence = false;
				val = !e.checked;	// If the first is set, unset all vica versa.
			}
			setChecked(e, val);
		}
	}
}

/*
 * Set a checkbox checked, so it will update the colors using TableHighlighter.js
 */
function setChecked(e, val) {
	// do not change the <input type="hidden" ... > fields, they are there just to fix the issue with checkboxes
	if (e.type == "hidden") {
		return;
	}

	e.checked = val;

	// notify tableHighlighter to update the row colors
	if (typeof tableHighlighter !="undefined" && tableHighlighter) {
		tableHighlighter.updateRowOfCheckbox(e);
	}
	// call event handler, because changing e.checked won't fire events
	// check if has onchange event-handler, and call it,
	if (typeof e.onchange == "function") {
		e.onchange.call(e);
	}
	// check if has onclick event-handler, and call it
	if (typeof e.onclick == "function") {
		e.onclick.call(e);
	}
}

/**
 * Check if the form is submittable if at least one checkbox selected.
 * @param frm The form to submit
 * @param property The checkbox property on the from to check
 */
function hasSelectedCheckbox(frm, property) {
	var found = ! forAllFields(frm, property, function(e) {
		// is it a checked checkbox?
		if (e.checked) {
			return false;
		}
		// not checkbox, continue
		return true;
	});

	return found;
}

/**
  Check if the form is submittable  if at least one checkbox selected.
  @param frm The form to submit
  @param property The checkbox property on the from to check
  @param url Optional parameter, if provided this url will be pulled if at least one checkbox is selected
  @return true if the form was submitted successfully
 */
function submitIfSelected(frm, property, url) {
	var found = hasSelectedCheckbox(frm, property);

	if (found) {
		if (url != null && url.length != 0) {
			document.location.href=url;
		}
	} else {
		alert('Please select some items first.');
	}
	return found;
}

/**
 * Find all fields in a form with a certain name
 * @param frm The form to search checkboxes inside
 * @param property the checkbox's name to look for
 * @param funct The function will be called back with the form element as first parameter,
 * 					it should return true to continue iteration,
 *					if false returned iteration will stop
 * @return true if all fields iterated, or false if the function returned false at least once, so iteration stopped
 */
function forAllFields(frm, property, func) {
	var length = frm.elements.length;
	for (var i=0; i < length; i++) {
		var e = frm.elements[i];
		// check if the form elem has name property, for example "fieldset" does not have it
		if(e && e.name && e.name.indexOf(property) != -1) {
			var cont = func.call(this, e);
			// exit if function says return false
			if (!cont) {
				return false;
			}
		}
	}
	return true;
}

/**
 * Get all "value" of the checked checkboxes.
 * @param frm The form where checkboxes are
 * @param property checkbox field name
 * @return array of values of checked checkboxes
 */
function findAllCheckedCheckboxValues(frm, property) {
	var values = new Array();
	forAllFields(frm, property, function(e) {
		if (e.checked) {
			values[values.length] = e.value;
		}
		return true;
	});
	return values;
}

/**
 * Set all input boxes/fields disabled or enabled on a form.
 * Won't disable/enable buttons though, to be able to click on "cancel" for example.
 *
 * @param form The form to search on
 * @param disabled if the fields will be disabled
 */
function setEditFieldsDisabled(frm, disabled) {
	var length = frm.elements.length;
	for (var i=0; i < length; i++) {
		var e = frm.elements[i];
		var inputfield = (e.tagName == "INPUT");
		// do not disable buttons, so we can still navigate
		var isbutton = inputfield && (e.type == "submit" || e.type == "button");
		// hidden fields are not disabled as they may contain required fields like tracker_id, which are not submitted
		var ishidden = inputfield && (e.type == "hidden");
		if (!isbutton && !ishidden) {
			e.disabled = disabled;
		}
	}
}

// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. 
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================

/* 
AnchorPosition.js
Author: Matt Kruse
Last modified: 10/11/02

DESCRIPTION: These functions find the position of an <A> tag in a document,
so other elements can be positioned relative to it.

COMPATABILITY: Netscape 4.x,6.x,Mozilla, IE 5.x,6.x on Windows. Some small
positioning errors - usually with Window positioning - occur on the 
Macintosh platform.

FUNCTIONS:
getAnchorPosition(anchorname)
  Returns an Object() having .x and .y properties of the pixel coordinates
  of the upper-left corner of the anchor. Position is relative to the PAGE.

getAnchorWindowPosition(anchorname)
  Returns an Object() having .x and .y properties of the pixel coordinates
  of the upper-left corner of the anchor, relative to the WHOLE SCREEN.

NOTES:

1) For popping up separate browser windows, use getAnchorWindowPosition. 
   Otherwise, use getAnchorPosition

2) Your anchor tag MUST contain both NAME and ID attributes which are the 
   same. For example:
   <A NAME="test" ID="test"> </A>

3) There must be at least a space between <A> </A> for IE5.5 to see the 
   anchor tag correctly. Do not do <A></A> with no space.
*/ 

// getAnchorPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the page.
function getAnchorPosition(anchorname) {
	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if (document.getElementById) { use_gebi=true; }
	else if (document.all) { use_css=true; }
	else if (document.layers) { use_layers=true; }
	// Logic to find position
 	if (use_gebi && document.all) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_gebi) {
		var o=document.getElementById(anchorname);
		x=AnchorPosition_getPageOffsetLeft(o);
		y=AnchorPosition_getPageOffsetTop(o);
		}
 	else if (use_css) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_layers) {
		var found=0;
		for (var i=0; i<document.anchors.length; i++) {
			if (document.anchors[i].name==anchorname) { found=1; break; }
			}
		if (found==0) {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		x=document.anchors[i].x;
		y=document.anchors[i].y;
		}
	else {
		coordinates.x=0; coordinates.y=0; return coordinates;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// getAnchorWindowPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the window
function getAnchorWindowPosition(anchorname) {
	var coordinates=getAnchorPosition(anchorname);
	var x=0;
	var y=0;
	if (document.getElementById) {
		if (isNaN(window.screenX)) {
			x=coordinates.x-document.body.scrollLeft+window.screenLeft;
			y=coordinates.y-document.body.scrollTop+window.screenTop;
			}
		else {
			x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
			y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
			}
		}
	else if (document.all) {
		x=coordinates.x-document.body.scrollLeft+window.screenLeft;
		y=coordinates.y-document.body.scrollTop+window.screenTop;
		}
	else if (document.layers) {
		x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
		y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// Functions for IE to get position of an object
function AnchorPosition_getPageOffsetLeft (el) {
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol;
	}
function AnchorPosition_getWindowOffsetLeft (el) {
	return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
	}	
function AnchorPosition_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
	}
function AnchorPosition_getWindowOffsetTop (el) {
	return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
	}
// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. 
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================

/* 
PopupWindow.js
Author: Matt Kruse
Last modified: 02/16/04

DESCRIPTION: This object allows you to easily and quickly popup a window
in a certain place. The window can either be a DIV or a separate browser
window.

COMPATABILITY: Works with Netscape 4.x, 6.x, IE 5.x on Windows. Some small
positioning errors - usually with Window positioning - occur on the 
Macintosh platform. Due to bugs in Netscape 4.x, populating the popup 
window with <STYLE> tags may cause errors.

USAGE:
// Create an object for a WINDOW popup
var win = new PopupWindow(); 

// Create an object for a DIV window using the DIV named 'mydiv'
var win = new PopupWindow('mydiv'); 

// Set the window to automatically hide itself when the user clicks 
// anywhere else on the page except the popup
win.autoHide(); 

// Show the window relative to the anchor name passed in
win.showPopup(anchorname);

// Hide the popup
win.hidePopup();

// Set the size of the popup window (only applies to WINDOW popups
win.setSize(width,height);

// Populate the contents of the popup window that will be shown. If you 
// change the contents while it is displayed, you will need to refresh()
win.populate(string);

// set the URL of the window, rather than populating its contents
// manually
win.setUrl("http://www.site.com/");

// Refresh the contents of the popup
win.refresh();

// Specify how many pixels to the right of the anchor the popup will appear
win.offsetX = 50;

// Specify how many pixels below the anchor the popup will appear
win.offsetY = 100;

NOTES:
1) Requires the functions in AnchorPosition.js

2) Your anchor tag MUST contain both NAME and ID attributes which are the 
   same. For example:
   <A NAME="test" ID="test"> </A>

3) There must be at least a space between <A> </A> for IE5.5 to see the 
   anchor tag correctly. Do not do <A></A> with no space.

4) When a PopupWindow object is created, a handler for 'onmouseup' is
   attached to any event handler you may have already defined. Do NOT define
   an event handler for 'onmouseup' after you define a PopupWindow object or
   the autoHide() will not work correctly.
*/ 

// Set the position of the popup window based on the anchor
function PopupWindow_getXYPosition(anchorname) {
	var coordinates;
	if (this.type == "WINDOW") {
		coordinates = getAnchorWindowPosition(anchorname);
		}
	else {
		coordinates = getAnchorPosition(anchorname);
		}
	this.x = coordinates.x;
	this.y = coordinates.y;
	}
// Set width/height of DIV/popup window
function PopupWindow_setSize(width,height) {
	this.width = width;
	this.height = height;
	}
// Fill the window with contents
function PopupWindow_populate(contents) {
	this.contents = contents;
	this.populated = false;
	}
// Set the URL to go to
function PopupWindow_setUrl(url) {
	this.url = url;
	}
// Set the window popup properties
function PopupWindow_setWindowProperties(props) {
	this.windowProperties = props;
	}
// Refresh the displayed contents of the popup
function PopupWindow_refresh() {
	if (this.divName != null) {
		// refresh the DIV object
		if (this.use_gebi) {
			document.getElementById(this.divName).innerHTML = this.contents;
			}
		else if (this.use_css) { 
			document.all[this.divName].innerHTML = this.contents;
			}
		else if (this.use_layers) { 
			var d = document.layers[this.divName]; 
			d.document.open();
			d.document.writeln(this.contents);
			d.document.close();
			}
		}
	else {
		if (this.popupWindow != null && !this.popupWindow.closed) {
			if (this.url!="") {
				this.popupWindow.location.href=this.url;
				}
			else {
				this.popupWindow.document.open();
				this.popupWindow.document.writeln(this.contents);
				this.popupWindow.document.close();
			}
			this.popupWindow.focus();
			}
		}
	}
// Position and show the popup, relative to an anchor object
function PopupWindow_showPopup(anchorname) {
	this.getXYPosition(anchorname);
	this.x += this.offsetX;
	this.y += this.offsetY;
	if (!this.populated && (this.contents != "")) {
		this.populated = true;
		this.refresh();
		}
	if (this.divName != null) {
		// Show the DIV object
		if (this.use_gebi) {
			document.getElementById(this.divName).style.left = this.x + "px";
			document.getElementById(this.divName).style.top = this.y + "px";
			document.getElementById(this.divName).style.visibility = "visible";
			}
		else if (this.use_css) {
			document.all[this.divName].style.left = this.x;
			document.all[this.divName].style.top = this.y;
			document.all[this.divName].style.visibility = "visible";
			}
		else if (this.use_layers) {
			document.layers[this.divName].left = this.x;
			document.layers[this.divName].top = this.y;
			document.layers[this.divName].visibility = "visible";
			}
		}
	else {
		if (this.popupWindow == null || this.popupWindow.closed) {
			// If the popup window will go off-screen, move it so it doesn't
			if (this.x<0) { this.x=0; }
			if (this.y<0) { this.y=0; }
			if (screen && screen.availHeight) {
				if ((this.y + this.height) > screen.availHeight) {
					this.y = screen.availHeight - this.height;
					}
				}
			if (screen && screen.availWidth) {
				if ((this.x + this.width) > screen.availWidth) {
					this.x = screen.availWidth - this.width;
					}
				}
			var avoidAboutBlank = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled );
			this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"");
			}
		this.refresh();
		}
	}
// Hide the popup
function PopupWindow_hidePopup() {
	if (this.divName != null) {
		if (this.use_gebi) {
			document.getElementById(this.divName).style.visibility = "hidden";
			}
		else if (this.use_css) {
			document.all[this.divName].style.visibility = "hidden";
			}
		else if (this.use_layers) {
			document.layers[this.divName].visibility = "hidden";
			}
		}
	else {
		if (this.popupWindow && !this.popupWindow.closed) {
			this.popupWindow.close();
			this.popupWindow = null;
			}
		}
	}
// Pass an event and return whether or not it was the popup DIV that was clicked
function PopupWindow_isClicked(e) {
	if (this.divName != null) {
		if (this.use_layers) {
			var clickX = e.pageX;
			var clickY = e.pageY;
			var t = document.layers[this.divName];
			if ((clickX > t.left) && (clickX < t.left+t.clip.width) && (clickY > t.top) && (clickY < t.top+t.clip.height)) {
				return true;
				}
			else { return false; }
			}
		else if (document.all) { // Need to hard-code this to trap IE for error-handling
			var t = window.event.srcElement;
			while (t.parentElement != null) {
				if (t.id==this.divName) {
					return true;
					}
				t = t.parentElement;
				}
			return false;
			}
		else if (this.use_gebi && e) {
			var t = e.originalTarget;
			while (t.parentNode != null) {
				if (t.id==this.divName) {
					return true;
					}
				t = t.parentNode;
				}
			return false;
			}
		return false;
		}
	return false;
	}

// Check an onMouseDown event to see if we should hide
function PopupWindow_hideIfNotClicked(e) {
	if (this.autoHideEnabled && !this.isClicked(e)) {
		this.hidePopup();
		}
	}
// Call this to make the DIV disable automatically when mouse is clicked outside it
function PopupWindow_autoHide() {
	this.autoHideEnabled = true;
	}
// This global function checks all PopupWindow objects onmouseup to see if they should be hidden
function PopupWindow_hidePopupWindows(e) {
	for (var i=0; i<popupWindowObjects.length; i++) {
		if (popupWindowObjects[i] != null) {
			var p = popupWindowObjects[i];
			p.hideIfNotClicked(e);
			}
		}
	}
// Run this immediately to attach the event listener
function PopupWindow_attachListener() {
	if (document.layers) {
		document.captureEvents(Event.MOUSEUP);
		}
	window.popupWindowOldEventListener = document.onmouseup;
	if (window.popupWindowOldEventListener != null) {
		document.onmouseup = new Function("window.popupWindowOldEventListener(); PopupWindow_hidePopupWindows();");
		}
	else {
		document.onmouseup = PopupWindow_hidePopupWindows;
		}
	}
// CONSTRUCTOR for the PopupWindow object
// Pass it a DIV name to use a DHTML popup, otherwise will default to window popup
function PopupWindow() {
	if (!window.popupWindowIndex) { window.popupWindowIndex = 0; }
	if (!window.popupWindowObjects) { window.popupWindowObjects = new Array(); }
	if (!window.listenerAttached) {
		window.listenerAttached = true;
		PopupWindow_attachListener();
		}
	this.index = popupWindowIndex++;
	popupWindowObjects[this.index] = this;
	this.divName = null;
	this.popupWindow = null;
	this.width=0;
	this.height=0;
	this.populated = false;
	this.visible = false;
	this.autoHideEnabled = false;
	
	this.contents = "";
	this.url="";
	this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";
	if (arguments.length>0) {
		this.type="DIV";
		this.divName = arguments[0];
		}
	else {
		this.type="WINDOW";
		}
	this.use_gebi = false;
	this.use_css = false;
	this.use_layers = false;
	if (document.getElementById) { this.use_gebi = true; }
	else if (document.all) { this.use_css = true; }
	else if (document.layers) { this.use_layers = true; }
	else { this.type = "WINDOW"; }
	this.offsetX = 0;
	this.offsetY = 0;
	// Method mappings
	this.getXYPosition = PopupWindow_getXYPosition;
	this.populate = PopupWindow_populate;
	this.setUrl = PopupWindow_setUrl;
	this.setWindowProperties = PopupWindow_setWindowProperties;
	this.refresh = PopupWindow_refresh;
	this.showPopup = PopupWindow_showPopup;
	this.hidePopup = PopupWindow_hidePopup;
	this.setSize = PopupWindow_setSize;
	this.isClicked = PopupWindow_isClicked;
	this.autoHide = PopupWindow_autoHide;
	this.hideIfNotClicked = PopupWindow_hideIfNotClicked;
	}
// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. 
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================

// HISTORY
// ------------------------------------------------------------------
// May 17, 2003: Fixed bug in parseDate() for dates <1970
// March 11, 2003: Added parseDate() function
// March 11, 2003: Added "NNN" formatting option. Doesn't match up
//                 perfectly with SimpleDateFormat formats, but 
//                 backwards-compatability was required.

// ------------------------------------------------------------------
// These functions use the same 'format' strings as the 
// java.text.SimpleDateFormat class, with minor exceptions.
// The format string consists of the following abbreviations:
// 
// Field        | Full Form          | Short Form
// -------------+--------------------+-----------------------
// Year         | yyyy (4 digits)    | yy (2 digits), y (2 or 4 digits)
// Month        | MMM (name or abbr.)| MM (2 digits), M (1 or 2 digits)
//              | NNN (abbr.)        |
// Day of Month | dd (2 digits)      | d (1 or 2 digits)
// Day of Week  | EE (name)          | E (abbr)
// Hour (1-12)  | hh (2 digits)      | h (1 or 2 digits)
// Hour (0-23)  | HH (2 digits)      | H (1 or 2 digits)
// Hour (0-11)  | KK (2 digits)      | K (1 or 2 digits)
// Hour (1-24)  | kk (2 digits)      | k (1 or 2 digits)
// Minute       | mm (2 digits)      | m (1 or 2 digits)
// Second       | ss (2 digits)      | s (1 or 2 digits)
// AM/PM        | a                  |
//
// NOTE THE DIFFERENCE BETWEEN MM and mm! Month=MM, not mm!
// Examples:
//  "MMM d, y" matches: January 01, 2000
//                      Dec 1, 1900
//                      Nov 20, 00
//  "M/d/yy"   matches: 01/20/00
//                      9/2/00
//  "MMM dd, yyyy hh:mm:ssa" matches: "January 01, 2000 12:30:45AM"
// ------------------------------------------------------------------

var MONTH_NAMES=new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
var DAY_NAMES=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sun','Mon','Tue','Wed','Thu','Fri','Sat');
function LZ(x) {return(x<0||x>9?"":"0")+x}

// ------------------------------------------------------------------
// isDate ( date_string, format_string )
// Returns true if date string matches format of format string and
// is a valid date. Else returns false.
// It is recommended that you trim whitespace around the value before
// passing it to this function, as whitespace is NOT ignored!
// ------------------------------------------------------------------
function isDate(val,format) {
	var date=getDateFromFormat(val,format);
	if (date==0) { return false; }
	return true;
	}

// -------------------------------------------------------------------
// compareDates(date1,date1format,date2,date2format)
//   Compare two date strings to see which is greater.
//   Returns:
//   1 if date1 is greater than date2
//   0 if date2 is greater than date1 of if they are the same
//  -1 if either of the dates is in an invalid format
// -------------------------------------------------------------------
function compareDates(date1,dateformat1,date2,dateformat2) {
	var d1=getDateFromFormat(date1,dateformat1);
	var d2=getDateFromFormat(date2,dateformat2);
	if (d1==0 || d2==0) {
		return -1;
		}
	else if (d1 > d2) {
		return 1;
		}
	return 0;
	}

// ------------------------------------------------------------------
// formatDate (date_object, format)
// Returns a date in the output format specified.
// The format string uses the same abbreviations as in getDateFromFormat()
// ------------------------------------------------------------------
function formatDate(date,format) {
	format=format+"";
	var result="";
	var i_format=0;
	var c="";
	var token="";
	var y=date.getYear()+"";
	var M=date.getMonth()+1;
	var d=date.getDate();
	var E=date.getDay();
	var H=date.getHours();
	var m=date.getMinutes();
	var s=date.getSeconds();
	var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;
	// Convert real date parts into formatted versions
	var value=new Object();
	if (y.length < 4) {y=""+(y-0+1900);}
	value["y"]=""+y;
	value["yyyy"]=y;
	value["yy"]=y.substring(2,4);
	value["M"]=M;
	value["MM"]=LZ(M);
	value["MMM"]=MONTH_NAMES[M-1];
	value["NNN"]=MONTH_NAMES[M+11];
	value["d"]=d;
	value["dd"]=LZ(d);
	value["E"]=DAY_NAMES[E+7];
	value["EE"]=DAY_NAMES[E];
	value["H"]=H;
	value["HH"]=LZ(H);
	if (H==0){value["h"]=12;}
	else if (H>12){value["h"]=H-12;}
	else {value["h"]=H;}
	value["hh"]=LZ(value["h"]);
	if (H>11){value["K"]=H-12;} else {value["K"]=H;}
	value["k"]=H+1;
	value["KK"]=LZ(value["K"]);
	value["kk"]=LZ(value["k"]);
	if (H > 11) { value["a"]="PM"; }
	else { value["a"]="AM"; }
	value["m"]=m;
	value["mm"]=LZ(m);
	value["s"]=s;
	value["ss"]=LZ(s);
	while (i_format < format.length) {
		c=format.charAt(i_format);
		token="";
		while ((format.charAt(i_format)==c) && (i_format < format.length)) {
			token += format.charAt(i_format++);
			}
		if (value[token] != null) { result=result + value[token]; }
		else { result=result + token; }
		}
	return result;
	}
	
// ------------------------------------------------------------------
// Utility functions for parsing in getDateFromFormat()
// ------------------------------------------------------------------
function _isInteger(val) {
	var digits="1234567890";
	for (var i=0; i < val.length; i++) {
		if (digits.indexOf(val.charAt(i))==-1) { return false; }
		}
	return true;
	}
function _getInt(str,i,minlength,maxlength) {
	for (var x=maxlength; x>=minlength; x--) {
		var token=str.substring(i,i+x);
		if (token.length < minlength) { return null; }
		if (_isInteger(token)) { return token; }
		}
	return null;
	}
	
// ------------------------------------------------------------------
// getDateFromFormat( date_string , format_string )
//
// This function takes a date string and a format string. It matches
// If the date string matches the format string, it returns the 
// getTime() of the date. If it does not match, it returns 0.
// ------------------------------------------------------------------
function getDateFromFormat(val,format) {
	val=val+"";
	format=format+"";
	var i_val=0;
	var i_format=0;
	var c="";
	var token="";
	var token2="";
	var x,y;
	var now=new Date();
	var year=now.getYear();
	var month=now.getMonth()+1;
	var date=1;
	var hh=now.getHours();
	var mm=now.getMinutes();
	var ss=now.getSeconds();
	var ampm="";
	
	while (i_format < format.length) {
		// Get next token from format string
		c=format.charAt(i_format);
		token="";
		while ((format.charAt(i_format)==c) && (i_format < format.length)) {
			token += format.charAt(i_format++);
			}
		// Extract contents of value based on format token
		if (token=="yyyy" || token=="yy" || token=="y") {
			if (token=="yyyy") { x=4;y=4; }
			if (token=="yy")   { x=2;y=2; }
			if (token=="y")    { x=2;y=4; }
			year=_getInt(val,i_val,x,y);
			if (year==null) { return 0; }
			i_val += year.length;
			if (year.length==2) {
				if (year > 70) { year=1900+(year-0); }
				else { year=2000+(year-0); }
				}
			}
		else if (token=="MMM"||token=="NNN"){
			month=0;
			for (var i=0; i<MONTH_NAMES.length; i++) {
				var month_name=MONTH_NAMES[i];
				if (val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()) {
					if (token=="MMM"||(token=="NNN"&&i>11)) {
						month=i+1;
						if (month>12) { month -= 12; }
						i_val += month_name.length;
						break;
						}
					}
				}
			if ((month < 1)||(month>12)){return 0;}
			}
		else if (token=="EE"||token=="E"){
			for (var i=0; i<DAY_NAMES.length; i++) {
				var day_name=DAY_NAMES[i];
				if (val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()) {
					i_val += day_name.length;
					break;
					}
				}
			}
		else if (token=="MM"||token=="M") {
			month=_getInt(val,i_val,token.length,2);
			if(month==null||(month<1)||(month>12)){return 0;}
			i_val+=month.length;}
		else if (token=="dd"||token=="d") {
			date=_getInt(val,i_val,token.length,2);
			if(date==null||(date<1)||(date>31)){return 0;}
			i_val+=date.length;}
		else if (token=="hh"||token=="h") {
			hh=_getInt(val,i_val,token.length,2);
			if(hh==null||(hh<1)||(hh>12)){return 0;}
			i_val+=hh.length;}
		else if (token=="HH"||token=="H") {
			hh=_getInt(val,i_val,token.length,2);
			if(hh==null||(hh<0)||(hh>23)){return 0;}
			i_val+=hh.length;}
		else if (token=="KK"||token=="K") {
			hh=_getInt(val,i_val,token.length,2);
			if(hh==null||(hh<0)||(hh>11)){return 0;}
			i_val+=hh.length;}
		else if (token=="kk"||token=="k") {
			hh=_getInt(val,i_val,token.length,2);
			if(hh==null||(hh<1)||(hh>24)){return 0;}
			i_val+=hh.length;hh--;}
		else if (token=="mm"||token=="m") {
			mm=_getInt(val,i_val,token.length,2);
			if(mm==null||(mm<0)||(mm>59)){return 0;}
			i_val+=mm.length;}
		else if (token=="ss"||token=="s") {
			ss=_getInt(val,i_val,token.length,2);
			if(ss==null||(ss<0)||(ss>59)){return 0;}
			i_val+=ss.length;}
		else if (token=="a") {
			if (val.substring(i_val,i_val+2).toLowerCase()=="am") {ampm="AM";}
			else if (val.substring(i_val,i_val+2).toLowerCase()=="pm") {ampm="PM";}
			else {return 0;}
			i_val+=2;}
		else {
			if (val.substring(i_val,i_val+token.length)!=token) {return 0;}
			else {i_val+=token.length;}
			}
		}
	// If there are any trailing characters left in the value, it doesn't match
	if (i_val != val.length) { return 0; }
	// Is date valid for month?
	if (month==2) {
		// Check for leap year
		if ( ( (year%4==0)&&(year%100 != 0) ) || (year%400==0) ) { // leap year
			if (date > 29){ return 0; }
			}
		else { if (date > 28) { return 0; } }
		}
	if ((month==4)||(month==6)||(month==9)||(month==11)) {
		if (date > 30) { return 0; }
		}
	// Correct hours value
	if (hh<12 && ampm=="PM") { hh=hh-0+12; }
	else if (hh>11 && ampm=="AM") { hh-=12; }
	var newdate=new Date(year,month-1,date,hh,mm,ss);
	return newdate.getTime();
	}

// ------------------------------------------------------------------
// parseDate( date_string [, prefer_euro_format] )
//
// This function takes a date string and tries to match it to a
// number of possible date formats to get the value. It will try to
// match against the following international formats, in this order:
// y-M-d   MMM d, y   MMM d,y   y-MMM-d   d-MMM-y  MMM d
// M/d/y   M-d-y      M.d.y     MMM-d     M/d      M-d
// d/M/y   d-M-y      d.M.y     d-MMM     d/M      d-M
// A second argument may be passed to instruct the method to search
// for formats like d/M/y (european format) before M/d/y (American).
// Returns a Date object or null if no patterns match.
// ------------------------------------------------------------------
function parseDate(val) {
	var preferEuro=(arguments.length==2)?arguments[1]:false;
	generalFormats=new Array('y-M-d','MMM d, y','MMM d,y','y-MMM-d','d-MMM-y','MMM d');
	monthFirst=new Array('M/d/y','M-d-y','M.d.y','MMM-d','M/d','M-d');
	dateFirst =new Array('d/M/y','d-M-y','d.M.y','d-MMM','d/M','d-M');
	var checkList=new Array('generalFormats',preferEuro?'dateFirst':'monthFirst',preferEuro?'monthFirst':'dateFirst');
	var d=null;
	for (var i=0; i<checkList.length; i++) {
		var l=window[checkList[i]];
		for (var j=0; j<l.length; j++) {
			d=getDateFromFormat(val,l[j]);
			if (d!=0) { return new Date(d); }
			}
		}
	return null;
	}
/**
 * Copyright by Intland Software
 *
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Intland Software. ("Confidential Information"). You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Intland.
 *
 * $Revision$ $Date$
 */

/* Handler to execute at page load. */
function onLoad() {
	TabbedSection.onPageLoad();
	SearchBox.onPageLoad();
	Wiki.onPageLoad();
	Sortable.onPageLoad();
	ZebraTable.onPageLoad();
	HighlightWord.onPageLoad();
	Collapsable.onPageLoad();
	GraphBar.onPageLoad();
	/* INCLUDERESOURCES (jsfunction) */

	// jump the page to the anchor in the url when the page is fully loaded. See [ISSUE:25681]
	// DO NOT add any javascript after this!
	var hash = location.hash;
	jumpToHash(hash);
}

/**
 * Jump to an anchor's hash like in the url "http://localhost:8080/cb/wiki/1003#section-Members+plugin".
 * This function automatically switches the appropriate JSPWiki's tab to show the desired anchor.
 *
 * @param hash The hash string of the anchor
 */
function jumpToHash(hash) {
	if (!hash || hash == "") {
		return;
	}

	// Open the JSPWiki's tabbedsection where this anchor is inside
	if (hash.indexOf("#") == 0) { // hash must start with a #
		var anchorId = hash.substr(1);
		var elem = document.getElementById(anchorId);
		if (elem) {
			/*
			walk up in the DOM tree to find the parent "tabbedSection"
			the DOM structure looks like:

				<div class="tabbedSection tabs">
					<div id="tab-Graphs" class="tab-Graphs">
						... somewhere below...
						<a id="${anchorId}">...</a>
					</div>
				</div>
			*/
			var previousParent = null;
			var found = false;
			while (elem && !(elem instanceof HTMLDocument) && !found) {
				if (YAHOO.util.Dom.hasClass(elem, "tabbedSection")) {
					found = true;
				} else {
					previousParent = elem;
					elem = elem.parentNode;
				}
			}

			if (found && previousParent) {
				// now the previousParent contains the "tab" element which we should show
				TabbedSection.onclick(previousParent.id);
			}
		}
	}

	// force the browser to jump to anchor
	location.hash = hash;
}


/*
 * Toggles the visibility of an HTML DOM element and
 * updates the "toggle" image.
 */
function toggleElement(elementId, imageId, showImageUrl, hideImageUrl) {
	var element = document.getElementById(elementId);
	var image = document.getElementById(imageId);
	if (element.style.display == 'none'){
		element.style.display = 'block';
		image.src = showImageUrl;
	} else {
		element.style.display = 'none';
		image.src = hideImageUrl;
	}

	return false;
}

var asciiBack       = 8;
var asciiTab        = 9;
var asciiSHIFT      = 16;
var asciiCTRL       = 17;
var asciiALT        = 18;
var asciiHome       = 36;
var asciiLeftArrow  = 37;
var asciiRightArrow = 39;
var asciiMS         = 92;
var asciiView       = 93;
var asciiF1         = 112;
var asciiF2         = 113;
var asciiF3         = 114;
var asciiF4         = 115;
var asciiF5         = 116;
var asciiF6         = 117;
var asciiF7         = 118;
var asciiF8         = 119;
var asciiF9         = 120;
var asciiF10        = 121;
var asciiF11        = 122;
var asciiF12        = 123;

function KeyInfo () {
	this.character = null;
	this.keyCode = null;
	this.altPressed = false;
	this.shiftPressed = false;
	this.ctrlPressed = false;
};

function getKeyPressed(evt) {
	//get the event object
	var oEvent = (window.event) ? window.event : evt;

	//hmmm in mozilla this is jacked, so i have to record these seperate
	//what key was pressed
	var nKeyCode =  oEvent.keyCode ? oEvent.keyCode :
					oEvent.which ? oEvent.which :
					void 0;

	var bIsFunctionKey = false;

	//hmmm in mozilla the keycode would contain a function key ONLY IF the charcode IS 0
	//else key code and charcode read funny, the charcode for 't'
	//returns 116, which is the same as the ascii for F5
	//SOOO,... to check if a the keycode is truly a function key,
	//ONLY check when the charcode is null OR 0, IE returns null, mozilla returns 0
	if(oEvent.charCode == null || oEvent.charCode == 0) {
		bIsFunctionKey = (nKeyCode >= asciiF1 && nKeyCode <= asciiF12) ||
							(
								nKeyCode == asciiALT
								|| nKeyCode == asciiMS
								|| nKeyCode == asciiView
								|| nKeyCode == asciiHome
								|| nKeyCode == asciiBack
							);
	}

	var keyInfo = new KeyInfo();

	//convert the key to a character, makes for more readable code
	keyInfo.character = String.fromCharCode(nKeyCode).toUpperCase();
	keyInfo.keyCode = nKeyCode;

	//get the active tag that has the focus on the page, and its tag type
	var oTarget = (oEvent.target) ? oEvent.target : oEvent.srcElement;
	var sTag = oTarget.tagName.toLowerCase();
	var sTagType = oTarget.getAttribute("type");

	keyInfo.altPressed = (oEvent.altKey) ? oEvent.altKey : oEvent.modifiers & 1 > 0;
	keyInfo.shiftPressed = (oEvent.shiftKey) ? oEvent.shiftKey : oEvent.modifiers & 4 > 0;
	keyInfo.ctrlPressed = (oEvent.ctrlKey) ? oEvent.ctrlKey : oEvent.modifiers & 2 > 0;

	return keyInfo;
}

function unloadBtnPressed(evt) {
	var keyInfo = getKeyPressed(evt);

	if (keyInfo.ctrlPressed && keyInfo.character == 'R') {
		return true;
	} else if (keyInfo.altPressed && (keyInfo.keyCode == asciiLeftArrow || keyInfo.keyCode == asciiRightArrow)) {
		return true;
	} else if (keyInfo.keyCode == asciiF5) {
		return true;
	}
	return false;
}

function tabBtnPressed(evt) {
	var keyInfo = getKeyPressed(evt);
	return (keyInfo.keyCode == 9 && !keyInfo.shiftPressed);
}

function enterBtnPressed(evt) {
	var keyInfo = getKeyPressed(evt);
	return (keyInfo.keyCode == 13);
}

/* - Single-click subscription --------------------------------------------- */

function setSubscriptionState(subscriptionStateIconId, entityTypeId, entityId, subscribed, modifiable, setNotificationAjaxRequestUrl, entitySubscribedClass, entityNotSubscribedClass, entitySubscribedNonEditableClass, entityNotSubscribedNonEditableClass) {
	var subscriptionStateIcon = new YAHOO.util.Element(subscriptionStateIconId);

	// update link
	var newOnClickFunction = null;
	if(modifiable) {
		subscriptionStateIcon.set("title", subscribed ? "Unsubscribe" : "Subscribe");
		newOnClickFunction = function() {
			// fire AJAX request
			var callback =  {
				success: function(o) { setSubscriptionState(subscriptionStateIconId, entityTypeId, entityId, !subscribed, modifiable, setNotificationAjaxRequestUrl, entitySubscribedClass, entityNotSubscribedClass, entitySubscribedNonEditableClass, entityNotSubscribedNonEditableClass); },
				failure: function(o) {
					AjaxErrorReport.reportAjaxFailure(o, "Failed to subscribe type " + entityTypeId + ", ID: " + entityId + ", because:");
				}
			}
			YAHOO.util.Connect.asyncRequest('POST', setNotificationAjaxRequestUrl, callback, 'entityTypeId=' + entityTypeId + '&entityId=' + entityId + '&subscribed=' + !subscribed);
			return false;
		};
	} else {
		subscriptionStateIcon.set("title", subscribed ? "You are subscribed, but can't cancel your subscription." : "You are not subscribed and can't subscribe.");
		newOnClickFunction =  function(){ return false;};
	};
	if (newOnClickFunction != null) {
		// unsubscribe previous onclick function to avoid multiple ajax requests
		YAHOO.util.Event.removeListener(subscriptionStateIconId, "click");
		YAHOO.util.Event.addListener(subscriptionStateIconId, "click", newOnClickFunction);
	}

	// update the css class
	var newclazz;

	// remove all previous classes
	var classes = [ entitySubscribedClass, entityNotSubscribedClass, entitySubscribedNonEditableClass, entityNotSubscribedNonEditableClass ];
	for (var i=0; i<classes.length; i++) {
		subscriptionStateIcon.removeClass(classes[i]);
	};

	if(modifiable) {
		newclazz = subscribed ? entitySubscribedClass : entityNotSubscribedClass;
	} else {
		newclazz = subscribed ? entitySubscribedNonEditableClass : entityNotSubscribedNonEditableClass;
	}

	subscriptionStateIcon.addClass(newclazz);
}

/**
 * Same as setSubscriptionState(), without last parameters which will get their default values.
 */
function setSubscriptionStateWithDefaults(subscriptionStateIconId, entityTypeId, entityId, subscribed, modifiable) {
	var setNotificationAjaxRequestUrl = contextPath + "/ajax/setNotification.spr";
	var entitySubscribedClass = "img_entity_subscribed";
	var entityNotSubscribedClass = "img_entity_notsubscribed";
	var entitySubscribedNonEditableClass = "img_entity_subscribednoteditable";
	var entityNotSubscribedNonEditableClass = "img_entity_notsubscribednoteditable";
	setSubscriptionState(subscriptionStateIconId, entityTypeId, entityId, subscribed, modifiable,
							setNotificationAjaxRequestUrl, entitySubscribedClass, entityNotSubscribedClass, entitySubscribedNonEditableClass, entityNotSubscribedNonEditableClass);
}

// Checking if the Object exists
function isDefined(o) {
	var varToStr=eval("' "+o+"'");
	if (varToStr==" undefined") {
		return false;
	} else {
		return true;
	}
}

// String.replaceAll function
String.prototype.replaceAll=function(s1, s2) {return this.split(s1).join(s2)};

//Trim whitespace from left and right sides of s.
function trim(s) {
	return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
}

/**
 * Show a modal dialog will cover the whole screen.
 * This DOES NOT block the javascript execution though, and will return immeditely.
 * The button presses must be handled in their handler functions.
 *
 * @param style The style , either ("error","warning" or "information")
 * @param message The message to display, can be any HTML markup
 * @param buttons the buttons as described here: http://developer.yahoo.com/yui/container/simpledialog/#buttons
 * @param optional width of the dialog in "em"-s. Defaults to 30
 * @param dialogName
 *
 * @return The dialog
 */
function showModalDialog(style, message, buttons, width, dialogName) {
	if (! width) {
		width = "30";
	}
	if (!dialogName) {
		dialogName = "cbModalDialog";
	}

	var dlg = new YAHOO.widget.SimpleDialog(dialogName, {
		width: width + "em",
		fixedcenter:true,
		modal:true,
		visible:false,
		draggable:false,
		close: false
	});
	var body = "<span class='" + style +"' ";
	if (buttons == null) {
		body += " style='margin-bottom:5px;'";
	}
	body +=">" + message +"</span>";
	dlg.setBody(body);

	dlg.cfg.queueProperty("buttons", buttons);
	dlg.render(document.body);
	dlg.resultValue = false;
	dlg.show();

	return dlg;
}

/**
 * A simpler form of the showModalDialog(), with only Yes and Cancel options, can be used as drop-in replacement for the standard confirm() function.
 * This method differs from the other showFancyConfirmDialog, that it can be attached to a combo-box too, the other function needs a button!
 *
 * @param msg The message to show
 * @param handleYes Optional callback function when yes is pressed
 * @param handeCancel Optional callback function when cancel is pressed
 */
function showFancyConfirmDialogWithCallbacks(msg, handleYes, handleCancel) {
	var handleYesWrapper = function() {
		this.hide();
		if (handleYes) {
			handleYes.call();
		}
	};
	var handleCancelWrapper = function() {
		this.hide();
		if (handleCancel) {
			handleCancel.call();
		}
	};
	var myButtons = [ { text:"Yes",  handler:handleYesWrapper },
					  { text:"Cancel", handler:handleCancelWrapper, isDefault:true}];
	showModalDialog("warning", msg, myButtons);
}

/**
 * A simpler form of the showModalDialog(), with only Yes and Cancel options, can be used as drop-in replacement for the standard confirm() function.
 * Attach this confirm dialog to any submit buttons' onclick, like: onclick="return showFancyConfirmDialog(this, 'message')"
 *
 * @param button The button attached to
 * @param msg The message to show
 * @return True if the button is confirmed, false if not.
 */
function showFancyConfirmDialog(button, msg) {
	if (button.confirmed) {
		return true;
	}
	var handleYes = function() {
		button.confirmed = true;
		button.click();
	};
	var handleCancel = function() {
		button.confirmed = false;
	};
	showFancyConfirmDialogWithCallbacks(msg, handleYes, handleCancel);
	return false;
}

/* - Artifact approvals ---------------------------------------------------- */

/**
 * Delete an artifact approval workflow after confirmation.
 */
function deleteArtifactApprovalConfirm(approvalName, approvalId, deleteApprovalUrl) {
	var handleYes = function() {
		document.location = deleteApprovalUrl;
		this.hide();
	};
	var handleNo = function() {
		this.hide();
	};
	var showArtifacts = function() {
		this.hide();
		var location = "/cb/listArtifactsInApproval.spr?approvalworkflow_id=" + approvalId + "&onlyActive=true";
		document.location = location;
	};
	var myButtons = [ { text:"Yes",  handler:handleYes },
						{ text:"Cancel", handler:handleNo, isDefault:true },
						{ text:"Not sure, show me those artifacts!", handler: showArtifacts } ];
	var msg = "Do you really want to delete the approval workflow <span style='white-space:nowrap'>\"<strong>" + approvalName + "</strong>\"</span>?";
	msg +="<br/>By deleting this approval workflow <strong>all pending artifacts will be published and become visible by everybody</strong>!";
	msg +="<br/>Those artifacts which are already rejected will be restored to their original (last approved) content!";
	showModalDialog("warning", msg, myButtons, 50);
}

function deleteArtifactApprovalStep(approvalStepName) {
	var answer = confirm("Do you really want to delete the approval workflow step \"" + approvalStepName + "\"?");
	return answer;
}

// This function submits the form if ENTER was pressed in a text field.
function submitOnEnter(textField, evt) {
	if (enterBtnPressed(evt)) {
		textField.form.submit();
		return false;
	}
	return true;
}
/**
 * Copyright by Intland Software
 *
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Intland Software. ("Confidential Information"). You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Intland.
 *
 * $Revision$ $Date$
 */

/*
	Javascript used by ToolbarTag to render the top menus
	$Id$
*/

/**
 * Helper function used by YUI popup menus to initialize the menus.
 * @param id The id of the html-element to initialize
 * @param params Extra parameters (as object-literal) passed to YUI menubar
 */
function initPopupMenu(id, params) {
	ShowMenu(id,params);
}

/**
 * Class/Constructor to show/control the menu.
 */
function ShowMenu(id,params) {
	if (this == window) {
		// create new object
		return new ShowMenu(id,params);
	}

	this.id = id;
	this.params = params;

	var ME = this;
	var lazyInitEnabled = true;

	// the YAHOO ui menus are only initialized lazily when the mouse moves over, because otherwise
	// the page load performance is very bad
	YAHOO.util.Event.onDOMReady(function() {
		var elem = document.getElementById(id);
		if (!elem) {
			YAHOO.log("initPopupMenu() is skipped for id:" + id + ", because HTML element not found on page!");
		} else {
			if (lazyInitEnabled) {
				YAHOO.util.Event.addListener(elem, "mouseover", ME.lazyInitMenu, ME, true /* override scope, "ME" will be this*/);
			} else {
				// call ME.show() with "ME" as "this"
				ME.show.apply(ME);
			}
		}
	});
}

// methods added to ShowMenu class
ShowMenu.prototype = {

	// callback to lazily show the menu
	lazyInitMenu: function() {
		this.show();
		// finally remove mouseover event listener, because menu now is initialized
		YAHOO.util.Event.removeListener(this.id, "mouseover", this.lazyInitMenu);
	},

	// show the menu
	show: function() {
		//alert("rendering menu:" + this.id);
		var defaultparams = { autosubmenudisplay:true, showdelay: 250 , hidedelay: 500, submenuhidedelay: 500
								/*, lazyload:false*/, constraintoviewport: true
								, zindex: 15 /* must be higher than 11 that is used by the Ditchnet tab control,
												also must be set here, because YUI will put this to style='...' of the tag, overrides yuimenu css class */
								 };
		// merge the optional params and can overwrite existing params
		if (this.params.length > 1) {
			var configparams = this.params[1]; // json object for configuration parameters
			defaultparams = YAHOO.lang.merge(defaultparams, configparams);
			YAHOO.log("initPopupMenu() params:" + YAHOO.lang.dump(defaultparams));
		}

		var oMenuBar = new YAHOO.widget.MenuBar(this.id, defaultparams);
		oMenuBar.render();
		oMenuBar.show();
	}

};

/*
 *  Contains a large amount of different UI-related utility Javascript
 *  for JSPWiki.
 *  (C) Dirk Fredericx, Janne Jalkanen 2005
 */

/**
 ** 010 String stuff
 **/

// repeat string size time
String.prototype.repeat = function( size )
{
   var a = new Array( size );
   for( var i=0; i < size; i++ ) { a[i] = this; }
   return( a.join("") );
}

// remove leading and trailing whitespace
String.prototype.trim = function()
{
  return this.replace(/^\s+|\s+$/g,'')
}
// split CamelCase string in readable string
String.prototype.deCamelize = function()
{
  return this.replace(/([a-z])([A-Z])/g,'$1 $2');
}
// parse color : prefix with # if amtched with 3 or 6 hex codes
var REparseColor =  new RegExp( "^[0-9a-fA-F]+" );
String.prototype.parseColor = function()
{
  var s = this;
  if( ((s.length==6) || (s.length==3)) && REparseColor.test(s) ) s = "#" + s;
  return( s );
}

// replace xml chars by &entities;
String.prototype.escapeXML = function()
{
  var s = this.replace( /&/g, "&amp;" );
  s = s.replace( /</g, "&lt;" );
  s = s.replace( />/g, "&gt;" );
  return s;
}

/**
 ** 020 Array stuff
 **/
function ExtArray() {
  this.first = function() { return this[0] }
  this.last  = function() { return this[this.length-1] }
}
ExtArray.prototype = new Array();
if( !ExtArray.prototype.push ) ExtArray.push = function() {
  for (var i=0; i<arguments.length; i++) this[this.length] = arguments[i];
  return this.length;
}



/**
 ** 030 DOM document functions
 **/

// get text of a dhtml node
getNodeText = function( node )
{
  if( node.nodeType == 3)  return( node.nodeValue );

  var s = "";
  for( var n = node.firstChild; n ; n = n.nextSibling )
  {
    s += this.getNodeText( n );
  }
  return( s );
}

// find first ancestor element with tagName
function getAncestorByTagName( node, tagName )
{
  if( !node) return null;
  if( node.nodeType == 1 && (node.tagName.toLowerCase() == tagName.toLowerCase()))
    return node;
  else
    return getAncestorByTagName( node.parentNode, tagName );
}

// walk all ancestors and match node with the given classname
function getAncestorsByClassName ( node, clazz, matchFirst)
{
  var result = [];
  var re = new RegExp ('(?:^| )'+clazz+'(?: |$)');
  while( node )
  {
    if( re.test( node.className ) )
    {
      if( matchFirst ) return( node );
      result.push( node );
    }
    node = node.parentNode;
  }
  return( (result.length==0) ? null : result );
}


// returns an array of elements matching the classname
// returns only the first element matching the classname when matchFirst is true
// returns null when nothing found
function getElementsByClassName( node, clazz, matchFirst )
{
  var result = [];
  var re;
  if( clazz instanceof RegExp) { re = clazz; }
  else if( typeof clazz == 'string' ) { re = new RegExp ('(?:^| )'+clazz+'(?: |$)'); }
  else return null;

  var n = (node.all) ? node.all : node.getElementsByTagName("*");
  for( var i=0, j=n.length; i<j; i++ )
  {
    if( re.test(n[i].className) )
    {
      if( matchFirst ) return(n[i]);
      result.push(n[i]);
    }
  }
  return( (result.length==0) ? null : result );
}

// className = css class name of any element
// matchFirst = true, when matching only the first occurence
document.getElementsByClassName = function( className, matchFirst )
{
  return getElementsByClassName( document.documentElement, className, matchFirst );
}

// tagName = name of element, like DIV...
// className = css class name
// matchFirst = true, when matching only the first occurence
document.getElementsByTagAndClassName = function( tagName, className, matchFirst )
{
  return getElementsByClassName( this.getElementsByTagName( tagName )
                               , className, matchFirst );
}


/**
 ** Wiki functions
 **/
var Wiki = new Object();
Wiki.DELIM = "\u00A4"; //non-typable char - used as delimitter

Wiki.reImageTypes = new RegExp( '(.bmp|.gif|.png|.jpg|.jpeg|.tiff)$','i' );

Wiki.getBaseURL  = function() { return this.BaseURL; } //not yet used
Wiki.getBasePath = function() { return this.BasePath; }
Wiki.getPageName = function() { return this.PageName; }

Wiki.showImage = function( attachment, attDELIM, maxWidth, maxHeight )
{
  // contains Name, Link-url, Info-url
  var attachArr = attachment.value.split( attDELIM );
  var attachImg  = document.getElementById("attachImg");

  if( !attachImg ) return true;

  if( attachArr.length == 1 ) //no image selected
  {
    return;
  }

  //not clean: should actually be read from the attachImg size - but dont know yet how xbrowser
  this.maxWidth = maxWidth;
  this.maxHeight = maxHeight;

  if( !this.reImageTypes.test( attachArr[0] ) )
  {
    attachImg.innerHTML  = "No image selected";
    return;
  }

  this.pic = new Image();
  this.pic.src = attachArr[1];
  if( this.pic.complete ) return Wiki.showLoadedImage() ;

  this.countdown = 30;
  setTimeout( "Wiki.showLoadedImage()" , 200 );
  attachImg.innerHTML= "Loading image";
}

Wiki.showLoadedImage = function ()
{
  var attachImg  = document.getElementById("attachImg");

  if( this.pic.complete )
  {
    var w = parseInt(this.pic.width);
    var h = parseInt(this.pic.height);

    if( w > this.maxWidth  ) { h *= this.maxWidth/w;  w = this.maxWidth; }
    if( h > this.maxHeight ) { w *= this.maxHeight/h; h = this.maxHeight; }
    attachImg.innerHTML = "<img src='" + this.pic.src + "' width='" + parseInt(w) + "' height='" + parseInt(h)
                        + "' style='margin-top:"+ parseInt((this.maxHeight-h)/2) +"px;' ></img>";
    this.countdown = 0;
    this.pic = null;
    return;
  }

  if( this.countdown <= 0 )
  {
    attachImg.innerHTML = "Loading image expired<br />Try loading the image manually";
    return;
  }

  this.countdown--;
  setTimeout( "Wiki.showLoadedImage()" , 200) ;
  attachImg.innerHTML = "Loading image " + this.countdown
}


// initialise Wiki global object
Wiki.onPageLoad = function()
{
  // mirrors commonheader.jsp !
  var c = document.getCookie( "JSPWikiUserPrefs" );
  if( c == null ) c="";
  var cArr = c.split(Wiki.DELIM);
  this.prefSkinName       = (cArr[0] ? cArr[0] : "PlainVanilla/SkinVanilla.css" );
  this.prefDateFormat     = (cArr[1] ? cArr[1] : "" );
  this.prefTimeZone       = (cArr[2] ? cArr[2] : "" );
  this.prefEditAreaHeight = (cArr[3] ? parseInt(cArr[3]) : 24 );
  this.prefShowQuickLinks = (cArr[4] ? (cArr[4]=="yes") : true);
  this.prefShowCalendar   = (cArr[5] ? (cArr[5]=="yes") : false);

  var u = document.getCookie( "JSPWikiUserProfile" );
  var reUsername = new RegExp ( 'username=(\\w+)' );
  this.username = ( reUsername.test(u) ) ? RegExp.$1 : null;
}

/*
 *  Chooses a suitable stylesheet based on browser.
 *
 * issue a document.write statement with the link to the browser specific stylesheet
 * should always be execute from direct javascript during page-load
 */
Wiki.loadBrowserSpecificCSS  = function ( baseurl, templatePath, pagename )
{
    var IE4 = (document.all && !document.getElementById) ? true : false;
    var NS4 = (document.layers) ? true : false;
    var IE5 = (document.all && document.getElementById) ? true : false;
    var NS6 = (document.getElementById && !document.all) ? true : false;
    var IE  = IE4 || IE5;
    var NS  = NS4 || NS6;
    var Mac = (navigator.platform.indexOf("Mac") == -1) ? false : true;

    var sheet = "";

    if( NS4 )
    {
        sheet = "jspwiki_ns.css";
    }
    else if( Mac )
    {
        sheet = "jspwiki_mac.css";
    }
    else if( IE )
    {
        sheet = "jspwiki_ie.css";
    }

    if( sheet != "" )
    {
        sheet = baseurl+"templates/" +templatePath + "/" + sheet;
        document.write("<link rel=\"stylesheet\" href=\""+sheet+"\" />");
    }

    this.BaseURL = baseurl;
    this.BasePath = this.BaseURL.slice( this.BaseURL.indexOf( location.host )
                                      + location.host.length, -1 );
    this.PageName = pagename;
}

/**
 ** 040  cookie stuff
 **/
document.setCookie = function( name, value, expires, path, domain, secure )
{
  var c = name + "=" + encodeURIComponent( value );

  if( !expires )
  {
    expires = new Date();
	expires.setFullYear( expires.getFullYear() + 1 );
  }

  /* Store the cookies agains the basepath of wiki
     so that different URLformats are supported properly !
   */
  if( !path ) path = Wiki.getBasePath();

  if( expires ) { c += "; expires=" + expires.toGMTString(); } // Date()
  if( path    ) { c += "; path=" + path; }
  if( domain  ) { c += "; domain=" + domain; }
  if( secure  ) { c += "; secure"; } //true = only via https
  //alert("cookie: "+c);
  document.cookie = c;
}

document.getCookie = function( name )
{
  var reMatchCookie = new RegExp ( "(?:; )?" + name + "=([^;]*);?" );
  return( reMatchCookie.test( document.cookie ) ? decodeURIComponent(RegExp.$1) : null );
}

// Select skin
function skinSelect(skin)
{
  //var skin = document.forms["skinForm"].skinSelector;
  if (! skin) return;

  for (var i=0; i<skin.length; i++)
  {
    if ( skin[i].selected )
    {
      document.cookie = "JspWikiSkin=" + skin[i].value + "#skin#" ;
    }
  }
  location.reload(); /* reload page */
}

/**
 ** 110 Tabbed Section
 **/
var TabbedSection = new Object();
TabbedSection.reMatchTabs = new RegExp( "(?:^| )tab-(\\S+)" );
TabbedSection.onPageLoad = function()
{
  var t = document.getElementsByClassName( "tabbedSection" );
  if( !t ) return;
  for( var i = 0; i<t.length; i++)
  {
    if( !t[i].hasChildNodes ) continue; //take next section

    t[i].className = t[i].className +" tabs";
    var tabmenu = [];
    var active = true; //first tab assumed to be the active one
    for( var n = t[i].firstChild; n ; n = n.nextSibling )
    {
      if( !this.reMatchTabs.test( n.className ) ) continue; // not a tab: take next element

      if( (n.id==null) || (n.id=="") ) n.id = n.className;
      n.style.display = ( active ? "" : "none" );

      /* <span><a class="active" href="#" id="menu-tabID"
                 onclick="TabbedSection.onclick('tabID')" >xyz</a></span>
      */
      tabmenu.push( "<span><a class='" + ( active ? "activetab" : "" ) + "' " );
      tabmenu.push( "id='menu-" + n.id + "'" );
      tabmenu.push( "onclick='TabbedSection.onclick(\"" + n.id + "\")' >" );
      tabmenu.push( RegExp.$1.deCamelize() + "</a></span>" );
      active=false;
    }
    if( tabmenu.length == 0 ) continue; //take next section
    var e = document.createElement( "div" );
    e.className = "tabmenu" ;
    e.innerHTML = tabmenu.join( "" );
    t[i].parentNode.insertBefore( e, t[i] );

  } // take next section

}

TabbedSection.onclick = function ( tabId )
{
  var target = document.getElementById( tabId );
  //safari and ie choke on some <a /> elements inside e.g. DiffContents.jsp
  //so it would be more safe to walk the parent-path until you find the
  //element with classname == tabs . ugh - DF oct 2004
  var section = target.parentNode;

  if( !section ) return;

  for( var n = section.firstChild; n ; n = n.nextSibling )
  {
    if( !n.id ) continue;
    var m = document.getElementById( "menu-" + n.id );
    var edittab = document.getElementById( "editcontent" );

    if( m && m.className == "activetab" )
    {
      if( n.id == target.id ) break; //stop - is already activetab

      // Default to changing tabs if user is not asked.
      changeTabs = true;

      // If current tab is editcontent, save content in JavaScript
      // so it will still be there when you come back.
      if( edittab && edittab.style.display == "" )
      {
        // If editor has a special function for changing tabs, run it.
        if ( window.onTabChange && typeof window.onTabChange === 'function')
        {
          // Save text so that you can click tabs and come back.
          onTabChange();
        }
      }

      n.style.display = "none";
      m.className = "";
      target.style.display = "";
      document.getElementById( "menu-" + target.id ).className = "activetab";
      break;
    }
  }
}

/**
 ** 120 SearchBox
 **  Remember 10 most recent search topics
 **  Uses a cookie to store to 10 most recent search topics
 **
 **  Extensions for quick link to View Page, Edit Page, Find as is.
 **  (based on idea of Ron Howard - Nov 05)
 **/
var SearchBox = new Object();

SearchBox.submit = function ( queryValue )
{
  for(var i=0; i < this.recentSearches.length; i++)
  {
    if( this.recentSearches[i] == queryValue ) return;
  }

  if( !this.recentSearches ) this.recentSearches = new ExtArray();
  if( this.recentSearches.length > 9 ) this.recentSearches.pop();
  this.recentSearches.unshift( queryValue );

  document.setCookie( "JSPWikiSearchBox", this.recentSearches.join( Wiki.DELIM) );
}

SearchBox.onPageLoad = function()
{
  this.searchForm = document.getElementById("searchForm");
  if( !this.searchForm ) return;

  this.recentSearchesDIV = document.getElementById("recentSearches");
  if( !this.recentSearchesDIV ) return;

  this.recentSearches = new ExtArray();
  var c = document.getCookie( "JSPWikiSearchBox" );
  if( c ) this.recentSearches = c.split( Wiki.DELIM );

  var s = "";
  if( this.recentSearches.length == 0 ) return;

  var div1 = "<div onclick='SearchBox.doSearch(this)'>";
  var div2 = "</div>";

  var s = "Recent Searches:";
  var t = [];
  for( i=0; i < this.recentSearches.length; i++ )
  {
    //todo
  }
  s += div1 + this.recentSearches.join( div2+div1 ) + div2;
  s += "<br /><div onclick='SearchBox.clearRecentSearches()'>Clear Recent Searches</div>";
  this.recentSearchesDIV.innerHTML = s;
}

SearchBox.doSearch = function ( searchDiv )
{
  this.searchForm.query.value = searchDiv.innerHTML; //nodeValue seems not to work
  this.searchForm.submit();
}

SearchBox.clearRecentSearches = function()
{
  document.setCookie( "JSPWikiSearchBox", "" );
  this.recentSearches = new ExtArray();
  this.recentSearchesDIV.innerHTML = "";
}

SearchBox.navigation = function( url, pagename )
{
  var s = SearchBox.searchForm.query.value;
  if( s == 'Search' ) s = '';
  if( s == '' ) s = pagename ; //current page name
  if( s != '' ) location.href = url.replace('__PAGEHERE__', s);
  return(false); //dont exec the click on the <a href=#>
}

/**
 ** 280 ZebraTable
 ** Color odd/even rows of table differently
 ** 1) odd rows get css class odd (ref. jspwiki.css )
 **   %%zebra-table ... %%
 **
 ** 2) odd rows get css style='background=<color>'
 ** %%zebra-<odd-color> ... %%
 **
 ** 3) odd rows get odd-color, even rows get even-color
 ** %%zebra-<odd-color>-<even-color> ... %%
 **
 ** colors are specified in HEX (without #) format or html color names (red, lime, ...)
 **
 **/

var ZebraTable = new Object();
ZebraTable.REclassName = new RegExp( "(?:^| )zebra-(\\S+)" );

ZebraTable.onPageLoad = function()
{
  var z = document.getElementsByClassName ( this.REclassName ); if( !z ) return;

  for( var i=0; i<z.length; i++)
  {
    var rows = z[i].getElementsByTagName( "TR" );  if( !rows ) continue;
    this.REclassName.test( z[i].className );
    var parms = RegExp.$1.split('-');

    if( parms[0] == 'table' )
    {
      for( var r=0; r < rows.length; r+=2 ) rows[r].className += " odd";
      continue;
    }

    if( parms[0] )
    {
      for( var r=2; r < rows.length; r+=2 )
        rows[r].style.backgroundColor = parms[0];        
    }
    if( parms[1] )
    {
      for( var r=1; r < rows.length; r+=2 )
        rows[r].style.backgroundColor = parms[1];
    }
  }
}

/**
 ** 290 Highlight Word
 **
 ** Inspired by http://www.kryogenix.org/code/browser/searchhi/
 ** Modified 20021006 to fix query string parsing and add case insensitivity
 ** Modified 20030227 by sgala@hisitech.com to skip words
 **                   with "-" and cut %2B (+) preceding pages
 ** Refactored for JSPWiki -- now based on regexp, by D.Frederickx. Nov 2005
 **
 **/
var HighlightWord = new Object();
HighlightWord.ClassName = "searchword";
HighlightWord.ClassNameMatch = "<span class='"+HighlightWord.ClassName+"' >$1</span>" ;
HighlightWord.ReQuery = new RegExp( "(?:\\?|&)(?:q|query)=([^&]*)", "g" );

HighlightWord.onPageLoad = function ()
{
  if( !this.ReQuery.test( document.referrer ) ) return;

  var words = decodeURIComponent(RegExp.$1);
  words = words.replace( /\+/g, " " );
  words = words.replace( /\s+-\S+/g, "" );
  words = words.replace( /([\(\[\{\\\^\$\|\)\?\*\.\+])/g, "\\$1" ); //escape metachars
  words = words.trim().split(/\s+/).join("|");
  this.reMatch = new RegExp( "(" + words + ")" , "gi");
  //alert(this.reMatch);

  this.walkDomTree( document.getElementById("pagecontent") );
}

// recursive tree walk matching all text nodes
HighlightWord.walkDomTree = function( node )
{
  if(!node) return;
  var nn = null;
  for( var n = node.firstChild; n ; n = nn )
  {
    nn = n. nextSibling; /* prefetch nextSibling cause the tree will be modified */
    this.walkDomTree( n );
  }

  // continue on text-nodes, not yet highlighted, with a word match
  if( node.nodeType != 3 ) return;
  if( node.parentNode.className == this.ClassName ) return;
  var s = node.nodeValue;
  s = s.escapeXML(); /* bugfix - nodeValue apparently unescapes the xml entities ?! */
  if( !this.reMatch.test( s ) ) return;

  //alert("found "+RegExp.$1);
  var tmp = document.createElement("span");
  tmp.innerHTML = s.replace( this.reMatch, this.ClassNameMatch );

  var f = document.createDocumentFragment();
  while( tmp.firstChild ) f.appendChild( tmp.firstChild );

  node.parentNode.replaceChild( f, node );
}

/**
 ** 230 Sortable -- for all tables
 **/
var Sortable = new Object();
Sortable.ClassName = "sortable";
Sortable.ClassSort           = "sort";
Sortable.ClassSortAscending  = "sortAscending";
Sortable.ClassSortDescending = "sortDescending";
Sortable.TitleSort           = "Click to sort";
Sortable.TitleSortAscending  = "Ascending order - Click to sort in descending order";
Sortable.TitleSortDescending = "Descending order - Click to sort in ascending order";


Sortable.onPageLoad = function()
{
  var p = document.getElementById( "pagecontent" ); if( !p ) return;
  var sortables = getElementsByClassName( p, Sortable.ClassName );  if( !sortables ) return;
  for( i=0; i<sortables.length; i++ )
  {
    var table = sortables[i].getElementsByTagName( "table" )[0];
    if( !table ) continue;
    if( table.rows.length < 2 ) continue;

    for( var j=0; j < table.rows[0].cells.length; j++ )
    {
      var c = table.rows[0].cells[j];
      if( c.nodeName != "TH" ) break;
      c.onclick    = function() { Sortable.sort(this); } ;
      c.title      = this.TitleSort;
      c.className += " " + this.ClassSort;
    }
  }
}
Sortable.REclassName = new RegExp ('(?:^| )(sort|sortAscending|sortDescending)(?: |$)');
Sortable.sort = function( thNode )
{
  var table = getAncestorByTagName(thNode, "table" ); if( !table ) return;
  if( table.tBodies[0] ) table = table.tBodies[0]; //bugfix
  if( table.rows.length < 2 ) return;
  var colidx = 0; //target column to sort
  var thNodeClassName = this.ClassSort; //default column header classname

  //validate header row
  for( var i=0; i < table.rows[0].cells.length; i++ )
  {
    var c = table.rows[0].cells[i];
    if( c.nodeName != "TH" ) return;

    if( thNode == c )
    {
      colidx = i;
      if( Sortable.REclassName.test(c.className) ) thNodeClassName = RegExp.$1;
    }
    else
    {
      c.className = c.className.replace(Sortable.REclassName, "" ) + " " + this.ClassSort ;
      c.title = this.TitleSort;
    }
  }

  //find body rows and guess data type of colidx
  var rows = new Array();
  var num  = true;
  var date = true;
  var ip4  = true;
  var ip4_regex = /(\d{1,3}\.){3}\d{1,3}/;
  for( var i=1; i< table.rows.length; i++)
  {
    rows[i-1] = table.rows[i] ;
    //var val = rows[i-1].cells[colidx].firstChild.nodeValue;
    var val = getNodeText( rows[i-1].cells[colidx] );
    if( num  ) num  = !isNaN( parseFloat( val ) ) ;
    if( date ) date = !isNaN( Date.parse( val ) );
    if( ip4  ) { if( !val.match( ip4_regex )) { ip4 = false; } }
  }

  var datatype = "string";
  if( num ) datatype = "num";
  if( date ) datatype = "date";
  if( ip4 ) datatype = "ip4";

  //do the actual sorting
  if( thNodeClassName == this.ClassSort ) //first time sort of column table.sortCol == colidx )
  {
    rows.sort( Sortable.createCompare( colidx, datatype ) );
    thNodeClassName = this.ClassSortAscending;
    thNode.title    = this.TitleSortAscending;
  }
  else
  {
    rows.reverse();
    if( thNodeClassName == this.ClassSortAscending )
    {
      thNodeClassName = this.ClassSortDescending;
      thNode.title    = this.TitleSortDescending;
    }
    else
    {
      thNodeClassName = this.ClassSortAscending;
      thNode.title    = this.TitleSortDescending;
    }
  }
  thNode.className = thNode.className.replace(Sortable.REclassName, "") + " " + thNodeClassName ;

  //put the sorted table back into the document
  var frag = document.createDocumentFragment();
  for( var i=0; i < rows.length; i++ )
  {
    frag.appendChild( rows[i] );
  }
  table.appendChild( frag );
}

Sortable.convert = function( val, datatype )
{
  switch( datatype )
  {
    case "num"  : return parseFloat( val );
    case "date" : return new Date( Date.parse( val ) );
    case "ip4"   :
		  var octet = val.split(/\./);
                  return parseInt(octet[0]) * 1000000000 + parseInt(octet[1]) * 1000000 + parseInt(octet[2]) * 1000 + parseInt(octet[3]);
    default     : return val.toString();
  }
}

Sortable.createCompare = function( colidx, datatype )
{
  return function(row1, row2)
  {
    //var val1 = Sortable.convert( row1.cells[colidx].firstChild.nodeValue, datatype );
    //var val2 = Sortable.convert( row2.cells[colidx].firstChild.nodeValue, datatype );
    var val1 = Sortable.convert( getNodeText(row1.cells[colidx]), datatype );
    var val2 = Sortable.convert( getNodeText(row2.cells[colidx]), datatype );

    if     ( val1 < val2 ) { return -1; }
    else if( val1 > val2 ) { return 1;  }
    else { return 0; }
  }
}
/**
 ** 200 Collapsable list items
 **
 ** See also David Lindquist <first name><at><last name><dot><net>
 ** See: http://www.gazingus.org/html/DOM-Scripted_Lists_Revisited.html
 **
 **/
var Collapsable = new Object();

Collapsable.tmpcookie    = null;
Collapsable.cookies      = [] ;
Collapsable.cookieNames  = [] ;

Collapsable.ClassName    = "collapse";
Collapsable.ClassNameBox = "collapsebox";
Collapsable.ClassNameBody= "collapsebody";
Collapsable.OpenTip      = "Click to collapse";
Collapsable.CloseTip     = "Click to expand";
Collapsable.CollapseID   = "clps"; //prefix for unique IDs of inserted DOM nodes
Collapsable.MarkerOpen   = "O";    //cookie state chars
Collapsable.MarkerClose  = "C";
Collapsable.CookiePrefix = "JSPWikiCollapse";
Collapsable.bullet           = document.createElement("div"); // template bullet node
Collapsable.bullet.className = "collapseBullet";
Collapsable.bullet.innerHTML = "&bull;";


Collapsable.onPageLoad = function()
{
  this.initialise( "favorites",   this.CookiePrefix + "Favorites" );
  this.initialise( "pagecontent", this.CookiePrefix + Wiki.getPageName() );
 }


Collapsable.initialise = function( domID, cookieName )
{
  var page  = document.getElementById( domID );  if( !page ) return;
  this.tmpcookie = document.getCookie( cookieName );
  this.cookies.push( "" ) ; //initialise new empty collapse cookie
  this.cookieNames.push( cookieName );

  var nodes;
  nodes = getElementsByClassName( page, this.ClassName );
  if( nodes )
  {
    for( var i=0; i < nodes.length; i++)  this.collapseNode( nodes[i] );
  }
  nodes = getElementsByClassName( page, this.ClassNameBox );
  if( nodes )
  {
    for( var i=0; i < nodes.length; i++)  this.collapseBox( nodes[i] );
  }
}

Collapsable.REboxtitle = new RegExp ( "h2|h3|h4" );
Collapsable.collapseBox = function( node )
{
  var title = node.firstChild;
  while( (title != null) && (!this.REboxtitle.test( title.nodeName.toLowerCase() )) )
  {
    title = title.nextSibling;
  }
  if( !title ) return;
  if( !title.nextSibling ) return;

  var body = document.createElement( "div" );
  body.className = this.ClassNameBody;
  while( title.nextSibling ) body.appendChild( title.nextSibling );
  node.appendChild( body );

  var bullet  = this.bullet.cloneNode(true);
  this.initBullet( bullet, body, this.MarkerOpen );
  title.appendChild( bullet );
}


// Modifies the list such that sublists canbe hidden and shown by clicking the listitem bullet
// The listitem bullet is a node inserted into the DOM tree as the first child of the
// listitem containing the sublist.
Collapsable.collapseNode = function( node )
{
  var items = node.getElementsByTagName("li");
  for( i=0; i < items.length; i++ )
  {
    var nodeLI = items[i];
    var nodeXL = ( nodeLI.getElementsByTagName("ul")[0] ||
                   nodeLI.getElementsByTagName("ol")[0] );

    //dont insert bullet when LI is "empty" -- iow it has no text or no non ulol tags inside
    //eg. * a listitem
    //    *** a nested list item - intermediate level is empty
    var emptyLI = true;
    for( var n = nodeLI.firstChild; n ; n = n.nextSibling )
    {
      if((n.nodeType == 3 ) && ( n.nodeValue.trim() == "" ) ) continue; //keep searching
      if((n.nodeName == "UL") || (n.nodeName == "OL")) break; //seems like an empty li
      emptyLI = false;
      break;
    }
    if( emptyLI ) continue; //do not insert a bullet

    var bullet  = this.bullet.cloneNode(true);

    if( nodeXL )
    {
      var defaultState = (nodeXL.nodeName == "UL") ? this.MarkerOpen : this.MarkerClose ;
      this.initBullet( bullet, nodeXL, defaultState );
    }
    nodeLI.insertBefore( bullet, nodeLI.firstChild );
  }
}


// initialise bullet according to parser settings
Collapsable.initBullet = function( bullet, body, defaultState )
{
  var collapseState = this.parseCookie( defaultState );
  bullet.onclick = this.toggleBullet;
  bullet.id = this.CollapseID + "." + (this.cookies.length-1) +
                                "." + (this.cookies[this.cookies.length-1].length-1);
  this.setOpenOrClose( bullet, ( collapseState == this.MarkerOpen ), body );
}

// modify dom-node according to the setToOpen flag
Collapsable.setOpenOrClose = function( bullet, setToOpen, body )
{
  bullet.innerHTML   = (setToOpen) ? "&raquo;"      : "&laquo;" ;
  bullet.className   = (setToOpen) ? "collapseOpen" : "collapseClose" ;
  bullet.title       = (setToOpen) ? this.OpenTip   : this.CloseTip ;
  body.style.display = (setToOpen) ? "block"        : "none" ;
}


// parse cookie
// this.tmpcookie  contains cookie being validated agains the document
// this.cookies.last contains actual cookie being constructed
//    this cookie is stored in the cookies[]
//    and only persisted when the user opens/closes something
// returns collapseState MarkerOpen, MarkerClose
Collapsable.parseCookie = function( token )
{
  var currentcookie = this.cookies[this.cookies.length-1];
  var cookieToken = token; //default value

  if( (this.tmpcookie) && (this.tmpcookie.length > currentcookie.length) )
  {
    cookieToken = this.tmpcookie.charAt( currentcookie.length );
    if(  ( (token == this.MarkerOpen) && (cookieToken == this.MarkerClose) )
      || ( (token == this.MarkerClose) && (cookieToken == this.MarkerOpen) ) ) //##fixed
        token = cookieToken ;
    if( token != cookieToken )  //mismatch between tmpcookie and expected token
        this.tmpcookie = null;
  }
  this.cookies[this.cookies.length - 1] += token; //append and save currentcookie

  return( token );
}


// toggle bullet and update corresponding cookie
// format of ID of bullet = "collapse.<cookies-index>.<cookie-charAt>"
Collapsable.toggleBullet = function( )
{
  var ctx = Collapsable; //avoid confusion with this == clicked bullet

  var idARR  = this.id.split(".");  if( idARR.length != 3 ) return;
  var cookie = ctx.cookies[idARR[1]]; // index in cookies array

  var body;
  if( ctx.REboxtitle.test( this.parentNode.nodeName.toLowerCase() ) )
  {
    body = this.parentNode.nextSibling;
  }
  else
  {
    body = ( this.parentNode.getElementsByTagName("ul")[0] ||
             this.parentNode.getElementsByTagName("ol")[0] );
  }
  if( !body ) return;

  ctx.setOpenOrClose( this, (body.style.display == "none"), body );

  var i = parseInt(idARR[2]); // position inside cookie
  var c = ( cookie.charAt(i) == ctx.MarkerOpen ) ? ctx.MarkerClose : ctx.MarkerOpen;
  cookie = cookie.substring(0,i) + c + cookie.substring(i+1) ;

  document.setCookie( ctx.cookieNames[idARR[1]], cookie );
  ctx.cookies[idARR[1]] = cookie;

  return false;
}

/**
 ** 130 GraphBar Object : also used on the findpage
 ** %%graphBars ... %%
 ** convert numbers inside %%gBar ... %% tags to graphic horizontal bars
 ** no img needed.
 ** supported parameters: bar-color and bar-maxsize
 ** e.g. %%graphBars-e0e0e0 ... %%  use color #e0e0e0, default size 120
 ** e.g. %%graphBars-red-40 ... %%  use color red, maxsize 40 chars
 **/
var GraphBar = new Object();
GraphBar.REclassName = new RegExp( "(?:^| )graphBars(-\\S+)?" );
GraphBar.onPageLoad = function()
{
  var g = document.getElementsByClassName ( this.REclassName ); if( !g ) return;

  for( var i=0; i < g.length; i++ )
  {
    this.REclassName.test( g[i].className );
    var parms = RegExp.$1.split('-');
    var color =   ( parms[1] ? "style='background:"+parms[1].parseColor()+";color:"+parms[1].parseColor()+";' " : "" );
    var maxsize = ( parms[2] ? parseInt(parms[2],10) : 120 );

    var gBars = getElementsByClassName( g[i], "gBar" ); if( !gBars ) continue;

    var gBarD = [], maxValue = Number.MIN_VALUE; minValue = Number.MAX_VALUE;

    for( var j=0; j < gBars.length; j++ )
    {
      var k = parseInt( getNodeText(gBars[j]),10 );
      maxValue = Math.max( maxValue, k );
      minValue = Math.min( minValue, k );
      gBarD[j] = k;
    }

    for( var j=0; j < gBars.length; j++ )
    {
      var s = ".".repeat( parseInt( maxsize * ( gBarD[j]-minValue) / maxValue ) + 1 ) ;
      gBars[j].innerHTML = " <span class='graphBar' "+color+">"+s+"</span> "+gBarD[j];
    }
  }
}


/**
 * Copyright by Intland Software
 *
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Intland Software. ("Confidential Information"). You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Intland.
 *
 * $Revision$ $Date$
 */

/*
  $Id$
  Javascript functions for calendarPopup.tag
 */

var YUICalendarHelper = {

	// helper to get the calendar init value from one field or an other if the 1st is empty
	getCalendarInitValue: function(fieldId, otherFieldId) {
			var field = document.getElementById(fieldId);
			if (field.value == "" && otherFieldId != "") {
				var otherfield = document.getElementById(otherFieldId);
				if (otherfield) {
					return otherfield.value;
				}
			}
			return field.value;
	},

	// creates the calendar for a field
	// @param field The field input box
	// @param the id of the field, also part of the id of the calendar popup
	createCalendar : function(field, textFieldId) {
		// calendar added to its related field
		if (field.calendar != null) {
			return field.calendar;
		}

		var cfg = {
			title:"Choose a date:", close:true,
			START_WEEKDAY: 1,
			// configure "YYYY-MM-DD" format
			DATE_FIELD_DELIMITER: "-",
			MDY_YEAR_POSITION: 1,
			MDY_MONTH_POSITION: 2,
			MDY_DAY_POSITION: 3,

			MD_MONTH_POSITION: 1,
			MD_DAY_POSITION: 2,

			// the title will show year and then month
			MY_LABEL_YEAR_POSITION:  1,
			MY_LABEL_MONTH_POSITION:  2,
			MY_LABEL_YEAR_SUFFIX: "&nbsp;"
		};
		var calendar = new YAHOO.widget.Calendar("cal" + textFieldId, "calContainer" + textFieldId, cfg);
		calendar.render();

		field.calendar = calendar;
		return calendar;
	},

	// formatting of the date
	dateFormat : "yyyy-MM-dd",

	// show the YUI calendar
	// @param the id of the calendar's text field (input)
	// @param the id of the other text field, where the default value is read from if this 1st is empty
	showYUICalendar : function(textFieldId, otherFieldId) {
		var field = document.getElementById(textFieldId);
		var calendar = YUICalendarHelper.createCalendar(field, textFieldId);

		// write the value to calendar
		var txtValue = YUICalendarHelper.getCalendarInitValue(textFieldId, otherFieldId);
		var dateTime = getDateFromFormat(txtValue, YUICalendarHelper.dateFormat);

		calendar.reset();
		if (dateTime && dateTime != 0) {
			var dateValue = new Date(dateTime);
			calendar.select(dateValue);
			// show the page for the current date in format mm/yyyy
			var pagedate = formatDate(dateValue, "MM-yyyy");
			calendar.cfg.setProperty("pagedate", pagedate);
		}
		calendar.render();

		if (YAHOO.env.ua.ie > 0) {
			ie_zindex_fixes.fix(field);

			// when mouse moves over a calendar bing it in front of other calendars may be shown to fix z-index problems
			YAHOO.util.Event.addListener(calendar.oDomContainer, "mouseover", function(event) {
				ie_zindex_fixes.fix(field);
			});
		}

		calendar.show();

		// add select event will write back the selected date to text field
		var handleSelect = function(type,args,obj) {
		    var dates = args[0];
		    var date = dates[0];
		    var year = date[0], month = date[1], day = date[2];

			//debugger;
		    field.value = formatDate(new Date(year, month-1, day), YUICalendarHelper.dateFormat);
		    calendar.hide();

		    // unsubscribe!
		    calendar.selectEvent.unsubscribe(handleSelect);
		};
		calendar.selectEvent.subscribe(handleSelect, calendar, true);
	}
}
// $Id$
// script handles Ajax action calls for locking/unlocking a document/artifact

/*
	Do an ajax call to the server to lock/unlock a document

	@param doc_id The id of the artifact to lock
	@param lock Boolean whether the artifact should get locked
 */
function ajaxDocumentLock(doc_id, lock) {
	var controller = new AjaxDocumentLockController(doc_id, lock);
	controller.ajaxCall();
}

	/**
	 * Constructor for the controller handles the Ajax-document-lock calls
	 * @param doc_id
	 * @param lock
	 */
	function AjaxDocumentLockController(doc_id, lock) {
		this.doc_id = doc_id;
		this.lock = lock;
	}

	// methods for AjaxDocumentLockController object
	AjaxDocumentLockController.prototype = {

		// type constant
		type : "AjaxDocumentLockController",

		// ajax time-out constant
		ajaxTimeout: 10000,

		// icon url showing the status when artifact is locked
		ICON_URL_LOCKED: "/images/locked.gif",
		// icon url showing the status when artifact is not locked
		ICON_URL_NOT_LOCKED: "/images/lockfoldergray.gif",
		// icon url showing ajax call in progress
		ICON_URL_LOADING: "/images/ajax-loading_16.gif",

		// constant: fixed part of the html id for the icon or the menu of lock/unlock
		LOCK_UNLOCK_ID_PART: "LockUnlockAction_",

		// initiate the ajax call to the server
		ajaxCall:function() {
		   this.url = contextPath + "/ajax/artifactLock.spr?doc_id=" + this.doc_id +"&lock=" + this.lock;
		   //alert("ajaxDocumentLock on url:" + this.url);
		   YAHOO.log("starting Ajax request to " + this.url, this.type);

		   var this_callback = {
		   		success: this.handleSuccess,
		   		failure: this.handleFailure,
		   		scope: this,
		   		timeout: this.ajaxTimeout
		   };
	       YAHOO.util.Connect.asyncRequest('GET', this.url , this_callback, null);

	       // change the icon to indicate the ajax call in progress
	       this.setIcon(this.ICON_URL_LOADING);
	    },

		// member method handle the success response of the ajax call
		handleSuccess:function(o){
			//alert("Ajax call success:" + o.responseText);
			YAHOO.log("Ajax call success:" + o.responseText, this.type);

			var Dom = YAHOO.util.Dom;

			if (o.responseText == "true") {
				// successful lock/unlock
				var newiconurl;
				var newtitle;
				var oldtitle;
				if (this.lock) {
					// change icon to locked
					newiconurl = this.ICON_URL_LOCKED;
					newtitle = "Unlock";
					oldtitle = "Lock";
				} else {
					// change icon to unlocked
					newiconurl = this.ICON_URL_NOT_LOCKED;
					newtitle = "Lock";
					oldtitle = "Unlock";
				}
				// find the icon's domElement is a <a href="#" title="Lock/Unlock" /><img src="..."/></a> html element what was clicked on
				var domElem = this.getDomElem();
				domElem.title = newtitle;
				var onclick = domElem.onclick;
				// alert("onclick func:" + onclick);
				this.setIcon(newiconurl);

				// replace the onclick function, so can switch back the lock state by clicking again
				var _revertLock = !this.lock;
				var _doc_id = this.doc_id;
				var newOnClickFunc = function(event) {
				    ajaxDocumentLock(_doc_id, _revertLock);
				    return false;
				};
				domElem.onclick = newOnClickFunc;

				// update the menu item in the context menu to be in sync with the icon
				var menuElem = document.getElementById(this.LOCK_UNLOCK_ID_PART + this.doc_id);
				menuElem.title = newtitle;
				menuElem.onclick = newOnClickFunc;

				// change the icon-image in the menu, this contains the label too
				Dom.getElementsByClassName("tableIcon", "img", menuElem, function(img) {
					img.src = contextPath + newiconurl;
				});
				// find the text-node child with the old title, and put the changed title there
				Dom.batch(menuElem.childNodes, function(el) {
					if (el.nodeType == 3 && el.nodeValue == oldtitle) {
						el.nodeValue = newtitle;
					}
				});
			} else if (o.responseTest=="false") {
				this.resetIcons();
				alert("Sorry the requested " + (this.lock ? "Lock" : "Unlock") + " operation can not be performed!");
			} else {
				this.resetIcons();
				YAHOO.log("invalid response:" + o.responseText, this.type);
			}
	    },

	    handleFailure:function(o) {
			YAHOO.log("Ajax call Failure:" + o.statusText +"\n" + o.responseText, "AjaxDocumentLockController");
	    	alert("Ajax call failure:" + o.statusText);
	    	this.resetIcons();
	    },

	    // find the icon's domElement
	    getDomElem: function() {
	    	var domElem = document.getElementById("icon_" + this.LOCK_UNLOCK_ID_PART + this.doc_id);
	    	return domElem;
	    },

	    // change the icon
	    // @param iconurl The icon url without contextPath
	    setIcon: function(iconurl) {
			var img = this.getDomElem().childNodes[0];
			img.src = contextPath + iconurl;
	    },

	    // reset icons when call failed, showing the original state
	    resetIcons:function() {
			if (this.lock) {
				this.setIcon(this.ICON_URL_NOT_LOCKED);
			} else {
				this.setIcon(this.ICON_URL_LOCKED);
			}
	    }

	}

/**
 * Copyright by Intland Software
 *
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Intland Software. ("Confidential Information"). You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Intland.
 *
 * $Revision$ $Date$
 */

// $Id$
// Javascript for Ajax populated tree

	// fix for that IE does not know Array.indexOf() function:
	if(!Array.indexOf){
	    Array.prototype.indexOf = function(obj){
	        for(var i=0; i<this.length; i++){
	            if(this[i]==obj){
	                return i;
	            }
	        }
	        return -1;
	    }
	}

	/**
	 * Class for the root node of the AjaxTree.
	 *
	 * @param id
	 * @param link The link url when clicked on the node
	 * @param label The text shown on the root node
	 */
	function AjaxTreeRootNode(id, link, label) {
		this.id = id;
		this.link = link;
		this.label = label;
	}

	/**
	 * Constructor for the Tree controller build tree via Ajax calls
	 * @param rootNodeData Optional AjaxTreeRootNode object where all the child nodes will be added to.
	 * @param divId The id of the div element for the Tree
	 * @param contextPath The context-path where the ajax urls are bound below. Use request.getContextPath()
	 * @param treeType The registered tree-type constant on server
	 * @param selectedNodeId The id of the selected node
	 * @param urlParams Optional url parameters to put on the request
	 */
	function AjaxTreeController(rootNodeData, divId, contextPath, treeType, selectedNodeId, urlParams) {
		this.rootNodeData = rootNodeData;
		this.divId = divId;
		this.contextPath = contextPath;
		this.treeType = treeType;
		this.selectedNodeId = selectedNodeId;
		this.urlParams = urlParams;
	}

	// methods for AjaxTreeController object
	AjaxTreeController.prototype = {

		// type constant
		type : "AjaxTreeController",

		// the treeType parameter passed in Ajax calls
		// this will be used to identify the tree builder's logic, i.e. we can have a Documents tree
		// and an Source-code tree. See ITreeNodeBuilderFactory subclasses
		treeType : "",

		// optional parameters to put on all of the urls of the ajax requests
		urlParams: null,

		// ajax timeout in ms :TODO: lower this in production
		ajaxTimeout: 100000,

		// id of the selected node
		selectedNodeId : null,

		// array contains the ids of the nodes on the path of the currently selected node
		pathToSelected: [],

		// if closing the node will send back the closed nodes to server in ajax calls.
		sendCloseNodeAjax: true,

		// event fired when the initial tree is loaded
		treeLoadedEvent: null,

		/**
		 * Render the tree, and request the initial content via ajax.
		 * @return
		 */
		render: function() {
			var divId = this.divId;
			var rootNodeData = this.rootNodeData;
			var htmlElement = document.getElementById(divId);
			var tree = new YAHOO.widget.TreeView(htmlElement);
			this.tree = tree;
			tree.ajaxTreeController = this;

			// create a visible top node under the root
			var rootNode = null;
			if (rootNodeData != null) {
				this.pathToSelected[this.pathToSelected.length] = rootNodeData.id;
				rootNode = this.createTreeNode(tree.getRoot(), rootNodeData);
			} else {
				// This node shows that the tree is being loaded. Also without this the tree would not be rendered.
				this.loadingNode = this.createTreeNode(tree.getRoot(), new AjaxTreeRootNode(null, null, "<span class='tree-root-loading'>loading...</span>"));
			}

			tree.draw();

			// Expand and collapse happen prior to the actual expand/collapse,
			// and can be used to cancel the operation
			tree.subscribe("expand", function(node) {
		          YAHOO.log(node.data.id + " was expanded");
				  this.fixTreeLayout(node);
		       }, this, true);

		    // disable collapse on top node:
		   	tree.subscribe("collapse", function(node) {
		          YAHOO.log(node.data.id + " to be collapsed");
			      // root node has no id: do not allow collapsing it
			      if (!node.data.id || node === rootNode) {
			      		return false;
			      }
			      return true; // allow collapse
		       }, this, true);

		   	tree.subscribe("collapseComplete", function(node) {
		          YAHOO.log(node.data.id + " was collapsed");
		          // when collapsed remove all children so next expand will refresh the data
			      tree.removeChildren(node);

			      // do an ajax call and send back the closed nodes later
			      try {
			    	  this.scheduleAjaxCloseNodeCall(node);
			      } catch (e) {
			    	  alert(e);
			      }
		       }, this, true);

		    tree.subscribe("labelClick", function(node) {
		    	var href = node.href;
		    	if (href != "#" && href != '') {
		    		YAHOO.log("opening href=" + href);
		    		document.location.href = href;
		    	}
		    });

			this.treeLoadedEvent = new YAHOO.util.CustomEvent("treeLoaded", this);

			// request the initial tree
			this.requestInitialTree(rootNode);
		},

		// member method handle the success response
		// Expects an argument parameter in the callback object as:
		// { node: the node to add children to,
		//	 fnLoadComplete: callback function after the nodes added
		// 	 expandNewNodes: if the newly added nodes are expanded
		// }
		handleSuccess:function(o){
			YAHOO.log("Ajax call success:" + o.responseText);
	        // parse the JSON of the result, the result will be an array of top TreeNode objects in a "nodes" subproperty
	        try {
	        	var result = YAHOO.lang.JSON.parse(o.responseText);

		        var subnodes = result.nodes;
		        if (result.pathToSelected) {
		        	this.pathToSelected = result.pathToSelected;
				}

		        var node = o.argument.node;
		        var expandNewNodes = o.argument.expandNewNodes;
		        YAHOO.log("handleSuccess() is adding to node:" + node);
		        this.addNodes(node, subnodes, expandNewNodes);
			} catch (e) {
				alert("Error parsing Ajax response:" + e);
			}

	        this.completeAjaxCall(o);
	    },

	    // Add a list/tree of new nodes to a parent node. This will add subnodes too!
	    // @param parentNode Yahoo TextNode widget to add child to
	    // @param subnodes The array of TreeNode objects serialized
	    // @param expandNewNodes If the newly created nodes should be expanded
	    addNodes:function(parentNode, subnodes, expandNewNodes) {
	    	if (parentNode == null) {
	    		parentNode = this.tree.getRoot();
	    	}

			for (var i=0; i<subnodes.length;i++) {
				// convert between the data structure of the JSON-TreeNode and the node-data needed for YUI node
				// it is almost the same, but not quite exactly!
				var treeNodeObj = subnodes[i];

				var subnode = this.createTreeNode(parentNode, treeNodeObj);
				this.fixTreeLayout(subnode);

				// all nodes will be dynamically loaded
				var ME = this;
				var loadFunction = function() {
					// apply function is used, so "this" object will refer to "Me" in the loadNodeData function
					ME.loadNodeData.apply(ME, arguments);
				};
				subnode.setDynamicLoad(loadFunction/*, currentIconMode*/);

				// recurse deeper if has children
				if (treeNodeObj.children.length >0) {
					this.addNodes(subnode, treeNodeObj.children, expandNewNodes);

					// mark this node is already loaded
					subnode.dynamicLoadComplete = true;
				} else {
					// no children data arrived, and the node tells that it has no children, then
					// tell that it is already loaded, and show as expanded
					if (! treeNodeObj.hasChildren) {
						subnode.dynamicLoadComplete = true;
						subnode.expanded = true;
					}
				}
			}

			if (expandNewNodes) {
				// make the parent node expanded
				parentNode.expand();
			}
			if (parentNode == this.tree.getRoot()) {
				parentNode.refresh();
			}
	    },

	    /**
	     * Creates nodeData parameter for YAHOO.widget.TextNode/HTMLNode from the treeNode object arrived in the ajax response.
	     * @param treeNodeObj The JSON data
	     * @return The nodeData
	     */
	    createNodeData: function(treeNodeObj) {
			// replace empty link with '#' to avoid expand/collapse of node when link is empty
			var href = treeNodeObj.link;
			if (href=='') {
				href = "#";
			}
			YAHOO.log("href:" + href);

			var nodeId = treeNodeObj.id;
			var label = treeNodeObj.label;

			var nodeData = {
					id: nodeId, label: label, href:href
					,	nowrap: true /* avoid wrapping of long text nodes: does not work! */
				};

			// mark the nodes on the path-to-the-selected-node with a style
			if (this.pathToSelected && this.pathToSelected.indexOf(nodeId) != -1) {
				nodeData.style = "tree-pathToSelected";
			}
			// change the style for selected node
			if (this.selectedNodeId && this.selectedNodeId == nodeId) {
				nodeData.style = "tree-selectedNode";
			}

			return nodeData;
	    },

	    /**
	     * Override-able function create tree node for the current node's json data.
	     *
		 * This converts between the data structure of the JSON-TreeNode and the node-data needed for YUI node
		 * it is almost the same, but not quite exactly!
		 *
	     * @param parentNode the parent node
	     * @param treeNodeObj The json data object contains data for this node
	     */
	    createTreeNode: function(parentNode, treeNodeObj) {
	    		var nodeData = this.createNodeData(treeNodeObj);
				var subnode = new YAHOO.widget.TextNode(nodeData, parentNode, false);
				return subnode;
	    },

	    handleFailure:function(o){
	    	AjaxErrorReport.reportAjaxFailure(o);
	    	this.completeAjaxCall(o);
	    },

	    // private method called after either successfull or failure on ajax calls to call
	    // the fnLoadComplete method so the tree will continue working even after errors
	    completeAjaxCall:function(o) {
			var fnLoadComplete = o.argument.fnLoadComplete;
			if (fnLoadComplete) {
				YAHOO.log("Callback the function:" + fnLoadComplete);
				fnLoadComplete.call(this);
			}

			YAHOO.log("Ajax tree rendering completed!");
	    },

	    /**
	     * build the ajax-url by adding the standard parameters
	     * @param path The ajax path without contextPath to build the url from.
	     * @return The url
	     */
	    buildAjaxURL: function(path) {
	    	var url = this.contextPath + path +'?treeType=' + this.treeType;
	    	if (this.urlParams != null) {
	    		url += "&" + this.urlParams;
	    	}
	    	return url;
	    },

		// do the initial request for loading the tree state
		// @param rootNode the root node of the tree to add the subnodes to
		requestInitialTree:function(rootNode) {
		   var url = this.buildAjaxURL('/ajax/getTreeStructure.spr');
		   var postData = "";
		   // pass the selected nodeId back to
		   if (this.selectedNodeId) {
		   		postData = "selectedNodeId=" + this.selectedNodeId;
		   }

		   YAHOO.log("starting Ajax request to " + url);
		   if (rootNode != null) {
			   YAHOO.util.Dom.addClass(rootNode.labelElId, "tree-root-loading");
			   YAHOO.util.Dom.addClass(rootNode.contentElId, "tree-root-loading");
		   }

		   var this_callback = {
		   		success: this.handleSuccess,
		   		failure: this.handleFailure,
		   		scope: this,
		   		timeout: this.ajaxTimeout,
				argument: { node: rootNode,
							fnLoadComplete: function() {
			   					if (rootNode != null) {
			   						// remove the tree-root-loading class, so it won't show the "loading" image any more
			   						YAHOO.util.Dom.removeClass(rootNode.labelElId, "tree-root-loading");
			   						YAHOO.util.Dom.removeClass(rootNode.contentElId, "tree-root-loading");
			   					}
			   					if (this.loadingNode != null) {
			   						this.tree.removeNode(this.loadingNode);
			   						this.loadingNode = null;
			   						this.tree.getRoot().refresh();
			   					}
			   					this.treeLoadedEvent.fire();
							},
							expandNewNodes: true
						  }
		   };
	       YAHOO.util.Connect.asyncRequest('POST', url , this_callback, postData);
	    },

		// dynamically load a node's subnodes when the node is expanded
		loadNodeData: function(node, fnLoadComplete) {
		   var url = this.buildAjaxURL('/ajax/openNode.spr');
		   var postData = "nodeId=" + node.data.id;
		   YAHOO.log("starting Ajax request to " + url);
		   var this_callback = {
		   		success: this.handleSuccess,
		   		failure: this.handleFailure,
		   		scope: this,
		   		timeout: this.ajaxTimeout,
		   		argument: { node: node,
		   					fnLoadComplete: function() {
		   										node.loadComplete.apply(node);
		   									},
		   					expandNewNodes: false
		   				   }
		   };
	       YAHOO.util.Connect.asyncRequest('POST', url , this_callback, postData);
		},

		// array for the nodes has been closed recently
		nodesClosed: new Array(),

		// current timer object for sending closed nodes
		sendNodesClosedTimer: null,

		// schedule a call to the server, with several nodes closed. Used to avoid having too many calls which would happen
		// when closing a node which closes all of its subnodes, would cause that many ajax calls fired
		scheduleAjaxCloseNodeCall: function(node) {
			if (!this.sendCloseNodeAjax) {
				return;
			}

			// add the node to the array for sending it later
			this.nodesClosed[this.nodesClosed.length] = node;

			if (this.sendNodesClosedTimer != null) {
				this.sendNodesClosedTimer.cancel();
			}
			// one second later close the nodes
			this.sendNodesClosedTimer = YAHOO.lang.later(500, this, this.sendNodesClosed);
		},

		sendNodesClosed: function() {
			var nodesToSend = this.nodesClosed;
			this.nodesClosed = new Array();
			if (nodesToSend.length == 0) {
				return;
			}

			var url = this.buildAjaxURL('/ajax/closeNodes.spr');
			var postData = "nodeId=";
			var SEPARATOR = String.fromCharCode(01); // use unicode 01 as separator
			for (var i=0; i<nodesToSend.length;i++) {
				if (i != 0) {
					postData += SEPARATOR;
				}
				var node = nodesToSend[i];
				postData += node.data.id;
			}
			YAHOO.log("Sending closed nodes to server:" + postData);

			// do the ajax call, but since no result we don't pass a callback
			YAHOO.util.Connect.asyncRequest('POST', url , null, postData);

			this.sendNodesClosedTimer = null;
		},

		// variable set to avoid fixTreeLayout wasting cpu when the tree is already set to wide
		layoutFixed: false,

		// WORKAROUND: when the tree gets wide set the width CSS of explicitly, so the tree won't break
		fixTreeLayout: function(node) {
			if (!this.layoutFixed && node) {
				// estimate width of labels
				var approxSize = (node.depth * 2) + node.label.length;
				if (approxSize > 20) {
					this.layoutFixed = true;
					YAHOO.log("setting tree wider");
					var treeDiv = document.getElementById(node.tree.id);
					treeDiv.style.width = "800px";
					//treeDiv.style.height = "600px";
				}
			}
		}

	};

/**
 * An Ajax tree with checkboxes or radio buttons as tree nodes, for allowing single or multi selection of these nodes
 *
 * @param rootNodeData Optional AjaxTreeRootNode object where all the child nodes will be added to.
 * @param divId The id of the div element for the Tree
 * @param contextPath The context-path where the ajax urls are bound below. Use request.getContextPath()
 * @param treeType The registered tree-type constant on server
 * @param selectedNodeId The id of the selected node
 * @param urlParams Optional url parameters to put on the request
 * @param multiSelection True for multi-selection (appears as checkbox), false for single selection (appears as radio-button)
 * @param inputName The name of the checkbox/radio input box
 */
function SelectableAjaxTree(rootNodeData, divId, contextPath, treeType, selectedNodeId, urlParams, multiSelection, inputName) {
	if (this.multiSelection != null) {
		this.multiSelection = multiSelection;
	}
	if (this.inputName != null) {
		this.inputName = inputName;
	}
	this.constructor.superclass.constructor.call(this, rootNodeData, divId, contextPath, treeType, selectedNodeId, urlParams);

	this.nodeLinkClickEvent = new YAHOO.util.CustomEvent("nodeLinkClick", this);
}

YAHOO.lang.extend(SelectableAjaxTree, AjaxTreeController,
		{
			// if the nodes in the tree are allowing multi selection (appearing as checkbox), or single-selection (appearing as radio-button).
			multiSelection: true,

			// the name of the input tag contains the selected ids
			inputName: "treeSelectedNode",

			// custom event fired when the node is clicked on
			// the event gets the following arguments in this order:
			//  nodeId	 - The id of the node
			//  treeNode - The YUI tree-node contains the  element clicked on
			nodeLinkClickEvent: null,

			// The last tree node clicked on
			lastClickedTreeNode: null,

			// CSS class added to the last-clicked node
		    lastClickedTreeNodeCssClass: "tree-last-clicked-node",

			// if the tree shows checkboxes/radio buttons
			showSelectors: true,

			/**
			 * Create the selector, which is either a checkbox or radio button.
			 * Uses treeNodeObj.selectable and selected properties for this
			 */
			createSelector: function(nodeData, treeNodeObj) {
				var selectable = treeNodeObj.selectable;
				var selected = treeNodeObj.selected;
				// defaults:
				if (selectable == null) {
					selectable = true;
				};
				if (selected == null) {
					selected = false;
				};

				var selector = "";
				var attributes = "";
				if (selected) {
					attributes += " checked='y' "
				}
				if (!selectable) {
					attributes += " disabled='true' ";
				}

				if (this.multiSelection) {
					selector = "<input type='checkbox' name='" + this.inputName + "' value='" + nodeData.id +"' " + attributes +" ></input>";
				} else {
					selector = "<input type='radio' name='" + this.inputName + "' value='" + nodeData.id +"' " + attributes +" ></input>";
				}
				return selector;
			},

			createLabelHTML:function (nodeData, treeNodeObj) {
				var labelHTML = nodeData.label;
				if ((nodeData.href != null && nodeData.href != "#") || nodeData.onclick != null) {
					labelHTML = "<a ";
					if (nodeData.href != null) {
						labelHTML += " href='" + nodeData.href+"'";
					}
					if (nodeData.onclick !=null) {
						labelHTML += " onclick=\"" + nodeData.onclick +"\"";
					}
					labelHTML += ">" + nodeData.label +"</a>";
				}
				return labelHTML;
			},

		    /**
		     * Overridden function create tree node for the current node's json data.
		     *
		     * @param parentNode the parent node
		     * @param treeNodeObj The json data object contains data for this node
		     */
		    createTreeNode: function(parentNode, treeNodeObj) {
				var nodeData = this.createNodeData(treeNodeObj);
				if (nodeData.id != null) {
					nodeData.onclick = "SelectableAjaxTree.prototype._nodeLinkClicked(this, '" + this.tree.id +"','" + nodeData.id +"'); return false;";
				}

				var html = "";

				if (this.showSelectors && nodeData.id != null) {
					html += this.createSelector(nodeData, treeNodeObj);
				}

				var iconMarkup = this.createIconImage(parentNode, treeNodeObj, nodeData);
				if (iconMarkup != null) {
					html = iconMarkup +  html;
				}

				html = html + this.createLabelHTML(nodeData, treeNodeObj);
				if (nodeData.style != null) {
					html = "<span class=\"" + nodeData.style +"\">" + html +"</span>";
				}

				nodeData.html = html;
				nodeData.hasIcon = true;

				var subnode = new YAHOO.widget.HTMLNode(nodeData, parentNode, false, nodeData.hasIcon);
				subnode.label = nodeData.label;	// TODO: workaround for fixTreeLayout() method needs the label
				return subnode;
		    },

		    /**
		     * Private method called when the link-label clicked.
		     * This fires the "nodeLinkClickEvent"
		     *
		     * @param el The element clicked on
		     * @param treeId
		     * @param nodeId the node id clicked on.
		     */
		    _nodeLinkClicked:function(el, treeId, nodeId) {
		    	var tree = YAHOO.widget.TreeView.getTree(treeId);
		    	if (tree == null) {
		    		return;
		    	}
		    	var treeNode = tree.getNodeByElement(el);
				var ajaxTreeController = tree.ajaxTreeController;
				if (ajaxTreeController != null) {
					ajaxTreeController.nodeLinkClickEvent.fire(nodeId, treeNode);
				}

				this.setLastClickedTreeNode(treeNode);
		    },

		    findTreeNodeByNodeId: function(nodeId) {
		    	var treeNode = this.tree.getNodeByProperty("id", nodeId);
		    	return treeNode;
		    },

		    /**
		     * "Click" on the node by a node-id
		     * @param the nodeId
		     */
		    clickOnNodeByNodeId: function(nodeId) {
		    	var treeNode = this.findTreeNodeByNodeId(nodeId);
		    	if (treeNode != null) {
		    		this.nodeLinkClickEvent.fire(nodeId, treeNode);
		    		this.setLastClickedTreeNode(treeNode);
		    	}
		    },

		    /**
		     * Change the last-clicked tree node.
		     * @param treeNode The tree-node clicked on
		     */
		    setLastClickedTreeNode: function(treeNode) {
		    	var Dom = YAHOO.util.Dom;
		    	var CSSCLASS = this.lastClickedTreeNodeCssClass;
				if (this.lastClickedTreeNode != null) {
					Dom.removeClass(this.lastClickedTreeNode.contentElId, CSSCLASS);
					this.lastClickedTreeNode = null;
				} else {
					// TODO: this is only workaround for the bug, that the tree root remains selected after page load:
					// it is probably because the "this" scope goes wrong, for example the this.tree is null
					//if (this.tree == null) {
					//	debugger;
					//}
					Dom.getElementsByClassName(CSSCLASS, null, null,
							function(foundEl) {
									Dom.removeClass(foundEl, CSSCLASS);
								});
				}
				if (treeNode != null) {
					this.lastClickedTreeNode = treeNode;
					Dom.addClass(this.lastClickedTreeNode.contentElId, CSSCLASS);
				}
		    },

		    /**
		     * Create the icon for the node.
		     *
		     * @return The markup used as icon for the node (including the contextPath), or null if no icon should be used.
		     */
		    createIconImage: function(parentNode, treeNodeObj, nodeData) {
		    	var id = treeNodeObj.id;
		    	var entityId = EntityIdParser.parse(id);
		    	if (entityId == null) {
		    		return null;
		    	}
		    	var grouptype = entityId.grouptype;

		    	var url;
		    	if (grouptype == 5 /* GroupType.ArtifactDto */) {
		    		// render wikipage's icon
			    	var title = "";
			    	if (treeNodeObj.linked || treeNodeObj.children) {
				    	var icon = "wikipage";
				    	if (treeNodeObj.linked) {
				    		icon += "-linked";
				    		title += " (linked)";
				    	}
				    	if (treeNodeObj.children) {
				    		icon += "-child";

				    		title += "(child)"
				    	}
				    	icon = "/images/" + icon + ".png";
			    	} else {
			    		icon = "/images/entity/wikipage.gif";
			    	}

			    	url = this.contextPath + icon;
			    	return "<img src='" + url + "' title='" + title +"'></img>";
		    	}

		    	if (grouptype == 8 /* ARTIFACT_COMMENT */) {
		    		url = this.contextPath + "/images/Attachment.gif";
		    		return "<img src='" +url +"' title='Attachment'></img>";
		    	}

		    	return null;
		    }

		}
);

/**
 * Parser for entity ids, which are in the form of "<grouptype>-<entityid>"
 */
var EntityIdParser = {

	re: new RegExp("(\\d+)\\-(\\d+)"),

	/**
	 * Parses the entityId is the form of "<grouptype>-<entityid>".
	 *
	 * @param entityId The entity-id
	 * @return null if can not parse, or an object with two attributes of "grouptype" and "id"
	 */
	parse:function(entityId) {
		var m = EntityIdParser.re.exec(entityId);
		if (m != null) {
			return { grouptype: m[1], id: m[2] };
		}
		return null;
	}

}

/**
 * Show the response of the Ajax request as innerHTML of an html element
 * TODO: clean-up!
 *
 * @param containerId The html element to add the ajax result into
 * @param url The request url
 */
function showAjaxResultIn(containerId, url, postData) {
   var container = document.getElementById(containerId);
   var showResponse = function(o) {
	   var response = o.responseText;
	   if (response == "") {
		   response = "<div class='information'>This page is empty</div>";
	   }
	   container.innerHTML = response;
   };
   var showError = function(o) {
	   var response = o.responseText;
	   container.innerHTML = "<div class='error'>Error!</div>" + response;
   };
   var this_callback = {
	   		success: showResponse,
	   		failure: showError,
	   		scope: this,
	   		timeout: 10000
   };
   YAHOO.util.Connect.asyncRequest('POST', url , this_callback, postData);
   container.innerHTML="<div><img src='" + contextPath +"/images/ajax-loading_16.gif'></img>&nbsp;Loading...</div>";
}

/**
 * Copyright by Intland Software
 *
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Intland Software. ("Confidential Information"). You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Intland.
 *
 * $Revision$ $Date$
 */

/**
 * AJAXy Star-rating Script For Yahoo! UI Library (YUI)
 *
 * By Ville Säävuori <Ville@Unessa.net>
 * http://www.unessa.net/en/hoyci/projects/yui-star-rating/
 *
 * Based loosely on Wil Stuckeys jQuery Star Rating Plugin:
 * http://sandbox.wilstuckey.com/jquery-ratings/
 *
 * Respecting the original licence, this script is also
 * dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Version history
 * 0.1 - First version (2007-04-06)
 */

/**
 * Base class for Raging/Voting widget
 */
function RatingBase() {
}

RatingBase.prototype = {

	// the unique id for the widget
	id: null,
	// the url to post to
	post_to: contextPath + "/ajax/setObjectRating.spr",
	// entity parameters for url
	entityTypeId: null,
	entityId: null,
	// current statstics values
	averageRating: 0,
	ratingTotal: 0,
	numberOfRatings: 0,
	// the user's rating/voting value
	userRating: null,

	/**
	 * constructor
	 * @param id The unique id for the widget.
	 * @param averageRating The current rating average value
	 * @param ratingTotal The rating total
     * @param numberOfRatings The number users who rated on this
     * @param userRating The current user's rating, or null if not yet rated this object
     * @param entityTypeId The entity-type
     * @param entityId The entity id
     */
	init: function(id, averageRating, ratingTotal, numberOfRatings, userRating, entityTypeId, entityId) {
		this.id = id;
		this.averageRating = averageRating;
		this.ratingTotal = ratingTotal;
		this.numberOfRatings = numberOfRatings;
		this.userRating = userRating;
		this.entityTypeId = entityTypeId;
		this.entityId = entityId;
		if (entityTypeId == null || entityId == null) {
			throw "Missing required entityTypeId or entityId parameters!";
		}
		this.updateStats(false);
	},

	/**
	 * Submit the rating via ajax
	 * @param num The rating number (index of star) has been clicked on
	 */
    submit_rating: function(num) {
        // check if submission is not in progress to avoid double submissions
        if (!this.submitting) {
            // save user's rating
            this.userRating = num;
			this.setSubmitting(true);

            // change the rating-value for the form and submit the form
            var post_to = this.post_to;
            var postdata = "rating=" + num;
            postdata += "&entityTypeId=" + this.entityTypeId + "&entityId=" + this.entityId;

            var THIS = this;
            // create a closure for ajax-callback, so it will call the current Rating instance
            var ajax_callback = {
		        success: function(o) {
		        	try {
		           		this.parseAjaxResponse(o.responseText);
		           		this.updateWidget();
					} catch (e) {
						alert("Error processing Ajax response:" + e);
					}
			        this.setSubmitting(false);
		        },
		        failure: function(o) {
		        	// we shouldn't ever go down this path.
		        	AjaxErrorReport.reportAjaxFailure(o);
		            this.setSubmitting(false);
		        },
		        scope: THIS
            };

            var c = YAHOO.util.Connect.asyncRequest('POST', post_to + '?xhr=True', ajax_callback, postdata);
        }
    },

    /**
     * Parse the ajax response. This should update average and numberOfRatings.
     * @param responseText The ajax response
     * @return if the parsing was successful
     */
    parseAjaxResponse: function(responseText) {
    	// the Ajax response may return a json message back:
    	try {
			var responseObj = YAHOO.lang.JSON.parse(responseText);
		} catch (e) {
			alert("Could not parse Ajax response:" + responseText +"\n" + e);
			return false;
		}
		// the json message contains properties for the new values of ObjectRatingStatsDto
		this.averageRating = responseObj.averageRating;
		this.numberOfRatings = responseObj.numberOfRatings;
		this.ratingTotal = responseObj.ratingTotal;
		return true;
    },

    // change the status of widget, because we're submitting the the rating value
    setSubmitting: function(submitting) {
    	if (submitting) {
    		YAHOO.util.Dom.addClass(this.getWidget(), "rating-submitting");
    	} else {
    		YAHOO.util.Dom.removeClass(this.getWidget(), "rating-submitting");
    		this.updateStats(true);
    	}
    	this.submitting = submitting;
    },

    // update the statistics in tooltips with the current values
    // @param show if it immediately shows the tooltip
    updateStats: function(show) {
    	var msg = this.getTooltipMessage();
    	// init tooltip if not yet
 	    if (!this.tooltip) {
    		var widget = this.getWidget();
    		if (widget != null) {
				var newTooltip = new YAHOO.widget.Tooltip("tooltip" + widget.id, { context: widget } );
	    		this.tooltip = newTooltip;
			}
		}

		// update text and force show
		if (this.tooltip != null) {
			this.tooltip.cfg.setProperty("text", msg);
			if (show) {
	    		this.tooltip.show();
			}
		}
    },

    // Get the message shown as tooltip for statistics
    getTooltipMessage: function() {
    	return null;
    },

    // Get the widget to align the tooltip too
    getWidget: function() {
    	return null;
    },

    // callback to update the widget after ajax response is received
    updateWidget: function() {
    }

}

/**
 * Class/Constructor for voting controller.
 * @param id The id for the entity this voting belongs to
 * @param ratingTotal The current total value for votings
 * @param numberOfRatings The number users who rated on this
 * @param userRating The current user's rating, or null if not yet rated this object
 * @param entityTypeId The entity-type
 * @param entityId The entity id
 */
Voting = function(id, ratingTotal, numberOfRatings, userRating, entityTypeId, entityId) {
	if (this == window) {
		// create new object
		return new Voting(id, ratingTotal, numberOfRatings, userRating, entityTypeId, entityId);
	}

	this.init(id, ratingTotal, numberOfRatings, userRating, entityTypeId, entityId);
}

// New methods and method overrides for Voting object
YAHOO.lang.extend(Voting, RatingBase, {

	/**
	 * @param id The unique id for the widget.
	 * @param ratingTotal The current total value for votings
 	 * @param numberOfRatings The number users who rated on this
 	 * @param userRating The current user's rating, or null if not yet rated this object
     * @param entityTypeId The entity-type
     * @param entityId The entity id
 	 */
    init: function(id, ratingTotal, numberOfRatings, userRating, entityTypeId, entityId) {
    	// call super constructor
    	Voting.superclass.init.call(this, id, null, ratingTotal, numberOfRatings, userRating, entityTypeId, entityId);

		// add event listeners
		var votingwidget = document.getElementById("votingwidget_" + this.id);
		for (var i=0; i<votingwidget.childNodes.length; i++) {
			var elem = votingwidget.childNodes[i];
			if (elem.className == 'yes-vote') {
				 YAHOO.util.Event.addListener(elem, 'click', function() { this.submit_rating(+1); }, i, this /* scope correction*/);
			}
			if (elem.className == 'no-vote') {
				 YAHOO.util.Event.addListener(elem, 'click', function() { this.submit_rating(-1); }, i, this /* scope correction*/);
			}
		}
    },

    /**
     * Update the voting widget with the new value.
     */
	updateWidget:function() {
		var votingwidget = document.getElementById("votingwidget_" + this.id);
		var votingtotal = document.getElementById("votingtotal_" + this.id);

		votingtotal.innerHTML = this.ratingTotal;

		// update CSS for total number
		YAHOO.util.Dom.removeClass(votingwidget, 'voted-total-negative');
		YAHOO.util.Dom.removeClass(votingwidget, 'voted-total-positive');
		// note: when the ratingTotal is 0 then don't put neither "positive" or "negative" CSS clas on it.
		if (this.ratingTotal > 0) {
			YAHOO.util.Dom.addClass(votingwidget, 'voted-total-positive');
		}
		if (this.ratingTotal < 0) {
			YAHOO.util.Dom.addClass(votingwidget, 'voted-total-negative');
		}

		// update CSS for user's voting
		if (this.userRating > 0) {
	    	YAHOO.util.Dom.replaceClass(votingwidget, 'voted-as-negative','voted-as-positive');
	    } else {
	    	YAHOO.util.Dom.replaceClass(votingwidget, 'voted-as-positive','voted-as-negative');
	    }
	},

    // Get the message shown as tooltip for statistics
    getTooltipMessage: function() {
    	if (this.numberOfRatings == 0) {
    		return i18n.message("vote.tooltip.no.votes.yet");
    	}

		var positivevotes = (this.numberOfRatings + this.ratingTotal) / 2;
		var negativevotes = (this.numberOfRatings - this.ratingTotal) / 2;
		var title = i18n.message("vote.tooltip.summary", positivevotes, negativevotes, this.numberOfRatings);
		if (this.userRating != null) {
			title += "<br/> ";
			title += i18n.message("vote.tooltip.yourvote", (this.userRating > 0 ? i18n.message("vote.tooltip.yourvote.yes"): i18n.message("vote.tooltip.yourvote.no")));
		}
		return title;
    },

    // Get the widget to align the tooltip too
    getWidget: function() {
    	var votingwidget = document.getElementById("votingwidget_" + this.id);
    	return votingwidget;
    }

});

/**
 * Class/Constructor for rating controller.
 * @param id The id for the entity this rating belongs to
 * @param averageRating The current average value
 * @param numberOfRatings The number users who rated on this
 * @param userRating The current user's rating, or null if not yet rated this object
 * @param entityTypeId The entity-type
 * @param entityId The entity id
 */
Rating = function (id, averageRating, numberOfRatings, userRating, entityTypeId, entityId) {
	if (this == window) {
		// create new object
		return new Rating(id, averageRating, numberOfRatings, userRating, entityTypeId, entityId);
	}

	this.init(id, averageRating, numberOfRatings, userRating, entityTypeId, entityId);
}

// New methods and method overrides for Rating object
YAHOO.lang.extend(Rating, RatingBase, {
	// unique id used as part of the rating widget.
	id: null,

    // if the control is enabled, i.e. it reacts on mouse movement and allow changing rating
    enabled: true,

	/**
	 * @param id The unique id for the widget.
 	 * @param numberOfRatings The number users who rated on this
 	 * @param userRating The current user's rating, or null if not yet rated this object
     * @param entityTypeId The entity-type
     * @param entityId The entity id
 	 */
    init: function(id, averageRating, numberOfRatings, userRating, entityTypeId, entityId) {
    	// call super constructor
    	Rating.superclass.init.call(this, id, averageRating, null, numberOfRatings, userRating, entityTypeId, entityId);

        this.ratingdiv = YAHOO.util.Dom.get('ratingdiv_' + this.id);
        if (! this.ratingdiv) {
        	alert("Rating div not found for id=" + this.id);
        	return;
        }

        this.stardiv = document.createElement('div');

        this.make_stardiv();
        this.updateStats(false);
    },

	/* Replaces original form with the star images */
    make_stardiv: function() {
        // hide star-div elem so changing its DOM won't cause flicker
   	    YAHOO.util.Dom.setStyle(this.stardiv, 'display', 'none');
        YAHOO.util.Dom.addClass(this.stardiv, 'rating');

		this.stars = new Array();
        // make the stars
        for (var i=1; i<=5; i++) {
            // first, make a div and then an a-element in it
            var star = document.createElement('div');
            this.stars[i] = star;
            star.id = 'star_' + this.id + "_" + i;
            var a = document.createElement('a');
            //a.href = '#'; // don't set href, because IE will move the screen a bit if href='#' is set
            YAHOO.util.Dom.addClass(star, 'star');

            star.appendChild(a);
            this.stardiv.appendChild(star);

            // add needed listeners to every star
            if (this.enabled) {
	            YAHOO.util.Event.addListener(star, 'mouseover', this.hover_star, i, this /* scope correction*/);
    	        YAHOO.util.Event.addListener(star, 'mouseout', this.reset_stars, this /* scope correction*/, true);
        	    YAHOO.util.Event.addListener(star, 'click',  function(e, num) { this.submit_rating(num); }, i, this /* scope correction*/);
			}
        }
        this.ratingdiv.appendChild(this.stardiv);
        // show the average
        this.reset_stars();

       	// reveal modified DOM elem
       	YAHOO.util.Dom.setStyle(this.stardiv, 'display', 'block');
    },

    hover_star: function(e, which_star) {
        /* hovers the selected star plus every star before it */
        for (var i=1; i<=which_star; i++) {
            var star = this.stars[i];
            var a = star.firstChild;
            YAHOO.util.Dom.addClass(star, 'hover');
            YAHOO.util.Dom.setStyle(a, 'width', '100%');
        }
    },

	/* Resets the status of each star */
    reset_stars: function() {
    	// always showing average value
        var value = this.averageRating;

        // compute how many stars are on, and the width for the last for the last
        var stars_on = Math.ceil(value);
        var fraction = (value - Math.floor(value));
        if (fraction == 0) {
        	// the value happens to be an integer -> the whole last star is on
           	last_star_width = '100%';
        } else {
           	last_star_width = (fraction * 100) + '%';
		}

        // cycle trought 1..5 stars
        for (var i=1; i<=5; i++) {
            var star = this.stars[i];
            var a = star.firstChild;

            // first, reset all stars
            YAHOO.util.Dom.removeClass(star, 'hover');
            YAHOO.util.Dom.removeClass(star, 'on');

            // for every star that should be on, turn them on
            if (i<=stars_on && !YAHOO.util.Dom.hasClass(star, 'on'))
                YAHOO.util.Dom.addClass(star, 'on');

            // and for the last one, set width if needed
            if (i == stars_on)
                YAHOO.util.Dom.setStyle(a, 'width', last_star_width);
        }
    },

	/**
     * Update the voting widget with the new value.
     */
	updateWidget:function() {
		this.reset_stars();
	},

    // Get the message shown as tooltip for statistics
    getTooltipMessage: function() {
    	var msg = "Average rating is <b>" + this.averageRating + "</b> by <b>" + this.numberOfRatings + "</b> user(s).<br/>";
    	if (this.userRating == null) {
    		msg += "You have not submitted a rating yet.";
    	} else {
    		msg += "You rated as <b>" + this.userRating + "</b>.";
    	}
    	return msg;
    },

    // Get the widget to align the tooltip too
    getWidget: function() {
    	return this.stardiv;
    }

});
/**
 * $Id$
 *
 * Javascript controller to reorder table rows by dragging and dropping its rows.
 *
 */

/**
 * Constructor.
 *
 * @param The id of the table to put drag-drop reorder on
 * @param sGroup <String>  the group of related DragDrop objects
 * @param config <object> an object containing configurable attributes Valid properties for DDProxy in addition to those in DragDrop: resizeFrame, centerFrame, dragElId
 */
TableReorder = function(tableId, sGroup, config) {
	if (this == window) {
		return new TableReorder(tableId);
	}
	this.sGroup = sGroup;
	this.config = config;

	new YAHOO.util.DDTarget(tableId);

	var table = document.getElementById(tableId);
	var idgenerator = 0;
	// for all rows in the table add drag-drop capability.
	var rows = YAHOO.util.Dom.get(table).getElementsByTagName("TR");
	for (var i=0; i<rows.length; i++) {
		var row = rows[i];
		// ignore <tr>-s inside the table header
		if (this.isDragTarget(row)) {
			if (row.id == null || row.id == "") {
				// generate an id for the row if it does not have
				row.id = tableId + "_" + (idgenerator++);
			}
			new TableReorderRow(this, row.id, sGroup, config);
		}
	}

	// initialize the custom events
	this.onSwapRowEvent = new YAHOO.util.CustomEvent("onSwapRowEvent");
	this.onEndDrag = new YAHOO.util.CustomEvent("onEndDrag");
};

TableReorder.prototype = {

	/**
	 * CustomEvent fired when the rows are swapped
	 * this event gets the two table rows has been swapped as arguments.
	 * It is guaranteed that the 1st row is above the 2nd row always (after the drop) in the table.
	 */
	onSwapRowEvent : null,

	/**
	 * Custom-event fired after rows are swapped and drop completed.
	 */
	onEndDrag: null,

	/**
	 * If the html element is a drag target.
	 * Only table rows and not inside the table head
	 */
	isDragTarget: function(element) {
		var result = (element.tagName.toLowerCase() == "tr" && element.parentNode.tagName.toLowerCase() != "thead");
		return result;
	}

}

/**
 * One row with reorder capability.
 *
 * @param tableReorder The tableReorder controller instance
 * @param id The id for the row
 * @param sGroup YUI DD proxy params
 * @param config YUI DD proxy params
 */
TableReorderRow = function(tableReorder, id, sGroup, config) {
    TableReorderRow.superclass.constructor.call(this, id, sGroup, config);

    this.tableReorder = tableReorder;

    this.logger = this.logger || YAHOO;
    var el = this.getDragEl();
    YAHOO.util.Dom.setStyle(el, "opacity", 0.67); // The proxy is slightly transparent

    this.goingUp = false;
    this.lastY = 0;

	// find the drag handle
	YAHOO.util.Dom.addClass(id, "dragRow");
	var dragHandle = this.findDragHandle();
	if (dragHandle != null) {
		this.setHandleElId(dragHandle);
	}
}

YAHOO.extend(TableReorderRow, YAHOO.util.DDProxy /* YAHOO.util.DD*/, {
	// reference to the TableReorder class
	tableReorder: null,

    startDrag: function(x, y) {
        this.logger.log(this.id + " startDrag");

        // make the proxy look like the source element
        var dragEl = this.getDragEl();
        var clickEl = this.getEl();
        YAHOO.util.Dom.addClass(clickEl, "draggingRow");

		// find the parent table's style
		var parentTableAttributes = this.cloneParentTableStyle(clickEl);
        dragEl.innerHTML = "<table " + parentTableAttributes + "><tr>" + clickEl.innerHTML +"</tr></table>";

        YAHOO.util.Dom.setStyle(dragEl, "color", YAHOO.util.Dom.getStyle(clickEl, "color"));
        YAHOO.util.Dom.setStyle(dragEl, "backgroundColor", YAHOO.util.Dom.getStyle(clickEl, "backgroundColor"));
        YAHOO.util.Dom.setStyle(dragEl, "border", "2px solid gray");
    },

    /**
     * Find the parent table, and clone its class/style attributes
     */
    cloneParentTableStyle: function(element) {
    	var parentTable = element;
    	// go up and find the parent table
    	while ((parentTable = parentTable.parentNode) != null && parentTable.tagName != "TABLE") {};
    	if (parentTable == null) {
    		return "";
    	}
    	return "class='" + parentTable.className+"'"; // only class of table cloned, not the style, but that's probably enough...
    },

    endDrag: function(e) {
        var srcEl = this.getEl();
        var proxy = this.getDragEl();

        // Show the proxy element and animate it to the src element's location
        YAHOO.util.Dom.setStyle(proxy, "visibility", "visible");
        var a = new YAHOO.util.Motion(
            proxy, {
                points: {
                    to: YAHOO.util.Dom.getXY(srcEl)
                }
            },
            0.2,
            YAHOO.util.Easing.easeOut
        )
        var proxyid = proxy.id;
        var thisid = this.id;

        // Hide the proxy and show the source element when finished with the animation
        a.onComplete.subscribe(function() {
        		this.logger.log("End of drag animate");
   	            YAHOO.util.Dom.setStyle(proxyid, "visibility", "hidden");
 	            YAHOO.util.Dom.removeClass(thisid, "draggingRow");
                // clear the proxy content to hide anything may stay visible after drag complete
                proxy.innerHTML="";
            }, this, true);
        a.animate();

        // fire the event about the drag-drop finished
		this.tableReorder.onEndDrag.fire();
    },

/*
	// Note used, this would be necessary when dragging rows between tables. This also causes crash on IE6/IE7
    onDragDrop: function(e, id) {
    	this.logger.log("Ondragdrop:" + id);
    	var DDM = YAHOO.util.DragDropMgr;

        // If there is one drop interaction, the li was dropped either on the list,
        // or it was dropped on the current location of the source element.
        if (DDM.interactionInfo.drop.length === 1) {

            // The position of the cursor at the time of the drop (YAHOO.util.Point)
            var pt = DDM.interactionInfo.point;

            // The region occupied by the source element at the time of the drop
            var region = DDM.interactionInfo.sourceRegion;

            // Check to see if we are over the source element's location.  We will
            // append to the bottom of the list once we are sure it was a drop in
            // the negative space (the area of the list without any list items)
            if (!region.intersect(pt)) {
                var destEl = YAHOO.util.Dom.get(id);
                var destDD = DDM.getDDById(id);
                destEl.appendChild(this.getEl());
                destDD.isEmpty = false;
                DDM.refreshCache();
            }

        }
    },
  */

    onDrag: function(e) {

        // Keep track of the direction of the drag for use during onDragOver
        var y = YAHOO.util.Event.getPageY(e);

        this.delta = (y-this.lastY);
        if (y < this.lastY) {
            this.goingUp = true;
        } else if (y > this.lastY) {
            this.goingUp = false;
        }

        this.lastY = y;
    },

    onDragOver: function(e, id) {
		var DDM = YAHOO.util.DragDropMgr;
        var srcEl = this.getEl();
        var destEl = YAHOO.util.Dom.get(id);

        // We are only concerned with list items, we ignore the dragover
        // notifications for the list.
        if (TableReorder.prototype.isDragTarget(destEl)) {
        	//debugger;
            var orig_p = srcEl.parentNode;
            var p = destEl.parentNode;

            if (this.goingUp) {
            	//this.logger.log("Inserting above:" + srcEl.id +"," + destEl.id);
                p.insertBefore(srcEl, destEl); // insert above

                // fire the event about the rows being swapped
               	this.tableReorder.onSwapRowEvent.fire(destEl, srcEl);
            } else {
            	var nextSib = destEl.nextSibling;
            	/*
            	var msg = "Inserting above:";
            	try { msg += srcEl.id } catch (e) { msg+= e; }
            	msg += "," ;
            	try { msg += nextSib.id;} catch (e) { msg +=e; }
            	this.logger.log(msg);
            	*/
                p.insertBefore(srcEl, nextSib); // insert below

                // fire the event about the rows being swapped
               	this.tableReorder.onSwapRowEvent.fire(srcEl, destEl);
            }

            DDM.refreshCache();
        }
    },

	// find the drag handle HTML element for the element.
	// @return the drag handle element, or null if the whole row can be dragged
	findDragHandle: function(element) {
		var elems = YAHOO.util.Dom.getElementsByClassName("dragHandle", null, element);
		if (elems.length>0) {
			return elems[0];
		}
		return null;
	}
});

// $Id: globalMessages.js 24448 2008-06-24 08:34:08Z zluspai $

/**
 * Dynamically show some message from javascript
 * as if it would have been displayed using GlobalMessages javascript object.
 */
var GlobalMessages = {

	/**
	 * if the animations are enabled
	 */
	enableAnimation: true,
	/**
	 * The duration for the animations
	 */
	duration: 1,

	/*
	 * show a global error message
	 */
	showErrorMessage:function(msg) {
		return GlobalMessages.showMessage("error", msg);
	},
	/*
	 * show a global warning message
	 */
	showWarningMessage:function(msg) {
		return GlobalMessages.showMessage("warning", msg);
	},

	/**
	 * show a global information message
	 */
	showInfoMessage:function(msg) {
		return GlobalMessages.showMessage("information", msg);
	},

	/*
	 * show a global message
	 * @param level The level for the message
	 * @param msg The message to show
	 * @param callback Optional function called back when the message is shown (after the animations are complete)
	 *
	 * @return The new HTML "li" element has been added. This can be hidden later using the hideMessage() function.
	 */
	showMessage:function(level, msg, callback) {
		var globalMessagesDiv = document.getElementById("globalMessages");
		var messageList = document.getElementById("globalMessages_" + level);
		if (globalMessagesDiv == null || messageList == null) {
			throw "Can't find global message HTML elements, probably invalid message level:" + level;
		}
		// check if the GlobalMessage is already shown the same message
		for (var i=0; i< messageList.childNodes.length; i++) {
			var li = messageList.childNodes[i];
			if (li.msg == msg) {
				// message is already shown, drop it
				return;
			}
		}

		// add the new message
		var newMessageLine = document.createElement('li');
		newMessageLine.innerHTML = msg;
		newMessageLine.msg = msg;
		messageList.appendChild(newMessageLine);

		var messageListParent = messageList.parentNode;
		var messageWasInvisible = YAHOO.util.Dom.hasClass(messageListParent, "invisible");

		if (GlobalMessages.enableAnimation) {
			try {
				var target;
				if (messageWasInvisible) {
					// fade in the container box which vas invisible
					target = messageListParent;
					YAHOO.util.Dom.setStyle(messageListParent,"opacity", 0);
	   				var anim = new YAHOO.util.Anim(messageListParent, { opacity: { from: 0.2, to: 1 }, height: { to: 34, units: "px" } }, GlobalMessages.duration, YAHOO.util.Easing.easeIn);
	   				YAHOO.util.Dom.setStyle(messageListParent, "height", 0);

	   				anim.onComplete.subscribe(function() { YAHOO.util.Dom.setStyle(messageListParent, "height", null);});
		           	anim.animate();
	            }

				/*
				    // fade in the new message
				    target = newMessageLine;
					YAHOO.util.Dom.setStyle(newMessageLine, "opacity", 0);
				   	var anim2 = new YAHOO.util.Anim(newMessageLine, { opacity: { to: 1 } , height: { from: 0, to: 12, units: "px" } }, GlobalMessages.duration, YAHOO.util.Easing.easeIn);
		           	anim2.onComplete.subscribe(function() { YAHOO.util.Dom.setStyle(newMessageLine, "height", null);});
		           	anim2.animate();
	           	*/
			} catch (e) { alert("Error:" +e); }
		}

		// show the message block on top
		YAHOO.util.Dom.removeClass(messageListParent, "invisible");
		YAHOO.util.Dom.removeClass(globalMessagesDiv, "invisible");

		return newMessageLine;
	},

	/**
	 * Hide a message element.
	 * @param el The element, which was returned in a previous call of showMessage()
	 */
	hideMessage: function(el) {
		var messageList = el.parentNode;
		var hideFunc = function() {
			messageList.removeChild(el);
			GlobalMessages.compact();
		};

		if (GlobalMessages.enableAnimation) {
			var anim = new YAHOO.util.Anim(el, { opacity: { to: 0 }, height: { to: 0, units: "px" } }, GlobalMessages.duration, YAHOO.util.Easing.easeIn);
			anim.onComplete.subscribe(hideFunc, null, true);
			anim.animate();
		} else {
			hideFunc.call();
		}
	},

	/**
	 * hide content elements if no more message is shown
	 * @param level Optional parameter for which message-areas to hide. If missing all areas will be compacted
	 * @return True if the compact was successful, and some/all of the message areas become invisible.
	 */
	compact: function(level) {
		var globalMessagesDiv = document.getElementById("globalMessages");
		if (!level) {
			var allInvisible = true;
			allInvisible = allInvisible & this.compact("error");
			allInvisible = allInvisible & this.compact("warning");
			allInvisible = allInvisible & this.compact("information");
			if (allInvisible) {
				YAHOO.util.Dom.addClass(globalMessagesDiv, "invisible");
			}
			return allInvisible;
		}
		var messageList = document.getElementById("globalMessages_" + level);
		if (globalMessagesDiv == null || messageList == null) {
			throw "Can't find global message HTML elements, probably invalid message level:" + level;
		}
		var messageListParent = messageList.parentNode;
		var liChildren = YAHOO.util.Dom.getChildrenBy(messageList, function(el) { return el.nodeName == "LI"; });
		if (liChildren.length == 0) {
			YAHOO.util.Dom.addClass(messageListParent, "invisible");
			return true;
		}
		return false;
	}

}
/**
 * Widget shows multiple boxes, each is close-able, selectable.
 *
 * $Id$
 */
YAHOO.namespace("MultiboxPanel");
YAHOO.namespace("MultiboxAutoComplete");

(function() {
	var Dom= YAHOO.util.Dom,
		Event = YAHOO.util.Event,
		CustomEvent = YAHOO.util.CustomEvent,
		Element = YAHOO.util.Element;
	var KEYS = YAHOO.util.KeyListener.KEY;

	// CSS class for clearing div automatically added as last child
	var CLEAR_DIV_CSS_CLASS = "yui-multibox-clear";

	/**
	 * Constructor.
	 *
	 * Expects this as initial markup (same as autocomplete...)
	 *
	 * <div>
	 * 		<div id="markerid"></div>
	 * </div>
	 *
	 * Optionally the outer <div> may already contain the following static html, which define boxes which will be automatically picked up by the widget.
	 * For example:
	 *     <div style="padding:2px; margin: 0px; border:solid 1px red;">
	 * 	   <!-- this tests how the static markup is picked up by the widget -->
	 *     <a class='box'>alpha</a>
	 *     <a class='box'>beta</a>
	 *     <a class='box'>gamma</a>
	 *
	 * @param id The html element where the boxes will be added "before"
	 */
	YAHOO.MultiboxPanel = function(markerid) {
		try {
			this.marker = new Element(document.getElementById(markerid));
			var multibox = this.marker.get("parentNode");

			YAHOO.MultiboxPanel.superclass.constructor.call(this, multibox);

			// initialize the events
			this.boxAddedEvent = new CustomEvent("boxAdded");
			this.boxDeletedEvent = new CustomEvent("boxDeleted");
			this.selectionChangedEvent = new CustomEvent("selectionChanged");
			this.movedOutEvent = new CustomEvent("movedOutEvent");

			this.initWidget();
		} catch (e) {
			alert(e);
		}
	};

	// yui class definition
	YAHOO.lang.extend(YAHOO.MultiboxPanel, YAHOO.util.Element, {
		// "box" Elements are added before this marker Element
		marker: null,

		// CSS class for a box
		CSS_CLASS_BOX : "box",
		// CSS class for selected box
		CSS_CLASS_SELECTED : "focus",

		//////////// Events fired...

		// Event fired after a new box is added
		// as argument receives the new box HTML element
		boxAddedEvent: null,

		// Event fired when after a box is deleted
		// as argument receives the box HTML element has been deleted
		boxDeletedEvent: null,

		// Event fired when the selection changes
		// as argument receives an array: 1st elem is the old selected element, 2nd elem is the new selected element.
		//		both arguments can be null
		selectionChangedEvent: null,

		// Event fired, when moving out from the multibox panel
		// as argument receives a boolean, false if moved out to "left" (previous), true if moved out to "right" (next)
		movedOutEvent: null,

		// Destructor
		destroy: function() {
			YAHOO.log("MultiboxPanel.destroy() is being called!");
			// Unhook custom events
			this.boxAddedEvent.unsubscribeAll();
			this.boxDeletedEvent.unsubscribeAll();
			this.selectionChangedEvent.unsubscribeAll();
			this.movedOutEvent.unsubscribeAll();

			// unhook DOM events bound to me (reverse of _setupEvents())
			this.removeListener("click", this._handleClicks);
			this.removeListener("keyup", this._handleKeyboard);
		},

		/**
		 * Initialize the widget, so automatically decorate HTML any elements, and attach event handlers
		 */
		initWidget: function() {
			// ensure that the container has the proper class name
			if (!this.hasClass("yui-multibox")) {
				this.addClass("yui-multibox");
			}

			var childNodes = this.get('childNodes');

			// go through all "box" child nodes, and set up their content
			var len = childNodes.length;
			for (var i=0; i < len; i++) {
				var node = childNodes[i];
				if (node.nodeType == 1 /* ELEMENT_NODE*/ && this.isBox(node)) {
					this._setupBox(node);
				}
			}

			// as last html element add clearing div if not yet there
			if (childNodes.length != 0) {
				var lastNode = childNodes[childNodes.length -1];
				if (!(lastNode.nodeType == 1 && Dom.hasClass(lastNode,CLEAR_DIV_CSS_CLASS))) {
					YAHOO.log("adding clearing div");
					var clearDiv = new Element(document.createElement("div"));
					clearDiv.addClass(CLEAR_DIV_CSS_CLASS);
					this.appendChild(clearDiv);
				}
			}

			this._setupEvents();
		},

		/**
		 * Add a new box to the multibox
		 * @param text The inner html text of the new box
		 * @return The box added
		 */
		addBox: function(text) {
			var newbox = this.createBoxElem(text);
			this._setupBox(newbox);
			this.insertBefore(newbox, this.marker);
			this.boxAddedEvent.fire(newbox);
			return newbox;
		},

		/**
		 * Determine if the HTML element is a box
		 * @return true if that's a box
		 */
		isBox: function(element) {
			return Dom.hasClass(element, this.CSS_CLASS_BOX);
		},

		/**
		 * Setup event delegation handlers for capturing mouse-clicks and keyboard presses inside this control.
		 */
		_setupEvents: function() {
			// remove previous listeners if we had any to avoid double subscriptions
			this.removeListener("click", this._handleClicks);
			this.removeListener("keyup", this._handleKeyboard);

			this.on("click", this._handleClicks, this, true);
			this.on("keyup", this._handleKeyboard, this, true);
		},

		/**
		 * Private method for handling click events.
		 */
		_handleClicks: function(e) {
			var elTarget = Event.getTarget(e);
			if (this.isBox(elTarget)) {
				// a box has been clicked
				YAHOO.log("Selecting a box:" + elTarget);
				this.setSelected(elTarget);
				Event.preventDefault(e); // kill the event so click won't jump to page start, because href="#"
				return false;
			}
			if (Dom.hasClass(elTarget, "deleteButton")) {
				// the delete button has been clicked, find the container box
				var THIS = this;
				var box = Dom.getAncestorByClassName(elTarget, this.CSS_CLASS_BOX);
				if (box) {
					YAHOO.log("Removing:" + box);
					this.removeBox(box);
				}
				return false;
			}
		},

		/**
		 * Private method for handling the keyboard events, for those, which are pressed inside a box
		 */
		_handleKeyboard: function(e) {
			var elTarget = Event.getTarget(e);
			if (!this.isBox(elTarget)) {
				return;
			}

			try {
				switch(e.keyCode){
					case KEYS.LEFT: {
						this.selectPrevious();
						Event.stopEvent(e);
						return;
					}
					case KEYS.RIGHT: {
						this.selectNext();
						Event.stopEvent(e);
						return;
					}
					case KEYS.DELETE:
					case KEYS.BACK_SPACE: {
						this.removeCurrent();
						Event.stopEvent(e);
						return;
					}
					case KEYS.ENTER: {
						// preventing the Enter event, so pressing enter won't jump the page because of href="#"
						Event.stopEvent(e);
						return;
					}
				}
			} catch (e) {
				alert("Exception:" + e);
			}
		},

		/**
		 * private method to set up box contents and events
		 * @param newbox the new HTML element being created
		 */
		_setupBox: function(newbox) {
			// avoid double initialization
			if (newbox.alreadySetUp) {
				return;
			}
			newbox.alreadySetup = true;

			var HREF_VALUE = "#?"; // without the href="#?" the keyboard events are not captured, using #?, because the simple "#" would jump the page

			var newboxElem = new Element(newbox);
			newboxElem.set("href", HREF_VALUE);
			newboxElem.addClass(this.CSS_CLASS_BOX);

			var closeButton = document.createElement("a");
			var closeButtonElem = new Element(closeButton);
			closeButtonElem.addClass("deleteButton");
			closeButtonElem.set("href", HREF_VALUE);
			newboxElem.appendChild(closeButton);
		},

		/**
		 * Method creating the HTML element for box. Override this to render custom box contents.
		 *
		 * @param text The text will be in the box.
		 * @return the HTML element (by default it's an <A> tag)
		 */
		createBoxElem: function(text) {
			var newbox = document.createElement("a");
			newboxElem = new Element(newbox);
			newboxElem.set("href","#"); // must add a href, otherwise the keyboard events are not catched
			newbox.innerHTML = text;
			return newbox;
		},

		/**
		 * Find the current selected box
		 * @return The <li> box if one selected, or null if none selected
		 */
		findCurrent: function() {
			if (! this.hasChildNodes) {
				return null;
			}
			var elements = this.getElementsByClassName(this.CSS_CLASS_SELECTED);
			if (elements.length == 0) {
				return null;
			}
			return elements[0];
		},

		/**
		 * Remove a box
		 *
		 * @param box The box-element to remove
		 */
		removeBox: function(box) {
			if (box) {
				// if the box was current, then select the next on the right
				var current = this.findCurrent();
				if (current === box) {
					this.selectNext();
				}
				this.removeChild(box);

				this.boxDeletedEvent.fire(box);
			}
		},

		/**
		 * Remove all boxes
		 */
		removeAllBoxes: function() {
			var boxes = this.getBoxes();
			for(var i=0; i<boxes.length; i++) {
				this.removeBox(boxes[i]);
			}
		},

		/**
		 * Remove the current selected box.
		 */
		removeCurrent: function() {
			this.removeBox(this.findCurrent());
		},

		/**
		 * Set selection on a box. Use with "null" parameter to remove selection
		 *
		 * @param box The box element to select
		 */
		setSelected: function(box) {
			YAHOO.log("Selecting:" + box);
			var current = this.findCurrent();
			if (current) {
				new Element(current).removeClass(this.CSS_CLASS_SELECTED);
				current.blur();
			}
			if (box) {
				new Element(box).addClass(this.CSS_CLASS_SELECTED);
				// put the focus on the box, so it will receive the keyboard events
				box.focus();
			}

			this.selectionChangedEvent.fire([current, box]);
		},

		/**
		 * find the box elements below
		 * @return array of box elements
		 */
		getBoxes: function() {
			var elems = this.getElementsByClassName(this.CSS_CLASS_BOX);
			return elems;
		},

		// select the first element
		selectFirst: function() {
			var elems = this.getBoxes();
			if (elems.length>0) {
				this.setSelected(elems[0]);
			}
		},

		// select the last element
		selectLast: function() {
			var elems = this.getBoxes();
			if (elems.length > 0) {
				this.setSelected(elems[elems.length-1]);
			}
		},

		/**
		 * Select the next box
		 */
		selectNext: function() {
			var idx = this.getSelectedIndex();
			if (idx != null) {
				var success = this.setSelectedIndex(idx+1);
				if (! success) {
					this.movedOutEvent.fire(true);
				}
			}
		},

		/**
		 * Select the previous box
		 */
		selectPrevious: function() {
			var idx = this.getSelectedIndex();
			if (idx != null) {
				var success = this.setSelectedIndex(idx-1);
				if (! success) {
					this.movedOutEvent.fire(false);
				}
			}
		},

		/**
		 * Select the idx-th element.
		 *
		 * @param idx The index of the element to select. If no such element, then the selection is removed.
		 * @return boolean If the selection is successful
		 */
		setSelectedIndex: function(idx) {
			var boxes = this.getBoxes();
			if (idx >=0 && idx< boxes.length) {
				var newselection = boxes[idx]
				this.setSelected(newselection);
				return true;
			}
			this.setSelected(null);
			return false;
		},

		/**
		 * Get the index of the given selected element.
		 * @return the index of the selected element, or null if none selected
		 */
		getSelectedIndex: function() {
			var selected = this.findCurrent();
			if (selected) {
				var boxes = this.getBoxes();
				for(var i=0; i<boxes.length;i++) {
					if (selected === boxes[i]) {
						return i;
					}
				}
			}
			return null;
		}

	});

	/**
	 * MultiboxAutoComplete class is an AutoComplete widget subclass, which maintains
	 * previous selections in the AutoComplete widget as deletable boxes.
	 *
	 * See: http://ajaxian.com/archives/facebook-style-input-box.
	 */
	YAHOO.MultiboxAutoComplete = function(elInput,elContainer,oDataSource,oConfigs) {
		YAHOO.MultiboxAutoComplete.superclass.constructor.call(this, elInput, elContainer, oDataSource, oConfigs);

		// initialize the multi-box control too.
		var id = this._elTextbox.id;
		this.multiboxPanel = new YAHOO.MultiboxPanel(id);
		this.setupEvents();
	}

	YAHOO.lang.extend(YAHOO.MultiboxAutoComplete, YAHOO.widget.AutoComplete, {

		// reference to the used MultiboxPanel
		multiboxPanel: null,

		/**
		 * Widget destructor.
		 */
		destroy: function() {
			YAHOO.log("Destroying MultiboxAutoComplete, including destroying the embedded multiboxPanel subcomponent");
			this.multiboxPanel.destroy.call(this.multiboxPanel);

			// call super
			YAHOO.MultiboxAutoComplete.superclass.destroy.call(this);
		},

		/**
		 * Setup event handlers, and wire multiboxPanel and the autocomplete widget together.
		 */
		setupEvents: function() {
		  	//subscribe your handler to the autocomplete event
   	  	    this.itemSelectEvent.subscribe(this.itemSelectHandler, this, true);

   	  	    // set up, that moving out from multiboxPanel will put the focus on the autocomplete's input box
   	  	    this.multiboxPanel.movedOutEvent.subscribe(function (e, args) {
   	  	    	// put the focus to the text box
 	  	    	this._elTextbox.focus();
   	  	    }, this, true);

   	  	    // when pressing left/right keys in an empty autocomplete box, let's move to the last/first box
			Event.on(this._elTextbox, "keyup", function(e, args) {
				if (this._elTextbox.value == "") {
					var mb = this.multiboxPanel;
					try {
						if (e.keyCode == KEYS.LEFT) {
							mb.selectLast.call(mb);
						}
						if (e.keyCode == KEYS.RIGHT) {
							mb.selectFirst.call(mb);
						}
					} catch (e) {
						YAHOO.log(e);
					}
				}
			}, this, true);

		},

		/**
		 * Function called when item is selected in the autocomplete widget. Called by itemSelectEvent on the autocomplete.
		 */
		itemSelectHandler: function(sType, aArgs) {
			try {
		  	    YAHOO.log(sType); //this is a string representing the event;
	              //e.g., "itemSelectEvent"
				var oMyAcInstance = aArgs[0]; // your AutoComplete instance
				var elListItem = aArgs[1]; //the <li> element selected in the suggestion
				                       //container
				var aData = aArgs[2]; //array of the data for the item as returned by the DataSource

				var boxContent = this.renderSelected(elListItem, aData);

				// create a new box, and clear the input
				var box = this.multiboxPanel.addBox(boxContent);
				this.customizeBox(box, elListItem, aData);
				this._elTextbox.value = "";
			} catch (e) {
				alert(e);
			}
		},

		/**
		 * Render the box when an element is selected from the autocomplete
		 * @param elListItem the <li> element selected in the suggestion
		 * @param aData array of the data for the item as returned by the DataSource
		 *
		 * @return the html to be rendered as selection. This should be
		 */
		renderSelected: function(elListItem, aData) {
			return elListItem.innerHTML;
		},

		/**
		 * Allow customizing the box html element after it is added. By default does nothing.
		 * @param box The box html element
		 * @param elListItem the <li> element selected in the suggestion
		 * @param aData array of the data for the item as returned by the DataSource
		 */
		customizeBox: function(box, elListItem, aData) {
			// nothing.
		}

	});

})();
/**
 * Copyright by Intland Software
 *
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Intland Software. ("Confidential Information"). You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Intland.
 *
 * $Revision$ $Date$
 */

// Ajax utility classes
// $Id$

/**
 * Static helper class for reporting Ajax errors.
 * @return
 */
var AjaxErrorReport = {

	// if the page is being unloaded, so ajax-communication errors are supressed
	pageunloading : false,

	init: function() {
		YAHOO.util.Event.addListener(window,"beforeunload",function() {AjaxErrorReport.pageunloading = true});
	},

	/**
	 * Common method to report an ajax call failure to the user, and also logs it.
	 *
	 * It takes care about that it won't report "communication errors" when navigating away from a page,
	 * and because of this navigation the pending ajax calls are aborted by the browser.
	 *
	 * Use it for handleFailure() method of your ajax callback.
	 *
	 * @param o
	 * @param msg Optional message shown to the user if the error is reported
	 */
    reportAjaxFailure:function(o, msg){
		try {
			YAHOO.log("Ajax call Failure:" + o.statusText +"\n" + o.responseText +"\nstatus:" + o.status);
			if (o.status >0 || !AjaxErrorReport.pageunloading) {
				if (YAHOO.lang.isUndefined(msg)) {
					msg = "";
				}
				alert(msg + "\nAjax call failure:" + o.statusText +"\nstatus:" + o.status);
			}
		} catch (e) {
			YAHOO.log("Error in reportAjaxFailure:" + e);
		}
    }

};

AjaxErrorReport.init();
/*
 * Copyright by Intland Software
 *
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Intland Software. ("Confidential Information"). You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Intland.
 *
 * $Revision$ $Date$
 */

YAHOO.namespace("codebeamer.ComboBoxActionHandler");

/**
 * Javascript companion for the ActionComboBoxTag.
 * Used by the ActionComboBoxTag to execute some action when an option is selected from the tag.
 *
 * This works as:
 * - an ActionMenuBuilder adds an ActionItems to an ui:actionComboBox tag
 * - which generates a new option in the select box by ui:actionComboBox
 * - if the ActionItem contains an "onClick" javascript that will be executed when its option is selected
 * - otherwise if the ActionItem contains an URL, then the browser will be forwarded to that URL
 *
 * Also by default the combo-box will do the following processing:
 * - call the onClick function with the (form, action) parameters, where
 * 			- the form is the wrapping <form> html-element of the select-box
 * 			- the action is the "key" of the action as provided by the ActionMenuBuilder
 * - if the onClick returns false the processing is stopped
 * - after this the onBeforeSubmit(form,action) method is called with the same parameters.
 * 		This method can do any preprocessing necessary before the form submit
 * 		(like storing values in hidden-form fields), and can also cancel the form submit if returns "false".
 * - after this the wrapping form is submitted (assuming there is one).
 *
 * @param id
 * @param submitForm
 */
YAHOO.codebeamer.ComboBoxActionHandler = function(id, submitForm) {
	this.id = id;
	this.submitForm = submitForm || true;
	this.registeredActions = new Object();
	// register my id
	var x = YAHOO.codebeamer.ComboBoxActionHandler.instances;
	this.instances[id] = this;
};

YAHOO.lang.augmentObject(YAHOO.codebeamer.ComboBoxActionHandler, {

	/**
	 * Get an instance of the ComboBoxActionHandler
	 * @param id The instance id
	 */
	get:function(id) {
		return YAHOO.codebeamer.ComboBoxActionHandler.prototype.instances[id];
	}

});

YAHOO.codebeamer.ComboBoxActionHandler.prototype = {

	// all instances of ComboBoxActionHandler
	instances : new Object(),

	// if the container form will be submitted when an action-handler function returns true
	submitForm: true,

	// action functions registered for this ComboBoxActionHandler
	// contains a hash of "actionname"-> function() {...code to execute when action selected...}
	registeredActions: new Object(),

	// the current form is accessible via this.form
	form: null,
	// the current action is accessible via this.action
	action: null,

	// callback when the selection changes
	// @param selectbox contains the actions
	onSelectionChange:  function (selectbox) {
		var action = selectbox.options[selectbox.selectedIndex].value;
		var success = this.execute(selectbox.form, action);

		if (!success) {
			// can not submit because no checkbox was checked,
			// reset the selectbox to the 1st selection so "More Actions..." will be selected
			selectbox.selectedIndex = 0;
		}
	},

	/**
	 * Execute an action.
	 * @param form The container form to submit when the action is sucessful
	 * @param The action string to execute
	 */
	execute: function(form, action) {
		// save the current form/action
		this.form = form;
		this.action = action;

		var success = false;
		var actionFunction = this.registeredActions[action];
		if (actionFunction != null) {
			try {
				YAHOO.log("Executing action-function: " + actionFunction + " with (form:" + form +", action:" + action +")");
				success = actionFunction.call(this, form, action);
			} catch (e) {
				alert("Failed to execute action " + action +", exception: " + e);
			}
		}
		if (success && this.submitForm && form) {
			success = this.onBeforeSubmit(form, action);
			if (success) {
				form.submit();
			}
		}
		return success;
	},

	/**
	 * Event callback, will be called before submitting the form.
	 * @param form The form will be submitted
	 * @param action The action name which is submitting the form
	 *
	 * @return if returns false the form submit will be cancelled.
	 */
	onBeforeSubmit: function(form, action) {
		return true;
	},

	/**
	 * Register multiple actions in the javascript object-notation syntax
	 * @param actions The actions javascript object
	 */
	registerActions: function(actions) {
		if (this instanceof YAHOO.codebeamer.ComboBoxActionHandler) {
			YAHOO.lang.augmentObject(this.registeredActions, actions, true);
		} else {
			YAHOO.log("No id is passed, creating the default ComboBoxActionHandler");
			var handler = new YAHOO.codebeamer.ComboBoxActionHandler(null);
			handler.registerActions(actions);
		}
	}

}
/*
 * Copyright by Intland Software
 *
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Intland Software. ("Confidential Information"). You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Intland.
 *
 * $Revision$ $Date$
 */

/**
 * Javascript for collapsingBorder.tag
 */
var CollapsingBorder = {
	/**
	 * Toggle the collapsing-border
	 * @param legendLink The link inside the legend clicked on
	 */
	toggle:function(legendLink) {
		var Dom = YAHOO.util.Dom;
		var CSS_CLASS="collapsingBorder_collapsed";
		// find the parent fieldset
		var fieldset = Dom.getAncestorBy(legendLink, function(el) {
				return el.nodeName == "FIELDSET";
			});
		if (fieldset != null) {
			if (Dom.hasClass(fieldset,CSS_CLASS)) {
				Dom.removeClass(fieldset,CSS_CLASS);
			} else {
				Dom.addClass(fieldset,CSS_CLASS);
			}
		}
	}
};
/**
 * Javascript companion for WysiwygController java class.
 *
 * $Id$
 */
var wysiwygController = {

	/**
	 * Start the editor for the wiki-page.
	 * @param wikiPageId the id of the wiki page/note
	 */
	startApplet:function(wikiPageId, hasEditInWordLicense) {
		if (!hasEditInWordLicense) {
			var response = confirm("This feature is not licensed, your modifications will not be saved!");
			if (!response) {
				return false;
			}
		}
		showModalDialog("warning", "This wiki content is being edited externally.<br/>Please <b>DO NOT refresh or close this page</b>, otherwise your changes will be lost.");

		var el = document.createElement('div');
		document.body.appendChild(el);

		var html = '<applet code="com.intland.codebeamer.applet.document.client.WysiwygController.class" '
				+ 'archive="' + contextPath + '/docs/jnlp/doc-applet.jar" align="baseline" width="0" height="0" mayscript>'
				+ '<param name="contextPath" value="' + contextPath +'">'
				+ '<param name="wikiPageId" value="' + wikiPageId +'">'
				+ 'Support for Java Applets is required! Please check your browser settings.'
				+ '</applet>';
		YAHOO.log("applet fragment:" + html);
		el.innerHTML = html;
		return false;
	},

	refreshPage:function(isPageModified) {
		window.location.reload();
	}

}/*
 * Copyright by Intland Software
 *
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Intland Software. ("Confidential Information"). You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Intland.
 *
 * $Id$
*/

/**
 * Utility class for scrolling around
 */
var ScrollUtil = {

	//EASE_STYLE = YAHOO.util.Easing.easeOut;
	EASE_STYLE: YAHOO.util.Easing.easeNone,

	// http://semihhazar.com/blog/animated-page-scroll-with-yui/
	scrollPage:function (to, dur, ease) {
	      var setAttr = function(a, v, u) {
	            window.scroll(0, v);
	      };

	      var anim = new YAHOO.util.Anim(null,
	            { 'scroll' : {
		                from : YAHOO.util.Dom.getDocumentScrollTop(),
		                to : to }
		           },
		           dur, ease
		       );
	      anim.setAttribute = setAttr;
	      anim.animate();
	},

	/**
	 * Scroll the page to an element
	 * @param el The element
	 * @param dur The duration of the scroll
	 * @param delta Integer: the scroll won't go exactly to the element, but with this difference
	 */
	scrollPageToElement: function(el, dur, delta) {
		if (delta == null) {
			delta = 0;
		}
		ScrollUtil.scrollPage(YAHOO.util.Dom.getXY(el)[1] + delta, dur, ScrollUtil.EASE_STYLE);
	},

	/**
	 * Scroll a container to an element
	 * @param container The container to scroll
	 * @param el The element
	 * @param dur The duration of the scroll
	 * @param delta Integer: the scroll won't go exactly to the element, but with this difference
	 */
	scrollContainerToElement:function (container, el, dur, delta) {
	  if (delta == null) {
		  delta = 0;
	  }
	  var ease = ScrollUtil.EASE_STYLE;
	  var to = YAHOO.util.Dom.getXY(el)[1];
	  var containerCoords = YAHOO.util.Dom.getXY(container);
	  to = (to + container.scrollTop - containerCoords[1]); /* note; the scrolltop is added, because the coorinates of the "el" element is reduced by the current scrolltop value */
	  to = to + delta;

	  var setAttr = function(a, v, u) {
		  container.scrollTop = v;
	  };

	  var anim = new YAHOO.util.Anim(null,
	        { 'scroll' : {
	                from : container.scrollTop,
	                to : to }
	           },
	           dur, ease
	       );
	  anim.setAttribute = setAttr;
	  anim.animate();
	}
}

