/*******************  YUI Library *************************/
/*** YAHOO namespace ***/
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt  */ var YAHOO=window.YAHOO||{};YAHOO.namespace=function(ns){if(!ns||!ns.length){return null;}var _2=ns.split(".");var _3=YAHOO;for(var i=(_2[0]=="YAHOO")?1:0;i<_2.length;++i){_3[_2[i]]=_3[_2[i]]||{};_3=_3[_2[i]];}return _3;};YAHOO.log=function(_5,_6,_7){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(_5,_6,_7);}else{return false;}};YAHOO.extend=function(_9,_10){var f=function(){};f.prototype=_10.prototype;_9.prototype=new f();_9.prototype.constructor=_9;_9.superclass=_10.prototype;if(_10.prototype.constructor==Object.prototype.constructor){_10.prototype.constructor=_10;}};YAHOO.namespace("util");YAHOO.namespace("widget");YAHOO.namespace("example");

/*** DOM ***/
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.  Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt */ YAHOO.util.Dom=function(){var ua=navigator.userAgent.toLowerCase();var isOpera=(ua.indexOf('opera')>-1);var isSafari=(ua.indexOf('safari')>-1);var isIE=(window.ActiveXObject);var id_counter=0;var util=YAHOO.util;var property_cache={};var toCamel=function(property){var convert=function(prop){var test=/(-[a-z])/i.exec(prop);return prop.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());};while(property.indexOf('-')>-1){property=convert(property);}return property;};var toHyphen=function(property){if(property.indexOf('-')>-1){return property;}var converted='';for(var i=0,len=property.length;i<len;++i){if(property.charAt(i)==property.charAt(i).toUpperCase()){converted=converted+'-'+property.charAt(i).toLowerCase();}else{converted=converted+property.charAt(i);}}return converted;};var cacheConvertedProperties=function(property){property_cache[property]={camel:toCamel(property),hyphen:toHyphen(property)};};return{get:function(el){if(!el){return null;}if(typeof el!='string'&&!(el instanceof Array)){return el;}if(typeof el=='string'){return document.getElementById(el);}else{var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=util.Dom.get(el[i]);}return collection;}return null;},getStyle:function(el,property){var f=function(el){var value=null;var dv=document.defaultView;if(!property_cache[property]){cacheConvertedProperties(property);}var camel=property_cache[property]['camel'];var hyphen=property_cache[property]['hyphen'];if(property=='opacity'&&el.filters){value=1;try{value=el.filters.item('DXImageTransform.Microsoft.Alpha').opacity/100;}catch(e){try{value=el.filters.item('alpha').opacity/100;}catch(e){}}}else if(el.style[camel]){value=el.style[camel];}else if(isIE&&el.currentStyle&&el.currentStyle[camel]){value=el.currentStyle[camel];}else if(dv&&dv.getComputedStyle){var computed=dv.getComputedStyle(el,'');if(computed&&computed.getPropertyValue(hyphen)){value=computed.getPropertyValue(hyphen);}}return value;};return util.Dom.batch(el,f,util.Dom,true);},setStyle:function(el,property,val){if(!property_cache[property]){cacheConvertedProperties(property);}var camel=property_cache[property]['camel'];var f=function(el){switch(property){case'opacity':if(isIE&&typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}else{el.style.opacity=val;el.style['-moz-opacity']=val;el.style['-khtml-opacity']=val;}break;default:el.style[camel]=val;}};util.Dom.batch(el,f,util.Dom,true);},getXY:function(el){var f=function(el){if(el.offsetParent===null||this.getStyle(el,'display')=='none'){return false;}var parentNode=null;var pos=[];var box;if(el.getBoundingClientRect){box=el.getBoundingClientRect();var doc=document;if(!this.inDocument(el)&&parent.document!=document){doc=parent.document;if(!this.isAncestor(doc.documentElement,el)){return false;}}var scrollTop=Math.max(doc.documentElement.scrollTop,doc.body.scrollTop);var scrollLeft=Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft);return[box.left+scrollLeft,box.top+scrollTop];}else{pos=[el.offsetLeft,el.offsetTop];parentNode=el.offsetParent;if(parentNode!=el){while(parentNode){pos[0]+=parentNode.offsetLeft;pos[1]+=parentNode.offsetTop;parentNode=parentNode.offsetParent;}}if(isSafari&&this.getStyle(el,'position')=='absolute'){pos[0]-=document.body.offsetLeft;pos[1]-=document.body.offsetTop;}}if(el.parentNode){parentNode=el.parentNode;}else{parentNode=null;}while(parentNode&&parentNode.tagName.toUpperCase()!='BODY'&&parentNode.tagName.toUpperCase()!='HTML'){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;if(parentNode.parentNode){parentNode=parentNode.parentNode;}else{parentNode=null;}}return pos;};return util.Dom.batch(el,f,util.Dom,true);},getX:function(el){return util.Dom.getXY(el)[0];},getY:function(el){return util.Dom.getXY(el)[1];},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative';}var pageXY=this.getXY(el);if(pageXY===false){return false;}var delta=[parseInt(this.getStyle(el,'left'),10),parseInt(this.getStyle(el,'top'),10)];if(isNaN(delta[0])){delta[0]=(style_pos=='relative')?0:el.offsetLeft;}if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop;}if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}var newXY=this.getXY(el);if(!noRetry&&(newXY[0]!=pos[0]||newXY[1]!=pos[1])){this.setXY(el,pos,true);}};util.Dom.batch(el,f,util.Dom,true);},setX:function(el,x){util.Dom.setXY(el,[x,null]);},setY:function(el,y){util.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var region=new YAHOO.util.Region.getRegion(el);return region;};return util.Dom.batch(el,f,util.Dom,true);},getClientWidth:function(){return util.Dom.getViewportWidth();},getClientHeight:function(){return util.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root){var method=function(el){return util.Dom.hasClass(el,className)};return util.Dom.getElementsBy(method,tag,root);},hasClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)');var f=function(el){return re.test(el['className']);};return util.Dom.batch(el,f,util.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return;}el['className']=[el['className'],className].join(' ');};util.Dom.batch(el,f,util.Dom,true);},removeClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,className)){return;}var c=el['className'];el['className']=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}};util.Dom.batch(el,f,util.Dom,true);},replaceClass:function(el,oldClassName,newClassName){var re=new RegExp('(?:^|\\s+)'+oldClassName+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return;}el['className']=el['className'].replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}};util.Dom.batch(el,f,util.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';el=el||{};var f=function(el){if(el){el=util.Dom.get(el);}else{el={};}if(!el.id){el.id=prefix+id_counter++;}return el.id;};return util.Dom.batch(el,f,util.Dom,true);},isAncestor:function(haystack,needle){haystack=util.Dom.get(haystack);if(!haystack||!needle){return false;}var f=function(needle){if(haystack.contains&&!isSafari){return haystack.contains(needle);}else if(haystack.compareDocumentPosition){return!!(haystack.compareDocumentPosition(needle)&16);}else{var parent=needle.parentNode;while(parent){if(parent==haystack){return true;}else if(parent.tagName.toUpperCase()=='HTML'){return false;}parent=parent.parentNode;}return false;}};return util.Dom.batch(needle,f,util.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return util.Dom.batch(el,f,util.Dom,true);},getElementsBy:function(method,tag,root){tag=tag||'*';root=util.Dom.get(root)||document;var nodes=[];var elements=root.getElementsByTagName(tag);if(!elements.length&&(tag=='*'&&root.all)){elements=root.all;}for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];}}return nodes;},batch:function(el,method,o,override){var id=el;el=util.Dom.get(el);var scope=(override)?o:window;if(!el||el.tagName||!el.length){if(!el){return false;}return method.call(scope,el,o);}var collection=[];for(var i=0,len=el.length;i<len;++i){if(!el[i]){id=id[i];}collection[collection.length]=method.call(scope,el[i],o);}return collection;},getDocumentHeight:function(){var scrollHeight=-1,windowHeight=-1,bodyHeight=-1;var marginTop=parseInt(util.Dom.getStyle(document.body,'marginTop'),10);var marginBottom=parseInt(util.Dom.getStyle(document.body,'marginBottom'),10);var mode=document.compatMode;if((mode||isIE)&&!isOpera){switch(mode){case'CSS1Compat':scrollHeight=((window.innerHeight&&window.scrollMaxY)?window.innerHeight+window.scrollMaxY:-1);windowHeight=[document.documentElement.clientHeight,self.innerHeight||-1].sort(function(a,b){return(a-b);})[1];bodyHeight=document.body.offsetHeight+marginTop+marginBottom;break;default:scrollHeight=document.body.scrollHeight;bodyHeight=document.body.clientHeight;}}else{scrollHeight=document.documentElement.scrollHeight;windowHeight=self.innerHeight;bodyHeight=document.documentElement.clientHeight;}var h=[scrollHeight,windowHeight,bodyHeight].sort(function(a,b){return(a-b);});return h[2];},getDocumentWidth:function(){var docWidth=-1,bodyWidth=-1,winWidth=-1;var marginRight=parseInt(util.Dom.getStyle(document.body,'marginRight'),10);var marginLeft=parseInt(util.Dom.getStyle(document.body,'marginLeft'),10);var mode=document.compatMode;if(mode||isIE){switch(mode){case'CSS1Compat':docWidth=document.documentElement.clientWidth;bodyWidth=document.body.offsetWidth+marginLeft+marginRight;winWidth=self.innerWidth||-1;break;default:bodyWidth=document.body.clientWidth;winWidth=document.body.scrollWidth;break;}}else{docWidth=document.documentElement.clientWidth;bodyWidth=document.body.offsetWidth+marginLeft+marginRight;winWidth=self.innerWidth;}var w=[docWidth,bodyWidth,winWidth].sort(function(a,b){return(a-b);});return w[2];},getViewportHeight:function(){var height=-1;var mode=document.compatMode;if((mode||isIE)&&!isOpera){switch(mode){case'CSS1Compat':height=document.documentElement.clientHeight;break;default:height=document.body.clientHeight;}}else{height=self.innerHeight;}return height;},getViewportWidth:function(){var width=-1;var mode=document.compatMode;if(mode||isIE){switch(mode){case'CSS1Compat':width=document.documentElement.clientWidth;break;default:width=document.body.clientWidth;}}else{width=self.innerWidth;}return width;}};}();YAHOO.util.Region=function(t,r,b,l){this.top=t;this[1]=t;this.right=r;this.bottom=b;this.left=l;this[0]=l;};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);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var 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);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var 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+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];}this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region();
/*** event ***/
/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt  */ YAHOO.util.CustomEvent=function(_1,_2,_3){this.type=_1;this.scope=_2||window;this.silent=_3;this.subscribers=[];if(YAHOO.util.Event){YAHOO.util.Event.regCE(this);}if(!this.silent){}};YAHOO.util.CustomEvent.prototype={subscribe:function(fn,_5,_6){this.subscribers.push(new YAHOO.util.Subscriber(fn,_5,_6));},unsubscribe:function(fn,_7){var _8=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,_7)){this._delete(i);_8=true;}}return _8;},fire:function(){var len=this.subscribers.length;var _12=[];for(var i=0;i<arguments.length;++i){_12.push(arguments[i]);}if(!this.silent){}for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}var _13=(s.override)?s.obj:this.scope;s.fn.call(_13,this.type,_12,s.obj);}}},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(i);}},_delete:function(_14){var s=this.subscribers[_14];if(s){delete s.fn;delete s.obj;}delete this.subscribers[_14];},toString:function(){return "CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,_16){this.fn=fn;this.obj=obj||null;this.override=(_16);};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){return (this.fn==fn&&this.obj==obj);};YAHOO.util.Subscriber.prototype.toString=function(){return "Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var _17=false;var _18=[];var _19=[];var _20=[];var _21=[];var _22=[];var _23=[];var _24=0;var _25=[];var _26=[];var _27=0;return {POLL_RETRYS:200,POLL_INTERVAL:50,EL:0,TYPE:1,FN:2,WFN:3,SCOPE:3,ADJ_SCOPE:4,isSafari:(/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),isIE:(!this.isSafari&&!navigator.userAgent.match(/opera/gi)&&navigator.userAgent.match(/msie/gi)),addDelayedListener:function(el,_29,fn,_30,_31){_19[_19.length]=[el,_29,fn,_30,_31];if(_17){_24=this.POLL_RETRYS;this.startTimeout(0);}},startTimeout:function(_32){var i=(_32||_32===0)?_32:this.POLL_INTERVAL;var _33=this;var _34=function(){_33._tryPreloadAttach();};this.timeout=setTimeout(_34,i);},onAvailable:function(_35,_36,_37,_38){_25.push({id:_35,fn:_36,obj:_37,override:_38});_24=this.POLL_RETRYS;this.startTimeout(0);},addListener:function(el,_39,fn,_40,_41){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],_39,fn,_40,_41)&&ok);}return ok;}else{if(typeof el=="string"){var oEl=this.getEl(el);if(_17&&oEl){el=oEl;}else{this.addDelayedListener(el,_39,fn,_40,_41);return true;}}}if(!el){return false;}if("unload"==_39&&_40!==this){_20[_20.length]=[el,_39,fn,_40,_41];return true;}var _44=(_41)?_40:el;var _45=function(e){return fn.call(_44,YAHOO.util.Event.getEvent(e),_40);};var li=[el,_39,fn,_45,_44];var _48=_18.length;_18[_48]=li;if(this.useLegacyEvent(el,_39)){var _49=this.getLegacyIndex(el,_39);if(_49==-1){_49=_22.length;_26[el.id+_39]=_49;_22[_49]=[el,_39,el["on"+_39]];_23[_49]=[];el["on"+_39]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),_49);};}_23[_49].push(_48);}else{if(el.addEventListener){el.addEventListener(_39,_45,false);}else{if(el.attachEvent){el.attachEvent("on"+_39,_45);}}}return true;},fireLegacyEvent:function(e,_50){var ok=true;var le=_23[_50];for(var i=0,len=le.length;i<len;++i){var _52=le[i];if(_52){var li=_18[_52];if(li&&li[this.WFN]){var _53=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(_53,e);ok=(ok&&ret);}else{delete le[i];}}}return ok;},getLegacyIndex:function(el,_55){var key=this.generateId(el)+_55;if(typeof _26[key]=="undefined"){return -1;}else{return _26[key];}},useLegacyEvent:function(el,_57){if(!el.addEventListener&&!el.attachEvent){return true;}else{if(this.isSafari){if("click"==_57||"dblclick"==_57){return true;}}}return false;},removeListener:function(el,_58,fn,_59){if(!fn||!fn.call){return false;}if(typeof el=="string"){el=this.getEl(el);}else{if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],_58,fn)&&ok);}return ok;}}if("unload"==_58){for(i=0,len=_20.length;i<len;i++){var li=_20[i];if(li&&li[0]==el&&li[1]==_58&&li[2]==fn){delete _20[i];return true;}}return false;}var _60=null;if("undefined"==typeof _59){_59=this._getCacheIndex(el,_58,fn);}if(_59>=0){_60=_18[_59];}if(!el||!_60){return false;}if(el.removeEventListener){el.removeEventListener(_58,_60[this.WFN],false);}else{if(el.detachEvent){el.detachEvent("on"+_58,_60[this.WFN]);}}delete _18[_59][this.WFN];delete _18[_59][this.FN];delete _18[_59];return true;},getTarget:function(ev,_62){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(_64){if(_64&&_64.nodeName&&"#TEXT"==_64.nodeName.toUpperCase()){return _64.parentNode;}else{return _64;}},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(e){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){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){return ev.charCode||((ev.type=="keypress")?ev.keyCode:0);},_getCacheIndex:function(el,_68,fn){for(var i=0,len=_18.length;i<len;++i){var li=_18[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==_68){return i;}}return -1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+_27;++_27;el.id=id;}return id;},_isValidCollection:function(o){return (o&&o.length&&typeof o!="string"&&!o.tagName&&!o.alert&&typeof o[0]!="undefined");},elCache:{},getEl:function(id){return document.getElementById(id);},clearCache:function(){},regCE:function(ce){_21.push(ce);},_load:function(e){_17=true;},_tryPreloadAttach:function(){if(this.locked){return false;}this.locked=true;var _72=!_17;if(!_72){_72=(_24>0);}var _73=[];for(var i=0,len=_19.length;i<len;++i){var d=_19[i];if(d){var el=this.getEl(d[this.EL]);if(el){this.on(el,d[this.TYPE],d[this.FN],d[this.SCOPE],d[this.ADJ_SCOPE]);delete _19[i];}else{_73.push(d);}}}_19=_73;var _75=[];for(i=0,len=_25.length;i<len;++i){var _76=_25[i];if(_76){el=this.getEl(_76.id);if(el){var _77=(_76.override)?_76.obj:el;_76.fn.call(_77,_76.obj);delete _25[i];}else{_75.push(_76);}}}_24=(_73.length===0&&_75.length===0)?0:_24-1;if(_72){this.startTimeout();}this.locked=false;return true;},purgeElement:function(el,_78,_79){var _80=this.getListeners(el,_79);if(_80){for(var i=0,len=_80.length;i<len;++i){var l=_80[i];this.removeListener(el,l.type,l.fn,l.index);}}if(_78&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],_78,_79);}}},getListeners:function(el,_82){var _83=[];if(_18&&_18.length>0){for(var i=0,len=_18.length;i<len;++i){var l=_18[i];if(l&&l[this.EL]===el&&(!_82||_82===l[this.TYPE])){_83.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.SCOPE],adjust:l[this.ADJ_SCOPE],index:i});}}}return (_83.length)?_83:null;},_unload:function(e,me){for(var i=0,len=_20.length;i<len;++i){var l=_20[i];if(l){var _85=(l[this.ADJ_SCOPE])?l[this.SCOPE]:window;l[this.FN].call(_85,this.getEvent(e),l[this.SCOPE]);}}if(_18&&_18.length>0){for(i=0,len=_18.length;i<len;++i){l=_18[i];if(l){this.removeListener(l[this.EL],l[this.TYPE],l[this.FN],i);}}this.clearCache();}for(i=0,len=_21.length;i<len;++i){_21[i].unsubscribeAll();delete _21[i];}for(i=0,len=_22.length;i<len;++i){delete _22[i][0];delete _22[i];}},_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){return [dd.scrollTop,dd.scrollLeft];}else{if(db){return [db.scrollTop,db.scrollLeft];}else{return [0,0];}}}};}();YAHOO.util.Event.on=YAHOO.util.Event.addListener;if(document&&document.body){YAHOO.util.Event._load();}else{YAHOO.util.Event.on(window,"load",YAHOO.util.Event._load,YAHOO.util.Event,true);}YAHOO.util.Event.on(window,"unload",YAHOO.util.Event._unload,YAHOO.util.Event,true);YAHOO.util.Event._tryPreloadAttach();}
/*** Connection ***/
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
*/
YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_header:{},_has_http_headers:false,_default_post_header:true,_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:[],_timeOut:[],_polling_interval:50,_transaction_id:0,setProgId:function(id)
{this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b)
{this._default_post_header=b;},setPollingInterval:function(i)
{if(typeof i=='number'&&isFinite(i)){this._polling_interval=i;}},createXhrObject:function(transactionId)
{var obj,http;try
{http=new XMLHttpRequest();obj={conn:http,tId:transactionId};}
catch(e)
{for(var i=0;i<this._msxml_progid.length;++i){try
{http=new ActiveXObject(this._msxml_progid[i]);obj={conn:http,tId:transactionId};break;}
catch(e){}}}
finally
{return obj;}},getConnectionObject:function()
{var o;var tId=this._transaction_id;try
{o=this.createXhrObject(tId);if(o){this._transaction_id++;}}
catch(e){}
finally
{return o;}},asyncRequest:function(method,uri,callback,postData)
{var o=this.getConnectionObject();if(!o){return null;}
else{if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(o.tId,callback,uri);this.releaseObject(o);return;}
if(method=='GET'){uri+="?"+this._sFormData;}
else if(method=='POST'){postData=this._sFormData;}
this._sFormData='';}
o.conn.open(method,uri,true);if(this._isFormSubmit||(postData&&this._default_post_header)){this.initHeader('Content-Type','application/x-www-form-urlencoded');if(this._isFormSubmit){this._isFormSubmit=false;}}
if(this._has_http_headers){this.setHeader(o);}
this.handleReadyState(o,callback);postData?o.conn.send(postData):o.conn.send(null);return o;}},handleReadyState:function(o,callback)
{var timeOut=callback.timeout;var oConn=this;try
{if(timeOut!==undefined){this._timeOut[o.tId]=window.setTimeout(function(){oConn.abort(o,callback,true)},timeOut);}
this._poll[o.tId]=window.setInterval(function(){if(o.conn&&o.conn.readyState==4){window.clearInterval(oConn._poll[o.tId]);oConn._poll.splice(o.tId);if(timeOut){oConn._timeOut.splice(o.tId);}
oConn.handleTransactionResponse(o,callback);}},this._polling_interval);}
catch(e)
{window.clearInterval(oConn._poll[o.tId]);oConn._poll.splice(o.tId);if(timeOut){oConn._timeOut.splice(o.tId);}
oConn.handleTransactionResponse(o,callback);}},handleTransactionResponse:function(o,callback,isAbort)
{if(!callback){this.releaseObject(o);return;}
var httpStatus,responseObject;try
{if(o.conn.status!==undefined&&o.conn.status!=0){httpStatus=o.conn.status;}
else{httpStatus=13030;}}
catch(e){httpStatus=13030;}
if(httpStatus>=200&&httpStatus<300){responseObject=this.createResponseObject(o,callback.argument);if(callback.success){if(!callback.scope){callback.success(responseObject);}
else{callback.success.apply(callback.scope,[responseObject]);}}}
else{switch(httpStatus){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:responseObject=this.createExceptionObject(o.tId,callback.argument,isAbort);if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
else{callback.failure.apply(callback.scope,[responseObject]);}}
break;default:responseObject=this.createResponseObject(o,callback.argument);if(callback.failure){if(!callback.scope){callback.failure(responseObject);}
else{callback.failure.apply(callback.scope,[responseObject]);}}}}
this.releaseObject(o);},createResponseObject:function(o,callbackArg)
{var obj={};var headerObj={};try
{var headerStr=o.conn.getAllResponseHeaders();var header=headerStr.split('\n');for(var i=0;i<header.length;i++){var delimitPos=header[i].indexOf(':');if(delimitPos!=-1){headerObj[header[i].substring(0,delimitPos)]=header[i].substring(delimitPos+2);}}}
catch(e){}
obj.tId=o.tId;obj.status=o.conn.status;obj.statusText=o.conn.statusText;obj.getResponseHeader=headerObj;obj.getAllResponseHeaders=headerStr;obj.responseText=o.conn.responseText;obj.responseXML=o.conn.responseXML;if(typeof callbackArg!==undefined){obj.argument=callbackArg;}
return obj;},createExceptionObject:function(tId,callbackArg,isAbort)
{var COMM_CODE=0;var COMM_ERROR='communication failure';var ABORT_CODE=-1;var ABORT_ERROR='transaction aborted';var 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)
{if(this._http_header[label]===undefined){this._http_header[label]=value;}
else{this._http_header[label]=value+","+this._http_header[label];}
this._has_http_headers=true;},setHeader:function(o)
{for(var prop in this._http_header){if(this._http_header.propertyIsEnumerable){o.conn.setRequestHeader(prop,this._http_header[prop]);}}
delete this._http_header;this._http_header={};this._has_http_headers=false;},setForm:function(formId,isUpload,secureUri)
{this._sFormData='';if(typeof formId=='string'){var oForm=(document.getElementById(formId)||document.forms[formId]);}
else if(typeof formId=='object'){var oForm=formId;}
else{return;}
if(isUpload){(typeof secureUri=='string')?this.createFrame(secureUri):this.createFrame();this._isFormSubmit=true;this._isFileUpload=true;this._formNode=oForm;return;}
var oElement,oName,oValue,oDisabled;var hasSubmit=false;for(var i=0;i<oForm.elements.length;i++){oDisabled=oForm.elements[i].disabled;oElement=oForm.elements[i];oName=oForm.elements[i].name;oValue=oForm.elements[i].value;if(!oDisabled&&oName)
{switch(oElement.type)
{case'select-one':case'select-multiple':for(var j=0;j<oElement.options.length;j++){if(oElement.options[j].selected){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oElement.options[j].value||oElement.options[j].text)+'&';}}
break;case'radio':case'checkbox':if(oElement.checked){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';}
break;case'file':case undefined:case'reset':case'button':break;case'submit':if(hasSubmit==false){this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';hasSubmit=true;}
break;default:this._sFormData+=encodeURIComponent(oName)+'='+encodeURIComponent(oValue)+'&';break;}}}
this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);},createFrame:function(secureUri){if(window.ActiveXObject){var io=document.createElement('<IFRAME name="ioFrame" id="ioFrame">');if(secureUri){io.src=secureUri;}}
else{var io=document.createElement('IFRAME');io.id='ioFrame';io.name='ioFrame';}
io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},uploadFile:function(id,callback,uri){this._formNode.action=uri;this._formNode.enctype='multipart/form-data';this._formNode.method='POST';this._formNode.target='ioFrame';this._formNode.submit();this._formNode=null;this._isFileUpload=false;this._isFormSubmit=false;var uploadCallback=function()
{var oResponse={tId:id,responseText:document.getElementById("ioFrame").contentWindow.document.body.innerHTML,argument:callback.argument}
if(callback.upload){if(!callback.scope){callback.upload(oResponse);}
else{callback.upload.apply(callback.scope,[oResponse]);}}
YAHOO.util.Event.removeListener("ioFrame","load",uploadCallback);window.ioFrame.location.replace('#');setTimeout("document.body.removeChild(document.getElementById('ioFrame'))",100);};YAHOO.util.Event.addListener("ioFrame","load",uploadCallback);},abort:function(o,callback,isTimeout)
{if(this.isCallInProgress(o)){window.clearInterval(this._poll[o.tId]);this._poll.splice(o.tId);if(isTimeout){this._timeOut.splice(o.tId);}
o.conn.abort();this.handleTransactionResponse(o,callback,true);return true;}
else{return false;}},isCallInProgress:function(o)
{if(o.conn){return o.conn.readyState!=4&&o.conn.readyState!=0;}
else{return false;}},releaseObject:function(o)
{o.conn=null;o=null;}};
// {{{ Alert Box Library
// {{{ yperLibAlert
function yperLibAlert(alertBox, myStyle)
{
  this.alertBox    = alertBox;
  this.yPos        = this.getYPos();
  this.screenWidth = document.body.offsetWidth;

  if (!this.alertBoxObj)
  {
    this.alertBoxObj = document.getElementById(this.alertBox.id);
  }

  // Assign style properties to an object
  if (this.alertBoxObj.style.setProperty) // For mozilla based browser
  {
    for (key in myStyle)
    {
      this.alertBoxObj.style.setProperty(key, myStyle[key], "");
    }
  }
  else
  {
    for (key in myStyle)
    {
      this.alertBoxObj.style.setAttribute(key, myStyle[key]);
    }
  }

  // set default left postion to center of the browser
  if (!this.alertBoxObj.style.left)
  {
    var tmpWidth = this.getNumber(this.alertBoxObj.style.width);
    this.alertBoxObj.style.left = ((this.screenWidth / 2) - (tmpWidth / 2)) + "px";
  }

  // set default top position 
  var tmpMargin = 0;
  if (this.alertBoxObj.style.marginTop)
  {
    tmpTMargin = this.getNumber(this.alertBoxObj.style.marginTop);
  }
  this.alertBoxObj.style.top = (tmpTMargin + this.yPos) + "px";
}
// }}} yperLibAlert
// {{{ getYPos
yperLibAlert.prototype.getYPos = function()
{
  var pos  = 0;

  if (document.documentElement && document.documentElement.scrollTop)
  {
    pos = document.documentElement.scrollTop;
  }
  else if (window.innerHeight)
  {
    pos = window.pageYOffset;
  }
  else if (document.body)
  {
    pos = document.body.scrollTop;
  }

  return pos;
};
// }}} getYPos 
// {{{ getNumber
yperLibAlert.prototype.getNumber = function()
{
  var myStr = arguments[0];
  myStr = myStr.replace(/px/,"");
  return +myStr; // cast type to integer
};
// }}} getNumber
// {{{ setAlertContentStyle
yperLibAlert.prototype.setAlertContentStyle = function()
{
  this.alertContentStyle = arguments[0] || false;
  return this.alertContentStyle;
};
// }}} setAlertContentStyle
// {{{ setMainContent
yperLibAlert.prototype.setMainContent = function()
{
  var myContent = arguments[0];

  if (!this.alertContentObj)
  {
    this.alertContentObj = document.getElementById(this.alertBox.contentId);
  }

  // Assign style properties to an object
  if (this.alertContentStyle)
  {
    if (this.alertContentObj.style.setProperty) // For mozilla based browser
    {
      for (key in this.alertContentStyle)
      {
        this.alertContentObj.style.setProperty(key, this.alertContentStyle[key], "");
      }
    }
    else
    {
      for (key in this.alertContentStyle)
      {
        this.alertContentObj.style.setAttribute(key, this.alertContentStyle[key]);
      }
    }
  }
  
  if (myContent)
  {
    this.alertContentObj.innerHTML = myContent;
  }
  return true;
};
// }}} setMainContent
// {{{ setAlertContentStyle
yperLibAlert.prototype.setAlertShadowStyle = function()
{
  this.alertShadowStyle = arguments[0] || false;
  return this.alertShadowStyle;
};
// }}} setAlertContentStyle
// {{{ setShadow
yperLibAlert.prototype.setShadow = function()
{
  if (!this.alertShadowObj)
  {
    this.alertShadowObj = document.getElementById(this.alertBox.shadowId);
  }

  // Assign style properties to an object
  if (this.alertShadowStyle)
  {
    if (this.alertShadowObj.style.setProperty) // For mozilla based browser
    {
      for (key in this.alertShadowStyle)
      {
        this.alertShadowObj.style.setProperty(key, this.alertShadowStyle[key], "");
      }
    }
    else
    {
      for (key in this.alertShadowStyle)
      {
        this.alertShadowObj.style.setAttribute(key, this.alertShadowStyle[key]);
      }
    }
  }
  return true;
};
// }}} setShadow
// }}} Alert Box Library

