2 Copyright (c) 2006, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.net/yui/license.txt
7 YAHOO
.util
.Config=function(owner
){if(owner
){this.init(owner
);}}
8 YAHOO
.util
.Config
.prototype={owner
:null,configChangedEvent
:null,queueInProgress
:false,addProperty:function(key
,propertyObject
){},getConfig:function(){},getProperty:function(key
){},resetProperty:function(key
){},setProperty:function(key
,value
,silent
){},queueProperty:function(key
,value
){},refireEvent:function(key
){},applyConfig:function(userConfig
,init
){},refresh:function(){},fireQueue:function(){},subscribeToConfigEvent:function(key
,handler
,obj
,override
){},unsubscribeFromConfigEvent:function(key
,handler
,obj
){},checkBoolean:function(val
){if(typeof val
=='boolean'){return true;}else{return false;}},checkNumber:function(val
){if(isNaN(val
)){return false;}else{return true;}}}
9 YAHOO
.util
.Config
.prototype.init=function(owner
){this.owner
=owner
;this.configChangedEvent
=new YAHOO
.util
.CustomEvent("configChanged");this.queueInProgress
=false;var config
={};var initialConfig
={};var eventQueue
=[];var fireEvent=function(key
,value
){key
=key
.toLowerCase();var property
=config
[key
];if(typeof property
!='undefined'&&property
.event
){property
.event
.fire(value
);}}
10 this.addProperty=function(key
,propertyObject
){key
=key
.toLowerCase();config
[key
]=propertyObject
;propertyObject
.event
=new YAHOO
.util
.CustomEvent(key
);propertyObject
.key
=key
;if(propertyObject
.handler
){propertyObject
.event
.subscribe(propertyObject
.handler
,this.owner
,true);}
11 this.setProperty(key
,propertyObject
.value
,true);if(!propertyObject
.suppressEvent
){this.queueProperty(key
,propertyObject
.value
);}}
12 this.getConfig=function(){var cfg
={};for(var prop
in config
){var property
=config
[prop
]
13 if(typeof property
!='undefined'&&property
.event
){cfg
[prop
]=property
.value
;}}
15 this.getProperty=function(key
){key
=key
.toLowerCase();var property
=config
[key
];if(typeof property
!='undefined'&&property
.event
){return property
.value
;}else{return undefined;}}
16 this.resetProperty=function(key
){key
=key
.toLowerCase();var property
=config
[key
];if(typeof property
!='undefined'&&property
.event
){this.setProperty(key
,initialConfig
[key
].value
);}else{return undefined;}}
17 this.setProperty=function(key
,value
,silent
){key
=key
.toLowerCase();if(this.queueInProgress
&&!silent
){this.queueProperty(key
,value
);return true;}else{var property
=config
[key
];if(typeof property
!='undefined'&&property
.event
){if(property
.validator
&&!property
.validator(value
)){return false;}else{property
.value
=value
;if(!silent
){fireEvent(key
,value
);this.configChangedEvent
.fire([key
,value
]);}
18 return true;}}else{return false;}}}
19 this.queueProperty=function(key
,value
){key
=key
.toLowerCase();var property
=config
[key
];if(typeof property
!='undefined'&&property
.event
){if(typeof value
!='undefined'&&property
.validator
&&!property
.validator(value
)){return false;}else{if(typeof value
!='undefined'){property
.value
=value
;}else{value
=property
.value
;}
20 var foundDuplicate
=false;for(var i
=0;i
<eventQueue
.length
;i
++){var queueItem
=eventQueue
[i
];if(queueItem
){var queueItemKey
=queueItem
[0];var queueItemValue
=queueItem
[1];if(queueItemKey
.toLowerCase()==key
){eventQueue
[i
]=null;eventQueue
.push([key
,(typeof value
!='undefined'?value
:queueItemValue
)]);foundDuplicate
=true;break;}}}
21 if(!foundDuplicate
&&typeof value
!='undefined'){eventQueue
.push([key
,value
]);}}
22 if(property
.supercedes
){for(var s
=0;s
<property
.supercedes
.length
;s
++){var supercedesCheck
=property
.supercedes
[s
];for(var q
=0;q
<eventQueue
.length
;q
++){var queueItemCheck
=eventQueue
[q
];if(queueItemCheck
){var queueItemCheckKey
=queueItemCheck
[0];var queueItemCheckValue
=queueItemCheck
[1];if(queueItemCheckKey
.toLowerCase()==supercedesCheck
.toLowerCase()){eventQueue
.push([queueItemCheckKey
,queueItemCheckValue
]);eventQueue
[q
]=null;break;}}}}}
23 return true;}else{return false;}}
24 this.refireEvent=function(key
){key
=key
.toLowerCase();var property
=config
[key
];if(typeof property
!='undefined'&&property
.event
&&typeof property
.value
!='undefined'){if(this.queueInProgress
){this.queueProperty(key
);}else{fireEvent(key
,property
.value
);}}}
25 this.applyConfig=function(userConfig
,init
){if(init
){initialConfig
=userConfig
;}
26 for(var prop
in userConfig
){this.queueProperty(prop
,userConfig
[prop
]);}}
27 this.refresh=function(){for(var prop
in config
){this.refireEvent(prop
);}}
28 this.fireQueue=function(){this.queueInProgress
=true;for(var i
=0;i
<eventQueue
.length
;i
++){var queueItem
=eventQueue
[i
];if(queueItem
){var key
=queueItem
[0];var value
=queueItem
[1];var property
=config
[key
];property
.value
=value
;fireEvent(key
,value
);}}
29 this.queueInProgress
=false;eventQueue
=new Array();}
30 this.subscribeToConfigEvent=function(key
,handler
,obj
,override
){key
=key
.toLowerCase();var property
=config
[key
];if(typeof property
!='undefined'&&property
.event
){if(!YAHOO
.util
.Config
.alreadySubscribed(property
.event
,handler
,obj
)){property
.event
.subscribe(handler
,obj
,override
);}
31 return true;}else{return false;}}
32 this.unsubscribeFromConfigEvent=function(key
,handler
,obj
){key
=key
.toLowerCase();var property
=config
[key
];if(typeof property
!='undefined'&&property
.event
){return property
.event
.unsubscribe(handler
,obj
);}else{return false;}}
33 this.outputEventQueue=function(){var output
="";for(var q
=0;q
<eventQueue
.length
;q
++){var queueItem
=eventQueue
[q
];if(queueItem
){output
+=queueItem
[0]+"="+queueItem
[1]+", ";}}
35 YAHOO
.util
.Config
.alreadySubscribed=function(evt
,fn
,obj
){for(var e
=0;e
<evt
.subscribers
.length
;e
++){var subsc
=evt
.subscribers
[e
];if(subsc
&&subsc
.obj
==obj
&&subsc
.fn
==fn
){return true;break;}}
37 YAHOO
.widget
.Module=function(el
,userConfig
){if(el
){this.init(el
,userConfig
);}}
38 YAHOO
.widget
.Module
.IMG_ROOT
="http://us.i1.yimg.com/us.yimg.com/i/";YAHOO
.widget
.Module
.IMG_ROOT_SSL
="https://a248.e.akamai.net/sec.yimg.com/i/";YAHOO
.widget
.Module
.CSS_MODULE
="module";YAHOO
.widget
.Module
.CSS_HEADER
="hd";YAHOO
.widget
.Module
.CSS_BODY
="bd";YAHOO
.widget
.Module
.CSS_FOOTER
="ft";YAHOO
.widget
.Module
.prototype={constructor:YAHOO
.widget
.Module
,element
:null,header
:null,body
:null,footer
:null,id
:null,childNodesInDOM
:null,imageRoot
:YAHOO
.widget
.Module
.IMG_ROOT
,beforeInitEvent
:null,initEvent
:null,appendEvent
:null,beforeRenderEvent
:null,renderEvent
:null,changeHeaderEvent
:null,changeBodyEvent
:null,changeFooterEvent
:null,changeContentEvent
:null,destroyEvent
:null,beforeShowEvent
:null,showEvent
:null,beforeHideEvent
:null,hideEvent
:null,initEvents:function(){this.beforeInitEvent
=new YAHOO
.util
.CustomEvent("beforeInit");this.initEvent
=new YAHOO
.util
.CustomEvent("init");this.appendEvent
=new YAHOO
.util
.CustomEvent("append");this.beforeRenderEvent
=new YAHOO
.util
.CustomEvent("beforeRender");this.renderEvent
=new YAHOO
.util
.CustomEvent("render");this.changeHeaderEvent
=new YAHOO
.util
.CustomEvent("changeHeader");this.changeBodyEvent
=new YAHOO
.util
.CustomEvent("changeBody");this.changeFooterEvent
=new YAHOO
.util
.CustomEvent("changeFooter");this.changeContentEvent
=new YAHOO
.util
.CustomEvent("changeContent");this.destroyEvent
=new YAHOO
.util
.CustomEvent("destroy");this.beforeShowEvent
=new YAHOO
.util
.CustomEvent("beforeShow");this.showEvent
=new YAHOO
.util
.CustomEvent("show");this.beforeHideEvent
=new YAHOO
.util
.CustomEvent("beforeHide");this.hideEvent
=new YAHOO
.util
.CustomEvent("hide");},platform:function(){var ua
=navigator
.userAgent
.toLowerCase();if(ua
.indexOf("windows")!=-1||ua
.indexOf("win32")!=-1){return"windows";}else if(ua
.indexOf("macintosh")!=-1){return"mac";}else{return false;}}(),browser:function(){var ua
=navigator
.userAgent
.toLowerCase();if(ua
.indexOf('opera')!=-1){return'opera';}else if(ua
.indexOf('msie 7')!=-1){return'ie7';}else if(ua
.indexOf('msie')!=-1){return'ie';}else if(ua
.indexOf('safari')!=-1){return'safari';}else if(ua
.indexOf('gecko')!=-1){return'gecko';}else{return false;}}(),isSecure:function(){if(window
.location
.href
.toLowerCase().indexOf("https")==0){this.imageRoot
=YAHOO
.widget
.Module
.IMG_ROOT_SSL
;return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg
.addProperty("visible",{value
:true,handler
:this.configVisible
,validator
:this.cfg
.checkBoolean
});this.cfg
.addProperty("effect",{suppressEvent
:true,supercedes
:["visible"]});this.cfg
.addProperty("monitorresize",{value
:true,handler
:this.configMonitorResize
});},init:function(el
,userConfig
){this.initEvents();this.beforeInitEvent
.fire(YAHOO
.widget
.Module
);this.cfg
=new YAHOO
.util
.Config(this);if(typeof el
=="string"){var elId
=el
;el
=document
.getElementById(el
);if(!el
){el
=document
.createElement("DIV");el
.id
=elId
;}}
39 this.element
=el
;if(el
.id
){this.id
=el
.id
;}
40 var childNodes
=this.element
.childNodes
;if(childNodes
){for(var i
=0;i
<childNodes
.length
;i
++){var child
=childNodes
[i
];switch(child
.className
){case YAHOO
.widget
.Module
.CSS_HEADER
:this.header
=child
;break;case YAHOO
.widget
.Module
.CSS_BODY
:this.body
=child
;break;case YAHOO
.widget
.Module
.CSS_FOOTER
:this.footer
=child
;break;}}}
41 this.initDefaultConfig();YAHOO
.util
.Dom
.addClass(this.element
,YAHOO
.widget
.Module
.CSS_MODULE
);if(userConfig
){this.cfg
.applyConfig(userConfig
,true);}
42 if(!YAHOO
.util
.Config
.alreadySubscribed(this.renderEvent
,this.cfg
.fireQueue
,this.cfg
)){this.renderEvent
.subscribe(this.cfg
.fireQueue
,this.cfg
,true);}
43 this.initEvent
.fire(YAHOO
.widget
.Module
);},initResizeMonitor:function(){var resizeMonitor
=document
.getElementById("_yuiResizeMonitor");if(!resizeMonitor
){resizeMonitor
=document
.createElement("DIV");resizeMonitor
.style
.position
="absolute";resizeMonitor
.id
="_yuiResizeMonitor";resizeMonitor
.style
.width
="1em";resizeMonitor
.style
.height
="1em";resizeMonitor
.style
.top
="-1000px";resizeMonitor
.style
.left
="-1000px";resizeMonitor
.innerHTML
=" ";document
.body
.appendChild(resizeMonitor
);}
44 this.resizeMonitor
=resizeMonitor
;YAHOO
.util
.Event
.addListener(this.resizeMonitor
,"resize",this.onDomResize
,this,true);},onDomResize:function(e
,obj
){},setHeader:function(headerContent
){if(!this.header
){this.header
=document
.createElement("DIV");this.header
.className
=YAHOO
.widget
.Module
.CSS_HEADER
;}
45 if(typeof headerContent
=="string"){this.header
.innerHTML
=headerContent
;}else{this.header
.innerHTML
="";this.header
.appendChild(headerContent
);}
46 this.changeHeaderEvent
.fire(headerContent
);this.changeContentEvent
.fire();},appendToHeader:function(element
){if(!this.header
){this.header
=document
.createElement("DIV");this.header
.className
=YAHOO
.widget
.Module
.CSS_HEADER
;}
47 this.header
.appendChild(element
);this.changeHeaderEvent
.fire(element
);this.changeContentEvent
.fire();},setBody:function(bodyContent
){if(!this.body
){this.body
=document
.createElement("DIV");this.body
.className
=YAHOO
.widget
.Module
.CSS_BODY
;}
48 if(typeof bodyContent
=="string")
49 {this.body
.innerHTML
=bodyContent
;}else{this.body
.innerHTML
="";this.body
.appendChild(bodyContent
);}
50 this.changeBodyEvent
.fire(bodyContent
);this.changeContentEvent
.fire();},appendToBody:function(element
){if(!this.body
){this.body
=document
.createElement("DIV");this.body
.className
=YAHOO
.widget
.Module
.CSS_BODY
;}
51 this.body
.appendChild(element
);this.changeBodyEvent
.fire(element
);this.changeContentEvent
.fire();},setFooter:function(footerContent
){if(!this.footer
){this.footer
=document
.createElement("DIV");this.footer
.className
=YAHOO
.widget
.Module
.CSS_FOOTER
;}
52 if(typeof footerContent
=="string"){this.footer
.innerHTML
=footerContent
;}else{this.footer
.innerHTML
="";this.footer
.appendChild(footerContent
);}
53 this.changeFooterEvent
.fire(footerContent
);this.changeContentEvent
.fire();},appendToFooter:function(element
){if(!this.footer
){this.footer
=document
.createElement("DIV");this.footer
.className
=YAHOO
.widget
.Module
.CSS_FOOTER
;}
54 this.footer
.appendChild(element
);this.changeFooterEvent
.fire(element
);this.changeContentEvent
.fire();},render:function(appendToNode
,moduleElement
){this.beforeRenderEvent
.fire();if(!moduleElement
){moduleElement
=this.element
;}
55 var me
=this;var appendTo=function(element
){if(typeof element
=="string"){element
=document
.getElementById(element
);}
56 if(element
){element
.appendChild(me
.element
);me
.appendEvent
.fire();}}
57 if(appendToNode
){appendTo(appendToNode
);}else{if(!YAHOO
.util
.Dom
.inDocument(this.element
)){return false;}}
58 if(this.header
&&!YAHOO
.util
.Dom
.inDocument(this.header
)){var firstChild
=moduleElement
.firstChild
;if(firstChild
){moduleElement
.insertBefore(this.header
,firstChild
);}else{moduleElement
.appendChild(this.header
);}}
59 if(this.body
&&!YAHOO
.util
.Dom
.inDocument(this.body
)){if(this.footer
&&YAHOO
.util
.Dom
.isAncestor(this.moduleElement
,this.footer
)){moduleElement
.insertBefore(this.body
,this.footer
);}else{moduleElement
.appendChild(this.body
);}}
60 if(this.footer
&&!YAHOO
.util
.Dom
.inDocument(this.footer
)){moduleElement
.appendChild(this.footer
);}
61 this.renderEvent
.fire();return true;},destroy:function(){if(this.element
){var parent
=this.element
.parentNode
;}
62 if(parent
){parent
.removeChild(this.element
);}
63 this.element
=null;this.header
=null;this.body
=null;this.footer
=null;this.destroyEvent
.fire();},show:function(){this.cfg
.setProperty("visible",true);},hide:function(){this.cfg
.setProperty("visible",false);},configVisible:function(type
,args
,obj
){var visible
=args
[0];if(visible
){this.beforeShowEvent
.fire();YAHOO
.util
.Dom
.setStyle(this.element
,"display","block");this.showEvent
.fire();}else{this.beforeHideEvent
.fire();YAHOO
.util
.Dom
.setStyle(this.element
,"display","none");this.hideEvent
.fire();}},configMonitorResize:function(type
,args
,obj
){var monitor
=args
[0];if(monitor
){this.initResizeMonitor();}else{YAHOO
.util
.Event
.removeListener(this.resizeMonitor
,"resize",this.onDomResize
);this.resizeMonitor
=null;}}}
64 YAHOO
.widget
.Overlay=function(el
,userConfig
){if(arguments
.length
>0){YAHOO
.widget
.Overlay
.superclass
.constructor.call(this,el
,userConfig
);}}
65 YAHOO
.widget
.Overlay
.prototype=new YAHOO
.widget
.Module();YAHOO
.widget
.Overlay
.prototype.constructor=YAHOO
.widget
.Overlay
;YAHOO
.widget
.Overlay
.superclass
=YAHOO
.widget
.Module
.prototype;YAHOO
.widget
.Overlay
.IFRAME_SRC
="promo/m/irs/blank.gif";YAHOO
.widget
.Overlay
.TOP_LEFT
="tl";YAHOO
.widget
.Overlay
.TOP_RIGHT
="tr";YAHOO
.widget
.Overlay
.BOTTOM_LEFT
="bl";YAHOO
.widget
.Overlay
.BOTTOM_RIGHT
="br";YAHOO
.widget
.Overlay
.CSS_OVERLAY
="overlay";YAHOO
.widget
.Overlay
.prototype.beforeMoveEvent
=null;YAHOO
.widget
.Overlay
.prototype.moveEvent
=null;YAHOO
.widget
.Overlay
.prototype.init=function(el
,userConfig
){YAHOO
.widget
.Overlay
.superclass
.init
.call(this,el
);this.beforeInitEvent
.fire(YAHOO
.widget
.Overlay
);YAHOO
.util
.Dom
.addClass(this.element
,YAHOO
.widget
.Overlay
.CSS_OVERLAY
);if(userConfig
){this.cfg
.applyConfig(userConfig
,true);}
66 if(this.platform
=="mac"&&this.browser
=="gecko"){if(!YAHOO
.util
.Config
.alreadySubscribed(this.showEvent
,this.showMacGeckoScrollbars
,this)){this.showEvent
.subscribe(this.showMacGeckoScrollbars
,this,true);}
67 if(!YAHOO
.util
.Config
.alreadySubscribed(this.hideEvent
,this.hideMacGeckoScrollbars
,this)){this.hideEvent
.subscribe(this.hideMacGeckoScrollbars
,this,true);}}
68 this.initEvent
.fire(YAHOO
.widget
.Overlay
);}
69 YAHOO
.widget
.Overlay
.prototype.initEvents=function(){YAHOO
.widget
.Overlay
.superclass
.initEvents
.call(this);this.beforeMoveEvent
=new YAHOO
.util
.CustomEvent("beforeMove",this);this.moveEvent
=new YAHOO
.util
.CustomEvent("move",this);}
70 YAHOO
.widget
.Overlay
.prototype.initDefaultConfig=function(){YAHOO
.widget
.Overlay
.superclass
.initDefaultConfig
.call(this);this.cfg
.addProperty("x",{handler
:this.configX
,validator
:this.cfg
.checkNumber
,suppressEvent
:true,supercedes
:["iframe"]});this.cfg
.addProperty("y",{handler
:this.configY
,validator
:this.cfg
.checkNumber
,suppressEvent
:true,supercedes
:["iframe"]});this.cfg
.addProperty("xy",{handler
:this.configXY
,suppressEvent
:true,supercedes
:["iframe"]});this.cfg
.addProperty("context",{handler
:this.configContext
,suppressEvent
:true,supercedes
:["iframe"]});this.cfg
.addProperty("fixedcenter",{value
:false,handler
:this.configFixedCenter
,validator
:this.cfg
.checkBoolean
,supercedes
:["iframe","visible"]});this.cfg
.addProperty("width",{handler
:this.configWidth
,suppressEvent
:true,supercedes
:["iframe"]});this.cfg
.addProperty("height",{handler
:this.configHeight
,suppressEvent
:true,supercedes
:["iframe"]});this.cfg
.addProperty("zIndex",{value
:null,handler
:this.configzIndex
});this.cfg
.addProperty("constraintoviewport",{value
:false,handler
:this.configConstrainToViewport
,validator
:this.cfg
.checkBoolean
,supercedes
:["iframe","x","y","xy"]});this.cfg
.addProperty("iframe",{value
:(this.browser
=="ie"?true:false),handler
:this.configIframe
,validator
:this.cfg
.checkBoolean
,supercedes
:["zIndex"]});}
71 YAHOO
.widget
.Overlay
.prototype.moveTo=function(x
,y
){this.cfg
.setProperty("xy",[x
,y
]);}
72 YAHOO
.widget
.Overlay
.prototype.hideMacGeckoScrollbars=function(){YAHOO
.util
.Dom
.removeClass(this.element
,"show-scrollbars");YAHOO
.util
.Dom
.addClass(this.element
,"hide-scrollbars");}
73 YAHOO
.widget
.Overlay
.prototype.showMacGeckoScrollbars=function(){YAHOO
.util
.Dom
.removeClass(this.element
,"hide-scrollbars");YAHOO
.util
.Dom
.addClass(this.element
,"show-scrollbars");}
74 YAHOO
.widget
.Overlay
.prototype.configVisible=function(type
,args
,obj
){var visible
=args
[0];var currentVis
=YAHOO
.util
.Dom
.getStyle(this.element
,"visibility");var effect
=this.cfg
.getProperty("effect");var effectInstances
=new Array();if(effect
){if(effect
instanceof Array
){for(var i
=0;i
<effect
.length
;i
++){var eff
=effect
[i
];effectInstances
[effectInstances
.length
]=eff
.effect(this,eff
.duration
);}}else{effectInstances
[effectInstances
.length
]=effect
.effect(this,effect
.duration
);}}
75 var isMacGecko
=(this.platform
=="mac"&&this.browser
=="gecko");if(visible
){if(isMacGecko
){this.showMacGeckoScrollbars();}
76 if(effect
){if(visible
){if(currentVis
!="visible"){this.beforeShowEvent
.fire();for(var i
=0;i
<effectInstances
.length
;i
++){var e
=effectInstances
[i
];if(i
==0&&!YAHOO
.util
.Config
.alreadySubscribed(e
.animateInCompleteEvent
,this.showEvent
.fire
,this.showEvent
)){e
.animateInCompleteEvent
.subscribe(this.showEvent
.fire
,this.showEvent
,true);}
77 e
.animateIn();}}}}else{if(currentVis
!="visible"){this.beforeShowEvent
.fire();YAHOO
.util
.Dom
.setStyle(this.element
,"visibility","visible");this.cfg
.refireEvent("iframe");this.showEvent
.fire();}}}else{if(isMacGecko
){this.hideMacGeckoScrollbars();}
78 if(effect
){if(currentVis
!="hidden"){this.beforeHideEvent
.fire();for(var i
=0;i
<effectInstances
.length
;i
++){var e
=effectInstances
[i
];if(i
==0&&!YAHOO
.util
.Config
.alreadySubscribed(e
.animateOutCompleteEvent
,this.hideEvent
.fire
,this.hideEvent
)){e
.animateOutCompleteEvent
.subscribe(this.hideEvent
.fire
,this.hideEvent
,true);}
79 e
.animateOut();}}}else{if(currentVis
!="hidden"){this.beforeHideEvent
.fire();YAHOO
.util
.Dom
.setStyle(this.element
,"visibility","hidden");this.cfg
.refireEvent("iframe");this.hideEvent
.fire();}}}}
80 YAHOO
.widget
.Overlay
.prototype.doCenterOnDOMEvent=function(){if(this.cfg
.getProperty("visible")){this.center();}}
81 YAHOO
.widget
.Overlay
.prototype.configFixedCenter=function(type
,args
,obj
){var val
=args
[0];if(val
){this.center();if(!YAHOO
.util
.Config
.alreadySubscribed(this.beforeShowEvent
,this.center
,this)){this.beforeShowEvent
.subscribe(this.center
,this,true);}
82 if(!YAHOO
.util
.Config
.alreadySubscribed(YAHOO
.widget
.Overlay
.windowResizeEvent
,this.doCenterOnDOMEvent
,this)){YAHOO
.widget
.Overlay
.windowResizeEvent
.subscribe(this.doCenterOnDOMEvent
,this,true);}
83 if(!YAHOO
.util
.Config
.alreadySubscribed(YAHOO
.widget
.Overlay
.windowScrollEvent
,this.doCenterOnDOMEvent
,this)){YAHOO
.widget
.Overlay
.windowScrollEvent
.subscribe(this.doCenterOnDOMEvent
,this,true);}}else{YAHOO
.widget
.Overlay
.windowResizeEvent
.unsubscribe(this.doCenterOnDOMEvent
,this);YAHOO
.widget
.Overlay
.windowScrollEvent
.unsubscribe(this.doCenterOnDOMEvent
,this);}}
84 YAHOO
.widget
.Overlay
.prototype.configHeight=function(type
,args
,obj
){var height
=args
[0];var el
=this.element
;YAHOO
.util
.Dom
.setStyle(el
,"height",height
);this.cfg
.refireEvent("iframe");}
85 YAHOO
.widget
.Overlay
.prototype.configWidth=function(type
,args
,obj
){var width
=args
[0];var el
=this.element
;YAHOO
.util
.Dom
.setStyle(el
,"width",width
);this.cfg
.refireEvent("iframe");}
86 YAHOO
.widget
.Overlay
.prototype.configzIndex=function(type
,args
,obj
){var zIndex
=args
[0];var el
=this.element
;if(!zIndex
){zIndex
=YAHOO
.util
.Dom
.getStyle(el
,"zIndex");if(!zIndex
||isNaN(zIndex
)){zIndex
=0;}}
87 if(this.iframe
){if(zIndex
<=0){zIndex
=1;}
88 YAHOO
.util
.Dom
.setStyle(this.iframe
,"zIndex",(zIndex
-1));}
89 YAHOO
.util
.Dom
.setStyle(el
,"zIndex",zIndex
);this.cfg
.setProperty("zIndex",zIndex
,true);}
90 YAHOO
.widget
.Overlay
.prototype.configXY=function(type
,args
,obj
){var pos
=args
[0];var x
=pos
[0];var y
=pos
[1];this.cfg
.setProperty("x",x
);this.cfg
.setProperty("y",y
);this.beforeMoveEvent
.fire([x
,y
]);x
=this.cfg
.getProperty("x");y
=this.cfg
.getProperty("y");this.cfg
.refireEvent("iframe");this.moveEvent
.fire([x
,y
]);}
91 YAHOO
.widget
.Overlay
.prototype.configX=function(type
,args
,obj
){var x
=args
[0];var y
=this.cfg
.getProperty("y");this.cfg
.setProperty("x",x
,true);this.cfg
.setProperty("y",y
,true);this.beforeMoveEvent
.fire([x
,y
]);x
=this.cfg
.getProperty("x");y
=this.cfg
.getProperty("y");YAHOO
.util
.Dom
.setX(this.element
,x
,true);this.cfg
.setProperty("xy",[x
,y
],true);this.cfg
.refireEvent("iframe");this.moveEvent
.fire([x
,y
]);}
92 YAHOO
.widget
.Overlay
.prototype.configY=function(type
,args
,obj
){var x
=this.cfg
.getProperty("x");var y
=args
[0];this.cfg
.setProperty("x",x
,true);this.cfg
.setProperty("y",y
,true);this.beforeMoveEvent
.fire([x
,y
]);x
=this.cfg
.getProperty("x");y
=this.cfg
.getProperty("y");YAHOO
.util
.Dom
.setY(this.element
,y
,true);this.cfg
.setProperty("xy",[x
,y
],true);this.cfg
.refireEvent("iframe");this.moveEvent
.fire([x
,y
]);}
93 YAHOO
.widget
.Overlay
.prototype.configIframe=function(type
,args
,obj
){var val
=args
[0];var el
=this.element
;if(val
){var x
=this.cfg
.getProperty("x");var y
=this.cfg
.getProperty("y");if(!x
||!y
){this.syncPosition();x
=this.cfg
.getProperty("x");y
=this.cfg
.getProperty("y");}
94 if(!isNaN(x
)&&!isNaN(y
)){if(!this.iframe
){this.iframe
=document
.createElement("iframe");var parent
=el
.parentNode
;if(parent
){parent
.appendChild(this.iframe
);}else{document
.body
.appendChild(this.iframe
);}
95 this.iframe
.src
=this.imageRoot
+YAHOO
.widget
.Overlay
.IFRAME_SRC
;YAHOO
.util
.Dom
.setStyle(this.iframe
,"position","absolute");YAHOO
.util
.Dom
.setStyle(this.iframe
,"border","none");YAHOO
.util
.Dom
.setStyle(this.iframe
,"margin","0");YAHOO
.util
.Dom
.setStyle(this.iframe
,"padding","0");YAHOO
.util
.Dom
.setStyle(this.iframe
,"opacity","0");}
96 YAHOO
.util
.Dom
.setStyle(this.iframe
,"left",x
-2+"px");YAHOO
.util
.Dom
.setStyle(this.iframe
,"top",y
-2+"px");var width
=el
.clientWidth
;var height
=el
.clientHeight
;YAHOO
.util
.Dom
.setStyle(this.iframe
,"width",(width
+2)+"px");YAHOO
.util
.Dom
.setStyle(this.iframe
,"height",(height
+2)+"px");if(!this.cfg
.getProperty("visible")){this.iframe
.style
.display
="none";}else{this.iframe
.style
.display
="block";}}}else{if(this.iframe
){this.iframe
.style
.display
="none";}}}
97 YAHOO
.widget
.Overlay
.prototype.configConstrainToViewport=function(type
,args
,obj
){var val
=args
[0];if(val
){if(!YAHOO
.util
.Config
.alreadySubscribed(this.beforeMoveEvent
,this.enforceConstraints
,this)){this.beforeMoveEvent
.subscribe(this.enforceConstraints
,this,true);}}else{this.beforeMoveEvent
.unsubscribe(this.enforceConstraints
,this);}}
98 YAHOO
.widget
.Overlay
.prototype.configContext=function(type
,args
,obj
){var contextArgs
=args
[0];if(contextArgs
){var contextEl
=contextArgs
[0];var elementMagnetCorner
=contextArgs
[1];var contextMagnetCorner
=contextArgs
[2];if(contextEl
){if(typeof contextEl
=="string"){this.cfg
.setProperty("context",[document
.getElementById(contextEl
),elementMagnetCorner
,contextMagnetCorner
],true);}
99 if(elementMagnetCorner
&&contextMagnetCorner
){this.align(elementMagnetCorner
,contextMagnetCorner
);}}}}
100 YAHOO
.widget
.Overlay
.prototype.align=function(elementAlign
,contextAlign
){var contextArgs
=this.cfg
.getProperty("context");if(contextArgs
){var context
=contextArgs
[0];var element
=this.element
;var me
=this;if(!elementAlign
){elementAlign
=contextArgs
[1];}
101 if(!contextAlign
){contextAlign
=contextArgs
[2];}
102 if(element
&&context
){var elementRegion
=YAHOO
.util
.Dom
.getRegion(element
);var contextRegion
=YAHOO
.util
.Dom
.getRegion(context
);var doAlign=function(v
,h
){switch(elementAlign
){case YAHOO
.widget
.Overlay
.TOP_LEFT
:me
.moveTo(h
,v
);break;case YAHOO
.widget
.Overlay
.TOP_RIGHT
:me
.moveTo(h
-element
.offsetWidth
,v
);break;case YAHOO
.widget
.Overlay
.BOTTOM_LEFT
:me
.moveTo(h
,v
-element
.offsetHeight
);break;case YAHOO
.widget
.Overlay
.BOTTOM_RIGHT
:me
.moveTo(h
-element
.offsetWidth
,v
-element
.offsetHeight
);break;}}
103 switch(contextAlign
){case YAHOO
.widget
.Overlay
.TOP_LEFT
:doAlign(contextRegion
.top
,contextRegion
.left
);break;case YAHOO
.widget
.Overlay
.TOP_RIGHT
:doAlign(contextRegion
.top
,contextRegion
.right
);break;case YAHOO
.widget
.Overlay
.BOTTOM_LEFT
:doAlign(contextRegion
.bottom
,contextRegion
.left
);break;case YAHOO
.widget
.Overlay
.BOTTOM_RIGHT
:doAlign(contextRegion
.bottom
,contextRegion
.right
);break;}}}}
104 YAHOO
.widget
.Overlay
.prototype.enforceConstraints=function(type
,args
,obj
){var pos
=args
[0];var x
=pos
[0];var y
=pos
[1];var width
=parseInt(this.cfg
.getProperty("width"));if(isNaN(width
)){width
=0;}
105 var offsetHeight
=this.element
.offsetHeight
;var offsetWidth
=(width
>0?width
:this.element
.offsetWidth
);var viewPortWidth
=YAHOO
.util
.Dom
.getViewportWidth();var viewPortHeight
=YAHOO
.util
.Dom
.getViewportHeight();var scrollX
=window
.scrollX
||document
.documentElement
.scrollLeft
;var scrollY
=window
.scrollY
||document
.documentElement
.scrollTop
;var topConstraint
=scrollY
+10;var leftConstraint
=scrollX
+10;var bottomConstraint
=scrollY
+viewPortHeight
-offsetHeight
-10;var rightConstraint
=scrollX
+viewPortWidth
-offsetWidth
-10;if(x
<leftConstraint
){x
=leftConstraint
;}else if(x
>rightConstraint
){x
=rightConstraint
;}
106 if(y
<topConstraint
){y
=topConstraint
;}else if(y
>bottomConstraint
){y
=bottomConstraint
;}
107 this.cfg
.setProperty("x",x
,true);this.cfg
.setProperty("y",y
,true);this.cfg
.setProperty("xy",[x
,y
],true);}
108 YAHOO
.widget
.Overlay
.prototype.center=function(){var scrollX
=window
.scrollX
||document
.documentElement
.scrollLeft
;var scrollY
=window
.scrollY
||document
.documentElement
.scrollTop
;var viewPortWidth
=YAHOO
.util
.Dom
.getClientWidth();var viewPortHeight
=YAHOO
.util
.Dom
.getClientHeight();var elementWidth
=this.element
.offsetWidth
;var elementHeight
=this.element
.offsetHeight
;var x
=(viewPortWidth
/2)-(elementWidth/2)+scrollX
;var y
=(viewPortHeight
/2)-(elementHeight/2)+scrollY
;this.element
.style
.left
=parseInt(x
)+"px";this.element
.style
.top
=parseInt(y
)+"px";this.syncPosition();this.cfg
.refireEvent("iframe");}
109 YAHOO
.widget
.Overlay
.prototype.syncPosition=function(){var pos
=YAHOO
.util
.Dom
.getXY(this.element
);this.cfg
.setProperty("x",pos
[0],true);this.cfg
.setProperty("y",pos
[1],true);this.cfg
.setProperty("xy",pos
,true);}
110 YAHOO
.widget
.Overlay
.prototype.onDomResize=function(e
,obj
){YAHOO
.widget
.Overlay
.superclass
.onDomResize
.call(this,e
,obj
);this.cfg
.refireEvent("iframe");}
111 YAHOO
.widget
.Overlay
.windowScrollEvent
=new YAHOO
.util
.CustomEvent("windowScroll");YAHOO
.widget
.Overlay
.windowResizeEvent
=new YAHOO
.util
.CustomEvent("windowResize");YAHOO
.widget
.Overlay
.windowScrollHandler=function(e
){YAHOO
.widget
.Overlay
.windowScrollEvent
.fire();}
112 YAHOO
.widget
.Overlay
.windowResizeHandler=function(e
){YAHOO
.widget
.Overlay
.windowResizeEvent
.fire();}
113 if(YAHOO
.widget
.Overlay
._initialized
==undefined){YAHOO
.util
.Event
.addListener(window
,"scroll",YAHOO
.widget
.Overlay
.windowScrollHandler
);YAHOO
.util
.Event
.addListener(window
,"resize",YAHOO
.widget
.Overlay
.windowResizeHandler
);YAHOO
.widget
.Overlay
._initialized
=true;}
114 YAHOO
.widget
.OverlayManager=function(userConfig
){this.init(userConfig
);}
115 YAHOO
.widget
.OverlayManager
.CSS_FOCUSED
="focused";YAHOO
.widget
.OverlayManager
.prototype={constructor:YAHOO
.widget
.OverlayManager
,overlays
:new Array(),initDefaultConfig:function(){this.cfg
.addProperty("overlays",{suppressEvent
:true});this.cfg
.addProperty("focusevent",{value
:"mousedown"});},getActive:function(){},focus:function(overlay
){},remove:function(overlay
){},blurAll:function(){},init:function(userConfig
){this.cfg
=new YAHOO
.util
.Config(this);this.initDefaultConfig();if(userConfig
){this.cfg
.applyConfig(userConfig
,true);}
116 this.cfg
.fireQueue();var activeOverlay
=null;this.getActive=function(){return activeOverlay
;}
117 this.focus=function(overlay
){var o
=this.find(overlay
);if(o
){this.blurAll();activeOverlay
=o
;YAHOO
.util
.Dom
.addClass(activeOverlay
.element
,YAHOO
.widget
.OverlayManager
.CSS_FOCUSED
);this.overlays
.sort(this.compareZIndexDesc
);var topZIndex
=YAHOO
.util
.Dom
.getStyle(this.overlays
[0].element
,"zIndex");if(!isNaN(topZIndex
)&&this.overlays
[0]!=overlay
){activeOverlay
.cfg
.setProperty("zIndex",(parseInt(topZIndex
)+1));}
118 this.overlays
.sort(this.compareZIndexDesc
);}}
119 this.remove=function(overlay
){var o
=this.find(overlay
);if(o
){var originalZ
=YAHOO
.util
.Dom
.getStyle(o
.element
,"zIndex");o
.cfg
.setProperty("zIndex",-1000,true);this.overlays
.sort(this.compareZIndexDesc
);this.overlays
=this.overlays
.slice(0,this.overlays
.length
-1);o
.cfg
.setProperty("zIndex",originalZ
,true);o
.cfg
.setProperty("manager",null);o
.focusEvent
=null
120 o
.blurEvent
=null;o
.focus
=null;o
.blur
=null;}}
121 this.blurAll=function(){activeOverlay
=null;for(var o
=0;o
<this.overlays
.length
;o
++){YAHOO
.util
.Dom
.removeClass(this.overlays
[o
].element
,YAHOO
.widget
.OverlayManager
.CSS_FOCUSED
);}}
122 var overlays
=this.cfg
.getProperty("overlays");if(overlays
){this.register(overlays
);this.overlays
.sort(this.compareZIndexDesc
);}},register:function(overlay
){if(overlay
instanceof YAHOO
.widget
.Overlay
){overlay
.cfg
.addProperty("manager",{value
:this});overlay
.focusEvent
=new YAHOO
.util
.CustomEvent("focus");overlay
.blurEvent
=new YAHOO
.util
.CustomEvent("blur");var mgr
=this;overlay
.focus=function(){mgr
.focus(this);this.focusEvent
.fire();}
123 overlay
.blur=function(){mgr
.blurAll();this.blurEvent
.fire();}
124 var focusOnDomEvent=function(e
,obj
){mgr
.focus(overlay
);}
125 var focusevent
=this.cfg
.getProperty("focusevent");YAHOO
.util
.Event
.addListener(overlay
.element
,focusevent
,focusOnDomEvent
,this,true);var zIndex
=YAHOO
.util
.Dom
.getStyle(overlay
.element
,"zIndex");if(!isNaN(zIndex
)){overlay
.cfg
.setProperty("zIndex",parseInt(zIndex
));}else{overlay
.cfg
.setProperty("zIndex",0);}
126 this.overlays
.push(overlay
);return true;}else if(overlay
instanceof Array
){var regcount
=0;for(var i
=0;i
<overlay
.length
;i
++){if(this.register(overlay
[i
])){regcount
++;}}
127 if(regcount
>0){return true;}}else{return false;}},find:function(overlay
){if(overlay
instanceof YAHOO
.widget
.Overlay
){for(var o
=0;o
<this.overlays
.length
;o
++){if(this.overlays
[o
]==overlay
){return this.overlays
[o
];}}}else if(typeof overlay
=="string"){for(var o
=0;o
<this.overlays
.length
;o
++){if(this.overlays
[o
].id
==overlay
){return this.overlays
[o
];}}}
128 return null;},compareZIndexDesc:function(o1
,o2
){var zIndex1
=o1
.cfg
.getProperty("zIndex");var zIndex2
=o2
.cfg
.getProperty("zIndex");if(zIndex1
>zIndex2
){return-1;}else if(zIndex1
<zIndex2
){return 1;}else{return 0;}},showAll:function(){for(var o
=0;o
<this.overlays
.length
;o
++){this.overlays
[o
].show();}},hideAll:function(){for(var o
=0;o
<this.overlays
.length
;o
++){this.overlays
[o
].hide();}}}
129 YAHOO
.util
.KeyListener=function(attachTo
,keyData
,handler
,event
){if(!event
){event
=YAHOO
.util
.KeyListener
.KEYDOWN
;}
130 var keyEvent
=new YAHOO
.util
.CustomEvent("keyPressed");this.enabledEvent
=new YAHOO
.util
.CustomEvent("enabled");this.disabledEvent
=new YAHOO
.util
.CustomEvent("disabled");if(typeof attachTo
=='string'){attachTo
=document
.getElementById(attachTo
);}
131 if(typeof handler
=='function'){keyEvent
.subscribe(handler
);}else{keyEvent
.subscribe(handler
.fn
,handler
.scope
,handler
.correctScope
);}
132 var handleKeyPress=function(e
,obj
){var keyPressed
=e
.charCode
||e
.keyCode
;if(!keyData
.shift
)keyData
.shift
=false;if(!keyData
.alt
)keyData
.alt
=false;if(!keyData
.ctrl
)keyData
.ctrl
=false;if(e
.shiftKey
==keyData
.shift
&&e
.altKey
==keyData
.alt
&&e
.ctrlKey
==keyData
.ctrl
){if(keyData
.keys
instanceof Array
){for(var i
=0;i
<keyData
.keys
.length
;i
++){if(keyPressed
==keyData
.keys
[i
]){keyEvent
.fire(keyPressed
,e
);break;}}}else{if(keyPressed
==keyData
.keys
){keyEvent
.fire(keyPressed
,e
);}}}}
133 this.enable=function(){if(!this.enabled
){YAHOO
.util
.Event
.addListener(attachTo
,event
,handleKeyPress
);this.enabledEvent
.fire(keyData
);}
135 this.disable=function(){if(this.enabled
){YAHOO
.util
.Event
.removeListener(attachTo
,event
,handleKeyPress
);this.disabledEvent
.fire(keyData
);}
136 this.enabled
=false;}}
137 YAHOO
.util
.KeyListener
.KEYDOWN
="keydown";YAHOO
.util
.KeyListener
.KEYUP
="keyup";YAHOO
.util
.KeyListener
.prototype.enable=function(){};YAHOO
.util
.KeyListener
.prototype.disable=function(){};YAHOO
.util
.KeyListener
.prototype.enabledEvent
=null;YAHOO
.util
.KeyListener
.prototype.disabledEvent
=null;YAHOO
.widget
.Tooltip=function(el
,userConfig
){if(arguments
.length
>0){YAHOO
.widget
.Tooltip
.superclass
.constructor.call(this,el
,userConfig
);}}
138 YAHOO
.widget
.Tooltip
.prototype=new YAHOO
.widget
.Overlay();YAHOO
.widget
.Tooltip
.prototype.constructor=YAHOO
.widget
.Tooltip
;YAHOO
.widget
.Tooltip
.superclass
=YAHOO
.widget
.Overlay
.prototype;YAHOO
.widget
.Tooltip
.CSS_TOOLTIP
="tt";YAHOO
.widget
.Tooltip
.prototype.init=function(el
,userConfig
){if(document
.readyState
&&document
.readyState
!="complete"){var deferredInit=function(){this.init(el
,userConfig
);}
139 YAHOO
.util
.Event
.addListener(window
,"load",deferredInit
,this,true);}else{YAHOO
.widget
.Tooltip
.superclass
.init
.call(this,el
);this.beforeInitEvent
.fire(YAHOO
.widget
.Tooltip
);YAHOO
.util
.Dom
.addClass(this.element
,YAHOO
.widget
.Tooltip
.CSS_TOOLTIP
);if(userConfig
){this.cfg
.applyConfig(userConfig
,true);}
140 this.cfg
.queueProperty("visible",false);this.cfg
.queueProperty("constraintoviewport",true);this.setBody("");this.render(this.cfg
.getProperty("container"));this.initEvent
.fire(YAHOO
.widget
.Tooltip
);}}
141 YAHOO
.widget
.Tooltip
.prototype.initDefaultConfig=function(){YAHOO
.widget
.Tooltip
.superclass
.initDefaultConfig
.call(this);this.cfg
.addProperty("preventoverlap",{value
:true,handler
:this.configPreventOverlap
,validator
:this.cfg
.checkBoolean
,supercedes
:["x","y","xy"]});this.cfg
.addProperty("showdelay",{value
:200,handler
:this.configShowDelay
,validator
:this.cfg
.checkNumber
});this.cfg
.addProperty("autodismissdelay",{value
:5000,handler
:this.configAutoDismissDelay
,validator
:this.cfg
.checkNumber
});this.cfg
.addProperty("hidedelay",{value
:250,handler
:this.configHideDelay
,validator
:this.cfg
.checkNumber
});this.cfg
.addProperty("text",{handler
:this.configText
,suppressEvent
:true});this.cfg
.addProperty("container",{value
:document
.body
,handler
:this.configContainer
});}
142 YAHOO
.widget
.Tooltip
.prototype.configText=function(type
,args
,obj
){var text
=args
[0];if(text
){this.setBody(text
);}}
143 YAHOO
.widget
.Tooltip
.prototype.configContainer=function(type
,args
,obj
){var container
=args
[0];if(typeof container
=='string'){this.cfg
.setProperty("container",document
.getElementById(container
),true);}}
144 YAHOO
.widget
.Tooltip
.prototype.configPreventOverlap=function(type
,args
,obj
){var preventoverlap
=args
[0];if(preventoverlap
){if(!YAHOO
.util
.Config
.alreadySubscribed(this.moveEvent
,this.preventOverlap
,this)){this.moveEvent
.subscribe(this.preventOverlap
,this,true);}}else{this.moveEvent
.unsubscribe(this.preventOverlap
,this);}}
145 YAHOO
.widget
.Tooltip
.prototype.configContext=function(type
,args
,obj
){var context
=args
[0];if(context
){if(typeof context
=="string"){this.cfg
.setProperty("context",document
.getElementById(context
),true);}
146 var contextElement
=this.cfg
.getProperty("context");if(contextElement
&&contextElement
.title
&&!this.cfg
.getProperty("text")){this.cfg
.setProperty("text",contextElement
.title
);}
147 YAHOO
.util
.Event
.addListener(contextElement
,"mouseover",this.onContextMouseOver
,this);YAHOO
.util
.Event
.addListener(contextElement
,"mouseout",this.onContextMouseOut
,this);}}
148 YAHOO
.widget
.Tooltip
.prototype.onContextMouseOver=function(e
,obj
){if(!obj
){obj
=this;}
149 var context
=obj
.cfg
.getProperty("context");if(context
.title
){obj
.tempTitle
=context
.title
;context
.title
="";}
150 this.procId
=obj
.doShow(e
);}
151 YAHOO
.widget
.Tooltip
.prototype.onContextMouseOut=function(e
,obj
){if(!obj
){obj
=this;}
152 var context
=obj
.cfg
.getProperty("context");if(obj
.tempTitle
){context
.title
=obj
.tempTitle
;}
153 if(this.procId
){clearTimeout(this.procId
);}
154 setTimeout(function(){obj
.hide();},obj
.cfg
.getProperty("hidedelay"));}
155 YAHOO
.widget
.Tooltip
.prototype.doShow=function(e
){var pageX
=YAHOO
.util
.Event
.getPageX(e
);var pageY
=YAHOO
.util
.Event
.getPageY(e
);var context
=this.cfg
.getProperty("context");var yOffset
=25;if(this.browser
=="opera"&&context
.tagName
=="A"){yOffset
+=12;}
156 var me
=this;return setTimeout(function(){me
.moveTo(pageX
,pageY
+yOffset
);me
.show();me
.doHide();},this.cfg
.getProperty("showdelay"));}
157 YAHOO
.widget
.Tooltip
.prototype.doHide=function(){var me
=this;setTimeout(function(){me
.hide();},this.cfg
.getProperty("autodismissdelay"));}
158 YAHOO
.widget
.Tooltip
.prototype.preventOverlap=function(type
,args
,obj
){var pos
=args
[0];var x
=pos
[0];var y
=pos
[1];var elementRegion
=YAHOO
.util
.Dom
.getRegion(this.element
);var contextRegion
=YAHOO
.util
.Dom
.getRegion(this.cfg
.getProperty("context"));var intersection
=contextRegion
.intersect(elementRegion
);if(intersection
){var overlapHeight
=intersection
.bottom
-intersection
.top
;y
=(y
-overlapHeight
-10);this.cfg
.setProperty("y",y
);}}
159 YAHOO
.widget
.Panel=function(el
,userConfig
){if(arguments
.length
>0){YAHOO
.widget
.Panel
.superclass
.constructor.call(this,el
,userConfig
);}}
160 YAHOO
.widget
.Panel
.prototype=new YAHOO
.widget
.Overlay();YAHOO
.widget
.Panel
.prototype.constructor=YAHOO
.widget
.Panel
;YAHOO
.widget
.Panel
.superclass
=YAHOO
.widget
.Overlay
.prototype;YAHOO
.widget
.Panel
.CSS_PANEL
="panel";YAHOO
.widget
.Panel
.CSS_PANEL_CONTAINER
="panel-container";YAHOO
.widget
.Panel
.prototype.showMaskEvent
=null;YAHOO
.widget
.Panel
.prototype.hideMaskEvent
=null;YAHOO
.widget
.Panel
.prototype.init=function(el
,userConfig
){YAHOO
.widget
.Panel
.superclass
.init
.call(this,el
);this.beforeInitEvent
.fire(YAHOO
.widget
.Panel
);YAHOO
.util
.Dom
.addClass(this.element
,YAHOO
.widget
.Panel
.CSS_PANEL
);this.buildWrapper();if(userConfig
){this.cfg
.applyConfig(userConfig
,true);}
161 this.beforeRenderEvent
.subscribe(function(){var draggable
=this.cfg
.getProperty("draggable");if(draggable
){if(!this.header
){this.setHeader(" ");}}},this,true);this.initEvent
.fire(YAHOO
.widget
.Panel
);}
162 YAHOO
.widget
.Panel
.prototype.initEvents=function(){YAHOO
.widget
.Panel
.superclass
.initEvents
.call(this);this.showMaskEvent
=new YAHOO
.util
.CustomEvent("showMask");this.hideMaskEvent
=new YAHOO
.util
.CustomEvent("hideMask");}
163 YAHOO
.widget
.Panel
.prototype.initDefaultConfig=function(){YAHOO
.widget
.Panel
.superclass
.initDefaultConfig
.call(this);this.cfg
.addProperty("close",{value
:true,handler
:this.configClose
,validator
:this.cfg
.checkBoolean
,supercedes
:["visible"]});this.cfg
.addProperty("draggable",{value
:true,handler
:this.configDraggable
,validator
:this.cfg
.checkBoolean
,supercedes
:["visible"]});this.cfg
.addProperty("underlay",{value
:"shadow",handler
:this.configUnderlay
,supercedes
:["visible"]});this.cfg
.addProperty("modal",{value
:false,handler
:this.configModal
,validator
:this.cfg
.checkBoolean
,supercedes
:["visible"]});this.cfg
.addProperty("keylisteners",{handler
:this.configKeyListeners
,suppressEvent
:true,supercedes
:["visible"]});}
164 YAHOO
.widget
.Panel
.prototype.configClose=function(type
,args
,obj
){var val
=args
[0];var doHide=function(e
,obj
){obj
.hide();}
165 if(val
){if(!this.close
){this.close
=document
.createElement("DIV");YAHOO
.util
.Dom
.addClass(this.close
,"close");if(this.isSecure
){YAHOO
.util
.Dom
.addClass(this.close
,"secure");}else{YAHOO
.util
.Dom
.addClass(this.close
,"nonsecure");}
166 this.close
.innerHTML
=" ";this.innerElement
.appendChild(this.close
);YAHOO
.util
.Event
.addListener(this.close
,"click",doHide
,this);}else{this.close
.style
.display
="block";}}else{if(this.close
){this.close
.style
.display
="none";}}}
167 YAHOO
.widget
.Panel
.prototype.configDraggable=function(type
,args
,obj
){var val
=args
[0];if(val
){if(this.header
){YAHOO
.util
.Dom
.setStyle(this.header
,"cursor","move");this.registerDragDrop();}}else{if(this.dd
){this.dd
.unreg();}
168 if(this.header
){YAHOO
.util
.Dom
.setStyle(this.header
,"cursor","auto");}}}
169 YAHOO
.widget
.Panel
.prototype.configUnderlay=function(type
,args
,obj
){var val
=args
[0];switch(val
.toLowerCase()){case"shadow":YAHOO
.util
.Dom
.removeClass(this.element
,"matte");YAHOO
.util
.Dom
.addClass(this.element
,"shadow");if(!this.underlay
){this.underlay
=document
.createElement("DIV");this.underlay
.className
="underlay";this.underlay
.innerHTML
=" ";this.element
.appendChild(this.underlay
);}
170 this.sizeUnderlay();break;case"matte":YAHOO
.util
.Dom
.removeClass(this.element
,"shadow");YAHOO
.util
.Dom
.addClass(this.element
,"matte");break;case"none":default:YAHOO
.util
.Dom
.removeClass(this.element
,"shadow");YAHOO
.util
.Dom
.removeClass(this.element
,"matte");break;}}
171 YAHOO
.widget
.Panel
.prototype.configModal=function(type
,args
,obj
){var modal
=args
[0];if(modal
){this.buildMask();if(!YAHOO
.util
.Config
.alreadySubscribed(this.showEvent
,this.showMask
,this)){this.showEvent
.subscribe(this.showMask
,this,true);}
172 if(!YAHOO
.util
.Config
.alreadySubscribed(this.hideEvent
,this.hideMask
,this)){this.hideEvent
.subscribe(this.hideMask
,this,true);}
173 if(!YAHOO
.util
.Config
.alreadySubscribed(YAHOO
.widget
.Overlay
.windowResizeEvent
,this.sizeMask
,this)){YAHOO
.widget
.Overlay
.windowResizeEvent
.subscribe(this.sizeMask
,this,true);}}else{this.beforeShowEvent
.unsubscribe(this.showMask
,this);this.hideEvent
.unsubscribe(this.hideMask
,this);YAHOO
.widget
.Overlay
.windowResizeEvent
.unsubscribe(this.sizeMask
);}}
174 YAHOO
.widget
.Panel
.prototype.configKeyListeners=function(type
,args
,obj
){var listeners
=args
[0];if(listeners
){if(listeners
instanceof Array
){for(var i
=0;i
<listeners
.length
;i
++){var listener
=listeners
[i
];if(!YAHOO
.util
.Config
.alreadySubscribed(this.showEvent
,listener
.enable
,listener
)){this.showEvent
.subscribe(listener
.enable
,listener
,true);}
175 if(!YAHOO
.util
.Config
.alreadySubscribed(this.hideEvent
,listener
.disable
,listener
)){this.hideEvent
.subscribe(listener
.disable
,listener
,true);}}}else{if(!YAHOO
.util
.Config
.alreadySubscribed(this.showEvent
,listeners
.enable
,listeners
)){this.showEvent
.subscribe(listeners
.enable
,listeners
,true);}
176 if(!YAHOO
.util
.Config
.alreadySubscribed(this.hideEvent
,listeners
.disable
,listeners
)){this.hideEvent
.subscribe(listeners
.disable
,listeners
,true);}}}}
177 YAHOO
.widget
.Panel
.prototype.buildWrapper=function(){var elementParent
=this.element
.parentNode
;var elementClone
=this.element
.cloneNode(true);this.innerElement
=elementClone
;this.innerElement
.style
.visibility
="inherit";YAHOO
.util
.Dom
.addClass(this.innerElement
,"panel");var wrapper
=document
.createElement("DIV");wrapper
.className
=YAHOO
.widget
.Panel
.CSS_PANEL_CONTAINER
;wrapper
.id
=elementClone
.id
+"_c";wrapper
.appendChild(elementClone
);if(elementParent
){elementParent
.replaceChild(wrapper
,this.element
);}
178 this.element
=wrapper
;var childNodes
=this.innerElement
.childNodes
;if(childNodes
){for(var i
=0;i
<childNodes
.length
;i
++){var child
=childNodes
[i
];switch(child
.className
){case YAHOO
.widget
.Module
.CSS_HEADER
:this.header
=child
;break;case YAHOO
.widget
.Module
.CSS_BODY
:this.body
=child
;break;case YAHOO
.widget
.Module
.CSS_FOOTER
:this.footer
=child
;break;}}}
179 this.initDefaultConfig();}
180 YAHOO
.widget
.Panel
.prototype.sizeUnderlay=function(){if(this.underlay
&&this.browser
!="gecko"&&this.browser
!="safari"){this.underlay
.style
.width
=this.innerElement
.offsetWidth
+"px";this.underlay
.style
.height
=this.innerElement
.offsetHeight
+"px";}}
181 YAHOO
.widget
.Panel
.prototype.onDomResize=function(e
,obj
){YAHOO
.widget
.Panel
.superclass
.onDomResize
.call(this,e
,obj
);var me
=this;setTimeout(function(){me
.sizeUnderlay();},0);};YAHOO
.widget
.Panel
.prototype.registerDragDrop=function(){if(this.header
){this.dd
=new YAHOO
.util
.DD(this.element
.id
,"panel");if(!this.header
.id
){this.header
.id
=this.id
+"_h";}
182 var me
=this;this.dd
.startDrag=function(){if(me
.browser
=="ie"){YAHOO
.util
.Dom
.addClass(me
.element
,"drag");}
183 if(me
.cfg
.getProperty("constraintoviewport")){var offsetHeight
=me
.element
.offsetHeight
;var offsetWidth
=me
.element
.offsetWidth
;var viewPortWidth
=YAHOO
.util
.Dom
.getViewportWidth();var viewPortHeight
=YAHOO
.util
.Dom
.getViewportHeight();var scrollX
=window
.scrollX
||document
.documentElement
.scrollLeft
;var scrollY
=window
.scrollY
||document
.documentElement
.scrollTop
;var topConstraint
=scrollY
+10;var leftConstraint
=scrollX
+10;var bottomConstraint
=scrollY
+viewPortHeight
-offsetHeight
-10;var rightConstraint
=scrollX
+viewPortWidth
-offsetWidth
-10;this.minX
=leftConstraint
184 this.maxX
=rightConstraint
;this.constrainX
=true;this.minY
=topConstraint
;this.maxY
=bottomConstraint
;this.constrainY
=true;}else{this.constrainX
=false;this.constrainY
=false;}}
185 this.dd
.onDrag=function(){me
.syncPosition();me
.cfg
.refireEvent("iframe");if(this.platform
=="mac"&&this.browser
=="gecko"){this.showMacGeckoScrollbars();}}
186 this.dd
.endDrag=function(){if(me
.browser
=="ie"){YAHOO
.util
.Dom
.removeClass(me
.element
,"drag");}}
187 this.dd
.setHandleElId(this.header
.id
);this.dd
.addInvalidHandleType("INPUT");this.dd
.addInvalidHandleType("SELECT");this.dd
.addInvalidHandleType("TEXTAREA");}}
188 YAHOO
.widget
.Panel
.prototype.buildMask=function(){if(!this.mask
){this.mask
=document
.createElement("DIV");this.mask
.id
=this.id
+"_mask";this.mask
.className
="mask";this.mask
.innerHTML
=" ";var maskClick=function(e
,obj
){YAHOO
.util
.Event
.stopEvent(e
);}
189 YAHOO
.util
.Event
.addListener(this.mask
,maskClick
,this);if(this.browser
=="opera"){this.mask
.style
.backgroundColor
="transparent";}
190 document
.body
.appendChild(this.mask
);}}
191 YAHOO
.widget
.Panel
.prototype.hideMask=function(){if(this.cfg
.getProperty("modal")&&this.mask
){this.mask
.tabIndex
=-1;this.mask
.style
.display
="none";this.hideMaskEvent
.fire();YAHOO
.util
.Dom
.removeClass(document
.body
,"masked");}}
192 YAHOO
.widget
.Panel
.prototype.showMask=function(){if(this.cfg
.getProperty("modal")&&this.mask
){YAHOO
.util
.Dom
.addClass(document
.body
,"masked");this.sizeMask();this.mask
.style
.display
="block";this.mask
.tabIndex
=0;this.showMaskEvent
.fire();}}
193 YAHOO
.widget
.Panel
.prototype.sizeMask=function(){if(this.mask
){this.mask
.style
.height
=YAHOO
.util
.Dom
.getDocumentHeight()+"px";this.mask
.style
.width
=YAHOO
.util
.Dom
.getDocumentWidth()+"px";}}
194 YAHOO
.widget
.Panel
.prototype.configHeight=function(type
,args
,obj
){var height
=args
[0];var el
=this.innerElement
;YAHOO
.util
.Dom
.setStyle(el
,"height",height
);this.cfg
.refireEvent("underlay");this.cfg
.refireEvent("iframe");}
195 YAHOO
.widget
.Panel
.prototype.configWidth=function(type
,args
,obj
){var width
=args
[0];var el
=this.innerElement
;YAHOO
.util
.Dom
.setStyle(el
,"width",width
);this.cfg
.refireEvent("underlay");this.cfg
.refireEvent("iframe");}
196 YAHOO
.widget
.Panel
.prototype.render=function(appendToNode
){return YAHOO
.widget
.Panel
.superclass
.render
.call(this,appendToNode
,this.innerElement
);}
197 YAHOO
.widget
.Dialog=function(el
,userConfig
){if(arguments
.length
>0){YAHOO
.widget
.Dialog
.superclass
.constructor.call(this,el
,userConfig
);}}
198 YAHOO
.widget
.Dialog
.prototype=new YAHOO
.widget
.Panel();YAHOO
.widget
.Dialog
.prototype.constructor=YAHOO
.widget
.Dialog
;YAHOO
.widget
.Dialog
.superclass
=YAHOO
.widget
.Panel
.prototype;YAHOO
.widget
.Dialog
.CSS_DIALOG
="dialog";YAHOO
.widget
.Dialog
.prototype.beforeSubmitEvent
=null;YAHOO
.widget
.Dialog
.prototype.submitEvent
=null;YAHOO
.widget
.Dialog
.prototype.manualSubmitEvent
=null;YAHOO
.widget
.Dialog
.prototype.asyncSubmitEvent
=null;YAHOO
.widget
.Dialog
.prototype.formSubmitEvent
=null;YAHOO
.widget
.Dialog
.prototype.cancelEvent
=null;YAHOO
.widget
.Dialog
.prototype.initDefaultConfig=function(){YAHOO
.widget
.Dialog
.superclass
.initDefaultConfig
.call(this);var callback
={success
:null,failure
:null,argument
:null,scope
:this}
199 this.configOnSuccess=function(type
,args
,obj
){var fn
=args
[0];callback
.success
=fn
;}
200 this.configOnFailure=function(type
,args
,obj
){var fn
=args
[0];callback
.failure
=fn
;}
201 this.doSubmit=function(){var method
=this.cfg
.getProperty("postmethod");switch(method
){case"async":YAHOO
.util
.Connect
.setForm(this.form
.name
);var cObj
=YAHOO
.util
.Connect
.asyncRequest('POST',this.form
.action
,callback
);this.asyncSubmitEvent
.fire();break;case"form":this.form
.submit();this.formSubmitEvent
.fire();break;case"none":case"manual":this.manualSubmitEvent
.fire();break;}}
202 this.cfg
.addProperty("postmethod",{value
:"async",validator:function(val
){if(val
!="form"&&val
!="async"&&val
!="none"&&val
!="manual"){return false;}else{return true;}}});this.cfg
.addProperty("onsuccess",{handler
:this.configOnSuccess
,suppressEvent
:true});this.cfg
.addProperty("onfailure",{handler
:this.configOnFailure
,suppressEvent
:true});this.cfg
.addProperty("buttons",{value
:"none",handler
:this.configButtons
});}
203 YAHOO
.widget
.Dialog
.prototype.initEvents=function(){YAHOO
.widget
.Dialog
.superclass
.initEvents
.call(this);this.beforeSubmitEvent
=new YAHOO
.util
.CustomEvent("beforeSubmit");this.submitEvent
=new YAHOO
.util
.CustomEvent("submit");this.manualSubmitEvent
=new YAHOO
.util
.CustomEvent("manualSubmit");this.asyncSubmitEvent
=new YAHOO
.util
.CustomEvent("asyncSubmit");this.formSubmitEvent
=new YAHOO
.util
.CustomEvent("formSubmit");this.cancelEvent
=new YAHOO
.util
.CustomEvent("cancel");}
204 YAHOO
.widget
.Dialog
.prototype.init=function(el
,userConfig
){YAHOO
.widget
.Dialog
.superclass
.init
.call(this,el
);this.beforeInitEvent
.fire(YAHOO
.widget
.Dialog
);YAHOO
.util
.Dom
.addClass(this.element
,YAHOO
.widget
.Dialog
.CSS_DIALOG
);if(userConfig
){this.cfg
.applyConfig(userConfig
,true);}
205 this.renderEvent
.subscribe(this.registerForm
,this,true);this.showEvent
.subscribe(this.focusFirst
,this,true);this.beforeHideEvent
.subscribe(this.blurButtons
,this,true);this.beforeRenderEvent
.subscribe(function(){var buttonCfg
=this.cfg
.getProperty("buttons");if(buttonCfg
&&buttonCfg
!="none"){if(!this.footer
){this.setFooter("");}}},this,true);this.initEvent
.fire(YAHOO
.widget
.Dialog
);}
206 YAHOO
.widget
.Dialog
.prototype.registerForm=function(){var form
=this.element
.getElementsByTagName("FORM")[0];if(!form
){var formHTML
="<form name=\"frm_"+this.id
+"\" action=\"\"></form>";this.body
.innerHTML
+=formHTML
;form
=this.element
.getElementsByTagName("FORM")[0];}
207 this.firstFormElement=function(){for(var f
=0;f
<form
.elements
.length
;f
++){var el
=form
.elements
[f
];if(el
.focus
){if(el
.type
&&el
.type
!="hidden"){return el
;break;}}}
208 return null;}();this.lastFormElement=function(){for(var f
=form
.elements
.length
-1;f
>=0;f
--){var el
=form
.elements
[f
];if(el
.focus
){if(el
.type
&&el
.type
!="hidden"){return el
;break;}}}
209 return null;}();this.form
=form
;if(this.cfg
.getProperty("modal")&&this.form
){var me
=this;var firstElement
=this.firstFormElement
||this.firstButton
;if(firstElement
){this.preventBackTab
=new YAHOO
.util
.KeyListener(firstElement
,{shift
:true,keys
:9},{fn
:me
.focusLast
,scope
:me
,correctScope
:true});this.showEvent
.subscribe(this.preventBackTab
.enable
,this.preventBackTab
,true);this.hideEvent
.subscribe(this.preventBackTab
.disable
,this.preventBackTab
,true);}
210 var lastElement
=this.lastButton
||this.lastFormElement
;if(lastElement
){this.preventTabOut
=new YAHOO
.util
.KeyListener(lastElement
,{shift
:false,keys
:9},{fn
:me
.focusFirst
,scope
:me
,correctScope
:true});this.showEvent
.subscribe(this.preventTabOut
.enable
,this.preventTabOut
,true);this.hideEvent
.subscribe(this.preventTabOut
.disable
,this.preventTabOut
,true);}}}
211 YAHOO
.widget
.Dialog
.prototype.configButtons=function(type
,args
,obj
){var buttons
=args
[0];if(buttons
!="none"){this.buttonSpan
=null;this.buttonSpan
=document
.createElement("SPAN");this.buttonSpan
.className
="button-group";for(var b
=0;b
<buttons
.length
;b
++){var button
=buttons
[b
];var htmlButton
=document
.createElement("BUTTON");if(button
.isDefault
){htmlButton
.className
="default";this.defaultHtmlButton
=htmlButton
;}
212 htmlButton
.appendChild(document
.createTextNode(button
.text
));YAHOO
.util
.Event
.addListener(htmlButton
,"click",button
.handler
,this,true);this.buttonSpan
.appendChild(htmlButton
);button
.htmlButton
=htmlButton
;if(b
==0){this.firstButton
=button
.htmlButton
;}
213 if(b
==(buttons
.length
-1)){this.lastButton
=button
.htmlButton
;}}
214 this.setFooter(this.buttonSpan
);this.cfg
.refireEvent("iframe");this.cfg
.refireEvent("underlay");}}
215 YAHOO
.widget
.Dialog
.prototype.configOnSuccess=function(type
,args
,obj
){};YAHOO
.widget
.Dialog
.prototype.configOnFailure=function(type
,args
,obj
){};YAHOO
.widget
.Dialog
.prototype.doSubmit=function(){};YAHOO
.widget
.Dialog
.prototype.focusFirst=function(type
,args
,obj
){if(args
){var e
=args
[1];if(e
){YAHOO
.util
.Event
.stopEvent(e
);}}
216 if(this.firstFormElement
){this.firstFormElement
.focus();}else{this.focusDefaultButton();}}
217 YAHOO
.widget
.Dialog
.prototype.focusLast=function(type
,args
,obj
){if(args
){var e
=args
[1];if(e
){YAHOO
.util
.Event
.stopEvent(e
);}}
218 var buttons
=this.cfg
.getProperty("buttons");if(buttons
&&buttons
instanceof Array
){this.focusLastButton();}else{if(this.lastFormElement
){this.lastFormElement
.focus();}}}
219 YAHOO
.widget
.Dialog
.prototype.focusDefaultButton=function(){if(this.defaultHtmlButton
){this.defaultHtmlButton
.focus();}}
220 YAHOO
.widget
.Dialog
.prototype.blurButtons=function(){var buttons
=this.cfg
.getProperty("buttons");if(buttons
&&buttons
instanceof Array
){var html
=buttons
[0].htmlButton
;if(html
){html
.blur();}}}
221 YAHOO
.widget
.Dialog
.prototype.focusFirstButton=function(){var buttons
=this.cfg
.getProperty("buttons");if(buttons
&&buttons
instanceof Array
){var html
=buttons
[0].htmlButton
;if(html
){html
.focus();}}}
222 YAHOO
.widget
.Dialog
.prototype.focusLastButton=function(){var buttons
=this.cfg
.getProperty("buttons");if(buttons
&&buttons
instanceof Array
){var html
=buttons
[buttons
.length
-1].htmlButton
;if(html
){html
.focus();}}}
223 YAHOO
.widget
.Dialog
.prototype.validate=function(){return true;}
224 YAHOO
.widget
.Dialog
.prototype.submit=function(){if(this.validate()){this.beforeSubmitEvent
.fire();this.doSubmit();this.submitEvent
.fire();this.hide();return true;}else{return false;}}
225 YAHOO
.widget
.Dialog
.prototype.cancel=function(){this.cancelEvent
.fire();this.hide();}
226 YAHOO
.widget
.Dialog
.prototype.getData=function(){var form
=this.form
;var data
={};if(form
){for(var i
in this.form
){var formItem
=form
[i
];if(formItem
){if(formItem
.tagName
){switch(formItem
.tagName
){case"INPUT":switch(formItem
.type
){case"checkbox":data
[i
]=formItem
.checked
;break;case"textbox":case"text":case"hidden":data
[i
]=formItem
.value
;break;}
227 break;case"TEXTAREA":data
[i
]=formItem
.value
;break;case"SELECT":var val
=new Array();for(var x
=0;x
<formItem
.options
.length
;x
++){var option
=formItem
.options
[x
];if(option
.selected
){var selval
=option
.value
;if(!selval
||selval
==""){selval
=option
.text
;}
228 val
[val
.length
]=selval
;}}
229 data
[i
]=val
;break;}}else if(formItem
[0]&&formItem
[0].tagName
){switch(formItem
[0].tagName
){case"INPUT":switch(formItem
[0].type
){case"radio":for(var r
=0;r
<formItem
.length
;r
++){var radio
=formItem
[r
];if(radio
.checked
){data
[radio
.name
]=radio
.value
;break;}}
230 break;case"checkbox":var cbArray
=new Array();for(var c
=0;c
<formItem
.length
;c
++){var check
=formItem
[c
];if(check
.checked
){cbArray
[cbArray
.length
]=check
.value
;}}
231 data
[formItem
[0].name
]=cbArray
;break;}}}}}}
233 YAHOO
.widget
.SimpleDialog=function(el
,userConfig
){if(arguments
.length
>0){YAHOO
.widget
.SimpleDialog
.superclass
.constructor.call(this,el
,userConfig
);}}
234 YAHOO
.widget
.SimpleDialog
.prototype=new YAHOO
.widget
.Dialog();YAHOO
.widget
.SimpleDialog
.prototype.constructor=YAHOO
.widget
.SimpleDialog
;YAHOO
.widget
.SimpleDialog
.superclass
=YAHOO
.widget
.Dialog
.prototype;YAHOO
.widget
.SimpleDialog
.ICON_BLOCK
="nt/ic/ut/bsc/blck16_1.gif";YAHOO
.widget
.SimpleDialog
.ICON_ALARM
="nt/ic/ut/bsc/alrt16_1.gif";YAHOO
.widget
.SimpleDialog
.ICON_HELP
="nt/ic/ut/bsc/hlp16_1.gif";YAHOO
.widget
.SimpleDialog
.ICON_INFO
="nt/ic/ut/bsc/info16_1.gif";YAHOO
.widget
.SimpleDialog
.ICON_WARN
="nt/ic/ut/bsc/warn16_1.gif";YAHOO
.widget
.SimpleDialog
.ICON_TIP
="nt/ic/ut/bsc/tip16_1.gif";YAHOO
.widget
.SimpleDialog
.CSS_SIMPLEDIALOG
="simple-dialog";YAHOO
.widget
.SimpleDialog
.prototype.initDefaultConfig=function(){YAHOO
.widget
.SimpleDialog
.superclass
.initDefaultConfig
.call(this);this.cfg
.addProperty("icon",{value
:"none",handler
:this.configIcon
,suppressEvent
:true});this.cfg
.addProperty("text",{value
:"",handler
:this.configText
,suppressEvent
:true,supercedes
:["icon"]});}
235 YAHOO
.widget
.SimpleDialog
.prototype.init=function(el
,userConfig
){YAHOO
.widget
.SimpleDialog
.superclass
.init
.call(this,el
);this.beforeInitEvent
.fire(YAHOO
.widget
.SimpleDialog
);YAHOO
.util
.Dom
.addClass(this.element
,YAHOO
.widget
.SimpleDialog
.CSS_SIMPLEDIALOG
);this.cfg
.queueProperty("postmethod","manual");if(userConfig
){this.cfg
.applyConfig(userConfig
,true);}
236 this.beforeRenderEvent
.subscribe(function(){if(!this.body
){this.setBody("");}},this,true);this.initEvent
.fire(YAHOO
.widget
.SimpleDialog
);}
237 YAHOO
.widget
.SimpleDialog
.prototype.registerForm=function(){YAHOO
.widget
.SimpleDialog
.superclass
.registerForm
.call(this);this.form
.innerHTML
+="<input type=\"hidden\" name=\""+this.id
+"\" value=\"\"/>";}
238 YAHOO
.widget
.SimpleDialog
.prototype.configIcon=function(type
,args
,obj
){var icon
=args
[0];if(icon
&&icon
!="none"){var iconHTML
="<img src=\""+this.imageRoot
+icon
+"\" class=\"icon\" />";this.body
.innerHTML
=iconHTML
+this.body
.innerHTML
;}}
239 YAHOO
.widget
.SimpleDialog
.prototype.configText=function(type
,args
,obj
){var text
=args
[0];if(text
){this.setBody(text
);}}
240 YAHOO
.widget
.ContainerEffect=function(overlay
,attrIn
,attrOut
,targetElement
){this.overlay
=overlay
;this.attrIn
=attrIn
;this.attrOut
=attrOut
;this.targetElement
=targetElement
||overlay
.element
;this.beforeAnimateInEvent
=new YAHOO
.util
.CustomEvent("beforeAnimateIn");this.beforeAnimateOutEvent
=new YAHOO
.util
.CustomEvent("beforeAnimateOut");this.animateInCompleteEvent
=new YAHOO
.util
.CustomEvent("animateInComplete");this.animateOutCompleteEvent
=new YAHOO
.util
.CustomEvent("animateOutComplete");}
241 YAHOO
.widget
.ContainerEffect
.prototype.init=function(animClass
){if(!animClass
){animClass
=YAHOO
.util
.Anim
;}
242 this.animIn
=new animClass(this.targetElement
,this.attrIn
.attributes
,this.attrIn
.duration
,this.attrIn
.method
);this.animIn
.onStart
.subscribe(this.handleStartAnimateIn
,this);this.animIn
.onTween
.subscribe(this.handleTweenAnimateIn
,this);this.animIn
.onComplete
.subscribe(this.handleCompleteAnimateIn
,this);this.animOut
=new animClass(this.targetElement
,this.attrOut
.attributes
,this.attrOut
.duration
,this.attrOut
.method
);this.animOut
.onStart
.subscribe(this.handleStartAnimateOut
,this);this.animOut
.onTween
.subscribe(this.handleTweenAnimateOut
,this);this.animOut
.onComplete
.subscribe(this.handleCompleteAnimateOut
,this);}
243 YAHOO
.widget
.ContainerEffect
.prototype.animateIn=function(){this.beforeAnimateInEvent
.fire();this.animIn
.animate();}
244 YAHOO
.widget
.ContainerEffect
.prototype.animateOut=function(){this.beforeAnimateOutEvent
.fire();this.animOut
.animate();}
245 YAHOO
.widget
.ContainerEffect
.prototype.handleStartAnimateIn=function(type
,args
,obj
){}
246 YAHOO
.widget
.ContainerEffect
.prototype.handleTweenAnimateIn=function(type
,args
,obj
){}
247 YAHOO
.widget
.ContainerEffect
.prototype.handleCompleteAnimateIn=function(type
,args
,obj
){}
248 YAHOO
.widget
.ContainerEffect
.prototype.handleStartAnimateOut=function(type
,args
,obj
){}
249 YAHOO
.widget
.ContainerEffect
.prototype.handleTweenAnimateOut=function(type
,args
,obj
){}
250 YAHOO
.widget
.ContainerEffect
.prototype.handleCompleteAnimateOut=function(type
,args
,obj
){}
251 YAHOO
.widget
.ContainerEffect
.FADE=function(overlay
,dur
){var fade
=new YAHOO
.widget
.ContainerEffect(overlay
,{attributes
:{opacity
:{from:0,to
:1}},duration
:dur
,method
:YAHOO
.util
.Easing
.easeIn
},{attributes
:{opacity
:{to
:0}},duration
:dur
,method
:YAHOO
.util
.Easing
.easeOut
});fade
.handleStartAnimateIn=function(type
,args
,obj
){YAHOO
.util
.Dom
.addClass(obj
.overlay
.element
,"hide-select");if(!obj
.overlay
.underlay
){obj
.overlay
.cfg
.refireEvent("underlay");}
252 if(obj
.overlay
.underlay
){obj
.initialUnderlayOpacity
=YAHOO
.util
.Dom
.getStyle(obj
.overlay
.underlay
,"opacity");obj
.overlay
.underlay
.style
.filter
=null;}
253 YAHOO
.util
.Dom
.setStyle(obj
.overlay
.element
,"visibility","visible");YAHOO
.util
.Dom
.setStyle(obj
.overlay
.element
,"opacity",0);}
254 fade
.handleCompleteAnimateIn=function(type
,args
,obj
){YAHOO
.util
.Dom
.removeClass(obj
.overlay
.element
,"hide-select");if(obj
.overlay
.element
.style
.filter
){obj
.overlay
.element
.style
.filter
=null;}
255 if(obj
.overlay
.underlay
){YAHOO
.util
.Dom
.setStyle(obj
.overlay
.underlay
,"opacity",obj
.initialUnderlayOpacity
);}
256 obj
.overlay
.cfg
.refireEvent("iframe");obj
.animateInCompleteEvent
.fire();}
257 fade
.handleStartAnimateOut=function(type
,args
,obj
){YAHOO
.util
.Dom
.addClass(obj
.overlay
.element
,"hide-select");if(obj
.overlay
.underlay
){obj
.overlay
.underlay
.style
.filter
=null;}}
258 fade
.handleCompleteAnimateOut=function(type
,args
,obj
){YAHOO
.util
.Dom
.removeClass(obj
.overlay
.element
,"hide-select");if(obj
.overlay
.element
.style
.filter
){obj
.overlay
.element
.style
.filter
=null;}
259 YAHOO
.util
.Dom
.setStyle(obj
.overlay
.element
,"visibility","hidden");YAHOO
.util
.Dom
.setStyle(obj
.overlay
.element
,"opacity",1);obj
.overlay
.cfg
.refireEvent("iframe");obj
.animateOutCompleteEvent
.fire();};fade
.init();return fade
;};YAHOO
.widget
.ContainerEffect
.SLIDE=function(overlay
,dur
){var x
=overlay
.cfg
.getProperty("x")||YAHOO
.util
.Dom
.getX(overlay
.element
);var y
=overlay
.cfg
.getProperty("y")||YAHOO
.util
.Dom
.getY(overlay
.element
);var clientWidth
=YAHOO
.util
.Dom
.getClientWidth();var offsetWidth
=overlay
.element
.offsetWidth
;var slide
=new YAHOO
.widget
.ContainerEffect(overlay
,{attributes
:{points
:{to
:[x
,y
]}},duration
:dur
,method
:YAHOO
.util
.Easing
.easeIn
},{attributes
:{points
:{to
:[(clientWidth
+25),y
]}},duration
:dur
,method
:YAHOO
.util
.Easing
.easeOut
});slide
.handleStartAnimateIn=function(type
,args
,obj
){obj
.overlay
.element
.style
.left
=(-25-offsetWidth
)+"px";obj
.overlay
.element
.style
.top
=y
+"px";}
260 slide
.handleTweenAnimateIn=function(type
,args
,obj
){var pos
=YAHOO
.util
.Dom
.getXY(obj
.overlay
.element
);var currentX
=pos
[0];var currentY
=pos
[1];if(YAHOO
.util
.Dom
.getStyle(obj
.overlay
.element
,"visibility")=="hidden"&¤tX
<x
){YAHOO
.util
.Dom
.setStyle(obj
.overlay
.element
,"visibility","visible");}
261 obj
.overlay
.cfg
.setProperty("xy",[currentX
,currentY
],true);obj
.overlay
.cfg
.refireEvent("iframe");}
262 slide
.handleCompleteAnimateIn=function(type
,args
,obj
){obj
.overlay
.cfg
.setProperty("xy",[x
,y
],true);obj
.startX
=x
;obj
.startY
=y
;obj
.overlay
.cfg
.refireEvent("iframe");obj
.animateInCompleteEvent
.fire();}
263 slide
.handleStartAnimateOut=function(type
,args
,obj
){var clientWidth
=YAHOO
.util
.Dom
.getViewportWidth();var pos
=YAHOO
.util
.Dom
.getXY(obj
.overlay
.element
);var x
=pos
[0];var y
=pos
[1];var currentTo
=obj
.animOut
.attributes
.points
.to
;obj
.animOut
.attributes
.points
.to
=[(clientWidth
+25),y
];}
264 slide
.handleTweenAnimateOut=function(type
,args
,obj
){var pos
=YAHOO
.util
.Dom
.getXY(obj
.overlay
.element
);var x
=pos
[0];var y
=pos
[1];obj
.overlay
.cfg
.setProperty("xy",[x
,y
],true);obj
.overlay
.cfg
.refireEvent("iframe");}
265 slide
.handleCompleteAnimateOut=function(type
,args
,obj
){YAHOO
.util
.Dom
.setStyle(obj
.overlay
.element
,"visibility","hidden");var offsetWidth
=obj
.overlay
.element
.offsetWidth
;obj
.overlay
.cfg
.setProperty("xy",[x
,y
]);obj
.animateOutCompleteEvent
.fire();};slide
.init(YAHOO
.util
.Motion
);return slide
;}