/* Merged Azcat Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */
/*http://www.physiotherapyalberta.ca/portal_javascripts/json.js?original=1*/
if(!this.JSON){JSON={};}(function(){function f(n){return n<10?"0"+n:n;}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z";};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key);}if(typeof rep==="function"){value=rep.call(holder,key,value);}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null";}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null";}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v;}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v);}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v);}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v;}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" ";}}else{if(typeof space==="string"){indent=space;}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify");}return str("",{"":value});};}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}return reviver.call(holder,key,value);}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4);});}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j;}throw new SyntaxError("JSON.parse");};}}());
/*http://www.physiotherapyalberta.ca/portal_javascripts/build/yahoo/yahoo.js?original=1*/
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=(""+a[i]).split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}return o;};YAHOO.log=function(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.register=function(name,mainClass,data){var mods=YAHOO.env.modules,m,v,b,ls,i;if(!mods[name]){mods[name]={versions:[],builds:[]};}m=mods[name];v=data.version;b=data.build;ls=YAHOO.env.listeners;m.name=name;m.version=v;m.build=b;m.versions.push(v);m.builds.push(b);m.mainClass=mainClass;for(i=0;i<ls.length;i=i+1){ls[i](m);}if(mainClass){mainClass.VERSION=v;mainClass.BUILD=b;}else{YAHOO.log("mainClass is undefined for module "+name,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(name){return YAHOO.env.modules[name]||null;};YAHOO.env.parseUA=function(agent){var numberify=function(s){var c=0;return parseFloat(s.replace(/\./g,function(){return(c++==1)?"":".";}));},nav=navigator,o={ie:0,opera:0,gecko:0,webkit:0,chrome:0,mobile:null,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,webos:0,caja:nav&&nav.cajaVersion,secure:false,os:null},ua=agent||(navigator&&navigator.userAgent),loc=window&&window.location,href=loc&&loc.href,m;o.secure=href&&(href.toLowerCase().indexOf("https")===0);if(ua){if((/windows|win32/i).test(ua)){o.os="windows";}else{if((/macintosh/i).test(ua)){o.os="macintosh";}else{if((/rhino/i).test(ua)){o.os="rhino";}}}if((/KHTML/).test(ua)){o.webkit=1;}m=ua.match(/AppleWebKit\/([^\s]*)/);if(m&&m[1]){o.webkit=numberify(m[1]);if(/ Mobile\//.test(ua)){o.mobile="Apple";m=ua.match(/OS ([^\s]*)/);if(m&&m[1]){m=numberify(m[1].replace("_","."));}o.ios=m;o.ipad=o.ipod=o.iphone=0;m=ua.match(/iPad|iPod|iPhone/);if(m&&m[0]){o[m[0].toLowerCase()]=o.ios;}}else{m=ua.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);if(m){o.mobile=m[0];}if(/webOS/.test(ua)){o.mobile="WebOS";m=ua.match(/webOS\/([^\s]*);/);if(m&&m[1]){o.webos=numberify(m[1]);}}if(/ Android/.test(ua)){o.mobile="Android";m=ua.match(/Android ([^\s]*);/);if(m&&m[1]){o.android=numberify(m[1]);}}}m=ua.match(/Chrome\/([^\s]*)/);if(m&&m[1]){o.chrome=numberify(m[1]);}else{m=ua.match(/AdobeAIR\/([^\s]*)/);if(m){o.air=m[0];}}}if(!o.webkit){m=ua.match(/Opera[\s\/]([^\s]*)/);if(m&&m[1]){o.opera=numberify(m[1]);m=ua.match(/Version\/([^\s]*)/);if(m&&m[1]){o.opera=numberify(m[1]);}m=ua.match(/Opera Mini[^;]*/);if(m){o.mobile=m[0];}}else{m=ua.match(/MSIE\s([^;]*)/);if(m&&m[1]){o.ie=numberify(m[1]);}else{m=ua.match(/Gecko\/([^\s]*)/);if(m){o.gecko=1;m=ua.match(/rv:([^\s\)]*)/);if(m&&m[1]){o.gecko=numberify(m[1]);}}}}}}return o;};YAHOO.env.ua=YAHOO.env.parseUA();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var l=YAHOO_config.listener,ls=YAHOO.env.listeners,unique=true,i;if(l){for(i=0;i<ls.length;i++){if(ls[i]==l){unique=false;break;}}if(unique){ls.push(l);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var L=YAHOO.lang,OP=Object.prototype,ARRAY_TOSTRING="[object Array]",FUNCTION_TOSTRING="[object Function]",OBJECT_TOSTRING="[object Object]",NOTHING=[],HTML_CHARS={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;","`":"&#x60;"},ADD=["toString","valueOf"],OB={isArray:function(o){return OP.toString.apply(o)===ARRAY_TOSTRING;},isBoolean:function(o){return typeof o==="boolean";},isFunction:function(o){return(typeof o==="function")||OP.toString.apply(o)===FUNCTION_TOSTRING;},isNull:function(o){return o===null;},isNumber:function(o){return typeof o==="number"&&isFinite(o);},isObject:function(o){return(o&&(typeof o==="object"||L.isFunction(o)))||false;},isString:function(o){return typeof o==="string";},isUndefined:function(o){return typeof o==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(r,s){var i,fname,f;for(i=0;i<ADD.length;i=i+1){fname=ADD[i];f=s[fname];if(L.isFunction(f)&&f!=OP[fname]){r[fname]=f;}}}:function(){},escapeHTML:function(html){return html.replace(/[&<>"'\/`]/g,function(match){return HTML_CHARS[match];});},extend:function(subc,superc,overrides){if(!superc||!subc){throw new Error("extend failed, please check that all dependencies are included.");}var F=function(){},i;F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==OP.constructor){superc.prototype.constructor=superc;}if(overrides){for(i in overrides){if(L.hasOwnProperty(overrides,i)){subc.prototype[i]=overrides[i];}}L._IEEnumFix(subc.prototype,overrides);}},augmentObject:function(r,s){if(!s||!r){throw new Error("Absorb failed, verify dependencies.");}var a=arguments,i,p,overrideList=a[2];if(overrideList&&overrideList!==true){for(i=2;i<a.length;i=i+1){r[a[i]]=s[a[i]];}}else{for(p in s){if(overrideList||!(p in r)){r[p]=s[p];}}L._IEEnumFix(r,s);}return r;},augmentProto:function(r,s){if(!s||!r){throw new Error("Augment failed, verify dependencies.");}var a=[r.prototype,s.prototype],i;for(i=2;i<arguments.length;i=i+1){a.push(arguments[i]);}L.augmentObject.apply(this,a);return r;},dump:function(o,d){var i,len,s=[],OBJ="{...}",FUN="f(){...}",COMMA=", ",ARROW=" => ";if(!L.isObject(o)){return o+"";}else{if(o instanceof Date||("nodeType" in o&&"tagName" in o)){return o;}else{if(L.isFunction(o)){return FUN;}}}d=(L.isNumber(d))?d:3;if(L.isArray(o)){s.push("[");for(i=0,len=o.length;i<len;i=i+1){if(L.isObject(o[i])){s.push((d>0)?L.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}s.push(COMMA);}if(s.length>1){s.pop();}s.push("]");}else{s.push("{");for(i in o){if(L.hasOwnProperty(o,i)){s.push(i+ARROW);if(L.isObject(o[i])){s.push((d>0)?L.dump(o[i],d-1):OBJ);}else{s.push(o[i]);}s.push(COMMA);}}if(s.length>1){s.pop();}s.push("}");}return s.join("");},substitute:function(s,o,f,recurse){var i,j,k,key,v,meta,saved=[],token,lidx=s.length,DUMP="dump",SPACE=" ",LBRACE="{",RBRACE="}",dump,objstr;for(;;){i=s.lastIndexOf(LBRACE,lidx);if(i<0){break;}j=s.indexOf(RBRACE,i);if(i+1>j){break;}token=s.substring(i+1,j);key=token;meta=null;k=key.indexOf(SPACE);if(k>-1){meta=key.substring(k+1);key=key.substring(0,k);}v=o[key];if(f){v=f(key,v,meta);}if(L.isObject(v)){if(L.isArray(v)){v=L.dump(v,parseInt(meta,10));}else{meta=meta||"";dump=meta.indexOf(DUMP);if(dump>-1){meta=meta.substring(4);}objstr=v.toString();if(objstr===OBJECT_TOSTRING||dump>-1){v=L.dump(v,parseInt(meta,10));}else{v=objstr;}}}else{if(!L.isString(v)&&!L.isNumber(v)){v="~-"+saved.length+"-~";saved[saved.length]=token;}}s=s.substring(0,i)+v+s.substring(j+1);if(recurse===false){lidx=i-1;}}for(i=saved.length-1;i>=0;i=i-1){s=s.replace(new RegExp("~-"+i+"-~"),"{"+saved[i]+"}","g");}return s;},trim:function(s){try{return s.replace(/^\s+|\s+$/g,"");}catch(e){return s;}},merge:function(){var o={},a=arguments,l=a.length,i;for(i=0;i<l;i=i+1){L.augmentObject(o,a[i],true);}return o;},later:function(when,o,fn,data,periodic){when=when||0;o=o||{};var m=fn,d=data,f,r;if(L.isString(fn)){m=o[fn];}if(!m){throw new TypeError("method undefined");}if(!L.isUndefined(data)&&!L.isArray(d)){d=[data];}f=function(){m.apply(o,d||NOTHING);};r=(periodic)?setInterval(f,when):setTimeout(f,when);return{interval:periodic,cancel:function(){if(this.interval){clearInterval(r);}else{clearTimeout(r);}}};},isValue:function(o){return(L.isObject(o)||L.isString(o)||L.isNumber(o)||L.isBoolean(o));}};L.hasOwnProperty=(OP.hasOwnProperty)?function(o,prop){return o&&o.hasOwnProperty&&o.hasOwnProperty(prop);}:function(o,prop){return !L.isUndefined(o[prop])&&o.constructor.prototype[prop]!==o[prop];};OB.augmentObject(L,OB,true);YAHOO.util.Lang=L;L.augment=L.augmentProto;YAHOO.augment=L.augmentProto;YAHOO.extend=L.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.9.0",build:"2800"});
/*http://www.physiotherapyalberta.ca/portal_javascripts/build/dom/dom.js?original=1*/
(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var Y=YAHOO.util,lang=YAHOO.lang,UA=YAHOO.env.ua,trim=YAHOO.lang.trim,propertyCache={},reCache={},RE_TABLE=/^t(?:able|d|h)$/i,RE_COLOR=/color$/i,document=window.document,documentElement=document.documentElement,OWNER_DOCUMENT="ownerDocument",DEFAULT_VIEW="defaultView",DOCUMENT_ELEMENT="documentElement",COMPAT_MODE="compatMode",OFFSET_LEFT="offsetLeft",OFFSET_TOP="offsetTop",OFFSET_PARENT="offsetParent",PARENT_NODE="parentNode",NODE_TYPE="nodeType",TAG_NAME="tagName",SCROLL_LEFT="scrollLeft",SCROLL_TOP="scrollTop",GET_BOUNDING_CLIENT_RECT="getBoundingClientRect",GET_COMPUTED_STYLE="getComputedStyle",CURRENT_STYLE="currentStyle",CSS1_COMPAT="CSS1Compat",_BACK_COMPAT="BackCompat",_CLASS="class",CLASS_NAME="className",EMPTY="",SPACE=" ",C_START="(?:^|\\s)",C_END="(?= |$)",G="g",POSITION="position",FIXED="fixed",RELATIVE="relative",LEFT="left",TOP="top",MEDIUM="medium",BORDER_LEFT_WIDTH="borderLeftWidth",BORDER_TOP_WIDTH="borderTopWidth",isOpera=UA.opera,isSafari=UA.webkit,isGecko=UA.gecko,isIE=UA.ie;Y.Dom={CUSTOM_ATTRIBUTES:(!documentElement.hasAttribute)?{"for":"htmlFor","class":CLASS_NAME}:{htmlFor:"for",className:_CLASS},DOT_ATTRIBUTES:{checked:true},get:function(el){var id,nodes,c,i,len,attr,ret=null;if(el){if(typeof el=="string"||typeof el=="number"){id=el+"";el=document.getElementById(el);attr=(el)?el.attributes:null;if(el&&attr&&attr.id&&attr.id.value===id){return el;}else{if(el&&document.all){el=null;nodes=document.all[id];if(nodes&&nodes.length){for(i=0,len=nodes.length;i<len;++i){if(nodes[i].id===id){return nodes[i];}}}}}}else{if(Y.Element&&el instanceof Y.Element){el=el.get("element");}else{if(!el.nodeType&&"length" in el){c=[];for(i=0,len=el.length;i<len;++i){c[c.length]=Y.Dom.get(el[i]);}el=c;}}}ret=el;}return ret;},getComputedStyle:function(el,property){if(window[GET_COMPUTED_STYLE]){return el[OWNER_DOCUMENT][DEFAULT_VIEW][GET_COMPUTED_STYLE](el,null)[property];}else{if(el[CURRENT_STYLE]){return Y.Dom.IE_ComputedStyle.get(el,property);}}},getStyle:function(el,property){return Y.Dom.batch(el,Y.Dom._getStyle,property);},_getStyle:function(){if(window[GET_COMPUTED_STYLE]){return function(el,property){property=(property==="float")?property="cssFloat":Y.Dom._toCamel(property);var value=el.style[property],computed;if(!value){computed=el[OWNER_DOCUMENT][DEFAULT_VIEW][GET_COMPUTED_STYLE](el,null);if(computed){value=computed[property];}}return value;};}else{if(documentElement[CURRENT_STYLE]){return function(el,property){var value;switch(property){case"opacity":value=100;try{value=el.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(e){try{value=el.filters("alpha").opacity;}catch(err){}}return value/100;case"float":property="styleFloat";default:property=Y.Dom._toCamel(property);value=el[CURRENT_STYLE]?el[CURRENT_STYLE][property]:null;return(el.style[property]||value);}};}}}(),setStyle:function(el,property,val){Y.Dom.batch(el,Y.Dom._setStyle,{prop:property,val:val});},_setStyle:function(){if(!window.getComputedStyle&&document.documentElement.currentStyle){return function(el,args){var property=Y.Dom._toCamel(args.prop),val=args.val;if(el){switch(property){case"opacity":if(val===""||val===null||val===1){el.style.removeAttribute("filter");}else{if(lang.isString(el.style.filter)){el.style.filter="alpha(opacity="+val*100+")";if(!el[CURRENT_STYLE]||!el[CURRENT_STYLE].hasLayout){el.style.zoom=1;}}}break;case"float":property="styleFloat";default:el.style[property]=val;}}else{}};}else{return function(el,args){var property=Y.Dom._toCamel(args.prop),val=args.val;if(el){if(property=="float"){property="cssFloat";}el.style[property]=val;}else{}};}}(),getXY:function(el){return Y.Dom.batch(el,Y.Dom._getXY);},_canPosition:function(el){return(Y.Dom._getStyle(el,"display")!=="none"&&Y.Dom._inDoc(el));},_getXY:function(node){var scrollLeft,scrollTop,box,doc,clientTop,clientLeft,round=Math.round,xy=false;if(Y.Dom._canPosition(node)){box=node[GET_BOUNDING_CLIENT_RECT]();doc=node[OWNER_DOCUMENT];scrollLeft=Y.Dom.getDocumentScrollLeft(doc);scrollTop=Y.Dom.getDocumentScrollTop(doc);xy=[box[LEFT],box[TOP]];if(clientTop||clientLeft){xy[0]-=clientLeft;xy[1]-=clientTop;}if((scrollTop||scrollLeft)){xy[0]+=scrollLeft;xy[1]+=scrollTop;}xy[0]=round(xy[0]);xy[1]=round(xy[1]);}else{}return xy;},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){Y.Dom.batch(el,Y.Dom._setXY,{pos:pos,noRetry:noRetry});},_setXY:function(node,args){var pos=Y.Dom._getStyle(node,POSITION),setStyle=Y.Dom.setStyle,xy=args.pos,noRetry=args.noRetry,delta=[parseInt(Y.Dom.getComputedStyle(node,LEFT),10),parseInt(Y.Dom.getComputedStyle(node,TOP),10)],currentXY,newXY;currentXY=Y.Dom._getXY(node);if(!xy||currentXY===false){return false;}if(pos=="static"){pos=RELATIVE;setStyle(node,POSITION,pos);}if(isNaN(delta[0])){delta[0]=(pos==RELATIVE)?0:node[OFFSET_LEFT];}if(isNaN(delta[1])){delta[1]=(pos==RELATIVE)?0:node[OFFSET_TOP];}if(xy[0]!==null){setStyle(node,LEFT,xy[0]-currentXY[0]+delta[0]+"px");}if(xy[1]!==null){setStyle(node,TOP,xy[1]-currentXY[1]+delta[1]+"px");}if(!noRetry){newXY=Y.Dom._getXY(node);if((xy[0]!==null&&newXY[0]!=xy[0])||(xy[1]!==null&&newXY[1]!=xy[1])){Y.Dom._setXY(node,{pos:xy,noRetry:true});}}},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var region=false;if(Y.Dom._canPosition(el)){region=Y.Region.getRegion(el);}else{}return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root,apply,o,overrides){tag=tag||"*";root=(root)?Y.Dom.get(root):null||document;if(!root){return[];}var nodes=[],elements=root.getElementsByTagName(tag),hasClass=Y.Dom.hasClass;for(var i=0,len=elements.length;i<len;++i){if(hasClass(elements[i],className)){nodes[nodes.length]=elements[i];}}if(apply){Y.Dom.batch(nodes,apply,o,overrides);}return nodes;},hasClass:function(el,className){return Y.Dom.batch(el,Y.Dom._hasClass,className);},_hasClass:function(el,className){var ret=false,current;if(el&&className){current=Y.Dom._getAttribute(el,CLASS_NAME)||EMPTY;if(current){current=current.replace(/\s+/g,SPACE);}if(className.exec){ret=className.test(current);}else{ret=className&&(SPACE+current+SPACE).indexOf(SPACE+className+SPACE)>-1;}}else{}return ret;},addClass:function(el,className){return Y.Dom.batch(el,Y.Dom._addClass,className);},_addClass:function(el,className){var ret=false,current;if(el&&className){current=Y.Dom._getAttribute(el,CLASS_NAME)||EMPTY;if(!Y.Dom._hasClass(el,className)){Y.Dom.setAttribute(el,CLASS_NAME,trim(current+SPACE+className));ret=true;}}else{}return ret;},removeClass:function(el,className){return Y.Dom.batch(el,Y.Dom._removeClass,className);},_removeClass:function(el,className){var ret=false,current,newClass,attr;if(el&&className){current=Y.Dom._getAttribute(el,CLASS_NAME)||EMPTY;Y.Dom.setAttribute(el,CLASS_NAME,current.replace(Y.Dom._getClassRegex(className),EMPTY));newClass=Y.Dom._getAttribute(el,CLASS_NAME);if(current!==newClass){Y.Dom.setAttribute(el,CLASS_NAME,trim(newClass));ret=true;if(Y.Dom._getAttribute(el,CLASS_NAME)===""){attr=(el.hasAttribute&&el.hasAttribute(_CLASS))?_CLASS:CLASS_NAME;el.removeAttribute(attr);}}}else{}return ret;},replaceClass:function(el,oldClassName,newClassName){return Y.Dom.batch(el,Y.Dom._replaceClass,{from:oldClassName,to:newClassName});},_replaceClass:function(el,classObj){var className,from,to,ret=false,current;if(el&&classObj){from=classObj.from;to=classObj.to;if(!to){ret=false;}else{if(!from){ret=Y.Dom._addClass(el,classObj.to);}else{if(from!==to){current=Y.Dom._getAttribute(el,CLASS_NAME)||EMPTY;className=(SPACE+current.replace(Y.Dom._getClassRegex(from),SPACE+to).replace(/\s+/g,SPACE)).split(Y.Dom._getClassRegex(to));className.splice(1,0,SPACE+to);Y.Dom.setAttribute(el,CLASS_NAME,trim(className.join(EMPTY)));ret=true;}}}}else{}return ret;},generateId:function(el,prefix){prefix=prefix||"yui-gen";var f=function(el){if(el&&el.id){return el.id;}var id=prefix+YAHOO.env._id_counter++;if(el){if(el[OWNER_DOCUMENT]&&el[OWNER_DOCUMENT].getElementById(id)){return Y.Dom.generateId(el,id+prefix);}el.id=id;}return id;};return Y.Dom.batch(el,f,Y.Dom,true)||f.apply(Y.Dom,arguments);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);needle=Y.Dom.get(needle);var ret=false;if((haystack&&needle)&&(haystack[NODE_TYPE]&&needle[NODE_TYPE])){if(haystack.contains&&haystack!==needle){ret=haystack.contains(needle);}else{if(haystack.compareDocumentPosition){ret=!!(haystack.compareDocumentPosition(needle)&16);}}}else{}return ret;},inDocument:function(el,doc){return Y.Dom._inDoc(Y.Dom.get(el),doc);},_inDoc:function(el,doc){var ret=false;if(el&&el[TAG_NAME]){doc=doc||el[OWNER_DOCUMENT];ret=Y.Dom.isAncestor(doc[DOCUMENT_ELEMENT],el);}else{}return ret;},getElementsBy:function(method,tag,root,apply,o,overrides,firstOnly){tag=tag||"*";root=(root)?Y.Dom.get(root):null||document;var ret=(firstOnly)?null:[],elements;if(root){elements=root.getElementsByTagName(tag);for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){if(firstOnly){ret=elements[i];break;}else{ret[ret.length]=elements[i];}}}if(apply){Y.Dom.batch(ret,apply,o,overrides);}}return ret;},getElementBy:function(method,tag,root){return Y.Dom.getElementsBy(method,tag,root,null,null,null,true);},batch:function(el,method,o,overrides){var collection=[],scope=(overrides)?o:null;el=(el&&(el[TAG_NAME]||el.item))?el:Y.Dom.get(el);if(el&&method){if(el[TAG_NAME]||el.length===undefined){return method.call(scope,el,o);}for(var i=0;i<el.length;++i){collection[collection.length]=method.call(scope||el[i],el[i],o);}}else{return false;}return collection;},getDocumentHeight:function(){var scrollHeight=(document[COMPAT_MODE]!=CSS1_COMPAT||isSafari)?document.body.scrollHeight:documentElement.scrollHeight,h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document[COMPAT_MODE]!=CSS1_COMPAT||isSafari)?document.body.scrollWidth:documentElement.scrollWidth,w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight,mode=document[COMPAT_MODE];if((mode||isIE)&&!isOpera){height=(mode==CSS1_COMPAT)?documentElement.clientHeight:document.body.clientHeight;}return height;},getViewportWidth:function(){var width=self.innerWidth,mode=document[COMPAT_MODE];if(mode||isIE){width=(mode==CSS1_COMPAT)?documentElement.clientWidth:document.body.clientWidth;}return width;},getAncestorBy:function(node,method){while((node=node[PARENT_NODE])){if(Y.Dom._testElement(node,method)){return node;}}return null;},getAncestorByClassName:function(node,className){node=Y.Dom.get(node);if(!node){return null;}var method=function(el){return Y.Dom.hasClass(el,className);};return Y.Dom.getAncestorBy(node,method);},getAncestorByTagName:function(node,tagName){node=Y.Dom.get(node);if(!node){return null;}var method=function(el){return el[TAG_NAME]&&el[TAG_NAME].toUpperCase()==tagName.toUpperCase();};return Y.Dom.getAncestorBy(node,method);},getPreviousSiblingBy:function(node,method){while(node){node=node.previousSibling;if(Y.Dom._testElement(node,method)){return node;}}return null;},getPreviousSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}return Y.Dom.getPreviousSiblingBy(node);},getNextSiblingBy:function(node,method){while(node){node=node.nextSibling;if(Y.Dom._testElement(node,method)){return node;}}return null;},getNextSibling:function(node){node=Y.Dom.get(node);if(!node){return null;}return Y.Dom.getNextSiblingBy(node);},getFirstChildBy:function(node,method){var child=(Y.Dom._testElement(node.firstChild,method))?node.firstChild:null;return child||Y.Dom.getNextSiblingBy(node.firstChild,method);},getFirstChild:function(node,method){node=Y.Dom.get(node);if(!node){return null;}return Y.Dom.getFirstChildBy(node);},getLastChildBy:function(node,method){if(!node){return null;}var child=(Y.Dom._testElement(node.lastChild,method))?node.lastChild:null;return child||Y.Dom.getPreviousSiblingBy(node.lastChild,method);},getLastChild:function(node){node=Y.Dom.get(node);return Y.Dom.getLastChildBy(node);},getChildrenBy:function(node,method){var child=Y.Dom.getFirstChildBy(node,method),children=child?[child]:[];Y.Dom.getNextSiblingBy(child,function(node){if(!method||method(node)){children[children.length]=node;}return false;});return children;},getChildren:function(node){node=Y.Dom.get(node);if(!node){}return Y.Dom.getChildrenBy(node);},getDocumentScrollLeft:function(doc){doc=doc||document;return Math.max(doc[DOCUMENT_ELEMENT].scrollLeft,doc.body.scrollLeft);},getDocumentScrollTop:function(doc){doc=doc||document;return Math.max(doc[DOCUMENT_ELEMENT].scrollTop,doc.body.scrollTop);},insertBefore:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode[PARENT_NODE]){return null;}return referenceNode[PARENT_NODE].insertBefore(newNode,referenceNode);},insertAfter:function(newNode,referenceNode){newNode=Y.Dom.get(newNode);referenceNode=Y.Dom.get(referenceNode);if(!newNode||!referenceNode||!referenceNode[PARENT_NODE]){return null;}if(referenceNode.nextSibling){return referenceNode[PARENT_NODE].insertBefore(newNode,referenceNode.nextSibling);}else{return referenceNode[PARENT_NODE].appendChild(newNode);}},getClientRegion:function(){var t=Y.Dom.getDocumentScrollTop(),l=Y.Dom.getDocumentScrollLeft(),r=Y.Dom.getViewportWidth()+l,b=Y.Dom.getViewportHeight()+t;return new Y.Region(t,r,b,l);},setAttribute:function(el,attr,val){Y.Dom.batch(el,Y.Dom._setAttribute,{attr:attr,val:val});},_setAttribute:function(el,args){var attr=Y.Dom._toCamel(args.attr),val=args.val;if(el&&el.setAttribute){if(Y.Dom.DOT_ATTRIBUTES[attr]&&el.tagName&&el.tagName!="BUTTON"){el[attr]=val;}else{attr=Y.Dom.CUSTOM_ATTRIBUTES[attr]||attr;el.setAttribute(attr,val);}}else{}},getAttribute:function(el,attr){return Y.Dom.batch(el,Y.Dom._getAttribute,attr);},_getAttribute:function(el,attr){var val;attr=Y.Dom.CUSTOM_ATTRIBUTES[attr]||attr;if(Y.Dom.DOT_ATTRIBUTES[attr]){val=el[attr];}else{if(el&&"getAttribute" in el){if(/^(?:href|src)$/.test(attr)){val=el.getAttribute(attr,2);}else{val=el.getAttribute(attr);}}else{}}return val;},_toCamel:function(property){var c=propertyCache;function tU(x,l){return l.toUpperCase();}return c[property]||(c[property]=property.indexOf("-")===-1?property:property.replace(/-([a-z])/gi,tU));},_getClassRegex:function(className){var re;if(className!==undefined){if(className.exec){re=className;}else{re=reCache[className];if(!re){className=className.replace(Y.Dom._patterns.CLASS_RE_TOKENS,"\\$1");className=className.replace(/\s+/g,SPACE);re=reCache[className]=new RegExp(C_START+className+C_END,G);}}}return re;},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}\\])/g},_testElement:function(node,method){return node&&node[NODE_TYPE]==1&&(!method||method(node));},_calcBorders:function(node,xy2){var t=parseInt(Y.Dom[GET_COMPUTED_STYLE](node,BORDER_TOP_WIDTH),10)||0,l=parseInt(Y.Dom[GET_COMPUTED_STYLE](node,BORDER_LEFT_WIDTH),10)||0;if(isGecko){if(RE_TABLE.test(node[TAG_NAME])){t=0;l=0;}}xy2[0]+=l;xy2[1]+=t;return xy2;}};var _getComputedStyle=Y.Dom[GET_COMPUTED_STYLE];if(UA.opera){Y.Dom[GET_COMPUTED_STYLE]=function(node,att){var val=_getComputedStyle(node,att);if(RE_COLOR.test(att)){val=Y.Dom.Color.toRGB(val);}return val;};}if(UA.webkit){Y.Dom[GET_COMPUTED_STYLE]=function(node,att){var val=_getComputedStyle(node,att);if(val==="rgba(0, 0, 0, 0)"){val="transparent";}return val;};}if(UA.ie&&UA.ie>=8){Y.Dom.DOT_ATTRIBUTES.type=true;}})();YAHOO.util.Region=function(t,r,b,l){this.top=t;this.y=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this.x=l;this[0]=l;this.width=this.right-this.left;this.height=this.bottom-this.top;};YAHOO.util.Region.prototype.contains=function(region){return(region.left>=this.left&&region.right<=this.right&&region.top>=this.top&&region.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top),r=Math.min(this.right,region.right),b=Math.min(this.bottom,region.bottom),l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top),r=Math.max(this.right,region.right),b=Math.max(this.bottom,region.bottom),l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};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(el){var p=YAHOO.util.Dom.getXY(el),t=p[1],r=p[0]+el.offsetWidth,b=p[1]+el.offsetHeight,l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(YAHOO.lang.isArray(x)){y=x[1];x=x[0];}YAHOO.util.Point.superclass.constructor.call(this,y,x,y,x);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var Y=YAHOO.util,CLIENT_TOP="clientTop",CLIENT_LEFT="clientLeft",PARENT_NODE="parentNode",RIGHT="right",HAS_LAYOUT="hasLayout",PX="px",OPACITY="opacity",AUTO="auto",BORDER_LEFT_WIDTH="borderLeftWidth",BORDER_TOP_WIDTH="borderTopWidth",BORDER_RIGHT_WIDTH="borderRightWidth",BORDER_BOTTOM_WIDTH="borderBottomWidth",VISIBLE="visible",TRANSPARENT="transparent",HEIGHT="height",WIDTH="width",STYLE="style",CURRENT_STYLE="currentStyle",re_size=/^width|height$/,re_unit=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,ComputedStyle={get:function(el,property){var value="",current=el[CURRENT_STYLE][property];if(property===OPACITY){value=Y.Dom.getStyle(el,OPACITY);}else{if(!current||(current.indexOf&&current.indexOf(PX)>-1)){value=current;}else{if(Y.Dom.IE_COMPUTED[property]){value=Y.Dom.IE_COMPUTED[property](el,property);}else{if(re_unit.test(current)){value=Y.Dom.IE.ComputedStyle.getPixel(el,property);}else{value=current;}}}}return value;},getOffset:function(el,prop){var current=el[CURRENT_STYLE][prop],capped=prop.charAt(0).toUpperCase()+prop.substr(1),offset="offset"+capped,pixel="pixel"+capped,value="",actual;if(current==AUTO){actual=el[offset];if(actual===undefined){value=0;}value=actual;if(re_size.test(prop)){el[STYLE][prop]=actual;if(el[offset]>actual){value=actual-(el[offset]-actual);}el[STYLE][prop]=AUTO;}}else{if(!el[STYLE][pixel]&&!el[STYLE][prop]){el[STYLE][prop]=current;}value=el[STYLE][pixel];}return value+PX;},getBorderWidth:function(el,property){var value=null;if(!el[CURRENT_STYLE][HAS_LAYOUT]){el[STYLE].zoom=1;}switch(property){case BORDER_TOP_WIDTH:value=el[CLIENT_TOP];break;case BORDER_BOTTOM_WIDTH:value=el.offsetHeight-el.clientHeight-el[CLIENT_TOP];break;case BORDER_LEFT_WIDTH:value=el[CLIENT_LEFT];break;case BORDER_RIGHT_WIDTH:value=el.offsetWidth-el.clientWidth-el[CLIENT_LEFT];break;}return value+PX;},getPixel:function(node,att){var val=null,styleRight=node[CURRENT_STYLE][RIGHT],current=node[CURRENT_STYLE][att];node[STYLE][RIGHT]=current;val=node[STYLE].pixelRight;node[STYLE][RIGHT]=styleRight;return val+PX;},getMargin:function(node,att){var val;if(node[CURRENT_STYLE][att]==AUTO){val=0+PX;}else{val=Y.Dom.IE.ComputedStyle.getPixel(node,att);}return val;},getVisibility:function(node,att){var current;while((current=node[CURRENT_STYLE])&&current[att]=="inherit"){node=node[PARENT_NODE];}return(current)?current[att]:VISIBLE;},getColor:function(node,att){return Y.Dom.Color.toRGB(node[CURRENT_STYLE][att])||TRANSPARENT;},getBorderColor:function(node,att){var current=node[CURRENT_STYLE],val=current[att]||current.color;return Y.Dom.Color.toRGB(Y.Dom.Color.toHex(val));}},IEComputed={};IEComputed.top=IEComputed.right=IEComputed.bottom=IEComputed.left=IEComputed[WIDTH]=IEComputed[HEIGHT]=ComputedStyle.getOffset;IEComputed.color=ComputedStyle.getColor;IEComputed[BORDER_TOP_WIDTH]=IEComputed[BORDER_RIGHT_WIDTH]=IEComputed[BORDER_BOTTOM_WIDTH]=IEComputed[BORDER_LEFT_WIDTH]=ComputedStyle.getBorderWidth;IEComputed.marginTop=IEComputed.marginRight=IEComputed.marginBottom=IEComputed.marginLeft=ComputedStyle.getMargin;IEComputed.visibility=ComputedStyle.getVisibility;IEComputed.borderColor=IEComputed.borderTopColor=IEComputed.borderRightColor=IEComputed.borderBottomColor=IEComputed.borderLeftColor=ComputedStyle.getBorderColor;Y.Dom.IE_COMPUTED=IEComputed;Y.Dom.IE_ComputedStyle=ComputedStyle;})();(function(){var TO_STRING="toString",PARSE_INT=parseInt,RE=RegExp,Y=YAHOO.util;Y.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(val){if(!Y.Dom.Color.re_RGB.test(val)){val=Y.Dom.Color.toHex(val);}if(Y.Dom.Color.re_hex.exec(val)){val="rgb("+[PARSE_INT(RE.$1,16),PARSE_INT(RE.$2,16),PARSE_INT(RE.$3,16)].join(", ")+")";}return val;},toHex:function(val){val=Y.Dom.Color.KEYWORDS[val]||val;if(Y.Dom.Color.re_RGB.exec(val)){val=[Number(RE.$1).toString(16),Number(RE.$2).toString(16),Number(RE.$3).toString(16)];for(var i=0;i<val.length;i++){if(val[i].length<2){val[i]="0"+val[i];}}val=val.join("");}if(val.length<6){val=val.replace(Y.Dom.Color.re_hex3,"$1$1");}if(val!=="transparent"&&val.indexOf("#")<0){val="#"+val;}return val.toUpperCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.9.0",build:"2800"});
/*http://www.physiotherapyalberta.ca/portal_javascripts/build/event/event.js?original=1*/
YAHOO.util.CustomEvent=function(type,context,silent,signature,fireOnce){this.type=type;this.scope=context||window;this.silent=silent;this.fireOnce=fireOnce;this.fired=false;this.firedWith=null;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,overrideContext){if(!fn){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,overrideContext);}var s=new YAHOO.util.Subscriber(fn,obj,overrideContext);if(this.fireOnce&&this.fired){this.notify(s,this.firedWith);}else{this.subscribers.push(s);}},unsubscribe:function(fn,obj){if(!fn){return this.unsubscribeAll();}var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}return found;},fire:function(){this.lastError=null;var errors=[],len=this.subscribers.length;var args=[].slice.call(arguments,0),ret=true,i,rebuild=false;if(this.fireOnce){if(this.fired){return true;}else{this.firedWith=args;}}this.fired=true;if(!len&&this.silent){return true;}if(!this.silent){}var subs=this.subscribers.slice();for(i=0;i<len;++i){var s=subs[i];if(!s||!s.fn){rebuild=true;}else{ret=this.notify(s,args);if(false===ret){if(!this.silent){}break;}}}return(ret!==false);},notify:function(s,args){var ret,param=null,scope=s.getScope(this.scope),throwErrors=YAHOO.util.Event.throwErrors;if(!this.silent){}if(this.signature==YAHOO.util.CustomEvent.FLAT){if(args.length>0){param=args[0];}try{ret=s.fn.call(scope,param,s.obj);}catch(e){this.lastError=e;if(throwErrors){throw e;}}}else{try{ret=s.fn.call(scope,this.type,args,s.obj);}catch(ex){this.lastError=ex;if(throwErrors){throw ex;}}}return ret;},unsubscribeAll:function(){var l=this.subscribers.length,i;for(i=l-1;i>-1;i--){this._delete(i);}this.subscribers=[];return l;},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}this.subscribers.splice(index,1);},toString:function(){return"CustomEvent: '"+this.type+"', context: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,overrideContext){this.fn=fn;this.obj=YAHOO.lang.isUndefined(obj)?null:obj;this.overrideContext=overrideContext;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false,listeners=[],unloadListeners=[],retryCount=0,onAvailStack=[],counter=0,webkitKeymap={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9},isIE=YAHOO.env.ua.ie,FOCUSIN="focusin",FOCUSOUT="focusout";return{POLL_RETRYS:500,POLL_INTERVAL:40,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:isIE,_interval:null,_dri:null,_specialTypes:{focusin:(isIE?"focusin":"focus"),focusout:(isIE?"focusout":"blur")},DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){this._interval=YAHOO.lang.later(this.POLL_INTERVAL,this,this._tryPreloadAttach,null,true);}},onAvailable:function(id,fn,obj,overrideContext,checkContent){var a=(YAHOO.lang.isString(id))?[id]:id;for(var i=0;i<a.length;i=i+1){onAvailStack.push({id:a[i],fn:fn,obj:obj,overrideContext:overrideContext,checkReady:checkContent});}retryCount=this.POLL_RETRYS;this.startInterval();},onContentReady:function(id,fn,obj,overrideContext){this.onAvailable(id,fn,obj,overrideContext,true);},onDOMReady:function(){this.DOMReadyEvent.subscribe.apply(this.DOMReadyEvent,arguments);},_addListener:function(el,sType,fn,obj,overrideContext,bCapture){if(!fn||!fn.call){return false;}if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=this.on(el[i],sType,fn,obj,overrideContext)&&ok;}return ok;}else{if(YAHOO.lang.isString(el)){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event._addListener(el,sType,fn,obj,overrideContext,bCapture);});return true;}}}if(!el){return false;}if("unload"==sType&&obj!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,obj,overrideContext];return true;}var context=el;if(overrideContext){if(overrideContext===true){context=obj;}else{context=overrideContext;}}var wrappedFn=function(e){return fn.call(context,YAHOO.util.Event.getEvent(e,el),obj);};var li=[el,sType,fn,wrappedFn,context,obj,overrideContext,bCapture];var index=listeners.length;listeners[index]=li;try{this._simpleAdd(el,sType,wrappedFn,bCapture);}catch(ex){this.lastError=ex;this.removeListener(el,sType,fn);return false;}return true;},_getType:function(type){return this._specialTypes[type]||type;},addListener:function(el,sType,fn,obj,overrideContext){var capture=((sType==FOCUSIN||sType==FOCUSOUT)&&!YAHOO.env.ua.ie)?true:false;return this._addListener(el,this._getType(sType),fn,obj,overrideContext,capture);},addFocusListener:function(el,fn,obj,overrideContext){return this.on(el,FOCUSIN,fn,obj,overrideContext);},removeFocusListener:function(el,fn){return this.removeListener(el,FOCUSIN,fn);},addBlurListener:function(el,fn,obj,overrideContext){return this.on(el,FOCUSOUT,fn,obj,overrideContext);},removeBlurListener:function(el,fn){return this.removeListener(el,FOCUSOUT,fn);},removeListener:function(el,sType,fn){var i,len,li;sType=this._getType(sType);if(typeof el=="string"){el=this.getEl(el);}else{if(this._isValidCollection(el)){var ok=true;for(i=el.length-1;i>-1;i--){ok=(this.removeListener(el[i],sType,fn)&&ok);}return ok;}}if(!fn||!fn.call){return this.purgeElement(el,false,sType);}if("unload"==sType){for(i=unloadListeners.length-1;i>-1;i--){li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners.splice(i,1);return true;}}return false;}var cacheItem=null;var index=arguments[3];if("undefined"===typeof index){index=this._getCacheIndex(listeners,el,sType,fn);}if(index>=0){cacheItem=listeners[index];}if(!el||!cacheItem){return false;}var bCapture=cacheItem[this.CAPTURE]===true?true:false;try{this._simpleRemove(el,sType,cacheItem[this.WFN],bCapture);}catch(ex){this.lastError=ex;return false;}delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners.splice(index,1);return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(n){try{if(n&&3==n.nodeType){return n.parentNode;}}catch(e){return null;}return n;},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}return y;},getXY:function(ev){return[this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else{if(ev.type=="mouseover"){t=ev.fromElement;}}}return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(ex){this.lastError=ex;return t;}}return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e,boundEl){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}c=c.caller;}}return ev;},getCharCode:function(ev){var code=ev.keyCode||ev.charCode||0;if(YAHOO.env.ua.webkit&&(code in webkitKeymap)){code=webkitKeymap[code];}return code;},_getCacheIndex:function(a,el,sType,fn){for(var i=0,l=a.length;i<l;i=i+1){var li=a[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}return -1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}return id;},_isValidCollection:function(o){try{return(o&&typeof o!=="string"&&o.length&&!o.tagName&&!o.alert&&typeof o[0]!=="undefined");}catch(ex){return false;}},elCache:{},getEl:function(id){return(typeof id==="string")?document.getElementById(id):id;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",YAHOO,0,0,1),_load:function(e){if(!loadComplete){loadComplete=true;var EU=YAHOO.util.Event;EU._ready();EU._tryPreloadAttach();}},_ready:function(e){var EU=YAHOO.util.Event;if(!EU.DOMReady){EU.DOMReady=true;EU.DOMReadyEvent.fire();EU._simpleRemove(document,"DOMContentLoaded",EU._ready);}},_tryPreloadAttach:function(){if(onAvailStack.length===0){retryCount=0;if(this._interval){this._interval.cancel();this._interval=null;}return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0&&onAvailStack.length>0);}var notAvail=[];var executeItem=function(el,item){var context=el;if(item.overrideContext){if(item.overrideContext===true){context=item.obj;}else{context=item.overrideContext;}}item.fn.call(context,item.obj);};var i,len,item,el,ready=[];for(i=0,len=onAvailStack.length;i<len;i=i+1){item=onAvailStack[i];if(item){el=this.getEl(item.id);if(el){if(item.checkReady){if(loadComplete||el.nextSibling||!tryAgain){ready.push(item);onAvailStack[i]=null;}}else{executeItem(el,item);onAvailStack[i]=null;}}else{notAvail.push(item);}}}for(i=0,len=ready.length;i<len;i=i+1){item=ready[i];executeItem(this.getEl(item.id),item);}retryCount--;if(tryAgain){for(i=onAvailStack.length-1;i>-1;i--){item=onAvailStack[i];if(!item||!item.id){onAvailStack.splice(i,1);}}this.startInterval();}else{if(this._interval){this._interval.cancel();this._interval=null;}}this.locked=false;},purgeElement:function(el,recurse,sType){var oEl=(YAHOO.lang.isString(el))?this.getEl(el):el;var elListeners=this.getListeners(oEl,sType),i,len;if(elListeners){for(i=elListeners.length-1;i>-1;i--){var l=elListeners[i];this.removeListener(oEl,l.type,l.fn);}}if(recurse&&oEl&&oEl.childNodes){for(i=0,len=oEl.childNodes.length;i<len;++i){this.purgeElement(oEl.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var results=[],searchLists;if(!sType){searchLists=[listeners,unloadListeners];}else{if(sType==="unload"){searchLists=[unloadListeners];}else{sType=this._getType(sType);searchLists=[listeners];}}var oEl=(YAHOO.lang.isString(el))?this.getEl(el):el;for(var j=0;j<searchLists.length;j=j+1){var searchList=searchLists[j];if(searchList){for(var i=0,len=searchList.length;i<len;++i){var l=searchList[i];if(l&&l[this.EL]===oEl&&(!sType||sType===l[this.TYPE])){results.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.OVERRIDE],scope:l[this.ADJ_SCOPE],index:i});}}}}return(results.length)?results:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index,ul=unloadListeners.slice(),context;for(i=0,len=unloadListeners.length;i<len;++i){l=ul[i];if(l){try{context=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){context=l[EU.UNLOAD_OBJ];}else{context=l[EU.ADJ_SCOPE];}}l[EU.FN].call(context,EU.getEvent(e,l[EU.EL]),l[EU.UNLOAD_OBJ]);}catch(e1){}ul[i]=null;}}l=null;context=null;unloadListeners=null;if(listeners){for(j=listeners.length-1;j>-1;j--){l=listeners[j];if(l){try{EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],j);}catch(e2){}}}l=null;}try{EU._simpleRemove(window,"unload",EU._unload);EU._simpleRemove(window,"load",EU._load);}catch(e3){}},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else{if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else{if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else{if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener;
/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */
if(EU.isIE){if(self!==self.top){document.onreadystatechange=function(){if(document.readyState=="complete"){document.onreadystatechange=null;EU._ready();}};}else{YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,overrideContext){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,overrideContext);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];}subs[p_type].push({fn:p_fn,obj:p_obj,overrideContext:overrideContext});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var evts=this.__yui_events;if(p_type){var ce=evts[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}}else{var ret=true;for(var i in evts){if(YAHOO.lang.hasOwnProperty(evts,i)){ret=ret&&evts[i].unsubscribe(p_fn,p_obj);}}return ret;}return false;},unsubscribeAll:function(p_type){return this.unsubscribe(p_type);},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{},events=this.__yui_events,ce;if(events[p_type]){}else{ce=new YAHOO.util.CustomEvent(p_type,opts.scope||this,opts.silent,YAHOO.util.CustomEvent.FLAT,opts.fireOnce);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].overrideContext);}}}return events[p_type];},fireEvent:function(p_type){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(!ce){return null;}var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}return ce.fire.apply(ce,args);},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}return false;}};(function(){var Event=YAHOO.util.Event,Lang=YAHOO.lang;YAHOO.util.KeyListener=function(attachTo,keyData,handler,event){if(!attachTo){}else{if(!keyData){}else{if(!handler){}}}if(!event){event=YAHOO.util.KeyListener.KEYDOWN;}var keyEvent=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(Lang.isString(attachTo)){attachTo=document.getElementById(attachTo);}if(Lang.isFunction(handler)){keyEvent.subscribe(handler);}else{keyEvent.subscribe(handler.fn,handler.scope,handler.correctScope);}function handleKeyPress(e,obj){if(!keyData.shift){keyData.shift=false;}if(!keyData.alt){keyData.alt=false;}if(!keyData.ctrl){keyData.ctrl=false;}if(e.shiftKey==keyData.shift&&e.altKey==keyData.alt&&e.ctrlKey==keyData.ctrl){var dataItem,keys=keyData.keys,key;if(YAHOO.lang.isArray(keys)){for(var i=0;i<keys.length;i++){dataItem=keys[i];key=Event.getCharCode(e);if(dataItem==key){keyEvent.fire(key,e);break;}}}else{key=Event.getCharCode(e);if(keys==key){keyEvent.fire(key,e);}}}}this.enable=function(){if(!this.enabled){Event.on(attachTo,event,handleKeyPress);this.enabledEvent.fire(keyData);}this.enabled=true;};this.disable=function(){if(this.enabled){Event.removeListener(attachTo,event,handleKeyPress);this.disabledEvent.fire(keyData);}this.enabled=false;};this.toString=function(){return"KeyListener ["+keyData.keys+"] "+attachTo.tagName+(attachTo.id?"["+attachTo.id+"]":"");};};var KeyListener=YAHOO.util.KeyListener;KeyListener.KEYDOWN="keydown";KeyListener.KEYUP="keyup";KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};})();YAHOO.register("event",YAHOO.util.Event,{version:"2.9.0",build:"2800"});
/*http://www.physiotherapyalberta.ca/portal_javascripts/build/cookie/cookie.js?original=1*/
YAHOO.namespace("util");YAHOO.util.Cookie={_createCookieString:function(name,value,encodeValue,options){var lang=YAHOO.lang,text=encodeURIComponent(name)+"="+(encodeValue?encodeURIComponent(value):value);if(lang.isObject(options)){if(options.expires instanceof Date){text+="; expires="+options.expires.toUTCString();}if(lang.isString(options.path)&&options.path!==""){text+="; path="+options.path;}if(lang.isString(options.domain)&&options.domain!==""){text+="; domain="+options.domain;}if(options.secure===true){text+="; secure";}}return text;},_createCookieHashString:function(hash){var lang=YAHOO.lang;if(!lang.isObject(hash)){throw new TypeError("Cookie._createCookieHashString(): Argument must be an object.");}var text=[];for(var key in hash){if(lang.hasOwnProperty(hash,key)&&!lang.isFunction(hash[key])&&!lang.isUndefined(hash[key])){text.push(encodeURIComponent(key)+"="+encodeURIComponent(String(hash[key])));}}return text.join("&");},_parseCookieHash:function(text){var hashParts=text.split("&"),hashPart=null,hash={};if(text.length>0){for(var i=0,len=hashParts.length;i<len;i++){hashPart=hashParts[i].split("=");hash[decodeURIComponent(hashPart[0])]=decodeURIComponent(hashPart[1]);}}return hash;},_parseCookieString:function(text,decode){var cookies={};if(YAHOO.lang.isString(text)&&text.length>0){var decodeValue=(decode===false?function(s){return s;}:decodeURIComponent);var cookieParts=text.split(/;\s/g),cookieName=null,cookieValue=null,cookieNameValue=null;for(var i=0,len=cookieParts.length;i<len;i++){cookieNameValue=cookieParts[i].match(/([^=]+)=/i);if(cookieNameValue instanceof Array){try{cookieName=decodeURIComponent(cookieNameValue[1]);cookieValue=decodeValue(cookieParts[i].substring(cookieNameValue[1].length+1));}catch(ex){}}else{cookieName=decodeURIComponent(cookieParts[i]);cookieValue="";}cookies[cookieName]=cookieValue;}}return cookies;},exists:function(name){if(!YAHOO.lang.isString(name)||name===""){throw new TypeError("Cookie.exists(): Cookie name must be a non-empty string.");}var cookies=this._parseCookieString(document.cookie,true);return cookies.hasOwnProperty(name);},get:function(name,options){var lang=YAHOO.lang,converter;if(lang.isFunction(options)){converter=options;options={};}else{if(lang.isObject(options)){converter=options.converter;}else{options={};}}var cookies=this._parseCookieString(document.cookie,!options.raw);if(!lang.isString(name)||name===""){throw new TypeError("Cookie.get(): Cookie name must be a non-empty string.");}if(lang.isUndefined(cookies[name])){return null;}if(!lang.isFunction(converter)){return cookies[name];}else{return converter(cookies[name]);}},getSub:function(name,subName,converter){var lang=YAHOO.lang,hash=this.getSubs(name);if(hash!==null){if(!lang.isString(subName)||subName===""){throw new TypeError("Cookie.getSub(): Subcookie name must be a non-empty string.");}if(lang.isUndefined(hash[subName])){return null;}if(!lang.isFunction(converter)){return hash[subName];}else{return converter(hash[subName]);}}else{return null;}},getSubs:function(name){var isString=YAHOO.lang.isString;if(!isString(name)||name===""){throw new TypeError("Cookie.getSubs(): Cookie name must be a non-empty string.");}var cookies=this._parseCookieString(document.cookie,false);if(isString(cookies[name])){return this._parseCookieHash(cookies[name]);}return null;},remove:function(name,options){if(!YAHOO.lang.isString(name)||name===""){throw new TypeError("Cookie.remove(): Cookie name must be a non-empty string.");}options=YAHOO.lang.merge(options||{},{expires:new Date(0)});return this.set(name,"",options);},removeSub:function(name,subName,options){var lang=YAHOO.lang;options=options||{};if(!lang.isString(name)||name===""){throw new TypeError("Cookie.removeSub(): Cookie name must be a non-empty string.");}if(!lang.isString(subName)||subName===""){throw new TypeError("Cookie.removeSub(): Subcookie name must be a non-empty string.");}var subs=this.getSubs(name);if(lang.isObject(subs)&&lang.hasOwnProperty(subs,subName)){delete subs[subName];if(!options.removeIfEmpty){return this.setSubs(name,subs,options);}else{for(var key in subs){if(lang.hasOwnProperty(subs,key)&&!lang.isFunction(subs[key])&&!lang.isUndefined(subs[key])){return this.setSubs(name,subs,options);}}return this.remove(name,options);}}else{return"";}},set:function(name,value,options){var lang=YAHOO.lang;options=options||{};if(!lang.isString(name)){throw new TypeError("Cookie.set(): Cookie name must be a string.");}if(lang.isUndefined(value)){throw new TypeError("Cookie.set(): Value cannot be undefined.");}var text=this._createCookieString(name,value,!options.raw,options);document.cookie=text;return text;},setSub:function(name,subName,value,options){var lang=YAHOO.lang;if(!lang.isString(name)||name===""){throw new TypeError("Cookie.setSub(): Cookie name must be a non-empty string.");}if(!lang.isString(subName)||subName===""){throw new TypeError("Cookie.setSub(): Subcookie name must be a non-empty string.");}if(lang.isUndefined(value)){throw new TypeError("Cookie.setSub(): Subcookie value cannot be undefined.");}var hash=this.getSubs(name);if(!lang.isObject(hash)){hash={};}hash[subName]=value;return this.setSubs(name,hash,options);},setSubs:function(name,value,options){var lang=YAHOO.lang;if(!lang.isString(name)){throw new TypeError("Cookie.setSubs(): Cookie name must be a string.");}if(!lang.isObject(value)){throw new TypeError("Cookie.setSubs(): Cookie value must be an object.");}var text=this._createCookieString(name,this._createCookieHashString(value),false,options);document.cookie=text;return text;}};YAHOO.register("cookie",YAHOO.util.Cookie,{version:"2.9.0",build:"2800"});
/*http://www.physiotherapyalberta.ca/portal_javascripts/build/animation/animation.js?original=1*/
(function(){var Y=YAHOO.util;var Anim=function(el,attributes,duration,method){if(!el){}this.init(el,attributes,duration,method);};Anim.NAME="Anim";Anim.prototype={toString:function(){var el=this.getEl()||{};var id=el.id||el.tagName;return(this.constructor.NAME+": "+id);},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(attr,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attr,val,unit){var el=this.getEl();if(this.patterns.noNegatives.test(attr)){val=(val>0)?val:0;}if(attr in el&&!("style" in el&&attr in el.style)){el[attr]=val;}else{Y.Dom.setStyle(el,attr,val+unit);}},getAttribute:function(attr){var el=this.getEl();var val=Y.Dom.getStyle(el,attr);if(val!=="auto"&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);}var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if("style" in el){if(box||(Y.Dom.getStyle(el,"position")=="absolute"&&pos)){val=el["offset"+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;}}else{if(attr in el){val=el[attr];}}return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return"px";}return"";},setRuntimeAttribute:function(attr){var start;var end;var attributes=this.attributes;this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=="undefined");};if(!isset(attributes[attr]["to"])&&!isset(attributes[attr]["by"])){return false;}start=(isset(attributes[attr]["from"]))?attributes[attr]["from"]:this.getAttribute(attr);if(isset(attributes[attr]["to"])){end=attributes[attr]["to"];}else{if(isset(attributes[attr]["by"])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]["by"][i]*1;}}else{end=start+attributes[attr]["by"]*1;}}}this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]["unit"]:this.getDefaultUnit(attr);return true;},init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var actualFrames=0;el=Y.Dom.get(el);this.attributes=attributes||{};this.duration=!YAHOO.lang.isUndefined(duration)?duration:1;this.method=method||Y.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=Y.AnimMgr.fps;this.setEl=function(element){el=Y.Dom.get(element);};this.getEl=function(){return el;};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(Y.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}Y.AnimMgr.registerElement(this);return true;};this.stop=function(finish){if(!this.isAnimated()){return false;}if(finish){this.currentFrame=this.totalFrames;this._onTween.fire();}Y.AnimMgr.stop(this);};this._handleStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var attr in this.attributes){if(this.attributes.hasOwnProperty(attr)){this.setRuntimeAttribute(attr);}}isAnimated=true;actualFrames=0;startTime=new Date();};this._handleTween=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){return("duration: "+data.duration+", currentFrame: "+data.currentFrame);};this.onTween.fire(data);var runtimeAttributes=this.runtimeAttributes;for(var attr in runtimeAttributes){if(runtimeAttributes.hasOwnProperty(attr)){this.setAttribute(attr,this.doMethod(attr,runtimeAttributes[attr].start,runtimeAttributes[attr].end),runtimeAttributes[attr].unit);}}this.afterTween.fire(data);actualFrames+=1;};this._handleComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return("duration: "+data.duration+", frames: "+data.frames+", fps: "+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new Y.CustomEvent("_start",this,true);this.onStart=new Y.CustomEvent("start",this);this.onTween=new Y.CustomEvent("tween",this);this.afterTween=new Y.CustomEvent("afterTween",this);this._onTween=new Y.CustomEvent("_tween",this,true);this.onComplete=new Y.CustomEvent("complete",this);this._onComplete=new Y.CustomEvent("_complete",this,true);this._onStart.subscribe(this._handleStart);this._onTween.subscribe(this._handleTween);this._onComplete.subscribe(this._handleComplete);}};Y.Anim=Anim;})();YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=1000;this.delay=20;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};var _unregisterQueue=[];var _unregistering=false;var doUnregister=function(){var next_args=_unregisterQueue.shift();unRegister.apply(YAHOO.util.AnimMgr,next_args);if(_unregisterQueue.length){arguments.callee();}};var unRegister=function(tween,index){index=index||getIndex(tween);if(!tween.isAnimated()||index===-1){return false;}tween._onComplete.fire();queue.splice(index,1);tweenCount-=1;if(tweenCount<=0){this.stop();}return true;};this.unRegister=function(){_unregisterQueue.push(arguments);if(!_unregistering){_unregistering=true;doUnregister();_unregistering=false;}};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){this.unRegister(queue[0],0);}queue=[];thread=null;tweenCount=0;}else{this.unRegister(tween);}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null){tween.currentFrame+=1;if(tween.useSeconds){correctFrame(tween);}tween._onTween.fire();}else{YAHOO.util.AnimMgr.stop(tween,i);}}};var getIndex=function(anim){for(var i=0,len=queue.length;i<len;++i){if(queue[i]===anim){return i;}}return -1;};var correctFrame=function(tween){var frames=tween.totalFrames;var frame=tween.currentFrame;var expected=(tween.currentFrame*tween.duration*1000/tween.totalFrames);var elapsed=(new Date()-tween.getStartTime());var tweak=0;if(elapsed<tween.duration*1000){tweak=Math.round((elapsed/expected-1)*tween.currentFrame);}else{tweak=frames-(frame+1);}if(tweak>0&&isFinite(tweak)){if(tween.currentFrame+tweak>=frames){tweak=frames-(frame+1);}tween.currentFrame+=tweak;}};this._queue=queue;this._getIndex=getIndex;};YAHOO.util.Bezier=new function(){this.getPosition=function(points,t){var n=points.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[points[i][0],points[i][1]];}for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}return[tmp[0][0],tmp[0][1]];};};(function(){var ColorAnim=function(el,attributes,duration,method){ColorAnim.superclass.constructor.call(this,el,attributes,duration,method);};ColorAnim.NAME="ColorAnim";ColorAnim.DEFAULT_BGCOLOR="#fff";var Y=YAHOO.util;YAHOO.extend(ColorAnim,Y.Anim);var superclass=ColorAnim.superclass;var proto=ColorAnim.prototype;proto.patterns.color=/color$/i;proto.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;proto.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;proto.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;proto.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;proto.parseColor=function(s){if(s.length==3){return s;}var c=this.patterns.hex.exec(s);if(c&&c.length==4){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}c=this.patterns.rgb.exec(s);if(c&&c.length==4){return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}c=this.patterns.hex3.exec(s);if(c&&c.length==4){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}return null;};proto.getAttribute=function(attr){var el=this.getEl();if(this.patterns.color.test(attr)){var val=YAHOO.util.Dom.getStyle(el,attr);var that=this;if(this.patterns.transparent.test(val)){var parent=YAHOO.util.Dom.getAncestorBy(el,function(node){return !that.patterns.transparent.test(val);});if(parent){val=Y.Dom.getStyle(parent,attr);}else{val=ColorAnim.DEFAULT_BGCOLOR;}}}else{val=superclass.getAttribute.call(this,attr);}return val;};proto.doMethod=function(attr,start,end){var val;if(this.patterns.color.test(attr)){val=[];for(var i=0,len=start.length;i<len;++i){val[i]=superclass.doMethod.call(this,attr,start[i],end[i]);}val="rgb("+Math.floor(val[0])+","+Math.floor(val[1])+","+Math.floor(val[2])+")";}else{val=superclass.doMethod.call(this,attr,start,end);}return val;};proto.setRuntimeAttribute=function(attr){superclass.setRuntimeAttribute.call(this,attr);if(this.patterns.color.test(attr)){var attributes=this.attributes;var start=this.parseColor(this.runtimeAttributes[attr].start);var end=this.parseColor(this.runtimeAttributes[attr].end);if(typeof attributes[attr]["to"]==="undefined"&&typeof attributes[attr]["by"]!=="undefined"){end=this.parseColor(attributes[attr].by);for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+end[i];}}this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;}};Y.ColorAnim=ColorAnim;})();
/*
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(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return -c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}return -c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return -c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}return -c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*0.3;}if(!a||a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}return -(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*0.3;}if(!a||a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0){return b;}if((t/=d/2)==2){return b+c;}if(!p){p=d*(0.3*1.5);}if(!a||a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}if(t<1){return -0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*0.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=="undefined"){s=1.70158;}return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=="undefined"){s=1.70158;}return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=="undefined"){s=1.70158;}if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;}return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-YAHOO.util.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else{if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+0.75)+b;}else{if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b;}}}return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b;},bounceBoth:function(t,b,c,d){if(t<d/2){return YAHOO.util.Easing.bounceIn(t*2,0,c,d)*0.5+b;}return YAHOO.util.Easing.bounceOut(t*2-d,0,c,d)*0.5+c*0.5+b;}};(function(){var Motion=function(el,attributes,duration,method){if(el){Motion.superclass.constructor.call(this,el,attributes,duration,method);}};Motion.NAME="Motion";var Y=YAHOO.util;YAHOO.extend(Motion,Y.ColorAnim);var superclass=Motion.superclass;var proto=Motion.prototype;proto.patterns.points=/^points$/i;proto.setAttribute=function(attr,val,unit){if(this.patterns.points.test(attr)){unit=unit||"px";superclass.setAttribute.call(this,"left",val[0],unit);superclass.setAttribute.call(this,"top",val[1],unit);}else{superclass.setAttribute.call(this,attr,val,unit);}};proto.getAttribute=function(attr){if(this.patterns.points.test(attr)){var val=[superclass.getAttribute.call(this,"left"),superclass.getAttribute.call(this,"top")];}else{val=superclass.getAttribute.call(this,attr);}return val;};proto.doMethod=function(attr,start,end){var val=null;if(this.patterns.points.test(attr)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;val=Y.Bezier.getPosition(this.runtimeAttributes[attr],t);}else{val=superclass.doMethod.call(this,attr,start,end);}return val;};proto.setRuntimeAttribute=function(attr){if(this.patterns.points.test(attr)){var el=this.getEl();var attributes=this.attributes;var start;var control=attributes.points["control"]||[];var end;var i,len;if(control.length>0&&!(control[0] instanceof Array)){control=[control];}else{var tmp=[];for(i=0,len=control.length;i<len;++i){tmp[i]=control[i];}control=tmp;}if(Y.Dom.getStyle(el,"position")=="static"){Y.Dom.setStyle(el,"position","relative");}if(isset(attributes.points["from"])){Y.Dom.setXY(el,attributes.points["from"]);}else{Y.Dom.setXY(el,Y.Dom.getXY(el));}start=this.getAttribute("points");if(isset(attributes.points["to"])){end=translateValues.call(this,attributes.points["to"],start);var pageXY=Y.Dom.getXY(this.getEl());for(i=0,len=control.length;i<len;++i){control[i]=translateValues.call(this,control[i],start);}}else{if(isset(attributes.points["by"])){end=[start[0]+attributes.points["by"][0],start[1]+attributes.points["by"][1]];for(i=0,len=control.length;i<len;++i){control[i]=[start[0]+control[i][0],start[1]+control[i][1]];}}}this.runtimeAttributes[attr]=[start];if(control.length>0){this.runtimeAttributes[attr]=this.runtimeAttributes[attr].concat(control);}this.runtimeAttributes[attr][this.runtimeAttributes[attr].length]=end;}else{superclass.setRuntimeAttribute.call(this,attr);}};var translateValues=function(val,start){var pageXY=Y.Dom.getXY(this.getEl());val=[val[0]-pageXY[0]+start[0],val[1]-pageXY[1]+start[1]];return val;};var isset=function(prop){return(typeof prop!=="undefined");};Y.Motion=Motion;})();(function(){var Scroll=function(el,attributes,duration,method){if(el){Scroll.superclass.constructor.call(this,el,attributes,duration,method);}};Scroll.NAME="Scroll";var Y=YAHOO.util;YAHOO.extend(Scroll,Y.ColorAnim);var superclass=Scroll.superclass;var proto=Scroll.prototype;proto.doMethod=function(attr,start,end){var val=null;if(attr=="scroll"){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=superclass.doMethod.call(this,attr,start,end);}return val;};proto.getAttribute=function(attr){var val=null;var el=this.getEl();if(attr=="scroll"){val=[el.scrollLeft,el.scrollTop];}else{val=superclass.getAttribute.call(this,attr);}return val;};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=="scroll"){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};Y.Scroll=Scroll;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.9.0",build:"2800"});
/*http://www.physiotherapyalberta.ca/portal_javascripts/build/container/container.js?original=1*/
(function(){YAHOO.util.Config=function(owner){if(owner){this.init(owner);}};var Lang=YAHOO.lang,CustomEvent=YAHOO.util.CustomEvent,Config=YAHOO.util.Config;Config.CONFIG_CHANGED_EVENT="configChanged";Config.BOOLEAN_TYPE="boolean";Config.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(owner){this.owner=owner;this.configChangedEvent=this.createEvent(Config.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=CustomEvent.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(val){return(typeof val==Config.BOOLEAN_TYPE);},checkNumber:function(val){return(!isNaN(val));},fireEvent:function(key,value){var property=this.config[key];if(property&&property.event){property.event.fire(value);}},addProperty:function(key,propertyObject){key=key.toLowerCase();this.config[key]=propertyObject;propertyObject.event=this.createEvent(key,{scope:this.owner});propertyObject.event.signature=CustomEvent.LIST;propertyObject.key=key;if(propertyObject.handler){propertyObject.event.subscribe(propertyObject.handler,this.owner);}this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}},getConfig:function(){var cfg={},currCfg=this.config,prop,property;for(prop in currCfg){if(Lang.hasOwnProperty(currCfg,prop)){property=currCfg[prop];if(property&&property.event){cfg[prop]=property.value;}}}return cfg;},getProperty:function(key){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.value;}else{return undefined;}},resetProperty:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event){if(key in this.initialConfig){this.setProperty(key,this.initialConfig[key]);return true;}}else{return false;}},setProperty:function(key,value,silent){var property;key=key.toLowerCase();if(this.queueInProgress&&!silent){this.queueProperty(key,value);return true;}else{property=this.config[key];if(property&&property.event){if(property.validator&&!property.validator(value)){return false;}else{property.value=value;if(!silent){this.fireEvent(key,value);this.configChangedEvent.fire([key,value]);}return true;}}else{return false;}}},queueProperty:function(key,value){key=key.toLowerCase();var property=this.config[key],foundDuplicate=false,iLen,queueItem,queueItemKey,queueItemValue,sLen,supercedesCheck,qLen,queueItemCheck,queueItemCheckKey,queueItemCheckValue,i,s,q;if(property&&property.event){if(!Lang.isUndefined(value)&&property.validator&&!property.validator(value)){return false;}else{if(!Lang.isUndefined(value)){property.value=value;}else{value=property.value;}foundDuplicate=false;iLen=this.eventQueue.length;for(i=0;i<iLen;i++){queueItem=this.eventQueue[i];if(queueItem){queueItemKey=queueItem[0];queueItemValue=queueItem[1];if(queueItemKey==key){this.eventQueue[i]=null;this.eventQueue.push([key,(!Lang.isUndefined(value)?value:queueItemValue)]);foundDuplicate=true;break;}}}if(!foundDuplicate&&!Lang.isUndefined(value)){this.eventQueue.push([key,value]);}}if(property.supercedes){sLen=property.supercedes.length;for(s=0;s<sLen;s++){supercedesCheck=property.supercedes[s];qLen=this.eventQueue.length;for(q=0;q<qLen;q++){queueItemCheck=this.eventQueue[q];if(queueItemCheck){queueItemCheckKey=queueItemCheck[0];queueItemCheckValue=queueItemCheck[1];if(queueItemCheckKey==supercedesCheck.toLowerCase()){this.eventQueue.push([queueItemCheckKey,queueItemCheckValue]);this.eventQueue[q]=null;break;}}}}}return true;}else{return false;}},refireEvent:function(key){key=key.toLowerCase();var property=this.config[key];if(property&&property.event&&!Lang.isUndefined(property.value)){if(this.queueInProgress){this.queueProperty(key);}else{this.fireEvent(key,property.value);}}},applyConfig:function(userConfig,init){var sKey,oConfig;if(init){oConfig={};for(sKey in userConfig){if(Lang.hasOwnProperty(userConfig,sKey)){oConfig[sKey.toLowerCase()]=userConfig[sKey];}}this.initialConfig=oConfig;}for(sKey in userConfig){if(Lang.hasOwnProperty(userConfig,sKey)){this.queueProperty(sKey,userConfig[sKey]);}}},refresh:function(){var prop;for(prop in this.config){if(Lang.hasOwnProperty(this.config,prop)){this.refireEvent(prop);}}},fireQueue:function(){var i,queueItem,key,value,property;this.queueInProgress=true;for(i=0;i<this.eventQueue.length;i++){queueItem=this.eventQueue[i];if(queueItem){key=queueItem[0];value=queueItem[1];property=this.config[key];property.value=value;this.eventQueue[i]=null;this.fireEvent(key,value);}}this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(key,handler,obj,overrideContext){var property=this.config[key.toLowerCase()];if(property&&property.event){if(!Config.alreadySubscribed(property.event,handler,obj)){property.event.subscribe(handler,obj,overrideContext);}return true;}else{return false;}},unsubscribeFromConfigEvent:function(key,handler,obj){var property=this.config[key.toLowerCase()];if(property&&property.event){return property.event.unsubscribe(handler,obj);}else{return false;}},toString:function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}return output;},outputEventQueue:function(){var output="",queueItem,q,nQueue=this.eventQueue.length;for(q=0;q<nQueue;q++){queueItem=this.eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}return output;},destroy:function(){var oConfig=this.config,sProperty,oProperty;for(sProperty in oConfig){if(Lang.hasOwnProperty(oConfig,sProperty)){oProperty=oConfig[sProperty];oProperty.event.unsubscribeAll();oProperty.event=null;}}this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};Config.alreadySubscribed=function(evt,fn,obj){var nSubscribers=evt.subscribers.length,subsc,i;if(nSubscribers>0){i=nSubscribers-1;do{subsc=evt.subscribers[i];if(subsc&&subsc.obj==obj&&subsc.fn==fn){return true;}}while(i--);}return false;};YAHOO.lang.augmentProto(Config,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}else{}};var Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,Event=YAHOO.util.Event,CustomEvent=YAHOO.util.CustomEvent,Module=YAHOO.widget.Module,UA=YAHOO.env.ua,m_oModuleTemplate,m_oHeaderTemplate,m_oBodyTemplate,m_oFooterTemplate,EVENT_TYPES={BEFORE_INIT:"beforeInit",INIT:"init",APPEND:"append",BEFORE_RENDER:"beforeRender",RENDER:"render",CHANGE_HEADER:"changeHeader",CHANGE_BODY:"changeBody",CHANGE_FOOTER:"changeFooter",CHANGE_CONTENT:"changeContent",DESTROY:"destroy",BEFORE_SHOW:"beforeShow",SHOW:"show",BEFORE_HIDE:"beforeHide",HIDE:"hide"},DEFAULT_CONFIG={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}};Module.IMG_ROOT=null;Module.IMG_ROOT_SSL=null;Module.CSS_MODULE="yui-module";Module.CSS_HEADER="hd";Module.CSS_BODY="bd";Module.CSS_FOOTER="ft";Module.RESIZE_MONITOR_SECURE_URL="javascript:false;";Module.RESIZE_MONITOR_BUFFER=1;Module.textResizeEvent=new CustomEvent("textResize");Module.forceDocumentRedraw=function(){var docEl=document.documentElement;if(docEl){docEl.className+=" ";docEl.className=YAHOO.lang.trim(docEl.className);}};function createModuleTemplate(){if(!m_oModuleTemplate){m_oModuleTemplate=document.createElement("div");m_oModuleTemplate.innerHTML=('<div class="'+Module.CSS_HEADER+'"></div><div class="'+Module.CSS_BODY+'"></div><div class="'+Module.CSS_FOOTER+'"></div>');m_oHeaderTemplate=m_oModuleTemplate.firstChild;m_oBodyTemplate=m_oHeaderTemplate.nextSibling;m_oFooterTemplate=m_oBodyTemplate.nextSibling;}return m_oModuleTemplate;}function createHeader(){if(!m_oHeaderTemplate){createModuleTemplate();}return(m_oHeaderTemplate.cloneNode(false));}function createBody(){if(!m_oBodyTemplate){createModuleTemplate();}return(m_oBodyTemplate.cloneNode(false));}function createFooter(){if(!m_oFooterTemplate){createModuleTemplate();}return(m_oFooterTemplate.cloneNode(false));}Module.prototype={constructor:Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:Module.IMG_ROOT,initEvents:function(){var SIGNATURE=CustomEvent.LIST;this.beforeInitEvent=this.createEvent(EVENT_TYPES.BEFORE_INIT);this.beforeInitEvent.signature=SIGNATURE;this.initEvent=this.createEvent(EVENT_TYPES.INIT);this.initEvent.signature=SIGNATURE;this.appendEvent=this.createEvent(EVENT_TYPES.APPEND);this.appendEvent.signature=SIGNATURE;this.beforeRenderEvent=this.createEvent(EVENT_TYPES.BEFORE_RENDER);this.beforeRenderEvent.signature=SIGNATURE;this.renderEvent=this.createEvent(EVENT_TYPES.RENDER);this.renderEvent.signature=SIGNATURE;this.changeHeaderEvent=this.createEvent(EVENT_TYPES.CHANGE_HEADER);this.changeHeaderEvent.signature=SIGNATURE;this.changeBodyEvent=this.createEvent(EVENT_TYPES.CHANGE_BODY);this.changeBodyEvent.signature=SIGNATURE;this.changeFooterEvent=this.createEvent(EVENT_TYPES.CHANGE_FOOTER);this.changeFooterEvent.signature=SIGNATURE;this.changeContentEvent=this.createEvent(EVENT_TYPES.CHANGE_CONTENT);this.changeContentEvent.signature=SIGNATURE;this.destroyEvent=this.createEvent(EVENT_TYPES.DESTROY);this.destroyEvent.signature=SIGNATURE;this.beforeShowEvent=this.createEvent(EVENT_TYPES.BEFORE_SHOW);this.beforeShowEvent.signature=SIGNATURE;this.showEvent=this.createEvent(EVENT_TYPES.SHOW);this.showEvent.signature=SIGNATURE;this.beforeHideEvent=this.createEvent(EVENT_TYPES.BEFORE_HIDE);this.beforeHideEvent.signature=SIGNATURE;this.hideEvent=this.createEvent(EVENT_TYPES.HIDE);this.hideEvent.signature=SIGNATURE;},platform:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1){return"windows";}else{if(ua.indexOf("macintosh")!=-1){return"mac";}else{return false;}}}(),browser:function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("opera")!=-1){return"opera";}else{if(ua.indexOf("msie 7")!=-1){return"ie7";}else{if(ua.indexOf("msie")!=-1){return"ie";}else{if(ua.indexOf("safari")!=-1){return"safari";}else{if(ua.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(DEFAULT_CONFIG.VISIBLE.key,{handler:this.configVisible,value:DEFAULT_CONFIG.VISIBLE.value,validator:DEFAULT_CONFIG.VISIBLE.validator});this.cfg.addProperty(DEFAULT_CONFIG.EFFECT.key,{handler:this.configEffect,suppressEvent:DEFAULT_CONFIG.EFFECT.suppressEvent,supercedes:DEFAULT_CONFIG.EFFECT.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.MONITOR_RESIZE.key,{handler:this.configMonitorResize,value:DEFAULT_CONFIG.MONITOR_RESIZE.value});this.cfg.addProperty(DEFAULT_CONFIG.APPEND_TO_DOCUMENT_BODY.key,{value:DEFAULT_CONFIG.APPEND_TO_DOCUMENT_BODY.value});},init:function(el,userConfig){var elId,child;this.initEvents();this.beforeInitEvent.fire(Module);this.cfg=new Config(this);if(this.isSecure){this.imageRoot=Module.IMG_ROOT_SSL;}if(typeof el=="string"){elId=el;el=document.getElementById(el);if(!el){el=(createModuleTemplate()).cloneNode(false);el.id=elId;}}this.id=Dom.generateId(el);this.element=el;child=this.element.firstChild;if(child){var fndHd=false,fndBd=false,fndFt=false;do{if(1==child.nodeType){if(!fndHd&&Dom.hasClass(child,Module.CSS_HEADER)){this.header=child;fndHd=true;}else{if(!fndBd&&Dom.hasClass(child,Module.CSS_BODY)){this.body=child;fndBd=true;}else{if(!fndFt&&Dom.hasClass(child,Module.CSS_FOOTER)){this.footer=child;fndFt=true;}}}}}while((child=child.nextSibling));}this.initDefaultConfig();Dom.addClass(this.element,Module.CSS_MODULE);if(userConfig){this.cfg.applyConfig(userConfig,true);}if(!Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}this.initEvent.fire(Module);},initResizeMonitor:function(){var isGeckoWin=(UA.gecko&&this.platform=="windows");if(isGeckoWin){var self=this;setTimeout(function(){self._initResizeMonitor();},0);}else{this._initResizeMonitor();}},_initResizeMonitor:function(){var oDoc,oIFrame,sHTML;function fireTextResize(){Module.textResizeEvent.fire();}if(!UA.opera){oIFrame=Dom.get("_yuiResizeMonitor");var supportsCWResize=this._supportsCWResize();if(!oIFrame){oIFrame=document.createElement("iframe");if(this.isSecure&&Module.RESIZE_MONITOR_SECURE_URL&&UA.ie){oIFrame.src=Module.RESIZE_MONITOR_SECURE_URL;}if(!supportsCWResize){sHTML=["<html><head><script ",'type="text/javascript">',"window.onresize=function(){window.parent.","YAHOO.widget.Module.textResizeEvent.","fire();};<","/script></head>","<body></body></html>"].join("");oIFrame.src="data:text/html;charset=utf-8,"+encodeURIComponent(sHTML);}oIFrame.id="_yuiResizeMonitor";oIFrame.title="Text Resize Monitor";oIFrame.tabIndex=-1;oIFrame.setAttribute("role","presentation");oIFrame.style.position="absolute";oIFrame.style.visibility="hidden";var db=document.body,fc=db.firstChild;if(fc){db.insertBefore(oIFrame,fc);}else{db.appendChild(oIFrame);}oIFrame.style.backgroundColor="transparent";oIFrame.style.borderWidth="0";oIFrame.style.width="2em";oIFrame.style.height="2em";oIFrame.style.left="0";oIFrame.style.top=(-1*(oIFrame.offsetHeight+Module.RESIZE_MONITOR_BUFFER))+"px";oIFrame.style.visibility="visible";if(UA.webkit){oDoc=oIFrame.contentWindow.document;oDoc.open();oDoc.close();}}if(oIFrame&&oIFrame.contentWindow){Module.textResizeEvent.subscribe(this.onDomResize,this,true);if(!Module.textResizeInitialized){if(supportsCWResize){if(!Event.on(oIFrame.contentWindow,"resize",fireTextResize)){Event.on(oIFrame,"resize",fireTextResize);}}Module.textResizeInitialized=true;}this.resizeMonitor=oIFrame;}}},_supportsCWResize:function(){var bSupported=true;if(UA.gecko&&UA.gecko<=1.8){bSupported=false;}return bSupported;},onDomResize:function(e,obj){var nTop=-1*(this.resizeMonitor.offsetHeight+Module.RESIZE_MONITOR_BUFFER);this.resizeMonitor.style.top=nTop+"px";this.resizeMonitor.style.left="0";},setHeader:function(headerContent){var oHeader=this.header||(this.header=createHeader());if(headerContent.nodeName){oHeader.innerHTML="";oHeader.appendChild(headerContent);}else{oHeader.innerHTML=headerContent;}if(this._rendered){this._renderHeader();}this.changeHeaderEvent.fire(headerContent);this.changeContentEvent.fire();},appendToHeader:function(element){var oHeader=this.header||(this.header=createHeader());oHeader.appendChild(element);this.changeHeaderEvent.fire(element);this.changeContentEvent.fire();},setBody:function(bodyContent){var oBody=this.body||(this.body=createBody());if(bodyContent.nodeName){oBody.innerHTML="";oBody.appendChild(bodyContent);}else{oBody.innerHTML=bodyContent;}if(this._rendered){this._renderBody();}this.changeBodyEvent.fire(bodyContent);this.changeContentEvent.fire();},appendToBody:function(element){var oBody=this.body||(this.body=createBody());oBody.appendChild(element);this.changeBodyEvent.fire(element);this.changeContentEvent.fire();},setFooter:function(footerContent){var oFooter=this.footer||(this.footer=createFooter());if(footerContent.nodeName){oFooter.innerHTML="";oFooter.appendChild(footerContent);}else{oFooter.innerHTML=footerContent;}if(this._rendered){this._renderFooter();}this.changeFooterEvent.fire(footerContent);this.changeContentEvent.fire();},appendToFooter:function(element){var oFooter=this.footer||(this.footer=createFooter());oFooter.appendChild(element);this.changeFooterEvent.fire(element);this.changeContentEvent.fire();},render:function(appendToNode,moduleElement){var me=this;function appendTo(parentNode){if(typeof parentNode=="string"){parentNode=document.getElementById(parentNode);}if(parentNode){me._addToParent(parentNode,me.element);me.appendEvent.fire();}}this.beforeRenderEvent.fire();if(!moduleElement){moduleElement=this.element;}if(appendToNode){appendTo(appendToNode);}else{if(!Dom.inDocument(this.element)){return false;}}this._renderHeader(moduleElement);this._renderBody(moduleElement);this._renderFooter(moduleElement);this._rendered=true;this.renderEvent.fire();return true;},_renderHeader:function(moduleElement){moduleElement=moduleElement||this.element;if(this.header&&!Dom.inDocument(this.header)){var firstChild=moduleElement.firstChild;if(firstChild){moduleElement.insertBefore(this.header,firstChild);}else{moduleElement.appendChild(this.header);}}},_renderBody:function(moduleElement){moduleElement=moduleElement||this.element;if(this.body&&!Dom.inDocument(this.body)){if(this.footer&&Dom.isAncestor(moduleElement,this.footer)){moduleElement.insertBefore(this.body,this.footer);}else{moduleElement.appendChild(this.body);}}},_renderFooter:function(moduleElement){moduleElement=moduleElement||this.element;if(this.footer&&!Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}},destroy:function(shallowPurge){var parent,purgeChildren=!(shallowPurge);if(this.element){Event.purgeElement(this.element,purgeChildren);parent=this.element.parentNode;}if(parent){parent.removeChild(this.element);}this.element=null;this.header=null;this.body=null;this.footer=null;Module.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(type,args,obj){var visible=args[0];if(visible){if(this.beforeShowEvent.fire()){Dom.setStyle(this.element,"display","block");this.showEvent.fire();}}else{if(this.beforeHideEvent.fire()){Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}}},configEffect:function(type,args,obj){this._cachedEffects=(this.cacheEffects)?this._createEffects(args[0]):null;},cacheEffects:true,_createEffects:function(effectCfg){var effectInstances=null,n,i,eff;if(effectCfg){if(effectCfg instanceof Array){effectInstances=[];n=effectCfg.length;for(i=0;i<n;i++){eff=effectCfg[i];if(eff.effect){effectInstances[effectInstances.length]=eff.effect(this,eff.duration);}}}else{if(effectCfg.effect){effectInstances=[effectCfg.effect(this,effectCfg.duration)];}}}return effectInstances;},configMonitorResize:function(type,args,obj){var monitor=args[0];if(monitor){this.initResizeMonitor();}else{Module.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}},_addToParent:function(parentNode,element){if(!this.cfg.getProperty("appendtodocumentbody")&&parentNode===document.body&&parentNode.firstChild){parentNode.insertBefore(element,parentNode.firstChild);}else{parentNode.appendChild(element);}},toString:function(){return"Module "+this.id;}};YAHOO.lang.augmentProto(Module,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};var Lang=YAHOO.lang,CustomEvent=YAHOO.util.CustomEvent,Module=YAHOO.widget.Module,Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,UA=YAHOO.env.ua,Overlay=YAHOO.widget.Overlay,_SUBSCRIBE="subscribe",_UNSUBSCRIBE="unsubscribe",_CONTAINED="contained",m_oIFrameTemplate,EVENT_TYPES={BEFORE_MOVE:"beforeMove",MOVE:"move"},DEFAULT_CONFIG={X:{key:"x",validator:Lang.isNumber,suppressEvent:true,supercedes:["iframe"]},Y:{key:"y",validator:Lang.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:Lang.isBoolean,supercedes:["iframe","x","y","xy"]},IFRAME:{key:"iframe",value:(UA.ie==6?true:false),validator:Lang.isBoolean,supercedes:["zindex"]},PREVENT_CONTEXT_OVERLAP:{key:"preventcontextoverlap",value:false,validator:Lang.isBoolean,supercedes:["constraintoviewport"]}};Overlay.IFRAME_SRC="javascript:false;";Overlay.IFRAME_OFFSET=3;Overlay.VIEWPORT_OFFSET=10;Overlay.TOP_LEFT="tl";Overlay.TOP_RIGHT="tr";Overlay.BOTTOM_LEFT="bl";Overlay.BOTTOM_RIGHT="br";Overlay.PREVENT_OVERLAP_X={tltr:true,blbr:true,brbl:true,trtl:true};Overlay.PREVENT_OVERLAP_Y={trbr:true,tlbl:true,bltl:true,brtr:true};Overlay.CSS_OVERLAY="yui-overlay";Overlay.CSS_HIDDEN="yui-overlay-hidden";Overlay.CSS_IFRAME="yui-overlay-iframe";Overlay.STD_MOD_RE=/^\s*?(body|footer|header)\s*?$/i;Overlay.windowScrollEvent=new CustomEvent("windowScroll");Overlay.windowResizeEvent=new CustomEvent("windowResize");Overlay.windowScrollHandler=function(e){var t=Event.getTarget(e);if(!t||t===window||t===window.document){if(UA.ie){if(!window.scrollEnd){window.scrollEnd=-1;}clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){Overlay.windowScrollEvent.fire();},1);}else{Overlay.windowScrollEvent.fire();}}};Overlay.windowResizeHandler=function(e){if(UA.ie){if(!window.resizeEnd){window.resizeEnd=-1;}clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){Overlay.windowResizeEvent.fire();},100);}else{Overlay.windowResizeEvent.fire();}};Overlay._initialized=null;if(Overlay._initialized===null){Event.on(window,"scroll",Overlay.windowScrollHandler);Event.on(window,"resize",Overlay.windowResizeHandler);Overlay._initialized=true;}Overlay._TRIGGER_MAP={windowScroll:Overlay.windowScrollEvent,windowResize:Overlay.windowResizeEvent,textResize:Module.textResizeEvent};YAHOO.extend(Overlay,Module,{CONTEXT_TRIGGERS:[],init:function(el,userConfig){Overlay.superclass.init.call(this,el);this.beforeInitEvent.fire(Overlay);Dom.addClass(this.element,Overlay.CSS_OVERLAY);if(userConfig){this.cfg.applyConfig(userConfig,true);}if(this.platform=="mac"&&UA.gecko){if(!Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}if(!Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}this.initEvent.fire(Overlay);},initEvents:function(){Overlay.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.beforeMoveEvent=this.createEvent(EVENT_TYPES.BEFORE_MOVE);this.beforeMoveEvent.signature=SIGNATURE;this.moveEvent=this.createEvent(EVENT_TYPES.MOVE);this.moveEvent.signature=SIGNATURE;},initDefaultConfig:function(){Overlay.superclass.initDefaultConfig.call(this);var cfg=this.cfg;cfg.addProperty(DEFAULT_CONFIG.X.key,{handler:this.configX,validator:DEFAULT_CONFIG.X.validator,suppressEvent:DEFAULT_CONFIG.X.suppressEvent,supercedes:DEFAULT_CONFIG.X.supercedes});cfg.addProperty(DEFAULT_CONFIG.Y.key,{handler:this.configY,validator:DEFAULT_CONFIG.Y.validator,suppressEvent:DEFAULT_CONFIG.Y.suppressEvent,supercedes:DEFAULT_CONFIG.Y.supercedes});cfg.addProperty(DEFAULT_CONFIG.XY.key,{handler:this.configXY,suppressEvent:DEFAULT_CONFIG.XY.suppressEvent,supercedes:DEFAULT_CONFIG.XY.supercedes});cfg.addProperty(DEFAULT_CONFIG.CONTEXT.key,{handler:this.configContext,suppressEvent:DEFAULT_CONFIG.CONTEXT.suppressEvent,supercedes:DEFAULT_CONFIG.CONTEXT.supercedes});cfg.addProperty(DEFAULT_CONFIG.FIXED_CENTER.key,{handler:this.configFixedCenter,value:DEFAULT_CONFIG.FIXED_CENTER.value,validator:DEFAULT_CONFIG.FIXED_CENTER.validator,supercedes:DEFAULT_CONFIG.FIXED_CENTER.supercedes});cfg.addProperty(DEFAULT_CONFIG.WIDTH.key,{handler:this.configWidth,suppressEvent:DEFAULT_CONFIG.WIDTH.suppressEvent,supercedes:DEFAULT_CONFIG.WIDTH.supercedes});cfg.addProperty(DEFAULT_CONFIG.HEIGHT.key,{handler:this.configHeight,suppressEvent:DEFAULT_CONFIG.HEIGHT.suppressEvent,supercedes:DEFAULT_CONFIG.HEIGHT.supercedes});cfg.addProperty(DEFAULT_CONFIG.AUTO_FILL_HEIGHT.key,{handler:this.configAutoFillHeight,value:DEFAULT_CONFIG.AUTO_FILL_HEIGHT.value,validator:this._validateAutoFill,supercedes:DEFAULT_CONFIG.AUTO_FILL_HEIGHT.supercedes});cfg.addProperty(DEFAULT_CONFIG.ZINDEX.key,{handler:this.configzIndex,value:DEFAULT_CONFIG.ZINDEX.value});cfg.addProperty(DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.value,validator:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.validator,supercedes:DEFAULT_CONFIG.CONSTRAIN_TO_VIEWPORT.supercedes});cfg.addProperty(DEFAULT_CONFIG.IFRAME.key,{handler:this.configIframe,value:DEFAULT_CONFIG.IFRAME.value,validator:DEFAULT_CONFIG.IFRAME.validator,supercedes:DEFAULT_CONFIG.IFRAME.supercedes});cfg.addProperty(DEFAULT_CONFIG.PREVENT_CONTEXT_OVERLAP.key,{value:DEFAULT_CONFIG.PREVENT_CONTEXT_OVERLAP.value,validator:DEFAULT_CONFIG.PREVENT_CONTEXT_OVERLAP.validator,supercedes:DEFAULT_CONFIG.PREVENT_CONTEXT_OVERLAP.supercedes});},moveTo:function(x,y){this.cfg.setProperty("xy",[x,y]);},hideMacGeckoScrollbars:function(){Dom.replaceClass(this.element,"show-scrollbars","hide-scrollbars");},showMacGeckoScrollbars:function(){Dom.replaceClass(this.element,"hide-scrollbars","show-scrollbars");},_setDomVisibility:function(show){Dom.setStyle(this.element,"visibility",(show)?"visible":"hidden");var hiddenClass=Overlay.CSS_HIDDEN;if(show){Dom.removeClass(this.element,hiddenClass);}else{Dom.addClass(this.element,hiddenClass);}},configVisible:function(type,args,obj){var visible=args[0],currentVis=Dom.getStyle(this.element,"visibility"),effects=this._cachedEffects||this._createEffects(this.cfg.getProperty("effect")),isMacGecko=(this.platform=="mac"&&UA.gecko),alreadySubscribed=Config.alreadySubscribed,ei,e,j,k,h,nEffectInstances;if(currentVis=="inherit"){e=this.element.parentNode;while(e.nodeType!=9&&e.nodeType!=11){currentVis=Dom.getStyle(e,"visibility");if(currentVis!="inherit"){break;}e=e.parentNode;}if(currentVis=="inherit"){currentVis="visible";}}if(visible){if(isMacGecko){this.showMacGeckoScrollbars();}if(effects){if(visible){if(currentVis!="visible"||currentVis===""||this._fadingOut){if(this.beforeShowEvent.fire()){nEffectInstances=effects.length;for(j=0;j<nEffectInstances;j++){ei=effects[j];if(j===0&&!alreadySubscribed(ei.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){ei.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}ei.animateIn();}}}}}else{if(currentVis!="visible"||currentVis===""){if(this.beforeShowEvent.fire()){this._setDomVisibility(true);this.cfg.refireEvent("iframe");this.showEvent.fire();}}else{this._setDomVisibility(true);}}}else{if(isMacGecko){this.hideMacGeckoScrollbars();}if(effects){if(currentVis=="visible"||this._fadingIn){if(this.beforeHideEvent.fire()){nEffectInstances=effects.length;for(k=0;k<nEffectInstances;k++){h=effects[k];if(k===0&&!alreadySubscribed(h.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){h.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}h.animateOut();}}}else{if(currentVis===""){this._setDomVisibility(false);}}}else{if(currentVis=="visible"||currentVis===""){if(this.beforeHideEvent.fire()){this._setDomVisibility(false);this.hideEvent.fire();}}else{this._setDomVisibility(false);}}}},doCenterOnDOMEvent:function(){var cfg=this.cfg,fc=cfg.getProperty("fixedcenter");if(cfg.getProperty("visible")){if(fc&&(fc!==_CONTAINED||this.fitsInViewport())){this.center();}}},fitsInViewport:function(){var nViewportOffset=Overlay.VIEWPORT_OFFSET,element=this.element,elementWidth=element.offsetWidth,elementHeight=element.offsetHeight,viewportWidth=Dom.getViewportWidth(),viewportHeight=Dom.getViewportHeight();return((elementWidth+nViewportOffset<viewportWidth)&&(elementHeight+nViewportOffset<viewportHeight));},configFixedCenter:function(type,args,obj){var val=args[0],alreadySubscribed=Config.alreadySubscribed,windowResizeEvent=Overlay.windowResizeEvent,windowScrollEvent=Overlay.windowScrollEvent;if(val){this.center();if(!alreadySubscribed(this.beforeShowEvent,this.center)){this.beforeShowEvent.subscribe(this.center);}if(!alreadySubscribed(windowResizeEvent,this.doCenterOnDOMEvent,this)){windowResizeEvent.subscribe(this.doCenterOnDOMEvent,this,true);}if(!alreadySubscribed(windowScrollEvent,this.doCenterOnDOMEvent,this)){windowScrollEvent.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(type,args,obj){var height=args[0],el=this.element;Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");},configAutoFillHeight:function(type,args,obj){var fillEl=args[0],cfg=this.cfg,autoFillHeight="autofillheight",height="height",currEl=cfg.getProperty(autoFillHeight),autoFill=this._autoFillOnHeightChange;cfg.unsubscribeFromConfigEvent(height,autoFill);Module.textResizeEvent.unsubscribe(autoFill);this.changeContentEvent.unsubscribe(autoFill);if(currEl&&fillEl!==currEl&&this[currEl]){Dom.setStyle(this[currEl],height,"");}if(fillEl){fillEl=Lang.trim(fillEl.toLowerCase());cfg.subscribeToConfigEvent(height,autoFill,this[fillEl],this);Module.textResizeEvent.subscribe(autoFill,this[fillEl],this);this.changeContentEvent.subscribe(autoFill,this[fillEl],this);cfg.setProperty(autoFillHeight,fillEl,true);}},configWidth:function(type,args,obj){var width=args[0],el=this.element;Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");},configzIndex:function(type,args,obj){var zIndex=args[0],el=this.element;if(!zIndex){zIndex=Dom.getStyle(el,"zIndex");if(!zIndex||isNaN(zIndex)){zIndex=0;}}if(this.iframe||this.cfg.getProperty("iframe")===true){if(zIndex<=0){zIndex=1;}}Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);if(this.iframe){this.stackIframe();}},configXY:function(type,args,obj){var pos=args[0],x=pos[0],y=pos[1];this.cfg.setProperty("x",x);this.cfg.setProperty("y",y);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},configX:function(type,args,obj){var x=args[0],y=this.cfg.getProperty("y");this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");Dom.setX(this.element,x,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},configY:function(type,args,obj){var x=this.cfg.getProperty("x"),y=args[0];this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.beforeMoveEvent.fire([x,y]);x=this.cfg.getProperty("x");y=this.cfg.getProperty("y");Dom.setY(this.element,y,true);this.cfg.setProperty("xy",[x,y],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([x,y]);},showIframe:function(){var oIFrame=this.iframe,oParentNode;if(oIFrame){oParentNode=this.element.parentNode;if(oParentNode!=oIFrame.parentNode){this._addToParent(oParentNode,oIFrame);}oIFrame.style.display="block";}},hideIframe:function(){if(this.iframe){this.iframe.style.display="none";}},syncIframe:function(){var oIFrame=this.iframe,oElement=this.element,nOffset=Overlay.IFRAME_OFFSET,nDimensionOffset=(nOffset*2),aXY;if(oIFrame){oIFrame.style.width=(oElement.offsetWidth+nDimensionOffset+"px");oIFrame.style.height=(oElement.offsetHeight+nDimensionOffset+"px");aXY=this.cfg.getProperty("xy");if(!Lang.isArray(aXY)||(isNaN(aXY[0])||isNaN(aXY[1]))){this.syncPosition();aXY=this.cfg.getProperty("xy");}Dom.setXY(oIFrame,[(aXY[0]-nOffset),(aXY[1]-nOffset)]);}},stackIframe:function(){if(this.iframe){var overlayZ=Dom.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(overlayZ)&&!isNaN(overlayZ)){Dom.setStyle(this.iframe,"zIndex",(overlayZ-1));}}},configIframe:function(type,args,obj){var bIFrame=args[0];function createIFrame(){var oIFrame=this.iframe,oElement=this.element,oParent;if(!oIFrame){if(!m_oIFrameTemplate){m_oIFrameTemplate=document.createElement("iframe");if(this.isSecure){m_oIFrameTemplate.src=Overlay.IFRAME_SRC;}if(UA.ie){m_oIFrameTemplate.style.filter="alpha(opacity=0)";m_oIFrameTemplate.frameBorder=0;}else{m_oIFrameTemplate.style.opacity="0";}m_oIFrameTemplate.style.position="absolute";m_oIFrameTemplate.style.border="none";m_oIFrameTemplate.style.margin="0";m_oIFrameTemplate.style.padding="0";m_oIFrameTemplate.style.display="none";m_oIFrameTemplate.tabIndex=-1;m_oIFrameTemplate.className=Overlay.CSS_IFRAME;}oIFrame=m_oIFrameTemplate.cloneNode(false);oIFrame.id=this.id+"_f";oParent=oElement.parentNode;var parentNode=oParent||document.body;this._addToParent(parentNode,oIFrame);this.iframe=oIFrame;}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 onBeforeShow(){createIFrame.call(this);this.beforeShowEvent.unsubscribe(onBeforeShow);this._iframeDeferred=false;}if(bIFrame){if(this.cfg.getProperty("visible")){createIFrame.call(this);}else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(onBeforeShow);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(type,args,obj){var val=args[0];if(val){if(!Config.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}if(!Config.alreadySubscribed(this.beforeShowEvent,this._primeXYFromDOM)){this.beforeShowEvent.subscribe(this._primeXYFromDOM);}}else{this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(type,args,obj){var contextArgs=args[0],contextEl,elementMagnetCorner,contextMagnetCorner,triggers,offset,defTriggers=this.CONTEXT_TRIGGERS;if(contextArgs){contextEl=contextArgs[0];elementMagnetCorner=contextArgs[1];contextMagnetCorner=contextArgs[2];triggers=contextArgs[3];offset=contextArgs[4];if(defTriggers&&defTriggers.length>0){triggers=(triggers||[]).concat(defTriggers);}if(contextEl){if(typeof contextEl=="string"){this.cfg.setProperty("context",[document.getElementById(contextEl),elementMagnetCorner,contextMagnetCorner,triggers,offset],true);}if(elementMagnetCorner&&contextMagnetCorner){this.align(elementMagnetCorner,contextMagnetCorner,offset);}if(this._contextTriggers){this._processTriggers(this._contextTriggers,_UNSUBSCRIBE,this._alignOnTrigger);}if(triggers){this._processTriggers(triggers,_SUBSCRIBE,this._alignOnTrigger);this._contextTriggers=triggers;}}}},_alignOnTrigger:function(type,args){this.align();},_findTriggerCE:function(t){var tce=null;if(t instanceof CustomEvent){tce=t;}else{if(Overlay._TRIGGER_MAP[t]){tce=Overlay._TRIGGER_MAP[t];}}return tce;},_processTriggers:function(triggers,mode,fn){var t,tce;for(var i=0,l=triggers.length;i<l;++i){t=triggers[i];tce=this._findTriggerCE(t);if(tce){tce[mode](fn,this,true);}else{this[mode](t,fn);}}},align:function(elementAlign,contextAlign,xyOffset){var contextArgs=this.cfg.getProperty("context"),me=this,context,element,contextRegion;function doAlign(v,h){var alignX=null,alignY=null;switch(elementAlign){case Overlay.TOP_LEFT:alignX=h;alignY=v;break;case Overlay.TOP_RIGHT:alignX=h-element.offsetWidth;alignY=v;break;case Overlay.BOTTOM_LEFT:alignX=h;alignY=v-element.offsetHeight;break;case Overlay.BOTTOM_RIGHT:alignX=h-element.offsetWidth;alignY=v-element.offsetHeight;break;}if(alignX!==null&&alignY!==null){if(xyOffset){alignX+=xyOffset[0];alignY+=xyOffset[1];}me.moveTo(alignX,alignY);}}if(contextArgs){context=contextArgs[0];element=this.element;me=this;if(!elementAlign){elementAlign=contextArgs[1];}if(!contextAlign){contextAlign=contextArgs[2];}if(!xyOffset&&contextArgs[4]){xyOffset=contextArgs[4];}if(element&&context){contextRegion=Dom.getRegion(context);switch(contextAlign){case Overlay.TOP_LEFT:doAlign(contextRegion.top,contextRegion.left);break;case Overlay.TOP_RIGHT:doAlign(contextRegion.top,contextRegion.right);break;case Overlay.BOTTOM_LEFT:doAlign(contextRegion.bottom,contextRegion.left);break;case Overlay.BOTTOM_RIGHT:doAlign(contextRegion.bottom,contextRegion.right);break;}}}},enforceConstraints:function(type,args,obj){var pos=args[0];var cXY=this.getConstrainedXY(pos[0],pos[1]);this.cfg.setProperty("x",cXY[0],true);this.cfg.setProperty("y",cXY[1],true);this.cfg.setProperty("xy",cXY,true);},_getConstrainedPos:function(pos,val){var overlayEl=this.element,buffer=Overlay.VIEWPORT_OFFSET,x=(pos=="x"),overlaySize=(x)?overlayEl.offsetWidth:overlayEl.offsetHeight,viewportSize=(x)?Dom.getViewportWidth():Dom.getViewportHeight(),docScroll=(x)?Dom.getDocumentScrollLeft():Dom.getDocumentScrollTop(),overlapPositions=(x)?Overlay.PREVENT_OVERLAP_X:Overlay.PREVENT_OVERLAP_Y,context=this.cfg.getProperty("context"),bOverlayFitsInViewport=(overlaySize+buffer<viewportSize),bPreventContextOverlap=this.cfg.getProperty("preventcontextoverlap")&&context&&overlapPositions[(context[1]+context[2])],minConstraint=docScroll+buffer,maxConstraint=docScroll+viewportSize-overlaySize-buffer,constrainedVal=val;if(val<minConstraint||val>maxConstraint){if(bPreventContextOverlap){constrainedVal=this._preventOverlap(pos,context[0],overlaySize,viewportSize,docScroll);}else{if(bOverlayFitsInViewport){if(val<minConstraint){constrainedVal=minConstraint;}else{if(val>maxConstraint){constrainedVal=maxConstraint;}}}else{constrainedVal=minConstraint;}}}return constrainedVal;},_preventOverlap:function(pos,contextEl,overlaySize,viewportSize,docScroll){var x=(pos=="x"),buffer=Overlay.VIEWPORT_OFFSET,overlay=this,contextElPos=((x)?Dom.getX(contextEl):Dom.getY(contextEl))-docScroll,contextElSize=(x)?contextEl.offsetWidth:contextEl.offsetHeight,minRegionSize=contextElPos-buffer,maxRegionSize=(viewportSize-(contextElPos+contextElSize))-buffer,bFlipped=false,flip=function(){var flippedVal;if((overlay.cfg.getProperty(pos)-docScroll)>contextElPos){flippedVal=(contextElPos-overlaySize);}else{flippedVal=(contextElPos+contextElSize);}overlay.cfg.setProperty(pos,(flippedVal+docScroll),true);return flippedVal;},setPosition=function(){var displayRegionSize=((overlay.cfg.getProperty(pos)-docScroll)>contextElPos)?maxRegionSize:minRegionSize,position;if(overlaySize>displayRegionSize){if(bFlipped){flip();}else{flip();bFlipped=true;position=setPosition();}}return position;};setPosition();return this.cfg.getProperty(pos);},getConstrainedX:function(x){return this._getConstrainedPos("x",x);},getConstrainedY:function(y){return this._getConstrainedPos("y",y);},getConstrainedXY:function(x,y){return[this.getConstrainedX(x),this.getConstrainedY(y)];},center:function(){var nViewportOffset=Overlay.VIEWPORT_OFFSET,elementWidth=this.element.offsetWidth,elementHeight=this.element.offsetHeight,viewPortWidth=Dom.getViewportWidth(),viewPortHeight=Dom.getViewportHeight(),x,y;if(elementWidth<viewPortWidth){x=(viewPortWidth/2)-(elementWidth/2)+Dom.getDocumentScrollLeft();}else{x=nViewportOffset+Dom.getDocumentScrollLeft();}if(elementHeight<viewPortHeight){y=(viewPortHeight/2)-(elementHeight/2)+Dom.getDocumentScrollTop();}else{y=nViewportOffset+Dom.getDocumentScrollTop();}this.cfg.setProperty("xy",[parseInt(x,10),parseInt(y,10)]);this.cfg.refireEvent("iframe");if(UA.webkit){this.forceContainerRedraw();}},syncPosition:function(){var pos=Dom.getXY(this.element);this.cfg.setProperty("x",pos[0],true);this.cfg.setProperty("y",pos[1],true);this.cfg.setProperty("xy",pos,true);},onDomResize:function(e,obj){var me=this;Overlay.superclass.onDomResize.call(this,e,obj);setTimeout(function(){me.syncPosition();me.cfg.refireEvent("iframe");me.cfg.refireEvent("context");},0);},_getComputedHeight:(function(){if(document.defaultView&&document.defaultView.getComputedStyle){return function(el){var height=null;if(el.ownerDocument&&el.ownerDocument.defaultView){var computed=el.ownerDocument.defaultView.getComputedStyle(el,"");if(computed){height=parseInt(computed.height,10);}}return(Lang.isNumber(height))?height:null;};}else{return function(el){var height=null;if(el.style.pixelHeight){height=el.style.pixelHeight;}return(Lang.isNumber(height))?height:null;};}})(),_validateAutoFillHeight:function(val){return(!val)||(Lang.isString(val)&&Overlay.STD_MOD_RE.test(val));},_autoFillOnHeightChange:function(type,args,el){var height=this.cfg.getProperty("height");if((height&&height!=="auto")||(height===0)){this.fillHeight(el);}},_getPreciseHeight:function(el){var height=el.offsetHeight;if(el.getBoundingClientRect){var rect=el.getBoundingClientRect();height=rect.bottom-rect.top;}return height;},fillHeight:function(el){if(el){var container=this.innerElement||this.element,containerEls=[this.header,this.body,this.footer],containerEl,total=0,filled=0,remaining=0,validEl=false;for(var i=0,l=containerEls.length;i<l;i++){containerEl=containerEls[i];if(containerEl){if(el!==containerEl){filled+=this._getPreciseHeight(containerEl);}else{validEl=true;}}}if(validEl){if(UA.ie||UA.opera){Dom.setStyle(el,"height",0+"px");}total=this._getComputedHeight(container);if(total===null){Dom.addClass(container,"yui-override-padding");total=container.clientHeight;Dom.removeClass(container,"yui-override-padding");}remaining=Math.max(total-filled,0);Dom.setStyle(el,"height",remaining+"px");if(el.offsetHeight!=remaining){remaining=Math.max(remaining-(el.offsetHeight-remaining),0);}Dom.setStyle(el,"height",remaining+"px");}}},bringToTop:function(){var aOverlays=[],oElement=this.element;function compareZIndexDesc(p_oOverlay1,p_oOverlay2){var sZIndex1=Dom.getStyle(p_oOverlay1,"zIndex"),sZIndex2=Dom.getStyle(p_oOverlay2,"zIndex"),nZIndex1=(!sZIndex1||isNaN(sZIndex1))?0:parseInt(sZIndex1,10),nZIndex2=(!sZIndex2||isNaN(sZIndex2))?0:parseInt(sZIndex2,10);if(nZIndex1>nZIndex2){return -1;}else{if(nZIndex1<nZIndex2){return 1;}else{return 0;}}}function isOverlayElement(p_oElement){var isOverlay=Dom.hasClass(p_oElement,Overlay.CSS_OVERLAY),Panel=YAHOO.widget.Panel;if(isOverlay&&!Dom.isAncestor(oElement,p_oElement)){if(Panel&&Dom.hasClass(p_oElement,Panel.CSS_PANEL)){aOverlays[aOverlays.length]=p_oElement.parentNode;}else{aOverlays[aOverlays.length]=p_oElement;}}}Dom.getElementsBy(isOverlayElement,"div",document.body);aOverlays.sort(compareZIndexDesc);var oTopOverlay=aOverlays[0],nTopZIndex;if(oTopOverlay){nTopZIndex=Dom.getStyle(oTopOverlay,"zIndex");if(!isNaN(nTopZIndex)){var bRequiresBump=false;if(oTopOverlay!=oElement){bRequiresBump=true;}else{if(aOverlays.length>1){var nNextZIndex=Dom.getStyle(aOverlays[1],"zIndex");if(!isNaN(nNextZIndex)&&(nTopZIndex==nNextZIndex)){bRequiresBump=true;}}}if(bRequiresBump){this.cfg.setProperty("zindex",(parseInt(nTopZIndex,10)+2));}}}},destroy:function(shallowPurge){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}this.iframe=null;Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);Module.textResizeEvent.unsubscribe(this._autoFillOnHeightChange);if(this._contextTriggers){this._processTriggers(this._contextTriggers,_UNSUBSCRIBE,this._alignOnTrigger);}Overlay.superclass.destroy.call(this,shallowPurge);},forceContainerRedraw:function(){var c=this;Dom.addClass(c.element,"yui-force-redraw");setTimeout(function(){Dom.removeClass(c.element,"yui-force-redraw");},0);},toString:function(){return"Overlay "+this.id;}});}());(function(){YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);};var Overlay=YAHOO.widget.Overlay,Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,Config=YAHOO.util.Config,CustomEvent=YAHOO.util.CustomEvent,OverlayManager=YAHOO.widget.OverlayManager;OverlayManager.CSS_FOCUSED="focused";OverlayManager.prototype={constructor:OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(userConfig){this.cfg=new Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}this.cfg.fireQueue();var activeOverlay=null;this.getActive=function(){return activeOverlay;};this.focus=function(overlay){var o=this.find(overlay);if(o){o.focus();}};this.remove=function(overlay){var o=this.find(overlay),originalZ;if(o){if(activeOverlay==o){activeOverlay=null;}var bDestroyed=(o.element===null&&o.cfg===null)?true:false;if(!bDestroyed){originalZ=Dom.getStyle(o.element,"zIndex");o.cfg.setProperty("zIndex",-1000,true);}this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,(this.overlays.length-1));o.hideEvent.unsubscribe(o.blur);o.destroyEvent.unsubscribe(this._onOverlayDestroy,o);o.focusEvent.unsubscribe(this._onOverlayFocusHandler,o);o.blurEvent.unsubscribe(this._onOverlayBlurHandler,o);if(!bDestroyed){Event.removeListener(o.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);o.cfg.setProperty("zIndex",originalZ,true);o.cfg.setProperty("manager",null);}if(o.focusEvent._managed){o.focusEvent=null;}if(o.blurEvent._managed){o.blurEvent=null;}if(o.focus._managed){o.focus=null;}if(o.blur._managed){o.blur=null;}}};this.blurAll=function(){var nOverlays=this.overlays.length,i;if(nOverlays>0){i=nOverlays-1;do{this.overlays[i].blur();}while(i--);}};this._manageBlur=function(overlay){var changed=false;if(activeOverlay==overlay){Dom.removeClass(activeOverlay.element,OverlayManager.CSS_FOCUSED);activeOverlay=null;changed=true;}return changed;};this._manageFocus=function(overlay){var changed=false;if(activeOverlay!=overlay){if(activeOverlay){activeOverlay.blur();}activeOverlay=overlay;this.bringToTop(activeOverlay);Dom.addClass(activeOverlay.element,OverlayManager.CSS_FOCUSED);changed=true;}return changed;};var overlays=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}if(overlays){this.register(overlays);this.overlays.sort(this.compareZIndexDesc);}},_onOverlayElementFocus:function(p_oEvent){var oTarget=Event.getTarget(p_oEvent),oClose=this.close;if(oClose&&(oTarget==oClose||Dom.isAncestor(oClose,oTarget))){this.blur();}else{this.focus();}},_onOverlayDestroy:function(p_sType,p_aArgs,p_oOverlay){this.remove(p_oOverlay);},_onOverlayFocusHandler:function(p_sType,p_aArgs,p_oOverlay){this._manageFocus(p_oOverlay);},_onOverlayBlurHandler:function(p_sType,p_aArgs,p_oOverlay){this._manageBlur(p_oOverlay);},_bindFocus:function(overlay){var mgr=this;if(!overlay.focusEvent){overlay.focusEvent=overlay.createEvent("focus");overlay.focusEvent.signature=CustomEvent.LIST;overlay.focusEvent._managed=true;}else{overlay.focusEvent.subscribe(mgr._onOverlayFocusHandler,overlay,mgr);}if(!overlay.focus){Event.on(overlay.element,mgr.cfg.getProperty("focusevent"),mgr._onOverlayElementFocus,null,overlay);overlay.focus=function(){if(mgr._manageFocus(this)){if(this.cfg.getProperty("visible")&&this.focusFirst){this.focusFirst();}this.focusEvent.fire();}};overlay.focus._managed=true;}},_bindBlur:function(overlay){var mgr=this;if(!overlay.blurEvent){overlay.blurEvent=overlay.createEvent("blur");overlay.blurEvent.signature=CustomEvent.LIST;overlay.focusEvent._managed=true;}else{overlay.blurEvent.subscribe(mgr._onOverlayBlurHandler,overlay,mgr);}if(!overlay.blur){overlay.blur=function(){if(mgr._manageBlur(this)){this.blurEvent.fire();}};overlay.blur._managed=true;}overlay.hideEvent.subscribe(overlay.blur);},_bindDestroy:function(overlay){var mgr=this;overlay.destroyEvent.subscribe(mgr._onOverlayDestroy,overlay,mgr);},_syncZIndex:function(overlay){var zIndex=Dom.getStyle(overlay.element,"zIndex");if(!isNaN(zIndex)){overlay.cfg.setProperty("zIndex",parseInt(zIndex,10));}else{overlay.cfg.setProperty("zIndex",0);}},register:function(overlay){var registered=false,i,n;if(overlay instanceof Overlay){overlay.cfg.addProperty("manager",{value:this});this._bindFocus(overlay);this._bindBlur(overlay);this._bindDestroy(overlay);this._syncZIndex(overlay);this.overlays.push(overlay);this.bringToTop(overlay);registered=true;}else{if(overlay instanceof Array){for(i=0,n=overlay.length;i<n;i++){registered=this.register(overlay[i])||registered;}}}return registered;},bringToTop:function(p_oOverlay){var oOverlay=this.find(p_oOverlay),nTopZIndex,oTopOverlay,aOverlays;if(oOverlay){aOverlays=this.overlays;aOverlays.sort(this.compareZIndexDesc);oTopOverlay=aOverlays[0];if(oTopOverlay){nTopZIndex=Dom.getStyle(oTopOverlay.element,"zIndex");if(!isNaN(nTopZIndex)){var bRequiresBump=false;if(oTopOverlay!==oOverlay){bRequiresBump=true;}else{if(aOverlays.length>1){var nNextZIndex=Dom.getStyle(aOverlays[1].element,"zIndex");if(!isNaN(nNextZIndex)&&(nTopZIndex==nNextZIndex)){bRequiresBump=true;}}}if(bRequiresBump){oOverlay.cfg.setProperty("zindex",(parseInt(nTopZIndex,10)+2));}}aOverlays.sort(this.compareZIndexDesc);}}},find:function(overlay){var isInstance=overlay instanceof Overlay,overlays=this.overlays,n=overlays.length,found=null,o,i;if(isInstance||typeof overlay=="string"){for(i=n-1;i>=0;i--){o=overlays[i];if((isInstance&&(o===overlay))||(o.id==overlay)){found=o;break;}}}return found;},compareZIndexDesc:function(o1,o2){var zIndex1=(o1.cfg)?o1.cfg.getProperty("zIndex"):null,zIndex2=(o2.cfg)?o2.cfg.getProperty("zIndex"):null;if(zIndex1===null&&zIndex2===null){return 0;}else{if(zIndex1===null){return 1;}else{if(zIndex2===null){return -1;}else{if(zIndex1>zIndex2){return -1;}else{if(zIndex1<zIndex2){return 1;}else{return 0;}}}}}},showAll:function(){var overlays=this.overlays,n=overlays.length,i;for(i=n-1;i>=0;i--){overlays[i].show();}},hideAll:function(){var overlays=this.overlays,n=overlays.length,i;for(i=n-1;i>=0;i--){overlays[i].hide();}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.Tooltip=function(el,userConfig){YAHOO.widget.Tooltip.superclass.constructor.call(this,el,userConfig);};var Lang=YAHOO.lang,Event=YAHOO.util.Event,CustomEvent=YAHOO.util.CustomEvent,Dom=YAHOO.util.Dom,Tooltip=YAHOO.widget.Tooltip,UA=YAHOO.env.ua,bIEQuirks=(UA.ie&&(UA.ie<=6||document.compatMode=="BackCompat")),m_oShadowTemplate,DEFAULT_CONFIG={PREVENT_OVERLAP:{key:"preventoverlap",value:true,validator:Lang.isBoolean,supercedes:["x","y","xy"]},SHOW_DELAY:{key:"showdelay",value:200,validator:Lang.isNumber},AUTO_DISMISS_DELAY:{key:"autodismissdelay",value:5000,validator:Lang.isNumber},HIDE_DELAY:{key:"hidedelay",value:250,validator:Lang.isNumber},TEXT:{key:"text",suppressEvent:true},CONTAINER:{key:"container"},DISABLED:{key:"disabled",value:false,suppressEvent:true},XY_OFFSET:{key:"xyoffset",value:[0,25],suppressEvent:true}},EVENT_TYPES={CONTEXT_MOUSE_OVER:"contextMouseOver",CONTEXT_MOUSE_OUT:"contextMouseOut",CONTEXT_TRIGGER:"contextTrigger"};Tooltip.CSS_TOOLTIP="yui-tt";function restoreOriginalWidth(sOriginalWidth,sForcedWidth){var oConfig=this.cfg,sCurrentWidth=oConfig.getProperty("width");if(sCurrentWidth==sForcedWidth){oConfig.setProperty("width",sOriginalWidth);}}function setWidthToOffsetWidth(p_sType,p_aArgs){if("_originalWidth" in this){restoreOriginalWidth.call(this,this._originalWidth,this._forcedWidth);}var oBody=document.body,oConfig=this.cfg,sOriginalWidth=oConfig.getProperty("width"),sNewWidth,oClone;if((!sOriginalWidth||sOriginalWidth=="auto")&&(oConfig.getProperty("container")!=oBody||oConfig.getProperty("x")>=Dom.getViewportWidth()||oConfig.getProperty("y")>=Dom.getViewportHeight())){oClone=this.element.cloneNode(true);oClone.style.visibility="hidden";oClone.style.top="0px";oClone.style.left="0px";oBody.appendChild(oClone);sNewWidth=(oClone.offsetWidth+"px");oBody.removeChild(oClone);oClone=null;oConfig.setProperty("width",sNewWidth);oConfig.refireEvent("xy");this._originalWidth=sOriginalWidth||"";this._forcedWidth=sNewWidth;}}function onDOMReady(p_sType,p_aArgs,p_oObject){this.render(p_oObject);}function onInit(){Event.onDOMReady(onDOMReady,this.cfg.getProperty("container"),this);}YAHOO.extend(Tooltip,YAHOO.widget.Overlay,{init:function(el,userConfig){Tooltip.superclass.init.call(this,el);this.beforeInitEvent.fire(Tooltip);Dom.addClass(this.element,Tooltip.CSS_TOOLTIP);if(userConfig){this.cfg.applyConfig(userConfig,true);}this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.subscribe("changeContent",setWidthToOffsetWidth);this.subscribe("init",onInit);this.subscribe("render",this.onRender);this.initEvent.fire(Tooltip);},initEvents:function(){Tooltip.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.contextMouseOverEvent=this.createEvent(EVENT_TYPES.CONTEXT_MOUSE_OVER);this.contextMouseOverEvent.signature=SIGNATURE;this.contextMouseOutEvent=this.createEvent(EVENT_TYPES.CONTEXT_MOUSE_OUT);this.contextMouseOutEvent.signature=SIGNATURE;this.contextTriggerEvent=this.createEvent(EVENT_TYPES.CONTEXT_TRIGGER);this.contextTriggerEvent.signature=SIGNATURE;},initDefaultConfig:function(){Tooltip.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.PREVENT_OVERLAP.key,{value:DEFAULT_CONFIG.PREVENT_OVERLAP.value,validator:DEFAULT_CONFIG.PREVENT_OVERLAP.validator,supercedes:DEFAULT_CONFIG.PREVENT_OVERLAP.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.SHOW_DELAY.key,{handler:this.configShowDelay,value:200,validator:DEFAULT_CONFIG.SHOW_DELAY.validator});this.cfg.addProperty(DEFAULT_CONFIG.AUTO_DISMISS_DELAY.key,{handler:this.configAutoDismissDelay,value:DEFAULT_CONFIG.AUTO_DISMISS_DELAY.value,validator:DEFAULT_CONFIG.AUTO_DISMISS_DELAY.validator});this.cfg.addProperty(DEFAULT_CONFIG.HIDE_DELAY.key,{handler:this.configHideDelay,value:DEFAULT_CONFIG.HIDE_DELAY.value,validator:DEFAULT_CONFIG.HIDE_DELAY.validator});this.cfg.addProperty(DEFAULT_CONFIG.TEXT.key,{handler:this.configText,suppressEvent:DEFAULT_CONFIG.TEXT.suppressEvent});this.cfg.addProperty(DEFAULT_CONFIG.CONTAINER.key,{handler:this.configContainer,value:document.body});this.cfg.addProperty(DEFAULT_CONFIG.DISABLED.key,{handler:this.configContainer,value:DEFAULT_CONFIG.DISABLED.value,supressEvent:DEFAULT_CONFIG.DISABLED.suppressEvent});this.cfg.addProperty(DEFAULT_CONFIG.XY_OFFSET.key,{value:DEFAULT_CONFIG.XY_OFFSET.value.concat(),supressEvent:DEFAULT_CONFIG.XY_OFFSET.suppressEvent});},configText:function(type,args,obj){var text=args[0];if(text){this.setBody(text);}},configContainer:function(type,args,obj){var container=args[0];if(typeof container=="string"){this.cfg.setProperty("container",document.getElementById(container),true);}},_removeEventListeners:function(){var aElements=this._context,nElements,oElement,i;if(aElements){nElements=aElements.length;if(nElements>0){i=nElements-1;do{oElement=aElements[i];Event.removeListener(oElement,"mouseover",this.onContextMouseOver);Event.removeListener(oElement,"mousemove",this.onContextMouseMove);Event.removeListener(oElement,"mouseout",this.onContextMouseOut);}while(i--);}}},configContext:function(type,args,obj){var context=args[0],aElements,nElements,oElement,i;if(context){if(!(context instanceof Array)){if(typeof context=="string"){this.cfg.setProperty("context",[document.getElementById(context)],true);}else{this.cfg.setProperty("context",[context],true);}context=this.cfg.getProperty("context");}this._removeEventListeners();this._context=context;aElements=this._context;if(aElements){nElements=aElements.length;if(nElements>0){i=nElements-1;do{oElement=aElements[i];Event.on(oElement,"mouseover",this.onContextMouseOver,this);Event.on(oElement,"mousemove",this.onContextMouseMove,this);Event.on(oElement,"mouseout",this.onContextMouseOut,this);}while(i--);}}}},onContextMouseMove:function(e,obj){obj.pageX=Event.getPageX(e);obj.pageY=Event.getPageY(e);},onContextMouseOver:function(e,obj){var context=this;if(context.title){obj._tempTitle=context.title;context.title="";}if(obj.fireEvent("contextMouseOver",context,e)!==false&&!obj.cfg.getProperty("disabled")){if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}Event.on(context,"mousemove",obj.onContextMouseMove,obj);obj.showProcId=obj.doShow(e,context);}},onContextMouseOut:function(e,obj){var el=this;if(obj._tempTitle){el.title=obj._tempTitle;obj._tempTitle=null;}if(obj.showProcId){clearTimeout(obj.showProcId);obj.showProcId=null;}if(obj.hideProcId){clearTimeout(obj.hideProcId);obj.hideProcId=null;}obj.fireEvent("contextMouseOut",el,e);obj.hideProcId=setTimeout(function(){obj.hide();},obj.cfg.getProperty("hidedelay"));},doShow:function(e,context){var offset=this.cfg.getProperty("xyoffset"),xOffset=offset[0],yOffset=offset[1],me=this;if(UA.opera&&context.tagName&&context.tagName.toUpperCase()=="A"){yOffset+=12;}return setTimeout(function(){var txt=me.cfg.getProperty("text");if(me._tempTitle&&(txt===""||YAHOO.lang.isUndefined(txt)||YAHOO.lang.isNull(txt))){me.setBody(me._tempTitle);}else{me.cfg.refireEvent("text");}me.moveTo(me.pageX+xOffset,me.pageY+yOffset);if(me.cfg.getProperty("preventoverlap")){me.preventOverlap(me.pageX,me.pageY);}Event.removeListener(context,"mousemove",me.onContextMouseMove);me.contextTriggerEvent.fire(context);me.show();me.hideProcId=me.doHide();},this.cfg.getProperty("showdelay"));},doHide:function(){var me=this;return setTimeout(function(){me.hide();},this.cfg.getProperty("autodismissdelay"));},preventOverlap:function(pageX,pageY){var height=this.element.offsetHeight,mousePoint=new YAHOO.util.Point(pageX,pageY),elementRegion=Dom.getRegion(this.element);elementRegion.top-=5;elementRegion.left-=5;elementRegion.right+=5;elementRegion.bottom+=5;if(elementRegion.contains(mousePoint)){this.cfg.setProperty("y",(pageY-height-5));}},onRender:function(p_sType,p_aArgs){function sizeShadow(){var oElement=this.element,oShadow=this.underlay;if(oShadow){oShadow.style.width=(oElement.offsetWidth+6)+"px";oShadow.style.height=(oElement.offsetHeight+1)+"px";}}function addShadowVisibleClass(){Dom.addClass(this.underlay,"yui-tt-shadow-visible");if(UA.ie){this.forceUnderlayRedraw();}}function removeShadowVisibleClass(){Dom.removeClass(this.underlay,"yui-tt-shadow-visible");}function createShadow(){var oShadow=this.underlay,oElement,Module,nIE,me;if(!oShadow){oElement=this.element;Module=YAHOO.widget.Module;nIE=UA.ie;me=this;if(!m_oShadowTemplate){m_oShadowTemplate=document.createElement("div");m_oShadowTemplate.className="yui-tt-shadow";}oShadow=m_oShadowTemplate.cloneNode(false);oElement.appendChild(oShadow);this.underlay=oShadow;this._shadow=this.underlay;addShadowVisibleClass.call(this);this.subscribe("beforeShow",addShadowVisibleClass);this.subscribe("hide",removeShadowVisibleClass);if(bIEQuirks){window.setTimeout(function(){sizeShadow.call(me);},0);this.cfg.subscribeToConfigEvent("width",sizeShadow);this.cfg.subscribeToConfigEvent("height",sizeShadow);this.subscribe("changeContent",sizeShadow);Module.textResizeEvent.subscribe(sizeShadow,this,true);this.subscribe("destroy",function(){Module.textResizeEvent.unsubscribe(sizeShadow,this);});}}}function onBeforeShow(){createShadow.call(this);this.unsubscribe("beforeShow",onBeforeShow);}if(this.cfg.getProperty("visible")){createShadow.call(this);}else{this.subscribe("beforeShow",onBeforeShow);}},forceUnderlayRedraw:function(){var tt=this;Dom.addClass(tt.underlay,"yui-force-redraw");setTimeout(function(){Dom.removeClass(tt.underlay,"yui-force-redraw");},0);},destroy:function(){this._removeEventListeners();Tooltip.superclass.destroy.call(this);},toString:function(){return"Tooltip "+this.id;}});}());(function(){YAHOO.widget.Panel=function(el,userConfig){YAHOO.widget.Panel.superclass.constructor.call(this,el,userConfig);};var _currentModal=null;var Lang=YAHOO.lang,Util=YAHOO.util,Dom=Util.Dom,Event=Util.Event,CustomEvent=Util.CustomEvent,KeyListener=YAHOO.util.KeyListener,Config=Util.Config,Overlay=YAHOO.widget.Overlay,Panel=YAHOO.widget.Panel,UA=YAHOO.env.ua,bIEQuirks=(UA.ie&&(UA.ie<=6||document.compatMode=="BackCompat")),m_oMaskTemplate,m_oUnderlayTemplate,m_oCloseIconTemplate,EVENT_TYPES={BEFORE_SHOW_MASK:"beforeShowMask",BEFORE_HIDE_MASK:"beforeHideMask",SHOW_MASK:"showMask",HIDE_MASK:"hideMask",DRAG:"drag"},DEFAULT_CONFIG={CLOSE:{key:"close",value:true,validator:Lang.isBoolean,supercedes:["visible"]},DRAGGABLE:{key:"draggable",value:(Util.DD?true:false),validator:Lang.isBoolean,supercedes:["visible"]},DRAG_ONLY:{key:"dragonly",value:false,validator:Lang.isBoolean,supercedes:["draggable"]},UNDERLAY:{key:"underlay",value:"shadow",supercedes:["visible"]},MODAL:{key:"modal",value:false,validator:Lang.isBoolean,supercedes:["visible","zindex"]},KEY_LISTENERS:{key:"keylisteners",suppressEvent:true,supercedes:["visible"]},STRINGS:{key:"strings",supercedes:["close"],validator:Lang.isObject,value:{close:"Close"}}};Panel.CSS_PANEL="yui-panel";Panel.CSS_PANEL_CONTAINER="yui-panel-container";Panel.FOCUSABLE=["a","button","select","textarea","input","iframe"];function createHeader(p_sType,p_aArgs){if(!this.header&&this.cfg.getProperty("draggable")){this.setHeader("&#160;");}}function restoreOriginalWidth(p_sType,p_aArgs,p_oObject){var sOriginalWidth=p_oObject[0],sNewWidth=p_oObject[1],oConfig=this.cfg,sCurrentWidth=oConfig.getProperty("width");if(sCurrentWidth==sNewWidth){oConfig.setProperty("width",sOriginalWidth);}this.unsubscribe("hide",restoreOriginalWidth,p_oObject);}function setWidthToOffsetWidth(p_sType,p_aArgs){var oConfig,sOriginalWidth,sNewWidth;if(bIEQuirks){oConfig=this.cfg;sOriginalWidth=oConfig.getProperty("width");if(!sOriginalWidth||sOriginalWidth=="auto"){sNewWidth=(this.element.offsetWidth+"px");oConfig.setProperty("width",sNewWidth);this.subscribe("hide",restoreOriginalWidth,[(sOriginalWidth||""),sNewWidth]);}}}YAHOO.extend(Panel,Overlay,{init:function(el,userConfig){Panel.superclass.init.call(this,el);this.beforeInitEvent.fire(Panel);Dom.addClass(this.element,Panel.CSS_PANEL);this.buildWrapper();if(userConfig){this.cfg.applyConfig(userConfig,true);}this.subscribe("showMask",this._addFocusHandlers);this.subscribe("hideMask",this._removeFocusHandlers);this.subscribe("beforeRender",createHeader);this.subscribe("render",function(){this.setFirstLastFocusable();this.subscribe("changeContent",this.setFirstLastFocusable);});this.subscribe("show",this._focusOnShow);this.initEvent.fire(Panel);},_onElementFocus:function(e){if(_currentModal===this){var target=Event.getTarget(e),doc=document.documentElement,insideDoc=(target!==doc&&target!==window);if(insideDoc&&target!==this.element&&target!==this.mask&&!Dom.isAncestor(this.element,target)){try{this._focusFirstModal();}catch(err){try{if(insideDoc&&target!==document.body){target.blur();}}catch(err2){}}}}},_focusFirstModal:function(){var el=this.firstElement;if(el){el.focus();}else{if(this._modalFocus){this._modalFocus.focus();}else{this.innerElement.focus();}}},_addFocusHandlers:function(p_sType,p_aArgs){if(!this.firstElement){if(UA.webkit||UA.opera){if(!this._modalFocus){this._createHiddenFocusElement();}}else{this.innerElement.tabIndex=0;}}this._setTabLoop(this.firstElement,this.lastElement);Event.onFocus(document.documentElement,this._onElementFocus,this,true);_currentModal=this;},_createHiddenFocusElement:function(){var e=document.createElement("button");e.style.height="1px";e.style.width="1px";e.style.position="absolute";e.style.left="-10000em";e.style.opacity=0;e.tabIndex=-1;this.innerElement.appendChild(e);this._modalFocus=e;},_removeFocusHandlers:function(p_sType,p_aArgs){Event.removeFocusListener(document.documentElement,this._onElementFocus,this);if(_currentModal==this){_currentModal=null;}},_focusOnShow:function(type,args,obj){if(args&&args[1]){Event.stopEvent(args[1]);}if(!this.focusFirst(type,args,obj)){if(this.cfg.getProperty("modal")){this._focusFirstModal();}}},focusFirst:function(type,args,obj){var el=this.firstElement,focused=false;if(args&&args[1]){Event.stopEvent(args[1]);}if(el){try{el.focus();focused=true;}catch(err){}}return focused;},focusLast:function(type,args,obj){var el=this.lastElement,focused=false;if(args&&args[1]){Event.stopEvent(args[1]);}if(el){try{el.focus();focused=true;}catch(err){}}return focused;},_setTabLoop:function(firstElement,lastElement){this.setTabLoop(firstElement,lastElement);},setTabLoop:function(firstElement,lastElement){var backTab=this.preventBackTab,tab=this.preventTabOut,showEvent=this.showEvent,hideEvent=this.hideEvent;if(backTab){backTab.disable();showEvent.unsubscribe(backTab.enable,backTab);hideEvent.unsubscribe(backTab.disable,backTab);backTab=this.preventBackTab=null;}if(tab){tab.disable();showEvent.unsubscribe(tab.enable,tab);hideEvent.unsubscribe(tab.disable,tab);tab=this.preventTabOut=null;}if(firstElement){this.preventBackTab=new KeyListener(firstElement,{shift:true,keys:9},{fn:this.focusLast,scope:this,correctScope:true});backTab=this.preventBackTab;showEvent.subscribe(backTab.enable,backTab,true);hideEvent.subscribe(backTab.disable,backTab,true);}if(lastElement){this.preventTabOut=new KeyListener(lastElement,{shift:false,keys:9},{fn:this.focusFirst,scope:this,correctScope:true});tab=this.preventTabOut;showEvent.subscribe(tab.enable,tab,true);hideEvent.subscribe(tab.disable,tab,true);}},getFocusableElements:function(root){root=root||this.innerElement;var focusable={},panel=this;for(var i=0;i<Panel.FOCUSABLE.length;i++){focusable[Panel.FOCUSABLE[i]]=true;}return Dom.getElementsBy(function(el){return panel._testIfFocusable(el,focusable);},null,root);},_testIfFocusable:function(el,focusable){if(el.focus&&el.type!=="hidden"&&!el.disabled&&focusable[el.tagName.toLowerCase()]){return true;}return false;},setFirstLastFocusable:function(){this.firstElement=null;this.lastElement=null;var elements=this.getFocusableElements();this.focusableElements=elements;if(elements.length>0){this.firstElement=elements[0];this.lastElement=elements[elements.length-1];}if(this.cfg.getProperty("modal")){this._setTabLoop(this.firstElement,this.lastElement);}},initEvents:function(){Panel.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.showMaskEvent=this.createEvent(EVENT_TYPES.SHOW_MASK);this.showMaskEvent.signature=SIGNATURE;this.beforeShowMaskEvent=this.createEvent(EVENT_TYPES.BEFORE_SHOW_MASK);this.beforeShowMaskEvent.signature=SIGNATURE;this.hideMaskEvent=this.createEvent(EVENT_TYPES.HIDE_MASK);this.hideMaskEvent.signature=SIGNATURE;this.beforeHideMaskEvent=this.createEvent(EVENT_TYPES.BEFORE_HIDE_MASK);this.beforeHideMaskEvent.signature=SIGNATURE;this.dragEvent=this.createEvent(EVENT_TYPES.DRAG);this.dragEvent.signature=SIGNATURE;},initDefaultConfig:function(){Panel.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.CLOSE.key,{handler:this.configClose,value:DEFAULT_CONFIG.CLOSE.value,validator:DEFAULT_CONFIG.CLOSE.validator,supercedes:DEFAULT_CONFIG.CLOSE.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.DRAGGABLE.key,{handler:this.configDraggable,value:(Util.DD)?true:false,validator:DEFAULT_CONFIG.DRAGGABLE.validator,supercedes:DEFAULT_CONFIG.DRAGGABLE.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.DRAG_ONLY.key,{value:DEFAULT_CONFIG.DRAG_ONLY.value,validator:DEFAULT_CONFIG.DRAG_ONLY.validator,supercedes:DEFAULT_CONFIG.DRAG_ONLY.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.UNDERLAY.key,{handler:this.configUnderlay,value:DEFAULT_CONFIG.UNDERLAY.value,supercedes:DEFAULT_CONFIG.UNDERLAY.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.MODAL.key,{handler:this.configModal,value:DEFAULT_CONFIG.MODAL.value,validator:DEFAULT_CONFIG.MODAL.validator,supercedes:DEFAULT_CONFIG.MODAL.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.KEY_LISTENERS.key,{handler:this.configKeyListeners,suppressEvent:DEFAULT_CONFIG.KEY_LISTENERS.suppressEvent,supercedes:DEFAULT_CONFIG.KEY_LISTENERS.supercedes});this.cfg.addProperty(DEFAULT_CONFIG.STRINGS.key,{value:DEFAULT_CONFIG.STRINGS.value,handler:this.configStrings,validator:DEFAULT_CONFIG.STRINGS.validator,supercedes:DEFAULT_CONFIG.STRINGS.supercedes});},configClose:function(type,args,obj){var val=args[0],oClose=this.close,strings=this.cfg.getProperty("strings"),fc;if(val){if(!oClose){if(!m_oCloseIconTemplate){m_oCloseIconTemplate=document.createElement("a");m_oCloseIconTemplate.className="container-close";m_oCloseIconTemplate.href="#";}oClose=m_oCloseIconTemplate.cloneNode(true);fc=this.innerElement.firstChild;if(fc){this.innerElement.insertBefore(oClose,fc);}else{this.innerElement.appendChild(oClose);}oClose.innerHTML=(strings&&strings.close)?strings.close:"&#160;";Event.on(oClose,"click",this._doClose,this,true);this.close=oClose;}else{oClose.style.display="block";}}else{if(oClose){oClose.style.display="none";}}},_doClose:function(e){Event.preventDefault(e);this.hide();},configDraggable:function(type,args,obj){var val=args[0];if(val){if(!Util.DD){this.cfg.setProperty("draggable",false);return;}if(this.header){Dom.setStyle(this.header,"cursor","move");this.registerDragDrop();}this.subscribe("beforeShow",setWidthToOffsetWidth);}else{if(this.dd){this.dd.unreg();}if(this.header){Dom.setStyle(this.header,"cursor","auto");}this.unsubscribe("beforeShow",setWidthToOffsetWidth);}},configUnderlay:function(type,args,obj){var bMacGecko=(this.platform=="mac"&&UA.gecko),sUnderlay=args[0].toLowerCase(),oUnderlay=this.underlay,oElement=this.element;function createUnderlay(){var bNew=false;if(!oUnderlay){if(!m_oUnderlayTemplate){m_oUnderlayTemplate=document.createElement("div");m_oUnderlayTemplate.className="underlay";}oUnderlay=m_oUnderlayTemplate.cloneNode(false);this.element.appendChild(oUnderlay);this.underlay=oUnderlay;if(bIEQuirks){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(UA.webkit&&UA.webkit<420){this.changeContentEvent.subscribe(this.forceUnderlayRedraw);}bNew=true;}}function onBeforeShow(){var bNew=createUnderlay.call(this);if(!bNew&&bIEQuirks){this.sizeUnderlay();}this._underlayDeferred=false;this.beforeShowEvent.unsubscribe(onBeforeShow);}function destroyUnderlay(){if(this._underlayDeferred){this.beforeShowEvent.unsubscribe(onBeforeShow);this._underlayDeferred=false;}if(oUnderlay){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(oUnderlay);this.underlay=null;}}switch(sUnderlay){case"shadow":Dom.removeClass(oElement,"matte");Dom.addClass(oElement,"shadow");break;case"matte":if(!bMacGecko){destroyUnderlay.call(this);}Dom.removeClass(oElement,"shadow");Dom.addClass(oElement,"matte");break;default:if(!bMacGecko){destroyUnderlay.call(this);}Dom.removeClass(oElement,"shadow");Dom.removeClass(oElement,"matte");break;}if((sUnderlay=="shadow")||(bMacGecko&&!oUnderlay)){if(this.cfg.getProperty("visible")){var bNew=createUnderlay.call(this);if(!bNew&&bIEQuirks){this.sizeUnderlay();}}else{if(!this._underlayDeferred){this.beforeShowEvent.subscribe(onBeforeShow);this._underlayDeferred=true;}}}},configModal:function(type,args,obj){var modal=args[0];if(modal){if(!this._hasModalityEventListeners){this.subscribe("beforeShow",this.buildMask);this.subscribe("beforeShow",this.bringToTop);this.subscribe("beforeShow",this.showMask);this.subscribe("hide",this.hideMask);Overlay.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);Overlay.windowResizeEvent.unsubscribe(this.sizeMask,this);this._hasModalityEventListeners=false;}}},removeMask:function(){var oMask=this.mask,oParentNode;if(oMask){this.hideMask();oParentNode=oMask.parentNode;if(oParentNode){oParentNode.removeChild(oMask);}this.mask=null;}},configKeyListeners:function(type,args,obj){var listeners=args[0],listener,nListeners,i;if(listeners){if(listeners instanceof Array){nListeners=listeners.length;for(i=0;i<nListeners;i++){listener=listeners[i];if(!Config.alreadySubscribed(this.showEvent,listener.enable,listener)){this.showEvent.subscribe(listener.enable,listener,true);}if(!Config.alreadySubscribed(this.hideEvent,listener.disable,listener)){this.hideEvent.subscribe(listener.disable,listener,true);this.destroyEvent.subscribe(listener.disable,listener,true);}}}else{if(!Config.alreadySubscribed(this.showEvent,listeners.enable,listeners)){this.showEvent.subscribe(listeners.enable,listeners,true);}if(!Config.alreadySubscribed(this.hideEvent,listeners.disable,listeners)){this.hideEvent.subscribe(listeners.disable,listeners,true);this.destroyEvent.subscribe(listeners.disable,listeners,true);}}}},configStrings:function(type,args,obj){var val=Lang.merge(DEFAULT_CONFIG.STRINGS.value,args[0]);this.cfg.setProperty(DEFAULT_CONFIG.STRINGS.key,val,true);},configHeight:function(type,args,obj){var height=args[0],el=this.innerElement;Dom.setStyle(el,"height",height);this.cfg.refireEvent("iframe");},_autoFillOnHeightChange:function(type,args,el){Panel.superclass._autoFillOnHeightChange.apply(this,arguments);if(bIEQuirks){var panel=this;setTimeout(function(){panel.sizeUnderlay();},0);}},configWidth:function(type,args,obj){var width=args[0],el=this.innerElement;Dom.setStyle(el,"width",width);this.cfg.refireEvent("iframe");},configzIndex:function(type,args,obj){Panel.superclass.configzIndex.call(this,type,args,obj);if(this.mask||this.cfg.getProperty("modal")===true){var panelZ=Dom.getStyle(this.element,"zIndex");if(!panelZ||isNaN(panelZ)){panelZ=0;}if(panelZ===0){this.cfg.setProperty("zIndex",1);}else{this.stackMask();}}},buildWrapper:function(){var elementParent=this.element.parentNode,originalElement=this.element,wrapper=document.createElement("div");wrapper.className=Panel.CSS_PANEL_CONTAINER;wrapper.id=originalElement.id+"_c";if(elementParent){elementParent.insertBefore(wrapper,originalElement);}wrapper.appendChild(originalElement);this.element=wrapper;this.innerElement=originalElement;Dom.setStyle(this.innerElement,"visibility","inherit");},sizeUnderlay:function(){var oUnderlay=this.underlay,oElement;if(oUnderlay){oElement=this.element;oUnderlay.style.width=oElement.offsetWidth+"px";oUnderlay.style.height=oElement.offsetHeight+"px";}},registerDragDrop:function(){var me=this;if(this.header){if(!Util.DD){return;}var bDragOnly=(this.cfg.getProperty("dragonly")===true);this.dd=new Util.DD(this.element.id,this.id,{dragOnly:bDragOnly});if(!this.header.id){this.header.id=this.id+"_h";}this.dd.startDrag=function(){var offsetHeight,offsetWidth,viewPortWidth,viewPortHeight,scrollX,scrollY;if(YAHOO.env.ua.ie==6){Dom.addClass(me.element,"drag");}if(me.cfg.getProperty("constraintoviewport")){var nViewportOffset=Overlay.VIEWPORT_OFFSET;offsetHeight=me.element.offsetHeight;offsetWidth=me.element.offsetWidth;viewPortWidth=Dom.getViewportWidth();viewPortHeight=Dom.getViewportHeight();scrollX=Dom.getDocumentScrollLeft();scrollY=Dom.getDocumentScrollTop();if(offsetHeight+nViewportOffset<viewPortHeight){this.minY=scrollY+nViewportOffset;this.maxY=scrollY+viewPortHeight-offsetHeight-nViewportOffset;}else{this.minY=scrollY+nViewportOffset;this.maxY=scrollY+nViewportOffset;}if(offsetWidth+nViewportOffset<viewPortWidth){this.minX=scrollX+nViewportOffset;this.maxX=scrollX+viewPortWidth-offsetWidth-nViewportOffset;}else{this.minX=scrollX+nViewportOffset;this.maxX=scrollX+nViewportOffset;}this.constrainX=true;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}me.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){me.syncPosition();me.cfg.refireEvent("iframe");if(this.platform=="mac"&&YAHOO.env.ua.gecko){this.showMacGeckoScrollbars();}me.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(YAHOO.env.ua.ie==6){Dom.removeClass(me.element,"drag");}me.dragEvent.fire("endDrag",arguments);me.moveEvent.fire(me.cfg.getProperty("xy"));};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}},buildMask:function(){var oMask=this.mask;if(!oMask){if(!m_oMaskTemplate){m_oMaskTemplate=document.createElement("div");m_oMaskTemplate.className="mask";m_oMaskTemplate.innerHTML="&#160;";}oMask=m_oMaskTemplate.cloneNode(true);oMask.id=this.id+"_mask";document.body.insertBefore(oMask,document.body.firstChild);this.mask=oMask;if(YAHOO.env.ua.gecko&&this.platform=="mac"){Dom.addClass(this.mask,"block-scrollbars");}this.stackMask();}},hideMask:function(){if(this.cfg.getProperty("modal")&&this.mask&&this.beforeHideMaskEvent.fire()){this.mask.style.display="none";Dom.removeClass(document.body,"masked");this.hideMaskEvent.fire();}},showMask:function(){if(this.cfg.getProperty("modal")&&this.mask&&this.beforeShowMaskEvent.fire()){Dom.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}},sizeMask:function(){if(this.mask){var mask=this.mask,viewWidth=Dom.getViewportWidth(),viewHeight=Dom.getViewportHeight();if(mask.offsetHeight>viewHeight){mask.style.height=viewHeight+"px";}if(mask.offsetWidth>viewWidth){mask.style.width=viewWidth+"px";}mask.style.height=Dom.getDocumentHeight()+"px";mask.style.width=Dom.getDocumentWidth()+"px";}},stackMask:function(){if(this.mask){var panelZ=Dom.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(panelZ)&&!isNaN(panelZ)){Dom.setStyle(this.mask,"zIndex",panelZ-1);}}},render:function(appendToNode){return Panel.superclass.render.call(this,appendToNode,this.innerElement);},_renderHeader:function(moduleElement){moduleElement=moduleElement||this.innerElement;Panel.superclass._renderHeader.call(this,moduleElement);},_renderBody:function(moduleElement){moduleElement=moduleElement||this.innerElement;Panel.superclass._renderBody.call(this,moduleElement);},_renderFooter:function(moduleElement){moduleElement=moduleElement||this.innerElement;Panel.superclass._renderFooter.call(this,moduleElement);},destroy:function(shallowPurge){Overlay.windowResizeEvent.unsubscribe(this.sizeMask,this);this.removeMask();if(this.close){Event.purgeElement(this.close);}Panel.superclass.destroy.call(this,shallowPurge);},forceUnderlayRedraw:function(){var u=this.underlay;Dom.addClass(u,"yui-force-redraw");setTimeout(function(){Dom.removeClass(u,"yui-force-redraw");},0);},toString:function(){return"Panel "+this.id;}});}());(function(){YAHOO.widget.Dialog=function(el,userConfig){YAHOO.widget.Dialog.superclass.constructor.call(this,el,userConfig);};var Event=YAHOO.util.Event,CustomEvent=YAHOO.util.CustomEvent,Dom=YAHOO.util.Dom,Dialog=YAHOO.widget.Dialog,Lang=YAHOO.lang,EVENT_TYPES={BEFORE_SUBMIT:"beforeSubmit",SUBMIT:"submit",MANUAL_SUBMIT:"manualSubmit",ASYNC_SUBMIT:"asyncSubmit",FORM_SUBMIT:"formSubmit",CANCEL:"cancel"},DEFAULT_CONFIG={POST_METHOD:{key:"postmethod",value:"async"},POST_DATA:{key:"postdata",value:null},BUTTONS:{key:"buttons",value:"none",supercedes:["visible"]},HIDEAFTERSUBMIT:{key:"hideaftersubmit",value:true}};Dialog.CSS_DIALOG="yui-dialog";function removeButtonEventHandlers(){var aButtons=this._aButtons,nButtons,oButton,i;if(Lang.isArray(aButtons)){nButtons=aButtons.length;if(nButtons>0){i=nButtons-1;do{oButton=aButtons[i];if(YAHOO.widget.Button&&oButton instanceof YAHOO.widget.Button){oButton.destroy();}else{if(oButton.tagName.toUpperCase()=="BUTTON"){Event.purgeElement(oButton);Event.purgeElement(oButton,false);}}}while(i--);}}}YAHOO.extend(Dialog,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){Dialog.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty(DEFAULT_CONFIG.POST_METHOD.key,{handler:this.configPostMethod,value:DEFAULT_CONFIG.POST_METHOD.value,validator:function(val){if(val!="form"&&val!="async"&&val!="none"&&val!="manual"){return false;}else{return true;}}});this.cfg.addProperty(DEFAULT_CONFIG.POST_DATA.key,{value:DEFAULT_CONFIG.POST_DATA.value});this.cfg.addProperty(DEFAULT_CONFIG.HIDEAFTERSUBMIT.key,{value:DEFAULT_CONFIG.HIDEAFTERSUBMIT.value});this.cfg.addProperty(DEFAULT_CONFIG.BUTTONS.key,{handler:this.configButtons,value:DEFAULT_CONFIG.BUTTONS.value,supercedes:DEFAULT_CONFIG.BUTTONS.supercedes});},initEvents:function(){Dialog.superclass.initEvents.call(this);var SIGNATURE=CustomEvent.LIST;this.beforeSubmitEvent=this.createEvent(EVENT_TYPES.BEFORE_SUBMIT);this.beforeSubmitEvent.signature=SIGNATURE;this.submitEvent=this.createEvent(EVENT_TYPES.SUBMIT);this.submitEvent.signature=SIGNATURE;this.manualSubmitEvent=this.createEvent(EVENT_TYPES.MANUAL_SUBMIT);this.manualSubmitEvent.signature=SIGNATURE;this.asyncSubmitEvent=this.createEvent(EVENT_TYPES.ASYNC_SUBMIT);this.asyncSubmitEvent.signature=SIGNATURE;this.formSubmitEvent=this.createEvent(EVENT_TYPES.FORM_SUBMIT);this.formSubmitEvent.signature=SIGNATURE;this.cancelEvent=this.createEvent(EVENT_TYPES.CANCEL);this.cancelEvent.signature=SIGNATURE;},init:function(el,userConfig){Dialog.superclass.init.call(this,el);this.beforeInitEvent.fire(Dialog);Dom.addClass(this.element,Dialog.CSS_DIALOG);this.cfg.setProperty("visible",false);if(userConfig){this.cfg.applyConfig(userConfig,true);}this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.subscribe("changeBody",this.registerForm);this.initEvent.fire(Dialog);},doSubmit:function(){var Connect=YAHOO.util.Connect,oForm=this.form,bUseFileUpload=false,bUseSecureFileUpload=false,aElements,nElements,i,formAttrs;switch(this.cfg.getProperty("postmethod")){case"async":aElements=oForm.elements;nElements=aElements.length;if(nElements>0){i=nElements-1;do{if(aElements[i].type=="file"){bUseFileUpload=true;break;}}while(i--);}if(bUseFileUpload&&YAHOO.env.ua.ie&&this.isSecure){bUseSecureFileUpload=true;}formAttrs=this._getFormAttributes(oForm);Connect.setForm(oForm,bUseFileUpload,bUseSecureFileUpload);var postData=this.cfg.getProperty("postdata");var c=Connect.asyncRequest(formAttrs.method,formAttrs.action,this.callback,postData);this.asyncSubmitEvent.fire(c);break;case"form":oForm.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}},_getFormAttributes:function(oForm){var attrs={method:null,action:null};if(oForm){if(oForm.getAttributeNode){var action=oForm.getAttributeNode("action");var method=oForm.getAttributeNode("method");if(action){attrs.action=action.value;}if(method){attrs.method=method.value;}}else{attrs.action=oForm.getAttribute("action");attrs.method=oForm.getAttribute("method");}}attrs.method=(Lang.isString(attrs.method)?attrs.method:"POST").toUpperCase();attrs.action=Lang.isString(attrs.action)?attrs.action:"";return attrs;},registerForm:function(){var form=this.element.getElementsByTagName("form")[0];if(this.form){if(this.form==form&&Dom.isAncestor(this.element,this.form)){return;}else{Event.purgeElement(this.form);this.form=null;}}if(!form){form=document.createElement("form");form.name="frm_"+this.id;this.body.appendChild(form);}if(form){this.form=form;Event.on(form,"submit",this._submitHandler,this,true);}},_submitHandler:function(e){Event.stopEvent(e);this.submit();this.form.blur();},setTabLoop:function(firstElement,lastElement){firstElement=firstElement||this.firstButton;lastElement=lastElement||this.lastButton;Dialog.superclass.setTabLoop.call(this,firstElement,lastElement);},_setTabLoop:function(firstElement,lastElement){firstElement=firstElement||this.firstButton;lastElement=this.lastButton||lastElement;this.setTabLoop(firstElement,lastElement);},setFirstLastFocusable:function(){Dialog.superclass.setFirstLastFocusable.call(this);var i,l,el,elements=this.focusableElements;this.firstFormElement=null;this.lastFormElement=null;if(this.form&&elements&&elements.length>0){l=elements.length;for(i=0;i<l;++i){el=elements[i];if(this.form===el.form){this.firstFormElement=el;break;}}for(i=l-1;i>=0;--i){el=elements[i];if(this.form===el.form){this.lastFormElement=el;break;}}}},configClose:function(type,args,obj){Dialog.superclass.configClose.apply(this,arguments);},_doClose:function(e){Event.preventDefault(e);this.cancel();},configButtons:function(type,args,obj){var Button=YAHOO.widget.Button,aButtons=args[0],oInnerElement=this.innerElement,oButton,oButtonEl,oYUIButton,nButtons,oSpan,oFooter,i;removeButtonEventHandlers.call(this);this._aButtons=null;if(Lang.isArray(aButtons)){oSpan=document.createElement("span");oSpan.className="button-group";nButtons=aButtons.length;this._aButtons=[];this.defaultHtmlButton=null;for(i=0;i<nButtons;i++){oButton=aButtons[i];if(Button){oYUIButton=new Button({label:oButton.text,type:oButton.type});oYUIButton.appendTo(oSpan);oButtonEl=oYUIButton.get("element");if(oButton.isDefault){oYUIButton.addClass("default");this.defaultHtmlButton=oButtonEl;}if(Lang.isFunction(oButton.handler)){oYUIButton.set("onclick",{fn:oButton.handler,obj:this,scope:this});}else{if(Lang.isObject(oButton.handler)&&Lang.isFunction(oButton.handler.fn)){oYUIButton.set("onclick",{fn:oButton.handler.fn,obj:((!Lang.isUndefined(oButton.handler.obj))?oButton.handler.obj:this),scope:(oButton.handler.scope||this)});}}this._aButtons[this._aButtons.length]=oYUIButton;}else{oButtonEl=document.createElement("button");oButtonEl.setAttribute("type","button");if(oButton.isDefault){oButtonEl.className="default";this.defaultHtmlButton=oButtonEl;}oButtonEl.innerHTML=oButton.text;if(Lang.isFunction(oButton.handler)){Event.on(oButtonEl,"click",oButton.handler,this,true);}else{if(Lang.isObject(oButton.handler)&&Lang.isFunction(oButton.handler.fn)){Event.on(oButtonEl,"click",oButton.handler.fn,((!Lang.isUndefined(oButton.handler.obj))?oButton.handler.obj:this),(oButton.handler.scope||this));}}oSpan.appendChild(oButtonEl);this._aButtons[this._aButtons.length]=oButtonEl;}oButton.htmlButton=oButtonEl;if(i===0){this.firstButton=oButtonEl;}if(i==(nButtons-1)){this.lastButton=oButtonEl;}}this.setFooter(oSpan);oFooter=this.footer;if(Dom.inDocument(this.element)&&!Dom.isAncestor(oInnerElement,oFooter)){oInnerElement.appendChild(oFooter);}this.buttonSpan=oSpan;}else{oSpan=this.buttonSpan;oFooter=this.footer;if(oSpan&&oFooter){oFooter.removeChild(oSpan);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}this.changeContentEvent.fire();},getButtons:function(){return this._aButtons||null;},focusFirst:function(type,args,obj){var el=this.firstFormElement,focused=false;if(args&&args[1]){Event.stopEvent(args[1]);if(args[0]===9&&this.firstElement){el=this.firstElement;}}if(el){try{el.focus();focused=true;}catch(oException){}}else{if(this.defaultHtmlButton){focused=this.focusDefaultButton();}else{focused=this.focusFirstButton();}}return focused;},focusLast:function(type,args,obj){var aButtons=this.cfg.getProperty("buttons"),el=this.lastFormElement,focused=false;if(args&&args[1]){Event.stopEvent(args[1]);if(args[0]===9&&this.lastElement){el=this.lastElement;}}if(aButtons&&Lang.isArray(aButtons)){focused=this.focusLastButton();}else{if(el){try{el.focus();focused=true;}catch(oException){}}}return focused;},_getButton:function(button){var Button=YAHOO.widget.Button;if(Button&&button&&button.nodeName&&button.id){button=Button.getButton(button.id)||button;}return button;},focusDefaultButton:function(){var button=this._getButton(this.defaultHtmlButton),focused=false;if(button){try{button.focus();focused=true;}catch(oException){}}return focused;},blurButtons:function(){var aButtons=this.cfg.getProperty("buttons"),nButtons,oButton,oElement,i;if(aButtons&&Lang.isArray(aButtons)){nButtons=aButtons.length;if(nButtons>0){i=(nButtons-1);do{oButton=aButtons[i];if(oButton){oElement=this._getButton(oButton.htmlButton);if(oElement){try{oElement.blur();}catch(oException){}}}}while(i--);}}},focusFirstButton:function(){var aButtons=this.cfg.getProperty("buttons"),oButton,oElement,focused=false;if(aButtons&&Lang.isArray(aButtons)){oButton=aButtons[0];if(oButton){oElement=this._getButton(oButton.htmlButton);if(oElement){try{oElement.focus();focused=true;}catch(oException){}}}}return focused;},focusLastButton:function(){var aButtons=this.cfg.getProperty("buttons"),nButtons,oButton,oElement,focused=false;if(aButtons&&Lang.isArray(aButtons)){nButtons=aButtons.length;if(nButtons>0){oButton=aButtons[(nButtons-1)];if(oButton){oElement=this._getButton(oButton.htmlButton);if(oElement){try{oElement.focus();focused=true;}catch(oException){}}}}}return focused;},configPostMethod:function(type,args,obj){this.registerForm();},validate:function(){return true;},submit:function(){if(this.validate()){if(this.beforeSubmitEvent.fire()){this.doSubmit();this.submitEvent.fire();if(this.cfg.getProperty("hideaftersubmit")){this.hide();}return true;}else{return false;}}else{return false;}},cancel:function(){this.cancelEvent.fire();this.hide();},getData:function(){var oForm=this.form,aElements,nTotalElements,oData,sName,oElement,nElements,sType,sTagName,aOptions,nOptions,aValues,oOption,oRadio,oCheckbox,valueAttr,i,n;function isFormElement(p_oElement){var sTag=p_oElement.tagName.toUpperCase();return((sTag=="INPUT"||sTag=="TEXTAREA"||sTag=="SELECT")&&p_oElement.name==sName);}if(oForm){aElements=oForm.elements;nTotalElements=aElements.length;oData={};for(i=0;i<nTotalElements;i++){sName=aElements[i].name;oElement=Dom.getElementsBy(isFormElement,"*",oForm);nElements=oElement.length;if(nElements>0){if(nElements==1){oElement=oElement[0];sType=oElement.type;sTagName=oElement.tagName.toUpperCase();switch(sTagName){case"INPUT":if(sType=="checkbox"){oData[sName]=oElement.checked;}else{if(sType!="radio"){oData[sName]=oElement.value;}}break;case"TEXTAREA":oData[sName]=oElement.value;break;case"SELECT":aOptions=oElement.options;nOptions=aOptions.length;aValues=[];for(n=0;n<nOptions;n++){oOption=aOptions[n];if(oOption.selected){valueAttr=oOption.attributes.value;aValues[aValues.length]=(valueAttr&&valueAttr.specified)?oOption.value:oOption.text;}}oData[sName]=aValues;break;}}else{sType=oElement[0].type;switch(sType){case"radio":for(n=0;n<nElements;n++){oRadio=oElement[n];if(oRadio.checked){oData[sName]=oRadio.value;break;}}break;case"checkbox":aValues=[];for(n=0;n<nElements;n++){oCheckbox=oElement[n];if(oCheckbox.checked){aValues[aValues.length]=oCheckbox.value;}}oData[sName]=aValues;break;}}}}}return oData;},destroy:function(shallowPurge){removeButtonEventHandlers.call(this);this._aButtons=null;var aForms=this.element.getElementsByTagName("form"),oForm;if(aForms.length>0){oForm=aForms[0];if(oForm){Event.purgeElement(oForm);if(oForm.parentNode){oForm.parentNode.removeChild(oForm);}this.form=null;}}Dialog.superclass.destroy.call(this,shallowPurge);},toString:function(){return"Dialog "+this.id;}});}());(function(){YAHOO.widget.SimpleDialog=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,el,userConfig);};var Dom=YAHOO.util.Dom,SimpleDialog=YAHOO.widget.SimpleDialog,DEFAULT_CONFIG={ICON:{key:"icon",value:"none",suppressEvent:true},TEXT:{key:"text",value:"",suppressEvent:true,supercedes:["icon"]}};SimpleDialog.ICON_BLOCK="blckicon";SimpleDialog.ICON_ALARM="alrticon";SimpleDialog.ICON_HELP="hlpicon";SimpleDialog.ICON_INFO="infoicon";SimpleDialog.ICON_WARN="warnicon";SimpleDialog.ICON_TIP="tipicon";SimpleDialog.ICON_CSS_CLASSNAME="yui-icon";SimpleDialog.CSS_SIMPLEDIALOG="yui-simple-dialog";YAHOO.extend(SimpleDialog,YAHOO.widget.Dialog,{initDefaultConfig:function(){SimpleDialog.superclass.initDefaultConfig.call(this);this.cfg.addProperty(DEFAULT_CONFIG.ICON.key,{handler:this.configIcon,value:DEFAULT_CONFIG.ICON.value,suppressEvent:DEFAULT_CONFIG.ICON.suppressEvent});this.cfg.addProperty(DEFAULT_CONFIG.TEXT.key,{handler:this.configText,value:DEFAULT_CONFIG.TEXT.value,suppressEvent:DEFAULT_CONFIG.TEXT.suppressEvent,supercedes:DEFAULT_CONFIG.TEXT.supercedes});},init:function(el,userConfig){SimpleDialog.superclass.init.call(this,el);this.beforeInitEvent.fire(SimpleDialog);Dom.addClass(this.element,SimpleDialog.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(userConfig){this.cfg.applyConfig(userConfig,true);}this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(SimpleDialog);},registerForm:function(){SimpleDialog.superclass.registerForm.call(this);var doc=this.form.ownerDocument,input=doc.createElement("input");input.type="hidden";input.name=this.id;input.value="";this.form.appendChild(input);},configIcon:function(type,args,obj){var sIcon=args[0],oBody=this.body,sCSSClass=SimpleDialog.ICON_CSS_CLASSNAME,aElements,oIcon,oIconParent;if(sIcon&&sIcon!="none"){aElements=Dom.getElementsByClassName(sCSSClass,"*",oBody);if(aElements.length===1){oIcon=aElements[0];oIconParent=oIcon.parentNode;if(oIconParent){oIconParent.removeChild(oIcon);oIcon=null;}}if(sIcon.indexOf(".")==-1){oIcon=document.createElement("span");oIcon.className=(sCSSClass+" "+sIcon);oIcon.innerHTML="&#160;";}else{oIcon=document.createElement("img");oIcon.src=(this.imageRoot+sIcon);oIcon.className=sCSSClass;}if(oIcon){oBody.insertBefore(oIcon,oBody.firstChild);}}},configText:function(type,args,obj){var text=args[0];if(text){this.setBody(text);this.cfg.refireEvent("icon");}},toString:function(){return"SimpleDialog "+this.id;}});}());(function(){YAHOO.widget.ContainerEffect=function(overlay,attrIn,attrOut,targetElement,animClass){if(!animClass){animClass=YAHOO.util.Anim;}this.overlay=overlay;this.attrIn=attrIn;this.attrOut=attrOut;this.targetElement=targetElement||overlay.element;this.animClass=animClass;};var Dom=YAHOO.util.Dom,CustomEvent=YAHOO.util.CustomEvent,ContainerEffect=YAHOO.widget.ContainerEffect;ContainerEffect.FADE=function(overlay,dur){var Easing=YAHOO.util.Easing,fin={attributes:{opacity:{from:0,to:1}},duration:dur,method:Easing.easeIn},fout={attributes:{opacity:{to:0}},duration:dur,method:Easing.easeOut},fade=new ContainerEffect(overlay,fin,fout,overlay.element);fade.handleUnderlayStart=function(){var underlay=this.overlay.underlay;if(underlay&&YAHOO.env.ua.ie){var hasFilters=(underlay.filters&&underlay.filters.length>0);if(hasFilters){Dom.addClass(overlay.element,"yui-effect-fade");}}};fade.handleUnderlayComplete=function(){var underlay=this.overlay.underlay;if(underlay&&YAHOO.env.ua.ie){Dom.removeClass(overlay.element,"yui-effect-fade");}};fade.handleStartAnimateIn=function(type,args,obj){obj.overlay._fadingIn=true;Dom.addClass(obj.overlay.element,"hide-select");if(!obj.overlay.underlay){obj.overlay.cfg.refireEvent("underlay");}obj.handleUnderlayStart();obj.overlay._setDomVisibility(true);Dom.setStyle(obj.overlay.element,"opacity",0);};fade.handleCompleteAnimateIn=function(type,args,obj){obj.overlay._fadingIn=false;Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}obj.handleUnderlayComplete();obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};fade.handleStartAnimateOut=function(type,args,obj){obj.overlay._fadingOut=true;Dom.addClass(obj.overlay.element,"hide-select");obj.handleUnderlayStart();};fade.handleCompleteAnimateOut=function(type,args,obj){obj.overlay._fadingOut=false;Dom.removeClass(obj.overlay.element,"hide-select");if(obj.overlay.element.style.filter){obj.overlay.element.style.filter=null;}obj.overlay._setDomVisibility(false);Dom.setStyle(obj.overlay.element,"opacity",1);obj.handleUnderlayComplete();obj.overlay.cfg.refireEvent("iframe");obj.animateOutCompleteEvent.fire();};fade.init();return fade;};ContainerEffect.SLIDE=function(overlay,dur){var Easing=YAHOO.util.Easing,x=overlay.cfg.getProperty("x")||Dom.getX(overlay.element),y=overlay.cfg.getProperty("y")||Dom.getY(overlay.element),clientWidth=Dom.getClientWidth(),offsetWidth=overlay.element.offsetWidth,sin={attributes:{points:{to:[x,y]}},duration:dur,method:Easing.easeIn},sout={attributes:{points:{to:[(clientWidth+25),y]}},duration:dur,method:Easing.easeOut},slide=new ContainerEffect(overlay,sin,sout,overlay.element,YAHOO.util.Motion);slide.handleStartAnimateIn=function(type,args,obj){obj.overlay.element.style.left=((-25)-offsetWidth)+"px";obj.overlay.element.style.top=y+"px";};slide.handleTweenAnimateIn=function(type,args,obj){var pos=Dom.getXY(obj.overlay.element),currentX=pos[0],currentY=pos[1];if(Dom.getStyle(obj.overlay.element,"visibility")=="hidden"&&currentX<x){obj.overlay._setDomVisibility(true);}obj.overlay.cfg.setProperty("xy",[currentX,currentY],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateIn=function(type,args,obj){obj.overlay.cfg.setProperty("xy",[x,y],true);obj.startX=x;obj.startY=y;obj.overlay.cfg.refireEvent("iframe");obj.animateInCompleteEvent.fire();};slide.handleStartAnimateOut=function(type,args,obj){var vw=Dom.getViewportWidth(),pos=Dom.getXY(obj.overlay.element),yso=pos[1];obj.animOut.attributes.points.to=[(vw+25),yso];};slide.handleTweenAnimateOut=function(type,args,obj){var pos=Dom.getXY(obj.overlay.element),xto=pos[0],yto=pos[1];obj.overlay.cfg.setProperty("xy",[xto,yto],true);obj.overlay.cfg.refireEvent("iframe");};slide.handleCompleteAnimateOut=function(type,args,obj){obj.overlay._setDomVisibility(false);obj.overlay.cfg.setProperty("xy",[x,y]);obj.animateOutCompleteEvent.fire();};slide.init();return slide;};ContainerEffect.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=CustomEvent.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=CustomEvent.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=CustomEvent.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=CustomEvent.LIST;this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);},animateIn:function(){this._stopAnims(this.lastFrameOnStop);this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this._stopAnims(this.lastFrameOnStop);this.beforeAnimateOutEvent.fire();this.animOut.animate();},lastFrameOnStop:true,_stopAnims:function(finish){if(this.animOut&&this.animOut.isAnimated()){this.animOut.stop(finish);}if(this.animIn&&this.animIn.isAnimated()){this.animIn.stop(finish);}},handleStartAnimateIn:function(type,args,obj){},handleTweenAnimateIn:function(type,args,obj){},handleCompleteAnimateIn:function(type,args,obj){},handleStartAnimateOut:function(type,args,obj){},handleTweenAnimateOut:function(type,args,obj){},handleCompleteAnimateOut:function(type,args,obj){},toString:function(){var output="ContainerEffect";if(this.overlay){output+=" ["+this.overlay.toString()+"]";}return output;}};YAHOO.lang.augmentProto(ContainerEffect,YAHOO.util.EventProvider);})();YAHOO.register("container",YAHOO.widget.Module,{version:"2.9.0",build:"2800"});
/*http://www.physiotherapyalberta.ca/portal_javascripts/build/menu/menu.js?original=1*/
(function(){var UA=YAHOO.env.ua,Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Lang=YAHOO.lang,_DIV="DIV",_HD="hd",_BD="bd",_FT="ft",_LI="LI",_DISABLED="disabled",_MOUSEOVER="mouseover",_MOUSEOUT="mouseout",_MOUSEDOWN="mousedown",_MOUSEUP="mouseup",_CLICK="click",_KEYDOWN="keydown",_KEYUP="keyup",_KEYPRESS="keypress",_CLICK_TO_HIDE="clicktohide",_POSITION="position",_DYNAMIC="dynamic",_SHOW_DELAY="showdelay",_SELECTED="selected",_VISIBLE="visible",_UL="UL",_MENUMANAGER="MenuManager";YAHOO.widget.MenuManager=function(){var m_bInitializedEventHandlers=false,m_oMenus={},m_oVisibleMenus={},m_oItems={},m_oEventTypes={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_oFocusedMenuItem=null;function getMenuRootElement(p_oElement){var oParentNode,returnVal;if(p_oElement&&p_oElement.tagName){switch(p_oElement.tagName.toUpperCase()){case _DIV:oParentNode=p_oElement.parentNode;if((Dom.hasClass(p_oElement,_HD)||Dom.hasClass(p_oElement,_BD)||Dom.hasClass(p_oElement,_FT))&&oParentNode&&oParentNode.tagName&&oParentNode.tagName.toUpperCase()==_DIV){returnVal=oParentNode;}else{returnVal=p_oElement;}break;case _LI:returnVal=p_oElement;break;default:oParentNode=p_oElement.parentNode;if(oParentNode){returnVal=getMenuRootElement(oParentNode);}break;}}return returnVal;}function onDOMEvent(p_oEvent){var oTarget=Event.getTarget(p_oEvent),oElement=getMenuRootElement(oTarget),bFireEvent=true,sEventType=p_oEvent.type,sCustomEventType,sTagName,sId,oMenuItem,oMenu;if(oElement){sTagName=oElement.tagName.toUpperCase();if(sTagName==_LI){sId=oElement.id;if(sId&&m_oItems[sId]){oMenuItem=m_oItems[sId];oMenu=oMenuItem.parent;}}else{if(sTagName==_DIV){if(oElement.id){oMenu=m_oMenus[oElement.id];}}}}if(oMenu){sCustomEventType=m_oEventTypes[sEventType];if(sEventType=="click"&&(UA.gecko&&oMenu.platform!="mac")&&p_oEvent.button>0){bFireEvent=false;}if(bFireEvent&&oMenuItem&&!oMenuItem.cfg.getProperty(_DISABLED)){oMenuItem[sCustomEventType].fire(p_oEvent);}if(bFireEvent){oMenu[sCustomEventType].fire(p_oEvent,oMenuItem);}}else{if(sEventType==_MOUSEDOWN){for(var i in m_oVisibleMenus){if(Lang.hasOwnProperty(m_oVisibleMenus,i)){oMenu=m_oVisibleMenus[i];if(oMenu.cfg.getProperty(_CLICK_TO_HIDE)&&!(oMenu instanceof YAHOO.widget.MenuBar)&&oMenu.cfg.getProperty(_POSITION)==_DYNAMIC){oMenu.hide();if(UA.ie&&oTarget.focus&&(UA.ie<9)){oTarget.setActive();}}else{if(oMenu.cfg.getProperty(_SHOW_DELAY)>0){oMenu._cancelShowDelay();}if(oMenu.activeItem){oMenu.activeItem.blur();oMenu.activeItem.cfg.setProperty(_SELECTED,false);oMenu.activeItem=null;}}}}}}}function onMenuDestroy(p_sType,p_aArgs,p_oMenu){if(m_oMenus[p_oMenu.id]){this.removeMenu(p_oMenu);}}function onMenuFocus(p_sType,p_aArgs){var oItem=p_aArgs[1];if(oItem){m_oFocusedMenuItem=oItem;}}function onMenuBlur(p_sType,p_aArgs){m_oFocusedMenuItem=null;}function onMenuVisibleConfigChange(p_sType,p_aArgs){var bVisible=p_aArgs[0],sId=this.id;if(bVisible){m_oVisibleMenus[sId]=this;}else{if(m_oVisibleMenus[sId]){delete m_oVisibleMenus[sId];}}}function onItemDestroy(p_sType,p_aArgs){removeItem(this);}function removeItem(p_oMenuItem){var sId=p_oMenuItem.id;if(sId&&m_oItems[sId]){if(m_oFocusedMenuItem==p_oMenuItem){m_oFocusedMenuItem=null;}delete m_oItems[sId];p_oMenuItem.destroyEvent.unsubscribe(onItemDestroy);}}function onItemAdded(p_sType,p_aArgs){var oItem=p_aArgs[0],sId;if(oItem instanceof YAHOO.widget.MenuItem){sId=oItem.id;if(!m_oItems[sId]){m_oItems[sId]=oItem;oItem.destroyEvent.subscribe(onItemDestroy);}}}return{addMenu:function(p_oMenu){var oDoc;if(p_oMenu instanceof YAHOO.widget.Menu&&p_oMenu.id&&!m_oMenus[p_oMenu.id]){m_oMenus[p_oMenu.id]=p_oMenu;if(!m_bInitializedEventHandlers){oDoc=document;Event.on(oDoc,_MOUSEOVER,onDOMEvent,this,true);Event.on(oDoc,_MOUSEOUT,onDOMEvent,this,true);Event.on(oDoc,_MOUSEDOWN,onDOMEvent,this,true);Event.on(oDoc,_MOUSEUP,onDOMEvent,this,true);Event.on(oDoc,_CLICK,onDOMEvent,this,true);Event.on(oDoc,_KEYDOWN,onDOMEvent,this,true);Event.on(oDoc,_KEYUP,onDOMEvent,this,true);Event.on(oDoc,_KEYPRESS,onDOMEvent,this,true);Event.onFocus(oDoc,onDOMEvent,this,true);Event.onBlur(oDoc,onDOMEvent,this,true);m_bInitializedEventHandlers=true;}p_oMenu.cfg.subscribeToConfigEvent(_VISIBLE,onMenuVisibleConfigChange);p_oMenu.destroyEvent.subscribe(onMenuDestroy,p_oMenu,this);p_oMenu.itemAddedEvent.subscribe(onItemAdded);p_oMenu.focusEvent.subscribe(onMenuFocus);p_oMenu.blurEvent.subscribe(onMenuBlur);}},removeMenu:function(p_oMenu){var sId,aItems,i;if(p_oMenu){sId=p_oMenu.id;if((sId in m_oMenus)&&(m_oMenus[sId]==p_oMenu)){aItems=p_oMenu.getItems();if(aItems&&aItems.length>0){i=aItems.length-1;do{removeItem(aItems[i]);}while(i--);}delete m_oMenus[sId];if((sId in m_oVisibleMenus)&&(m_oVisibleMenus[sId]==p_oMenu)){delete m_oVisibleMenus[sId];}if(p_oMenu.cfg){p_oMenu.cfg.unsubscribeFromConfigEvent(_VISIBLE,onMenuVisibleConfigChange);}p_oMenu.destroyEvent.unsubscribe(onMenuDestroy,p_oMenu);p_oMenu.itemAddedEvent.unsubscribe(onItemAdded);p_oMenu.focusEvent.unsubscribe(onMenuFocus);p_oMenu.blurEvent.unsubscribe(onMenuBlur);}}},hideVisible:function(){var oMenu;for(var i in m_oVisibleMenus){if(Lang.hasOwnProperty(m_oVisibleMenus,i)){oMenu=m_oVisibleMenus[i];if(!(oMenu instanceof YAHOO.widget.MenuBar)&&oMenu.cfg.getProperty(_POSITION)==_DYNAMIC){oMenu.hide();}}}},getVisible:function(){return m_oVisibleMenus;},getMenus:function(){return m_oMenus;},getMenu:function(p_sId){var returnVal;if(p_sId in m_oMenus){returnVal=m_oMenus[p_sId];}return returnVal;},getMenuItem:function(p_sId){var returnVal;if(p_sId in m_oItems){returnVal=m_oItems[p_sId];}return returnVal;},getMenuItemGroup:function(p_sId){var oUL=Dom.get(p_sId),aItems,oNode,oItem,sId,returnVal;if(oUL&&oUL.tagName&&oUL.tagName.toUpperCase()==_UL){oNode=oUL.firstChild;if(oNode){aItems=[];do{sId=oNode.id;if(sId){oItem=this.getMenuItem(sId);if(oItem){aItems[aItems.length]=oItem;}}}while((oNode=oNode.nextSibling));if(aItems.length>0){returnVal=aItems;}}}return returnVal;},getFocusedMenuItem:function(){return m_oFocusedMenuItem;},getFocusedMenu:function(){var returnVal;if(m_oFocusedMenuItem){returnVal=m_oFocusedMenuItem.parent.getRoot();}return returnVal;},toString:function(){return _MENUMANAGER;}};}();})();(function(){var Lang=YAHOO.lang,_MENU="Menu",_DIV_UPPERCASE="DIV",_DIV_LOWERCASE="div",_ID="id",_SELECT="SELECT",_XY="xy",_Y="y",_UL_UPPERCASE="UL",_UL_LOWERCASE="ul",_FIRST_OF_TYPE="first-of-type",_LI="LI",_OPTGROUP="OPTGROUP",_OPTION="OPTION",_DISABLED="disabled",_NONE="none",_SELECTED="selected",_GROUP_INDEX="groupindex",_INDEX="index",_SUBMENU="submenu",_VISIBLE="visible",_HIDE_DELAY="hidedelay",_POSITION="position",_DYNAMIC="dynamic",_STATIC="static",_DYNAMIC_STATIC=_DYNAMIC+","+_STATIC,_URL="url",_HASH="#",_TARGET="target",_MAX_HEIGHT="maxheight",_TOP_SCROLLBAR="topscrollbar",_BOTTOM_SCROLLBAR="bottomscrollbar",_UNDERSCORE="_",_TOP_SCROLLBAR_DISABLED=_TOP_SCROLLBAR+_UNDERSCORE+_DISABLED,_BOTTOM_SCROLLBAR_DISABLED=_BOTTOM_SCROLLBAR+_UNDERSCORE+_DISABLED,_MOUSEMOVE="mousemove",_SHOW_DELAY="showdelay",_SUBMENU_HIDE_DELAY="submenuhidedelay",_IFRAME="iframe",_CONSTRAIN_TO_VIEWPORT="constraintoviewport",_PREVENT_CONTEXT_OVERLAP="preventcontextoverlap",_SUBMENU_ALIGNMENT="submenualignment",_AUTO_SUBMENU_DISPLAY="autosubmenudisplay",_CLICK_TO_HIDE="clicktohide",_CONTAINER="container",_SCROLL_INCREMENT="scrollincrement",_MIN_SCROLL_HEIGHT="minscrollheight",_CLASSNAME="classname",_SHADOW="shadow",_KEEP_OPEN="keepopen",_HD="hd",_HAS_TITLE="hastitle",_CONTEXT="context",_EMPTY_STRING="",_MOUSEDOWN="mousedown",_KEYDOWN="keydown",_HEIGHT="height",_WIDTH="width",_PX="px",_EFFECT="effect",_MONITOR_RESIZE="monitorresize",_DISPLAY="display",_BLOCK="block",_VISIBILITY="visibility",_ABSOLUTE="absolute",_ZINDEX="zindex",_YUI_MENU_BODY_SCROLLED="yui-menu-body-scrolled",_NON_BREAKING_SPACE="&#32;",_SPACE=" ",_MOUSEOVER="mouseover",_MOUSEOUT="mouseout",_ITEM_ADDED="itemAdded",_ITEM_REMOVED="itemRemoved",_HIDDEN="hidden",_YUI_MENU_SHADOW="yui-menu-shadow",_YUI_MENU_SHADOW_VISIBLE=_YUI_MENU_SHADOW+"-visible",_YUI_MENU_SHADOW_YUI_MENU_SHADOW_VISIBLE=_YUI_MENU_SHADOW+_SPACE+_YUI_MENU_SHADOW_VISIBLE;YAHOO.widget.Menu=function(p_oElement,p_oConfig){if(p_oConfig){this.parent=p_oConfig.parent;this.lazyLoad=p_oConfig.lazyLoad||p_oConfig.lazyload;this.itemData=p_oConfig.itemData||p_oConfig.itemdata;}YAHOO.widget.Menu.superclass.constructor.call(this,p_oElement,p_oConfig);};function checkPosition(p_sPosition){var returnVal=false;if(Lang.isString(p_sPosition)){returnVal=(_DYNAMIC_STATIC.indexOf((p_sPosition.toLowerCase()))!=-1);}return returnVal;}var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Module=YAHOO.widget.Module,Overlay=YAHOO.widget.Overlay,Menu=YAHOO.widget.Menu,MenuManager=YAHOO.widget.MenuManager,CustomEvent=YAHOO.util.CustomEvent,UA=YAHOO.env.ua,m_oShadowTemplate,bFocusListenerInitialized=false,oFocusedElement,EVENT_TYPES=[["mouseOverEvent",_MOUSEOVER],["mouseOutEvent",_MOUSEOUT],["mouseDownEvent",_MOUSEDOWN],["mouseUpEvent","mouseup"],["clickEvent","click"],["keyPressEvent","keypress"],["keyDownEvent",_KEYDOWN],["keyUpEvent","keyup"],["focusEvent","focus"],["blurEvent","blur"],["itemAddedEvent",_ITEM_ADDED],["itemRemovedEvent",_ITEM_REMOVED]],VISIBLE_CONFIG={key:_VISIBLE,value:false,validator:Lang.isBoolean},CONSTRAIN_TO_VIEWPORT_CONFIG={key:_CONSTRAIN_TO_VIEWPORT,value:true,validator:Lang.isBoolean,supercedes:[_IFRAME,"x",_Y,_XY]},PREVENT_CONTEXT_OVERLAP_CONFIG={key:_PREVENT_CONTEXT_OVERLAP,value:true,validator:Lang.isBoolean,supercedes:[_CONSTRAIN_TO_VIEWPORT]},POSITION_CONFIG={key:_POSITION,value:_DYNAMIC,validator:checkPosition,supercedes:[_VISIBLE,_IFRAME]},SUBMENU_ALIGNMENT_CONFIG={key:_SUBMENU_ALIGNMENT,value:["tl","tr"]},AUTO_SUBMENU_DISPLAY_CONFIG={key:_AUTO_SUBMENU_DISPLAY,value:true,validator:Lang.isBoolean,suppressEvent:true},SHOW_DELAY_CONFIG={key:_SHOW_DELAY,value:250,validator:Lang.isNumber,suppressEvent:true},HIDE_DELAY_CONFIG={key:_HIDE_DELAY,value:0,validator:Lang.isNumber,suppressEvent:true},SUBMENU_HIDE_DELAY_CONFIG={key:_SUBMENU_HIDE_DELAY,value:250,validator:Lang.isNumber,suppressEvent:true},CLICK_TO_HIDE_CONFIG={key:_CLICK_TO_HIDE,value:true,validator:Lang.isBoolean,suppressEvent:true},CONTAINER_CONFIG={key:_CONTAINER,suppressEvent:true},SCROLL_INCREMENT_CONFIG={key:_SCROLL_INCREMENT,value:1,validator:Lang.isNumber,supercedes:[_MAX_HEIGHT],suppressEvent:true},MIN_SCROLL_HEIGHT_CONFIG={key:_MIN_SCROLL_HEIGHT,value:90,validator:Lang.isNumber,supercedes:[_MAX_HEIGHT],suppressEvent:true},MAX_HEIGHT_CONFIG={key:_MAX_HEIGHT,value:0,validator:Lang.isNumber,supercedes:[_IFRAME],suppressEvent:true},CLASS_NAME_CONFIG={key:_CLASSNAME,value:null,validator:Lang.isString,suppressEvent:true},DISABLED_CONFIG={key:_DISABLED,value:false,validator:Lang.isBoolean,suppressEvent:true},SHADOW_CONFIG={key:_SHADOW,value:true,validator:Lang.isBoolean,suppressEvent:true,supercedes:[_VISIBLE]},KEEP_OPEN_CONFIG={key:_KEEP_OPEN,value:false,validator:Lang.isBoolean};function onDocFocus(event){oFocusedElement=Event.getTarget(event);}YAHOO.lang.extend(Menu,Overlay,{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(p_oElement,p_oConfig){this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuItem;}var oElement;if(Lang.isString(p_oElement)){oElement=Dom.get(p_oElement);}else{if(p_oElement.tagName){oElement=p_oElement;}}if(oElement&&oElement.tagName){switch(oElement.tagName.toUpperCase()){case _DIV_UPPERCASE:this.srcElement=oElement;if(!oElement.id){oElement.setAttribute(_ID,Dom.generateId());}Menu.superclass.init.call(this,oElement);this.beforeInitEvent.fire(Menu);break;case _SELECT:this.srcElement=oElement;Menu.superclass.init.call(this,Dom.generateId());this.beforeInitEvent.fire(Menu);break;}}else{Menu.superclass.init.call(this,p_oElement);this.beforeInitEvent.fire(Menu);}if(this.element){Dom.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(!bFocusListenerInitialized){Event.onFocus(document,onDocFocus);bFocusListenerInitialized=true;}if((UA.gecko&&UA.gecko<1.9)||(UA.webkit&&UA.webkit<523)){this.cfg.subscribeToConfigEvent(_Y,this._onYChange);}if(p_oConfig){this.cfg.applyConfig(p_oConfig,true);}MenuManager.addMenu(this);this.initEvent.fire(Menu);}},_initSubTree:function(){var oSrcElement=this.srcElement,sSrcElementTagName,nGroup,sGroupTitleTagName,oNode,aListElements,nListElements,i;if(oSrcElement){sSrcElementTagName=(oSrcElement.tagName&&oSrcElement.tagName.toUpperCase());if(sSrcElementTagName==_DIV_UPPERCASE){oNode=this.body.firstChild;if(oNode){nGroup=0;sGroupTitleTagName=this.GROUP_TITLE_TAG_NAME.toUpperCase();do{if(oNode&&oNode.tagName){switch(oNode.tagName.toUpperCase()){case sGroupTitleTagName:this._aGroupTitleElements[nGroup]=oNode;break;case _UL_UPPERCASE:this._aListElements[nGroup]=oNode;this._aItemGroups[nGroup]=[];nGroup++;break;}}}while((oNode=oNode.nextSibling));if(this._aListElements[0]){Dom.addClass(this._aListElements[0],_FIRST_OF_TYPE);}}}oNode=null;if(sSrcElementTagName){switch(sSrcElementTagName){case _DIV_UPPERCASE:aListElements=this._aListElements;nListElements=aListElements.length;if(nListElements>0){i=nListElements-1;do{oNode=aListElements[i].firstChild;if(oNode){do{if(oNode&&oNode.tagName&&oNode.tagName.toUpperCase()==_LI){this.addItem(new this.ITEM_TYPE(oNode,{parent:this}),i);}}while((oNode=oNode.nextSibling));}}while(i--);}break;case _SELECT:oNode=oSrcElement.firstChild;do{if(oNode&&oNode.tagName){switch(oNode.tagName.toUpperCase()){case _OPTGROUP:case _OPTION:this.addItem(new this.ITEM_TYPE(oNode,{parent:this}));break;}}}while((oNode=oNode.nextSibling));break;}}}},_getFirstEnabledItem:function(){var aItems=this.getItems(),nItems=aItems.length,oItem,returnVal;for(var i=0;i<nItems;i++){oItem=aItems[i];if(oItem&&!oItem.cfg.getProperty(_DISABLED)&&oItem.element.style.display!=_NONE){returnVal=oItem;break;}}return returnVal;},_addItemToGroup:function(p_nGroupIndex,p_oItem,p_nItemIndex){var oItem,nGroupIndex,aGroup,oGroupItem,bAppend,oNextItemSibling,nItemIndex,returnVal;function getNextItemSibling(p_aArray,p_nStartIndex){return(p_aArray[p_nStartIndex]||getNextItemSibling(p_aArray,(p_nStartIndex+1)));}if(p_oItem instanceof this.ITEM_TYPE){oItem=p_oItem;oItem.parent=this;}else{if(Lang.isString(p_oItem)){oItem=new this.ITEM_TYPE(p_oItem,{parent:this});}else{if(Lang.isObject(p_oItem)){p_oItem.parent=this;oItem=new this.ITEM_TYPE(p_oItem.text,p_oItem);}}}if(oItem){if(oItem.cfg.getProperty(_SELECTED)){this.activeItem=oItem;}nGroupIndex=Lang.isNumber(p_nGroupIndex)?p_nGroupIndex:0;aGroup=this._getItemGroup(nGroupIndex);if(!aGroup){aGroup=this._createItemGroup(nGroupIndex);}if(Lang.isNumber(p_nItemIndex)){bAppend=(p_nItemIndex>=aGroup.length);if(aGroup[p_nItemIndex]){aGroup.splice(p_nItemIndex,0,oItem);}else{aGroup[p_nItemIndex]=oItem;}oGroupItem=aGroup[p_nItemIndex];if(oGroupItem){if(bAppend&&(!oGroupItem.element.parentNode||oGroupItem.element.parentNode.nodeType==11)){this._aListElements[nGroupIndex].appendChild(oGroupItem.element);}else{oNextItemSibling=getNextItemSibling(aGroup,(p_nItemIndex+1));if(oNextItemSibling&&(!oGroupItem.element.parentNode||oGroupItem.element.parentNode.nodeType==11)){this._aListElements[nGroupIndex].insertBefore(oGroupItem.element,oNextItemSibling.element);}}oGroupItem.parent=this;this._subscribeToItemEvents(oGroupItem);this._configureSubmenu(oGroupItem);this._updateItemProperties(nGroupIndex);this.itemAddedEvent.fire(oGroupItem);this.changeContentEvent.fire();returnVal=oGroupItem;}}else{nItemIndex=aGroup.length;aGroup[nItemIndex]=oItem;oGroupItem=aGroup[nItemIndex];if(oGroupItem){if(!Dom.isAncestor(this._aListElements[nGroupIndex],oGroupItem.element)){this._aListElements[nGroupIndex].appendChild(oGroupItem.element);}oGroupItem.element.setAttribute(_GROUP_INDEX,nGroupIndex);oGroupItem.element.setAttribute(_INDEX,nItemIndex);oGroupItem.parent=this;oGroupItem.index=nItemIndex;oGroupItem.groupIndex=nGroupIndex;this._subscribeToItemEvents(oGroupItem);this._configureSubmenu(oGroupItem);if(nItemIndex===0){Dom.addClass(oGroupItem.element,_FIRST_OF_TYPE);}this.itemAddedEvent.fire(oGroupItem);this.changeContentEvent.fire();returnVal=oGroupItem;}}}return returnVal;},_removeItemFromGroupByIndex:function(p_nGroupIndex,p_nItemIndex){var nGroupIndex=Lang.isNumber(p_nGroupIndex)?p_nGroupIndex:0,aGroup=this._getItemGroup(nGroupIndex),aArray,oItem,oUL;if(aGroup){aArray=aGroup.splice(p_nItemIndex,1);oItem=aArray[0];if(oItem){this._updateItemProperties(nGroupIndex);if(aGroup.length===0){oUL=this._aListElements[nGroupIndex];if(oUL&&oUL.parentNode){oUL.parentNode.removeChild(oUL);}this._aItemGroups.splice(nGroupIndex,1);this._aListElements.splice(nGroupIndex,1);oUL=this._aListElements[0];if(oUL){Dom.addClass(oUL,_FIRST_OF_TYPE);}}this.itemRemovedEvent.fire(oItem);this.changeContentEvent.fire();}}return oItem;},_removeItemFromGroupByValue:function(p_nGroupIndex,p_oItem){var aGroup=this._getItemGroup(p_nGroupIndex),nItems,nItemIndex,returnVal,i;if(aGroup){nItems=aGroup.length;nItemIndex=-1;if(nItems>0){i=nItems-1;do{if(aGroup[i]==p_oItem){nItemIndex=i;break;}}while(i--);if(nItemIndex>-1){returnVal=this._removeItemFromGroupByIndex(p_nGroupIndex,nItemIndex);}}}return returnVal;},_updateItemProperties:function(p_nGroupIndex){var aGroup=this._getItemGroup(p_nGroupIndex),nItems=aGroup.length,oItem,oLI,i;if(nItems>0){i=nItems-1;do{oItem=aGroup[i];if(oItem){oLI=oItem.element;oItem.index=i;oItem.groupIndex=p_nGroupIndex;oLI.setAttribute(_GROUP_INDEX,p_nGroupIndex);oLI.setAttribute(_INDEX,i);Dom.removeClass(oLI,_FIRST_OF_TYPE);}}while(i--);if(oLI){Dom.addClass(oLI,_FIRST_OF_TYPE);}}},_createItemGroup:function(p_nIndex){var oUL,returnVal;if(!this._aItemGroups[p_nIndex]){this._aItemGroups[p_nIndex]=[];oUL=document.createElement(_UL_LOWERCASE);this._aListElements[p_nIndex]=oUL;returnVal=this._aItemGroups[p_nIndex];}return returnVal;},_getItemGroup:function(p_nIndex){var nIndex=Lang.isNumber(p_nIndex)?p_nIndex:0,aGroups=this._aItemGroups,returnVal;if(nIndex in aGroups){returnVal=aGroups[nIndex];}return returnVal;},_configureSubmenu:function(p_oItem){var oSubmenu=p_oItem.cfg.getProperty(_SUBMENU);if(oSubmenu){this.cfg.configChangedEvent.subscribe(this._onParentMenuConfigChange,oSubmenu,true);this.renderEvent.subscribe(this._onParentMenuRender,oSubmenu,true);}},_subscribeToItemEvents:function(p_oItem){p_oItem.destroyEvent.subscribe(this._onMenuItemDestroy,p_oItem,this);p_oItem.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange,p_oItem,this);},_onVisibleChange:function(p_sType,p_aArgs){var bVisible=p_aArgs[0];if(bVisible){Dom.addClass(this.element,_VISIBLE);}else{Dom.removeClass(this.element,_VISIBLE);}},_cancelHideDelay:function(){var oTimer=this.getRoot()._hideDelayTimer;if(oTimer){oTimer.cancel();}},_execHideDelay:function(){this._cancelHideDelay();var oRoot=this.getRoot();oRoot._hideDelayTimer=Lang.later(oRoot.cfg.getProperty(_HIDE_DELAY),this,function(){if(oRoot.activeItem){if(oRoot.hasFocus()){oRoot.activeItem.focus();}oRoot.clearActiveItem();}if(oRoot==this&&!(this instanceof YAHOO.widget.MenuBar)&&this.cfg.getProperty(_POSITION)==_DYNAMIC){this.hide();}});},_cancelShowDelay:function(){var oTimer=this.getRoot()._showDelayTimer;if(oTimer){oTimer.cancel();}},_execSubmenuHideDelay:function(p_oSubmenu,p_nMouseX,p_nHideDelay){p_oSubmenu._submenuHideDelayTimer=Lang.later(50,this,function(){if(this._nCurrentMouseX>(p_nMouseX+10)){p_oSubmenu._submenuHideDelayTimer=Lang.later(p_nHideDelay,p_oSubmenu,function(){this.hide();});}else{p_oSubmenu.hide();}});},_disableScrollHeader:function(){if(!this._bHeaderDisabled){Dom.addClass(this.header,_TOP_SCROLLBAR_DISABLED);this._bHeaderDisabled=true;}},_disableScrollFooter:function(){if(!this._bFooterDisabled){Dom.addClass(this.footer,_BOTTOM_SCROLLBAR_DISABLED);this._bFooterDisabled=true;}},_enableScrollHeader:function(){if(this._bHeaderDisabled){Dom.removeClass(this.header,_TOP_SCROLLBAR_DISABLED);this._bHeaderDisabled=false;}},_enableScrollFooter:function(){if(this._bFooterDisabled){Dom.removeClass(this.footer,_BOTTOM_SCROLLBAR_DISABLED);this._bFooterDisabled=false;}},_onMouseOver:function(p_sType,p_aArgs){var oEvent=p_aArgs[0],oItem=p_aArgs[1],oTarget=Event.getTarget(oEvent),oRoot=this.getRoot(),oSubmenuHideDelayTimer=this._submenuHideDelayTimer,oParentMenu,nShowDelay,bShowDelay,oActiveItem,oItemCfg,oSubmenu;var showSubmenu=function(){if(this.parent.cfg.getProperty(_SELECTED)){this.show();}};if(!this._bStopMouseEventHandlers){if(!this._bHandledMouseOverEvent&&(oTarget==this.element||Dom.isAncestor(this.element,oTarget))){if(this._useHideDelay){this._cancelHideDelay();}this._nCurrentMouseX=0;Event.on(this.element,_MOUSEMOVE,this._onMouseMove,this,true);if(!(oItem&&Dom.isAncestor(oItem.element,Event.getRelatedTarget(oEvent)))){this.clearActiveItem();}if(this.parent&&oSubmenuHideDelayTimer){oSubmenuHideDelayTimer.cancel();this.parent.cfg.setProperty(_SELECTED,true);oParentMenu=this.parent.parent;oParentMenu._bHandledMouseOutEvent=true;oParentMenu._bHandledMouseOverEvent=false;}this._bHandledMouseOverEvent=true;this._bHandledMouseOutEvent=false;}if(oItem&&!oItem.handledMouseOverEvent&&!oItem.cfg.getProperty(_DISABLED)&&(oTarget==oItem.element||Dom.isAncestor(oItem.element,oTarget))){nShowDelay=this.cfg.getProperty(_SHOW_DELAY);bShowDelay=(nShowDelay>0);if(bShowDelay){this._cancelShowDelay();}oActiveItem=this.activeItem;if(oActiveItem){oActiveItem.cfg.setProperty(_SELECTED,false);}oItemCfg=oItem.cfg;oItemCfg.setProperty(_SELECTED,true);if(this.hasFocus()||oRoot._hasFocus){oItem.focus();oRoot._hasFocus=false;}if(this.cfg.getProperty(_AUTO_SUBMENU_DISPLAY)){oSubmenu=oItemCfg.getProperty(_SUBMENU);if(oSubmenu){if(bShowDelay){oRoot._showDelayTimer=Lang.later(oRoot.cfg.getProperty(_SHOW_DELAY),oSubmenu,showSubmenu);}else{oSubmenu.show();}}}oItem.handledMouseOverEvent=true;oItem.handledMouseOutEvent=false;}}},_onMouseOut:function(p_sType,p_aArgs){var oEvent=p_aArgs[0],oItem=p_aArgs[1],oRelatedTarget=Event.getRelatedTarget(oEvent),bMovingToSubmenu=false,oItemCfg,oSubmenu,nSubmenuHideDelay,nShowDelay;if(!this._bStopMouseEventHandlers){if(oItem&&!oItem.cfg.getProperty(_DISABLED)){oItemCfg=oItem.cfg;oSubmenu=oItemCfg.getProperty(_SUBMENU);if(oSubmenu&&(oRelatedTarget==oSubmenu.element||Dom.isAncestor(oSubmenu.element,oRelatedTarget))){bMovingToSubmenu=true;}if(!oItem.handledMouseOutEvent&&((oRelatedTarget!=oItem.element&&!Dom.isAncestor(oItem.element,oRelatedTarget))||bMovingToSubmenu)){if(!bMovingToSubmenu){oItem.cfg.setProperty(_SELECTED,false);if(oSubmenu){nSubmenuHideDelay=this.cfg.getProperty(_SUBMENU_HIDE_DELAY);nShowDelay=this.cfg.getProperty(_SHOW_DELAY);if(!(this instanceof YAHOO.widget.MenuBar)&&nSubmenuHideDelay>0&&nSubmenuHideDelay>=nShowDelay){this._execSubmenuHideDelay(oSubmenu,Event.getPageX(oEvent),nSubmenuHideDelay);}else{oSubmenu.hide();}}}oItem.handledMouseOutEvent=true;oItem.handledMouseOverEvent=false;}}if(!this._bHandledMouseOutEvent){if(this._didMouseLeave(oRelatedTarget)||bMovingToSubmenu){if(this._useHideDelay){this._execHideDelay();}Event.removeListener(this.element,_MOUSEMOVE,this._onMouseMove);this._nCurrentMouseX=Event.getPageX(oEvent);this._bHandledMouseOutEvent=true;this._bHandledMouseOverEvent=false;}}}},_didMouseLeave:function(oRelatedTarget){return(oRelatedTarget===this._shadow||(oRelatedTarget!=this.element&&!Dom.isAncestor(this.element,oRelatedTarget)));},_onMouseMove:function(p_oEvent,p_oMenu){if(!this._bStopMouseEventHandlers){this._nCurrentMouseX=Event.getPageX(p_oEvent);}},_onClick:function(p_sType,p_aArgs){var oEvent=p_aArgs[0],oItem=p_aArgs[1],bInMenuAnchor=false,oSubmenu,oMenu,oRoot,sId,sURL,nHashPos,nLen;var hide=function(){oRoot=this.getRoot();if(oRoot instanceof YAHOO.widget.MenuBar||oRoot.cfg.getProperty(_POSITION)==_STATIC){oRoot.clearActiveItem();}else{oRoot.hide();}};if(oItem){if(oItem.cfg.getProperty(_DISABLED)){Event.preventDefault(oEvent);hide.call(this);}else{oSubmenu=oItem.cfg.getProperty(_SUBMENU);sURL=oItem.cfg.getProperty(_URL);if(sURL){nHashPos=sURL.indexOf(_HASH);nLen=sURL.length;if(nHashPos!=-1){sURL=sURL.substr(nHashPos,nLen);nLen=sURL.length;if(nLen>1){sId=sURL.substr(1,nLen);oMenu=YAHOO.widget.MenuManager.getMenu(sId);if(oMenu){bInMenuAnchor=(this.getRoot()===oMenu.getRoot());}}else{if(nLen===1){bInMenuAnchor=true;}}}}if(bInMenuAnchor&&!oItem.cfg.getProperty(_TARGET)){Event.preventDefault(oEvent);if(UA.webkit){oItem.focus();}else{oItem.focusEvent.fire();}}if(!oSubmenu&&!this.cfg.getProperty(_KEEP_OPEN)){hide.call(this);}}}},_stopMouseEventHandlers:function(){this._bStopMouseEventHandlers=true;Lang.later(10,this,function(){this._bStopMouseEventHandlers=false;});},_onKeyDown:function(p_sType,p_aArgs){var oEvent=p_aArgs[0],oItem=p_aArgs[1],oSubmenu,oItemCfg,oParentItem,oRoot,oNextItem,oBody,nBodyScrollTop,nBodyOffsetHeight,aItems,nItems,nNextItemOffsetTop,nScrollTarget,oParentMenu,oFocusedEl;if(this._useHideDelay){this._cancelHideDelay();}if(oItem&&!oItem.cfg.getProperty(_DISABLED)){oItemCfg=oItem.cfg;oParentItem=this.parent;switch(oEvent.keyCode){case 38:case 40:oNextItem=(oEvent.keyCode==38)?oItem.getPreviousEnabledSibling():oItem.getNextEnabledSibling();if(oNextItem){this.clearActiveItem();oNextItem.cfg.setProperty(_SELECTED,true);oNextItem.focus();if(this.cfg.getProperty(_MAX_HEIGHT)>0||Dom.hasClass(this.body,_YUI_MENU_BODY_SCROLLED)){oBody=this.body;nBodyScrollTop=oBody.scrollTop;nBodyOffsetHeight=oBody.offsetHeight;aItems=this.getItems();nItems=aItems.length-1;nNextItemOffsetTop=oNextItem.element.offsetTop;if(oEvent.keyCode==40){if(nNextItemOffsetTop>=(nBodyOffsetHeight+nBodyScrollTop)){oBody.scrollTop=nNextItemOffsetTop-nBodyOffsetHeight;}else{if(nNextItemOffsetTop<=nBodyScrollTop){oBody.scrollTop=0;}}if(oNextItem==aItems[nItems]){oBody.scrollTop=oNextItem.element.offsetTop;}}else{if(nNextItemOffsetTop<=nBodyScrollTop){oBody.scrollTop=nNextItemOffsetTop-oNextItem.element.offsetHeight;}else{if(nNextItemOffsetTop>=(nBodyScrollTop+nBodyOffsetHeight)){oBody.scrollTop=nNextItemOffsetTop;}}if(oNextItem==aItems[0]){oBody.scrollTop=0;}}nBodyScrollTop=oBody.scrollTop;nScrollTarget=oBody.scrollHeight-oBody.offsetHeight;if(nBodyScrollTop===0){this._disableScrollHeader();this._enableScrollFooter();}else{if(nBodyScrollTop==nScrollTarget){this._enableScrollHeader();this._disableScrollFooter();}else{this._enableScrollHeader();this._enableScrollFooter();}}}}Event.preventDefault(oEvent);this._stopMouseEventHandlers();break;case 39:oSubmenu=oItemCfg.getProperty(_SUBMENU);if(oSubmenu){if(!oItemCfg.getProperty(_SELECTED)){oItemCfg.setProperty(_SELECTED,true);}oSubmenu.show();oSubmenu.setInitialFocus();oSubmenu.setInitialSelection();}else{oRoot=this.getRoot();if(oRoot instanceof YAHOO.widget.MenuBar){oNextItem=oRoot.activeItem.getNextEnabledSibling();if(oNextItem){oRoot.clearActiveItem();oNextItem.cfg.setProperty(_SELECTED,true);oSubmenu=oNextItem.cfg.getProperty(_SUBMENU);if(oSubmenu){oSubmenu.show();oSubmenu.setInitialFocus();}else{oNextItem.focus();}}}}Event.preventDefault(oEvent);this._stopMouseEventHandlers();break;case 37:if(oParentItem){oParentMenu=oParentItem.parent;if(oParentMenu instanceof YAHOO.widget.MenuBar){oNextItem=oParentMenu.activeItem.getPreviousEnabledSibling();if(oNextItem){oParentMenu.clearActiveItem();oNextItem.cfg.setProperty(_SELECTED,true);oSubmenu=oNextItem.cfg.getProperty(_SUBMENU);if(oSubmenu){oSubmenu.show();oSubmenu.setInitialFocus();}else{oNextItem.focus();}}}else{this.hide();oParentItem.focus();}}Event.preventDefault(oEvent);this._stopMouseEventHandlers();break;}}if(oEvent.keyCode==27){if(this.cfg.getProperty(_POSITION)==_DYNAMIC){this.hide();if(this.parent){this.parent.focus();}else{oFocusedEl=this._focusedElement;if(oFocusedEl&&oFocusedEl.focus){try{oFocusedEl.focus();}catch(ex){}}}}else{if(this.activeItem){oSubmenu=this.activeItem.cfg.getProperty(_SUBMENU);if(oSubmenu&&oSubmenu.cfg.getProperty(_VISIBLE)){oSubmenu.hide();this.activeItem.focus();}else{this.activeItem.blur();this.activeItem.cfg.setProperty(_SELECTED,false);}}}Event.preventDefault(oEvent);}},_onKeyPress:function(p_sType,p_aArgs){var oEvent=p_aArgs[0];if(oEvent.keyCode==40||oEvent.keyCode==38){Event.preventDefault(oEvent);}},_onBlur:function(p_sType,p_aArgs){if(this._hasFocus){this._hasFocus=false;}},_onYChange:function(p_sType,p_aArgs){var oParent=this.parent,nScrollTop,oIFrame,nY;if(oParent){nScrollTop=oParent.parent.body.scrollTop;if(nScrollTop>0){nY=(this.cfg.getProperty(_Y)-nScrollTop);Dom.setY(this.element,nY);oIFrame=this.iframe;if(oIFrame){Dom.setY(oIFrame,nY);}this.cfg.setProperty(_Y,nY,true);}}},_onScrollTargetMouseOver:function(p_oEvent,p_oMenu){var oBodyScrollTimer=this._bodyScrollTimer;if(oBodyScrollTimer){oBodyScrollTimer.cancel();}this._cancelHideDelay();var oTarget=Event.getTarget(p_oEvent),oBody=this.body,nScrollIncrement=this.cfg.getProperty(_SCROLL_INCREMENT),nScrollTarget,fnScrollFunction;function scrollBodyDown(){var nScrollTop=oBody.scrollTop;if(nScrollTop<nScrollTarget){oBody.scrollTop=(nScrollTop+nScrollIncrement);this._enableScrollHeader();}else{oBody.scrollTop=nScrollTarget;this._bodyScrollTimer.cancel();this._disableScrollFooter();}}function scrollBodyUp(){var nScrollTop=oBody.scrollTop;if(nScrollTop>0){oBody.scrollTop=(nScrollTop-nScrollIncrement);this._enableScrollFooter();}else{oBody.scrollTop=0;this._bodyScrollTimer.cancel();this._disableScrollHeader();}}if(Dom.hasClass(oTarget,_HD)){fnScrollFunction=scrollBodyUp;}else{nScrollTarget=oBody.scrollHeight-oBody.offsetHeight;fnScrollFunction=scrollBodyDown;}this._bodyScrollTimer=Lang.later(10,this,fnScrollFunction,null,true);},_onScrollTargetMouseOut:function(p_oEvent,p_oMenu){var oBodyScrollTimer=this._bodyScrollTimer;if(oBodyScrollTimer){oBodyScrollTimer.cancel();}this._cancelHideDelay();},_onInit:function(p_sType,p_aArgs){this.cfg.subscribeToConfigEvent(_VISIBLE,this._onVisibleChange);var bRootMenu=!this.parent,bLazyLoad=this.lazyLoad;if(((bRootMenu&&!bLazyLoad)||(bRootMenu&&(this.cfg.getProperty(_VISIBLE)||this.cfg.getProperty(_POSITION)==_STATIC))||(!bRootMenu&&!bLazyLoad))&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree();}if(this.itemData){this.addItems(this.itemData);}}else{if(bLazyLoad){this.cfg.fireQueue();}}},_onBeforeRender:function(p_sType,p_aArgs){var oEl=this.element,nListElements=this._aListElements.length,bFirstList=true,i=0,oUL,oGroupTitle;if(nListElements>0){do{oUL=this._aListElements[i];if(oUL){if(bFirstList){Dom.addClass(oUL,_FIRST_OF_TYPE);bFirstList=false;}if(!Dom.isAncestor(oEl,oUL)){this.appendToBody(oUL);}oGroupTitle=this._aGroupTitleElements[i];if(oGroupTitle){if(!Dom.isAncestor(oEl,oGroupTitle)){oUL.parentNode.insertBefore(oGroupTitle,oUL);}Dom.addClass(oUL,_HAS_TITLE);}}i++;}while(i<nListElements);}},_onRender:function(p_sType,p_aArgs){if(this.cfg.getProperty(_POSITION)==_DYNAMIC){if(!this.cfg.getProperty(_VISIBLE)){this.positionOffScreen();}}},_onBeforeShow:function(p_sType,p_aArgs){var nOptions,n,oSrcElement,oContainer=this.cfg.getProperty(_CONTAINER);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()==_SELECT){nOptions=this.itemData.length;for(n=0;n<nOptions;n++){if(this.itemData[n].tagName){this.addItem((new this.ITEM_TYPE(this.itemData[n])));}}}else{this.addItems(this.itemData);}}oSrcElement=this.srcElement;if(oSrcElement){if(oSrcElement.tagName.toUpperCase()==_SELECT){if(Dom.inDocument(oSrcElement)){this.render(oSrcElement.parentNode);}else{this.render(oContainer);}}else{this.render();}}else{if(this.parent){this.render(this.parent.element);}else{this.render(oContainer);}}}var oParent=this.parent,aAlignment;if(!oParent&&this.cfg.getProperty(_POSITION)==_DYNAMIC){this.cfg.refireEvent(_XY);}if(oParent){aAlignment=oParent.parent.cfg.getProperty(_SUBMENU_ALIGNMENT);this.cfg.setProperty(_CONTEXT,[oParent.element,aAlignment[0],aAlignment[1]]);this.align();}},getConstrainedY:function(y){var oMenu=this,aContext=oMenu.cfg.getProperty(_CONTEXT),nInitialMaxHeight=oMenu.cfg.getProperty(_MAX_HEIGHT),nMaxHeight,oOverlapPositions={trbr:true,tlbl:true,bltl:true,brtr:true},bPotentialContextOverlap=(aContext&&oOverlapPositions[aContext[1]+aContext[2]]),oMenuEl=oMenu.element,nMenuOffsetHeight=oMenuEl.offsetHeight,nViewportOffset=Overlay.VIEWPORT_OFFSET,viewPortHeight=Dom.getViewportHeight(),scrollY=Dom.getDocumentScrollTop(),bCanConstrain=(oMenu.cfg.getProperty(_MIN_SCROLL_HEIGHT)+nViewportOffset<viewPortHeight),nAvailableHeight,oContextEl,nContextElY,nContextElHeight,bFlipped=false,nTopRegionHeight,nBottomRegionHeight,topConstraint=scrollY+nViewportOffset,bottomConstraint=scrollY+viewPortHeight-nMenuOffsetHeight-nViewportOffset,yNew=y;var flipVertical=function(){var nNewY;if((oMenu.cfg.getProperty(_Y)-scrollY)>nContextElY){nNewY=(nContextElY-nMenuOffsetHeight);}else{nNewY=(nContextElY+nContextElHeight);}oMenu.cfg.setProperty(_Y,(nNewY+scrollY),true);return nNewY;};var getDisplayRegionHeight=function(){if((oMenu.cfg.getProperty(_Y)-scrollY)>nContextElY){return(nBottomRegionHeight-nViewportOffset);}else{return(nTopRegionHeight-nViewportOffset);}};var alignY=function(){var nNewY;if((oMenu.cfg.getProperty(_Y)-scrollY)>nContextElY){nNewY=(nContextElY+nContextElHeight);}else{nNewY=(nContextElY-oMenuEl.offsetHeight);}oMenu.cfg.setProperty(_Y,(nNewY+scrollY),true);};var resetMaxHeight=function(){oMenu._setScrollHeight(this.cfg.getProperty(_MAX_HEIGHT));oMenu.hideEvent.unsubscribe(resetMaxHeight);};var setVerticalPosition=function(){var nDisplayRegionHeight=getDisplayRegionHeight(),bMenuHasItems=(oMenu.getItems().length>0),nMenuMinScrollHeight,fnReturnVal;if(nMenuOffsetHeight>nDisplayRegionHeight){nMenuMinScrollHeight=bMenuHasItems?oMenu.cfg.getProperty(_MIN_SCROLL_HEIGHT):nMenuOffsetHeight;if((nDisplayRegionHeight>nMenuMinScrollHeight)&&bMenuHasItems){nMaxHeight=nDisplayRegionHeight;}else{nMaxHeight=nInitialMaxHeight;}oMenu._setScrollHeight(nMaxHeight);oMenu.hideEvent.subscribe(resetMaxHeight);alignY();if(nDisplayRegionHeight<nMenuMinScrollHeight){if(bFlipped){flipVertical();}else{flipVertical();bFlipped=true;fnReturnVal=setVerticalPosition();}}}else{if(nMaxHeight&&(nMaxHeight!==nInitialMaxHeight)){oMenu._setScrollHeight(nInitialMaxHeight);oMenu.hideEvent.subscribe(resetMaxHeight);alignY();}}return fnReturnVal;};if(y<topConstraint||y>bottomConstraint){if(bCanConstrain){if(oMenu.cfg.getProperty(_PREVENT_CONTEXT_OVERLAP)&&bPotentialContextOverlap){oContextEl=aContext[0];nContextElHeight=oContextEl.offsetHeight;nContextElY=(Dom.getY(oContextEl)-scrollY);nTopRegionHeight=nContextElY;nBottomRegionHeight=(viewPortHeight-(nContextElY+nContextElHeight));setVerticalPosition();yNew=oMenu.cfg.getProperty(_Y);}else{if(!(oMenu instanceof YAHOO.widget.MenuBar)&&nMenuOffsetHeight>=viewPortHeight){nAvailableHeight=(viewPortHeight-(nViewportOffset*2));if(nAvailableHeight>oMenu.cfg.getProperty(_MIN_SCROLL_HEIGHT)){oMenu._setScrollHeight(nAvailableHeight);oMenu.hideEvent.subscribe(resetMaxHeight);alignY();yNew=oMenu.cfg.getProperty(_Y);}}else{if(y<topConstraint){yNew=topConstraint;}else{if(y>bottomConstraint){yNew=bottomConstraint;}}}}}else{yNew=nViewportOffset+scrollY;}}return yNew;},_onHide:function(p_sType,p_aArgs){if(this.cfg.getProperty(_POSITION)===_DYNAMIC){this.positionOffScreen();}},_onShow:function(p_sType,p_aArgs){var oParent=this.parent,oParentMenu,oElement,nOffsetWidth,sWidth;function disableAutoSubmenuDisplay(p_oEvent){var oTarget;if(p_oEvent.type==_MOUSEDOWN||(p_oEvent.type==_KEYDOWN&&p_oEvent.keyCode==27)){oTarget=Event.getTarget(p_oEvent);if(oTarget!=oParentMenu.element||!Dom.isAncestor(oParentMenu.element,oTarget)){oParentMenu.cfg.setProperty(_AUTO_SUBMENU_DISPLAY,false);Event.removeListener(document,_MOUSEDOWN,disableAutoSubmenuDisplay);Event.removeListener(document,_KEYDOWN,disableAutoSubmenuDisplay);}}}function onSubmenuHide(p_sType,p_aArgs,p_sWidth){this.cfg.setProperty(_WIDTH,_EMPTY_STRING);this.hideEvent.unsubscribe(onSubmenuHide,p_sWidth);}if(oParent){oParentMenu=oParent.parent;if(!oParentMenu.cfg.getProperty(_AUTO_SUBMENU_DISPLAY)&&(oParentMenu instanceof YAHOO.widget.MenuBar||oParentMenu.cfg.getProperty(_POSITION)==_STATIC)){oParentMenu.cfg.setProperty(_AUTO_SUBMENU_DISPLAY,true);Event.on(document,_MOUSEDOWN,disableAutoSubmenuDisplay);Event.on(document,_KEYDOWN,disableAutoSubmenuDisplay);}if((this.cfg.getProperty("x")<oParentMenu.cfg.getProperty("x"))&&(UA.gecko&&UA.gecko<1.9)&&!this.cfg.getProperty(_WIDTH)){oElement=this.element;nOffsetWidth=oElement.offsetWidth;oElement.style.width=nOffsetWidth+_PX;sWidth=(nOffsetWidth-(oElement.offsetWidth-nOffsetWidth))+_PX;this.cfg.setProperty(_WIDTH,sWidth);this.hideEvent.subscribe(onSubmenuHide,sWidth);}}if(this===this.getRoot()&&this.cfg.getProperty(_POSITION)===_DYNAMIC){this._focusedElement=oFocusedElement;this.focus();}},_onBeforeHide:function(p_sType,p_aArgs){var oActiveItem=this.activeItem,oRoot=this.getRoot(),oConfig,oSubmenu;if(oActiveItem){oConfig=oActiveItem.cfg;oConfig.setProperty(_SELECTED,false);oSubmenu=oConfig.getProperty(_SUBMENU);if(oSubmenu){oSubmenu.hide();}}if(UA.ie&&this.cfg.getProperty(_POSITION)===_DYNAMIC&&this.parent){oRoot._hasFocus=this.hasFocus();}if(oRoot==this){oRoot.blur();}},_onParentMenuConfigChange:function(p_sType,p_aArgs,p_oSubmenu){var sPropertyName=p_aArgs[0][0],oPropertyValue=p_aArgs[0][1];switch(sPropertyName){case _IFRAME:case _CONSTRAIN_TO_VIEWPORT:case _HIDE_DELAY:case _SHOW_DELAY:case _SUBMENU_HIDE_DELAY:case _CLICK_TO_HIDE:case _EFFECT:case _CLASSNAME:case _SCROLL_INCREMENT:case _MAX_HEIGHT:case _MIN_SCROLL_HEIGHT:case _MONITOR_RESIZE:case _SHADOW:case _PREVENT_CONTEXT_OVERLAP:case _KEEP_OPEN:p_oSubmenu.cfg.setProperty(sPropertyName,oPropertyValue);break;case _SUBMENU_ALIGNMENT:if(!(this.parent.parent instanceof YAHOO.widget.MenuBar)){p_oSubmenu.cfg.setProperty(sPropertyName,oPropertyValue);}break;}},_onParentMenuRender:function(p_sType,p_aArgs,p_oSubmenu){var oParentMenu=p_oSubmenu.parent.parent,oParentCfg=oParentMenu.cfg,oConfig={constraintoviewport:oParentCfg.getProperty(_CONSTRAIN_TO_VIEWPORT),xy:[0,0],clicktohide:oParentCfg.getProperty(_CLICK_TO_HIDE),effect:oParentCfg.getProperty(_EFFECT),showdelay:oParentCfg.getProperty(_SHOW_DELAY),hidedelay:oParentCfg.getProperty(_HIDE_DELAY),submenuhidedelay:oParentCfg.getProperty(_SUBMENU_HIDE_DELAY),classname:oParentCfg.getProperty(_CLASSNAME),scrollincrement:oParentCfg.getProperty(_SCROLL_INCREMENT),maxheight:oParentCfg.getProperty(_MAX_HEIGHT),minscrollheight:oParentCfg.getProperty(_MIN_SCROLL_HEIGHT),iframe:oParentCfg.getProperty(_IFRAME),shadow:oParentCfg.getProperty(_SHADOW),preventcontextoverlap:oParentCfg.getProperty(_PREVENT_CONTEXT_OVERLAP),monitorresize:oParentCfg.getProperty(_MONITOR_RESIZE),keepopen:oParentCfg.getProperty(_KEEP_OPEN)},oLI;if(!(oParentMenu instanceof YAHOO.widget.MenuBar)){oConfig[_SUBMENU_ALIGNMENT]=oParentCfg.getProperty(_SUBMENU_ALIGNMENT);}p_oSubmenu.cfg.applyConfig(oConfig);if(!this.lazyLoad){oLI=this.parent.element;if(this.element.parentNode==oLI){this.render();}else{this.render(oLI);}}},_onMenuItemDestroy:function(p_sType,p_aArgs,p_oItem){this._removeItemFromGroupByValue(p_oItem.groupIndex,p_oItem);},_onMenuItemConfigChange:function(p_sType,p_aArgs,p_oItem){var sPropertyName=p_aArgs[0][0],oPropertyValue=p_aArgs[0][1],oSubmenu;switch(sPropertyName){case _SELECTED:if(oPropertyValue===true){this.activeItem=p_oItem;}break;case _SUBMENU:oSubmenu=p_aArgs[0][1];if(oSubmenu){this._configureSubmenu(p_oItem);}break;}},configVisible:function(p_sType,p_aArgs,p_oMenu){var bVisible,sDisplay;if(this.cfg.getProperty(_POSITION)==_DYNAMIC){Menu.superclass.configVisible.call(this,p_sType,p_aArgs,p_oMenu);}else{bVisible=p_aArgs[0];sDisplay=Dom.getStyle(this.element,_DISPLAY);Dom.setStyle(this.element,_VISIBILITY,_VISIBLE);if(bVisible){if(sDisplay!=_BLOCK){this.beforeShowEvent.fire();Dom.setStyle(this.element,_DISPLAY,_BLOCK);this.showEvent.fire();}}else{if(sDisplay==_BLOCK){this.beforeHideEvent.fire();Dom.setStyle(this.element,_DISPLAY,_NONE);this.hideEvent.fire();}}}},configPosition:function(p_sType,p_aArgs,p_oMenu){var oElement=this.element,sCSSPosition=p_aArgs[0]==_STATIC?_STATIC:_ABSOLUTE,oCfg=this.cfg,nZIndex;Dom.setStyle(oElement,_POSITION,sCSSPosition);if(sCSSPosition==_STATIC){Dom.setStyle(oElement,_DISPLAY,_BLOCK);oCfg.setProperty(_VISIBLE,true);}else{Dom.setStyle(oElement,_VISIBILITY,_HIDDEN);}if(sCSSPosition==_ABSOLUTE){nZIndex=oCfg.getProperty(_ZINDEX);if(!nZIndex||nZIndex===0){oCfg.setProperty(_ZINDEX,1);}}},configIframe:function(p_sType,p_aArgs,p_oMenu){if(this.cfg.getProperty(_POSITION)==_DYNAMIC){Menu.superclass.configIframe.call(this,p_sType,p_aArgs,p_oMenu);}},configHideDelay:function(p_sType,p_aArgs,p_oMenu){var nHideDelay=p_aArgs[0];this._useHideDelay=(nHideDelay>0);},configContainer:function(p_sType,p_aArgs,p_oMenu){var oElement=p_aArgs[0];if(Lang.isString(oElement)){this.cfg.setProperty(_CONTAINER,Dom.get(oElement),true);}},_clearSetWidthFlag:function(){this._widthSetForScroll=false;this.cfg.unsubscribeFromConfigEvent(_WIDTH,this._clearSetWidthFlag);},_subscribeScrollHandlers:function(oHeader,oFooter){var fnMouseOver=this._onScrollTargetMouseOver;var fnMouseOut=this._onScrollTargetMouseOut;Event.on(oHeader,_MOUSEOVER,fnMouseOver,this,true);Event.on(oHeader,_MOUSEOUT,fnMouseOut,this,true);Event.on(oFooter,_MOUSEOVER,fnMouseOver,this,true);Event.on(oFooter,_MOUSEOUT,fnMouseOut,this,true);},_unsubscribeScrollHandlers:function(oHeader,oFooter){var fnMouseOver=this._onScrollTargetMouseOver;var fnMouseOut=this._onScrollTargetMouseOut;Event.removeListener(oHeader,_MOUSEOVER,fnMouseOver);Event.removeListener(oHeader,_MOUSEOUT,fnMouseOut);Event.removeListener(oFooter,_MOUSEOVER,fnMouseOver);Event.removeListener(oFooter,_MOUSEOUT,fnMouseOut);},_setScrollHeight:function(p_nScrollHeight){var nScrollHeight=p_nScrollHeight,bRefireIFrameAndShadow=false,bSetWidth=false,oElement,oBody,oHeader,oFooter,nMinScrollHeight,nHeight,nOffsetWidth,sWidth;if(this.getItems().length>0){oElement=this.element;oBody=this.body;oHeader=this.header;oFooter=this.footer;nMinScrollHeight=this.cfg.getProperty(_MIN_SCROLL_HEIGHT);if(nScrollHeight>0&&nScrollHeight<nMinScrollHeight){nScrollHeight=nMinScrollHeight;}Dom.setStyle(oBody,_HEIGHT,_EMPTY_STRING);Dom.removeClass(oBody,_YUI_MENU_BODY_SCROLLED);oBody.scrollTop=0;bSetWidth=((UA.gecko&&UA.gecko<1.9)||UA.ie);if(nScrollHeight>0&&bSetWidth&&!this.cfg.getProperty(_WIDTH)){nOffsetWidth=oElement.offsetWidth;oElement.style.width=nOffsetWidth+_PX;sWidth=(nOffsetWidth-(oElement.offsetWidth-nOffsetWidth))+_PX;this.cfg.unsubscribeFromConfigEvent(_WIDTH,this._clearSetWidthFlag);this.cfg.setProperty(_WIDTH,sWidth);this._widthSetForScroll=true;this.cfg.subscribeToConfigEvent(_WIDTH,this._clearSetWidthFlag);}if(nScrollHeight>0&&(!oHeader&&!oFooter)){this.setHeader(_NON_BREAKING_SPACE);this.setFooter(_NON_BREAKING_SPACE);oHeader=this.header;oFooter=this.footer;Dom.addClass(oHeader,_TOP_SCROLLBAR);Dom.addClass(oFooter,_BOTTOM_SCROLLBAR);oElement.insertBefore(oHeader,oBody);oElement.appendChild(oFooter);}nHeight=nScrollHeight;if(oHeader&&oFooter){nHeight=(nHeight-(oHeader.offsetHeight+oFooter.offsetHeight));}if((nHeight>0)&&(oBody.offsetHeight>nScrollHeight)){Dom.addClass(oBody,_YUI_MENU_BODY_SCROLLED);Dom.setStyle(oBody,_HEIGHT,(nHeight+_PX));if(!this._hasScrollEventHandlers){this._subscribeScrollHandlers(oHeader,oFooter);this._hasScrollEventHandlers=true;}this._disableScrollHeader();this._enableScrollFooter();bRefireIFrameAndShadow=true;}else{if(oHeader&&oFooter){if(this._widthSetForScroll){this._widthSetForScroll=false;this.cfg.unsubscribeFromConfigEvent(_WIDTH,this._clearSetWidthFlag);this.cfg.setProperty(_WIDTH,_EMPTY_STRING);}this._enableScrollHeader();this._enableScrollFooter();if(this._hasScrollEventHandlers){this._unsubscribeScrollHandlers(oHeader,oFooter);this._hasScrollEventHandlers=false;}oElement.removeChild(oHeader);oElement.removeChild(oFooter);this.header=null;this.footer=null;bRefireIFrameAndShadow=true;}}if(bRefireIFrameAndShadow){this.cfg.refireEvent(_IFRAME);this.cfg.refireEvent(_SHADOW);}}},_setMaxHeight:function(p_sType,p_aArgs,p_nMaxHeight){this._setScrollHeight(p_nMaxHeight);this.renderEvent.unsubscribe(this._setMaxHeight);},configMaxHeight:function(p_sType,p_aArgs,p_oMenu){var nMaxHeight=p_aArgs[0];if(this.lazyLoad&&!this.body&&nMaxHeight>0){this.renderEvent.subscribe(this._setMaxHeight,nMaxHeight,this);}else{this._setScrollHeight(nMaxHeight);}},configClassName:function(p_sType,p_aArgs,p_oMenu){var sClassName=p_aArgs[0];if(this._sClassName){Dom.removeClass(this.element,this._sClassName);}Dom.addClass(this.element,sClassName);this._sClassName=sClassName;},_onItemAdded:function(p_sType,p_aArgs){var oItem=p_aArgs[0];if(oItem){oItem.cfg.setProperty(_DISABLED,true);}},configDisabled:function(p_sType,p_aArgs,p_oMenu){var bDisabled=p_aArgs[0],aItems=this.getItems(),nItems,i;if(Lang.isArray(aItems)){nItems=aItems.length;if(nItems>0){i=nItems-1;do{aItems[i].cfg.setProperty(_DISABLED,bDisabled);}while(i--);}if(bDisabled){this.clearActiveItem(true);Dom.addClass(this.element,_DISABLED);this.itemAddedEvent.subscribe(this._onItemAdded);}else{Dom.removeClass(this.element,_DISABLED);this.itemAddedEvent.unsubscribe(this._onItemAdded);}}},_sizeShadow:function(){var oElement=this.element,oShadow=this._shadow;if(oShadow&&oElement){if(oShadow.style.width&&oShadow.style.height){oShadow.style.width=_EMPTY_STRING;oShadow.style.height=_EMPTY_STRING;}oShadow.style.width=(oElement.offsetWidth+6)+_PX;oShadow.style.height=(oElement.offsetHeight+1)+_PX;}},_replaceShadow:function(){this.element.appendChild(this._shadow);},_addShadowVisibleClass:function(){Dom.addClass(this._shadow,_YUI_MENU_SHADOW_VISIBLE);},_removeShadowVisibleClass:function(){Dom.removeClass(this._shadow,_YUI_MENU_SHADOW_VISIBLE);},_removeShadow:function(){var p=(this._shadow&&this._shadow.parentNode);if(p){p.removeChild(this._shadow);}this.beforeShowEvent.unsubscribe(this._addShadowVisibleClass);this.beforeHideEvent.unsubscribe(this._removeShadowVisibleClass);this.cfg.unsubscribeFromConfigEvent(_WIDTH,this._sizeShadow);this.cfg.unsubscribeFromConfigEvent(_HEIGHT,this._sizeShadow);this.cfg.unsubscribeFromConfigEvent(_MAX_HEIGHT,this._sizeShadow);this.cfg.unsubscribeFromConfigEvent(_MAX_HEIGHT,this._replaceShadow);this.changeContentEvent.unsubscribe(this._sizeShadow);Module.textResizeEvent.unsubscribe(this._sizeShadow);},_createShadow:function(){var oShadow=this._shadow,oElement;if(!oShadow){oElement=this.element;if(!m_oShadowTemplate){m_oShadowTemplate=document.createElement(_DIV_LOWERCASE);m_oShadowTemplate.className=_YUI_MENU_SHADOW_YUI_MENU_SHADOW_VISIBLE;}oShadow=m_oShadowTemplate.cloneNode(false);oElement.appendChild(oShadow);this._shadow=oShadow;this.beforeShowEvent.subscribe(this._addShadowVisibleClass);this.beforeHideEvent.subscribe(this._removeShadowVisibleClass);if(UA.ie){Lang.later(0,this,function(){this._sizeShadow();this.syncIframe();});this.cfg.subscribeToConfigEvent(_WIDTH,this._sizeShadow);this.cfg.subscribeToConfigEvent(_HEIGHT,this._sizeShadow);this.cfg.subscribeToConfigEvent(_MAX_HEIGHT,this._sizeShadow);this.changeContentEvent.subscribe(this._sizeShadow);Module.textResizeEvent.subscribe(this._sizeShadow,this,true);this.destroyEvent.subscribe(function(){Module.textResizeEvent.unsubscribe(this._sizeShadow,this);});}this.cfg.subscribeToConfigEvent(_MAX_HEIGHT,this._replaceShadow);}},_shadowBeforeShow:function(){if(this._shadow){this._replaceShadow();if(UA.ie){this._sizeShadow();}}else{this._createShadow();}this.beforeShowEvent.unsubscribe(this._shadowBeforeShow);},configShadow:function(p_sType,p_aArgs,p_oMenu){var bShadow=p_aArgs[0];if(bShadow&&this.cfg.getProperty(_POSITION)==_DYNAMIC){if(this.cfg.getProperty(_VISIBLE)){if(this._shadow){this._replaceShadow();if(UA.ie){this._sizeShadow();}}else{this._createShadow();}}else{this.beforeShowEvent.subscribe(this._shadowBeforeShow);}}else{if(!bShadow){this.beforeShowEvent.unsubscribe(this._shadowBeforeShow);this._removeShadow();}}},initEvents:function(){Menu.superclass.initEvents.call(this);var i=EVENT_TYPES.length-1,aEventData,oCustomEvent;do{aEventData=EVENT_TYPES[i];oCustomEvent=this.createEvent(aEventData[1]);oCustomEvent.signature=CustomEvent.LIST;this[aEventData[0]]=oCustomEvent;}while(i--);},positionOffScreen:function(){var oIFrame=this.iframe,oElement=this.element,sPos=this.OFF_SCREEN_POSITION;oElement.style.top=_EMPTY_STRING;oElement.style.left=_EMPTY_STRING;if(oIFrame){oIFrame.style.top=sPos;oIFrame.style.left=sPos;}},getRoot:function(){var oItem=this.parent,oParentMenu,returnVal;if(oItem){oParentMenu=oItem.parent;returnVal=oParentMenu?oParentMenu.getRoot():this;}else{returnVal=this;}return returnVal;},toString:function(){var sReturnVal=_MENU,sId=this.id;if(sId){sReturnVal+=(_SPACE+sId);}return sReturnVal;},setItemGroupTitle:function(p_sGroupTitle,p_nGroupIndex){var nGroupIndex,oTitle,i,nFirstIndex;if(Lang.isString(p_sGroupTitle)&&p_sGroupTitle.length>0){nGroupIndex=Lang.isNumber(p_nGroupIndex)?p_nGroupIndex:0;oTitle=this._aGroupTitleElements[nGroupIndex];if(oTitle){oTitle.innerHTML=p_sGroupTitle;}else{oTitle=document.createElement(this.GROUP_TITLE_TAG_NAME);oTitle.innerHTML=p_sGroupTitle;this._aGroupTitleElements[nGroupIndex]=oTitle;}i=this._aGroupTitleElements.length-1;do{if(this._aGroupTitleElements[i]){Dom.removeClass(this._aGroupTitleElements[i],_FIRST_OF_TYPE);nFirstIndex=i;}}while(i--);if(nFirstIndex!==null){Dom.addClass(this._aGroupTitleElements[nFirstIndex],_FIRST_OF_TYPE);}this.changeContentEvent.fire();}},addItem:function(p_oItem,p_nGroupIndex){return this._addItemToGroup(p_nGroupIndex,p_oItem);},addItems:function(p_aItems,p_nGroupIndex){var nItems,aItems,oItem,i,returnVal;if(Lang.isArray(p_aItems)){nItems=p_aItems.length;aItems=[];for(i=0;i<nItems;i++){oItem=p_aItems[i];if(oItem){if(Lang.isArray(oItem)){aItems[aItems.length]=this.addItems(oItem,i);}else{aItems[aItems.length]=this._addItemToGroup(p_nGroupIndex,oItem);}}}if(aItems.length){returnVal=aItems;}}return returnVal;},insertItem:function(p_oItem,p_nItemIndex,p_nGroupIndex){return this._addItemToGroup(p_nGroupIndex,p_oItem,p_nItemIndex);},removeItem:function(p_oObject,p_nGroupIndex){var oItem,returnVal;if(!Lang.isUndefined(p_oObject)){if(p_oObject instanceof YAHOO.widget.MenuItem){oItem=this._removeItemFromGroupByValue(p_nGroupIndex,p_oObject);}else{if(Lang.isNumber(p_oObject)){oItem=this._removeItemFromGroupByIndex(p_nGroupIndex,p_oObject);}}if(oItem){oItem.destroy();returnVal=oItem;}}return returnVal;},getItems:function(){var aGroups=this._aItemGroups,nGroups,returnVal,aItems=[];if(Lang.isArray(aGroups)){nGroups=aGroups.length;returnVal=((nGroups==1)?aGroups[0]:(Array.prototype.concat.apply(aItems,aGroups)));}return returnVal;},getItemGroups:function(){return this._aItemGroups;},getItem:function(p_nItemIndex,p_nGroupIndex){var aGroup,returnVal;if(Lang.isNumber(p_nItemIndex)){aGroup=this._getItemGroup(p_nGroupIndex);if(aGroup){returnVal=aGroup[p_nItemIndex];}}return returnVal;},getSubmenus:function(){var aItems=this.getItems(),nItems=aItems.length,aSubmenus,oSubmenu,oItem,i;if(nItems>0){aSubmenus=[];for(i=0;i<nItems;i++){oItem=aItems[i];if(oItem){oSubmenu=oItem.cfg.getProperty(_SUBMENU);if(oSubmenu){aSubmenus[aSubmenus.length]=oSubmenu;}}}}return aSubmenus;},clearContent:function(){var aItems=this.getItems(),nItems=aItems.length,oElement=this.element,oBody=this.body,oHeader=this.header,oFooter=this.footer,oItem,oSubmenu,i;if(nItems>0){i=nItems-1;do{oItem=aItems[i];if(oItem){oSubmenu=oItem.cfg.getProperty(_SUBMENU);if(oSubmenu){this.cfg.configChangedEvent.unsubscribe(this._onParentMenuConfigChange,oSubmenu);this.renderEvent.unsubscribe(this._onParentMenuRender,oSubmenu);}this.removeItem(oItem,oItem.groupIndex);}}while(i--);}if(oHeader){Event.purgeElement(oHeader);oElement.removeChild(oHeader);}if(oFooter){Event.purgeElement(oFooter);oElement.removeChild(oFooter);}if(oBody){Event.purgeElement(oBody);oBody.innerHTML=_EMPTY_STRING;}this.activeItem=null;this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];this.cfg.setProperty(_WIDTH,null);},destroy:function(shallowPurge){this.clearContent();this._aItemGroups=null;this._aListElements=null;this._aGroupTitleElements=null;Menu.superclass.destroy.call(this,shallowPurge);},setInitialFocus:function(){var oItem=this._getFirstEnabledItem();if(oItem){oItem.focus();}},setInitialSelection:function(){var oItem=this._getFirstEnabledItem();if(oItem){oItem.cfg.setProperty(_SELECTED,true);}},clearActiveItem:function(p_bBlur){if(this.cfg.getProperty(_SHOW_DELAY)>0){this._cancelShowDelay();}var oActiveItem=this.activeItem,oConfig,oSubmenu;if(oActiveItem){oConfig=oActiveItem.cfg;if(p_bBlur){oActiveItem.blur();this.getRoot()._hasFocus=true;}oConfig.setProperty(_SELECTED,false);oSubmenu=oConfig.getProperty(_SUBMENU);if(oSubmenu){oSubmenu.hide();}this.activeItem=null;}},focus:function(){if(!this.hasFocus()){this.setInitialFocus();}},blur:function(){var oItem;if(this.hasFocus()){oItem=MenuManager.getFocusedMenuItem();if(oItem){oItem.blur();}}},hasFocus:function(){return(MenuManager.getFocusedMenu()==this.getRoot());},_doItemSubmenuSubscribe:function(p_sType,p_aArgs,p_oObject){var oItem=p_aArgs[0],oSubmenu=oItem.cfg.getProperty(_SUBMENU);if(oSubmenu){oSubmenu.subscribe.apply(oSubmenu,p_oObject);}},_doSubmenuSubscribe:function(p_sType,p_aArgs,p_oObject){var oSubmenu=this.cfg.getProperty(_SUBMENU);if(oSubmenu){oSubmenu.subscribe.apply(oSubmenu,p_oObject);}},subscribe:function(){Menu.superclass.subscribe.apply(this,arguments);Menu.superclass.subscribe.call(this,_ITEM_ADDED,this._doItemSubmenuSubscribe,arguments);var aItems=this.getItems(),nItems,oItem,oSubmenu,i;if(aItems){nItems=aItems.length;if(nItems>0){i=nItems-1;do{oItem=aItems[i];oSubmenu=oItem.cfg.getProperty(_SUBMENU);if(oSubmenu){oSubmenu.subscribe.apply(oSubmenu,arguments);}else{oItem.cfg.subscribeToConfigEvent(_SUBMENU,this._doSubmenuSubscribe,arguments);}}while(i--);}}},unsubscribe:function(){Menu.superclass.unsubscribe.apply(this,arguments);Menu.superclass.unsubscribe.call(this,_ITEM_ADDED,this._doItemSubmenuSubscribe,arguments);var aItems=this.getItems(),nItems,oItem,oSubmenu,i;if(aItems){nItems=aItems.length;if(nItems>0){i=nItems-1;do{oItem=aItems[i];oSubmenu=oItem.cfg.getProperty(_SUBMENU);if(oSubmenu){oSubmenu.unsubscribe.apply(oSubmenu,arguments);}else{oItem.cfg.unsubscribeFromConfigEvent(_SUBMENU,this._doSubmenuSubscribe,arguments);}}while(i--);}}},initDefaultConfig:function(){Menu.superclass.initDefaultConfig.call(this);var oConfig=this.cfg;oConfig.addProperty(VISIBLE_CONFIG.key,{handler:this.configVisible,value:VISIBLE_CONFIG.value,validator:VISIBLE_CONFIG.validator});oConfig.addProperty(CONSTRAIN_TO_VIEWPORT_CONFIG.key,{handler:this.configConstrainToViewport,value:CONSTRAIN_TO_VIEWPORT_CONFIG.value,validator:CONSTRAIN_TO_VIEWPORT_CONFIG.validator,supercedes:CONSTRAIN_TO_VIEWPORT_CONFIG.supercedes});oConfig.addProperty(PREVENT_CONTEXT_OVERLAP_CONFIG.key,{value:PREVENT_CONTEXT_OVERLAP_CONFIG.value,validator:PREVENT_CONTEXT_OVERLAP_CONFIG.validator,supercedes:PREVENT_CONTEXT_OVERLAP_CONFIG.supercedes});oConfig.addProperty(POSITION_CONFIG.key,{handler:this.configPosition,value:POSITION_CONFIG.value,validator:POSITION_CONFIG.validator,supercedes:POSITION_CONFIG.supercedes});oConfig.addProperty(SUBMENU_ALIGNMENT_CONFIG.key,{value:SUBMENU_ALIGNMENT_CONFIG.value,suppressEvent:SUBMENU_ALIGNMENT_CONFIG.suppressEvent});oConfig.addProperty(AUTO_SUBMENU_DISPLAY_CONFIG.key,{value:AUTO_SUBMENU_DISPLAY_CONFIG.value,validator:AUTO_SUBMENU_DISPLAY_CONFIG.validator,suppressEvent:AUTO_SUBMENU_DISPLAY_CONFIG.suppressEvent});oConfig.addProperty(SHOW_DELAY_CONFIG.key,{value:SHOW_DELAY_CONFIG.value,validator:SHOW_DELAY_CONFIG.validator,suppressEvent:SHOW_DELAY_CONFIG.suppressEvent});oConfig.addProperty(HIDE_DELAY_CONFIG.key,{handler:this.configHideDelay,value:HIDE_DELAY_CONFIG.value,validator:HIDE_DELAY_CONFIG.validator,suppressEvent:HIDE_DELAY_CONFIG.suppressEvent});oConfig.addProperty(SUBMENU_HIDE_DELAY_CONFIG.key,{value:SUBMENU_HIDE_DELAY_CONFIG.value,validator:SUBMENU_HIDE_DELAY_CONFIG.validator,suppressEvent:SUBMENU_HIDE_DELAY_CONFIG.suppressEvent});oConfig.addProperty(CLICK_TO_HIDE_CONFIG.key,{value:CLICK_TO_HIDE_CONFIG.value,validator:CLICK_TO_HIDE_CONFIG.validator,suppressEvent:CLICK_TO_HIDE_CONFIG.suppressEvent});oConfig.addProperty(CONTAINER_CONFIG.key,{handler:this.configContainer,value:document.body,suppressEvent:CONTAINER_CONFIG.suppressEvent});oConfig.addProperty(SCROLL_INCREMENT_CONFIG.key,{value:SCROLL_INCREMENT_CONFIG.value,validator:SCROLL_INCREMENT_CONFIG.validator,supercedes:SCROLL_INCREMENT_CONFIG.supercedes,suppressEvent:SCROLL_INCREMENT_CONFIG.suppressEvent});oConfig.addProperty(MIN_SCROLL_HEIGHT_CONFIG.key,{value:MIN_SCROLL_HEIGHT_CONFIG.value,validator:MIN_SCROLL_HEIGHT_CONFIG.validator,supercedes:MIN_SCROLL_HEIGHT_CONFIG.supercedes,suppressEvent:MIN_SCROLL_HEIGHT_CONFIG.suppressEvent});oConfig.addProperty(MAX_HEIGHT_CONFIG.key,{handler:this.configMaxHeight,value:MAX_HEIGHT_CONFIG.value,validator:MAX_HEIGHT_CONFIG.validator,suppressEvent:MAX_HEIGHT_CONFIG.suppressEvent,supercedes:MAX_HEIGHT_CONFIG.supercedes});oConfig.addProperty(CLASS_NAME_CONFIG.key,{handler:this.configClassName,value:CLASS_NAME_CONFIG.value,validator:CLASS_NAME_CONFIG.validator,supercedes:CLASS_NAME_CONFIG.supercedes});oConfig.addProperty(DISABLED_CONFIG.key,{handler:this.configDisabled,value:DISABLED_CONFIG.value,validator:DISABLED_CONFIG.validator,suppressEvent:DISABLED_CONFIG.suppressEvent});oConfig.addProperty(SHADOW_CONFIG.key,{handler:this.configShadow,value:SHADOW_CONFIG.value,validator:SHADOW_CONFIG.validator});oConfig.addProperty(KEEP_OPEN_CONFIG.key,{value:KEEP_OPEN_CONFIG.value,validator:KEEP_OPEN_CONFIG.validator});}});})();(function(){YAHOO.widget.MenuItem=function(p_oObject,p_oConfig){if(p_oObject){if(p_oConfig){this.parent=p_oConfig.parent;this.value=p_oConfig.value;this.id=p_oConfig.id;}this.init(p_oObject,p_oConfig);}};var Dom=YAHOO.util.Dom,Module=YAHOO.widget.Module,Menu=YAHOO.widget.Menu,MenuItem=YAHOO.widget.MenuItem,CustomEvent=YAHOO.util.CustomEvent,UA=YAHOO.env.ua,Lang=YAHOO.lang,_TEXT="text",_HASH="#",_HYPHEN="-",_HELP_TEXT="helptext",_URL="url",_TARGET="target",_EMPHASIS="emphasis",_STRONG_EMPHASIS="strongemphasis",_CHECKED="checked",_SUBMENU="submenu",_DISABLED="disabled",_SELECTED="selected",_HAS_SUBMENU="hassubmenu",_CHECKED_DISABLED="checked-disabled",_HAS_SUBMENU_DISABLED="hassubmenu-disabled",_HAS_SUBMENU_SELECTED="hassubmenu-selected",_CHECKED_SELECTED="checked-selected",_ONCLICK="onclick",_CLASSNAME="classname",_EMPTY_STRING="",_OPTION="OPTION",_OPTGROUP="OPTGROUP",_LI_UPPERCASE="LI",_HREF="href",_SELECT="SELECT",_DIV="DIV",_START_HELP_TEXT='<em class="helptext">',_START_EM="<em>",_END_EM="</em>",_START_STRONG="<strong>",_END_STRONG="</strong>",_PREVENT_CONTEXT_OVERLAP="preventcontextoverlap",_OBJ="obj",_SCOPE="scope",_NONE="none",_VISIBLE="visible",_SPACE=" ",_MENUITEM="MenuItem",_CLICK="click",_SHOW="show",_HIDE="hide",_LI_LOWERCASE="li",_ANCHOR_TEMPLATE='<a href="#"></a>',EVENT_TYPES=[["mouseOverEvent","mouseover"],["mouseOutEvent","mouseout"],["mouseDownEvent","mousedown"],["mouseUpEvent","mouseup"],["clickEvent",_CLICK],["keyPressEvent","keypress"],["keyDownEvent","keydown"],["keyUpEvent","keyup"],["focusEvent","focus"],["blurEvent","blur"],["destroyEvent","destroy"]],TEXT_CONFIG={key:_TEXT,value:_EMPTY_STRING,validator:Lang.isString,suppressEvent:true},HELP_TEXT_CONFIG={key:_HELP_TEXT,supercedes:[_TEXT],suppressEvent:true},URL_CONFIG={key:_URL,value:_HASH,suppressEvent:true},TARGET_CONFIG={key:_TARGET,suppressEvent:true},EMPHASIS_CONFIG={key:_EMPHASIS,value:false,validator:Lang.isBoolean,suppressEvent:true,supercedes:[_TEXT]},STRONG_EMPHASIS_CONFIG={key:_STRONG_EMPHASIS,value:false,validator:Lang.isBoolean,suppressEvent:true,supercedes:[_TEXT]},CHECKED_CONFIG={key:_CHECKED,value:false,validator:Lang.isBoolean,suppressEvent:true,supercedes:[_DISABLED,_SELECTED]},SUBMENU_CONFIG={key:_SUBMENU,suppressEvent:true,supercedes:[_DISABLED,_SELECTED]},DISABLED_CONFIG={key:_DISABLED,value:false,validator:Lang.isBoolean,suppressEvent:true,supercedes:[_TEXT,_SELECTED]},SELECTED_CONFIG={key:_SELECTED,value:false,validator:Lang.isBoolean,suppressEvent:true},ONCLICK_CONFIG={key:_ONCLICK,suppressEvent:true},CLASS_NAME_CONFIG={key:_CLASSNAME,value:null,validator:Lang.isString,suppressEvent:true},KEY_LISTENER_CONFIG={key:"keylistener",value:null,suppressEvent:true},m_oMenuItemTemplate=null,CLASS_NAMES={};var getClassNameForState=function(prefix,state){var oClassNames=CLASS_NAMES[prefix];if(!oClassNames){CLASS_NAMES[prefix]={};oClassNames=CLASS_NAMES[prefix];}var sClassName=oClassNames[state];if(!sClassName){sClassName=prefix+_HYPHEN+state;oClassNames[state]=sClassName;}return sClassName;};var addClassNameForState=function(state){Dom.addClass(this.element,getClassNameForState(this.CSS_CLASS_NAME,state));Dom.addClass(this._oAnchor,getClassNameForState(this.CSS_LABEL_CLASS_NAME,state));};var removeClassNameForState=function(state){Dom.removeClass(this.element,getClassNameForState(this.CSS_CLASS_NAME,state));Dom.removeClass(this._oAnchor,getClassNameForState(this.CSS_LABEL_CLASS_NAME,state));};MenuItem.prototype={CSS_CLASS_NAME:"yuimenuitem",CSS_LABEL_CLASS_NAME:"yuimenuitemlabel",SUBMENU_TYPE:null,_oAnchor:null,_oHelpTextEM:null,_oSubmenu:null,_oOnclickAttributeValue:null,_sClassName:null,constructor:MenuItem,index:null,groupIndex:null,parent:null,element:null,srcElement:null,value:null,browser:Module.prototype.browser,id:null,init:function(p_oObject,p_oConfig){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=Menu;}this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();var oConfig=this.cfg,sURL=_HASH,oCustomEvent,aEventData,oAnchor,sTarget,sText,sId,i;if(Lang.isString(p_oObject)){this._createRootNodeStructure();oConfig.queueProperty(_TEXT,p_oObject);}else{if(p_oObject&&p_oObject.tagName){switch(p_oObject.tagName.toUpperCase()){case _OPTION:this._createRootNodeStructure();oConfig.queueProperty(_TEXT,p_oObject.text);oConfig.queueProperty(_DISABLED,p_oObject.disabled);this.value=p_oObject.value;this.srcElement=p_oObject;break;case _OPTGROUP:this._createRootNodeStructure();oConfig.queueProperty(_TEXT,p_oObject.label);oConfig.queueProperty(_DISABLED,p_oObject.disabled);this.srcElement=p_oObject;this._initSubTree();break;case _LI_UPPERCASE:oAnchor=Dom.getFirstChild(p_oObject);if(oAnchor){sURL=oAnchor.getAttribute(_HREF,2);sTarget=oAnchor.getAttribute(_TARGET);sText=oAnchor.innerHTML;}this.srcElement=p_oObject;this.element=p_oObject;this._oAnchor=oAnchor;oConfig.setProperty(_TEXT,sText,true);oConfig.setProperty(_URL,sURL,true);oConfig.setProperty(_TARGET,sTarget,true);this._initSubTree();break;}}}if(this.element){sId=(this.srcElement||this.element).id;if(!sId){sId=this.id||Dom.generateId();this.element.id=sId;}this.id=sId;Dom.addClass(this.element,this.CSS_CLASS_NAME);Dom.addClass(this._oAnchor,this.CSS_LABEL_CLASS_NAME);i=EVENT_TYPES.length-1;do{aEventData=EVENT_TYPES[i];oCustomEvent=this.createEvent(aEventData[1]);oCustomEvent.signature=CustomEvent.LIST;this[aEventData[0]]=oCustomEvent;}while(i--);if(p_oConfig){oConfig.applyConfig(p_oConfig);}oConfig.fireQueue();}},_createRootNodeStructure:function(){var oElement,oAnchor;if(!m_oMenuItemTemplate){m_oMenuItemTemplate=document.createElement(_LI_LOWERCASE);m_oMenuItemTemplate.innerHTML=_ANCHOR_TEMPLATE;}oElement=m_oMenuItemTemplate.cloneNode(true);oElement.className=this.CSS_CLASS_NAME;oAnchor=oElement.firstChild;oAnchor.className=this.CSS_LABEL_CLASS_NAME;this.element=oElement;this._oAnchor=oAnchor;},_initSubTree:function(){var oSrcEl=this.srcElement,oConfig=this.cfg,oNode,aOptions,nOptions,oMenu,n;if(oSrcEl.childNodes.length>0){if(this.parent.lazyLoad&&this.parent.srcElement&&this.parent.srcElement.tagName.toUpperCase()==_SELECT){oConfig.setProperty(_SUBMENU,{id:Dom.generateId(),itemdata:oSrcEl.childNodes});}else{oNode=oSrcEl.firstChild;aOptions=[];do{if(oNode&&oNode.tagName){switch(oNode.tagName.toUpperCase()){case _DIV:oConfig.setProperty(_SUBMENU,oNode);break;case _OPTION:aOptions[aOptions.length]=oNode;break;}}}while((oNode=oNode.nextSibling));nOptions=aOptions.length;if(nOptions>0){oMenu=new this.SUBMENU_TYPE(Dom.generateId());oConfig.setProperty(_SUBMENU,oMenu);for(n=0;n<nOptions;n++){oMenu.addItem((new oMenu.ITEM_TYPE(aOptions[n])));}}}}},configText:function(p_sType,p_aArgs,p_oItem){var sText=p_aArgs[0],oConfig=this.cfg,oAnchor=this._oAnchor,sHelpText=oConfig.getProperty(_HELP_TEXT),sHelpTextHTML=_EMPTY_STRING,sEmphasisStartTag=_EMPTY_STRING,sEmphasisEndTag=_EMPTY_STRING;if(sText){if(sHelpText){sHelpTextHTML=_START_HELP_TEXT+sHelpText+_END_EM;}if(oConfig.getProperty(_EMPHASIS)){sEmphasisStartTag=_START_EM;sEmphasisEndTag=_END_EM;}if(oConfig.getProperty(_STRONG_EMPHASIS)){sEmphasisStartTag=_START_STRONG;sEmphasisEndTag=_END_STRONG;}oAnchor.innerHTML=(sEmphasisStartTag+sText+sEmphasisEndTag+sHelpTextHTML);}},configHelpText:function(p_sType,p_aArgs,p_oItem){this.cfg.refireEvent(_TEXT);},configURL:function(p_sType,p_aArgs,p_oItem){var sURL=p_aArgs[0];if(!sURL){sURL=_HASH;}var oAnchor=this._oAnchor;if(UA.opera){oAnchor.removeAttribute(_HREF);}oAnchor.setAttribute(_HREF,sURL);},configTarget:function(p_sType,p_aArgs,p_oItem){var sTarget=p_aArgs[0],oAnchor=this._oAnchor;if(sTarget&&sTarget.length>0){oAnchor.setAttribute(_TARGET,sTarget);}else{oAnchor.removeAttribute(_TARGET);}},configEmphasis:function(p_sType,p_aArgs,p_oItem){var bEmphasis=p_aArgs[0],oConfig=this.cfg;if(bEmphasis&&oConfig.getProperty(_STRONG_EMPHASIS)){oConfig.setProperty(_STRONG_EMPHASIS,false);}oConfig.refireEvent(_TEXT);},configStrongEmphasis:function(p_sType,p_aArgs,p_oItem){var bStrongEmphasis=p_aArgs[0],oConfig=this.cfg;if(bStrongEmphasis&&oConfig.getProperty(_EMPHASIS)){oConfig.setProperty(_EMPHASIS,false);}oConfig.refireEvent(_TEXT);},configChecked:function(p_sType,p_aArgs,p_oItem){var bChecked=p_aArgs[0],oConfig=this.cfg;if(bChecked){addClassNameForState.call(this,_CHECKED);}else{removeClassNameForState.call(this,_CHECKED);}oConfig.refireEvent(_TEXT);if(oConfig.getProperty(_DISABLED)){oConfig.refireEvent(_DISABLED);}if(oConfig.getProperty(_SELECTED)){oConfig.refireEvent(_SELECTED);}},configDisabled:function(p_sType,p_aArgs,p_oItem){var bDisabled=p_aArgs[0],oConfig=this.cfg,oSubmenu=oConfig.getProperty(_SUBMENU),bChecked=oConfig.getProperty(_CHECKED);if(bDisabled){if(oConfig.getProperty(_SELECTED)){oConfig.setProperty(_SELECTED,false);}addClassNameForState.call(this,_DISABLED);if(oSubmenu){addClassNameForState.call(this,_HAS_SUBMENU_DISABLED);}if(bChecked){addClassNameForState.call(this,_CHECKED_DISABLED);}}else{removeClassNameForState.call(this,_DISABLED);if(oSubmenu){removeClassNameForState.call(this,_HAS_SUBMENU_DISABLED);}if(bChecked){removeClassNameForState.call(this,_CHECKED_DISABLED);}}},configSelected:function(p_sType,p_aArgs,p_oItem){var oConfig=this.cfg,oAnchor=this._oAnchor,bSelected=p_aArgs[0],bChecked=oConfig.getProperty(_CHECKED),oSubmenu=oConfig.getProperty(_SUBMENU);if(UA.opera){oAnchor.blur();}if(bSelected&&!oConfig.getProperty(_DISABLED)){addClassNameForState.call(this,_SELECTED);if(oSubmenu){addClassNameForState.call(this,_HAS_SUBMENU_SELECTED);}if(bChecked){addClassNameForState.call(this,_CHECKED_SELECTED);}}else{removeClassNameForState.call(this,_SELECTED);if(oSubmenu){removeClassNameForState.call(this,_HAS_SUBMENU_SELECTED);}if(bChecked){removeClassNameForState.call(this,_CHECKED_SELECTED);}}if(this.hasFocus()&&UA.opera){oAnchor.focus();}},_onSubmenuBeforeHide:function(p_sType,p_aArgs){var oItem=this.parent,oMenu;function onHide(){oItem._oAnchor.blur();oMenu.beforeHideEvent.unsubscribe(onHide);}if(oItem.hasFocus()){oMenu=oItem.parent;oMenu.beforeHideEvent.subscribe(onHide);}},configSubmenu:function(p_sType,p_aArgs,p_oItem){var oSubmenu=p_aArgs[0],oConfig=this.cfg,bLazyLoad=this.parent&&this.parent.lazyLoad,oMenu,sSubmenuId,oSubmenuConfig;if(oSubmenu){if(oSubmenu instanceof Menu){oMenu=oSubmenu;oMenu.parent=this;oMenu.lazyLoad=bLazyLoad;}else{if(Lang.isObject(oSubmenu)&&oSubmenu.id&&!oSubmenu.nodeType){sSubmenuId=oSubmenu.id;oSubmenuConfig=oSubmenu;oSubmenuConfig.lazyload=bLazyLoad;oSubmenuConfig.parent=this;oMenu=new this.SUBMENU_TYPE(sSubmenuId,oSubmenuConfig);oConfig.setProperty(_SUBMENU,oMenu,true);}else{oMenu=new this.SUBMENU_TYPE(oSubmenu,{lazyload:bLazyLoad,parent:this});oConfig.setProperty(_SUBMENU,oMenu,true);}}if(oMenu){oMenu.cfg.setProperty(_PREVENT_CONTEXT_OVERLAP,true);addClassNameForState.call(this,_HAS_SUBMENU);if(oConfig.getProperty(_URL)===_HASH){oConfig.setProperty(_URL,(_HASH+oMenu.id));}this._oSubmenu=oMenu;if(UA.opera){oMenu.beforeHideEvent.subscribe(this._onSubmenuBeforeHide);}}}else{removeClassNameForState.call(this,_HAS_SUBMENU);if(this._oSubmenu){this._oSubmenu.destroy();}}if(oConfig.getProperty(_DISABLED)){oConfig.refireEvent(_DISABLED);}if(oConfig.getProperty(_SELECTED)){oConfig.refireEvent(_SELECTED);}},configOnClick:function(p_sType,p_aArgs,p_oItem){var oObject=p_aArgs[0];if(this._oOnclickAttributeValue&&(this._oOnclickAttributeValue!=oObject)){this.clickEvent.unsubscribe(this._oOnclickAttributeValue.fn,this._oOnclickAttributeValue.obj);this._oOnclickAttributeValue=null;}if(!this._oOnclickAttributeValue&&Lang.isObject(oObject)&&Lang.isFunction(oObject.fn)){this.clickEvent.subscribe(oObject.fn,((_OBJ in oObject)?oObject.obj:this),((_SCOPE in oObject)?oObject.scope:null));this._oOnclickAttributeValue=oObject;}},configClassName:function(p_sType,p_aArgs,p_oItem){var sClassName=p_aArgs[0];if(this._sClassName){Dom.removeClass(this.element,this._sClassName);}Dom.addClass(this.element,sClassName);this._sClassName=sClassName;},_dispatchClickEvent:function(){var oMenuItem=this,oAnchor;if(!oMenuItem.cfg.getProperty(_DISABLED)){oAnchor=Dom.getFirstChild(oMenuItem.element);this._dispatchDOMClick(oAnchor);}},_dispatchDOMClick:function(el){var oEvent;if(UA.ie&&UA.ie<9){el.fireEvent(_ONCLICK);}else{if((UA.gecko&&UA.gecko>=1.9)||UA.opera||UA.webkit){oEvent=document.createEvent("HTMLEvents");oEvent.initEvent(_CLICK,true,true);}else{oEvent=document.createEvent("MouseEvents");oEvent.initMouseEvent(_CLICK,true,true,window,0,0,0,0,0,false,false,false,false,0,null);}el.dispatchEvent(oEvent);}},_createKeyListener:function(type,args,keyData){var oMenuItem=this,oMenu=oMenuItem.parent;var oKeyListener=new YAHOO.util.KeyListener(oMenu.element.ownerDocument,keyData,{fn:oMenuItem._dispatchClickEvent,scope:oMenuItem,correctScope:true});if(oMenu.cfg.getProperty(_VISIBLE)){oKeyListener.enable();}oMenu.subscribe(_SHOW,oKeyListener.enable,null,oKeyListener);oMenu.subscribe(_HIDE,oKeyListener.disable,null,oKeyListener);oMenuItem._keyListener=oKeyListener;oMenu.unsubscribe(_SHOW,oMenuItem._createKeyListener,keyData);},configKeyListener:function(p_sType,p_aArgs){var oKeyData=p_aArgs[0],oMenuItem=this,oMenu=oMenuItem.parent;if(oMenuItem._keyData){oMenu.unsubscribe(_SHOW,oMenuItem._createKeyListener,oMenuItem._keyData);oMenuItem._keyData=null;}if(oMenuItem._keyListener){oMenu.unsubscribe(_SHOW,oMenuItem._keyListener.enable);oMenu.unsubscribe(_HIDE,oMenuItem._keyListener.disable);oMenuItem._keyListener.disable();oMenuItem._keyListener=null;}if(oKeyData){oMenuItem._keyData=oKeyData;oMenu.subscribe(_SHOW,oMenuItem._createKeyListener,oKeyData,oMenuItem);}},initDefaultConfig:function(){var oConfig=this.cfg;oConfig.addProperty(TEXT_CONFIG.key,{handler:this.configText,value:TEXT_CONFIG.value,validator:TEXT_CONFIG.validator,suppressEvent:TEXT_CONFIG.suppressEvent});oConfig.addProperty(HELP_TEXT_CONFIG.key,{handler:this.configHelpText,supercedes:HELP_TEXT_CONFIG.supercedes,suppressEvent:HELP_TEXT_CONFIG.suppressEvent});oConfig.addProperty(URL_CONFIG.key,{handler:this.configURL,value:URL_CONFIG.value,suppressEvent:URL_CONFIG.suppressEvent});oConfig.addProperty(TARGET_CONFIG.key,{handler:this.configTarget,suppressEvent:TARGET_CONFIG.suppressEvent});oConfig.addProperty(EMPHASIS_CONFIG.key,{handler:this.configEmphasis,value:EMPHASIS_CONFIG.value,validator:EMPHASIS_CONFIG.validator,suppressEvent:EMPHASIS_CONFIG.suppressEvent,supercedes:EMPHASIS_CONFIG.supercedes});oConfig.addProperty(STRONG_EMPHASIS_CONFIG.key,{handler:this.configStrongEmphasis,value:STRONG_EMPHASIS_CONFIG.value,validator:STRONG_EMPHASIS_CONFIG.validator,suppressEvent:STRONG_EMPHASIS_CONFIG.suppressEvent,supercedes:STRONG_EMPHASIS_CONFIG.supercedes});oConfig.addProperty(CHECKED_CONFIG.key,{handler:this.configChecked,value:CHECKED_CONFIG.value,validator:CHECKED_CONFIG.validator,suppressEvent:CHECKED_CONFIG.suppressEvent,supercedes:CHECKED_CONFIG.supercedes});oConfig.addProperty(DISABLED_CONFIG.key,{handler:this.configDisabled,value:DISABLED_CONFIG.value,validator:DISABLED_CONFIG.validator,suppressEvent:DISABLED_CONFIG.suppressEvent});oConfig.addProperty(SELECTED_CONFIG.key,{handler:this.configSelected,value:SELECTED_CONFIG.value,validator:SELECTED_CONFIG.validator,suppressEvent:SELECTED_CONFIG.suppressEvent});oConfig.addProperty(SUBMENU_CONFIG.key,{handler:this.configSubmenu,supercedes:SUBMENU_CONFIG.supercedes,suppressEvent:SUBMENU_CONFIG.suppressEvent});oConfig.addProperty(ONCLICK_CONFIG.key,{handler:this.configOnClick,suppressEvent:ONCLICK_CONFIG.suppressEvent});oConfig.addProperty(CLASS_NAME_CONFIG.key,{handler:this.configClassName,value:CLASS_NAME_CONFIG.value,validator:CLASS_NAME_CONFIG.validator,suppressEvent:CLASS_NAME_CONFIG.suppressEvent});oConfig.addProperty(KEY_LISTENER_CONFIG.key,{handler:this.configKeyListener,value:KEY_LISTENER_CONFIG.value,suppressEvent:KEY_LISTENER_CONFIG.suppressEvent});},getNextSibling:function(){var isUL=function(el){return(el.nodeName.toLowerCase()==="ul");},menuitemEl=this.element,next=Dom.getNextSibling(menuitemEl),parent,sibling,list;if(!next){parent=menuitemEl.parentNode;sibling=Dom.getNextSiblingBy(parent,isUL);if(sibling){list=sibling;}else{list=Dom.getFirstChildBy(parent.parentNode,isUL);}next=Dom.getFirstChild(list);}return YAHOO.widget.MenuManager.getMenuItem(next.id);},getNextEnabledSibling:function(){var next=this.getNextSibling();return(next.cfg.getProperty(_DISABLED)||next.element.style.display==_NONE)?next.getNextEnabledSibling():next;},getPreviousSibling:function(){var isUL=function(el){return(el.nodeName.toLowerCase()==="ul");},menuitemEl=this.element,next=Dom.getPreviousSibling(menuitemEl),parent,sibling,list;if(!next){parent=menuitemEl.parentNode;sibling=Dom.getPreviousSiblingBy(parent,isUL);if(sibling){list=sibling;}else{list=Dom.getLastChildBy(parent.parentNode,isUL);}next=Dom.getLastChild(list);}return YAHOO.widget.MenuManager.getMenuItem(next.id);},getPreviousEnabledSibling:function(){var next=this.getPreviousSibling();return(next.cfg.getProperty(_DISABLED)||next.element.style.display==_NONE)?next.getPreviousEnabledSibling():next;},focus:function(){var oParent=this.parent,oAnchor=this._oAnchor,oActiveItem=oParent.activeItem;function setFocus(){try{if(!(UA.ie&&!document.hasFocus())){if(oActiveItem){oActiveItem.blurEvent.fire();}oAnchor.focus();this.focusEvent.fire();}}catch(e){}}if(!this.cfg.getProperty(_DISABLED)&&oParent&&oParent.cfg.getProperty(_VISIBLE)&&this.element.style.display!=_NONE){Lang.later(0,this,setFocus);}},blur:function(){var oParent=this.parent;if(!this.cfg.getProperty(_DISABLED)&&oParent&&oParent.cfg.getProperty(_VISIBLE)){Lang.later(0,this,function(){try{this._oAnchor.blur();this.blurEvent.fire();}catch(e){}},0);}},hasFocus:function(){return(YAHOO.widget.MenuManager.getFocusedMenuItem()==this);},destroy:function(){var oEl=this.element,oSubmenu,oParentNode,aEventData,i;if(oEl){oSubmenu=this.cfg.getProperty(_SUBMENU);if(oSubmenu){oSubmenu.destroy();}oParentNode=oEl.parentNode;if(oParentNode){oParentNode.removeChild(oEl);this.destroyEvent.fire();}i=EVENT_TYPES.length-1;do{aEventData=EVENT_TYPES[i];this[aEventData[0]].unsubscribeAll();}while(i--);this.cfg.configChangedEvent.unsubscribeAll();}},toString:function(){var sReturnVal=_MENUITEM,sId=this.id;if(sId){sReturnVal+=(_SPACE+sId);}return sReturnVal;}};Lang.augmentProto(MenuItem,YAHOO.util.EventProvider);})();(function(){var _XY="xy",_MOUSEDOWN="mousedown",_CONTEXTMENU="ContextMenu",_SPACE=" ";YAHOO.widget.ContextMenu=function(p_oElement,p_oConfig){YAHOO.widget.ContextMenu.superclass.constructor.call(this,p_oElement,p_oConfig);};var Event=YAHOO.util.Event,UA=YAHOO.env.ua,ContextMenu=YAHOO.widget.ContextMenu,EVENT_TYPES={TRIGGER_CONTEXT_MENU:"triggerContextMenu",CONTEXT_MENU:(UA.opera?_MOUSEDOWN:"contextmenu"),CLICK:"click"},TRIGGER_CONFIG={key:"trigger",suppressEvent:true};function position(p_sType,p_aArgs,p_aPos){this.cfg.setProperty(_XY,p_aPos);this.beforeShowEvent.unsubscribe(position,p_aPos);}YAHOO.lang.extend(ContextMenu,YAHOO.widget.Menu,{_oTrigger:null,_bCancelled:false,contextEventTarget:null,triggerContextMenuEvent:null,init:function(p_oElement,p_oConfig){ContextMenu.superclass.init.call(this,p_oElement);this.beforeInitEvent.fire(ContextMenu);if(p_oConfig){this.cfg.applyConfig(p_oConfig,true);}this.initEvent.fire(ContextMenu);},initEvents:function(){ContextMenu.superclass.initEvents.call(this);this.triggerContextMenuEvent=this.createEvent(EVENT_TYPES.TRIGGER_CONTEXT_MENU);this.triggerContextMenuEvent.signature=YAHOO.util.CustomEvent.LIST;},cancel:function(){this._bCancelled=true;},_removeEventHandlers:function(){var oTrigger=this._oTrigger;if(oTrigger){Event.removeListener(oTrigger,EVENT_TYPES.CONTEXT_MENU,this._onTriggerContextMenu);if(UA.opera){Event.removeListener(oTrigger,EVENT_TYPES.CLICK,this._onTriggerClick);}}},_onTriggerClick:function(p_oEvent,p_oMenu){if(p_oEvent.ctrlKey){Event.stopEvent(p_oEvent);}},_onTriggerContextMenu:function(p_oEvent,p_oMenu){var aXY;if(!(p_oEvent.type==_MOUSEDOWN&&!p_oEvent.ctrlKey)){this.contextEventTarget=Event.getTarget(p_oEvent);this.triggerContextMenuEvent.fire(p_oEvent);if(!this._bCancelled){Event.stopEvent(p_oEvent);YAHOO.widget.MenuManager.hideVisible();aXY=Event.getXY(p_oEvent);if(!YAHOO.util.Dom.inDocument(this.element)){this.beforeShowEvent.subscribe(position,aXY);}else{this.cfg.setProperty(_XY,aXY);}this.show();}this._bCancelled=false;}},toString:function(){var sReturnVal=_CONTEXTMENU,sId=this.id;if(sId){sReturnVal+=(_SPACE+sId);}return sReturnVal;},initDefaultConfig:function(){ContextMenu.superclass.initDefaultConfig.call(this);this.cfg.addProperty(TRIGGER_CONFIG.key,{handler:this.configTrigger,suppressEvent:TRIGGER_CONFIG.suppressEvent});},destroy:function(shallowPurge){this._removeEventHandlers();ContextMenu.superclass.destroy.call(this,shallowPurge);},configTrigger:function(p_sType,p_aArgs,p_oMenu){var oTrigger=p_aArgs[0];if(oTrigger){if(this._oTrigger){this._removeEventHandlers();}this._oTrigger=oTrigger;Event.on(oTrigger,EVENT_TYPES.CONTEXT_MENU,this._onTriggerContextMenu,this,true);if(UA.opera){Event.on(oTrigger,EVENT_TYPES.CLICK,this._onTriggerClick,this,true);}}else{this._removeEventHandlers();}}});}());YAHOO.widget.ContextMenuItem=YAHOO.widget.MenuItem;(function(){var Lang=YAHOO.lang,_STATIC="static",_DYNAMIC_STATIC="dynamic,"+_STATIC,_DISABLED="disabled",_SELECTED="selected",_AUTO_SUBMENU_DISPLAY="autosubmenudisplay",_SUBMENU="submenu",_VISIBLE="visible",_SPACE=" ",_SUBMENU_TOGGLE_REGION="submenutoggleregion",_MENUBAR="MenuBar";YAHOO.widget.MenuBar=function(p_oElement,p_oConfig){YAHOO.widget.MenuBar.superclass.constructor.call(this,p_oElement,p_oConfig);};function checkPosition(p_sPosition){var returnVal=false;if(Lang.isString(p_sPosition)){returnVal=(_DYNAMIC_STATIC.indexOf((p_sPosition.toLowerCase()))!=-1);}return returnVal;}var Event=YAHOO.util.Event,MenuBar=YAHOO.widget.MenuBar,POSITION_CONFIG={key:"position",value:_STATIC,validator:checkPosition,supercedes:[_VISIBLE]},SUBMENU_ALIGNMENT_CONFIG={key:"submenualignment",value:["tl","bl"]},AUTO_SUBMENU_DISPLAY_CONFIG={key:_AUTO_SUBMENU_DISPLAY,value:false,validator:Lang.isBoolean,suppressEvent:true},SUBMENU_TOGGLE_REGION_CONFIG={key:_SUBMENU_TOGGLE_REGION,value:false,validator:Lang.isBoolean};Lang.extend(MenuBar,YAHOO.widget.Menu,{init:function(p_oElement,p_oConfig){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuBarItem;}MenuBar.superclass.init.call(this,p_oElement);this.beforeInitEvent.fire(MenuBar);if(p_oConfig){this.cfg.applyConfig(p_oConfig,true);}this.initEvent.fire(MenuBar);},CSS_CLASS_NAME:"yuimenubar",SUBMENU_TOGGLE_REGION_WIDTH:20,_onKeyDown:function(p_sType,p_aArgs,p_oMenuBar){var oEvent=p_aArgs[0],oItem=p_aArgs[1],oSubmenu,oItemCfg,oNextItem;if(oItem&&!oItem.cfg.getProperty(_DISABLED)){oItemCfg=oItem.cfg;switch(oEvent.keyCode){case 37:case 39:if(oItem==this.activeItem&&!oItemCfg.getProperty(_SELECTED)){oItemCfg.setProperty(_SELECTED,true);}else{oNextItem=(oEvent.keyCode==37)?oItem.getPreviousEnabledSibling():oItem.getNextEnabledSibling();if(oNextItem){this.clearActiveItem();oNextItem.cfg.setProperty(_SELECTED,true);oSubmenu=oNextItem.cfg.getProperty(_SUBMENU);if(oSubmenu){oSubmenu.show();oSubmenu.setInitialFocus();}else{oNextItem.focus();}}}Event.preventDefault(oEvent);break;case 40:if(this.activeItem!=oItem){this.clearActiveItem();oItemCfg.setProperty(_SELECTED,true);oItem.focus();}oSubmenu=oItemCfg.getProperty(_SUBMENU);if(oSubmenu){if(oSubmenu.cfg.getProperty(_VISIBLE)){oSubmenu.setInitialSelection();oSubmenu.setInitialFocus();}else{oSubmenu.show();oSubmenu.setInitialFocus();}}Event.preventDefault(oEvent);break;}}if(oEvent.keyCode==27&&this.activeItem){oSubmenu=this.activeItem.cfg.getProperty(_SUBMENU);if(oSubmenu&&oSubmenu.cfg.getProperty(_VISIBLE)){oSubmenu.hide();this.activeItem.focus();}else{this.activeItem.cfg.setProperty(_SELECTED,false);this.activeItem.blur();}Event.preventDefault(oEvent);}},_onClick:function(p_sType,p_aArgs,p_oMenuBar){MenuBar.superclass._onClick.call(this,p_sType,p_aArgs,p_oMenuBar);var oItem=p_aArgs[1],bReturnVal=true,oItemEl,oEvent,oTarget,oActiveItem,oConfig,oSubmenu,nMenuItemX,nToggleRegion;var toggleSubmenuDisplay=function(){if(oSubmenu.cfg.getProperty(_VISIBLE)){oSubmenu.hide();}else{oSubmenu.show();}};if(oItem&&!oItem.cfg.getProperty(_DISABLED)){oEvent=p_aArgs[0];oTarget=Event.getTarget(oEvent);oActiveItem=this.activeItem;oConfig=this.cfg;if(oActiveItem&&oActiveItem!=oItem){this.clearActiveItem();}oItem.cfg.setProperty(_SELECTED,true);oSubmenu=oItem.cfg.getProperty(_SUBMENU);if(oSubmenu){oItemEl=oItem.element;nMenuItemX=YAHOO.util.Dom.getX(oItemEl);nToggleRegion=nMenuItemX+(oItemEl.offsetWidth-this.SUBMENU_TOGGLE_REGION_WIDTH);if(oConfig.getProperty(_SUBMENU_TOGGLE_REGION)){if(Event.getPageX(oEvent)>nToggleRegion){toggleSubmenuDisplay();Event.preventDefault(oEvent);bReturnVal=false;}}else{toggleSubmenuDisplay();}}}return bReturnVal;},configSubmenuToggle:function(p_sType,p_aArgs){var bSubmenuToggle=p_aArgs[0];if(bSubmenuToggle){this.cfg.setProperty(_AUTO_SUBMENU_DISPLAY,false);}},toString:function(){var sReturnVal=_MENUBAR,sId=this.id;if(sId){sReturnVal+=(_SPACE+sId);}return sReturnVal;},initDefaultConfig:function(){MenuBar.superclass.initDefaultConfig.call(this);var oConfig=this.cfg;oConfig.addProperty(POSITION_CONFIG.key,{handler:this.configPosition,value:POSITION_CONFIG.value,validator:POSITION_CONFIG.validator,supercedes:POSITION_CONFIG.supercedes});oConfig.addProperty(SUBMENU_ALIGNMENT_CONFIG.key,{value:SUBMENU_ALIGNMENT_CONFIG.value,suppressEvent:SUBMENU_ALIGNMENT_CONFIG.suppressEvent});oConfig.addProperty(AUTO_SUBMENU_DISPLAY_CONFIG.key,{value:AUTO_SUBMENU_DISPLAY_CONFIG.value,validator:AUTO_SUBMENU_DISPLAY_CONFIG.validator,suppressEvent:AUTO_SUBMENU_DISPLAY_CONFIG.suppressEvent});oConfig.addProperty(SUBMENU_TOGGLE_REGION_CONFIG.key,{value:SUBMENU_TOGGLE_REGION_CONFIG.value,validator:SUBMENU_TOGGLE_REGION_CONFIG.validator,handler:this.configSubmenuToggle});}});}());YAHOO.widget.MenuBarItem=function(p_oObject,p_oConfig){YAHOO.widget.MenuBarItem.superclass.constructor.call(this,p_oObject,p_oConfig);};YAHOO.lang.extend(YAHOO.widget.MenuBarItem,YAHOO.widget.MenuItem,{init:function(p_oObject,p_oConfig){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.Menu;}YAHOO.widget.MenuBarItem.superclass.init.call(this,p_oObject);var oConfig=this.cfg;if(p_oConfig){oConfig.applyConfig(p_oConfig,true);}oConfig.fireQueue();},CSS_CLASS_NAME:"yuimenubaritem",CSS_LABEL_CLASS_NAME:"yuimenubaritemlabel",toString:function(){var sReturnVal="MenuBarItem";if(this.cfg&&this.cfg.getProperty("text")){sReturnVal+=(": "+this.cfg.getProperty("text"));}return sReturnVal;}});YAHOO.register("menu",YAHOO.widget.Menu,{version:"2.9.0",build:"2800"});
/*http://www.physiotherapyalberta.ca/portal_javascripts/build/connection/connection.js?original=1*/
YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_isFormSubmit:false,_default_headers:{},_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(id){this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b){if(typeof b=="string"){this._default_post_header=b;this._use_default_post_header=true;}else{if(typeof b=="boolean"){this._use_default_post_header=b;}}},setDefaultXhrHeader:function(b){if(typeof b=="string"){this._default_xhr_header=b;}else{this._use_default_xhr_header=b;}},setPollingInterval:function(i){if(typeof i=="number"&&isFinite(i)){this._polling_interval=i;}},createXhrObject:function(transactionId){var obj,http,i;try{http=new XMLHttpRequest();obj={conn:http,tId:transactionId,xhr:true};}catch(e){for(i=0;i<this._msxml_progid.length;++i){try{http=new ActiveXObject(this._msxml_progid[i]);obj={conn:http,tId:transactionId,xhr:true};break;}catch(e1){}}}finally{return obj;}},getConnectionObject:function(t){var o,tId=this._transaction_id;try{if(!t){o=this.createXhrObject(tId);}else{o={tId:tId};if(t==="xdr"){o.conn=this._transport;o.xdr=true;}else{if(t==="upload"){o.upload=true;}}}if(o){this._transaction_id++;}}catch(e){}return o;},asyncRequest:function(method,uri,callback,postData){var args=callback&&callback.argument?callback.argument:null,YCM=this,o,t;if(this._isFileUpload){t="upload";}else{if(callback&&callback.xdr){t="xdr";}}o=this.getConnectionObject(t);if(!o){return null;}else{if(callback&&callback.customevents){this.initCustomEvents(o,callback);}if(this._isFormSubmit){if(this._isFileUpload){window.setTimeout(function(){YCM.uploadFile(o,callback,uri,postData);},10);return o;}if(method.toUpperCase()=="GET"){if(this._sFormData.length!==0){uri+=((uri.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(method.toUpperCase()=="POST"){postData=postData?this._sFormData+"&"+postData:this._sFormData;}}}if(method.toUpperCase()=="GET"&&(callback&&callback.cache===false)){uri+=((uri.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString();}if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);}}if((method.toUpperCase()==="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);}if(o.xdr){this.xdr(o,method,uri,callback,postData);return o;}o.conn.open(method,uri,true);if(this._has_default_headers||this._has_http_headers){this.setHeader(o);}this.handleReadyState(o,callback);o.conn.send(postData||"");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(o,args);if(o.startEvent){o.startEvent.fire(o,args);}return o;}},initCustomEvents:function(o,callback){var prop;for(prop in callback.customevents){if(this._customEvents[prop][0]){o[this._customEvents[prop][0]]=new YAHOO.util.CustomEvent(this._customEvents[prop][1],(callback.scope)?callback.scope:null);o[this._customEvents[prop][0]].subscribe(callback.customevents[prop]);}}},handleReadyState:function(o,callback){var oConn=this,args=(callback&&callback.argument)?callback.argument:null;if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState===4){window.clearInterval(oConn._poll[o.tId]);delete oConn._poll[o.tId];if(callback&&callback.timeout){window.clearTimeout(oConn._timeOut[o.tId]);delete oConn._timeOut[o.tId];}oConn.completeEvent.fire(o,args);if(o.completeEvent){o.completeEvent.fire(o,args);}oConn.handleTransactionResponse(o,callback);}},this._polling_interval);},handleTransactionResponse:function(o,callback,isAbort){var httpStatus,responseObject,args=(callback&&callback.argument)?callback.argument:null,xdrS=(o.r&&o.r.statusText==="xdr:success")?true:false,xdrF=(o.r&&o.r.statusText==="xdr:failure")?true:false,xdrA=isAbort;try{if((o.conn.status!==undefined&&o.conn.status!==0)||xdrS){httpStatus=o.conn.status;}else{if(xdrF&&!xdrA){httpStatus=0;}else{httpStatus=13030;}}}catch(e){httpStatus=13030;}if((httpStatus>=200&&httpStatus<300)||httpStatus===1223||xdrS){responseObject=o.xdr?o.r:this.createResponseObject(o,args);if(callback&&callback.success){if(!callback.scope){callback.success(responseObject);}else{callback.success.apply(callback.scope,[responseObject]);}}this.successEvent.fire(responseObject);if(o.successEvent){o.successEvent.fire(responseObject);}}else{switch(httpStatus){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:responseObject=this.createExceptionObject(o.tId,args,(isAbort?isAbort:false));if(callback&&callback.failure){if(!callback.scope){callback.failure(responseObject);}else{callback.failure.apply(callback.scope,[responseObject]);}}break;default:responseObject=(o.xdr)?o.response:this.createResponseObject(o,args);if(callback&&callback.failure){if(!callback.scope){callback.failure(responseObject);}else{callback.failure.apply(callback.scope,[responseObject]);}}}this.failureEvent.fire(responseObject);if(o.failureEvent){o.failureEvent.fire(responseObject);}}this.releaseObject(o);responseObject=null;},createResponseObject:function(o,callbackArg){var obj={},headerObj={},i,headerStr,header,delimitPos;try{headerStr=o.conn.getAllResponseHeaders();header=headerStr.split("\n");for(i=0;i<header.length;i++){delimitPos=header[i].indexOf(":");if(delimitPos!=-1){headerObj[header[i].substring(0,delimitPos)]=YAHOO.lang.trim(header[i].substring(delimitPos+2));}}}catch(e){}obj.tId=o.tId;obj.status=(o.conn.status==1223)?204:o.conn.status;obj.statusText=(o.conn.status==1223)?"No Content":o.conn.statusText;obj.getResponseHeader=headerObj;obj.getAllResponseHeaders=headerStr;obj.responseText=o.conn.responseText;obj.responseXML=o.conn.responseXML;if(callbackArg){obj.argument=callbackArg;}return obj;},createExceptionObject:function(tId,callbackArg,isAbort){var COMM_CODE=0,COMM_ERROR="communication failure",ABORT_CODE=-1,ABORT_ERROR="transaction aborted",obj={};obj.tId=tId;if(isAbort){obj.status=ABORT_CODE;obj.statusText=ABORT_ERROR;}else{obj.status=COMM_CODE;obj.statusText=COMM_ERROR;}if(callbackArg){obj.argument=callbackArg;}return obj;},initHeader:function(label,value,isDefault){var headerObj=(isDefault)?this._default_headers:this._http_headers;headerObj[label]=value;if(isDefault){this._has_default_headers=true;}else{this._has_http_headers=true;}},setHeader:function(o){var prop;if(this._has_default_headers){for(prop in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,prop)){o.conn.setRequestHeader(prop,this._default_headers[prop]);}}}if(this._has_http_headers){for(prop in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,prop)){o.conn.setRequestHeader(prop,this._http_headers[prop]);}}this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){this._default_headers={};this._has_default_headers=false;},abort:function(o,callback,isTimeout){var abortStatus,args=(callback&&callback.argument)?callback.argument:null;o=o||{};if(o.conn){if(o.xhr){if(this.isCallInProgress(o)){o.conn.abort();window.clearInterval(this._poll[o.tId]);delete this._poll[o.tId];if(isTimeout){window.clearTimeout(this._timeOut[o.tId]);delete this._timeOut[o.tId];}abortStatus=true;}}else{if(o.xdr){o.conn.abort(o.tId);abortStatus=true;}}}else{if(o.upload){var frameId="yuiIO"+o.tId;var io=document.getElementById(frameId);if(io){YAHOO.util.Event.removeListener(io,"load");document.body.removeChild(io);if(isTimeout){window.clearTimeout(this._timeOut[o.tId]);delete this._timeOut[o.tId];}abortStatus=true;}}else{abortStatus=false;}}if(abortStatus===true){this.abortEvent.fire(o,args);if(o.abortEvent){o.abortEvent.fire(o,args);}this.handleTransactionResponse(o,callback,true);}return abortStatus;},isCallInProgress:function(o){o=o||{};if(o.xhr&&o.conn){return o.conn.readyState!==4&&o.conn.readyState!==0;}else{if(o.xdr&&o.conn){return o.conn.isCallInProgress(o.tId);}else{if(o.upload===true){return document.getElementById("yuiIO"+o.tId)?true:false;}else{return false;}}}},releaseObject:function(o){if(o&&o.conn){o.conn=null;o=null;}}};(function(){var YCM=YAHOO.util.Connect,_fn={};function _swf(uri){var o='<object id="YUIConnectionSwf" type="application/x-shockwave-flash" data="'+uri+'" width="0" height="0"><param name="movie" value="'+uri+'"><param name="allowScriptAccess" value="always"></object>',c=document.createElement("div");document.body.appendChild(c);c.innerHTML=o;}function _xdr(o,m,u,c,d){_fn[parseInt(o.tId)]={o:o,c:c};if(d){c.method=m;c.data=d;}o.conn.send(u,c,o.tId);}function _init(uri){_swf(uri);YCM._transport=document.getElementById("YUIConnectionSwf");}function _xdrReady(){YCM.xdrReadyEvent.fire();}function _xdrStart(o,cb){if(o){YCM.startEvent.fire(o,cb.argument);if(o.startEvent){o.startEvent.fire(o,cb.argument);}}}function _handleXdrResponse(r){var o=_fn[r.tId].o,cb=_fn[r.tId].c;if(r.statusText==="xdr:start"){_xdrStart(o,cb);return;}r.responseText=decodeURI(r.responseText);o.r=r;if(cb.argument){o.r.argument=cb.argument;}this.handleTransactionResponse(o,cb,r.statusText==="xdr:abort"?true:false);delete _fn[r.tId];}YCM.xdr=_xdr;YCM.swf=_swf;YCM.transport=_init;YCM.xdrReadyEvent=new YAHOO.util.CustomEvent("xdrReady");YCM.xdrReady=_xdrReady;YCM.handleXdrResponse=_handleXdrResponse;})();(function(){var YCM=YAHOO.util.Connect,YE=YAHOO.util.Event,dM=document.documentMode?document.documentMode:false;YCM._isFileUpload=false;YCM._formNode=null;YCM._sFormData=null;YCM._submitElementValue=null;YCM.uploadEvent=new YAHOO.util.CustomEvent("upload");YCM._hasSubmitListener=function(){if(YE){YE.addListener(document,"click",function(e){var obj=YE.getTarget(e),name=obj.nodeName.toLowerCase();if((name==="input"||name==="button")&&(obj.type&&obj.type.toLowerCase()=="submit")){YCM._submitElementValue=encodeURIComponent(obj.name)+"="+encodeURIComponent(obj.value);}});return true;}return false;}();function _setForm(formId,isUpload,secureUri){var oForm,oElement,oName,oValue,oDisabled,hasSubmit=false,data=[],item=0,i,len,j,jlen,opt;this.resetFormState();if(typeof formId=="string"){oForm=(document.getElementById(formId)||document.forms[formId]);}else{if(typeof formId=="object"){oForm=formId;}else{return;}}if(isUpload){this.createFrame(secureUri?secureUri:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}for(i=0,len=oForm.elements.length;i<len;++i){oElement=oForm.elements[i];oDisabled=oElement.disabled;oName=oElement.name;if(!oDisabled&&oName){oName=encodeURIComponent(oName)+"=";oValue=encodeURIComponent(oElement.value);switch(oElement.type){case"select-one":if(oElement.selectedIndex>-1){opt=oElement.options[oElement.selectedIndex];data[item++]=oName+encodeURIComponent((opt.attributes.value&&opt.attributes.value.specified)?opt.value:opt.text);}break;case"select-multiple":if(oElement.selectedIndex>-1){for(j=oElement.selectedIndex,jlen=oElement.options.length;j<jlen;++j){opt=oElement.options[j];if(opt.selected){data[item++]=oName+encodeURIComponent((opt.attributes.value&&opt.attributes.value.specified)?opt.value:opt.text);}}}break;case"radio":case"checkbox":if(oElement.checked){data[item++]=oName+oValue;}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(hasSubmit===false){if(this._hasSubmitListener&&this._submitElementValue){data[item++]=this._submitElementValue;}hasSubmit=true;}break;default:data[item++]=oName+oValue;}}}this._isFormSubmit=true;this._sFormData=data.join("&");this.initHeader("Content-Type",this._default_form_header);return this._sFormData;}function _resetFormState(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";}function _createFrame(secureUri){var frameId="yuiIO"+this._transaction_id,ie9=(dM===9)?true:false,io;if(YAHOO.env.ua.ie&&!ie9){io=document.createElement('<iframe id="'+frameId+'" name="'+frameId+'" />');if(typeof secureUri=="boolean"){io.src="javascript:false";}}else{io=document.createElement("iframe");io.id=frameId;io.name=frameId;}io.style.position="absolute";io.style.top="-1000px";io.style.left="-1000px";document.body.appendChild(io);}function _appendPostData(postData){var formElements=[],postMessage=postData.split("&"),i,delimitPos;for(i=0;i<postMessage.length;i++){delimitPos=postMessage[i].indexOf("=");if(delimitPos!=-1){formElements[i]=document.createElement("input");formElements[i].type="hidden";formElements[i].name=decodeURIComponent(postMessage[i].substring(0,delimitPos));formElements[i].value=decodeURIComponent(postMessage[i].substring(delimitPos+1));this._formNode.appendChild(formElements[i]);}}return formElements;}function _uploadFile(o,callback,uri,postData){var frameId="yuiIO"+o.tId,uploadEncoding="multipart/form-data",io=document.getElementById(frameId),ie8=(dM>=8)?true:false,oConn=this,args=(callback&&callback.argument)?callback.argument:null,oElements,i,prop,obj,rawFormAttributes,uploadCallback;rawFormAttributes={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",uri);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",frameId);if(YAHOO.env.ua.ie&&!ie8){this._formNode.setAttribute("encoding",uploadEncoding);}else{this._formNode.setAttribute("enctype",uploadEncoding);}if(postData){oElements=this.appendPostData(postData);}this._formNode.submit();this.startEvent.fire(o,args);if(o.startEvent){o.startEvent.fire(o,args);}if(callback&&callback.timeout){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true);},callback.timeout);}if(oElements&&oElements.length>0){for(i=0;i<oElements.length;i++){this._formNode.removeChild(oElements[i]);}}for(prop in rawFormAttributes){if(YAHOO.lang.hasOwnProperty(rawFormAttributes,prop)){if(rawFormAttributes[prop]){this._formNode.setAttribute(prop,rawFormAttributes[prop]);}else{this._formNode.removeAttribute(prop);}}}this.resetFormState();uploadCallback=function(){var body,pre,text;if(callback&&callback.timeout){window.clearTimeout(oConn._timeOut[o.tId]);delete oConn._timeOut[o.tId];}oConn.completeEvent.fire(o,args);if(o.completeEvent){o.completeEvent.fire(o,args);}obj={tId:o.tId,argument:args};try{body=io.contentWindow.document.getElementsByTagName("body")[0];pre=io.contentWindow.document.getElementsByTagName("pre")[0];if(body){if(pre){text=pre.textContent?pre.textContent:pre.innerText;}else{text=body.textContent?body.textContent:body.innerText;}}obj.responseText=text;obj.responseXML=io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;}catch(e){}if(callback&&callback.upload){if(!callback.scope){callback.upload(obj);}else{callback.upload.apply(callback.scope,[obj]);}}oConn.uploadEvent.fire(obj);if(o.uploadEvent){o.uploadEvent.fire(obj);}YE.removeListener(io,"load",uploadCallback);setTimeout(function(){document.body.removeChild(io);oConn.releaseObject(o);},100);};YE.addListener(io,"load",uploadCallback);}YCM.setForm=_setForm;YCM.resetFormState=_resetFormState;YCM.createFrame=_createFrame;YCM.appendPostData=_appendPostData;YCM.uploadFile=_uploadFile;})();YAHOO.register("connection",YAHOO.util.Connect,{version:"2.9.0",build:"2800"});
/*http://www.physiotherapyalberta.ca/portal_javascripts/build/datasource/datasource.js?original=1*/
(function(){var lang=YAHOO.lang,util=YAHOO.util,Ev=util.Event;util.DataSourceBase=function(oLiveData,oConfigs){if(oLiveData===null||oLiveData===undefined){return;}this.liveData=oLiveData;this._oQueue={interval:null,conn:null,requests:[]};this.responseSchema={};if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}var maxCacheEntries=this.maxCacheEntries;if(!lang.isNumber(maxCacheEntries)||(maxCacheEntries<0)){maxCacheEntries=0;}this._aIntervals=[];this.createEvent("cacheRequestEvent");this.createEvent("cacheResponseEvent");this.createEvent("requestEvent");this.createEvent("responseEvent");this.createEvent("responseParseEvent");this.createEvent("responseCacheEvent");this.createEvent("dataErrorEvent");this.createEvent("cacheFlushEvent");var DS=util.DataSourceBase;this._sName="DataSource instance"+DS._nIndex;DS._nIndex++;};var DS=util.DataSourceBase;lang.augmentObject(DS,{TYPE_UNKNOWN:-1,TYPE_JSARRAY:0,TYPE_JSFUNCTION:1,TYPE_XHR:2,TYPE_JSON:3,TYPE_XML:4,TYPE_TEXT:5,TYPE_HTMLTABLE:6,TYPE_SCRIPTNODE:7,TYPE_LOCAL:8,ERROR_DATAINVALID:"Invalid data",ERROR_DATANULL:"Null data",_nIndex:0,_nTransactionId:0,_cloneObject:function(o){if(!lang.isValue(o)){return o;}var copy={};if(Object.prototype.toString.apply(o)==="[object RegExp]"){copy=o;}else{if(lang.isFunction(o)){copy=o;}else{if(lang.isArray(o)){var array=[];for(var i=0,len=o.length;i<len;i++){array[i]=DS._cloneObject(o[i]);}copy=array;}else{if(lang.isObject(o)){for(var x in o){if(lang.hasOwnProperty(o,x)){if(lang.isValue(o[x])&&lang.isObject(o[x])||lang.isArray(o[x])){copy[x]=DS._cloneObject(o[x]);}else{copy[x]=o[x];}}}}else{copy=o;}}}}return copy;},_getLocationValue:function(field,context){var locator=field.locator||field.key||field,xmldoc=context.ownerDocument||context,result,res,value=null;try{if(!lang.isUndefined(xmldoc.evaluate)){result=xmldoc.evaluate(locator,context,xmldoc.createNSResolver(!context.ownerDocument?context.documentElement:context.ownerDocument.documentElement),0,null);while(res=result.iterateNext()){value=res.textContent;}}else{xmldoc.setProperty("SelectionLanguage","XPath");result=context.selectNodes(locator)[0];value=result.value||result.text||null;}return value;}catch(e){}},issueCallback:function(callback,params,error,scope){if(lang.isFunction(callback)){callback.apply(scope,params);}else{if(lang.isObject(callback)){scope=callback.scope||scope||window;var callbackFunc=callback.success;if(error){callbackFunc=callback.failure;}if(callbackFunc){callbackFunc.apply(scope,params.concat([callback.argument]));}}}},parseString:function(oData){if(!lang.isValue(oData)){return null;}var string=oData+"";if(lang.isString(string)){return string;}else{return null;}},parseNumber:function(oData){if(!lang.isValue(oData)||(oData==="")){return null;}var number=oData*1;if(lang.isNumber(number)){return number;}else{return null;}},convertNumber:function(oData){return DS.parseNumber(oData);},parseDate:function(oData){var date=null;if(lang.isValue(oData)&&!(oData instanceof Date)){date=new Date(oData);}else{return oData;}if(date instanceof Date){return date;}else{return null;}},convertDate:function(oData){return DS.parseDate(oData);}});DS.Parser={string:DS.parseString,number:DS.parseNumber,date:DS.parseDate};DS.prototype={_sName:null,_aCache:null,_oQueue:null,_aIntervals:null,maxCacheEntries:0,liveData:null,dataType:DS.TYPE_UNKNOWN,responseType:DS.TYPE_UNKNOWN,responseSchema:null,useXPath:false,cloneBeforeCaching:false,toString:function(){return this._sName;},getCachedResponse:function(oRequest,oCallback,oCaller){var aCache=this._aCache;if(this.maxCacheEntries>0){if(!aCache){this._aCache=[];}else{var nCacheLength=aCache.length;if(nCacheLength>0){var oResponse=null;this.fireEvent("cacheRequestEvent",{request:oRequest,callback:oCallback,caller:oCaller});for(var i=nCacheLength-1;i>=0;i--){var oCacheElem=aCache[i];if(this.isCacheHit(oRequest,oCacheElem.request)){oResponse=oCacheElem.response;this.fireEvent("cacheResponseEvent",{request:oRequest,response:oResponse,callback:oCallback,caller:oCaller});if(i<nCacheLength-1){aCache.splice(i,1);this.addToCache(oRequest,oResponse);}oResponse.cached=true;break;}}return oResponse;}}}else{if(aCache){this._aCache=null;}}return null;},isCacheHit:function(oRequest,oCachedRequest){return(oRequest===oCachedRequest);},addToCache:function(oRequest,oResponse){var aCache=this._aCache;if(!aCache){return;}while(aCache.length>=this.maxCacheEntries){aCache.shift();}oResponse=(this.cloneBeforeCaching)?DS._cloneObject(oResponse):oResponse;var oCacheElem={request:oRequest,response:oResponse};aCache[aCache.length]=oCacheElem;this.fireEvent("responseCacheEvent",{request:oRequest,response:oResponse});},flushCache:function(){if(this._aCache){this._aCache=[];this.fireEvent("cacheFlushEvent");}},setInterval:function(nMsec,oRequest,oCallback,oCaller){if(lang.isNumber(nMsec)&&(nMsec>=0)){var oSelf=this;var nId=setInterval(function(){oSelf.makeConnection(oRequest,oCallback,oCaller);},nMsec);this._aIntervals.push(nId);return nId;}else{}},clearInterval:function(nId){var tracker=this._aIntervals||[];for(var i=tracker.length-1;i>-1;i--){if(tracker[i]===nId){tracker.splice(i,1);clearInterval(nId);}}},clearAllIntervals:function(){var tracker=this._aIntervals||[];for(var i=tracker.length-1;i>-1;i--){clearInterval(tracker[i]);}tracker=[];},sendRequest:function(oRequest,oCallback,oCaller){var oCachedResponse=this.getCachedResponse(oRequest,oCallback,oCaller);if(oCachedResponse){DS.issueCallback(oCallback,[oRequest,oCachedResponse],false,oCaller);return null;}return this.makeConnection(oRequest,oCallback,oCaller);},makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=this.liveData;this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);return tId;},handleResponse:function(oRequest,oRawResponse,oCallback,oCaller,tId){this.fireEvent("responseEvent",{tId:tId,request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller});var xhr=(this.dataType==DS.TYPE_XHR)?true:false;var oParsedResponse=null;var oFullResponse=oRawResponse;if(this.responseType===DS.TYPE_UNKNOWN){var ctype=(oRawResponse&&oRawResponse.getResponseHeader)?oRawResponse.getResponseHeader["Content-Type"]:null;if(ctype){if(ctype.indexOf("text/xml")>-1){this.responseType=DS.TYPE_XML;}else{if(ctype.indexOf("application/json")>-1){this.responseType=DS.TYPE_JSON;}else{if(ctype.indexOf("text/plain")>-1){this.responseType=DS.TYPE_TEXT;}}}}else{if(YAHOO.lang.isArray(oRawResponse)){this.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse&&oRawResponse.nodeType&&(oRawResponse.nodeType===9||oRawResponse.nodeType===1||oRawResponse.nodeType===11)){this.responseType=DS.TYPE_XML;}else{if(oRawResponse&&oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){this.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){this.responseType=DS.TYPE_TEXT;}}}}}}}switch(this.responseType){case DS.TYPE_JSARRAY:if(xhr&&oRawResponse&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}try{if(lang.isString(oFullResponse)){var parseArgs=[oFullResponse].concat(this.parseJSONArgs);if(lang.JSON){oFullResponse=lang.JSON.parse.apply(lang.JSON,parseArgs);}else{if(window.JSON&&JSON.parse){oFullResponse=JSON.parse.apply(JSON,parseArgs);}else{if(oFullResponse.parseJSON){oFullResponse=oFullResponse.parseJSON.apply(oFullResponse,parseArgs.slice(1));}else{while(oFullResponse.length>0&&(oFullResponse.charAt(0)!="{")&&(oFullResponse.charAt(0)!="[")){oFullResponse=oFullResponse.substring(1,oFullResponse.length);}if(oFullResponse.length>0){var arrayEnd=Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));oFullResponse=oFullResponse.substring(0,arrayEnd+1);oFullResponse=eval("("+oFullResponse+")");}}}}}}catch(e1){}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseArrayData(oRequest,oFullResponse);break;case DS.TYPE_JSON:if(xhr&&oRawResponse&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}try{if(lang.isString(oFullResponse)){var parseArgs=[oFullResponse].concat(this.parseJSONArgs);if(lang.JSON){oFullResponse=lang.JSON.parse.apply(lang.JSON,parseArgs);}else{if(window.JSON&&JSON.parse){oFullResponse=JSON.parse.apply(JSON,parseArgs);}else{if(oFullResponse.parseJSON){oFullResponse=oFullResponse.parseJSON.apply(oFullResponse,parseArgs.slice(1));}else{while(oFullResponse.length>0&&(oFullResponse.charAt(0)!="{")&&(oFullResponse.charAt(0)!="[")){oFullResponse=oFullResponse.substring(1,oFullResponse.length);}if(oFullResponse.length>0){var objEnd=Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));oFullResponse=oFullResponse.substring(0,objEnd+1);oFullResponse=eval("("+oFullResponse+")");}}}}}}catch(e){}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseJSONData(oRequest,oFullResponse);break;case DS.TYPE_HTMLTABLE:if(xhr&&oRawResponse.responseText){var el=document.createElement("div");el.innerHTML=oRawResponse.responseText;oFullResponse=el.getElementsByTagName("table")[0];}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseHTMLTableData(oRequest,oFullResponse);break;case DS.TYPE_XML:if(xhr&&oRawResponse.responseXML){oFullResponse=oRawResponse.responseXML;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseXMLData(oRequest,oFullResponse);break;case DS.TYPE_TEXT:if(xhr&&lang.isString(oRawResponse.responseText)){oFullResponse=oRawResponse.responseText;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseTextData(oRequest,oFullResponse);break;default:oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseData(oRequest,oFullResponse);break;}oParsedResponse=oParsedResponse||{};if(!oParsedResponse.results){oParsedResponse.results=[];}if(!oParsedResponse.meta){oParsedResponse.meta={};}if(!oParsedResponse.error){oParsedResponse=this.doBeforeCallback(oRequest,oFullResponse,oParsedResponse,oCallback);this.fireEvent("responseParseEvent",{request:oRequest,response:oParsedResponse,callback:oCallback,caller:oCaller});this.addToCache(oRequest,oParsedResponse);}else{oParsedResponse.error=true;this.fireEvent("dataErrorEvent",{request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller,message:DS.ERROR_DATANULL});}oParsedResponse.tId=tId;DS.issueCallback(oCallback,[oRequest,oParsedResponse],oParsedResponse.error,oCaller);},doBeforeParseData:function(oRequest,oFullResponse,oCallback){return oFullResponse;},doBeforeCallback:function(oRequest,oFullResponse,oParsedResponse,oCallback){return oParsedResponse;},parseData:function(oRequest,oFullResponse){if(lang.isValue(oFullResponse)){var oParsedResponse={results:oFullResponse,meta:{}};return oParsedResponse;}return null;},parseArrayData:function(oRequest,oFullResponse){if(lang.isArray(oFullResponse)){var results=[],i,j,rec,field,data;if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(i=fields.length-1;i>=0;--i){if(typeof fields[i]!=="object"){fields[i]={key:fields[i]};}}var parsers={},p;for(i=fields.length-1;i>=0;--i){p=(typeof fields[i].parser==="function"?fields[i].parser:DS.Parser[fields[i].parser+""])||fields[i].converter;if(p){parsers[fields[i].key]=p;}}var arrType=lang.isArray(oFullResponse[0]);for(i=oFullResponse.length-1;i>-1;i--){var oResult={};rec=oFullResponse[i];if(typeof rec==="object"){for(j=fields.length-1;j>-1;j--){field=fields[j];data=arrType?rec[j]:rec[field.key];if(parsers[field.key]){data=parsers[field.key].call(this,data);}if(data===undefined){data=null;}oResult[field.key]=data;}}else{if(lang.isString(rec)){for(j=fields.length-1;j>-1;j--){field=fields[j];data=rec;if(parsers[field.key]){data=parsers[field.key].call(this,data);}if(data===undefined){data=null;}oResult[field.key]=data;}}}results[i]=oResult;}}else{results=oFullResponse;}var oParsedResponse={results:results};return oParsedResponse;}return null;},parseTextData:function(oRequest,oFullResponse){if(lang.isString(oFullResponse)){if(lang.isString(this.responseSchema.recordDelim)&&lang.isString(this.responseSchema.fieldDelim)){var oParsedResponse={results:[]};var recDelim=this.responseSchema.recordDelim;var fieldDelim=this.responseSchema.fieldDelim;if(oFullResponse.length>0){var newLength=oFullResponse.length-recDelim.length;if(oFullResponse.substr(newLength)==recDelim){oFullResponse=oFullResponse.substr(0,newLength);}if(oFullResponse.length>0){var recordsarray=oFullResponse.split(recDelim);for(var i=0,len=recordsarray.length,recIdx=0;i<len;++i){var bError=false,sRecord=recordsarray[i];if(lang.isString(sRecord)&&(sRecord.length>0)){var fielddataarray=recordsarray[i].split(fieldDelim);var oResult={};if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(var j=fields.length-1;j>-1;j--){try{var data=fielddataarray[j];if(lang.isString(data)){if(data.charAt(0)=='"'){data=data.substr(1);}if(data.charAt(data.length-1)=='"'){data=data.substr(0,data.length-1);}var field=fields[j];var key=(lang.isValue(field.key))?field.key:field;if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}else{bError=true;}}catch(e){bError=true;}}}else{oResult=fielddataarray;}if(!bError){oParsedResponse.results[recIdx++]=oResult;}}}}}return oParsedResponse;}}return null;},parseXMLResult:function(result){var oResult={},schema=this.responseSchema;try{for(var m=schema.fields.length-1;m>=0;m--){var field=schema.fields[m];var key=(lang.isValue(field.key))?field.key:field;var data=null;if(this.useXPath){data=YAHOO.util.DataSource._getLocationValue(field,result);}else{var xmlAttr=result.attributes.getNamedItem(key);if(xmlAttr){data=xmlAttr.value;}else{var xmlNode=result.getElementsByTagName(key);if(xmlNode&&xmlNode.item(0)){var item=xmlNode.item(0);data=(item)?((item.text)?item.text:(item.textContent)?item.textContent:null):null;if(!data){var datapieces=[];for(var j=0,len=item.childNodes.length;j<len;j++){if(item.childNodes[j].nodeValue){datapieces[datapieces.length]=item.childNodes[j].nodeValue;}}if(datapieces.length>0){data=datapieces.join("");}}}}}if(data===null){data="";}if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}}catch(e){}return oResult;},parseXMLData:function(oRequest,oFullResponse){var bError=false,schema=this.responseSchema,oParsedResponse={meta:{}},xmlList=null,metaNode=schema.metaNode,metaLocators=schema.metaFields||{},i,k,loc,v;try{if(this.useXPath){for(k in metaLocators){oParsedResponse.meta[k]=YAHOO.util.DataSource._getLocationValue(metaLocators[k],oFullResponse);}}else{metaNode=metaNode?oFullResponse.getElementsByTagName(metaNode)[0]:oFullResponse;if(metaNode){for(k in metaLocators){if(lang.hasOwnProperty(metaLocators,k)){loc=metaLocators[k];v=metaNode.getElementsByTagName(loc)[0];if(v){v=v.firstChild.nodeValue;}else{v=metaNode.attributes.getNamedItem(loc);if(v){v=v.value;}}if(lang.isValue(v)){oParsedResponse.meta[k]=v;}}}}}xmlList=(schema.resultNode)?oFullResponse.getElementsByTagName(schema.resultNode):null;}catch(e){}if(!xmlList||!lang.isArray(schema.fields)){bError=true;}else{oParsedResponse.results=[];for(i=xmlList.length-1;i>=0;--i){var oResult=this.parseXMLResult(xmlList.item(i));oParsedResponse.results[i]=oResult;}}if(bError){oParsedResponse.error=true;}else{}return oParsedResponse;},parseJSONData:function(oRequest,oFullResponse){var oParsedResponse={results:[],meta:{}};if(lang.isObject(oFullResponse)&&this.responseSchema.resultsList){var schema=this.responseSchema,fields=schema.fields,resultsList=oFullResponse,results=[],metaFields=schema.metaFields||{},fieldParsers=[],fieldPaths=[],simpleFields=[],bError=false,i,len,j,v,key,parser,path;var buildPath=function(needle){var path=null,keys=[],i=0;if(needle){needle=needle.replace(/\[(['"])(.*?)\1\]/g,function(x,$1,$2){keys[i]=$2;return".@"+(i++);}).replace(/\[(\d+)\]/g,function(x,$1){keys[i]=parseInt($1,10)|0;return".@"+(i++);}).replace(/^\./,"");if(!/[^\w\.\$@]/.test(needle)){path=needle.split(".");for(i=path.length-1;i>=0;--i){if(path[i].charAt(0)==="@"){path[i]=keys[parseInt(path[i].substr(1),10)];}}}else{}}return path;};var walkPath=function(path,origin){var v=origin,i=0,len=path.length;for(;i<len&&v;++i){v=v[path[i]];}return v;};path=buildPath(schema.resultsList);if(path){resultsList=walkPath(path,oFullResponse);if(resultsList===undefined){bError=true;}}else{bError=true;}if(!resultsList){resultsList=[];}if(!lang.isArray(resultsList)){resultsList=[resultsList];}if(!bError){if(schema.fields){var field;for(i=0,len=fields.length;i<len;i++){field=fields[i];key=field.key||field;parser=((typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""])||field.converter;path=buildPath(key);if(parser){fieldParsers[fieldParsers.length]={key:key,parser:parser};}if(path){if(path.length>1){fieldPaths[fieldPaths.length]={key:key,path:path};}else{simpleFields[simpleFields.length]={key:key,path:path[0]};}}else{}}for(i=resultsList.length-1;i>=0;--i){var r=resultsList[i],rec={};if(r){for(j=simpleFields.length-1;j>=0;--j){rec[simpleFields[j].key]=(r[simpleFields[j].path]!==undefined)?r[simpleFields[j].path]:r[j];}for(j=fieldPaths.length-1;j>=0;--j){rec[fieldPaths[j].key]=walkPath(fieldPaths[j].path,r);}for(j=fieldParsers.length-1;j>=0;--j){var p=fieldParsers[j].key;rec[p]=fieldParsers[j].parser.call(this,rec[p]);if(rec[p]===undefined){rec[p]=null;}}}results[i]=rec;}}else{results=resultsList;}for(key in metaFields){if(lang.hasOwnProperty(metaFields,key)){path=buildPath(metaFields[key]);if(path){v=walkPath(path,oFullResponse);oParsedResponse.meta[key]=v;}}}}else{oParsedResponse.error=true;}oParsedResponse.results=results;}else{oParsedResponse.error=true;}return oParsedResponse;},parseHTMLTableData:function(oRequest,oFullResponse){var bError=false;var elTable=oFullResponse;var fields=this.responseSchema.fields;var oParsedResponse={results:[]};if(lang.isArray(fields)){for(var i=0;i<elTable.tBodies.length;i++){var elTbody=elTable.tBodies[i];for(var j=elTbody.rows.length-1;j>-1;j--){var elRow=elTbody.rows[j];var oResult={};for(var k=fields.length-1;k>-1;k--){var field=fields[k];var key=(lang.isValue(field.key))?field.key:field;var data=elRow.cells[k].innerHTML;if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}oParsedResponse.results[j]=oResult;}}}else{bError=true;}if(bError){oParsedResponse.error=true;}else{}return oParsedResponse;}};lang.augmentProto(DS,util.EventProvider);util.LocalDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_LOCAL;if(oLiveData){if(YAHOO.lang.isArray(oLiveData)){this.responseType=DS.TYPE_JSARRAY;}else{if(oLiveData.nodeType&&oLiveData.nodeType==9){this.responseType=DS.TYPE_XML;}else{if(oLiveData.nodeName&&(oLiveData.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;oLiveData=oLiveData.cloneNode(true);}else{if(YAHOO.lang.isString(oLiveData)){this.responseType=DS.TYPE_TEXT;}else{if(YAHOO.lang.isObject(oLiveData)){this.responseType=DS.TYPE_JSON;}}}}}}else{oLiveData=[];this.responseType=DS.TYPE_JSARRAY;}util.LocalDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.LocalDataSource,DS);lang.augmentObject(util.LocalDataSource,DS);util.FunctionDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_JSFUNCTION;oLiveData=oLiveData||function(){};util.FunctionDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.FunctionDataSource,DS,{scope:null,makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=(this.scope)?this.liveData.call(this.scope,oRequest,this,oCallback):this.liveData(oRequest,oCallback);if(this.responseType===DS.TYPE_UNKNOWN){if(YAHOO.lang.isArray(oRawResponse)){this.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse&&oRawResponse.nodeType&&oRawResponse.nodeType==9){this.responseType=DS.TYPE_XML;}else{if(oRawResponse&&oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){this.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){this.responseType=DS.TYPE_TEXT;}}}}}}this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);return tId;}});lang.augmentObject(util.FunctionDataSource,DS);util.ScriptNodeDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_SCRIPTNODE;oLiveData=oLiveData||"";util.ScriptNodeDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.ScriptNodeDataSource,DS,{getUtility:util.Get,asyncMode:"allowAll",scriptCallbackParam:"callback",generateRequestCallback:function(id){return"&"+this.scriptCallbackParam+"=YAHOO.util.ScriptNodeDataSource.callbacks["+id+"]";},doBeforeGetScriptNode:function(sUri){return sUri;},makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});if(util.ScriptNodeDataSource._nPending===0){util.ScriptNodeDataSource.callbacks=[];util.ScriptNodeDataSource._nId=0;}var id=util.ScriptNodeDataSource._nId;util.ScriptNodeDataSource._nId++;var oSelf=this;util.ScriptNodeDataSource.callbacks[id]=function(oRawResponse){if((oSelf.asyncMode!=="ignoreStaleResponses")||(id===util.ScriptNodeDataSource.callbacks.length-1)){if(oSelf.responseType===DS.TYPE_UNKNOWN){if(YAHOO.lang.isArray(oRawResponse)){oSelf.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse.nodeType&&oRawResponse.nodeType==9){oSelf.responseType=DS.TYPE_XML;}else{if(oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){oSelf.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){oSelf.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){oSelf.responseType=DS.TYPE_TEXT;}}}}}}oSelf.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);}else{}delete util.ScriptNodeDataSource.callbacks[id];};util.ScriptNodeDataSource._nPending++;var sUri=this.liveData+oRequest+this.generateRequestCallback(id);sUri=this.doBeforeGetScriptNode(sUri);this.getUtility.script(sUri,{autopurge:true,onsuccess:util.ScriptNodeDataSource._bumpPendingDown,onfail:util.ScriptNodeDataSource._bumpPendingDown});return tId;}});lang.augmentObject(util.ScriptNodeDataSource,DS);lang.augmentObject(util.ScriptNodeDataSource,{_nId:0,_nPending:0,callbacks:[]});util.XHRDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_XHR;this.connMgr=this.connMgr||util.Connect;oLiveData=oLiveData||"";util.XHRDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.XHRDataSource,DS,{connMgr:null,connXhrMode:"allowAll",connMethodPost:false,connTimeout:0,makeConnection:function(oRequest,oCallback,oCaller){var oRawResponse=null;var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oSelf=this;var oConnMgr=this.connMgr;var oQueue=this._oQueue;var _xhrSuccess=function(oResponse){if(oResponse&&(this.connXhrMode=="ignoreStaleResponses")&&(oResponse.tId!=oQueue.conn.tId)){return null;}else{if(!oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,response:null,callback:oCallback,caller:oCaller,message:DS.ERROR_DATANULL});DS.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller);return null;}else{if(this.responseType===DS.TYPE_UNKNOWN){var ctype=(oResponse.getResponseHeader)?oResponse.getResponseHeader["Content-Type"]:null;if(ctype){if(ctype.indexOf("text/xml")>-1){this.responseType=DS.TYPE_XML;}else{if(ctype.indexOf("application/json")>-1){this.responseType=DS.TYPE_JSON;}else{if(ctype.indexOf("text/plain")>-1){this.responseType=DS.TYPE_TEXT;}}}}}this.handleResponse(oRequest,oResponse,oCallback,oCaller,tId);}}};var _xhrFailure=function(oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,response:oResponse,callback:oCallback,caller:oCaller,message:DS.ERROR_DATAINVALID});if(lang.isString(this.liveData)&&lang.isString(oRequest)&&(this.liveData.lastIndexOf("?")!==this.liveData.length-1)&&(oRequest.indexOf("?")!==0)){}oResponse=oResponse||{};oResponse.error=true;DS.issueCallback(oCallback,[oRequest,oResponse],true,oCaller);return null;};var _xhrCallback={success:_xhrSuccess,failure:_xhrFailure,scope:this};if(lang.isNumber(this.connTimeout)){_xhrCallback.timeout=this.connTimeout;}if(this.connXhrMode=="cancelStaleRequests"){if(oQueue.conn){if(oConnMgr.abort){oConnMgr.abort(oQueue.conn);oQueue.conn=null;}else{}}}if(oConnMgr&&oConnMgr.asyncRequest){var sLiveData=this.liveData;var isPost=this.connMethodPost;var sMethod=(isPost)?"POST":"GET";var sUri=(isPost||!lang.isValue(oRequest))?sLiveData:sLiveData+oRequest;var sRequest=(isPost)?oRequest:null;if(this.connXhrMode!="queueRequests"){oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}else{if(oQueue.conn){var allRequests=oQueue.requests;allRequests.push({request:oRequest,callback:_xhrCallback});if(!oQueue.interval){oQueue.interval=setInterval(function(){if(oConnMgr.isCallInProgress(oQueue.conn)){return;}else{if(allRequests.length>0){sUri=(isPost||!lang.isValue(allRequests[0].request))?sLiveData:sLiveData+allRequests[0].request;sRequest=(isPost)?allRequests[0].request:null;oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,allRequests[0].callback,sRequest);allRequests.shift();}else{clearInterval(oQueue.interval);oQueue.interval=null;}}},50);}}else{oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}}}else{DS.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller);}return tId;}});lang.augmentObject(util.XHRDataSource,DS);util.DataSource=function(oLiveData,oConfigs){oConfigs=oConfigs||{};var dataType=oConfigs.dataType;if(dataType){if(dataType==DS.TYPE_LOCAL){return new util.LocalDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_XHR){return new util.XHRDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_SCRIPTNODE){return new util.ScriptNodeDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_JSFUNCTION){return new util.FunctionDataSource(oLiveData,oConfigs);}}}}}if(YAHOO.lang.isString(oLiveData)){return new util.XHRDataSource(oLiveData,oConfigs);}else{if(YAHOO.lang.isFunction(oLiveData)){return new util.FunctionDataSource(oLiveData,oConfigs);}else{return new util.LocalDataSource(oLiveData,oConfigs);}}};lang.augmentObject(util.DataSource,DS);})();YAHOO.util.Number={format:function(n,cfg){if(n===""||n===null||!isFinite(n)){return"";}n=+n;cfg=YAHOO.lang.merge(YAHOO.util.Number.format.defaults,(cfg||{}));var stringN=n+"",absN=Math.abs(n),places=cfg.decimalPlaces||0,sep=cfg.thousandsSeparator,negFmt=cfg.negativeFormat||("-"+cfg.format),s,bits,i,precision;if(negFmt.indexOf("#")>-1){negFmt=negFmt.replace(/#/,cfg.format);}if(places<0){s=absN-(absN%1)+"";i=s.length+places;if(i>0){s=Number("."+s).toFixed(i).slice(2)+new Array(s.length-i+1).join("0");}else{s="0";}}else{var unfloatedN=absN+"";if(places>0||unfloatedN.indexOf(".")>0){var power=Math.pow(10,places);s=Math.round(absN*power)/power+"";var dot=s.indexOf("."),padding,zeroes;if(dot<0){padding=places;zeroes=(Math.pow(10,padding)+"").substring(1);if(places>0){s=s+"."+zeroes;}}else{padding=places-(s.length-dot-1);zeroes=(Math.pow(10,padding)+"").substring(1);s=s+zeroes;}}else{s=absN.toFixed(places)+"";}}bits=s.split(/\D/);if(absN>=1000){i=bits[0].length%3||3;bits[0]=bits[0].slice(0,i)+bits[0].slice(i).replace(/(\d{3})/g,sep+"$1");}return YAHOO.util.Number.format._applyFormat((n<0?negFmt:cfg.format),bits.join(cfg.decimalSeparator),cfg);}};YAHOO.util.Number.format.defaults={format:"{prefix}{number}{suffix}",negativeFormat:null,decimalSeparator:".",decimalPlaces:null,thousandsSeparator:""};YAHOO.util.Number.format._applyFormat=function(tmpl,num,data){return tmpl.replace(/\{(\w+)\}/g,function(_,token){return token==="number"?num:token in data?data[token]:"";});};(function(){var xPad=function(x,pad,r){if(typeof r==="undefined"){r=10;}for(;parseInt(x,10)<r&&r>1;r/=10){x=pad.toString()+x;}return x.toString();};var Dt={formats:{a:function(d,l){return l.a[d.getDay()];},A:function(d,l){return l.A[d.getDay()];},b:function(d,l){return l.b[d.getMonth()];},B:function(d,l){return l.B[d.getMonth()];},C:function(d){return xPad(parseInt(d.getFullYear()/100,10),0);},d:["getDate","0"],e:["getDate"," "],g:function(d){return xPad(parseInt(Dt.formats.G(d)%100,10),0);},G:function(d){var y=d.getFullYear();var V=parseInt(Dt.formats.V(d),10);var W=parseInt(Dt.formats.W(d),10);if(W>V){y++;}else{if(W===0&&V>=52){y--;}}return y;},H:["getHours","0"],I:function(d){var I=d.getHours()%12;return xPad(I===0?12:I,0);},j:function(d){var gmd_1=new Date(""+d.getFullYear()+"/1/1 GMT");var gmdate=new Date(""+d.getFullYear()+"/"+(d.getMonth()+1)+"/"+d.getDate()+" GMT");var ms=gmdate-gmd_1;var doy=parseInt(ms/60000/60/24,10)+1;return xPad(doy,0,100);},k:["getHours"," "],l:function(d){var I=d.getHours()%12;return xPad(I===0?12:I," ");},m:function(d){return xPad(d.getMonth()+1,0);},M:["getMinutes","0"],p:function(d,l){return l.p[d.getHours()>=12?1:0];},P:function(d,l){return l.P[d.getHours()>=12?1:0];},s:function(d,l){return parseInt(d.getTime()/1000,10);},S:["getSeconds","0"],u:function(d){var dow=d.getDay();return dow===0?7:dow;},U:function(d){var doy=parseInt(Dt.formats.j(d),10);var rdow=6-d.getDay();var woy=parseInt((doy+rdow)/7,10);return xPad(woy,0);},V:function(d){var woy=parseInt(Dt.formats.W(d),10);var dow1_1=(new Date(""+d.getFullYear()+"/1/1")).getDay();var idow=woy+(dow1_1>4||dow1_1<=1?0:1);if(idow===53&&(new Date(""+d.getFullYear()+"/12/31")).getDay()<4){idow=1;}else{if(idow===0){idow=Dt.formats.V(new Date(""+(d.getFullYear()-1)+"/12/31"));}}return xPad(idow,0);},w:"getDay",W:function(d){var doy=parseInt(Dt.formats.j(d),10);var rdow=7-Dt.formats.u(d);var woy=parseInt((doy+rdow)/7,10);return xPad(woy,0,10);},y:function(d){return xPad(d.getFullYear()%100,0);},Y:"getFullYear",z:function(d){var o=d.getTimezoneOffset();var H=xPad(parseInt(Math.abs(o/60),10),0);var M=xPad(Math.abs(o%60),0);return(o>0?"-":"+")+H+M;},Z:function(d){var tz=d.toString().replace(/^.*:\d\d( GMT[+-]\d+)? \(?([A-Za-z ]+)\)?\d*$/,"$2").replace(/[a-z ]/g,"");if(tz.length>4){tz=Dt.formats.z(d);}return tz;},"%":function(d){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(oDate,oConfig,sLocale){oConfig=oConfig||{};if(!(oDate instanceof Date)){return YAHOO.lang.isValue(oDate)?oDate:"";}var format=oConfig.format||"%m/%d/%Y";if(format==="YYYY/MM/DD"){format="%Y/%m/%d";}else{if(format==="DD/MM/YYYY"){format="%d/%m/%Y";}else{if(format==="MM/DD/YYYY"){format="%m/%d/%Y";}}}sLocale=sLocale||"en";if(!(sLocale in YAHOO.util.DateLocale)){if(sLocale.replace(/-[a-zA-Z]+$/,"") in YAHOO.util.DateLocale){sLocale=sLocale.replace(/-[a-zA-Z]+$/,"");}else{sLocale="en";}}var aLocale=YAHOO.util.DateLocale[sLocale];var replace_aggs=function(m0,m1){var f=Dt.aggregates[m1];return(f==="locale"?aLocale[m1]:f);};var replace_formats=function(m0,m1){var f=Dt.formats[m1];if(typeof f==="string"){return oDate[f]();}else{if(typeof f==="function"){return f.call(oDate,oDate,aLocale);}else{if(typeof f==="object"&&typeof f[0]==="string"){return xPad(oDate[f[0]](),f[1]);}else{return m1;}}}};while(format.match(/%[cDFhnrRtTxX]/)){format=format.replace(/%([cDFhnrRtTxX])/g,replace_aggs);}var str=format.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g,replace_formats);replace_aggs=replace_formats=undefined;return str;}};YAHOO.namespace("YAHOO.util");YAHOO.util.Date=Dt;YAHOO.util.DateLocale={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],r:"%I:%M:%S %p",x:"%d/%m/%y",X:"%T"};YAHOO.util.DateLocale.en=YAHOO.lang.merge(YAHOO.util.DateLocale,{});YAHOO.util.DateLocale["en-US"]=YAHOO.lang.merge(YAHOO.util.DateLocale.en,{c:"%a %d %b %Y %I:%M:%S %p %Z",x:"%m/%d/%Y",X:"%I:%M:%S %p"});YAHOO.util.DateLocale["en-GB"]=YAHOO.lang.merge(YAHOO.util.DateLocale.en,{r:"%l:%M:%S %P %Z"});YAHOO.util.DateLocale["en-AU"]=YAHOO.lang.merge(YAHOO.util.DateLocale.en);})();YAHOO.register("datasource",YAHOO.util.DataSource,{version:"2.9.0",build:"2800"});
/*http://www.physiotherapyalberta.ca/portal_javascripts/build/autocomplete/autocomplete.js?original=1*/
YAHOO.widget.DS_JSArray=YAHOO.util.LocalDataSource;YAHOO.widget.DS_JSFunction=YAHOO.util.FunctionDataSource;YAHOO.widget.DS_XHR=function(sScriptURI,aSchema,oConfigs){var DS=new YAHOO.util.XHRDataSource(sScriptURI,oConfigs);DS._aDeprecatedSchema=aSchema;return DS;};YAHOO.widget.DS_ScriptNode=function(sScriptURI,aSchema,oConfigs){var DS=new YAHOO.util.ScriptNodeDataSource(sScriptURI,oConfigs);DS._aDeprecatedSchema=aSchema;return DS;};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(elInput,elContainer,oDataSource,oConfigs){if(elInput&&elContainer&&oDataSource){if(oDataSource&&YAHOO.lang.isFunction(oDataSource.sendRequest)){this.dataSource=oDataSource;}else{return;}this.key=0;var schema=oDataSource.responseSchema;if(oDataSource._aDeprecatedSchema){var aDeprecatedSchema=oDataSource._aDeprecatedSchema;if(YAHOO.lang.isArray(aDeprecatedSchema)){if((oDataSource.responseType===YAHOO.util.DataSourceBase.TYPE_JSON)||(oDataSource.responseType===YAHOO.util.DataSourceBase.TYPE_UNKNOWN)){schema.resultsList=aDeprecatedSchema[0];this.key=aDeprecatedSchema[1];schema.fields=(aDeprecatedSchema.length<3)?null:aDeprecatedSchema.slice(1);}else{if(oDataSource.responseType===YAHOO.util.DataSourceBase.TYPE_XML){schema.resultNode=aDeprecatedSchema[0];this.key=aDeprecatedSchema[1];schema.fields=aDeprecatedSchema.slice(1);}else{if(oDataSource.responseType===YAHOO.util.DataSourceBase.TYPE_TEXT){schema.recordDelim=aDeprecatedSchema[0];schema.fieldDelim=aDeprecatedSchema[1];}}}oDataSource.responseSchema=schema;}}if(YAHOO.util.Dom.inDocument(elInput)){if(YAHOO.lang.isString(elInput)){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+elInput;this._elTextbox=document.getElementById(elInput);}else{this._sName=(elInput.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+elInput.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._elTextbox=elInput;}YAHOO.util.Dom.addClass(this._elTextbox,"yui-ac-input");}else{return;}if(YAHOO.util.Dom.inDocument(elContainer)){if(YAHOO.lang.isString(elContainer)){this._elContainer=document.getElementById(elContainer);}else{this._elContainer=elContainer;}if(this._elContainer.style.display=="none"){}var elParent=this._elContainer.parentNode;var elTag=elParent.tagName.toLowerCase();if(elTag=="div"){YAHOO.util.Dom.addClass(elParent,"yui-ac");}else{}}else{return;}if(this.dataSource.dataType===YAHOO.util.DataSourceBase.TYPE_LOCAL){this.applyLocalFilter=true;}if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}this._initContainerEl();this._initProps();this._initListEl();this._initContainerHelperEls();var oSelf=this;var elTextbox=this._elTextbox;YAHOO.util.Event.addListener(elTextbox,"keyup",oSelf._onTextboxKeyUp,oSelf);YAHOO.util.Event.addListener(elTextbox,"keydown",oSelf._onTextboxKeyDown,oSelf);YAHOO.util.Event.addListener(elTextbox,"focus",oSelf._onTextboxFocus,oSelf);YAHOO.util.Event.addListener(elTextbox,"blur",oSelf._onTextboxBlur,oSelf);YAHOO.util.Event.addListener(elContainer,"mouseover",oSelf._onContainerMouseover,oSelf);YAHOO.util.Event.addListener(elContainer,"mouseout",oSelf._onContainerMouseout,oSelf);YAHOO.util.Event.addListener(elContainer,"click",oSelf._onContainerClick,oSelf);YAHOO.util.Event.addListener(elContainer,"scroll",oSelf._onContainerScroll,oSelf);YAHOO.util.Event.addListener(elContainer,"resize",oSelf._onContainerResize,oSelf);YAHOO.util.Event.addListener(elTextbox,"keypress",oSelf._onTextboxKeyPress,oSelf);YAHOO.util.Event.addListener(window,"unload",oSelf._onWindowUnload,oSelf);this.textboxFocusEvent=new YAHOO.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=new YAHOO.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new YAHOO.util.CustomEvent("dataRequest",this);this.dataRequestCancelEvent=new YAHOO.util.CustomEvent("dataRequestCancel",this);this.dataReturnEvent=new YAHOO.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.containerPopulateEvent=new YAHOO.util.CustomEvent("containerPopulate",this);this.containerExpandEvent=new YAHOO.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new YAHOO.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new YAHOO.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=new YAHOO.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new YAHOO.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new YAHOO.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new YAHOO.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new YAHOO.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new YAHOO.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new YAHOO.util.CustomEvent("containerCollapse",this);this.textboxBlurEvent=new YAHOO.util.CustomEvent("textboxBlur",this);this.textboxChangeEvent=new YAHOO.util.CustomEvent("textboxChange",this);elTextbox.setAttribute("autocomplete","off");YAHOO.widget.AutoComplete._nIndex++;}else{}};YAHOO.widget.AutoComplete.prototype.dataSource=null;YAHOO.widget.AutoComplete.prototype.applyLocalFilter=null;YAHOO.widget.AutoComplete.prototype.queryMatchCase=false;YAHOO.widget.AutoComplete.prototype.queryMatchContains=false;YAHOO.widget.AutoComplete.prototype.queryMatchSubset=false;YAHOO.widget.AutoComplete.prototype.minQueryLength=1;YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed=10;YAHOO.widget.AutoComplete.prototype.queryDelay=0.2;YAHOO.widget.AutoComplete.prototype.typeAheadDelay=0.5;YAHOO.widget.AutoComplete.prototype.queryInterval=500;YAHOO.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";YAHOO.widget.AutoComplete.prototype.prehighlightClassName=null;YAHOO.widget.AutoComplete.prototype.delimChar=null;YAHOO.widget.AutoComplete.prototype.autoHighlight=true;YAHOO.widget.AutoComplete.prototype.typeAhead=false;YAHOO.widget.AutoComplete.prototype.animHoriz=false;YAHOO.widget.AutoComplete.prototype.animVert=true;YAHOO.widget.AutoComplete.prototype.animSpeed=0.3;YAHOO.widget.AutoComplete.prototype.forceSelection=false;YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete=true;YAHOO.widget.AutoComplete.prototype.alwaysShowContainer=false;YAHOO.widget.AutoComplete.prototype.useIFrame=false;YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.suppressInputUpdate=false;YAHOO.widget.AutoComplete.prototype.resultTypeList=true;YAHOO.widget.AutoComplete.prototype.queryQuestionMark=true;YAHOO.widget.AutoComplete.prototype.autoSnapContainer=true;YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName;};YAHOO.widget.AutoComplete.prototype.getInputEl=function(){return this._elTextbox;};YAHOO.widget.AutoComplete.prototype.getContainerEl=function(){return this._elContainer;};YAHOO.widget.AutoComplete.prototype.isFocused=function(){return this._bFocused;};YAHOO.widget.AutoComplete.prototype.isContainerOpen=function(){return this._bContainerOpen;};YAHOO.widget.AutoComplete.prototype.getListEl=function(){return this._elList;};YAHOO.widget.AutoComplete.prototype.getListItemMatch=function(elListItem){if(elListItem._sResultMatch){return elListItem._sResultMatch;}else{return null;}};YAHOO.widget.AutoComplete.prototype.getListItemData=function(elListItem){if(elListItem._oResultData){return elListItem._oResultData;}else{return null;}};YAHOO.widget.AutoComplete.prototype.getListItemIndex=function(elListItem){if(YAHOO.lang.isNumber(elListItem._nItemIndex)){return elListItem._nItemIndex;}else{return null;}};YAHOO.widget.AutoComplete.prototype.setHeader=function(sHeader){if(this._elHeader){var elHeader=this._elHeader;if(sHeader){elHeader.innerHTML=sHeader;elHeader.style.display="";}else{elHeader.innerHTML="";elHeader.style.display="none";}}};YAHOO.widget.AutoComplete.prototype.setFooter=function(sFooter){if(this._elFooter){var elFooter=this._elFooter;if(sFooter){elFooter.innerHTML=sFooter;elFooter.style.display="";}else{elFooter.innerHTML="";elFooter.style.display="none";}}};YAHOO.widget.AutoComplete.prototype.setBody=function(sBody){if(this._elBody){var elBody=this._elBody;YAHOO.util.Event.purgeElement(elBody,true);if(sBody){elBody.innerHTML=sBody;elBody.style.display="";}else{elBody.innerHTML="";elBody.style.display="none";}this._elList=null;}};YAHOO.widget.AutoComplete.prototype.generateRequest=function(sQuery){var dataType=this.dataSource.dataType;if(dataType===YAHOO.util.DataSourceBase.TYPE_XHR){if(!this.dataSource.connMethodPost){sQuery=(this.queryQuestionMark?"?":"")+(this.dataSource.scriptQueryParam||"query")+"="+sQuery+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"");}else{sQuery=(this.dataSource.scriptQueryParam||"query")+"="+sQuery+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"");}}else{if(dataType===YAHOO.util.DataSourceBase.TYPE_SCRIPTNODE){sQuery="&"+(this.dataSource.scriptQueryParam||"query")+"="+sQuery+(this.dataSource.scriptQueryAppend?("&"+this.dataSource.scriptQueryAppend):"");}}return sQuery;};YAHOO.widget.AutoComplete.prototype.sendQuery=function(sQuery){this._bFocused=true;var newQuery=(this.delimChar)?this._elTextbox.value+sQuery:sQuery;this._sendQuery(newQuery);};YAHOO.widget.AutoComplete.prototype.snapContainer=function(){var oTextbox=this._elTextbox,pos=YAHOO.util.Dom.getXY(oTextbox);pos[1]+=YAHOO.util.Dom.get(oTextbox).offsetHeight+2;YAHOO.util.Dom.setXY(this._elContainer,pos);};YAHOO.widget.AutoComplete.prototype.expandContainer=function(){this._toggleContainer(true);};YAHOO.widget.AutoComplete.prototype.collapseContainer=function(){this._toggleContainer(false);};YAHOO.widget.AutoComplete.prototype.clearList=function(){var allItems=this._elList.childNodes,i=allItems.length-1;for(;i>-1;i--){allItems[i].style.display="none";}};YAHOO.widget.AutoComplete.prototype.getSubsetMatches=function(sQuery){var subQuery,oCachedResponse,subRequest;for(var i=sQuery.length;i>=this.minQueryLength;i--){subRequest=this.generateRequest(sQuery.substr(0,i));this.dataRequestEvent.fire(this,subQuery,subRequest);oCachedResponse=this.dataSource.getCachedResponse(subRequest);if(oCachedResponse){return this.filterResults.apply(this.dataSource,[sQuery,oCachedResponse,oCachedResponse,{scope:this}]);}}return null;};YAHOO.widget.AutoComplete.prototype.preparseRawResponse=function(oRequest,oFullResponse,oCallback){var nEnd=((this.responseStripAfter!=="")&&(oFullResponse.indexOf))?oFullResponse.indexOf(this.responseStripAfter):-1;if(nEnd!=-1){oFullResponse=oFullResponse.substring(0,nEnd);}return oFullResponse;};YAHOO.widget.AutoComplete.prototype.filterResults=function(sQuery,oFullResponse,oParsedResponse,oCallback){if(oCallback&&oCallback.argument&&YAHOO.lang.isValue(oCallback.argument.query)){sQuery=oCallback.argument.query;}if(sQuery&&sQuery!==""){oParsedResponse=YAHOO.widget.AutoComplete._cloneObject(oParsedResponse);var oAC=oCallback.scope,oDS=this,allResults=oParsedResponse.results,filteredResults=[],nMax=oAC.maxResultsDisplayed,bMatchCase=(oDS.queryMatchCase||oAC.queryMatchCase),bMatchContains=(oDS.queryMatchContains||oAC.queryMatchContains);for(var i=0,len=allResults.length;i<len;i++){var oResult=allResults[i];var sResult=null;if(YAHOO.lang.isString(oResult)){sResult=oResult;}else{if(YAHOO.lang.isArray(oResult)){sResult=oResult[0];}else{if(this.responseSchema.fields){var key=this.responseSchema.fields[0].key||this.responseSchema.fields[0];sResult=oResult[key];}else{if(this.key){sResult=oResult[this.key];}}}}if(YAHOO.lang.isString(sResult)){var sKeyIndex=(bMatchCase)?sResult.indexOf(decodeURIComponent(sQuery)):sResult.toLowerCase().indexOf(decodeURIComponent(sQuery).toLowerCase());if((!bMatchContains&&(sKeyIndex===0))||(bMatchContains&&(sKeyIndex>-1))){filteredResults.push(oResult);}}if(len>nMax&&filteredResults.length===nMax){break;}}oParsedResponse.results=filteredResults;}else{}return oParsedResponse;};YAHOO.widget.AutoComplete.prototype.handleResponse=function(sQuery,oResponse,oPayload){if((this instanceof YAHOO.widget.AutoComplete)&&this._sName){this._populateList(sQuery,oResponse,oPayload);}};YAHOO.widget.AutoComplete.prototype.doBeforeLoadData=function(sQuery,oResponse,oPayload){return true;};YAHOO.widget.AutoComplete.prototype.formatResult=function(oResultData,sQuery,sResultMatch){var sMarkup=(sResultMatch)?sResultMatch:"";return sMarkup;};YAHOO.widget.AutoComplete.prototype.formatEscapedResult=function(oResultData,sQuery,sResultMatch){var sResult=(sResultMatch)?sResultMatch:"";return YAHOO.lang.escapeHTML(sResult);};YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer=function(elTextbox,elContainer,sQuery,aResults){return true;};YAHOO.widget.AutoComplete.prototype.destroy=function(){var instanceName=this.toString();var elInput=this._elTextbox;var elContainer=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(elInput,true);YAHOO.util.Event.purgeElement(elContainer,true);elContainer.innerHTML="";for(var key in this){if(YAHOO.lang.hasOwnProperty(this,key)){this[key]=null;}}};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestCancelEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;YAHOO.widget.AutoComplete.prototype.containerPopulateEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete.prototype.textboxChangeEvent=null;YAHOO.widget.AutoComplete._nIndex=0;YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._elTextbox=null;YAHOO.widget.AutoComplete.prototype._elContainer=null;YAHOO.widget.AutoComplete.prototype._elContent=null;YAHOO.widget.AutoComplete.prototype._elHeader=null;YAHOO.widget.AutoComplete.prototype._elBody=null;YAHOO.widget.AutoComplete.prototype._elFooter=null;YAHOO.widget.AutoComplete.prototype._elShadow=null;YAHOO.widget.AutoComplete.prototype._elIFrame=null;YAHOO.widget.AutoComplete.prototype._bFocused=false;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._elList=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sPastSelections="";YAHOO.widget.AutoComplete.prototype._sInitInputValue=null;YAHOO.widget.AutoComplete.prototype._elCurListItem=null;YAHOO.widget.AutoComplete.prototype._elCurPrehighlightItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._nTypeAheadDelayID=-1;YAHOO.widget.AutoComplete.prototype._iFrameSrc="javascript:false;";YAHOO.widget.AutoComplete.prototype._queryInterval=null;YAHOO.widget.AutoComplete.prototype._sLastTextboxValue=null;YAHOO.widget.AutoComplete.prototype._initProps=function(){var minQueryLength=this.minQueryLength;if(!YAHOO.lang.isNumber(minQueryLength)){this.minQueryLength=1;}var maxResultsDisplayed=this.maxResultsDisplayed;if(!YAHOO.lang.isNumber(maxResultsDisplayed)||(maxResultsDisplayed<1)){this.maxResultsDisplayed=10;}var queryDelay=this.queryDelay;if(!YAHOO.lang.isNumber(queryDelay)||(queryDelay<0)){this.queryDelay=0.2;}var typeAheadDelay=this.typeAheadDelay;if(!YAHOO.lang.isNumber(typeAheadDelay)||(typeAheadDelay<0)){this.typeAheadDelay=0.2;}var delimChar=this.delimChar;if(YAHOO.lang.isString(delimChar)&&(delimChar.length>0)){this.delimChar=[delimChar];}else{if(!YAHOO.lang.isArray(delimChar)){this.delimChar=null;}}var animSpeed=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(!YAHOO.lang.isNumber(animSpeed)||(animSpeed<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&&delimChar){}};YAHOO.widget.AutoComplete.prototype._initContainerHelperEls=function(){if(this.useShadow&&!this._elShadow){var elShadow=document.createElement("div");elShadow.className="yui-ac-shadow";elShadow.style.width=0;elShadow.style.height=0;this._elShadow=this._elContainer.appendChild(elShadow);}if(this.useIFrame&&!this._elIFrame){var elIFrame=document.createElement("iframe");elIFrame.src=this._iFrameSrc;elIFrame.frameBorder=0;elIFrame.scrolling="no";elIFrame.style.position="absolute";elIFrame.style.width=0;elIFrame.style.height=0;elIFrame.style.padding=0;elIFrame.tabIndex=-1;elIFrame.role="presentation";elIFrame.title="Presentational iframe shim";this._elIFrame=this._elContainer.appendChild(elIFrame);}};YAHOO.widget.AutoComplete.prototype._initContainerEl=function(){YAHOO.util.Dom.addClass(this._elContainer,"yui-ac-container");if(!this._elContent){var elContent=document.createElement("div");elContent.className="yui-ac-content";elContent.style.display="none";this._elContent=this._elContainer.appendChild(elContent);var elHeader=document.createElement("div");elHeader.className="yui-ac-hd";elHeader.style.display="none";this._elHeader=this._elContent.appendChild(elHeader);var elBody=document.createElement("div");elBody.className="yui-ac-bd";this._elBody=this._elContent.appendChild(elBody);var elFooter=document.createElement("div");elFooter.className="yui-ac-ft";elFooter.style.display="none";this._elFooter=this._elContent.appendChild(elFooter);}else{}};YAHOO.widget.AutoComplete.prototype._initListEl=function(){var nListLength=this.maxResultsDisplayed,elList=this._elList||document.createElement("ul"),elListItem;while(elList.childNodes.length<nListLength){elListItem=document.createElement("li");elListItem.style.display="none";elListItem._nItemIndex=elList.childNodes.length;elList.appendChild(elListItem);}if(!this._elList){var elBody=this._elBody;YAHOO.util.Event.purgeElement(elBody,true);elBody.innerHTML="";this._elList=elBody.appendChild(elList);}this._elBody.style.display="";};YAHOO.widget.AutoComplete.prototype._focus=function(){var oSelf=this;setTimeout(function(){try{oSelf._elTextbox.focus();}catch(e){}},0);};YAHOO.widget.AutoComplete.prototype._enableIntervalDetection=function(){var oSelf=this;if(!oSelf._queryInterval&&oSelf.queryInterval){oSelf._queryInterval=setInterval(function(){oSelf._onInterval();},oSelf.queryInterval);}};YAHOO.widget.AutoComplete.prototype.enableIntervalDetection=YAHOO.widget.AutoComplete.prototype._enableIntervalDetection;YAHOO.widget.AutoComplete.prototype._onInterval=function(){var currValue=this._elTextbox.value;var lastValue=this._sLastTextboxValue;if(currValue!=lastValue){this._sLastTextboxValue=currValue;this._sendQuery(currValue);}};YAHOO.widget.AutoComplete.prototype._clearInterval=function(){if(this._queryInterval){clearInterval(this._queryInterval);this._queryInterval=null;}};YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(nKeyCode){if((nKeyCode==9)||(nKeyCode==13)||(nKeyCode==16)||(nKeyCode==17)||(nKeyCode>=18&&nKeyCode<=20)||(nKeyCode==27)||(nKeyCode>=33&&nKeyCode<=35)||(nKeyCode>=36&&nKeyCode<=40)||(nKeyCode>=44&&nKeyCode<=45)||(nKeyCode==229)){return true;}return false;};YAHOO.widget.AutoComplete.prototype._sendQuery=function(sQuery){if(this.minQueryLength<0){this._toggleContainer(false);return;}if(this.delimChar){var extraction=this._extractQuery(sQuery);sQuery=extraction.query;this._sPastSelections=extraction.previous;}if((sQuery&&(sQuery.length<this.minQueryLength))||(!sQuery&&this.minQueryLength>0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID);}this._toggleContainer(false);return;}sQuery=encodeURIComponent(sQuery);this._nDelayID=-1;if(this.dataSource.queryMatchSubset||this.queryMatchSubset){var oResponse=this.getSubsetMatches(sQuery);if(oResponse){this.handleResponse(sQuery,oResponse,{query:sQuery});return;}}if(this.dataSource.responseStripAfter){this.dataSource.doBeforeParseData=this.preparseRawResponse;}if(this.applyLocalFilter){this.dataSource.doBeforeCallback=this.filterResults;}var sRequest=this.generateRequest(sQuery);if(sRequest!==undefined){this.dataRequestEvent.fire(this,sQuery,sRequest);this.dataSource.sendRequest(sRequest,{success:this.handleResponse,failure:this.handleResponse,scope:this,argument:{query:sQuery}});}else{this.dataRequestCancelEvent.fire(this,sQuery);}};YAHOO.widget.AutoComplete.prototype._populateListItem=function(elListItem,oResult,sQuery){elListItem.innerHTML=this.formatResult(oResult,sQuery,elListItem._sResultMatch);};YAHOO.widget.AutoComplete.prototype._populateList=function(sQuery,oResponse,oPayload){if(this._nTypeAheadDelayID!=-1){clearTimeout(this._nTypeAheadDelayID);}sQuery=(oPayload&&oPayload.query)?oPayload.query:sQuery;var ok=this.doBeforeLoadData(sQuery,oResponse,oPayload);if(ok&&!oResponse.error){this.dataReturnEvent.fire(this,sQuery,oResponse.results);if(this._bFocused){var sCurQuery=decodeURIComponent(sQuery);this._sCurQuery=sCurQuery;this._bItemSelected=false;var allResults=oResponse.results,nItemsToShow=Math.min(allResults.length,this.maxResultsDisplayed),sMatchKey=(this.dataSource.responseSchema.fields)?(this.dataSource.responseSchema.fields[0].key||this.dataSource.responseSchema.fields[0]):0;if(nItemsToShow>0){if(!this._elList||(this._elList.childNodes.length<nItemsToShow)){this._initListEl();}this._initContainerHelperEls();var allListItemEls=this._elList.childNodes;for(var i=nItemsToShow-1;i>=0;i--){var elListItem=allListItemEls[i],oResult=allResults[i];if(this.resultTypeList){var aResult=[];aResult[0]=(YAHOO.lang.isString(oResult))?oResult:oResult[sMatchKey]||oResult[this.key];var fields=this.dataSource.responseSchema.fields;if(YAHOO.lang.isArray(fields)&&(fields.length>1)){for(var k=1,len=fields.length;k<len;k++){aResult[aResult.length]=oResult[fields[k].key||fields[k]];}}else{if(YAHOO.lang.isArray(oResult)){aResult=oResult;}else{if(YAHOO.lang.isString(oResult)){aResult=[oResult];}else{aResult[1]=oResult;}}}oResult=aResult;}elListItem._sResultMatch=(YAHOO.lang.isString(oResult))?oResult:(YAHOO.lang.isArray(oResult))?oResult[0]:(oResult[sMatchKey]||"");elListItem._oResultData=oResult;this._populateListItem(elListItem,oResult,sCurQuery);elListItem.style.display="";}if(nItemsToShow<allListItemEls.length){var extraListItem;for(var j=allListItemEls.length-1;j>=nItemsToShow;j--){extraListItem=allListItemEls[j];extraListItem.style.display="none";}}this._nDisplayedItems=nItemsToShow;this.containerPopulateEvent.fire(this,sQuery,allResults);if(this.autoHighlight){var elFirstListItem=this._elList.firstChild;this._toggleHighlight(elFirstListItem,"to");this.itemArrowToEvent.fire(this,elFirstListItem);this._typeAhead(elFirstListItem,sQuery);}else{this._toggleHighlight(this._elCurListItem,"from");}ok=this._doBeforeExpandContainer(this._elTextbox,this._elContainer,sQuery,allResults);this._toggleContainer(ok);}else{this._toggleContainer(false);}return;}}else{this.dataErrorEvent.fire(this,sQuery,oResponse);}};YAHOO.widget.AutoComplete.prototype._doBeforeExpandContainer=function(elTextbox,elContainer,sQuery,aResults){if(this.autoSnapContainer){this.snapContainer();}return this.doBeforeExpandContainer(elTextbox,elContainer,sQuery,aResults);};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var extraction=(this.delimChar)?this._extractQuery(this._elTextbox.value):{previous:"",query:this._elTextbox.value};this._elTextbox.value=extraction.previous;this.selectionEnforceEvent.fire(this,extraction.query);};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var elMatch=null;for(var i=0;i<this._nDisplayedItems;i++){var elListItem=this._elList.childNodes[i];var sMatch=(""+elListItem._sResultMatch).toLowerCase();if(sMatch==this._sCurQuery.toLowerCase()){elMatch=elListItem;break;}}return(elMatch);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(elListItem,sQuery){if(!this.typeAhead||(this._nKeyCode==8)){return;}var oSelf=this,elTextbox=this._elTextbox;if(elTextbox.setSelectionRange||elTextbox.createTextRange){this._nTypeAheadDelayID=setTimeout(function(){var nStart=elTextbox.value.length;oSelf._updateValue(elListItem);var nEnd=elTextbox.value.length;oSelf._selectText(elTextbox,nStart,nEnd);var sPrefill=elTextbox.value.substr(nStart,nEnd);oSelf._sCurQuery=elListItem._sResultMatch;oSelf.typeAheadEvent.fire(oSelf,sQuery,sPrefill);},(this.typeAheadDelay*1000));}};YAHOO.widget.AutoComplete.prototype._selectText=function(elTextbox,nStart,nEnd){if(elTextbox.setSelectionRange){elTextbox.setSelectionRange(nStart,nEnd);}else{if(elTextbox.createTextRange){var oTextRange=elTextbox.createTextRange();oTextRange.moveStart("character",nStart);oTextRange.moveEnd("character",nEnd-elTextbox.value.length);oTextRange.select();}else{elTextbox.select();}}};YAHOO.widget.AutoComplete.prototype._extractQuery=function(sQuery){var aDelimChar=this.delimChar,nDelimIndex=-1,nNewIndex,nQueryStart,i=aDelimChar.length-1,sPrevious;for(;i>=0;i--){nNewIndex=sQuery.lastIndexOf(aDelimChar[i]);if(nNewIndex>nDelimIndex){nDelimIndex=nNewIndex;}}if(aDelimChar[i]==" "){for(var j=aDelimChar.length-1;j>=0;j--){if(sQuery[nDelimIndex-1]==aDelimChar[j]){nDelimIndex--;break;}}}if(nDelimIndex>-1){nQueryStart=nDelimIndex+1;while(sQuery.charAt(nQueryStart)==" "){nQueryStart+=1;}sPrevious=sQuery.substring(0,nQueryStart);sQuery=sQuery.substr(nQueryStart);}else{sPrevious="";}return{previous:sPrevious,query:sQuery};};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(bShow){var width=this._elContent.offsetWidth+"px";var height=this._elContent.offsetHeight+"px";if(this.useIFrame&&this._elIFrame){var elIFrame=this._elIFrame;if(bShow){elIFrame.style.width=width;elIFrame.style.height=height;elIFrame.style.padding="";}else{elIFrame.style.width=0;elIFrame.style.height=0;elIFrame.style.padding=0;}}if(this.useShadow&&this._elShadow){var elShadow=this._elShadow;if(bShow){elShadow.style.width=width;elShadow.style.height=height;}else{elShadow.style.width=0;elShadow.style.height=0;}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(bShow){var elContainer=this._elContainer;if(this.alwaysShowContainer&&this._bContainerOpen){return;}if(!bShow){this._toggleHighlight(this._elCurListItem,"from");this._nDisplayedItems=0;this._sCurQuery=null;if(this._elContent.style.display=="none"){return;}}var oAnim=this._oAnim;if(oAnim&&oAnim.getEl()&&(this.animHoriz||this.animVert)){if(oAnim.isAnimated()){oAnim.stop(true);}var oClone=this._elContent.cloneNode(true);elContainer.appendChild(oClone);oClone.style.top="-9000px";oClone.style.width="";oClone.style.height="";oClone.style.display="";var wExp=oClone.offsetWidth;var hExp=oClone.offsetHeight;var wColl=(this.animHoriz)?0:wExp;var hColl=(this.animVert)?0:hExp;oAnim.attributes=(bShow)?{width:{to:wExp},height:{to:hExp}}:{width:{to:wColl},height:{to:hColl}};if(bShow&&!this._bContainerOpen){this._elContent.style.width=wColl+"px";this._elContent.style.height=hColl+"px";}else{this._elContent.style.width=wExp+"px";this._elContent.style.height=hExp+"px";}elContainer.removeChild(oClone);oClone=null;var oSelf=this;var onAnimComplete=function(){oAnim.onComplete.unsubscribeAll();if(bShow){oSelf._toggleContainerHelpers(true);oSelf._bContainerOpen=bShow;oSelf.containerExpandEvent.fire(oSelf);}else{oSelf._elContent.style.display="none";oSelf._bContainerOpen=bShow;oSelf.containerCollapseEvent.fire(oSelf);}};this._toggleContainerHelpers(false);this._elContent.style.display="";oAnim.onComplete.subscribe(onAnimComplete);oAnim.animate();}else{if(bShow){this._elContent.style.display="";this._toggleContainerHelpers(true);this._bContainerOpen=bShow;this.containerExpandEvent.fire(this);}else{this._toggleContainerHelpers(false);this._elContent.style.display="none";this._bContainerOpen=bShow;this.containerCollapseEvent.fire(this);}}};YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(elNewListItem,sType){if(elNewListItem){var sHighlight=this.highlightClassName;if(this._elCurListItem){YAHOO.util.Dom.removeClass(this._elCurListItem,sHighlight);this._elCurListItem=null;}if((sType=="to")&&sHighlight){YAHOO.util.Dom.addClass(elNewListItem,sHighlight);this._elCurListItem=elNewListItem;}}};YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(elNewListItem,sType){var sPrehighlight=this.prehighlightClassName;if(this._elCurPrehighlightItem){YAHOO.util.Dom.removeClass(this._elCurPrehighlightItem,sPrehighlight);}if(elNewListItem==this._elCurListItem){return;}if((sType=="mouseover")&&sPrehighlight){YAHOO.util.Dom.addClass(elNewListItem,sPrehighlight);this._elCurPrehighlightItem=elNewListItem;}else{YAHOO.util.Dom.removeClass(elNewListItem,sPrehighlight);}};YAHOO.widget.AutoComplete.prototype._updateValue=function(elListItem){if(!this.suppressInputUpdate){var elTextbox=this._elTextbox;var sDelimChar=(this.delimChar)?(this.delimChar[0]||this.delimChar):null;var sResultMatch=elListItem._sResultMatch;var sNewValue="";if(sDelimChar){sNewValue=this._sPastSelections;sNewValue+=sResultMatch+sDelimChar;if(sDelimChar!=" "){sNewValue+=" ";}}else{sNewValue=sResultMatch;}elTextbox.value=sNewValue;if(elTextbox.type=="textarea"){elTextbox.scrollTop=elTextbox.scrollHeight;}var end=elTextbox.value.length;this._selectText(elTextbox,end,end);this._elCurListItem=elListItem;}};YAHOO.widget.AutoComplete.prototype._selectItem=function(elListItem){this._bItemSelected=true;this._updateValue(elListItem);this._sPastSelections=this._elTextbox.value;this._clearInterval();this.itemSelectEvent.fire(this,elListItem,elListItem._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(nKeyCode){if(this._bContainerOpen){var elCurListItem=this._elCurListItem,nCurItemIndex=-1;if(elCurListItem){nCurItemIndex=elCurListItem._nItemIndex;}var nNewItemIndex=(nKeyCode==40)?(nCurItemIndex+1):(nCurItemIndex-1);if(nNewItemIndex<-2||nNewItemIndex>=this._nDisplayedItems){return;}if(elCurListItem){this._toggleHighlight(elCurListItem,"from");this.itemArrowFromEvent.fire(this,elCurListItem);}if(nNewItemIndex==-1){if(this.delimChar){this._elTextbox.value=this._sPastSelections+this._sCurQuery;}else{this._elTextbox.value=this._sCurQuery;}return;}if(nNewItemIndex==-2){this._toggleContainer(false);return;}var elNewListItem=this._elList.childNodes[nNewItemIndex],elContent=this._elContent,sOF=YAHOO.util.Dom.getStyle(elContent,"overflow"),sOFY=YAHOO.util.Dom.getStyle(elContent,"overflowY"),scrollOn=((sOF=="auto")||(sOF=="scroll")||(sOFY=="auto")||(sOFY=="scroll"));if(scrollOn&&(nNewItemIndex>-1)&&(nNewItemIndex<this._nDisplayedItems)){if(nKeyCode==40){if((elNewListItem.offsetTop+elNewListItem.offsetHeight)>(elContent.scrollTop+elContent.offsetHeight)){elContent.scrollTop=(elNewListItem.offsetTop+elNewListItem.offsetHeight)-elContent.offsetHeight;}else{if((elNewListItem.offsetTop+elNewListItem.offsetHeight)<elContent.scrollTop){elContent.scrollTop=elNewListItem.offsetTop;}}}else{if(elNewListItem.offsetTop<elContent.scrollTop){this._elContent.scrollTop=elNewListItem.offsetTop;}else{if(elNewListItem.offsetTop>(elContent.scrollTop+elContent.offsetHeight)){this._elContent.scrollTop=(elNewListItem.offsetTop+elNewListItem.offsetHeight)-elContent.offsetHeight;}}}}this._toggleHighlight(elNewListItem,"to");this.itemArrowToEvent.fire(this,elNewListItem);if(this.typeAhead){this._updateValue(elNewListItem);this._sCurQuery=elNewListItem._sResultMatch;}}};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(v,oSelf){var elTarget=YAHOO.util.Event.getTarget(v);var elTag=elTarget.nodeName.toLowerCase();while(elTarget&&(elTag!="table")){switch(elTag){case"body":return;case"li":if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(elTarget,"mouseover");}else{oSelf._toggleHighlight(elTarget,"to");}oSelf.itemMouseOverEvent.fire(oSelf,elTarget);break;case"div":if(YAHOO.util.Dom.hasClass(elTarget,"yui-ac-container")){oSelf._bOverContainer=true;return;}break;default:break;}elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(v,oSelf){var elTarget=YAHOO.util.Event.getTarget(v);var elTag=elTarget.nodeName.toLowerCase();while(elTarget&&(elTag!="table")){switch(elTag){case"body":return;case"li":if(oSelf.prehighlightClassName){oSelf._togglePrehighlight(elTarget,"mouseout");}else{oSelf._toggleHighlight(elTarget,"from");}oSelf.itemMouseOutEvent.fire(oSelf,elTarget);break;case"ul":oSelf._toggleHighlight(oSelf._elCurListItem,"to");break;case"div":if(YAHOO.util.Dom.hasClass(elTarget,"yui-ac-container")){oSelf._bOverContainer=false;return;}break;default:break;}elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerClick=function(v,oSelf){var elTarget=YAHOO.util.Event.getTarget(v);var elTag=elTarget.nodeName.toLowerCase();while(elTarget&&(elTag!="table")){switch(elTag){case"body":return;case"li":oSelf._toggleHighlight(elTarget,"to");oSelf._selectItem(elTarget);return;default:break;}elTarget=elTarget.parentNode;if(elTarget){elTag=elTarget.nodeName.toLowerCase();}}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(v,oSelf){oSelf._focus();};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(v,oSelf){oSelf._toggleContainerHelpers(oSelf._bContainerOpen);};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(v,oSelf){var nKeyCode=v.keyCode;if(oSelf._nTypeAheadDelayID!=-1){clearTimeout(oSelf._nTypeAheadDelayID);}switch(nKeyCode){case 9:if(!YAHOO.env.ua.opera&&(navigator.userAgent.toLowerCase().indexOf("mac")==-1)||(YAHOO.env.ua.webkit>420)){if(oSelf._elCurListItem){if(oSelf.delimChar&&(oSelf._nKeyCode!=nKeyCode)){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}oSelf._selectItem(oSelf._elCurListItem);}else{oSelf._toggleContainer(false);}}break;case 13:if(!YAHOO.env.ua.opera&&(navigator.userAgent.toLowerCase().indexOf("mac")==-1)||(YAHOO.env.ua.webkit>420)){if(oSelf._elCurListItem){if(oSelf._nKeyCode!=nKeyCode){if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);}}oSelf._selectItem(oSelf._elCurListItem);}else{oSelf._toggleContainer(false);}}break;case 27:oSelf._toggleContainer(false);return;case 39:oSelf._jumpSelection();break;case 38:if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);}break;case 40:if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);oSelf._moveSelection(nKeyCode);}break;default:oSelf._bItemSelected=false;oSelf._toggleHighlight(oSelf._elCurListItem,"from");oSelf.textboxKeyEvent.fire(oSelf,nKeyCode);break;}if(nKeyCode===18){oSelf._enableIntervalDetection();}oSelf._nKeyCode=nKeyCode;};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(v,oSelf){var nKeyCode=v.keyCode;if(YAHOO.env.ua.opera||(navigator.userAgent.toLowerCase().indexOf("mac")!=-1)&&(YAHOO.env.ua.webkit<420)){switch(nKeyCode){case 9:if(oSelf._bContainerOpen){if(oSelf.delimChar){YAHOO.util.Event.stopEvent(v);}if(oSelf._elCurListItem){oSelf._selectItem(oSelf._elCurListItem);}else{oSelf._toggleContainer(false);}}break;case 13:if(oSelf._bContainerOpen){YAHOO.util.Event.stopEvent(v);if(oSelf._elCurListItem){oSelf._selectItem(oSelf._elCurListItem);}else{oSelf._toggleContainer(false);}}break;default:break;}}else{if(nKeyCode==229){oSelf._enableIntervalDetection();}}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(v,oSelf){var sText=this.value;oSelf._initProps();var nKeyCode=v.keyCode;if(oSelf._isIgnoreKey(nKeyCode)){return;}if(oSelf._nDelayID!=-1){clearTimeout(oSelf._nDelayID);}oSelf._nDelayID=setTimeout(function(){oSelf._sendQuery(sText);},(oSelf.queryDelay*1000));};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(v,oSelf){if(!oSelf._bFocused){oSelf._elTextbox.setAttribute("autocomplete","off");oSelf._bFocused=true;oSelf._sInitInputValue=oSelf._elTextbox.value;oSelf.textboxFocusEvent.fire(oSelf);}};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(v,oSelf){if(!oSelf._bOverContainer||(oSelf._nKeyCode==9)){if(!oSelf._bItemSelected){var elMatchListItem=oSelf._textMatchesOption();if(!oSelf._bContainerOpen||(oSelf._bContainerOpen&&(elMatchListItem===null))){if(oSelf.forceSelection){oSelf._clearSelection();}else{oSelf.unmatchedItemSelectEvent.fire(oSelf,oSelf._sCurQuery);}}else{if(oSelf.forceSelection){oSelf._selectItem(elMatchListItem);}}}oSelf._clearInterval();oSelf._bFocused=false;if(oSelf._sInitInputValue!==oSelf._elTextbox.value){oSelf.textboxChangeEvent.fire(oSelf);}oSelf.textboxBlurEvent.fire(oSelf);oSelf._toggleContainer(false);}else{oSelf._focus();}};YAHOO.widget.AutoComplete.prototype._onWindowUnload=function(v,oSelf){if(oSelf&&oSelf._elTextbox&&oSelf.allowBrowserAutocomplete){oSelf._elTextbox.setAttribute("autocomplete","on");}};YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery=function(sQuery){return this.generateRequest(sQuery);};YAHOO.widget.AutoComplete.prototype.getListItems=function(){var allListItemEls=[],els=this._elList.childNodes;for(var i=els.length-1;i>=0;i--){allListItemEls[i]=els[i];}return allListItemEls;};YAHOO.widget.AutoComplete._cloneObject=function(o){if(!YAHOO.lang.isValue(o)){return o;}var copy={};if(YAHOO.lang.isFunction(o)){copy=o;}else{if(YAHOO.lang.isArray(o)){var array=[];for(var i=0,len=o.length;i<len;i++){array[i]=YAHOO.widget.AutoComplete._cloneObject(o[i]);}copy=array;}else{if(YAHOO.lang.isObject(o)){for(var x in o){if(YAHOO.lang.hasOwnProperty(o,x)){if(YAHOO.lang.isValue(o[x])&&YAHOO.lang.isObject(o[x])||YAHOO.lang.isArray(o[x])){copy[x]=YAHOO.widget.AutoComplete._cloneObject(o[x]);}else{copy[x]=o[x];}}}}else{copy=o;}}}return copy;};YAHOO.register("autocomplete",YAHOO.widget.AutoComplete,{version:"2.9.0",build:"2800"});
/*http://www.physiotherapyalberta.ca/portal_javascripts/standard_javascript.js?original=1*/
var always_safe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-";if(!Array.prototype.indexOf){Array.prototype.indexOf=function(elt,from){var len=this.length;from=Number(from)||0;from=(from<0)?Math.ceil(from):Math.floor(from);if(from<0){from+=len;}for(;from<len;from+=1){if(this.hasOwnProperty(from)&&this[from]===elt){return from;}}return -1;};}function recursiveGetOffsetTop(FIELD){var theOffsetTop=FIELD.offsetTop;if(FIELD.offsetParent!==null){theOffsetTop=theOffsetTop+recursiveGetOffsetTop(FIELD.offsetParent);}return theOffsetTop;}function recursiveGetOffsetLeft(FIELD){var theOffsetLeft=FIELD.offsetLeft;if(FIELD.offsetParent!==null){theOffsetLeft=theOffsetLeft+recursiveGetOffsetLeft(FIELD.offsetParent);}return theOffsetLeft;}function createCookie(name,value,days,path){var expires,pathname,date;if(days){date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toGMTString();}else{expires="";}if(path){pathname=path;}else{pathname="/";}document.cookie=name+"="+value+expires+"; path="+pathname;}function readCookie(name,defaultValue){var nameEQ=name+"=",ca=document.cookie.split(";"),i,c;for(i=0;i<ca.length;i+=1){c=ca[i];while(c.charAt(0)===" "){c=c.substring(1,c.length);}if(c.indexOf(nameEQ)===0){c=c.substring(nameEQ.length,c.length);if(c.indexOf('"')===0&&c.lastIndexOf('"')===c.length-1){return c.substring(1,c.length-1);}else{return c;}}}if(defaultValue){return defaultValue;}else{return undefined;}}function addAttribute(element,attributeName,attributeValue){var attribute=document.createAttribute(attributeName);attribute.value=attributeValue;element.setAttributeNode(attribute);}function padding(str,padchar,padding_size){padding_size=padding_size-1;if(str.length<=padding_size){str=[str];while(padding_size>=str.unshift(padchar)){}str=str.join("");}return str;}function escape_char(character){return"%"+padding(character.charCodeAt(0).toString(16).toUpperCase(),2);}function urllib_quote(s,safe){var i,ilen,extra_escapes=[[/\*/g,"%2A"],[/@/g,"%40"],[/\+/g,"%2B"],[/\//g,"%2F"]],extra_escape,escaped_char;s=escape(s);if(typeof safe==="undefined"){safe="";}if(safe===null){safe="/";}for(i=0,ilen=extra_escapes.length;i<ilen;i+=1){extra_escape=extra_escapes[i];if(safe.search(extra_escape[0])===-1){s=s.replace(extra_escape[0],extra_escape[1]);}}for(i=0;i<=safe.length;i+=1){escaped_char=new RegExp(escape_char(safe.charAt(i)),"ig");s=s.replace(escaped_char,safe.charAt(i));}return s;}function cgi_escape(s,quote){s=s.replace(/&/g,"&amp;");s=s.replace(/</g,"&lt;");s=s.replace(/>/g,"&gt;");if(quote!==null){s=s.replace(/"/g,"&quot;");}return s;}function cgi_unescape(s,quote){if(quote!==null){s=s.replace(/&quot;/g,/"/);}s=s.replace(/&gt;/g,">");s=s.replace(/&lt;/g,"<");s=s.replace(/&amp;/g,"&");return s;}var setNodeValue;if(YAHOO.env.ua.webkit&&YAHOO.env.ua.webkit<522){setNodeValue=function(node,value){if(!YAHOO.lang.isNull(node.nodeValue)){node.nodeValue=value;}else{node.value=value;}};}else{setNodeValue=function(node,value){node.value=value;};}setNodeValue=(function(){var realSetNodeValue=setNodeValue,warn=true;return function(node,value){if(warn){YAHOO.util.Connect.asyncRequest("POST","/reportError",{},"msg="+urllib_quote("setNodeValue is deprecated."));warn=false;}realSetNodeValue(node,value);};}());var unicodeEscapeDecRegex=new RegExp("&#([0-9]{2,6});","g");var unicodeEscapeNameRegex=new RegExp("&([A-Za-z]{2,4});","g");var namedEscapeToNumberLookup={quot:34,amp:38,lt:60,gt:62,nbsp:160,laquo:171,raquo:187,copy:169,reg:174,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,not:172,shy:173,macr:175,deg:176,plusmn:177,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,sup1:185,ordm:186,frac14:188,frac12:189,frac34:190,iquest:191,Agrave:192,Aacute:193,Acirc:194,Atilde:195,Auml:196,Aring:197,AElig:198,Ccedil:199,Egrave:200,Eacute:201,Ecirc:202,Euml:203,Igrave:204,Iacute:205,Icirc:206,Iuml:207,ETH:208,Ntilde:209,Ograve:210,Oacute:211,Ocirc:212,Otilde:213,Ouml:214,times:215,Oslash:216,Ugrave:217,Uacute:218,Ucirc:219,Uuml:220,Yacute:221,THORN:222,szlig:223,agrave:224,aacute:225,acirc:226,atilde:227,auml:228,aring:229,aelig:230,ccedil:231,egrave:232,eacute:233,ecirc:234,euml:235,igrave:236,iacute:237,icirc:238,iuml:239,eth:240,ntilde:241,ograve:242,oacute:243,ocirc:244,otilde:245,ouml:246,divide:247,oslash:248,ugrave:249,uacute:250,ucirc:251,uuml:252,yacute:253,thorn:254,yuml:255,euro:8364};function dec2Unicode(text,value){return String.fromCharCode(parseInt(value,10));}function name2Unicode(text,value){value=namedEscapeToNumberLookup[value];if(!value){return text;}return String.fromCharCode(parseInt(value,10));}function unicodeEscape(text){text=text.replace(unicodeEscapeDecRegex,dec2Unicode);return text.replace(unicodeEscapeNameRegex,name2Unicode);}function isCapsLock(e,blur){var kc=e.keyCode||e.which,sk=e.shiftKey||((kc===16)?true:false);if(!blur&&(((kc>=65&&kc<=90)&&!sk)||((kc>=97&&kc<=122)&&sk))){document.getElementById("isCapsLock").style.display="block";}else{document.getElementById("isCapsLock").style.display="none";}}var recursivePurgeAndRemove=function(el){var children=YAHOO.util.Dom.getChildren(el);if(children.length){YAHOO.util.Dom.batch(children,recursivePurgeAndRemove);}YAHOO.util.Event.purgeElement(el);if(el.parentNode){el.parentNode.removeChild(el);}};function jval(jString,oScope){var jPath,jPathLength,jChunks,jScope,jArgs=[],x,y;if(!oScope){oScope=window;}jPath=jString.replace(/javascript:/,"").split(".");jPathLength=jPath.length;for(x=0;x<jPathLength;x+=1){if(jPath[x].indexOf("(")!==-1){jChunks=jPath[x].match(/(['|"]?[\w\d\.]+['|"]?)/g);jScope=jChunks.shift();if(jChunks.length>0){jArgs=[];for(y=0;y<jChunks.length;y+=1){if(jChunks[y].search(/['|"]{1}/g)!==-1){jArgs=jArgs.concat(jChunks[y].match(/[\w\d]+/g));}else{if(jChunks[y].search(/[\.\d]+/g)!==-1){jArgs.push(parseInt(jChunks[y],10));}else{if(jChunks[y]==="true"){jArgs.push(true);}else{if(jChunks[y]==="false"){jArgs.push(false);}else{jArgs.push(jChunks[y]);}}}}}}oScope=oScope[jScope].apply(oScope,jArgs);}else{oScope=oScope[jPath[x]];}}return oScope;}function getQueryStringVariable(varName){var queryString,x,xLen,queryStringVar;queryString=window.location.search.substring(1);queryString=queryString.split("&");for(x=0,xLen=queryString.length;x<xLen;x+=1){queryStringVar=queryString[x].split("=");if(queryStringVar[0]===varName){return queryStringVar[1];}}}function typeOf(value){var s=typeof value;if(s==="object"){if(value){if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))&&typeof value.splice==="function"){s="array";}}else{s="null";}}return s;}function isEmpty(o){var i,v;if(typeOf(o)==="object"){for(i in o){if(o.hasOwnProperty(i)){v=o[i];if(v!==undefined&&typeOf(v)!=="function"){return false;}}}}return true;}function isEqual(x,y){function areEqualArrays(xarr,yarr){var xx,xlen;if(xarr.length!==yarr.length){return false;}for(xx=0,xlen=xarr.length;xx>xlen;xx+=1){if(isEqual(xarr[xx],yarr[xx])){return false;}}return true;}function areEqualObjects(xobj,yobj){if(xobj===yobj){return true;}var xkeys=[],ykeys=[],xlen,xx,yy;for(xx in xobj){if(xobj.hasOwnProperty(xx)){xkeys.push(xx);}}for(yy in yobj){if(yobj.hasOwnProperty(yy)){ykeys.push(yy);}}if(!areEqualArrays(xkeys,ykeys)){return false;}for(xx=0,xlen=xkeys.length;xx>xlen;xx+=1){if(!isEqual(xobj[xkeys[xx]],yobj[ykeys[xx]])){return false;}}return true;}var xisArray,yisArray,xisObject,yisObject;if(x!==y){xisArray=YAHOO.lang.isArray(x);yisArray=YAHOO.lang.isArray(y);if(xisArray!==yisArray){return false;}if(!xisArray){xisObject=YAHOO.lang.isObject(x);yisObject=YAHOO.lang.isObject(y);if(xisObject!==yisObject){return false;}}if(xisArray){if(!areEqualArrays(x,y)){return false;}}else{if(xisObject){if(!areEqualObjects(x,y)){return false;}}else{return false;}}}return true;}
/*http://www.physiotherapyalberta.ca/portal_javascripts/swfobject/swfobject.js?original=1*/
var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0;}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7");}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always";}catch(t){if(AC[0]==6){AB=true;}}if(!AB){try{y=new ActiveXObject(p);}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)];}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);
/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/
return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w};}();var L=function(){if(!h.w3cdom){return;}f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S);}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E();}},10);}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null);}R(E);}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E();}}function E(){if(e){return;}if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u);}catch(w){return;}}e=true;if(Z){clearInterval(Z);Z=null;}var q=o.length;for(var r=0;r<q;r++){o[r]();}}function f(q){if(e){q();}else{o[o.length]=q;}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false);}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false);}else{if(typeof j.attachEvent!=b){I(j,"onload",r);}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r();};}else{j.onload=r;}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r);}W(u,true);}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q]);}else{O(r);}}}}else{W(u,true);}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue);}else{w.setAttribute(y[u].nodeName,y[u].nodeValue);}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"));}}}t.parentNode.replaceChild(w,t);}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId;}}else{M=G(u);}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310";}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137";}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u);};I(j,"onload",v);}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x);}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t);};I(j,"onload",q);}else{t.parentNode.replaceChild(G(t),t);}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML;}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true));}}}}}return u;}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t;}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB];}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"';}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"';}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />';}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id);}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z]);}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z]);}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z]);}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y]);}}}v.parentNode.replaceChild(AC,v);q=AC;}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x]);}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x]);}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w]);}}v.parentNode.replaceChild(u,v);q=u;}}}return q;}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u);}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r);}else{j.attachEvent("onload",function(){B(r);});}}else{q.parentNode.removeChild(q);}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null;}}r.parentNode.removeChild(r);}}function C(t){var q=null;try{q=K.getElementById(t);}catch(r){}return q;}function a(q){return K.createElement(q);}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r];}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false;}function V(v,r){if(h.ie&&h.mac){return;}var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"));}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r);}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r;}else{V("#"+t,"visibility:"+r);}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s;}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2]);}var t=i.length;for(var u=0;u<t;u++){X(i[u]);}for(var r in h){h[r]=null;}h=null;for(var q in swfobject){swfobject[q]=null;}swfobject=null;});}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return;}var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false);},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t;}else{if(typeof u.SetVariable!=b){q=u;}}}}return q;},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return;}AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v];}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u];}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t];}else{y.flashvars=t+"="+r[t];}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true);}});}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF);});}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]};},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q);}else{return undefined;}},removeSWF:function(q){if(h.w3cdom){X(q);}},createCSS:function(r,q){if(h.w3cdom){V(r,q);}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u);}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)));}}}return"";},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block";}}M=null;l=null;A=false;}}}};}();
/*http://www.physiotherapyalberta.ca/portal_javascripts/skin/default_skin.js?original=1*/
if(window.location.href.length<=36){new Image().src="/skin_images/home_physiotherapy_over.png";new Image().src="/skin_images/home_public_and_patients_over.png";new Image().src="/skin_images/home_physiotherapists_over.png";new Image().src="/skin_images/home_everyone_else_over.png";}YAHOO.util.Event.onContentReady("td_insurance_flash",function(){swfobject.embedSWF("/skin_files/tdinsur_widget.swf","td_insurance_flash","215","160","9,0,28,0");});YAHOO.util.Event.onContentReady("the_you_movement_flash",function(){swfobject.embedSWF("/skin_files/the_you_movement_widget_new.swf","the_you_movement_flash","215","160","9,0,28,0");});YAHOO.util.Event.onContentReady("twitter_widget",function(){var h3s=this.getElementsByTagName("H3"),doneyet=0,toomuch=0;doneyet=setInterval(function(){if(h3s.length){h3s[0].style.display="none";clearInterval(doneyet);}else{toomuch+=1;if(toomuch>=32){clearInterval(doneyet);}}},125);});function isLoggedIn(){return YAHOO.util.Cookie.exists("__ac");}(function(){var login_click=function(e){if(!isLoggedIn()){YAHOO.util.Event.stopEvent(e);var myDialog=new AZCAT.Dialog(false,"login_form_dialog",{width:"960px",zindex:10}),indexOf=this.href.indexOf("came_from"),indexOfAmp,admin_url,that;myDialog.setHeader([myDialog.headerleft,"Login",myDialog.headerright].join(""));if(indexOf!==-1){admin_url=this.href.substr(indexOf+10);indexOfAmp=admin_url.indexOf("&");if(indexOfAmp!==-1){admin_url=admin_url.substr(0,indexOfAmp);}admin_url=unescape(admin_url);}else{admin_url=this.href;}myDialog.setBody('<iframe id="login_form_iframe"        style="height:475px; width: 940px;"        src="https://secure.alinity.com/CPTA/WebClient/"></iframe><div style="text-align: center">  <a href="/login_form?came_from='+escape(admin_url)+'#admin">Admin login</a></div>');myDialog.setFooter([myDialog.footerleft,myDialog.footerright].join(""));that=this;myDialog.render(document.body);YAHOO.util.Event.on("login_form_iframe","load",function(){var error=false,logged_in=false;try{logged_in=this.contentWindow.location.href.indexOf("/ssoAlinityLoggedIn")!==-1;if(logged_in){myDialog.hide();}}catch(e){error=true;}if(!error&&logged_in){if(window._gaq){_gaq.push(["_trackEvent","Login","By Iframe",admin_url]);}window.location.href=admin_url;}});myDialog.show();}};YAHOO.util.Event.onDOMReady(function(){var links=document.getElementsByTagName("a"),link,l;for(l=links.length-1;l>=0;l-=1){link=links[l];if(link.className.indexOf("login_link")!==-1||link.href.indexOf("/protected_urls/")!==-1){YAHOO.util.Event.on(link,"click",login_click);}}});}());YAHOO.util.Event.onContentReady("nav",function(){var oMenuBar=new YAHOO.widget.MenuBar("nav",{autosubmenudisplay:true,hidedelay:750,iframe:true,lazyload:true});oMenuBar.render();});
/*http://www.physiotherapyalberta.ca/portal_javascripts/emwendelin-javascript-stacktrace/stacktrace.js?original=1*/
function printStackTrace(options){options=options||{guess:true};var ex=options.e||null,guess=!!options.guess;var p=new printStackTrace.implementation();var result=p.run(ex);return(guess)?p.guessAnonymousFunctions(result):result;}printStackTrace.implementation=function(){};printStackTrace.implementation.prototype={run:function(ex,mode){ex=ex||this.createException();mode=mode||this.mode(ex);if(mode==="other"){return this.other(arguments.callee);}else{return this[mode](ex);}},createException:function(){try{this.undef();return null;}catch(e){return e;}},mode:function(e){if(e["arguments"]&&e.stack){return"chrome";}else{if(e.message&&typeof window!=="undefined"&&window.opera){if(!e.stacktrace){return"opera9";}if(!e.stack){return"opera10a";}if(e.stacktrace.indexOf("called from line")<0){return"opera10b";}return"opera11";}else{if(e.stack){return"firefox";}}}return"other";},instrumentFunction:function(context,functionName,callback){context=context||window;var original=context[functionName];context[functionName]=function instrumented(){callback.call(this,printStackTrace().slice(4));return context[functionName]._instrumented.apply(this,arguments);};context[functionName]._instrumented=original;},deinstrumentFunction:function(context,functionName){if(context[functionName].constructor===Function&&context[functionName]._instrumented&&context[functionName]._instrumented.constructor===Function){context[functionName]=context[functionName]._instrumented;}},chrome:function(e){var stack=(e.stack+"\n").replace(/^\S[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^([^\(]+?)([\n$])/gm,"{anonymous}()@$1$2").replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm,"{anonymous}()@$1").split("\n");stack.pop();return stack;},firefox:function(e){return e.stack.replace(/(?:\n@:0)?\s+$/m,"").replace(/^\(/gm,"{anonymous}(").split("\n");},opera11:function(e){var ANON="{anonymous}",lineRE=/^.*line (\d+), column (\d+)(?: in (.+))? in (\S+):$/;var lines=e.stacktrace.split("\n"),result=[];for(var i=0,len=lines.length;i<len;i+=2){var match=lineRE.exec(lines[i]);if(match){var location=match[4]+":"+match[1]+":"+match[2];var fnName=match[3]||"global code";fnName=fnName.replace(/<anonymous function: (\S+)>/g,"$1");result.push(fnName+"@"+location+" -- "+lines[i+1].replace(/^\s+/,""));}}return result;},opera10b:function(e){var ANON="{anonymous}",lineRE=/^(.*)@(.+):(\d+)$/;var lines=e.stacktrace.split("\n"),result=[];for(var i=0,len=lines.length;i<len;i++){var match=lineRE.exec(lines[i]);if(match){var fnName=match[1]?(match[1]+"()"):"global code";result.push(fnName+"@"+match[2]+":"+match[3]);}}return result;},opera10a:function(e){var ANON="{anonymous}",lineRE=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i;var lines=e.stacktrace.split("\n"),result=[];for(var i=0,len=lines.length;i<len;i+=2){var match=lineRE.exec(lines[i]);if(match){var fnName=match[3]||ANON;result.push(fnName+"()@"+match[2]+":"+match[1]+" -- "+lines[i+1].replace(/^\s+/,""));}}return result;},opera9:function(e){var ANON="{anonymous}",lineRE=/Line (\d+).*script (?:in )?(\S+)/i;var lines=e.message.split("\n"),result=[];for(var i=2,len=lines.length;i<len;i+=2){var match=lineRE.exec(lines[i]);if(match){result.push(ANON+"()@"+match[2]+":"+match[1]+" -- "+lines[i+1].replace(/^\s+/,""));}}return result;},other:function(curr){var ANON="{anonymous}",fnRE=/function\s*([\w\-$]+)?\s*\(/i,stack=[],fn,args,maxStackSize=10;while(curr&&stack.length<maxStackSize){fn=fnRE.test(curr.toString())?RegExp.$1||ANON:ANON;args=Array.prototype.slice.call(curr["arguments"]||[]);stack[stack.length]=fn+"("+this.stringifyArguments(args)+")";curr=curr.caller;}return stack;},stringifyArguments:function(args){var result=[];var slice=Array.prototype.slice;for(var i=0;i<args.length;++i){var arg=args[i];if(arg===undefined){result[i]="undefined";}else{if(arg===null){result[i]="null";}else{if(arg.constructor){if(arg.constructor===Array){if(arg.length<3){result[i]="["+this.stringifyArguments(arg)+"]";}else{result[i]="["+this.stringifyArguments(slice.call(arg,0,1))+"..."+this.stringifyArguments(slice.call(arg,-1))+"]";}}else{if(arg.constructor===Object){result[i]="#object";}else{if(arg.constructor===Function){result[i]="#function";}else{if(arg.constructor===String){result[i]='"'+arg+'"';}else{if(arg.constructor===Number){result[i]=arg;}}}}}}}}}return result.join(",");},sourceCache:{},ajax:function(url){var req=this.createXMLHTTPObject();if(req){try{req.open("GET",url,false);req.send("");return req.responseText;}catch(e){}}return"";},createXMLHTTPObject:function(){var xmlhttp,XMLHttpFactories=[function(){return new XMLHttpRequest();},function(){return new ActiveXObject("Msxml2.XMLHTTP");},function(){return new ActiveXObject("Msxml3.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");}];for(var i=0;i<XMLHttpFactories.length;i++){try{xmlhttp=XMLHttpFactories[i]();this.createXMLHTTPObject=XMLHttpFactories[i];return xmlhttp;}catch(e){}}},isSameDomain:function(url){return url.indexOf(location.hostname)!==-1;},getSource:function(url){if(!(url in this.sourceCache)){this.sourceCache[url]=this.ajax(url).split("\n");}return this.sourceCache[url];},guessAnonymousFunctions:function(stack){for(var i=0;i<stack.length;++i){var reStack=/\{anonymous\}\(.*\)@(.*)/,reRef=/^(.*?)(?::(\d+))(?::(\d+))?$/,frame=stack[i],ref=reStack.exec(frame);if(ref){var m=reRef.exec(ref[1]),file=m[1],lineno=m[2],charno=m[3]||0;if(file&&this.isSameDomain(file)&&lineno){var functionName=this.guessAnonymousFunction(file,lineno,charno);stack[i]=frame.replace("{anonymous}",functionName);}}}return stack;},guessAnonymousFunction:function(url,lineNo,charNo){var ret;try{ret=this.findFunctionName(this.getSource(url),lineNo);}catch(e){ret="getSource failed with url: "+url+", exception: "+e.toString();}return ret;},findFunctionName:function(source,lineNo){var reFunctionDeclaration=/function\s+([^(]*?)\s*\(([^)]*)\)/;var reFunctionExpression=/['"]?([0-9A-Za-z_]+)['"]?\s*[:=]\s*function\b/;var reFunctionEvaluation=/['"]?([0-9A-Za-z_]+)['"]?\s*[:=]\s*(?:eval|new Function)\b/;var code="",line,maxLines=10,m;for(var i=0;i<maxLines;++i){line=source[lineNo-i];if(line){code=line+code;m=reFunctionExpression.exec(code);if(m&&m[1]){return m[1];}m=reFunctionDeclaration.exec(code);if(m&&m[1]){return m[1];}m=reFunctionEvaluation.exec(code);if(m&&m[1]){return m[1];}}}return"(?)";}};
/*http://www.physiotherapyalberta.ca/portal_javascripts/azcat.js?original=1*/
if(!window.AZCAT){var AZCAT={};}AZCAT.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1){d=a[i].split(".");o=AZCAT;for(j=(d[0]==="AZCAT")?1:0;j<d.length;j=j+1){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}return o;};AZCAT.init=function(){this.namespace("siteman");this.namespace("utils");this.namespace("widgets");};AZCAT.register=function(name,mainClass,data){var mods=AZCAT.env.modules,m,v,b,ls,i;if(!mods[name]){mods[name]={versions:[],builds:[]};}m=mods[name];v=data.version;b=data.build;ls=AZCAT.env.listeners;m.name=name;m.version=v;m.build=b;m.versions.push(v);m.builds.push(b);m.mainClass=mainClass;for(i=0;i<ls.length;i=i+1){ls[i](m);}if(mainClass){mainClass.VERSION=v;mainClass.BUILD=b;}else{YAHOO.log("mainClass is undefined for module "+name,"warn");}};AZCAT.env=AZCAT.env||{modules:[],listeners:[],getVersion:function(name){return AZCAT.env.modules[name]||null;}};AZCAT.init();AZCAT.register("azcat",AZCAT,{version:"2.0.0",build:"???"});AZCAT.utils.connFail=function(o){alert(["Unfortunately, you have encountered an error connecting with our server. Please try again later.  If the problem persists, contact support @ emergence.com"]);};(function(){var errorCache={};AZCAT.utils.reportError=function(msg){if(!errorCache[msg]){errorCache[msg]=true;YAHOO.util.Connect.asyncRequest("POST",[context_url,"/reportError"].join(""),{},"msg="+urllib_quote(msg));}};}());AZCAT.utils.errorCatcher=function(e){AZCAT.utils.reportError(JSON.stringify(e));};(function(){function errorEvent(){var stack_trace=printStackTrace(),temp_stack=stack_trace.slice(0),error_event_found=false,real_array=[],msg=JSON.stringify(arguments),x;if(msg==="{}"){for(x=arguments.length-1;x>=0;x-=1){real_array.unshift(arguments[x]);}msg=JSON.stringify(real_array);}while(temp_stack.length){if(temp_stack[0].search(/^errorEvent\(/)!==0){temp_stack.splice(0,1);}else{temp_stack[0]=msg;error_event_found=true;break;}}if(error_event_found){stack_trace=temp_stack;}else{stack_trace.splice(0,0,msg);}AZCAT.utils.reportError(JSON.stringify(stack_trace));return false;}AZCAT.utils.errorEvent=errorEvent;}());if(roles.indexOf("Manager")===-1){window.onerror=AZCAT.utils.errorEvent;}YAHOO.env.supports_inline_block=(YAHOO.env.ua.ie!==6&&YAHOO.env.ua.ie!==7);YAHOO.util.Event.throwErrors=true;
/*http://www.physiotherapyalberta.ca/portal_javascripts/build/element/element.js?original=1*/
YAHOO.util.Attribute=function(hash,owner){if(owner){this.owner=owner;this.configure(hash,true);}};YAHOO.util.Attribute.INVALID_VALUE={};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 val=this.value;if(this.getter){val=this.getter.call(this.owner,this.name,val);}return val;},setValue:function(value,silent){var beforeRetVal,owner=this.owner,name=this.name,invalidValue=YAHOO.util.Attribute.INVALID_VALUE,event={type:name,prevValue:this.getValue(),newValue:value};if(this.readOnly||(this.writeOnce&&this._written)){return false;}if(this.validator&&!this.validator.call(owner,value)){return false;}if(!silent){beforeRetVal=owner.fireBeforeChangeEvent(event);if(beforeRetVal===false){return false;}}if(this.setter){value=this.setter.call(owner,value,this.name);if(value===undefined){}if(value===invalidValue){return false;}}if(this.method){if(this.method.call(owner,value,this.name)===invalidValue){return false;}}this.value=value;this._written=true;event.type=name;if(!silent){this.owner.fireChangeEvent(event);}return true;},configure:function(map,init){map=map||{};if(init){this._written=false;}this._initialConfig=this._initialConfig||{};for(var key in map){if(map.hasOwnProperty(key)){this[key]=map[key];if(init){this._initialConfig[key]=map[key];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig,true);},refresh:function(silent){this.setValue(this.value,silent);}};(function(){var Lang=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(key){this._configs=this._configs||{};var config=this._configs[key];if(!config||!this._configs.hasOwnProperty(key)){return null;}return config.getValue();},set:function(key,value,silent){this._configs=this._configs||{};var config=this._configs[key];if(!config){return false;}return config.setValue(value,silent);},getAttributeKeys:function(){this._configs=this._configs;var keys=[],key;for(key in this._configs){if(Lang.hasOwnProperty(this._configs,key)&&!Lang.isUndefined(this._configs[key])){keys[keys.length]=key;}}return keys;},setAttributes:function(map,silent){for(var key in map){if(Lang.hasOwnProperty(map,key)){this.set(key,map[key],silent);}}},resetValue:function(key,silent){this._configs=this._configs||{};if(this._configs[key]){this.set(key,this._configs[key]._initialConfig.value,silent);return true;}return false;},refresh:function(key,silent){this._configs=this._configs||{};var configs=this._configs;key=((Lang.isString(key))?[key]:key)||this.getAttributeKeys();for(var i=0,len=key.length;i<len;++i){if(configs.hasOwnProperty(key[i])){this._configs[key[i]].refresh(silent);}}},register:function(key,map){this.setAttributeConfig(key,map);},getAttributeConfig:function(key){this._configs=this._configs||{};var config=this._configs[key]||{};var map={};for(key in config){if(Lang.hasOwnProperty(config,key)){map[key]=config[key];}}return map;},setAttributeConfig:function(key,map,init){this._configs=this._configs||{};map=map||{};if(!this._configs[key]){map.name=key;this._configs[key]=this.createAttribute(map);}else{this._configs[key].configure(map,init);}},configureAttribute:function(key,map,init){this.setAttributeConfig(key,map,init);},resetAttributeConfig:function(key){this._configs=this._configs||{};this._configs[key].resetConfig();},subscribe:function(type,callback){this._events=this._events||{};if(!(type in this._events)){this._events[type]=this.createEvent(type);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.subscribe.apply(this,arguments);},addListener:function(){this.subscribe.apply(this,arguments);},fireBeforeChangeEvent:function(e){var type="before";type+=e.type.charAt(0).toUpperCase()+e.type.substr(1)+"Change";e.type=type;return this.fireEvent(e.type,e);},fireChangeEvent:function(e){e.type+="Change";return this.fireEvent(e.type,e);},createAttribute:function(map){return new YAHOO.util.Attribute(map,this);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var Dom=YAHOO.util.Dom,AttributeProvider=YAHOO.util.AttributeProvider,specialTypes={mouseenter:true,mouseleave:true};var Element=function(el,map){this.init.apply(this,arguments);};Element.DOM_EVENTS={click:true,dblclick:true,keydown:true,keypress:true,keyup:true,mousedown:true,mousemove:true,mouseout:true,mouseover:true,mouseup:true,mouseenter:true,mouseleave:true,focus:true,blur:true,submit:true,change:true};Element.prototype={DOM_EVENTS:null,DEFAULT_HTML_SETTER:function(value,key){var el=this.get("element");if(el){el[key]=value;}return value;},DEFAULT_HTML_GETTER:function(key){var el=this.get("element"),val;if(el){val=el[key];}return val;},appendChild:function(child){child=child.get?child.get("element"):child;return this.get("element").appendChild(child);},getElementsByTagName:function(tag){return this.get("element").getElementsByTagName(tag);},hasChildNodes:function(){return this.get("element").hasChildNodes();},insertBefore:function(element,before){element=element.get?element.get("element"):element;before=(before&&before.get)?before.get("element"):before;return this.get("element").insertBefore(element,before);},removeChild:function(child){child=child.get?child.get("element"):child;return this.get("element").removeChild(child);},replaceChild:function(newNode,oldNode){newNode=newNode.get?newNode.get("element"):newNode;oldNode=oldNode.get?oldNode.get("element"):oldNode;return this.get("element").replaceChild(newNode,oldNode);},initAttributes:function(map){},addListener:function(type,fn,obj,scope){scope=scope||this;var Event=YAHOO.util.Event,el=this.get("element")||this.get("id"),self=this;if(specialTypes[type]&&!Event._createMouseDelegate){return false;}if(!this._events[type]){if(el&&this.DOM_EVENTS[type]){Event.on(el,type,function(e,matchedEl){if(e.srcElement&&!e.target){e.target=e.srcElement;}if((e.toElement&&!e.relatedTarget)||(e.fromElement&&!e.relatedTarget)){e.relatedTarget=Event.getRelatedTarget(e);}if(!e.currentTarget){e.currentTarget=el;}self.fireEvent(type,e,matchedEl);},obj,scope);}this.createEvent(type,{scope: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(type,fn){return this.unsubscribe.apply(this,arguments);},addClass:function(className){Dom.addClass(this.get("element"),className);},getElementsByClassName:function(className,tag){return Dom.getElementsByClassName(className,tag,this.get("element"));},hasClass:function(className){return Dom.hasClass(this.get("element"),className);},removeClass:function(className){return Dom.removeClass(this.get("element"),className);},replaceClass:function(oldClassName,newClassName){return Dom.replaceClass(this.get("element"),oldClassName,newClassName);},setStyle:function(property,value){return Dom.setStyle(this.get("element"),property,value);},getStyle:function(property){return Dom.getStyle(this.get("element"),property);},fireQueue:function(){var queue=this._queue;for(var i=0,len=queue.length;i<len;++i){this[queue[i][0]].apply(this,queue[i][1]);}},appendTo:function(parent,before){parent=(parent.get)?parent.get("element"):Dom.get(parent);this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:parent});before=(before&&before.get)?before.get("element"):Dom.get(before);var element=this.get("element");if(!element){return false;}if(!parent){return false;}if(element.parent!=parent){if(before){parent.insertBefore(element,before);}else{parent.appendChild(element);}}this.fireEvent("appendTo",{type:"appendTo",target:parent});return element;},get:function(key){var configs=this._configs||{},el=configs.element;if(el&&!configs[key]&&!YAHOO.lang.isUndefined(el.value[key])){this._setHTMLAttrConfig(key);}return AttributeProvider.prototype.get.call(this,key);},setAttributes:function(map,silent){var done={},configOrder=this._configOrder;for(var i=0,len=configOrder.length;i<len;++i){if(map[configOrder[i]]!==undefined){done[configOrder[i]]=true;this.set(configOrder[i],map[configOrder[i]],silent);}}for(var att in map){if(map.hasOwnProperty(att)&&!done[att]){this.set(att,map[att],silent);}}},set:function(key,value,silent){var el=this.get("element");if(!el){this._queue[this._queue.length]=["set",arguments];if(this._configs[key]){this._configs[key].value=value;}return;}if(!this._configs[key]&&!YAHOO.lang.isUndefined(el[key])){this._setHTMLAttrConfig(key);}return AttributeProvider.prototype.set.apply(this,arguments);},setAttributeConfig:function(key,map,init){this._configOrder.push(key);AttributeProvider.prototype.setAttributeConfig.apply(this,arguments);},createEvent:function(type,config){this._events[type]=true;return AttributeProvider.prototype.createEvent.apply(this,arguments);},init:function(el,attr){this._initElement(el,attr);},destroy:function(){var el=this.get("element");YAHOO.util.Event.purgeElement(el,true);this.unsubscribeAll();if(el&&el.parentNode){el.parentNode.removeChild(el);}this._queue=[];this._events={};this._configs={};this._configOrder=[];},_initElement:function(el,attr){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];attr=attr||{};attr.element=attr.element||el||null;var isReady=false;var DOM_EVENTS=Element.DOM_EVENTS;this.DOM_EVENTS=this.DOM_EVENTS||{};for(var event in DOM_EVENTS){if(DOM_EVENTS.hasOwnProperty(event)){this.DOM_EVENTS[event]=DOM_EVENTS[event];}}if(typeof attr.element==="string"){this._setHTMLAttrConfig("id",{value:attr.element});}if(Dom.get(attr.element)){isReady=true;this._initHTMLElement(attr);this._initContent(attr);}YAHOO.util.Event.onAvailable(attr.element,function(){if(!isReady){this._initHTMLElement(attr);}this.fireEvent("available",{type:"available",target:Dom.get(attr.element)});},this,true);YAHOO.util.Event.onContentReady(attr.element,function(){if(!isReady){this._initContent(attr);}this.fireEvent("contentReady",{type:"contentReady",target:Dom.get(attr.element)});},this,true);},_initHTMLElement:function(attr){this.setAttributeConfig("element",{value:Dom.get(attr.element),readOnly:true});},_initContent:function(attr){this.initAttributes(attr);this.setAttributes(attr,true);this.fireQueue();},_setHTMLAttrConfig:function(key,map){var el=this.get("element");map=map||{};map.name=key;map.setter=map.setter||this.DEFAULT_HTML_SETTER;map.getter=map.getter||this.DEFAULT_HTML_GETTER;map.value=map.value||el[key];this._configs[key]=new YAHOO.util.Attribute(map,this);}};YAHOO.augment(Element,AttributeProvider);YAHOO.util.Element=Element;})();YAHOO.register("element",YAHOO.util.Element,{version:"2.9.0",build:"2800"});
/*http://www.physiotherapyalberta.ca/portal_javascripts/build/paginator/paginator.js?original=1*/
(function(){var Dom=YAHOO.util.Dom,lang=YAHOO.lang,isObject=lang.isObject,isFunction=lang.isFunction,isArray=lang.isArray,isString=lang.isString;function Paginator(config){var UNLIMITED=Paginator.VALUE_UNLIMITED,attrib,initialPage,records,perPage,startIndex;config=isObject(config)?config:{};this.initConfig();this.initEvents();this.set("rowsPerPage",config.rowsPerPage,true);if(Paginator.isNumeric(config.totalRecords)){this.set("totalRecords",config.totalRecords,true);}this.initUIComponents();for(attrib in config){if(config.hasOwnProperty(attrib)){this.set(attrib,config[attrib],true);}}initialPage=this.get("initialPage");records=this.get("totalRecords");perPage=this.get("rowsPerPage");if(initialPage>1&&perPage!==UNLIMITED){startIndex=(initialPage-1)*perPage;if(records===UNLIMITED||startIndex<records){this.set("recordOffset",startIndex,true);}}}lang.augmentObject(Paginator,{id:0,ID_BASE:"yui-pg",VALUE_UNLIMITED:-1,TEMPLATE_DEFAULT:"{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}",TEMPLATE_ROWS_PER_PAGE:"{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}",ui:{},isNumeric:function(v){return isFinite(+v);},toNumber:function(n){return isFinite(+n)?+n:null;}},true);Paginator.prototype={_containers:[],_batch:false,_pageChanged:false,_state:null,initConfig:function(){var UNLIMITED=Paginator.VALUE_UNLIMITED;this.setAttributeConfig("rowsPerPage",{value:0,validator:Paginator.isNumeric,setter:Paginator.toNumber});this.setAttributeConfig("containers",{value:null,validator:function(val){if(!isArray(val)){val=[val];}for(var i=0,len=val.length;i<len;++i){if(isString(val[i])||(isObject(val[i])&&val[i].nodeType===1)){continue;}return false;}return true;},method:function(val){val=Dom.get(val);if(!isArray(val)){val=[val];}this._containers=val;}});this.setAttributeConfig("totalRecords",{value:0,validator:Paginator.isNumeric,setter:Paginator.toNumber});this.setAttributeConfig("recordOffset",{value:0,validator:function(val){var total=this.get("totalRecords");if(Paginator.isNumeric(val)){val=+val;return total===UNLIMITED||total>val||(total===0&&val===0);}return false;},setter:Paginator.toNumber});this.setAttributeConfig("initialPage",{value:1,validator:Paginator.isNumeric,setter:Paginator.toNumber});this.setAttributeConfig("template",{value:Paginator.TEMPLATE_DEFAULT,validator:isString});this.setAttributeConfig("containerClass",{value:"yui-pg-container",validator:isString});this.setAttributeConfig("alwaysVisible",{value:true,validator:lang.isBoolean});this.setAttributeConfig("updateOnChange",{value:false,validator:lang.isBoolean});this.setAttributeConfig("id",{value:Paginator.id++,readOnly:true});this.setAttributeConfig("rendered",{value:false,readOnly:true});},initUIComponents:function(){var ui=Paginator.ui,name,UIComp;for(name in ui){if(ui.hasOwnProperty(name)){UIComp=ui[name];if(isObject(UIComp)&&isFunction(UIComp.init)){UIComp.init(this);}}}},initEvents:function(){this.createEvent("render");this.createEvent("rendered");this.createEvent("changeRequest");this.createEvent("pageChange");this.createEvent("beforeDestroy");this.createEvent("destroy");this._selfSubscribe();},_selfSubscribe:function(){this.subscribe("totalRecordsChange",this.updateVisibility,this,true);this.subscribe("alwaysVisibleChange",this.updateVisibility,this,true);this.subscribe("totalRecordsChange",this._handleStateChange,this,true);this.subscribe("recordOffsetChange",this._handleStateChange,this,true);this.subscribe("rowsPerPageChange",this._handleStateChange,this,true);this.subscribe("totalRecordsChange",this._syncRecordOffset,this,true);},_syncRecordOffset:function(e){var v=e.newValue,rpp,state;if(e.prevValue!==v){if(v!==Paginator.VALUE_UNLIMITED){rpp=this.get("rowsPerPage");if(rpp&&this.get("recordOffset")>=v){state=this.getState({totalRecords:e.prevValue,recordOffset:this.get("recordOffset")});this.set("recordOffset",state.before.recordOffset);this._firePageChange(state);}}}},_handleStateChange:function(e){if(e.prevValue!==e.newValue){var change=this._state||{},state;change[e.type.replace(/Change$/,"")]=e.prevValue;state=this.getState(change);if(state.page!==state.before.page){if(this._batch){this._pageChanged=true;}else{this._firePageChange(state);}}}},_firePageChange:function(state){if(isObject(state)){var current=state.before;delete state.before;this.fireEvent("pageChange",{type:"pageChange",prevValue:state.page,newValue:current.page,prevState:state,newState:current});}},render:function(){if(this.get("rendered")){return this;}var template=this.get("template"),state=this.getState(),id_base=Paginator.ID_BASE+this.get("id")+"-",i,len;for(i=0,len=this._containers.length;i<len;++i){this._renderTemplate(this._containers[i],template,id_base+i,true);}this.updateVisibility();if(this._containers.length){this.setAttributeConfig("rendered",{value:true});this.fireEvent("render",state);this.fireEvent("rendered",state);}return this;},_renderTemplate:function(container,template,id_base,hide){var containerClass=this.get("containerClass"),markers,i,len;if(!container){return;}Dom.setStyle(container,"display","none");Dom.addClass(container,containerClass);container.innerHTML=template.replace(/\{([a-z0-9_ \-]+)\}/gi,'<span class="yui-pg-ui yui-pg-ui-$1"></span>');markers=Dom.getElementsByClassName("yui-pg-ui","span",container);for(i=0,len=markers.length;i<len;++i){this.renderUIComponent(markers[i],id_base);}if(!hide){Dom.setStyle(container,"display","");}},renderUIComponent:function(marker,id_base){var par=marker.parentNode,name=/yui-pg-ui-(\w+)/.exec(marker.className),UIComp=name&&Paginator.ui[name[1]],comp;if(isFunction(UIComp)){comp=new UIComp(this);if(isFunction(comp.render)){par.replaceChild(comp.render(id_base),marker);}}return this;},destroy:function(){this.fireEvent("beforeDestroy");this.fireEvent("destroy");this.setAttributeConfig("rendered",{value:false});this.unsubscribeAll();},updateVisibility:function(e){var alwaysVisible=this.get("alwaysVisible"),totalRecords,visible,rpp,rppOptions,i,len,opt;if(!e||e.type==="alwaysVisibleChange"||!alwaysVisible){totalRecords=this.get("totalRecords");visible=true;rpp=this.get("rowsPerPage");rppOptions=this.get("rowsPerPageOptions");if(isArray(rppOptions)){for(i=0,len=rppOptions.length;i<len;++i){opt=rppOptions[i];if(lang.isNumber(opt||opt.value)){rpp=Math.min(rpp,(opt.value||opt));}}}if(totalRecords!==Paginator.VALUE_UNLIMITED&&totalRecords<=rpp){visible=false;}visible=visible||alwaysVisible;for(i=0,len=this._containers.length;i<len;++i){Dom.setStyle(this._containers[i],"display",visible?"":"none");}}},getContainerNodes:function(){return this._containers;},getTotalPages:function(){var records=this.get("totalRecords"),perPage=this.get("rowsPerPage");if(!perPage){return null;}if(records===Paginator.VALUE_UNLIMITED){return Paginator.VALUE_UNLIMITED;}return Math.ceil(records/perPage);},hasPage:function(page){if(!lang.isNumber(page)||page<1){return false;}var totalPages=this.getTotalPages();return(totalPages===Paginator.VALUE_UNLIMITED||totalPages>=page);},getCurrentPage:function(){var perPage=this.get("rowsPerPage");if(!perPage||!this.get("totalRecords")){return 0;}return Math.floor(this.get("recordOffset")/perPage)+1;},hasNextPage:function(){var currentPage=this.getCurrentPage(),totalPages=this.getTotalPages();return currentPage&&(totalPages===Paginator.VALUE_UNLIMITED||currentPage<totalPages);},getNextPage:function(){return this.hasNextPage()?this.getCurrentPage()+1:null;},hasPreviousPage:function(){return(this.getCurrentPage()>1);},getPreviousPage:function(){return(this.hasPreviousPage()?this.getCurrentPage()-1:1);},getPageRecords:function(page){if(!lang.isNumber(page)){page=this.getCurrentPage();}var perPage=this.get("rowsPerPage"),records=this.get("totalRecords"),start,end;if(!page||!perPage){return null;}start=(page-1)*perPage;if(records!==Paginator.VALUE_UNLIMITED){if(start>=records){return null;}end=Math.min(start+perPage,records)-1;}else{end=start+perPage-1;}return[start,end];},setPage:function(page,silent){if(this.hasPage(page)&&page!==this.getCurrentPage()){if(this.get("updateOnChange")||silent){this.set("recordOffset",(page-1)*this.get("rowsPerPage"));}else{this.fireEvent("changeRequest",this.getState({page:page}));}}},getRowsPerPage:function(){return this.get("rowsPerPage");},setRowsPerPage:function(rpp,silent){if(Paginator.isNumeric(rpp)&&+rpp>0&&+rpp!==this.get("rowsPerPage")){if(this.get("updateOnChange")||silent){this.set("rowsPerPage",rpp);}else{this.fireEvent("changeRequest",this.getState({rowsPerPage:+rpp}));}}},getTotalRecords:function(){return this.get("totalRecords");},setTotalRecords:function(total,silent){if(Paginator.isNumeric(total)&&+total>=0&&+total!==this.get("totalRecords")){if(this.get("updateOnChange")||silent){this.set("totalRecords",total);}else{this.fireEvent("changeRequest",this.getState({totalRecords:+total}));}}},getStartIndex:function(){return this.get("recordOffset");},setStartIndex:function(offset,silent){if(Paginator.isNumeric(offset)&&+offset>=0&&+offset!==this.get("recordOffset")){if(this.get("updateOnChange")||silent){this.set("recordOffset",offset);}else{this.fireEvent("changeRequest",this.getState({recordOffset:+offset}));}}},getState:function(changes){var UNLIMITED=Paginator.VALUE_UNLIMITED,M=Math,max=M.max,ceil=M.ceil,currentState,state,offset;function normalizeOffset(offset,total,rpp){if(offset<=0||total===0){return 0;}if(total===UNLIMITED||total>offset){return offset-(offset%rpp);}return total-(total%rpp||rpp);}currentState={paginator:this,totalRecords:this.get("totalRecords"),rowsPerPage:this.get("rowsPerPage"),records:this.getPageRecords()};currentState.recordOffset=normalizeOffset(this.get("recordOffset"),currentState.totalRecords,currentState.rowsPerPage);currentState.page=ceil(currentState.recordOffset/currentState.rowsPerPage)+1;if(!changes){return currentState;}state={paginator:this,before:currentState,rowsPerPage:changes.rowsPerPage||currentState.rowsPerPage,totalRecords:(Paginator.isNumeric(changes.totalRecords)?max(changes.totalRecords,UNLIMITED):+currentState.totalRecords)};if(state.totalRecords===0){state.recordOffset=state.page=0;}else{offset=Paginator.isNumeric(changes.page)?(changes.page-1)*state.rowsPerPage:Paginator.isNumeric(changes.recordOffset)?+changes.recordOffset:currentState.recordOffset;state.recordOffset=normalizeOffset(offset,state.totalRecords,state.rowsPerPage);state.page=ceil(state.recordOffset/state.rowsPerPage)+1;}state.records=[state.recordOffset,state.recordOffset+state.rowsPerPage-1];if(state.totalRecords!==UNLIMITED&&state.recordOffset<state.totalRecords&&state.records&&state.records[1]>state.totalRecords-1){state.records[1]=state.totalRecords-1;}return state;},setState:function(state){if(isObject(state)){this._state=this.getState({});state={page:state.page,rowsPerPage:state.rowsPerPage,totalRecords:state.totalRecords,recordOffset:state.recordOffset};if(state.page&&state.recordOffset===undefined){state.recordOffset=(state.page-1)*(state.rowsPerPage||this.get("rowsPerPage"));}this._batch=true;this._pageChanged=false;for(var k in state){if(state.hasOwnProperty(k)&&this._configs.hasOwnProperty(k)){this.set(k,state[k]);}}this._batch=false;if(this._pageChanged){this._pageChanged=false;this._firePageChange(this.getState(this._state));}}}};lang.augmentProto(Paginator,YAHOO.util.AttributeProvider);YAHOO.widget.Paginator=Paginator;})();(function(){var Paginator=YAHOO.widget.Paginator,l=YAHOO.lang,setId=YAHOO.util.Dom.generateId;Paginator.ui.CurrentPageReport=function(p){this.paginator=p;p.subscribe("recordOffsetChange",this.update,this,true);p.subscribe("rowsPerPageChange",this.update,this,true);p.subscribe("totalRecordsChange",this.update,this,true);p.subscribe("pageReportTemplateChange",this.update,this,true);p.subscribe("destroy",this.destroy,this,true);p.subscribe("pageReportClassChange",this.update,this,true);};Paginator.ui.CurrentPageReport.init=function(p){p.setAttributeConfig("pageReportClass",{value:"yui-pg-current",validator:l.isString});p.setAttributeConfig("pageReportTemplate",{value:"({currentPage} of {totalPages})",validator:l.isString});p.setAttributeConfig("pageReportValueGenerator",{value:function(paginator){var curPage=paginator.getCurrentPage(),records=paginator.getPageRecords();return{currentPage:records?curPage:0,totalPages:paginator.getTotalPages(),startIndex:records?records[0]:0,endIndex:records?records[1]:0,startRecord:records?records[0]+1:0,endRecord:records?records[1]+1:0,totalRecords:paginator.get("totalRecords")};},validator:l.isFunction});};Paginator.ui.CurrentPageReport.sprintf=function(template,values){return template.replace(/\{([\w\s\-]+)\}/g,function(x,key){return(key in values)?values[key]:"";});};Paginator.ui.CurrentPageReport.prototype={span:null,render:function(id_base){this.span=document.createElement("span");this.span.className=this.paginator.get("pageReportClass");setId(this.span,id_base+"-page-report");this.update();return this.span;},update:function(e){if(e&&e.prevValue===e.newValue){return;}this.span.innerHTML=Paginator.ui.CurrentPageReport.sprintf(this.paginator.get("pageReportTemplate"),this.paginator.get("pageReportValueGenerator")(this.paginator));},destroy:function(){this.span.parentNode.removeChild(this.span);this.span=null;}};})();(function(){var Paginator=YAHOO.widget.Paginator,l=YAHOO.lang,setId=YAHOO.util.Dom.generateId;Paginator.ui.PageLinks=function(p){this.paginator=p;p.subscribe("recordOffsetChange",this.update,this,true);p.subscribe("rowsPerPageChange",this.update,this,true);p.subscribe("totalRecordsChange",this.update,this,true);p.subscribe("pageLinksChange",this.rebuild,this,true);p.subscribe("pageLinkClassChange",this.rebuild,this,true);p.subscribe("currentPageClassChange",this.rebuild,this,true);p.subscribe("destroy",this.destroy,this,true);p.subscribe("pageLinksContainerClassChange",this.rebuild,this,true);};Paginator.ui.PageLinks.init=function(p){p.setAttributeConfig("pageLinkClass",{value:"yui-pg-page",validator:l.isString});p.setAttributeConfig("currentPageClass",{value:"yui-pg-current-page",validator:l.isString});p.setAttributeConfig("pageLinksContainerClass",{value:"yui-pg-pages",validator:l.isString});p.setAttributeConfig("pageLinks",{value:10,validator:Paginator.isNumeric});p.setAttributeConfig("pageLabelBuilder",{value:function(page,paginator){return page;},validator:l.isFunction});p.setAttributeConfig("pageTitleBuilder",{value:function(page,paginator){return"Page "+page;},validator:l.isFunction});};Paginator.ui.PageLinks.calculateRange=function(currentPage,totalPages,numPages){var UNLIMITED=Paginator.VALUE_UNLIMITED,start,end,delta;if(!currentPage||numPages===0||totalPages===0||(totalPages===UNLIMITED&&numPages===UNLIMITED)){return[0,-1];}if(totalPages!==UNLIMITED){numPages=numPages===UNLIMITED?totalPages:Math.min(numPages,totalPages);}start=Math.max(1,Math.ceil(currentPage-(numPages/2)));if(totalPages===UNLIMITED){end=start+numPages-1;}else{end=Math.min(totalPages,start+numPages-1);}delta=numPages-(end-start+1);start=Math.max(1,start-delta);return[start,end];};Paginator.ui.PageLinks.prototype={current:0,container:null,render:function(id_base){var p=this.paginator;this.container=document.createElement("span");setId(this.container,id_base+"-pages");this.container.className=p.get("pageLinksContainerClass");YAHOO.util.Event.on(this.container,"click",this.onClick,this,true);this.update({newValue:null,rebuild:true});return this.container;},update:function(e){if(e&&e.prevValue===e.newValue){return;}var p=this.paginator,currentPage=p.getCurrentPage();if(this.current!==currentPage||!currentPage||e.rebuild){var labelBuilder=p.get("pageLabelBuilder"),titleBuilder=p.get("pageTitleBuilder"),range=Paginator.ui.PageLinks.calculateRange(currentPage,p.getTotalPages(),p.get("pageLinks")),start=range[0],end=range[1],content="",linkTemplate,i,spanTemplate;linkTemplate='<a href="#" class="{class}" page="{page}" title="{title}">{label}</a>';spanTemplate='<span class="{class}">{label}</span>';for(i=start;i<=end;++i){if(i===currentPage){content+=l.substitute(spanTemplate,{"class":p.get("currentPageClass")+" "+p.get("pageLinkClass"),label:labelBuilder(i,p)});}else{content+=l.substitute(linkTemplate,{"class":p.get("pageLinkClass"),page:i,label:labelBuilder(i,p),title:titleBuilder(i,p)});}}this.container.innerHTML=content;}},rebuild:function(e){e.rebuild=true;this.update(e);},destroy:function(){YAHOO.util.Event.purgeElement(this.container,true);this.container.parentNode.removeChild(this.container);this.container=null;},onClick:function(e){var t=YAHOO.util.Event.getTarget(e);if(t&&YAHOO.util.Dom.hasClass(t,this.paginator.get("pageLinkClass"))){YAHOO.util.Event.stopEvent(e);this.paginator.setPage(parseInt(t.getAttribute("page"),10));}}};})();(function(){var Paginator=YAHOO.widget.Paginator,l=YAHOO.lang,setId=YAHOO.util.Dom.generateId;Paginator.ui.FirstPageLink=function(p){this.paginator=p;p.subscribe("recordOffsetChange",this.update,this,true);p.subscribe("rowsPerPageChange",this.update,this,true);p.subscribe("totalRecordsChange",this.update,this,true);p.subscribe("destroy",this.destroy,this,true);p.subscribe("firstPageLinkLabelChange",this.update,this,true);p.subscribe("firstPageLinkClassChange",this.update,this,true);};Paginator.ui.FirstPageLink.init=function(p){p.setAttributeConfig("firstPageLinkLabel",{value:"&lt;&lt; first",validator:l.isString});p.setAttributeConfig("firstPageLinkClass",{value:"yui-pg-first",validator:l.isString});p.setAttributeConfig("firstPageLinkTitle",{value:"First Page",validator:l.isString});};Paginator.ui.FirstPageLink.prototype={current:null,link:null,span:null,render:function(id_base){var p=this.paginator,c=p.get("firstPageLinkClass"),label=p.get("firstPageLinkLabel"),title=p.get("firstPageLinkTitle");this.link=document.createElement("a");this.span=document.createElement("span");setId(this.link,id_base+"-first-link");this.link.href="#";this.link.className=c;this.link.innerHTML=label;this.link.title=title;YAHOO.util.Event.on(this.link,"click",this.onClick,this,true);setId(this.span,id_base+"-first-span");this.span.className=c;this.span.innerHTML=label;this.current=p.getCurrentPage()>1?this.link:this.span;return this.current;},update:function(e){if(e&&e.prevValue===e.newValue){return;}var par=this.current?this.current.parentNode:null;if(this.paginator.getCurrentPage()>1){if(par&&this.current===this.span){par.replaceChild(this.link,this.current);this.current=this.link;}}else{if(par&&this.current===this.link){par.replaceChild(this.span,this.current);this.current=this.span;}}},destroy:function(){YAHOO.util.Event.purgeElement(this.link);this.current.parentNode.removeChild(this.current);this.link=this.span=null;},onClick:function(e){YAHOO.util.Event.stopEvent(e);this.paginator.setPage(1);}};})();(function(){var Paginator=YAHOO.widget.Paginator,l=YAHOO.lang,setId=YAHOO.util.Dom.generateId;Paginator.ui.LastPageLink=function(p){this.paginator=p;p.subscribe("recordOffsetChange",this.update,this,true);p.subscribe("rowsPerPageChange",this.update,this,true);p.subscribe("totalRecordsChange",this.update,this,true);p.subscribe("destroy",this.destroy,this,true);p.subscribe("lastPageLinkLabelChange",this.update,this,true);p.subscribe("lastPageLinkClassChange",this.update,this,true);};Paginator.ui.LastPageLink.init=function(p){p.setAttributeConfig("lastPageLinkLabel",{value:"last &gt;&gt;",validator:l.isString});p.setAttributeConfig("lastPageLinkClass",{value:"yui-pg-last",validator:l.isString});p.setAttributeConfig("lastPageLinkTitle",{value:"Last Page",validator:l.isString});};Paginator.ui.LastPageLink.prototype={current:null,link:null,span:null,na:null,render:function(id_base){var p=this.paginator,c=p.get("lastPageLinkClass"),label=p.get("lastPageLinkLabel"),last=p.getTotalPages(),title=p.get("lastPageLinkTitle");this.link=document.createElement("a");this.span=document.createElement("span");this.na=this.span.cloneNode(false);setId(this.link,id_base+"-last-link");this.link.href="#";this.link.className=c;this.link.innerHTML=label;this.link.title=title;YAHOO.util.Event.on(this.link,"click",this.onClick,this,true);setId(this.span,id_base+"-last-span");this.span.className=c;this.span.innerHTML=label;setId(this.na,id_base+"-last-na");switch(last){case Paginator.VALUE_UNLIMITED:this.current=this.na;break;case p.getCurrentPage():this.current=this.span;break;default:this.current=this.link;}return this.current;},update:function(e){if(e&&e.prevValue===e.newValue){return;}var par=this.current?this.current.parentNode:null,after=this.link;if(par){switch(this.paginator.getTotalPages()){case Paginator.VALUE_UNLIMITED:after=this.na;break;case this.paginator.getCurrentPage():after=this.span;break;}if(this.current!==after){par.replaceChild(after,this.current);this.current=after;}}},destroy:function(){YAHOO.util.Event.purgeElement(this.link);this.current.parentNode.removeChild(this.current);this.link=this.span=null;},onClick:function(e){YAHOO.util.Event.stopEvent(e);this.paginator.setPage(this.paginator.getTotalPages());}};})();(function(){var Paginator=YAHOO.widget.Paginator,l=YAHOO.lang,setId=YAHOO.util.Dom.generateId;Paginator.ui.NextPageLink=function(p){this.paginator=p;p.subscribe("recordOffsetChange",this.update,this,true);p.subscribe("rowsPerPageChange",this.update,this,true);p.subscribe("totalRecordsChange",this.update,this,true);p.subscribe("destroy",this.destroy,this,true);p.subscribe("nextPageLinkLabelChange",this.update,this,true);p.subscribe("nextPageLinkClassChange",this.update,this,true);};Paginator.ui.NextPageLink.init=function(p){p.setAttributeConfig("nextPageLinkLabel",{value:"next &gt;",validator:l.isString});p.setAttributeConfig("nextPageLinkClass",{value:"yui-pg-next",validator:l.isString});p.setAttributeConfig("nextPageLinkTitle",{value:"Next Page",validator:l.isString});};Paginator.ui.NextPageLink.prototype={current:null,link:null,span:null,render:function(id_base){var p=this.paginator,c=p.get("nextPageLinkClass"),label=p.get("nextPageLinkLabel"),last=p.getTotalPages(),title=p.get("nextPageLinkTitle");this.link=document.createElement("a");this.span=document.createElement("span");setId(this.link,id_base+"-next-link");this.link.href="#";this.link.className=c;this.link.innerHTML=label;this.link.title=title;YAHOO.util.Event.on(this.link,"click",this.onClick,this,true);setId(this.span,id_base+"-next-span");this.span.className=c;this.span.innerHTML=label;this.current=p.getCurrentPage()===last?this.span:this.link;return this.current;},update:function(e){if(e&&e.prevValue===e.newValue){return;}var last=this.paginator.getTotalPages(),par=this.current?this.current.parentNode:null;if(this.paginator.getCurrentPage()!==last){if(par&&this.current===this.span){par.replaceChild(this.link,this.current);this.current=this.link;}}else{if(this.current===this.link){if(par){par.replaceChild(this.span,this.current);this.current=this.span;}}}},destroy:function(){YAHOO.util.Event.purgeElement(this.link);this.current.parentNode.removeChild(this.current);this.link=this.span=null;},onClick:function(e){YAHOO.util.Event.stopEvent(e);this.paginator.setPage(this.paginator.getNextPage());}};})();(function(){var Paginator=YAHOO.widget.Paginator,l=YAHOO.lang,setId=YAHOO.util.Dom.generateId;Paginator.ui.PreviousPageLink=function(p){this.paginator=p;p.subscribe("recordOffsetChange",this.update,this,true);p.subscribe("rowsPerPageChange",this.update,this,true);p.subscribe("totalRecordsChange",this.update,this,true);p.subscribe("destroy",this.destroy,this,true);p.subscribe("previousPageLinkLabelChange",this.update,this,true);p.subscribe("previousPageLinkClassChange",this.update,this,true);};Paginator.ui.PreviousPageLink.init=function(p){p.setAttributeConfig("previousPageLinkLabel",{value:"&lt; prev",validator:l.isString});p.setAttributeConfig("previousPageLinkClass",{value:"yui-pg-previous",validator:l.isString});p.setAttributeConfig("previousPageLinkTitle",{value:"Previous Page",validator:l.isString});};Paginator.ui.PreviousPageLink.prototype={current:null,link:null,span:null,render:function(id_base){var p=this.paginator,c=p.get("previousPageLinkClass"),label=p.get("previousPageLinkLabel"),title=p.get("previousPageLinkTitle");this.link=document.createElement("a");this.span=document.createElement("span");setId(this.link,id_base+"-prev-link");this.link.href="#";this.link.className=c;this.link.innerHTML=label;this.link.title=title;YAHOO.util.Event.on(this.link,"click",this.onClick,this,true);setId(this.span,id_base+"-prev-span");this.span.className=c;this.span.innerHTML=label;this.current=p.getCurrentPage()>1?this.link:this.span;return this.current;},update:function(e){if(e&&e.prevValue===e.newValue){return;}var par=this.current?this.current.parentNode:null;if(this.paginator.getCurrentPage()>1){if(par&&this.current===this.span){par.replaceChild(this.link,this.current);this.current=this.link;}}else{if(par&&this.current===this.link){par.replaceChild(this.span,this.current);this.current=this.span;}}},destroy:function(){YAHOO.util.Event.purgeElement(this.link);this.current.parentNode.removeChild(this.current);this.link=this.span=null;},onClick:function(e){YAHOO.util.Event.stopEvent(e);this.paginator.setPage(this.paginator.getPreviousPage());}};})();(function(){var Paginator=YAHOO.widget.Paginator,l=YAHOO.lang,setId=YAHOO.util.Dom.generateId;Paginator.ui.RowsPerPageDropdown=function(p){this.paginator=p;p.subscribe("rowsPerPageChange",this.update,this,true);p.subscribe("rowsPerPageOptionsChange",this.rebuild,this,true);p.subscribe("totalRecordsChange",this._handleTotalRecordsChange,this,true);p.subscribe("destroy",this.destroy,this,true);p.subscribe("rowsPerPageDropdownClassChange",this.rebuild,this,true);};Paginator.ui.RowsPerPageDropdown.init=function(p){p.setAttributeConfig("rowsPerPageOptions",{value:[],validator:l.isArray});p.setAttributeConfig("rowsPerPageDropdownClass",{value:"yui-pg-rpp-options",validator:l.isString});};Paginator.ui.RowsPerPageDropdown.prototype={select:null,all:null,render:function(id_base){this.select=document.createElement("select");setId(this.select,id_base+"-rpp");this.select.className=this.paginator.get("rowsPerPageDropdownClass");this.select.title="Rows per page";YAHOO.util.Event.on(this.select,"change",this.onChange,this,true);this.rebuild();return this.select;},rebuild:function(e){var p=this.paginator,sel=this.select,options=p.get("rowsPerPageOptions"),opt,cfg,val,i,len;this.all=null;for(i=0,len=options.length;i<len;++i){cfg=options[i];opt=sel.options[i]||sel.appendChild(document.createElement("option"));val=l.isValue(cfg.value)?cfg.value:cfg;opt.text=l.isValue(cfg.text)?cfg.text:cfg;if(l.isString(val)&&val.toLowerCase()==="all"){this.all=opt;opt.value=p.get("totalRecords");}else{opt.value=val;}}while(sel.options.length>options.length){sel.removeChild(sel.firstChild);}this.update();},update:function(e){if(e&&e.prevValue===e.newValue){return;}var rpp=this.paginator.get("rowsPerPage")+"",options=this.select.options,i,len;for(i=0,len=options.length;i<len;++i){if(options[i].value===rpp){options[i].selected=true;break;}}},onChange:function(e){this.paginator.setRowsPerPage(parseInt(this.select.options[this.select.selectedIndex].value,10));},_handleTotalRecordsChange:function(e){if(!this.all||(e&&e.prevValue===e.newValue)){return;}this.all.value=e.newValue;if(this.all.selected){this.paginator.set("rowsPerPage",e.newValue);}},destroy:function(){YAHOO.util.Event.purgeElement(this.select);this.select.parentNode.removeChild(this.select);this.select=null;}};})();(function(){var Paginator=YAHOO.widget.Paginator,l=YAHOO.lang,setId=YAHOO.util.Dom.generateId;Paginator.ui.JumpToPageDropdown=function(p){this.paginator=p;p.subscribe("rowsPerPageChange",this.rebuild,this,true);p.subscribe("rowsPerPageOptionsChange",this.rebuild,this,true);p.subscribe("pageChange",this.update,this,true);p.subscribe("totalRecordsChange",this.rebuild,this,true);p.subscribe("destroy",this.destroy,this,true);};Paginator.ui.JumpToPageDropdown.init=function(p){p.setAttributeConfig("jumpToPageDropdownClass",{value:"yui-pg-jtp-options",validator:l.isString});};Paginator.ui.JumpToPageDropdown.prototype={select:null,render:function(id_base){this.select=document.createElement("select");setId(this.select,id_base+"-jtp");this.select.className=this.paginator.get("jumpToPageDropdownClass");this.select.title="Jump to page";YAHOO.util.Event.on(this.select,"change",this.onChange,this,true);this.rebuild();return this.select;},rebuild:function(e){var p=this.paginator,sel=this.select,numPages=p.getTotalPages(),opt,i,len;this.all=null;for(i=0,len=numPages;i<len;++i){opt=sel.options[i]||sel.appendChild(document.createElement("option"));opt.innerHTML=i+1;opt.value=i+1;}for(i=numPages,len=sel.options.length;i<len;i++){sel.removeChild(sel.lastChild);}this.update();},update:function(e){if(e&&e.prevValue===e.newValue){return;}var cp=this.paginator.getCurrentPage()+"",options=this.select.options,i,len;for(i=0,len=options.length;i<len;++i){if(options[i].value===cp){options[i].selected=true;break;}}},onChange:function(e){this.paginator.setPage(parseInt(this.select.options[this.select.selectedIndex].value,false));},destroy:function(){YAHOO.util.Event.purgeElement(this.select);this.select.parentNode.removeChild(this.select);this.select=null;}};})();YAHOO.register("paginator",YAHOO.widget.Paginator,{version:"2.9.0",build:"2800"});
/*http://www.physiotherapyalberta.ca/portal_javascripts/search_ajax.js?original=1*/
AZCAT.search=(function(){function _showLoader(){var loader=document.getElementById(this._loaderEl);if(loader){YAHOO.util.Dom.setStyle(loader,"display","block");}}function _hideLoader(){var loader=document.getElementById(this._loaderEl);if(loader){YAHOO.util.Dom.setStyle(loader,"display","none");}}function _showResultsEl(){var resultsField=document.getElementById(this._resultsField);YAHOO.util.Dom.setStyle(resultsField,"visibility","visible");}function _hideResultsEl(){var resultsField=document.getElementById(this._resultsField);YAHOO.util.Dom.setStyle(resultsField,"visibility","hidden");}function _getForm(){return document.getElementById(this._searchForm);}function _updateFromServerCallback(o){var fadeIn,resultsField;this._hideLoader();if(this._fadeOut.isAnimated){this._fadeOut.stop();}this._showResultsEl();resultsField=document.getElementById(this._resultsField);this.dataReturnEvent.fire({results:o,el:resultsField,formEl:this._searchForm});fadeIn=new YAHOO.util.Anim(this._resultsField,{opacity:{to:1}},0.3);fadeIn.animate();}function _updateFromServer(){var query,x;this._fadeOut=new YAHOO.util.Anim(this._resultsField,{opacity:{to:0}},0.3);this._showLoader();this._fadeOut.onComplete.subscribe(this._hideResultsEl,this,true);this._fadeOut.animate();YAHOO.util.Connect.setForm(this._getForm());query="page:int="+this.getCurrentPage();if(!this._rowsPerPageInForm){query+="&"+this._rowsPerPageName+":int="+this.getRowsPerPage();}for(x in this._submitVars){if(this._submitVars.hasOwnProperty(x)){query+=("&"+x+"="+this._submitVars[x]);}}YAHOO.util.Connect._sFormData+=("&"+query);YAHOO.util.Connect.asyncRequest("POST",this._requestURL,{success:this._updateFromServerCallback,scope:this});YAHOO.util.Connect.resetFormState();}function getCurrentPage(){return this._currentPage;}function setCurrentPage(page,fireChange){var pag;this._currentPage=page;pag=this.getPaginator();if(pag){pag.setPage(page,!fireChange);}}function submitSearch(e){var el=YAHOO.util.Event.getTarget(e);if(el.type.toLowerCase()==="submit"){YAHOO.util.Event.stopEvent(e);}this.setCurrentPage(1);this.beforeSearchEvent.fire({el:el,formEl:this._searchForm});this._updateFromServer();}function resetSearch(){var searchField;if(!this._searchField){return;}searchField=document.getElementById(this._searchField);if(searchField){searchField.value="";this.setCurrentPage(1);this._updateFromServer();}else{throw {name:"Unknown Element",message:"Unable to find field "+this._searchField};}}function searchFieldEnter(e){if((e.keyCode||e.which)===13){YAHOO.util.Event.stopEvent(e);this.setCurrentPage(1);this._updateFromServer();}}function getPaginator(){return this._paginator;}function setPaginator(pag){this._paginator=pag;}function showPaginator(){var els,x,xLen;els=this._paginator.getContainerNodes();for(x=0,xLen=els.length;x<xLen;x+=1){YAHOO.util.Dom.setStyle(els[x],"visibility","visible");}}function hidePaginator(){var els,x,xLen;els=this._paginator.getContainerNodes();for(x=0,xLen=els.length;x<xLen;x+=1){YAHOO.util.Dom.setStyle(els[x],"visibility","hidden");}}function getTotalRecords(){return this._totalRecords;}function setTotalRecords(num,fireChange){var pag;this._totalRecords=num;pag=this.getPaginator();if(pag){pag.set("totalRecords",num);if(num===0){this.hidePaginator();}else{this.showPaginator();}if(fireChange){pag.setTotalRecords(num);}}}function getRowsPerPage(){return this.getPaginator().get("rowsPerPage");}function setRowsPerPage(num,fireChange){var pag;this._rowsPerPage=num;pag=this.getPaginator();if(pag){pag.set("rowsPerPage",num);if(fireChange){pag.setRowsPerPage(num);}}}function handlePagination(newState){var pag;this.setCurrentPage(newState.page);pag=this.getPaginator();pag.setState(newState);this._updateFromServer();}return function(config){var pagConfig,paginator,configItem,el,x,xLen,eventType,that={_currentPage:1,_rowsPerPage:config.rowsPerPage,_rowsPerPageName:config.rowsPerPageName||"rows_per_page",_rowsPerPageInForm:config.rowsPerPageInForm||false,_totalRecords:config.totalRecords||0,_loaderEl:config.loader,_requestURL:config.requestURL,_submitVars:config.submitVars||{},_searchForm:config.searchForm,_searchField:config.searchField,_submitFields:config.submitFields,_resetFields:config.resetFields,_resultsField:config.resultsField,_paginator:null,_fadeOut:null,_showLoader:_showLoader,_hideLoader:_hideLoader,_showResultsEl:_showResultsEl,_hideResultsEl:_hideResultsEl,_getForm:_getForm,_updateFromServer:_updateFromServer,_updateFromServerCallback:_updateFromServerCallback,getCurrentPage:getCurrentPage,setCurrentPage:setCurrentPage,submitSearch:submitSearch,resetSearch:resetSearch,searchFieldEnter:searchFieldEnter,getPaginator:getPaginator,setPaginator:setPaginator,showPaginator:showPaginator,hidePaginator:hidePaginator,getTotalRecords:getTotalRecords,setTotalRecords:setTotalRecords,getRowsPerPage:getRowsPerPage,setRowsPerPage:setRowsPerPage,handlePagination:handlePagination,dataReturnEvent:new YAHOO.util.CustomEvent("dataReturnEvent",this),beforeSearchEvent:new YAHOO.util.CustomEvent("beforeSearchEvent",this)};if(config.paginatorEls&&config.paginatorEls.length){pagConfig={containers:config.paginatorEls,rowsPerPage:config.rowsPerPage,totalRecords:config.totalRecords};if(config.rowsPerPageOptions){pagConfig.rowsPerPageOptions=config.rowsPerPageOptions;}if(config.paginatorTemplate){pagConfig.template=config.paginatorTemplate;}paginator=new YAHOO.widget.Paginator(pagConfig);that.setPaginator(paginator);if(config.pagConfig){for(configItem in config.pagConfig){if(config.pagConfig.hasOwnProperty(configItem)){paginator.setAttributeConfig(configItem,{value:config.pagConfig[configItem]});}}}paginator.subscribe("changeRequest",handlePagination,that,true);paginator.render();if(that._totalRecords===0){that.hidePaginator();}}if(that._searchField){el=document.getElementById(that._searchField);if(el){YAHOO.util.Event.on(el,"keydown",that.searchFieldEnter,that,true);}}if(that._submitFields){if(!YAHOO.lang.isArray(that._submitFields)){that._submitFields=[that._submitFields];}for(x=0,xLen=that._submitFields.length;x<xLen;x+=1){if(YAHOO.lang.isString(that._submitFields[x])){el=document.getElementById(that._submitFields[x]);}else{el=that._submitFields[x];}if(!el){continue;}switch(el.tagName.toLowerCase()){case"select":eventType="change";break;case"input":switch(el.type.toLowerCase()){case"submit":case"radio":case"checkbox":eventType="click";break;}break;}if(!eventType){throw {name:"Unknown Event For Element",message:"Unable to determine what type of event to subscribe to field "+that._submitFields[x]};}YAHOO.util.Event.on(el,eventType,that.submitSearch,that,true);}}if(that._resetFields){if(!YAHOO.lang.isArray(that._resetFields)){that._resetFields=[that._resetFields];}for(x=0,xLen=that._resetFields.length;x<xLen;x+=1){if(YAHOO.lang.isString(that._resetFields[x])){el=document.getElementById(that._resetFields[x]);}else{el=that._resetFields[x];}YAHOO.util.Event.on(el,"click",that.resetSearch,that,true);}}return that;};}());(function(){var Paginator=YAHOO.widget.Paginator,l=YAHOO.lang;Paginator.ui.PageLinksSeparated=function(p){this.paginator=p;p.subscribe("recordOffsetChange",this.update,this,true);p.subscribe("rowsPerPageChange",this.update,this,true);p.subscribe("totalRecordsChange",this.update,this,true);p.subscribe("pageLinksChange",this.rebuild,this,true);p.subscribe("pageLinkClassChange",this.rebuild,this,true);p.subscribe("currentPageClassChange",this.rebuild,this,true);p.subscribe("destroy",this.destroy,this,true);p.subscribe("pageLinksContainerClassChange",this.rebuild,this,true);};Paginator.ui.PageLinksSeparated.init=function(p){p.setAttributeConfig("pageSeparator",{value:" | ",validator:l.isString});p.setAttributeConfig("pageLinkClass",{value:"yui-pg-page",validator:l.isString});p.setAttributeConfig("currentPageClass",{value:"yui-pg-current-page",validator:l.isString});p.setAttributeConfig("pageLinksContainerClass",{value:"yui-pg-pages",validator:l.isString});p.setAttributeConfig("pageLinks",{value:10,validator:Paginator.isNumeric});p.setAttributeConfig("pageLabelBuilder",{value:function(page,paginator){return page;},validator:l.isFunction});};Paginator.ui.PageLinksSeparated.calculateRange=function(currentPage,totalPages,numPages){var UNLIMITED=Paginator.VALUE_UNLIMITED,start,end,delta;if(!currentPage||numPages===0||totalPages===0||(totalPages===UNLIMITED&&numPages===UNLIMITED)){return[0,-1];}if(totalPages!==UNLIMITED){numPages=numPages===UNLIMITED?totalPages:Math.min(numPages,totalPages);}start=Math.max(1,Math.ceil(currentPage-(numPages/2)));if(totalPages===UNLIMITED){end=start+numPages-1;}else{end=Math.min(totalPages,start+numPages-1);}delta=numPages-(end-start+1);start=Math.max(1,start-delta);return[start,end];};Paginator.ui.PageLinksSeparated.prototype={current:0,container:null,render:function(id_base){var p=this.paginator;this.container=document.createElement("span");this.container.id=id_base+"-pages";this.container.className=p.get("pageLinksContainerClass");YAHOO.util.Event.on(this.container,"click",this.onClick,this,true);this.update({newValue:null,rebuild:true});return this.container;},update:function(e){if(e&&e.prevValue===e.newValue){return;}var p=this.paginator,currentPage=p.getCurrentPage(),labelBuilder,range,start,end,content,pageSeparator,linkTemplate,i;if(this.current!==currentPage||!currentPage||e.rebuild){labelBuilder=p.get("pageLabelBuilder");range=Paginator.ui.PageLinks.calculateRange(currentPage,p.getTotalPages(),p.get("pageLinks"));start=range[0];end=range[1];content="";pageSeparator=p.get("pageSeparator");linkTemplate='<a href="#" class="'+p.get("pageLinkClass")+'" page="';for(i=start;i<=end;i+=1){if(i===currentPage){content+='<span class="'+p.get("currentPageClass")+" "+p.get("pageLinkClass")+'">'+labelBuilder(i,p)+"</span>";}else{content+=linkTemplate+i+'">'+labelBuilder(i,p)+"</a>";}if(i!==end){content+=pageSeparator;}}this.container.innerHTML=content;}},rebuild:function(e){e.rebuild=true;this.update(e);},destroy:function(){YAHOO.util.Event.purgeElement(this.container,true);this.container.parentNode.removeChild(this.container);this.container=null;},onClick:function(e){var t=YAHOO.util.Event.getTarget(e);if(t&&YAHOO.util.Dom.hasClass(t,this.paginator.get("pageLinkClass"))){YAHOO.util.Event.stopEvent(e);this.paginator.setPage(parseInt(t.getAttribute("page"),10));}}};}());
/*http://www.physiotherapyalberta.ca/portal_javascripts/azcat_panels.js?original=1*/
AZCAT.namespace("dialog");AZCAT.Dialog=(function(){function convertToPixels(value){return parseInt(value,10);}function onResizeOrRenderPanel(e){var maxHeight,maxWidth,scrollTop,height,width,newWidth;YAHOO.util.Dom.setStyle(this.body,"overflow","auto");if(this.id!=="waitStatus"&&this.element){maxHeight=YAHOO.util.Dom.getViewportHeight()-100;if(!this.has_an_overriding_width){maxWidth=YAHOO.util.Dom.getViewportWidth()-100;scrollTop=this.body.scrollTop;if(YAHOO.env.ua.ie===6){YAHOO.util.Dom.setStyle(this.body,"width","auto");}else{YAHOO.util.Dom.setStyle(this.innerElement,"width","auto");}}YAHOO.util.Dom.setStyle(this.body,"height","auto");if(!this.has_an_overriding_width){width=this.body.scrollWidth+(convertToPixels(YAHOO.util.Dom.getStyle(this.body,"padding-left"))+convertToPixels(YAHOO.util.Dom.getStyle(this.body,"padding-right")));YAHOO.util.Dom.setStyle(this.innerElement,"width",(width>maxWidth?maxWidth:width)+"px");if(YAHOO.env.ua.ie===6){newWidth=(width>maxWidth?maxWidth:width)-20;newWidth=newWidth>0?newWidth:0;YAHOO.util.Dom.setStyle(this.body,"width",newWidth+"px");}}height=this.body.scrollHeight-(convertToPixels(YAHOO.util.Dom.getStyle(this.body,"padding-top"))+convertToPixels(YAHOO.util.Dom.getStyle(this.body,"padding-bottom")))+1;YAHOO.util.Dom.setStyle(this.body,"height",(height>maxHeight?maxHeight:height)+"px");if(scrollTop){this.body.scrollTop=scrollTop;}}this.resizeEvent.fire(this);}function onResizeOrRenderPanelFull(e){var maxHeight,maxWidth;maxWidth=YAHOO.util.Dom.getViewportWidth()-100;maxHeight=YAHOO.util.Dom.getViewportHeight()-100;YAHOO.util.Dom.setStyle(this.body,"overflow","auto");if(YAHOO.env.ua.ie===6){YAHOO.util.Dom.setStyle(this.body,"width",maxWidth+"px");}else{YAHOO.util.Dom.setStyle(this.innerElement,"width",maxWidth+"px");}YAHOO.util.Dom.setStyle(this.body,"height",maxHeight+"px");this.center();this.resizeEvent.fire(this);}function onBeforeHidePanel(){var myels=YAHOO.util.Dom.getElementsByClassName("bd","div",this.element);YAHOO.util.Dom.setStyle(myels[0],"overflow","hidden");if(this.cfg.getProperty("effect")){this.hideEvent.subscribe(this.destroy);}else{this.cfg.configChangedEvent.subscribe(function(event_type,config_changes,context){var x,xlen,config_change;for(x=0,xlen=config_changes.length;x<xlen;x+=1){config_change=config_changes[x];if(config_change.length===2&&config_change[0]==="visible"&&config_change[1]===false){this.destroy();}}},this,true);}myels=null;}function destroy(){YAHOO.widget.Panel.prototype.destroy.call(this);this.unsubscribeAll();YAHOO.util.Event.removeListener(window,"resize",onResizeOrRenderPanel);YAHOO.util.Event.removeListener(window,"resize",onResizeOrRenderPanelFull);if(this.dd){recursivePurgeAndRemove(this.dd._domRef);this.dd._domRef=null;}this.close=null;this.innerElement=null;this.focusableElements=null;this.resizeMonitor=null;}function goFullScreen(){YAHOO.util.Event.removeListener(window,"resize",onResizeOrRenderPanel,this);this.changeBodyEvent.unsubscribe(onResizeOrRenderPanel,this);YAHOO.util.Event.addListener(window,"resize",onResizeOrRenderPanelFull,this,true);this.changeBodyEvent.subscribe(onResizeOrRenderPanelFull,this,true);onResizeOrRenderPanelFull.call(this);}function unFullScreen(){YAHOO.util.Event.removeListener(window,"resize",onResizeOrRenderPanelFull,this);this.changeBodyEvent.unsubscribe(onResizeOrRenderPanelFull,this);YAHOO.util.Event.addListener(window,"resize",onResizeOrRenderPanel,this,true);this.changeBodyEvent.subscribe(onResizeOrRenderPanel,this,true);onResizeOrRenderPanel.call(this);}function focusCloseButton(){if(this.close){this.close.focus();}}return function(isMultiUpload,id,config){var that,x,has_an_overriding_width,azcatConfig={width:"30em",fixedcenter:true,constraintoviewport:true,underlay:"none",close:true,visible:false,draggable:true,modal:true};if(YAHOO.util.Anim){azcatConfig.effect={effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25};}for(x in config){if(config.hasOwnProperty(x)){azcatConfig[x]=config[x];if(x==="width"){has_an_overriding_width=true;}}}that=new YAHOO.widget.Panel(id||"azcat_dialog",azcatConfig);if(has_an_overriding_width){that.has_an_overriding_width=true;}that.renderEvent.subscribe(onResizeOrRenderPanel,that,true);that.renderEvent.subscribe(that.center,that,true);that.showEvent.subscribe(focusCloseButton,that,true);YAHOO.util.Event.on(window,"resize",onResizeOrRenderPanel,that,true);that.changeBodyEvent.subscribe(onResizeOrRenderPanel,that,true);that.beforeHideEvent.subscribe(onBeforeHidePanel,that,true);that.headerleft='<div class="tl"></div><span>';that.headerright='</span><div class="tr"></div>';that.footerleft='<div class="bl"></div><span>';that.footerright='</span><div class="br"></div>';that.destroy=destroy;that.goFullScreen=goFullScreen;that.unFullScreen=unFullScreen;that.confirmEvent=new YAHOO.util.CustomEvent("confirm_dialog_event");that.denyEvent=new YAHOO.util.CustomEvent("deny_dialog_event");that.closeEvent=new YAHOO.util.CustomEvent("close_dialog_event");that.resizeEvent=new YAHOO.util.CustomEvent("resize_dialog_event");return that;};}());AZCAT.dialog.actionCode={"delete":function(e,dialogParams){deleteItem(e,dialogParams);YAHOO.util.Event.stopEvent(e);},addMember:function(e,dialogParams){addMember(e,dialogParams);YAHOO.util.Event.stopEvent(e);},deleteMember:function(e,dialogParams){deleteMember(e,dialogParams);YAHOO.util.Event.stopEvent(e);},disableMember:function(e,dialogParams){disableMember(e,dialogParams);YAHOO.util.Event.stopEvent(e);},enableMember:function(e,dialogParams){enableMember(e,dialogParams);YAHOO.util.Event.stopEvent(e);},welcomeEmail:function(e,dialogParams){var x,xLen;dialogParams.cmf_uids=[];for(x=0,xLen=dialogParams.ids.length;x<xLen;x+=1){dialogParams.cmf_uids.push(AZCAT.siteman.dataView.getCMFUIDfromPath(dialogParams.ids[x]));}sendWelcomeEmail(e,dialogParams);YAHOO.util.Event.stopEvent(e);},rename_items:function(e,dialogParams){renameItem(e,dialogParams);YAHOO.util.Event.stopEvent(e);},addpage:function(e,dialogParams){addPageItem(e,dialogParams);YAHOO.util.Event.stopEvent(e);},sortcontent:function(e,dialogParams){sortContent(e,dialogParams);YAHOO.util.Event.stopEvent(e);},sortcollections:function(e,dialogParams){sortCollections(e,dialogParams);YAHOO.util.Event.stopEvent(e);},retract:function(e,dialogParams){doTransition(e,"retract",dialogParams);YAHOO.util.Event.stopEvent(e);},publish:function(e,dialogParams){doTransition(e,"publish",dialogParams);YAHOO.util.Event.stopEvent(e);},publish_for_members:function(e,dialogParams){doTransition(e,"publish_for_members",dialogParams);YAHOO.util.Event.stopEvent(e);},submit:function(e,dialogParams){doTransition(e,"submit",dialogParams);YAHOO.util.Event.stopEvent(e);},reject:function(e,dialogParams){doTransition(e,"reject",dialogParams);YAHOO.util.Event.stopEvent(e);},pastehere:function(e,dialogParams){AZCAT.siteman.dataView.pasteHere(e,dialogParams);YAHOO.util.Event.stopEvent(e);},cut:function(e,dialogParams){var x,xLen;clipboard.items=[];for(x=0,xLen=dialogParams.ids.length;x<xLen;x+=1){clipboard.items.push(AZCAT.siteman.dataView.getCMFUIDfromPath(dialogParams.ids[x]));}clipboard.action="cut";AZCAT.siteman.dataView.insertPasteAction();YAHOO.util.Event.stopEvent(e);},copy:function(e,dialogParams){var x,xLen;clipboard.items=[];for(x=0,xLen=dialogParams.ids.length;x<xLen;x+=1){clipboard.items.push(AZCAT.siteman.dataView.getCMFUIDfromPath(dialogParams.ids[x]));}clipboard.action="copy";AZCAT.siteman.dataView.insertPasteAction();YAHOO.util.Event.stopEvent(e);},revert:function(e,dialogParams){AZCAT.editForm.image.doRevert(e,dialogParams);YAHOO.util.Event.stopEvent(e);},info:function(e,dialogParams){doInfo(e,dialogParams);YAHOO.util.Event.stopEvent(e);},preformat:function(e,dialogParams){var obj,onclickParams,y,yLen,powerFilter,staticData,dynamicData,attr,objAttr;YAHOO.util.Event.stopEvent(e);if(dialogParams.ids.length){obj=AZCAT.siteman.dataView.getCMFUIDfromPath(dialogParams.ids[0]);obj=dialogParams.callback_scope._parent.data.getData(obj);onclickParams=null;for(y=0,yLen=obj.actions.length;y<yLen;y+=1){if(obj.actions[y].id==="preformat"){onclickParams=JSON.parse(obj.actions[y].onclick.replace("javascript:",""));break;}}if(!onclickParams){throw"No onclickParams found for preformat action for "+obj.portal_type+".";}if(onclickParams.power_filter){powerFilter=["_submit_=1"];staticData=onclickParams.power_filter.staticData;if(staticData){for(attr in staticData){if(staticData.hasOwnProperty(attr)){powerFilter.push(attr+"="+urllib_quote(staticData[attr]));}}}dynamicData=onclickParams.power_filter.dynamicData;for(attr in dynamicData){if(dynamicData.hasOwnProperty(attr)){objAttr=obj[dynamicData[attr]];if(objAttr==="undefined"){throw"dynamicData values through a power_filter preformat that do not exist as columns is not implemented.  Attribute requested was "+attr+" on "+obj.cmf_uid+".";}powerFilter.push(attr+"="+urllib_quote(objAttr));}}YAHOO.util.Cookie.set("prefilter",JSON.stringify(powerFilter.join("&")),{path:"/"});YAHOO.util.Cookie.set("prefilter_type","power_filter",{path:"/"});}else{YAHOO.util.Cookie.set("prefilter",obj.title,{path:"/"});}window.location.href=([portal_url,"/site_manager#",onclickParams.fragment]).join("");}},exportContent:function(e,dialogParams){AZCAT.exportContent=AZCAT.ExportContent(e,dialogParams);YAHOO.util.Event.stopEvent(e);},upload:function(e){AZCAT.uploader.openUploadDialog();YAHOO.util.Event.stopEvent(e);},emailUsers:function(e,dialogParams){YAHOO.util.Event.stopEvent(e);var cmf_uid,cmf_uidlen,row,action,actionlen,extraArgs;for(cmf_uid=0,cmf_uidlen=dialogParams.cmf_uids.length;cmf_uid<cmf_uidlen;cmf_uid+=1){row=dialogParams.callback_scope._parent.data.getData(dialogParams.cmf_uids[cmf_uid]);for(action=0,actionlen=row.actions.length;action<actionlen;action+=1){if(row.actions[action].id==="emailUsers"){extraArgs=JSON.parse(row.actions[action].onclick.replace("javascript:",""));break;}}}AZCAT.emailer.openEmailDialog(e,YAHOO.lang.merge(dialogParams,extraArgs));},getImportTemplate:function(e){getImportTemplate();YAHOO.util.Event.stopEvent(e);},importContent:function(e,dialogParams){importContent(e,dialogParams);YAHOO.util.Event.stopEvent(e);}};AZCAT.dialog.actionConditions={"delete":function(params){if(params.id==="index_html"){return false;}if((AZCAT.siteman.dataView.getViewType()==="Tree"&&params.cmf_uid!==AZCAT.siteman.data.root_cmf_uid)||AZCAT.siteman.dataView.getViewType()!=="Tree"){return true;}},cut:function(params){if(params.id==="index_html"){return false;}if(AZCAT.siteman.dataView.getViewType()==="Tree"&&params.cmf_uid!==AZCAT.siteman.data.root_cmf_uid){return true;}},copy:function(params){if(params.id==="index_html"){return false;}if(AZCAT.siteman.dataView.getViewType()==="Tree"&&params.cmf_uid!==AZCAT.siteman.data.root_cmf_uid){return true;}}};