// {{{ general Library
// {{{ yperLibChkAll
// This function will go into library.
function yperLibChkAll()
{
  var chkAllBox    = arguments[0];
  var eachChkBoxId = arguments[1]; // id or some strings prefix of each checkbox to be checked
  var isMultiple   = arguments[2]; // if there are more than one checkall boxes (top and bottom)

  var chkAllBoxId = chkAllBox.getAttribute('id');           // id of the checkall box;
  var myChkBoxes  = document.getElementsByTagName('input'); // all checkbox input 
  var unhideFlag  = (chkAllBox.checked) ? true : false;
  
  var myReg = new RegExp(eachChkBoxId);
  // If there are more than one checkall box, we need to get some prefix strings
  // of the checkall box name and use that to find out which other boxes are the
  // checkall boxes
  if (isMultiple)
  {
    var myReg2  = new RegExp(chkAllBoxId);
  }

  for (var i = 0; i < myChkBoxes.length; i++)
  {
    var myChkBox = myChkBoxes[i];
    var chkBoxId = myChkBox.getAttribute('id'); // get an id of checkbox

    // if a name of the input box is the same as a name of checkbox
    if (myReg.test(chkBoxId))     
    {
      myChkBox.checked = (unhideFlag) ? true : false;
    }

    if (myReg2.test(chkBoxId))
    {
      myChkBox.checked = (unhideFlag) ? true : false;
    }
  }
  return true;
}
// }}} yperLibChkAll

