/*                                                                                                                                                      Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    Code licensed under the BSD License:                                                                                                                    http://developer.yahoo.net/yui/license.txt                                                                                                              version: 0.11.0                                                                                                                                         */ 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");

/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.  Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt Version: 0.11.1 */ 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();

/*                                                                                                                                                      Copyright (c) 2006, Yahoo! Inc. All rights reserved.                                                                                                    Code licensed under the BSD License:                                                                                                                    http://developer.yahoo.net/yui/license.txt                                                                                                              version: 0.11.0                                                                                                                                         */ 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();}

//common.js
var isIE=(document.all)?true:false;function $(){var elements=new Array();for(var i=0;i<arguments.length;i++){var element=arguments[i];if(typeof element=='string')element=document.getElementById(element);if(arguments.length==1)return element;elements.push(element);}return elements;};function $C(elType){return document.createElement(elType);};function $C2(loc,elType){return loc.createElement(elType);};function $T(text){return document.createTextNode(text);};function $I(div,innerHTML){if(!$(div)){return;};$(div).innerHTML=innerHTML};function addEvent(elm,evType,fn,useCapture){if(elm.addEventListener){elm.addEventListener(evType,fn,useCapture);return true;}else if(elm.attachEvent){var r=elm.attachEvent('on'+evType,fn);return r;}else{elm['on'+evType]=fn;}};function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){oldonload();func();}}};function inArray(array,value){var i;for(i=0;i<array.length;i++){if(array[i]==value){return i;}}return-1;};function showDiv(divId){if(!$(divId)){return;};$(divId).style.display="block";};function hideDiv(divId){if(!$(divId)){return;};$(divId).style.display="none";};function getCookie(name){var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length))){return null;}if(start==-1)return null;var end=document.cookie.indexOf(';',len);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(len,end));};function setCookie(name,value,expires,path,domain,secure){var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60*60*24;}var expires_date=new Date(today.getTime()+(expires));document.cookie=name+'='+escape(value)+((expires)?';expires='+expires_date.toGMTString():'')+((path)?';path='+path:'')+((domain)?';domain='+domain:'')+((secure)?';secure':'');};function deleteCookie(name,path,domain){if(getCookie(name))document.cookie=name+'='+((path)?';path='+path:'')+((domain)?';domain='+domain:'')+';expires=Thu, 01-Jan-1970 00:00:01 GMT';};function openNewWin(url,w,h){var l=Math.max((screen.width-w)/2,0);var t=Math.max((screen.height-h)/2,0);var newwin=window.open(url,"newwin","top="+t+",left="+l+",height="+h+",width="+w+",status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes");newwin.focus();};var oDialog;var loadedJS="";function loadJS(){if(!document.getElementById)return;for(i=0;i<arguments.length;i++){var file=arguments[i];var fileref="";if(loadedJS.indexOf(file)==-1){if(file.indexOf(".js")!=-1){fileref=document.createElement('script');fileref.setAttribute("type","text/javascript");fileref.setAttribute("src",file);}}
if(fileref!=""){document.getElementsByTagName("head").item(0).appendChild(fileref);loadedJS+=file+" ";}}};function loadFile(fileName,toDiv){var p=((typeof toDiv)=='object')?toDiv:$(toDiv);if(!p){return;}
p.innerHTML=MyAjax.get(fileName);};function unLoadPage(toDiv){if(!($(toDiv)&&$(toDiv).hasChildNodes())){return;}var children=$(toDiv).childNodes;for(i=children.length-1;i>=0;i--){if(children[i].nodeType==1){$(toDiv).removeChild(children[i]);}}};function loadPage(pageName,toDiv,paras){if(!$(toDiv)){return;}
unLoadPage(toDiv);var loading=$C('div');loading.setAttribute("id","loadingloadedIframe"+toDiv);var loadingAnimation=$C('img');loadingAnimation.setAttribute('src','/tpl/0000/images/loading.gif');loading.appendChild(loadingAnimation);loading.style.width="80px";loading.style.textAlign="center";$(toDiv).appendChild(loading);var iframe=(isIE)?$C('<iframe onload="removeLoadingCaption(this,'+paras["height"]+')"></iframe>'):$C('iframe');if(!isIE){iframe.setAttribute("onload","removeLoadingCaption(this,"+paras["height"]+")")};iframe.setAttribute("src",pageName);iframe.setAttribute("id","loadedIframe"+toDiv);iframe.setAttribute("scrolling",(paras["scroll"]==1)?"auto":"no");iframe.setAttribute("width",paras["width"]||0);iframe.setAttribute("height",paras["height"]||0);iframe.setAttribute("frameBorder","0");$(toDiv).appendChild(iframe);iframe.focus();};function removeLoadingCaption(obj,h){var p=obj.parentNode;var d=p.getElementsByTagName("div");if(d[0]&&d[0].id=="loading"+obj.id){p.removeChild(d[0]);}
if(obj.contentDocument&&obj.contentDocument.body.offsetHeight){obj.height=h||(obj.contentDocument.body.offsetHeight+23);}else if(obj.Document&&obj.Document.body.scrollHeight){obj.height=h||obj.Document.body.scrollHeight;}};function adjustIframeView(toDiv,s){var p=((typeof toDiv)=='object')?toDiv:$(toDiv);if(!p){return;}
var d=p.getElementsByTagName("iframe");var oD=((s==1)?top.window.oDialog2:top.window.oDialog);if(d[0]){var obj=d[0];if(obj.contentDocument&&obj.contentDocument.body.offsetHeight){if(obj.id.indexOf('cxt')>-1){var dispHeight=(obj.contentDocument.body.offsetHeight<=450)?obj.contentDocument.body.offsetHeight:450;obj.height=dispHeight+23;oD.hide();oD.resizeTo(Math.max(492,obj.contentDocument.body.offsetWidth),dispHeight+28);oD.show();}else{obj.height=obj.contentDocument.body.offsetHeight+10;}}else if(obj.Document&&obj.Document.body.scrollHeight){if(obj.id.indexOf('cxt')>-1){var dispHeight=(obj.Document.body.scrollHeight<=450)?obj.Document.body.scrollHeight:450;obj.height=dispHeight;oD.hide();oD.resizeTo(Math.max(obj.Document.body.scrollWidth,489),dispHeight+2);oD.show();}else{obj.height=obj.Document.body.scrollHeight;}}}};if(!this.MyAjax)MyAjax=function(){};MyAjax.get=function(url,callback,loadingCallback){return(new MyAjax()).get({'url':url,'onComplete':callback,'onLoading':loadingCallback});};MyAjax.post=function(url,data,callback,loadingCallback){return(new MyAjax()).post({'url':url,'data':data,'onComplete':callback,'onLoading':loadingCallback});};proto=MyAjax.prototype;proto.die=function(e){throw(e)};proto.get=function(params){this._init_object(params);this.request.open('GET',this.url,Boolean(this.onComplete||this.onLoading));return this._send();};proto.post=function(params){this._init_object(params);this.request.open('POST',this.url,Boolean(this.onComplete||this.onLoading));this.request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');return this._send();};proto._init_object=function(params){for(key in params){if(!key.match(/^url|data|onComplete|onLoading$/))throw("Invalid Ajax parameter: "+key);this[key]=params[key];}if(!this.url)throw("'url' required for Ajax get/post method");if(this.request)throw("Don't yet support multiple requests on the same Ajax object");this.request=new XMLHttpRequest();if(!this.request)return this.die("Your browser doesn't do Ajax");if(this.request.readyState!=0)return this.die("Ajax readyState should be 0");return this;};proto._send=function(){var self=this;if(this.onComplete||this.onLoading){this.request.onreadystatechange=function(){self._check_asynchronous();};}
this.request.send(this.data);return Boolean(this.onComplete)?this:this._check_synchronous();};proto._check_status=function(){if(this.request.status!=200){return this.die('Ajax request for "'+this.url+'" failed with status: '+this.request.status);}};proto._check_synchronous=function(){this._check_status();return this.request.responseText;};proto._check_asynchronous=function(){if(this.request.readyState==1){if((typeof this.onLoading)=="function"){this.onLoading();};return;}else{if(this.request.readyState!=4)return;}
this._check_status();this.onComplete(this.request.responseText);};if(window.ActiveXObject&&!window.XMLHttpRequest){window.XMLHttpRequest=function(){var name=(navigator.userAgent.toLowerCase().indexOf('msie 5')!=-1)?'Microsoft.XMLHTTP':'Msxml2.XMLHTTP';return new ActiveXObject(name);}};var digits="0123456789";var lowercaseLetters="abcdefghijklmnopqrstuvwxyz";var uppercaseLetters="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var whitespace=" \t\n\r";var decimalPointDelimiter=".";var phoneNumberDelimiters="()- ";var validUSPhoneChars=digits+phoneNumberDelimiters;var validWorldPhoneChars=digits+phoneNumberDelimiters+"+";var digitsInUSPhoneNumber=10;var ZIPCodeDelimiters="-";var ZIPCodeDelimeter="-"
var validZIPCodeChars=digits+ZIPCodeDelimiters;var digitsInZIPCode1=5;var digitsInZIPCode2=9;var creditCardDelimiters=" ";var defaultEmptyOK=false;function isEmpty(s){return((s==null)||(s.length==0))};function isWhitespace(s){var i;if(isEmpty(s))return true;for(i=0;i<s.length;i++){var c=s.charAt(i);if(whitespace.indexOf(c)==-1)return false;}return true;};function stripCharsInBag(s,bag){var i;var returnString="";for(i=0;i<s.length;i++){var c=s.charAt(i);if(bag.indexOf(c)==-1)returnString+=c;}return returnString;};function stripCharsNotInBag(s,bag){var i;var returnString="";for(i=0;i<s.length;i++){var c=s.charAt(i);if(bag.indexOf(c)!=-1)returnString+=c;}return returnString;};function stripWhitespace(s){return stripCharsInBag(s,whitespace)};function isLetter(c){return(((c>="a")&&(c<="z"))||((c>="A")&&(c<="Z")))};function isDigit(c){return((c>="0")&&(c<="9"))};function isLetterOrDigit(c){return(isLetter(c)||isDigit(c))};function isInteger(s){var i;if(isEmpty(s))if(isInteger.arguments.length==1)return defaultEmptyOK;else return(isInteger.arguments[1]==true);for(i=0;i<s.length;i++){var c=s.charAt(i);if(!isDigit(c))return false;}return true;};function isSignedInteger(s){if(isEmpty(s))if(isSignedInteger.arguments.length==1)return defaultEmptyOK;else return(isSignedInteger.arguments[1]==true);else{var startPos=0;var secondArg=defaultEmptyOK;if(isSignedInteger.arguments.length>1)secondArg=isSignedInteger.arguments[1];if((s.charAt(0)=="-")||(s.charAt(0)=="+"))startPos=1;return(isInteger(s.substring(startPos,s.length),secondArg))}};function isPositiveInteger(s){var secondArg=defaultEmptyOK;if(isPositiveInteger.arguments.length>1)secondArg=isPositiveInteger.arguments[1];return(isSignedInteger(s,secondArg)&&((isEmpty(s)&&secondArg)||(parseInt(s)>0)));};function isFloat(s){var i;var seenDecimalPoint=false;if(isEmpty(s))if(isFloat.arguments.length==1)return defaultEmptyOK;else return(isFloat.arguments[1]==true);if(s==decimalPointDelimiter)return false;for(i=0;i<s.length;i++){var c=s.charAt(i);if(((c==decimalPointDelimiter)||(c==","))&&!seenDecimalPoint)seenDecimalPoint=true;else if(!isDigit(c))return false;else seenDecimalPoint=false;}return true;};function isAlphabetic(s){var i;if(isEmpty(s))if(isAlphabetic.arguments.length==1)return defaultEmptyOK;else return(isAlphabetic.arguments[1]==true);for(i=0;i<s.length;i++){var c=s.charAt(i);if(!isLetter(c))return false;}return true;};function isAlphanumeric(s){var i;if(isEmpty(s))if(isAlphanumeric.arguments.length==1)return defaultEmptyOK;else return(isAlphanumeric.arguments[1]==true);for(i=0;i<s.length;i++){var c=s.charAt(i);if(!(isLetter(c)||isDigit(c)))return false;}return true;};function isUSPhoneNumber(s){if(isEmpty(s))if(isUSPhoneNumber.arguments.length==1)return defaultEmptyOK;else return(isUSPhoneNumber.arguments[1]==true);return(isInteger(s)&&s.length==digitsInUSPhoneNumber)};function isInternationalPhoneNumber(s){if(isEmpty(s))if(isInternationalPhoneNumber.arguments.length==1)return defaultEmptyOK;else return(isInternationalPhoneNumber.arguments[1]==true);return(isPositiveInteger(s))};function isZIPCode(s){if(isEmpty(s))if(isZIPCode.arguments.length==1)return defaultEmptyOK;else return(isZIPCode.arguments[1]==true);return(isInteger(s)&&((s.length==digitsInZIPCode1)||(s.length==digitsInZIPCode2)))};function isCanadaCode(s){var str=s;re=/(\w\d\w\s*\d\w\d)/i;found=str.match(re);return(found);};function isEmail(s){if(isEmpty(s))if(isEmail.arguments.length==1)return defaultEmptyOK;else return(isEmail.arguments[1]==true);if(isWhitespace(s))return false;var i=1;var sLength=s.length;while((i<sLength)&&(s.charAt(i)!="@")){i++}if((i>=sLength)||(s.charAt(i)!="@"))return false;else i+=2;while((i<sLength)&&(s.charAt(i)!=".")){i++}if((i>=sLength-1)||(s.charAt(i)!="."))return false;else return true;};function isCreditCard(st){if(st.length>19)return(false);sum=0;mul=1;l=st.length;for(i=0;i<l;i++){digit=st.substring(l-i-1,l-i);tproduct=parseInt(digit,10)*mul;if(tproduct>=10)sum+=(tproduct%10)+1;else sum+=tproduct;if(mul==1)mul++;else mul--;}if((sum%10)==0)return(true);else return(false);};function isVisa(cc){if(((cc.length==16)||(cc.length==13))&&(cc.substring(0,1)==4))return isCreditCard(cc);return false;};function isMasterCard(cc){var firstdig=cc.substring(0,1);var seconddig=cc.substring(1,2);if((cc.length==16)&&(firstdig==5)&&((seconddig>=1)&&(seconddig<=5)))return isCreditCard(cc);return false;};function isAmericanExpress(cc){var firstdig=cc.substring(0,1);var seconddig=cc.substring(1,2);if((cc.length==15)&&(firstdig==3)&&((seconddig==4)||(seconddig==7)))return isCreditCard(cc);return false;};function jumpNext(obj,n,objnext){if(obj.value.length==n){$(objnext).focus();}};function CommaFormatted(amount)
{if(typeof(amount)!='string'){amount=String(amount);}
var delimiter=",";if(amount.indexOf('.')<0){amount+=".00";}
var a=amount.split('.',2);var d=a[1];if(d.length==1){d+="0";};var i=parseInt(a[0]);if(isNaN(i)){return'';}
var minus='';if(i<0){minus='-';}
i=Math.abs(i);var n=new String(i);var a=[];while(n.length>3)
{var nn=n.substr(n.length-3);a.unshift(nn);n=n.substr(0,n.length-3);}
if(n.length>0){a.unshift(n);}
n=a.join(delimiter);if(d.length<1){amount=n;}
else{amount=n+'.'+d;}
amount="$"+minus+amount;return amount;};var lastTooltip;function showTooltip(tip){if(tip["stay"]==0&&(typeof lastTooltip)=='object'&&lastTooltip.hidden==0){lastTooltip.hidden=1;lastTooltip.close();};var oArg={html:'',adjustX:tip["adjustX"]||0,adjustY:tip["adjustY"]||0,maxWidth:200};oArg.target=tip["obj"];oArg.html=tip["msg"];oArg.title=tip["title"]||"";oArg.minWidth=tip["minWidth"]||180;var oD=MyUIDialog.balloon(oArg);lastTooltip=oD;YAHOO.util.Dom.addClass(oD.id+"cxt","tooltip-cxt");lastTooltip.hidden=0;setTimeout(function(){if(lastTooltip&&(typeof lastTooltip)=='object'&&lastTooltip.hidden==0){lastTooltip.hidden=1;lastTooltip.close();}},7000);};var WIN_POP_WIDTH=700;var WIN_POP_HEIGHT=431;var WIN_POP_PAGE_WIDTH=676;if(navigator.appName=="Microsoft Internet Explorer")
var WIN_POP_PAGE_HEIGHT=360;else
var WIN_POP_PAGE_HEIGHT=950;