// {{{ yperLibUpdateChkAll
// This function will go into library.
function yperLibUpdateChkAll()
{
  var myObj        = arguments[0];
  var chkAllBoxId  = arguments[1];
  var eachChkBoxId = arguments[2]; // id or some strings prefix of each checkbox to be checked

  var allFlag  = false;
  var chkCtr   = 0;
  var allBoxes = 0;

  var myChkBoxes = document.getElementsByTagName('input'); // all checkbox input 
  var myReg      = new RegExp(eachChkBoxId);
  var myReg2     = new RegExp(chkAllBoxId);

  var chkAllBoxes = [];
  for (var i = 0; i < myChkBoxes.length; i++)
  {
    var myChkBox = myChkBoxes[i];
    var chkBoxId = myChkBox.getAttribute('id'); // get an id of checkbox

    if (myReg.test(chkBoxId))
    {
      allBoxes++;  // count all profile boxes

      if (myChkBox.checked)
      {
        chkCtr++;  // count all checked boxes
      }
    }

    if (myReg2.test(chkBoxId))
    {
      chkAllBoxes.push(myChkBox); // get checkall box object into an array
    }
  } // end for loop

  for (i = 0; i < chkAllBoxes.length; i++)
  {
    chkAllBoxes[i].checked = (allBoxes == chkCtr) ? true : false;
  }
  return true;
}
// }}} yperLibUpdateChkAll

// {{{ yperLibGetYPos
// This function will go into library.
function yperLibGetYPos()
{
  var pos  = 0;

  if (document.documentElement && document.documentElement.scrollTop)
  {
    pos = document.documentElement.scrollTop;
  }
  else if (window.innerHeight)
  {
    pos = window.pageYOffset;
  }
  else if (document.body)
  {
    pos = document.body.scrollTop;
  }

  return pos;
}
// }}} yperLibGetYPos

// {{{ yperLibGetChkedBoxId
// This function will go into library.
function yperLibGetChkedBoxId()
{
  var eachChkBoxId = arguments[0]; // id or some strings prefix of each checkbox to be checked

  var chkedBoxes = [];
  var myChkBoxes = document.getElementsByTagName('input');  // all checkbox input 
  var myReg      = new RegExp(eachChkBoxId);

  for (var i = 0; i < myChkBoxes.length; i++)
  {
    var myChkBox = myChkBoxes[i];
    var chkBoxId = myChkBox.getAttribute('id'); // get an id of checkbox

    if (myReg.test(chkBoxId))       // if an id of the input box is similar to what we are looking for
    {
      if (myChkBox.checked)
      {
        chkedBoxes.push(chkBoxId);  // If a box is checked, get the id and add to array
      }
    }
  } // end for loop
  return chkedBoxes;
}
// }}} yperLibGetChkedBoxId