//ui-dialog.js
MyUIDialog=new function()
{var nId=0;var zIndex=50;var $D=YAHOO.util.Dom;var $R=YAHOO.util.Region;var $GA=function(d,s){return d.getAttribute(s)}
var $DC=function(s){return document.createElement(s)}
var $AC=function(){$D.addClass.apply($D,arguments)}
var $RC=function(){$D.removeClass.apply($D,arguments)}
var $E=YAHOO.util.Event;var $AE=function(){$E.on.apply($E,arguments)}
var $RE=function(){$E.removeListener.apply($E,arguments)}
var $d=document;var $$=function(d,s){return(d||$d).getElementsByTagName(s||'*')};var $=$D.get;var $GC=function(q,w,e,r,t,y){return $D.getElementsByClassName(q,w,e,r,t,y)}
var isIE=!!document.uniqueID;var $root=$d.documentElement;var dSky=$('layout-sky');var dCloud=$('layout-cloud');var dFocalElement;var dFocalTarget;var dEventStopper;var dLightMask;var dLastHoverBox;var dDialogTempFrame;var hasSelectBug=!!(document.uniqueID&&!window.XMLHttpRequest);var oLastOpenedDismissDialog;var getScrollLeft=function()
{if($d.body)
{return Math.max($root.scrollLeft,$d.body.scrollLeft);}else{return $root.scrollLeft;}}
var getScrollTop=function()
{if($d.body)
{return Math.max($root.scrollTop,$d.body.scrollTop);}else{return $root.scrollTop;}}
var bPreventClick;var onDocumentClick=new YAHOO.util.CustomEvent('documentclick');var onDocumentClickHandler=function(e,isFromStop)
{if(bPreventClick)
{return;}
try{var dEl=e.target||e.srcElement;if(dEl==$d)
{onDocumentClick.fire(3);return;}
while(dEl)
{if(dEl.isYUIDialog||dEl.isYUIDialogPreventAutoDismiss||dEl.isYUIDialogComponent)
{return;}
dEl=dEl.parentNode;}
if(isFromStop)
{onDocumentClick.fire(2);}
else
{onDocumentClick.fire(3);}
return;}catch(oh){}}
var eventStop=$E.stopEvent;$E.stopEvent=function(e)
{if(e&&e.type=='click')
{onDocumentClickHandler(e,true);}
eventStop.apply(this,arguments);}
$E.on($d,'click',onDocumentClickHandler);var appendHTML=function(dEl,sHTML,bAfterBegin)
{if(!dEl){throw Error('appendHTML:dEl is null');return;}
var d1stChild;if(!(d1stChild=dEl.firstChild))
{dEl.innerHTML=sHTML;return;}
bAfterBegin=(!!bAfterBegin)||false;if(dEl.insertAdjacentHTML)
{bAfterBegin=bAfterBegin?'AfterBegin':'BeforeEnd';dEl.insertAdjacentHTML(bAfterBegin,sHTML);}
else
{try
{var r=dEl.ownerDocument.createRange();r.setStartBefore(dEl);var dSnippet=r.createContextualFragment(sHTML);if(bAfterBegin)
{dEl.insertBefore(dSnippet,d1stChild);}
else
{dEl.appendChild(dSnippet);}}
catch(err)
{var tempNode=document.createElement('div');tempNode.innerHTML=sHTML;var c;if(bAfterBegin)
{while(c=tempNode.firstChild)
{dEl.insertBefore(c,d1stChild);}}
else
{while(c=tempNode.firstChild)
{dEl.appendChild(c);}};tempNode=null;}}};var onFocusIn=function(e)
{if(!dEventStopper||(dEventStopper&&!dEventStopper.display))
{return true;}
dFocalElement=e.srcElement||e.target;var dEl=dFocalElement;if(dEl==$d||!dEl)
{try{if(dFocalTarget)
{dFocalTarget.focus();}}catch(oh){dFocalTarget=null;}}
while(dEl=dEl.parentNode)
{if(dEl.isYUIDialog)
{return;}}
if(dEl==$d||!dEl)
{if(dFocalTarget)
{try{dFocalTarget.focus();}catch(oh){}}}
$E.stopEvent(e);return false;}
if(document.uniqueID){YAHOO.util.Event.on(document,'focusin',onFocusIn);}else{document.addEventListener('focus',onFocusIn,true);}
var getArguments=function(oArg){oArg=oArg||[];oArg=oArg[0]||{};if(typeof(oArg)!='object')
{oArg={html:['',oArg].join(''),buttonText:'ok'};}
if(typeof(oArg.callback)!='function')
{oArg.callback=function(){};}
if(!oArg.buttonText||!oArg.buttonText.shift)
{oArg.buttonText=[oArg.buttonText||''];}
if(oArg.dragDrop==null){oArg.dragDrop=1}
if(typeof(oArg.minWidth)!='number')
{oArg.minWidth=220;}else{oArg.minWidth=Math.max(oArg.minWidth,100)}
if(typeof(oArg.maxWidth)!='number')
{oArg.maxWidth=600;}
if(typeof(oArg.displayDelay)!='number')
{oArg.displayDelay=500;}
if(typeof(oArg.dismissDelay)!='number')
{oArg.dismissDelay=500;}
return oArg;}
var _resizeMask_;var _resizeMaskLoop;var resizeH;var resizeW;var resizeY;var resizeMask=function(e)
{if(_resizeMask_)
{clearTimeout(_resizeMask_);}
var doit=function()
{var h=Math.max($root.clientHeight,$root.scrollHeight);var w=Math.max($root.clientWidth,$root.scrollWidth);var bSizeChange;if(resizeH!=h){resizeH=h;bSizeChange=1;}
if(resizeW!=w){resizeH=w;bSizeChange=1;}
if(bSizeChange&&dEventStopper&&dEventStopper.display&&w)
{dEventStopper.style.height=h+'px';dEventStopper.style.width=w+'px';}};if(e&&e.type){_resizeMask_=setTimeout(doit,100);}else{_resizeMask_=setTimeout(doit,0);}}
$AE(window,'resize',resizeMask);var setMask=function(bStopEvent,bDisplayMask)
{bStopEvent=!!bStopEvent;bDisplayMask=!!bDisplayMask;var h=Math.max($root.clientHeight,$root.scrollHeight);var w=Math.max($root.clientWidth,$root.scrollWidth);if(!dEventStopper)
{return;}
if(!dLightMask)
{return;}
if(bStopEvent)
{dEventStopper.style.height=h+'px';dEventStopper.style.width=w+'px';dEventStopper.style.zIndex=zIndex-2;dEventStopper.display=1;if(!_resizeMaskLoop)
{_resizeMaskLoop=setInterval(resizeMask,500);}
$AC($root,'yui-simple-dialog-has-mask');}
else if(dEventStopper){if(_resizeMaskLoop)
{clearInterval(_resizeMaskLoop);_resizeMaskLoop=null;}
$RC($root,'yui-simple-dialog-has-mask');dEventStopper.style.height=0;dEventStopper.display=0;};return;if(bDisplayMask)
{if(!_resizeMaskLoop)
{_resizeMaskLoop=setInterval(resizeMask,500);}
dLightMask.style.height=h+'px';dLightMask.style.width=w+'px';dLightMask.style.zIndex=zIndex-1;dLightMask.display=1;}
else if(dLightMask)
{if(_resizeMaskLoop)
{clearInterval(_resizeMaskLoop);_resizeMaskLoop=null;}
dLightMask.style.height=0;dLightMask.display=0;};}
var noEvent=function(e)
{$E.stopEvent(e);return false;}
var simpleDialog=function(oArg)
{var nScrollTop=getScrollTop();var sId='simple-dialog-hedgerwow-'+(nId+=1);this.id=sId;this._arg=oArg;appendHTML(dSky,this.createDialogHTML());this.applyLayout();var dBox=this.__box;dBox.isYUIDialog=true
if(!oArg.disableCloseButton)
{var oBtn=this.getButtonHTML('&times');appendHTML(this.__toolTop,oBtn.html);$AE(oBtn.ids[0],'click',this.onButtonClick,this);}
var oBtn=this.getButtonHTML(oArg.buttonText);appendHTML(this.__toolBottom,oBtn.html);var dFirstButton;for(var i=0;i<oBtn.ids.length;i++)
{var dBtn=$(oBtn.ids[i]);dFirstButton=dFirstButton||dBtn;dBtn.buttonIndex=i;$AE(dBtn,'click',this.onButtonClick,this);}
this.setContext(oArg.html,true);this.addResizeControl();if(oArg.width||oArg.height){this.resizeTo(oArg.width,oArg.height);}
if(oArg.hide){this.hide()}else{this.moveToCenter();}
this.setDragDrop();if(oArg._stopEvent&&oArg._displayMask)
{this.setCapture();}else
{if(oArg.autoDismiss)
{bPreventClick=true;setTimeout(function(){bPreventClick=false},100);if(oArg.target)
{oArg.target.isYUIDialogPreventAutoDismiss=1;}
if(oLastOpenedDismissDialog)
{try{oLastOpenedDismissDialog.close();oLastOpenedDismissDialog=null;}catch(oh){}}
var oSelf=this;oLastOpenedDismissDialog=this;oArg.autoDismiss=function(sEtype,n)
{onDocumentClick.unsubscribe(oArg.autoDismiss,oSelf);oArg.autoDismiss=null;oSelf.close();}
onDocumentClick.subscribe(oArg.autoDismiss,this,true);}}
this.showAtTop();$AE(dBox,'mousedown',this.showAtTop,this,true);}
simpleDialog.prototype.hide=function()
{var dBox=this.__box;this._top=dBox.style.top;dBox.style.top='-5000px';dBox.style.visibility='hidden';this.hidden=1;}
simpleDialog.prototype.show=function()
{var dBox=this.__box;dBox.style.top=this._top;dBox.style.visibility='visible';this.showAtTop();this.hidden=0;}
simpleDialog.prototype.addResizeControl=function()
{var oArg=this._arg;this.addResizeControl=function(){};if(!oArg.resize)
{return;}
var sId=this.id+'resize-ctrl';appendHTML(this.__toolBottom,['<div class="yui-dialog-box-resize-ctrl"><span id="',sId,'" ></span><b class="ysd-clr"></b></div>'].join(''));if(!dDialogTempFrame){dDialogTempFrame=$DC('div');dDialogTempFrame.className='yui-dialog-box-resize-frame';dDialogTempFrame.innerHTML='<b></b>';dSky.appendChild(dDialogTempFrame);}
var dS=dDialogTempFrame.style;var nShadowOffset=0;var nX1,nY1,nW,nH,nEw,nEh;var dBox=this.__box;var dScroll=this.__scroll;var oSelf=this;var nBorderH=this.__borderN.offsetHeight;var mBorderW=this.__borderW.offsetWidth;this.resizeTo(oArg.width,oArg.height||dScroll.offsetHeight);var onResizeStart=function(e,oClass)
{nX1=$D.getX(oClass.__borderW);nY1=$D.getY(oClass.__borderN);nW=dBox.offsetWidth+mBorderW-dScroll.offsetWidth;nH=dBox.offsetHeight+nBorderH-dScroll.offsetHeight;if(isIE)
{this.setCapture();}
else
{try{document.addEventListener('mouseover',noEvent,true);document.addEventListener('mouseout',noEvent,true);}catch(oh){};}
oSelf.showAtTop();dS.zIndex=zIndex+=4;dS.width=dBox.offsetWidth+mBorderW+'px';dS.height=dBox.offsetHeight+nBorderH+'px';dS.left=nX1+'px';dS.top=nY1+'px';$AE(document,'mousemove',onResizeMove);$AE(document,'mouseup',onResizeEnd,oClass);$AE(document,'mouseover',noEvent);$AE(document,'mouseout',noEvent);$E.stopEvent(e);return false;}
var onResizeMove=function(e)
{nEw=Math.max(100,e.clientX+getScrollLeft()-nX1);nEh=Math.max(100,e.clientY+getScrollTop()-nY1);dS.width=nEw+'px';dS.height=nEh+'px';$E.stopEvent(e);return false;}
var onResizeEnd=function(e,oClass)
{if(isIE)
{this.releaseCapture();}
nEw=Math.max(100,nEw-nW);nEh=Math.max(100,nEh-nH);oClass.resizeTo(nEw,nEh);dS.width=0;dS.height=0;dS.top='-5000px';try{document.removeEventListener('mouseover',noEvent,true);document.removeEventListener('mouseout',noEvent,true);}catch(oh){};$RE(document,'mousemove',onResizeMove);$RE(document,'mouseup',onResizeEnd);$RE(document,'mouseover',noEvent);$RE(document,'mouseout',noEvent);nX1=nY1=null;dS.width=0;dS.height=0;$E.stopEvent(e);return false;}
$AE(sId,'mousedown',onResizeStart,this);}
simpleDialog.prototype.setDragDrop=function()
{}
simpleDialog.prototype.onButtonClick=function(e,oSelf)
{var oArg=oSelf._arg;oSelf.close(e,this);}
var aFocalElement=[];simpleDialog.prototype.setCapture=function()
{setMask(true,true);dFocalTarget=this.__toolBottom.getElementsByTagName('button')[0]||this.__toolBottom.getElementsByTagName('a')[0];dFocalTarget.focus();aFocalElement.push(dFocalTarget.id);$AC($root,'display-mask');}
simpleDialog.prototype.releaseCapture=function()
{var a=[];for(var i=aFocalElement.length-1;i>=0;i--)
{var sId=aFocalElement[i];if(sId&&(dFocalTarget=document.getElementById(sId)))
{if(dEventStopper)
{var dBox=dFocalTarget.parentNode;while(!dBox.isYUIDialog)
{dBox=dBox.parentNode;}
dBox.style.zIndex=zIndex+=4;dEventStopper.style.zIndex=zIndex-2;}
break;}
else
{dFocalTarget=null;aFocalElement[i]='';};}
if(!dFocalTarget)
{setMask(false,false);}
for(var i=0,j=aFocalElement.length;i<j;i++)
{var sId=aFocalElement[i];if(sId)
{a.push(sId);}}
aFocalElement=a;if(!aFocalElement.length)
{$RC($root,'display-mask');setMask(false,false);};}
simpleDialog.prototype.close=function(e,dButton)
{var oArg=this._arg;dButton=dButton||{};e=e||{}
if(typeof(oArg.onBeforeClose)=='function')
{e.buttonIndex=dButton.buttonIndex||-1;if(!oArg.onBeforeClose.call(this,oArg,e,(dButton.buttonIndex==0)))
{return false}}
this.exit();var bConfirm=false;e.buttonIndex=-1;if(dButton)
{bConfirm=dButton.buttonIndex==0;e.buttonIndex=(dButton.buttonIndex==null)?-1:dButton.buttonIndex;}
oArg.callback.call(this,oArg,e,bConfirm);}
simpleDialog.prototype.exit=function()
{try{this.dragDrop.unreg()}catch(oh){};var oArg=this._arg;var dBox=this.__box;if(oArg.autoDismiss)
{onDocumentClick.unsubscribe(oArg.autoDismiss,this);oArg.autoDismiss=null;}
$E.purgeElement(dBox,true);dBox.innerHTML='';dBox.parentNode.removeChild(dBox);dBox=null;this.releaseCapture();var oSelf=this;if(this._toolTipTarget)
{while(this._toolTipTarget.length)
{var dEl=this._toolTipTarget.shift();this.removeTarget(dEl);}}
var oArg=oSelf._arg;for(var i in oSelf)
{if(oSelf[i]!=oArg)
{oSelf[i]=null;}}
oSelf.closed=true;}
simpleDialog.prototype.applyLayout=function()
{var sId=this.id;var oLayout={box:$(sId+'box'),context:$(sId+'cxt'),scroll:$(sId+'scroll'),toolTop:$(sId+'cmd-0'),toolBottom:$(sId+'cmd-1'),arrow:$(sId+'arrow'),title:$(sId+'title'),borderW:$(sId+'border-w'),borderN:$(sId+'border-n'),borderE:$(sId+'border-e'),borderS:$(sId+'border-s'),opacBg:$(sId+'opacBg')}
for(var i in oLayout)
{this['__'+i]=oLayout[i];}
oLayout=null;}
simpleDialog.prototype.showAtTop=function(e)
{var z=this.__box.style.zIndex||0;if(z<zIndex)
{this.__box.style.zIndex=(zIndex+=4);if(dEventStopper)
{dEventStopper.style.zIndex=(zIndex-2);}}
if(e&&e.type)
{$E.stopEvent(e);return false;}}
simpleDialog.prototype.setTitle=function(s)
{this.__title.innerHTML="<span style='font-family:Verdana;font-size:12px'>"+s+"</span>";}
simpleDialog.prototype.setContext=function(s,bRecalcSize)
{s=[s].join('');var oArg=this._arg;var dScroll=this.__scroll;var dContext=this.__context;var dBox=this.__box;dContext.innerHTML=s;YAHOO.util.Dom.setStyle(dContext,'textAlign','left');if(isIE)
{var recalc=function(){dBox.style.zoom=1.1;dBox.style.zoom=1;}
setTimeout(recalc,0);};if(bRecalcSize)
{dBox.style.visibility='hidden';dBox.style.visibility='visible';dBox.style.width='auto';var nW=Math.min(dScroll.offsetWidth,oArg.maxWidth);nW=Math.max(nW,oArg.minWidth);dBox.style.width=nW+'px';dBox.style.visibility='visible';}}
simpleDialog.prototype.moveTo=function(x,y)
{var dBox=this.__box;if((this._left!=x+'px')&&typeof(x)=='number')
{this._left=dBox.style.left=x+'px';}
if(this._top!=y+'px'&&typeof(y)=='number')
{this._top=dBox.style.top=y+'px';}}
simpleDialog.prototype.moveToCenter=function(nMode)
{var dBox=this.__box;var aScroll=[getScrollLeft(),getScrollTop()];if(nMode==1||!nMode){this.moveTo(Math.max(16,($D.getViewportWidth()-dBox.offsetWidth)/2+aScroll[0]),null);}
if(nMode==2||!nMode){this.moveTo(null,Math.max(16,($D.getViewportHeight()-dBox.offsetHeight)/2+aScroll[1]));}}
simpleDialog.prototype.resizeTo=function(nW,nH)
{var oArg=this._arg;var dBox=this.__box;var dScroll=this.__scroll;if(!this._hasScrollBar)
{this._hasScrollBar=1;dScroll.style.width='100%';dScroll.style.overflow='hidden';}
if(nW&&!isNaN(nW)){dBox.style.width=Math.max(100,nW)+'px';}
if(nH&&!isNaN(nH)){dScroll.style.height=Math.max(100,nH)+'px';this.moveToCenter();}}
simpleDialog.prototype.getButtonHTML=function(aButtonText)
{var aHtml=[];var aId=[];if(!aButtonText.shift)
{aButtonText=[aButtonText];}
if(aButtonText=='Close'){for(var i=0,j=aButtonText.length;i<j;i+=1)
{if(aButtonText[i])
{aId[i]='yui-dialog-btn'+(nId+=1);aHtml[i]='<button  style="width:0px;height:0px;" id="'+aId[i]+'"><span>'+aButtonText[i]+'</span></button>';}}}else{for(var i=0,j=aButtonText.length;i<j;i+=1)
{if(aButtonText[i])
{aId[i]='yui-dialog-btn'+(nId+=1);aHtml[i]='<button  class="yui-dialog-btn" id="'+aId[i]+'"><span>'+aButtonText[i]+'</span></button>';}}}
return{ids:aId,html:aHtml.join('')}}
simpleDialog.prototype.setTarget=function(dTarget,nX,nY,bInnerView)
{var oArg=this._arg||{};nX=nX||0;nY=nY||0;var sId=$D.generateId(dTarget);dTarget=$(sId);if(!dTarget){return false};if(oArg.autoDismiss){dTarget.isYUIDialogPreventAutoDismiss=1;}
var dBox=this.__box;var dArr=this.__arrow||{offsetHeight:0};var nH=dBox.offsetHeight;var nW=dBox.offsetWidth;var nSY=getScrollTop();var nSX=getScrollLeft();dBox.style.visibility='hidden';nX+=$D.getX(dTarget);nY+=$D.getY(dTarget)-dArr.offsetHeight-nH;if(bInnerView)
{if(nY<nSY+3)
{nY=nSY+3;}
else if(nY>($D.getViewportHeight()+nSY-nH))
{nY=($D.getViewportHeight()+nSY-nH-3);}
if(nX<nSX+3)
{nX=nSX+3;}
else if(nX>($D.getViewportWidth()+nSX-nW-6))
{nX=($D.getViewportWidth()+nSX-nW-6);}}
if(nX>$D.getViewportWidth()/2){dBox.style.left=(nX/2+$D.getViewportWidth()/7+oArg.adjustX)+'px';var arrow=$(dBox.id.replace(/box/,"arrow"));$D.replaceClass(arrow,"arrow-s","arrow-s2");$D.setX(arrow,$D.getX(arrow)+nW-60);}else{dBox.style.left=(nX+50+oArg.adjustX)+'px';}
dBox.style.top=(nY+12+oArg.adjustY)+'px';dBox.style.visibility='visible';}
simpleDialog.prototype.addTarget=function(dEl,oConfig)
{var oArg=this._arg||{};if(oArg._type!='tooltip')
{this.addTarget=function(){};return;};if(dEl&&typeof(oConfig)=='object'&&typeof(oConfig.onDisplay)=='function')
{if(dEl._hasToolTip){return};if(!this._toolTipTarget)
{this._toolTipTarget=[];}
if(typeof(oConfig.onBeforeDisplay)!='function')
{oConfig.onBeforeDisplay=function(){return true}}
this._toolTipTarget.push(dEl);oConfig._scope=this;$D.generateId(dEl);$AE(dEl,'mouseover',this._toolTipMouseOver,oConfig);$AE(dEl,'mouseout',this._toolTipMouseOut,oConfig);dEl._hasToolTip=true;}}
simpleDialog.prototype.removeTarget=function(dEl)
{var oArg=this._arg||{};var oSelf=this;if(oArg._type!='tooltip')
{this.removeTarget=function(){};return;};if(!dEl||!dEl._hasToolTip){return};$RE(dEl,'mouseover',this._toolTipMouseOver);$RE(dEl,'mouseout',this._toolTipMouseOut);dEl._hasToolTip=null;}
simpleDialog.prototype._toolTipMouseOver=function(e,oConfig)
{var oSelf=oConfig._scope;var oArg=oSelf._arg;var dTarget=this;if(!oArg)
{$E.stopEvent(e);return false;}
if(oSelf._toolTipAction)
{clearTimeout(oSelf._toolTipAction);}
if(this.isYUIDialog)
{$E.stopEvent(e);return false;}
var dEventCopy={};for(var i in e)
{dEventCopy[i]=e;}
var doit=function()
{if(oSelf._targetId==dTarget.id)
{var isShow=oConfig.onBeforeDisplay.call(oSelf,oConfig,dEventCopy);if(isShow!=false)
{oSelf.show();oConfig.onDisplay.call(oSelf,oConfig,dEventCopy);}}}
if(oSelf._targetId&&oSelf._targetId!=dTarget.id)
{oSelf.setContext('');oSelf.hide();}
oSelf._targetId=dTarget.id;oSelf._toolTipAction=setTimeout(doit,oArg.displayDelay);if(typeof(oConfig.onMouseOver)=='function')
{oConfig.onMouseOver.call(oSelf,e,oConfig);}
$E.stopEvent(e);return false;}
simpleDialog.prototype._toolTipMouseOut=function(e,oConfig)
{var oSelf=oConfig._scope;var oArg=oSelf._arg;var dTarget=this;if(!oArg)
{$E.stopEvent(e);}
if(oSelf._toolTipAction)
{clearTimeout(oSelf._toolTipAction);}
var doit=function()
{if(oSelf._targetId==dTarget.id||dTarget.isYUIDialog)
{oSelf.setContext('');oSelf.hide();if(typeof(oConfig.onDismiss)=='function')
{oConfig.onDismiss.call(oSelf,oConfig);}}}
oSelf._toolTipAction=setTimeout(doit,oArg.dismissDelay);if(typeof(oConfig.onMouseOut)=='function')
{oConfig.onMouseOut.call(oSelf,e,oConfig);}
$E.stopEvent(e);return false;}
simpleDialog.prototype.createDialogHTML=function()
{var sId=this.id;var oArg=this._arg||{};var bHasIframe=!!oArg._stopEvent;if(!hasSelectBug){bHasIframe=true}
var opac=oArg.opacity;if(opac&&!isNaN(opac)&&opac>0&&opac<=1&&!isIE){opac=['<style>','#',sId,'box .cr ,','#',sId,'cmd-1,','#',sId,'cmd-0','{ opacity:',opac,';}','#',sId,'box,','#',sId,'box .ysd-cxt,','#',sId,'box .scroll','{background:transparent}','#',sId,'box .opac-bg','{opacity:',opac,'}','</style>'].join('');}
else{opac=''}
var s=['<div id="',sId,'box" class="yui-simple-dialog yui-simple-dialog-',oArg._type,' ',(opac)?'yui-simple-dialog-opac':'','">',opac,'<div class="ysd-bd" id="',sId,'bd">','<div class="ysd-cmd-0" id="',sId,'cmd-0">','<div class="ysd-title" ><nobr id="',sId,'title" ></nobr></div>','</div>','<div class="ysd-scroll" id="',sId,'scroll">','<div class="ysd-cxt type-',oArg._type,'" id="',sId,'cxt">&nbsp;</div>','</div><div class="ysd-clr"></div>','<div class="ysd-cmd-1" id="',sId,'cmd-1"><a href="#" rel="focus" tabIndex="-1" hidefocs="hidefocus"></a></div>','<b class="ysd-e cr" id="',sId,'border-e"></b>','<b class="ysd-w cr" id="',sId,'border-w"></b>','<div class="opac-bg" id="',sId,'opacBg"></div>','<!--[if lte IE 6.5]>','<iframe class="select-free" frameborder="0"></iframe>','<![endif]-->','</div>','<b class="ysd-nw cr"></b>','<b class="ysd-n cr" id="',sId,'border-n"></b>','<b class="ysd-ne cr"></b>','<b class="ysd-se cr"></b>','<b class="ysd-s cr" id="',sId,'border-s"></b>','<b class="ysd-sw cr"></b>','<!--[if lte IE 6.5]>','<iframe frameborder="0" class="select-free" style="height:9px;top:-9px;filter:mask();"></iframe>','<iframe frameborder="0" class="select-free" style="height:9px;top:auto;bottom:-9px;filter:mask();"></iframe>','<![endif]-->',(oArg._type=='balloon'||oArg._type=='tooltip')?'<b class="arrow-s" id="'+sId+'arrow"></b>':'','</div>'].join('');return s;}
var dummy=function(){};this.alert=function()
{var oArg=getArguments(arguments);oArg.resize=0;oArg.buttonText=[oArg.buttonText[0]||'ok'];oArg._stopEvent=1;oArg._displayMask=1;oArg._type='alert';var oDialog=new simpleDialog(oArg);return oDialog;};this.notify=function()
{var oArg=getArguments(arguments);oArg.resize=0;oArg._stopEvent=0;oArg._displayMask=0;oArg.buttonText=[oArg.buttonText[0]||'ok'];oArg._type='notify';var oDialog=new simpleDialog(oArg);oDialog.setCapture=dummy;oDialog.releaseCapture=dummy;return oDialog;};this.confirm=function()
{var oArg=getArguments(arguments);oArg.resize=0;oArg.buttonText=[(oArg.buttonText[0])||'yes',(oArg.buttonText[1])||'no'];oArg._type='confirm';oArg._stopEvent=1;oArg._displayMask=1;var oDialog=new simpleDialog(oArg);return oDialog;};this.balloon=function()
{var oArg=getArguments(arguments);oArg.resize=0;oArg.dragDrop=0;oArg.buttonText=[];oArg._type='balloon';oArg._stopEvent=0;oArg._displayMask=0;var oDialog=new simpleDialog(oArg);if(oArg.title){oDialog.setTitle(oArg.title)};oDialog.setTarget(oArg.target);oDialog.setCapture=dummy;oDialog.releaseCapture=dummy;return oDialog;};this.popup=function()
{var oArg=getArguments(arguments);oArg.dragDrop=1;oArg._type='popup';oArg.resize=1;oArg._stopEvent=0;oArg._displayMask=0;var oDialog=new simpleDialog(oArg);oDialog.setCapture=dummy;oDialog.releaseCapture=dummy;return oDialog;};this.modal=function()
{var oArg=getArguments(arguments);oArg.dragDrop=0;oArg.resize=0;oArg._type='popup';oArg._stopEvent=1;oArg._displayMask=1;var oDialog=new simpleDialog(oArg);if(oArg.title){oDialog.setTitle(oArg.title)};return oDialog;};this.process=function()
{var oArg=getArguments(arguments);oArg.dragDrop=1;if(oArg.displayMask)
{oArg._stopEvent=1;oArg._displayMask=1;}
oArg._type='process';oArg.buttonText=0;oArg.resize=0;var oDialog=new simpleDialog(oArg);if(!oArg.displayMask)
{oDialog.setCapture=dummy;oDialog.releaseCapture=dummy;}
if(oArg.title){oDialog.setTitle(oArg.title)};return oDialog;};this.tooltip=function()
{var oArg=getArguments(arguments);oArg.dragDrop=0;oArg.html='&nbsp;';oArg.resize=0;oArg.buttonText=0;oArg._type='tooltip';oArg.displayMask=0;oArg.hide=1;var oDialog=new simpleDialog(oArg);$AE(oDialog.__box,'mouseover',oDialog._toolTipMouseOver,{_scope:oDialog});$AE(oDialog.__box,'mouseout',oDialog._toolTipMouseOut,{_scope:oDialog});return oDialog;}
function addSkyCloud(){if(!$d.body||!$d.body.firstChild)
{setTimeout(addSkyCloud,0);return;}
if(!dSky)
{appendHTML($d.body,'<div id="layout-sky"></div>',true);dSky=$('layout-sky');}
if(!dCloud)
{appendHTML($d.body,'<div id="layout-cloud"></div>',true);dCloud=$('layout-cloud');}
if(!dEventStopper)
{var dummy=function(e)
{$E.stopEvent(e);return false;}
dEventStopper='mask'+(nId+=1);appendHTML(dSky,'<div id="'+dEventStopper+'" class="passive"  ></div>');dEventStopper=$(dEventStopper);var aE=('mousedown,dragstart,dragend,selectstart,mouseup,mousemove,mouseout,mouseover,click,contextmenu,keydown,keyup').split(',');while(aE.length)
{$AE(dEventStopper,aE.shift(),dummy);}}
if(!dLightMask)
{dLightMask='mask'+(nId+=1);appendHTML(dCloud,'<div id="'+dLightMask+'" class="mask"></div>');dLightMask=$(dLightMask);}}
addSkyCloud();};