// {{{ yperLibEnable
function yperLibEnable()
{
  var myObj            = arguments[0];
  var enableFlag       = arguments[1];
  var disableClassName = arguments[2];
  var myParentId       = arguments[3];

  if (myObj.tagName && (myObj.tagName != "!") && (myObj.tagName != "undefined"))
  {
    if (myObj.attributes.length > 0)
    {
      if (myObj.getAttribute('id') == myParentId) // Highlight main content
      {
        yperLibEnableManageClass(myObj, enableFlag, disableClassName);
      } // end highlight or un-highlight main content

      if (myObj.getAttribute('id') == "yperLayoutPolicy") // Highlight policy 
      {
        if (myObj.tagName == "DIV")
        {
          yperLibEnableManageClass(myObj, enableFlag, disableClassName);
        }
      }
    } // end if this tag has any attribute

    if ((myObj.tagName == "INPUT") || (myObj.tagName == "SELECT"))
    {
      myObj.disabled = (enableFlag) ? false : true;

      if (!enableFlag && (myObj.tagName == "SELECT"))
      {
        myObj.style.visibility = "hidden";
      }
      else
      {
        myObj.style.visibility = "visible";
      }
    }

    if (myObj.tagName == "IMG")
    {
      if (!enableFlag)
      {
        myObj.style.filter = "Alpha(Opacity=50, FinishOpacity=0, Style=1, StartX=100, StartY=100, FinishX=100, FinishY=100)";
        myObj.style.opacity = "0.5"; // mozilla
      }
      else
      {
        myObj.style.filter = "none";
        myObj.style.opacity = "1"; // mozilla
      }
    }

    if (myObj.tagName == "A")
    {
      if (!enableFlag)
      {
        myObj.onclick = function()
        {
          return false;
        };
        myObj.style.cursor = "default";
      }
      else
      {
        myObj.onclick = function()
        {
          return true;
        };
        myObj.style.cursor = "pointer";
      }
      yperLibEnableManageClass(myObj, enableFlag, disableClassName);
    }

    if ((myObj.tagName == "EM") || (myObj.tagName == "STRONG") || (myObj.tagName == "SPAN"))
    {
      yperLibEnableManageClass(myObj, enableFlag, disableClassName);
    }
  } // end if it is a tag

  if(myObj.childNodes && myObj.childNodes.length > 0)
  {
    for(var i = 0; i < myObj.childNodes.length; i++)
    {
      yperLibEnable(myObj.childNodes[i], enableFlag, disableClassName, myParentId);
    }
  }
  return true;
}

function yperLibEnableManageClass()
{
  var myObj            = arguments[0];
  var enableFlag       = arguments[1];
  var disableClassName = arguments[2];

  if (enableFlag)
  {
    if (myObj.className == disableClassName)
    {
      myObj.className = "";
    }
    else
    {
      // Split all classes assigned to this object
      // and exclude the disable class
      var classes = myObj.className.split(" ");

      myObj.className = "";  // Reset classname

      for (var i = 0; i < classes.length; i++)
      {
        // Need to add hack class != yperYahoo since it is in the masthead
        // for some reasons.
        if (classes[i] != disableClassName)
        {
          myObj.className += " " + classes[i];
        }
      } // end for loop
    } // end if else to enable the object
  }
  else
  {
    if (myObj.className !== "")
    {
      myObj.className += " " + disableClassName;
    }
    else
    {
      myObj.className = disableClassName;
    }
  }
}
// }}} yperLibEnable

// {{{ yperLibGetNumber
function yperLibGetNumber()
{
  var myStr = arguments[0];
  myStr = myStr.replace(/px/,"");
  return +myStr; // cast type to integer
}
// }}} yperLibGetNumber

// {{{ yperLibGetInnerHtml
function yperLibGetInnerHtml()
{
  var myId  = arguments[0];
  var myObj = document.getElementById(myId);

  return (myObj) ? myObj.innerHTML : false;
}
// }}} yperLibGetGetInnerHtml

// {{{ yperLibContainsDom
function yperLibContainsDom(container, containee)
{
  var isParent = false;
  do
  {
    if ((isParent = container == containee))
    {
      break;
    }
    containee = containee.parentNode;
  } while(containee !== null);

  return isParent;
} // }}}

// {{{ yperLibChkMouseIn
function yperLibChkMouseIn(element, evt)
{
  if (element.contains && evt.fromElement)
  {
    return !element.contains(evt.fromElement);
  }
  else if (evt.relatedTarget)
  {
    return !yperLibContainsDom(element, evt.relatedTarget);
  }
} // }}}

// {{{ yperLibChkMouseOut
function yperLibChkMouseOut(element, evt)
{
  if (element.contains && evt.toElement)
  {
    return !element.contains(evt.toElement);
  }
  else if (evt.relatedTarget)
  {
    return !yperLibContainsDom(element, evt.relatedTarget);
  }
} // }}}

// {{{ yperLibUncheckSingle
function yperLibUncheckSingle(formname,field)
{
  var aCheckBoxes = formname.elements[field];
  if (aCheckBoxes.length != -1)
  {
    for (i = 0; i < aCheckBoxes.length; i++)
    {
      if (aCheckBoxes[i].value != 9)
      {
        aCheckBoxes[i].checked = false ;
      }
      aCheckBoxes.checked = false;
    }
  }
} // }}}

// {{{ yperLibUncheckAll
function yperLibUncheckAll(obj,field,sChkBox,formName)
{
  var aCheckBoxes = formName.elements[field];
  if (aCheckBoxes.length != -1)
  {
    for (i = 0; i < aCheckBoxes.length; i++)
    {
      aCheckBoxes[i].checked = false ;
    }
  }
} // }}}

// {{{ yperLibUpdateInputSameStr
function yperLibUpdateInputSameStr()
{
  var origin = arguments[0];        // element of input box
  var id     = arguments[1];        // id of the box to be updated

  var target = document.getElementById(id);

  target.value = origin.value;

  return true;
} // }}}
// }}} general Library

// {{{ yperLibMenu
// Example:
//    var myMenu = new yperLibMenu("dashboardMenu", "selectedMenu");
//
// {{{ yperLibMenu Constructor
//-------------------------------------------------------------------------------------------------
// Constructor
// @param menuId id to a ul tag
// @param selectedClass the class to change to when selected
//-------------------------------------------------------------------------------------------------
function yperLibMenu()
{
  this.menuId            = arguments[0];
  this.menuSelectedClass = arguments[1];

  if (this.menuId !== "")
  {
    this.menuObj = document.getElementById(this.menuId);

    if (!this.menuObj) // Could not create an object
    {
      return false;    // return false
    }
  }

  var menuSelected = false;         // check if any option selected

  //***********************************************************************
  // Member variables
  //***********************************************************************
  this.menuOptions         = 0;
  this.menuOptionsObjArray = [];
  this.activeMenuIndex     = null;
  //***********************************************************************

  // Find out how many options are there for this menu
  var myLen = this.menuObj.childNodes.length;
  for (var i = 0; i < myLen; i++)
  {
    var myItem     = this.menuObj.childNodes.item(i);
    var myItemName = myItem.nodeName;
    if (myItemName  == "LI")
    {
      this.menuOptionsObjArray[this.menuOptions] = myItem;
      this.menuOptions++;
    }
  } // end for loop


  var self = this; //the 'this' inside of a mouseevent takes from the caller, not this object
                   //thus we need 'self' to use to call this

  var myOptionLen = this.menuOptionsObjArray.length;
  for (i = 0; i < myOptionLen; i++)
  {
    var myLiObj = this.menuOptionsObjArray[i];
    // When mouse is over LI node
    myLiObj.onmouseover = function() {};

    // When mouse is out of LI node
    myLiObj.onmouseout = function() {};

    myLiObj.onclick = function()
    {
      self.activateMenu(this);
    };

    // Find the 'set by default menu'
    if (myLiObj.className.indexOf(this.menuSelectedClass) != -1)
    {
      menuSelected = true;
      this.activeMenuIndex = i;
    }
  } // end for loop

  // if no menu has been selected, highlight menu 0 by default
  if (!menuSelected)
  {
    this.activeMenuIndex = 0;
    this.activateMenu(this.menuOptionsObjArray[0]); // activate the default menu
  }
}
// }}}
// {{{ activateMenu
//-------------------------------------------------------------------------------------------------
// activateMenu
// Make the selectin visible and hide the previous one if there is any
//-------------------------------------------------------------------------------------------------
// Sections that are activated are the menu name class + "_contnet"
yperLibMenu.prototype.activateMenu = function()
{
  var myObj = arguments[0];   // Active menu (LI node)

  this.menuOptionsObjArray[this.activeMenuIndex].className =
    this.menuOptionsObjArray[this.activeMenuIndex].className.replace(this.menuSelectedClass, "");
      
  var myPrevMenu = document.getElementById(this.menuOptionsObjArray[this.activeMenuIndex].id + "_content");
  myPrevMenu.style.display = "none";

  // Determine which menu is selected
  for (var i = 0; i < this.menuOptionsObjArray.length; i++)
  {
    if (myObj.id == this.menuOptionsObjArray[i].id)
    {
      this.activeMenuIndex = i;
      break;
    }
  }

  myObj.className = this.menuSelectedClass;
    
  var myActiveMenu = document.getElementById(myObj.id + "_content");
  myActiveMenu.style.display = "block";
};
// }}}
// }}} yperLib Li Menu

/* IMV callback function {{{
 *
 */
var sendIMVCallback = 
function yperLibSendIMVCallBack(o, tID, redirUrl)
{
  if(o.readyState == 4)
  {
    response = o.responseXML.documentElement;
    redir_url = response.getElementsByTagName('redirURL')[0].firstChild.data;
    if (redir_url != "none")
    {
      top.location.href = redir_url;
    }
    else
    {
      if ( navigator.appVersion >= "4")
      {
        if (navigator.appName =="Netscape")
        {
          nav4=true;
        }
        else if (navigator.appName =="Microsoft Internet Explorer")
        {
          ie4=true;
        }
      }

      senderAlias = response.getElementsByTagName('senderalias')[0].firstChild.data;
      receiverAlias = response.getElementsByTagName('receiveralias')[0].firstChild.data;

      if(YMsgrV5 && ie4)
      {
        if (redirUrl)
        {
          //top.location.href = redirUrl;
        }
        duet = response.getElementsByTagName('duet')[0].firstChild.data;
        intl = response.getElementsByTagName('intl')[0].firstChild.data;
        site = response.getElementsByTagName('site')[0].firstChild.data;
        
        top.location.href='ymsgr:im?sendas='+senderAlias+'&to='+receiverAlias+'&imv='+intl+'connect&arg=server:"'+intl+'.personals.yahoo.com",duet:"'+duet+'",intl:"'+intl+'",site:"'+site+'"';
      }
      else
      {
        top.location.href = "http://edit.yahoo.com/config/send_webmesg?.src=&.target="+alias;
      }
    }
  }
};

/*
 * Handle the IM action
 */
function yperLibSendIMV(serverName, adid, crumb, redirUrl, loginUrl)
{
  if (loginUrl) {
    top.location.href = loginUrl;
  }

  var obj = ygConn.getObject();
  var requestUri = serverName + '/ajax/launch_im?adid=' + adid + '&crumb=' + crumb;
  ygConn.http.asyncRequest(obj,'GET',requestUri,true,sendIMVCallback, redirUrl, null);
} // }}}

// {{{ Javascript Functions for Search and Communication Preference
// {{{ yperLibCommCheckPref
// Add the yperLibCommCheckPref() to be the second parameter of the pers_fe_get_startPageHTML().
// It will call the javascript onload function in the body tag.
//  eg.pers_fe_get_startPageHTML('postad/postad.css', 'yperLibCommCheckPref()');
function yperLibCommCheckPref()
{
  var comm1Obj = document.getElementById('yperComm1');
  var comm2Obj = document.getElementById('yperComm2');

  // Check if we should display alias preference
  if (comm1Obj && comm2Obj)
  {
    if (comm1Obj.checked && !comm2Obj.checked)
    {
      yperLibCommShowAliasPref(false);
    }
    else if (!comm1Obj.checked && comm2Obj.checked)
    {
      yperLibCommShowAliasPref(true);
    }
  }

  // Check if we should display alias warning
  yperLibCommShowAliasWarning();

  return true;
} // }}}

// {{{ yperLibCommShowAliasPref
function yperLibCommShowAliasPref()
{
  var show = arguments[0];

  var aliasPrefObj = document.getElementById('yperCommAliasPref');

  if (!show)
  {
    aliasPrefObj.style.display    = "none";
    aliasPrefObj.style.visibility = "hidden";
  }
  else
  {
    aliasPrefObj.style.display    = "block";
    aliasPrefObj.style.visibility = "visible";
  }
  return true;
} // }}}

// {{{ yperLibCommShowAliasWarning
function yperLibCommShowAliasWarning()
{
  var nicknameRadioObj    = document.getElementById('yper-1');
  var nicknameInputObj    = document.getElementById('yperCommNickname');
  var aliasWarningObj     = document.getElementById('yperCommAliasWarning');
  var aliasCheckButtonObj = document.getElementById('yperCommAliasCheck');

  // Hide all response messages
  var checkObj  = document.getElementById('yperCommNicknameChecking');
  var avaiObj   = document.getElementById('yperCommNicknameAvailable');
  var unavaiObj = document.getElementById('yperCommNicknameUnavailable');

  yperLibIsVisible(false, checkObj);
  yperLibIsVisible(false, avaiObj);
  yperLibIsVisible(false, unavaiObj);

  if (nicknameRadioObj)
  {
    if (!nicknameRadioObj.checked)
    {
      yperLibIsVisible(false, aliasWarningObj);
      yperLibIsVisible(false, aliasCheckButtonObj);
    }
    else
    {
      yperLibIsVisible(true, aliasWarningObj);
      yperLibIsVisible(true, aliasCheckButtonObj, "inline");
    }
  }
  return true;
} // }}}

// {{{ yperLibCommShowAliasWarning2
function yperLibCommShowAliasWarning2()
{
  var nicknameRadioObj    = document.getElementById('yper-1');
  var nicknameInputObj    = document.getElementById('yperCommNickname');
  var aliasWarningObj     = document.getElementById('yperCommAliasWarning');
  var aliasCheckButtonObj = document.getElementById('yperCommAliasCheck');

  // Hide all response messages
  var checkObj  = document.getElementById('yperCommNicknameChecking');
  var avaiObj   = document.getElementById('yperCommNicknameAvailable');
  var unavaiObj = document.getElementById('yperCommNicknameUnavailable');

  yperLibIsVisible(false, checkObj);
  yperLibIsVisible(false, avaiObj);
  yperLibIsVisible(false, unavaiObj);

  if (nicknameInputObj.value === '')
  {
    yperLibIsVisible(false, aliasWarningObj);
    yperLibIsVisible(false, aliasCheckButtonObj);
  }
  else
  {
    nicknameRadioObj.checked = true;

    yperLibIsVisible(true, aliasWarningObj);
    yperLibIsVisible(true, aliasCheckButtonObj, "inline");
  }
  return true;
} // }}}

// {{{ yperLibCommCheckNicknameBox
function yperLibCommCheckNicknameBox()
{
  var nicknameRadioObj    = document.getElementById('yper-1');
  var aliasCheckButtonObj = document.getElementById('yperCommAliasCheck');

  nicknameRadioObj.checked = true;
  yperLibIsVisible(true, aliasCheckButtonObj, "inline");

  return true;
} // }}}

// {{{ yperLibCommCheckAliasAvailability
function yperLibCommCheckAliasAvailability()
{
  var uri = arguments[0];

  var checkButtonObj   = document.getElementById('yperCommAliasCheck');
  var nicknameInputObj = document.getElementById('yperCommNickname');
  var unavaiObj        = document.getElementById('yperCommNicknameUnavailable');
  
  // Validate nickname
  // var validChar = /^[a-zA-Z][a-zA-Z_0-9]+/;
  var validChar = /(^[a-zA-Z])([a-zA-Z_0-9]+)$/;
  var reg = new RegExp(validChar);

  if (reg.test(nicknameInputObj.value))
  {
    uri += '?new_alias=' + nicknameInputObj.value;
    var obj = ygConn.getObject();
    ygConn.http.asyncRequest(obj, 'GET', uri, true, yperCheckAliasResponse, nicknameInputObj, null);

    return true;
  } 
  else
  {
    // Hide button
    yperLibIsVisible(false, checkButtonObj);
    yperLibIsVisible(true, unavaiObj, "inline");

    // if it is invalid, we stay in the input box
    nicknameInputObj.select();
    return false;
  }
} // }}}

// {{{ yperLibGetXmlNodeData
function yperLibGetXmlNodeData()
{
  var xmlDoc = arguments[0];
  var myNode = arguments[1];
  var myData = '';
 
  var reg = new RegExp(myNode);

  if (xmlDoc.childNodes.length > 0)
  {
    for (i = 0; i < xmlDoc.childNodes.length; i++)
    {
      var xmlNode = xmlDoc.childNodes[i].nodeName;
  
      if (reg.test(xmlNode))
      {
        myData = xmlDoc.childNodes[i].firstChild.data;
        return myData; 
      }
      else
      {
        myData = yperLibGetXmlNodeData(xmlDoc.childNodes[i], myNode);
      }
      if (myData)
      {
        break;
      }
    }
  }  
 
  return myData;
} // }}} yperLibGetXmlNodeData

// {{{ yperLibCommCheckAliasResponse
// Callback function for yperLibCommCheckAliasAvailability
var yperCheckAliasResponse =
function yperLibCommCheckAliasResponse()
{
  var obj = arguments[0];      // object itself
  var tID = arguments[1];      // transaction id

  var myResponse = false;

  var checkButtonObj   = document.getElementById('yperCommAliasCheck');
  var nicknameInputObj = document.getElementById('yperCommNickname');

  // Response messages
  var checkObj  = document.getElementById('yperCommNicknameChecking');
  var avaiObj   = document.getElementById('yperCommNicknameAvailable');
  var unavaiObj = document.getElementById('yperCommNicknameUnavailable');

  // Hide button
  yperLibIsVisible(false, checkButtonObj);

  switch (obj.readyState)
  {
    case 4: // complete
      // numeric code returned by server
      if (obj.status == 200)  // 200 is for OK
      {
        var myXML = obj.responseXML;
        if (myXML)
        {
          // myResponse = myXML.childNodes[0].childNodes[0].firstChild.data;
           myResponse = yperLibGetXmlNodeData(myXML, "result");
          
          if (myResponse == 'true')
          {
            yperLibIsVisible(true, avaiObj, "inline");
          }
          else
          {
            yperLibIsVisible(true, unavaiObj, "inline");
          }
        }
      }
      else
      {
        yperLibIsVisible(true, unavaiObj, "inline");
        nicknameInputObj.select();
      }
    break;

    case 1: // loading
      yperLibIsVisible(true, checkObj, "inline");
    break;

    case 2: // loaded
    break;

    case 3: // interactive
    break;

    default: // uninitialized
      yperLibIsVisible(true, unavaiObj, "inline");
      nicknameInputObj.select();
    break;
  }
}; // }}}

// {{{ yperLibIsVisible
function yperLibIsVisible()
{
  var show = arguments[0]; // true of false
  var obj  = arguments[1]; // object to hide or unhide
  var disp = arguments[2]; // it is a block or inline

  if (obj)
  {
    if (show)
    {
      if (!disp || (disp === ""))
      {
        disp = "block";
      }

      obj.style.display = disp;
      obj.style.visible = "visible";
    }
    else
    {
      obj.style.display = "none";
      obj.style.visible = "hidden";
    }
    return true;
  }
  else
  {
    return false;
  }
} // }}}
// }}}

// {{{ JavaScript Functions for Modal Dialog Box
// {{{ yperLibScreening
// Put screening on top of html page and disable form elements
// Usage: An empty div tag with id needs to be in the html page
//        that needs to be screened and disable for modal dialog
//        CSS class - .yperLayoutScreen needs to be defined.
// e.g. <div id="screen"></div>
//.yperLayoutScreen {
//  top: 0;
//  left: 0;
//  display: block;
//  position: absolute;
//  background: #ccc;
//  opacity: 0.5;
//  filter:Alpha(Opacity=50, FinishOpacity=0, Style=1, StartX=100, StartY=100, FinishX=100, FinishY=100)
//}
// @param - id of div tag to be used as screen
// @param - flag to set on or off [true|false]
// @param - color to be used [optional]
function yperLibScreening()
{
  var myId   = arguments[0];
  var isOn   = arguments[1];
  var colour = arguments[2];

  if (typeof(isOn) == 'undefined') // set default value to true
  {
    isOn = true;
  }

  var tagArray = ['input','select']; // tags to be manipulated
  var myObj    = document.getElementById(myId);

  if (isOn)
  {
    myObj.className += ' yperLayoutScreen';

    myObj.style.width  = '100%';

    if (document.body.scrollHeight)
    {
      myObj.style.height = document.body.scrollHeight + 'px';
    }

    if (document.height) // for firefox
    {
      myObj.style.height = document.documentElement.offsetHeight +'px';
    }

    if (typeof(colour) != 'undefined') // if colour is specified
    {
      myObj.style.backgroundColor = colour;
    }

    myObj.style.visibility = 'visible';
    myObj.style.display    = 'block';
    yperLibTraverse(document.getElementById('yperLayout1'), tagArray, true); //disable tags 
  }
  else
  {
    var classes = myObj.className.split(' ');
    myObj.className = '';     // reset classname

    for (var i = 0; i < classes.length; i++)
    {
      if (classes[i] != 'yperLayoutScreen')
      {
        myObj.className += ' ' + classes[i];
      }
    }
    myObj.style.display    = 'none';
    myObj.style.visibility = 'hidden';
    yperLibTraverse(document.getElementById('yperLayout1'), tagArray, false); //enable tags 
  }
  return true;
} // }}}

// {{{ yperLibTraverse
// Recursive function to traverse HTML elements
// @param - top html node
// @param - array of nodeName to be manipulated
// @param - disable flag [false|true]
function yperLibTraverse()
{
  var top       = arguments[0];
  var nodeArray = arguments[1];
  var isDisable = arguments[2]; 

  var sizeOfArray   = nodeArray.length;
  var ttlChildNodes = top.childNodes.length;

  if (typeof(isDisable) == 'undefined')// set default value to false
  {
    isDisable = false;
  }

  for (var i = 0; i < ttlChildNodes; i++)
  {
    var myNodeObj  = top.childNodes[i];
    var myNodeName = myNodeObj.nodeName.toLowerCase();

    for (var j = 0; j < sizeOfArray; j++)
    {
      if (nodeArray[j] == myNodeName)
      {
        myNodeObj.style.visibility = (isDisable) ? 'hidden' : 'visible';
      }
    }
    yperLibTraverse(myNodeObj, nodeArray, isDisable);
  }
  return true;
} // }}}

//  {{{  yperLibModalBox
// {{{ main/
function yperLibModalBox()
{
  this.modalId     = arguments[0];
  this.modalWidth  = arguments[1];
  this.modalClass  = arguments[2];
  if (!this.modalClass)
  {
    this.modalClass = 'yperLayoutModalBox';
  }
  
  this.screenWidth = document.body.offsetWidth;
  this.yPos        = this.getYPos();
  this.modalObj    = document.getElementById(this.modalId); // create obj
 
  this.modalObj.className        = this.modalClass;
  this.modalObj.style.display    = 'block';
  this.modalObj.style.visibility = 'visible';

  // set default left postion to center of the browser
  if (!this.modalObj.style.left)
  {
    this.modalObj.style.left = ((this.screenWidth / 2) - (this.modalWidth / 2)) + 'px';
  }

  // set default top position
  if (!this.modalObj.style.marginTop)
  {
    var tmpTMargin = this.dropPx(this.modalObj.style.marginTop);
  }
  this.modalObj.style.top = (tmpTMargin + this.yPos) + 'px';
} // }}}
// {{{ getYPos
yperLibModalBox.prototype.getYPos = function()
{
  var pos = 0;
  if (document.documentElement && document.documentElement.scrollTop)
  {
    pos = document.documentElement.scrollTop;
  }
  else if (window.innerHeight)
  {
    pos = window.pageYOffset;
  }
  else if (document.body)
  {
    pos = document.body.scrollTop;
  }

  return pos;
}; // }}}
// {{{ dropPx
yperLibModalBox.prototype.dropPx = function()
{
  var str = arguments[0];

  str = str.replace(/px/, '');
  return +str; // cast type to be integer
};
// }}}
// {{{ setContent
yperLibModalBox.prototype.setContent = function()
{
  var content = arguments[0];
  var contentClass = arguments[1];
  if (!contentClass)
  {
    contentClass = 'yperLayoutModalBoxContent';
  }
  
  if (content)
  {
    var contentObj = document.getElementById(this.modalId +'Content');
    contentObj.className = contentClass;

    var msgObj = document.getElementById(this.modalId +'Msg');
    msgObj.className = 'yperLayoutModalBoxMsg';
    msgObj.innerHTML = content;
  }

  return true;
}; // }}}
// {{{ setShadow
yperLibModalBox.prototype.setShadow = function()
{
  var shadowClass  = arguments[0];
  var shadowObj    = document.getElementById(this.modalId +'Shadow');
  if (!shadowClass)
  {
    shadowClass = 'yperLayoutModalBoxShadow';
  }

  shadowObj.className = shadowClass;
  return true;
}; // }}}
// {{{ getContent
yperLibModalBox.prototype.getContent = function()
{
    var msgObj = document.getElementById(this.modalId +'Msg');
    var msgContent = msgObj.innerHTML;
    return msgContent;
};
// }}}
// {{{ setPosition
yperLibModalBox.prototype.setPosition= function()
{
  this.yPos = this.getYPos();
  // set default top position
  var tmpTMargin = this.dropPx(this.modalObj.style.marginTop);
  this.modalObj.style.top = (tmpTMargin + this.yPos) + 'px';

  // set left postion to center of the browser
  this.modalObj.style.left = ((this.screenWidth / 2) - (this.modalWidth / 2)) + 'px';

  return true;
};
// }}}
// {{{ closeBox 
yperLibModalBox.prototype.closeBox = function()
{
  this.modalObj.style.display    = 'none';
  this.modalObj.style.visibility = 'hidden';

  return true;
}; // }}}
// }}}
// }}} JavaScript Functions for Modal Dialog Box

/**************************** {{{ Legacy JavaScript ******************************/
var yg_frameable=0;
if(yg_frameable&&(top.location!=self.location))
{
  top.location=self.location;
}

if(document.layers)
{
	yg_onResizeNS4.w=innerWidth;yg_onResizeNS4.h=innerHeight;
	if(document.embeds.length>0)
  {
    setInterval('yg_onResize()',200);
  }
	else
  {
    onresize=yg_onResizeNS4;
  }
}
else if((navigator.userAgent.indexOf("Mac")!=-1)&&(document.all))
{
	onresize=yg_onResizeMacIE;
}
else
{
//	onresize=init;
//	if(document.getElementById&&!document.all)onresize=init;
//	else onresize=yg_onResizeNS6;
}
function yg_onResizeNS4(){
	if(w!=innerWidth||h!=innerHeight){location.reload();}
}
function yg_onResizeMacIE(){
	location.reload();
}
function yg_onResizeNS6(){
	location.reload();
}

function yg_back(){
	history.back();
}
function yg_print(){
	if(print){print();return 1;}else{return 0;}
}
function yg_bookmark(){
	if(window.external){external.AddFavorite(location.href,document.title);return 1;}else{return 0;}
}

function yg_popup(u,n,w,h,k){
	var a=[],o=null,r=arguments;
	a[0]="width="+w+",height="+h;
	a[1]=",scrollbars="+((k&1)?1:0);
	a[2]=",resizable="+((k&2)?1:0);
	a[3]=",toolbar="+((k&4)?1:0);
	a[4]=",status="+((k&8)?1:0);
	a[5]=",location="+((k&16)?1:0);
	a[6]=",menubar="+((k&32)?1:0);
	if(r.length>=6){a[7]=(document.layers)?",screenX="+r[5]:",left="+r[5];}
	if(r.length>=7){a[8]=(document.layers)?",screenY="+r[6]:",top="+r[6];}
	a=a.join("");o=open(u,n,a);if(o){o.focus();}
	return o;
}

if(!Array.prototype.pop){
	function yg_arrayPop(){
		var a=this[this.length-1];
		this.length=Math.max(this.length-1,0);
		return a;
	}
	Array.prototype.pop=yg_arrayPop;
}

if(Array.prototype.push&&([0].push(true)===true)){Array.prototype.push=null;}
if(!Array.prototype.push){
	function yg_arrayPush(){
		for(var i=0;i<arguments.length;i++){this[this.length]=arguments[i];}
		return this.length;
	}
	Array.prototype.push=yg_arrayPush;
}

if(!Array.prototype.shift){
	function yg_arrayShift(){
		var a=this[0];
		this.reverse();
		this.length=Math.max(this.length-1,0);
		this.reverse();
		return a;
	}
	Array.prototype.shift=yg_arrayShift;
}

if(Array.prototype.splice&&typeof([0].splice(0))=="number"){Array.prototype.splice=null;}
if(!Array.prototype.splice){
	function yg_arraySplice(n,s){
		if(arguments.length===0){return n;}
		if(typeof n!="number"){n=0;}
		if(n<0){n=Math.max(0,this.length+n);}
		if(n>this.length){
			if(arguments.length>2){n=this.length;}
			else{return [];}
		}
		if(arguments.length<2){s=this.length-n;}
		s=(typeof s=="number")?Math.max(0,s):0;
		var a=this.slice(n,n+s);
		var b=this.slice(n+s);
		this.length=n;
		for(var i=2;i<arguments.length;i++){this[this.length]=arguments[i];}
		for(i=0;i<b.length;i++){this[this.length]=b[i];}
		return a;
	}
	Array.prototype.splice=yg_arraySplice;
}

if((!Array.prototype.unshift)||document.all){
	function yg_arrayUnshift(){
		this.reverse();
		for(var i=arguments.length-1;i>=0;i--){this[this.length]=arguments[i];}
		this.reverse();
		return this.length;
	}
	Array.prototype.unshift=yg_arrayUnshift;
}
/********************* }}} *******************/

/* {{{ yper.js */
// {{{ setAndSubmitForm()
function setAndSubmitForm( formName, fieldToSet, valueToSet )
{
  theForm = document.forms[formName];
  theForm.elements[fieldToSet].value = valueToSet;
  theForm.submit();
} // }}}

// {{{ yperSetVarsAndSubmitForm()
// This function will be used to set multiple variables in the form,
// since function setAndSubmitForm() above could not handle multiple variables.
// see example in change location in ILE.
// 
function yperSetVarsAndSubmitForm()
{
  var formName = arguments[0];
  var toBeSet  = arguments[1];  // hash of variables to be set

  if (!formName) { return false; }
  if (!toBeSet) { return false; }

  var myForm = document.forms[formName];

  for (var varName in toBeSet)
  {
    myForm.elements[varName].value = toBeSet[varName];
  }

  myForm.submit();
} // }}}

// {{{ updateRelTestRadioButton()
function updateRelTestRadioButton(use_compat, seeker_wt)
{
  if (use_compat.checked)
  {
    seeker_wt[1].checked = true;
  }
  else
  {
    for (i = 0; i < seeker_wt.length; i++)
    {
      seeker_wt[i].checked = false;
    }
  }
} // }}}

// {{{ checkRelTestCheckBox()
function checkRelTestCheckBox(use_compat, yesFit, noFit)
{
  use_compat.checked = true;
  yperILEToggleText(use_compat.checked, 'use_compat', yesFit, noFit);
} // }}}

// {{{ ypers_redirect()
function ypers_redirect(s) {
  window.location = s;
} // }}}
	
function textCounter(field, maxlimit) {
  if (field.value.length >= maxlimit)
  {
    field.value = field.value.substring(0, maxlimit); 
  }
}
	
// {{{ textCounterUpdate
function textCounterUpdate(fieldName, maxlimit) 
{
  field = document.getElementById(fieldName+'_txt');
  txt_field = document.getElementById(fieldName+'_char_count');
  txt_field.innerText = field.value.length;
  txt_field.innerHTML = field.value.length;
  if (field.value.length >= maxlimit) 
  {
    field.value = field.value.substring(0, maxlimit);
  }
} // }}}

// {{{ uncheckSingle
function uncheckSingle(formname,field) 
{ 
  var aCheckBoxes = formname.elements[field]; 
  if (aCheckBoxes.length != -1) 
  {
    for (i = 0; i < aCheckBoxes.length; i++) 
    {
      if (aCheckBoxes[i].value != 9) 
      {
        aCheckBoxes[i].checked = false ; 
      }
    }
  }
} // }}}

// {{{ uncheckAll
function uncheckAll(obj,field,sChkBox,formName) 
{ 
  var aCheckBoxes = formName.elements[field]; 
  if (aCheckBoxes.length != -1) 
  {
    for (i = 0; i < aCheckBoxes.length; i++) 
    {
      aCheckBoxes[i].checked = false ; 
    }
  }

  checkAnyState(obj,sChkBox,formName); 
} // }}}

// {{{ checkAnyState
function checkAnyState(obj,sChkBox,formName) 
{ 
  var sInput = eval("formName."+sChkBox); 
  if (sInput.type == 'checkbox') 
  { 
    if (sChkBox.indexOf('[0]')) 
    { 
      if (obj.checked) 
      {
        sInput.checked = false; 
      }
    } 
    else 
    { 
      if (obj[0].checked) 
      {
        sInput.checked = false; 
      }
    } 
  } 
} // }}}

// {{{ yper_priCheck
function yper_priCheck(obj) {

 if(obj.checked){yper_count++;}
  else{
    if(!obj.checked)
    {
      yper_count--;
    }
 }

 //alert("count: "+yper_count);

 if(yper_count > 6){
  document.getElementById("yperPostad2WarningMsg").style.display = "block";
 } else {
  document.getElementById("yperPostad2WarningMsg").style.display = "none";
 }

} // }}}

  var browser_string = navigator.appVersion + " " + navigator.userAgent;
  var YMsgrV5 = false;
  if (browser_string.indexOf("MSIE") < 0) {
    if (navigator.mimeTypes) {
      for (i = 0 ; i < navigator.mimeTypes.length ; i++) {
	if (navigator.mimeTypes[i].suffixes.indexOf("yps") > -1) {
		YMsgrV5 = true;
	}
      }
    }
  } else {
    if (browser_string.indexOf("Windows")>=0) {
	YMsgrV5=true;
	document.write('<object classid="clsid:41695A8E-6414-11D4-8FB3-00D0B7730277" CODEBASE="javascript:YMsgrV5=false;" width="1" height="1" style="visibility:hidden"></object>');
    }
  }

  var ie4 = false;
  var nav4 = false;

// {{{ SendIMV
function SendIMV(yid,duet,intl,site){
  if ( navigator.appVersion >= "4") {
     if (navigator.appName =="Netscape") {
	 nav4=true;
     }
     else if (navigator.appName =="Microsoft Internet Explorer") {
	 ie4=true;
     }
  }

     if(YMsgrV5 && ie4) {
	top.location.href='ymsgr:im?to='+yid+'&imv='+intl+'connect&arg=server:"'+intl+'.personals.yahoo.com",duet:"'+duet+'",intl:"'+intl+'",site:"'+site+'"';
     }
     else {
	top.location.href="http://edit.yahoo.com/config/send_webmesg?.src=&.target="+yid;
     }
} // }}}

// {{{ displayAbuseMenu
function displayAbuseMenu(){
  if (document.getElementById("yperPreviewAbuseMenu").style.display == "block"){
    document.getElementById("yperPreviewAbuseMenu").style.display = "none";
  } else {
    document.getElementById("yperPreviewAbuseMenu").style.display = "block";
  }
} // }}}

// {{{ closeActiveAbuseMenu
function closeActiveAbuseMenu(){
  if (document.getElementById("yperPreviewAbuseMenu").style.display == "block"){
    the_timeout = setTimeout("displayAbuseMenu()",500);
  }
} // }}}

// {{{ captureActiveAbuseMenu
function captureActiveAbuseMenu(){
  if (document.getElementById("yperPreviewAbuseMenu").style.display == "block"){
    clearTimeout(the_timeout);
  }
} // }}}
/* }}} end of yper.js */

