Added to Moodle 13 July 2006
Updated to YUI 0.12.0, 23 November 2006
+Updated to YUI 0.12.1, 8 January 2007
Animation Release Notes\r
\r
+*** version 0.12.1 ***\r
+* minified version no longer strips line breaks\r
+\r
*** version 0.12.0 ***\r
\r
* added boolean finish argument to Anim.stop()\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
+version: 0.12.1\r
*/\r
\r
/**\r
\r
};\r
};\r
+(function() {\r
/**\r
* Anim subclass for color transitions.\r
* <p>Usage: <code>var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut);</code> Color values can be specified with either 112233, #112233,\r
* @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based\r
* @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)\r
*/\r
-(function() {\r
YAHOO.util.ColorAnim = function(el, attributes, duration, method) {\r
YAHOO.util.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);\r
};\r
}\r
};\r
\r
+(function() {\r
/**\r
* Anim subclass for moving elements along a path defined by the "points"\r
* member of "attributes". All "points" are arrays with x, y coordinates.\r
* @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based\r
* @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)\r
*/\r
-(function() {\r
YAHOO.util.Motion = function(el, attributes, duration, method) {\r
if (el) { // dont break existing subclasses not using YAHOO.extend\r
YAHOO.util.Motion.superclass.constructor.call(this, el, attributes, duration, method);\r
return (typeof prop !== 'undefined');\r
};\r
})();\r
+(function() {\r
/**\r
* Anim subclass for scrolling elements to a position defined by the "scroll"\r
* member of "attributes". All "scroll" members are arrays with x, y scroll positions.\r
* @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based\r
* @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)\r
*/\r
-(function() {\r
YAHOO.util.Scroll = function(el, attributes, duration, method) {\r
if (el) { // dont break existing subclasses not using YAHOO.extend\r
YAHOO.util.Scroll.superclass.constructor.call(this, el, attributes, duration, method);\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txtversion: 0.12.0 */ YAHOO.util.Anim=function(el,attributes,duration,method){if(el){this.init(el,attributes,duration,method);}};YAHOO.util.Anim.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName;return("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(attr,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attr,val,unit){if(this.patterns.noNegatives.test(attr)){val=(val>0)?val:0;}YAHOO.util.Dom.setStyle(this.getEl(),attr,val+unit);},getAttribute:function(attr){var el=this.getEl();var val=YAHOO.util.Dom.getStyle(el,attr);if(val!=='auto'&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);}var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||(YAHOO.util.Dom.getStyle(el,'position')=='absolute'&&pos)){val=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;}return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return'px';}return'';},setRuntimeAttribute:function(attr){var start;var end;var attributes=this.attributes;this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=='undefined');};if(!isset(attributes[attr]['to'])&&!isset(attributes[attr]['by'])){return false;}start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]['by'][i];}}else{end=start+attributes[attr]['by'];}}this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);},init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var actualFrames=0;el=YAHOO.util.Dom.get(el);this.attributes=attributes||{};this.duration=duration||1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.getEl=function(){return el;};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;YAHOO.util.AnimMgr.registerElement(this);};this.stop=function(finish){if(finish){this.currentFrame=this.totalFrames;this._onTween.fire();}YAHOO.util.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var attr in this.attributes){this.setRuntimeAttribute(attr);}isAnimated=true;actualFrames=0;startTime=new Date();};var onTween=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){return('duration: '+data.duration+', currentFrame: '+data.currentFrame);};this.onTween.fire(data);var runtimeAttributes=this.runtimeAttributes;for(var attr in runtimeAttributes){this.setAttribute(attr,this.doMethod(attr,runtimeAttributes[attr].start,runtimeAttributes[attr].end),runtimeAttributes[attr].unit);}actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new YAHOO.util.CustomEvent('_start',this,true);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this,true);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onComplete=new YAHOO.util.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=200;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){tween._onComplete.fire();index=index||getIndex(tween);if(index!=-1){queue.splice(index,1);}tweenCount-=1;if(tweenCount<=0){this.stop();}};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){if(queue[i].isAnimated()){this.unRegister(tween,i);}}queue=[];thread=null;tweenCount=0;}else{this.unRegister(tween);}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null){tween.currentFrame+=1;if(tween.useSeconds){correctFrame(tween);}tween._onTween.fire();}else{YAHOO.util.AnimMgr.stop(tween,i);}}};var getIndex=function(anim){for(var i=0,len=queue.length;i<len;++i){if(queue[i]==anim){return i;}}return-1;};var correctFrame=function(tween){var frames=tween.totalFrames;var frame=tween.currentFrame;var expected=(tween.currentFrame*tween.duration*1000/tween.totalFrames);var elapsed=(new Date()-tween.getStartTime());var tweak=0;if(elapsed<tween.duration*1000){tweak=Math.round((elapsed/expected-1)*tween.currentFrame);}else{tweak=frames-(frame+1);}if(tweak>0&&isFinite(tweak)){if(tween.currentFrame+tweak>=frames){tweak=frames-(frame+1);}tween.currentFrame+=tweak;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(points,t){var n=points.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[points[i][0],points[i][1]];}for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}return[tmp[0][0],tmp[0][1]];};};(function(){YAHOO.util.ColorAnim=function(el,attributes,duration,method){YAHOO.util.ColorAnim.superclass.constructor.call(this,el,attributes,duration,method);};YAHOO.extend(YAHOO.util.ColorAnim,YAHOO.util.Anim);var Y=YAHOO.util;var superclass=Y.ColorAnim.superclass;var proto=Y.ColorAnim.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("ColorAnim "+id);};proto.patterns.color=/color$/i;proto.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;proto.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;proto.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;proto.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;proto.parseColor=function(s){if(s.length==3){return s;}var c=this.patterns.hex.exec(s);if(c&&c.length==4){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}c=this.patterns.rgb.exec(s);if(c&&c.length==4){return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}c=this.patterns.hex3.exec(s);if(c&&c.length==4){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}return null;};proto.getAttribute=function(attr){var el=this.getEl();if(this.patterns.color.test(attr)){var val=YAHOO.util.Dom.getStyle(el,attr);if(this.patterns.transparent.test(val)){var parent=el.parentNode;val=Y.Dom.getStyle(parent,attr);while(parent&&this.patterns.transparent.test(val)){parent=parent.parentNode;val=Y.Dom.getStyle(parent,attr);if(parent.tagName.toUpperCase()=='HTML'){val='#fff';}}}}else{val=superclass.getAttribute.call(this,attr);}return val;};proto.doMethod=function(attr,start,end){var val;if(this.patterns.color.test(attr)){val=[];for(var i=0,len=start.length;i<len;++i){val[i]=superclass.doMethod.call(this,attr,start[i],end[i]);}val='rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')';}else{val=superclass.doMethod.call(this,attr,start,end);}return val;};proto.setRuntimeAttribute=function(attr){superclass.setRuntimeAttribute.call(this,attr);if(this.patterns.color.test(attr)){var attributes=this.attributes;var start=this.parseColor(this.runtimeAttributes[attr].start);var end=this.parseColor(this.runtimeAttributes[attr].end);if(typeof attributes[attr]['to']==='undefined'&&typeof attributes[attr]['by']!=='undefined'){end=this.parseColor(attributes[attr].by);for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+end[i];}}this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;}};})();YAHOO.util.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(!a||a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(!a||a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(!a||a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-YAHOO.util.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},bounceBoth:function(t,b,c,d){if(t<d/2)return YAHOO.util.Easing.bounceIn(t*2,0,c,d)*.5+b;return YAHOO.util.Easing.bounceOut(t*2-d,0,c,d)*.5+c*.5+b;}};(function(){YAHOO.util.Motion=function(el,attributes,duration,method){if(el){YAHOO.util.Motion.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Motion,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Motion.superclass;var proto=Y.Motion.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Motion "+id);};proto.patterns.points=/^points$/i;proto.setAttribute=function(attr,val,unit){if(this.patterns.points.test(attr)){unit=unit||'px';superclass.setAttribute.call(this,'left',val[0],unit);superclass.setAttribute.call(this,'top',val[1],unit);}else{superclass.setAttribute.call(this,attr,val,unit);}};proto.getAttribute=function(attr){if(this.patterns.points.test(attr)){var val=[superclass.getAttribute.call(this,'left'),superclass.getAttribute.call(this,'top')];}else{val=superclass.getAttribute.call(this,attr);}return val;};proto.doMethod=function(attr,start,end){var val=null;if(this.patterns.points.test(attr)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;val=Y.Bezier.getPosition(this.runtimeAttributes[attr],t);}else{val=superclass.doMethod.call(this,attr,start,end);}return val;};proto.setRuntimeAttribute=function(attr){if(this.patterns.points.test(attr)){var el=this.getEl();var attributes=this.attributes;var start;var control=attributes['points']['control']||[];var end;var i,len;if(control.length>0&&!(control[0]instanceof Array)){control=[control];}else{var tmp=[];for(i=0,len=control.length;i<len;++i){tmp[i]=control[i];}control=tmp;}if(Y.Dom.getStyle(el,'position')=='static'){Y.Dom.setStyle(el,'position','relative');}if(isset(attributes['points']['from'])){Y.Dom.setXY(el,attributes['points']['from']);}else{Y.Dom.setXY(el,Y.Dom.getXY(el));}start=this.getAttribute('points');if(isset(attributes['points']['to'])){end=translateValues.call(this,attributes['points']['to'],start);var pageXY=Y.Dom.getXY(this.getEl());for(i=0,len=control.length;i<len;++i){control[i]=translateValues.call(this,control[i],start);}}else if(isset(attributes['points']['by'])){end=[start[0]+attributes['points']['by'][0],start[1]+attributes['points']['by'][1]];for(i=0,len=control.length;i<len;++i){control[i]=[start[0]+control[i][0],start[1]+control[i][1]];}}this.runtimeAttributes[attr]=[start];if(control.length>0){this.runtimeAttributes[attr]=this.runtimeAttributes[attr].concat(control);}this.runtimeAttributes[attr][this.runtimeAttributes[attr].length]=end;}else{superclass.setRuntimeAttribute.call(this,attr);}};var translateValues=function(val,start){var pageXY=Y.Dom.getXY(this.getEl());val=[val[0]-pageXY[0]+start[0],val[1]-pageXY[1]+start[1]];return val;};var isset=function(prop){return(typeof prop!=='undefined');};})();(function(){YAHOO.util.Scroll=function(el,attributes,duration,method){if(el){YAHOO.util.Scroll.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Scroll,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Scroll.superclass;var proto=Y.Scroll.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Scroll "+id);};proto.doMethod=function(attr,start,end){var val=null;if(attr=='scroll'){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=superclass.doMethod.call(this,attr,start,end);}return val;};proto.getAttribute=function(attr){var val=null;var el=this.getEl();if(attr=='scroll'){val=[el.scrollLeft,el.scrollTop];}else{val=superclass.getAttribute.call(this,attr);}return val;};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};})();
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.1 */\r
+YAHOO.util.Anim=function(el,attributes,duration,method){if(el){this.init(el,attributes,duration,method);}};YAHOO.util.Anim.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName;return("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(attr,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attr,val,unit){if(this.patterns.noNegatives.test(attr)){val=(val>0)?val:0;}\r
+YAHOO.util.Dom.setStyle(this.getEl(),attr,val+unit);},getAttribute:function(attr){var el=this.getEl();var val=YAHOO.util.Dom.getStyle(el,attr);if(val!=='auto'&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);}\r
+var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||(YAHOO.util.Dom.getStyle(el,'position')=='absolute'&&pos)){val=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;}\r
+return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return'px';}\r
+return'';},setRuntimeAttribute:function(attr){var start;var end;var attributes=this.attributes;this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=='undefined');};if(!isset(attributes[attr]['to'])&&!isset(attributes[attr]['by'])){return false;}\r
+start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]['by'][i];}}else{end=start+attributes[attr]['by'];}}\r
+this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);},init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var actualFrames=0;el=YAHOO.util.Dom.get(el);this.attributes=attributes||{};this.duration=duration||1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.getEl=function(){return el;};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}\r
+this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;YAHOO.util.AnimMgr.registerElement(this);};this.stop=function(finish){if(finish){this.currentFrame=this.totalFrames;this._onTween.fire();}\r
+YAHOO.util.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var attr in this.attributes){this.setRuntimeAttribute(attr);}\r
+isAnimated=true;actualFrames=0;startTime=new Date();};var onTween=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){return('duration: '+data.duration+', currentFrame: '+data.currentFrame);};this.onTween.fire(data);var runtimeAttributes=this.runtimeAttributes;for(var attr in runtimeAttributes){this.setAttribute(attr,this.doMethod(attr,runtimeAttributes[attr].start,runtimeAttributes[attr].end),runtimeAttributes[attr].unit);}\r
+actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new YAHOO.util.CustomEvent('_start',this,true);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this,true);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onComplete=new YAHOO.util.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=200;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){tween._onComplete.fire();index=index||getIndex(tween);if(index!=-1){queue.splice(index,1);}\r
+tweenCount-=1;if(tweenCount<=0){this.stop();}};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){if(queue[i].isAnimated()){this.unRegister(tween,i);}}\r
+queue=[];thread=null;tweenCount=0;}\r
+else{this.unRegister(tween);}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}\r
+if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null)\r
+{tween.currentFrame+=1;if(tween.useSeconds){correctFrame(tween);}\r
+tween._onTween.fire();}\r
+else{YAHOO.util.AnimMgr.stop(tween,i);}}};var getIndex=function(anim){for(var i=0,len=queue.length;i<len;++i){if(queue[i]==anim){return i;}}\r
+return-1;};var correctFrame=function(tween){var frames=tween.totalFrames;var frame=tween.currentFrame;var expected=(tween.currentFrame*tween.duration*1000/tween.totalFrames);var elapsed=(new Date()-tween.getStartTime());var tweak=0;if(elapsed<tween.duration*1000){tweak=Math.round((elapsed/expected-1)*tween.currentFrame);}else{tweak=frames-(frame+1);}\r
+if(tweak>0&&isFinite(tweak)){if(tween.currentFrame+tweak>=frames){tweak=frames-(frame+1);}\r
+tween.currentFrame+=tweak;}};};YAHOO.util.Bezier=new function()\r
+{this.getPosition=function(points,t)\r
+{var n=points.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[points[i][0],points[i][1]];}\r
+for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}\r
+return[tmp[0][0],tmp[0][1]];};};(function(){YAHOO.util.ColorAnim=function(el,attributes,duration,method){YAHOO.util.ColorAnim.superclass.constructor.call(this,el,attributes,duration,method);};YAHOO.extend(YAHOO.util.ColorAnim,YAHOO.util.Anim);var Y=YAHOO.util;var superclass=Y.ColorAnim.superclass;var proto=Y.ColorAnim.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("ColorAnim "+id);};proto.patterns.color=/color$/i;proto.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;proto.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;proto.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;proto.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;proto.parseColor=function(s){if(s.length==3){return s;}\r
+var c=this.patterns.hex.exec(s);if(c&&c.length==4){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}\r
+c=this.patterns.rgb.exec(s);if(c&&c.length==4){return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}\r
+c=this.patterns.hex3.exec(s);if(c&&c.length==4){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}\r
+return null;};proto.getAttribute=function(attr){var el=this.getEl();if(this.patterns.color.test(attr)){var val=YAHOO.util.Dom.getStyle(el,attr);if(this.patterns.transparent.test(val)){var parent=el.parentNode;val=Y.Dom.getStyle(parent,attr);while(parent&&this.patterns.transparent.test(val)){parent=parent.parentNode;val=Y.Dom.getStyle(parent,attr);if(parent.tagName.toUpperCase()=='HTML'){val='#fff';}}}}else{val=superclass.getAttribute.call(this,attr);}\r
+return val;};proto.doMethod=function(attr,start,end){var val;if(this.patterns.color.test(attr)){val=[];for(var i=0,len=start.length;i<len;++i){val[i]=superclass.doMethod.call(this,attr,start[i],end[i]);}\r
+val='rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')';}\r
+else{val=superclass.doMethod.call(this,attr,start,end);}\r
+return val;};proto.setRuntimeAttribute=function(attr){superclass.setRuntimeAttribute.call(this,attr);if(this.patterns.color.test(attr)){var attributes=this.attributes;var start=this.parseColor(this.runtimeAttributes[attr].start);var end=this.parseColor(this.runtimeAttributes[attr].end);if(typeof attributes[attr]['to']==='undefined'&&typeof attributes[attr]['by']!=='undefined'){end=this.parseColor(attributes[attr].by);for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+end[i];}}\r
+this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;}};})();YAHOO.util.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(!a||a<Math.abs(c)){a=c;var s=p/4;}\r
+else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(!a||a<Math.abs(c)){a=c;var s=p/4;}\r
+else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(!a||a<Math.abs(c)){a=c;var s=p/4;}\r
+else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-YAHOO.util.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},bounceBoth:function(t,b,c,d){if(t<d/2)return YAHOO.util.Easing.bounceIn(t*2,0,c,d)*.5+b;return YAHOO.util.Easing.bounceOut(t*2-d,0,c,d)*.5+c*.5+b;}};(function(){YAHOO.util.Motion=function(el,attributes,duration,method){if(el){YAHOO.util.Motion.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Motion,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Motion.superclass;var proto=Y.Motion.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Motion "+id);};proto.patterns.points=/^points$/i;proto.setAttribute=function(attr,val,unit){if(this.patterns.points.test(attr)){unit=unit||'px';superclass.setAttribute.call(this,'left',val[0],unit);superclass.setAttribute.call(this,'top',val[1],unit);}else{superclass.setAttribute.call(this,attr,val,unit);}};proto.getAttribute=function(attr){if(this.patterns.points.test(attr)){var val=[superclass.getAttribute.call(this,'left'),superclass.getAttribute.call(this,'top')];}else{val=superclass.getAttribute.call(this,attr);}\r
+return val;};proto.doMethod=function(attr,start,end){var val=null;if(this.patterns.points.test(attr)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;val=Y.Bezier.getPosition(this.runtimeAttributes[attr],t);}else{val=superclass.doMethod.call(this,attr,start,end);}\r
+return val;};proto.setRuntimeAttribute=function(attr){if(this.patterns.points.test(attr)){var el=this.getEl();var attributes=this.attributes;var start;var control=attributes['points']['control']||[];var end;var i,len;if(control.length>0&&!(control[0]instanceof Array)){control=[control];}else{var tmp=[];for(i=0,len=control.length;i<len;++i){tmp[i]=control[i];}\r
+control=tmp;}\r
+if(Y.Dom.getStyle(el,'position')=='static'){Y.Dom.setStyle(el,'position','relative');}\r
+if(isset(attributes['points']['from'])){Y.Dom.setXY(el,attributes['points']['from']);}\r
+else{Y.Dom.setXY(el,Y.Dom.getXY(el));}\r
+start=this.getAttribute('points');if(isset(attributes['points']['to'])){end=translateValues.call(this,attributes['points']['to'],start);var pageXY=Y.Dom.getXY(this.getEl());for(i=0,len=control.length;i<len;++i){control[i]=translateValues.call(this,control[i],start);}}else if(isset(attributes['points']['by'])){end=[start[0]+attributes['points']['by'][0],start[1]+attributes['points']['by'][1]];for(i=0,len=control.length;i<len;++i){control[i]=[start[0]+control[i][0],start[1]+control[i][1]];}}\r
+this.runtimeAttributes[attr]=[start];if(control.length>0){this.runtimeAttributes[attr]=this.runtimeAttributes[attr].concat(control);}\r
+this.runtimeAttributes[attr][this.runtimeAttributes[attr].length]=end;}\r
+else{superclass.setRuntimeAttribute.call(this,attr);}};var translateValues=function(val,start){var pageXY=Y.Dom.getXY(this.getEl());val=[val[0]-pageXY[0]+start[0],val[1]-pageXY[1]+start[1]];return val;};var isset=function(prop){return(typeof prop!=='undefined');};})();(function(){YAHOO.util.Scroll=function(el,attributes,duration,method){if(el){YAHOO.util.Scroll.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Scroll,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Scroll.superclass;var proto=Y.Scroll.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Scroll "+id);};proto.doMethod=function(attr,start,end){var val=null;if(attr=='scroll'){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=superclass.doMethod.call(this,attr,start,end);}\r
+return val;};proto.getAttribute=function(attr){var val=null;var el=this.getEl();if(attr=='scroll'){val=[el.scrollLeft,el.scrollTop];}else{val=superclass.getAttribute.call(this,attr);}\r
+return val;};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};})();
\ No newline at end of file
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
+version: 0.12.1\r
*/\r
\r
/**\r
\r
};\r
};\r
+(function() {\r
/**\r
* Anim subclass for color transitions.\r
* <p>Usage: <code>var myAnim = new Y.ColorAnim(el, { backgroundColor: { from: '#FF0000', to: '#FFFFFF' } }, 1, Y.Easing.easeOut);</code> Color values can be specified with either 112233, #112233,\r
* @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based\r
* @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)\r
*/\r
-(function() {\r
YAHOO.util.ColorAnim = function(el, attributes, duration, method) {\r
YAHOO.util.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);\r
};\r
}\r
};\r
\r
+(function() {\r
/**\r
* Anim subclass for moving elements along a path defined by the "points"\r
* member of "attributes". All "points" are arrays with x, y coordinates.\r
* @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based\r
* @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)\r
*/\r
-(function() {\r
YAHOO.util.Motion = function(el, attributes, duration, method) {\r
if (el) { // dont break existing subclasses not using YAHOO.extend\r
YAHOO.util.Motion.superclass.constructor.call(this, el, attributes, duration, method);\r
return (typeof prop !== 'undefined');\r
};\r
})();\r
+(function() {\r
/**\r
* Anim subclass for scrolling elements to a position defined by the "scroll"\r
* member of "attributes". All "scroll" members are arrays with x, y scroll positions.\r
* @param {Number} duration (optional, defaults to 1 second) Length of animation (frames or seconds), defaults to time-based\r
* @param {Function} method (optional, defaults to YAHOO.util.Easing.easeNone) Computes the values that are applied to the attributes per frame (generally a YAHOO.util.Easing method)\r
*/\r
-(function() {\r
YAHOO.util.Scroll = function(el, attributes, duration, method) {\r
if (el) { // dont break existing subclasses not using YAHOO.extend\r
YAHOO.util.Scroll.superclass.constructor.call(this, el, attributes, duration, method);\r
AutoComplete Release Notes\r
\r
+*** version 0.12.1 ***\r
+\r
+* No longer trigger typeAhead feature when user is backspacing on input text.\r
+\r
+\r
+\r
*** version 0.12.0 ***\r
\r
* The following constants must be defined as static class properties and are no longer\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r\r
Code licensed under the BSD License:\r\r
http://developer.yahoo.com/yui/license.txt\r\r
-version: 0.12.0\r\r
+version: 0.12.1\r\r
*/\r\r
\r\r
/**\r
*\r
* @class AutoComplete\r
* @constructor\r
- * @param elInput {HTMLElement} DOM element reference of an input field\r
- * @param elInput {String} String ID of an input field\r
- * @param elContainer {HTMLElement} DOM element reference of an existing DIV\r
- * @param elContainer {String} String ID of an existing DIV\r
- * @param oDataSource {Object} Instance of YAHOO.widget.DataSource for query/results\r
- * @param oConfigs {Object} (optional) Object literal of configuration params\r
+ * @param elInput {HTMLElement} DOM element reference of an input field.\r
+ * @param elInput {String} String ID of an input field.\r
+ * @param elContainer {HTMLElement} DOM element reference of an existing DIV.\r
+ * @param elContainer {String} String ID of an existing DIV.\r
+ * @param oDataSource {Object} Instance of YAHOO.widget.DataSource for query/results.\r
+ * @param oConfigs {Object} (optional) Object literal of configuration params.\r
*/\r
YAHOO.widget.AutoComplete = function(elInput,elContainer,oDataSource,oConfigs) {\r
if(elInput && elContainer && oDataSource) {\r
this.selectionEnforceEvent = new YAHOO.util.CustomEvent("selectionEnforce", this);\r
this.containerCollapseEvent = new YAHOO.util.CustomEvent("containerCollapse", this);\r
this.textboxBlurEvent = new YAHOO.util.CustomEvent("textboxBlur", this);\r
- \r
+\r
// Finish up\r
oTextbox.setAttribute("autocomplete","off");\r
YAHOO.widget.AutoComplete._nIndex++;\r
\r
/**\r
* Fired when the AutoComplete instance makes a query to the DataSource.\r
- * \r
+ *\r
* @event dataRequestEvent\r
* @param oSelf {Object} The AutoComplete instance.\r
* @param sQuery {String} The query string.\r
\r
/**\r
* Fired when the input field has been prefilled by the type-ahead\r
- * feature. \r
+ * feature.\r
*\r
* @event typeAheadEvent\r
* @param oSelf {Object} The AutoComplete instance.\r
YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent = null;\r
\r
/**\r
- * Fired when result item has been arrowed to. \r
+ * Fired when result item has been arrowed to.\r
*\r
* @event itemArrowToEvent\r
* @param oSelf {Object} The AutoComplete instance.\r
/**\r
* Fired when a user selection does not match any of the displayed result items.\r
* Note that this event may not behave as expected when delimiter characters\r
- * have been defined. \r
+ * have been defined.\r
*\r
* @event unmatchedItemSelectEvent\r
* @param oSelf {Object} The AutoComplete instance.\r
*/\r
YAHOO.widget.AutoComplete.prototype._typeAhead = function(oItem, sQuery) {\r
// Don't update if turned off\r
- if (!this.typeAhead) {\r
+ if (!this.typeAhead || (this._nKeyCode == 8)) {\r
return;\r
}\r
\r
if(this.alwaysShowContainer && this._bContainerOpen) {\r
return;\r
}\r
- \r
+\r
// Clear contents of container\r
if(!bShow) {\r
this._oContainer._oContent.scrollTop = 0;\r
* database. Supported data include local JavaScript arrays and objects and databases\r\r
* accessible via XHR connections. Supported response formats include JavaScript arrays,\r\r
* JSON, XML, and flat-file textual data.\r\r
- * \r\r
+ *\r\r
* @class DataSource\r\r
* @constructor\r\r
*/\r\r
-YAHOO.widget.DataSource = function() { \r\r
+YAHOO.widget.DataSource = function() {\r\r
/* abstract class */\r\r
};\r\r
\r\r
* @param oParent {Object} The object instance that has requested data.\r\r
*/\r\r
YAHOO.widget.DataSource.prototype.getResults = function(oCallbackFn, sQuery, oParent) {\r\r
- \r\r
+\r\r
// First look in cache\r\r
var aResults = this._doQueryCache(oCallbackFn,sQuery,oParent);\r\r
- \r\r
+\r\r
// Not in cache, so get results from server\r\r
if(aResults.length === 0) {\r\r
this.queryEvent.fire(this, oParent, sQuery);\r\r
* @param oParent {Object} The object instance that has requested data.\r\r
*/\r\r
YAHOO.widget.DataSource.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r\r
- /* override this */ \r\r
+ /* override this */\r\r
};\r\r
\r\r
/**\r\r
* @param aResults {Object[]} Array of result objects.\r\r
*/\r\r
YAHOO.widget.DataSource.prototype.getResultsEvent = null;\r\r
- \r\r
+\r\r
/**\r\r
* Fired when data is retrieved from the local cache.\r\r
*\r\r
\r\r
/**\r\r
* Initializes DataSource instance.\r\r
- * \r\r
+ *\r\r
* @method _init\r\r
* @private\r\r
*/\r\r
if(maxCacheEntries > 0 && !this._aCache) {\r\r
this._aCache = [];\r\r
}\r\r
- \r\r
+\r\r
this._sName = "instance" + YAHOO.widget.DataSource._nIndex;\r\r
YAHOO.widget.DataSource._nIndex++;\r\r
- \r\r
+\r\r
this.queryEvent = new YAHOO.util.CustomEvent("query", this);\r\r
this.cacheQueryEvent = new YAHOO.util.CustomEvent("cacheQuery", this);\r\r
this.getResultsEvent = new YAHOO.util.CustomEvent("getResults", this);\r\r
};\r\r
\r\r
/**\r\r
- * Adds a result object to the local cache, evicting the oldest element if the \r\r
+ * Adds a result object to the local cache, evicting the oldest element if the\r\r
* cache is full. Newer items will have higher indexes, the oldest item will have\r\r
- * index of 0. \r\r
+ * index of 0.\r\r
*\r\r
* @method _addCacheElem\r\r
* @param oResult {Object} Data result object, including array of results.\r\r
if(!aCache || !oResult || !oResult.query || !oResult.results) {\r\r
return;\r\r
}\r\r
- \r\r
+\r\r
// If the cache is full, make room by removing from index=0\r\r
if(aCache.length >= this.maxCacheEntries) {\r\r
aCache.shift();\r\r
}\r\r
- \r\r
+\r\r
// Add to cache, at the end of the array\r\r
aCache.push(oResult);\r\r
};\r\r
/**\r\r
* Queries the local cache for results. If query has been cached, the callback\r\r
* function is called with the results, and the cached is refreshed so that it\r\r
- * is now the newest element. \r\r
+ * is now the newest element.\r\r
*\r\r
* @method _doQueryCache\r\r
* @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r\r
* @param sQuery {String} Query string.\r\r
* @param oParent {Object} The object instance that has requested data.\r\r
* @return aResults {Object[]} Array of results from local cache if found, otherwise null.\r\r
- * @private \r\r
+ * @private\r\r
*/\r\r
YAHOO.widget.DataSource.prototype._doQueryCache = function(oCallbackFn, sQuery, oParent) {\r\r
var aResults = [];\r\r
var aCache = this._aCache;\r\r
var nCacheLength = (aCache) ? aCache.length : 0;\r\r
var bMatchContains = this.queryMatchContains;\r\r
- \r\r
+\r\r
// If cache is enabled...\r\r
if((this.maxCacheEntries > 0) && aCache && (nCacheLength > 0)) {\r\r
this.cacheQueryEvent.fire(this, oParent, sQuery);\r\r
var matchKey = (!this.queryMatchCase) ?\r\r
encodeURIComponent(resultObj.query).toLowerCase():\r\r
encodeURIComponent(resultObj.query);\r\r
- \r\r
+\r\r
// If a cached match key exactly matches the query...\r\r
if(matchKey == sQuery) {\r\r
// Stash all result objects into aResult[] and stop looping through the cache.\r\r
bMatchFound = true;\r\r
aResults = aAllResultItems;\r\r
- \r\r
+\r\r
// The matching cache element was not the most recent,\r\r
// so now we need to refresh the cache.\r\r
- if(i != nCacheLength-1) { \r\r
+ if(i != nCacheLength-1) {\r\r
// Remove element from its original location\r\r
aCache.splice(i,1);\r\r
// Add element as newest\r\r
// Loop through substrings of each cached element's query property...\r\r
for(var j = sQuery.length-1; j >= 0 ; j--) {\r\r
var subQuery = sQuery.substr(0,j);\r\r
- \r\r
+\r\r
// If a substring of a cached sQuery exactly matches the query...\r\r
- if(matchKey == subQuery) { \r\r
+ if(matchKey == subQuery) {\r\r
bMatchFound = true;\r\r
- \r\r
+\r\r
// Go through each cached result object to match against the query...\r\r
for(var k = aAllResultItems.length-1; k >= 0; k--) {\r\r
var aRecord = aAllResultItems[k];\r\r
var sKeyIndex = (this.queryMatchCase) ?\r\r
encodeURIComponent(aRecord[0]).indexOf(sQuery):\r\r
encodeURIComponent(aRecord[0]).toLowerCase().indexOf(sQuery);\r\r
- \r\r
+\r\r
// A STARTSWITH match is when the query is found at the beginning of the key string...\r\r
if((!bMatchContains && (sKeyIndex === 0)) ||\r\r
// A CONTAINS match is when the query is found anywhere within the key string...\r\r
aResults.unshift(aRecord);\r\r
}\r\r
}\r\r
- \r\r
+\r\r
// Add the subset match result set object as the newest element to cache,\r\r
// and stop looping through the cache.\r\r
resultObj = {};\r\r
}\r\r
}\r\r
}\r\r
- \r\r
+\r\r
// If there was a match, send along the results.\r\r
if(bMatchFound) {\r\r
this.getCachedResultsEvent.fire(this, oParent, sOrigQuery, aResults);\r\r
/**\r\r
* Implementation of YAHOO.widget.DataSource using XML HTTP requests that return\r\r
* query results.\r\r
- * \r\r
+ *\r\r
* @class DS_XHR\r\r
* @extends YAHOO.widget.DataSource\r\r
* @requires connection\r\r
this[sConfig] = oConfigs[sConfig];\r\r
}\r\r
}\r\r
- \r\r
+\r\r
// Initialization sequence\r\r
if(!aSchema || (aSchema.constructor != Array)) {\r\r
YAHOO.log("Could not instantiate XHR DataSource due to invalid arguments", "error", this.toString());\r\r
/**\r\r
* Queries the live data source defined by scriptURI for results. Results are\r\r
* passed back to a callback function.\r\r
- * \r\r
+ *\r\r
* @method doQuery\r\r
* @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r\r
* @param sQuery {String} Query string.\r\r
}\r\r
YAHOO.log("DataSource is querying URL " + sUri, "info", this.toString());\r\r
var oResponse = null;\r\r
- \r\r
+\r\r
var oSelf = this;\r\r
/*\r\r
* Sets up ajax request callback\r\r
if(!isXML) {\r\r
oResp = oResp.responseText;\r\r
}\r\r
- else { \r\r
+ else {\r\r
oResp = oResp.responseXML;\r\r
}\r\r
if(oResp === null) {\r\r
YAHOO.log(YAHOO.widget.DS_XHR.ERROR_DATAXHR + ": " + oResp.statusText, "error", oSelf.toString());\r\r
return;\r\r
};\r\r
- \r\r
+\r\r
var oCallback = {\r\r
success:responseSuccess,\r\r
failure:responseFailure\r\r
};\r\r
- \r\r
+\r\r
if(!isNaN(this.connTimeout) && this.connTimeout > 0) {\r\r
oCallback.timeout = this.connTimeout;\r\r
}\r\r
- \r\r
+\r\r
if(this._oConn) {\r\r
this.connMgr.abort(this._oConn);\r\r
}\r\r
- \r\r
+\r\r
oSelf._oConn = this.connMgr.asyncRequest("GET", sUri, oCallback, null);\r\r
};\r\r
\r\r
/**\r\r
* Parses raw response data into an array of result objects. The result data key\r\r
- * is always stashed in the [0] element of each result object. \r\r
+ * is always stashed in the [0] element of each result object.\r\r
*\r\r
* @method parseResponse\r\r
* @param sQuery {String} Query string.\r\r
if(jsonList.constructor != Array) {\r\r
jsonList = [jsonList];\r\r
}\r\r
- \r\r
+\r\r
// Loop through the array of all responses...\r\r
for(var i = jsonList.length-1; i >= 0 ; i--) {\r\r
var aResultItem = [];\r\r
else {\r\r
return aResults;\r\r
}\r\r
-}; \r\r
+};\r\r
\r\r
/////////////////////////////////////////////////////////////////////////////\r\r
//\r\r
/**\r\r
* Implementation of YAHOO.widget.DataSource using a native Javascript function as\r\r
* its live data source.\r\r
- * \r\r
+ *\r\r
* @class DS_JSFunction\r\r
* @constructor\r\r
* @extends YAHOO.widget.DataSource\r\r
- * @param oFunction {String} In-memory Javascript function that returns query results as an array of objects.\r\r
+ * @param oFunction {HTMLFunction} In-memory Javascript function that returns query results as an array of objects.\r\r
* @param oConfigs {Object} (optional) Object literal of config params.\r\r
*/\r\r
YAHOO.widget.DS_JSFunction = function(oFunction, oConfigs) {\r\r
/**\r\r
* Queries the live data source defined by function for results. Results are\r\r
* passed back to a callback function.\r\r
- * \r\r
+ *\r\r
* @method doQuery\r\r
* @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r\r
* @param sQuery {String} Query string.\r\r
YAHOO.widget.DS_JSFunction.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r\r
var oFunction = this.dataFunction;\r\r
var aResults = [];\r\r
- \r\r
+\r\r
aResults = oFunction(sQuery);\r\r
if(aResults === null) {\r\r
this.dataErrorEvent.fire(this, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);\r\r
YAHOO.log(YAHOO.widget.DataSource.ERROR_DATANULL, "error", this.toString());\r\r
return;\r\r
}\r\r
- \r\r
+\r\r
var resultObj = {};\r\r
resultObj.query = decodeURIComponent(sQuery);\r\r
resultObj.results = aResults;\r\r
this._addCacheElem(resultObj);\r\r
- \r\r
+\r\r
this.getResultsEvent.fire(this, oParent, sQuery, aResults);\r\r
oCallbackFn(sQuery, aResults, oParent);\r\r
return;\r\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */\r\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.txt version: 0.12.1 */\r\r
+\r\r
YAHOO.widget.AutoComplete=function(elInput,elContainer,oDataSource,oConfigs){if(elInput&&elContainer&&oDataSource){if(oDataSource&&(oDataSource instanceof YAHOO.widget.DataSource)){this.dataSource=oDataSource;}\r\r
else{return;}\r\r
if(YAHOO.util.Dom.inDocument(elInput)){if(typeof elInput=="string"){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+elInput;this._oTextbox=document.getElementById(elInput);}\r\r
oSelf.dataReturnEvent.fire(oSelf,sQuery,aResults);};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var sValue=this._oTextbox.value;var sChar=(this.delimChar)?this.delimChar[0]:null;var nIndex=(sChar)?sValue.lastIndexOf(sChar,sValue.length-2):-1;if(nIndex>-1){this._oTextbox.value=sValue.substring(0,nIndex);}\r\r
else{this._oTextbox.value="";}\r\r
this._sSavedQuery=this._oTextbox.value;this.selectionEnforceEvent.fire(this);};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var foundMatch=false;for(var i=this._nDisplayedItems-1;i>=0;i--){var oItem=this._aListItems[i];var sMatch=oItem._sResultKey.toLowerCase();if(sMatch==this._sCurQuery.toLowerCase()){foundMatch=true;break;}}\r\r
-return(foundMatch);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(oItem,sQuery){if(!this.typeAhead){return;}\r\r
+return(foundMatch);};YAHOO.widget.AutoComplete.prototype._typeAhead=function(oItem,sQuery){if(!this.typeAhead||(this._nKeyCode==8)){return;}\r\r
var oTextbox=this._oTextbox;var sValue=this._oTextbox.value;if(!oTextbox.setSelectionRange&&!oTextbox.createTextRange){return;}\r\r
var nStart=sValue.length;this._updateValue(oItem);var nEnd=oTextbox.value.length;this._selectText(oTextbox,nStart,nEnd);var sPrefill=oTextbox.value.substr(nStart,nEnd);this.typeAheadEvent.fire(this,sQuery,sPrefill);};YAHOO.widget.AutoComplete.prototype._selectText=function(oTextbox,nStart,nEnd){if(oTextbox.setSelectionRange){oTextbox.setSelectionRange(nStart,nEnd);}\r\r
else if(oTextbox.createTextRange){var oTextRange=oTextbox.createTextRange();oTextRange.moveStart("character",nStart);oTextRange.moveEnd("character",nEnd-oTextbox.value.length);oTextRange.select();}\r\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r\r
Code licensed under the BSD License:\r\r
http://developer.yahoo.com/yui/license.txt\r\r
-version: 0.12.0\r\r
+version: 0.12.1\r\r
*/\r\r
\r\r
/**\r
*\r
* @class AutoComplete\r
* @constructor\r
- * @param elInput {HTMLElement} DOM element reference of an input field\r
- * @param elInput {String} String ID of an input field\r
- * @param elContainer {HTMLElement} DOM element reference of an existing DIV\r
- * @param elContainer {String} String ID of an existing DIV\r
- * @param oDataSource {Object} Instance of YAHOO.widget.DataSource for query/results\r
- * @param oConfigs {Object} (optional) Object literal of configuration params\r
+ * @param elInput {HTMLElement} DOM element reference of an input field.\r
+ * @param elInput {String} String ID of an input field.\r
+ * @param elContainer {HTMLElement} DOM element reference of an existing DIV.\r
+ * @param elContainer {String} String ID of an existing DIV.\r
+ * @param oDataSource {Object} Instance of YAHOO.widget.DataSource for query/results.\r
+ * @param oConfigs {Object} (optional) Object literal of configuration params.\r
*/\r
YAHOO.widget.AutoComplete = function(elInput,elContainer,oDataSource,oConfigs) {\r
if(elInput && elContainer && oDataSource) {\r
this.selectionEnforceEvent = new YAHOO.util.CustomEvent("selectionEnforce", this);\r
this.containerCollapseEvent = new YAHOO.util.CustomEvent("containerCollapse", this);\r
this.textboxBlurEvent = new YAHOO.util.CustomEvent("textboxBlur", this);\r
- \r
+\r
// Finish up\r
oTextbox.setAttribute("autocomplete","off");\r
YAHOO.widget.AutoComplete._nIndex++;\r
\r
/**\r
* Fired when the AutoComplete instance makes a query to the DataSource.\r
- * \r
+ *\r
* @event dataRequestEvent\r
* @param oSelf {Object} The AutoComplete instance.\r
* @param sQuery {String} The query string.\r
\r
/**\r
* Fired when the input field has been prefilled by the type-ahead\r
- * feature. \r
+ * feature.\r
*\r
* @event typeAheadEvent\r
* @param oSelf {Object} The AutoComplete instance.\r
YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent = null;\r
\r
/**\r
- * Fired when result item has been arrowed to. \r
+ * Fired when result item has been arrowed to.\r
*\r
* @event itemArrowToEvent\r
* @param oSelf {Object} The AutoComplete instance.\r
/**\r
* Fired when a user selection does not match any of the displayed result items.\r
* Note that this event may not behave as expected when delimiter characters\r
- * have been defined. \r
+ * have been defined.\r
*\r
* @event unmatchedItemSelectEvent\r
* @param oSelf {Object} The AutoComplete instance.\r
*/\r
YAHOO.widget.AutoComplete.prototype._typeAhead = function(oItem, sQuery) {\r
// Don't update if turned off\r
- if (!this.typeAhead) {\r
+ if (!this.typeAhead || (this._nKeyCode == 8)) {\r
return;\r
}\r
\r
if(this.alwaysShowContainer && this._bContainerOpen) {\r
return;\r
}\r
- \r
+\r
// Clear contents of container\r
if(!bShow) {\r
this._oContainer._oContent.scrollTop = 0;\r
* database. Supported data include local JavaScript arrays and objects and databases\r\r
* accessible via XHR connections. Supported response formats include JavaScript arrays,\r\r
* JSON, XML, and flat-file textual data.\r\r
- * \r\r
+ *\r\r
* @class DataSource\r\r
* @constructor\r\r
*/\r\r
-YAHOO.widget.DataSource = function() { \r\r
+YAHOO.widget.DataSource = function() {\r\r
/* abstract class */\r\r
};\r\r
\r\r
* @param oParent {Object} The object instance that has requested data.\r\r
*/\r\r
YAHOO.widget.DataSource.prototype.getResults = function(oCallbackFn, sQuery, oParent) {\r\r
- \r\r
+\r\r
// First look in cache\r\r
var aResults = this._doQueryCache(oCallbackFn,sQuery,oParent);\r\r
- \r\r
+\r\r
// Not in cache, so get results from server\r\r
if(aResults.length === 0) {\r\r
this.queryEvent.fire(this, oParent, sQuery);\r\r
* @param oParent {Object} The object instance that has requested data.\r\r
*/\r\r
YAHOO.widget.DataSource.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r\r
- /* override this */ \r\r
+ /* override this */\r\r
};\r\r
\r\r
/**\r\r
* @param aResults {Object[]} Array of result objects.\r\r
*/\r\r
YAHOO.widget.DataSource.prototype.getResultsEvent = null;\r\r
- \r\r
+\r\r
/**\r\r
* Fired when data is retrieved from the local cache.\r\r
*\r\r
\r\r
/**\r\r
* Initializes DataSource instance.\r\r
- * \r\r
+ *\r\r
* @method _init\r\r
* @private\r\r
*/\r\r
if(maxCacheEntries > 0 && !this._aCache) {\r\r
this._aCache = [];\r\r
}\r\r
- \r\r
+\r\r
this._sName = "instance" + YAHOO.widget.DataSource._nIndex;\r\r
YAHOO.widget.DataSource._nIndex++;\r\r
- \r\r
+\r\r
this.queryEvent = new YAHOO.util.CustomEvent("query", this);\r\r
this.cacheQueryEvent = new YAHOO.util.CustomEvent("cacheQuery", this);\r\r
this.getResultsEvent = new YAHOO.util.CustomEvent("getResults", this);\r\r
};\r\r
\r\r
/**\r\r
- * Adds a result object to the local cache, evicting the oldest element if the \r\r
+ * Adds a result object to the local cache, evicting the oldest element if the\r\r
* cache is full. Newer items will have higher indexes, the oldest item will have\r\r
- * index of 0. \r\r
+ * index of 0.\r\r
*\r\r
* @method _addCacheElem\r\r
* @param oResult {Object} Data result object, including array of results.\r\r
if(!aCache || !oResult || !oResult.query || !oResult.results) {\r\r
return;\r\r
}\r\r
- \r\r
+\r\r
// If the cache is full, make room by removing from index=0\r\r
if(aCache.length >= this.maxCacheEntries) {\r\r
aCache.shift();\r\r
}\r\r
- \r\r
+\r\r
// Add to cache, at the end of the array\r\r
aCache.push(oResult);\r\r
};\r\r
/**\r\r
* Queries the local cache for results. If query has been cached, the callback\r\r
* function is called with the results, and the cached is refreshed so that it\r\r
- * is now the newest element. \r\r
+ * is now the newest element.\r\r
*\r\r
* @method _doQueryCache\r\r
* @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r\r
* @param sQuery {String} Query string.\r\r
* @param oParent {Object} The object instance that has requested data.\r\r
* @return aResults {Object[]} Array of results from local cache if found, otherwise null.\r\r
- * @private \r\r
+ * @private\r\r
*/\r\r
YAHOO.widget.DataSource.prototype._doQueryCache = function(oCallbackFn, sQuery, oParent) {\r\r
var aResults = [];\r\r
var aCache = this._aCache;\r\r
var nCacheLength = (aCache) ? aCache.length : 0;\r\r
var bMatchContains = this.queryMatchContains;\r\r
- \r\r
+\r\r
// If cache is enabled...\r\r
if((this.maxCacheEntries > 0) && aCache && (nCacheLength > 0)) {\r\r
this.cacheQueryEvent.fire(this, oParent, sQuery);\r\r
var matchKey = (!this.queryMatchCase) ?\r\r
encodeURIComponent(resultObj.query).toLowerCase():\r\r
encodeURIComponent(resultObj.query);\r\r
- \r\r
+\r\r
// If a cached match key exactly matches the query...\r\r
if(matchKey == sQuery) {\r\r
// Stash all result objects into aResult[] and stop looping through the cache.\r\r
bMatchFound = true;\r\r
aResults = aAllResultItems;\r\r
- \r\r
+\r\r
// The matching cache element was not the most recent,\r\r
// so now we need to refresh the cache.\r\r
- if(i != nCacheLength-1) { \r\r
+ if(i != nCacheLength-1) {\r\r
// Remove element from its original location\r\r
aCache.splice(i,1);\r\r
// Add element as newest\r\r
// Loop through substrings of each cached element's query property...\r\r
for(var j = sQuery.length-1; j >= 0 ; j--) {\r\r
var subQuery = sQuery.substr(0,j);\r\r
- \r\r
+\r\r
// If a substring of a cached sQuery exactly matches the query...\r\r
- if(matchKey == subQuery) { \r\r
+ if(matchKey == subQuery) {\r\r
bMatchFound = true;\r\r
- \r\r
+\r\r
// Go through each cached result object to match against the query...\r\r
for(var k = aAllResultItems.length-1; k >= 0; k--) {\r\r
var aRecord = aAllResultItems[k];\r\r
var sKeyIndex = (this.queryMatchCase) ?\r\r
encodeURIComponent(aRecord[0]).indexOf(sQuery):\r\r
encodeURIComponent(aRecord[0]).toLowerCase().indexOf(sQuery);\r\r
- \r\r
+\r\r
// A STARTSWITH match is when the query is found at the beginning of the key string...\r\r
if((!bMatchContains && (sKeyIndex === 0)) ||\r\r
// A CONTAINS match is when the query is found anywhere within the key string...\r\r
aResults.unshift(aRecord);\r\r
}\r\r
}\r\r
- \r\r
+\r\r
// Add the subset match result set object as the newest element to cache,\r\r
// and stop looping through the cache.\r\r
resultObj = {};\r\r
}\r\r
}\r\r
}\r\r
- \r\r
+\r\r
// If there was a match, send along the results.\r\r
if(bMatchFound) {\r\r
this.getCachedResultsEvent.fire(this, oParent, sOrigQuery, aResults);\r\r
/**\r\r
* Implementation of YAHOO.widget.DataSource using XML HTTP requests that return\r\r
* query results.\r\r
- * \r\r
+ *\r\r
* @class DS_XHR\r\r
* @extends YAHOO.widget.DataSource\r\r
* @requires connection\r\r
this[sConfig] = oConfigs[sConfig];\r\r
}\r\r
}\r\r
- \r\r
+\r\r
// Initialization sequence\r\r
if(!aSchema || (aSchema.constructor != Array)) {\r\r
return;\r\r
/**\r\r
* Queries the live data source defined by scriptURI for results. Results are\r\r
* passed back to a callback function.\r\r
- * \r\r
+ *\r\r
* @method doQuery\r\r
* @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r\r
* @param sQuery {String} Query string.\r\r
sUri += "&" + this.scriptQueryAppend;\r\r
}\r\r
var oResponse = null;\r\r
- \r\r
+\r\r
var oSelf = this;\r\r
/*\r\r
* Sets up ajax request callback\r\r
if(!isXML) {\r\r
oResp = oResp.responseText;\r\r
}\r\r
- else { \r\r
+ else {\r\r
oResp = oResp.responseXML;\r\r
}\r\r
if(oResp === null) {\r\r
oSelf.dataErrorEvent.fire(oSelf, oParent, sQuery, YAHOO.widget.DS_XHR.ERROR_DATAXHR);\r\r
return;\r\r
};\r\r
- \r\r
+\r\r
var oCallback = {\r\r
success:responseSuccess,\r\r
failure:responseFailure\r\r
};\r\r
- \r\r
+\r\r
if(!isNaN(this.connTimeout) && this.connTimeout > 0) {\r\r
oCallback.timeout = this.connTimeout;\r\r
}\r\r
- \r\r
+\r\r
if(this._oConn) {\r\r
this.connMgr.abort(this._oConn);\r\r
}\r\r
- \r\r
+\r\r
oSelf._oConn = this.connMgr.asyncRequest("GET", sUri, oCallback, null);\r\r
};\r\r
\r\r
/**\r\r
* Parses raw response data into an array of result objects. The result data key\r\r
- * is always stashed in the [0] element of each result object. \r\r
+ * is always stashed in the [0] element of each result object.\r\r
*\r\r
* @method parseResponse\r\r
* @param sQuery {String} Query string.\r\r
if(jsonList.constructor != Array) {\r\r
jsonList = [jsonList];\r\r
}\r\r
- \r\r
+\r\r
// Loop through the array of all responses...\r\r
for(var i = jsonList.length-1; i >= 0 ; i--) {\r\r
var aResultItem = [];\r\r
else {\r\r
return aResults;\r\r
}\r\r
-}; \r\r
+};\r\r
\r\r
/////////////////////////////////////////////////////////////////////////////\r\r
//\r\r
/**\r\r
* Implementation of YAHOO.widget.DataSource using a native Javascript function as\r\r
* its live data source.\r\r
- * \r\r
+ *\r\r
* @class DS_JSFunction\r\r
* @constructor\r\r
* @extends YAHOO.widget.DataSource\r\r
- * @param oFunction {String} In-memory Javascript function that returns query results as an array of objects.\r\r
+ * @param oFunction {HTMLFunction} In-memory Javascript function that returns query results as an array of objects.\r\r
* @param oConfigs {Object} (optional) Object literal of config params.\r\r
*/\r\r
YAHOO.widget.DS_JSFunction = function(oFunction, oConfigs) {\r\r
/**\r\r
* Queries the live data source defined by function for results. Results are\r\r
* passed back to a callback function.\r\r
- * \r\r
+ *\r\r
* @method doQuery\r\r
* @param oCallbackFn {HTMLFunction} Callback function defined by oParent object to which to return results.\r\r
* @param sQuery {String} Query string.\r\r
YAHOO.widget.DS_JSFunction.prototype.doQuery = function(oCallbackFn, sQuery, oParent) {\r\r
var oFunction = this.dataFunction;\r\r
var aResults = [];\r\r
- \r\r
+\r\r
aResults = oFunction(sQuery);\r\r
if(aResults === null) {\r\r
this.dataErrorEvent.fire(this, oParent, sQuery, YAHOO.widget.DataSource.ERROR_DATANULL);\r\r
return;\r\r
}\r\r
- \r\r
+\r\r
var resultObj = {};\r\r
resultObj.query = decodeURIComponent(sQuery);\r\r
resultObj.results = aResults;\r\r
this._addCacheElem(resultObj);\r\r
- \r\r
+\r\r
this.getResultsEvent.fire(this, oParent, sQuery, aResults);\r\r
oCallbackFn(sQuery, aResults, oParent);\r\r
return;\r\r
Calendar Release Notes\r
\r
+*** version 0.12.1 ***\r
+\r
+ - Calendar and CalendarGroup now automatically parse the argument passed to setMonth and setYear into an integer, eliminating potential concatenation bugs. \r
+\r
*** version 0.12 ***\r
\r
- New documentation format implemented\r
- - Calendar2up and Calendar_Core are now deprecated. Now, Calendar alone\r
- represents the single Calendar instance, and CalendarGroup represents an\r
- n-up instance, defaulting to 2up\r
- - Added semantic style classes to Calendar elements to allow for custom\r
- styling solely using CSS.\r
- - Remapped all configuration properties to use the Config object\r
- (familiar to those who use the Container collection of controls).\r
- Property names are the same as their previous counterparts, but wrapped\r
- into Calendar.cfg, allowing for runtime reconfiguration of most\r
- properties.\r
+ - Calendar2up and Calendar_Core are now deprecated. Now, Calendar alone represents the single Calendar instance, and CalendarGroup represents an n-up instance, defaulting to 2up\r
+ - Added semantic style classes to Calendar elements to allow for custom styling solely using CSS.\r
+ - Remapped all configuration properties to use the Config object (familiar to those who use the Container collection of controls). Property names are the same as their previous counterparts, but wrapped into Calendar.cfg, allowing for runtime reconfiguration of most properties\r
- Added "title" property for setting the Calendar title\r
- Added "close" property for enabling and disabling the close icon\r
- - Added "iframe" property for enabling an iframe shim in Internet\r
- Explorer 6 and below to fix the select bleed-through bug\r
+ - Added "iframe" property for enabling an iframe shim in Internet Explorer 6 and below to fix the select bleed-through bug\r
- pageDate moved to property: "pagedate"\r
- selectedDates moved to property: "selected"\r
- - minDate moved to property : "mindate", which accepts a JavaScript Date\r
- object like its predecessor, but also supports string dates\r
- - maxDate moved to property : "maxdate", which accepts a JavaScript Date\r
- object like its predecessor, but also supports string dates\r
+ - minDate moved to property : "mindate", which accepts a JavaScript Date object like its predecessor, but also supports string dates\r
+ - maxDate moved to property : "maxdate", which accepts a JavaScript Date object like its predecessor, but also supports string dates\r
- Moved style declarations to initStyles function\r
- - Optimized event handling in\r
- doSelectCell/doCellMouseOver/doCellMouseOut by only attaching the\r
- listener to the outer Calendar container, and only reacting to events on\r
- cells with the "selectable" CSS class.\r
- - Added domEventMap field for applying DOM event listeners to cells\r
- containing specific class and tag combinations.\r
+ - Optimized event handling in doSelectCell/doCellMouseOver/doCellMouseOut by only attaching the listener to the outer Calendar container, and only reacting to events on cells with the "selectable" CSS class.\r
+ - Added domEventMap field for applying DOM event listeners to cells containing specific class and tag combinations.\r
- Moved all cell DOM event attachment to applyListeners function\r
- Added getDateByCellId / getDateFieldsByCellId helper functions\r
- - Corrected DateMath.getWeekNumber to comply with ISO week number\r
- handling\r
- - Separated renderCellDefault style portions into styleCellDefault\r
- function for easy extension\r
- - Deprecated onBeforeSelect. Created beforeSelectEvent which\r
- automatically subscribes to its deprecated predecessor.\r
- - Deprecated onSelect. Created selectEvent, which automatically\r
- subscribes to its deprecated predecessor.\r
- - Deprecated onBeforeDeselect. Created beforeSelectEvent which\r
- automatically subscribes to its deprecated predecessor.\r
- - Deprecated onDeselect. Created beforeDeselectEvent, which\r
- automatically subscribes to its deprecated predecessor.\r
- - Deprecated onChangePage. Created changePageEvent, which automatically\r
- subscribes to its deprecated predecessor.\r
- - Deprecated onRender. Created renderEvent, which automatically\r
- subscribes to its deprecated predecessor.\r
- - Deprecated onReset. Created resetEvent, which automatically subscribes\r
- to its deprecated predecessor.\r
- - Deprecated onClear. Created clearEvent, which automatically subscribes\r
- to its deprecated predecessor.\r
+ - Corrected DateMath.getWeekNumber to comply with ISO week number handling\r
+ - Separated renderCellDefault style portions into styleCellDefault function for easy extension\r
+ - Deprecated onBeforeSelect. Created beforeSelectEvent which automatically subscribes to its deprecated predecessor.\r
+ - Deprecated onSelect. Created selectEvent, which automatically subscribes to its deprecated predecessor.\r
+ - Deprecated onBeforeDeselect. Created beforeSelectEvent which automatically subscribes to its deprecated predecessor.\r
+ - Deprecated onDeselect. Created beforeDeselectEvent, which automatically subscribes to its deprecated predecessor.\r
+ - Deprecated onChangePage. Created changePageEvent, which automatically subscribes to its deprecated predecessor.\r
+ - Deprecated onRender. Created renderEvent, which automatically subscribes to its deprecated predecessor.\r
+ - Deprecated onReset. Created resetEvent, which automatically subscribes to its deprecated predecessor.\r
+ - Deprecated onClear. Created clearEvent, which automatically subscribes to its deprecated predecessor.\r
- Corrected setMonth documentation to refer to 0-11 indexed months.\r
- - Added show and hide methods to Calendar for setting the Calendar's\r
- display property.\r
- - Optimized internal render classes to use innerHTML and string buffers\r
+ - Added show and hide methods to Calendar for setting the Calendar's display property.\r
+ - Optimized internal render classes to use innerHTML and string buffers \r
- Removed wireCustomEvents function\r
- Removed wireDefaultEvents function\r
- Removed doNextMonth / doPreviousMonth\r
- - Removed all buildShell (header, body, footer) functions, since the\r
- Calendar shell is now built dynamically on each render\r
- - Wired all CalendarGroup events and configuration properties to be\r
- properly delegated to Calendar\r
- - Augmented CalendarGroup with all built-in renderers, label functions,\r
- hide, show, and initStyles, creating API transparency between Calendar\r
- and CalendarGroup.\r
+ - Removed all buildShell (header, body, footer) functions, since the Calendar shell is now built dynamically on each render\r
+ - Wired all CalendarGroup events and configuration properties to be properly delegated to Calendar\r
+ - Augmented CalendarGroup with all built-in renderers, label functions, hide, show, and initStyles, creating API transparency between Calendar and CalendarGroup.\r
- Made all tagName, createElement, and entity references XHTML compliant\r
- Fixed Daylight Saving Time bug for Brazilian time zone\r
\r
*** version 0.11.3 ***\r
\r
- - Calendar_Core: Added arguments for selected/deselected dates to\r
- onSelect/onDeselect\r
- - CalendarGroup: Fixed bug where selected dates passed to constructor\r
- were not represented in selectedDates\r
+ - Calendar_Core: Added arguments for selected/deselected dates to onSelect/onDeselect\r
+ - CalendarGroup: Fixed bug where selected dates passed to constructor were not represented in selectedDates\r
- Calendar2up: Now displays correctly in Opera 9\r
\r
*** version 0.11.0 ***\r
\r
- DateMath: DateMath.add now properly adds weeks\r
- DateMath: between() function added\r
- - DateMath: getWeekNumber() fixed to take starting day of week into\r
- account\r
- - All references to Calendar's built in CSS class handlers are removed,\r
- replaced with calls to Dom utility (addClass, removeClass)\r
+ - DateMath: getWeekNumber() fixed to take starting day of week into account\r
+ - All references to Calendar's built in CSS class handlers are removed, replaced with calls to Dom utility (addClass, removeClass)\r
- Several CSS class constants now have clearer names\r
- All CSS classes are now properly namespaced to avoid CSS conflicts\r
- Fixed table:hover bug in CSS\r
- - Calendar no longer requires the container ID and variable name to\r
- match in order for month navigation to function properly\r
- - Calendar month navigation arrows are now represented as background\r
- images\r
+ - Calendar no longer requires the container ID and variable name to match in order for month navigation to function properly\r
+ - Calendar month navigation arrows are now represented as background images\r
\r
*** version 0.10.0 ***\r
\r
- - Major performance improvements from attaching DOM events to associated\r
- table cells only once, when the Calendar shell is built\r
- - DOM events for mouseover/mouseout are now fired for all browsers (not\r
- just Internet Explorer)\r
+ - Major performance improvements from attaching DOM events to associated table cells only once, when the Calendar shell is built\r
+ - DOM events for mouseover/mouseout are now fired for all browsers (not just Internet Explorer)\r
- Reset functionality bug fixed for 2-up Calendar view\r
\r
*** version 0.9.0 ***\r
\r
* Initial release\r
-\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-Version 0.12\r
+version 0.12.1\r
*/\r
\r
.yui-calcontainer {\r
top:2px;\r
bottom:0;\r
width:9px;\r
- height:12px; \r
+ height:12px;\r
left:2px;\r
z-index:1;\r
}\r
top:2px;\r
bottom:0;\r
width:9px;\r
- height:12px; \r
+ height:12px;\r
right:2px;\r
z-index:1;\r
}\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version 0.12.0\r
+version 0.12.1\r
*/\r
\r
/**\r
* Config is a utility used within an Object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.\r
-* @class YAHOO.util.Config\r
+* @namespace YAHOO.util\r
+* @class Config\r
* @constructor\r
* @param {Object} owner The owner Object to which this Config Object belongs\r
*/\r
/**\r
* YAHOO.widget.DateMath is used for simple date manipulation. The class is a static utility\r
* used for adding, subtracting, and comparing dates.\r
-* @class YAHOO.widget.DateMath\r
+* @namespace YAHOO.widget\r
+* @class DateMath\r
*/\r
YAHOO.widget.DateMath = {\r
/**\r
\r
/**\r
* The Calendar component is a UI control that enables users to choose one or more dates from a graphical calendar presented in a one-month ("one-up") or two-month ("two-up") interface. Calendars are generated entirely via script and can be navigated without any page refreshes.\r
-* @module Calendar\r
-* @title Calendar Widget\r
+* @module calendar\r
+* @title Calendar\r
* @namespace YAHOO.widget\r
* @requires yahoo,dom,event\r
*/\r
d = cal.cellDates[index];\r
date = new Date(d[0],d[1]-1,d[2]);\r
\r
+ var link;\r
+\r
cal.logger.log("Selecting cell " + index + " via click", "info");\r
\r
if (cal.Options.MULTI_SELECT) {\r
*/\r
YAHOO.widget.Calendar.prototype.setMonth = function(month) {\r
var current = this.cfg.getProperty("pagedate");\r
- current.setMonth(month);\r
+ current.setMonth(parseInt(month, 10));\r
this.cfg.setProperty("pagedate", current);\r
};\r
\r
*/\r
YAHOO.widget.Calendar.prototype.setYear = function(year) {\r
var current = this.cfg.getProperty("pagedate");\r
- current.setFullYear(year);\r
+ current.setFullYear(parseInt(year, 10));\r
this.cfg.setProperty("pagedate", current);\r
};\r
\r
\r
/**\r
* Sets the calendar group's month explicitly. This month will be set into the first\r
-* @method setMonth\r
* page of the multi-page calendar, and all other months will be iterated appropriately.\r
+* @method setMonth\r
* @param {Number} month The numeric month, from 0 (January) to 11 (December)\r
*/\r
YAHOO.widget.CalendarGroup.prototype.setMonth = function(month) {\r
+ month = parseInt(month, 10);\r
+\r
for (var p=0;p<this.pages.length;++p) {\r
var cal = this.pages[p];\r
cal.setMonth(month+p);\r
\r
/**\r
* Sets the calendar group's year explicitly. This year will be set into the first\r
-* @method setYear\r
* page of the multi-page calendar, and all other months will be iterated appropriately.\r
+* @method setYear\r
* @param {Number} year The numeric 4-digit year\r
*/\r
YAHOO.widget.CalendarGroup.prototype.setYear = function(year) {\r
+ year = parseInt(year, 10);\r
for (var p=0;p<this.pages.length;++p) {\r
var cal = this.pages[p];\r
var pageDate = cal.cfg.getProperty("pageDate");\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version 0.12.1 */\r
YAHOO.util.Config=function(owner){if(owner){this.init(owner);}};YAHOO.util.Config.prototype={owner:null,queueInProgress:false,checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}};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);}};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);}\r
this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}};this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop];if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}\r
return cfg;};this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}};this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(initialConfig[key]&&initialConfig[key]!='undefined'){this.setProperty(key,initialConfig[key]);}\r
for(var i=0;i<rArray.length;i++){rArray[i]=parseInt(rArray[i],10);}\r
return rArray;};YAHOO.widget.Calendar.prototype._parseDates=function(sDates){var aReturn=[];var aDates=sDates.split(this.Locale.DATE_DELIMITER);for(var d=0;d<aDates.length;++d){var sDate=aDates[d];if(sDate.indexOf(this.Locale.DATE_RANGE_DELIMITER)!=-1){var aRange=sDate.split(this.Locale.DATE_RANGE_DELIMITER);var dateStart=this._parseDate(aRange[0]);var dateEnd=this._parseDate(aRange[1]);var fullRange=this._parseRange(dateStart,dateEnd);aReturn=aReturn.concat(fullRange);}else{var aDate=this._parseDate(sDate);aReturn.push(aDate);}}\r
return aReturn;};YAHOO.widget.Calendar.prototype._parseRange=function(startDate,endDate){var dStart=new Date(startDate[0],startDate[1]-1,startDate[2]);var dCurrent=YAHOO.widget.DateMath.add(new Date(startDate[0],startDate[1]-1,startDate[2]),YAHOO.widget.DateMath.DAY,1);var dEnd=new Date(endDate[0],endDate[1]-1,endDate[2]);var results=[];results.push(startDate);while(dCurrent.getTime()<=dEnd.getTime()){results.push([dCurrent.getFullYear(),dCurrent.getMonth()+1,dCurrent.getDate()]);dCurrent=YAHOO.widget.DateMath.add(dCurrent,YAHOO.widget.DateMath.DAY,1);}\r
-return results;};YAHOO.widget.Calendar.prototype.resetRenderers=function(){this.renderStack=this._renderStack.concat();};YAHOO.widget.Calendar.prototype.clearElement=function(cell){cell.innerHTML=" ";cell.className="";};YAHOO.widget.Calendar.prototype.addRenderer=function(sDates,fnRender){var aDates=this._parseDates(sDates);for(var i=0;i<aDates.length;++i){var aDate=aDates[i];if(aDate.length==2){if(aDate[0]instanceof Array){this._addRenderer(YAHOO.widget.Calendar.RANGE,aDate,fnRender);}else{this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,aDate,fnRender);}}else if(aDate.length==3){this._addRenderer(YAHOO.widget.Calendar.DATE,aDate,fnRender);}}};YAHOO.widget.Calendar.prototype._addRenderer=function(type,aDates,fnRender){var add=[type,aDates,fnRender];this.renderStack.unshift(add);this._renderStack=this.renderStack.concat();};YAHOO.widget.Calendar.prototype.addMonthRenderer=function(month,fnRender){this._addRenderer(YAHOO.widget.Calendar.MONTH,[month],fnRender);};YAHOO.widget.Calendar.prototype.addWeekdayRenderer=function(weekday,fnRender){this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[weekday],fnRender);};YAHOO.widget.Calendar.prototype.clearAllBodyCellStyles=function(style){for(var c=0;c<this.cells.length;++c){YAHOO.util.Dom.removeClass(this.cells[c],style);}};YAHOO.widget.Calendar.prototype.setMonth=function(month){var current=this.cfg.getProperty("pagedate");current.setMonth(month);this.cfg.setProperty("pagedate",current);};YAHOO.widget.Calendar.prototype.setYear=function(year){var current=this.cfg.getProperty("pagedate");current.setFullYear(year);this.cfg.setProperty("pagedate",current);};YAHOO.widget.Calendar.prototype.getSelectedDates=function(){var returnDates=[];var selected=this.cfg.getProperty("selected");for(var d=0;d<selected.length;++d){var dateArray=selected[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}\r
+return results;};YAHOO.widget.Calendar.prototype.resetRenderers=function(){this.renderStack=this._renderStack.concat();};YAHOO.widget.Calendar.prototype.clearElement=function(cell){cell.innerHTML=" ";cell.className="";};YAHOO.widget.Calendar.prototype.addRenderer=function(sDates,fnRender){var aDates=this._parseDates(sDates);for(var i=0;i<aDates.length;++i){var aDate=aDates[i];if(aDate.length==2){if(aDate[0]instanceof Array){this._addRenderer(YAHOO.widget.Calendar.RANGE,aDate,fnRender);}else{this._addRenderer(YAHOO.widget.Calendar.MONTH_DAY,aDate,fnRender);}}else if(aDate.length==3){this._addRenderer(YAHOO.widget.Calendar.DATE,aDate,fnRender);}}};YAHOO.widget.Calendar.prototype._addRenderer=function(type,aDates,fnRender){var add=[type,aDates,fnRender];this.renderStack.unshift(add);this._renderStack=this.renderStack.concat();};YAHOO.widget.Calendar.prototype.addMonthRenderer=function(month,fnRender){this._addRenderer(YAHOO.widget.Calendar.MONTH,[month],fnRender);};YAHOO.widget.Calendar.prototype.addWeekdayRenderer=function(weekday,fnRender){this._addRenderer(YAHOO.widget.Calendar.WEEKDAY,[weekday],fnRender);};YAHOO.widget.Calendar.prototype.clearAllBodyCellStyles=function(style){for(var c=0;c<this.cells.length;++c){YAHOO.util.Dom.removeClass(this.cells[c],style);}};YAHOO.widget.Calendar.prototype.setMonth=function(month){var current=this.cfg.getProperty("pagedate");current.setMonth(parseInt(month,10));this.cfg.setProperty("pagedate",current);};YAHOO.widget.Calendar.prototype.setYear=function(year){var current=this.cfg.getProperty("pagedate");current.setFullYear(parseInt(year,10));this.cfg.setProperty("pagedate",current);};YAHOO.widget.Calendar.prototype.getSelectedDates=function(){var returnDates=[];var selected=this.cfg.getProperty("selected");for(var d=0;d<selected.length;++d){var dateArray=selected[d];var date=new Date(dateArray[0],dateArray[1]-1,dateArray[2]);returnDates.push(date);}\r
returnDates.sort(function(a,b){return a-b;});return returnDates;};YAHOO.widget.Calendar.prototype.hide=function(){this.oDomContainer.style.display="none";};YAHOO.widget.Calendar.prototype.show=function(){this.oDomContainer.style.display="block";};YAHOO.widget.Calendar.prototype.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;}}();YAHOO.widget.Calendar.prototype.toString=function(){return"Calendar "+this.id;};YAHOO.widget.Calendar_Core=YAHOO.widget.Calendar;YAHOO.widget.Cal_Core=YAHOO.widget.Calendar;YAHOO.widget.CalendarGroup=function(id,containerId,config){if(arguments.length>0){this.init(id,containerId,config);}};YAHOO.widget.CalendarGroup.prototype.init=function(id,containerId,config){this.initEvents();this.initStyles();this.pages=[];this.id=id;this.containerId=containerId;this.oDomContainer=document.getElementById(containerId);YAHOO.util.Dom.addClass(this.oDomContainer,YAHOO.widget.CalendarGroup.CSS_CONTAINER);YAHOO.util.Dom.addClass(this.oDomContainer,YAHOO.widget.CalendarGroup.CSS_MULTI_UP);this.cfg=new YAHOO.util.Config(this);this.Options={};this.Locale={};this.setupConfig();if(config){this.cfg.applyConfig(config,true);}\r
this.cfg.fireQueue();if(this.browser=="opera"){var fixWidth=function(){var startW=this.oDomContainer.offsetWidth;var w=0;for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];w+=cal.oDomContainer.offsetWidth;}\r
if(w>0){this.oDomContainer.style.width=w+"px";}};this.renderEvent.subscribe(fixWidth,this,true);}};YAHOO.widget.CalendarGroup.prototype.setupConfig=function(){this.cfg.addProperty("pages",{value:2,validator:this.cfg.checkNumber,handler:this.configPages});this.cfg.addProperty("pagedate",{value:new Date(),handler:this.configPageDate});this.cfg.addProperty("selected",{value:[],handler:this.delegateConfig});this.cfg.addProperty("title",{value:"",handler:this.configTitle});this.cfg.addProperty("close",{value:false,handler:this.configClose});this.cfg.addProperty("iframe",{value:true,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("mindate",{value:null,handler:this.delegateConfig});this.cfg.addProperty("maxdate",{value:null,handler:this.delegateConfig});this.cfg.addProperty("MULTI_SELECT",{value:false,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("START_WEEKDAY",{value:0,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("SHOW_WEEKDAYS",{value:true,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("SHOW_WEEK_HEADER",{value:false,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("SHOW_WEEK_FOOTER",{value:false,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("HIDE_BLANK_WEEKS",{value:false,handler:this.delegateConfig,validator:this.cfg.checkBoolean});this.cfg.addProperty("NAV_ARROW_LEFT",{value:YAHOO.widget.Calendar.IMG_ROOT+"us/tr/callt.gif",handler:this.delegateConfig});this.cfg.addProperty("NAV_ARROW_RIGHT",{value:YAHOO.widget.Calendar.IMG_ROOT+"us/tr/calrt.gif",handler:this.delegateConfig});this.cfg.addProperty("MONTHS_SHORT",{value:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],handler:this.delegateConfig});this.cfg.addProperty("MONTHS_LONG",{value:["January","February","March","April","May","June","July","August","September","October","November","December"],handler:this.delegateConfig});this.cfg.addProperty("WEEKDAYS_1CHAR",{value:["S","M","T","W","T","F","S"],handler:this.delegateConfig});this.cfg.addProperty("WEEKDAYS_SHORT",{value:["Su","Mo","Tu","We","Th","Fr","Sa"],handler:this.delegateConfig});this.cfg.addProperty("WEEKDAYS_MEDIUM",{value:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],handler:this.delegateConfig});this.cfg.addProperty("WEEKDAYS_LONG",{value:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],handler:this.delegateConfig});this.cfg.addProperty("LOCALE_MONTHS",{value:"long",handler:this.delegateConfig});this.cfg.addProperty("LOCALE_WEEKDAYS",{value:"short",handler:this.delegateConfig});this.cfg.addProperty("DATE_DELIMITER",{value:",",handler:this.delegateConfig});this.cfg.addProperty("DATE_FIELD_DELIMITER",{value:"/",handler:this.delegateConfig});this.cfg.addProperty("DATE_RANGE_DELIMITER",{value:"-",handler:this.delegateConfig});this.cfg.addProperty("MY_MONTH_POSITION",{value:1,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MY_YEAR_POSITION",{value:2,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MD_MONTH_POSITION",{value:1,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MD_DAY_POSITION",{value:2,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_MONTH_POSITION",{value:1,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_DAY_POSITION",{value:2,handler:this.delegateConfig,validator:this.cfg.checkNumber});this.cfg.addProperty("MDY_YEAR_POSITION",{value:3,handler:this.delegateConfig,validator:this.cfg.checkNumber});};YAHOO.widget.CalendarGroup.prototype.initEvents=function(){var me=this;var sub=function(fn,obj,bOverride){for(var p=0;p<me.pages.length;++p){var cal=me.pages[p];cal[this.type+"Event"].subscribe(fn,obj,bOverride);}};var unsub=function(fn,obj){for(var p=0;p<me.pages.length;++p){var cal=me.pages[p];cal[this.type+"Event"].unsubscribe(fn,obj);}};this.beforeSelectEvent=new YAHOO.util.CustomEvent("beforeSelect");this.beforeSelectEvent.subscribe=sub;this.beforeSelectEvent.unsubscribe=unsub;this.selectEvent=new YAHOO.util.CustomEvent("select");this.selectEvent.subscribe=sub;this.selectEvent.unsubscribe=unsub;this.beforeDeselectEvent=new YAHOO.util.CustomEvent("beforeDeselect");this.beforeDeselectEvent.subscribe=sub;this.beforeDeselectEvent.unsubscribe=unsub;this.deselectEvent=new YAHOO.util.CustomEvent("deselect");this.deselectEvent.subscribe=sub;this.deselectEvent.unsubscribe=unsub;this.changePageEvent=new YAHOO.util.CustomEvent("changePage");this.changePageEvent.subscribe=sub;this.changePageEvent.unsubscribe=unsub;this.beforeRenderEvent=new YAHOO.util.CustomEvent("beforeRender");this.beforeRenderEvent.subscribe=sub;this.beforeRenderEvent.unsubscribe=unsub;this.renderEvent=new YAHOO.util.CustomEvent("render");this.renderEvent.subscribe=sub;this.renderEvent.unsubscribe=unsub;this.resetEvent=new YAHOO.util.CustomEvent("reset");this.resetEvent.subscribe=sub;this.resetEvent.unsubscribe=unsub;this.clearEvent=new YAHOO.util.CustomEvent("clear");this.clearEvent.subscribe=sub;this.clearEvent.unsubscribe=unsub;};YAHOO.widget.CalendarGroup.prototype.configPages=function(type,args,obj){var pageCount=args[0];for(var p=0;p<pageCount;++p){var calId=this.id+"_"+p;var calContainerId=this.containerId+"_"+p;var childConfig=this.cfg.getConfig();childConfig.close=false;childConfig.title=false;var cal=this.constructChild(calId,calContainerId,childConfig);var caldate=cal.cfg.getProperty("pagedate");caldate.setMonth(caldate.getMonth()+p);cal.cfg.setProperty("pagedate",caldate);YAHOO.util.Dom.removeClass(cal.oDomContainer,this.Style.CSS_SINGLE);YAHOO.util.Dom.addClass(cal.oDomContainer,"groupcal");if(p===0){YAHOO.util.Dom.addClass(cal.oDomContainer,"first");}\r
if(p==(pageCount-1)){YAHOO.util.Dom.addClass(cal.oDomContainer,"last");}\r
cal.parent=this;cal.index=p;this.pages[this.pages.length]=cal;}};YAHOO.widget.CalendarGroup.prototype.configPageDate=function(type,args,obj){var val=args[0];for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.cfg.setProperty("pagedate",val);var calDate=cal.cfg.getProperty("pagedate");calDate.setMonth(calDate.getMonth()+p);}};YAHOO.widget.CalendarGroup.prototype.delegateConfig=function(type,args,obj){var val=args[0];var cal;for(var p=0;p<this.pages.length;p++){cal=this.pages[p];cal.cfg.setProperty(type,val);}};YAHOO.widget.CalendarGroup.prototype.setChildFunction=function(fnName,fn){var pageCount=this.cfg.getProperty("pages");for(var p=0;p<pageCount;++p){this.pages[p][fnName]=fn;}};YAHOO.widget.CalendarGroup.prototype.callChildFunction=function(fnName,args){var pageCount=this.cfg.getProperty("pages");for(var p=0;p<pageCount;++p){var page=this.pages[p];if(page[fnName]){var fn=page[fnName];fn.call(page,args);}}};YAHOO.widget.CalendarGroup.prototype.constructChild=function(id,containerId,config){var container=document.getElementById(containerId);if(!container){container=document.createElement("div");container.id=containerId;this.oDomContainer.appendChild(container);}\r
-return new YAHOO.widget.Calendar(id,containerId,config);};YAHOO.widget.CalendarGroup.prototype.setMonth=function(month){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.setMonth(month+p);}};YAHOO.widget.CalendarGroup.prototype.setYear=function(year){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];var pageDate=cal.cfg.getProperty("pageDate");if((pageDate.getMonth()+1)==1&&p>0){year+=1;}\r
+return new YAHOO.widget.Calendar(id,containerId,config);};YAHOO.widget.CalendarGroup.prototype.setMonth=function(month){month=parseInt(month,10);for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.setMonth(month+p);}};YAHOO.widget.CalendarGroup.prototype.setYear=function(year){year=parseInt(year,10);for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];var pageDate=cal.cfg.getProperty("pageDate");if((pageDate.getMonth()+1)==1&&p>0){year+=1;}\r
cal.setYear(year);}};YAHOO.widget.CalendarGroup.prototype.render=function(){this.renderHeader();for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.render();}\r
this.renderFooter();};YAHOO.widget.CalendarGroup.prototype.select=function(date){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.select(date);}\r
return this.getSelectedDates();};YAHOO.widget.CalendarGroup.prototype.selectCell=function(cellIndex){for(var p=0;p<this.pages.length;++p){var cal=this.pages[p];cal.selectCell(cellIndex);}\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version 0.12.0\r
+version 0.12.1\r
*/\r
\r
/**\r
* Config is a utility used within an Object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.\r
-* @class YAHOO.util.Config\r
+* @namespace YAHOO.util\r
+* @class Config\r
* @constructor\r
* @param {Object} owner The owner Object to which this Config Object belongs\r
*/\r
/**\r
* YAHOO.widget.DateMath is used for simple date manipulation. The class is a static utility\r
* used for adding, subtracting, and comparing dates.\r
-* @class YAHOO.widget.DateMath\r
+* @namespace YAHOO.widget\r
+* @class DateMath\r
*/\r
YAHOO.widget.DateMath = {\r
/**\r
\r
/**\r
* The Calendar component is a UI control that enables users to choose one or more dates from a graphical calendar presented in a one-month ("one-up") or two-month ("two-up") interface. Calendars are generated entirely via script and can be navigated without any page refreshes.\r
-* @module Calendar\r
-* @title Calendar Widget\r
+* @module calendar\r
+* @title Calendar\r
* @namespace YAHOO.widget\r
* @requires yahoo,dom,event\r
*/\r
*/\r
YAHOO.widget.Calendar.prototype.setMonth = function(month) {\r
var current = this.cfg.getProperty("pagedate");\r
- current.setMonth(month);\r
+ current.setMonth(parseInt(month, 10));\r
this.cfg.setProperty("pagedate", current);\r
};\r
\r
*/\r
YAHOO.widget.Calendar.prototype.setYear = function(year) {\r
var current = this.cfg.getProperty("pagedate");\r
- current.setFullYear(year);\r
+ current.setFullYear(parseInt(year, 10));\r
this.cfg.setProperty("pagedate", current);\r
};\r
\r
\r
/**\r
* Sets the calendar group's month explicitly. This month will be set into the first\r
-* @method setMonth\r
* page of the multi-page calendar, and all other months will be iterated appropriately.\r
+* @method setMonth\r
* @param {Number} month The numeric month, from 0 (January) to 11 (December)\r
*/\r
YAHOO.widget.CalendarGroup.prototype.setMonth = function(month) {\r
+ month = parseInt(month, 10);\r
+\r
for (var p=0;p<this.pages.length;++p) {\r
var cal = this.pages[p];\r
cal.setMonth(month+p);\r
\r
/**\r
* Sets the calendar group's year explicitly. This year will be set into the first\r
-* @method setYear\r
* page of the multi-page calendar, and all other months will be iterated appropriately.\r
+* @method setYear\r
* @param {Number} year The numeric 4-digit year\r
*/\r
YAHOO.widget.CalendarGroup.prototype.setYear = function(year) {\r
+ year = parseInt(year, 10);\r
+\r
for (var p=0;p<this.pages.length;++p) {\r
var cal = this.pages[p];\r
var pageDate = cal.cfg.getProperty("pageDate");\r
Connection Manager Release Notes\r
\r
+*** version 0.12.1 ***\r
+\r
+* connection-debug.js corrected and synchronized with connection.js. Code\r
+inconsistencies between the two files existed in 0.12.0.\r
+\r
*** version 0.12.0 ***\r
\r
* When uploading files via setForm() and asyncRequest includes a POST data\r
\r
\r
\r
+\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
+version: 0.12.1\r
*/\r
\r
/**\r
if(this._isFormSubmit || (postData && this._use_default_post_header)){\r
this.initHeader('Content-Type', this._default_post_header);\r
YAHOO.log('Initialize default header Content-Type to application/x-www-form-urlencoded.', 'info', 'Connection');\r
- }\r
- else if(this._isFormSubmit){\r
- this.resetFormState();\r
+ if(this._isFormSubmit){\r
+ this.resetFormState();\r
+ }\r
}\r
\r
if(this._has_http_headers){\r
*/\r
setForm:function(formId, isUpload, secureUri)\r
{\r
+ this.resetFormState();\r
+ var oForm;\r
if(typeof formId == 'string'){\r
// Determine if the argument is a form id or a form name.\r
// Note form name usage is deprecated by supported\r
// here for legacy reasons.\r
- var oForm = (document.getElementById(formId) || document.forms[formId]);\r
+ oForm = (document.getElementById(formId) || document.forms[formId]);\r
}\r
else if(typeof formId == 'object'){\r
// Treat argument as an HTML form object.\r
- var oForm = formId;\r
+ oForm = formId;\r
}\r
else{\r
YAHOO.log('Unable to create form object ' + formId, 'warn', 'Connection');\r
* @method resetFormState\r
* @private\r
* @static\r
- * @param {boolean} isUpload Indicates if file upload properties should be reset.\r
* @return {void}\r
*/\r
- resetFormState:function(isUpload){\r
+ resetFormState:function(){\r
this._isFormSubmit = false;\r
- this._sFormData = null;\r
- if(isUpload){\r
- this._isFileUpload = false;\r
- this._formNode = null;\r
- }\r
+ this._isFileUpload = false;\r
+ this._formNode = null;\r
+ this._sFormData = "";\r
},\r
\r
/**\r
*/\r
appendPostData:function(postData)\r
{\r
- var formElements = new Array();\r
+ var formElements = [];\r
var postMessage = postData.split('&');\r
for(var i=0; i < postMessage.length; i++){\r
var delimitPos = postMessage[i].indexOf('=');\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.1 */\r
YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_header:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:'application/x-www-form-urlencoded',_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,setProgId:function(id)\r
{this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b)\r
{this._use_default_post_header=b;},setPollingInterval:function(i)\r
else if(typeof secureURI=='string'){io.src=secureUri;}}\r
else{var io=document.createElement('iframe');io.id=frameId;io.name=frameId;}\r
io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},appendPostData:function(postData)\r
-{var formElements=new Array();var postMessage=postData.split('&');for(var i=0;i<postMessage.length;i++){var delimitPos=postMessage[i].indexOf('=');if(delimitPos!=-1){formElements[i]=document.createElement('input');formElements[i].type='hidden';formElements[i].name=postMessage[i].substring(0,delimitPos);formElements[i].value=postMessage[i].substring(delimitPos+1);this._formNode.appendChild(formElements[i]);}}\r
+{var formElements=[];var postMessage=postData.split('&');for(var i=0;i<postMessage.length;i++){var delimitPos=postMessage[i].indexOf('=');if(delimitPos!=-1){formElements[i]=document.createElement('input');formElements[i].type='hidden';formElements[i].name=postMessage[i].substring(0,delimitPos);formElements[i].value=postMessage[i].substring(delimitPos+1);this._formNode.appendChild(formElements[i]);}}\r
return formElements;},uploadFile:function(id,callback,uri,postData){var frameId='yuiIO'+id;var io=document.getElementById(frameId);this._formNode.action=uri;this._formNode.method='POST';this._formNode.target=frameId;if(this._formNode.encoding){this._formNode.encoding='multipart/form-data';}\r
else{this._formNode.enctype='multipart/form-data';}\r
if(postData){var oElements=this.appendPostData(postData);}\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
+version: 0.12.1\r
*/\r
\r
/**\r
var oForm;\r
if(typeof formId == 'string'){\r
// Determine if the argument is a form id or a form name.\r
- // Note form name usage is deprecated by supported\r
+ // Note form name usage is deprecated but supported\r
// here for legacy reasons.\r
oForm = (document.getElementById(formId) || document.forms[formId]);\r
}\r
*/\r
appendPostData:function(postData)\r
{\r
- var formElements = new Array();\r
+ var formElements = [];\r
var postMessage = postData.split('&');\r
for(var i=0; i < postMessage.length; i++){\r
var delimitPos = postMessage[i].indexOf('=');\r
Container Release Notes\r
\r
-*** version 0.12.0 ***\r
+*** version 0.12.1 ***\r
\r
All Classes\r
- - New documentation format implemented, and removed unnecessary\r
- prototype null references previously used for generating\r
- documentation\r
- - Modified the\r
+ - "monitorresize" property now functions in situations where document.domain has been modified.\r
+ - YAHOO.widget.Module.textResizeEvent now fires when the font size is changed (except for Opera, which uses "zoom" functionality that prevents this)\r
+ - Event listeners attached to container elements are now properly purged on destroy using YAHOO.util.Event.purgeElement\r
+\r
+ Panel\r
+ - Fixed issue where focus events were broken on the page when a modal Panel was created\r
+\r
+ Dialog\r
+ - Fixed bug where hitting "enter" on a Dialog was forcing the default submission behavior of the form's action to execute\r
+ - Dialog no longer tries to give focus to hidden form elements.\r
+ - Replaced references in Panel with   for XHTML compliance.\r
+ - Fixed issue that was preventing Safari from successfully using the getData() function\r
+\r
+*** version 0.12 ***\r
+\r
+ All Classes\r
+ - New documentation format implemented, and removed unnecessary prototype null references previously used for generating documentation\r
+ - Modified the \r
\r
Config\r
- - Added 'undefined' check when reading initial properties for\r
- .reset()\r
+ - Added 'undefined' check when reading initial properties for .reset() \r
- Fixed Firefox warning on .resetProperty()\r
- - Fixed issue preventing resetProperty() from resetting values\r
- correctly\r
+ - Fixed issue preventing resetProperty() from resetting values correctly\r
\r
Module\r
- Removed unused "childNodesInDom" property\r
\r
Overlay\r
- Converted center() to use Dom utility\r
- - Fixed configVisible() to properly detect actual visible/hidden\r
- status in Internet Explorer, which reports "inherit" for all elements\r
- by default.\r
+ - Fixed configVisible() to properly detect actual visible/hidden status in Internet Explorer, which reports "inherit" for all elements by default.\r
- Updated onDomResize to properly reapply "context" property\r
- - Unified scroll/resize handlers so that they fire properly (when the\r
- event has completed) as opposed to constantly (as seen in Mozilla-\r
- based browsers)\r
-\r
+ - Unified scroll/resize handlers so that they fire properly (when the event has completed) as opposed to constantly (as seen in Mozilla-based browsers)\r
+ \r
Panel\r
- - Modified modality mask to show before Panel is shown (prior to any\r
- animation)\r
- - Modified buildWrapper to eliminate cloning of the initial markup\r
- module, which fixes issues with select options not maintaining their\r
- default selections in IE\r
- - Modality mask is now z-indexed properly so that the mask z-index is\r
- always one less than the Panel z-index\r
-\r
+ - Modified modality mask to show before Panel is shown (prior to any animation)\r
+ - Modified buildWrapper to eliminate cloning of the initial markup module, which fixes issues with select options not maintaining their default selections in IE\r
+ - Modality mask is now z-indexed properly so that the mask z-index is always one less than the Panel z-index\r
+ \r
Dialog\r
- - Fixed Connection to get "action" attribute using getAttribute, to\r
- allow for form fields named "action"\r
- - Added support for "GET" by retrieving the form "method" rather than\r
- always defaulting to "POST"\r
-\r
+ - Fixed Connection to get "action" attribute using getAttribute, to allow for form fields named "action"\r
+ - Added support for "GET" by retrieving the form "method" rather than always defaulting to "POST"\r
+ \r
KeyListener\r
- - Fixed to work properly with Safari 2.0 by matching against keyCode\r
- or charCode\r
+ - Fixed to work properly with Safari 2.0 by matching against keyCode or charCode\r
\r
*** version 0.11.4 ***\r
-\r
- - Panel: Modality mask is now properly removed from DOM on Panel\r
- destroy.\r
-\r
+ \r
+ - Panel: Modality mask is now properly removed from DOM on Panel destroy.\r
+ \r
*** version 0.11.3 ***\r
\r
- Module: Fixed SSL warning issue in IE\r
- Overlay: Fixed memory leak related to iframe shim in IE\r
- Panel: No focusable elements under the mask can now be tabbed to\r
- - Panel: Set Panel container overflow to hidden to fix scrolling issue\r
- in Opera 9\r
+ - Panel: Set Panel container overflow to hidden to fix scrolling issue in Opera 9\r
\r
*** version 0.11.2 ***\r
\r
*** version 0.11.1 ***\r
\r
- Tooltip: Removed incorrect logger statement\r
- - Dialog: Corrected logic that was causing browser lockup in IE for\r
- SimpleDialog\r
+ - Dialog: Corrected logic that was causing browser lockup in IE for SimpleDialog\r
- Dialog: Fixed "firstButtom" typo\r
\r
*** version 0.11.0 ***\r
\r
- toString function added to all classes for easy logging\r
- - YAHOO.extend is now being used for inheritance on all container\r
- classes\r
+ - YAHOO.extend is now being used for inheritance on all container classes\r
- Module: monitorresize feature now works on all browsers\r
- Module: Fixed bug with image root and isSecure\r
- Overlay: Fixed bugs related to IFRAME shim positioning\r
- Overlay: center() now works in quirks mode\r
- - Overlay: Overlay now has a custom destroy() method that also removes\r
- the IFRAME shim\r
- - OverlayManager: Fixed bug in the prototype that was preventing\r
- multiple Managers on one page\r
+ - Overlay: Overlay now has a custom destroy() method that also removes the IFRAME shim\r
+ - OverlayManager: Fixed bug in the prototype that was preventing multiple Managers on one page\r
- OverlayManager: focusEvent now fires at all appropriate times\r
- - Tooltip: context can now be specified as an array, so Tooltips can be\r
- reused across multiple context elements\r
- - Tooltip: preventoverlap now functions properly for large context\r
- elements (i.e, images)\r
+ - Tooltip: context can now be specified as an array, so Tooltips can be reused across multiple context elements\r
+ - Tooltip: preventoverlap now functions properly for large context elements (i.e, images)\r
- Tooltip: fixed bugs regarding setTimeout\r
- - Tooltip: added mousemove event to allow for more accurate Tooltip\r
- positioning\r
- - Panel: added dragEvent for monitoring all event handlers for drag and\r
- drop\r
+ - Tooltip: added mousemove event to allow for more accurate Tooltip positioning\r
+ - Panel: added dragEvent for monitoring all event handlers for drag and drop\r
- Panel: modality mask is now resized on scroll\r
- - Panel: KeyListeners are now properly destroyed when the Panel is\r
- destroyed\r
+ - Panel: KeyListeners are now properly destroyed when the Panel is destroyed\r
- Panel: Header is now sized properly in quirks mode\r
- Dialog: Blinking cursor issue is fixed for Firefox\r
- Dialog: callback object for Connection is now public (this.callback)\r
- - Dialog: onsuccess/onfailure properties removed (as a result of the\r
- public callback object)\r
+ - Dialog: onsuccess/onfailure properties removed (as a result of the public callback object)\r
- Dialog: Dialog is now invisible by default\r
- Dialog: Buttons are now properly cleaned up on destroy\r
\r
*** version 0.10.0 ***\r
\r
* Initial release\r
-\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-Version 0.11.0\r
+version 0.12.1\r
*/\r
\r
.overlay {\r
}\r
\r
.mask {\r
- z-index:0; \r
+ z-index:0;\r
display:none;\r
position:absolute;\r
top:0;\r
font-weight:bold;\r
}\r
\r
-.button-group button:hover, .button-group button.hover { \r
+.button-group button:hover, .button-group button.hover {\r
border:2px solid #90A029;\r
background-color:#EBF09E;\r
border-top-color:#FFF;\r
border-left-color:#FFF;\r
}\r
\r
-.button-group button:active { \r
+.button-group button:active {\r
border:2px solid #E4E4E4;\r
background-color:#BBB;\r
border-top-color:#333;\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
+version 0.12.1\r
*/\r
\r
/**\r
* Config is a utility used within an Object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.\r
-* @class YAHOO.util.Config\r
+* @namespace YAHOO.util\r
+* @class Config\r
* @constructor\r
* @param {Object} owner The owner Object to which this Config Object belongs\r
*/\r
\r
/**\r
* The Container family of components is designed to enable developers to create different kinds of content-containing modules on the web. Module and Overlay are the most basic containers, and they can be used directly or extended to build custom containers. Also part of the Container family are four UI controls that extend Module and Overlay: Tooltip, Panel, Dialog, and SimpleDialog.\r
-* @module Container\r
+* @module container\r
+* @title Container\r
* @requires yahoo,dom,event,dragdrop,animation\r
*/\r
\r
/**\r
* Module is a JavaScript representation of the Standard Module Format. Standard Module Format is a simple standard for markup containers where child nodes representing the header, body, and footer of the content are denoted using the CSS classes "hd", "bd", and "ft" respectively. Module is the base class for all other classes in the YUI Container package.\r
-* @class Module\r
* @namespace YAHOO.widget\r
+* @class Module\r
* @constructor\r
* @param {String} el The element ID representing the Module <em>OR</em>\r
* @param {HTMLElement} el The element representing the Module\r
*/\r
YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";\r
\r
-YAHOO.widget.Module.prototype = {\r
+/**\r
+* Singleton CustomEvent fired when the font size is changed in the browser.\r
+* Opera's "zoom" functionality currently does not support text size detection.\r
+* @event YAHOO.widget.Module.textResizeEvent\r
+*/\r
+YAHOO.widget.Module.textResizeEvent = new YAHOO.util.CustomEvent("textResize");\r
\r
+YAHOO.widget.Module.prototype = {\r
/**\r
* The class's constructor function\r
* @property contructor\r
doc.close();\r
\r
}\r
-\r
}\r
\r
- if(resizeMonitor && resizeMonitor.contentWindow) {\r
+ var fireTextResize = function() {\r
+ YAHOO.widget.Module.textResizeEvent.fire();\r
+ };\r
\r
+ if(resizeMonitor && resizeMonitor.contentWindow) {\r
this.resizeMonitor = resizeMonitor;\r
\r
- YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", this.onDomResize, this, true);\r
+ YAHOO.widget.Module.textResizeEvent.subscribe(this.onDomResize, this, true);\r
\r
+ if (! YAHOO.widget.Module.textResizeInitialized) {\r
+ if (! YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", fireTextResize)) {\r
+ // This will fail in IE if document.domain has changed, so we must change the listener to\r
+ // use the resizeMonitor element instead\r
+ YAHOO.util.Event.addListener(this.resizeMonitor, "resize", fireTextResize);\r
+ }\r
+ YAHOO.widget.Module.textResizeInitialized = true;\r
+ }\r
}\r
\r
}\r
* @method destroy\r
*/\r
destroy : function() {\r
+ var parent;\r
+\r
if (this.element) {\r
- var parent = this.element.parentNode;\r
+ YAHOO.util.Event.purgeElement(this.element, true);\r
+ parent = this.element.parentNode;\r
}\r
if (parent) {\r
parent.removeChild(this.element);\r
this.body = null;\r
this.footer = null;\r
\r
+ for (var e in this) {\r
+ if (e instanceof YAHOO.util.CustomEvent) {\r
+ e.unsubscribeAll();\r
+ }\r
+ }\r
+\r
+ YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize, this);\r
+\r
this.destroyEvent.fire();\r
},\r
\r
\r
/**\r
* Overlay is a Module that is absolutely positioned above the page flow. It has convenience methods for positioning and sizing, as well as options for controlling zIndex and constraining the Overlay's position to the current visible viewport. Overlay also contains a dynamicly generated IFRAME which is placed beneath it for Internet Explorer 6 and 5.x so that it will be properly rendered above SELECT elements.\r
-* @class Overlay\r
* @namespace YAHOO.widget\r
+* @class Overlay\r
* @extends YAHOO.widget.Module\r
* @param {String} el The element ID representing the Overlay <em>OR</em>\r
* @param {HTMLElement} el The element representing the Overlay\r
* @final\r
* @type String\r
*/\r
-YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;"\r
+YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;";\r
\r
/**\r
* Constant representing the top left corner of an element, used for configuring the context element alignment\r
if (! this.iframe) {\r
this.iframe = document.createElement("iframe");\r
if (this.isSecure) {\r
- this.iframe.src = this.imageRoot + YAHOO.widget.Overlay.IFRAME_SRC;\r
+ this.iframe.src = YAHOO.widget.Overlay.IFRAME_SRC;\r
}\r
\r
var parent = this.element.parentNode;\r
\r
this.iframe = null;\r
\r
+ YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);\r
+ YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);\r
+\r
YAHOO.widget.Overlay.superclass.destroy.call(this);\r
};\r
\r
var draggable = this.cfg.getProperty("draggable");\r
if (draggable) {\r
if (! this.header) {\r
- this.setHeader(" ");\r
+ this.setHeader(" ");\r
}\r
}\r
}, this, true);\r
\r
var me = this;\r
\r
+ var doBlur = function() {\r
+ this.blur();\r
+ };\r
+\r
this.showMaskEvent.subscribe(function() {\r
var checkFocusable = function(el) {\r
- if (el.tagName == "A" || el.tagName == "BUTTON" || el.tagName == "SELECT" || el.tagName == "INPUT" || el.tagName == "TEXTAREA" || el.tagName == "FORM") {\r
+ if ((el.tagName == "A" || el.tagName == "BUTTON" || el.tagName == "SELECT" || el.tagName == "INPUT" || el.tagName == "TEXTAREA" || el.tagName == "FORM") && el.type != "hidden") {\r
if (! YAHOO.util.Dom.isAncestor(me.element, el)) {\r
- YAHOO.util.Event.addListener(el, "focus", el.blur);\r
+ YAHOO.util.Event.addListener(el, "focus", doBlur, el, true);\r
return true;\r
}\r
} else {\r
this.hideMaskEvent.subscribe(function() {\r
for (var i=0;i<this.focusableElements.length;i++) {\r
var el2 = this.focusableElements[i];\r
- YAHOO.util.Event.removeListener(el2, "focus", el2.blur);\r
+ YAHOO.util.Event.removeListener(el2, "focus", doBlur);\r
}\r
}, this, true);\r
\r
YAHOO.util.Dom.addClass(this.close, "nonsecure");\r
}\r
\r
- this.close.innerHTML = " ";\r
+ this.close.innerHTML = " ";\r
this.innerElement.appendChild(this.close);\r
YAHOO.util.Event.addListener(this.close, "click", doHide, this);\r
} else {\r
if (! this.underlay) { // create if not already in DOM\r
this.underlay = document.createElement("DIV");\r
this.underlay.className = "underlay";\r
- this.underlay.innerHTML = " ";\r
+ this.underlay.innerHTML = " ";\r
this.element.appendChild(this.underlay);\r
}\r
\r
this.mask = document.createElement("DIV");\r
this.mask.id = this.id + "_mask";\r
this.mask.className = "mask";\r
- this.mask.innerHTML = " ";\r
+ this.mask.innerHTML = " ";\r
\r
var maskClick = function(e, obj) {\r
YAHOO.util.Event.stopEvent(e);\r
* @type String\r
* @default async\r
*/\r
- this.cfg.addProperty("postmethod", { value:"async", validator:function(val) {\r
+ this.cfg.addProperty("postmethod", { value:"async", handler:this.configPostMethod, validator:function(val) {\r
if (val != "form" && val != "async" && val != "none" && val != "manual") {\r
return false;\r
} else {\r
this.cfg.applyConfig(userConfig, true);\r
}\r
\r
- this.renderEvent.subscribe(this.registerForm, this, true);\r
-\r
this.showEvent.subscribe(this.focusFirst, this, true);\r
this.beforeHideEvent.subscribe(this.blurButtons, this, true);\r
\r
}\r
};\r
\r
+/**\r
+* The default event handler for the "postmethod" configuration property\r
+* @method configPostMethod\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]} args The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj The scope object. For configuration handlers, this will usually equal the owner.\r
+*/\r
+YAHOO.widget.Dialog.prototype.configPostMethod = function(type, args, obj) {\r
+ var postmethod = args[0];\r
+\r
+ this.registerForm();\r
+ YAHOO.util.Event.addListener(this.form, "submit", function(e) {\r
+ YAHOO.util.Event.stopEvent(e);\r
+ this.submit();\r
+ this.form.blur();\r
+ }, this, true);\r
+};\r
+\r
// END BUILT-IN PROPERTY EVENT HANDLERS //\r
\r
/**\r
var data = {};\r
\r
if (form) {\r
- for (var i in this.form) {\r
- var formItem = form[i];\r
+ for (var i=0;i<form.elements.length;i++) {\r
+ var formItem = form.elements[i];\r
if (formItem) {\r
if (formItem.tagName) { // Got a single form item\r
switch (formItem.tagName) {\r
case "INPUT":\r
switch (formItem.type) {\r
case "checkbox":\r
- data[i] = formItem.checked;\r
+ data[formItem.name] = formItem.checked;\r
break;\r
case "textbox":\r
case "text":\r
case "hidden":\r
- data[i] = formItem.value;\r
+ data[formItem.name] = formItem.value;\r
break;\r
}\r
break;\r
case "TEXTAREA":\r
- data[i] = formItem.value;\r
+ data[formItem.name] = formItem.value;\r
break;\r
case "SELECT":\r
var val = [];\r
val[val.length] = selval;\r
}\r
}\r
- data[i] = val;\r
+ data[formItem.name] = val;\r
break;\r
}\r
} else if (formItem[0] && formItem[0].tagName) { // this is an array of form items\r
* A pre-configured ContainerEffect instance that can be used for fading an overlay in and out.\r
* @method FADE\r
* @static\r
-* @param {Overlay} The Overlay object to animate\r
-* @param {Number} The duration of the animation\r
+* @param {Overlay} overlay The Overlay object to animate\r
+* @param {Number} dur The duration of the animation\r
* @return {ContainerEffect} The configured ContainerEffect object\r
*/\r
YAHOO.widget.ContainerEffect.FADE = function(overlay, dur) {\r
* A pre-configured ContainerEffect instance that can be used for sliding an overlay in and out.\r
* @method SLIDE\r
* @static\r
-* @param {Overlay} The Overlay object to animate\r
-* @param {Number} The duration of the animation\r
+* @param {Overlay} overlay The Overlay object to animate\r
+* @param {Number} dur The duration of the animation\r
* @return {ContainerEffect} The configured ContainerEffect object\r
*/\r
YAHOO.widget.ContainerEffect.SLIDE = function(overlay, dur) {\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version 0.12.1 */\r
YAHOO.util.Config=function(owner){if(owner){this.init(owner);}};YAHOO.util.Config.prototype={owner:null,queueInProgress:false,checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}};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);}};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);}\r
this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}};this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop];if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}\r
return cfg;};this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}};this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(initialConfig[key]&&initialConfig[key]!='undefined'){this.setProperty(key,initialConfig[key]);}\r
return true;}else{return false;}};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;}};this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}\r
return output;};this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}\r
return output;};};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;}}\r
-return false;};YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}};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.RESIZE_MONITOR_SECURE_URL="javascript:false;";YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,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){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(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}\r
+return false;};YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}};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.RESIZE_MONITOR_SECURE_URL="javascript:false;";YAHOO.widget.Module.textResizeEvent=new YAHOO.util.CustomEvent("textResize");YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,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){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(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}\r
if(typeof el=="string"){var elId=el;el=document.getElementById(el);if(!el){el=document.createElement("DIV");el.id=elId;}}\r
this.element=el;if(el.id){this.id=el.id;}\r
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;}}}\r
if(!YAHOO.util.Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}\r
this.initEvent.fire(YAHOO.widget.Module);},initResizeMonitor:function(){if(this.browser!="opera"){var resizeMonitor=document.getElementById("_yuiResizeMonitor");if(!resizeMonitor){resizeMonitor=document.createElement("iframe");var bIE=(this.browser.indexOf("ie")===0);if(this.isSecure&&YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL&&bIE){resizeMonitor.src=YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL;}\r
resizeMonitor.id="_yuiResizeMonitor";resizeMonitor.style.visibility="hidden";document.body.appendChild(resizeMonitor);resizeMonitor.style.width="10em";resizeMonitor.style.height="10em";resizeMonitor.style.position="absolute";var nLeft=-1*resizeMonitor.offsetWidth,nTop=-1*resizeMonitor.offsetHeight;resizeMonitor.style.top=nTop+"px";resizeMonitor.style.left=nLeft+"px";resizeMonitor.style.borderStyle="none";resizeMonitor.style.borderWidth="0";YAHOO.util.Dom.setStyle(resizeMonitor,"opacity","0");resizeMonitor.style.visibility="visible";if(!bIE){var doc=resizeMonitor.contentWindow.document;doc.open();doc.close();}}\r
-if(resizeMonitor&&resizeMonitor.contentWindow){this.resizeMonitor=resizeMonitor;YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow,"resize",this.onDomResize,this,true);}}},onDomResize:function(e,obj){var nLeft=-1*this.resizeMonitor.offsetWidth,nTop=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=nTop+"px";this.resizeMonitor.style.left=nLeft+"px";},setHeader:function(headerContent){if(!this.header){this.header=document.createElement("DIV");this.header.className=YAHOO.widget.Module.CSS_HEADER;}\r
+var fireTextResize=function(){YAHOO.widget.Module.textResizeEvent.fire();};if(resizeMonitor&&resizeMonitor.contentWindow){this.resizeMonitor=resizeMonitor;YAHOO.widget.Module.textResizeEvent.subscribe(this.onDomResize,this,true);if(!YAHOO.widget.Module.textResizeInitialized){if(!YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow,"resize",fireTextResize)){YAHOO.util.Event.addListener(this.resizeMonitor,"resize",fireTextResize);}\r
+YAHOO.widget.Module.textResizeInitialized=true;}}}},onDomResize:function(e,obj){var nLeft=-1*this.resizeMonitor.offsetWidth,nTop=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=nTop+"px";this.resizeMonitor.style.left=nLeft+"px";},setHeader:function(headerContent){if(!this.header){this.header=document.createElement("DIV");this.header.className=YAHOO.widget.Module.CSS_HEADER;}\r
if(typeof headerContent=="string"){this.header.innerHTML=headerContent;}else{this.header.innerHTML="";this.header.appendChild(headerContent);}\r
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;}\r
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;}\r
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);}}\r
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);}}\r
if(this.footer&&!YAHOO.util.Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}\r
-this.renderEvent.fire();return true;},destroy:function(){if(this.element){var parent=this.element.parentNode;}\r
+this.renderEvent.fire();return true;},destroy:function(){var parent;if(this.element){YAHOO.util.Event.purgeElement(this.element,true);parent=this.element.parentNode;}\r
if(parent){parent.removeChild(this.element);}\r
-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;}}};YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;};YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="javascript:false;"\r
+this.element=null;this.header=null;this.body=null;this.footer=null;for(var e in this){if(e instanceof YAHOO.util.CustomEvent){e.unsubscribeAll();}}\r
+YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize,this);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;}}};YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;};YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="javascript:false;";\r
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.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);}\r
if(this.platform=="mac"&&this.browser=="gecko"){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}\r
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}\r
YAHOO.util.Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);};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]);};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]);};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]);};YAHOO.widget.Overlay.prototype.showIframe=function(){if(this.iframe){this.iframe.style.display="block";}};YAHOO.widget.Overlay.prototype.hideIframe=function(){if(this.iframe){this.iframe.style.display="none";}};YAHOO.widget.Overlay.prototype.configIframe=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showIframe,this)){this.showEvent.subscribe(this.showIframe,this,true);}\r
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideIframe,this)){this.hideEvent.subscribe(this.hideIframe,this,true);}\r
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");}\r
-if(!isNaN(x)&&!isNaN(y)){if(!this.iframe){this.iframe=document.createElement("iframe");if(this.isSecure){this.iframe.src=this.imageRoot+YAHOO.widget.Overlay.IFRAME_SRC;}\r
+if(!isNaN(x)&&!isNaN(y)){if(!this.iframe){this.iframe=document.createElement("iframe");if(this.isSecure){this.iframe.src=YAHOO.widget.Overlay.IFRAME_SRC;}\r
var parent=this.element.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}\r
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");if(this.cfg.getProperty("visible")){this.showIframe();}else{this.hideIframe();}}\r
var iframeDisplay=YAHOO.util.Dom.getStyle(this.iframe,"display");if(iframeDisplay=="none"){this.iframe.style.display="block";}\r
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;}};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;}}}};YAHOO.widget.Overlay.prototype.enforceConstraints=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];var offsetHeight=this.element.offsetHeight;var offsetWidth=this.element.offsetWidth;var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.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;}\r
if(y<topConstraint){y=topConstraint;}else if(y>bottomConstraint){y=bottomConstraint;}\r
this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);};YAHOO.widget.Overlay.prototype.center=function(){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.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.cfg.setProperty("xy",[parseInt(x,10),parseInt(y,10)]);this.cfg.refireEvent("iframe");};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);};YAHOO.widget.Overlay.prototype.onDomResize=function(e,obj){YAHOO.widget.Overlay.superclass.onDomResize.call(this,e,obj);var me=this;setTimeout(function(){me.syncPosition();me.cfg.refireEvent("iframe");me.cfg.refireEvent("context");},0);};YAHOO.widget.Overlay.prototype.destroy=function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}\r
-this.iframe=null;YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;};YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.scrollEnd){window.scrollEnd=-1;}\r
+this.iframe=null;YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;};YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.scrollEnd){window.scrollEnd=-1;}\r
clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){YAHOO.widget.Overlay.windowScrollEvent.fire();},1);}else{YAHOO.widget.Overlay.windowScrollEvent.fire();}};YAHOO.widget.Overlay.windowResizeHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.resizeEnd){window.resizeEnd=-1;}\r
clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){YAHOO.widget.Overlay.windowResizeEvent.fire();},100);}else{YAHOO.widget.Overlay.windowResizeEvent.fire();}};YAHOO.widget.Overlay._initialized=null;if(YAHOO.widget.Overlay._initialized===null){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;}\r
YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);};YAHOO.widget.OverlayManager.CSS_FOCUSED="focused";YAHOO.widget.OverlayManager.prototype={constructor:YAHOO.widget.OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(userConfig){this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
var me=this;return setTimeout(function(){if(me._tempTitle){me.setBody(me._tempTitle);}else{me.cfg.refireEvent("text");}\r
me.moveTo(me.pageX,me.pageY+yOffset);if(me.cfg.getProperty("preventoverlap")){me.preventOverlap(me.pageX,me.pageY);}\r
YAHOO.util.Event.removeListener(context,"mousemove",me.onContextMouseMove);me.show();me.hideProcId=me.doHide();},this.cfg.getProperty("showdelay"));};YAHOO.widget.Tooltip.prototype.doHide=function(){var me=this;return setTimeout(function(){me.hide();},this.cfg.getProperty("autodismissdelay"));};YAHOO.widget.Tooltip.prototype.preventOverlap=function(pageX,pageY){var height=this.element.offsetHeight;var elementRegion=YAHOO.util.Dom.getRegion(this.element);elementRegion.top-=5;elementRegion.left-=5;elementRegion.right+=5;elementRegion.bottom+=5;var mousePoint=new YAHOO.util.Point(pageX,pageY);if(elementRegion.contains(mousePoint)){this.cfg.setProperty("y",(pageY-height-5));}};YAHOO.widget.Tooltip.prototype.toString=function(){return"Tooltip "+this.id;};YAHOO.widget.Panel=function(el,userConfig){YAHOO.widget.Panel.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Panel,YAHOO.widget.Overlay);YAHOO.widget.Panel.CSS_PANEL="panel";YAHOO.widget.Panel.CSS_PANEL_CONTAINER="panel-container";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);}\r
-this.beforeRenderEvent.subscribe(function(){var draggable=this.cfg.getProperty("draggable");if(draggable){if(!this.header){this.setHeader(" ");}}},this,true);var me=this;this.showMaskEvent.subscribe(function(){var checkFocusable=function(el){if(el.tagName=="A"||el.tagName=="BUTTON"||el.tagName=="SELECT"||el.tagName=="INPUT"||el.tagName=="TEXTAREA"||el.tagName=="FORM"){if(!YAHOO.util.Dom.isAncestor(me.element,el)){YAHOO.util.Event.addListener(el,"focus",el.blur);return true;}}else{return false;}};this.focusableElements=YAHOO.util.Dom.getElementsBy(checkFocusable);},this,true);this.hideMaskEvent.subscribe(function(){for(var i=0;i<this.focusableElements.length;i++){var el2=this.focusableElements[i];YAHOO.util.Event.removeListener(el2,"focus",el2.blur);}},this,true);this.beforeShowEvent.subscribe(function(){this.cfg.refireEvent("underlay");},this,true);this.initEvent.fire(YAHOO.widget.Panel);};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");this.dragEvent=new YAHOO.util.CustomEvent("drag");};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"]});};YAHOO.widget.Panel.prototype.configClose=function(type,args,obj){var val=args[0];var doHide=function(e,obj){obj.hide();};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");}\r
-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";}}};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();}\r
-if(this.header){YAHOO.util.Dom.setStyle(this.header,"cursor","auto");}}};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);}\r
+this.beforeRenderEvent.subscribe(function(){var draggable=this.cfg.getProperty("draggable");if(draggable){if(!this.header){this.setHeader(" ");}}},this,true);var me=this;var doBlur=function(){this.blur();};this.showMaskEvent.subscribe(function(){var checkFocusable=function(el){if((el.tagName=="A"||el.tagName=="BUTTON"||el.tagName=="SELECT"||el.tagName=="INPUT"||el.tagName=="TEXTAREA"||el.tagName=="FORM")&&el.type!="hidden"){if(!YAHOO.util.Dom.isAncestor(me.element,el)){YAHOO.util.Event.addListener(el,"focus",doBlur,el,true);return true;}}else{return false;}};this.focusableElements=YAHOO.util.Dom.getElementsBy(checkFocusable);},this,true);this.hideMaskEvent.subscribe(function(){for(var i=0;i<this.focusableElements.length;i++){var el2=this.focusableElements[i];YAHOO.util.Event.removeListener(el2,"focus",doBlur);}},this,true);this.beforeShowEvent.subscribe(function(){this.cfg.refireEvent("underlay");},this,true);this.initEvent.fire(YAHOO.widget.Panel);};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");this.dragEvent=new YAHOO.util.CustomEvent("drag");};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"]});};YAHOO.widget.Panel.prototype.configClose=function(type,args,obj){var val=args[0];var doHide=function(e,obj){obj.hide();};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");}\r
+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";}}};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();}\r
+if(this.header){YAHOO.util.Dom.setStyle(this.header,"cursor","auto");}}};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);}\r
this.sizeUnderlay();break;case"matte":YAHOO.util.Dom.removeClass(this.element,"shadow");YAHOO.util.Dom.addClass(this.element,"matte");break;default:YAHOO.util.Dom.removeClass(this.element,"shadow");YAHOO.util.Dom.removeClass(this.element,"matte");break;}};YAHOO.widget.Panel.prototype.configModal=function(type,args,obj){var modal=args[0];if(modal){this.buildMask();if(!YAHOO.util.Config.alreadySubscribed(this.beforeShowEvent,this.showMask,this)){this.beforeShowEvent.subscribe(this.showMask,this,true);}\r
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMask,this)){this.hideEvent.subscribe(this.hideMask,this,true);}\r
if(!YAHOO.util.Config.alreadySubscribed(YAHOO.widget.Overlay.windowResizeEvent,this.sizeMask,this)){YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.sizeMask,this,true);}\r
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;this.maxX=rightConstraint;this.constrainX=true;this.minY=topConstraint;this.maxY=bottomConstraint;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}\r
me.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){me.syncPosition();me.cfg.refireEvent("iframe");if(this.platform=="mac"&&this.browser=="gecko"){this.showMacGeckoScrollbars();}\r
me.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(me.browser=="ie"){YAHOO.util.Dom.removeClass(me.element,"drag");}\r
-me.dragEvent.fire("endDrag",arguments);};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}};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);};var firstChild=document.body.firstChild;if(firstChild){document.body.insertBefore(this.mask,document.body.firstChild);}else{document.body.appendChild(this.mask);}}};YAHOO.widget.Panel.prototype.hideMask=function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";this.hideMaskEvent.fire();YAHOO.util.Dom.removeClass(document.body,"masked");}};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.showMaskEvent.fire();}};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";}};YAHOO.widget.Panel.prototype.render=function(appendToNode){return YAHOO.widget.Panel.superclass.render.call(this,appendToNode,this.innerElement);};YAHOO.widget.Panel.prototype.toString=function(){return"Panel "+this.id;};YAHOO.widget.Dialog=function(el,userConfig){YAHOO.widget.Dialog.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Dialog,YAHOO.widget.Panel);YAHOO.widget.Dialog.CSS_DIALOG="dialog";YAHOO.widget.Dialog.prototype.initDefaultConfig=function(){YAHOO.widget.Dialog.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};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("buttons",{value:"none",handler:this.configButtons});};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");};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);this.cfg.setProperty("visible",false);if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
-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);};YAHOO.widget.Dialog.prototype.doSubmit=function(){var pm=this.cfg.getProperty("postmethod");switch(pm){case"async":var method=this.form.getAttribute("method")||'POST';method=method.toUpperCase();YAHOO.util.Connect.setForm(this.form);var cObj=YAHOO.util.Connect.asyncRequest(method,this.form.getAttribute("action"),this.callback);this.asyncSubmitEvent.fire();break;case"form":this.form.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}};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];}\r
+me.dragEvent.fire("endDrag",arguments);};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}};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);};var firstChild=document.body.firstChild;if(firstChild){document.body.insertBefore(this.mask,document.body.firstChild);}else{document.body.appendChild(this.mask);}}};YAHOO.widget.Panel.prototype.hideMask=function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";this.hideMaskEvent.fire();YAHOO.util.Dom.removeClass(document.body,"masked");}};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.showMaskEvent.fire();}};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";}};YAHOO.widget.Panel.prototype.render=function(appendToNode){return YAHOO.widget.Panel.superclass.render.call(this,appendToNode,this.innerElement);};YAHOO.widget.Panel.prototype.toString=function(){return"Panel "+this.id;};YAHOO.widget.Dialog=function(el,userConfig){YAHOO.widget.Dialog.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Dialog,YAHOO.widget.Panel);YAHOO.widget.Dialog.CSS_DIALOG="dialog";YAHOO.widget.Dialog.prototype.initDefaultConfig=function(){YAHOO.widget.Dialog.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty("postmethod",{value:"async",handler:this.configPostMethod,validator:function(val){if(val!="form"&&val!="async"&&val!="none"&&val!="manual"){return false;}else{return true;}}});this.cfg.addProperty("buttons",{value:"none",handler:this.configButtons});};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");};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);this.cfg.setProperty("visible",false);if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
+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);};YAHOO.widget.Dialog.prototype.doSubmit=function(){var pm=this.cfg.getProperty("postmethod");switch(pm){case"async":var method=this.form.getAttribute("method")||'POST';method=method.toUpperCase();YAHOO.util.Connect.setForm(this.form);var cObj=YAHOO.util.Connect.asyncRequest(method,this.form.getAttribute("action"),this.callback);this.asyncSubmitEvent.fire();break;case"form":this.form.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}};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];}\r
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;}}}\r
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;}}}\r
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);}\r
this.setFooter(this.buttonSpan);this.cfg.refireEvent("iframe");this.cfg.refireEvent("underlay");}else{if(this.buttonSpan){if(this.buttonSpan.parentNode){this.buttonSpan.parentNode.removeChild(this.buttonSpan);}\r
this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}};YAHOO.widget.Dialog.prototype.focusFirst=function(type,args,obj){if(args){var e=args[1];if(e){YAHOO.util.Event.stopEvent(e);}}\r
if(this.firstFormElement){this.firstFormElement.focus();}else{this.focusDefaultButton();}};YAHOO.widget.Dialog.prototype.focusLast=function(type,args,obj){if(args){var e=args[1];if(e){YAHOO.util.Event.stopEvent(e);}}\r
-var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){this.focusLastButton();}else{if(this.lastFormElement){this.lastFormElement.focus();}}};YAHOO.widget.Dialog.prototype.focusDefaultButton=function(){if(this.defaultHtmlButton){this.defaultHtmlButton.focus();}};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();}}};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();}}};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();}}};YAHOO.widget.Dialog.prototype.validate=function(){return true;};YAHOO.widget.Dialog.prototype.submit=function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();this.hide();return true;}else{return false;}};YAHOO.widget.Dialog.prototype.cancel=function(){this.cancelEvent.fire();this.hide();};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;}\r
-break;case"TEXTAREA":data[i]=formItem.value;break;case"SELECT":var val=[];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;}\r
+var buttons=this.cfg.getProperty("buttons");if(buttons&&buttons instanceof Array){this.focusLastButton();}else{if(this.lastFormElement){this.lastFormElement.focus();}}};YAHOO.widget.Dialog.prototype.focusDefaultButton=function(){if(this.defaultHtmlButton){this.defaultHtmlButton.focus();}};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();}}};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();}}};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();}}};YAHOO.widget.Dialog.prototype.configPostMethod=function(type,args,obj){var postmethod=args[0];this.registerForm();YAHOO.util.Event.addListener(this.form,"submit",function(e){YAHOO.util.Event.stopEvent(e);this.submit();this.form.blur();},this,true);};YAHOO.widget.Dialog.prototype.validate=function(){return true;};YAHOO.widget.Dialog.prototype.submit=function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();this.hide();return true;}else{return false;}};YAHOO.widget.Dialog.prototype.cancel=function(){this.cancelEvent.fire();this.hide();};YAHOO.widget.Dialog.prototype.getData=function(){var form=this.form;var data={};if(form){for(var i=0;i<form.elements.length;i++){var formItem=form.elements[i];if(formItem){if(formItem.tagName){switch(formItem.tagName){case"INPUT":switch(formItem.type){case"checkbox":data[formItem.name]=formItem.checked;break;case"textbox":case"text":case"hidden":data[formItem.name]=formItem.value;break;}\r
+break;case"TEXTAREA":data[formItem.name]=formItem.value;break;case"SELECT":var val=[];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;}\r
val[val.length]=selval;}}\r
-data[i]=val;break;}}else if(formItem[0]&&formItem[0].tagName){if(formItem[0].tagName=="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;}}\r
+data[formItem.name]=val;break;}}else if(formItem[0]&&formItem[0].tagName){if(formItem[0].tagName=="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;}}\r
break;case"checkbox":var cbArray=[];for(var c=0;c<formItem.length;c++){var check=formItem[c];if(check.checked){cbArray[cbArray.length]=check.value;}}\r
data[formItem[0].name]=cbArray;break;}}}}}}\r
return data;};YAHOO.widget.Dialog.prototype.toString=function(){return"Dialog "+this.id;};YAHOO.widget.SimpleDialog=function(el,userConfig){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.SimpleDialog,YAHOO.widget.Dialog);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"]});};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);}\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version 0.12.0\r
+version 0.12.1\r
*/\r
\r
/**\r
* Config is a utility used within an Object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.\r
-* @class YAHOO.util.Config\r
+* @namespace YAHOO.util\r
+* @class Config\r
* @constructor\r
* @param {Object} owner The owner Object to which this Config Object belongs\r
*/\r
\r
/**\r
* The Container family of components is designed to enable developers to create different kinds of content-containing modules on the web. Module and Overlay are the most basic containers, and they can be used directly or extended to build custom containers. Also part of the Container family are four UI controls that extend Module and Overlay: Tooltip, Panel, Dialog, and SimpleDialog.\r
-* @module Container\r
+* @module container\r
+* @title Container\r
* @requires yahoo,dom,event,dragdrop,animation\r
*/\r
\r
/**\r
* Module is a JavaScript representation of the Standard Module Format. Standard Module Format is a simple standard for markup containers where child nodes representing the header, body, and footer of the content are denoted using the CSS classes "hd", "bd", and "ft" respectively. Module is the base class for all other classes in the YUI Container package.\r
-* @class Module\r
* @namespace YAHOO.widget\r
+* @class Module\r
* @constructor\r
* @param {String} el The element ID representing the Module <em>OR</em>\r
* @param {HTMLElement} el The element representing the Module\r
*/\r
YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";\r
\r
+/**\r
+* Singleton CustomEvent fired when the font size is changed in the browser.\r
+* Opera's "zoom" functionality currently does not support text size detection.\r
+* @event YAHOO.widget.Module.textResizeEvent\r
+*/\r
+YAHOO.widget.Module.textResizeEvent = new YAHOO.util.CustomEvent("textResize");\r
+\r
YAHOO.widget.Module.prototype = {\r
/**\r
* The class's constructor function\r
doc.close();\r
\r
}\r
-\r
}\r
\r
- if(resizeMonitor && resizeMonitor.contentWindow) {\r
+ var fireTextResize = function() {\r
+ YAHOO.widget.Module.textResizeEvent.fire();\r
+ };\r
\r
+ if(resizeMonitor && resizeMonitor.contentWindow) {\r
this.resizeMonitor = resizeMonitor;\r
\r
- YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", this.onDomResize, this, true);\r
+ YAHOO.widget.Module.textResizeEvent.subscribe(this.onDomResize, this, true);\r
\r
+ if (! YAHOO.widget.Module.textResizeInitialized) {\r
+ if (! YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", fireTextResize)) {\r
+ // This will fail in IE if document.domain has changed, so we must change the listener to\r
+ // use the resizeMonitor element instead\r
+ YAHOO.util.Event.addListener(this.resizeMonitor, "resize", fireTextResize);\r
+ }\r
+ YAHOO.widget.Module.textResizeInitialized = true;\r
+ }\r
}\r
\r
}\r
* @method destroy\r
*/\r
destroy : function() {\r
+ var parent;\r
+\r
if (this.element) {\r
- var parent = this.element.parentNode;\r
+ YAHOO.util.Event.purgeElement(this.element, true);\r
+ parent = this.element.parentNode;\r
}\r
if (parent) {\r
parent.removeChild(this.element);\r
this.body = null;\r
this.footer = null;\r
\r
+ for (var e in this) {\r
+ if (e instanceof YAHOO.util.CustomEvent) {\r
+ e.unsubscribeAll();\r
+ }\r
+ }\r
+\r
+ YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize, this);\r
+\r
this.destroyEvent.fire();\r
},\r
\r
\r
/**\r
* Overlay is a Module that is absolutely positioned above the page flow. It has convenience methods for positioning and sizing, as well as options for controlling zIndex and constraining the Overlay's position to the current visible viewport. Overlay also contains a dynamicly generated IFRAME which is placed beneath it for Internet Explorer 6 and 5.x so that it will be properly rendered above SELECT elements.\r
-* @class Overlay\r
* @namespace YAHOO.widget\r
+* @class Overlay\r
* @extends YAHOO.widget.Module\r
* @param {String} el The element ID representing the Overlay <em>OR</em>\r
* @param {HTMLElement} el The element representing the Overlay\r
* @final\r
* @type String\r
*/\r
-YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;"\r
+YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;";\r
\r
/**\r
* Constant representing the top left corner of an element, used for configuring the context element alignment\r
if (! this.iframe) {\r
this.iframe = document.createElement("iframe");\r
if (this.isSecure) {\r
- this.iframe.src = this.imageRoot + YAHOO.widget.Overlay.IFRAME_SRC;\r
+ this.iframe.src = YAHOO.widget.Overlay.IFRAME_SRC;\r
}\r
\r
var parent = this.element.parentNode;\r
\r
this.iframe = null;\r
\r
+ YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);\r
+ YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);\r
+\r
YAHOO.widget.Overlay.superclass.destroy.call(this);\r
};\r
\r
var draggable = this.cfg.getProperty("draggable");\r
if (draggable) {\r
if (! this.header) {\r
- this.setHeader(" ");\r
+ this.setHeader(" ");\r
}\r
}\r
}, this, true);\r
\r
var me = this;\r
\r
+ var doBlur = function() {\r
+ this.blur();\r
+ };\r
+\r
this.showMaskEvent.subscribe(function() {\r
var checkFocusable = function(el) {\r
- if (el.tagName == "A" || el.tagName == "BUTTON" || el.tagName == "SELECT" || el.tagName == "INPUT" || el.tagName == "TEXTAREA" || el.tagName == "FORM") {\r
+ if ((el.tagName == "A" || el.tagName == "BUTTON" || el.tagName == "SELECT" || el.tagName == "INPUT" || el.tagName == "TEXTAREA" || el.tagName == "FORM") && el.type != "hidden") {\r
if (! YAHOO.util.Dom.isAncestor(me.element, el)) {\r
- YAHOO.util.Event.addListener(el, "focus", el.blur);\r
+ YAHOO.util.Event.addListener(el, "focus", doBlur, el, true);\r
return true;\r
}\r
} else {\r
this.hideMaskEvent.subscribe(function() {\r
for (var i=0;i<this.focusableElements.length;i++) {\r
var el2 = this.focusableElements[i];\r
- YAHOO.util.Event.removeListener(el2, "focus", el2.blur);\r
+ YAHOO.util.Event.removeListener(el2, "focus", doBlur);\r
}\r
}, this, true);\r
\r
YAHOO.util.Dom.addClass(this.close, "nonsecure");\r
}\r
\r
- this.close.innerHTML = " ";\r
+ this.close.innerHTML = " ";\r
this.innerElement.appendChild(this.close);\r
YAHOO.util.Event.addListener(this.close, "click", doHide, this);\r
} else {\r
if (! this.underlay) { // create if not already in DOM\r
this.underlay = document.createElement("DIV");\r
this.underlay.className = "underlay";\r
- this.underlay.innerHTML = " ";\r
+ this.underlay.innerHTML = " ";\r
this.element.appendChild(this.underlay);\r
}\r
\r
this.mask = document.createElement("DIV");\r
this.mask.id = this.id + "_mask";\r
this.mask.className = "mask";\r
- this.mask.innerHTML = " ";\r
+ this.mask.innerHTML = " ";\r
\r
var maskClick = function(e, obj) {\r
YAHOO.util.Event.stopEvent(e);\r
* @type String\r
* @default async\r
*/\r
- this.cfg.addProperty("postmethod", { value:"async", validator:function(val) {\r
+ this.cfg.addProperty("postmethod", { value:"async", handler:this.configPostMethod, validator:function(val) {\r
if (val != "form" && val != "async" && val != "none" && val != "manual") {\r
return false;\r
} else {\r
this.cfg.applyConfig(userConfig, true);\r
}\r
\r
- this.renderEvent.subscribe(this.registerForm, this, true);\r
-\r
this.showEvent.subscribe(this.focusFirst, this, true);\r
this.beforeHideEvent.subscribe(this.blurButtons, this, true);\r
\r
}\r
};\r
\r
+/**\r
+* The default event handler for the "postmethod" configuration property\r
+* @method configPostMethod\r
+* @param {String} type The CustomEvent type (usually the property name)\r
+* @param {Object[]} args The CustomEvent arguments. For configuration handlers, args[0] will equal the newly applied value for the property.\r
+* @param {Object} obj The scope object. For configuration handlers, this will usually equal the owner.\r
+*/\r
+YAHOO.widget.Dialog.prototype.configPostMethod = function(type, args, obj) {\r
+ var postmethod = args[0];\r
+\r
+ this.registerForm();\r
+ YAHOO.util.Event.addListener(this.form, "submit", function(e) {\r
+ YAHOO.util.Event.stopEvent(e);\r
+ this.submit();\r
+ this.form.blur();\r
+ }, this, true);\r
+};\r
+\r
// END BUILT-IN PROPERTY EVENT HANDLERS //\r
\r
/**\r
var data = {};\r
\r
if (form) {\r
- for (var i in this.form) {\r
- var formItem = form[i];\r
+ for (var i=0;i<form.elements.length;i++) {\r
+ var formItem = form.elements[i];\r
if (formItem) {\r
if (formItem.tagName) { // Got a single form item\r
switch (formItem.tagName) {\r
case "INPUT":\r
switch (formItem.type) {\r
case "checkbox":\r
- data[i] = formItem.checked;\r
+ data[formItem.name] = formItem.checked;\r
break;\r
case "textbox":\r
case "text":\r
case "hidden":\r
- data[i] = formItem.value;\r
+ data[formItem.name] = formItem.value;\r
break;\r
}\r
break;\r
case "TEXTAREA":\r
- data[i] = formItem.value;\r
+ data[formItem.name] = formItem.value;\r
break;\r
case "SELECT":\r
var val = [];\r
val[val.length] = selval;\r
}\r
}\r
- data[i] = val;\r
+ data[formItem.name] = val;\r
break;\r
}\r
} else if (formItem[0] && formItem[0].tagName) { // this is an array of form items\r
* A pre-configured ContainerEffect instance that can be used for fading an overlay in and out.\r
* @method FADE\r
* @static\r
-* @param {Overlay} The Overlay object to animate\r
-* @param {Number} The duration of the animation\r
+* @param {Overlay} overlay The Overlay object to animate\r
+* @param {Number} dur The duration of the animation\r
* @return {ContainerEffect} The configured ContainerEffect object\r
*/\r
YAHOO.widget.ContainerEffect.FADE = function(overlay, dur) {\r
* A pre-configured ContainerEffect instance that can be used for sliding an overlay in and out.\r
* @method SLIDE\r
* @static\r
-* @param {Overlay} The Overlay object to animate\r
-* @param {Number} The duration of the animation\r
+* @param {Overlay} overlay The Overlay object to animate\r
+* @param {Number} dur The duration of the animation\r
* @return {ContainerEffect} The configured ContainerEffect object\r
*/\r
YAHOO.widget.ContainerEffect.SLIDE = function(overlay, dur) {\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
+version 0.12.1\r
*/\r
\r
/**\r
* Config is a utility used within an Object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.\r
-* @class YAHOO.util.Config\r
+* @namespace YAHOO.util\r
+* @class Config\r
* @constructor\r
* @param {Object} owner The owner Object to which this Config Object belongs\r
*/\r
\r
/**\r
* The Container family of components is designed to enable developers to create different kinds of content-containing modules on the web. Module and Overlay are the most basic containers, and they can be used directly or extended to build custom containers. Also part of the Container family are four UI controls that extend Module and Overlay: Tooltip, Panel, Dialog, and SimpleDialog.\r
-* @module Container\r
+* @module container\r
+* @title Container\r
* @requires yahoo,dom,event,dragdrop,animation\r
*/\r
\r
/**\r
* Module is a JavaScript representation of the Standard Module Format. Standard Module Format is a simple standard for markup containers where child nodes representing the header, body, and footer of the content are denoted using the CSS classes "hd", "bd", and "ft" respectively. Module is the base class for all other classes in the YUI Container package.\r
-* @class Module\r
* @namespace YAHOO.widget\r
+* @class Module\r
* @constructor\r
* @param {String} el The element ID representing the Module <em>OR</em>\r
* @param {HTMLElement} el The element representing the Module\r
*/\r
YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";\r
\r
-YAHOO.widget.Module.prototype = {\r
+/**\r
+* Singleton CustomEvent fired when the font size is changed in the browser.\r
+* Opera's "zoom" functionality currently does not support text size detection.\r
+* @event YAHOO.widget.Module.textResizeEvent\r
+*/\r
+YAHOO.widget.Module.textResizeEvent = new YAHOO.util.CustomEvent("textResize");\r
\r
+YAHOO.widget.Module.prototype = {\r
/**\r
* The class's constructor function\r
* @property contructor\r
doc.close();\r
\r
}\r
-\r
}\r
\r
- if(resizeMonitor && resizeMonitor.contentWindow) {\r
+ var fireTextResize = function() {\r
+ YAHOO.widget.Module.textResizeEvent.fire();\r
+ };\r
\r
+ if(resizeMonitor && resizeMonitor.contentWindow) {\r
this.resizeMonitor = resizeMonitor;\r
\r
- YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", this.onDomResize, this, true);\r
+ YAHOO.widget.Module.textResizeEvent.subscribe(this.onDomResize, this, true);\r
\r
+ if (! YAHOO.widget.Module.textResizeInitialized) {\r
+ if (! YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", fireTextResize)) {\r
+ // This will fail in IE if document.domain has changed, so we must change the listener to\r
+ // use the resizeMonitor element instead\r
+ YAHOO.util.Event.addListener(this.resizeMonitor, "resize", fireTextResize);\r
+ }\r
+ YAHOO.widget.Module.textResizeInitialized = true;\r
+ }\r
}\r
\r
}\r
* @method destroy\r
*/\r
destroy : function() {\r
+ var parent;\r
+\r
if (this.element) {\r
- var parent = this.element.parentNode;\r
+ YAHOO.util.Event.purgeElement(this.element, true);\r
+ parent = this.element.parentNode;\r
}\r
if (parent) {\r
parent.removeChild(this.element);\r
this.body = null;\r
this.footer = null;\r
\r
+ for (var e in this) {\r
+ if (e instanceof YAHOO.util.CustomEvent) {\r
+ e.unsubscribeAll();\r
+ }\r
+ }\r
+\r
+ YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize, this);\r
+\r
this.destroyEvent.fire();\r
},\r
\r
\r
/**\r
* Overlay is a Module that is absolutely positioned above the page flow. It has convenience methods for positioning and sizing, as well as options for controlling zIndex and constraining the Overlay's position to the current visible viewport. Overlay also contains a dynamicly generated IFRAME which is placed beneath it for Internet Explorer 6 and 5.x so that it will be properly rendered above SELECT elements.\r
-* @class Overlay\r
* @namespace YAHOO.widget\r
+* @class Overlay\r
* @extends YAHOO.widget.Module\r
* @param {String} el The element ID representing the Overlay <em>OR</em>\r
* @param {HTMLElement} el The element representing the Overlay\r
* @final\r
* @type String\r
*/\r
-YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;"\r
+YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;";\r
\r
/**\r
* Constant representing the top left corner of an element, used for configuring the context element alignment\r
if (! this.iframe) {\r
this.iframe = document.createElement("iframe");\r
if (this.isSecure) {\r
- this.iframe.src = this.imageRoot + YAHOO.widget.Overlay.IFRAME_SRC;\r
+ this.iframe.src = YAHOO.widget.Overlay.IFRAME_SRC;\r
}\r
\r
var parent = this.element.parentNode;\r
\r
this.iframe = null;\r
\r
+ YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);\r
+ YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);\r
+\r
YAHOO.widget.Overlay.superclass.destroy.call(this);\r
};\r
\r
* A pre-configured ContainerEffect instance that can be used for fading an overlay in and out.\r
* @method FADE\r
* @static\r
-* @param {Overlay} The Overlay object to animate\r
-* @param {Number} The duration of the animation\r
+* @param {Overlay} overlay The Overlay object to animate\r
+* @param {Number} dur The duration of the animation\r
* @return {ContainerEffect} The configured ContainerEffect object\r
*/\r
YAHOO.widget.ContainerEffect.FADE = function(overlay, dur) {\r
* A pre-configured ContainerEffect instance that can be used for sliding an overlay in and out.\r
* @method SLIDE\r
* @static\r
-* @param {Overlay} The Overlay object to animate\r
-* @param {Number} The duration of the animation\r
+* @param {Overlay} overlay The Overlay object to animate\r
+* @param {Number} dur The duration of the animation\r
* @return {ContainerEffect} The configured ContainerEffect object\r
*/\r
YAHOO.widget.ContainerEffect.SLIDE = function(overlay, dur) {\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version 0.12.1 */\r
YAHOO.util.Config=function(owner){if(owner){this.init(owner);}};YAHOO.util.Config.prototype={owner:null,queueInProgress:false,checkBoolean:function(val){if(typeof val=='boolean'){return true;}else{return false;}},checkNumber:function(val){if(isNaN(val)){return false;}else{return true;}}};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);}};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);}\r
this.setProperty(key,propertyObject.value,true);if(!propertyObject.suppressEvent){this.queueProperty(key,propertyObject.value);}};this.getConfig=function(){var cfg={};for(var prop in config){var property=config[prop];if(typeof property!='undefined'&&property.event){cfg[prop]=property.value;}}\r
return cfg;};this.getProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){return property.value;}else{return undefined;}};this.resetProperty=function(key){key=key.toLowerCase();var property=config[key];if(typeof property!='undefined'&&property.event){if(initialConfig[key]&&initialConfig[key]!='undefined'){this.setProperty(key,initialConfig[key]);}\r
return true;}else{return false;}};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;}};this.toString=function(){var output="Config";if(this.owner){output+=" ["+this.owner.toString()+"]";}\r
return output;};this.outputEventQueue=function(){var output="";for(var q=0;q<eventQueue.length;q++){var queueItem=eventQueue[q];if(queueItem){output+=queueItem[0]+"="+queueItem[1]+", ";}}\r
return output;};};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;}}\r
-return false;};YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}};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.RESIZE_MONITOR_SECURE_URL="javascript:false;";YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,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){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(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}\r
+return false;};YAHOO.widget.Module=function(el,userConfig){if(el){this.init(el,userConfig);}};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.RESIZE_MONITOR_SECURE_URL="javascript:false;";YAHOO.widget.Module.textResizeEvent=new YAHOO.util.CustomEvent("textResize");YAHOO.widget.Module.prototype={constructor:YAHOO.widget.Module,element:null,header:null,body:null,footer:null,id:null,imageRoot:YAHOO.widget.Module.IMG_ROOT,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){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(this.isSecure){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;}\r
if(typeof el=="string"){var elId=el;el=document.getElementById(el);if(!el){el=document.createElement("DIV");el.id=elId;}}\r
this.element=el;if(el.id){this.id=el.id;}\r
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;}}}\r
if(!YAHOO.util.Config.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}\r
this.initEvent.fire(YAHOO.widget.Module);},initResizeMonitor:function(){if(this.browser!="opera"){var resizeMonitor=document.getElementById("_yuiResizeMonitor");if(!resizeMonitor){resizeMonitor=document.createElement("iframe");var bIE=(this.browser.indexOf("ie")===0);if(this.isSecure&&YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL&&bIE){resizeMonitor.src=YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL;}\r
resizeMonitor.id="_yuiResizeMonitor";resizeMonitor.style.visibility="hidden";document.body.appendChild(resizeMonitor);resizeMonitor.style.width="10em";resizeMonitor.style.height="10em";resizeMonitor.style.position="absolute";var nLeft=-1*resizeMonitor.offsetWidth,nTop=-1*resizeMonitor.offsetHeight;resizeMonitor.style.top=nTop+"px";resizeMonitor.style.left=nLeft+"px";resizeMonitor.style.borderStyle="none";resizeMonitor.style.borderWidth="0";YAHOO.util.Dom.setStyle(resizeMonitor,"opacity","0");resizeMonitor.style.visibility="visible";if(!bIE){var doc=resizeMonitor.contentWindow.document;doc.open();doc.close();}}\r
-if(resizeMonitor&&resizeMonitor.contentWindow){this.resizeMonitor=resizeMonitor;YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow,"resize",this.onDomResize,this,true);}}},onDomResize:function(e,obj){var nLeft=-1*this.resizeMonitor.offsetWidth,nTop=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=nTop+"px";this.resizeMonitor.style.left=nLeft+"px";},setHeader:function(headerContent){if(!this.header){this.header=document.createElement("DIV");this.header.className=YAHOO.widget.Module.CSS_HEADER;}\r
+var fireTextResize=function(){YAHOO.widget.Module.textResizeEvent.fire();};if(resizeMonitor&&resizeMonitor.contentWindow){this.resizeMonitor=resizeMonitor;YAHOO.widget.Module.textResizeEvent.subscribe(this.onDomResize,this,true);if(!YAHOO.widget.Module.textResizeInitialized){if(!YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow,"resize",fireTextResize)){YAHOO.util.Event.addListener(this.resizeMonitor,"resize",fireTextResize);}\r
+YAHOO.widget.Module.textResizeInitialized=true;}}}},onDomResize:function(e,obj){var nLeft=-1*this.resizeMonitor.offsetWidth,nTop=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=nTop+"px";this.resizeMonitor.style.left=nLeft+"px";},setHeader:function(headerContent){if(!this.header){this.header=document.createElement("DIV");this.header.className=YAHOO.widget.Module.CSS_HEADER;}\r
if(typeof headerContent=="string"){this.header.innerHTML=headerContent;}else{this.header.innerHTML="";this.header.appendChild(headerContent);}\r
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;}\r
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;}\r
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);}}\r
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);}}\r
if(this.footer&&!YAHOO.util.Dom.inDocument(this.footer)){moduleElement.appendChild(this.footer);}\r
-this.renderEvent.fire();return true;},destroy:function(){if(this.element){var parent=this.element.parentNode;}\r
+this.renderEvent.fire();return true;},destroy:function(){var parent;if(this.element){YAHOO.util.Event.purgeElement(this.element,true);parent=this.element.parentNode;}\r
if(parent){parent.removeChild(this.element);}\r
-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;}}};YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;};YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="javascript:false;"\r
+this.element=null;this.header=null;this.body=null;this.footer=null;for(var e in this){if(e instanceof YAHOO.util.CustomEvent){e.unsubscribeAll();}}\r
+YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize,this);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;}}};YAHOO.widget.Module.prototype.toString=function(){return"Module "+this.id;};YAHOO.widget.Overlay=function(el,userConfig){YAHOO.widget.Overlay.superclass.constructor.call(this,el,userConfig);};YAHOO.extend(YAHOO.widget.Overlay,YAHOO.widget.Module);YAHOO.widget.Overlay.IFRAME_SRC="javascript:false;";\r
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.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);}\r
if(this.platform=="mac"&&this.browser=="gecko"){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}\r
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}\r
YAHOO.util.Dom.setStyle(el,"zIndex",zIndex);this.cfg.setProperty("zIndex",zIndex,true);};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]);};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]);};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]);};YAHOO.widget.Overlay.prototype.showIframe=function(){if(this.iframe){this.iframe.style.display="block";}};YAHOO.widget.Overlay.prototype.hideIframe=function(){if(this.iframe){this.iframe.style.display="none";}};YAHOO.widget.Overlay.prototype.configIframe=function(type,args,obj){var val=args[0];if(val){if(!YAHOO.util.Config.alreadySubscribed(this.showEvent,this.showIframe,this)){this.showEvent.subscribe(this.showIframe,this,true);}\r
if(!YAHOO.util.Config.alreadySubscribed(this.hideEvent,this.hideIframe,this)){this.hideEvent.subscribe(this.hideIframe,this,true);}\r
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");}\r
-if(!isNaN(x)&&!isNaN(y)){if(!this.iframe){this.iframe=document.createElement("iframe");if(this.isSecure){this.iframe.src=this.imageRoot+YAHOO.widget.Overlay.IFRAME_SRC;}\r
+if(!isNaN(x)&&!isNaN(y)){if(!this.iframe){this.iframe=document.createElement("iframe");if(this.isSecure){this.iframe.src=YAHOO.widget.Overlay.IFRAME_SRC;}\r
var parent=this.element.parentNode;if(parent){parent.appendChild(this.iframe);}else{document.body.appendChild(this.iframe);}\r
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");if(this.cfg.getProperty("visible")){this.showIframe();}else{this.hideIframe();}}\r
var iframeDisplay=YAHOO.util.Dom.getStyle(this.iframe,"display");if(iframeDisplay=="none"){this.iframe.style.display="block";}\r
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;}};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;}}}};YAHOO.widget.Overlay.prototype.enforceConstraints=function(type,args,obj){var pos=args[0];var x=pos[0];var y=pos[1];var offsetHeight=this.element.offsetHeight;var offsetWidth=this.element.offsetWidth;var viewPortWidth=YAHOO.util.Dom.getViewportWidth();var viewPortHeight=YAHOO.util.Dom.getViewportHeight();var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.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;}\r
if(y<topConstraint){y=topConstraint;}else if(y>bottomConstraint){y=bottomConstraint;}\r
this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);this.cfg.setProperty("xy",[x,y],true);};YAHOO.widget.Overlay.prototype.center=function(){var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.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.cfg.setProperty("xy",[parseInt(x,10),parseInt(y,10)]);this.cfg.refireEvent("iframe");};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);};YAHOO.widget.Overlay.prototype.onDomResize=function(e,obj){YAHOO.widget.Overlay.superclass.onDomResize.call(this,e,obj);var me=this;setTimeout(function(){me.syncPosition();me.cfg.refireEvent("iframe");me.cfg.refireEvent("context");},0);};YAHOO.widget.Overlay.prototype.destroy=function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}\r
-this.iframe=null;YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;};YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.scrollEnd){window.scrollEnd=-1;}\r
+this.iframe=null;YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);YAHOO.widget.Overlay.superclass.destroy.call(this);};YAHOO.widget.Overlay.prototype.toString=function(){return"Overlay "+this.id;};YAHOO.widget.Overlay.windowScrollEvent=new YAHOO.util.CustomEvent("windowScroll");YAHOO.widget.Overlay.windowResizeEvent=new YAHOO.util.CustomEvent("windowResize");YAHOO.widget.Overlay.windowScrollHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.scrollEnd){window.scrollEnd=-1;}\r
clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){YAHOO.widget.Overlay.windowScrollEvent.fire();},1);}else{YAHOO.widget.Overlay.windowScrollEvent.fire();}};YAHOO.widget.Overlay.windowResizeHandler=function(e){if(YAHOO.widget.Module.prototype.browser=="ie"||YAHOO.widget.Module.prototype.browser=="ie7"){if(!window.resizeEnd){window.resizeEnd=-1;}\r
clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){YAHOO.widget.Overlay.windowResizeEvent.fire();},100);}else{YAHOO.widget.Overlay.windowResizeEvent.fire();}};YAHOO.widget.Overlay._initialized=null;if(YAHOO.widget.Overlay._initialized===null){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;}\r
YAHOO.widget.OverlayManager=function(userConfig){this.init(userConfig);};YAHOO.widget.OverlayManager.CSS_FOCUSED="focused";YAHOO.widget.OverlayManager.prototype={constructor:YAHOO.widget.OverlayManager,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(userConfig){this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();if(userConfig){this.cfg.applyConfig(userConfig,true);}\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version 0.12.0\r
+version 0.12.1\r
*/\r
\r
/**\r
* Config is a utility used within an Object to allow the implementer to maintain a list of local configuration properties and listen for changes to those properties dynamically using CustomEvent. The initial values are also maintained so that the configuration can be reset at any given point to its initial state.\r
-* @class YAHOO.util.Config\r
+* @namespace YAHOO.util\r
+* @class Config\r
* @constructor\r
* @param {Object} owner The owner Object to which this Config Object belongs\r
*/\r
\r
/**\r
* The Container family of components is designed to enable developers to create different kinds of content-containing modules on the web. Module and Overlay are the most basic containers, and they can be used directly or extended to build custom containers. Also part of the Container family are four UI controls that extend Module and Overlay: Tooltip, Panel, Dialog, and SimpleDialog.\r
-* @module Container\r
+* @module container\r
+* @title Container\r
* @requires yahoo,dom,event,dragdrop,animation\r
*/\r
\r
/**\r
* Module is a JavaScript representation of the Standard Module Format. Standard Module Format is a simple standard for markup containers where child nodes representing the header, body, and footer of the content are denoted using the CSS classes "hd", "bd", and "ft" respectively. Module is the base class for all other classes in the YUI Container package.\r
-* @class Module\r
* @namespace YAHOO.widget\r
+* @class Module\r
* @constructor\r
* @param {String} el The element ID representing the Module <em>OR</em>\r
* @param {HTMLElement} el The element representing the Module\r
*/\r
YAHOO.widget.Module.RESIZE_MONITOR_SECURE_URL = "javascript:false;";\r
\r
+/**\r
+* Singleton CustomEvent fired when the font size is changed in the browser.\r
+* Opera's "zoom" functionality currently does not support text size detection.\r
+* @event YAHOO.widget.Module.textResizeEvent\r
+*/\r
+YAHOO.widget.Module.textResizeEvent = new YAHOO.util.CustomEvent("textResize");\r
+\r
YAHOO.widget.Module.prototype = {\r
/**\r
* The class's constructor function\r
doc.close();\r
\r
}\r
-\r
}\r
\r
- if(resizeMonitor && resizeMonitor.contentWindow) {\r
+ var fireTextResize = function() {\r
+ YAHOO.widget.Module.textResizeEvent.fire();\r
+ };\r
\r
+ if(resizeMonitor && resizeMonitor.contentWindow) {\r
this.resizeMonitor = resizeMonitor;\r
\r
- YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", this.onDomResize, this, true);\r
+ YAHOO.widget.Module.textResizeEvent.subscribe(this.onDomResize, this, true);\r
\r
+ if (! YAHOO.widget.Module.textResizeInitialized) {\r
+ if (! YAHOO.util.Event.addListener(this.resizeMonitor.contentWindow, "resize", fireTextResize)) {\r
+ // This will fail in IE if document.domain has changed, so we must change the listener to\r
+ // use the resizeMonitor element instead\r
+ YAHOO.util.Event.addListener(this.resizeMonitor, "resize", fireTextResize);\r
+ }\r
+ YAHOO.widget.Module.textResizeInitialized = true;\r
+ }\r
}\r
\r
}\r
* @method destroy\r
*/\r
destroy : function() {\r
+ var parent;\r
+\r
if (this.element) {\r
- var parent = this.element.parentNode;\r
+ YAHOO.util.Event.purgeElement(this.element, true);\r
+ parent = this.element.parentNode;\r
}\r
if (parent) {\r
parent.removeChild(this.element);\r
this.body = null;\r
this.footer = null;\r
\r
+ for (var e in this) {\r
+ if (e instanceof YAHOO.util.CustomEvent) {\r
+ e.unsubscribeAll();\r
+ }\r
+ }\r
+\r
+ YAHOO.widget.Module.textResizeEvent.unsubscribe(this.onDomResize, this);\r
+\r
this.destroyEvent.fire();\r
},\r
\r
\r
/**\r
* Overlay is a Module that is absolutely positioned above the page flow. It has convenience methods for positioning and sizing, as well as options for controlling zIndex and constraining the Overlay's position to the current visible viewport. Overlay also contains a dynamicly generated IFRAME which is placed beneath it for Internet Explorer 6 and 5.x so that it will be properly rendered above SELECT elements.\r
-* @class Overlay\r
* @namespace YAHOO.widget\r
+* @class Overlay\r
* @extends YAHOO.widget.Module\r
* @param {String} el The element ID representing the Overlay <em>OR</em>\r
* @param {HTMLElement} el The element representing the Overlay\r
* @final\r
* @type String\r
*/\r
-YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;"\r
+YAHOO.widget.Overlay.IFRAME_SRC = "javascript:false;";\r
\r
/**\r
* Constant representing the top left corner of an element, used for configuring the context element alignment\r
if (! this.iframe) {\r
this.iframe = document.createElement("iframe");\r
if (this.isSecure) {\r
- this.iframe.src = this.imageRoot + YAHOO.widget.Overlay.IFRAME_SRC;\r
+ this.iframe.src = YAHOO.widget.Overlay.IFRAME_SRC;\r
}\r
\r
var parent = this.element.parentNode;\r
\r
this.iframe = null;\r
\r
+ YAHOO.widget.Overlay.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent, this);\r
+ YAHOO.widget.Overlay.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent, this);\r
+\r
YAHOO.widget.Overlay.superclass.destroy.call(this);\r
};\r
\r
* A pre-configured ContainerEffect instance that can be used for fading an overlay in and out.\r
* @method FADE\r
* @static\r
-* @param {Overlay} The Overlay object to animate\r
-* @param {Number} The duration of the animation\r
+* @param {Overlay} overlay The Overlay object to animate\r
+* @param {Number} dur The duration of the animation\r
* @return {ContainerEffect} The configured ContainerEffect object\r
*/\r
YAHOO.widget.ContainerEffect.FADE = function(overlay, dur) {\r
* A pre-configured ContainerEffect instance that can be used for sliding an overlay in and out.\r
* @method SLIDE\r
* @static\r
-* @param {Overlay} The Overlay object to animate\r
-* @param {Number} The duration of the animation\r
+* @param {Overlay} overlay The Overlay object to animate\r
+* @param {Number} dur The duration of the animation\r
* @return {ContainerEffect} The configured ContainerEffect object\r
*/\r
YAHOO.widget.ContainerEffect.SLIDE = function(overlay, dur) {\r
Dom Release Notes\r
\r
-*** version .12.0 ***\r
+*** version 0.12.1 ***\r
+\r
+* getElementsByClassName no longer reverts to document when "root" not found\r
+* setXY no longer makes a second call to getXY unless noRetry is false\r
+* minified version no longer strips line breaks\r
+\r
+*** version 0.12.0 ***\r
\r
* fixed getXY for IE null parent\r
* branching set/getStyle at load time instead of run time \r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
+version: 0.12.1\r
*/\r
\r
/**\r
if (pos[0] !== null) { el.style.left = pos[0] - pageXY[0] + delta[0] + 'px'; }\r
if (pos[1] !== null) { el.style.top = pos[1] - pageXY[1] + delta[1] + 'px'; }\r
\r
- var newXY = this.getXY(el);\r
+ if (!noRetry) {\r
+ var newXY = this.getXY(el);\r
\r
- // if retry is true, try one more time if we miss\r
- if (!noRetry && (newXY[0] != pos[0] || newXY[1] != pos[1]) ) {\r
- this.setXY(el, pos, true);\r
+ // if retry is true, try one more time if we miss\r
+ if ( (pos[0] !== null && newXY[0] != pos[0]) ||\r
+ (pos[1] !== null && newXY[1] != pos[1]) ) {\r
+ this.setXY(el, pos, true);\r
+ }\r
}\r
\r
logger.log('setXY setting position to ' + pos, 'info', 'Dom');\r
*/\r
getElementsBy: function(method, tag, root) {\r
tag = tag || '*';\r
- root = Y.Dom.get(root) || document;\r
\r
var nodes = [];\r
+\r
+ if (root) {\r
+ root = Y.Dom.get(root);\r
+ if (!root) { // if no root node, then no children\r
+ return nodes;\r
+ }\r
+ } else {\r
+ root = document;\r
+ }\r
+\r
var elements = root.getElementsByTagName(tag);\r
\r
if ( !elements.length && (tag == '*' && root.all) ) {\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={};var ua=navigator.userAgent.toLowerCase(),isOpera=(ua.indexOf('opera')>-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);var patterns={HYPHEN:/(-[a-z])/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}if(propertyCache[property]){return propertyCache[property];}while(patterns.HYPHEN.exec(property)){property=property.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}propertyCache[property]=property;return property;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}return val/100;break;default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};}if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}break;default:el.style[property]=val;}};}else{setStyle=function(el,property,val){el.style[property]=val;};}YAHOO.util.Dom={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]=Y.Dom.get(el[i]);}return collection;}return null;},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if(el.parentNode===null||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'){if(Y.Dom.getStyle(parentNode,'display')!='inline'){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}if(parentNode.parentNode){parentNode=parentNode.parentNode;}else{parentNode=null;}}return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){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);}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var region=new Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root){var method=function(el){return Y.Dom.hasClass(el,className);};return Y.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 Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return;}el['className']=[el['className'],className].join(' ');};Y.Dom.batch(el,f,Y.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);}};Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(oldClassName===newClassName){return false;}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);}};Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';el=el||{};var f=function(el){if(el){el=Y.Dom.get(el);}else{el={};}if(!el.id){el.id=prefix+id_counter++;}return el.id;};return Y.Dom.batch(el,f,Y.Dom,true);},isAncestor:function(haystack,needle){haystack=Y.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||parent.tagName.toUpperCase()=='HTML'){return false;}parent=parent.parentNode;}return false;}};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root){tag=tag||'*';root=Y.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=Y.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=el[i];}collection[collection.length]=method.call(scope,el[i],o);}return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}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&®ion.right<=this.right&®ion.top>=this.top&®ion.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();
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.1 */\r
+(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={};var ua=navigator.userAgent.toLowerCase(),isOpera=(ua.indexOf('opera')>-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);var patterns={HYPHEN:/(-[a-z])/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}\r
+if(propertyCache[property]){return propertyCache[property];}\r
+while(patterns.HYPHEN.exec(property)){property=property.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}\r
+propertyCache[property]=property;return property;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}\r
+return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}\r
+return val/100;break;default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};}\r
+if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}\r
+break;default:el.style[property]=val;}};}else{setStyle=function(el,property,val){el.style[property]=val;};}\r
+YAHOO.util.Dom={get:function(el){if(!el){return null;}\r
+if(typeof el!='string'&&!(el instanceof Array)){return el;}\r
+if(typeof el=='string'){return document.getElementById(el);}\r
+else{var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=Y.Dom.get(el[i]);}\r
+return collection;}\r
+return null;},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if(el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none'){return false;}\r
+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;}}\r
+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];}\r
+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;}}\r
+if(isSafari&&this.getStyle(el,'position')=='absolute'){pos[0]-=document.body.offsetLeft;pos[1]-=document.body.offsetTop;}}\r
+if(el.parentNode){parentNode=el.parentNode;}\r
+else{parentNode=null;}\r
+while(parentNode&&parentNode.tagName.toUpperCase()!='BODY'&&parentNode.tagName.toUpperCase()!='HTML')\r
+{if(Y.Dom.getStyle(parentNode,'display')!='inline'){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}\r
+if(parentNode.parentNode){parentNode=parentNode.parentNode;}else{parentNode=null;}}\r
+return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative';}\r
+var pageXY=this.getXY(el);if(pageXY===false){return false;}\r
+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;}\r
+if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop;}\r
+if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}\r
+if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}\r
+if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true);}}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var region=new Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root){var method=function(el){return Y.Dom.hasClass(el,className);};return Y.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 Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return;}\r
+el['className']=[el['className'],className].join(' ');};Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,className)){return;}\r
+var c=el['className'];el['className']=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}};Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(oldClassName===newClassName){return false;}\r
+var re=new RegExp('(?:^|\\s+)'+oldClassName+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return;}\r
+el['className']=el['className'].replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}};Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';el=el||{};var f=function(el){if(el){el=Y.Dom.get(el);}else{el={};}\r
+if(!el.id){el.id=prefix+id_counter++;}\r
+return el.id;};return Y.Dom.batch(el,f,Y.Dom,true);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false;}\r
+var f=function(needle){if(haystack.contains&&!isSafari){return haystack.contains(needle);}\r
+else if(haystack.compareDocumentPosition){return!!(haystack.compareDocumentPosition(needle)&16);}\r
+else{var parent=needle.parentNode;while(parent){if(parent==haystack){return true;}\r
+else if(!parent.tagName||parent.tagName.toUpperCase()=='HTML'){return false;}\r
+parent=parent.parentNode;}\r
+return false;}};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root){tag=tag||'*';var nodes=[];if(root){root=Y.Dom.get(root);if(!root){return nodes;}}else{root=document;}\r
+var elements=root.getElementsByTagName(tag);if(!elements.length&&(tag=='*'&&root.all)){elements=root.all;}\r
+for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];}}\r
+return nodes;},batch:function(el,method,o,override){var id=el;el=Y.Dom.get(el);var scope=(override)?o:window;if(!el||el.tagName||!el.length){if(!el){return false;}\r
+return method.call(scope,el,o);}\r
+var collection=[];for(var i=0,len=el.length;i<len;++i){if(!el[i]){id=el[i];}\r
+collection[collection.length]=method.call(scope,el[i],o);}\r
+return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}\r
+return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}\r
+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&®ion.right<=this.right&®ion.top>=this.top&®ion.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];}\r
+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();
\ No newline at end of file
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
+version: 0.12.1\r
*/\r
\r
/**\r
if (pos[0] !== null) { el.style.left = pos[0] - pageXY[0] + delta[0] + 'px'; }\r
if (pos[1] !== null) { el.style.top = pos[1] - pageXY[1] + delta[1] + 'px'; }\r
\r
- var newXY = this.getXY(el);\r
+ if (!noRetry) {\r
+ var newXY = this.getXY(el);\r
\r
- // if retry is true, try one more time if we miss\r
- if (!noRetry && (newXY[0] != pos[0] || newXY[1] != pos[1]) ) {\r
- this.setXY(el, pos, true);\r
+ // if retry is true, try one more time if we miss\r
+ if ( (pos[0] !== null && newXY[0] != pos[0]) ||\r
+ (pos[1] !== null && newXY[1] != pos[1]) ) {\r
+ this.setXY(el, pos, true);\r
+ }\r
}\r
\r
};\r
*/\r
getElementsBy: function(method, tag, root) {\r
tag = tag || '*';\r
- root = Y.Dom.get(root) || document;\r
\r
var nodes = [];\r
+\r
+ if (root) {\r
+ root = Y.Dom.get(root);\r
+ if (!root) { // if no root node, then no children\r
+ return nodes;\r
+ }\r
+ } else {\r
+ root = document;\r
+ }\r
+\r
var elements = root.getElementsByTagName(tag);\r
\r
if ( !elements.length && (tag == '*' && root.all) ) {\r
Drag and Drop Release Notes\r
\r
+0.12.1\r
+\r
+ * Added a STRICT_INTERSECT drag and drop interaction mode. This alters the\r
+ behavior of DDM::getBestMatch. INTERSECT mode first tests the cursor\r
+ location, and if it is over the target that target wins, otherwise it\r
+ tests the overlap of the elements. STRICT_INTERSECT mode tests only \r
+ the overlap, the largest overlap wins.\r
+\r
+ * getBestMatch will work for targeted elements that have no overlap.\r
+\r
0.12.0\r
\r
* The logic to determine if a drag should be initiated has been isolated\r
-/*\r
+/* \r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
-*/\r
-\r
+version: 0.12.1\r
+*/ \r
(function() {\r
\r
-var Event=YAHOO.util.Event;\r
+var Event=YAHOO.util.Event; \r
var Dom=YAHOO.util.Dom;\r
\r
/**\r
- * Defines the interface and base operation of items that that can be\r
+ * Defines the interface and base operation of items that that can be \r
* dragged or can be drop targets. It was designed to be extended, overriding\r
* the event handlers for startDrag, onDrag, onDragOver, onDragOut.\r
* Up to three html elements can be associated with a DragDrop instance:\r
* <ul>\r
* <li>linked element: the element that is passed into the constructor.\r
- * This is the element which defines the boundaries for interaction with\r
+ * This is the element which defines the boundaries for interaction with \r
* other DragDrop objects.</li>\r
- * <li>handle element(s): The drag operation only occurs if the element that\r
- * was clicked matches a handle element. By default this is the linked\r
- * element, but there are times that you will want only a portion of the\r
- * linked element to initiate the drag operation, and the setHandleElId()\r
+ * <li>handle element(s): The drag operation only occurs if the element that \r
+ * was clicked matches a handle element. By default this is the linked \r
+ * element, but there are times that you will want only a portion of the \r
+ * linked element to initiate the drag operation, and the setHandleElId() \r
* method provides a way to define this.</li>\r
* <li>drag element: this represents an the element that would be moved along\r
* with the cursor during a drag operation. By default, this is the linked\r
* </ul>\r
* This class should not be instantiated until the onload event to ensure that\r
* the associated elements are available.\r
- * The following would define a DragDrop obj that would interact with any\r
+ * The following would define a DragDrop obj that would interact with any \r
* other DragDrop obj in the "group1" group:\r
* <pre>\r
* dd = new YAHOO.util.DragDrop("div1", "group1");\r
* </pre>\r
- * Since none of the event handlers have been implemented, nothing would\r
- * actually happen if you were to run the code above. Normally you would\r
- * override this class or one of the default implementations, but you can\r
+ * Since none of the event handlers have been implemented, nothing would \r
+ * actually happen if you were to run the code above. Normally you would \r
+ * override this class or one of the default implementations, but you can \r
* also override the methods you want on an instance of the class...\r
* <pre>\r
* dd.onDragDrop = function(e, id) {\r
* @param {String} id of the element that is linked to this instance\r
* @param {String} sGroup the group of related DragDrop objects\r
* @param {object} config an object containing configurable attributes\r
- * Valid properties for DragDrop:\r
- * padding, isTarget, maintainOffset, primaryButtonOnly\r
+ * Valid properties for DragDrop: \r
+ * padding, isTarget, maintainOffset, primaryButtonOnly,\r
*/\r
YAHOO.util.DragDrop = function(id, sGroup, config) {\r
if (id) {\r
- this.init(id, sGroup, config);\r
+ this.init(id, sGroup, config); \r
}\r
};\r
\r
YAHOO.util.DragDrop.prototype = {\r
\r
/**\r
- * The id of the element associated with this object. This is what we\r
- * refer to as the "linked element" because the size and position of\r
- * this element is used to determine when the drag and drop objects have\r
+ * The id of the element associated with this object. This is what we \r
+ * refer to as the "linked element" because the size and position of \r
+ * this element is used to determine when the drag and drop objects have \r
* interacted.\r
* @property id\r
* @type String\r
config: null,\r
\r
/**\r
- * The id of the element that will be dragged. By default this is same\r
- * as the linked element , but could be changed to another element. Ex:\r
+ * The id of the element that will be dragged. By default this is same \r
+ * as the linked element , but could be changed to another element. Ex: \r
* YAHOO.util.DDProxy\r
* @property dragElId\r
* @type String\r
* @private\r
*/\r
- dragElId: null,\r
+ dragElId: null, \r
\r
/**\r
- * the id of the element that initiates the drag operation. By default\r
+ * the id of the element that initiates the drag operation. By default \r
* this is the linked element, but could be changed to be a child of this\r
- * element. This lets us do things like only starting the drag when the\r
+ * element. This lets us do things like only starting the drag when the \r
* header element within the linked html element is clicked.\r
* @property handleElId\r
* @type String\r
* @private\r
*/\r
- handleElId: null,\r
+ handleElId: null, \r
\r
/**\r
* An associative array of HTML tags that will be ignored if clicked.\r
* @property invalidHandleTypes\r
* @type {string: string}\r
*/\r
- invalidHandleTypes: null,\r
+ invalidHandleTypes: null, \r
\r
/**\r
* An associative array of ids for elements that will be ignored if clicked\r
* @property invalidHandleIds\r
* @type {string: string}\r
*/\r
- invalidHandleIds: null,\r
+ invalidHandleIds: null, \r
\r
/**\r
* An indexted array of css class names for elements that will be ignored\r
* @property invalidHandleClasses\r
* @type string[]\r
*/\r
- invalidHandleClasses: null,\r
+ invalidHandleClasses: null, \r
\r
/**\r
- * The linked element's absolute X position at the time the drag was\r
+ * The linked element's absolute X position at the time the drag was \r
* started\r
* @property startPageX\r
* @type int\r
startPageX: 0,\r
\r
/**\r
- * The linked element's absolute X position at the time the drag was\r
+ * The linked element's absolute X position at the time the drag was \r
* started\r
* @property startPageY\r
* @type int\r
startPageY: 0,\r
\r
/**\r
- * The group defines a logical collection of DragDrop objects that are\r
- * related. Instances only get events when interacting with other\r
- * DragDrop object in the same group. This lets us define multiple\r
+ * The group defines a logical collection of DragDrop objects that are \r
+ * related. Instances only get events when interacting with other \r
+ * DragDrop object in the same group. This lets us define multiple \r
* groups using a single DragDrop subclass if we want.\r
* @property groups\r
* @type {string: string}\r
groups: null,\r
\r
/**\r
- * Individual drag/drop instances can be locked. This will prevent\r
+ * Individual drag/drop instances can be locked. This will prevent \r
* onmousedown start drag.\r
* @property locked\r
* @type boolean\r
maxX: 0,\r
\r
/**\r
- * The up constraint\r
+ * The up constraint \r
* @property minY\r
* @type int\r
* @type int\r
minY: 0,\r
\r
/**\r
- * The down constraint\r
+ * The down constraint \r
* @property maxY\r
* @type int\r
* @private\r
maintainOffset: false,\r
\r
/**\r
- * Array of pixel locations the element will snap to if we specified a\r
+ * Array of pixel locations the element will snap to if we specified a \r
* horizontal graduation/interval. This array is generated automatically\r
* when you define a tick interval.\r
* @property xTicks\r
xTicks: null,\r
\r
/**\r
- * Array of pixel locations the element will snap to if we specified a\r
- * vertical graduation/interval. This array is generated automatically\r
+ * Array of pixel locations the element will snap to if we specified a \r
+ * vertical graduation/interval. This array is generated automatically \r
* when you define a tick interval.\r
* @property yTicks\r
* @type int[]\r
b4Drag: function(e) { },\r
\r
/**\r
- * Abstract method called during the onMouseMove event while dragging an\r
+ * Abstract method called during the onMouseMove event while dragging an \r
* object.\r
* @method onDrag\r
* @param {Event} e the mousemove event\r
onDrag: function(e) { /* override this */ },\r
\r
/**\r
- * Abstract method called when this element fist begins hovering over\r
+ * Abstract method called when this element fist begins hovering over \r
* another DragDrop obj\r
* @method onDragEnter\r
* @param {Event} e the mousemove event\r
* @param {String|DragDrop[]} id In POINT mode, the element\r
- * id this is hovering over. In INTERSECT mode, an array of one or more\r
+ * id this is hovering over. In INTERSECT mode, an array of one or more \r
* dragdrop items being hovered over.\r
*/\r
onDragEnter: function(e, id) { /* override this */ },\r
b4DragOver: function(e) { },\r
\r
/**\r
- * Abstract method called when this element is hovering over another\r
+ * Abstract method called when this element is hovering over another \r
* DragDrop obj\r
* @method onDragOver\r
* @param {Event} e the mousemove event\r
* @param {String|DragDrop[]} id In POINT mode, the element\r
- * id this is hovering over. In INTERSECT mode, an array of dd items\r
+ * id this is hovering over. In INTERSECT mode, an array of dd items \r
* being hovered over.\r
*/\r
onDragOver: function(e, id) { /* override this */ },\r
* @method onDragOut\r
* @param {Event} e the mousemove event\r
* @param {String|DragDrop[]} id In POINT mode, the element\r
- * id this was hovering over. In INTERSECT mode, an array of dd items\r
+ * id this was hovering over. In INTERSECT mode, an array of dd items \r
* that the mouse is no longer over.\r
*/\r
onDragOut: function(e, id) { /* override this */ },\r
b4DragDrop: function(e) { },\r
\r
/**\r
- * Abstract method called when this item is dropped on another DragDrop\r
+ * Abstract method called when this item is dropped on another DragDrop \r
* obj\r
* @method onDragDrop\r
* @param {Event} e the mouseup event\r
* @param {String|DragDrop[]} id In POINT mode, the element\r
- * id this was dropped on. In INTERSECT mode, an array of dd items this\r
+ * id this was dropped on. In INTERSECT mode, an array of dd items this \r
* was dropped on.\r
*/\r
onDragDrop: function(e, id) { /* override this */ },\r
* @param {Event} e the mouseup event\r
*/\r
onMouseUp: function(e) { /* override this */ },\r
-\r
+ \r
/**\r
* Override the onAvailable method to do what is needed after the initial\r
* position was determined.\r
* @method onAvailable\r
*/\r
- onAvailable: function () {\r
- this.logger.log("onAvailable (base)");\r
+ onAvailable: function () { \r
+ this.logger.log("onAvailable (base)"); \r
},\r
\r
/**\r
* Returns a reference to the linked element\r
* @method getEl\r
- * @return {HTMLElement} the html element\r
+ * @return {HTMLElement} the html element \r
*/\r
- getEl: function() {\r
+ getEl: function() { \r
if (!this._domRef) {\r
- this._domRef = Dom.get(this.id);\r
+ this._domRef = Dom.get(this.id); \r
}\r
\r
return this._domRef;\r
\r
/**\r
* Returns a reference to the actual element to drag. By default this is\r
- * the same as the html element, but it can be assigned to another\r
+ * the same as the html element, but it can be assigned to another \r
* element. An example of this can be found in YAHOO.util.DDProxy\r
* @method getDragEl\r
- * @return {HTMLElement} the html element\r
+ * @return {HTMLElement} the html element \r
*/\r
getDragEl: function() {\r
return Dom.get(this.dragElId);\r
*/\r
initTarget: function(id, sGroup, config) {\r
\r
- // configuration attributes\r
+ // configuration attributes \r
this.config = config || {};\r
\r
// create a local reference to the drag and drop manager\r
Event.onAvailable(id, this.handleOnAvailable, this, true);\r
\r
// create a logger instance\r
- this.logger = (YAHOO.widget.LogWriter) ?\r
+ this.logger = (YAHOO.widget.LogWriter) ? \r
new YAHOO.widget.LogWriter(this.toString()) : YAHOO;\r
\r
// the linked element is the element that gets dragged by default\r
- this.setDragElId(id);\r
+ this.setDragElId(id); \r
\r
- // by default, clicked anchors will not start drag operations.\r
+ // by default, clicked anchors will not start drag operations. \r
// @TODO what else should be here? Probably form fields.\r
this.invalidHandleTypes = { A: "A" };\r
this.invalidHandleIds = {};\r
/**\r
* Applies the configuration parameters that were passed into the constructor.\r
* This is supposed to happen at each level through the inheritance chain. So\r
- * a DDProxy implentation will execute apply config on DDProxy, DD, and\r
+ * a DDProxy implentation will execute apply config on DDProxy, DD, and \r
* DragDrop in order to get all of the parameters that are available in\r
* each object.\r
* @method applyConfig\r
*/\r
applyConfig: function() {\r
\r
- // configurable properties:\r
+ // configurable properties: \r
// padding, isTarget, maintainOffset, primaryButtonOnly\r
this.padding = this.config.padding || [0, 0, 0, 0];\r
this.isTarget = (this.config.isTarget !== false);\r
\r
/**\r
* Configures the padding for the target zone in px. Effectively expands\r
- * (or reduces) the virtual object size for targeting calculations.\r
+ * (or reduces) the virtual object size for targeting calculations. \r
* Supports css-style shorthand; if only one parameter is passed, all sides\r
* will have that padding, and if only two are passed, the top and bottom\r
* will have the first param, the left and right the second.\r
this.lastPageX = p[0];\r
this.lastPageY = p[1];\r
\r
- this.logger.log(this.id + " inital position: " + this.initPageX +\r
+ this.logger.log(this.id + " inital position: " + this.initPageX + \r
", " + this.initPageY);\r
\r
\r
*/\r
setStartPosition: function(pos) {\r
var p = pos || Dom.getXY( this.getEl() );\r
+\r
this.deltaSetXY = null;\r
\r
this.startPageX = p[0];\r
},\r
\r
/**\r
- * Add this instance to a group of related drag/drop objects. All\r
- * instances belong to at least one group, and can belong to as many\r
+ * Add this instance to a group of related drag/drop objects. All \r
+ * instances belong to at least one group, and can belong to as many \r
* groups as needed.\r
* @method addToGroup\r
* @param sGroup {string} the name of the group\r
},\r
\r
/**\r
- * Allows you to specify that an element other than the linked element\r
+ * Allows you to specify that an element other than the linked element \r
* will be moved with the cursor during a drag\r
* @method setDragElId\r
* @param id {string} the id of the element that will be used to initiate the drag\r
},\r
\r
/**\r
- * Allows you to specify a child of the linked element that should be\r
- * used to initiate the drag operation. An example of this would be if\r
- * you have a content div with text and links. Clicking anywhere in the\r
+ * Allows you to specify a child of the linked element that should be \r
+ * used to initiate the drag operation. An example of this would be if \r
+ * you have a content div with text and links. Clicking anywhere in the \r
* content area would normally start the drag operation. Use this method\r
- * to specify that an element inside of the content div is the element\r
+ * to specify that an element inside of the content div is the element \r
* that starts the drag operation.\r
* @method setHandleElId\r
- * @param id {string} the id of the element that will be used to\r
+ * @param id {string} the id of the element that will be used to \r
* initiate the drag.\r
*/\r
setHandleElId: function(id) {\r
},\r
\r
/**\r
- * Allows you to set an element outside of the linked element as a drag\r
+ * Allows you to set an element outside of the linked element as a drag \r
* handle\r
* @method setOuterHandleElId\r
* @param id the id of the element that will be used to initiate the drag\r
id = Dom.generateId(id);\r
}\r
this.logger.log("Adding outer handle event: " + id);\r
- Event.on(id, "mousedown",\r
+ Event.on(id, "mousedown", \r
this.handleMouseDown, this, true);\r
this.setHandleElId(id);\r
\r
*/\r
unreg: function() {\r
this.logger.log("DragDrop obj cleanup " + this.id);\r
- Event.removeListener(this.id, "mousedown",\r
+ Event.removeListener(this.id, "mousedown", \r
this.handleMouseDown);\r
this._domRef = null;\r
this.DDM._remove(this);\r
* Returns true if this instance is locked, or the drag drop mgr is locked\r
* (meaning that all drag/drop is disabled on the page.)\r
* @method isLocked\r
- * @return {boolean} true if this obj or all drag/drop is locked, else\r
+ * @return {boolean} true if this obj or all drag/drop is locked, else \r
* false\r
*/\r
isLocked: function() {\r
/**\r
* Fired when this object is clicked\r
* @method handleMouseDown\r
- * @param {Event} e\r
+ * @param {Event} e \r
* @param {YAHOO.util.DragDrop} oDD the clicked dd object (this dd obj)\r
* @private\r
*/\r
// var self = this;\r
// setTimeout( function() { self.DDM.refreshCache(self.groups); }, 0);\r
\r
- // Only process the event if we really clicked within the linked\r
- // element. The reason we make this check is that in the case that\r
- // another element was moved between the clicked element and the\r
- // cursor in the time between the mousedown and mouseup events. When\r
- // this happens, the element gets the next mousedown event\r
- // regardless of where on the screen it happened.\r
+ // Only process the event if we really clicked within the linked \r
+ // element. The reason we make this check is that in the case that \r
+ // another element was moved between the clicked element and the \r
+ // cursor in the time between the mousedown and mouseup events. When \r
+ // this happens, the element gets the next mousedown event \r
+ // regardless of where on the screen it happened. \r
var pt = new YAHOO.util.Point(Event.getPageX(e), Event.getPageY(e));\r
if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) ) {\r
this.logger.log("Click was not over the element: " + this.id);\r
clickValidator: function(e) {\r
var target = Event.getTarget(e);\r
return ( this.isValidHandleChild(target) &&\r
- (this.id == this.handleElId ||\r
+ (this.id == this.handleElId || \r
this.DDM.handleWasClicked(target, this.id)) );\r
},\r
\r
// this.invalidHandleTypes[type] = null;\r
delete this.invalidHandleTypes[type];\r
},\r
-\r
+ \r
/**\r
* Unsets an invalid handle id\r
* @method removeInvalidHandleId\r
/**\r
* Unsets an invalid css class\r
* @method removeInvalidHandleClass\r
- * @param {string} cssClass the class of the element(s) you wish to\r
+ * @param {string} cssClass the class of the element(s) you wish to \r
* re-enable\r
*/\r
removeInvalidHandleClass: function(cssClass) {\r
setXTicks: function(iStartX, iTickSize) {\r
this.xTicks = [];\r
this.xTickSize = iTickSize;\r
-\r
+ \r
var tickMap = {};\r
\r
for (var i = this.initPageX; i >= this.minX; i = i - iTickSize) {\r
},\r
\r
/**\r
- * Create the array of vertical tick marks if an interval was specified in\r
+ * Create the array of vertical tick marks if an interval was specified in \r
* setYConstraint().\r
* @method setYTicks\r
* @private\r
},\r
\r
/**\r
- * By default, the element can be dragged any place on the screen. Use\r
- * this method to limit the horizontal travel of the element. Pass in\r
+ * By default, the element can be dragged any place on the screen. Use \r
+ * this method to limit the horizontal travel of the element. Pass in \r
* 0,0 for the parameters if you want to lock the drag to the y axis.\r
* @method setXConstraint\r
* @param {int} iLeft the number of pixels the element can move to the left\r
- * @param {int} iRight the number of pixels the element can move to the\r
+ * @param {int} iRight the number of pixels the element can move to the \r
* right\r
- * @param {int} iTickSize optional parameter for specifying that the\r
+ * @param {int} iTickSize optional parameter for specifying that the \r
* element\r
* should move iTickSize pixels at a time.\r
*/\r
if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); }\r
\r
this.constrainX = true;\r
- this.logger.log("initPageX:" + this.initPageX + " minX:" + this.minX +\r
+ this.logger.log("initPageX:" + this.initPageX + " minX:" + this.minX + \r
" maxX:" + this.maxX);\r
},\r
\r
},\r
\r
/**\r
- * By default, the element can be dragged any place on the screen. Set\r
+ * By default, the element can be dragged any place on the screen. Set \r
* this to limit the vertical travel of the element. Pass in 0,0 for the\r
* parameters if you want to lock the drag to the x axis.\r
* @method setYConstraint\r
* @param {int} iUp the number of pixels the element can move up\r
* @param {int} iDown the number of pixels the element can move down\r
- * @param {int} iTickSize optional parameter for specifying that the\r
+ * @param {int} iTickSize optional parameter for specifying that the \r
* element should move iTickSize pixels at a time.\r
*/\r
setYConstraint: function(iUp, iDown, iTickSize) {\r
if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); }\r
\r
this.constrainY = true;\r
-\r
- this.logger.log("initPageY:" + this.initPageY + " minY:" + this.minY +\r
+ \r
+ this.logger.log("initPageY:" + this.initPageY + " minY:" + this.minY + \r
" maxY:" + this.maxY);\r
},\r
\r
\r
// Maintain offsets if necessary\r
if (this.initPageX || this.initPageX === 0) {\r
- this.logger.log("init pagexy: " + this.initPageX + ", " +\r
+ this.logger.log("init pagexy: " + this.initPageX + ", " + \r
this.initPageY);\r
- this.logger.log("last pagexy: " + this.lastPageX + ", " +\r
+ this.logger.log("last pagexy: " + this.lastPageX + ", " + \r
this.lastPageY);\r
// figure out how much this thing has moved\r
var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0;\r
}\r
\r
if (this.constrainX) {\r
- this.setXConstraint( this.leftConstraint,\r
- this.rightConstraint,\r
+ this.setXConstraint( this.leftConstraint, \r
+ this.rightConstraint, \r
this.xTickSize );\r
}\r
\r
if (this.constrainY) {\r
- this.setYConstraint( this.topConstraint,\r
- this.bottomConstraint,\r
+ this.setYConstraint( this.topConstraint, \r
+ this.bottomConstraint, \r
this.yTickSize );\r
}\r
},\r
\r
/**\r
- * Normally the drag element is moved pixel by pixel, but we can specify\r
- * that it move a number of pixels at a time. This method resolves the\r
+ * Normally the drag element is moved pixel by pixel, but we can specify \r
+ * that it move a number of pixels at a time. This method resolves the \r
* location when we have it set up like this.\r
* @method getTick\r
* @param {int} val where we want to place the object\r
getTick: function(val, tickArray) {\r
\r
if (!tickArray) {\r
- // If tick interval is not defined, it is effectively 1 pixel,\r
+ // If tick interval is not defined, it is effectively 1 pixel, \r
// so we return the value passed to us.\r
- return val;\r
+ return val; \r
} else if (tickArray[0] >= val) {\r
// The value is lower than the first tick, so we return the first\r
// tick.\r
* @namespace YAHOO.util\r
*/\r
\r
-// Only load the library once. Rewriting the manager class would orphan\r
+// Only load the library once. Rewriting the manager class would orphan \r
// existing drag and drop instances.\r
if (!YAHOO.util.DragDropMgr) {\r
\r
/**\r
- * DragDropMgr is a singleton that tracks the element interaction for\r
- * all DragDrop items in the window. Generally, you will not call\r
- * this class directly, but it does have helper methods that could\r
+ * DragDropMgr is a singleton that tracks the element interaction for \r
+ * all DragDrop items in the window. Generally, you will not call \r
+ * this class directly, but it does have helper methods that could \r
* be useful in your DragDrop implementations.\r
* @class DragDropMgr\r
* @static\r
return {\r
\r
/**\r
- * Two dimensional Array of registered DragDrop objects. The first\r
- * dimension is the DragDrop item group, the second the DragDrop\r
+ * Two dimensional Array of registered DragDrop objects. The first \r
+ * dimension is the DragDrop item group, the second the DragDrop \r
* object.\r
* @property ids\r
* @type {string: string}\r
ids: {},\r
\r
/**\r
- * Array of element ids defined as drag handles. Used to determine\r
- * if the element that generated the mousedown event is actually the\r
+ * Array of element ids defined as drag handles. Used to determine \r
+ * if the element that generated the mousedown event is actually the \r
* handle and not the html element itself.\r
* @property handleIds\r
* @type {string: string}\r
\r
/**\r
* Flag to determine if we should prevent the default behavior of the\r
- * events we define. By default this is true, but this can be set to\r
+ * events we define. By default this is true, but this can be set to \r
* false if you need the default behavior (not recommended)\r
* @property preventDefault\r
* @type boolean\r
preventDefault: true,\r
\r
/**\r
- * Flag to determine if we should stop the propagation of the events\r
+ * Flag to determine if we should stop the propagation of the events \r
* we generate. This is true by default but you may want to set it to\r
* false if the html element contains other features that require the\r
* mouse click.\r
},\r
\r
/**\r
- * In point mode, drag and drop interaction is defined by the\r
+ * In point mode, drag and drop interaction is defined by the \r
* location of the cursor during the drag/drop\r
* @property POINT\r
* @type int\r
* @static\r
+ * @final\r
*/\r
POINT: 0,\r
\r
/**\r
- * In intersect mode, drag and drop interactio nis defined by the\r
- * overlap of two or more drag and drop objects.\r
+ * In intersect mode, drag and drop interaction is defined by the \r
+ * cursor position or the amount of overlap of two or more drag and \r
+ * drop objects.\r
* @property INTERSECT\r
* @type int\r
* @static\r
+ * @final\r
*/\r
INTERSECT: 1,\r
\r
+ /**\r
+ * In intersect mode, drag and drop interaction is defined only by the \r
+ * overlap of two or more drag and drop objects.\r
+ * @property STRICT_INTERSECT\r
+ * @type int\r
+ * @static\r
+ * @final\r
+ */\r
+ STRICT_INTERSECT: 2,\r
+\r
/**\r
* The current drag and drop mode. Default: POINT\r
* @property mode\r
useCache: true,\r
\r
/**\r
- * The number of pixels that the mouse needs to move after the\r
+ * The number of pixels that the mouse needs to move after the \r
* mousedown before the drag is initiated. Default=3;\r
* @property clickPixelThresh\r
* @type int\r
clickTimeThresh: 1000,\r
\r
/**\r
- * Flag that indicates that either the drag pixel threshold or the\r
+ * Flag that indicates that either the drag pixel threshold or the \r
* mousdown time threshold has been met\r
* @property dragThreshMet\r
* @type boolean\r
clickTimeout: null,\r
\r
/**\r
- * The X position of the mousedown event stored for later use when a\r
+ * The X position of the mousedown event stored for later use when a \r
* drag threshold is met.\r
* @property startX\r
* @type int\r
startX: 0,\r
\r
/**\r
- * The Y position of the mousedown event stored for later use when a\r
+ * The Y position of the mousedown event stored for later use when a \r
* drag threshold is met.\r
* @property startY\r
* @type int\r
startY: 0,\r
\r
/**\r
- * Each DragDrop instance must be registered with the DragDropMgr.\r
+ * Each DragDrop instance must be registered with the DragDropMgr. \r
* This is executed in DragDrop.init()\r
* @method regDragDrop\r
* @param {DragDrop} oDD the DragDrop object to register\r
*/\r
regDragDrop: function(oDD, sGroup) {\r
if (!this.initialized) { this.init(); }\r
-\r
+ \r
if (!this.ids[sGroup]) {\r
this.ids[sGroup] = {};\r
}\r
},\r
\r
/**\r
- * Unregisters a drag and drop item. This is executed in\r
+ * Unregisters a drag and drop item. This is executed in \r
* DragDrop.unreg, use that method instead of calling this directly.\r
* @method _remove\r
* @private\r
* automatically when executing DragDrop.setHandleElId()\r
* @method regHandle\r
* @param {String} sDDId the DragDrop id this element is a handle for\r
- * @param {String} sHandleId the id of the element that is the drag\r
+ * @param {String} sHandleId the id of the element that is the drag \r
* handle\r
* @static\r
*/\r
},\r
\r
/**\r
- * Utility function to determine if a given element has been\r
+ * Utility function to determine if a given element has been \r
* registered as a drag drop item.\r
* @method isDragDrop\r
* @param {String} id the element id to check\r
- * @return {boolean} true if this element is a DragDrop item,\r
+ * @return {boolean} true if this element is a DragDrop item, \r
* false otherwise\r
* @static\r
*/\r
},\r
\r
/**\r
- * Returns true if the specified dd target is a legal target for\r
+ * Returns true if the specified dd target is a legal target for \r
* the specifice drag obj\r
* @method isLegalTarget\r
* @param {DragDrop} the drag obj\r
* @param {DragDrop} the target\r
- * @return {boolean} true if the target is a legal target for the\r
+ * @return {boolean} true if the target is a legal target for the \r
* dd obj\r
* @static\r
*/\r
\r
/**\r
* My goal is to be able to transparently determine if an object is\r
- * typeof DragDrop, and the exact subclass of DragDrop. typeof\r
+ * typeof DragDrop, and the exact subclass of DragDrop. typeof \r
* returns "object", oDD.constructor.toString() always returns\r
* "DragDrop" and not the name of the subclass. So for now it just\r
* evaluates a well-known variable in DragDrop.\r
},\r
\r
/**\r
- * Utility function to determine if a given element has been\r
+ * Utility function to determine if a given element has been \r
* registered as a drag drop handle for the given Drag Drop object.\r
* @method isHandle\r
* @param {String} id the element id to check\r
- * @return {boolean} true if this element is a DragDrop handle, false\r
+ * @return {boolean} true if this element is a DragDrop handle, false \r
* otherwise\r
* @static\r
*/\r
isHandle: function(sDDId, sHandleId) {\r
- return ( this.handleIds[sDDId] &&\r
+ return ( this.handleIds[sDDId] && \r
this.handleIds[sDDId][sHandleId] );\r
},\r
\r
\r
this.dragThreshMet = false;\r
\r
- this.clickTimeout = setTimeout(\r
- function() {\r
+ this.clickTimeout = setTimeout( \r
+ function() { \r
var DDM = YAHOO.util.DDM;\r
- DDM.startDrag(DDM.startX, DDM.startY);\r
- },\r
+ DDM.startDrag(DDM.startX, DDM.startY); \r
+ }, \r
this.clickTimeThresh );\r
},\r
\r
/**\r
- * Fired when either the drag pixel threshol or the mousedown hold\r
+ * Fired when either the drag pixel threshol or the mousedown hold \r
* time threshold has been met.\r
* @method startDrag\r
* @param x {int} the X position of the original mousedown\r
},\r
\r
/**\r
- * Internal function to handle the mouseup event. Will be invoked\r
+ * Internal function to handle the mouseup event. Will be invoked \r
* from the context of the document.\r
* @method handleMouseUp\r
* @param {Event} e the event\r
},\r
\r
/**\r
- * Utility to stop event propagation and event default, if these\r
+ * Utility to stop event propagation and event default, if these \r
* features are turned on.\r
* @method stopEvent\r
* @param {Event} e the event as returned by this.getEvent()\r
}\r
},\r
\r
- /**\r
- * Internal function to clean up event handlers after the drag\r
+ /** \r
+ * Internal function to clean up event handlers after the drag \r
* operation is complete\r
* @method stopDrag\r
* @param {Event} e the event\r
},\r
\r
\r
- /**\r
- * Internal function to handle the mousemove event. Will be invoked\r
+ /** \r
+ * Internal function to handle the mousemove event. Will be invoked \r
* from the context of the html element.\r
*\r
- * @TODO figure out what we can do about mouse events lost when the\r
- * user drags objects beyond the window boundary. Currently we can\r
- * detect this in internet explorer by verifying that the mouse is\r
- * down during the mousemove event. Firefox doesn't give us the\r
+ * @TODO figure out what we can do about mouse events lost when the \r
+ * user drags objects beyond the window boundary. Currently we can \r
+ * detect this in internet explorer by verifying that the mouse is \r
+ * down during the mousemove event. Firefox doesn't give us the \r
* button state on the mousemove event.\r
* @method handleMouseMove\r
* @param {Event} e the event\r
var diffX = Math.abs(this.startX - YAHOO.util.Event.getPageX(e));\r
var diffY = Math.abs(this.startY - YAHOO.util.Event.getPageY(e));\r
// this.logger.log("diffX: " + diffX + "diffY: " + diffY);\r
- if (diffX > this.clickPixelThresh ||\r
+ if (diffX > this.clickPixelThresh || \r
diffY > this.clickPixelThresh) {\r
this.logger.log("pixel threshold met");\r
this.startDrag(this.startX, this.startY);\r
},\r
\r
/**\r
- * Iterates over all of the DragDrop elements to find ones we are\r
+ * Iterates over all of the DragDrop elements to find ones we are \r
* hovering over or dropping on\r
* @method fireEvents\r
* @param {Event} e the event\r
fireEvents: function(e, isDrop) {\r
var dc = this.dragCurrent;\r
\r
- // If the user did the mouse up outside of the window, we could\r
+ // If the user did the mouse up outside of the window, we could \r
// get here even though we have ended the drag.\r
if (!dc || dc.isLocked()) {\r
return;\r
var dropEvts = [];\r
var enterEvts = [];\r
\r
- // Check to see if the object(s) we were hovering over is no longer\r
+ // Check to see if the object(s) we were hovering over is no longer \r
// being hovered over so we can fire the onDragOut event\r
for (var i in this.dragOvers) {\r
\r
\r
for (var sGroup in dc.groups) {\r
// this.logger.log("Processing group " + sGroup);\r
-\r
+ \r
if ("string" != typeof sGroup) {\r
continue;\r
}\r
dc.b4DragOut(e, outEvts[i].id);\r
dc.onDragOut(e, outEvts[i].id);\r
}\r
-\r
+ \r
// fire enter events\r
for (i=0,len=enterEvts.length; i<len; ++i) {\r
this.logger.log(dc.id + " onDragEnter " + enterEvts[i].id);\r
// dc.b4DragEnter(e, oDD.id);\r
dc.onDragEnter(e, enterEvts[i].id);\r
}\r
-\r
+ \r
// fire over events\r
for (i=0,len=overEvts.length; i<len; ++i) {\r
this.logger.log(dc.id + " onDragOver " + overEvts[i].id);\r
},\r
\r
/**\r
- * Helper function for getting the best match from the list of drag\r
- * and drop objects returned by the drag and drop events when we are\r
- * in INTERSECT mode. It returns either the first object that the\r
- * cursor is over, or the object that has the greatest overlap with\r
+ * Helper function for getting the best match from the list of drag \r
+ * and drop objects returned by the drag and drop events when we are \r
+ * in INTERSECT mode. It returns either the first object that the \r
+ * cursor is over, or the object that has the greatest overlap with \r
* the dragged element.\r
* @method getBestMatch\r
- * @param {DragDrop[]} dds The array of drag and drop objects\r
+ * @param {DragDrop[]} dds The array of drag and drop objects \r
* targeted\r
* @return {DragDrop} The best single match\r
* @static\r
*/\r
getBestMatch: function(dds) {\r
var winner = null;\r
- // Return null if the input is not what we expect\r
- //if (!dds || !dds.length || dds.length == 0) {\r
- // winner = null;\r
- // If there is only one item, it wins\r
- //} else if (dds.length == 1) {\r
\r
var len = dds.length;\r
\r
// Loop through the targeted items\r
for (var i=0; i<len; ++i) {\r
var dd = dds[i];\r
- // If the cursor is over the object, it wins. If the\r
+ // If the cursor is over the object, it wins. If the \r
// cursor is over multiple matches, the first one we come\r
// to wins.\r
- if (dd.cursorIsOver) {\r
+ if (this.mode == this.INTERSECT && dd.cursorIsOver) {\r
winner = dd;\r
break;\r
// Otherwise the object with the most overlap wins\r
} else {\r
- if (!winner ||\r
- winner.overlap.getArea() < dd.overlap.getArea()) {\r
+ if (!winner || !winner.overlap || (dd.overlap &&\r
+ winner.overlap.getArea() < dd.overlap.getArea())) {\r
winner = dd;\r
}\r
}\r
},\r
\r
/**\r
- * Refreshes the cache of the top-left and bottom-right points of the\r
+ * Refreshes the cache of the top-left and bottom-right points of the \r
* drag and drop objects in the specified group(s). This is in the\r
- * format that is stored in the drag and drop instance, so typical\r
+ * format that is stored in the drag and drop instance, so typical \r
* usage is:\r
* <code>\r
* YAHOO.util.DragDropMgr.refreshCache(ddinstance.groups);\r
\r
return false;\r
},\r
-\r
+ \r
/**\r
* Returns a Region object containing the drag and drop element's position\r
* and size, including the padding configured for it\r
* @method getLocation\r
- * @param {DragDrop} oDD the drag and drop object to get the\r
+ * @param {DragDrop} oDD the drag and drop object to get the \r
* location for\r
* @return {YAHOO.util.Region} a Region object representing the total area\r
* the element occupies, including any padding\r
\r
// DragDrop is using this as a sanity check for the initial mousedown\r
// in this case we are done. In POINT mode, if the drag obj has no\r
- // contraints, we are also done. Otherwise we need to evaluate the\r
+ // contraints, we are also done. Otherwise we need to evaluate the \r
// location of the target as related to the actual location of the\r
// dragged element.\r
var dc = this.dragCurrent;\r
- if (!dc || !dc.getTargetCoord ||\r
+ if (!dc || !dc.getTargetCoord || \r
(!intersect && !dc.constrainX && !dc.constrainY)) {\r
return oTarget.cursorIsOver;\r
}\r
var pos = dc.getTargetCoord(pt.x, pt.y);\r
\r
var el = dc.getDragEl();\r
- var curRegion = new YAHOO.util.Region( pos.y,\r
+ var curRegion = new YAHOO.util.Region( pos.y, \r
pos.x + el.offsetWidth,\r
- pos.y + el.offsetHeight,\r
+ pos.y + el.offsetHeight, \r
pos.x );\r
\r
var overlap = curRegion.intersect(loc);\r
* @static\r
*/\r
elementCache: {},\r
-\r
+ \r
/**\r
* Get the wrapper for the DOM element specified\r
* @method getElWrapper\r
getElWrapper: function(id) {\r
var oWrapper = this.elementCache[id];\r
if (!oWrapper || !oWrapper.el) {\r
- oWrapper = this.elementCache[id] =\r
+ oWrapper = this.elementCache[id] = \r
new this.ElementWrapper(YAHOO.util.Dom.get(id));\r
}\r
return oWrapper;\r
getElement: function(id) {\r
return YAHOO.util.Dom.get(id);\r
},\r
-\r
+ \r
/**\r
- * Returns the style property for the DOM element (i.e.,\r
+ * Returns the style property for the DOM element (i.e., \r
* document.getElById(id).style)\r
* @method getCss\r
* @param {String} id the id of the elment to get\r
* @static\r
*/\r
getPosY: function(el) {\r
- return YAHOO.util.Dom.getY(el);\r
+ return YAHOO.util.Dom.getY(el); \r
},\r
\r
/**\r
- * Swap two nodes. In IE, we use the native method, for others we\r
+ * Swap two nodes. In IE, we use the native method, for others we \r
* emulate the IE behavior\r
* @method swapNode\r
* @param n1 the first node to swap\r
},\r
\r
/**\r
- * Recursively searches the immediate parent and all child nodes for\r
- * the handle element in order to determine wheter or not it was\r
+ * Recursively searches the immediate parent and all child nodes for \r
+ * the handle element in order to determine wheter or not it was \r
* clicked.\r
* @method handleWasClicked\r
* @param node the html element to inspect\r
}\r
\r
/**\r
- * A DragDrop implementation where the linked element follows the\r
+ * A DragDrop implementation where the linked element follows the \r
* mouse cursor during a drag.\r
* @class DD\r
* @extends YAHOO.util.DragDrop\r
* @constructor\r
- * @param {String} id the id of the linked element\r
+ * @param {String} id the id of the linked element \r
* @param {String} sGroup the group of related DragDrop items\r
* @param {object} config an object containing configurable attributes\r
- * Valid properties for DD:\r
+ * Valid properties for DD: \r
* scroll\r
*/\r
YAHOO.util.DD = function(id, sGroup, config) {\r
* @property scroll\r
* @type boolean\r
*/\r
- scroll: true,\r
+ scroll: true, \r
\r
/**\r
- * Sets the pointer offset to the distance between the linked element's top\r
+ * Sets the pointer offset to the distance between the linked element's top \r
* left corner and the location the element was clicked\r
* @method autoOffset\r
* @param {int} iPageX the X coordinate of the click\r
// this.logger.log("autoOffset el pos: " + aCoord + ", delta: " + x + "," + y);\r
},\r
\r
- /**\r
- * Sets the pointer offset. You can call this directly to force the\r
- * offset to be in a particular location (e.g., pass in 0,0 to set it\r
+ /** \r
+ * Sets the pointer offset. You can call this directly to force the \r
+ * offset to be in a particular location (e.g., pass in 0,0 to set it \r
* to the center of the object, as done in YAHOO.widget.Slider)\r
* @method setDelta\r
* @param {int} iDeltaX the distance from the left\r
},\r
\r
/**\r
- * Sets the drag element to the location of the mousedown or click event,\r
- * maintaining the cursor location relative to the location on the element\r
- * that was clicked. Override this if you want to place the element in a\r
+ * Sets the drag element to the location of the mousedown or click event, \r
+ * maintaining the cursor location relative to the location on the element \r
+ * that was clicked. Override this if you want to place the element in a \r
* location other than where the cursor is.\r
* @method setDragElPos\r
* @param {int} iPageX the X coordinate of the mousedown or drag event\r
},\r
\r
/**\r
- * Sets the element to the location of the mousedown or click event,\r
- * maintaining the cursor location relative to the location on the element\r
- * that was clicked. Override this if you want to place the element in a\r
+ * Sets the element to the location of the mousedown or click event, \r
+ * maintaining the cursor location relative to the location on the element \r
+ * that was clicked. Override this if you want to place the element in a \r
* location other than where the cursor is.\r
* @method alignElWithMouse\r
* @param {HTMLElement} el the element to move\r
YAHOO.util.Dom.setStyle(el, "left", (oCoord.x + this.deltaSetXY[0]) + "px");\r
YAHOO.util.Dom.setStyle(el, "top", (oCoord.y + this.deltaSetXY[1]) + "px");\r
}\r
-\r
+ \r
this.cachePosition(oCoord.x, oCoord.y);\r
this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);\r
},\r
},\r
\r
/**\r
- * Auto-scroll the window if the dragged object has been moved beyond the\r
+ * Auto-scroll the window if the dragged object has been moved beyond the \r
* visible window boundary.\r
* @method autoScroll\r
* @param {int} x the drag element's x position\r
// Location of the right of the element\r
var right = w + x;\r
\r
- // The distance from the cursor to the bottom of the visible area,\r
+ // The distance from the cursor to the bottom of the visible area, \r
// adjusted so that we don't scroll if the cursor is beyond the\r
// element drag constraints\r
var toBot = (clientH + st - y - this.deltaY);\r
// The distance from the cursor to the right of the visible area\r
var toRight = (clientW + sl - x - this.deltaX);\r
\r
- // this.logger.log( " x: " + x + " y: " + y + " h: " + h +\r
- // " clientH: " + clientH + " clientW: " + clientW +\r
- // " st: " + st + " sl: " + sl + " bot: " + bot +\r
+ // this.logger.log( " x: " + x + " y: " + y + " h: " + h + \r
+ // " clientH: " + clientH + " clientW: " + clientW + \r
+ // " st: " + st + " sl: " + sl + " bot: " + bot + \r
// " right: " + right + " toBot: " + toBot + " toRight: " + toRight);\r
\r
// How close to the edge the cursor must be before we scroll\r
// var thresh = (document.all) ? 100 : 40;\r
var thresh = 40;\r
\r
- // How many pixels to scroll per autoscroll op. This helps to reduce\r
- // clunky scrolling. IE is more sensitive about this ... it needs this\r
+ // How many pixels to scroll per autoscroll op. This helps to reduce \r
+ // clunky scrolling. IE is more sensitive about this ... it needs this \r
// value to be higher.\r
var scrAmt = (document.all) ? 80 : 30;\r
\r
- // Scroll down if we are near the bottom of the visible page and the\r
+ // Scroll down if we are near the bottom of the visible page and the \r
// obj extends below the crease\r
- if ( bot > clientH && toBot < thresh ) {\r
- window.scrollTo(sl, st + scrAmt);\r
+ if ( bot > clientH && toBot < thresh ) { \r
+ window.scrollTo(sl, st + scrAmt); \r
}\r
\r
// Scroll up if the window is scrolled down and the top of the object\r
// goes above the top border\r
- if ( y < st && st > 0 && y - st < thresh ) {\r
- window.scrollTo(sl, st - scrAmt);\r
+ if ( y < st && st > 0 && y - st < thresh ) { \r
+ window.scrollTo(sl, st - scrAmt); \r
}\r
\r
// Scroll right if the obj is beyond the right border and the cursor is\r
// near the border.\r
- if ( right > clientW && toRight < thresh ) {\r
- window.scrollTo(sl + scrAmt, st);\r
+ if ( right > clientW && toRight < thresh ) { \r
+ window.scrollTo(sl + scrAmt, st); \r
}\r
\r
// Scroll left if the window has been scrolled to the right and the obj\r
// extends past the left border\r
- if ( x < sl && sl > 0 && x - sl < thresh ) {\r
+ if ( x < sl && sl > 0 && x - sl < thresh ) { \r
window.scrollTo(sl - scrAmt, st);\r
}\r
}\r
x = this.getTick(x, this.xTicks);\r
y = this.getTick(y, this.yTicks);\r
\r
- // this.logger.log("getTargetCoord " +\r
+ // this.logger.log("getTargetCoord " + \r
// " iPageX: " + iPageX +\r
// " iPageY: " + iPageY +\r
// " x: " + x + ", y: " + y);\r
\r
/*\r
* Sets up config options specific to this class. Overrides\r
- * YAHOO.util.DragDrop, but all versions of this method through the\r
+ * YAHOO.util.DragDrop, but all versions of this method through the \r
* inheritance chain are called\r
*/\r
applyConfig: function() {\r
},\r
\r
/*\r
- * Event that fires prior to the onMouseDown event. Overrides\r
+ * Event that fires prior to the onMouseDown event. Overrides \r
* YAHOO.util.DragDrop.\r
*/\r
b4MouseDown: function(e) {\r
// this.resetConstraints();\r
- this.autoOffset(YAHOO.util.Event.getPageX(e),\r
+ this.autoOffset(YAHOO.util.Event.getPageX(e), \r
YAHOO.util.Event.getPageY(e));\r
},\r
\r
/*\r
- * Event that fires prior to the onDrag event. Overrides\r
+ * Event that fires prior to the onDrag event. Overrides \r
* YAHOO.util.DragDrop.\r
*/\r
b4Drag: function(e) {\r
- this.setDragElPos(YAHOO.util.Event.getPageX(e),\r
+ this.setDragElPos(YAHOO.util.Event.getPageX(e), \r
YAHOO.util.Event.getPageY(e));\r
},\r
\r
* @param {String} id the id of the linked html element\r
* @param {String} sGroup the group of related DragDrop objects\r
* @param {object} config an object containing configurable attributes\r
- * Valid properties for DDProxy in addition to those in DragDrop:\r
+ * Valid properties for DDProxy in addition to those in DragDrop: \r
* resizeFrame, centerFrame, dragElId\r
*/\r
YAHOO.util.DDProxy = function(id, sGroup, config) {\r
if (id) {\r
this.init(id, sGroup, config);\r
- this.initFrame();\r
+ this.initFrame(); \r
}\r
};\r
\r
s.zIndex = 999;\r
\r
// appendChild can blow up IE if invoked prior to the window load event\r
- // while rendering a table. It is possible there are other scenarios\r
+ // while rendering a table. It is possible there are other scenarios \r
// that would cause this to happen as well.\r
body.insertBefore(div, body.firstChild);\r
}\r
},\r
\r
/**\r
- * Resizes the drag frame to the dimensions of the clicked object, positions\r
+ * Resizes the drag frame to the dimensions of the clicked object, positions \r
* it over the object, and finally displays it\r
* @method showFrame\r
* @param {int} iPageX X click position\r
this._resizeProxy();\r
\r
if (this.centerFrame) {\r
- this.setDelta( Math.round(parseInt(s.width, 10)/2),\r
+ this.setDelta( Math.round(parseInt(s.width, 10)/2), \r
Math.round(parseInt(s.height, 10)/2) );\r
}\r
\r
this.setDragElPos(iPageX, iPageY);\r
\r
- YAHOO.util.Dom.setStyle(dragEl, "visibility", "visible");\r
+ YAHOO.util.Dom.setStyle(dragEl, "visibility", "visible"); \r
},\r
\r
/**\r
\r
this.logger.log("proxy size: " + bt + " " + br + " " + bb + " " + bl);\r
\r
- var newWidth = Math.max(0, el.offsetWidth - br - bl);\r
+ var newWidth = Math.max(0, el.offsetWidth - br - bl); \r
var newHeight = Math.max(0, el.offsetHeight - bt - bb);\r
\r
this.logger.log("Resizing proxy element");\r
// overrides YAHOO.util.DragDrop\r
b4EndDrag: function(e) {\r
this.logger.log(this.id + " b4EndDrag");\r
- YAHOO.util.Dom.setStyle(this.getDragEl(), "visibility", "hidden");\r
+ YAHOO.util.Dom.setStyle(this.getDragEl(), "visibility", "hidden"); \r
},\r
\r
// overrides YAHOO.util.DragDrop\r
- // By default we try to move the element to the last location of the frame.\r
- // This is so that the default behavior mirrors that of YAHOO.util.DD.\r
+ // By default we try to move the element to the last location of the frame. \r
+ // This is so that the default behavior mirrors that of YAHOO.util.DD. \r
endDrag: function(e) {\r
var DOM = YAHOO.util.Dom;\r
this.logger.log(this.id + " endDrag");\r
\r
// Show the drag frame briefly so we can get its position\r
// del.style.visibility = "";\r
- DOM.setStyle(del, "visibility", "");\r
+ DOM.setStyle(del, "visibility", ""); \r
\r
- // Hide the linked element before the move to get around a Safari\r
+ // Hide the linked element before the move to get around a Safari \r
// rendering bug.\r
//lel.style.visibility = "hidden";\r
- DOM.setStyle(lel, "visibility", "hidden");\r
+ DOM.setStyle(lel, "visibility", "hidden"); \r
YAHOO.util.DDM.moveToEl(lel, del);\r
//del.style.visibility = "hidden";\r
- DOM.setStyle(del, "visibility", "hidden");\r
+ DOM.setStyle(del, "visibility", "hidden"); \r
//lel.style.visibility = "";\r
- DOM.setStyle(lel, "visibility", "");\r
+ DOM.setStyle(lel, "visibility", ""); \r
},\r
\r
toString: function() {\r
\r
});\r
/**\r
- * A DragDrop implementation that does not move, but can be a drop\r
- * target. You would get the same result by simply omitting implementation\r
- * for the event callbacks, but this way we reduce the processing cost of the\r
+ * A DragDrop implementation that does not move, but can be a drop \r
+ * target. You would get the same result by simply omitting implementation \r
+ * for the event callbacks, but this way we reduce the processing cost of the \r
* event listener and the callbacks.\r
* @class DDTarget\r
- * @extends YAHOO.util.DragDrop\r
+ * @extends YAHOO.util.DragDrop \r
* @constructor\r
* @param {String} id the id of the element that is a drop target\r
* @param {String} sGroup the group of related DragDrop objects\r
* @param {object} config an object containing configurable attributes\r
- * Valid properties for DDTarget in addition to those in\r
- * DragDrop:\r
+ * Valid properties for DDTarget in addition to those in \r
+ * DragDrop: \r
* none\r
*/\r
YAHOO.util.DDTarget = function(id, sGroup, config) {\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ (function(){var _1=YAHOO.util.Event;var _2=YAHOO.util.Dom;YAHOO.util.DragDrop=function(id,_4,_5){if(id){this.init(id,_4,_5);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=_2.get(this.id);}return this._domRef;},getDragEl:function(){return _2.get(this.dragElId);},init:function(id,_9,_10){this.initTarget(id,_9,_10);_1.on(this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,_11,_12){this.config=_12||{};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}this.id=id;this.addToGroup((_11)?_11:"default");this.handleElId=id;_1.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(_13,_14,_15,_16){if(!_14&&0!==_14){this.padding=[_13,_13,_13,_13];}else{if(!_15&&0!==_15){this.padding=[_13,_14,_13,_14];}else{this.padding=[_13,_14,_15,_16];}}},setInitPosition:function(_17,_18){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}var dx=_17||0;var dy=_18||0;var p=_2.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||_2.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(_24){this.groups[_24]=true;this.DDM.regDragDrop(this,_24);},removeFromGroup:function(_25){if(this.groups[_25]){delete this.groups[_25];}this.DDM.removeDDFromGroup(this,_25);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}_1.on(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){_1.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return (this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var _27=e.which||e.button;if(this.primaryButtonOnly&&_27>1){return;}if(this.isLocked()){return;}this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(_1.getPageX(e),_1.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var _29=_1.getTarget(e);return (this.isValidHandleChild(_29)&&(this.id==this.handleElId||this.DDM.handleWasClicked(_29,this.id)));},addInvalidHandleType:function(_30){var _31=_30.toUpperCase();this.invalidHandleTypes[_31]=_31;},addInvalidHandleId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(_32){this.invalidHandleClasses.push(_32);},removeInvalidHandleType:function(_33){var _34=_33.toUpperCase();delete this.invalidHandleTypes[_34];},removeInvalidHandleId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(_35){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==_35){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(_37){var _38=true;var _39;try{_39=_37.nodeName.toUpperCase();}catch(e){_39=_37.nodeName;}_38=_38&&!this.invalidHandleTypes[_39];_38=_38&&!this.invalidHandleIds[_37.id];for(var i=0,len=this.invalidHandleClasses.length;_38&&i<len;++i){_38=!_2.hasClass(_37,this.invalidHandleClasses[i]);}return _38;},setXTicks:function(_40,_41){this.xTicks=[];this.xTickSize=_41;var _42={};for(var i=this.initPageX;i>=this.minX;i=i-_41){if(!_42[i]){this.xTicks[this.xTicks.length]=i;_42[i]=true;}}for(i=this.initPageX;i<=this.maxX;i=i+_41){if(!_42[i]){this.xTicks[this.xTicks.length]=i;_42[i]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(_43,_44){this.yTicks=[];this.yTickSize=_44;var _45={};for(var i=this.initPageY;i>=this.minY;i=i-_44){if(!_45[i]){this.yTicks[this.yTicks.length]=i;_45[i]=true;}}for(i=this.initPageY;i<=this.maxY;i=i+_44){if(!_45[i]){this.yTicks[this.yTicks.length]=i;_45[i]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(_46,_47,_48){this.leftConstraint=_46;this.rightConstraint=_47;this.minX=this.initPageX-_46;this.maxX=this.initPageX+_47;if(_48){this.setXTicks(this.initPageX,_48);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,_50,_51){this.topConstraint=iUp;this.bottomConstraint=_50;this.minY=this.initPageY-iUp;this.maxY=this.initPageY+_50;if(_51){this.setYTicks(this.initPageY,_51);}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,_53){if(!_53){return val;}else{if(_53[0]>=val){return _53[0];}else{for(var i=0,len=_53.length;i<len;++i){var _54=i+1;if(_53[_54]&&_53[_54]>=val){var _55=val-_53[i];var _56=_53[_54]-val;return (_56>_55)?_53[i]:_53[_54];}}return _53[_53.length-1];}}},toString:function(){return ("DragDrop "+this.id);}};})();if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var _57=YAHOO.util.Event;return {ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initalized:false,locked:false,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(_58,_59){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;}oDD[_58].apply(oDD,_59);}}},_onLoad:function(){this.init();_57.on(document,"mouseup",this.handleMouseUp,this,true);_57.on(document,"mousemove",this.handleMouseMove,this,true);_57.on(window,"unload",this._onUnload,this,true);_57.on(window,"resize",this._onResize,this,true);},_onResize:function(e){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(oDD,_61){if(!this.initialized){this.init();}if(!this.ids[_61]){this.ids[_61]={};}this.ids[_61][oDD.id]=oDD;},removeDDFromGroup:function(oDD,_62){if(!this.ids[_62]){this.ids[_62]={};}var obj=this.ids[_62];if(obj&&obj[oDD.id]){delete obj[oDD.id];}},_remove:function(oDD){for(var g in oDD.groups){if(g&&this.ids[g][oDD.id]){delete this.ids[g][oDD.id];}}delete this.handleIds[oDD.id];},regHandle:function(_65,_66){if(!this.handleIds[_65]){this.handleIds[_65]={};}this.handleIds[_65][_66]=_66;},isDragDrop:function(id){return (this.getDDById(id))?true:false;},getRelated:function(_67,_68){var _69=[];for(var i in _67.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}if(!_68||dd.isTarget){_69[_69.length]=dd;}}}return _69;},isLegalTarget:function(oDD,_71){var _72=this.getRelated(oDD,true);for(var i=0,len=_72.length;i<len;++i){if(_72[i].id==_71.id){return true;}}return false;},isTypeOfDD:function(oDD){return (oDD&&oDD.__ygDragDrop);},isHandle:function(_73,_74){return (this.handleIds[_73]&&this.handleIds[_73][_74]);},getDDById:function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}return null;},handleMouseDown:function(e,oDD){this.currentTarget=YAHOO.util.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=YAHOO.util.Event.getPageX(e);this.startY=YAHOO.util.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX,DDM.startY);},this.clickTimeThresh);},startDrag:function(x,y){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(x,y);this.dragCurrent.startDrag(x,y);}this.dragThreshMet=true;},handleMouseUp:function(e){if(!this.dragCurrent){return;}clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(e,true);}else{}this.stopDrag(e);this.stopEvent(e);},stopEvent:function(e){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(e);}if(this.preventDefault){YAHOO.util.Event.preventDefault(e);}},stopDrag:function(e){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}this.dragCurrent.onMouseUp(e);}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e){if(!this.dragCurrent){return true;}if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}if(!this.dragThreshMet){var _76=Math.abs(this.startX-YAHOO.util.Event.getPageX(e));var _77=Math.abs(this.startY-YAHOO.util.Event.getPageY(e));if(_76>this.clickPixelThresh||_77>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);this.fireEvents(e,false);}this.stopEvent(e);return true;},fireEvents:function(e,_78){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var _80=[];var _81=[];var _82=[];var _83=[];var _84=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}if(!this.isOverTarget(pt,ddo,this.mode)){_81.push(ddo);}_80[i]=true;delete this.dragOvers[i];}for(var _86 in dc.groups){if("string"!=typeof _86){continue;}for(i in this.ids[_86]){var oDD=this.ids[_86][i];if(!this.isTypeOfDD(oDD)){continue;}if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode)){if(_78){_83.push(oDD);}else{if(!_80[oDD.id]){_84.push(oDD);}else{_82.push(oDD);}this.dragOvers[oDD.id]=oDD;}}}}}if(this.mode){if(_81.length){dc.b4DragOut(e,_81);dc.onDragOut(e,_81);}if(_84.length){dc.onDragEnter(e,_84);}if(_82.length){dc.b4DragOver(e,_82);dc.onDragOver(e,_82);}if(_83.length){dc.b4DragDrop(e,_83);dc.onDragDrop(e,_83);}}else{var len=0;for(i=0,len=_81.length;i<len;++i){dc.b4DragOut(e,_81[i].id);dc.onDragOut(e,_81[i].id);}for(i=0,len=_84.length;i<len;++i){dc.onDragEnter(e,_84[i].id);}for(i=0,len=_82.length;i<len;++i){dc.b4DragOver(e,_82[i].id);dc.onDragOver(e,_82[i].id);}for(i=0,len=_83.length;i<len;++i){dc.b4DragDrop(e,_83[i].id);dc.onDragDrop(e,_83[i].id);}}if(_78&&!_83.length){dc.onInvalidDrop(e);}},getBestMatch:function(dds){var _89=null;var len=dds.length;if(len==1){_89=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(dd.cursorIsOver){_89=dd;break;}else{if(!_89||_89.overlap.getArea()<dd.overlap.getArea()){_89=dd;}}}}return _89;},refreshCache:function(_90){for(var _91 in _90){if("string"!=typeof _91){continue;}for(var i in this.ids[_91]){var oDD=this.ids[_91][i];if(this.isTypeOfDD(oDD)){var loc=this.getLocation(oDD);if(loc){this.locationCache[oDD.id]=loc;}else{delete this.locationCache[oDD.id];}}}}},verifyEl:function(el){try{if(el){var _93=el.offsetParent;if(_93){return true;}}}catch(e){}return false;},getLocation:function(oDD){if(!this.isTypeOfDD(oDD)){return null;}var el=oDD.getEl(),pos,x1,x2,y1,y2,t,r,b,l;try{pos=YAHOO.util.Dom.getXY(el);}catch(e){}if(!pos){return null;}x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);},isOverTarget:function(pt,_94,_95){var loc=this.locationCache[_94.id];if(!loc||!this.useCache){loc=this.getLocation(_94);this.locationCache[_94.id]=loc;}if(!loc){return false;}_94.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||!dc.getTargetCoord||(!_95&&!dc.constrainX&&!dc.constrainY)){return _94.cursorIsOver;}_94.overlap=null;var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();var _96=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var _97=_96.intersect(loc);if(_97){_94.overlap=_97;return (_95)?true:_94.cursorIsOver;}else{return false;}},_onUnload:function(e,me){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);for(i in this.elementCache){delete this.elementCache[i];}this.elementCache={};this.ids={};},elementCache:{},getElWrapper:function(id){var _99=this.elementCache[id];if(!_99||!_99.el){_99=this.elementCache[id]=new this.ElementWrapper(YAHOO.util.Dom.get(id));}return _99;},getElement:function(id){return YAHOO.util.Dom.get(id);},getCss:function(id){var el=YAHOO.util.Dom.get(id);return (el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return YAHOO.util.Dom.getX(el);},getPosY:function(el){return YAHOO.util.Dom.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else{if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}}},getScroll:function(){var t,l,dde=document.documentElement,db=document.body;if(dde&&(dde.scrollTop||dde.scrollLeft)){t=dde.scrollTop;l=dde.scrollLeft;}else{if(db){t=db.scrollTop;l=db.scrollLeft;}else{YAHOO.log("could not get scroll property");}}return {top:t,left:l};},getStyle:function(el,_104){return YAHOO.util.Dom.getStyle(el,_104);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(_105,_106){var _107=YAHOO.util.Dom.getXY(_106);YAHOO.util.Dom.setXY(_105,_107);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(a,b){return (a-b);},_timeoutCount:0,_addListeners:function(){var DDM=YAHOO.util.DDM;if(YAHOO.util.Event&&document){DDM._onLoad();}else{if(DDM._timeoutCount>2000){}else{setTimeout(DDM._addListeners,10);if(document&&document.body){DDM._timeoutCount+=1;}}}},handleWasClicked:function(node,id){if(this.isHandle(id,node.id)){return true;}else{var p=node.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}YAHOO.util.DD=function(id,_111,_112){if(id){this.init(id,_111,_112);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(_113,_114){var x=_113-this.startPageX;var y=_114-this.startPageY;this.setDelta(x,y);},setDelta:function(_115,_116){this.deltaX=_115;this.deltaY=_116;},setDragElPos:function(_117,_118){var el=this.getDragEl();this.alignElWithMouse(el,_117,_118);},alignElWithMouse:function(el,_119,_120){var _121=this.getTargetCoord(_119,_120);if(!this.deltaSetXY){var _122=[_121.x,_121.y];YAHOO.util.Dom.setXY(el,_122);var _123=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var _124=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[_123-_121.x,_124-_121.y];}else{YAHOO.util.Dom.setStyle(el,"left",(_121.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(_121.y+this.deltaSetXY[1])+"px");}this.cachePosition(_121.x,_121.y);this.autoScroll(_121.x,_121.y,el.offsetHeight,el.offsetWidth);},cachePosition:function(_125,_126){if(_125){this.lastPageX=_125;this.lastPageY=_126;}else{var _127=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=_127[0];this.lastPageY=_127[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var _130=this.DDM.getClientHeight();var _131=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var _135=w+x;var _136=(_130+st-y-this.deltaY);var _137=(_131+sl-x-this.deltaX);var _138=40;var _139=(document.all)?80:30;if(bot>_130&&_136<_138){window.scrollTo(sl,st+_139);}if(y<st&&st>0&&y-st<_138){window.scrollTo(sl,st-_139);}if(_135>_131&&_137<_138){window.scrollTo(sl+_139,st);}if(x<sl&&sl>0&&x-sl<_138){window.scrollTo(sl-_139,st);}}},getTargetCoord:function(_140,_141){var x=_140-this.deltaX;var y=_141-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}if(x>this.maxX){x=this.maxX;}}if(this.constrainY){if(y<this.minY){y=this.minY;}if(y>this.maxY){y=this.maxY;}}x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return {x:x,y:y};},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){this.autoOffset(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},b4Drag:function(e){this.setDragElPos(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},toString:function(){return ("DD "+this.id);}});YAHOO.util.DDProxy=function(id,_142,_143){if(id){this.init(id,_142,_143);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this;var body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}var div=this.getDragEl();if(!div){div=document.createElement("div");div.id=this.dragElId;var s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;body.insertBefore(div,body.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(_147,_148){var el=this.getEl();var _149=this.getDragEl();var s=_149.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}this.setDragElPos(_147,_148);YAHOO.util.Dom.setStyle(_149,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var DOM=YAHOO.util.Dom;var el=this.getEl();var _151=this.getDragEl();var bt=parseInt(DOM.getStyle(_151,"borderTopWidth"),10);var br=parseInt(DOM.getStyle(_151,"borderRightWidth"),10);var bb=parseInt(DOM.getStyle(_151,"borderBottomWidth"),10);var bl=parseInt(DOM.getStyle(_151,"borderLeftWidth"),10);if(isNaN(bt)){bt=0;}if(isNaN(br)){br=0;}if(isNaN(bb)){bb=0;}if(isNaN(bl)){bl=0;}var _156=Math.max(0,el.offsetWidth-br-bl);var _157=Math.max(0,el.offsetHeight-bt-bb);DOM.setStyle(_151,"width",_156+"px");DOM.setStyle(_151,"height",_157+"px");}},b4MouseDown:function(e){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);this.setDragElPos(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(e){var DOM=YAHOO.util.Dom;var lel=this.getEl();var del=this.getDragEl();DOM.setStyle(del,"visibility","");DOM.setStyle(lel,"visibility","hidden");YAHOO.util.DDM.moveToEl(lel,del);DOM.setStyle(del,"visibility","hidden");DOM.setStyle(lel,"visibility","");},toString:function(){return ("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(id,_160,_161){if(id){this.initTarget(id,_160,_161);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return ("DDTarget "+this.id);}});
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.1 */\r
+(function(){var Event=YAHOO.util.Event;var Dom=YAHOO.util.Dom;YAHOO.util.DragDrop=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=Dom.get(this.id);}\r
+return this._domRef;},getDragEl:function(){return Dom.get(this.dragElId);},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);Event.on(this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,sGroup,config){this.config=config||{};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.generateId(id);}\r
+this.id=id;this.addToGroup((sGroup)?sGroup:"default");this.handleElId=id;Event.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(iTop,iRight,iBot,iLeft){if(!iRight&&0!==iRight){this.padding=[iTop,iTop,iTop,iTop];}else if(!iBot&&0!==iBot){this.padding=[iTop,iRight,iTop,iRight];}else{this.padding=[iTop,iRight,iBot,iLeft];}},setInitPosition:function(diffX,diffY){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}\r
+var dx=diffX||0;var dy=diffY||0;var p=Dom.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||Dom.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(sGroup){this.groups[sGroup]=true;this.DDM.regDragDrop(this,sGroup);},removeFromGroup:function(sGroup){if(this.groups[sGroup]){delete this.groups[sGroup];}\r
+this.DDM.removeDDFromGroup(this,sGroup);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.generateId(id);}\r
+this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.generateId(id);}\r
+Event.on(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){Event.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var button=e.which||e.button;if(this.primaryButtonOnly&&button>1){return;}\r
+if(this.isLocked()){return;}\r
+this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(Event.getPageX(e),Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var target=Event.getTarget(e);return(this.isValidHandleChild(target)&&(this.id==this.handleElId||this.DDM.handleWasClicked(target,this.id)));},addInvalidHandleType:function(tagName){var type=tagName.toUpperCase();this.invalidHandleTypes[type]=type;},addInvalidHandleId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.generateId(id);}\r
+this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(cssClass){this.invalidHandleClasses.push(cssClass);},removeInvalidHandleType:function(tagName){var type=tagName.toUpperCase();delete this.invalidHandleTypes[type];},removeInvalidHandleId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.generateId(id);}\r
+delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(cssClass){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==cssClass){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(node){var valid=true;var nodeName;try{nodeName=node.nodeName.toUpperCase();}catch(e){nodeName=node.nodeName;}\r
+valid=valid&&!this.invalidHandleTypes[nodeName];valid=valid&&!this.invalidHandleIds[node.id];for(var i=0,len=this.invalidHandleClasses.length;valid&&i<len;++i){valid=!Dom.hasClass(node,this.invalidHandleClasses[i]);}\r
+return valid;},setXTicks:function(iStartX,iTickSize){this.xTicks=[];this.xTickSize=iTickSize;var tickMap={};for(var i=this.initPageX;i>=this.minX;i=i-iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}\r
+for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}\r
+this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(iStartY,iTickSize){this.yTicks=[];this.yTickSize=iTickSize;var tickMap={};for(var i=this.initPageY;i>=this.minY;i=i-iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}\r
+for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}\r
+this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(iLeft,iRight,iTickSize){this.leftConstraint=iLeft;this.rightConstraint=iRight;this.minX=this.initPageX-iLeft;this.maxX=this.initPageX+iRight;if(iTickSize){this.setXTicks(this.initPageX,iTickSize);}\r
+this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,iDown,iTickSize){this.topConstraint=iUp;this.bottomConstraint=iDown;this.minY=this.initPageY-iUp;this.maxY=this.initPageY+iDown;if(iTickSize){this.setYTicks(this.initPageY,iTickSize);}\r
+this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}\r
+if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}\r
+if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,tickArray){if(!tickArray){return val;}else if(tickArray[0]>=val){return tickArray[0];}else{for(var i=0,len=tickArray.length;i<len;++i){var next=i+1;if(tickArray[next]&&tickArray[next]>=val){var diff1=val-tickArray[i];var diff2=tickArray[next]-val;return(diff2>diff1)?tickArray[i]:tickArray[next];}}\r
+return tickArray[tickArray.length-1];}},toString:function(){return("DragDrop "+this.id);}};})();if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var Event=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initalized:false,locked:false,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(sMethod,args){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;}\r
+oDD[sMethod].apply(oDD,args);}}},_onLoad:function(){this.init();Event.on(document,"mouseup",this.handleMouseUp,this,true);Event.on(document,"mousemove",this.handleMouseMove,this,true);Event.on(window,"unload",this._onUnload,this,true);Event.on(window,"resize",this._onResize,this,true);},_onResize:function(e){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(oDD,sGroup){if(!this.initialized){this.init();}\r
+if(!this.ids[sGroup]){this.ids[sGroup]={};}\r
+this.ids[sGroup][oDD.id]=oDD;},removeDDFromGroup:function(oDD,sGroup){if(!this.ids[sGroup]){this.ids[sGroup]={};}\r
+var obj=this.ids[sGroup];if(obj&&obj[oDD.id]){delete obj[oDD.id];}},_remove:function(oDD){for(var g in oDD.groups){if(g&&this.ids[g][oDD.id]){delete this.ids[g][oDD.id];}}\r
+delete this.handleIds[oDD.id];},regHandle:function(sDDId,sHandleId){if(!this.handleIds[sDDId]){this.handleIds[sDDId]={};}\r
+this.handleIds[sDDId][sHandleId]=sHandleId;},isDragDrop:function(id){return(this.getDDById(id))?true:false;},getRelated:function(p_oDD,bTargetsOnly){var oDDs=[];for(var i in p_oDD.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}\r
+if(!bTargetsOnly||dd.isTarget){oDDs[oDDs.length]=dd;}}}\r
+return oDDs;},isLegalTarget:function(oDD,oTargetDD){var targets=this.getRelated(oDD,true);for(var i=0,len=targets.length;i<len;++i){if(targets[i].id==oTargetDD.id){return true;}}\r
+return false;},isTypeOfDD:function(oDD){return(oDD&&oDD.__ygDragDrop);},isHandle:function(sDDId,sHandleId){return(this.handleIds[sDDId]&&this.handleIds[sDDId][sHandleId]);},getDDById:function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}\r
+return null;},handleMouseDown:function(e,oDD){this.currentTarget=YAHOO.util.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=YAHOO.util.Event.getPageX(e);this.startY=YAHOO.util.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX,DDM.startY);},this.clickTimeThresh);},startDrag:function(x,y){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(x,y);this.dragCurrent.startDrag(x,y);}\r
+this.dragThreshMet=true;},handleMouseUp:function(e){if(!this.dragCurrent){return;}\r
+clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(e,true);}else{}\r
+this.stopDrag(e);this.stopEvent(e);},stopEvent:function(e){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(e);}\r
+if(this.preventDefault){YAHOO.util.Event.preventDefault(e);}},stopDrag:function(e){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}\r
+this.dragCurrent.onMouseUp(e);}\r
+this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e){if(!this.dragCurrent){return true;}\r
+if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}\r
+if(!this.dragThreshMet){var diffX=Math.abs(this.startX-YAHOO.util.Event.getPageX(e));var diffY=Math.abs(this.startY-YAHOO.util.Event.getPageY(e));if(diffX>this.clickPixelThresh||diffY>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}\r
+if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);this.fireEvents(e,false);}\r
+this.stopEvent(e);return true;},fireEvents:function(e,isDrop){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}\r
+var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var oldOvers=[];var outEvts=[];var overEvts=[];var dropEvts=[];var enterEvts=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}\r
+if(!this.isOverTarget(pt,ddo,this.mode)){outEvts.push(ddo);}\r
+oldOvers[i]=true;delete this.dragOvers[i];}\r
+for(var sGroup in dc.groups){if("string"!=typeof sGroup){continue;}\r
+for(i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(!this.isTypeOfDD(oDD)){continue;}\r
+if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode)){if(isDrop){dropEvts.push(oDD);}else{if(!oldOvers[oDD.id]){enterEvts.push(oDD);}else{overEvts.push(oDD);}\r
+this.dragOvers[oDD.id]=oDD;}}}}}\r
+if(this.mode){if(outEvts.length){dc.b4DragOut(e,outEvts);dc.onDragOut(e,outEvts);}\r
+if(enterEvts.length){dc.onDragEnter(e,enterEvts);}\r
+if(overEvts.length){dc.b4DragOver(e,overEvts);dc.onDragOver(e,overEvts);}\r
+if(dropEvts.length){dc.b4DragDrop(e,dropEvts);dc.onDragDrop(e,dropEvts);}}else{var len=0;for(i=0,len=outEvts.length;i<len;++i){dc.b4DragOut(e,outEvts[i].id);dc.onDragOut(e,outEvts[i].id);}\r
+for(i=0,len=enterEvts.length;i<len;++i){dc.onDragEnter(e,enterEvts[i].id);}\r
+for(i=0,len=overEvts.length;i<len;++i){dc.b4DragOver(e,overEvts[i].id);dc.onDragOver(e,overEvts[i].id);}\r
+for(i=0,len=dropEvts.length;i<len;++i){dc.b4DragDrop(e,dropEvts[i].id);dc.onDragDrop(e,dropEvts[i].id);}}\r
+if(isDrop&&!dropEvts.length){dc.onInvalidDrop(e);}},getBestMatch:function(dds){var winner=null;var len=dds.length;if(len==1){winner=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(this.mode==this.INTERSECT&&dd.cursorIsOver){winner=dd;break;}else{if(!winner||!winner.overlap||(dd.overlap&&winner.overlap.getArea()<dd.overlap.getArea())){winner=dd;}}}}\r
+return winner;},refreshCache:function(groups){for(var sGroup in groups){if("string"!=typeof sGroup){continue;}\r
+for(var i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(this.isTypeOfDD(oDD)){var loc=this.getLocation(oDD);if(loc){this.locationCache[oDD.id]=loc;}else{delete this.locationCache[oDD.id];}}}}},verifyEl:function(el){try{if(el){var parent=el.offsetParent;if(parent){return true;}}}catch(e){}\r
+return false;},getLocation:function(oDD){if(!this.isTypeOfDD(oDD)){return null;}\r
+var el=oDD.getEl(),pos,x1,x2,y1,y2,t,r,b,l;try{pos=YAHOO.util.Dom.getXY(el);}catch(e){}\r
+if(!pos){return null;}\r
+x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);},isOverTarget:function(pt,oTarget,intersect){var loc=this.locationCache[oTarget.id];if(!loc||!this.useCache){loc=this.getLocation(oTarget);this.locationCache[oTarget.id]=loc;}\r
+if(!loc){return false;}\r
+oTarget.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||!dc.getTargetCoord||(!intersect&&!dc.constrainX&&!dc.constrainY)){return oTarget.cursorIsOver;}\r
+oTarget.overlap=null;var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();var curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var overlap=curRegion.intersect(loc);if(overlap){oTarget.overlap=overlap;return(intersect)?true:oTarget.cursorIsOver;}else{return false;}},_onUnload:function(e,me){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}\r
+this._execOnAll("unreg",[]);for(i in this.elementCache){delete this.elementCache[i];}\r
+this.elementCache={};this.ids={};},elementCache:{},getElWrapper:function(id){var oWrapper=this.elementCache[id];if(!oWrapper||!oWrapper.el){oWrapper=this.elementCache[id]=new this.ElementWrapper(YAHOO.util.Dom.get(id));}\r
+return oWrapper;},getElement:function(id){return YAHOO.util.Dom.get(id);},getCss:function(id){var el=YAHOO.util.Dom.get(id);return(el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return YAHOO.util.Dom.getX(el);},getPosY:function(el){return YAHOO.util.Dom.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}},getScroll:function(){var t,l,dde=document.documentElement,db=document.body;if(dde&&(dde.scrollTop||dde.scrollLeft)){t=dde.scrollTop;l=dde.scrollLeft;}else if(db){t=db.scrollTop;l=db.scrollLeft;}else{YAHOO.log("could not get scroll property");}\r
+return{top:t,left:l};},getStyle:function(el,styleProp){return YAHOO.util.Dom.getStyle(el,styleProp);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(moveEl,targetEl){var aCoord=YAHOO.util.Dom.getXY(targetEl);YAHOO.util.Dom.setXY(moveEl,aCoord);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(a,b){return(a-b);},_timeoutCount:0,_addListeners:function(){var DDM=YAHOO.util.DDM;if(YAHOO.util.Event&&document){DDM._onLoad();}else{if(DDM._timeoutCount>2000){}else{setTimeout(DDM._addListeners,10);if(document&&document.body){DDM._timeoutCount+=1;}}}},handleWasClicked:function(node,id){if(this.isHandle(id,node.id)){return true;}else{var p=node.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}}\r
+return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}\r
+YAHOO.util.DD=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(iPageX,iPageY){var x=iPageX-this.startPageX;var y=iPageY-this.startPageY;this.setDelta(x,y);},setDelta:function(iDeltaX,iDeltaY){this.deltaX=iDeltaX;this.deltaY=iDeltaY;},setDragElPos:function(iPageX,iPageY){var el=this.getDragEl();this.alignElWithMouse(el,iPageX,iPageY);},alignElWithMouse:function(el,iPageX,iPageY){var oCoord=this.getTargetCoord(iPageX,iPageY);if(!this.deltaSetXY){var aCoord=[oCoord.x,oCoord.y];YAHOO.util.Dom.setXY(el,aCoord);var newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[newLeft-oCoord.x,newTop-oCoord.y];}else{YAHOO.util.Dom.setStyle(el,"left",(oCoord.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(oCoord.y+this.deltaSetXY[1])+"px");}\r
+this.cachePosition(oCoord.x,oCoord.y);this.autoScroll(oCoord.x,oCoord.y,el.offsetHeight,el.offsetWidth);},cachePosition:function(iPageX,iPageY){if(iPageX){this.lastPageX=iPageX;this.lastPageY=iPageY;}else{var aCoord=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var clientH=this.DDM.getClientHeight();var clientW=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot<thresh){window.scrollTo(sl,st+scrAmt);}\r
+if(y<st&&st>0&&y-st<thresh){window.scrollTo(sl,st-scrAmt);}\r
+if(right>clientW&&toRight<thresh){window.scrollTo(sl+scrAmt,st);}\r
+if(x<sl&&sl>0&&x-sl<thresh){window.scrollTo(sl-scrAmt,st);}}},getTargetCoord:function(iPageX,iPageY){var x=iPageX-this.deltaX;var y=iPageY-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}\r
+if(x>this.maxX){x=this.maxX;}}\r
+if(this.constrainY){if(y<this.minY){y=this.minY;}\r
+if(y>this.maxY){y=this.maxY;}}\r
+x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){this.autoOffset(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},b4Drag:function(e){this.setDragElPos(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(id,sGroup,config){if(id){this.init(id,sGroup,config);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this;var body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}\r
+var div=this.getDragEl();if(!div){div=document.createElement("div");div.id=this.dragElId;var s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;body.insertBefore(div,body.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(iPageX,iPageY){var el=this.getEl();var dragEl=this.getDragEl();var s=dragEl.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}\r
+this.setDragElPos(iPageX,iPageY);YAHOO.util.Dom.setStyle(dragEl,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var DOM=YAHOO.util.Dom;var el=this.getEl();var dragEl=this.getDragEl();var bt=parseInt(DOM.getStyle(dragEl,"borderTopWidth"),10);var br=parseInt(DOM.getStyle(dragEl,"borderRightWidth"),10);var bb=parseInt(DOM.getStyle(dragEl,"borderBottomWidth"),10);var bl=parseInt(DOM.getStyle(dragEl,"borderLeftWidth"),10);if(isNaN(bt)){bt=0;}\r
+if(isNaN(br)){br=0;}\r
+if(isNaN(bb)){bb=0;}\r
+if(isNaN(bl)){bl=0;}\r
+var newWidth=Math.max(0,el.offsetWidth-br-bl);var newHeight=Math.max(0,el.offsetHeight-bt-bb);DOM.setStyle(dragEl,"width",newWidth+"px");DOM.setStyle(dragEl,"height",newHeight+"px");}},b4MouseDown:function(e){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);this.setDragElPos(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(e){var DOM=YAHOO.util.Dom;var lel=this.getEl();var del=this.getDragEl();DOM.setStyle(del,"visibility","");DOM.setStyle(lel,"visibility","hidden");YAHOO.util.DDM.moveToEl(lel,del);DOM.setStyle(del,"visibility","hidden");DOM.setStyle(lel,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(id,sGroup,config){if(id){this.initTarget(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});
\ No newline at end of file
-/*\r
+/* \r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
-*/\r
-\r
+version: 0.12.1\r
+*/ \r
(function() {\r
\r
-var Event=YAHOO.util.Event;\r
+var Event=YAHOO.util.Event; \r
var Dom=YAHOO.util.Dom;\r
\r
/**\r
- * Defines the interface and base operation of items that that can be\r
+ * Defines the interface and base operation of items that that can be \r
* dragged or can be drop targets. It was designed to be extended, overriding\r
* the event handlers for startDrag, onDrag, onDragOver, onDragOut.\r
* Up to three html elements can be associated with a DragDrop instance:\r
* <ul>\r
* <li>linked element: the element that is passed into the constructor.\r
- * This is the element which defines the boundaries for interaction with\r
+ * This is the element which defines the boundaries for interaction with \r
* other DragDrop objects.</li>\r
- * <li>handle element(s): The drag operation only occurs if the element that\r
- * was clicked matches a handle element. By default this is the linked\r
- * element, but there are times that you will want only a portion of the\r
- * linked element to initiate the drag operation, and the setHandleElId()\r
+ * <li>handle element(s): The drag operation only occurs if the element that \r
+ * was clicked matches a handle element. By default this is the linked \r
+ * element, but there are times that you will want only a portion of the \r
+ * linked element to initiate the drag operation, and the setHandleElId() \r
* method provides a way to define this.</li>\r
* <li>drag element: this represents an the element that would be moved along\r
* with the cursor during a drag operation. By default, this is the linked\r
* </ul>\r
* This class should not be instantiated until the onload event to ensure that\r
* the associated elements are available.\r
- * The following would define a DragDrop obj that would interact with any\r
+ * The following would define a DragDrop obj that would interact with any \r
* other DragDrop obj in the "group1" group:\r
* <pre>\r
* dd = new YAHOO.util.DragDrop("div1", "group1");\r
* </pre>\r
- * Since none of the event handlers have been implemented, nothing would\r
- * actually happen if you were to run the code above. Normally you would\r
- * override this class or one of the default implementations, but you can\r
+ * Since none of the event handlers have been implemented, nothing would \r
+ * actually happen if you were to run the code above. Normally you would \r
+ * override this class or one of the default implementations, but you can \r
* also override the methods you want on an instance of the class...\r
* <pre>\r
* dd.onDragDrop = function(e, id) {\r
* @param {String} id of the element that is linked to this instance\r
* @param {String} sGroup the group of related DragDrop objects\r
* @param {object} config an object containing configurable attributes\r
- * Valid properties for DragDrop:\r
- * padding, isTarget, maintainOffset, primaryButtonOnly\r
+ * Valid properties for DragDrop: \r
+ * padding, isTarget, maintainOffset, primaryButtonOnly,\r
*/\r
YAHOO.util.DragDrop = function(id, sGroup, config) {\r
if (id) {\r
- this.init(id, sGroup, config);\r
+ this.init(id, sGroup, config); \r
}\r
};\r
\r
YAHOO.util.DragDrop.prototype = {\r
\r
/**\r
- * The id of the element associated with this object. This is what we\r
- * refer to as the "linked element" because the size and position of\r
- * this element is used to determine when the drag and drop objects have\r
+ * The id of the element associated with this object. This is what we \r
+ * refer to as the "linked element" because the size and position of \r
+ * this element is used to determine when the drag and drop objects have \r
* interacted.\r
* @property id\r
* @type String\r
config: null,\r
\r
/**\r
- * The id of the element that will be dragged. By default this is same\r
- * as the linked element , but could be changed to another element. Ex:\r
+ * The id of the element that will be dragged. By default this is same \r
+ * as the linked element , but could be changed to another element. Ex: \r
* YAHOO.util.DDProxy\r
* @property dragElId\r
* @type String\r
* @private\r
*/\r
- dragElId: null,\r
+ dragElId: null, \r
\r
/**\r
- * the id of the element that initiates the drag operation. By default\r
+ * the id of the element that initiates the drag operation. By default \r
* this is the linked element, but could be changed to be a child of this\r
- * element. This lets us do things like only starting the drag when the\r
+ * element. This lets us do things like only starting the drag when the \r
* header element within the linked html element is clicked.\r
* @property handleElId\r
* @type String\r
* @private\r
*/\r
- handleElId: null,\r
+ handleElId: null, \r
\r
/**\r
* An associative array of HTML tags that will be ignored if clicked.\r
* @property invalidHandleTypes\r
* @type {string: string}\r
*/\r
- invalidHandleTypes: null,\r
+ invalidHandleTypes: null, \r
\r
/**\r
* An associative array of ids for elements that will be ignored if clicked\r
* @property invalidHandleIds\r
* @type {string: string}\r
*/\r
- invalidHandleIds: null,\r
+ invalidHandleIds: null, \r
\r
/**\r
* An indexted array of css class names for elements that will be ignored\r
* @property invalidHandleClasses\r
* @type string[]\r
*/\r
- invalidHandleClasses: null,\r
+ invalidHandleClasses: null, \r
\r
/**\r
- * The linked element's absolute X position at the time the drag was\r
+ * The linked element's absolute X position at the time the drag was \r
* started\r
* @property startPageX\r
* @type int\r
startPageX: 0,\r
\r
/**\r
- * The linked element's absolute X position at the time the drag was\r
+ * The linked element's absolute X position at the time the drag was \r
* started\r
* @property startPageY\r
* @type int\r
startPageY: 0,\r
\r
/**\r
- * The group defines a logical collection of DragDrop objects that are\r
- * related. Instances only get events when interacting with other\r
- * DragDrop object in the same group. This lets us define multiple\r
+ * The group defines a logical collection of DragDrop objects that are \r
+ * related. Instances only get events when interacting with other \r
+ * DragDrop object in the same group. This lets us define multiple \r
* groups using a single DragDrop subclass if we want.\r
* @property groups\r
* @type {string: string}\r
groups: null,\r
\r
/**\r
- * Individual drag/drop instances can be locked. This will prevent\r
+ * Individual drag/drop instances can be locked. This will prevent \r
* onmousedown start drag.\r
* @property locked\r
* @type boolean\r
maxX: 0,\r
\r
/**\r
- * The up constraint\r
+ * The up constraint \r
* @property minY\r
* @type int\r
* @type int\r
minY: 0,\r
\r
/**\r
- * The down constraint\r
+ * The down constraint \r
* @property maxY\r
* @type int\r
* @private\r
maintainOffset: false,\r
\r
/**\r
- * Array of pixel locations the element will snap to if we specified a\r
+ * Array of pixel locations the element will snap to if we specified a \r
* horizontal graduation/interval. This array is generated automatically\r
* when you define a tick interval.\r
* @property xTicks\r
xTicks: null,\r
\r
/**\r
- * Array of pixel locations the element will snap to if we specified a\r
- * vertical graduation/interval. This array is generated automatically\r
+ * Array of pixel locations the element will snap to if we specified a \r
+ * vertical graduation/interval. This array is generated automatically \r
* when you define a tick interval.\r
* @property yTicks\r
* @type int[]\r
b4Drag: function(e) { },\r
\r
/**\r
- * Abstract method called during the onMouseMove event while dragging an\r
+ * Abstract method called during the onMouseMove event while dragging an \r
* object.\r
* @method onDrag\r
* @param {Event} e the mousemove event\r
onDrag: function(e) { /* override this */ },\r
\r
/**\r
- * Abstract method called when this element fist begins hovering over\r
+ * Abstract method called when this element fist begins hovering over \r
* another DragDrop obj\r
* @method onDragEnter\r
* @param {Event} e the mousemove event\r
* @param {String|DragDrop[]} id In POINT mode, the element\r
- * id this is hovering over. In INTERSECT mode, an array of one or more\r
+ * id this is hovering over. In INTERSECT mode, an array of one or more \r
* dragdrop items being hovered over.\r
*/\r
onDragEnter: function(e, id) { /* override this */ },\r
b4DragOver: function(e) { },\r
\r
/**\r
- * Abstract method called when this element is hovering over another\r
+ * Abstract method called when this element is hovering over another \r
* DragDrop obj\r
* @method onDragOver\r
* @param {Event} e the mousemove event\r
* @param {String|DragDrop[]} id In POINT mode, the element\r
- * id this is hovering over. In INTERSECT mode, an array of dd items\r
+ * id this is hovering over. In INTERSECT mode, an array of dd items \r
* being hovered over.\r
*/\r
onDragOver: function(e, id) { /* override this */ },\r
* @method onDragOut\r
* @param {Event} e the mousemove event\r
* @param {String|DragDrop[]} id In POINT mode, the element\r
- * id this was hovering over. In INTERSECT mode, an array of dd items\r
+ * id this was hovering over. In INTERSECT mode, an array of dd items \r
* that the mouse is no longer over.\r
*/\r
onDragOut: function(e, id) { /* override this */ },\r
b4DragDrop: function(e) { },\r
\r
/**\r
- * Abstract method called when this item is dropped on another DragDrop\r
+ * Abstract method called when this item is dropped on another DragDrop \r
* obj\r
* @method onDragDrop\r
* @param {Event} e the mouseup event\r
* @param {String|DragDrop[]} id In POINT mode, the element\r
- * id this was dropped on. In INTERSECT mode, an array of dd items this\r
+ * id this was dropped on. In INTERSECT mode, an array of dd items this \r
* was dropped on.\r
*/\r
onDragDrop: function(e, id) { /* override this */ },\r
* @param {Event} e the mouseup event\r
*/\r
onMouseUp: function(e) { /* override this */ },\r
-\r
+ \r
/**\r
* Override the onAvailable method to do what is needed after the initial\r
* position was determined.\r
* @method onAvailable\r
*/\r
- onAvailable: function () {\r
+ onAvailable: function () { \r
},\r
\r
/**\r
* Returns a reference to the linked element\r
* @method getEl\r
- * @return {HTMLElement} the html element\r
+ * @return {HTMLElement} the html element \r
*/\r
- getEl: function() {\r
+ getEl: function() { \r
if (!this._domRef) {\r
- this._domRef = Dom.get(this.id);\r
+ this._domRef = Dom.get(this.id); \r
}\r
\r
return this._domRef;\r
\r
/**\r
* Returns a reference to the actual element to drag. By default this is\r
- * the same as the html element, but it can be assigned to another\r
+ * the same as the html element, but it can be assigned to another \r
* element. An example of this can be found in YAHOO.util.DDProxy\r
* @method getDragEl\r
- * @return {HTMLElement} the html element\r
+ * @return {HTMLElement} the html element \r
*/\r
getDragEl: function() {\r
return Dom.get(this.dragElId);\r
*/\r
initTarget: function(id, sGroup, config) {\r
\r
- // configuration attributes\r
+ // configuration attributes \r
this.config = config || {};\r
\r
// create a local reference to the drag and drop manager\r
\r
\r
// the linked element is the element that gets dragged by default\r
- this.setDragElId(id);\r
+ this.setDragElId(id); \r
\r
- // by default, clicked anchors will not start drag operations.\r
+ // by default, clicked anchors will not start drag operations. \r
// @TODO what else should be here? Probably form fields.\r
this.invalidHandleTypes = { A: "A" };\r
this.invalidHandleIds = {};\r
/**\r
* Applies the configuration parameters that were passed into the constructor.\r
* This is supposed to happen at each level through the inheritance chain. So\r
- * a DDProxy implentation will execute apply config on DDProxy, DD, and\r
+ * a DDProxy implentation will execute apply config on DDProxy, DD, and \r
* DragDrop in order to get all of the parameters that are available in\r
* each object.\r
* @method applyConfig\r
*/\r
applyConfig: function() {\r
\r
- // configurable properties:\r
+ // configurable properties: \r
// padding, isTarget, maintainOffset, primaryButtonOnly\r
this.padding = this.config.padding || [0, 0, 0, 0];\r
this.isTarget = (this.config.isTarget !== false);\r
\r
/**\r
* Configures the padding for the target zone in px. Effectively expands\r
- * (or reduces) the virtual object size for targeting calculations.\r
+ * (or reduces) the virtual object size for targeting calculations. \r
* Supports css-style shorthand; if only one parameter is passed, all sides\r
* will have that padding, and if only two are passed, the top and bottom\r
* will have the first param, the left and right the second.\r
*/\r
setStartPosition: function(pos) {\r
var p = pos || Dom.getXY( this.getEl() );\r
+\r
this.deltaSetXY = null;\r
\r
this.startPageX = p[0];\r
},\r
\r
/**\r
- * Add this instance to a group of related drag/drop objects. All\r
- * instances belong to at least one group, and can belong to as many\r
+ * Add this instance to a group of related drag/drop objects. All \r
+ * instances belong to at least one group, and can belong to as many \r
* groups as needed.\r
* @method addToGroup\r
* @param sGroup {string} the name of the group\r
},\r
\r
/**\r
- * Allows you to specify that an element other than the linked element\r
+ * Allows you to specify that an element other than the linked element \r
* will be moved with the cursor during a drag\r
* @method setDragElId\r
* @param id {string} the id of the element that will be used to initiate the drag\r
},\r
\r
/**\r
- * Allows you to specify a child of the linked element that should be\r
- * used to initiate the drag operation. An example of this would be if\r
- * you have a content div with text and links. Clicking anywhere in the\r
+ * Allows you to specify a child of the linked element that should be \r
+ * used to initiate the drag operation. An example of this would be if \r
+ * you have a content div with text and links. Clicking anywhere in the \r
* content area would normally start the drag operation. Use this method\r
- * to specify that an element inside of the content div is the element\r
+ * to specify that an element inside of the content div is the element \r
* that starts the drag operation.\r
* @method setHandleElId\r
- * @param id {string} the id of the element that will be used to\r
+ * @param id {string} the id of the element that will be used to \r
* initiate the drag.\r
*/\r
setHandleElId: function(id) {\r
},\r
\r
/**\r
- * Allows you to set an element outside of the linked element as a drag\r
+ * Allows you to set an element outside of the linked element as a drag \r
* handle\r
* @method setOuterHandleElId\r
* @param id the id of the element that will be used to initiate the drag\r
YAHOO.log("id is not a string, assuming it is an HTMLElement");\r
id = Dom.generateId(id);\r
}\r
- Event.on(id, "mousedown",\r
+ Event.on(id, "mousedown", \r
this.handleMouseDown, this, true);\r
this.setHandleElId(id);\r
\r
* @method unreg\r
*/\r
unreg: function() {\r
- Event.removeListener(this.id, "mousedown",\r
+ Event.removeListener(this.id, "mousedown", \r
this.handleMouseDown);\r
this._domRef = null;\r
this.DDM._remove(this);\r
* Returns true if this instance is locked, or the drag drop mgr is locked\r
* (meaning that all drag/drop is disabled on the page.)\r
* @method isLocked\r
- * @return {boolean} true if this obj or all drag/drop is locked, else\r
+ * @return {boolean} true if this obj or all drag/drop is locked, else \r
* false\r
*/\r
isLocked: function() {\r
/**\r
* Fired when this object is clicked\r
* @method handleMouseDown\r
- * @param {Event} e\r
+ * @param {Event} e \r
* @param {YAHOO.util.DragDrop} oDD the clicked dd object (this dd obj)\r
* @private\r
*/\r
// var self = this;\r
// setTimeout( function() { self.DDM.refreshCache(self.groups); }, 0);\r
\r
- // Only process the event if we really clicked within the linked\r
- // element. The reason we make this check is that in the case that\r
- // another element was moved between the clicked element and the\r
- // cursor in the time between the mousedown and mouseup events. When\r
- // this happens, the element gets the next mousedown event\r
- // regardless of where on the screen it happened.\r
+ // Only process the event if we really clicked within the linked \r
+ // element. The reason we make this check is that in the case that \r
+ // another element was moved between the clicked element and the \r
+ // cursor in the time between the mousedown and mouseup events. When \r
+ // this happens, the element gets the next mousedown event \r
+ // regardless of where on the screen it happened. \r
var pt = new YAHOO.util.Point(Event.getPageX(e), Event.getPageY(e));\r
if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) ) {\r
} else {\r
clickValidator: function(e) {\r
var target = Event.getTarget(e);\r
return ( this.isValidHandleChild(target) &&\r
- (this.id == this.handleElId ||\r
+ (this.id == this.handleElId || \r
this.DDM.handleWasClicked(target, this.id)) );\r
},\r
\r
// this.invalidHandleTypes[type] = null;\r
delete this.invalidHandleTypes[type];\r
},\r
-\r
+ \r
/**\r
* Unsets an invalid handle id\r
* @method removeInvalidHandleId\r
/**\r
* Unsets an invalid css class\r
* @method removeInvalidHandleClass\r
- * @param {string} cssClass the class of the element(s) you wish to\r
+ * @param {string} cssClass the class of the element(s) you wish to \r
* re-enable\r
*/\r
removeInvalidHandleClass: function(cssClass) {\r
setXTicks: function(iStartX, iTickSize) {\r
this.xTicks = [];\r
this.xTickSize = iTickSize;\r
-\r
+ \r
var tickMap = {};\r
\r
for (var i = this.initPageX; i >= this.minX; i = i - iTickSize) {\r
},\r
\r
/**\r
- * Create the array of vertical tick marks if an interval was specified in\r
+ * Create the array of vertical tick marks if an interval was specified in \r
* setYConstraint().\r
* @method setYTicks\r
* @private\r
},\r
\r
/**\r
- * By default, the element can be dragged any place on the screen. Use\r
- * this method to limit the horizontal travel of the element. Pass in\r
+ * By default, the element can be dragged any place on the screen. Use \r
+ * this method to limit the horizontal travel of the element. Pass in \r
* 0,0 for the parameters if you want to lock the drag to the y axis.\r
* @method setXConstraint\r
* @param {int} iLeft the number of pixels the element can move to the left\r
- * @param {int} iRight the number of pixels the element can move to the\r
+ * @param {int} iRight the number of pixels the element can move to the \r
* right\r
- * @param {int} iTickSize optional parameter for specifying that the\r
+ * @param {int} iTickSize optional parameter for specifying that the \r
* element\r
* should move iTickSize pixels at a time.\r
*/\r
},\r
\r
/**\r
- * By default, the element can be dragged any place on the screen. Set\r
+ * By default, the element can be dragged any place on the screen. Set \r
* this to limit the vertical travel of the element. Pass in 0,0 for the\r
* parameters if you want to lock the drag to the x axis.\r
* @method setYConstraint\r
* @param {int} iUp the number of pixels the element can move up\r
* @param {int} iDown the number of pixels the element can move down\r
- * @param {int} iTickSize optional parameter for specifying that the\r
+ * @param {int} iTickSize optional parameter for specifying that the \r
* element should move iTickSize pixels at a time.\r
*/\r
setYConstraint: function(iUp, iDown, iTickSize) {\r
if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); }\r
\r
this.constrainY = true;\r
-\r
+ \r
},\r
\r
/**\r
}\r
\r
if (this.constrainX) {\r
- this.setXConstraint( this.leftConstraint,\r
- this.rightConstraint,\r
+ this.setXConstraint( this.leftConstraint, \r
+ this.rightConstraint, \r
this.xTickSize );\r
}\r
\r
if (this.constrainY) {\r
- this.setYConstraint( this.topConstraint,\r
- this.bottomConstraint,\r
+ this.setYConstraint( this.topConstraint, \r
+ this.bottomConstraint, \r
this.yTickSize );\r
}\r
},\r
\r
/**\r
- * Normally the drag element is moved pixel by pixel, but we can specify\r
- * that it move a number of pixels at a time. This method resolves the\r
+ * Normally the drag element is moved pixel by pixel, but we can specify \r
+ * that it move a number of pixels at a time. This method resolves the \r
* location when we have it set up like this.\r
* @method getTick\r
* @param {int} val where we want to place the object\r
getTick: function(val, tickArray) {\r
\r
if (!tickArray) {\r
- // If tick interval is not defined, it is effectively 1 pixel,\r
+ // If tick interval is not defined, it is effectively 1 pixel, \r
// so we return the value passed to us.\r
- return val;\r
+ return val; \r
} else if (tickArray[0] >= val) {\r
// The value is lower than the first tick, so we return the first\r
// tick.\r
* @namespace YAHOO.util\r
*/\r
\r
-// Only load the library once. Rewriting the manager class would orphan\r
+// Only load the library once. Rewriting the manager class would orphan \r
// existing drag and drop instances.\r
if (!YAHOO.util.DragDropMgr) {\r
\r
/**\r
- * DragDropMgr is a singleton that tracks the element interaction for\r
- * all DragDrop items in the window. Generally, you will not call\r
- * this class directly, but it does have helper methods that could\r
+ * DragDropMgr is a singleton that tracks the element interaction for \r
+ * all DragDrop items in the window. Generally, you will not call \r
+ * this class directly, but it does have helper methods that could \r
* be useful in your DragDrop implementations.\r
* @class DragDropMgr\r
* @static\r
return {\r
\r
/**\r
- * Two dimensional Array of registered DragDrop objects. The first\r
- * dimension is the DragDrop item group, the second the DragDrop\r
+ * Two dimensional Array of registered DragDrop objects. The first \r
+ * dimension is the DragDrop item group, the second the DragDrop \r
* object.\r
* @property ids\r
* @type {string: string}\r
ids: {},\r
\r
/**\r
- * Array of element ids defined as drag handles. Used to determine\r
- * if the element that generated the mousedown event is actually the\r
+ * Array of element ids defined as drag handles. Used to determine \r
+ * if the element that generated the mousedown event is actually the \r
* handle and not the html element itself.\r
* @property handleIds\r
* @type {string: string}\r
\r
/**\r
* Flag to determine if we should prevent the default behavior of the\r
- * events we define. By default this is true, but this can be set to\r
+ * events we define. By default this is true, but this can be set to \r
* false if you need the default behavior (not recommended)\r
* @property preventDefault\r
* @type boolean\r
preventDefault: true,\r
\r
/**\r
- * Flag to determine if we should stop the propagation of the events\r
+ * Flag to determine if we should stop the propagation of the events \r
* we generate. This is true by default but you may want to set it to\r
* false if the html element contains other features that require the\r
* mouse click.\r
},\r
\r
/**\r
- * In point mode, drag and drop interaction is defined by the\r
+ * In point mode, drag and drop interaction is defined by the \r
* location of the cursor during the drag/drop\r
* @property POINT\r
* @type int\r
* @static\r
+ * @final\r
*/\r
POINT: 0,\r
\r
/**\r
- * In intersect mode, drag and drop interactio nis defined by the\r
- * overlap of two or more drag and drop objects.\r
+ * In intersect mode, drag and drop interaction is defined by the \r
+ * cursor position or the amount of overlap of two or more drag and \r
+ * drop objects.\r
* @property INTERSECT\r
* @type int\r
* @static\r
+ * @final\r
*/\r
INTERSECT: 1,\r
\r
+ /**\r
+ * In intersect mode, drag and drop interaction is defined only by the \r
+ * overlap of two or more drag and drop objects.\r
+ * @property STRICT_INTERSECT\r
+ * @type int\r
+ * @static\r
+ * @final\r
+ */\r
+ STRICT_INTERSECT: 2,\r
+\r
/**\r
* The current drag and drop mode. Default: POINT\r
* @property mode\r
useCache: true,\r
\r
/**\r
- * The number of pixels that the mouse needs to move after the\r
+ * The number of pixels that the mouse needs to move after the \r
* mousedown before the drag is initiated. Default=3;\r
* @property clickPixelThresh\r
* @type int\r
clickTimeThresh: 1000,\r
\r
/**\r
- * Flag that indicates that either the drag pixel threshold or the\r
+ * Flag that indicates that either the drag pixel threshold or the \r
* mousdown time threshold has been met\r
* @property dragThreshMet\r
* @type boolean\r
clickTimeout: null,\r
\r
/**\r
- * The X position of the mousedown event stored for later use when a\r
+ * The X position of the mousedown event stored for later use when a \r
* drag threshold is met.\r
* @property startX\r
* @type int\r
startX: 0,\r
\r
/**\r
- * The Y position of the mousedown event stored for later use when a\r
+ * The Y position of the mousedown event stored for later use when a \r
* drag threshold is met.\r
* @property startY\r
* @type int\r
startY: 0,\r
\r
/**\r
- * Each DragDrop instance must be registered with the DragDropMgr.\r
+ * Each DragDrop instance must be registered with the DragDropMgr. \r
* This is executed in DragDrop.init()\r
* @method regDragDrop\r
* @param {DragDrop} oDD the DragDrop object to register\r
*/\r
regDragDrop: function(oDD, sGroup) {\r
if (!this.initialized) { this.init(); }\r
-\r
+ \r
if (!this.ids[sGroup]) {\r
this.ids[sGroup] = {};\r
}\r
},\r
\r
/**\r
- * Unregisters a drag and drop item. This is executed in\r
+ * Unregisters a drag and drop item. This is executed in \r
* DragDrop.unreg, use that method instead of calling this directly.\r
* @method _remove\r
* @private\r
* automatically when executing DragDrop.setHandleElId()\r
* @method regHandle\r
* @param {String} sDDId the DragDrop id this element is a handle for\r
- * @param {String} sHandleId the id of the element that is the drag\r
+ * @param {String} sHandleId the id of the element that is the drag \r
* handle\r
* @static\r
*/\r
},\r
\r
/**\r
- * Utility function to determine if a given element has been\r
+ * Utility function to determine if a given element has been \r
* registered as a drag drop item.\r
* @method isDragDrop\r
* @param {String} id the element id to check\r
- * @return {boolean} true if this element is a DragDrop item,\r
+ * @return {boolean} true if this element is a DragDrop item, \r
* false otherwise\r
* @static\r
*/\r
},\r
\r
/**\r
- * Returns true if the specified dd target is a legal target for\r
+ * Returns true if the specified dd target is a legal target for \r
* the specifice drag obj\r
* @method isLegalTarget\r
* @param {DragDrop} the drag obj\r
* @param {DragDrop} the target\r
- * @return {boolean} true if the target is a legal target for the\r
+ * @return {boolean} true if the target is a legal target for the \r
* dd obj\r
* @static\r
*/\r
\r
/**\r
* My goal is to be able to transparently determine if an object is\r
- * typeof DragDrop, and the exact subclass of DragDrop. typeof\r
+ * typeof DragDrop, and the exact subclass of DragDrop. typeof \r
* returns "object", oDD.constructor.toString() always returns\r
* "DragDrop" and not the name of the subclass. So for now it just\r
* evaluates a well-known variable in DragDrop.\r
},\r
\r
/**\r
- * Utility function to determine if a given element has been\r
+ * Utility function to determine if a given element has been \r
* registered as a drag drop handle for the given Drag Drop object.\r
* @method isHandle\r
* @param {String} id the element id to check\r
- * @return {boolean} true if this element is a DragDrop handle, false\r
+ * @return {boolean} true if this element is a DragDrop handle, false \r
* otherwise\r
* @static\r
*/\r
isHandle: function(sDDId, sHandleId) {\r
- return ( this.handleIds[sDDId] &&\r
+ return ( this.handleIds[sDDId] && \r
this.handleIds[sDDId][sHandleId] );\r
},\r
\r
\r
this.dragThreshMet = false;\r
\r
- this.clickTimeout = setTimeout(\r
- function() {\r
+ this.clickTimeout = setTimeout( \r
+ function() { \r
var DDM = YAHOO.util.DDM;\r
- DDM.startDrag(DDM.startX, DDM.startY);\r
- },\r
+ DDM.startDrag(DDM.startX, DDM.startY); \r
+ }, \r
this.clickTimeThresh );\r
},\r
\r
/**\r
- * Fired when either the drag pixel threshol or the mousedown hold\r
+ * Fired when either the drag pixel threshol or the mousedown hold \r
* time threshold has been met.\r
* @method startDrag\r
* @param x {int} the X position of the original mousedown\r
},\r
\r
/**\r
- * Internal function to handle the mouseup event. Will be invoked\r
+ * Internal function to handle the mouseup event. Will be invoked \r
* from the context of the document.\r
* @method handleMouseUp\r
* @param {Event} e the event\r
},\r
\r
/**\r
- * Utility to stop event propagation and event default, if these\r
+ * Utility to stop event propagation and event default, if these \r
* features are turned on.\r
* @method stopEvent\r
* @param {Event} e the event as returned by this.getEvent()\r
}\r
},\r
\r
- /**\r
- * Internal function to clean up event handlers after the drag\r
+ /** \r
+ * Internal function to clean up event handlers after the drag \r
* operation is complete\r
* @method stopDrag\r
* @param {Event} e the event\r
this.dragOvers = {};\r
},\r
\r
- /**\r
- * Internal function to handle the mousemove event. Will be invoked\r
+ /** \r
+ * Internal function to handle the mousemove event. Will be invoked \r
* from the context of the html element.\r
*\r
- * @TODO figure out what we can do about mouse events lost when the\r
- * user drags objects beyond the window boundary. Currently we can\r
- * detect this in internet explorer by verifying that the mouse is\r
- * down during the mousemove event. Firefox doesn't give us the\r
+ * @TODO figure out what we can do about mouse events lost when the \r
+ * user drags objects beyond the window boundary. Currently we can \r
+ * detect this in internet explorer by verifying that the mouse is \r
+ * down during the mousemove event. Firefox doesn't give us the \r
* button state on the mousemove event.\r
* @method handleMouseMove\r
* @param {Event} e the event\r
if (!this.dragThreshMet) {\r
var diffX = Math.abs(this.startX - YAHOO.util.Event.getPageX(e));\r
var diffY = Math.abs(this.startY - YAHOO.util.Event.getPageY(e));\r
- if (diffX > this.clickPixelThresh ||\r
+ if (diffX > this.clickPixelThresh || \r
diffY > this.clickPixelThresh) {\r
this.startDrag(this.startX, this.startY);\r
}\r
},\r
\r
/**\r
- * Iterates over all of the DragDrop elements to find ones we are\r
+ * Iterates over all of the DragDrop elements to find ones we are \r
* hovering over or dropping on\r
* @method fireEvents\r
* @param {Event} e the event\r
fireEvents: function(e, isDrop) {\r
var dc = this.dragCurrent;\r
\r
- // If the user did the mouse up outside of the window, we could\r
+ // If the user did the mouse up outside of the window, we could \r
// get here even though we have ended the drag.\r
if (!dc || dc.isLocked()) {\r
return;\r
var dropEvts = [];\r
var enterEvts = [];\r
\r
- // Check to see if the object(s) we were hovering over is no longer\r
+ // Check to see if the object(s) we were hovering over is no longer \r
// being hovered over so we can fire the onDragOut event\r
for (var i in this.dragOvers) {\r
\r
}\r
\r
for (var sGroup in dc.groups) {\r
-\r
+ \r
if ("string" != typeof sGroup) {\r
continue;\r
}\r
dc.b4DragOut(e, outEvts[i].id);\r
dc.onDragOut(e, outEvts[i].id);\r
}\r
-\r
+ \r
// fire enter events\r
for (i=0,len=enterEvts.length; i<len; ++i) {\r
// dc.b4DragEnter(e, oDD.id);\r
dc.onDragEnter(e, enterEvts[i].id);\r
}\r
-\r
+ \r
// fire over events\r
for (i=0,len=overEvts.length; i<len; ++i) {\r
dc.b4DragOver(e, overEvts[i].id);\r
},\r
\r
/**\r
- * Helper function for getting the best match from the list of drag\r
- * and drop objects returned by the drag and drop events when we are\r
- * in INTERSECT mode. It returns either the first object that the\r
- * cursor is over, or the object that has the greatest overlap with\r
+ * Helper function for getting the best match from the list of drag \r
+ * and drop objects returned by the drag and drop events when we are \r
+ * in INTERSECT mode. It returns either the first object that the \r
+ * cursor is over, or the object that has the greatest overlap with \r
* the dragged element.\r
* @method getBestMatch\r
- * @param {DragDrop[]} dds The array of drag and drop objects\r
+ * @param {DragDrop[]} dds The array of drag and drop objects \r
* targeted\r
* @return {DragDrop} The best single match\r
* @static\r
*/\r
getBestMatch: function(dds) {\r
var winner = null;\r
- // Return null if the input is not what we expect\r
- //if (!dds || !dds.length || dds.length == 0) {\r
- // winner = null;\r
- // If there is only one item, it wins\r
- //} else if (dds.length == 1) {\r
\r
var len = dds.length;\r
\r
// Loop through the targeted items\r
for (var i=0; i<len; ++i) {\r
var dd = dds[i];\r
- // If the cursor is over the object, it wins. If the\r
+ // If the cursor is over the object, it wins. If the \r
// cursor is over multiple matches, the first one we come\r
// to wins.\r
- if (dd.cursorIsOver) {\r
+ if (this.mode == this.INTERSECT && dd.cursorIsOver) {\r
winner = dd;\r
break;\r
// Otherwise the object with the most overlap wins\r
} else {\r
- if (!winner ||\r
- winner.overlap.getArea() < dd.overlap.getArea()) {\r
+ if (!winner || !winner.overlap || (dd.overlap &&\r
+ winner.overlap.getArea() < dd.overlap.getArea())) {\r
winner = dd;\r
}\r
}\r
},\r
\r
/**\r
- * Refreshes the cache of the top-left and bottom-right points of the\r
+ * Refreshes the cache of the top-left and bottom-right points of the \r
* drag and drop objects in the specified group(s). This is in the\r
- * format that is stored in the drag and drop instance, so typical\r
+ * format that is stored in the drag and drop instance, so typical \r
* usage is:\r
* <code>\r
* YAHOO.util.DragDropMgr.refreshCache(ddinstance.groups);\r
\r
return false;\r
},\r
-\r
+ \r
/**\r
* Returns a Region object containing the drag and drop element's position\r
* and size, including the padding configured for it\r
* @method getLocation\r
- * @param {DragDrop} oDD the drag and drop object to get the\r
+ * @param {DragDrop} oDD the drag and drop object to get the \r
* location for\r
* @return {YAHOO.util.Region} a Region object representing the total area\r
* the element occupies, including any padding\r
\r
// DragDrop is using this as a sanity check for the initial mousedown\r
// in this case we are done. In POINT mode, if the drag obj has no\r
- // contraints, we are also done. Otherwise we need to evaluate the\r
+ // contraints, we are also done. Otherwise we need to evaluate the \r
// location of the target as related to the actual location of the\r
// dragged element.\r
var dc = this.dragCurrent;\r
- if (!dc || !dc.getTargetCoord ||\r
+ if (!dc || !dc.getTargetCoord || \r
(!intersect && !dc.constrainX && !dc.constrainY)) {\r
return oTarget.cursorIsOver;\r
}\r
var pos = dc.getTargetCoord(pt.x, pt.y);\r
\r
var el = dc.getDragEl();\r
- var curRegion = new YAHOO.util.Region( pos.y,\r
+ var curRegion = new YAHOO.util.Region( pos.y, \r
pos.x + el.offsetWidth,\r
- pos.y + el.offsetHeight,\r
+ pos.y + el.offsetHeight, \r
pos.x );\r
\r
var overlap = curRegion.intersect(loc);\r
* @static\r
*/\r
elementCache: {},\r
-\r
+ \r
/**\r
* Get the wrapper for the DOM element specified\r
* @method getElWrapper\r
getElWrapper: function(id) {\r
var oWrapper = this.elementCache[id];\r
if (!oWrapper || !oWrapper.el) {\r
- oWrapper = this.elementCache[id] =\r
+ oWrapper = this.elementCache[id] = \r
new this.ElementWrapper(YAHOO.util.Dom.get(id));\r
}\r
return oWrapper;\r
getElement: function(id) {\r
return YAHOO.util.Dom.get(id);\r
},\r
-\r
+ \r
/**\r
- * Returns the style property for the DOM element (i.e.,\r
+ * Returns the style property for the DOM element (i.e., \r
* document.getElById(id).style)\r
* @method getCss\r
* @param {String} id the id of the elment to get\r
* @static\r
*/\r
getPosY: function(el) {\r
- return YAHOO.util.Dom.getY(el);\r
+ return YAHOO.util.Dom.getY(el); \r
},\r
\r
/**\r
- * Swap two nodes. In IE, we use the native method, for others we\r
+ * Swap two nodes. In IE, we use the native method, for others we \r
* emulate the IE behavior\r
* @method swapNode\r
* @param n1 the first node to swap\r
},\r
\r
/**\r
- * Recursively searches the immediate parent and all child nodes for\r
- * the handle element in order to determine wheter or not it was\r
+ * Recursively searches the immediate parent and all child nodes for \r
+ * the handle element in order to determine wheter or not it was \r
* clicked.\r
* @method handleWasClicked\r
* @param node the html element to inspect\r
}\r
\r
/**\r
- * A DragDrop implementation where the linked element follows the\r
+ * A DragDrop implementation where the linked element follows the \r
* mouse cursor during a drag.\r
* @class DD\r
* @extends YAHOO.util.DragDrop\r
* @constructor\r
- * @param {String} id the id of the linked element\r
+ * @param {String} id the id of the linked element \r
* @param {String} sGroup the group of related DragDrop items\r
* @param {object} config an object containing configurable attributes\r
- * Valid properties for DD:\r
+ * Valid properties for DD: \r
* scroll\r
*/\r
YAHOO.util.DD = function(id, sGroup, config) {\r
* @property scroll\r
* @type boolean\r
*/\r
- scroll: true,\r
+ scroll: true, \r
\r
/**\r
- * Sets the pointer offset to the distance between the linked element's top\r
+ * Sets the pointer offset to the distance between the linked element's top \r
* left corner and the location the element was clicked\r
* @method autoOffset\r
* @param {int} iPageX the X coordinate of the click\r
this.setDelta(x, y);\r
},\r
\r
- /**\r
- * Sets the pointer offset. You can call this directly to force the\r
- * offset to be in a particular location (e.g., pass in 0,0 to set it\r
+ /** \r
+ * Sets the pointer offset. You can call this directly to force the \r
+ * offset to be in a particular location (e.g., pass in 0,0 to set it \r
* to the center of the object, as done in YAHOO.widget.Slider)\r
* @method setDelta\r
* @param {int} iDeltaX the distance from the left\r
},\r
\r
/**\r
- * Sets the drag element to the location of the mousedown or click event,\r
- * maintaining the cursor location relative to the location on the element\r
- * that was clicked. Override this if you want to place the element in a\r
+ * Sets the drag element to the location of the mousedown or click event, \r
+ * maintaining the cursor location relative to the location on the element \r
+ * that was clicked. Override this if you want to place the element in a \r
* location other than where the cursor is.\r
* @method setDragElPos\r
* @param {int} iPageX the X coordinate of the mousedown or drag event\r
},\r
\r
/**\r
- * Sets the element to the location of the mousedown or click event,\r
- * maintaining the cursor location relative to the location on the element\r
- * that was clicked. Override this if you want to place the element in a\r
+ * Sets the element to the location of the mousedown or click event, \r
+ * maintaining the cursor location relative to the location on the element \r
+ * that was clicked. Override this if you want to place the element in a \r
* location other than where the cursor is.\r
* @method alignElWithMouse\r
* @param {HTMLElement} el the element to move\r
YAHOO.util.Dom.setStyle(el, "left", (oCoord.x + this.deltaSetXY[0]) + "px");\r
YAHOO.util.Dom.setStyle(el, "top", (oCoord.y + this.deltaSetXY[1]) + "px");\r
}\r
-\r
+ \r
this.cachePosition(oCoord.x, oCoord.y);\r
this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);\r
},\r
},\r
\r
/**\r
- * Auto-scroll the window if the dragged object has been moved beyond the\r
+ * Auto-scroll the window if the dragged object has been moved beyond the \r
* visible window boundary.\r
* @method autoScroll\r
* @param {int} x the drag element's x position\r
// Location of the right of the element\r
var right = w + x;\r
\r
- // The distance from the cursor to the bottom of the visible area,\r
+ // The distance from the cursor to the bottom of the visible area, \r
// adjusted so that we don't scroll if the cursor is beyond the\r
// element drag constraints\r
var toBot = (clientH + st - y - this.deltaY);\r
// var thresh = (document.all) ? 100 : 40;\r
var thresh = 40;\r
\r
- // How many pixels to scroll per autoscroll op. This helps to reduce\r
- // clunky scrolling. IE is more sensitive about this ... it needs this\r
+ // How many pixels to scroll per autoscroll op. This helps to reduce \r
+ // clunky scrolling. IE is more sensitive about this ... it needs this \r
// value to be higher.\r
var scrAmt = (document.all) ? 80 : 30;\r
\r
- // Scroll down if we are near the bottom of the visible page and the\r
+ // Scroll down if we are near the bottom of the visible page and the \r
// obj extends below the crease\r
- if ( bot > clientH && toBot < thresh ) {\r
- window.scrollTo(sl, st + scrAmt);\r
+ if ( bot > clientH && toBot < thresh ) { \r
+ window.scrollTo(sl, st + scrAmt); \r
}\r
\r
// Scroll up if the window is scrolled down and the top of the object\r
// goes above the top border\r
- if ( y < st && st > 0 && y - st < thresh ) {\r
- window.scrollTo(sl, st - scrAmt);\r
+ if ( y < st && st > 0 && y - st < thresh ) { \r
+ window.scrollTo(sl, st - scrAmt); \r
}\r
\r
// Scroll right if the obj is beyond the right border and the cursor is\r
// near the border.\r
- if ( right > clientW && toRight < thresh ) {\r
- window.scrollTo(sl + scrAmt, st);\r
+ if ( right > clientW && toRight < thresh ) { \r
+ window.scrollTo(sl + scrAmt, st); \r
}\r
\r
// Scroll left if the window has been scrolled to the right and the obj\r
// extends past the left border\r
- if ( x < sl && sl > 0 && x - sl < thresh ) {\r
+ if ( x < sl && sl > 0 && x - sl < thresh ) { \r
window.scrollTo(sl - scrAmt, st);\r
}\r
}\r
\r
/*\r
* Sets up config options specific to this class. Overrides\r
- * YAHOO.util.DragDrop, but all versions of this method through the\r
+ * YAHOO.util.DragDrop, but all versions of this method through the \r
* inheritance chain are called\r
*/\r
applyConfig: function() {\r
},\r
\r
/*\r
- * Event that fires prior to the onMouseDown event. Overrides\r
+ * Event that fires prior to the onMouseDown event. Overrides \r
* YAHOO.util.DragDrop.\r
*/\r
b4MouseDown: function(e) {\r
// this.resetConstraints();\r
- this.autoOffset(YAHOO.util.Event.getPageX(e),\r
+ this.autoOffset(YAHOO.util.Event.getPageX(e), \r
YAHOO.util.Event.getPageY(e));\r
},\r
\r
/*\r
- * Event that fires prior to the onDrag event. Overrides\r
+ * Event that fires prior to the onDrag event. Overrides \r
* YAHOO.util.DragDrop.\r
*/\r
b4Drag: function(e) {\r
- this.setDragElPos(YAHOO.util.Event.getPageX(e),\r
+ this.setDragElPos(YAHOO.util.Event.getPageX(e), \r
YAHOO.util.Event.getPageY(e));\r
},\r
\r
* @param {String} id the id of the linked html element\r
* @param {String} sGroup the group of related DragDrop objects\r
* @param {object} config an object containing configurable attributes\r
- * Valid properties for DDProxy in addition to those in DragDrop:\r
+ * Valid properties for DDProxy in addition to those in DragDrop: \r
* resizeFrame, centerFrame, dragElId\r
*/\r
YAHOO.util.DDProxy = function(id, sGroup, config) {\r
if (id) {\r
this.init(id, sGroup, config);\r
- this.initFrame();\r
+ this.initFrame(); \r
}\r
};\r
\r
s.zIndex = 999;\r
\r
// appendChild can blow up IE if invoked prior to the window load event\r
- // while rendering a table. It is possible there are other scenarios\r
+ // while rendering a table. It is possible there are other scenarios \r
// that would cause this to happen as well.\r
body.insertBefore(div, body.firstChild);\r
}\r
},\r
\r
/**\r
- * Resizes the drag frame to the dimensions of the clicked object, positions\r
+ * Resizes the drag frame to the dimensions of the clicked object, positions \r
* it over the object, and finally displays it\r
* @method showFrame\r
* @param {int} iPageX X click position\r
this._resizeProxy();\r
\r
if (this.centerFrame) {\r
- this.setDelta( Math.round(parseInt(s.width, 10)/2),\r
+ this.setDelta( Math.round(parseInt(s.width, 10)/2), \r
Math.round(parseInt(s.height, 10)/2) );\r
}\r
\r
this.setDragElPos(iPageX, iPageY);\r
\r
- YAHOO.util.Dom.setStyle(dragEl, "visibility", "visible");\r
+ YAHOO.util.Dom.setStyle(dragEl, "visibility", "visible"); \r
},\r
\r
/**\r
if (isNaN(bl)) { bl = 0; }\r
\r
\r
- var newWidth = Math.max(0, el.offsetWidth - br - bl);\r
+ var newWidth = Math.max(0, el.offsetWidth - br - bl); \r
var newHeight = Math.max(0, el.offsetHeight - bt - bb);\r
\r
\r
\r
// overrides YAHOO.util.DragDrop\r
b4EndDrag: function(e) {\r
- YAHOO.util.Dom.setStyle(this.getDragEl(), "visibility", "hidden");\r
+ YAHOO.util.Dom.setStyle(this.getDragEl(), "visibility", "hidden"); \r
},\r
\r
// overrides YAHOO.util.DragDrop\r
- // By default we try to move the element to the last location of the frame.\r
- // This is so that the default behavior mirrors that of YAHOO.util.DD.\r
+ // By default we try to move the element to the last location of the frame. \r
+ // This is so that the default behavior mirrors that of YAHOO.util.DD. \r
endDrag: function(e) {\r
var DOM = YAHOO.util.Dom;\r
var lel = this.getEl();\r
\r
// Show the drag frame briefly so we can get its position\r
// del.style.visibility = "";\r
- DOM.setStyle(del, "visibility", "");\r
+ DOM.setStyle(del, "visibility", ""); \r
\r
- // Hide the linked element before the move to get around a Safari\r
+ // Hide the linked element before the move to get around a Safari \r
// rendering bug.\r
//lel.style.visibility = "hidden";\r
- DOM.setStyle(lel, "visibility", "hidden");\r
+ DOM.setStyle(lel, "visibility", "hidden"); \r
YAHOO.util.DDM.moveToEl(lel, del);\r
//del.style.visibility = "hidden";\r
- DOM.setStyle(del, "visibility", "hidden");\r
+ DOM.setStyle(del, "visibility", "hidden"); \r
//lel.style.visibility = "";\r
- DOM.setStyle(lel, "visibility", "");\r
+ DOM.setStyle(lel, "visibility", ""); \r
},\r
\r
toString: function() {\r
\r
});\r
/**\r
- * A DragDrop implementation that does not move, but can be a drop\r
- * target. You would get the same result by simply omitting implementation\r
- * for the event callbacks, but this way we reduce the processing cost of the\r
+ * A DragDrop implementation that does not move, but can be a drop \r
+ * target. You would get the same result by simply omitting implementation \r
+ * for the event callbacks, but this way we reduce the processing cost of the \r
* event listener and the callbacks.\r
* @class DDTarget\r
- * @extends YAHOO.util.DragDrop\r
+ * @extends YAHOO.util.DragDrop \r
* @constructor\r
* @param {String} id the id of the element that is a drop target\r
* @param {String} sGroup the group of related DragDrop objects\r
* @param {object} config an object containing configurable attributes\r
- * Valid properties for DDTarget in addition to those in\r
- * DragDrop:\r
+ * Valid properties for DDTarget in addition to those in \r
+ * DragDrop: \r
* none\r
*/\r
YAHOO.util.DDTarget = function(id, sGroup, config) {\r
\r
YUI Library - Event - Release Notes\r
\r
+0.12.1\r
+\r
+ * If an error is thrown during the browser-specific add/remove lister call,\r
+ addListener/removeListener will catch the error and return false.\r
+\r
+ * onAvailable array items are nulled out instead of deleted when completed to\r
+ get around an Opera issue introduced in a recent version of the browser.\r
+\r
0.12.0\r
\r
* If the function argument is not provided to Event.removeListener, all\r
-/*\r
+/* \r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
-*/\r
-\r
+version: 0.12.1\r
+*/ \r
\r
/**\r
* The CustomEvent class lets you define events for your application\r
* @param {String} type The type of event, which is passed to the callback\r
* when the event fires\r
* @param {Object} oScope The context the event will fire from. "this" will\r
- * refer to this object in the callback. Default value:\r
+ * refer to this object in the callback. Default value: \r
* the window object. The listener can override this.\r
* @param {boolean} silent pass true to prevent the event from writing to\r
- * the log system\r
+ * the debugsystem\r
+ * @param {int} signature the signature that the custom event subscriber\r
+ * will receive. YAHOO.util.CustomEvent.LIST or \r
+ * YAHOO.util.CustomEvent.FLAT. The default is\r
+ * YAHOO.util.CustomEvent.LIST.\r
* @namespace YAHOO.util\r
* @class CustomEvent\r
* @constructor\r
this.type = type;\r
\r
/**\r
- * The scope the the event will fire from by default. Defaults to the window\r
+ * The scope the the event will fire from by default. Defaults to the window \r
* obj\r
* @property scope\r
* @type object\r
\r
/**\r
* By default all custom events are logged in the debug build, set silent\r
- * to true to disable logging for this event.\r
+ * to true to disable debug outpu for this event.\r
* @property silent\r
* @type boolean\r
*/\r
\r
/**\r
* Custom events support two styles of arguments provided to the event\r
- * subscribers.\r
+ * subscribers. \r
* <ul>\r
- * <li>YAHOO.util.CustomEvent.LIST:\r
+ * <li>YAHOO.util.CustomEvent.LIST: \r
* <ul>\r
* <li>param1: event name</li>\r
* <li>param2: array of arguments sent to fire</li>\r
\r
var onsubscribeType = "_YUICEOnSubscribe";\r
\r
- // Only add subscribe events for events that are not generated by\r
+ // Only add subscribe events for events that are not generated by \r
// CustomEvent\r
if (type !== onsubscribeType) {\r
\r
* Custom events provide a custom event that fires whenever there is\r
* a new subscriber to the event. This provides an opportunity to\r
* handle the case where there is a non-repeating event that has\r
- * already fired has a new subscriber.\r
+ * already fired has a new subscriber. \r
*\r
* @event subscribeEvent\r
* @type YAHOO.util.CustomEvent\r
* @param {Function} fn The function to execute\r
- * @param {Object} obj An object to be passed along when the event\r
+ * @param {Object} obj An object to be passed along when the event \r
* fires\r
- * @param {boolean|Object} override If true, the obj passed in becomes\r
+ * @param {boolean|Object} override If true, the obj passed in becomes \r
* the execution scope of the listener.\r
* if an object, that object becomes the\r
* the execution scope.\r
*/\r
- this.subscribeEvent =\r
+ this.subscribeEvent = \r
new YAHOO.util.CustomEvent(onsubscribeType, this, true);\r
\r
- }\r
+ } \r
};\r
\r
/**\r
\r
/**\r
* Subscriber listener sigature constant. The FLAT type returns two\r
- * parameters: the first argument passed to fire and the optional\r
+ * parameters: the first argument passed to fire and the optional \r
* custom object\r
* @property YAHOO.util.CustomEvent.FLAT\r
* @static\r
* Subscribes the caller to this event\r
* @method subscribe\r
* @param {Function} fn The function to execute\r
- * @param {Object} obj An object to be passed along when the event\r
+ * @param {Object} obj An object to be passed along when the event \r
* fires\r
- * @param {boolean|Object} override If true, the obj passed in becomes\r
+ * @param {boolean|Object} override If true, the obj passed in becomes \r
* the execution scope of the listener.\r
* if an object, that object becomes the\r
* the execution scope.\r
\r
/**\r
* Notifies the subscribers. The callback functions will be executed\r
- * from the scope specified when the event was created, and with the\r
+ * from the scope specified when the event was created, and with the \r
* following parameters:\r
* <ul>\r
* <li>The type of event</li>\r
* <li>All of the arguments fire() was executed with as an array</li>\r
- * <li>The custom object (if any) that was passed into the subscribe()\r
+ * <li>The custom object (if any) that was passed into the subscribe() \r
* method</li>\r
* </ul>\r
- * @method fire\r
- * @param {Object*} arguments an arbitrary set of parameters to pass to\r
+ * @method fire \r
+ * @param {Object*} arguments an arbitrary set of parameters to pass to \r
* the handler.\r
+ * @return {boolean} false if one of the subscribers returned false, \r
+ * true otherwise\r
*/\r
fire: function() {\r
var len=this.subscribers.length;\r
var argslength = args.length;\r
\r
if (!this.silent) {\r
- YAHOO.log( "Firing " + this + ", " +\r
+ YAHOO.log( "Firing " + this + ", " + \r
"args: " + args + ", " +\r
- "subscribers: " + len,\r
+ "subscribers: " + len, \r
"info", "Event" );\r
}\r
\r
var s = this.subscribers[i];\r
if (s) {\r
if (!this.silent) {\r
- YAHOO.log( this.type + "->" + (i+1) + ": " + s,\r
+ YAHOO.log( this.type + "->" + (i+1) + ": " + s, \r
"info", "Event" );\r
}\r
\r
}\r
if (false === ret) {\r
if (!this.silent) {\r
- YAHOO.log("Event cancelled, subscriber " + i +\r
+ YAHOO.log("Event cancelled, subscriber " + i + \r
" of " + len);\r
}\r
\r
* @method toString\r
*/\r
toString: function() {\r
- return "CustomEvent: " + "'" + this.type + "', " +\r
+ return "CustomEvent: " + "'" + this.type + "', " + \r
"scope: " + this.scope;\r
\r
}\r
* The default execution scope for the event listener is defined when the\r
* event is created (usually the object which contains the event).\r
* By setting override to true, the execution scope becomes the custom\r
- * object passed in by the subscriber. If override is an object, that\r
+ * object passed in by the subscriber. If override is an object, that \r
* object becomes the scope.\r
* @property override\r
* @type boolean|object\r
* @method contains\r
* @param {Function} fn the function to execute\r
* @param {Object} obj an object to be passed along when the event fires\r
- * @return {boolean} true if the supplied arguments match this\r
+ * @return {boolean} true if the supplied arguments match this \r
* subscriber's signature.\r
*/\r
YAHOO.util.Subscriber.prototype.contains = function(fn, obj) {\r
* @method toString\r
*/\r
YAHOO.util.Subscriber.prototype.toString = function() {\r
- return "Subscriber { obj: " + (this.obj || "") +\r
+ return "Subscriber { obj: " + (this.obj || "") + \r
", override: " + (this.override || "no") + " }";\r
};\r
\r
WFN: 3,\r
\r
/**\r
- * Object passed in by the user that will be returned as a\r
+ * Object passed in by the user that will be returned as a \r
* parameter to the callback, int constant\r
* @property OBJ\r
* @type int\r
\r
/**\r
* Safari detection is necessary to work around the preventDefault\r
- * bug that makes it so you can't cancel a href click from the\r
+ * bug that makes it so you can't cancel a href click from the \r
* handler. There is not a capabilities check we can use here.\r
* @property isSafari\r
* @private\r
isSafari: (/Safari|Konqueror|KHTML/gi).test(navigator.userAgent),\r
\r
/**\r
- * IE detection needed to properly calculate pageX and pageY.\r
- * capabilities checking didn't seem to work because another\r
- * browser that does not provide the properties have the values\r
+ * IE detection needed to properly calculate pageX and pageY. \r
+ * capabilities checking didn't seem to work because another \r
+ * browser that does not provide the properties have the values \r
* calculated in a different manner than IE.\r
* @property isIE\r
* @private\r
* @static\r
*/\r
- isIE: (!this.isSafari && !navigator.userAgent.match(/opera/gi) &&\r
+ isIE: (!this.isSafari && !navigator.userAgent.match(/opera/gi) && \r
navigator.userAgent.match(/msie/gi)),\r
\r
/**\r
* @static\r
*/\r
onAvailable: function(p_id, p_fn, p_obj, p_override) {\r
- onAvailStack.push( { id: p_id,\r
- fn: p_fn,\r
- obj: p_obj,\r
- override: p_override,\r
+ onAvailStack.push( { id: p_id, \r
+ fn: p_fn, \r
+ obj: p_obj, \r
+ override: p_override, \r
checkReady: false } );\r
\r
retryCount = this.POLL_RETRYS;\r
* @static\r
*/\r
onContentReady: function(p_id, p_fn, p_obj, p_override) {\r
- onAvailStack.push( { id: p_id,\r
- fn: p_fn,\r
- obj: p_obj,\r
+ onAvailStack.push( { id: p_id, \r
+ fn: p_fn, \r
+ obj: p_obj, \r
override: p_override,\r
checkReady: true } );\r
\r
*\r
* @method addListener\r
*\r
- * @param {Object} el The html element to assign the\r
+ * @param {Object} el The html element to assign the \r
* event to\r
* @param {String} sType The type of event to append\r
* @param {Function} fn The method the event invokes\r
- * @param {Object} obj An arbitrary object that will be\r
+ * @param {Object} obj An arbitrary object that will be \r
* passed as a parameter to the handler\r
* @param {boolean} override If true, the obj passed in becomes\r
* the execution scope of the listener\r
* @return {boolean} True if the action was successful or defered,\r
- * false if one or more of the elements\r
- * could not have the event bound to it.\r
+ * false if one or more of the elements \r
+ * could not have the listener attached,\r
+ * or if the operation throws an exception.\r
* @static\r
*/\r
addListener: function(el, sType, fn, obj, override) {\r
if ( this._isValidCollection(el)) {\r
var ok = true;\r
for (var i=0,len=el.length; i<len; ++i) {\r
- ok = this.on(el[i],\r
- sType,\r
- fn,\r
- obj,\r
+ ok = this.on(el[i], \r
+ sType, \r
+ fn, \r
+ obj, \r
override) && ok;\r
}\r
return ok;\r
\r
} else if (typeof el == "string") {\r
var oEl = this.getEl(el);\r
- // If the el argument is a string, we assume it is\r
+ // If the el argument is a string, we assume it is \r
// actually the id of the element. If the page is loaded\r
- // we convert el to the actual element, otherwise we\r
+ // we convert el to the actual element, otherwise we \r
// defer attaching the event until onload event fires\r
\r
- // check to see if we need to delay hooking up the event\r
+ // check to see if we need to delay hooking up the event \r
// until after the page loads.\r
if (oEl) {\r
el = oEl;\r
}\r
}\r
\r
- // Element should be an html element or an array if we get\r
+ // Element should be an html element or an array if we get \r
// here.\r
if (!el) {\r
// this.logger.debug("unable to attach event " + sType);\r
return false;\r
}\r
\r
- // we need to make sure we fire registered unload events\r
- // prior to automatically unhooking them. So we hang on to\r
+ // we need to make sure we fire registered unload events \r
+ // prior to automatically unhooking them. So we hang on to \r
// these instead of attaching them to the window and fire the\r
// handles explicitly during our one unload event.\r
if ("unload" == sType && obj !== this) {\r
// wrap the function so we can return the obj object when\r
// the event fires;\r
var wrappedFn = function(e) {\r
- return fn.call(scope, YAHOO.util.Event.getEvent(e),\r
+ return fn.call(scope, YAHOO.util.Event.getEvent(e), \r
obj);\r
};\r
\r
\r
// Add a new dom0 wrapper if one is not detected for this\r
// element\r
- if ( legacyIndex == -1 ||\r
+ if ( legacyIndex == -1 || \r
el != legacyEvents[legacyIndex][0] ) {\r
\r
legacyIndex = legacyEvents.length;\r
legacyMap[el.id + sType] = legacyIndex;\r
\r
- // cache the signature for the DOM0 event, and\r
+ // cache the signature for the DOM0 event, and \r
// include the existing handler for the event, if any\r
- legacyEvents[legacyIndex] =\r
+ legacyEvents[legacyIndex] = \r
[el, sType, el["on" + sType]];\r
legacyHandlers[legacyIndex] = [];\r
\r
- el["on" + sType] =\r
+ el["on" + sType] = \r
function(e) {\r
YAHOO.util.Event.fireLegacyEvent(\r
YAHOO.util.Event.getEvent(e), legacyIndex);\r
legacyHandlers[legacyIndex].push(li);\r
\r
} else {\r
- this._simpleAdd(el, sType, wrappedFn, false);\r
+ try {\r
+ this._simpleAdd(el, sType, wrappedFn, false);\r
+ } catch(e) {\r
+ // handle an error trying to attach an event. If it fails\r
+ // we need to clean up the cache\r
+ this.removeListener(el, sType, fn);\r
+ return false;\r
+ }\r
}\r
\r
return true;\r
-\r
+ \r
},\r
\r
/**\r
},\r
\r
/**\r
- * Returns the legacy event index that matches the supplied\r
+ * Returns the legacy event index that matches the supplied \r
* signature\r
* @method getLegacyIndex\r
* @static\r
*/\r
getLegacyIndex: function(el, sType) {\r
var key = this.generateId(el) + sType;\r
- if (typeof legacyMap[key] == "undefined") {\r
+ if (typeof legacyMap[key] == "undefined") { \r
return -1;\r
} else {\r
return legacyMap[key];\r
}\r
return false;\r
},\r
-\r
+ \r
/**\r
* Removes an event handler\r
*\r
* @method removeListener\r
*\r
- * @param {Object} el the html element or the id of the element to\r
+ * @param {Object} el the html element or the id of the element to \r
* assign the event to.\r
* @param {String} sType the type of event to remove.\r
* @param {Function} fn the method the event invokes. If fn is\r
- * undefined, then all event handlers for the type of event are\r
+ * undefined, then all event handlers for the type of event are \r
* removed.\r
- * @return {boolean} true if the unbind was successful, false\r
+ * @return {boolean} true if the unbind was successful, false \r
* otherwise.\r
* @static\r
*/\r
\r
for (i=0, len=unloadListeners.length; i<len; i++) {\r
var li = unloadListeners[i];\r
- if (li &&\r
- li[0] == el &&\r
- li[1] == sType &&\r
+ if (li && \r
+ li[0] == el && \r
+ li[1] == sType && \r
li[2] == fn) {\r
unloadListeners.splice(i, 1);\r
return true;\r
// the method signature because it was tempting users to\r
// try and take advantage of it, which is not possible.\r
var index = arguments[3];\r
-\r
+ \r
if ("undefined" == typeof index) {\r
index = this._getCacheIndex(el, sType, fn);\r
}\r
if (llist) {\r
for (i=0, len=llist.length; i<len; ++i) {\r
li = llist[i];\r
- if (li &&\r
- li[this.EL] == el &&\r
- li[this.TYPE] == sType &&\r
+ if (li && \r
+ li[this.EL] == el && \r
+ li[this.TYPE] == sType && \r
li[this.FN] == fn) {\r
llist.splice(i, 1);\r
break;\r
}\r
\r
} else {\r
- this._simpleRemove(el, sType, cacheItem[this.WFN], false);\r
+ try {\r
+ this._simpleRemove(el, sType, cacheItem[this.WFN], false);\r
+ } catch(e) {\r
+ return false;\r
+ }\r
}\r
\r
// removed the wrapped handler\r
* @method getTarget\r
* @param {Event} ev the event\r
* @param {boolean} resolveTextNode when set to true the target's\r
- * parent will be returned if the target is a\r
+ * parent will be returned if the target is a \r
* text node. @deprecated, the text node is\r
* now resolved automatically\r
* @return {HTMLElement} the event's target\r
* @static\r
*/\r
resolveTextNode: function(node) {\r
- // if (node && node.nodeName &&\r
+ // if (node && node.nodeName && \r
// "#TEXT" == node.nodeName.toUpperCase()) {\r
if (node && 3 == node.nodeType) {\r
return node.parentNode;\r
},\r
\r
/**\r
- * Returns the event's related target\r
+ * Returns the event's related target \r
* @method getRelatedTarget\r
* @param {Event} ev the event\r
* @return {HTMLElement} the event's relatedTarget\r
var t = new Date().getTime();\r
try {\r
ev.time = t;\r
- } catch(e) {\r
+ } catch(e) { \r
return t;\r
}\r
}\r
ev.returnValue = false;\r
}\r
},\r
-\r
+ \r
/**\r
* Finds the event in the window object, the caller's arguments, or\r
* in the arguments of another method in the callstack. This is\r
* this function at all.\r
* @method getEvent\r
* @param {Event} e the event parameter from the handler\r
- * @return {Event} the event\r
+ * @return {Event} the event \r
* @static\r
*/\r
getEvent: function(e) {\r
_getCacheIndex: function(el, sType, fn) {\r
for (var i=0,len=listeners.length; i<len; ++i) {\r
var li = listeners[i];\r
- if ( li &&\r
- li[this.FN] == fn &&\r
- li[this.EL] == el &&\r
+ if ( li && \r
+ li[this.FN] == fn && \r
+ li[this.EL] == el && \r
li[this.TYPE] == sType ) {\r
return i;\r
}\r
},\r
\r
/**\r
- * Generates an unique ID for the element if it does not already\r
+ * Generates an unique ID for the element if it does not already \r
* have one.\r
* @method generateId\r
* @param el the element to create the id for\r
\r
/**\r
* We want to be able to use getElementsByTagName as a collection\r
- * to attach a group of events to. Unfortunately, different\r
+ * to attach a group of events to. Unfortunately, different \r
* browsers return different types of collections. This function\r
- * tests to determine if the object is array-like. It will also\r
+ * tests to determine if the object is array-like. It will also \r
* fail if the object is an array, but is empty.\r
* @method _isValidCollection\r
* @param o the object to test\r
elCache: {},\r
\r
/**\r
- * We cache elements bound by id because when the unload event\r
+ * We cache elements bound by id because when the unload event \r
* fires, we can no longer use document.getElementById\r
* @method getEl\r
* @static\r
},\r
\r
/**\r
- * Polling function that runs before the onload event fires,\r
- * attempting to attach to DOM Nodes as soon as they are\r
+ * Polling function that runs before the onload event fires, \r
+ * attempting to attach to DOM Nodes as soon as they are \r
* available\r
* @method _tryPreloadAttach\r
* @static\r
\r
// this.logger.debug("tryPreloadAttach");\r
\r
- // keep trying until after the page is loaded. We need to\r
- // check the page load state prior to trying to bind the\r
- // elements so that we can be certain all elements have been\r
+ // keep trying until after the page is loaded. We need to \r
+ // check the page load state prior to trying to bind the \r
+ // elements so that we can be certain all elements have been \r
// tested appropriately\r
var tryAgain = !loadComplete;\r
if (!tryAgain) {\r
\r
if (el) {\r
// The element is available, but not necessarily ready\r
-\r
- if ( !item.checkReady ||\r
- loadComplete ||\r
+ // @todo verify IE7 compatibility\r
+ // @todo should we test parentNode.nextSibling?\r
+ // @todo re-evaluate global content ready\r
+ if ( !item.checkReady || \r
+ loadComplete || \r
el.nextSibling ||\r
(document && document.body) ) {\r
\r
}\r
}\r
item.fn.call(scope, item.obj);\r
- delete onAvailStack[i];\r
+ //delete onAvailStack[i];\r
+ // null out instead of delete for Opera\r
+ onAvailStack[i] = null;\r
}\r
} else {\r
notAvail.push(item);\r
retryCount = (notAvail.length === 0) ? 0 : retryCount - 1;\r
\r
if (tryAgain) {\r
+ onAvailStack = notAvail; // cleanse the array\r
this.startInterval();\r
} else {\r
clearInterval(this._interval);\r
* Returns all listeners attached to the given element via addListener.\r
* Optionally, you can specify a specific type of event to return.\r
* @method getListeners\r
- * @param el {HTMLElement} the element to inspect\r
+ * @param el {HTMLElement} the element to inspect \r
* @param sType {string} optional type of listener to return. If\r
* left out, all listeners will be returned\r
* @return {Object} the listener. Contains the following fields:\r
* adjust: (boolean) whether or not to adjust the default scope\r
* index: (int) its position in the Event util listener cache\r
* @static\r
- */\r
+ */ \r
getListeners: function(el, sType) {\r
var elListeners = [];\r
if (listeners && listeners.length > 0) {\r
for (var i=0,len=listeners.length; i<len ; ++i) {\r
var l = listeners[i];\r
- if ( l && l[this.EL] === el &&\r
+ if ( l && l[this.EL] === el && \r
(!sType || sType === l[this.TYPE]) ) {\r
elListeners.push({\r
type: l[this.TYPE],\r
},\r
\r
/**\r
- * Removes all listeners registered by pe.event. Called\r
+ * Removes all listeners registered by pe.event. Called \r
* automatically during the unload event.\r
* @method _unload\r
* @static\r
}\r
}\r
l[EU.FN].call(scope, EU.getEvent(e), l[EU.OBJ] );\r
- delete unloadListeners[i];\r
+ unloadListeners[i] = null;\r
l=null;\r
scope=null;\r
}\r
}\r
\r
+ unloadListeners = null;\r
+\r
if (listeners && listeners.length > 0) {\r
j = listeners.length;\r
while (j) {\r
index = j-1;\r
l = listeners[index];\r
if (l) {\r
- EU.removeListener(l[EU.EL], l[EU.TYPE],\r
+ EU.removeListener(l[EU.EL], l[EU.TYPE], \r
l[EU.FN], index);\r
- }\r
+ } \r
j = j - 1;\r
}\r
l=null;\r
\r
for (i=0,len=legacyEvents.length; i<len; ++i) {\r
// dereference the element\r
- delete legacyEvents[i][0];\r
+ //delete legacyEvents[i][0];\r
+ legacyEvents[i][0] = null;\r
+\r
// delete the array item\r
- delete legacyEvents[i];\r
+ //delete legacyEvents[i];\r
+ legacyEvents[i] = null;\r
}\r
\r
+ legacyEvents = null;\r
+\r
EU._simpleRemove(window, "unload", EU._unload);\r
\r
},\r
},\r
\r
/**\r
- * Returns the scrollTop and scrollLeft. Used to calculate the\r
+ * Returns the scrollTop and scrollLeft. Used to calculate the \r
* pageX and pageY in Internet Explorer\r
* @method _getScroll\r
* @static\r
}\r
\r
/**\r
- * EventProvider is designed to be used with YAHOO.augment to wrap\r
- * CustomEvents in an interface that allows events to be subscribed to\r
+ * EventProvider is designed to be used with YAHOO.augment to wrap \r
+ * CustomEvents in an interface that allows events to be subscribed to \r
* and fired by name. This makes it possible for implementing code to\r
* subscribe to an event that either has not been created yet, or will\r
* not be created at all.\r
* @private\r
*/\r
__yui_subscribers: null,\r
-\r
+ \r
/**\r
* Subscribe to a CustomEvent by event type\r
*\r
* @param p_type {string} the type, or name of the event\r
* @param p_fn {function} the function to exectute when the event fires\r
* @param p_obj\r
- * @param p_obj {Object} An object to be passed along when the event\r
+ * @param p_obj {Object} An object to be passed along when the event \r
* fires\r
- * @param p_override {boolean} If true, the obj passed in becomes the\r
+ * @param p_override {boolean} If true, the obj passed in becomes the \r
* execution scope of the listener\r
*/\r
subscribe: function(p_type, p_fn, p_obj, p_override) {\r
/**\r
* Creates a new custom event of the specified type. If a custom event\r
* by that name already exists, it will not be re-created. In either\r
- * case the custom event is returned.\r
+ * case the custom event is returned. \r
*\r
* @method createEvent\r
*\r
\r
/**\r
* Fire a custom event by name. The callback functions will be executed\r
- * from the scope specified when the event was created, and with the\r
+ * from the scope specified when the event was created, and with the \r
* following parameters:\r
* <ul>\r
* <li>The first argument fire() was executed with</li>\r
- * <li>The custom object (if any) that was passed into the subscribe()\r
+ * <li>The custom object (if any) that was passed into the subscribe() \r
* method</li>\r
* </ul>\r
* @method fireEvent\r
* @param p_type {string} the type, or name of the event\r
- * @param arguments {Object*} an arbitrary set of parameters to pass to\r
+ * @param arguments {Object*} an arbitrary set of parameters to pass to \r
* the handler.\r
- * @return {boolean} the return value from CustomEvent.fire, or null if\r
+ * @return {boolean} the return value from CustomEvent.fire, or null if \r
* the custom event does not exist.\r
*/\r
fireEvent: function(p_type, arg1, arg2, etc) {\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ YAHOO.util.CustomEvent=function(_1,_2,_3,_4){this.type=_1;this.scope=_2||window;this.silent=_3;this.signature=_4||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var _5="_YUICEOnSubscribe";if(_1!==_5){this.subscribeEvent=new YAHOO.util.CustomEvent(_5,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,_7,_8){if(this.subscribeEvent){this.subscribeEvent.fire(fn,_7,_8);}this.subscribers.push(new YAHOO.util.Subscriber(fn,_7,_8));},unsubscribe:function(fn,_9){var _10=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,_9)){this._delete(i);_10=true;}}return _10;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}var _14=[],ret=true,i;for(i=0;i<arguments.length;++i){_14.push(arguments[i]);}var _15=_14.length;if(!this.silent){}for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}var _16=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var _17=null;if(_14.length>0){_17=_14[0];}ret=s.fn.call(_16,_17,s.obj);}else{ret=s.fn.call(_16,this.type,_14,s.obj);}if(false===ret){if(!this.silent){}return false;}}}return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}},_delete:function(_18){var s=this.subscribers[_18];if(s){delete s.fn;delete s.obj;}this.subscribers.splice(_18,1);},toString:function(){return "CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,_20){this.fn=fn;this.obj=obj||null;this.override=_20;};YAHOO.util.Subscriber.prototype.getScope=function(_21){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return _21;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return (this.fn==fn&&this.obj==obj);}else{return (this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return "Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var _22=false;var _23=[];var _24=[];var _25=[];var _26=[];var _27=0;var _28=[];var _29=[];var _30=0;return {POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ: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)),_interval:null,startInterval:function(){if(!this._interval){var _31=this;var _32=function(){_31._tryPreloadAttach();};this._interval=setInterval(_32,this.POLL_INTERVAL);}},onAvailable:function(_33,_34,_35,_36){_28.push({id:_33,fn:_34,obj:_35,override:_36,checkReady:false});_27=this.POLL_RETRYS;this.startInterval();},onContentReady:function(_37,_38,_39,_40){_28.push({id:_37,fn:_38,obj:_39,override:_40,checkReady:true});_27=this.POLL_RETRYS;this.startInterval();},addListener:function(el,_42,fn,obj,_43){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],_42,fn,obj,_43)&&ok;}return ok;}else{if(typeof el=="string"){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,_42,fn,obj,_43);});return true;}}}if(!el){return false;}if("unload"==_42&&obj!==this){_24[_24.length]=[el,_42,fn,obj,_43];return true;}var _46=el;if(_43){if(_43===true){_46=obj;}else{_46=_43;}}var _47=function(e){return fn.call(_46,YAHOO.util.Event.getEvent(e),obj);};var li=[el,_42,fn,_47,_46];var _50=_23.length;_23[_50]=li;if(this.useLegacyEvent(el,_42)){var _51=this.getLegacyIndex(el,_42);if(_51==-1||el!=_25[_51][0]){_51=_25.length;_29[el.id+_42]=_51;_25[_51]=[el,_42,el["on"+_42]];_26[_51]=[];el["on"+_42]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),_51);};}_26[_51].push(li);}else{this._simpleAdd(el,_42,_47,false);}return true;},fireLegacyEvent:function(e,_52){var ok=true;var le=_26[_52];for(var i=0,len=le.length;i<len;++i){var li=le[i];if(li&&li[this.WFN]){var _54=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(_54,e);ok=(ok&&ret);}}return ok;},getLegacyIndex:function(el,_56){var key=this.generateId(el)+_56;if(typeof _29[key]=="undefined"){return -1;}else{return _29[key];}},useLegacyEvent:function(el,_58){if(!el.addEventListener&&!el.attachEvent){return true;}else{if(this.isSafari){if("click"==_58||"dblclick"==_58){return true;}}}return false;},removeListener:function(el,_59,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else{if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],_59,fn)&&ok);}return ok;}}if(!fn||!fn.call){return this.purgeElement(el,false,_59);}if("unload"==_59){for(i=0,len=_24.length;i<len;i++){var li=_24[i];if(li&&li[0]==el&&li[1]==_59&&li[2]==fn){_24.splice(i,1);return true;}}return false;}var _60=null;var _61=arguments[3];if("undefined"==typeof _61){_61=this._getCacheIndex(el,_59,fn);}if(_61>=0){_60=_23[_61];}if(!el||!_60){return false;}if(this.useLegacyEvent(el,_59)){var _62=this.getLegacyIndex(el,_59);var _63=_26[_62];if(_63){for(i=0,len=_63.length;i<len;++i){li=_63[i];if(li&&li[this.EL]==el&&li[this.TYPE]==_59&&li[this.FN]==fn){_63.splice(i,1);break;}}}}else{this._simpleRemove(el,_59,_60[this.WFN],false);}delete _23[_61][this.WFN];delete _23[_61][this.FN];_23.splice(_61,1);return true;},getTarget:function(ev,_65){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(_67){if(_67&&3==_67.nodeType){return _67.parentNode;}else{return _67;}},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.keyCode||0;},_getCacheIndex:function(el,_71,fn){for(var i=0,len=_23.length;i<len;++i){var li=_23[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==_71){return i;}}return -1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+_30;++_30;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(){},_load:function(e){_22=true;var EU=YAHOO.util.Event;if(this.isIE){EU._simpleRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}this.locked=true;var _75=!_22;if(!_75){_75=(_27>0);}var _76=[];for(var i=0,len=_28.length;i<len;++i){var _77=_28[i];if(_77){var el=this.getEl(_77.id);if(el){if(!_77.checkReady||_22||el.nextSibling||(document&&document.body)){var _78=el;if(_77.override){if(_77.override===true){_78=_77.obj;}else{_78=_77.override;}}_77.fn.call(_78,_77.obj);delete _28[i];}}else{_76.push(_77);}}}_27=(_76.length===0)?0:_27-1;if(_75){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;return true;},purgeElement:function(el,_79,_80){var _81=this.getListeners(el,_80);if(_81){for(var i=0,len=_81.length;i<len;++i){var l=_81[i];this.removeListener(el,l.type,l.fn);}}if(_79&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],_79,_80);}}},getListeners:function(el,_83){var _84=[];if(_23&&_23.length>0){for(var i=0,len=_23.length;i<len;++i){var l=_23[i];if(l&&l[this.EL]===el&&(!_83||_83===l[this.TYPE])){_84.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}return (_84.length)?_84:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=_24.length;i<len;++i){l=_24[i];if(l){var _85=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){_85=l[EU.OBJ];}else{_85=l[EU.ADJ_SCOPE];}}l[EU.FN].call(_85,EU.getEvent(e),l[EU.OBJ]);delete _24[i];l=null;_85=null;}}if(_23&&_23.length>0){j=_23.length;while(j){index=j-1;l=_23[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}j=j-1;}l=null;EU.clearCache();}for(i=0,len=_25.length;i<len;++i){delete _25[i][0];delete _25[i];}EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return [dd.scrollTop,dd.scrollLeft];}else{if(db){return [db.scrollTop,db.scrollLeft];}else{return [0,0];}}},_simpleAdd:function(){if(window.addEventListener){return function(el,_87,fn,_88){el.addEventListener(_87,fn,(_88));};}else{if(window.attachEvent){return function(el,_89,fn,_90){el.attachEvent("on"+_89,fn);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,_91,fn,_92){el.removeEventListener(_91,fn,(_92));};}else{if(window.detachEvent){return function(el,_93,fn){el.detachEvent("on"+_93,fn);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(document&&document.body){EU._load();}else{EU._simpleAdd(window,"load",EU._load);}EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(_94,_95,_96,_97){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_94];if(ce){ce.subscribe(_95,_96,_97);}else{this.__yui_subscribers=this.__yui_subscribers||{};var _99=this.__yui_subscribers;if(!_99[_94]){_99[_94]=[];}_99[_94].push({fn:_95,obj:_96,override:_97});}},unsubscribe:function(_100,p_fn,_102){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_100];if(ce){return ce.unsubscribe(p_fn,_102);}else{return false;}},createEvent:function(_103,_104){this.__yui_events=this.__yui_events||{};var opts=_104||{};var _106=this.__yui_events;if(_106[_103]){}else{var _107=opts.scope||this;var _108=opts.silent||null;var ce=new YAHOO.util.CustomEvent(_103,_107,_108,YAHOO.util.CustomEvent.FLAT);_106[_103]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[_103];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}return _106[_103];},fireEvent:function(_110,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_110];if(ce){var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}return ce.fire.apply(ce,args);}else{return null;}},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}return false;}};
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.1 */\r
+YAHOO.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this.scope=oScope||window;this.silent=silent;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}\r
+var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);}\r
+this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}\r
+return found;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}\r
+var args=[],ret=true,i;for(i=0;i<arguments.length;++i){args.push(arguments[i]);}\r
+var argslength=args.length;if(!this.silent){}\r
+for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}\r
+var scope=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var param=null;if(args.length>0){param=args[0];}\r
+ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);}\r
+if(false===ret){if(!this.silent){}\r
+return false;}}}\r
+return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}\r
+this.subscribers.splice(index,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=obj||null;this.override=override;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}\r
+return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;return{POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ: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)),_interval:null,startInterval:function(){if(!this._interval){var self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:false});retryCount=this.POLL_RETRYS;this.startInterval();},onContentReady:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:true});retryCount=this.POLL_RETRYS;this.startInterval();},addListener:function(el,sType,fn,obj,override){if(!fn||!fn.call){return false;}\r
+if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=this.on(el[i],sType,fn,obj,override)&&ok;}\r
+return ok;}else if(typeof el=="string"){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,sType,fn,obj,override);});return true;}}\r
+if(!el){return false;}\r
+if("unload"==sType&&obj!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,obj,override];return true;}\r
+var scope=el;if(override){if(override===true){scope=obj;}else{scope=override;}}\r
+var wrappedFn=function(e){return fn.call(scope,YAHOO.util.Event.getEvent(e),obj);};var li=[el,sType,fn,wrappedFn,scope];var index=listeners.length;listeners[index]=li;if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1||el!=legacyEvents[legacyIndex][0]){legacyIndex=legacyEvents.length;legacyMap[el.id+sType]=legacyIndex;legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];legacyHandlers[legacyIndex]=[];el["on"+sType]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),legacyIndex);};}\r
+legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(e){this.removeListener(el,sType,fn);return false;}}\r
+return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true;var le=legacyHandlers[legacyIndex];for(var i=0,len=le.length;i<len;++i){var li=le[i];if(li&&li[this.WFN]){var scope=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}\r
+return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(!el.addEventListener&&!el.attachEvent){return true;}else if(this.isSafari){if("click"==sType||"dblclick"==sType){return true;}}\r
+return false;},removeListener:function(el,sType,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],sType,fn)&&ok);}\r
+return ok;}\r
+if(!fn||!fn.call){return this.purgeElement(el,false,sType);}\r
+if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners.splice(i,1);return true;}}\r
+return false;}\r
+var cacheItem=null;var index=arguments[3];if("undefined"==typeof index){index=this._getCacheIndex(el,sType,fn);}\r
+if(index>=0){cacheItem=listeners[index];}\r
+if(!el||!cacheItem){return false;}\r
+if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist.splice(i,1);break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(e){return false;}}\r
+delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners.splice(index,1);return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}\r
+return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}\r
+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;}}\r
+return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}\r
+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;}\r
+c=c.caller;}}\r
+return ev;},getCharCode:function(ev){return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}\r
+return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}\r
+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(){},_load:function(e){loadComplete=true;var EU=YAHOO.util.Event;if(this.isIE){EU._simpleRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}\r
+this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0);}\r
+var notAvail=[];for(var i=0,len=onAvailStack.length;i<len;++i){var item=onAvailStack[i];if(item){var el=this.getEl(item.id);if(el){if(!item.checkReady||loadComplete||el.nextSibling||(document&&document.body)){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}\r
+item.fn.call(scope,item.obj);onAvailStack[i]=null;}}else{notAvail.push(item);}}}\r
+retryCount=(notAvail.length===0)?0:retryCount-1;if(tryAgain){onAvailStack=notAvail;this.startInterval();}else{clearInterval(this._interval);this._interval=null;}\r
+this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn);}}\r
+if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var elListeners=[];if(listeners&&listeners.length>0){for(var i=0,len=listeners.length;i<len;++i){var l=listeners[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){elListeners.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}\r
+return(elListeners.length)?elListeners:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=unloadListeners.length;i<len;++i){l=unloadListeners[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else{scope=l[EU.ADJ_SCOPE];}}\r
+l[EU.FN].call(scope,EU.getEvent(e),l[EU.OBJ]);unloadListeners[i]=null;l=null;scope=null;}}\r
+unloadListeners=null;if(listeners&&listeners.length>0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}\r
+j=j-1;}\r
+l=null;EU.clearCache();}\r
+for(i=0,len=legacyEvents.length;i<len;++i){legacyEvents[i][0]=null;legacyEvents[i]=null;}\r
+legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(document&&document.body){EU._load();}else{EU._simpleAdd(window,"load",EU._load);}\r
+EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}\r
+YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,p_override){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];}\r
+subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}else{return false;}},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=opts.silent||null;var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}\r
+this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}\r
+return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}\r
+return ce.fire.apply(ce,args);}else{return null;}},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}\r
+return false;}};
\ No newline at end of file
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
+version: 0.12.1\r
*/ \r
\r
/**\r
* refer to this object in the callback. Default value: \r
* the window object. The listener can override this.\r
* @param {boolean} silent pass true to prevent the event from writing to\r
- * the log system\r
+ * the debugsystem\r
+ * @param {int} signature the signature that the custom event subscriber\r
+ * will receive. YAHOO.util.CustomEvent.LIST or \r
+ * YAHOO.util.CustomEvent.FLAT. The default is\r
+ * YAHOO.util.CustomEvent.LIST.\r
* @namespace YAHOO.util\r
* @class CustomEvent\r
* @constructor\r
\r
/**\r
* By default all custom events are logged in the debug build, set silent\r
- * to true to disable logging for this event.\r
+ * to true to disable debug outpu for this event.\r
* @property silent\r
* @type boolean\r
*/\r
* @method fire \r
* @param {Object*} arguments an arbitrary set of parameters to pass to \r
* the handler.\r
+ * @return {boolean} false if one of the subscribers returned false, \r
+ * true otherwise\r
*/\r
fire: function() {\r
var len=this.subscribers.length;\r
* the execution scope of the listener\r
* @return {boolean} True if the action was successful or defered,\r
* false if one or more of the elements \r
- * could not have the event bound to it.\r
+ * could not have the listener attached,\r
+ * or if the operation throws an exception.\r
* @static\r
*/\r
addListener: function(el, sType, fn, obj, override) {\r
return true;\r
}\r
\r
+\r
// if the user chooses to override the scope, we use the custom\r
// object passed in, otherwise the executing scope will be the\r
// HTML element that the event is registered on\r
legacyHandlers[legacyIndex].push(li);\r
\r
} else {\r
- this._simpleAdd(el, sType, wrappedFn, false);\r
+ try {\r
+ this._simpleAdd(el, sType, wrappedFn, false);\r
+ } catch(e) {\r
+ // handle an error trying to attach an event. If it fails\r
+ // we need to clean up the cache\r
+ this.removeListener(el, sType, fn);\r
+ return false;\r
+ }\r
}\r
\r
return true;\r
return false;\r
}\r
\r
+\r
if (this.useLegacyEvent(el, sType)) {\r
var legacyIndex = this.getLegacyIndex(el, sType);\r
var llist = legacyHandlers[legacyIndex];\r
}\r
\r
} else {\r
- this._simpleRemove(el, sType, cacheItem[this.WFN], false);\r
+ try {\r
+ this._simpleRemove(el, sType, cacheItem[this.WFN], false);\r
+ } catch(e) {\r
+ return false;\r
+ }\r
}\r
\r
// removed the wrapped handler\r
\r
this.locked = true;\r
\r
+\r
// keep trying until after the page is loaded. We need to \r
// check the page load state prior to trying to bind the \r
// elements so that we can be certain all elements have been \r
\r
if (el) {\r
// The element is available, but not necessarily ready\r
-\r
+ // @todo verify IE7 compatibility\r
+ // @todo should we test parentNode.nextSibling?\r
+ // @todo re-evaluate global content ready\r
if ( !item.checkReady || \r
loadComplete || \r
el.nextSibling ||\r
}\r
}\r
item.fn.call(scope, item.obj);\r
- delete onAvailStack[i];\r
+ //delete onAvailStack[i];\r
+ // null out instead of delete for Opera\r
+ onAvailStack[i] = null;\r
}\r
} else {\r
notAvail.push(item);\r
retryCount = (notAvail.length === 0) ? 0 : retryCount - 1;\r
\r
if (tryAgain) {\r
+ onAvailStack = notAvail; // cleanse the array\r
this.startInterval();\r
} else {\r
clearInterval(this._interval);\r
}\r
}\r
l[EU.FN].call(scope, EU.getEvent(e), l[EU.OBJ] );\r
- delete unloadListeners[i];\r
+ unloadListeners[i] = null;\r
l=null;\r
scope=null;\r
}\r
}\r
\r
+ unloadListeners = null;\r
+\r
if (listeners && listeners.length > 0) {\r
j = listeners.length;\r
while (j) {\r
\r
for (i=0,len=legacyEvents.length; i<len; ++i) {\r
// dereference the element\r
- delete legacyEvents[i][0];\r
+ //delete legacyEvents[i][0];\r
+ legacyEvents[i][0] = null;\r
+\r
// delete the array item\r
- delete legacyEvents[i];\r
+ //delete legacyEvents[i];\r
+ legacyEvents[i] = null;\r
}\r
\r
+ legacyEvents = null;\r
+\r
EU._simpleRemove(window, "unload", EU._unload);\r
\r
},\r
YUI Library - Fonts - Release Notes\r
\r
+Version 0.12.1\r
+\r
+ * No changes.\r
+ \r
Version 0.12.0\r
\r
* No changes.\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.1 */ body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
+version: 0.12.1\r
*/\r
\r
/**\r
YUI Library - Grids - Release Notes\r
\r
+Version 0.12.1\r
+\r
+ * No changes.\r
+ \r
Version 0.12.0\r
\r
* Removed redundant "text-align:left" from nodes below #doc.\r
-/* Copyright (c) 2006,Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */\r
+/*Copyright (c) 2006,Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt */\r
body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.3em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;min-width:950px;}#doc3{margin:auto 10px;width:auto;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.3207em;*width:12.0106em;}.yui-t1 #yui-main .yui-b{margin-left:13.3207em;*margin-left:13.0106em;}.yui-t2 .yui-b{float:left;width:13.8456em;*width:13.512em;}.yui-t2 #yui-main .yui-b{margin-left:14.8456em;*margin-left:14.512em;}.yui-t3 .yui-b{float:left;width:23.0759em;*width:22.52em;}.yui-t3 #yui-main .yui-b{margin-left:24.0759em;*margin-left:23.52em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.512em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.512em;}.yui-t5 .yui-b{float:right;width:18.4608em;*width:18.016em;}.yui-t5 #yui-main .yui-b{margin-right:19.4608em;*margin-right:19.016em;}.yui-t6 .yui-b{float:right;width:23.0759em;*width:22.52em;}.yui-t6 #yui-main .yui-b{margin-right:24.0759em;*margin-right:23.52em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-g .yui-u,.yui-g .yui-g,.yui-gc .yui-u,.yui-gc .yui-g .yui-u,.yui-ge .yui-u,.yui-gf .yui-u{float:right;display:inline;}.yui-g div.first,.yui-gc div.first,.yui-gc div.first div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first{float:left;}.yui-g .yui-u,.yui-g .yui-g{width:49.1%;}.yui-g .yui-g .yui-u,.yui-gc .yui-g .yui-u{width:48.1%;}.yui-gb .yui-u,.yui-gc .yui-u,.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge .yui-u{width:24%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-gf div.first{width:24%;}.yui-ge div.first{width:74.2%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}
\ No newline at end of file
-/*\r
+/* \r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
*/\r
\r
/* for all templates and grids */\r
body{text-align:center;}\r
#ft{clear:both;}\r
/**/\r
-/* 750 centered, and backward compatibility */\r
+/* 750 centered, and backward compatibility */ \r
#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 {\r
margin:auto;text-align:left;\r
width:57.69em;*width:56.3em;min-width:750px;}\r
-/* 950 centered */\r
+/* 950 centered */ \r
#doc2 {\r
width:73.074em;*width:71.313em;min-width:950px;}\r
-/* 100% with 10px viewport side matting */\r
+/* 100% with 10px viewport side matting */ \r
#doc3 {\r
margin:auto 10px; /* not for structure, but so content doesn't bleed to edge */\r
width:auto;}\r
-\r
+ \r
/* below required for all fluid grids; adjust widths and margins above accordingly */\r
\r
/* to preserve source-order independence for Gecko */\r
.yui-b{position:relative;}\r
.yui-b{_position:static;} /* for IE < 7 */\r
- #yui-main .yui-b{position:static;}\r
+ #yui-main .yui-b{position:static;} \r
\r
#yui-main {width:100%;}\r
.yui-t1 #yui-main,\r
}\r
#yui-main .yui-b {float:none;width:auto;}\r
/* GRIDS (not TEMPLATES) */\r
-.yui-g .yui-u,\r
-.yui-g .yui-g,\r
+.yui-g .yui-u, \r
+.yui-g .yui-g, \r
.yui-gc .yui-u,\r
.yui-gc .yui-g .yui-u,\r
-.yui-ge .yui-u,\r
+.yui-ge .yui-u, \r
.yui-gf .yui-u{float:right;display:inline;}\r
-.yui-g div.first,\r
+.yui-g div.first, \r
.yui-gc div.first,\r
.yui-gc div.first div.first,\r
-.yui-gd div.first,\r
-.yui-ge div.first,\r
+.yui-gd div.first, \r
+.yui-ge div.first, \r
.yui-gf div.first{float:left;}\r
-.yui-g .yui-u,\r
+.yui-g .yui-u, \r
.yui-g .yui-g{width:49.1%;}\r
.yui-g .yui-g .yui-u,\r
.yui-gc .yui-g .yui-u {width:48.1%;}\r
-.yui-gb .yui-u,\r
-.yui-gc .yui-u,\r
+.yui-gb .yui-u, \r
+.yui-gc .yui-u, \r
.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}\r
-.yui-gb div.first,\r
-.yui-gc div.first,\r
+.yui-gb div.first, \r
+.yui-gc div.first, \r
.yui-gd div.first{margin-left:0;}\r
-.yui-gc div.first,\r
+.yui-gc div.first, \r
.yui-gd .yui-u{width:66%;}\r
.yui-gd div.first{width:32%;}\r
.yui-ge .yui-u{width:24%;}\r
-.yui-ge div.first,\r
+.yui-ge div.first, \r
.yui-gf .yui-u{width:74.2%;}\r
.yui-gf div.first{width:24%;}\r
.yui-ge div.first{width:74.2%;}\r
#bd:after,\r
-.yui-g:after,\r
-.yui-gb:after,\r
-.yui-gc:after,\r
-.yui-gd:after,\r
-.yui-ge:after,\r
+.yui-g:after, \r
+.yui-gb:after, \r
+.yui-gc:after, \r
+.yui-gd:after, \r
+.yui-ge:after, \r
.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}\r
#bd,\r
-.yui-g,\r
-.yui-gb,\r
-.yui-gc,\r
-.yui-gd,\r
-.yui-ge,\r
+.yui-g, \r
+.yui-gb, \r
+.yui-gc, \r
+.yui-gd, \r
+.yui-ge, \r
.yui-gf{zoom:1;}
\ No newline at end of file
Logger Release Notes\r
\r
+*** version 0.12.1 ***\r
+\r
+* Fixed issues with setting LogReader's "bottom" property.\r
+\r
+\r
+\r
*** version 0.12.0 ***\r
\r
* Added method formatMsg(oLogMsg) to support custom formatting of log messages\r
\r
* By default, the Logger will not automatically output to Firebug or Safari's\r
JavaScript console. To enable this feature, implementers should now explicitly\r
-call\r
-YAHOO.widget.Logger.enableBrowserConsole().\r
+call YAHOO.widget.Logger.enableBrowserConsole().\r
\r
* Implementers may now cap the size of the YAHOO.widget.Logger stack by setting\r
the property YAHOO.widget.Logger.maxStackEntries.\r
*** version 0.11.0 ***\r
\r
* Initial release\r
-\r
+/*\r\r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r\r
+Code licensed under the BSD License:\r\r
+http://developer.yahoo.com/yui/license.txt\r\r
+version: 0.12.1\r\r
+*/\r\r
/* logger default styles */\r\r
/* font size is controlled here: default 77% */\r\r
#yui-log {position:absolute;top:1em;right:1em;font-size:77%;text-align:left;}\r\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r\r
Code licensed under the BSD License:\r\r
http://developer.yahoo.com/yui/license.txt\r\r
-version: 0.12.0\r\r
+version: 0.12.1\r\r
*/\r\r
\r\r
/****************************************************************************/\r\r
}\r\r
}\r\r
};\r\r
- \r\r
+\r\r
/////////////////////////////////////////////////////////////////////////////\r\r
//\r\r
// Public member variables\r\r
* @type String\r\r
*/\r\r
YAHOO.widget.LogMsg.prototype.msg = null;\r\r
- \r\r
+\r\r
/**\r\r
* Log timestamp.\r\r
*\r\r
if(this.width) {\r\r
containerStyle.width = this.width;\r\r
}\r\r
- if(this.left) {\r\r
- containerStyle.left = this.left;\r\r
- }\r\r
if(this.right) {\r\r
containerStyle.right = this.right;\r\r
}\r\r
- if(this.bottom) {\r\r
- containerStyle.bottom = this.bottom;\r\r
- }\r\r
if(this.top) {\r\r
containerStyle.top = this.top;\r\r
}\r\r
- if(this.fontSize) {\r\r
+ if(this.left) {\r\r
+ containerStyle.left = this.left;\r\r
+ containerStyle.right = "auto";\r\r
+ }\r\r
+ if(this.bottom) {\r\r
+ containerStyle.bottom = this.bottom;\r\r
+ containerStyle.top = "auto";\r\r
+ }\r\r
+ if(this.fontSize) {\r\r
containerStyle.fontSize = this.fontSize;\r\r
}\r\r
+ if(window.opera) {\r\r
+ document.body.style += '';\r\r
+ }\r\r
}\r\r
\r\r
if(this._elContainer) {\r\r
this._buffer = []; // output buffer\r\r
}\r\r
// Timestamp of last log message to console\r\r
- this._lastTime = YAHOO.widget.Logger.getStartTime(); \r\r
- \r\r
+ this._lastTime = YAHOO.widget.Logger.getStartTime();\r\r
+\r\r
// Subscribe to Logger custom events\r\r
YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog, this);\r\r
YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset, this);\r\r
*/\r\r
YAHOO.widget.LogReader.prototype.formatMsg = function(oLogMsg) {\r\r
var category = oLogMsg.category;\r\r
- \r\r
+\r\r
// Label for color-coded display\r\r
var label = category.substring(0,4).toUpperCase();\r\r
\r\r
var sourceDetail = oLogMsg.sourceDetail;\r\r
var sourceAndDetail = (sourceDetail) ?\r\r
source + " " + sourceDetail : source;\r\r
- \r\r
+\r\r
// Escape HTML entities in the log message itself for output to console\r\r
var msg = this.html2Text(oLogMsg.msg);\r\r
\r\r
else {\r\r
this._filterLogs();\r\r
}\r\r
- \r\r
+\r\r
if(!this.newestOnTop) {\r\r
this._elConsole.scrollTop = this._elConsole.scrollHeight;\r\r
}\r\r
thresholdMin = 0;\r\r
}\r\r
var entriesStartIndex = (entriesLen > thresholdMin) ? (entriesLen - thresholdMin) : 0;\r\r
- \r\r
- // Iterate through all log entries \r\r
+\r\r
+ // Iterate through all log entries\r\r
var sourceFiltersLen = this._sourceFilters.length;\r\r
var categoryFiltersLen = this._categoryFilters.length;\r\r
for(var i=entriesStartIndex; i<entriesLen; i++) {\r\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */\r\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.txt version: 0.12.1 */\r\r
YAHOO.widget.LogMsg=function(oConfigs){if(typeof oConfigs=="object"){for(var param in oConfigs){this[param]=oConfigs[param];}}};YAHOO.widget.LogMsg.prototype.msg=null;YAHOO.widget.LogMsg.prototype.time=null;YAHOO.widget.LogMsg.prototype.category=null;YAHOO.widget.LogMsg.prototype.source=null;YAHOO.widget.LogMsg.prototype.sourceDetail=null;YAHOO.widget.LogWriter=function(sSource){if(!sSource){YAHOO.log("Could not instantiate LogWriter due to invalid source.","error","LogWriter");return;}\r\r
this._source=sSource;};YAHOO.widget.LogWriter.prototype.toString=function(){return"LogWriter "+this._sSource;};YAHOO.widget.LogWriter.prototype.log=function(sMsg,sCategory){YAHOO.widget.Logger.log(sMsg,sCategory,this._source);};YAHOO.widget.LogWriter.prototype.getSource=function(){return this._sSource;};YAHOO.widget.LogWriter.prototype.setSource=function(sSource){if(!sSource){YAHOO.log("Could not set source due to invalid source.","error",this.toString());return;}\r\r
else{this._sSource=sSource;}};YAHOO.widget.LogWriter.prototype._source=null;YAHOO.widget.LogReader=function(elContainer,oConfigs){var oSelf=this;this._sName=YAHOO.widget.LogReader._index;YAHOO.widget.LogReader._index++;if(typeof oConfigs=="object"){for(var param in oConfigs){this[param]=oConfigs[param];}}\r\r
if(!this._elContainer){if(YAHOO.widget.LogReader._elDefaultContainer){this._elContainer=YAHOO.widget.LogReader._elDefaultContainer;}\r\r
else{this._elContainer=document.body.appendChild(document.createElement("div"));this._elContainer.id="yui-log";this._elContainer.className="yui-log";YAHOO.widget.LogReader._elDefaultContainer=this._elContainer;}\r\r
var containerStyle=this._elContainer.style;if(this.width){containerStyle.width=this.width;}\r\r
-if(this.left){containerStyle.left=this.left;}\r\r
if(this.right){containerStyle.right=this.right;}\r\r
-if(this.bottom){containerStyle.bottom=this.bottom;}\r\r
if(this.top){containerStyle.top=this.top;}\r\r
-if(this.fontSize){containerStyle.fontSize=this.fontSize;}}\r\r
+if(this.left){containerStyle.left=this.left;containerStyle.right="auto";}\r\r
+if(this.bottom){containerStyle.bottom=this.bottom;containerStyle.top="auto";}\r\r
+if(this.fontSize){containerStyle.fontSize=this.fontSize;}\r\r
+if(window.opera){document.body.style+='';}}\r\r
if(this._elContainer){if(!this._elHd){this._elHd=this._elContainer.appendChild(document.createElement("div"));this._elHd.id="yui-log-hd"+this._sName;this._elHd.className="yui-log-hd";this._elCollapse=this._elHd.appendChild(document.createElement("div"));this._elCollapse.className="yui-log-btns";this._btnCollapse=document.createElement("input");this._btnCollapse.type="button";this._btnCollapse.style.fontSize=YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");this._btnCollapse.className="yui-log-button";this._btnCollapse.value="Collapse";this._btnCollapse=this._elCollapse.appendChild(this._btnCollapse);YAHOO.util.Event.addListener(oSelf._btnCollapse,'click',oSelf._onClickCollapseBtn,oSelf);this._title=this._elHd.appendChild(document.createElement("h4"));this._title.innerHTML="Logger Console";if(YAHOO.util.DD&&(YAHOO.widget.LogReader._elDefaultContainer==this._elContainer)){var ylog_dd=new YAHOO.util.DD(this._elContainer.id);ylog_dd.setHandleElId(this._elHd.id);this._elHd.style.cursor="move";}}\r\r
if(!this._elConsole){this._elConsole=this._elContainer.appendChild(document.createElement("div"));this._elConsole.className="yui-log-bd";if(this.height){this._elConsole.style.height=this.height;}}\r\r
if(!this._elFt&&this.footerEnabled){this._elFt=this._elContainer.appendChild(document.createElement("div"));this._elFt.className="yui-log-ft";this._elBtns=this._elFt.appendChild(document.createElement("div"));this._elBtns.className="yui-log-btns";this._btnPause=document.createElement("input");this._btnPause.type="button";this._btnPause.style.fontSize=YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");this._btnPause.className="yui-log-button";this._btnPause.value="Pause";this._btnPause=this._elBtns.appendChild(this._btnPause);YAHOO.util.Event.addListener(oSelf._btnPause,'click',oSelf._onClickPauseBtn,oSelf);this._btnClear=document.createElement("input");this._btnClear.type="button";this._btnClear.style.fontSize=YAHOO.util.Dom.getStyle(this._elContainer,"fontSize");this._btnClear.className="yui-log-button";this._btnClear.value="Clear";this._btnClear=this._elBtns.appendChild(this._btnClear);YAHOO.util.Event.addListener(oSelf._btnClear,'click',oSelf._onClickClearBtn,oSelf);this._elCategoryFilters=this._elFt.appendChild(document.createElement("div"));this._elCategoryFilters.className="yui-log-categoryfilters";this._elSourceFilters=this._elFt.appendChild(document.createElement("div"));this._elSourceFilters.className="yui-log-sourcefilters";}}\r\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r\r
Code licensed under the BSD License:\r\r
http://developer.yahoo.com/yui/license.txt\r\r
-version: 0.12.0\r\r
+version: 0.12.1\r\r
*/\r\r
\r\r
/****************************************************************************/\r\r
}\r\r
}\r\r
};\r\r
- \r\r
+\r\r
/////////////////////////////////////////////////////////////////////////////\r\r
//\r\r
// Public member variables\r\r
* @type String\r\r
*/\r\r
YAHOO.widget.LogMsg.prototype.msg = null;\r\r
- \r\r
+\r\r
/**\r\r
* Log timestamp.\r\r
*\r\r
if(this.width) {\r\r
containerStyle.width = this.width;\r\r
}\r\r
- if(this.left) {\r\r
- containerStyle.left = this.left;\r\r
- }\r\r
if(this.right) {\r\r
containerStyle.right = this.right;\r\r
}\r\r
- if(this.bottom) {\r\r
- containerStyle.bottom = this.bottom;\r\r
- }\r\r
if(this.top) {\r\r
containerStyle.top = this.top;\r\r
}\r\r
- if(this.fontSize) {\r\r
+ if(this.left) {\r\r
+ containerStyle.left = this.left;\r\r
+ containerStyle.right = "auto";\r\r
+ }\r\r
+ if(this.bottom) {\r\r
+ containerStyle.bottom = this.bottom;\r\r
+ containerStyle.top = "auto";\r\r
+ }\r\r
+ if(this.fontSize) {\r\r
containerStyle.fontSize = this.fontSize;\r\r
}\r\r
+ if(window.opera) {\r\r
+ document.body.style += '';\r\r
+ }\r\r
}\r\r
\r\r
if(this._elContainer) {\r\r
this._buffer = []; // output buffer\r\r
}\r\r
// Timestamp of last log message to console\r\r
- this._lastTime = YAHOO.widget.Logger.getStartTime(); \r\r
- \r\r
+ this._lastTime = YAHOO.widget.Logger.getStartTime();\r\r
+\r\r
// Subscribe to Logger custom events\r\r
YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog, this);\r\r
YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset, this);\r\r
*/\r\r
YAHOO.widget.LogReader.prototype.formatMsg = function(oLogMsg) {\r\r
var category = oLogMsg.category;\r\r
- \r\r
+\r\r
// Label for color-coded display\r\r
var label = category.substring(0,4).toUpperCase();\r\r
\r\r
var sourceDetail = oLogMsg.sourceDetail;\r\r
var sourceAndDetail = (sourceDetail) ?\r\r
source + " " + sourceDetail : source;\r\r
- \r\r
+\r\r
// Escape HTML entities in the log message itself for output to console\r\r
var msg = this.html2Text(oLogMsg.msg);\r\r
\r\r
else {\r\r
this._filterLogs();\r\r
}\r\r
- \r\r
+\r\r
if(!this.newestOnTop) {\r\r
this._elConsole.scrollTop = this._elConsole.scrollHeight;\r\r
}\r\r
thresholdMin = 0;\r\r
}\r\r
var entriesStartIndex = (entriesLen > thresholdMin) ? (entriesLen - thresholdMin) : 0;\r\r
- \r\r
- // Iterate through all log entries \r\r
+\r\r
+ // Iterate through all log entries\r\r
var sourceFiltersLen = this._sourceFilters.length;\r\r
var categoryFiltersLen = this._categoryFilters.length;\r\r
for(var i=entriesStartIndex; i<entriesLen; i++) {\r\r
* Element reference\r
\r
* "hide" and "show" methods of statically positioned menus now toggle the their\r
- element's "display" style property between "block" and "none."
\ No newline at end of file
+ element's "display" style property between "block" and "none."\r
+ \r
+ \r
+*** version 0.12.1 ***\r
+\r
+Fixed the following bugs:\r
+-------------------------\r
+\r
+* Placed the call to the DOM "focus" method used by the MenuItem class inside \r
+ a zero-second timeout to resolve a race condition between menu positioning \r
+ and focusing of a menu item that resulted in the browser viewport \r
+ scrolling unnecessarily.\r
+\r
+* Switched to JSMin for JavaScript compression to resolve issues with the \r
+ minified version. \r
+\r
+* Disabled menu item instances will no longer display a submenu if the item is \r
+ clicked or moused over. \r
+\r
+* Can no longer select more than one item in a menu if using the keyboard and \r
+ mouse simultaneously.\r
+\r
+* Calling the "destory" method on a menu will now unregister all of the menu's \r
+ submenus from the MenuManager.
\ No newline at end of file
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.com/yui/license.txt\r
-Version: 0.12\r
+Version: 0.12.1\r
*/\r
\r
\r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.com/yui/license.txt\r
-version: 0.12.0\r
+version: 0.12.1\r
*/\r
\r
+\r
+\r
/**\r
* @module menu\r
* @description <p>The Menu Library features a collection of widgets that make\r
*/\r
(function() {\r
\r
-var Dom = YAHOO.util.Dom;\r
-var Event = YAHOO.util.Event;\r
+var Dom = YAHOO.util.Dom,\r
+ Event = YAHOO.util.Event;\r
\r
/**\r
* Singleton that manages a collection of all menus and menu items. Listens for\r
* @class MenuManager\r
* @static\r
*/\r
-YAHOO.widget.MenuManager = new function() {\r
+YAHOO.widget.MenuManager = function() {\r
\r
// Private member variables\r
\r
\r
// Flag indicating if the DOM event handlers have been attached\r
\r
- var m_bInitializedEventHandlers = false;\r
+ var m_bInitializedEventHandlers = false,\r
\r
\r
- // Collection of menus\r
+ // Collection of menus\r
\r
- var m_oMenus = {};\r
+ m_oMenus = {},\r
\r
\r
- // Collection of menu items\r
+ // Collection of menu items\r
\r
- var m_oItems = {};\r
+ m_oItems = {},\r
\r
\r
- // Collection of visible menus\r
+ // Collection of visible menus\r
\r
- var m_oVisibleMenus = {};\r
+ m_oVisibleMenus = {},\r
\r
\r
- // Logger\r
+ // Logger\r
\r
- var m_oLogger = new YAHOO.widget.LogWriter(this.toString());\r
+ m_oLogger = new YAHOO.widget.LogWriter(this.toString()),\r
\r
\r
+ me = this;\r
+\r
\r
// Private methods\r
\r
\r
/**\r
- * Adds an item to the collection of known menu items.\r
+ * @method addItem\r
+ * @description Adds an item to the collection of known menu items.\r
* @private\r
* @param {YAHOO.widget.MenuItem} p_oItem Object specifying the MenuItem\r
* instance to be added.\r
*/\r
- var addItem = function(p_oItem) {\r
+ function addItem(p_oItem) {\r
\r
var sYUIId = Dom.generateId();\r
\r
\r
}\r
\r
- };\r
+ }\r
\r
\r
/**\r
- * Removes an item from the collection of known menu items.\r
+ * @method removeItem\r
+ * @description Removes an item from the collection of known menu items.\r
* @private\r
* @param {YAHOO.widget.MenuItem} p_oItem Object specifying the MenuItem\r
* instance to be removed.\r
*/\r
- var removeItem = function(p_oItem) {\r
+ function removeItem(p_oItem) {\r
\r
var sYUIId = p_oItem.element.getAttribute("yuiid");\r
\r
\r
}\r
\r
- };\r
+ }\r
\r
\r
/**\r
- * Finds the root DIV node of a menu or the root LI node of a menu item.\r
+ * @method getMenuRootElement\r
+ * @description Finds the root DIV node of a menu or the root LI node of a\r
+ * menu item.\r
* @private\r
* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
* one-html.html#ID-58190037">HTMLElement</a>} p_oElement Object specifying\r
* an HTML element.\r
*/\r
- var getMenuRootElement = function(p_oElement) {\r
+ function getMenuRootElement(p_oElement) {\r
\r
var oParentNode;\r
\r
\r
}\r
\r
- };\r
+ }\r
\r
\r
\r
\r
\r
/**\r
- * Generic, global event handler for all of a menu's DOM-based\r
+ * @method onDOMEvent\r
+ * @description Generic, global event handler for all of a menu's DOM-based\r
* events. This listens for events against the document object. If the\r
* target of a given event is a member of a menu or menu item's DOM, the\r
* instance's corresponding Custom Event is fired.\r
* @param {Event} p_oEvent Object representing the DOM event object passed\r
* back by the event utility (YAHOO.util.Event).\r
*/\r
- var onDOMEvent = function(p_oEvent) {\r
+ function onDOMEvent(p_oEvent) {\r
\r
// Get the target node of the DOM event\r
\r
- var oTarget = Event.getTarget(p_oEvent);\r
+ var oTarget = Event.getTarget(p_oEvent),\r
\r
\r
// See if the target of the event was a menu, or a menu item\r
\r
- var oElement = getMenuRootElement(oTarget);\r
-\r
- var oMenuItem;\r
- var oMenu;\r
+ oElement = getMenuRootElement(oTarget),\r
+ oMenuItem,\r
+ oMenu;\r
\r
\r
if(oElement) {\r
"keydown": "keyDownEvent",\r
"keyup": "keyUpEvent",\r
"keypress": "keyPressEvent"\r
- };\r
+ },\r
\r
- var sCustomEventType = oEventTypes[p_oEvent.type];\r
+ sCustomEventType = oEventTypes[p_oEvent.type];\r
\r
\r
// Fire the Custom Even that corresponds the current DOM event\r
\r
}\r
\r
- };\r
+ }\r
\r
\r
/**\r
- * "destroy" event handler for a menu.\r
+ * @method onMenuDestroy\r
+ * @description "destroy" event handler for a menu.\r
* @private\r
* @param {String} p_sType String representing the name of the event that\r
* was fired.\r
* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
* fired the event.\r
*/\r
- var onMenuDestroy = function(p_sType, p_aArgs, p_oMenu) {\r
+ function onMenuDestroy(p_sType, p_aArgs, p_oMenu) {\r
\r
- this.removeMenu(p_oMenu);\r
+ if(p_oMenu && m_oMenus[p_oMenu.id]) {\r
\r
- };\r
+ delete m_oMenus[p_oMenu.id];\r
+\r
+ m_oLogger.log("Menu: " +\r
+ p_oMenu.toString() + " successfully unregistered.");\r
+\r
+ }\r
+\r
+ }\r
\r
\r
/**\r
- * "destroy" event handler for a MenuItem instance.\r
+ * @method onItemDestroy\r
+ * @description "destroy" event handler for a MenuItem instance.\r
* @private\r
* @param {String} p_sType String representing the name of the event that\r
* was fired.\r
* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
* that fired the event.\r
*/\r
- var onItemDestroy = function(p_sType, p_aArgs, p_oItem) {\r
+ function onItemDestroy(p_sType, p_aArgs, p_oItem) {\r
\r
var sYUIId = p_oItem.element.getAttribute("yuiid");\r
\r
\r
}\r
\r
- };\r
+ }\r
\r
\r
/**\r
- * Event handler for when the "visible" configuration property\r
+ * @method onMenuVisibleConfigChange\r
+ * @description Event handler for when the "visible" configuration property\r
* of a Menu instance changes.\r
* @private\r
* @param {String} p_sType String representing the name of the event that\r
* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
* fired the event.\r
*/\r
- var onMenuVisibleConfigChange = function(p_sType, p_aArgs, p_oMenu) {\r
+ function onMenuVisibleConfigChange(p_sType, p_aArgs, p_oMenu) {\r
\r
var bVisible = p_aArgs[0];\r
\r
\r
m_oLogger.log("Menu: " +\r
p_oMenu.toString() +\r
- " unregistered from the collection of visible menus.");\r
-\r
- }\r
-\r
- };\r
-\r
-\r
- /**\r
- * "itemadded" event handler for a Menu instance.\r
- * @private\r
- * @param {String} p_sType String representing the name of the event that\r
- * was fired.\r
- * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
- */\r
- var onItemAdded = function(p_sType, p_aArgs) {\r
-\r
- addItem(p_aArgs[0]);\r
-\r
- };\r
-\r
-\r
- /**\r
- * "itemremoved" event handler for a Menu instance.\r
- * @private\r
- * @param {String} p_sType String representing the name of the event that\r
- * was fired.\r
- * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
- */\r
- var onItemRemoved = function(p_sType, p_aArgs) {\r
-\r
- removeItem(p_aArgs[0]);\r
-\r
- };\r
-\r
-\r
-\r
- // Privileged methods\r
-\r
-\r
- /**\r
- * @method addMenu\r
- * @description Adds a menu to the collection of known menus.\r
- * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu instance\r
- * to be added.\r
- */\r
- this.addMenu = function(p_oMenu) {\r
-\r
- if(p_oMenu && p_oMenu.id && !m_oMenus[p_oMenu.id]) {\r
-\r
- m_oMenus[p_oMenu.id] = p_oMenu;\r
-\r
-\r
- if(!m_bInitializedEventHandlers) {\r
-\r
- var oDoc = document;\r
-\r
- Event.addListener(oDoc, "mouseover", onDOMEvent, this, true);\r
- Event.addListener(oDoc, "mouseout", onDOMEvent, this, true);\r
- Event.addListener(oDoc, "mousedown", onDOMEvent, this, true);\r
- Event.addListener(oDoc, "mouseup", onDOMEvent, this, true);\r
- Event.addListener(oDoc, "click", onDOMEvent, this, true);\r
- Event.addListener(oDoc, "keydown", onDOMEvent, this, true);\r
- Event.addListener(oDoc, "keyup", onDOMEvent, this, true);\r
- Event.addListener(oDoc, "keypress", onDOMEvent, this, true);\r
-\r
- m_bInitializedEventHandlers = true;\r
-\r
- m_oLogger.log("DOM event handlers initialized.");\r
-\r
- }\r
-\r
- p_oMenu.destroyEvent.subscribe(onMenuDestroy, p_oMenu, this);\r
-\r
- p_oMenu.cfg.subscribeToConfigEvent(\r
- "visible",\r
- onMenuVisibleConfigChange,\r
- p_oMenu\r
- );\r
-\r
- p_oMenu.itemAddedEvent.subscribe(onItemAdded);\r
- p_oMenu.itemRemovedEvent.subscribe(onItemRemoved);\r
-\r
- m_oLogger.log("Menu: " +\r
- p_oMenu.toString() + " successfully registered.");\r
-\r
- }\r
-\r
- };\r
-\r
-\r
- /**\r
- * @method removeMenu\r
- * @description Removes a menu from the collection of known menus.\r
- * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu instance\r
- * to be removed.\r
- */\r
- this.removeMenu = function(p_oMenu) {\r
-\r
- if(p_oMenu && m_oMenus[p_oMenu.id]) {\r
-\r
- delete m_oMenus[p_oMenu.id];\r
-\r
- m_oLogger.log("Menu: " +\r
- p_oMenu.toString() + " successfully unregistered.");\r
-\r
- }\r
-\r
- };\r
-\r
-\r
- /**\r
- * @method hideVisible\r
- * @description Hides all visible, dynamically positioned menus.\r
- */\r
- this.hideVisible = function() {\r
-\r
- var oMenu;\r
-\r
- for(var i in m_oVisibleMenus) {\r
-\r
- if(m_oVisibleMenus.hasOwnProperty(i)) {\r
-\r
- oMenu = m_oVisibleMenus[i];\r
-\r
- if(oMenu.cfg.getProperty("position") == "dynamic") {\r
-\r
- oMenu.hide();\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
- };\r
-\r
-\r
- /**\r
- * @method getMenus\r
- * @description Returns an array of all menus registered with the\r
- * menu manger.\r
- * @return {Array}\r
- */\r
- this.getMenus = function() {\r
-\r
- return m_oMenus;\r
-\r
- };\r
-\r
-\r
- /**\r
- * @method getMenu\r
- * @description Returns a menu with the specified id.\r
- * @param {String} p_sId String specifying the id of the menu to\r
- * be retrieved.\r
- * @return {YAHOO.widget.Menu}\r
- */\r
- this.getMenu = function(p_sId) {\r
-\r
- if(m_oMenus[p_sId]) {\r
-\r
- return m_oMenus[p_sId];\r
-\r
- }\r
-\r
- };\r
-\r
-\r
- /**\r
- * @method toString\r
- * @description Returns a string representing the menu manager.\r
- * @return {String}\r
- */\r
- this.toString = function() {\r
-\r
- return ("MenuManager");\r
-\r
- };\r
-\r
-};\r
-\r
-})();\r
-\r
-\r
-(function() {\r
-\r
-var Dom = YAHOO.util.Dom;\r
-var Event = YAHOO.util.Event;\r
-\r
-\r
-/**\r
-* The Menu class creates a container that holds a vertical list representing\r
-* a set of options or commands. Menu is the base class for all\r
-* menu containers.\r
-* @param {String} p_oElement String specifying the id attribute of the\r
-* <code><div></code> element of the menu.\r
-* @param {String} p_oElement String specifying the id attribute of the\r
-* <code><select></code> element to be used as the data source\r
-* for the menu.\r
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
-* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object\r
-* specifying the <code><div></code> element of the menu.\r
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
-* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement\r
-* Object specifying the <code><select></code> element to be used as\r
-* the data source for the menu.\r
-* @param {Object} p_oConfig Optional. Object literal specifying the\r
-* configuration for the menu. See configuration class documentation for\r
-* more details.\r
-* @namespace YAHOO.widget\r
-* @class Menu\r
-* @constructor\r
-* @extends YAHOO.widget.Overlay\r
-*/\r
-YAHOO.widget.Menu = function(p_oElement, p_oConfig) {\r
-\r
- if(p_oConfig) {\r
-\r
- this.parent = p_oConfig.parent;\r
-\r
- this.lazyLoad = p_oConfig.lazyLoad || p_oConfig.lazyload;\r
-\r
- this.itemData = p_oConfig.itemData || p_oConfig.itemdata;\r
-\r
- }\r
-\r
-\r
- YAHOO.widget.Menu.superclass.constructor.call(\r
- this,\r
- p_oElement,\r
- p_oConfig\r
- );\r
-\r
-};\r
-\r
-YAHOO.extend(YAHOO.widget.Menu, YAHOO.widget.Overlay, {\r
-\r
-\r
-\r
-// Constants\r
-\r
-\r
-/**\r
-* @property CSS_CLASS_NAME\r
-* @description String representing the CSS class(es) to be applied to the\r
-* menu's <code><div></code> element.\r
-* @default "yuimenu"\r
-* @final\r
-* @type String\r
-*/\r
-CSS_CLASS_NAME: "yuimenu",\r
-\r
-\r
-/**\r
-* @property ITEM_TYPE\r
-* @description Object representing the type of menu item to instantiate and\r
-* add when parsing the child nodes (either <code><li></code> element,\r
-* <code><optgroup></code> element or <code><option></code>)\r
-* of the menu's source HTML element.\r
-* @default YAHOO.widget.MenuItem\r
-* @final\r
-* @type YAHOO.widget.MenuItem\r
-*/\r
-ITEM_TYPE: null,\r
-\r
-\r
-/**\r
-* @property GROUP_TITLE_TAG_NAME\r
-* @description String representing the tagname of the HTML element used to\r
-* title the menu's item groups.\r
-* @default H6\r
-* @final\r
-* @type String\r
-*/\r
-GROUP_TITLE_TAG_NAME: "h6",\r
-\r
-\r
-\r
-// Private properties\r
-\r
-\r
-/**\r
-* @property _nHideDelayId\r
-* @description Number representing the time-out setting used to cancel the\r
-* hiding of a menu.\r
-* @default null\r
-* @private\r
-* @type Number\r
-*/\r
-_nHideDelayId: null,\r
-\r
-\r
-/**\r
-* @property _nShowDelayId\r
-* @description Number representing the time-out setting used to cancel the\r
-* showing of a menu.\r
-* @default null\r
-* @private\r
-* @type Number\r
-*/\r
-_nShowDelayId: null,\r
-\r
-\r
-/**\r
-* @property _hideDelayEventHandlersAssigned\r
-* @description Boolean indicating if the "mouseover" and "mouseout" event\r
-* handlers used for hiding the menu via a call to "window.setTimeout" have\r
-* already been assigned.\r
-* @default false\r
-* @private\r
-* @type Boolean\r
-*/\r
-_hideDelayEventHandlersAssigned: false,\r
-\r
-\r
-/**\r
-* @property _bHandledMouseOverEvent\r
-* @description Boolean indicating the current state of the menu's\r
-* "mouseover" event.\r
-* @default false\r
-* @private\r
-* @type Boolean\r
-*/\r
-_bHandledMouseOverEvent: false,\r
-\r
-\r
-/**\r
-* @property _bHandledMouseOutEvent\r
-* @description Boolean indicating the current state of the menu's\r
-* "mouseout" event.\r
-* @default false\r
-* @private\r
-* @type Boolean\r
-*/\r
-_bHandledMouseOutEvent: false,\r
-\r
-\r
-/**\r
-* @property _aGroupTitleElements\r
-* @description Array of HTML element used to title groups of menu items.\r
-* @default []\r
-* @private\r
-* @type Array\r
-*/\r
-_aGroupTitleElements: null,\r
-\r
-\r
-/**\r
-* @property _aItemGroups\r
-* @description Array of menu items.\r
-* @default []\r
-* @private\r
-* @type Array\r
-*/\r
-_aItemGroups: null,\r
-\r
-\r
-/**\r
-* @property _aListElements\r
-* @description Array of <code><ul></code> elements, each of which is\r
-* the parent node for each item's <code><li></code> element.\r
-* @default []\r
-* @private\r
-* @type Array\r
-*/\r
-_aListElements: null,\r
-\r
-\r
-\r
-// Public properties\r
-\r
-\r
-/**\r
-* @property lazyLoad\r
-* @description Boolean indicating if the menu's "lazy load" feature is\r
-* enabled. If set to "true," initialization and rendering of the menu's\r
-* items will be deferred until the first time it is made visible. This\r
-* property should be set via the constructor using the configuration\r
-* object literal.\r
-* @default false\r
-* @type Boolean\r
-*/\r
-lazyLoad: false,\r
-\r
-\r
-/**\r
-* @property itemData\r
-* @description Array of items to be added to the menu. The array can contain\r
-* strings representing the text for each item to be created, object literals\r
-* representing the menu item configuration properties, or MenuItem instances.\r
-* This property should be set via the constructor using the configuration\r
-* object literal.\r
-* @default null\r
-* @type Array\r
-*/\r
-itemData: null,\r
-\r
-\r
-/**\r
-* @property activeItem\r
-* @description Object reference to the item in the menu that has focus.\r
-* @default null\r
-* @type YAHOO.widget.MenuItem\r
-*/\r
-activeItem: null,\r
-\r
-\r
-/**\r
-* @property parent\r
-* @description Object reference to the menu's parent menu or menu item.\r
-* This property can be set via the constructor using the configuration\r
-* object literal.\r
-* @default null\r
-* @type YAHOO.widget.MenuItem\r
-*/\r
-parent: null,\r
-\r
-\r
-/**\r
-* @property srcElement\r
-* @description Object reference to the HTML element (either\r
-* <code><select></code> or <code><div></code>) used to\r
-* create the menu.\r
-* @default null\r
-* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
-* level-one-html.html#ID-94282980">HTMLSelectElement</a>|<a\r
-* href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.\r
-* html#ID-22445964">HTMLDivElement</a>\r
-*/\r
-srcElement: null,\r
-\r
-\r
-\r
-// Events\r
-\r
-\r
-/**\r
-* @event mouseOverEvent\r
-* @description Fires when the mouse has entered the menu. Passes back\r
-* the DOM Event object as an argument.\r
-*/\r
-mouseOverEvent: null,\r
-\r
-\r
-/**\r
-* @event mouseOutEvent\r
-* @description Fires when the mouse has left the menu. Passes back the DOM\r
-* Event object as an argument.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-mouseOutEvent: null,\r
-\r
-\r
-/**\r
-* @event mouseDownEvent\r
-* @description Fires when the user mouses down on the menu. Passes back the\r
-* DOM Event object as an argument.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-mouseDownEvent: null,\r
-\r
-\r
-/**\r
-* @event mouseUpEvent\r
-* @description Fires when the user releases a mouse button while the mouse is\r
-* over the menu. Passes back the DOM Event object as an argument.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-mouseUpEvent: null,\r
-\r
-\r
-/**\r
-* @event clickEvent\r
-* @description Fires when the user clicks the on the menu. Passes back the\r
-* DOM Event object as an argument.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-clickEvent: null,\r
-\r
-\r
-/**\r
-* @event keyPressEvent\r
-* @description Fires when the user presses an alphanumeric key when one of the\r
-* menu's items has focus. Passes back the DOM Event object as an argument.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-keyPressEvent: null,\r
-\r
-\r
-/**\r
-* @event keyDownEvent\r
-* @description Fires when the user presses a key when one of the menu's items\r
-* has focus. Passes back the DOM Event object as an argument.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-keyDownEvent: null,\r
-\r
-\r
-/**\r
-* @event keyUpEvent\r
-* @description Fires when the user releases a key when one of the menu's items\r
-* has focus. Passes back the DOM Event object as an argument.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-keyUpEvent: null,\r
-\r
-\r
-/**\r
-* @event itemAddedEvent\r
-* @description Fires when an item is added to the menu.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-itemAddedEvent: null,\r
-\r
-\r
-/**\r
-* @event itemRemovedEvent\r
-* @description Fires when an item is removed to the menu.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-itemRemovedEvent: null,\r
-\r
-\r
-/**\r
-* @method init\r
-* @description The Menu class's initialization method. This method is\r
-* automatically called by the constructor, and sets up all DOM references\r
-* for pre-existing markup, and creates required markup if it is not\r
-* already present.\r
-* @param {String} p_oElement String specifying the id attribute of the\r
-* <code><div></code> element of the menu.\r
-* @param {String} p_oElement String specifying the id attribute of the\r
-* <code><select></code> element to be used as the data source\r
-* for the menu.\r
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
-* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object\r
-* specifying the <code><div></code> element of the menu.\r
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
-* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement\r
-* Object specifying the <code><select></code> element to be used as\r
-* the data source for the menu.\r
-* @param {Object} p_oConfig Optional. Object literal specifying the\r
-* configuration for the menu. See configuration class documentation for\r
-* more details.\r
-*/\r
-init: function(p_oElement, p_oConfig) {\r
-\r
- this._aItemGroups = [];\r
- this._aListElements = [];\r
- this._aGroupTitleElements = [];\r
-\r
-\r
- if(!this.ITEM_TYPE) {\r
-\r
- this.ITEM_TYPE = YAHOO.widget.MenuItem;\r
-\r
- }\r
-\r
-\r
- var oElement;\r
-\r
- if(typeof p_oElement == "string") {\r
-\r
- oElement = document.getElementById(p_oElement);\r
-\r
- }\r
- else if(p_oElement.tagName) {\r
-\r
- oElement = p_oElement;\r
-\r
- }\r
-\r
-\r
- if(oElement && oElement.tagName) {\r
-\r
- switch(oElement.tagName.toUpperCase()) {\r
-\r
- case "DIV":\r
-\r
- this.srcElement = oElement;\r
-\r
- if(!oElement.id) {\r
-\r
- oElement.setAttribute("id", Dom.generateId());\r
-\r
- }\r
-\r
-\r
- /*\r
- Note: we don't pass the user config in here yet\r
- because we only want it executed once, at the lowest\r
- subclass level.\r
- */\r
-\r
- YAHOO.widget.Menu.superclass.init.call(this, oElement);\r
-\r
- this.beforeInitEvent.fire(YAHOO.widget.Menu);\r
-\r
- this.logger = new YAHOO.widget.LogWriter(this.toString());\r
-\r
- this.logger.log("Source element: " + this.srcElement.tagName);\r
-\r
- break;\r
-\r
- case "SELECT":\r
-\r
- this.srcElement = oElement;\r
-\r
-\r
- /*\r
- The source element is not something that we can use\r
- outright, so we need to create a new Overlay\r
-\r
- Note: we don't pass the user config in here yet\r
- because we only want it executed once, at the lowest\r
- subclass level.\r
- */\r
-\r
- YAHOO.widget.Menu.superclass.init.call(this, Dom.generateId());\r
-\r
- this.beforeInitEvent.fire(YAHOO.widget.Menu);\r
-\r
- this.logger = new YAHOO.widget.LogWriter(this.toString());\r
-\r
- this.logger.log("Source element: " + this.srcElement.tagName);\r
-\r
- break;\r
-\r
- }\r
-\r
- }\r
- else {\r
-\r
- /*\r
- Note: we don't pass the user config in here yet\r
- because we only want it executed once, at the lowest\r
- subclass level.\r
- */\r
-\r
- YAHOO.widget.Menu.superclass.init.call(this, p_oElement);\r
-\r
- this.beforeInitEvent.fire(YAHOO.widget.Menu);\r
-\r
- this.logger = new YAHOO.widget.LogWriter(this.toString());\r
-\r
- this.logger.log("No source element found. " +\r
- "Created element with id: " + this.id);\r
-\r
- }\r
-\r
-\r
- if(this.element) {\r
-\r
- var oEl = this.element;\r
-\r
- Dom.addClass(oEl, this.CSS_CLASS_NAME);\r
-\r
-\r
- // Subscribe to Custom Events\r
-\r
- this.initEvent.subscribe(this._onInit, this, true);\r
- this.beforeRenderEvent.subscribe(this._onBeforeRender, this, true);\r
- this.renderEvent.subscribe(this._onRender, this, true);\r
- this.beforeShowEvent.subscribe(this._onBeforeShow, this, true);\r
- this.showEvent.subscribe(this._onShow, this, true);\r
- this.beforeHideEvent.subscribe(this._onBeforeHide, this, true);\r
- this.mouseOverEvent.subscribe(this._onMouseOver, this, true);\r
- this.mouseOutEvent.subscribe(this._onMouseOut, this, true);\r
- this.clickEvent.subscribe(this._onClick, this, true);\r
- this.keyDownEvent.subscribe(this._onKeyDown, this, true);\r
-\r
-\r
- if(p_oConfig) {\r
-\r
- this.cfg.applyConfig(p_oConfig, true);\r
-\r
- }\r
-\r
-\r
- // Register the Menu instance with the MenuManager\r
-\r
- YAHOO.widget.MenuManager.addMenu(this);\r
-\r
-\r
- this.initEvent.fire(YAHOO.widget.Menu);\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-\r
-// Private methods\r
-\r
-\r
-/**\r
-* @method _initSubTree\r
-* @description Iterates the childNodes of the source element to find nodes\r
-* used to instantiate menu and menu items.\r
-* @private\r
-*/\r
-_initSubTree: function() {\r
-\r
- var oNode;\r
-\r
- if(this.srcElement.tagName == "DIV") {\r
-\r
- /*\r
- Populate the collection of item groups and item\r
- group titles\r
- */\r
-\r
- oNode = this.body.firstChild;\r
-\r
- var nGroup = 0;\r
- var sGroupTitleTagName = this.GROUP_TITLE_TAG_NAME.toUpperCase();\r
-\r
- do {\r
-\r
- if(oNode && oNode.tagName) {\r
-\r
- switch(oNode.tagName.toUpperCase()) {\r
-\r
- case sGroupTitleTagName:\r
-\r
- this._aGroupTitleElements[nGroup] = oNode;\r
-\r
- break;\r
-\r
- case "UL":\r
-\r
- this._aListElements[nGroup] = oNode;\r
- this._aItemGroups[nGroup] = [];\r
- nGroup++;\r
-\r
- break;\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
- while((oNode = oNode.nextSibling));\r
-\r
-\r
- /*\r
- Apply the "first-of-type" class to the first UL to mimic\r
- the "first-of-type" CSS3 psuedo class.\r
- */\r
-\r
- if(this._aListElements[0]) {\r
-\r
- Dom.addClass(this._aListElements[0], "first-of-type");\r
-\r
- }\r
-\r
- }\r
-\r
-\r
- oNode = null;\r
-\r
- this.logger.log("Searching DOM for items to initialize.");\r
-\r
- if(this.srcElement.tagName) {\r
-\r
- switch(this.srcElement.tagName.toUpperCase()) {\r
-\r
- case "DIV":\r
-\r
- if(this._aListElements.length > 0) {\r
-\r
- this.logger.log("Found " +\r
- this._aListElements.length +\r
- " item groups to initialize.");\r
-\r
- var i = this._aListElements.length - 1;\r
-\r
- do {\r
-\r
- oNode = this._aListElements[i].firstChild;\r
-\r
- this.logger.log("Scanning " +\r
- this._aListElements[i].childNodes.length +\r
- " child nodes for items to initialize.");\r
-\r
- do {\r
-\r
- if(oNode && oNode.tagName) {\r
-\r
- switch(oNode.tagName.toUpperCase()) {\r
-\r
- case "LI":\r
-\r
- this.logger.log("Initializing " +\r
- oNode.tagName + " node.");\r
-\r
- this.addItem(\r
- new this.ITEM_TYPE(\r
- oNode,\r
- { parent: this }\r
- ),\r
- i\r
- );\r
-\r
- break;\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
- while((oNode = oNode.nextSibling));\r
-\r
- }\r
- while(i--);\r
-\r
- }\r
-\r
- break;\r
-\r
- case "SELECT":\r
-\r
- this.logger.log("Scanning " +\r
- this.srcElement.childNodes.length +\r
- " child nodes for items to initialize.");\r
-\r
- oNode = this.srcElement.firstChild;\r
-\r
- do {\r
-\r
- if(oNode && oNode.tagName) {\r
-\r
- switch(oNode.tagName.toUpperCase()) {\r
-\r
- case "OPTGROUP":\r
- case "OPTION":\r
-\r
- this.logger.log("Initializing " +\r
- oNode.tagName + " node.");\r
-\r
- this.addItem(\r
- new this.ITEM_TYPE(\r
- oNode,\r
- { parent: this }\r
- )\r
- );\r
-\r
- break;\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
- while((oNode = oNode.nextSibling));\r
-\r
- break;\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _getFirstEnabledItem\r
-* @description Returns the first enabled item in the menu.\r
-* @return {YAHOO.widget.MenuItem}\r
-* @private\r
-*/\r
-_getFirstEnabledItem: function() {\r
-\r
- var nGroups = this._aItemGroups.length;\r
- var oItem;\r
- var aItemGroup;\r
-\r
- for(var i=0; i<nGroups; i++) {\r
-\r
- aItemGroup = this._aItemGroups[i];\r
-\r
- if(aItemGroup) {\r
-\r
- var nItems = aItemGroup.length;\r
-\r
- for(var n=0; n<nItems; n++) {\r
-\r
- oItem = aItemGroup[n];\r
-\r
- if(\r
- !oItem.cfg.getProperty("disabled") &&\r
- oItem.element.style.display != "none"\r
- ) {\r
-\r
- return oItem;\r
-\r
- }\r
-\r
- oItem = null;\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _checkPosition\r
-* @description Checks to make sure that the value of the "position" property\r
-* is one of the supported strings. Returns true if the position is supported.\r
-* @private\r
-* @param {Object} p_sPosition String specifying the position of the menu.\r
-* @return {Boolean}\r
-*/\r
-_checkPosition: function(p_sPosition) {\r
-\r
- if(typeof p_sPosition == "string") {\r
-\r
- var sPosition = p_sPosition.toLowerCase();\r
-\r
- return ("dynamic,static".indexOf(sPosition) != -1);\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _addItemToGroup\r
-* @description Adds a menu item to a group.\r
-* @private\r
-* @param {Number} p_nGroupIndex Number indicating the group to which the\r
-* item belongs.\r
-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
-* instance to be added to the menu.\r
-* @param {String} p_oItem String specifying the text of the item to be added\r
-* to the menu.\r
-* @param {Object} p_oItem Object literal containing a set of menu item\r
-* configuration properties.\r
-* @param {Number} p_nItemIndex Optional. Number indicating the index at\r
-* which the menu item should be added.\r
-* @return {YAHOO.widget.MenuItem}\r
-*/\r
-_addItemToGroup: function(p_nGroupIndex, p_oItem, p_nItemIndex) {\r
-\r
- var oItem;\r
-\r
- if(p_oItem instanceof this.ITEM_TYPE) {\r
-\r
- oItem = p_oItem;\r
- oItem.parent = this;\r
-\r
- }\r
- else if(typeof p_oItem == "string") {\r
-\r
- oItem = new this.ITEM_TYPE(p_oItem, { parent: this });\r
-\r
- }\r
- else if(typeof p_oItem == "object" && p_oItem.text) {\r
-\r
- var sText = p_oItem.text;\r
-\r
- delete p_oItem["text"];\r
-\r
- p_oItem.parent = this;\r
-\r
- oItem = new this.ITEM_TYPE(sText, p_oItem);\r
-\r
- }\r
-\r
-\r
- if(oItem) {\r
-\r
- var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;\r
-\r
- var aGroup = this._getItemGroup(nGroupIndex);\r
-\r
- var oGroupItem;\r
-\r
-\r
- if(!aGroup) {\r
-\r
- aGroup = this._createItemGroup(nGroupIndex);\r
-\r
- }\r
-\r
-\r
- if(typeof p_nItemIndex == "number") {\r
-\r
- var bAppend = (p_nItemIndex >= aGroup.length);\r
-\r
-\r
- if(aGroup[p_nItemIndex]) {\r
-\r
- aGroup.splice(p_nItemIndex, 0, oItem);\r
-\r
- }\r
- else {\r
-\r
- aGroup[p_nItemIndex] = oItem;\r
-\r
- }\r
-\r
-\r
- oGroupItem = aGroup[p_nItemIndex];\r
-\r
- if(oGroupItem) {\r
-\r
- if(\r
- bAppend &&\r
- (\r
- !oGroupItem.element.parentNode ||\r
- oGroupItem.element.parentNode.nodeType == 11\r
- )\r
- ) {\r
-\r
- this._aListElements[nGroupIndex].appendChild(\r
- oGroupItem.element\r
- );\r
-\r
- }\r
- else {\r
-\r
-\r
- /**\r
- * Returns the next sibling of an item in an array.\r
- * @private\r
- * @param {p_aArray} Array to search.\r
- * @param {p_nStartIndex} Number indicating the index to\r
- * start searching the array.\r
- * @return {Object}\r
- */\r
- var getNextItemSibling =\r
-\r
- function(p_aArray, p_nStartIndex) {\r
-\r
- return (\r
- p_aArray[p_nStartIndex] ||\r
- getNextItemSibling(\r
- p_aArray,\r
- (p_nStartIndex+1)\r
- )\r
- );\r
-\r
- };\r
-\r
-\r
- var oNextItemSibling =\r
- getNextItemSibling(aGroup, (p_nItemIndex+1));\r
-\r
- if(\r
- oNextItemSibling &&\r
- (\r
- !oGroupItem.element.parentNode ||\r
- oGroupItem.element.parentNode.nodeType == 11\r
- )\r
- ) {\r
-\r
- this._aListElements[nGroupIndex].insertBefore(\r
- oGroupItem.element,\r
- oNextItemSibling.element\r
- );\r
-\r
- }\r
-\r
- }\r
-\r
-\r
- oGroupItem.parent = this;\r
-\r
- this._subscribeToItemEvents(oGroupItem);\r
-\r
- this._configureSubmenu(oGroupItem);\r
-\r
- this._updateItemProperties(nGroupIndex);\r
-\r
- this.logger.log("Item inserted." +\r
- " Text: " + oGroupItem.cfg.getProperty("text") + ", " +\r
- " Index: " + oGroupItem.index + ", " +\r
- " Group Index: " + oGroupItem.groupIndex);\r
-\r
- this.itemAddedEvent.fire(oGroupItem);\r
-\r
- return oGroupItem;\r
-\r
- }\r
-\r
- }\r
- else {\r
-\r
- var nItemIndex = aGroup.length;\r
-\r
- aGroup[nItemIndex] = oItem;\r
-\r
- oGroupItem = aGroup[nItemIndex];\r
-\r
-\r
- if(oGroupItem) {\r
-\r
- if(\r
- !Dom.isAncestor(\r
- this._aListElements[nGroupIndex],\r
- oGroupItem.element\r
- )\r
- ) {\r
-\r
- this._aListElements[nGroupIndex].appendChild(\r
- oGroupItem.element\r
- );\r
-\r
- }\r
-\r
- oGroupItem.element.setAttribute("groupindex", nGroupIndex);\r
- oGroupItem.element.setAttribute("index", nItemIndex);\r
-\r
- oGroupItem.parent = this;\r
-\r
- oGroupItem.index = nItemIndex;\r
- oGroupItem.groupIndex = nGroupIndex;\r
-\r
- this._subscribeToItemEvents(oGroupItem);\r
-\r
- this._configureSubmenu(oGroupItem);\r
-\r
- if(nItemIndex === 0) {\r
-\r
- Dom.addClass(oGroupItem.element, "first-of-type");\r
-\r
- }\r
-\r
- this.logger.log("Item added." +\r
- " Text: " + oGroupItem.cfg.getProperty("text") + ", " +\r
- " Index: " + oGroupItem.index + ", " +\r
- " Group Index: " + oGroupItem.groupIndex);\r
-\r
-\r
- this.itemAddedEvent.fire(oGroupItem);\r
-\r
- return oGroupItem;\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _removeItemFromGroupByIndex\r
-* @description Removes a menu item from a group by index. Returns the menu\r
-* item that was removed.\r
-* @private\r
-* @param {Number} p_nGroupIndex Number indicating the group to which the menu\r
-* item belongs.\r
-* @param {Number} p_nItemIndex Number indicating the index of the menu item\r
-* to be removed.\r
-* @return {YAHOO.widget.MenuItem}\r
-*/\r
-_removeItemFromGroupByIndex: function(p_nGroupIndex, p_nItemIndex) {\r
-\r
- var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;\r
- var aGroup = this._getItemGroup(nGroupIndex);\r
-\r
- if(aGroup) {\r
-\r
- var aArray = aGroup.splice(p_nItemIndex, 1);\r
- var oItem = aArray[0];\r
-\r
- if(oItem) {\r
-\r
- // Update the index and className properties of each member\r
-\r
- this._updateItemProperties(nGroupIndex);\r
-\r
- if(aGroup.length === 0) {\r
-\r
- // Remove the UL\r
-\r
- var oUL = this._aListElements[nGroupIndex];\r
-\r
- if(this.body && oUL) {\r
-\r
- this.body.removeChild(oUL);\r
-\r
- }\r
-\r
- // Remove the group from the array of items\r
-\r
- this._aItemGroups.splice(nGroupIndex, 1);\r
-\r
-\r
- // Remove the UL from the array of ULs\r
-\r
- this._aListElements.splice(nGroupIndex, 1);\r
-\r
-\r
- /*\r
- Assign the "first-of-type" class to the new first UL\r
- in the collection\r
- */\r
-\r
- oUL = this._aListElements[0];\r
-\r
- if(oUL) {\r
-\r
- Dom.addClass(oUL, "first-of-type");\r
-\r
- }\r
-\r
- }\r
-\r
-\r
- this.itemRemovedEvent.fire(oItem);\r
-\r
-\r
- // Return a reference to the item that was removed\r
-\r
- return oItem;\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _removeItemFromGroupByValue\r
-* @description Removes a menu item from a group by reference. Returns the\r
-* menu item that was removed.\r
-* @private\r
-* @param {Number} p_nGroupIndex Number indicating the group to which the\r
-* menu item belongs.\r
-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
-* instance to be removed.\r
-* @return {YAHOO.widget.MenuItem}\r
-*/\r
-_removeItemFromGroupByValue: function(p_nGroupIndex, p_oItem) {\r
-\r
- var aGroup = this._getItemGroup(p_nGroupIndex);\r
-\r
- if(aGroup) {\r
-\r
- var nItems = aGroup.length;\r
- var nItemIndex = -1;\r
-\r
- if(nItems > 0) {\r
-\r
- var i = nItems-1;\r
-\r
- do {\r
-\r
- if(aGroup[i] == p_oItem) {\r
-\r
- nItemIndex = i;\r
- break;\r
-\r
- }\r
-\r
- }\r
- while(i--);\r
-\r
- if(nItemIndex > -1) {\r
-\r
- return this._removeItemFromGroupByIndex(\r
- p_nGroupIndex,\r
- nItemIndex\r
- );\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _updateItemProperties\r
-* @description Updates the "index," "groupindex," and "className" properties\r
-* of the menu items in the specified group.\r
-* @private\r
-* @param {Number} p_nGroupIndex Number indicating the group of items to update.\r
-*/\r
-_updateItemProperties: function(p_nGroupIndex) {\r
-\r
- var aGroup = this._getItemGroup(p_nGroupIndex);\r
- var nItems = aGroup.length;\r
-\r
- if(nItems > 0) {\r
-\r
- var i = nItems - 1;\r
- var oItem;\r
- var oLI;\r
-\r
- // Update the index and className properties of each member\r
-\r
- do {\r
-\r
- oItem = aGroup[i];\r
-\r
- if(oItem) {\r
-\r
- oLI = oItem.element;\r
-\r
- oItem.index = i;\r
- oItem.groupIndex = p_nGroupIndex;\r
-\r
- oLI.setAttribute("groupindex", p_nGroupIndex);\r
- oLI.setAttribute("index", i);\r
-\r
- Dom.removeClass(oLI, "first-of-type");\r
-\r
- }\r
-\r
- }\r
- while(i--);\r
-\r
-\r
- if(oLI) {\r
-\r
- Dom.addClass(oLI, "first-of-type");\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _createItemGroup\r
-* @description Creates a new menu item group (array) and its associated\r
-* <code><ul></code> element. Returns an aray of menu item groups.\r
-* @private\r
-* @param {Number} p_nIndex Number indicating the group to create.\r
-* @return {Array}\r
-*/\r
-_createItemGroup: function(p_nIndex) {\r
-\r
- if(!this._aItemGroups[p_nIndex]) {\r
-\r
- this._aItemGroups[p_nIndex] = [];\r
-\r
- var oUL = document.createElement("ul");\r
-\r
- this._aListElements[p_nIndex] = oUL;\r
-\r
- return this._aItemGroups[p_nIndex];\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _getItemGroup\r
-* @description Returns the menu item group at the specified index.\r
-* @private\r
-* @param {Number} p_nIndex Number indicating the index of the menu item group\r
-* to be retrieved.\r
-* @return {Array}\r
-*/\r
-_getItemGroup: function(p_nIndex) {\r
-\r
- var nIndex = ((typeof p_nIndex == "number") ? p_nIndex : 0);\r
-\r
- return this._aItemGroups[nIndex];\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _configureSubmenu\r
-* @description Subscribes the menu item's submenu to its parent menu's events.\r
-* @private\r
-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
-* instance with the submenu to be configured.\r
-*/\r
-_configureSubmenu: function(p_oItem) {\r
-\r
- var oSubmenu = p_oItem.cfg.getProperty("submenu");\r
-\r
- if(oSubmenu) {\r
-\r
- /*\r
- Listen for configuration changes to the parent menu\r
- so they they can be applied to the submenu.\r
- */\r
-\r
- this.cfg.configChangedEvent.subscribe(\r
- this._onParentMenuConfigChange,\r
- oSubmenu,\r
- true\r
- );\r
-\r
- this.renderEvent.subscribe(\r
- this._onParentMenuRender,\r
- oSubmenu,\r
- true\r
- );\r
-\r
- oSubmenu.beforeShowEvent.subscribe(\r
- this._onSubmenuBeforeShow,\r
- oSubmenu,\r
- true\r
- );\r
-\r
- oSubmenu.showEvent.subscribe(\r
- this._onSubmenuShow,\r
- oSubmenu,\r
- true\r
- );\r
-\r
- oSubmenu.hideEvent.subscribe(\r
- this._onSubmenuHide,\r
- oSubmenu,\r
- true\r
- );\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _subscribeToItemEvents\r
-* @description Subscribes a menu to a menu item's event.\r
-* @private\r
-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
-* instance whose events should be subscribed to.\r
-*/\r
-_subscribeToItemEvents: function(p_oItem) {\r
-\r
- p_oItem.focusEvent.subscribe(this._onMenuItemFocus, p_oItem, this);\r
-\r
- p_oItem.blurEvent.subscribe(this._onMenuItemBlur, this, true);\r
-\r
- p_oItem.cfg.configChangedEvent.subscribe(\r
- this._onMenuItemConfigChange,\r
- p_oItem,\r
- this\r
- );\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _getOffsetWidth\r
-* @description Returns the offset width of the menu's\r
-* <code><div></code> element.\r
-* @private\r
-*/\r
-_getOffsetWidth: function() {\r
-\r
- var oClone = this.element.cloneNode(true);\r
-\r
- Dom.setStyle(oClone, "width", "");\r
-\r
- document.body.appendChild(oClone);\r
-\r
- var sWidth = oClone.offsetWidth;\r
-\r
- document.body.removeChild(oClone);\r
-\r
- return sWidth;\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _cancelHideDelay\r
-* @description Cancels the call to "hideMenu."\r
-* @private\r
-*/\r
-_cancelHideDelay: function() {\r
-\r
- var oRoot = this.getRoot();\r
-\r
- if(oRoot._nHideDelayId) {\r
-\r
- window.clearTimeout(oRoot._nHideDelayId);\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _execHideDelay\r
-* @description Hides the menu after the number of milliseconds specified by\r
-* the "hidedelay" configuration property.\r
-* @private\r
-*/\r
-_execHideDelay: function() {\r
-\r
- this._cancelHideDelay();\r
-\r
- var oRoot = this.getRoot();\r
- var me = this;\r
-\r
- var hideMenu = function() {\r
-\r
- if(oRoot.activeItem) {\r
-\r
- oRoot.clearActiveItem();\r
-\r
- }\r
-\r
- if(oRoot == me && me.cfg.getProperty("position") == "dynamic") {\r
-\r
- me.hide();\r
-\r
- }\r
-\r
- };\r
-\r
-\r
- oRoot._nHideDelayId =\r
- window.setTimeout(hideMenu, oRoot.cfg.getProperty("hidedelay"));\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _cancelShowDelay\r
-* @description Cancels the call to the "showMenu."\r
-* @private\r
-*/\r
-_cancelShowDelay: function() {\r
-\r
- var oRoot = this.getRoot();\r
-\r
- if(oRoot._nShowDelayId) {\r
-\r
- window.clearTimeout(oRoot._nShowDelayId);\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _execShowDelay\r
-* @description Shows the menu after the number of milliseconds specified by\r
-* the "showdelay" configuration property have ellapsed.\r
-* @private\r
-* @param {YAHOO.widget.Menu} p_oMenu Object specifying the menu that should\r
-* be made visible.\r
-*/\r
-_execShowDelay: function(p_oMenu) {\r
-\r
- this._cancelShowDelay();\r
-\r
- var oRoot = this.getRoot();\r
-\r
- var showMenu = function() {\r
-\r
- p_oMenu.show();\r
-\r
- };\r
-\r
-\r
- oRoot._nShowDelayId =\r
- window.setTimeout(showMenu, oRoot.cfg.getProperty("showdelay"));\r
-\r
-},\r
-\r
-\r
-\r
-// Protected methods\r
-\r
-\r
-/**\r
-* @method _onMouseOver\r
-* @description "mouseover" event handler for the menu.\r
-* @protected\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-_onMouseOver: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- var oEvent = p_aArgs[0];\r
- var oItem = p_aArgs[1];\r
- var oTarget = Event.getTarget(oEvent);\r
-\r
- if(\r
- !this._bHandledMouseOverEvent &&\r
- (oTarget == this.element || Dom.isAncestor(this.element, oTarget))\r
- ) {\r
-\r
- // MENU MOUSEOVER LOGIC HERE\r
-\r
- this.clearActiveItem();\r
-\r
- this._bHandledMouseOverEvent = true;\r
- this._bHandledMouseOutEvent = false;\r
-\r
- }\r
-\r
-\r
- if(\r
- oItem && !oItem.handledMouseOverEvent &&\r
- (oTarget == oItem.element || Dom.isAncestor(oItem.element, oTarget))\r
- ) {\r
-\r
- var oItemCfg = oItem.cfg;\r
-\r
- // Select and focus the current menu item\r
-\r
- oItemCfg.setProperty("selected", true);\r
- oItem.focus();\r
-\r
-\r
- if(this.cfg.getProperty("autosubmenudisplay")) {\r
-\r
- // Show the submenu this menu item\r
-\r
- var oSubmenu = oItemCfg.getProperty("submenu");\r
-\r
- if(oSubmenu) {\r
-\r
- if(this.cfg.getProperty("showdelay") > 0) {\r
-\r
- this._execShowDelay(oSubmenu);\r
-\r
- }\r
- else {\r
-\r
- oSubmenu.show();\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
- oItem.handledMouseOverEvent = true;\r
- oItem.handledMouseOutEvent = false;\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onMouseOut\r
-* @description "mouseout" event handler for the menu.\r
-* @protected\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-_onMouseOut: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- var oEvent = p_aArgs[0];\r
- var oItem = p_aArgs[1];\r
- var oRelatedTarget = Event.getRelatedTarget(oEvent);\r
- var bMovingToSubmenu = false;\r
-\r
- if(oItem) {\r
-\r
- var oItemCfg = oItem.cfg;\r
- var oSubmenu = oItemCfg.getProperty("submenu");\r
-\r
-\r
- if(\r
- oSubmenu &&\r
- (\r
- oRelatedTarget == oSubmenu.element ||\r
- Dom.isAncestor(oSubmenu.element, oRelatedTarget)\r
- )\r
- ) {\r
-\r
- bMovingToSubmenu = true;\r
-\r
- }\r
-\r
-\r
- if(\r
- !oItem.handledMouseOutEvent &&\r
- (\r
- (\r
- oRelatedTarget != oItem.element &&\r
- !Dom.isAncestor(oItem.element, oRelatedTarget)\r
- ) || bMovingToSubmenu\r
- )\r
- ) {\r
-\r
-\r
- if(this.cfg.getProperty("showdelay") > 0) {\r
-\r
- this._cancelShowDelay();\r
-\r
- }\r
-\r
-\r
- if(!bMovingToSubmenu) {\r
-\r
- oItemCfg.setProperty("selected", false);\r
-\r
- }\r
-\r
-\r
- if(this.cfg.getProperty("autosubmenudisplay")) {\r
-\r
- if(oSubmenu) {\r
-\r
- if(\r
- !(\r
- oRelatedTarget == oSubmenu.element ||\r
- YAHOO.util.Dom.isAncestor(\r
- oSubmenu.element,\r
- oRelatedTarget\r
- )\r
- )\r
- ) {\r
-\r
- oSubmenu.hide();\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
- oItem.handledMouseOutEvent = true;\r
- oItem.handledMouseOverEvent = false;\r
-\r
- }\r
-\r
- }\r
-\r
-\r
- if(\r
- !this._bHandledMouseOutEvent &&\r
- (\r
- (\r
- oRelatedTarget != this.element &&\r
- !Dom.isAncestor(this.element, oRelatedTarget)\r
- )\r
- || bMovingToSubmenu\r
- )\r
- ) {\r
-\r
- this._bHandledMouseOutEvent = true;\r
- this._bHandledMouseOverEvent = false;\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onClick\r
-* @description "click" event handler for the menu.\r
-* @protected\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-_onClick: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- var oEvent = p_aArgs[0];\r
- var oItem = p_aArgs[1];\r
- var oTarget = Event.getTarget(oEvent);\r
-\r
- if(oItem) {\r
-\r
- var oItemCfg = oItem.cfg;\r
- var oSubmenu = oItemCfg.getProperty("submenu");\r
-\r
-\r
- /*\r
- ACCESSIBILITY FEATURE FOR SCREEN READERS:\r
- Expand/collapse the submenu when the user clicks\r
- on the submenu indicator image.\r
- */\r
-\r
- if(oTarget == oItem.submenuIndicator && oSubmenu) {\r
-\r
- if(oSubmenu.cfg.getProperty("visible")) {\r
-\r
- oSubmenu.hide();\r
-\r
- }\r
- else {\r
-\r
- this.clearActiveItem();\r
-\r
- this.activeItem = oItem;\r
-\r
- oItem.cfg.setProperty("selected", true);\r
-\r
- oSubmenu.show();\r
-\r
- }\r
-\r
- }\r
- else {\r
-\r
- var sURL = oItemCfg.getProperty("url");\r
- var bCurrentPageURL = (sURL.substr((sURL.length-1),1) == "#");\r
- var sTarget = oItemCfg.getProperty("target");\r
- var bHasTarget = (sTarget && sTarget.length > 0);\r
-\r
- /*\r
- Prevent the browser from following links\r
- equal to "#"\r
- */\r
-\r
- if(\r
- oTarget.tagName.toUpperCase() == "A" &&\r
- bCurrentPageURL && !bHasTarget\r
- ) {\r
-\r
- Event.preventDefault(oEvent);\r
-\r
- }\r
-\r
- if(\r
- oTarget.tagName.toUpperCase() != "A" &&\r
- !bCurrentPageURL && !bHasTarget\r
- ) {\r
-\r
- /*\r
- Follow the URL of the item regardless of\r
- whether or not the user clicked specifically\r
- on the anchor element.\r
- */\r
-\r
- document.location = sURL;\r
-\r
- }\r
-\r
-\r
- /*\r
- If the item doesn't navigate to a URL and it doesn't have\r
- a submenu, then collapse the menu tree.\r
- */\r
-\r
- if(bCurrentPageURL && !oSubmenu) {\r
-\r
- var oRoot = this.getRoot();\r
-\r
- if(oRoot.cfg.getProperty("position") == "static") {\r
-\r
- oRoot.clearActiveItem();\r
-\r
- }\r
- else {\r
-\r
- oRoot.hide();\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onKeyDown\r
-* @description "keydown" event handler for the menu.\r
-* @protected\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-_onKeyDown: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- var oEvent = p_aArgs[0];\r
- var oItem = p_aArgs[1];\r
- var oSubmenu;\r
-\r
- if(oItem) {\r
-\r
- var oItemCfg = oItem.cfg;\r
- var oParentItem = this.parent;\r
- var oRoot;\r
- var oNextItem;\r
-\r
-\r
- switch(oEvent.keyCode) {\r
-\r
- case 38: // Up arrow\r
- case 40: // Down arrow\r
-\r
- if(\r
- oItem == this.activeItem &&\r
- !oItemCfg.getProperty("selected")\r
- ) {\r
-\r
- oItemCfg.setProperty("selected", true);\r
-\r
- }\r
- else {\r
-\r
- oNextItem = (oEvent.keyCode == 38) ?\r
- oItem.getPreviousEnabledSibling() :\r
- oItem.getNextEnabledSibling();\r
-\r
- if(oNextItem) {\r
-\r
- this.clearActiveItem();\r
-\r
- oNextItem.cfg.setProperty("selected", true);\r
- oNextItem.focus();\r
-\r
- }\r
-\r
- }\r
-\r
- Event.preventDefault(oEvent);\r
-\r
- break;\r
-\r
-\r
- case 39: // Right arrow\r
-\r
- oSubmenu = oItemCfg.getProperty("submenu");\r
-\r
- if(oSubmenu) {\r
-\r
- if(!oItemCfg.getProperty("selected")) {\r
-\r
- oItemCfg.setProperty("selected", true);\r
-\r
- }\r
-\r
- oSubmenu.show();\r
-\r
- oSubmenu.setInitialSelection();\r
-\r
- }\r
- else {\r
-\r
- oRoot = this.getRoot();\r
-\r
- if(oRoot instanceof YAHOO.widget.MenuBar) {\r
-\r
- oNextItem = oRoot.activeItem.getNextEnabledSibling();\r
-\r
- if(oNextItem) {\r
-\r
- oRoot.clearActiveItem();\r
-\r
- oNextItem.cfg.setProperty("selected", true);\r
-\r
- oSubmenu = oNextItem.cfg.getProperty("submenu");\r
-\r
- if(oSubmenu) {\r
-\r
- oSubmenu.show();\r
-\r
- }\r
-\r
- oNextItem.focus();\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
-\r
- Event.preventDefault(oEvent);\r
-\r
- break;\r
-\r
-\r
- case 37: // Left arrow\r
-\r
- if(oParentItem) {\r
-\r
- var oParentMenu = oParentItem.parent;\r
-\r
- if(oParentMenu instanceof YAHOO.widget.MenuBar) {\r
-\r
- oNextItem =\r
- oParentMenu.activeItem.getPreviousEnabledSibling();\r
-\r
- if(oNextItem) {\r
-\r
- oParentMenu.clearActiveItem();\r
-\r
- oNextItem.cfg.setProperty("selected", true);\r
-\r
- oSubmenu = oNextItem.cfg.getProperty("submenu");\r
-\r
- if(oSubmenu) {\r
-\r
- oSubmenu.show();\r
-\r
- }\r
-\r
- oNextItem.focus();\r
-\r
- }\r
-\r
- }\r
- else {\r
-\r
- this.hide();\r
-\r
- oParentItem.focus();\r
-\r
- }\r
-\r
- }\r
-\r
- Event.preventDefault(oEvent);\r
-\r
- break;\r
-\r
- }\r
-\r
-\r
- }\r
-\r
-\r
- if(oEvent.keyCode == 27) { // Esc key\r
-\r
- if(this.cfg.getProperty("position") == "dynamic") {\r
-\r
- this.hide();\r
-\r
- if(this.parent) {\r
-\r
- this.parent.focus();\r
-\r
- }\r
-\r
- }\r
- else if(this.activeItem) {\r
-\r
- oSubmenu = this.activeItem.cfg.getProperty("submenu");\r
-\r
- if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {\r
-\r
- oSubmenu.hide();\r
- this.activeItem.focus();\r
-\r
- }\r
- else {\r
-\r
- this.activeItem.cfg.setProperty("selected", false);\r
- this.activeItem.blur();\r
-\r
- }\r
-\r
- }\r
-\r
-\r
- Event.preventDefault(oEvent);\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-\r
-// Private methods\r
-\r
-\r
-/**\r
-* @method _onInit\r
-* @description "init" event handler for the menu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-_onInit: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- if(\r
- (\r
- (this.parent && !this.lazyLoad) ||\r
- (!this.parent && this.cfg.getProperty("position") == "static") ||\r
- (\r
- !this.parent &&\r
- !this.lazyLoad &&\r
- this.cfg.getProperty("position") == "dynamic"\r
- )\r
- ) &&\r
- this.getItemGroups().length === 0\r
- ) {\r
-\r
- if(this.srcElement) {\r
-\r
- this._initSubTree();\r
-\r
- }\r
-\r
-\r
- if(this.itemData) {\r
-\r
- this.addItems(this.itemData);\r
-\r
- }\r
-\r
- }\r
- else if(this.lazyLoad) {\r
-\r
- this.cfg.fireQueue();\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onBeforeRender\r
-* @description "beforerender" event handler for the menu. Appends all of the\r
-* <code><ul></code>, <code><li></code> and their accompanying\r
-* title elements to the body element of the menu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-_onBeforeRender: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- var oConfig = this.cfg;\r
- var oEl = this.element;\r
- var nListElements = this._aListElements.length;\r
-\r
-\r
- if(nListElements > 0) {\r
-\r
- var i = 0;\r
- var bFirstList = true;\r
- var oUL;\r
- var oGroupTitle;\r
-\r
-\r
- do {\r
-\r
- oUL = this._aListElements[i];\r
-\r
- if(oUL) {\r
-\r
- if(bFirstList) {\r
-\r
- Dom.addClass(oUL, "first-of-type");\r
- bFirstList = false;\r
-\r
- }\r
-\r
-\r
- if(!Dom.isAncestor(oEl, oUL)) {\r
-\r
- this.appendToBody(oUL);\r
-\r
- }\r
-\r
-\r
- oGroupTitle = this._aGroupTitleElements[i];\r
-\r
- if(oGroupTitle) {\r
-\r
- if(!Dom.isAncestor(oEl, oGroupTitle)) {\r
-\r
- oUL.parentNode.insertBefore(oGroupTitle, oUL);\r
-\r
- }\r
-\r
-\r
- Dom.addClass(oUL, "hastitle");\r
-\r
- }\r
-\r
- }\r
-\r
- i++;\r
-\r
- }\r
- while(i < nListElements);\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onRender\r
-* @description "render" event handler for the menu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-_onRender: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- if(this.cfg.getProperty("position") == "dynamic") {\r
-\r
- var sWidth =\r
- this.element.parentNode.tagName.toUpperCase() == "BODY" ?\r
- this.element.offsetWidth : this._getOffsetWidth();\r
-\r
- this.cfg.setProperty("width", (sWidth + "px"));\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onBeforeShow\r
-* @description "beforeshow" event handler for the menu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-_onBeforeShow: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- if(this.lazyLoad && this.getItemGroups().length === 0) {\r
-\r
- if(this.srcElement) {\r
-\r
- this._initSubTree();\r
-\r
- }\r
-\r
-\r
- if(this.itemData) {\r
-\r
- if(\r
- this.parent && this.parent.parent &&\r
- this.parent.parent.srcElement &&\r
- this.parent.parent.srcElement.tagName.toUpperCase() == "SELECT"\r
- ) {\r
-\r
- var nOptions = this.itemData.length;\r
-\r
- for(var n=0; n<nOptions; n++) {\r
-\r
- if(this.itemData[n].tagName) {\r
-\r
- this.addItem((new this.ITEM_TYPE(this.itemData[n])));\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
- else {\r
-\r
- this.addItems(this.itemData);\r
-\r
- }\r
-\r
- }\r
-\r
-\r
- if(this.srcElement) {\r
-\r
- this.render();\r
-\r
- }\r
- else {\r
-\r
- if(this.parent) {\r
-\r
- this.render(this.parent.element);\r
-\r
- }\r
- else {\r
-\r
- this.render(this.cfg.getProperty("container"));\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onShow\r
-* @description "show" event handler for the menu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that fired\r
-* the event.\r
-*/\r
-_onShow: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- this.setInitialFocus();\r
-\r
- var oParent = this.parent;\r
-\r
- if(oParent) {\r
-\r
-\r
- var oParentMenu = oParent.parent;\r
-\r
- var aParentAlignment = oParentMenu.cfg.getProperty("submenualignment");\r
- var aAlignment = this.cfg.getProperty("submenualignment");\r
-\r
- if(\r
- (aParentAlignment[0] != aAlignment[0]) &&\r
- (aParentAlignment[1] != aAlignment[1])\r
- ) {\r
-\r
- this.cfg.setProperty(\r
- "submenualignment",\r
- [ aParentAlignment[0], aParentAlignment[1] ]\r
- );\r
-\r
- }\r
-\r
-\r
- if(\r
- !oParentMenu.cfg.getProperty("autosubmenudisplay") &&\r
- oParentMenu.cfg.getProperty("position") == "static"\r
- ) {\r
-\r
- oParentMenu.cfg.setProperty("autosubmenudisplay", true);\r
-\r
-\r
- /**\r
- * "click" event handler for the document\r
- * @private\r
- * @param {Event} p_oEvent Object reference for the DOM event object\r
- * passed back by the event utility (YAHOO.util.Event).\r
- */\r
- var disableAutoSubmenuDisplay = function(p_oEvent) {\r
-\r
- if(\r
- p_oEvent.type == "mousedown" ||\r
- (p_oEvent.type == "keydown" && p_oEvent.keyCode == 27)\r
- ) {\r
-\r
- /*\r
- Set the "autosubmenudisplay" to "false" if the user\r
- clicks outside the menu bar.\r
- */\r
-\r
- var oTarget = Event.getTarget(p_oEvent);\r
-\r
- if(\r
- oTarget != oParentMenu.element ||\r
- !YAHOO.util.Dom.isAncestor(oParentMenu.element, oTarget)\r
- ) {\r
-\r
- oParentMenu.cfg.setProperty(\r
- "autosubmenudisplay",\r
- false\r
- );\r
-\r
- Event.removeListener(\r
- document,\r
- "mousedown",\r
- disableAutoSubmenuDisplay\r
- );\r
-\r
- Event.removeListener(\r
- document,\r
- "keydown",\r
- disableAutoSubmenuDisplay\r
- );\r
-\r
- }\r
-\r
- }\r
-\r
- };\r
-\r
- Event.addListener(document, "mousedown", disableAutoSubmenuDisplay);\r
- Event.addListener(document, "keydown", disableAutoSubmenuDisplay);\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onBeforeHide\r
-* @description "beforehide" event handler for the menu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that fired\r
-* the event.\r
-*/\r
-_onBeforeHide: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- this.clearActiveItem(true);\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onParentMenuConfigChange\r
-* @description "configchange" event handler for a submenu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
-* subscribed to the event.\r
-*/\r
-_onParentMenuConfigChange: function(p_sType, p_aArgs, p_oSubmenu) {\r
-\r
- var sPropertyName = p_aArgs[0][0];\r
- var oPropertyValue = p_aArgs[0][1];\r
-\r
- switch(sPropertyName) {\r
-\r
- case "iframe":\r
- case "constraintoviewport":\r
- case "hidedelay":\r
- case "showdelay":\r
- case "clicktohide":\r
- case "effect":\r
-\r
- p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue);\r
-\r
- break;\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onParentMenuRender\r
-* @description "render" event handler for a submenu. Renders a\r
-* submenu in response to the firing of its parent's "render" event.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
-* subscribed to the event.\r
-*/\r
-_onParentMenuRender: function(p_sType, p_aArgs, p_oSubmenu) {\r
-\r
- /*\r
- Set the "constraintoviewport" configuration\r
- property to match the parent Menu\r
- */\r
-\r
- var oParentMenu = p_oSubmenu.parent.parent;\r
-\r
- var oConfig = {\r
-\r
- constraintoviewport:\r
- oParentMenu.cfg.getProperty("constraintoviewport"),\r
-\r
- xy: [0,0],\r
-\r
- clicktohide:\r
- oParentMenu.cfg.getProperty("clicktohide"),\r
-\r
- effect:\r
- oParentMenu.cfg.getProperty("effect")\r
-\r
- };\r
-\r
-\r
- var nShowDelay = oParentMenu.cfg.getProperty("showdelay");\r
-\r
- if(nShowDelay > 0) {\r
-\r
- oConfig.showdelay = nShowDelay;\r
-\r
- }\r
-\r
-\r
- var nHideDelay = oParentMenu.cfg.getProperty("hidedelay");\r
-\r
- if(nHideDelay > 0) {\r
-\r
- oConfig.hidedelay = nHideDelay;\r
-\r
- }\r
-\r
-\r
- /*\r
- Only sync the "iframe" configuration property if the parent\r
- menu's "position" configuration is the same.\r
- */\r
-\r
- if(\r
- this.cfg.getProperty("position") ==\r
- oParentMenu.cfg.getProperty("position")\r
- ) {\r
-\r
- oConfig.iframe = oParentMenu.cfg.getProperty("iframe");\r
-\r
- }\r
-\r
-\r
- p_oSubmenu.cfg.applyConfig(oConfig);\r
-\r
-\r
- if(!this.lazyLoad) {\r
-\r
- if(Dom.inDocument(this.element)) {\r
-\r
- this.render();\r
-\r
- }\r
- else {\r
-\r
- this.render(this.parent.element);\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onSubmenuBeforeShow\r
-* @description "beforeshow" event handler for a submenu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
-* subscribed to the event.\r
-*/\r
-_onSubmenuBeforeShow: function(p_sType, p_aArgs, p_oSubmenu) {\r
-\r
- var oParent = this.parent;\r
- var aAlignment = oParent.parent.cfg.getProperty("submenualignment");\r
-\r
- this.cfg.setProperty(\r
- "context",\r
- [oParent.element, aAlignment[0], aAlignment[1]]\r
- );\r
-\r
- oParent.submenuIndicator.alt = oParent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onSubmenuShow\r
-* @description "show" event handler for a submenu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
-* subscribed to the event.\r
-*/\r
-_onSubmenuShow: function(p_sType, p_aArgs, p_oSubmenu) {\r
-\r
- var oParent = this.parent;\r
-\r
- oParent.submenuIndicator.alt = oParent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onSubmenuHide\r
-* @description "hide" Custom Event handler for a submenu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
-* subscribed to the event.\r
-*/\r
-_onSubmenuHide: function(p_sType, p_aArgs, p_oSubmenu) {\r
-\r
- var oParent = this.parent;\r
-\r
- oParent.submenuIndicator.alt = oParent.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onMenuItemFocus\r
-* @description "focus" event handler for the menu's items.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
-* that fired the event.\r
-*/\r
-_onMenuItemFocus: function(p_sType, p_aArgs, p_oItem) {\r
-\r
- this.activeItem = p_oItem;\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onMenuItemBlur\r
-* @description "blur" event handler for the menu's items.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event\r
-* that was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-*/\r
-_onMenuItemBlur: function(p_sType, p_aArgs) {\r
-\r
- this.activeItem = null;\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method _onMenuItemConfigChange\r
-* @description "configchange" event handler for the menu's items.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
-* that fired the event.\r
-*/\r
-_onMenuItemConfigChange: function(p_sType, p_aArgs, p_oItem) {\r
-\r
- var sProperty = p_aArgs[0][0];\r
-\r
- switch(sProperty) {\r
-\r
- case "submenu":\r
-\r
- var oSubmenu = p_aArgs[0][1];\r
-\r
- if(oSubmenu) {\r
-\r
- this._configureSubmenu(p_oItem);\r
-\r
- }\r
-\r
- break;\r
-\r
- case "text":\r
- case "helptext":\r
-\r
- /*\r
- A change to an item's "text" or "helptext"\r
- configuration properties requires the width of the parent\r
- menu to be recalculated.\r
- */\r
-\r
- if(this.element.style.width) {\r
-\r
- var sWidth = this._getOffsetWidth() + "px";\r
-\r
- Dom.setStyle(this.element, "width", sWidth);\r
-\r
- }\r
-\r
- break;\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-\r
-// Public event handlers for configuration properties\r
-\r
-\r
-/**\r
-* @method enforceConstraints\r
-* @description The default event handler executed when the moveEvent is fired,\r
-* if the "constraintoviewport" configuration property is set to true.\r
-* @param {String} type The name of the event that was fired.\r
-* @param {Array} args Collection of arguments sent when the\r
-* event was fired.\r
-* @param {Array} obj Array containing the current Menu instance\r
-* and the item that fired the event.\r
-*/\r
-enforceConstraints: function(type, args, obj) {\r
-\r
- var oConfig = this.cfg;\r
-\r
- var pos = args[0];\r
-\r
- var x = pos[0];\r
- var y = pos[1];\r
-\r
- var bod = document.getElementsByTagName('body')[0];\r
- var htm = document.getElementsByTagName('html')[0];\r
-\r
- var bodyOverflow = Dom.getStyle(bod, "overflow");\r
- var htmOverflow = Dom.getStyle(htm, "overflow");\r
-\r
- var offsetHeight = this.element.offsetHeight;\r
- var offsetWidth = this.element.offsetWidth;\r
-\r
- var viewPortWidth = Dom.getClientWidth();\r
- var viewPortHeight = Dom.getClientHeight();\r
-\r
- var scrollX = window.scrollX || document.body.scrollLeft;\r
- var scrollY = window.scrollY || document.body.scrollTop;\r
-\r
- var topConstraint = scrollY + 10;\r
- var leftConstraint = scrollX + 10;\r
- var bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10;\r
- var rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;\r
-\r
- var aContext = oConfig.getProperty("context");\r
- var oContextElement = aContext ? aContext[0] : null;\r
-\r
-\r
- if (x < 10) {\r
-\r
- x = leftConstraint;\r
-\r
- } else if ((x + offsetWidth) > viewPortWidth) {\r
-\r
- if(\r
- oContextElement &&\r
- ((x - oContextElement.offsetWidth) > offsetWidth)\r
- ) {\r
-\r
- x = (x - (oContextElement.offsetWidth + offsetWidth));\r
-\r
- }\r
- else {\r
-\r
- x = rightConstraint;\r
-\r
- }\r
-\r
- }\r
-\r
- if (y < 10) {\r
-\r
- y = topConstraint;\r
-\r
- } else if (y > bottomConstraint) {\r
-\r
- if(oContextElement && (y > offsetHeight)) {\r
-\r
- y = ((y + oContextElement.offsetHeight) - offsetHeight);\r
-\r
- }\r
- else {\r
-\r
- y = bottomConstraint;\r
-\r
- }\r
-\r
- }\r
-\r
- oConfig.setProperty("x", x, true);\r
- oConfig.setProperty("y", y, true);\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method configVisible\r
-* @description Event handler for when the "visible" configuration property\r
-* the menu changes.\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-configVisible: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- if(this.cfg.getProperty("position") == "dynamic") {\r
-\r
- YAHOO.widget.Menu.superclass.configVisible.call(\r
- this,\r
- p_sType,\r
- p_aArgs,\r
- p_oMenu\r
- );\r
-\r
- }\r
- else {\r
-\r
- var bVisible = p_aArgs[0];\r
- var sDisplay = Dom.getStyle(this.element, "display");\r
-\r
- if(bVisible) {\r
-\r
- if(sDisplay != "block") {\r
- this.beforeShowEvent.fire();\r
- Dom.setStyle(this.element, "display", "block");\r
- this.showEvent.fire();\r
- }\r
-\r
- }\r
- else {\r
-\r
- if(sDisplay == "block") {\r
- this.beforeHideEvent.fire();\r
- Dom.setStyle(this.element, "display", "none");\r
- this.hideEvent.fire();\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method configPosition\r
-* @description Event handler for when the "position" configuration property\r
-* of the menu changes.\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-configPosition: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- var sCSSPosition = p_aArgs[0] == "static" ? "static" : "absolute";\r
- var oCfg = this.cfg;\r
-\r
- Dom.setStyle(this.element, "position", sCSSPosition);\r
-\r
-\r
- if(sCSSPosition == "static") {\r
-\r
- /*\r
- Remove the iframe for statically positioned menus since it will\r
- intercept mouse events.\r
- */\r
-\r
- oCfg.setProperty("iframe", false);\r
-\r
-\r
- // Statically positioned menus are visible by default\r
-\r
- Dom.setStyle(this.element, "display", "block");\r
-\r
- oCfg.setProperty("visible", true);\r
-\r
- }\r
- else {\r
-\r
- /*\r
- Even though the "visible" property is queued to\r
- "false" by default, we need to set the "visibility" property to\r
- "hidden" since Overlay's "configVisible" implementation checks the\r
- element's "visibility" style property before deciding whether\r
- or not to show an Overlay instance.\r
- */\r
-\r
- Dom.setStyle(this.element, "visibility", "hidden");\r
-\r
- }\r
-\r
-\r
- if(sCSSPosition == "absolute") {\r
-\r
- var nZIndex = oCfg.getProperty("zindex");\r
-\r
- if(!nZIndex || nZIndex === 0) {\r
-\r
- nZIndex = this.parent ?\r
- (this.parent.parent.cfg.getProperty("zindex") + 1) : 1;\r
-\r
- oCfg.setProperty("zindex", nZIndex);\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method configIframe\r
-* @description Event handler for when the "iframe" configuration property of\r
-* the menu changes.\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-configIframe: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- if(this.cfg.getProperty("position") == "dynamic") {\r
-\r
- YAHOO.widget.Menu.superclass.configIframe.call(\r
- this,\r
- p_sType,\r
- p_aArgs,\r
- p_oMenu\r
- );\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method configHideDelay\r
-* @description Event handler for when the "hidedelay" configuration property\r
-* of the menu changes.\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-configHideDelay: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- var nHideDelay = p_aArgs[0];\r
- var oMouseOutEvent = this.mouseOutEvent;\r
- var oMouseOverEvent = this.mouseOverEvent;\r
- var oKeyDownEvent = this.keyDownEvent;\r
-\r
- if(nHideDelay > 0) {\r
-\r
- /*\r
- Only assign event handlers once. This way the user change\r
- the value for the hidedelay as many times as they want.\r
- */\r
-\r
- if(!this._hideDelayEventHandlersAssigned) {\r
-\r
- oMouseOutEvent.subscribe(this._execHideDelay, true);\r
- oMouseOverEvent.subscribe(this._cancelHideDelay, this, true);\r
- oKeyDownEvent.subscribe(this._cancelHideDelay, this, true);\r
-\r
- this._hideDelayEventHandlersAssigned = true;\r
-\r
- }\r
-\r
- }\r
- else {\r
-\r
- oMouseOutEvent.unsubscribe(this._execHideDelay, this);\r
- oMouseOverEvent.unsubscribe(this._cancelHideDelay, this);\r
- oKeyDownEvent.unsubscribe(this._cancelHideDelay, this);\r
-\r
- this._hideDelayEventHandlersAssigned = false;\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method configContainer\r
-* @description Event handler for when the "container" configuration property\r
-of the menu changes.\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-configContainer: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- var oElement = p_aArgs[0];\r
-\r
- if(typeof oElement == 'string') {\r
-\r
- this.cfg.setProperty(\r
- "container",\r
- document.getElementById(oElement),\r
- true\r
- );\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-\r
-// Public methods\r
-\r
-\r
-/**\r
-* Event handler called when the resize monitor element's "resize" evet is fired.\r
-*/\r
-onDomResize: function(e, obj) {\r
-\r
- if(!this._handleResize) {\r
-\r
- this._handleResize = true;\r
- return;\r
-\r
- }\r
-\r
- var oConfig = this.cfg;\r
-\r
- if(oConfig.getProperty("position") == "dynamic") {\r
-\r
- oConfig.setProperty("width", (this._getOffsetWidth() + "px"));\r
-\r
- }\r
-\r
- YAHOO.widget.Menu.superclass.onDomResize.call(this, e, obj);\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method initEvents\r
-* @description Initializes the custom events for the menu.\r
-*/\r
-initEvents: function() {\r
-\r
- YAHOO.widget.Menu.superclass.initEvents.call(this);\r
-\r
- // Create custom events\r
-\r
- var CustomEvent = YAHOO.util.CustomEvent;\r
-\r
- this.mouseOverEvent = new CustomEvent("mouseOverEvent", this);\r
- this.mouseOutEvent = new CustomEvent("mouseOutEvent", this);\r
- this.mouseDownEvent = new CustomEvent("mouseDownEvent", this);\r
- this.mouseUpEvent = new CustomEvent("mouseUpEvent", this);\r
- this.clickEvent = new CustomEvent("clickEvent", this);\r
- this.keyPressEvent = new CustomEvent("keyPressEvent", this);\r
- this.keyDownEvent = new CustomEvent("keyDownEvent", this);\r
- this.keyUpEvent = new CustomEvent("keyUpEvent", this);\r
- this.itemAddedEvent = new CustomEvent("itemAddedEvent", this);\r
- this.itemRemovedEvent = new CustomEvent("itemRemovedEvent", this);\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method getRoot\r
-* @description Finds the menu's root menu.\r
-*/\r
-getRoot: function() {\r
-\r
- var oItem = this.parent;\r
-\r
- if(oItem) {\r
-\r
- var oParentMenu = oItem.parent;\r
-\r
- return oParentMenu ? oParentMenu.getRoot() : this;\r
-\r
- }\r
- else {\r
-\r
- return this;\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method toString\r
-* @description Returns a string representing the menu.\r
-* @return {String}\r
-*/\r
-toString: function() {\r
-\r
- return ("Menu " + this.id);\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method setItemGroupTitle\r
-* @description Sets the title of a group of menu items.\r
-* @param {String} p_sGroupTitle String specifying the title of the group.\r
-* @param {Number} p_nGroupIndex Optional. Number specifying the group to which\r
-* the title belongs.\r
-*/\r
-setItemGroupTitle: function(p_sGroupTitle, p_nGroupIndex) {\r
-\r
- if(typeof p_sGroupTitle == "string" && p_sGroupTitle.length > 0) {\r
-\r
- var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;\r
- var oTitle = this._aGroupTitleElements[nGroupIndex];\r
-\r
-\r
- if(oTitle) {\r
-\r
- oTitle.innerHTML = p_sGroupTitle;\r
-\r
- }\r
- else {\r
-\r
- oTitle = document.createElement(this.GROUP_TITLE_TAG_NAME);\r
-\r
- oTitle.innerHTML = p_sGroupTitle;\r
-\r
- this._aGroupTitleElements[nGroupIndex] = oTitle;\r
-\r
- }\r
-\r
-\r
- var i = this._aGroupTitleElements.length - 1;\r
- var nFirstIndex;\r
-\r
- do {\r
-\r
- if(this._aGroupTitleElements[i]) {\r
-\r
- Dom.removeClass(this._aGroupTitleElements[i], "first-of-type");\r
-\r
- nFirstIndex = i;\r
-\r
- }\r
-\r
- }\r
- while(i--);\r
-\r
-\r
- if(nFirstIndex !== null) {\r
-\r
- Dom.addClass(\r
- this._aGroupTitleElements[nFirstIndex],\r
- "first-of-type"\r
- );\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-\r
-/**\r
-* @method addItem\r
-* @description Appends an item to the menu.\r
-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
-* instance to be added to the menu.\r
-* @param {String} p_oItem String specifying the text of the item to be added\r
-* to the menu.\r
-* @param {Object} p_oItem Object literal containing a set of menu item\r
-* configuration properties.\r
-* @param {Number} p_nGroupIndex Optional. Number indicating the group to\r
-* which the item belongs.\r
-* @return {YAHOO.widget.MenuItem}\r
-*/\r
-addItem: function(p_oItem, p_nGroupIndex) {\r
-\r
- if(p_oItem) {\r
-\r
- return this._addItemToGroup(p_nGroupIndex, p_oItem);\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method addItems\r
-* @description Adds an array of items to the menu.\r
-* @param {Array} p_aItems Array of items to be added to the menu. The array\r
-* can contain strings specifying the text for each item to be created, object\r
-* literals specifying each of the menu item configuration properties,\r
-* or MenuItem instances.\r
-* @param {Number} p_nGroupIndex Optional. Number specifying the group to\r
-* which the items belongs.\r
-* @return {Array}\r
-*/\r
-addItems: function(p_aItems, p_nGroupIndex) {\r
-\r
- function isArray(p_oValue) {\r
-\r
- return (typeof p_oValue == "object" && p_oValue.constructor == Array);\r
-\r
- }\r
-\r
-\r
- if(isArray(p_aItems)) {\r
-\r
- var nItems = p_aItems.length;\r
- var aItems = [];\r
- var oItem;\r
-\r
-\r
- for(var i=0; i<nItems; i++) {\r
-\r
- oItem = p_aItems[i];\r
-\r
- if(isArray(oItem)) {\r
-\r
- aItems[aItems.length] = this.addItems(oItem, i);\r
-\r
- }\r
- else {\r
-\r
- aItems[aItems.length] =\r
- this._addItemToGroup(p_nGroupIndex, oItem);\r
-\r
- }\r
-\r
- }\r
-\r
-\r
- if(aItems.length) {\r
-\r
- return aItems;\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method insertItem\r
-* @description Inserts an item into the menu at the specified index.\r
-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
-* instance to be added to the menu.\r
-* @param {String} p_oItem String specifying the text of the item to be added\r
-* to the menu.\r
-* @param {Object} p_oItem Object literal containing a set of menu item\r
-* configuration properties.\r
-* @param {Number} p_nItemIndex Number indicating the ordinal position at which\r
-* the item should be added.\r
-* @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r
-* the item belongs.\r
-* @return {YAHOO.widget.MenuItem}\r
-*/\r
-insertItem: function(p_oItem, p_nItemIndex, p_nGroupIndex) {\r
-\r
- if(p_oItem) {\r
-\r
- return this._addItemToGroup(p_nGroupIndex, p_oItem, p_nItemIndex);\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method removeItem\r
-* @description Removes the specified item from the menu.\r
-* @param {YAHOO.widget.MenuItem} p_oObject Object reference for the MenuItem\r
-* instance to be removed from the menu.\r
-* @param {Number} p_oObject Number specifying the index of the item\r
-* to be removed.\r
-* @param {Number} p_nGroupIndex Optional. Number specifying the group to\r
-* which the item belongs.\r
-* @return {YAHOO.widget.MenuItem}\r
-*/\r
-removeItem: function(p_oObject, p_nGroupIndex) {\r
-\r
- if(typeof p_oObject != "undefined") {\r
-\r
- var oItem;\r
-\r
- if(p_oObject instanceof YAHOO.widget.MenuItem) {\r
-\r
- oItem = this._removeItemFromGroupByValue(p_nGroupIndex, p_oObject);\r
-\r
- }\r
- else if(typeof p_oObject == "number") {\r
-\r
- oItem = this._removeItemFromGroupByIndex(p_nGroupIndex, p_oObject);\r
-\r
- }\r
-\r
- if(oItem) {\r
-\r
- oItem.destroy();\r
-\r
- this.logger.log("Item removed." +\r
- " Text: " + oItem.cfg.getProperty("text") + ", " +\r
- " Index: " + oItem.index + ", " +\r
- " Group Index: " + oItem.groupIndex);\r
-\r
- return oItem;\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method getItemGroups\r
-* @description Returns a multi-dimensional array of all of the items in the menu.\r
-* @return {Array}\r
-*/\r
-getItemGroups: function() {\r
-\r
- return this._aItemGroups;\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method getItem\r
-* @description Returns the item at the specified index.\r
-* @param {Number} p_nItemIndex Number indicating the ordinal position of the\r
-* item to be retrieved.\r
-* @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r
-* the item belongs.\r
-* @return {YAHOO.widget.MenuItem}\r
-*/\r
-getItem: function(p_nItemIndex, p_nGroupIndex) {\r
-\r
- if(typeof p_nItemIndex == "number") {\r
-\r
- var aGroup = this._getItemGroup(p_nGroupIndex);\r
-\r
- if(aGroup) {\r
-\r
- return aGroup[p_nItemIndex];\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-\r
-/**\r
-* @method destroy\r
-* @description Removes the menu's <code><div></code> element\r
-* (and accompanying child nodes) from the document.\r
-*/\r
-destroy: function() {\r
-\r
- // Remove Custom Event listeners\r
-\r
- this.mouseOverEvent.unsubscribeAll();\r
- this.mouseOutEvent.unsubscribeAll();\r
- this.mouseDownEvent.unsubscribeAll();\r
- this.mouseUpEvent.unsubscribeAll();\r
- this.clickEvent.unsubscribeAll();\r
- this.keyPressEvent.unsubscribeAll();\r
- this.keyDownEvent.unsubscribeAll();\r
- this.keyUpEvent.unsubscribeAll();\r
-\r
-\r
- var nItemGroups = this._aItemGroups.length;\r
- var nItems;\r
- var oItemGroup;\r
- var oItem;\r
- var i;\r
- var n;\r
-\r
-\r
- // Remove all items\r
-\r
- if(nItemGroups > 0) {\r
-\r
- i = nItemGroups - 1;\r
-\r
- do {\r
-\r
- oItemGroup = this._aItemGroups[i];\r
-\r
- if(oItemGroup) {\r
-\r
- nItems = oItemGroup.length;\r
-\r
- if(nItems > 0) {\r
-\r
- n = nItems - 1;\r
-\r
- do {\r
-\r
- oItem = this._aItemGroups[i][n];\r
-\r
- if(oItem) {\r
-\r
- oItem.destroy();\r
- }\r
-\r
- }\r
- while(n--);\r
-\r
- }\r
-\r
- }\r
+ " unregistered from the collection of visible menus.");\r
\r
}\r
- while(i--);\r
\r
}\r
\r
\r
- // Continue with the superclass implementation of this method\r
+ /**\r
+ * @method onItemAdded\r
+ * @description "itemadded" event handler for a Menu instance.\r
+ * @private\r
+ * @param {String} p_sType String representing the name of the event that\r
+ * was fired.\r
+ * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+ */\r
+ function onItemAdded(p_sType, p_aArgs) {\r
\r
- YAHOO.widget.Menu.superclass.destroy.call(this);\r
+ addItem(p_aArgs[0]);\r
\r
- this.logger.log("Destroyed.");\r
+ }\r
\r
-},\r
\r
+ /**\r
+ * @method onItemRemoved\r
+ * @description "itemremoved" event handler for a Menu instance.\r
+ * @private\r
+ * @param {String} p_sType String representing the name of the event that\r
+ * was fired.\r
+ * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+ */\r
+ function onItemRemoved(p_sType, p_aArgs) {\r
\r
-/**\r
-* @method setInitialFocus\r
-* @description Sets focus to the menu's first enabled item.\r
-*/\r
-setInitialFocus: function() {\r
+ removeItem(p_aArgs[0]);\r
\r
- var oItem = this._getFirstEnabledItem();\r
+ }\r
\r
- if(oItem) {\r
\r
- oItem.focus();\r
- }\r
\r
-},\r
+ return {\r
\r
+ // Privileged methods\r
\r
-/**\r
-* @method setInitialSelection\r
-* @description Sets the "selected" configuration property of the menu's first\r
-* enabled item to "true."\r
-*/\r
-setInitialSelection: function() {\r
\r
- var oItem = this._getFirstEnabledItem();\r
+ /**\r
+ * @method addMenu\r
+ * @description Adds a menu to the collection of known menus.\r
+ * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu\r
+ * instance to be added.\r
+ */\r
+ addMenu: function(p_oMenu) {\r
\r
- if(oItem) {\r
+ if(p_oMenu && p_oMenu.id && !m_oMenus[p_oMenu.id]) {\r
\r
- oItem.cfg.setProperty("selected", true);\r
- }\r
+ m_oMenus[p_oMenu.id] = p_oMenu;\r
\r
-},\r
\r
+ if(!m_bInitializedEventHandlers) {\r
\r
-/**\r
-* @method clearActiveItem\r
-* @description Sets the "selected" configuration property of the menu's active\r
-* item to "false" and hides the item's submenu.\r
-* @param {Boolean} p_bBlur Boolean indicating if the menu's active item\r
-* should be blurred.\r
-*/\r
-clearActiveItem: function(p_bBlur) {\r
+ var oDoc = document;\r
\r
- if(this.cfg.getProperty("showdelay") > 0) {\r
+ Event.addListener(oDoc, "mouseover", onDOMEvent, me, true);\r
+ Event.addListener(oDoc, "mouseout", onDOMEvent, me, true);\r
+ Event.addListener(oDoc, "mousedown", onDOMEvent, me, true);\r
+ Event.addListener(oDoc, "mouseup", onDOMEvent, me, true);\r
+ Event.addListener(oDoc, "click", onDOMEvent, me, true);\r
+ Event.addListener(oDoc, "keydown", onDOMEvent, me, true);\r
+ Event.addListener(oDoc, "keyup", onDOMEvent, me, true);\r
+ Event.addListener(oDoc, "keypress", onDOMEvent, me, true);\r
\r
- this._cancelShowDelay();\r
+ m_bInitializedEventHandlers = true;\r
\r
- }\r
+ m_oLogger.log("DOM event handlers initialized.");\r
\r
+ }\r
\r
- var oActiveItem = this.activeItem;\r
+ p_oMenu.destroyEvent.subscribe(onMenuDestroy, p_oMenu, me);\r
\r
- if(oActiveItem) {\r
+ p_oMenu.cfg.subscribeToConfigEvent(\r
+ "visible",\r
+ onMenuVisibleConfigChange,\r
+ p_oMenu\r
+ );\r
\r
- var oConfig = oActiveItem.cfg;\r
+ p_oMenu.itemAddedEvent.subscribe(onItemAdded);\r
+ p_oMenu.itemRemovedEvent.subscribe(onItemRemoved);\r
\r
- oConfig.setProperty("selected", false);\r
+ m_oLogger.log("Menu: " +\r
+ p_oMenu.toString() + " successfully registered.");\r
\r
- var oSubmenu = oConfig.getProperty("submenu");\r
+ }\r
\r
- if(oSubmenu) {\r
+ },\r
\r
- oSubmenu.hide();\r
\r
- }\r
+ /**\r
+ * @method removeMenu\r
+ * @description Removes a menu from the collection of known menus.\r
+ * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu\r
+ * instance to be removed.\r
+ */\r
+ removeMenu: function(p_oMenu) {\r
\r
- if(p_bBlur) {\r
+ if(p_oMenu && m_oMenus[p_oMenu.id]) {\r
\r
- oActiveItem.blur();\r
+ delete m_oMenus[p_oMenu.id];\r
\r
- }\r
+ m_oLogger.log("Menu: " +\r
+ p_oMenu.toString() + " successfully unregistered.");\r
\r
- }\r
+ }\r
\r
-},\r
+ },\r
\r
\r
-/**\r
-* @description Initializes the class's configurable properties which can be\r
-* changed using the menu's Config object ("cfg").\r
-* @method initDefaultConfig\r
-*/\r
-initDefaultConfig: function() {\r
+ /**\r
+ * @method hideVisible\r
+ * @description Hides all visible, dynamically positioned menus.\r
+ */\r
+ hideVisible: function() {\r
\r
- YAHOO.widget.Menu.superclass.initDefaultConfig.call(this);\r
+ var oMenu;\r
\r
- var oConfig = this.cfg;\r
+ for(var i in m_oVisibleMenus) {\r
\r
- // Add configuration properties\r
+ if(m_oVisibleMenus.hasOwnProperty(i)) {\r
\r
- /*\r
- Change the default value for the "visible" configuration\r
- property to "false" by re-adding the property.\r
- */\r
+ oMenu = m_oVisibleMenus[i];\r
\r
- /**\r
- * @config visible\r
- * @description Boolean indicating whether or not the menu is visible. If\r
- * the menu's "position" configuration property is set to "dynamic" (the\r
- * default), this property toggles the menu's <code><div></code>\r
- * element's "visibility" style property between "visible" (true) or\r
- * "hidden" (false). If the menu's "position" configuration property is\r
- * set to "static" this property toggles the menu's\r
- * <code><div></code> element's "display" style property\r
- * between "block" (true) or "none" (false).\r
- * @default false\r
- * @type Boolean\r
- */\r
- oConfig.addProperty(\r
- "visible",\r
- {\r
- value:false,\r
- handler:this.configVisible,\r
- validator:this.cfg.checkBoolean\r
- }\r
- );\r
+ if(oMenu.cfg.getProperty("position") == "dynamic") {\r
\r
+ oMenu.hide();\r
\r
- /*\r
- Change the default value for the "constraintoviewport" configuration\r
- property to "true" by re-adding the property.\r
- */\r
+ }\r
\r
- /**\r
- * @config constraintoviewport\r
- * @description Boolean indicating if the menu will try to remain inside\r
- * the boundaries of the size of viewport.\r
- * @default true\r
- * @type Boolean\r
- */\r
- oConfig.addProperty(\r
- "constraintoviewport",\r
- {\r
- value:true,\r
- handler:this.configConstrainToViewport,\r
- validator:this.cfg.checkBoolean,\r
- supercedes:["iframe","x","y","xy"]\r
- }\r
- );\r
+ }\r
\r
+ }\r
\r
- /**\r
- * @config position\r
- * @description String indicating how a menu should be positioned on the\r
- * screen. Possible values are "static" and "dynamic." Static menus are\r
- * visible by default and reside in the normal flow of the document\r
- * (CSS position: static). Dynamic menus are hidden by default, reside\r
- * out of the normal flow of the document (CSS position: absolute), and\r
- * can overlay other elements on the screen.\r
- * @default dynamic\r
- * @type String\r
- */\r
- oConfig.addProperty(\r
- "position",\r
- {\r
- value: "dynamic",\r
- handler: this.configPosition,\r
- validator: this._checkPosition,\r
- supercedes: ["visible"]\r
- }\r
- );\r
+ },\r
\r
\r
- /**\r
- * @config submenualignment\r
- * @description Array defining how submenus should be aligned to their\r
- * parent menu item. The format is: [itemCorner, submenuCorner]. By default\r
- * a submenu's top left corner is aligned to its parent menu item's top\r
- * right corner.\r
- * @default ["tl","tr"]\r
- * @type Array\r
- */\r
- oConfig.addProperty("submenualignment", { value: ["tl","tr"] } );\r
+ /**\r
+ * @method getMenus\r
+ * @description Returns an array of all menus registered with the\r
+ * menu manger.\r
+ * @return {Array}\r
+ */\r
+ getMenus: function() {\r
\r
+ return m_oMenus;\r
\r
- /**\r
- * @config autosubmenudisplay\r
- * @description Boolean indicating if submenus are automatically made\r
- * visible when the user mouses over the menu's items.\r
- * @default true\r
- * @type Boolean\r
- */\r
- oConfig.addProperty(\r
- "autosubmenudisplay",\r
- {\r
- value: true,\r
- validator: oConfig.checkBoolean\r
- }\r
- );\r
+ },\r
\r
\r
- /**\r
- * @config showdelay\r
- * @description Number indicating the time (in milliseconds) that should\r
- * expire before a submenu is made visible when the user mouses over\r
- * the menu's items.\r
- * @default 0\r
- * @type Number\r
- */\r
- oConfig.addProperty(\r
- "showdelay",\r
- {\r
- value: 0,\r
- validator: oConfig.checkNumber\r
- }\r
- );\r
+ /**\r
+ * @method getMenu\r
+ * @description Returns a menu with the specified id.\r
+ * @param {String} p_sId String specifying the id of the menu to\r
+ * be retrieved.\r
+ * @return {YAHOO.widget.Menu}\r
+ */\r
+ getMenu: function(p_sId) {\r
\r
+ if(m_oMenus[p_sId]) {\r
\r
- /**\r
- * @config hidedelay\r
- * @description Number indicating the time (in milliseconds) that should\r
- * expire before the menu is hidden.\r
- * @default 0\r
- * @type Number\r
- */\r
- oConfig.addProperty(\r
- "hidedelay",\r
- {\r
- value: 0,\r
- validator: oConfig.checkNumber,\r
- handler: this.configHideDelay,\r
- suppressEvent: true\r
- }\r
- );\r
+ return m_oMenus[p_sId];\r
\r
+ }\r
\r
- /**\r
- * @config clicktohide\r
- * @description Boolean indicating if the menu will automatically be\r
- * hidden if the user clicks outside of it.\r
- * @default true\r
- * @type Boolean\r
- */\r
- oConfig.addProperty(\r
- "clicktohide",\r
- {\r
- value: true,\r
- validator: oConfig.checkBoolean\r
- }\r
- );\r
+ },\r
\r
\r
- /**\r
- * @config container\r
- * @description HTML element reference or string specifying the id\r
- * attribute of the HTML element that the menu's markup should be rendered into.\r
- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
- * level-one-html.html#ID-58190037">HTMLElement</a>|String\r
- * @default document.body\r
- */\r
- this.cfg.addProperty(\r
- "container",\r
- { value:document.body, handler:this.configContainer }\r
- );\r
+ /**\r
+ * @method toString\r
+ * @description Returns a string representing the menu manager.\r
+ * @return {String}\r
+ */\r
+ toString: function() {\r
\r
-}\r
+ return ("MenuManager");\r
\r
-}); // END YAHOO.extend\r
+ }\r
+\r
+ };\r
\r
+}();\r
+\r
+})();\r\r
+\r\r
+\r\r
+(function() {\r\r
+\r\r
+var Dom = YAHOO.util.Dom,\r\r
+ Event = YAHOO.util.Event;\r\r
+\r\r
+\r\r
+/**\r\r
+* The Menu class creates a container that holds a vertical list representing\r\r
+* a set of options or commands. Menu is the base class for all\r\r
+* menu containers.\r\r
+* @param {String} p_oElement String specifying the id attribute of the\r\r
+* <code><div></code> element of the menu.\r\r
+* @param {String} p_oElement String specifying the id attribute of the\r\r
+* <code><select></code> element to be used as the data source\r\r
+* for the menu.\r\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r\r
+* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object\r\r
+* specifying the <code><div></code> element of the menu.\r\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r\r
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement\r\r
+* Object specifying the <code><select></code> element to be used as\r\r
+* the data source for the menu.\r\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r\r
+* configuration for the menu. See configuration class documentation for\r\r
+* more details.\r\r
+* @namespace YAHOO.widget\r\r
+* @class Menu\r\r
+* @constructor\r\r
+* @extends YAHOO.widget.Overlay\r\r
+*/\r\r
+YAHOO.widget.Menu = function(p_oElement, p_oConfig) {\r\r
+\r\r
+ if(p_oConfig) {\r\r
+\r\r
+ this.parent = p_oConfig.parent;\r\r
+\r\r
+ this.lazyLoad = p_oConfig.lazyLoad || p_oConfig.lazyload;\r\r
+\r\r
+ this.itemData = p_oConfig.itemData || p_oConfig.itemdata;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.constructor.call(\r\r
+ this,\r\r
+ p_oElement,\r\r
+ p_oConfig\r\r
+ );\r\r
+\r\r
+};\r\r
+\r\r
+YAHOO.extend(YAHOO.widget.Menu, YAHOO.widget.Overlay, {\r\r
+\r\r
+\r\r
+\r\r
+// Constants\r\r
+\r\r
+\r\r
+/**\r\r
+* @property CSS_CLASS_NAME\r\r
+* @description String representing the CSS class(es) to be applied to the\r\r
+* menu's <code><div></code> element.\r\r
+* @default "yuimenu"\r\r
+* @final\r\r
+* @type String\r\r
+*/\r\r
+CSS_CLASS_NAME: "yuimenu",\r\r
+\r\r
+\r\r
+/**\r\r
+* @property ITEM_TYPE\r\r
+* @description Object representing the type of menu item to instantiate and\r\r
+* add when parsing the child nodes (either <code><li></code> element,\r\r
+* <code><optgroup></code> element or <code><option></code>)\r\r
+* of the menu's source HTML element.\r\r
+* @default YAHOO.widget.MenuItem\r\r
+* @final\r\r
+* @type YAHOO.widget.MenuItem\r\r
+*/\r\r
+ITEM_TYPE: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property GROUP_TITLE_TAG_NAME\r\r
+* @description String representing the tagname of the HTML element used to\r\r
+* title the menu's item groups.\r\r
+* @default H6\r\r
+* @final\r\r
+* @type String\r\r
+*/\r\r
+GROUP_TITLE_TAG_NAME: "h6",\r\r
+\r\r
+\r\r
+\r\r
+// Private properties\r\r
+\r\r
+\r\r
+/**\r\r
+* @property _nHideDelayId\r\r
+* @description Number representing the time-out setting used to cancel the\r\r
+* hiding of a menu.\r\r
+* @default null\r\r
+* @private\r\r
+* @type Number\r\r
+*/\r\r
+_nHideDelayId: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property _nShowDelayId\r\r
+* @description Number representing the time-out setting used to cancel the\r\r
+* showing of a menu.\r\r
+* @default null\r\r
+* @private\r\r
+* @type Number\r\r
+*/\r\r
+_nShowDelayId: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property _hideDelayEventHandlersAssigned\r\r
+* @description Boolean indicating if the "mouseover" and "mouseout" event\r\r
+* handlers used for hiding the menu via a call to "window.setTimeout" have\r\r
+* already been assigned.\r\r
+* @default false\r\r
+* @private\r\r
+* @type Boolean\r\r
+*/\r\r
+_hideDelayEventHandlersAssigned: false,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property _bHandledMouseOverEvent\r\r
+* @description Boolean indicating the current state of the menu's\r\r
+* "mouseover" event.\r\r
+* @default false\r\r
+* @private\r\r
+* @type Boolean\r\r
+*/\r\r
+_bHandledMouseOverEvent: false,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property _bHandledMouseOutEvent\r\r
+* @description Boolean indicating the current state of the menu's\r\r
+* "mouseout" event.\r\r
+* @default false\r\r
+* @private\r\r
+* @type Boolean\r\r
+*/\r\r
+_bHandledMouseOutEvent: false,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property _aGroupTitleElements\r\r
+* @description Array of HTML element used to title groups of menu items.\r\r
+* @default []\r\r
+* @private\r\r
+* @type Array\r\r
+*/\r\r
+_aGroupTitleElements: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property _aItemGroups\r\r
+* @description Array of menu items.\r\r
+* @default []\r\r
+* @private\r\r
+* @type Array\r\r
+*/\r\r
+_aItemGroups: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property _aListElements\r\r
+* @description Array of <code><ul></code> elements, each of which is\r\r
+* the parent node for each item's <code><li></code> element.\r\r
+* @default []\r\r
+* @private\r\r
+* @type Array\r\r
+*/\r\r
+_aListElements: null,\r\r
+\r\r
+\r\r
+\r\r
+// Public properties\r\r
+\r\r
+\r\r
+/**\r\r
+* @property lazyLoad\r\r
+* @description Boolean indicating if the menu's "lazy load" feature is\r\r
+* enabled. If set to "true," initialization and rendering of the menu's\r\r
+* items will be deferred until the first time it is made visible. This\r\r
+* property should be set via the constructor using the configuration\r\r
+* object literal.\r\r
+* @default false\r\r
+* @type Boolean\r\r
+*/\r\r
+lazyLoad: false,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property itemData\r\r
+* @description Array of items to be added to the menu. The array can contain\r\r
+* strings representing the text for each item to be created, object literals\r\r
+* representing the menu item configuration properties, or MenuItem instances.\r\r
+* This property should be set via the constructor using the configuration\r\r
+* object literal.\r\r
+* @default null\r\r
+* @type Array\r\r
+*/\r\r
+itemData: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property activeItem\r\r
+* @description Object reference to the item in the menu that has focus.\r\r
+* @default null\r\r
+* @type YAHOO.widget.MenuItem\r\r
+*/\r\r
+activeItem: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property parent\r\r
+* @description Object reference to the menu's parent menu or menu item.\r\r
+* This property can be set via the constructor using the configuration\r\r
+* object literal.\r\r
+* @default null\r\r
+* @type YAHOO.widget.MenuItem\r\r
+*/\r\r
+parent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property srcElement\r\r
+* @description Object reference to the HTML element (either\r\r
+* <code><select></code> or <code><div></code>) used to\r\r
+* create the menu.\r\r
+* @default null\r\r
+* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r\r
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>|<a\r\r
+* href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.\r\r
+* html#ID-22445964">HTMLDivElement</a>\r\r
+*/\r\r
+srcElement: null,\r\r
+\r\r
+\r\r
+\r\r
+// Events\r\r
+\r\r
+\r\r
+/**\r\r
+* @event mouseOverEvent\r\r
+* @description Fires when the mouse has entered the menu. Passes back\r\r
+* the DOM Event object as an argument.\r\r
+*/\r\r
+mouseOverEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event mouseOutEvent\r\r
+* @description Fires when the mouse has left the menu. Passes back the DOM\r\r
+* Event object as an argument.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+mouseOutEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event mouseDownEvent\r\r
+* @description Fires when the user mouses down on the menu. Passes back the\r\r
+* DOM Event object as an argument.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+mouseDownEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event mouseUpEvent\r\r
+* @description Fires when the user releases a mouse button while the mouse is\r\r
+* over the menu. Passes back the DOM Event object as an argument.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+mouseUpEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event clickEvent\r\r
+* @description Fires when the user clicks the on the menu. Passes back the\r\r
+* DOM Event object as an argument.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+clickEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event keyPressEvent\r\r
+* @description Fires when the user presses an alphanumeric key when one of the\r\r
+* menu's items has focus. Passes back the DOM Event object as an argument.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+keyPressEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event keyDownEvent\r\r
+* @description Fires when the user presses a key when one of the menu's items\r\r
+* has focus. Passes back the DOM Event object as an argument.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+keyDownEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event keyUpEvent\r\r
+* @description Fires when the user releases a key when one of the menu's items\r\r
+* has focus. Passes back the DOM Event object as an argument.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+keyUpEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event itemAddedEvent\r\r
+* @description Fires when an item is added to the menu.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+itemAddedEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event itemRemovedEvent\r\r
+* @description Fires when an item is removed to the menu.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+itemRemovedEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @method init\r\r
+* @description The Menu class's initialization method. This method is\r\r
+* automatically called by the constructor, and sets up all DOM references\r\r
+* for pre-existing markup, and creates required markup if it is not\r\r
+* already present.\r\r
+* @param {String} p_oElement String specifying the id attribute of the\r\r
+* <code><div></code> element of the menu.\r\r
+* @param {String} p_oElement String specifying the id attribute of the\r\r
+* <code><select></code> element to be used as the data source\r\r
+* for the menu.\r\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r\r
+* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object\r\r
+* specifying the <code><div></code> element of the menu.\r\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r\r
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement\r\r
+* Object specifying the <code><select></code> element to be used as\r\r
+* the data source for the menu.\r\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r\r
+* configuration for the menu. See configuration class documentation for\r\r
+* more details.\r\r
+*/\r\r
+init: function(p_oElement, p_oConfig) {\r\r
+\r\r
+ this._aItemGroups = [];\r\r
+ this._aListElements = [];\r\r
+ this._aGroupTitleElements = [];\r\r
+\r\r
+\r\r
+ if(!this.ITEM_TYPE) {\r\r
+\r\r
+ this.ITEM_TYPE = YAHOO.widget.MenuItem;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ var oElement;\r\r
+\r\r
+ if(typeof p_oElement == "string") {\r\r
+\r\r
+ oElement = document.getElementById(p_oElement);\r\r
+\r\r
+ }\r\r
+ else if(p_oElement.tagName) {\r\r
+\r\r
+ oElement = p_oElement;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(oElement && oElement.tagName) {\r\r
+\r\r
+ switch(oElement.tagName.toUpperCase()) {\r\r
+\r\r
+ case "DIV":\r\r
+\r\r
+ this.srcElement = oElement;\r\r
+\r\r
+ if(!oElement.id) {\r\r
+\r\r
+ oElement.setAttribute("id", Dom.generateId());\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ /*\r\r
+ Note: we don't pass the user config in here yet\r\r
+ because we only want it executed once, at the lowest\r\r
+ subclass level.\r\r
+ */\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.init.call(this, oElement);\r\r
+\r\r
+ this.beforeInitEvent.fire(YAHOO.widget.Menu);\r\r
+\r\r
+ this.logger = new YAHOO.widget.LogWriter(this.toString());\r\r
+\r\r
+ this.logger.log("Source element: " + this.srcElement.tagName);\r\r
+\r\r
+ break;\r\r
+\r\r
+ case "SELECT":\r\r
+\r\r
+ this.srcElement = oElement;\r\r
+\r\r
+\r\r
+ /*\r\r
+ The source element is not something that we can use\r\r
+ outright, so we need to create a new Overlay\r\r
+\r\r
+ Note: we don't pass the user config in here yet\r\r
+ because we only want it executed once, at the lowest\r\r
+ subclass level.\r\r
+ */\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.init.call(this, Dom.generateId());\r\r
+\r\r
+ this.beforeInitEvent.fire(YAHOO.widget.Menu);\r\r
+\r\r
+ this.logger = new YAHOO.widget.LogWriter(this.toString());\r\r
+\r\r
+ this.logger.log("Source element: " + this.srcElement.tagName);\r\r
+\r\r
+ break;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ /*\r\r
+ Note: we don't pass the user config in here yet\r\r
+ because we only want it executed once, at the lowest\r\r
+ subclass level.\r\r
+ */\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.init.call(this, p_oElement);\r\r
+\r\r
+ this.beforeInitEvent.fire(YAHOO.widget.Menu);\r\r
+\r\r
+ this.logger = new YAHOO.widget.LogWriter(this.toString());\r\r
+\r\r
+ this.logger.log("No source element found. " +\r\r
+ "Created element with id: " + this.id);\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(this.element) {\r\r
+\r\r
+ var oEl = this.element;\r\r
+\r\r
+ Dom.addClass(oEl, this.CSS_CLASS_NAME);\r\r
+\r\r
+\r\r
+ // Subscribe to Custom Events\r\r
+\r\r
+ this.initEvent.subscribe(this._onInit, this, true);\r\r
+ this.beforeRenderEvent.subscribe(this._onBeforeRender, this, true);\r\r
+ this.renderEvent.subscribe(this._onRender, this, true);\r\r
+ this.beforeShowEvent.subscribe(this._onBeforeShow, this, true);\r\r
+ this.showEvent.subscribe(this._onShow, this, true);\r\r
+ this.beforeHideEvent.subscribe(this._onBeforeHide, this, true);\r\r
+ this.mouseOverEvent.subscribe(this._onMouseOver, this, true);\r\r
+ this.mouseOutEvent.subscribe(this._onMouseOut, this, true);\r\r
+ this.clickEvent.subscribe(this._onClick, this, true);\r\r
+ this.keyDownEvent.subscribe(this._onKeyDown, this, true);\r\r
+\r\r
+ YAHOO.widget.Module.textResizeEvent.subscribe(\r\r
+ this._onTextResize,\r\r
+ this,\r\r
+ true\r\r
+ );\r\r
+\r\r
+\r\r
+ if(p_oConfig) {\r\r
+\r\r
+ this.cfg.applyConfig(p_oConfig, true);\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ // Register the Menu instance with the MenuManager\r\r
+\r\r
+ YAHOO.widget.MenuManager.addMenu(this);\r\r
+\r\r
+\r\r
+ this.initEvent.fire(YAHOO.widget.Menu);\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+\r\r
+// Private methods\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _initSubTree\r\r
+* @description Iterates the childNodes of the source element to find nodes\r\r
+* used to instantiate menu and menu items.\r\r
+* @private\r\r
+*/\r\r
+_initSubTree: function() {\r\r
+\r\r
+ var oNode;\r\r
+\r\r
+ if(this.srcElement.tagName == "DIV") {\r\r
+\r\r
+ /*\r\r
+ Populate the collection of item groups and item\r\r
+ group titles\r\r
+ */\r\r
+\r\r
+ oNode = this.body.firstChild;\r\r
+\r\r
+ var nGroup = 0,\r\r
+ sGroupTitleTagName = this.GROUP_TITLE_TAG_NAME.toUpperCase();\r\r
+\r\r
+ do {\r\r
+\r\r
+ if(oNode && oNode.tagName) {\r\r
+\r\r
+ switch(oNode.tagName.toUpperCase()) {\r\r
+\r\r
+ case sGroupTitleTagName:\r\r
+\r\r
+ this._aGroupTitleElements[nGroup] = oNode;\r\r
+\r\r
+ break;\r\r
+\r\r
+ case "UL":\r\r
+\r\r
+ this._aListElements[nGroup] = oNode;\r\r
+ this._aItemGroups[nGroup] = [];\r\r
+ nGroup++;\r\r
+\r\r
+ break;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ while((oNode = oNode.nextSibling));\r\r
+\r\r
+\r\r
+ /*\r\r
+ Apply the "first-of-type" class to the first UL to mimic\r\r
+ the "first-of-type" CSS3 psuedo class.\r\r
+ */\r\r
+\r\r
+ if(this._aListElements[0]) {\r\r
+\r\r
+ Dom.addClass(this._aListElements[0], "first-of-type");\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ oNode = null;\r\r
+\r\r
+ this.logger.log("Searching DOM for items to initialize.");\r\r
+\r\r
+ if(this.srcElement.tagName) {\r\r
+\r\r
+ var sSrcElementTagName = this.srcElement.tagName.toUpperCase();\r\r
+\r\r
+\r\r
+ switch(sSrcElementTagName) {\r\r
+\r\r
+ case "DIV":\r\r
+\r\r
+ if(this._aListElements.length > 0) {\r\r
+\r\r
+ this.logger.log("Found " +\r\r
+ this._aListElements.length +\r\r
+ " item groups to initialize.");\r\r
+\r\r
+ var i = this._aListElements.length - 1;\r\r
+\r\r
+ do {\r\r
+\r\r
+ oNode = this._aListElements[i].firstChild;\r\r
+\r\r
+ this.logger.log("Scanning " +\r\r
+ this._aListElements[i].childNodes.length +\r\r
+ " child nodes for items to initialize.");\r\r
+\r\r
+ do {\r\r
+\r\r
+ if(\r\r
+ oNode &&\r\r
+ oNode.tagName &&\r\r
+ oNode.tagName.toUpperCase() == "LI"\r\r
+ ) {\r\r
+\r\r
+ this.logger.log("Initializing " +\r\r
+ oNode.tagName + " node.");\r\r
+\r\r
+ this.addItem(\r\r
+ new this.ITEM_TYPE(\r\r
+ oNode,\r\r
+ { parent: this }\r\r
+ ),\r\r
+ i\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ while((oNode = oNode.nextSibling));\r\r
+\r\r
+ }\r\r
+ while(i--);\r\r
+\r\r
+ }\r\r
+\r\r
+ break;\r\r
+\r\r
+ case "SELECT":\r\r
+\r\r
+ this.logger.log("Scanning " +\r\r
+ this.srcElement.childNodes.length +\r\r
+ " child nodes for items to initialize.");\r\r
+\r\r
+ oNode = this.srcElement.firstChild;\r\r
+\r\r
+ do {\r\r
+\r\r
+ if(oNode && oNode.tagName) {\r\r
+\r\r
+ switch(oNode.tagName.toUpperCase()) {\r\r
+\r\r
+ case "OPTGROUP":\r\r
+ case "OPTION":\r\r
+\r\r
+ this.logger.log("Initializing " +\r\r
+ oNode.tagName + " node.");\r\r
+\r\r
+ this.addItem(\r\r
+ new this.ITEM_TYPE(\r\r
+ oNode,\r\r
+ { parent: this }\r\r
+ )\r\r
+ );\r\r
+\r\r
+ break;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ while((oNode = oNode.nextSibling));\r\r
+\r\r
+ break;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _getFirstEnabledItem\r\r
+* @description Returns the first enabled item in the menu.\r\r
+* @return {YAHOO.widget.MenuItem}\r\r
+* @private\r\r
+*/\r\r
+_getFirstEnabledItem: function() {\r\r
+\r\r
+ var nGroups = this._aItemGroups.length,\r\r
+ oItem,\r\r
+ aItemGroup;\r\r
+\r\r
+ for(var i=0; i<nGroups; i++) {\r\r
+\r\r
+ aItemGroup = this._aItemGroups[i];\r\r
+\r\r
+ if(aItemGroup) {\r\r
+\r\r
+ var nItems = aItemGroup.length;\r\r
+\r\r
+ for(var n=0; n<nItems; n++) {\r\r
+\r\r
+ oItem = aItemGroup[n];\r\r
+\r\r
+ if(\r\r
+ !oItem.cfg.getProperty("disabled") &&\r\r
+ oItem.element.style.display != "none"\r\r
+ ) {\r\r
+\r\r
+ return oItem;\r\r
+\r\r
+ }\r\r
+\r\r
+ oItem = null;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _checkPosition\r\r
+* @description Checks to make sure that the value of the "position" property\r\r
+* is one of the supported strings. Returns true if the position is supported.\r\r
+* @private\r\r
+* @param {Object} p_sPosition String specifying the position of the menu.\r\r
+* @return {Boolean}\r\r
+*/\r\r
+_checkPosition: function(p_sPosition) {\r\r
+\r\r
+ if(typeof p_sPosition == "string") {\r\r
+\r\r
+ var sPosition = p_sPosition.toLowerCase();\r\r
+\r\r
+ return ("dynamic,static".indexOf(sPosition) != -1);\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _addItemToGroup\r\r
+* @description Adds a menu item to a group.\r\r
+* @private\r\r
+* @param {Number} p_nGroupIndex Number indicating the group to which the\r\r
+* item belongs.\r\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r\r
+* instance to be added to the menu.\r\r
+* @param {String} p_oItem String specifying the text of the item to be added\r\r
+* to the menu.\r\r
+* @param {Object} p_oItem Object literal containing a set of menu item\r\r
+* configuration properties.\r\r
+* @param {Number} p_nItemIndex Optional. Number indicating the index at\r\r
+* which the menu item should be added.\r\r
+* @return {YAHOO.widget.MenuItem}\r\r
+*/\r\r
+_addItemToGroup: function(p_nGroupIndex, p_oItem, p_nItemIndex) {\r\r
+\r\r
+ var oItem;\r\r
+\r\r
+ if(p_oItem instanceof this.ITEM_TYPE) {\r\r
+\r\r
+ oItem = p_oItem;\r\r
+ oItem.parent = this;\r\r
+\r\r
+ }\r\r
+ else if(typeof p_oItem == "string") {\r\r
+\r\r
+ oItem = new this.ITEM_TYPE(p_oItem, { parent: this });\r\r
+\r\r
+ }\r\r
+ else if(typeof p_oItem == "object") {\r\r
+\r\r
+ p_oItem.parent = this;\r\r
+\r\r
+ oItem = new this.ITEM_TYPE(p_oItem.text, p_oItem);\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(oItem) {\r\r
+\r\r
+ var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0,\r\r
+ aGroup = this._getItemGroup(nGroupIndex),\r\r
+ oGroupItem;\r\r
+\r\r
+\r\r
+ if(!aGroup) {\r\r
+\r\r
+ aGroup = this._createItemGroup(nGroupIndex);\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(typeof p_nItemIndex == "number") {\r\r
+\r\r
+ var bAppend = (p_nItemIndex >= aGroup.length);\r\r
+\r\r
+\r\r
+ if(aGroup[p_nItemIndex]) {\r\r
+\r\r
+ aGroup.splice(p_nItemIndex, 0, oItem);\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ aGroup[p_nItemIndex] = oItem;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ oGroupItem = aGroup[p_nItemIndex];\r\r
+\r\r
+ if(oGroupItem) {\r\r
+\r\r
+ if(\r\r
+ bAppend &&\r\r
+ (\r\r
+ !oGroupItem.element.parentNode ||\r\r
+ oGroupItem.element.parentNode.nodeType == 11\r\r
+ )\r\r
+ ) {\r\r
+\r\r
+ this._aListElements[nGroupIndex].appendChild(\r\r
+ oGroupItem.element\r\r
+ );\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+\r\r
+ /**\r\r
+ * Returns the next sibling of an item in an array.\r\r
+ * @private\r\r
+ * @param {p_aArray} Array to search.\r\r
+ * @param {p_nStartIndex} Number indicating the index to\r\r
+ * start searching the array.\r\r
+ * @return {Object}\r\r
+ */\r\r
+ function getNextItemSibling(p_aArray, p_nStartIndex) {\r\r
+\r\r
+ return (\r\r
+ p_aArray[p_nStartIndex] ||\r\r
+ getNextItemSibling(\r\r
+ p_aArray,\r\r
+ (p_nStartIndex+1)\r\r
+ )\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ var oNextItemSibling =\r\r
+ getNextItemSibling(aGroup, (p_nItemIndex+1));\r\r
+\r\r
+ if(\r\r
+ oNextItemSibling &&\r\r
+ (\r\r
+ !oGroupItem.element.parentNode ||\r\r
+ oGroupItem.element.parentNode.nodeType == 11\r\r
+ )\r\r
+ ) {\r\r
+\r\r
+ this._aListElements[nGroupIndex].insertBefore(\r\r
+ oGroupItem.element,\r\r
+ oNextItemSibling.element\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ oGroupItem.parent = this;\r\r
+\r\r
+ this._subscribeToItemEvents(oGroupItem);\r\r
+\r\r
+ this._configureSubmenu(oGroupItem);\r\r
+\r\r
+ this._updateItemProperties(nGroupIndex);\r\r
+\r\r
+ this.logger.log("Item inserted." +\r\r
+ " Text: " + oGroupItem.cfg.getProperty("text") + ", " +\r\r
+ " Index: " + oGroupItem.index + ", " +\r\r
+ " Group Index: " + oGroupItem.groupIndex);\r\r
+\r\r
+ this.itemAddedEvent.fire(oGroupItem);\r\r
+\r\r
+ return oGroupItem;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ var nItemIndex = aGroup.length;\r\r
+\r\r
+ aGroup[nItemIndex] = oItem;\r\r
+\r\r
+ oGroupItem = aGroup[nItemIndex];\r\r
+\r\r
+\r\r
+ if(oGroupItem) {\r\r
+\r\r
+ if(\r\r
+ !Dom.isAncestor(\r\r
+ this._aListElements[nGroupIndex],\r\r
+ oGroupItem.element\r\r
+ )\r\r
+ ) {\r\r
+\r\r
+ this._aListElements[nGroupIndex].appendChild(\r\r
+ oGroupItem.element\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+ oGroupItem.element.setAttribute("groupindex", nGroupIndex);\r\r
+ oGroupItem.element.setAttribute("index", nItemIndex);\r\r
+\r\r
+ oGroupItem.parent = this;\r\r
+\r\r
+ oGroupItem.index = nItemIndex;\r\r
+ oGroupItem.groupIndex = nGroupIndex;\r\r
+\r\r
+ this._subscribeToItemEvents(oGroupItem);\r\r
+\r\r
+ this._configureSubmenu(oGroupItem);\r\r
+\r\r
+ if(nItemIndex === 0) {\r\r
+\r\r
+ Dom.addClass(oGroupItem.element, "first-of-type");\r\r
+\r\r
+ }\r\r
+\r\r
+ this.logger.log("Item added." +\r\r
+ " Text: " + oGroupItem.cfg.getProperty("text") + ", " +\r\r
+ " Index: " + oGroupItem.index + ", " +\r\r
+ " Group Index: " + oGroupItem.groupIndex);\r\r
+\r\r
+\r\r
+ this.itemAddedEvent.fire(oGroupItem);\r\r
+\r\r
+ return oGroupItem;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _removeItemFromGroupByIndex\r\r
+* @description Removes a menu item from a group by index. Returns the menu\r\r
+* item that was removed.\r\r
+* @private\r\r
+* @param {Number} p_nGroupIndex Number indicating the group to which the menu\r\r
+* item belongs.\r\r
+* @param {Number} p_nItemIndex Number indicating the index of the menu item\r\r
+* to be removed.\r\r
+* @return {YAHOO.widget.MenuItem}\r\r
+*/\r\r
+_removeItemFromGroupByIndex: function(p_nGroupIndex, p_nItemIndex) {\r\r
+\r\r
+ var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0,\r\r
+ aGroup = this._getItemGroup(nGroupIndex);\r\r
+\r\r
+ if(aGroup) {\r\r
+\r\r
+ var aArray = aGroup.splice(p_nItemIndex, 1),\r\r
+ oItem = aArray[0];\r\r
+\r\r
+ if(oItem) {\r\r
+\r\r
+ // Update the index and className properties of each member\r\r
+\r\r
+ this._updateItemProperties(nGroupIndex);\r\r
+\r\r
+ if(aGroup.length === 0) {\r\r
+\r\r
+ // Remove the UL\r\r
+\r\r
+ var oUL = this._aListElements[nGroupIndex];\r\r
+\r\r
+ if(this.body && oUL) {\r\r
+\r\r
+ this.body.removeChild(oUL);\r\r
+\r\r
+ }\r\r
+\r\r
+ // Remove the group from the array of items\r\r
+\r\r
+ this._aItemGroups.splice(nGroupIndex, 1);\r\r
+\r\r
+\r\r
+ // Remove the UL from the array of ULs\r\r
+\r\r
+ this._aListElements.splice(nGroupIndex, 1);\r\r
+\r\r
+\r\r
+ /*\r\r
+ Assign the "first-of-type" class to the new first UL\r\r
+ in the collection\r\r
+ */\r\r
+\r\r
+ oUL = this._aListElements[0];\r\r
+\r\r
+ if(oUL) {\r\r
+\r\r
+ Dom.addClass(oUL, "first-of-type");\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ this.itemRemovedEvent.fire(oItem);\r\r
+\r\r
+\r\r
+ // Return a reference to the item that was removed\r\r
+\r\r
+ return oItem;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _removeItemFromGroupByValue\r\r
+* @description Removes a menu item from a group by reference. Returns the\r\r
+* menu item that was removed.\r\r
+* @private\r\r
+* @param {Number} p_nGroupIndex Number indicating the group to which the\r\r
+* menu item belongs.\r\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r\r
+* instance to be removed.\r\r
+* @return {YAHOO.widget.MenuItem}\r\r
+*/\r\r
+_removeItemFromGroupByValue: function(p_nGroupIndex, p_oItem) {\r\r
+\r\r
+ var aGroup = this._getItemGroup(p_nGroupIndex);\r\r
+\r\r
+ if(aGroup) {\r\r
+\r\r
+ var nItems = aGroup.length,\r\r
+ nItemIndex = -1;\r\r
+\r\r
+ if(nItems > 0) {\r\r
+\r\r
+ var i = nItems-1;\r\r
+\r\r
+ do {\r\r
+\r\r
+ if(aGroup[i] == p_oItem) {\r\r
+\r\r
+ nItemIndex = i;\r\r
+ break;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ while(i--);\r\r
+\r\r
+ if(nItemIndex > -1) {\r\r
+\r\r
+ return this._removeItemFromGroupByIndex(\r\r
+ p_nGroupIndex,\r\r
+ nItemIndex\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _updateItemProperties\r\r
+* @description Updates the "index," "groupindex," and "className" properties\r\r
+* of the menu items in the specified group.\r\r
+* @private\r\r
+* @param {Number} p_nGroupIndex Number indicating the group of items to update.\r\r
+*/\r\r
+_updateItemProperties: function(p_nGroupIndex) {\r\r
+\r\r
+ var aGroup = this._getItemGroup(p_nGroupIndex),\r\r
+ nItems = aGroup.length;\r\r
+\r\r
+ if(nItems > 0) {\r\r
+\r\r
+ var i = nItems - 1,\r\r
+ oItem,\r\r
+ oLI;\r\r
+\r\r
+ // Update the index and className properties of each member\r\r
+\r\r
+ do {\r\r
+\r\r
+ oItem = aGroup[i];\r\r
+\r\r
+ if(oItem) {\r\r
+\r\r
+ oLI = oItem.element;\r\r
+\r\r
+ oItem.index = i;\r\r
+ oItem.groupIndex = p_nGroupIndex;\r\r
+\r\r
+ oLI.setAttribute("groupindex", p_nGroupIndex);\r\r
+ oLI.setAttribute("index", i);\r\r
+\r\r
+ Dom.removeClass(oLI, "first-of-type");\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ while(i--);\r\r
+\r\r
+\r\r
+ if(oLI) {\r\r
+\r\r
+ Dom.addClass(oLI, "first-of-type");\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _createItemGroup\r\r
+* @description Creates a new menu item group (array) and its associated\r\r
+* <code><ul></code> element. Returns an aray of menu item groups.\r\r
+* @private\r\r
+* @param {Number} p_nIndex Number indicating the group to create.\r\r
+* @return {Array}\r\r
+*/\r\r
+_createItemGroup: function(p_nIndex) {\r\r
+\r\r
+ if(!this._aItemGroups[p_nIndex]) {\r\r
+\r\r
+ this._aItemGroups[p_nIndex] = [];\r\r
+\r\r
+ var oUL = document.createElement("ul");\r\r
+\r\r
+ this._aListElements[p_nIndex] = oUL;\r\r
+\r\r
+ return this._aItemGroups[p_nIndex];\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _getItemGroup\r\r
+* @description Returns the menu item group at the specified index.\r\r
+* @private\r\r
+* @param {Number} p_nIndex Number indicating the index of the menu item group\r\r
+* to be retrieved.\r\r
+* @return {Array}\r\r
+*/\r\r
+_getItemGroup: function(p_nIndex) {\r\r
+\r\r
+ var nIndex = ((typeof p_nIndex == "number") ? p_nIndex : 0);\r\r
+\r\r
+ return this._aItemGroups[nIndex];\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _configureSubmenu\r\r
+* @description Subscribes the menu item's submenu to its parent menu's events.\r\r
+* @private\r\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r\r
+* instance with the submenu to be configured.\r\r
+*/\r\r
+_configureSubmenu: function(p_oItem) {\r\r
+\r\r
+ var oSubmenu = p_oItem.cfg.getProperty("submenu");\r\r
+\r\r
+ if(oSubmenu) {\r\r
+\r\r
+ /*\r\r
+ Listen for configuration changes to the parent menu\r\r
+ so they they can be applied to the submenu.\r\r
+ */\r\r
+\r\r
+ this.cfg.configChangedEvent.subscribe(\r\r
+ this._onParentMenuConfigChange,\r\r
+ oSubmenu,\r\r
+ true\r\r
+ );\r\r
+\r\r
+ this.renderEvent.subscribe(\r\r
+ this._onParentMenuRender,\r\r
+ oSubmenu,\r\r
+ true\r\r
+ );\r\r
+\r\r
+ oSubmenu.beforeShowEvent.subscribe(\r\r
+ this._onSubmenuBeforeShow,\r\r
+ oSubmenu,\r\r
+ true\r\r
+ );\r\r
+\r\r
+ oSubmenu.showEvent.subscribe(\r\r
+ this._onSubmenuShow,\r\r
+ oSubmenu,\r\r
+ true\r\r
+ );\r\r
+\r\r
+ oSubmenu.hideEvent.subscribe(\r\r
+ this._onSubmenuHide,\r\r
+ oSubmenu,\r\r
+ true\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _subscribeToItemEvents\r\r
+* @description Subscribes a menu to a menu item's event.\r\r
+* @private\r\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r\r
+* instance whose events should be subscribed to.\r\r
+*/\r\r
+_subscribeToItemEvents: function(p_oItem) {\r\r
+\r\r
+ p_oItem.focusEvent.subscribe(this._onMenuItemFocus, p_oItem, this);\r\r
+\r\r
+ p_oItem.blurEvent.subscribe(this._onMenuItemBlur, this, true);\r\r
+\r\r
+ p_oItem.cfg.configChangedEvent.subscribe(\r\r
+ this._onMenuItemConfigChange,\r\r
+ p_oItem,\r\r
+ this\r\r
+ );\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _getOffsetWidth\r\r
+* @description Returns the offset width of the menu's\r\r
+* <code><div></code> element.\r\r
+* @private\r\r
+*/\r\r
+_getOffsetWidth: function() {\r\r
+\r\r
+ var oClone = this.element.cloneNode(true);\r\r
+\r\r
+ Dom.setStyle(oClone, "width", "");\r\r
+\r\r
+ document.body.appendChild(oClone);\r\r
+\r\r
+ var sWidth = oClone.offsetWidth;\r\r
+\r\r
+ document.body.removeChild(oClone);\r\r
+\r\r
+ return sWidth;\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _cancelHideDelay\r\r
+* @description Cancels the call to "hideMenu."\r\r
+* @private\r\r
+*/\r\r
+_cancelHideDelay: function() {\r\r
+\r\r
+ var oRoot = this.getRoot();\r\r
+\r\r
+ if(oRoot._nHideDelayId) {\r\r
+\r\r
+ window.clearTimeout(oRoot._nHideDelayId);\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _execHideDelay\r\r
+* @description Hides the menu after the number of milliseconds specified by\r\r
+* the "hidedelay" configuration property.\r\r
+* @private\r\r
+*/\r\r
+_execHideDelay: function() {\r\r
+\r\r
+ this._cancelHideDelay();\r\r
+\r\r
+ var oRoot = this.getRoot(),\r\r
+ me = this;\r\r
+\r\r
+ function hideMenu() {\r\r
+\r\r
+ if(oRoot.activeItem) {\r\r
+\r\r
+ oRoot.clearActiveItem();\r\r
+\r\r
+ }\r\r
+\r\r
+ if(oRoot == me && me.cfg.getProperty("position") == "dynamic") {\r\r
+\r\r
+ me.hide();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ oRoot._nHideDelayId =\r\r
+ window.setTimeout(hideMenu, oRoot.cfg.getProperty("hidedelay"));\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _cancelShowDelay\r\r
+* @description Cancels the call to the "showMenu."\r\r
+* @private\r\r
+*/\r\r
+_cancelShowDelay: function() {\r\r
+\r\r
+ var oRoot = this.getRoot();\r\r
+\r\r
+ if(oRoot._nShowDelayId) {\r\r
+\r\r
+ window.clearTimeout(oRoot._nShowDelayId);\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _execShowDelay\r\r
+* @description Shows the menu after the number of milliseconds specified by\r\r
+* the "showdelay" configuration property have ellapsed.\r\r
+* @private\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object specifying the menu that should\r\r
+* be made visible.\r\r
+*/\r\r
+_execShowDelay: function(p_oMenu) {\r\r
+\r\r
+ var oRoot = this.getRoot();\r\r
+\r\r
+ function showMenu() {\r\r
+\r\r
+ p_oMenu.show();\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ oRoot._nShowDelayId =\r\r
+ window.setTimeout(showMenu, oRoot.cfg.getProperty("showdelay"));\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+\r\r
+// Protected methods\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onMouseOver\r\r
+* @description "mouseover" event handler for the menu.\r\r
+* @protected\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onMouseOver: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var oEvent = p_aArgs[0],\r\r
+ oItem = p_aArgs[1],\r\r
+ oTarget = Event.getTarget(oEvent);\r\r
+\r\r
+\r\r
+ if(\r\r
+ !this._bHandledMouseOverEvent &&\r\r
+ (oTarget == this.element || Dom.isAncestor(this.element, oTarget))\r\r
+ ) {\r\r
+\r\r
+ this.clearActiveItem();\r\r
+\r\r
+ this._bHandledMouseOverEvent = true;\r\r
+ this._bHandledMouseOutEvent = false;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(\r\r
+ oItem && !oItem.handledMouseOverEvent &&\r\r
+ !oItem.cfg.getProperty("disabled") &&\r\r
+ (oTarget == oItem.element || Dom.isAncestor(oItem.element, oTarget))\r\r
+ ) {\r\r
+\r\r
+ var nShowDelay = this.cfg.getProperty("showdelay"),\r\r
+ bShowDelay = (nShowDelay > 0);\r\r
+\r\r
+\r\r
+ if(bShowDelay) {\r\r
+\r\r
+ this._cancelShowDelay();\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ var oActiveItem = this.activeItem;\r\r
+\r\r
+ if(oActiveItem) {\r\r
+\r\r
+ oActiveItem.cfg.setProperty("selected", false);\r\r
+\r\r
+ var oActiveSubmenu = oActiveItem.cfg.getProperty("submenu");\r\r
+\r\r
+ if(oActiveSubmenu) {\r\r
+\r\r
+ oActiveSubmenu.hide();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ var oItemCfg = oItem.cfg;\r\r
+\r\r
+ // Select and focus the current menu item\r\r
+\r\r
+ oItemCfg.setProperty("selected", true);\r\r
+ oItem.focus();\r\r
+\r\r
+\r\r
+ if(this.cfg.getProperty("autosubmenudisplay")) {\r\r
+\r\r
+ // Show the submenu this menu item\r\r
+\r\r
+ var oSubmenu = oItemCfg.getProperty("submenu");\r\r
+\r\r
+ if(oSubmenu) {\r\r
+\r\r
+ if(bShowDelay) {\r\r
+\r\r
+ this._execShowDelay(oSubmenu);\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ oSubmenu.show();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ oItem.handledMouseOverEvent = true;\r\r
+ oItem.handledMouseOutEvent = false;\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onMouseOut\r\r
+* @description "mouseout" event handler for the menu.\r\r
+* @protected\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onMouseOut: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var oEvent = p_aArgs[0],\r\r
+ oItem = p_aArgs[1],\r\r
+ oRelatedTarget = Event.getRelatedTarget(oEvent),\r\r
+ bMovingToSubmenu = false;\r\r
+\r\r
+\r\r
+ if(oItem && !oItem.cfg.getProperty("disabled")) {\r\r
+\r\r
+ var oItemCfg = oItem.cfg,\r\r
+ oSubmenu = oItemCfg.getProperty("submenu");\r\r
+\r\r
+\r\r
+ if(\r\r
+ oSubmenu &&\r\r
+ (\r\r
+ oRelatedTarget == oSubmenu.element ||\r\r
+ Dom.isAncestor(oSubmenu.element, oRelatedTarget)\r\r
+ )\r\r
+ ) {\r\r
+\r\r
+ bMovingToSubmenu = true;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(\r\r
+ !oItem.handledMouseOutEvent &&\r\r
+ (\r\r
+ (\r\r
+ oRelatedTarget != oItem.element &&\r\r
+ !Dom.isAncestor(oItem.element, oRelatedTarget)\r\r
+ ) || bMovingToSubmenu\r\r
+ )\r\r
+ ) {\r\r
+\r\r
+ if(\r\r
+ !oSubmenu ||\r\r
+ (oSubmenu && !oSubmenu.cfg.getProperty("visible"))\r\r
+ ) {\r\r
+\r\r
+ oItem.cfg.setProperty("selected", false);\r\r
+\r\r
+ if(\r\r
+ oSubmenu &&\r\r
+ oSubmenu.cfg.getProperty("showdelay") &&\r\r
+ !oSubmenu.cfg.getProperty("visible")\r\r
+ ) {\r\r
+\r\r
+ this._cancelShowDelay();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ oItem.handledMouseOutEvent = true;\r\r
+ oItem.handledMouseOverEvent = false;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(\r\r
+ !this._bHandledMouseOutEvent &&\r\r
+ (\r\r
+ (\r\r
+ oRelatedTarget != this.element &&\r\r
+ !Dom.isAncestor(this.element, oRelatedTarget)\r\r
+ )\r\r
+ || bMovingToSubmenu\r\r
+ )\r\r
+ ) {\r\r
+\r\r
+ this._bHandledMouseOutEvent = true;\r\r
+ this._bHandledMouseOverEvent = false;\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onClick\r\r
+* @description "click" event handler for the menu.\r\r
+* @protected\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onClick: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var oEvent = p_aArgs[0],\r\r
+ oItem = p_aArgs[1],\r\r
+ oTarget = Event.getTarget(oEvent);\r\r
+\r\r
+ if(oItem && !oItem.cfg.getProperty("disabled")) {\r\r
+\r\r
+ var oItemCfg = oItem.cfg,\r\r
+ oSubmenu = oItemCfg.getProperty("submenu");\r\r
+\r\r
+\r\r
+ /*\r\r
+ ACCESSIBILITY FEATURE FOR SCREEN READERS:\r\r
+ Expand/collapse the submenu when the user clicks\r\r
+ on the submenu indicator image.\r\r
+ */\r\r
+\r\r
+ if(oTarget == oItem.submenuIndicator && oSubmenu) {\r\r
+\r\r
+ if(oSubmenu.cfg.getProperty("visible")) {\r\r
+\r\r
+ oSubmenu.hide();\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ this.clearActiveItem();\r\r
+\r\r
+ this.activeItem = oItem;\r\r
+\r\r
+ oItem.cfg.setProperty("selected", true);\r\r
+\r\r
+ oSubmenu.show();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ var sURL = oItemCfg.getProperty("url"),\r\r
+ bCurrentPageURL = (sURL.substr((sURL.length-1),1) == "#"),\r\r
+ sTarget = oItemCfg.getProperty("target"),\r\r
+ bHasTarget = (sTarget && sTarget.length > 0);\r\r
+\r\r
+ /*\r\r
+ Prevent the browser from following links\r\r
+ equal to "#"\r\r
+ */\r\r
+\r\r
+ if(\r\r
+ oTarget.tagName.toUpperCase() == "A" &&\r\r
+ bCurrentPageURL && !bHasTarget\r\r
+ ) {\r\r
+\r\r
+ Event.preventDefault(oEvent);\r\r
+\r\r
+ }\r\r
+\r\r
+ if(\r\r
+ oTarget.tagName.toUpperCase() != "A" &&\r\r
+ !bCurrentPageURL && !bHasTarget\r\r
+ ) {\r\r
+\r\r
+ /*\r\r
+ Follow the URL of the item regardless of\r\r
+ whether or not the user clicked specifically\r\r
+ on the anchor element.\r\r
+ */\r\r
+\r\r
+ document.location = sURL;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ /*\r\r
+ If the item doesn't navigate to a URL and it doesn't have\r\r
+ a submenu, then collapse the menu tree.\r\r
+ */\r\r
+\r\r
+ if(bCurrentPageURL && !oSubmenu) {\r\r
+\r\r
+ var oRoot = this.getRoot();\r\r
+\r\r
+ if(oRoot.cfg.getProperty("position") == "static") {\r\r
+\r\r
+ oRoot.clearActiveItem();\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ oRoot.hide();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onKeyDown\r\r
+* @description "keydown" event handler for the menu.\r\r
+* @protected\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onKeyDown: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var oEvent = p_aArgs[0],\r\r
+ oItem = p_aArgs[1],\r\r
+ oSubmenu;\r\r
+\r\r
+ if(oItem && !oItem.cfg.getProperty("disabled")) {\r\r
+\r\r
+ var oItemCfg = oItem.cfg,\r\r
+ oParentItem = this.parent,\r\r
+ oRoot,\r\r
+ oNextItem;\r\r
+\r\r
+\r\r
+ switch(oEvent.keyCode) {\r\r
+\r\r
+ case 38: // Up arrow\r\r
+ case 40: // Down arrow\r\r
+\r\r
+ if(\r\r
+ oItem == this.activeItem &&\r\r
+ !oItemCfg.getProperty("selected")\r\r
+ ) {\r\r
+\r\r
+ oItemCfg.setProperty("selected", true);\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ oNextItem = (oEvent.keyCode == 38) ?\r\r
+ oItem.getPreviousEnabledSibling() :\r\r
+ oItem.getNextEnabledSibling();\r\r
+\r\r
+ if(oNextItem) {\r\r
+\r\r
+ this.clearActiveItem();\r\r
+\r\r
+ oNextItem.cfg.setProperty("selected", true);\r\r
+ oNextItem.focus();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ Event.preventDefault(oEvent);\r\r
+\r\r
+ break;\r\r
+\r\r
+\r\r
+ case 39: // Right arrow\r\r
+\r\r
+ oSubmenu = oItemCfg.getProperty("submenu");\r\r
+\r\r
+ if(oSubmenu) {\r\r
+\r\r
+ if(!oItemCfg.getProperty("selected")) {\r\r
+\r\r
+ oItemCfg.setProperty("selected", true);\r\r
+\r\r
+ }\r\r
+\r\r
+ oSubmenu.show();\r\r
+\r\r
+ oSubmenu.setInitialSelection();\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ oRoot = this.getRoot();\r\r
+\r\r
+ if(oRoot instanceof YAHOO.widget.MenuBar) {\r\r
+\r\r
+ oNextItem = oRoot.activeItem.getNextEnabledSibling();\r\r
+\r\r
+ if(oNextItem) {\r\r
+\r\r
+ oRoot.clearActiveItem();\r\r
+\r\r
+ oNextItem.cfg.setProperty("selected", true);\r\r
+\r\r
+ oSubmenu = oNextItem.cfg.getProperty("submenu");\r\r
+\r\r
+ if(oSubmenu) {\r\r
+\r\r
+ oSubmenu.show();\r\r
+\r\r
+ }\r\r
+\r\r
+ oNextItem.focus();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ Event.preventDefault(oEvent);\r\r
+\r\r
+ break;\r\r
+\r\r
+\r\r
+ case 37: // Left arrow\r\r
+\r\r
+ if(oParentItem) {\r\r
+\r\r
+ var oParentMenu = oParentItem.parent;\r\r
+\r\r
+ if(oParentMenu instanceof YAHOO.widget.MenuBar) {\r\r
+\r\r
+ oNextItem =\r\r
+ oParentMenu.activeItem.getPreviousEnabledSibling();\r\r
+\r\r
+ if(oNextItem) {\r\r
+\r\r
+ oParentMenu.clearActiveItem();\r\r
+\r\r
+ oNextItem.cfg.setProperty("selected", true);\r\r
+\r\r
+ oSubmenu = oNextItem.cfg.getProperty("submenu");\r\r
+\r\r
+ if(oSubmenu) {\r\r
+\r\r
+ oSubmenu.show();\r\r
+\r\r
+ }\r\r
+\r\r
+ oNextItem.focus();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ this.hide();\r\r
+\r\r
+ oParentItem.focus();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ Event.preventDefault(oEvent);\r\r
+\r\r
+ break;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(oEvent.keyCode == 27) { // Esc key\r\r
+\r\r
+ if(this.cfg.getProperty("position") == "dynamic") {\r\r
+\r\r
+ this.hide();\r\r
+\r\r
+ if(this.parent) {\r\r
+\r\r
+ this.parent.focus();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else if(this.activeItem) {\r\r
+\r\r
+ oSubmenu = this.activeItem.cfg.getProperty("submenu");\r\r
+\r\r
+ if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {\r\r
+\r\r
+ oSubmenu.hide();\r\r
+ this.activeItem.focus();\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ this.activeItem.cfg.setProperty("selected", false);\r\r
+ this.activeItem.blur();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ Event.preventDefault(oEvent);\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onTextResize\r\r
+* @description "textresize" event handler for the menu.\r\r
+* @protected\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onTextResize: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ if(this.browser == "gecko" && !this._handleResize) {\r\r
+\r\r
+ this._handleResize = true;\r\r
+ return;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ var oConfig = this.cfg;\r\r
+\r\r
+ if(oConfig.getProperty("position") == "dynamic") {\r\r
+\r\r
+ oConfig.setProperty("width", (this._getOffsetWidth() + "px"));\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+\r\r
+// Private methods\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onInit\r\r
+* @description "init" event handler for the menu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onInit: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ if(\r\r
+ (\r\r
+ (this.parent && !this.lazyLoad) ||\r\r
+ (!this.parent && this.cfg.getProperty("position") == "static") ||\r\r
+ (\r\r
+ !this.parent &&\r\r
+ !this.lazyLoad &&\r\r
+ this.cfg.getProperty("position") == "dynamic"\r\r
+ )\r\r
+ ) &&\r\r
+ this.getItemGroups().length === 0\r\r
+ ) {\r\r
+\r\r
+ if(this.srcElement) {\r\r
+\r\r
+ this._initSubTree();\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(this.itemData) {\r\r
+\r\r
+ this.addItems(this.itemData);\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else if(this.lazyLoad) {\r\r
+\r\r
+ this.cfg.fireQueue();\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onBeforeRender\r\r
+* @description "beforerender" event handler for the menu. Appends all of the\r\r
+* <code><ul></code>, <code><li></code> and their accompanying\r\r
+* title elements to the body element of the menu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onBeforeRender: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var oConfig = this.cfg,\r\r
+ oEl = this.element,\r\r
+ nListElements = this._aListElements.length;\r\r
+\r\r
+\r\r
+ if(nListElements > 0) {\r\r
+\r\r
+ var i = 0,\r\r
+ bFirstList = true,\r\r
+ oUL,\r\r
+ oGroupTitle;\r\r
+\r\r
+\r\r
+ do {\r\r
+\r\r
+ oUL = this._aListElements[i];\r\r
+\r\r
+ if(oUL) {\r\r
+\r\r
+ if(bFirstList) {\r\r
+\r\r
+ Dom.addClass(oUL, "first-of-type");\r\r
+ bFirstList = false;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(!Dom.isAncestor(oEl, oUL)) {\r\r
+\r\r
+ this.appendToBody(oUL);\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ oGroupTitle = this._aGroupTitleElements[i];\r\r
+\r\r
+ if(oGroupTitle) {\r\r
+\r\r
+ if(!Dom.isAncestor(oEl, oGroupTitle)) {\r\r
+\r\r
+ oUL.parentNode.insertBefore(oGroupTitle, oUL);\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ Dom.addClass(oUL, "hastitle");\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ i++;\r\r
+\r\r
+ }\r\r
+ while(i < nListElements);\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onRender\r\r
+* @description "render" event handler for the menu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onRender: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ if(this.cfg.getProperty("position") == "dynamic") {\r\r
+\r\r
+ var sWidth =\r\r
+ this.element.parentNode.tagName.toUpperCase() == "BODY" ?\r\r
+ this.element.offsetWidth : this._getOffsetWidth();\r\r
+\r\r
+ this.cfg.setProperty("width", (sWidth + "px"));\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onBeforeShow\r\r
+* @description "beforeshow" event handler for the menu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onBeforeShow: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ if(this.lazyLoad && this.getItemGroups().length === 0) {\r\r
+\r\r
+ if(this.srcElement) {\r\r
+\r\r
+ this._initSubTree();\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(this.itemData) {\r\r
+\r\r
+ if(\r\r
+ this.parent && this.parent.parent &&\r\r
+ this.parent.parent.srcElement &&\r\r
+ this.parent.parent.srcElement.tagName.toUpperCase() == "SELECT"\r\r
+ ) {\r\r
+\r\r
+ var nOptions = this.itemData.length;\r\r
+\r\r
+ for(var n=0; n<nOptions; n++) {\r\r
+\r\r
+ if(this.itemData[n].tagName) {\r\r
+\r\r
+ this.addItem((new this.ITEM_TYPE(this.itemData[n])));\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ this.addItems(this.itemData);\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(this.srcElement) {\r\r
+\r\r
+ this.render();\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ if(this.parent) {\r\r
+\r\r
+ this.render(this.parent.element);\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ this.render(this.cfg.getProperty("container"));\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onShow\r\r
+* @description "show" event handler for the menu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that fired\r\r
+* the event.\r\r
+*/\r\r
+_onShow: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ this.setInitialFocus();\r\r
+\r\r
+ var oParent = this.parent;\r\r
+\r\r
+ if(oParent) {\r\r
+\r\r
+ var oParentMenu = oParent.parent,\r\r
+ aParentAlignment = oParentMenu.cfg.getProperty("submenualignment"),\r\r
+ aAlignment = this.cfg.getProperty("submenualignment");\r\r
+\r\r
+\r\r
+ if(\r\r
+ (aParentAlignment[0] != aAlignment[0]) &&\r\r
+ (aParentAlignment[1] != aAlignment[1])\r\r
+ ) {\r\r
+\r\r
+ this.cfg.setProperty(\r\r
+ "submenualignment",\r\r
+ [ aParentAlignment[0], aParentAlignment[1] ]\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(\r\r
+ !oParentMenu.cfg.getProperty("autosubmenudisplay") &&\r\r
+ oParentMenu.cfg.getProperty("position") == "static"\r\r
+ ) {\r\r
+\r\r
+ oParentMenu.cfg.setProperty("autosubmenudisplay", true);\r\r
+\r\r
+\r\r
+ /**\r\r
+ * "click" event handler for the document\r\r
+ * @private\r\r
+ * @param {Event} p_oEvent Object reference for the DOM event object\r\r
+ * passed back by the event utility (YAHOO.util.Event).\r\r
+ */\r\r
+ function disableAutoSubmenuDisplay(p_oEvent) {\r\r
+\r\r
+ if(\r\r
+ p_oEvent.type == "mousedown" ||\r\r
+ (p_oEvent.type == "keydown" && p_oEvent.keyCode == 27)\r\r
+ ) {\r\r
+\r\r
+ /*\r\r
+ Set the "autosubmenudisplay" to "false" if the user\r\r
+ clicks outside the menu bar.\r\r
+ */\r\r
+\r\r
+ var oTarget = Event.getTarget(p_oEvent);\r\r
+\r\r
+ if(\r\r
+ oTarget != oParentMenu.element ||\r\r
+ !YAHOO.util.Dom.isAncestor(oParentMenu.element, oTarget)\r\r
+ ) {\r\r
+\r\r
+ oParentMenu.cfg.setProperty(\r\r
+ "autosubmenudisplay",\r\r
+ false\r\r
+ );\r\r
+\r\r
+ Event.removeListener(\r\r
+ document,\r\r
+ "mousedown",\r\r
+ disableAutoSubmenuDisplay\r\r
+ );\r\r
+\r\r
+ Event.removeListener(\r\r
+ document,\r\r
+ "keydown",\r\r
+ disableAutoSubmenuDisplay\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ Event.addListener(document, "mousedown", disableAutoSubmenuDisplay);\r\r
+ Event.addListener(document, "keydown", disableAutoSubmenuDisplay);\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onBeforeHide\r\r
+* @description "beforehide" event handler for the menu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that fired\r\r
+* the event.\r\r
+*/\r\r
+_onBeforeHide: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var oActiveItem = this.activeItem;\r\r
+\r\r
+ if(oActiveItem) {\r\r
+\r\r
+ var oConfig = oActiveItem.cfg;\r\r
+\r\r
+ oConfig.setProperty("selected", false);\r\r
+\r\r
+ var oSubmenu = oConfig.getProperty("submenu");\r\r
+\r\r
+ if(oSubmenu) {\r\r
+\r\r
+ oSubmenu.hide();\r\r
+\r\r
+ }\r\r
+\r\r
+ oActiveItem.blur();\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onParentMenuConfigChange\r\r
+* @description "configchange" event handler for a submenu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r\r
+* subscribed to the event.\r\r
+*/\r\r
+_onParentMenuConfigChange: function(p_sType, p_aArgs, p_oSubmenu) {\r\r
+\r\r
+ var sPropertyName = p_aArgs[0][0],\r\r
+ oPropertyValue = p_aArgs[0][1];\r\r
+\r\r
+ switch(sPropertyName) {\r\r
+\r\r
+ case "iframe":\r\r
+ case "constraintoviewport":\r\r
+ case "hidedelay":\r\r
+ case "showdelay":\r\r
+ case "clicktohide":\r\r
+ case "effect":\r\r
+\r\r
+ p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue);\r\r
+\r\r
+ break;\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onParentMenuRender\r\r
+* @description "render" event handler for a submenu. Renders a\r\r
+* submenu in response to the firing of its parent's "render" event.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r\r
+* subscribed to the event.\r\r
+*/\r\r
+_onParentMenuRender: function(p_sType, p_aArgs, p_oSubmenu) {\r\r
+\r\r
+ var oParentMenu = p_oSubmenu.parent.parent,\r\r
+\r\r
+ oConfig = {\r\r
+\r\r
+ constraintoviewport:\r\r
+ oParentMenu.cfg.getProperty("constraintoviewport"),\r\r
+\r\r
+ xy: [0,0],\r\r
+\r\r
+ clicktohide:\r\r
+ oParentMenu.cfg.getProperty("clicktohide"),\r\r
+\r\r
+ effect:\r\r
+ oParentMenu.cfg.getProperty("effect"),\r\r
+\r\r
+ showdelay:\r\r
+ oParentMenu.cfg.getProperty("showdelay"),\r\r
+\r\r
+ hidedelay:\r\r
+ oParentMenu.cfg.getProperty("hidedelay")\r\r
+\r\r
+ };\r\r
+\r\r
+\r\r
+ /*\r\r
+ Only sync the "iframe" configuration property if the parent\r\r
+ menu's "position" configuration is the same.\r\r
+ */\r\r
+\r\r
+ if(\r\r
+ this.cfg.getProperty("position") ==\r\r
+ oParentMenu.cfg.getProperty("position")\r\r
+ ) {\r\r
+\r\r
+ oConfig.iframe = oParentMenu.cfg.getProperty("iframe");\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ p_oSubmenu.cfg.applyConfig(oConfig);\r\r
+\r\r
+\r\r
+ if(!this.lazyLoad) {\r\r
+\r\r
+ if(Dom.inDocument(this.element)) {\r\r
+\r\r
+ this.render();\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ this.render(this.parent.element);\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onSubmenuBeforeShow\r\r
+* @description "beforeshow" event handler for a submenu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r\r
+* subscribed to the event.\r\r
+*/\r\r
+_onSubmenuBeforeShow: function(p_sType, p_aArgs, p_oSubmenu) {\r\r
+\r\r
+ var oParent = this.parent,\r\r
+ aAlignment = oParent.parent.cfg.getProperty("submenualignment");\r\r
+\r\r
+ this.cfg.setProperty(\r\r
+ "context",\r\r
+ [oParent.element, aAlignment[0], aAlignment[1]]\r\r
+ );\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onSubmenuShow\r\r
+* @description "show" event handler for a submenu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r\r
+* subscribed to the event.\r\r
+*/\r\r
+_onSubmenuShow: function(p_sType, p_aArgs, p_oSubmenu) {\r\r
+\r\r
+ var oParent = this.parent;\r\r
+\r\r
+ oParent.submenuIndicator.alt = oParent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onSubmenuHide\r\r
+* @description "hide" Custom Event handler for a submenu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r\r
+* subscribed to the event.\r\r
+*/\r\r
+_onSubmenuHide: function(p_sType, p_aArgs, p_oSubmenu) {\r\r
+\r\r
+ var oParent = this.parent;\r\r
+\r\r
+ oParent.submenuIndicator.alt = oParent.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onMenuItemFocus\r\r
+* @description "focus" event handler for the menu's items.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r\r
+* that fired the event.\r\r
+*/\r\r
+_onMenuItemFocus: function(p_sType, p_aArgs, p_oItem) {\r\r
+\r\r
+ this.activeItem = p_oItem;\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onMenuItemBlur\r\r
+* @description "blur" event handler for the menu's items.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event\r\r
+* that was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+*/\r\r
+_onMenuItemBlur: function(p_sType, p_aArgs) {\r\r
+\r\r
+ this.activeItem = null;\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onMenuItemConfigChange\r\r
+* @description "configchange" event handler for the menu's items.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r\r
+* that fired the event.\r\r
+*/\r\r
+_onMenuItemConfigChange: function(p_sType, p_aArgs, p_oItem) {\r\r
+\r\r
+ var sProperty = p_aArgs[0][0];\r\r
+\r\r
+ switch(sProperty) {\r\r
+\r\r
+ case "submenu":\r\r
+\r\r
+ var oSubmenu = p_aArgs[0][1];\r\r
+\r\r
+ if(oSubmenu) {\r\r
+\r\r
+ this._configureSubmenu(p_oItem);\r\r
+\r\r
+ }\r\r
+\r\r
+ break;\r\r
+\r\r
+ case "text":\r\r
+ case "helptext":\r\r
+\r\r
+ /*\r\r
+ A change to an item's "text" or "helptext"\r\r
+ configuration properties requires the width of the parent\r\r
+ menu to be recalculated.\r\r
+ */\r\r
+\r\r
+ if(this.element.style.width) {\r\r
+\r\r
+ var sWidth = this._getOffsetWidth() + "px";\r\r
+\r\r
+ Dom.setStyle(this.element, "width", sWidth);\r\r
+\r\r
+ }\r\r
+\r\r
+ break;\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+\r\r
+// Public event handlers for configuration properties\r\r
+\r\r
+\r\r
+/**\r\r
+* @method enforceConstraints\r\r
+* @description The default event handler executed when the moveEvent is fired,\r\r
+* if the "constraintoviewport" configuration property is set to true.\r\r
+* @param {String} type The name of the event that was fired.\r\r
+* @param {Array} args Collection of arguments sent when the\r\r
+* event was fired.\r\r
+* @param {Array} obj Array containing the current Menu instance\r\r
+* and the item that fired the event.\r\r
+*/\r\r
+enforceConstraints: function(type, args, obj) {\r\r
+\r\r
+ var oConfig = this.cfg,\r\r
+ pos = args[0],\r\r
+\r\r
+ x = pos[0],\r\r
+ y = pos[1],\r\r
+\r\r
+ offsetHeight = this.element.offsetHeight,\r\r
+ offsetWidth = this.element.offsetWidth,\r\r
+\r\r
+ viewPortWidth = YAHOO.util.Dom.getViewportWidth(),\r\r
+ viewPortHeight = YAHOO.util.Dom.getViewportHeight(),\r\r
+\r\r
+ scrollX = Math.max(\r\r
+ document.documentElement.scrollLeft,\r\r
+ document.body.scrollLeft\r\r
+ ),\r\r
+\r\r
+ scrollY = Math.max(\r\r
+ document.documentElement.scrollTop,\r\r
+ document.body.scrollTop\r\r
+ ),\r\r
+\r\r
+ topConstraint = scrollY + 10,\r\r
+ leftConstraint = scrollX + 10,\r\r
+ bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10,\r\r
+ rightConstraint = scrollX + viewPortWidth - offsetWidth - 10,\r\r
+\r\r
+ aContext = oConfig.getProperty("context"),\r\r
+ oContextElement = aContext ? aContext[0] : null;\r\r
+\r\r
+\r\r
+ if (x < 10) {\r\r
+\r\r
+ x = leftConstraint;\r\r
+\r\r
+ } else if ((x + offsetWidth) > viewPortWidth) {\r\r
+\r\r
+ if(\r\r
+ oContextElement &&\r\r
+ ((x - oContextElement.offsetWidth) > offsetWidth)\r\r
+ ) {\r\r
+\r\r
+ x = (x - (oContextElement.offsetWidth + offsetWidth));\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ x = rightConstraint;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ if (y < 10) {\r\r
+\r\r
+ y = topConstraint;\r\r
+\r\r
+ } else if (y > bottomConstraint) {\r\r
+\r\r
+ if(oContextElement && (y > offsetHeight)) {\r\r
+\r\r
+ y = ((y + oContextElement.offsetHeight) - offsetHeight);\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ y = bottomConstraint;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ oConfig.setProperty("x", x, true);\r\r
+ oConfig.setProperty("y", y, true);\r\r
+ oConfig.setProperty("xy", [x,y], true);\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method configVisible\r\r
+* @description Event handler for when the "visible" configuration property\r\r
+* the menu changes.\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+configVisible: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ if(this.cfg.getProperty("position") == "dynamic") {\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.configVisible.call(\r\r
+ this,\r\r
+ p_sType,\r\r
+ p_aArgs,\r\r
+ p_oMenu\r\r
+ );\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ var bVisible = p_aArgs[0],\r\r
+ sDisplay = Dom.getStyle(this.element, "display");\r\r
+\r\r
+ if(bVisible) {\r\r
+\r\r
+ if(sDisplay != "block") {\r\r
+ this.beforeShowEvent.fire();\r\r
+ Dom.setStyle(this.element, "display", "block");\r\r
+ this.showEvent.fire();\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ if(sDisplay == "block") {\r\r
+ this.beforeHideEvent.fire();\r\r
+ Dom.setStyle(this.element, "display", "none");\r\r
+ this.hideEvent.fire();\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method configPosition\r\r
+* @description Event handler for when the "position" configuration property\r\r
+* of the menu changes.\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+configPosition: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var sCSSPosition = p_aArgs[0] == "static" ? "static" : "absolute",\r\r
+ oCfg = this.cfg;\r\r
+\r\r
+ Dom.setStyle(this.element, "position", sCSSPosition);\r\r
+\r\r
+\r\r
+ if(sCSSPosition == "static") {\r\r
+\r\r
+ /*\r\r
+ Remove the iframe for statically positioned menus since it will\r\r
+ intercept mouse events.\r\r
+ */\r\r
+\r\r
+ oCfg.setProperty("iframe", false);\r\r
+\r\r
+\r\r
+ // Statically positioned menus are visible by default\r\r
+\r\r
+ Dom.setStyle(this.element, "display", "block");\r\r
+\r\r
+ oCfg.setProperty("visible", true);\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ /*\r\r
+ Even though the "visible" property is queued to\r\r
+ "false" by default, we need to set the "visibility" property to\r\r
+ "hidden" since Overlay's "configVisible" implementation checks the\r\r
+ element's "visibility" style property before deciding whether\r\r
+ or not to show an Overlay instance.\r\r
+ */\r\r
+\r\r
+ Dom.setStyle(this.element, "visibility", "hidden");\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(sCSSPosition == "absolute") {\r\r
+\r\r
+ var nZIndex = oCfg.getProperty("zindex");\r\r
+\r\r
+ if(!nZIndex || nZIndex === 0) {\r\r
+\r\r
+ nZIndex = this.parent ?\r\r
+ (this.parent.parent.cfg.getProperty("zindex") + 1) : 1;\r\r
+\r\r
+ oCfg.setProperty("zindex", nZIndex);\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method configIframe\r\r
+* @description Event handler for when the "iframe" configuration property of\r\r
+* the menu changes.\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+configIframe: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ if(this.cfg.getProperty("position") == "dynamic") {\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.configIframe.call(\r\r
+ this,\r\r
+ p_sType,\r\r
+ p_aArgs,\r\r
+ p_oMenu\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method configHideDelay\r\r
+* @description Event handler for when the "hidedelay" configuration property\r\r
+* of the menu changes.\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+configHideDelay: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var nHideDelay = p_aArgs[0],\r\r
+ oMouseOutEvent = this.mouseOutEvent,\r\r
+ oMouseOverEvent = this.mouseOverEvent,\r\r
+ oKeyDownEvent = this.keyDownEvent;\r\r
+\r\r
+ if(nHideDelay > 0) {\r\r
+\r\r
+ /*\r\r
+ Only assign event handlers once. This way the user change\r\r
+ the value for the hidedelay as many times as they want.\r\r
+ */\r\r
+\r\r
+ if(!this._hideDelayEventHandlersAssigned) {\r\r
+\r\r
+ oMouseOutEvent.subscribe(this._execHideDelay, true);\r\r
+ oMouseOverEvent.subscribe(this._cancelHideDelay, this, true);\r\r
+ oKeyDownEvent.subscribe(this._cancelHideDelay, this, true);\r\r
+\r\r
+ this._hideDelayEventHandlersAssigned = true;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ oMouseOutEvent.unsubscribe(this._execHideDelay, this);\r\r
+ oMouseOverEvent.unsubscribe(this._cancelHideDelay, this);\r\r
+ oKeyDownEvent.unsubscribe(this._cancelHideDelay, this);\r\r
+\r\r
+ this._hideDelayEventHandlersAssigned = false;\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method configContainer\r\r
+* @description Event handler for when the "container" configuration property\r\r
+of the menu changes.\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+configContainer: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var oElement = p_aArgs[0];\r\r
+\r\r
+ if(typeof oElement == 'string') {\r\r
+\r\r
+ this.cfg.setProperty(\r\r
+ "container",\r\r
+ document.getElementById(oElement),\r\r
+ true\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+\r\r
+// Public methods\r\r
+\r\r
+\r\r
+/**\r\r
+* @method initEvents\r\r
+* @description Initializes the custom events for the menu.\r\r
+*/\r\r
+initEvents: function() {\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.initEvents.call(this);\r\r
+\r\r
+ // Create custom events\r\r
+\r\r
+ var CustomEvent = YAHOO.util.CustomEvent;\r\r
+\r\r
+ this.mouseOverEvent = new CustomEvent("mouseOverEvent", this);\r\r
+ this.mouseOutEvent = new CustomEvent("mouseOutEvent", this);\r\r
+ this.mouseDownEvent = new CustomEvent("mouseDownEvent", this);\r\r
+ this.mouseUpEvent = new CustomEvent("mouseUpEvent", this);\r\r
+ this.clickEvent = new CustomEvent("clickEvent", this);\r\r
+ this.keyPressEvent = new CustomEvent("keyPressEvent", this);\r\r
+ this.keyDownEvent = new CustomEvent("keyDownEvent", this);\r\r
+ this.keyUpEvent = new CustomEvent("keyUpEvent", this);\r\r
+ this.itemAddedEvent = new CustomEvent("itemAddedEvent", this);\r\r
+ this.itemRemovedEvent = new CustomEvent("itemRemovedEvent", this);\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method getRoot\r\r
+* @description Finds the menu's root menu.\r\r
+*/\r\r
+getRoot: function() {\r\r
+\r\r
+ var oItem = this.parent;\r\r
+\r\r
+ if(oItem) {\r\r
+\r\r
+ var oParentMenu = oItem.parent;\r\r
+\r\r
+ return oParentMenu ? oParentMenu.getRoot() : this;\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ return this;\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method toString\r\r
+* @description Returns a string representing the menu.\r\r
+* @return {String}\r\r
+*/\r\r
+toString: function() {\r\r
+\r\r
+ return ("Menu " + this.id);\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method setItemGroupTitle\r\r
+* @description Sets the title of a group of menu items.\r\r
+* @param {String} p_sGroupTitle String specifying the title of the group.\r\r
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to which\r\r
+* the title belongs.\r\r
+*/\r\r
+setItemGroupTitle: function(p_sGroupTitle, p_nGroupIndex) {\r\r
+\r\r
+ if(typeof p_sGroupTitle == "string" && p_sGroupTitle.length > 0) {\r\r
+\r\r
+ var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0,\r\r
+ oTitle = this._aGroupTitleElements[nGroupIndex];\r\r
+\r\r
+\r\r
+ if(oTitle) {\r\r
+\r\r
+ oTitle.innerHTML = p_sGroupTitle;\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ oTitle = document.createElement(this.GROUP_TITLE_TAG_NAME);\r\r
+\r\r
+ oTitle.innerHTML = p_sGroupTitle;\r\r
+\r\r
+ this._aGroupTitleElements[nGroupIndex] = oTitle;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ var i = this._aGroupTitleElements.length - 1,\r\r
+ nFirstIndex;\r\r
+\r\r
+ do {\r\r
+\r\r
+ if(this._aGroupTitleElements[i]) {\r\r
+\r\r
+ Dom.removeClass(this._aGroupTitleElements[i], "first-of-type");\r\r
+\r\r
+ nFirstIndex = i;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ while(i--);\r\r
+\r\r
+\r\r
+ if(nFirstIndex !== null) {\r\r
+\r\r
+ Dom.addClass(\r\r
+ this._aGroupTitleElements[nFirstIndex],\r\r
+ "first-of-type"\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+\r\r
+/**\r\r
+* @method addItem\r\r
+* @description Appends an item to the menu.\r\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r\r
+* instance to be added to the menu.\r\r
+* @param {String} p_oItem String specifying the text of the item to be added\r\r
+* to the menu.\r\r
+* @param {Object} p_oItem Object literal containing a set of menu item\r\r
+* configuration properties.\r\r
+* @param {Number} p_nGroupIndex Optional. Number indicating the group to\r\r
+* which the item belongs.\r\r
+* @return {YAHOO.widget.MenuItem}\r\r
+*/\r\r
+addItem: function(p_oItem, p_nGroupIndex) {\r\r
+\r\r
+ if(p_oItem) {\r\r
+\r\r
+ return this._addItemToGroup(p_nGroupIndex, p_oItem);\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method addItems\r\r
+* @description Adds an array of items to the menu.\r\r
+* @param {Array} p_aItems Array of items to be added to the menu. The array\r\r
+* can contain strings specifying the text for each item to be created, object\r\r
+* literals specifying each of the menu item configuration properties,\r\r
+* or MenuItem instances.\r\r
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to\r\r
+* which the items belongs.\r\r
+* @return {Array}\r\r
+*/\r\r
+addItems: function(p_aItems, p_nGroupIndex) {\r\r
+\r\r
+ function isArray(p_oValue) {\r\r
+\r\r
+ return (typeof p_oValue == "object" && p_oValue.constructor == Array);\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(isArray(p_aItems)) {\r\r
+\r\r
+ var nItems = p_aItems.length,\r\r
+ aItems = [],\r\r
+ oItem;\r\r
+\r\r
+\r\r
+ for(var i=0; i<nItems; i++) {\r\r
+\r\r
+ oItem = p_aItems[i];\r\r
+\r\r
+ if(isArray(oItem)) {\r\r
+\r\r
+ aItems[aItems.length] = this.addItems(oItem, i);\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ aItems[aItems.length] =\r\r
+ this._addItemToGroup(p_nGroupIndex, oItem);\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(aItems.length) {\r\r
+\r\r
+ return aItems;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method insertItem\r\r
+* @description Inserts an item into the menu at the specified index.\r\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r\r
+* instance to be added to the menu.\r\r
+* @param {String} p_oItem String specifying the text of the item to be added\r\r
+* to the menu.\r\r
+* @param {Object} p_oItem Object literal containing a set of menu item\r\r
+* configuration properties.\r\r
+* @param {Number} p_nItemIndex Number indicating the ordinal position at which\r\r
+* the item should be added.\r\r
+* @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r\r
+* the item belongs.\r\r
+* @return {YAHOO.widget.MenuItem}\r\r
+*/\r\r
+insertItem: function(p_oItem, p_nItemIndex, p_nGroupIndex) {\r\r
+\r\r
+ if(p_oItem) {\r\r
+\r\r
+ return this._addItemToGroup(p_nGroupIndex, p_oItem, p_nItemIndex);\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method removeItem\r\r
+* @description Removes the specified item from the menu.\r\r
+* @param {YAHOO.widget.MenuItem} p_oObject Object reference for the MenuItem\r\r
+* instance to be removed from the menu.\r\r
+* @param {Number} p_oObject Number specifying the index of the item\r\r
+* to be removed.\r\r
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to\r\r
+* which the item belongs.\r\r
+* @return {YAHOO.widget.MenuItem}\r\r
+*/\r\r
+removeItem: function(p_oObject, p_nGroupIndex) {\r\r
+\r\r
+ if(typeof p_oObject != "undefined") {\r\r
+\r\r
+ var oItem;\r\r
+\r\r
+ if(p_oObject instanceof YAHOO.widget.MenuItem) {\r\r
+\r\r
+ oItem = this._removeItemFromGroupByValue(p_nGroupIndex, p_oObject);\r\r
+\r\r
+ }\r\r
+ else if(typeof p_oObject == "number") {\r\r
+\r\r
+ oItem = this._removeItemFromGroupByIndex(p_nGroupIndex, p_oObject);\r\r
+\r\r
+ }\r\r
+\r\r
+ if(oItem) {\r\r
+\r\r
+ oItem.destroy();\r\r
+\r\r
+ this.logger.log("Item removed." +\r\r
+ " Text: " + oItem.cfg.getProperty("text") + ", " +\r\r
+ " Index: " + oItem.index + ", " +\r\r
+ " Group Index: " + oItem.groupIndex);\r\r
+\r\r
+ return oItem;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method getItemGroups\r\r
+* @description Returns a multi-dimensional array of all of the items in the menu.\r\r
+* @return {Array}\r\r
+*/\r\r
+getItemGroups: function() {\r\r
+\r\r
+ return this._aItemGroups;\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method getItem\r\r
+* @description Returns the item at the specified index.\r\r
+* @param {Number} p_nItemIndex Number indicating the ordinal position of the\r\r
+* item to be retrieved.\r\r
+* @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r\r
+* the item belongs.\r\r
+* @return {YAHOO.widget.MenuItem}\r\r
+*/\r\r
+getItem: function(p_nItemIndex, p_nGroupIndex) {\r\r
+\r\r
+ if(typeof p_nItemIndex == "number") {\r\r
+\r\r
+ var aGroup = this._getItemGroup(p_nGroupIndex);\r\r
+\r\r
+ if(aGroup) {\r\r
+\r\r
+ return aGroup[p_nItemIndex];\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method destroy\r\r
+* @description Removes the menu's <code><div></code> element\r\r
+* (and accompanying child nodes) from the document.\r\r
+*/\r\r
+destroy: function() {\r\r
+\r\r
+ // Remove Custom Event listeners\r\r
+\r\r
+ this.mouseOverEvent.unsubscribeAll();\r\r
+ this.mouseOutEvent.unsubscribeAll();\r\r
+ this.mouseDownEvent.unsubscribeAll();\r\r
+ this.mouseUpEvent.unsubscribeAll();\r\r
+ this.clickEvent.unsubscribeAll();\r\r
+ this.keyPressEvent.unsubscribeAll();\r\r
+ this.keyDownEvent.unsubscribeAll();\r\r
+ this.keyUpEvent.unsubscribeAll();\r\r
+ this.itemAddedEvent.unsubscribeAll();\r\r
+ this.itemRemovedEvent.unsubscribeAll();\r\r
+\r\r
+ var nItemGroups = this._aItemGroups.length,\r\r
+ nItems,\r\r
+ oItemGroup,\r\r
+ oItem,\r\r
+ i,\r\r
+ n;\r\r
+\r\r
+\r\r
+ // Remove all items\r\r
+\r\r
+ if(nItemGroups > 0) {\r\r
+\r\r
+ i = nItemGroups - 1;\r\r
+\r\r
+ do {\r\r
+\r\r
+ oItemGroup = this._aItemGroups[i];\r\r
+\r\r
+ if(oItemGroup) {\r\r
+\r\r
+ nItems = oItemGroup.length;\r\r
+\r\r
+ if(nItems > 0) {\r\r
+\r\r
+ n = nItems - 1;\r\r
+\r\r
+ do {\r\r
+\r\r
+ oItem = this._aItemGroups[i][n];\r\r
+\r\r
+ if(oItem) {\r\r
+\r\r
+ oItem.destroy();\r\r
+ }\r\r
+\r\r
+ }\r\r
+ while(n--);\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ while(i--);\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ // Continue with the superclass implementation of this method\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.destroy.call(this);\r\r
+\r\r
+ this.logger.log("Destroyed.");\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method setInitialFocus\r\r
+* @description Sets focus to the menu's first enabled item.\r\r
+*/\r\r
+setInitialFocus: function() {\r\r
+\r\r
+ var oItem = this._getFirstEnabledItem();\r\r
+\r\r
+ if(oItem) {\r\r
+\r\r
+ oItem.focus();\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method setInitialSelection\r\r
+* @description Sets the "selected" configuration property of the menu's first\r\r
+* enabled item to "true."\r\r
+*/\r\r
+setInitialSelection: function() {\r\r
+\r\r
+ var oItem = this._getFirstEnabledItem();\r\r
+\r\r
+ if(oItem) {\r\r
+\r\r
+ oItem.cfg.setProperty("selected", true);\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method clearActiveItem\r\r
+* @description Sets the "selected" configuration property of the menu's active\r\r
+* item to "false" and hides the item's submenu.\r\r
+* @param {Boolean} p_bBlur Boolean indicating if the menu's active item\r\r
+* should be blurred.\r\r
+*/\r\r
+clearActiveItem: function(p_bBlur) {\r\r
+\r\r
+ if(this.cfg.getProperty("showdelay") > 0) {\r\r
+\r\r
+ this._cancelShowDelay();\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ var oActiveItem = this.activeItem;\r\r
+\r\r
+ if(oActiveItem) {\r\r
+\r\r
+ var oConfig = oActiveItem.cfg;\r\r
+\r\r
+ oConfig.setProperty("selected", false);\r\r
+\r\r
+ var oSubmenu = oConfig.getProperty("submenu");\r\r
+\r\r
+ if(oSubmenu) {\r\r
+\r\r
+ oSubmenu.hide();\r\r
+\r\r
+ }\r\r
+\r\r
+ if(p_bBlur) {\r\r
+\r\r
+ oActiveItem.blur();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @description Initializes the class's configurable properties which can be\r\r
+* changed using the menu's Config object ("cfg").\r\r
+* @method initDefaultConfig\r\r
+*/\r\r
+initDefaultConfig: function() {\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.initDefaultConfig.call(this);\r\r
+\r\r
+ var oConfig = this.cfg;\r\r
+\r\r
+ // Add configuration properties\r\r
+\r\r
+ /*\r\r
+ Change the default value for the "visible" configuration\r\r
+ property to "false" by re-adding the property.\r\r
+ */\r\r
+\r\r
+ /**\r\r
+ * @config visible\r\r
+ * @description Boolean indicating whether or not the menu is visible. If\r\r
+ * the menu's "position" configuration property is set to "dynamic" (the\r\r
+ * default), this property toggles the menu's <code><div></code>\r\r
+ * element's "visibility" style property between "visible" (true) or\r\r
+ * "hidden" (false). If the menu's "position" configuration property is\r\r
+ * set to "static" this property toggles the menu's\r\r
+ * <code><div></code> element's "display" style property\r\r
+ * between "block" (true) or "none" (false).\r\r
+ * @default false\r\r
+ * @type Boolean\r\r
+ */\r\r
+ oConfig.addProperty(\r\r
+ "visible",\r\r
+ {\r\r
+ value:false,\r\r
+ handler:this.configVisible,\r\r
+ validator:this.cfg.checkBoolean\r\r
+ }\r\r
+ );\r\r
+\r\r
+\r\r
+ /*\r\r
+ Change the default value for the "constraintoviewport" configuration\r\r
+ property to "true" by re-adding the property.\r\r
+ */\r\r
+\r\r
+ /**\r\r
+ * @config constraintoviewport\r\r
+ * @description Boolean indicating if the menu will try to remain inside\r\r
+ * the boundaries of the size of viewport.\r\r
+ * @default true\r\r
+ * @type Boolean\r\r
+ */\r\r
+ oConfig.addProperty(\r\r
+ "constraintoviewport",\r\r
+ {\r\r
+ value:true,\r\r
+ handler:this.configConstrainToViewport,\r\r
+ validator:this.cfg.checkBoolean,\r\r
+ supercedes:["iframe","x","y","xy"]\r\r
+ }\r\r
+ );\r\r
+\r\r
+\r\r
+ /**\r\r
+ * @config position\r\r
+ * @description String indicating how a menu should be positioned on the\r\r
+ * screen. Possible values are "static" and "dynamic." Static menus are\r\r
+ * visible by default and reside in the normal flow of the document\r\r
+ * (CSS position: static). Dynamic menus are hidden by default, reside\r\r
+ * out of the normal flow of the document (CSS position: absolute), and\r\r
+ * can overlay other elements on the screen.\r\r
+ * @default dynamic\r\r
+ * @type String\r\r
+ */\r\r
+ oConfig.addProperty(\r\r
+ "position",\r\r
+ {\r\r
+ value: "dynamic",\r\r
+ handler: this.configPosition,\r\r
+ validator: this._checkPosition,\r\r
+ supercedes: ["visible"]\r\r
+ }\r\r
+ );\r\r
+\r\r
+\r\r
+ /**\r\r
+ * @config submenualignment\r\r
+ * @description Array defining how submenus should be aligned to their\r\r
+ * parent menu item. The format is: [itemCorner, submenuCorner]. By default\r\r
+ * a submenu's top left corner is aligned to its parent menu item's top\r\r
+ * right corner.\r\r
+ * @default ["tl","tr"]\r\r
+ * @type Array\r\r
+ */\r\r
+ oConfig.addProperty("submenualignment", { value: ["tl","tr"] } );\r\r
+\r\r
+\r\r
+ /**\r\r
+ * @config autosubmenudisplay\r\r
+ * @description Boolean indicating if submenus are automatically made\r\r
+ * visible when the user mouses over the menu's items.\r\r
+ * @default true\r\r
+ * @type Boolean\r\r
+ */\r\r
+ oConfig.addProperty(\r\r
+ "autosubmenudisplay",\r\r
+ {\r\r
+ value: true,\r\r
+ validator: oConfig.checkBoolean\r\r
+ }\r\r
+ );\r\r
+\r\r
+\r\r
+ /**\r\r
+ * @config showdelay\r\r
+ * @description Number indicating the time (in milliseconds) that should\r\r
+ * expire before a submenu is made visible when the user mouses over\r\r
+ * the menu's items.\r\r
+ * @default 0\r\r
+ * @type Number\r\r
+ */\r\r
+ oConfig.addProperty(\r\r
+ "showdelay",\r\r
+ {\r\r
+ value: 0,\r\r
+ validator: oConfig.checkNumber\r\r
+ }\r\r
+ );\r\r
+\r\r
+\r\r
+ /**\r\r
+ * @config hidedelay\r\r
+ * @description Number indicating the time (in milliseconds) that should\r\r
+ * expire before the menu is hidden.\r\r
+ * @default 0\r\r
+ * @type Number\r\r
+ */\r\r
+ oConfig.addProperty(\r\r
+ "hidedelay",\r\r
+ {\r\r
+ value: 0,\r\r
+ validator: oConfig.checkNumber,\r\r
+ handler: this.configHideDelay,\r\r
+ suppressEvent: true\r\r
+ }\r\r
+ );\r\r
+\r\r
+\r\r
+ /**\r\r
+ * @config clicktohide\r\r
+ * @description Boolean indicating if the menu will automatically be\r\r
+ * hidden if the user clicks outside of it.\r\r
+ * @default true\r\r
+ * @type Boolean\r\r
+ */\r\r
+ oConfig.addProperty(\r\r
+ "clicktohide",\r\r
+ {\r\r
+ value: true,\r\r
+ validator: oConfig.checkBoolean\r\r
+ }\r\r
+ );\r\r
+\r\r
+\r\r
+ /**\r\r
+ * @config container\r\r
+ * @description HTML element reference or string specifying the id\r\r
+ * attribute of the HTML element that the menu's markup should be rendered into.\r\r
+ * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r\r
+ * level-one-html.html#ID-58190037">HTMLElement</a>|String\r\r
+ * @default document.body\r\r
+ */\r\r
+ this.cfg.addProperty(\r\r
+ "container",\r\r
+ { value:document.body, handler:this.configContainer }\r\r
+ );\r\r
+\r\r
+}\r\r
+\r\r
+}); // END YAHOO.extend\r\r
+\r\r
})();\r
\r
\r
\r
(function() {\r
\r
-var Dom = YAHOO.util.Dom;\r
-var Module = YAHOO.widget.Module;\r
-var Menu = YAHOO.widget.Menu;\r
+var Dom = YAHOO.util.Dom,\r
+ Module = YAHOO.widget.Module,\r
+ Menu = YAHOO.widget.Menu;\r
\r
\r
/**\r
\r
// Get the anchor node (if it exists)\r
\r
- var oAnchor = this._getFirstElement(p_oObject, "A");\r
- var sURL = "#";\r
- var sTarget = null;\r
- var sText = null;\r
+ var oAnchor = this._getFirstElement(p_oObject, "A"),\r
+ sURL = "#",\r
+ sTarget,\r
+ sText;\r
\r
\r
// Capture the "text" and/or the "URL"\r
\r
// Check if emphasis has been applied to the MenuItem\r
\r
- var oEmphasisNode = this._getFirstElement(oAnchor);\r
- var bEmphasis = false;\r
- var bStrongEmphasis = false;\r
+ var oEmphasisNode = this._getFirstElement(oAnchor),\r
+ bEmphasis = false,\r
+ bStrongEmphasis = false;\r
\r
if(oEmphasisNode) {\r
\r
*/\r
_initSubTree: function() {\r
\r
- var oSrcEl = this.srcElement;\r
- var oConfig = this.cfg;\r
+ var oSrcEl = this.srcElement,\r
+ oConfig = this.cfg;\r
\r
\r
if(oSrcEl.childNodes.length > 0) {\r
}\r
else {\r
\r
- var oNode = oSrcEl.firstChild;\r
- var aOptions = [];\r
+ var oNode = oSrcEl.firstChild,\r
+ aOptions = [];\r
\r
do {\r
\r
*/\r
configHelpText: function(p_sType, p_aArgs, p_oItem) {\r
\r
- var me = this;\r
- var oHelpText = p_aArgs[0];\r
- var oEl = this.element;\r
- var oConfig = this.cfg;\r
- var aNodes = [oEl, this._oAnchor];\r
- var oImg = this.submenuIndicator;\r
+ var me = this,\r
+ oHelpText = p_aArgs[0],\r
+ oEl = this.element,\r
+ oConfig = this.cfg,\r
+ aNodes = [oEl, this._oAnchor],\r
+ oImg = this.submenuIndicator;\r
\r
\r
/**\r
* "selected" and "disabled" configuration events.\r
* @private\r
*/\r
- var initHelpText = function() {\r
+ function initHelpText() {\r
\r
Dom.addClass(aNodes, "hashelptext");\r
\r
\r
}\r
\r
- };\r
+ }\r
\r
\r
/**\r
* Removes the "hashelptext" class and corresponding DOM element (EM).\r
* @private\r
*/\r
- var removeHelpText = function() {\r
+ function removeHelpText() {\r
\r
Dom.removeClass(aNodes, "hashelptext");\r
\r
oEl.removeChild(me._oHelpTextEM);\r
me._oHelpTextEM = null;\r
\r
- };\r
+ }\r
\r
\r
if(this._checkDOMNode(oHelpText)) {\r
*/\r
configTarget: function(p_sType, p_aArgs, p_oItem) {\r
\r
- var sTarget = p_aArgs[0];\r
- var oAnchor = this._oAnchor;\r
+ var sTarget = p_aArgs[0],\r
+ oAnchor = this._oAnchor;\r
\r
if(sTarget && sTarget.length > 0) {\r
\r
*/\r
configEmphasis: function(p_sType, p_aArgs, p_oItem) {\r
\r
- var bEmphasis = p_aArgs[0];\r
- var oAnchor = this._oAnchor;\r
- var oText = this._oText;\r
- var oConfig = this.cfg;\r
- var oEM;\r
+ var bEmphasis = p_aArgs[0],\r
+ oAnchor = this._oAnchor,\r
+ oText = this._oText,\r
+ oConfig = this.cfg,\r
+ oEM;\r
\r
\r
if(bEmphasis && oConfig.getProperty("strongemphasis")) {\r
\r
oEM = this._getFirstElement(oAnchor, "EM");\r
\r
- oAnchor.removeChild(oEM);\r
- oAnchor.appendChild(oText);\r
+ if(oEM) {\r
+\r
+ oAnchor.removeChild(oEM);\r
+ oAnchor.appendChild(oText);\r
+\r
+ }\r
\r
}\r
\r
*/\r
configStrongEmphasis: function(p_sType, p_aArgs, p_oItem) {\r
\r
- var bStrongEmphasis = p_aArgs[0];\r
- var oAnchor = this._oAnchor;\r
- var oText = this._oText;\r
- var oConfig = this.cfg;\r
- var oStrong;\r
+ var bStrongEmphasis = p_aArgs[0],\r
+ oAnchor = this._oAnchor,\r
+ oText = this._oText,\r
+ oConfig = this.cfg,\r
+ oStrong;\r
\r
if(bStrongEmphasis && oConfig.getProperty("emphasis")) {\r
\r
\r
oStrong = this._getFirstElement(oAnchor, "STRONG");\r
\r
- oAnchor.removeChild(oStrong);\r
- oAnchor.appendChild(oText);\r
+ if(oStrong) {\r
+\r
+ oAnchor.removeChild(oStrong);\r
+ oAnchor.appendChild(oText);\r
+\r
+ }\r
\r
}\r
\r
*/\r
configChecked: function(p_sType, p_aArgs, p_oItem) {\r
\r
- var bChecked = p_aArgs[0];\r
- var oEl = this.element;\r
- var oConfig = this.cfg;\r
- var oImg;\r
+ var bChecked = p_aArgs[0],\r
+ oEl = this.element,\r
+ oConfig = this.cfg,\r
+ oImg;\r
\r
\r
if(bChecked) {\r
*/\r
configDisabled: function(p_sType, p_aArgs, p_oItem) {\r
\r
- var bDisabled = p_aArgs[0];\r
- var oAnchor = this._oAnchor;\r
- var aNodes = [this.element, oAnchor];\r
- var oEM = this._oHelpTextEM;\r
- var oConfig = this.cfg;\r
- var oImg;\r
- var sImgSrc;\r
- var sImgAlt;\r
+ var bDisabled = p_aArgs[0],\r
+ oAnchor = this._oAnchor,\r
+ aNodes = [this.element, oAnchor],\r
+ oEM = this._oHelpTextEM,\r
+ oConfig = this.cfg,\r
+ oImg,\r
+ sImgSrc,\r
+ sImgAlt;\r
\r
\r
if(oEM) {\r
\r
if(!this.cfg.getProperty("disabled")) {\r
\r
- var bSelected = p_aArgs[0];\r
- var oEM = this._oHelpTextEM;\r
- var aNodes = [this.element, this._oAnchor];\r
- var oImg = this.submenuIndicator;\r
- var sImgSrc;\r
+ var bSelected = p_aArgs[0],\r
+ oEM = this._oHelpTextEM,\r
+ aNodes = [this.element, this._oAnchor],\r
+ oImg = this.submenuIndicator,\r
+ sImgSrc;\r
\r
\r
if(oEM) {\r
*/\r
configSubmenu: function(p_sType, p_aArgs, p_oItem) {\r
\r
- var oEl = this.element;\r
- var oSubmenu = p_aArgs[0];\r
- var oImg = this.submenuIndicator;\r
- var oConfig = this.cfg;\r
- var aNodes = [this.element, this._oAnchor];\r
- var oMenu;\r
- var bLazyLoad = this.parent && this.parent.lazyLoad;\r
+ var oEl = this.element,\r
+ oSubmenu = p_aArgs[0],\r
+ oImg = this.submenuIndicator,\r
+ oConfig = this.cfg,\r
+ aNodes = [this.element, this._oAnchor],\r
+ oMenu,\r
+ bLazyLoad = this.parent && this.parent.lazyLoad;\r
\r
\r
if(oSubmenu) {\r
!oSubmenu.nodeType\r
) {\r
\r
- var sSubmenuId = oSubmenu.id;\r
- var oSubmenuConfig = oSubmenu;\r
-\r
- delete oSubmenu["id"];\r
+ var sSubmenuId = oSubmenu.id,\r
+ oSubmenuConfig = oSubmenu;\r
\r
oSubmenuConfig.lazyload = bLazyLoad;\r
oSubmenuConfig.parent = this;\r
*/\r
initDefaultConfig : function() {\r
\r
- var oConfig = this.cfg;\r
- var CheckBoolean = oConfig.checkBoolean;\r
+ var oConfig = this.cfg,\r
+ CheckBoolean = oConfig.checkBoolean;\r
\r
\r
// Define the config properties\r
* start searching the array.\r
* @return {Object}\r
*/\r
- var getNextArrayItem = function(p_aArray, p_nStartIndex) {\r
+ function getNextArrayItem(p_aArray, p_nStartIndex) {\r
\r
return p_aArray[p_nStartIndex] ||\r
getNextArrayItem(p_aArray, (p_nStartIndex+1));\r
\r
- };\r
+ }\r
\r
\r
- var aItemGroups = this.parent.getItemGroups();\r
- var oNextItem;\r
+ var aItemGroups = this.parent.getItemGroups(),\r
+ oNextItem;\r
\r
\r
if(this.index < (aItemGroups[nGroupIndex].length - 1)) {\r
* start searching the array.\r
* @return {Object}\r
*/\r
- var getPreviousArrayItem = function(p_aArray, p_nStartIndex) {\r
+ function getPreviousArrayItem(p_aArray, p_nStartIndex) {\r
\r
return p_aArray[p_nStartIndex] ||\r
getPreviousArrayItem(p_aArray, (p_nStartIndex-1));\r
\r
- };\r
+ }\r
\r
\r
/**\r
* start searching the array.\r
* @return {Object}\r
*/\r
- var getFirstItemIndex = function(p_aArray, p_nStartIndex) {\r
+ function getFirstItemIndex(p_aArray, p_nStartIndex) {\r
\r
return p_aArray[p_nStartIndex] ?\r
p_nStartIndex :\r
getFirstItemIndex(p_aArray, (p_nStartIndex+1));\r
\r
- };\r
+ }\r
\r
- var aItemGroups = this.parent.getItemGroups();\r
- var oPreviousItem;\r
+ var aItemGroups = this.parent.getItemGroups(),\r
+ oPreviousItem;\r
\r
if(\r
this.index > getFirstItemIndex(aItemGroups[nGroupIndex], 0)\r
*/\r
focus: function() {\r
\r
- var oParent = this.parent;\r
- var oAnchor = this._oAnchor;\r
- var oActiveItem = oParent.activeItem;\r
+ var oParent = this.parent,\r
+ oAnchor = this._oAnchor,\r
+ oActiveItem = oParent.activeItem;\r
+\r
+\r
+ function setFocus() {\r
+\r
+ try {\r
+\r
+ oAnchor.focus();\r
+\r
+ }\r
+ catch(e) {\r
+\r
+ }\r
+\r
+ }\r
+\r
\r
if(\r
!this.cfg.getProperty("disabled") &&\r
\r
}\r
\r
- try {\r
-\r
- oAnchor.focus();\r
\r
- }\r
- catch(e) {\r
+ /*\r
+ Setting focus via a timer fixes a race condition in Firefox, IE\r
+ and Opera where the browser viewport jumps as it trys to\r
+ position and focus the menu.\r
+ */\r
\r
- }\r
+ window.setTimeout(setFocus, 0);\r
\r
this.focusEvent.fire();\r
\r
\r
if(oEl) {\r
\r
+\r
+ // If the item has a submenu, destroy it first\r
+\r
+ var oSubmenu = this.cfg.getProperty("submenu");\r
+\r
+ if(oSubmenu) {\r
+\r
+ oSubmenu.destroy();\r
+\r
+ }\r
+\r
+\r
// Remove CustomEvent listeners\r
\r
this.mouseOverEvent.unsubscribeAll();\r
*/\r
_removeEventHandlers: function() {\r
\r
- var Event = YAHOO.util.Event;\r
- var oTrigger = this._oTrigger;\r
- var bOpera = (this.browser == "opera");\r
+ var Event = YAHOO.util.Event,\r
+ oTrigger = this._oTrigger,\r
+ bOpera = (this.browser == "opera");\r
\r
\r
// Remove the event handlers from the trigger(s)\r
YAHOO.widget.MenuManager.hideVisible();\r
\r
\r
- var Event = YAHOO.util.Event;\r
- var oConfig = this.cfg;\r
+ var Event = YAHOO.util.Event,\r
+ oConfig = this.cfg;\r
\r
if(p_oEvent.type == "mousedown" && !p_oEvent.ctrlKey) {\r
\r
\r
// Position and display the context menu\r
\r
- var nX = Event.getPageX(p_oEvent);\r
- var nY = Event.getPageY(p_oEvent);\r
+ var nX = Event.getPageX(p_oEvent),\r
+ nY = Event.getPageY(p_oEvent);\r
\r
\r
oConfig.applyConfig( { xy:[nX, nY], visible:true } );\r
*/\r
configTrigger: function(p_sType, p_aArgs, p_oMenu) {\r
\r
- var Event = YAHOO.util.Event;\r
- var oTrigger = p_aArgs[0];\r
+ var Event = YAHOO.util.Event,\r
+ oTrigger = p_aArgs[0];\r
\r
if(oTrigger) {\r
\r
*/\r
_onKeyDown: function(p_sType, p_aArgs, p_oMenuBar) {\r
\r
- var Event = YAHOO.util.Event;\r
- var oEvent = p_aArgs[0];\r
- var oItem = p_aArgs[1];\r
- var oItemCfg = oItem.cfg;\r
- var oSubmenu;\r
+ var Event = YAHOO.util.Event,\r
+ oEvent = p_aArgs[0],\r
+ oItem = p_aArgs[1],\r
+ oSubmenu;\r
\r
\r
- switch(oEvent.keyCode) {\r
+ if(oItem && !oItem.cfg.getProperty("disabled")) {\r
\r
- case 27: // Esc key\r
+ var oItemCfg = oItem.cfg;\r
\r
- if(this.cfg.getProperty("position") == "dynamic") {\r
+ switch(oEvent.keyCode) {\r
\r
- this.hide();\r
+ case 37: // Left arrow\r
+ case 39: // Right arrow\r
\r
- if(this.parent) {\r
+ if(\r
+ oItem == this.activeItem &&\r
+ !oItemCfg.getProperty("selected")\r
+ ) {\r
\r
- this.parent.focus();\r
+ oItemCfg.setProperty("selected", true);\r
\r
}\r
+ else {\r
\r
- }\r
- else if(this.activeItem) {\r
+ var oNextItem = (oEvent.keyCode == 37) ?\r
+ oItem.getPreviousEnabledSibling() :\r
+ oItem.getNextEnabledSibling();\r
\r
- oSubmenu = this.activeItem.cfg.getProperty("submenu");\r
+ if(oNextItem) {\r
\r
- if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {\r
+ this.clearActiveItem();\r
\r
- oSubmenu.hide();\r
- this.activeItem.focus();\r
+ oNextItem.cfg.setProperty("selected", true);\r
\r
- }\r
- else {\r
\r
- this.activeItem.cfg.setProperty("selected", false);\r
- this.activeItem.blur();\r
+ if(this.cfg.getProperty("autosubmenudisplay")) {\r
\r
- }\r
+ oSubmenu = oNextItem.cfg.getProperty("submenu");\r
\r
- }\r
+ if(oSubmenu) {\r
\r
+ oSubmenu.show();\r
+ oSubmenu.activeItem.blur();\r
+ oSubmenu.activeItem = null;\r
\r
- Event.preventDefault(oEvent);\r
+ }\r
\r
- break;\r
+ }\r
\r
- case 37: // Left arrow\r
- case 39: // Right arrow\r
+ oNextItem.focus();\r
\r
- if(\r
- oItem == this.activeItem &&\r
- !oItemCfg.getProperty("selected")\r
- ) {\r
+ }\r
\r
- oItemCfg.setProperty("selected", true);\r
+ }\r
\r
- }\r
- else {\r
+ Event.preventDefault(oEvent);\r
+\r
+ break;\r
\r
- var oNextItem = (oEvent.keyCode == 37) ?\r
- oItem.getPreviousEnabledSibling() :\r
- oItem.getNextEnabledSibling();\r
+ case 40: // Down arrow\r
\r
- if(oNextItem) {\r
+ if(this.activeItem != oItem) {\r
\r
this.clearActiveItem();\r
\r
- oNextItem.cfg.setProperty("selected", true);\r
-\r
+ oItemCfg.setProperty("selected", true);\r
+ oItem.focus();\r
\r
- if(this.cfg.getProperty("autosubmenudisplay")) {\r
+ }\r
\r
- oSubmenu = oNextItem.cfg.getProperty("submenu");\r
+ oSubmenu = oItemCfg.getProperty("submenu");\r
\r
- if(oSubmenu) {\r
+ if(oSubmenu) {\r
\r
- oSubmenu.show();\r
- oSubmenu.activeItem.blur();\r
- oSubmenu.activeItem = null;\r
+ if(oSubmenu.cfg.getProperty("visible")) {\r
\r
- }\r
+ oSubmenu.setInitialSelection();\r
+ oSubmenu.setInitialFocus();\r
\r
}\r
+ else {\r
\r
- oNextItem.focus();\r
-\r
- }\r
-\r
- }\r
-\r
- Event.preventDefault(oEvent);\r
-\r
- break;\r
+ oSubmenu.show();\r
\r
- case 40: // Down arrow\r
+ }\r
\r
- if(this.activeItem != oItem) {\r
+ }\r
\r
- this.clearActiveItem();\r
+ Event.preventDefault(oEvent);\r
\r
- oItemCfg.setProperty("selected", true);\r
- oItem.focus();\r
+ break;\r
\r
- }\r
+ }\r
\r
- oSubmenu = oItemCfg.getProperty("submenu");\r
+ }\r
\r
- if(oSubmenu) {\r
\r
- if(oSubmenu.cfg.getProperty("visible")) {\r
+ if(oEvent.keyCode == 27 && this.activeItem) { // Esc key\r
\r
- oSubmenu.setInitialSelection();\r
- oSubmenu.setInitialFocus();\r
+ oSubmenu = this.activeItem.cfg.getProperty("submenu");\r
\r
- }\r
- else {\r
+ if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {\r
\r
- oSubmenu.show();\r
+ oSubmenu.hide();\r
+ this.activeItem.focus();\r
\r
- }\r
+ }\r
+ else {\r
\r
- }\r
+ this.activeItem.cfg.setProperty("selected", false);\r
+ this.activeItem.blur();\r
\r
- Event.preventDefault(oEvent);\r
+ }\r
\r
- break;\r
+ Event.preventDefault(oEvent);\r
\r
}\r
\r
\r
var oItem = p_aArgs[1];\r
\r
- if(oItem) {\r
+ if(oItem && !oItem.cfg.getProperty("disabled")) {\r
\r
- var Event = YAHOO.util.Event;\r
- var Dom = YAHOO.util.Dom;\r
+ var Event = YAHOO.util.Event,\r
+ Dom = YAHOO.util.Dom,\r
\r
- var oEvent = p_aArgs[0];\r
- var oTarget = Event.getTarget(oEvent);\r
+ oEvent = p_aArgs[0],\r
+ oTarget = Event.getTarget(oEvent),\r
\r
- var oActiveItem = this.activeItem;\r
- var oConfig = this.cfg;\r
+ oActiveItem = this.activeItem,\r
+ oConfig = this.cfg;\r
\r
\r
// Hide any other submenus that might be visible\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ (function(){var _1=YAHOO.util.Dom;var _2=YAHOO.util.Event;YAHOO.widget.MenuManager=new function(){var _3=false;var _4={};var _5={};var _6={};var _7=function(_8){var _9=_1.generateId();if(_8&&_5[_9]!=_8){_8.element.setAttribute("yuiid",_9);_5[_9]=_8;_8.destroyEvent.subscribe(onItemDestroy,_8);}};var _a=function(_b){var _c=_b.element.getAttribute("yuiid");if(_c&&_5[_c]){delete _5[_c];}};var _d=function(_e){var _f;if(_e&&_e.tagName){switch(_e.tagName.toUpperCase()){case "DIV":_f=_e.parentNode;if(_1.hasClass(_e,"bd")&&_f&&_f.tagName&&_f.tagName.toUpperCase()=="DIV"){return _f;}else{return _e;}break;case "LI":return _e;default:_f=_e.parentNode;if(_f){return _d(_f);}break;}}};var _10=function(_11){var _12=_2.getTarget(_11);var _13=_d(_12);var _14;var _15;if(_13){var _16=_13.tagName.toUpperCase();if(_16=="LI"){var _17=_13.getAttribute("yuiid");if(_17){_14=_5[_17];_15=_14.parent;}}else{if(_16=="DIV"){if(_13.id){_15=_4[_13.id];}}}}if(_15){var _18={"click":"clickEvent","mousedown":"mouseDownEvent","mouseup":"mouseUpEvent","mouseover":"mouseOverEvent","mouseout":"mouseOutEvent","keydown":"keyDownEvent","keyup":"keyUpEvent","keypress":"keyPressEvent"};var _19=_18[_11.type];if(_14&&!_14.cfg.getProperty("disabled")){_14[_19].fire(_11);}_15[_19].fire(_11,_14);}else{if(_11.type=="mousedown"){var _1a;for(var i in _4){if(_4.hasOwnProperty(i)){_15=_4[i];if(_15.cfg.getProperty("clicktohide")&&_15.cfg.getProperty("position")=="dynamic"){_15.hide();}else{_15.clearActiveItem(true);}}}}}};var _1c=function(_1d,_1e,_1f){this.removeMenu(_1f);};var _20=function(_21,_22,_23){var _24=_23.element.getAttribute("yuiid");if(_24){delete _5[_24];}};var _25=function(_26,_27,_28){var _29=_27[0];if(_29){_6[_28.id]=_28;}else{if(_6[_28.id]){delete _6[_28.id];}}};var _2a=function(_2b,_2c){_7(_2c[0]);};var _2d=function(_2e,_2f){_a(_2f[0]);};this.addMenu=function(_30){if(_30&&_30.id&&!_4[_30.id]){_4[_30.id]=_30;if(!_3){var _31=document;_2.addListener(_31,"mouseover",_10,this,true);_2.addListener(_31,"mouseout",_10,this,true);_2.addListener(_31,"mousedown",_10,this,true);_2.addListener(_31,"mouseup",_10,this,true);_2.addListener(_31,"click",_10,this,true);_2.addListener(_31,"keydown",_10,this,true);_2.addListener(_31,"keyup",_10,this,true);_2.addListener(_31,"keypress",_10,this,true);_3=true;}_30.destroyEvent.subscribe(_1c,_30,this);_30.cfg.subscribeToConfigEvent("visible",_25,_30);_30.itemAddedEvent.subscribe(_2a);_30.itemRemovedEvent.subscribe(_2d);}};this.removeMenu=function(_32){if(_32&&_4[_32.id]){delete _4[_32.id];}};this.hideVisible=function(){var _33;for(var i in _6){if(_6.hasOwnProperty(i)){_33=_6[i];if(_33.cfg.getProperty("position")=="dynamic"){_33.hide();}}}};this.getMenus=function(){return _4;};this.getMenu=function(_35){if(_4[_35]){return _4[_35];}};this.toString=function(){return ("MenuManager");};};})();(function(){var Dom=YAHOO.util.Dom;var _37=YAHOO.util.Event;YAHOO.widget.Menu=function(_38,_39){if(_39){this.parent=_39.parent;this.lazyLoad=_39.lazyLoad||_39.lazyload;this.itemData=_39.itemData||_39.itemdata;}YAHOO.widget.Menu.superclass.constructor.call(this,_38,_39);};YAHOO.extend(YAHOO.widget.Menu,YAHOO.widget.Overlay,{CSS_CLASS_NAME:"yuimenu",ITEM_TYPE:null,GROUP_TITLE_TAG_NAME:"h6",_nHideDelayId:null,_nShowDelayId:null,_hideDelayEventHandlersAssigned:false,_bHandledMouseOverEvent:false,_bHandledMouseOutEvent:false,_aGroupTitleElements:null,_aItemGroups:null,_aListElements:null,lazyLoad:false,itemData:null,activeItem:null,parent:null,srcElement:null,mouseOverEvent:null,mouseOutEvent:null,mouseDownEvent:null,mouseUpEvent:null,clickEvent:null,keyPressEvent:null,keyDownEvent:null,keyUpEvent:null,itemAddedEvent:null,itemRemovedEvent:null,init:function(_3a,_3b){this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuItem;}var _3c;if(typeof _3a=="string"){_3c=document.getElementById(_3a);}else{if(_3a.tagName){_3c=_3a;}}if(_3c&&_3c.tagName){switch(_3c.tagName.toUpperCase()){case "DIV":this.srcElement=_3c;if(!_3c.id){_3c.setAttribute("id",Dom.generateId());}YAHOO.widget.Menu.superclass.init.call(this,_3c);this.beforeInitEvent.fire(YAHOO.widget.Menu);break;case "SELECT":this.srcElement=_3c;YAHOO.widget.Menu.superclass.init.call(this,Dom.generateId());this.beforeInitEvent.fire(YAHOO.widget.Menu);break;}}else{YAHOO.widget.Menu.superclass.init.call(this,_3a);this.beforeInitEvent.fire(YAHOO.widget.Menu);}if(this.element){var oEl=this.element;Dom.addClass(oEl,this.CSS_CLASS_NAME);this.initEvent.subscribe(this._onInit,this,true);this.beforeRenderEvent.subscribe(this._onBeforeRender,this,true);this.renderEvent.subscribe(this._onRender,this,true);this.beforeShowEvent.subscribe(this._onBeforeShow,this,true);this.showEvent.subscribe(this._onShow,this,true);this.beforeHideEvent.subscribe(this._onBeforeHide,this,true);this.mouseOverEvent.subscribe(this._onMouseOver,this,true);this.mouseOutEvent.subscribe(this._onMouseOut,this,true);this.clickEvent.subscribe(this._onClick,this,true);this.keyDownEvent.subscribe(this._onKeyDown,this,true);if(_3b){this.cfg.applyConfig(_3b,true);}YAHOO.widget.MenuManager.addMenu(this);this.initEvent.fire(YAHOO.widget.Menu);}},_initSubTree:function(){var _3e;if(this.srcElement.tagName=="DIV"){_3e=this.body.firstChild;var _3f=0;var _40=this.GROUP_TITLE_TAG_NAME.toUpperCase();do{if(_3e&&_3e.tagName){switch(_3e.tagName.toUpperCase()){case _40:this._aGroupTitleElements[_3f]=_3e;break;case "UL":this._aListElements[_3f]=_3e;this._aItemGroups[_3f]=[];_3f++;break;}}}while((_3e=_3e.nextSibling));if(this._aListElements[0]){Dom.addClass(this._aListElements[0],"first-of-type");}}_3e=null;if(this.srcElement.tagName){switch(this.srcElement.tagName.toUpperCase()){case "DIV":if(this._aListElements.length>0){var i=this._aListElements.length-1;do{_3e=this._aListElements[i].firstChild;do{if(_3e&&_3e.tagName){switch(_3e.tagName.toUpperCase()){case "LI":this.addItem(new this.ITEM_TYPE(_3e,{parent:this}),i);break;}}}while((_3e=_3e.nextSibling));}while(i--);}break;case "SELECT":_3e=this.srcElement.firstChild;do{if(_3e&&_3e.tagName){switch(_3e.tagName.toUpperCase()){case "OPTGROUP":case "OPTION":this.addItem(new this.ITEM_TYPE(_3e,{parent:this}));break;}}}while((_3e=_3e.nextSibling));break;}}},_getFirstEnabledItem:function(){var _42=this._aItemGroups.length;var _43;var _44;for(var i=0;i<_42;i++){_44=this._aItemGroups[i];if(_44){var _46=_44.length;for(var n=0;n<_46;n++){_43=_44[n];if(!_43.cfg.getProperty("disabled")&&_43.element.style.display!="none"){return _43;}_43=null;}}}},_checkPosition:function(_48){if(typeof _48=="string"){var _49=_48.toLowerCase();return ("dynamic,static".indexOf(_49)!=-1);}},_addItemToGroup:function(_4a,_4b,_4c){var _4d;if(_4b instanceof this.ITEM_TYPE){_4d=_4b;_4d.parent=this;}else{if(typeof _4b=="string"){_4d=new this.ITEM_TYPE(_4b,{parent:this});}else{if(typeof _4b=="object"&&_4b.text){var _4e=_4b.text;delete _4b["text"];_4b.parent=this;_4d=new this.ITEM_TYPE(_4e,_4b);}}}if(_4d){var _4f=typeof _4a=="number"?_4a:0;var _50=this._getItemGroup(_4f);var _51;if(!_50){_50=this._createItemGroup(_4f);}if(typeof _4c=="number"){var _52=(_4c>=_50.length);if(_50[_4c]){_50.splice(_4c,0,_4d);}else{_50[_4c]=_4d;}_51=_50[_4c];if(_51){if(_52&&(!_51.element.parentNode||_51.element.parentNode.nodeType==11)){this._aListElements[_4f].appendChild(_51.element);}else{var _53=function(_54,_55){return (_54[_55]||_53(_54,(_55+1)));};var _56=_53(_50,(_4c+1));if(_56&&(!_51.element.parentNode||_51.element.parentNode.nodeType==11)){this._aListElements[_4f].insertBefore(_51.element,_56.element);}}_51.parent=this;this._subscribeToItemEvents(_51);this._configureSubmenu(_51);this._updateItemProperties(_4f);this.itemAddedEvent.fire(_51);return _51;}}else{var _57=_50.length;_50[_57]=_4d;_51=_50[_57];if(_51){if(!Dom.isAncestor(this._aListElements[_4f],_51.element)){this._aListElements[_4f].appendChild(_51.element);}_51.element.setAttribute("groupindex",_4f);_51.element.setAttribute("index",_57);_51.parent=this;_51.index=_57;_51.groupIndex=_4f;this._subscribeToItemEvents(_51);this._configureSubmenu(_51);if(_57===0){Dom.addClass(_51.element,"first-of-type");}this.itemAddedEvent.fire(_51);return _51;}}}},_removeItemFromGroupByIndex:function(_58,_59){var _5a=typeof _58=="number"?_58:0;var _5b=this._getItemGroup(_5a);if(_5b){var _5c=_5b.splice(_59,1);var _5d=_5c[0];if(_5d){this._updateItemProperties(_5a);if(_5b.length===0){var oUL=this._aListElements[_5a];if(this.body&&oUL){this.body.removeChild(oUL);}this._aItemGroups.splice(_5a,1);this._aListElements.splice(_5a,1);oUL=this._aListElements[0];if(oUL){Dom.addClass(oUL,"first-of-type");}}this.itemRemovedEvent.fire(_5d);return _5d;}}},_removeItemFromGroupByValue:function(_5f,_60){var _61=this._getItemGroup(_5f);if(_61){var _62=_61.length;var _63=-1;if(_62>0){var i=_62-1;do{if(_61[i]==_60){_63=i;break;}}while(i--);if(_63>-1){return this._removeItemFromGroupByIndex(_5f,_63);}}}},_updateItemProperties:function(_65){var _66=this._getItemGroup(_65);var _67=_66.length;if(_67>0){var i=_67-1;var _69;var oLI;do{_69=_66[i];if(_69){oLI=_69.element;_69.index=i;_69.groupIndex=_65;oLI.setAttribute("groupindex",_65);oLI.setAttribute("index",i);Dom.removeClass(oLI,"first-of-type");}}while(i--);if(oLI){Dom.addClass(oLI,"first-of-type");}}},_createItemGroup:function(_6b){if(!this._aItemGroups[_6b]){this._aItemGroups[_6b]=[];var oUL=document.createElement("ul");this._aListElements[_6b]=oUL;return this._aItemGroups[_6b];}},_getItemGroup:function(_6d){var _6e=((typeof _6d=="number")?_6d:0);return this._aItemGroups[_6e];},_configureSubmenu:function(_6f){var _70=_6f.cfg.getProperty("submenu");if(_70){this.cfg.configChangedEvent.subscribe(this._onParentMenuConfigChange,_70,true);this.renderEvent.subscribe(this._onParentMenuRender,_70,true);_70.beforeShowEvent.subscribe(this._onSubmenuBeforeShow,_70,true);_70.showEvent.subscribe(this._onSubmenuShow,_70,true);_70.hideEvent.subscribe(this._onSubmenuHide,_70,true);}},_subscribeToItemEvents:function(_71){_71.focusEvent.subscribe(this._onMenuItemFocus,_71,this);_71.blurEvent.subscribe(this._onMenuItemBlur,this,true);_71.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange,_71,this);},_getOffsetWidth:function(){var _72=this.element.cloneNode(true);Dom.setStyle(_72,"width","");document.body.appendChild(_72);var _73=_72.offsetWidth;document.body.removeChild(_72);return _73;},_cancelHideDelay:function(){var _74=this.getRoot();if(_74._nHideDelayId){window.clearTimeout(_74._nHideDelayId);}},_execHideDelay:function(){this._cancelHideDelay();var _75=this.getRoot();var me=this;var _77=function(){if(_75.activeItem){_75.clearActiveItem();}if(_75==me&&me.cfg.getProperty("position")=="dynamic"){me.hide();}};_75._nHideDelayId=window.setTimeout(_77,_75.cfg.getProperty("hidedelay"));},_cancelShowDelay:function(){var _78=this.getRoot();if(_78._nShowDelayId){window.clearTimeout(_78._nShowDelayId);}},_execShowDelay:function(_79){this._cancelShowDelay();var _7a=this.getRoot();var _7b=function(){_79.show();};_7a._nShowDelayId=window.setTimeout(_7b,_7a.cfg.getProperty("showdelay"));},_onMouseOver:function(_7c,_7d,_7e){var _7f=_7d[0];var _80=_7d[1];var _81=_37.getTarget(_7f);if(!this._bHandledMouseOverEvent&&(_81==this.element||Dom.isAncestor(this.element,_81))){this.clearActiveItem();this._bHandledMouseOverEvent=true;this._bHandledMouseOutEvent=false;}if(_80&&!_80.handledMouseOverEvent&&(_81==_80.element||Dom.isAncestor(_80.element,_81))){var _82=_80.cfg;_82.setProperty("selected",true);_80.focus();if(this.cfg.getProperty("autosubmenudisplay")){var _83=_82.getProperty("submenu");if(_83){if(this.cfg.getProperty("showdelay")>0){this._execShowDelay(_83);}else{_83.show();}}}_80.handledMouseOverEvent=true;_80.handledMouseOutEvent=false;}},_onMouseOut:function(_84,_85,_86){var _87=_85[0];var _88=_85[1];var _89=_37.getRelatedTarget(_87);var _8a=false;if(_88){var _8b=_88.cfg;var _8c=_8b.getProperty("submenu");if(_8c&&(_89==_8c.element||Dom.isAncestor(_8c.element,_89))){_8a=true;}if(!_88.handledMouseOutEvent&&((_89!=_88.element&&!Dom.isAncestor(_88.element,_89))||_8a)){if(this.cfg.getProperty("showdelay")>0){this._cancelShowDelay();}if(!_8a){_8b.setProperty("selected",false);}if(this.cfg.getProperty("autosubmenudisplay")){if(_8c){if(!(_89==_8c.element||YAHOO.util.Dom.isAncestor(_8c.element,_89))){_8c.hide();}}}_88.handledMouseOutEvent=true;_88.handledMouseOverEvent=false;}}if(!this._bHandledMouseOutEvent&&((_89!=this.element&&!Dom.isAncestor(this.element,_89))||_8a)){this._bHandledMouseOutEvent=true;this._bHandledMouseOverEvent=false;}},_onClick:function(_8d,_8e,_8f){var _90=_8e[0];var _91=_8e[1];var _92=_37.getTarget(_90);if(_91){var _93=_91.cfg;var _94=_93.getProperty("submenu");if(_92==_91.submenuIndicator&&_94){if(_94.cfg.getProperty("visible")){_94.hide();}else{this.clearActiveItem();this.activeItem=_91;_91.cfg.setProperty("selected",true);_94.show();}}else{var _95=_93.getProperty("url");var _96=(_95.substr((_95.length-1),1)=="#");var _97=_93.getProperty("target");var _98=(_97&&_97.length>0);if(_92.tagName.toUpperCase()=="A"&&_96&&!_98){_37.preventDefault(_90);}if(_92.tagName.toUpperCase()!="A"&&!_96&&!_98){document.location=_95;}if(_96&&!_94){var _99=this.getRoot();if(_99.cfg.getProperty("position")=="static"){_99.clearActiveItem();}else{_99.hide();}}}}},_onKeyDown:function(_9a,_9b,_9c){var _9d=_9b[0];var _9e=_9b[1];var _9f;if(_9e){var _a0=_9e.cfg;var _a1=this.parent;var _a2;var _a3;switch(_9d.keyCode){case 38:case 40:if(_9e==this.activeItem&&!_a0.getProperty("selected")){_a0.setProperty("selected",true);}else{_a3=(_9d.keyCode==38)?_9e.getPreviousEnabledSibling():_9e.getNextEnabledSibling();if(_a3){this.clearActiveItem();_a3.cfg.setProperty("selected",true);_a3.focus();}}_37.preventDefault(_9d);break;case 39:_9f=_a0.getProperty("submenu");if(_9f){if(!_a0.getProperty("selected")){_a0.setProperty("selected",true);}_9f.show();_9f.setInitialSelection();}else{_a2=this.getRoot();if(_a2 instanceof YAHOO.widget.MenuBar){_a3=_a2.activeItem.getNextEnabledSibling();if(_a3){_a2.clearActiveItem();_a3.cfg.setProperty("selected",true);_9f=_a3.cfg.getProperty("submenu");if(_9f){_9f.show();}_a3.focus();}}}_37.preventDefault(_9d);break;case 37:if(_a1){var _a4=_a1.parent;if(_a4 instanceof YAHOO.widget.MenuBar){_a3=_a4.activeItem.getPreviousEnabledSibling();if(_a3){_a4.clearActiveItem();_a3.cfg.setProperty("selected",true);_9f=_a3.cfg.getProperty("submenu");if(_9f){_9f.show();}_a3.focus();}}else{this.hide();_a1.focus();}}_37.preventDefault(_9d);break;}}if(_9d.keyCode==27){if(this.cfg.getProperty("position")=="dynamic"){this.hide();if(this.parent){this.parent.focus();}}else{if(this.activeItem){_9f=this.activeItem.cfg.getProperty("submenu");if(_9f&&_9f.cfg.getProperty("visible")){_9f.hide();this.activeItem.focus();}else{this.activeItem.cfg.setProperty("selected",false);this.activeItem.blur();}}}_37.preventDefault(_9d);}},_onInit:function(_a5,_a6,_a7){if(((this.parent&&!this.lazyLoad)||(!this.parent&&this.cfg.getProperty("position")=="static")||(!this.parent&&!this.lazyLoad&&this.cfg.getProperty("position")=="dynamic"))&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree();}if(this.itemData){this.addItems(this.itemData);}}else{if(this.lazyLoad){this.cfg.fireQueue();}}},_onBeforeRender:function(_a8,_a9,_aa){var _ab=this.cfg;var oEl=this.element;var _ad=this._aListElements.length;if(_ad>0){var i=0;var _af=true;var oUL;var _b1;do{oUL=this._aListElements[i];if(oUL){if(_af){Dom.addClass(oUL,"first-of-type");_af=false;}if(!Dom.isAncestor(oEl,oUL)){this.appendToBody(oUL);}_b1=this._aGroupTitleElements[i];if(_b1){if(!Dom.isAncestor(oEl,_b1)){oUL.parentNode.insertBefore(_b1,oUL);}Dom.addClass(oUL,"hastitle");}}i++;}while(i<_ad);}},_onRender:function(_b2,_b3,_b4){if(this.cfg.getProperty("position")=="dynamic"){var _b5=this.element.parentNode.tagName.toUpperCase()=="BODY"?this.element.offsetWidth:this._getOffsetWidth();this.cfg.setProperty("width",(_b5+"px"));}},_onBeforeShow:function(_b6,_b7,_b8){if(this.lazyLoad&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree();}if(this.itemData){if(this.parent&&this.parent.parent&&this.parent.parent.srcElement&&this.parent.parent.srcElement.tagName.toUpperCase()=="SELECT"){var _b9=this.itemData.length;for(var n=0;n<_b9;n++){if(this.itemData[n].tagName){this.addItem((new this.ITEM_TYPE(this.itemData[n])));}}}else{this.addItems(this.itemData);}}if(this.srcElement){this.render();}else{if(this.parent){this.render(this.parent.element);}else{this.render(this.cfg.getProperty("container"));}}}},_onShow:function(_bb,_bc,_bd){this.setInitialFocus();var _be=this.parent;if(_be){var _bf=_be.parent;var _c0=_bf.cfg.getProperty("submenualignment");var _c1=this.cfg.getProperty("submenualignment");if((_c0[0]!=_c1[0])&&(_c0[1]!=_c1[1])){this.cfg.setProperty("submenualignment",[_c0[0],_c0[1]]);}if(!_bf.cfg.getProperty("autosubmenudisplay")&&_bf.cfg.getProperty("position")=="static"){_bf.cfg.setProperty("autosubmenudisplay",true);var _c2=function(_c3){if(_c3.type=="mousedown"||(_c3.type=="keydown"&&_c3.keyCode==27)){var _c4=_37.getTarget(_c3);if(_c4!=_bf.element||!YAHOO.util.Dom.isAncestor(_bf.element,_c4)){_bf.cfg.setProperty("autosubmenudisplay",false);_37.removeListener(document,"mousedown",_c2);_37.removeListener(document,"keydown",_c2);}}};_37.addListener(document,"mousedown",_c2);_37.addListener(document,"keydown",_c2);}}},_onBeforeHide:function(_c5,_c6,_c7){this.clearActiveItem(true);},_onParentMenuConfigChange:function(_c8,_c9,_ca){var _cb=_c9[0][0];var _cc=_c9[0][1];switch(_cb){case "iframe":case "constraintoviewport":case "hidedelay":case "showdelay":case "clicktohide":case "effect":_ca.cfg.setProperty(_cb,_cc);break;}},_onParentMenuRender:function(_cd,_ce,_cf){var _d0=_cf.parent.parent;var _d1={constraintoviewport:_d0.cfg.getProperty("constraintoviewport"),xy:[0,0],clicktohide:_d0.cfg.getProperty("clicktohide"),effect:_d0.cfg.getProperty("effect")};var _d2=_d0.cfg.getProperty("showdelay");if(_d2>0){_d1.showdelay=_d2;}var _d3=_d0.cfg.getProperty("hidedelay");if(_d3>0){_d1.hidedelay=_d3;}if(this.cfg.getProperty("position")==_d0.cfg.getProperty("position")){_d1.iframe=_d0.cfg.getProperty("iframe");}_cf.cfg.applyConfig(_d1);if(!this.lazyLoad){if(Dom.inDocument(this.element)){this.render();}else{this.render(this.parent.element);}}},_onSubmenuBeforeShow:function(_d4,_d5,_d6){var _d7=this.parent;var _d8=_d7.parent.cfg.getProperty("submenualignment");this.cfg.setProperty("context",[_d7.element,_d8[0],_d8[1]]);_d7.submenuIndicator.alt=_d7.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;},_onSubmenuShow:function(_d9,_da,_db){var _dc=this.parent;_dc.submenuIndicator.alt=_dc.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;},_onSubmenuHide:function(_dd,_de,_df){var _e0=this.parent;_e0.submenuIndicator.alt=_e0.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;},_onMenuItemFocus:function(_e1,_e2,_e3){this.activeItem=_e3;},_onMenuItemBlur:function(_e4,_e5){this.activeItem=null;},_onMenuItemConfigChange:function(_e6,_e7,_e8){var _e9=_e7[0][0];switch(_e9){case "submenu":var _ea=_e7[0][1];if(_ea){this._configureSubmenu(_e8);}break;case "text":case "helptext":if(this.element.style.width){var _eb=this._getOffsetWidth()+"px";Dom.setStyle(this.element,"width",_eb);}break;}},enforceConstraints:function(_ec,_ed,obj){var _ef=this.cfg;var pos=_ed[0];var x=pos[0];var y=pos[1];var bod=document.getElementsByTagName("body")[0];var htm=document.getElementsByTagName("html")[0];var _f5=Dom.getStyle(bod,"overflow");var _f6=Dom.getStyle(htm,"overflow");var _f7=this.element.offsetHeight;var _f8=this.element.offsetWidth;var _f9=Dom.getClientWidth();var _fa=Dom.getClientHeight();var _fb=window.scrollX||document.body.scrollLeft;var _fc=window.scrollY||document.body.scrollTop;var _fd=_fc+10;var _fe=_fb+10;var _ff=_fc+_fa-_f7-10;var _100=_fb+_f9-_f8-10;var _101=_ef.getProperty("context");var _102=_101?_101[0]:null;if(x<10){x=_fe;}else{if((x+_f8)>_f9){if(_102&&((x-_102.offsetWidth)>_f8)){x=(x-(_102.offsetWidth+_f8));}else{x=_100;}}}if(y<10){y=_fd;}else{if(y>_ff){if(_102&&(y>_f7)){y=((y+_102.offsetHeight)-_f7);}else{y=_ff;}}}_ef.setProperty("x",x,true);_ef.setProperty("y",y,true);},configVisible:function(_103,_104,_105){if(this.cfg.getProperty("position")=="dynamic"){YAHOO.widget.Menu.superclass.configVisible.call(this,_103,_104,_105);}else{var _106=_104[0];var _107=Dom.getStyle(this.element,"display");if(_106){if(_107!="block"){this.beforeShowEvent.fire();Dom.setStyle(this.element,"display","block");this.showEvent.fire();}}else{if(_107=="block"){this.beforeHideEvent.fire();Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}}}},configPosition:function(_108,_109,_10a){var _10b=_109[0]=="static"?"static":"absolute";var oCfg=this.cfg;Dom.setStyle(this.element,"position",_10b);if(_10b=="static"){oCfg.setProperty("iframe",false);Dom.setStyle(this.element,"display","block");oCfg.setProperty("visible",true);}else{Dom.setStyle(this.element,"visibility","hidden");}if(_10b=="absolute"){var _10d=oCfg.getProperty("zindex");if(!_10d||_10d===0){_10d=this.parent?(this.parent.parent.cfg.getProperty("zindex")+1):1;oCfg.setProperty("zindex",_10d);}}},configIframe:function(_10e,_10f,_110){if(this.cfg.getProperty("position")=="dynamic"){YAHOO.widget.Menu.superclass.configIframe.call(this,_10e,_10f,_110);}},configHideDelay:function(_111,_112,_113){var _114=_112[0];var _115=this.mouseOutEvent;var _116=this.mouseOverEvent;var _117=this.keyDownEvent;if(_114>0){if(!this._hideDelayEventHandlersAssigned){_115.subscribe(this._execHideDelay,true);_116.subscribe(this._cancelHideDelay,this,true);_117.subscribe(this._cancelHideDelay,this,true);this._hideDelayEventHandlersAssigned=true;}}else{_115.unsubscribe(this._execHideDelay,this);_116.unsubscribe(this._cancelHideDelay,this);_117.unsubscribe(this._cancelHideDelay,this);this._hideDelayEventHandlersAssigned=false;}},configContainer:function(_118,_119,_11a){var _11b=_119[0];if(typeof _11b=="string"){this.cfg.setProperty("container",document.getElementById(_11b),true);}},onDomResize:function(e,obj){if(!this._handleResize){this._handleResize=true;return;}var _11e=this.cfg;if(_11e.getProperty("position")=="dynamic"){_11e.setProperty("width",(this._getOffsetWidth()+"px"));}YAHOO.widget.Menu.superclass.onDomResize.call(this,e,obj);},initEvents:function(){YAHOO.widget.Menu.superclass.initEvents.call(this);var _11f=YAHOO.util.CustomEvent;this.mouseOverEvent=new _11f("mouseOverEvent",this);this.mouseOutEvent=new _11f("mouseOutEvent",this);this.mouseDownEvent=new _11f("mouseDownEvent",this);this.mouseUpEvent=new _11f("mouseUpEvent",this);this.clickEvent=new _11f("clickEvent",this);this.keyPressEvent=new _11f("keyPressEvent",this);this.keyDownEvent=new _11f("keyDownEvent",this);this.keyUpEvent=new _11f("keyUpEvent",this);this.itemAddedEvent=new _11f("itemAddedEvent",this);this.itemRemovedEvent=new _11f("itemRemovedEvent",this);},getRoot:function(){var _120=this.parent;if(_120){var _121=_120.parent;return _121?_121.getRoot():this;}else{return this;}},toString:function(){return ("Menu "+this.id);},setItemGroupTitle:function(_122,_123){if(typeof _122=="string"&&_122.length>0){var _124=typeof _123=="number"?_123:0;var _125=this._aGroupTitleElements[_124];if(_125){_125.innerHTML=_122;}else{_125=document.createElement(this.GROUP_TITLE_TAG_NAME);_125.innerHTML=_122;this._aGroupTitleElements[_124]=_125;}var i=this._aGroupTitleElements.length-1;var _127;do{if(this._aGroupTitleElements[i]){Dom.removeClass(this._aGroupTitleElements[i],"first-of-type");_127=i;}}while(i--);if(_127!==null){Dom.addClass(this._aGroupTitleElements[_127],"first-of-type");}}},addItem:function(_128,_129){if(_128){return this._addItemToGroup(_129,_128);}},addItems:function(_12a,_12b){function isArray(_12c){return (typeof _12c=="object"&&_12c.constructor==Array);}if(isArray(_12a)){var _12d=_12a.length;var _12e=[];var _12f;for(var i=0;i<_12d;i++){_12f=_12a[i];if(isArray(_12f)){_12e[_12e.length]=this.addItems(_12f,i);}else{_12e[_12e.length]=this._addItemToGroup(_12b,_12f);}}if(_12e.length){return _12e;}}},insertItem:function(_131,_132,_133){if(_131){return this._addItemToGroup(_133,_131,_132);}},removeItem:function(_134,_135){if(typeof _134!="undefined"){var _136;if(_134 instanceof YAHOO.widget.MenuItem){_136=this._removeItemFromGroupByValue(_135,_134);}else{if(typeof _134=="number"){_136=this._removeItemFromGroupByIndex(_135,_134);}}if(_136){_136.destroy();return _136;}}},getItemGroups:function(){return this._aItemGroups;},getItem:function(_137,_138){if(typeof _137=="number"){var _139=this._getItemGroup(_138);if(_139){return _139[_137];}}},destroy:function(){this.mouseOverEvent.unsubscribeAll();this.mouseOutEvent.unsubscribeAll();this.mouseDownEvent.unsubscribeAll();this.mouseUpEvent.unsubscribeAll();this.clickEvent.unsubscribeAll();this.keyPressEvent.unsubscribeAll();this.keyDownEvent.unsubscribeAll();this.keyUpEvent.unsubscribeAll();var _13a=this._aItemGroups.length;var _13b;var _13c;var _13d;var i;var n;if(_13a>0){i=_13a-1;do{_13c=this._aItemGroups[i];if(_13c){_13b=_13c.length;if(_13b>0){n=_13b-1;do{_13d=this._aItemGroups[i][n];if(_13d){_13d.destroy();}}while(n--);}}}while(i--);}YAHOO.widget.Menu.superclass.destroy.call(this);},setInitialFocus:function(){var _140=this._getFirstEnabledItem();if(_140){_140.focus();}},setInitialSelection:function(){var _141=this._getFirstEnabledItem();if(_141){_141.cfg.setProperty("selected",true);}},clearActiveItem:function(_142){if(this.cfg.getProperty("showdelay")>0){this._cancelShowDelay();}var _143=this.activeItem;if(_143){var _144=_143.cfg;_144.setProperty("selected",false);var _145=_144.getProperty("submenu");if(_145){_145.hide();}if(_142){_143.blur();}}},initDefaultConfig:function(){YAHOO.widget.Menu.superclass.initDefaultConfig.call(this);var _146=this.cfg;_146.addProperty("visible",{value:false,handler:this.configVisible,validator:this.cfg.checkBoolean});_146.addProperty("constraintoviewport",{value:true,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});_146.addProperty("position",{value:"dynamic",handler:this.configPosition,validator:this._checkPosition,supercedes:["visible"]});_146.addProperty("submenualignment",{value:["tl","tr"]});_146.addProperty("autosubmenudisplay",{value:true,validator:_146.checkBoolean});_146.addProperty("showdelay",{value:0,validator:_146.checkNumber});_146.addProperty("hidedelay",{value:0,validator:_146.checkNumber,handler:this.configHideDelay,suppressEvent:true});_146.addProperty("clicktohide",{value:true,validator:_146.checkBoolean});this.cfg.addProperty("container",{value:document.body,handler:this.configContainer});}});})();YAHOO.widget.MenuModule=YAHOO.widget.Menu;(function(){var Dom=YAHOO.util.Dom;var _148=YAHOO.widget.Module;var Menu=YAHOO.widget.Menu;YAHOO.widget.MenuItem=function(_14a,_14b){if(_14a){if(_14b){this.parent=_14b.parent;this.value=_14b.value;}this.init(_14a,_14b);}};YAHOO.widget.MenuItem.prototype={SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarorght8_nrm_1.gif",SELECTED_SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarorght8_hov_1.gif",DISABLED_SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarorght8_dim_1.gif",COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT:"Collapsed. Click to expand.",EXPANDED_SUBMENU_INDICATOR_ALT_TEXT:"Expanded. Click to collapse.",DISABLED_SUBMENU_INDICATOR_ALT_TEXT:"Disabled.",CHECKED_IMAGE_PATH:"nt/ic/ut/bsc/menuchk8_nrm_1.gif",SELECTED_CHECKED_IMAGE_PATH:"nt/ic/ut/bsc/menuchk8_hov_1.gif",DISABLED_CHECKED_IMAGE_PATH:"nt/ic/ut/bsc/menuchk8_dim_1.gif",CHECKED_IMAGE_ALT_TEXT:"Checked.",DISABLED_CHECKED_IMAGE_ALT_TEXT:"Checked. (Item disabled.)",CSS_CLASS_NAME:"yuimenuitem",SUBMENU_TYPE:null,IMG_ROOT:"http://us.i1.yimg.com/us.yimg.com/i/",IMG_ROOT_SSL:"https://a248.e.akamai.net/sec.yimg.com/i/",_oAnchor:null,_oText:null,_oHelpTextEM:null,_oSubmenu:null,_checkImage:null,constructor:YAHOO.widget.MenuItem,imageRoot:null,isSecure:_148.prototype.isSecure,index:null,groupIndex:null,parent:null,element:null,srcElement:null,value:null,submenuIndicator:null,browser:_148.prototype.browser,destroyEvent:null,mouseOverEvent:null,mouseOutEvent:null,mouseDownEvent:null,mouseUpEvent:null,clickEvent:null,keyPressEvent:null,keyDownEvent:null,keyUpEvent:null,focusEvent:null,blurEvent:null,init:function(_14c,_14d){this.imageRoot=(this.isSecure)?this.IMG_ROOT_SSL:this.IMG_ROOT;if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=Menu;}this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();var _14e=this.cfg;if(this._checkString(_14c)){this._createRootNodeStructure();_14e.setProperty("text",_14c);}else{if(this._checkDOMNode(_14c)){switch(_14c.tagName.toUpperCase()){case "OPTION":this._createRootNodeStructure();_14e.setProperty("text",_14c.text);this.srcElement=_14c;break;case "OPTGROUP":this._createRootNodeStructure();_14e.setProperty("text",_14c.label);this.srcElement=_14c;this._initSubTree();break;case "LI":var _14f=this._getFirstElement(_14c,"A");var sURL="#";var _151=null;var _152=null;if(_14f){sURL=_14f.getAttribute("href");_151=_14f.getAttribute("target");if(_14f.innerText){_152=_14f.innerText;}else{var _153=_14f.ownerDocument.createRange();_153.selectNodeContents(_14f);_152=_153.toString();}}else{var _154=_14c.firstChild;_152=_154.nodeValue;_14f=document.createElement("a");_14f.setAttribute("href",sURL);_14c.replaceChild(_14f,_154);_14f.appendChild(_154);}this.srcElement=_14c;this.element=_14c;this._oAnchor=_14f;var _155=this._getFirstElement(_14f);var _156=false;var _157=false;if(_155){this._oText=_155.firstChild;switch(_155.tagName.toUpperCase()){case "EM":_156=true;break;case "STRONG":_157=true;break;}}else{this._oText=_14f.firstChild;}_14e.setProperty("text",_152,true);_14e.setProperty("url",sURL,true);_14e.setProperty("target",_151,true);_14e.setProperty("emphasis",_156,true);_14e.setProperty("strongemphasis",_157,true);this._initSubTree();break;}}}if(this.element){Dom.addClass(this.element,this.CSS_CLASS_NAME);var _158=YAHOO.util.CustomEvent;this.destroyEvent=new _158("destroyEvent",this);this.mouseOverEvent=new _158("mouseOverEvent",this);this.mouseOutEvent=new _158("mouseOutEvent",this);this.mouseDownEvent=new _158("mouseDownEvent",this);this.mouseUpEvent=new _158("mouseUpEvent",this);this.clickEvent=new _158("clickEvent",this);this.keyPressEvent=new _158("keyPressEvent",this);this.keyDownEvent=new _158("keyDownEvent",this);this.keyUpEvent=new _158("keyUpEvent",this);this.focusEvent=new _158("focusEvent",this);this.blurEvent=new _158("blurEvent",this);if(_14d){_14e.applyConfig(_14d);}_14e.fireQueue();}},_getFirstElement:function(_159,_15a){var _15b;if(_159.firstChild&&_159.firstChild.nodeType==1){_15b=_159.firstChild;}else{if(_159.firstChild&&_159.firstChild.nextSibling&&_159.firstChild.nextSibling.nodeType==1){_15b=_159.firstChild.nextSibling;}}if(_15a){return (_15b&&_15b.tagName.toUpperCase()==_15a)?_15b:false;}return _15b;},_checkString:function(_15c){return (typeof _15c=="string");},_checkDOMNode:function(_15d){return (_15d&&_15d.tagName);},_createRootNodeStructure:function(){this.element=document.createElement("li");this._oText=document.createTextNode("");this._oAnchor=document.createElement("a");this._oAnchor.appendChild(this._oText);this.cfg.refireEvent("url");this.element.appendChild(this._oAnchor);},_initSubTree:function(){var _15e=this.srcElement;var _15f=this.cfg;if(_15e.childNodes.length>0){if(this.parent.lazyLoad&&this.parent.srcElement&&this.parent.srcElement.tagName.toUpperCase()=="SELECT"){_15f.setProperty("submenu",{id:Dom.generateId(),itemdata:_15e.childNodes});}else{var _160=_15e.firstChild;var _161=[];do{if(_160&&_160.tagName){switch(_160.tagName.toUpperCase()){case "DIV":_15f.setProperty("submenu",_160);break;case "OPTION":_161[_161.length]=_160;break;}}}while((_160=_160.nextSibling));var _162=_161.length;if(_162>0){var _163=new this.SUBMENU_TYPE(Dom.generateId());_15f.setProperty("submenu",_163);for(var n=0;n<_162;n++){_163.addItem((new _163.ITEM_TYPE(_161[n])));}}}}},_preloadImage:function(_165){var _166=this.imageRoot+_165;if(!document.images[_166]){var _167=document.createElement("img");_167.src=_166;_167.name=_166;_167.id=_166;_167.style.display="none";document.body.appendChild(_167);}},configText:function(_168,_169,_16a){var _16b=_169[0];if(this._oText){this._oText.nodeValue=_16b;}},configHelpText:function(_16c,_16d,_16e){var me=this;var _170=_16d[0];var oEl=this.element;var _172=this.cfg;var _173=[oEl,this._oAnchor];var oImg=this.submenuIndicator;var _175=function(){Dom.addClass(_173,"hashelptext");if(_172.getProperty("disabled")){_172.refireEvent("disabled");}if(_172.getProperty("selected")){_172.refireEvent("selected");}};var _176=function(){Dom.removeClass(_173,"hashelptext");oEl.removeChild(me._oHelpTextEM);me._oHelpTextEM=null;};if(this._checkDOMNode(_170)){if(this._oHelpTextEM){this._oHelpTextEM.parentNode.replaceChild(_170,this._oHelpTextEM);}else{this._oHelpTextEM=_170;oEl.insertBefore(this._oHelpTextEM,oImg);}_175();}else{if(this._checkString(_170)){if(_170.length===0){_176();}else{if(!this._oHelpTextEM){this._oHelpTextEM=document.createElement("em");oEl.insertBefore(this._oHelpTextEM,oImg);}this._oHelpTextEM.innerHTML=_170;_175();}}else{if(!_170&&this._oHelpTextEM){_176();}}}},configURL:function(_177,_178,_179){var sURL=_178[0];if(!sURL){sURL="#";}this._oAnchor.setAttribute("href",sURL);},configTarget:function(_17b,_17c,_17d){var _17e=_17c[0];var _17f=this._oAnchor;if(_17e&&_17e.length>0){_17f.setAttribute("target",_17e);}else{_17f.removeAttribute("target");}},configEmphasis:function(_180,_181,_182){var _183=_181[0];var _184=this._oAnchor;var _185=this._oText;var _186=this.cfg;var oEM;if(_183&&_186.getProperty("strongemphasis")){_186.setProperty("strongemphasis",false);}if(_184){if(_183){oEM=document.createElement("em");oEM.appendChild(_185);_184.appendChild(oEM);}else{oEM=this._getFirstElement(_184,"EM");_184.removeChild(oEM);_184.appendChild(_185);}}},configStrongEmphasis:function(_188,_189,_18a){var _18b=_189[0];var _18c=this._oAnchor;var _18d=this._oText;var _18e=this.cfg;var _18f;if(_18b&&_18e.getProperty("emphasis")){_18e.setProperty("emphasis",false);}if(_18c){if(_18b){_18f=document.createElement("strong");_18f.appendChild(_18d);_18c.appendChild(_18f);}else{_18f=this._getFirstElement(_18c,"STRONG");_18c.removeChild(_18f);_18c.appendChild(_18d);}}},configChecked:function(_190,_191,_192){var _193=_191[0];var oEl=this.element;var _195=this.cfg;var oImg;if(_193){this._preloadImage(this.CHECKED_IMAGE_PATH);this._preloadImage(this.SELECTED_CHECKED_IMAGE_PATH);this._preloadImage(this.DISABLED_CHECKED_IMAGE_PATH);oImg=document.createElement("img");oImg.src=(this.imageRoot+this.CHECKED_IMAGE_PATH);oImg.alt=this.CHECKED_IMAGE_ALT_TEXT;var _197=this.cfg.getProperty("submenu");if(_197){oEl.insertBefore(oImg,_197.element);}else{oEl.appendChild(oImg);}Dom.addClass([oEl,oImg],"checked");this._checkImage=oImg;if(_195.getProperty("disabled")){_195.refireEvent("disabled");}if(_195.getProperty("selected")){_195.refireEvent("selected");}}else{oImg=this._checkImage;Dom.removeClass([oEl,oImg],"checked");if(oImg){oEl.removeChild(oImg);}this._checkImage=null;}},configDisabled:function(_198,_199,_19a){var _19b=_199[0];var _19c=this._oAnchor;var _19d=[this.element,_19c];var oEM=this._oHelpTextEM;var _19f=this.cfg;var oImg;var _1a1;var _1a2;if(oEM){_19d[2]=oEM;}if(this.cfg.getProperty("checked")){_1a2=this.CHECKED_IMAGE_ALT_TEXT;_1a1=this.CHECKED_IMAGE_PATH;oImg=this._checkImage;if(_19b){_1a2=this.DISABLED_CHECKED_IMAGE_ALT_TEXT;_1a1=this.DISABLED_CHECKED_IMAGE_PATH;}oImg.src=document.images[(this.imageRoot+_1a1)].src;oImg.alt=_1a2;}oImg=this.submenuIndicator;if(_19b){if(_19f.getProperty("selected")){_19f.setProperty("selected",false);}_19c.removeAttribute("href");Dom.addClass(_19d,"disabled");_1a1=this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH;_1a2=this.DISABLED_SUBMENU_INDICATOR_ALT_TEXT;}else{_19c.setAttribute("href",_19f.getProperty("url"));Dom.removeClass(_19d,"disabled");_1a1=this.SUBMENU_INDICATOR_IMAGE_PATH;_1a2=this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;}if(oImg){oImg.src=this.imageRoot+_1a1;oImg.alt=_1a2;}},configSelected:function(_1a3,_1a4,_1a5){if(!this.cfg.getProperty("disabled")){var _1a6=_1a4[0];var oEM=this._oHelpTextEM;var _1a8=[this.element,this._oAnchor];var oImg=this.submenuIndicator;var _1aa;if(oEM){_1a8[_1a8.length]=oEM;}if(oImg){_1a8[_1a8.length]=oImg;}if(this.cfg.getProperty("checked")){_1aa=this.imageRoot+(_1a6?this.SELECTED_CHECKED_IMAGE_PATH:this.CHECKED_IMAGE_PATH);this._checkImage.src=document.images[_1aa].src;}if(_1a6){Dom.addClass(_1a8,"selected");_1aa=this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH;}else{Dom.removeClass(_1a8,"selected");_1aa=this.SUBMENU_INDICATOR_IMAGE_PATH;}if(oImg){oImg.src=document.images[(this.imageRoot+_1aa)].src;}}},configSubmenu:function(_1ab,_1ac,_1ad){var oEl=this.element;var _1af=_1ac[0];var oImg=this.submenuIndicator;var _1b1=this.cfg;var _1b2=[this.element,this._oAnchor];var _1b3;var _1b4=this.parent&&this.parent.lazyLoad;if(_1af){if(_1af instanceof Menu){_1b3=_1af;_1b3.parent=this;_1b3.lazyLoad=_1b4;}else{if(typeof _1af=="object"&&_1af.id&&!_1af.nodeType){var _1b5=_1af.id;var _1b6=_1af;delete _1af["id"];_1b6.lazyload=_1b4;_1b6.parent=this;_1b3=new this.SUBMENU_TYPE(_1b5,_1b6);this.cfg.setProperty("submenu",_1b3,true);}else{_1b3=new this.SUBMENU_TYPE(_1af,{lazyload:_1b4,parent:this});this.cfg.setProperty("submenu",_1b3,true);}}if(_1b3){this._oSubmenu=_1b3;if(!oImg){this._preloadImage(this.SUBMENU_INDICATOR_IMAGE_PATH);this._preloadImage(this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH);this._preloadImage(this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH);oImg=document.createElement("img");oImg.src=(this.imageRoot+this.SUBMENU_INDICATOR_IMAGE_PATH);oImg.alt=this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;oEl.appendChild(oImg);this.submenuIndicator=oImg;Dom.addClass(_1b2,"hassubmenu");if(_1b1.getProperty("disabled")){_1b1.refireEvent("disabled");}if(_1b1.getProperty("selected")){_1b1.refireEvent("selected");}}}}else{Dom.removeClass(_1b2,"hassubmenu");if(oImg){oEl.removeChild(oImg);}if(this._oSubmenu){this._oSubmenu.destroy();}}},initDefaultConfig:function(){var _1b7=this.cfg;var _1b8=_1b7.checkBoolean;_1b7.addProperty("text",{value:"",handler:this.configText,validator:this._checkString,suppressEvent:true});_1b7.addProperty("helptext",{handler:this.configHelpText});_1b7.addProperty("url",{value:"#",handler:this.configURL,suppressEvent:true});_1b7.addProperty("target",{handler:this.configTarget,suppressEvent:true});_1b7.addProperty("emphasis",{value:false,handler:this.configEmphasis,validator:_1b8,suppressEvent:true});_1b7.addProperty("strongemphasis",{value:false,handler:this.configStrongEmphasis,validator:_1b8,suppressEvent:true});_1b7.addProperty("checked",{value:false,handler:this.configChecked,validator:this.cfg.checkBoolean,suppressEvent:true,supercedes:["disabled"]});_1b7.addProperty("disabled",{value:false,handler:this.configDisabled,validator:_1b8,suppressEvent:true});_1b7.addProperty("selected",{value:false,handler:this.configSelected,validator:_1b8,suppressEvent:true});_1b7.addProperty("submenu",{handler:this.configSubmenu});},getNextEnabledSibling:function(){if(this.parent instanceof Menu){var _1b9=this.groupIndex;var _1ba=function(_1bb,_1bc){return _1bb[_1bc]||_1ba(_1bb,(_1bc+1));};var _1bd=this.parent.getItemGroups();var _1be;if(this.index<(_1bd[_1b9].length-1)){_1be=_1ba(_1bd[_1b9],(this.index+1));}else{var _1bf;if(_1b9<(_1bd.length-1)){_1bf=_1b9+1;}else{_1bf=0;}var _1c0=_1ba(_1bd,_1bf);_1be=_1ba(_1c0,0);}return (_1be.cfg.getProperty("disabled")||_1be.element.style.display=="none")?_1be.getNextEnabledSibling():_1be;}},getPreviousEnabledSibling:function(){if(this.parent instanceof Menu){var _1c1=this.groupIndex;var _1c2=function(_1c3,_1c4){return _1c3[_1c4]||_1c2(_1c3,(_1c4-1));};var _1c5=function(_1c6,_1c7){return _1c6[_1c7]?_1c7:_1c5(_1c6,(_1c7+1));};var _1c8=this.parent.getItemGroups();var _1c9;if(this.index>_1c5(_1c8[_1c1],0)){_1c9=_1c2(_1c8[_1c1],(this.index-1));}else{var _1ca;if(_1c1>_1c5(_1c8,0)){_1ca=_1c1-1;}else{_1ca=_1c8.length-1;}var _1cb=_1c2(_1c8,_1ca);_1c9=_1c2(_1cb,(_1cb.length-1));}return (_1c9.cfg.getProperty("disabled")||_1c9.element.style.display=="none")?_1c9.getPreviousEnabledSibling():_1c9;}},focus:function(){var _1cc=this.parent;var _1cd=this._oAnchor;var _1ce=_1cc.activeItem;if(!this.cfg.getProperty("disabled")&&_1cc&&_1cc.cfg.getProperty("visible")&&this.element.style.display!="none"){if(_1ce){_1ce.blur();}try{_1cd.focus();}catch(e){}this.focusEvent.fire();}},blur:function(){var _1cf=this.parent;if(!this.cfg.getProperty("disabled")&&_1cf&&Dom.getStyle(_1cf.element,"visibility")=="visible"){this._oAnchor.blur();this.blurEvent.fire();}},destroy:function(){var oEl=this.element;if(oEl){this.mouseOverEvent.unsubscribeAll();this.mouseOutEvent.unsubscribeAll();this.mouseDownEvent.unsubscribeAll();this.mouseUpEvent.unsubscribeAll();this.clickEvent.unsubscribeAll();this.keyPressEvent.unsubscribeAll();this.keyDownEvent.unsubscribeAll();this.keyUpEvent.unsubscribeAll();this.focusEvent.unsubscribeAll();this.blurEvent.unsubscribeAll();this.cfg.configChangedEvent.unsubscribeAll();var _1d1=oEl.parentNode;if(_1d1){_1d1.removeChild(oEl);this.destroyEvent.fire();}this.destroyEvent.unsubscribeAll();}},toString:function(){return ("MenuItem: "+this.cfg.getProperty("text"));}};})();YAHOO.widget.MenuModuleItem=YAHOO.widget.MenuItem;YAHOO.widget.ContextMenu=function(_1d2,_1d3){YAHOO.widget.ContextMenu.superclass.constructor.call(this,_1d2,_1d3);};YAHOO.extend(YAHOO.widget.ContextMenu,YAHOO.widget.Menu,{_oTrigger:null,contextEventTarget:null,init:function(_1d4,_1d5){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.ContextMenuItem;}YAHOO.widget.ContextMenu.superclass.init.call(this,_1d4);this.beforeInitEvent.fire(YAHOO.widget.ContextMenu);if(_1d5){this.cfg.applyConfig(_1d5,true);}this.initEvent.fire(YAHOO.widget.ContextMenu);},_removeEventHandlers:function(){var _1d6=YAHOO.util.Event;var _1d7=this._oTrigger;var _1d8=(this.browser=="opera");_1d6.removeListener(_1d7,(_1d8?"mousedown":"contextmenu"),this._onTriggerContextMenu);if(_1d8){_1d6.removeListener(_1d7,"click",this._onTriggerClick);}},_onTriggerClick:function(_1d9,_1da){if(_1d9.ctrlKey){YAHOO.util.Event.stopEvent(_1d9);}},_onTriggerContextMenu:function(_1db,_1dc){YAHOO.widget.MenuManager.hideVisible();var _1dd=YAHOO.util.Event;var _1de=this.cfg;if(_1db.type=="mousedown"&&!_1db.ctrlKey){return;}this.contextEventTarget=_1dd.getTarget(_1db);var nX=_1dd.getPageX(_1db);var nY=_1dd.getPageY(_1db);_1de.applyConfig({xy:[nX,nY],visible:true});_1de.fireQueue();_1dd.stopEvent(_1db);},toString:function(){return ("ContextMenu "+this.id);},initDefaultConfig:function(){YAHOO.widget.ContextMenu.superclass.initDefaultConfig.call(this);this.cfg.addProperty("trigger",{handler:this.configTrigger});},destroy:function(){this._removeEventHandlers();YAHOO.widget.ContextMenu.superclass.destroy.call(this);},configTrigger:function(_1e1,_1e2,_1e3){var _1e4=YAHOO.util.Event;var _1e5=_1e2[0];if(_1e5){if(this._oTrigger){this._removeEventHandlers();}this._oTrigger=_1e5;var _1e6=(this.browser=="opera");_1e4.addListener(_1e5,(_1e6?"mousedown":"contextmenu"),this._onTriggerContextMenu,this,true);if(_1e6){_1e4.addListener(_1e5,"click",this._onTriggerClick,this,true);}}else{this._removeEventHandlers();}}});YAHOO.widget.ContextMenuItem=function(_1e7,_1e8){YAHOO.widget.ContextMenuItem.superclass.constructor.call(this,_1e7,_1e8);};YAHOO.extend(YAHOO.widget.ContextMenuItem,YAHOO.widget.MenuItem,{init:function(_1e9,_1ea){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.ContextMenu;}YAHOO.widget.ContextMenuItem.superclass.init.call(this,_1e9);var _1eb=this.cfg;if(_1ea){_1eb.applyConfig(_1ea,true);}_1eb.fireQueue();},toString:function(){return ("MenuBarItem: "+this.cfg.getProperty("text"));}});YAHOO.widget.MenuBar=function(_1ec,_1ed){YAHOO.widget.MenuBar.superclass.constructor.call(this,_1ec,_1ed);};YAHOO.extend(YAHOO.widget.MenuBar,YAHOO.widget.Menu,{init:function(_1ee,_1ef){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuBarItem;}YAHOO.widget.MenuBar.superclass.init.call(this,_1ee);this.beforeInitEvent.fire(YAHOO.widget.MenuBar);if(_1ef){this.cfg.applyConfig(_1ef,true);}this.initEvent.fire(YAHOO.widget.MenuBar);},CSS_CLASS_NAME:"yuimenubar",_onKeyDown:function(_1f0,_1f1,_1f2){var _1f3=YAHOO.util.Event;var _1f4=_1f1[0];var _1f5=_1f1[1];var _1f6=_1f5.cfg;var _1f7;switch(_1f4.keyCode){case 27:if(this.cfg.getProperty("position")=="dynamic"){this.hide();if(this.parent){this.parent.focus();}}else{if(this.activeItem){_1f7=this.activeItem.cfg.getProperty("submenu");if(_1f7&&_1f7.cfg.getProperty("visible")){_1f7.hide();this.activeItem.focus();}else{this.activeItem.cfg.setProperty("selected",false);this.activeItem.blur();}}}_1f3.preventDefault(_1f4);break;case 37:case 39:if(_1f5==this.activeItem&&!_1f6.getProperty("selected")){_1f6.setProperty("selected",true);}else{var _1f8=(_1f4.keyCode==37)?_1f5.getPreviousEnabledSibling():_1f5.getNextEnabledSibling();if(_1f8){this.clearActiveItem();_1f8.cfg.setProperty("selected",true);if(this.cfg.getProperty("autosubmenudisplay")){_1f7=_1f8.cfg.getProperty("submenu");if(_1f7){_1f7.show();_1f7.activeItem.blur();_1f7.activeItem=null;}}_1f8.focus();}}_1f3.preventDefault(_1f4);break;case 40:if(this.activeItem!=_1f5){this.clearActiveItem();_1f6.setProperty("selected",true);_1f5.focus();}_1f7=_1f6.getProperty("submenu");if(_1f7){if(_1f7.cfg.getProperty("visible")){_1f7.setInitialSelection();_1f7.setInitialFocus();}else{_1f7.show();}}_1f3.preventDefault(_1f4);break;}},_onClick:function(_1f9,_1fa,_1fb){YAHOO.widget.MenuBar.superclass._onClick.call(this,_1f9,_1fa,_1fb);var _1fc=_1fa[1];if(_1fc){var _1fd=YAHOO.util.Event;var Dom=YAHOO.util.Dom;var _1ff=_1fa[0];var _200=_1fd.getTarget(_1ff);var _201=this.activeItem;var _202=this.cfg;if(_201&&_201!=_1fc){this.clearActiveItem();}_1fc.cfg.setProperty("selected",true);_1fc.focus();var _203=_1fc.cfg.getProperty("submenu");if(_203&&_200!=_1fc.submenuIndicator){if(_203.cfg.getProperty("visible")){_203.hide();}else{_203.show();}}}},toString:function(){return ("MenuBar "+this.id);},initDefaultConfig:function(){YAHOO.widget.MenuBar.superclass.initDefaultConfig.call(this);var _204=this.cfg;_204.addProperty("position",{value:"static",handler:this.configPosition,validator:this._checkPosition,supercedes:["visible"]});_204.addProperty("submenualignment",{value:["tl","bl"]});_204.addProperty("autosubmenudisplay",{value:false,validator:_204.checkBoolean});}});YAHOO.widget.MenuBarItem=function(_205,_206){YAHOO.widget.MenuBarItem.superclass.constructor.call(this,_205,_206);};YAHOO.extend(YAHOO.widget.MenuBarItem,YAHOO.widget.MenuItem,{init:function(_207,_208){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.Menu;}YAHOO.widget.MenuBarItem.superclass.init.call(this,_207);var _209=this.cfg;if(_208){_209.applyConfig(_208,true);}_209.fireQueue();},CSS_CLASS_NAME:"yuimenubaritem",SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarodwn8_nrm_1.gif",SELECTED_SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarodwn8_hov_1.gif",DISABLED_SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarodwn8_dim_1.gif",toString:function(){return ("MenuBarItem: "+this.cfg.getProperty("text"));}});
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.com/yui/license.txt version: 0.12.1 */\r
+(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event;YAHOO.widget.MenuManager=function(){var m_bInitializedEventHandlers=false,m_oMenus={},m_oItems={},m_oVisibleMenus={},me=this;function addItem(p_oItem){var sYUIId=Dom.generateId();if(p_oItem&&m_oItems[sYUIId]!=p_oItem){p_oItem.element.setAttribute("yuiid",sYUIId);m_oItems[sYUIId]=p_oItem;p_oItem.destroyEvent.subscribe(onItemDestroy,p_oItem);}}\r
+function removeItem(p_oItem){var sYUIId=p_oItem.element.getAttribute("yuiid");if(sYUIId&&m_oItems[sYUIId]){delete m_oItems[sYUIId];}}\r
+function getMenuRootElement(p_oElement){var oParentNode;if(p_oElement&&p_oElement.tagName){switch(p_oElement.tagName.toUpperCase()){case"DIV":oParentNode=p_oElement.parentNode;if(Dom.hasClass(p_oElement,"bd")&&oParentNode&&oParentNode.tagName&&oParentNode.tagName.toUpperCase()=="DIV"){return oParentNode;}\r
+else{return p_oElement;}\r
+break;case"LI":return p_oElement;default:oParentNode=p_oElement.parentNode;if(oParentNode){return getMenuRootElement(oParentNode);}\r
+break;}}}\r
+function onDOMEvent(p_oEvent){var oTarget=Event.getTarget(p_oEvent),oElement=getMenuRootElement(oTarget),oMenuItem,oMenu;if(oElement){var sTagName=oElement.tagName.toUpperCase();if(sTagName=="LI"){var sYUIId=oElement.getAttribute("yuiid");if(sYUIId){oMenuItem=m_oItems[sYUIId];oMenu=oMenuItem.parent;}}\r
+else if(sTagName=="DIV"){if(oElement.id){oMenu=m_oMenus[oElement.id];}}}\r
+if(oMenu){var oEventTypes={"click":"clickEvent","mousedown":"mouseDownEvent","mouseup":"mouseUpEvent","mouseover":"mouseOverEvent","mouseout":"mouseOutEvent","keydown":"keyDownEvent","keyup":"keyUpEvent","keypress":"keyPressEvent"},sCustomEventType=oEventTypes[p_oEvent.type];if(oMenuItem&&!oMenuItem.cfg.getProperty("disabled")){oMenuItem[sCustomEventType].fire(p_oEvent);}\r
+oMenu[sCustomEventType].fire(p_oEvent,oMenuItem);}\r
+else if(p_oEvent.type=="mousedown"){var oActiveItem;for(var i in m_oMenus){if(m_oMenus.hasOwnProperty(i)){oMenu=m_oMenus[i];if(oMenu.cfg.getProperty("clicktohide")&&oMenu.cfg.getProperty("position")=="dynamic"){oMenu.hide();}\r
+else{oMenu.clearActiveItem(true);}}}}}\r
+function onMenuDestroy(p_sType,p_aArgs,p_oMenu){if(p_oMenu&&m_oMenus[p_oMenu.id]){delete m_oMenus[p_oMenu.id];}}\r
+function onItemDestroy(p_sType,p_aArgs,p_oItem){var sYUIId=p_oItem.element.getAttribute("yuiid");if(sYUIId){delete m_oItems[sYUIId];}}\r
+function onMenuVisibleConfigChange(p_sType,p_aArgs,p_oMenu){var bVisible=p_aArgs[0];if(bVisible){m_oVisibleMenus[p_oMenu.id]=p_oMenu;}\r
+else if(m_oVisibleMenus[p_oMenu.id]){delete m_oVisibleMenus[p_oMenu.id];}}\r
+function onItemAdded(p_sType,p_aArgs){addItem(p_aArgs[0]);}\r
+function onItemRemoved(p_sType,p_aArgs){removeItem(p_aArgs[0]);}\r
+return{addMenu:function(p_oMenu){if(p_oMenu&&p_oMenu.id&&!m_oMenus[p_oMenu.id]){m_oMenus[p_oMenu.id]=p_oMenu;if(!m_bInitializedEventHandlers){var oDoc=document;Event.addListener(oDoc,"mouseover",onDOMEvent,me,true);Event.addListener(oDoc,"mouseout",onDOMEvent,me,true);Event.addListener(oDoc,"mousedown",onDOMEvent,me,true);Event.addListener(oDoc,"mouseup",onDOMEvent,me,true);Event.addListener(oDoc,"click",onDOMEvent,me,true);Event.addListener(oDoc,"keydown",onDOMEvent,me,true);Event.addListener(oDoc,"keyup",onDOMEvent,me,true);Event.addListener(oDoc,"keypress",onDOMEvent,me,true);m_bInitializedEventHandlers=true;}\r
+p_oMenu.destroyEvent.subscribe(onMenuDestroy,p_oMenu,me);p_oMenu.cfg.subscribeToConfigEvent("visible",onMenuVisibleConfigChange,p_oMenu);p_oMenu.itemAddedEvent.subscribe(onItemAdded);p_oMenu.itemRemovedEvent.subscribe(onItemRemoved);}},removeMenu:function(p_oMenu){if(p_oMenu&&m_oMenus[p_oMenu.id]){delete m_oMenus[p_oMenu.id];}},hideVisible:function(){var oMenu;for(var i in m_oVisibleMenus){if(m_oVisibleMenus.hasOwnProperty(i)){oMenu=m_oVisibleMenus[i];if(oMenu.cfg.getProperty("position")=="dynamic"){oMenu.hide();}}}},getMenus:function(){return m_oMenus;},getMenu:function(p_sId){if(m_oMenus[p_sId]){return m_oMenus[p_sId];}},toString:function(){return("MenuManager");}};}();})();(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event;YAHOO.widget.Menu=function(p_oElement,p_oConfig){if(p_oConfig){this.parent=p_oConfig.parent;this.lazyLoad=p_oConfig.lazyLoad||p_oConfig.lazyload;this.itemData=p_oConfig.itemData||p_oConfig.itemdata;}\r
+YAHOO.widget.Menu.superclass.constructor.call(this,p_oElement,p_oConfig);};YAHOO.extend(YAHOO.widget.Menu,YAHOO.widget.Overlay,{CSS_CLASS_NAME:"yuimenu",ITEM_TYPE:null,GROUP_TITLE_TAG_NAME:"h6",_nHideDelayId:null,_nShowDelayId:null,_hideDelayEventHandlersAssigned:false,_bHandledMouseOverEvent:false,_bHandledMouseOutEvent:false,_aGroupTitleElements:null,_aItemGroups:null,_aListElements:null,lazyLoad:false,itemData:null,activeItem:null,parent:null,srcElement:null,mouseOverEvent:null,mouseOutEvent:null,mouseDownEvent:null,mouseUpEvent:null,clickEvent:null,keyPressEvent:null,keyDownEvent:null,keyUpEvent:null,itemAddedEvent:null,itemRemovedEvent:null,init:function(p_oElement,p_oConfig){this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuItem;}\r
+var oElement;if(typeof p_oElement=="string"){oElement=document.getElementById(p_oElement);}\r
+else if(p_oElement.tagName){oElement=p_oElement;}\r
+if(oElement&&oElement.tagName){switch(oElement.tagName.toUpperCase()){case"DIV":this.srcElement=oElement;if(!oElement.id){oElement.setAttribute("id",Dom.generateId());}\r
+YAHOO.widget.Menu.superclass.init.call(this,oElement);this.beforeInitEvent.fire(YAHOO.widget.Menu);break;case"SELECT":this.srcElement=oElement;YAHOO.widget.Menu.superclass.init.call(this,Dom.generateId());this.beforeInitEvent.fire(YAHOO.widget.Menu);break;}}\r
+else{YAHOO.widget.Menu.superclass.init.call(this,p_oElement);this.beforeInitEvent.fire(YAHOO.widget.Menu);}\r
+if(this.element){var oEl=this.element;Dom.addClass(oEl,this.CSS_CLASS_NAME);this.initEvent.subscribe(this._onInit,this,true);this.beforeRenderEvent.subscribe(this._onBeforeRender,this,true);this.renderEvent.subscribe(this._onRender,this,true);this.beforeShowEvent.subscribe(this._onBeforeShow,this,true);this.showEvent.subscribe(this._onShow,this,true);this.beforeHideEvent.subscribe(this._onBeforeHide,this,true);this.mouseOverEvent.subscribe(this._onMouseOver,this,true);this.mouseOutEvent.subscribe(this._onMouseOut,this,true);this.clickEvent.subscribe(this._onClick,this,true);this.keyDownEvent.subscribe(this._onKeyDown,this,true);YAHOO.widget.Module.textResizeEvent.subscribe(this._onTextResize,this,true);if(p_oConfig){this.cfg.applyConfig(p_oConfig,true);}\r
+YAHOO.widget.MenuManager.addMenu(this);this.initEvent.fire(YAHOO.widget.Menu);}},_initSubTree:function(){var oNode;if(this.srcElement.tagName=="DIV"){oNode=this.body.firstChild;var nGroup=0,sGroupTitleTagName=this.GROUP_TITLE_TAG_NAME.toUpperCase();do{if(oNode&&oNode.tagName){switch(oNode.tagName.toUpperCase()){case sGroupTitleTagName:this._aGroupTitleElements[nGroup]=oNode;break;case"UL":this._aListElements[nGroup]=oNode;this._aItemGroups[nGroup]=[];nGroup++;break;}}}\r
+while((oNode=oNode.nextSibling));if(this._aListElements[0]){Dom.addClass(this._aListElements[0],"first-of-type");}}\r
+oNode=null;if(this.srcElement.tagName){var sSrcElementTagName=this.srcElement.tagName.toUpperCase();switch(sSrcElementTagName){case"DIV":if(this._aListElements.length>0){var i=this._aListElements.length-1;do{oNode=this._aListElements[i].firstChild;do{if(oNode&&oNode.tagName&&oNode.tagName.toUpperCase()=="LI"){this.addItem(new this.ITEM_TYPE(oNode,{parent:this}),i);}}\r
+while((oNode=oNode.nextSibling));}\r
+while(i--);}\r
+break;case"SELECT":oNode=this.srcElement.firstChild;do{if(oNode&&oNode.tagName){switch(oNode.tagName.toUpperCase()){case"OPTGROUP":case"OPTION":this.addItem(new this.ITEM_TYPE(oNode,{parent:this}));break;}}}\r
+while((oNode=oNode.nextSibling));break;}}},_getFirstEnabledItem:function(){var nGroups=this._aItemGroups.length,oItem,aItemGroup;for(var i=0;i<nGroups;i++){aItemGroup=this._aItemGroups[i];if(aItemGroup){var nItems=aItemGroup.length;for(var n=0;n<nItems;n++){oItem=aItemGroup[n];if(!oItem.cfg.getProperty("disabled")&&oItem.element.style.display!="none"){return oItem;}\r
+oItem=null;}}}},_checkPosition:function(p_sPosition){if(typeof p_sPosition=="string"){var sPosition=p_sPosition.toLowerCase();return("dynamic,static".indexOf(sPosition)!=-1);}},_addItemToGroup:function(p_nGroupIndex,p_oItem,p_nItemIndex){var oItem;if(p_oItem instanceof this.ITEM_TYPE){oItem=p_oItem;oItem.parent=this;}\r
+else if(typeof p_oItem=="string"){oItem=new this.ITEM_TYPE(p_oItem,{parent:this});}\r
+else if(typeof p_oItem=="object"){p_oItem.parent=this;oItem=new this.ITEM_TYPE(p_oItem.text,p_oItem);}\r
+if(oItem){var nGroupIndex=typeof p_nGroupIndex=="number"?p_nGroupIndex:0,aGroup=this._getItemGroup(nGroupIndex),oGroupItem;if(!aGroup){aGroup=this._createItemGroup(nGroupIndex);}\r
+if(typeof p_nItemIndex=="number"){var bAppend=(p_nItemIndex>=aGroup.length);if(aGroup[p_nItemIndex]){aGroup.splice(p_nItemIndex,0,oItem);}\r
+else{aGroup[p_nItemIndex]=oItem;}\r
+oGroupItem=aGroup[p_nItemIndex];if(oGroupItem){if(bAppend&&(!oGroupItem.element.parentNode||oGroupItem.element.parentNode.nodeType==11)){this._aListElements[nGroupIndex].appendChild(oGroupItem.element);}\r
+else{function getNextItemSibling(p_aArray,p_nStartIndex){return(p_aArray[p_nStartIndex]||getNextItemSibling(p_aArray,(p_nStartIndex+1)));}\r
+var oNextItemSibling=getNextItemSibling(aGroup,(p_nItemIndex+1));if(oNextItemSibling&&(!oGroupItem.element.parentNode||oGroupItem.element.parentNode.nodeType==11)){this._aListElements[nGroupIndex].insertBefore(oGroupItem.element,oNextItemSibling.element);}}\r
+oGroupItem.parent=this;this._subscribeToItemEvents(oGroupItem);this._configureSubmenu(oGroupItem);this._updateItemProperties(nGroupIndex);this.itemAddedEvent.fire(oGroupItem);return oGroupItem;}}\r
+else{var nItemIndex=aGroup.length;aGroup[nItemIndex]=oItem;oGroupItem=aGroup[nItemIndex];if(oGroupItem){if(!Dom.isAncestor(this._aListElements[nGroupIndex],oGroupItem.element)){this._aListElements[nGroupIndex].appendChild(oGroupItem.element);}\r
+oGroupItem.element.setAttribute("groupindex",nGroupIndex);oGroupItem.element.setAttribute("index",nItemIndex);oGroupItem.parent=this;oGroupItem.index=nItemIndex;oGroupItem.groupIndex=nGroupIndex;this._subscribeToItemEvents(oGroupItem);this._configureSubmenu(oGroupItem);if(nItemIndex===0){Dom.addClass(oGroupItem.element,"first-of-type");}\r
+this.itemAddedEvent.fire(oGroupItem);return oGroupItem;}}}},_removeItemFromGroupByIndex:function(p_nGroupIndex,p_nItemIndex){var nGroupIndex=typeof p_nGroupIndex=="number"?p_nGroupIndex:0,aGroup=this._getItemGroup(nGroupIndex);if(aGroup){var aArray=aGroup.splice(p_nItemIndex,1),oItem=aArray[0];if(oItem){this._updateItemProperties(nGroupIndex);if(aGroup.length===0){var oUL=this._aListElements[nGroupIndex];if(this.body&&oUL){this.body.removeChild(oUL);}\r
+this._aItemGroups.splice(nGroupIndex,1);this._aListElements.splice(nGroupIndex,1);oUL=this._aListElements[0];if(oUL){Dom.addClass(oUL,"first-of-type");}}\r
+this.itemRemovedEvent.fire(oItem);return oItem;}}},_removeItemFromGroupByValue:function(p_nGroupIndex,p_oItem){var aGroup=this._getItemGroup(p_nGroupIndex);if(aGroup){var nItems=aGroup.length,nItemIndex=-1;if(nItems>0){var i=nItems-1;do{if(aGroup[i]==p_oItem){nItemIndex=i;break;}}\r
+while(i--);if(nItemIndex>-1){return this._removeItemFromGroupByIndex(p_nGroupIndex,nItemIndex);}}}},_updateItemProperties:function(p_nGroupIndex){var aGroup=this._getItemGroup(p_nGroupIndex),nItems=aGroup.length;if(nItems>0){var i=nItems-1,oItem,oLI;do{oItem=aGroup[i];if(oItem){oLI=oItem.element;oItem.index=i;oItem.groupIndex=p_nGroupIndex;oLI.setAttribute("groupindex",p_nGroupIndex);oLI.setAttribute("index",i);Dom.removeClass(oLI,"first-of-type");}}\r
+while(i--);if(oLI){Dom.addClass(oLI,"first-of-type");}}},_createItemGroup:function(p_nIndex){if(!this._aItemGroups[p_nIndex]){this._aItemGroups[p_nIndex]=[];var oUL=document.createElement("ul");this._aListElements[p_nIndex]=oUL;return this._aItemGroups[p_nIndex];}},_getItemGroup:function(p_nIndex){var nIndex=((typeof p_nIndex=="number")?p_nIndex:0);return this._aItemGroups[nIndex];},_configureSubmenu:function(p_oItem){var oSubmenu=p_oItem.cfg.getProperty("submenu");if(oSubmenu){this.cfg.configChangedEvent.subscribe(this._onParentMenuConfigChange,oSubmenu,true);this.renderEvent.subscribe(this._onParentMenuRender,oSubmenu,true);oSubmenu.beforeShowEvent.subscribe(this._onSubmenuBeforeShow,oSubmenu,true);oSubmenu.showEvent.subscribe(this._onSubmenuShow,oSubmenu,true);oSubmenu.hideEvent.subscribe(this._onSubmenuHide,oSubmenu,true);}},_subscribeToItemEvents:function(p_oItem){p_oItem.focusEvent.subscribe(this._onMenuItemFocus,p_oItem,this);p_oItem.blurEvent.subscribe(this._onMenuItemBlur,this,true);p_oItem.cfg.configChangedEvent.subscribe(this._onMenuItemConfigChange,p_oItem,this);},_getOffsetWidth:function(){var oClone=this.element.cloneNode(true);Dom.setStyle(oClone,"width","");document.body.appendChild(oClone);var sWidth=oClone.offsetWidth;document.body.removeChild(oClone);return sWidth;},_cancelHideDelay:function(){var oRoot=this.getRoot();if(oRoot._nHideDelayId){window.clearTimeout(oRoot._nHideDelayId);}},_execHideDelay:function(){this._cancelHideDelay();var oRoot=this.getRoot(),me=this;function hideMenu(){if(oRoot.activeItem){oRoot.clearActiveItem();}\r
+if(oRoot==me&&me.cfg.getProperty("position")=="dynamic"){me.hide();}}\r
+oRoot._nHideDelayId=window.setTimeout(hideMenu,oRoot.cfg.getProperty("hidedelay"));},_cancelShowDelay:function(){var oRoot=this.getRoot();if(oRoot._nShowDelayId){window.clearTimeout(oRoot._nShowDelayId);}},_execShowDelay:function(p_oMenu){var oRoot=this.getRoot();function showMenu(){p_oMenu.show();}\r
+oRoot._nShowDelayId=window.setTimeout(showMenu,oRoot.cfg.getProperty("showdelay"));},_onMouseOver:function(p_sType,p_aArgs,p_oMenu){var oEvent=p_aArgs[0],oItem=p_aArgs[1],oTarget=Event.getTarget(oEvent);if(!this._bHandledMouseOverEvent&&(oTarget==this.element||Dom.isAncestor(this.element,oTarget))){this.clearActiveItem();this._bHandledMouseOverEvent=true;this._bHandledMouseOutEvent=false;}\r
+if(oItem&&!oItem.handledMouseOverEvent&&!oItem.cfg.getProperty("disabled")&&(oTarget==oItem.element||Dom.isAncestor(oItem.element,oTarget))){var nShowDelay=this.cfg.getProperty("showdelay"),bShowDelay=(nShowDelay>0);if(bShowDelay){this._cancelShowDelay();}\r
+var oActiveItem=this.activeItem;if(oActiveItem){oActiveItem.cfg.setProperty("selected",false);var oActiveSubmenu=oActiveItem.cfg.getProperty("submenu");if(oActiveSubmenu){oActiveSubmenu.hide();}}\r
+var oItemCfg=oItem.cfg;oItemCfg.setProperty("selected",true);oItem.focus();if(this.cfg.getProperty("autosubmenudisplay")){var oSubmenu=oItemCfg.getProperty("submenu");if(oSubmenu){if(bShowDelay){this._execShowDelay(oSubmenu);}\r
+else{oSubmenu.show();}}}\r
+oItem.handledMouseOverEvent=true;oItem.handledMouseOutEvent=false;}},_onMouseOut:function(p_sType,p_aArgs,p_oMenu){var oEvent=p_aArgs[0],oItem=p_aArgs[1],oRelatedTarget=Event.getRelatedTarget(oEvent),bMovingToSubmenu=false;if(oItem&&!oItem.cfg.getProperty("disabled")){var oItemCfg=oItem.cfg,oSubmenu=oItemCfg.getProperty("submenu");if(oSubmenu&&(oRelatedTarget==oSubmenu.element||Dom.isAncestor(oSubmenu.element,oRelatedTarget))){bMovingToSubmenu=true;}\r
+if(!oItem.handledMouseOutEvent&&((oRelatedTarget!=oItem.element&&!Dom.isAncestor(oItem.element,oRelatedTarget))||bMovingToSubmenu)){if(!oSubmenu||(oSubmenu&&!oSubmenu.cfg.getProperty("visible"))){oItem.cfg.setProperty("selected",false);if(oSubmenu&&oSubmenu.cfg.getProperty("showdelay")&&!oSubmenu.cfg.getProperty("visible")){this._cancelShowDelay();}}\r
+oItem.handledMouseOutEvent=true;oItem.handledMouseOverEvent=false;}}\r
+if(!this._bHandledMouseOutEvent&&((oRelatedTarget!=this.element&&!Dom.isAncestor(this.element,oRelatedTarget))||bMovingToSubmenu)){this._bHandledMouseOutEvent=true;this._bHandledMouseOverEvent=false;}},_onClick:function(p_sType,p_aArgs,p_oMenu){var oEvent=p_aArgs[0],oItem=p_aArgs[1],oTarget=Event.getTarget(oEvent);if(oItem&&!oItem.cfg.getProperty("disabled")){var oItemCfg=oItem.cfg,oSubmenu=oItemCfg.getProperty("submenu");if(oTarget==oItem.submenuIndicator&&oSubmenu){if(oSubmenu.cfg.getProperty("visible")){oSubmenu.hide();}\r
+else{this.clearActiveItem();this.activeItem=oItem;oItem.cfg.setProperty("selected",true);oSubmenu.show();}}\r
+else{var sURL=oItemCfg.getProperty("url"),bCurrentPageURL=(sURL.substr((sURL.length-1),1)=="#"),sTarget=oItemCfg.getProperty("target"),bHasTarget=(sTarget&&sTarget.length>0);if(oTarget.tagName.toUpperCase()=="A"&&bCurrentPageURL&&!bHasTarget){Event.preventDefault(oEvent);}\r
+if(oTarget.tagName.toUpperCase()!="A"&&!bCurrentPageURL&&!bHasTarget){document.location=sURL;}\r
+if(bCurrentPageURL&&!oSubmenu){var oRoot=this.getRoot();if(oRoot.cfg.getProperty("position")=="static"){oRoot.clearActiveItem();}\r
+else{oRoot.hide();}}}}},_onKeyDown:function(p_sType,p_aArgs,p_oMenu){var oEvent=p_aArgs[0],oItem=p_aArgs[1],oSubmenu;if(oItem&&!oItem.cfg.getProperty("disabled")){var oItemCfg=oItem.cfg,oParentItem=this.parent,oRoot,oNextItem;switch(oEvent.keyCode){case 38:case 40:if(oItem==this.activeItem&&!oItemCfg.getProperty("selected")){oItemCfg.setProperty("selected",true);}\r
+else{oNextItem=(oEvent.keyCode==38)?oItem.getPreviousEnabledSibling():oItem.getNextEnabledSibling();if(oNextItem){this.clearActiveItem();oNextItem.cfg.setProperty("selected",true);oNextItem.focus();}}\r
+Event.preventDefault(oEvent);break;case 39:oSubmenu=oItemCfg.getProperty("submenu");if(oSubmenu){if(!oItemCfg.getProperty("selected")){oItemCfg.setProperty("selected",true);}\r
+oSubmenu.show();oSubmenu.setInitialSelection();}\r
+else{oRoot=this.getRoot();if(oRoot instanceof YAHOO.widget.MenuBar){oNextItem=oRoot.activeItem.getNextEnabledSibling();if(oNextItem){oRoot.clearActiveItem();oNextItem.cfg.setProperty("selected",true);oSubmenu=oNextItem.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.show();}\r
+oNextItem.focus();}}}\r
+Event.preventDefault(oEvent);break;case 37:if(oParentItem){var oParentMenu=oParentItem.parent;if(oParentMenu instanceof YAHOO.widget.MenuBar){oNextItem=oParentMenu.activeItem.getPreviousEnabledSibling();if(oNextItem){oParentMenu.clearActiveItem();oNextItem.cfg.setProperty("selected",true);oSubmenu=oNextItem.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.show();}\r
+oNextItem.focus();}}\r
+else{this.hide();oParentItem.focus();}}\r
+Event.preventDefault(oEvent);break;}}\r
+if(oEvent.keyCode==27){if(this.cfg.getProperty("position")=="dynamic"){this.hide();if(this.parent){this.parent.focus();}}\r
+else if(this.activeItem){oSubmenu=this.activeItem.cfg.getProperty("submenu");if(oSubmenu&&oSubmenu.cfg.getProperty("visible")){oSubmenu.hide();this.activeItem.focus();}\r
+else{this.activeItem.cfg.setProperty("selected",false);this.activeItem.blur();}}\r
+Event.preventDefault(oEvent);}},_onTextResize:function(p_sType,p_aArgs,p_oMenu){if(this.browser=="gecko"&&!this._handleResize){this._handleResize=true;return;}\r
+var oConfig=this.cfg;if(oConfig.getProperty("position")=="dynamic"){oConfig.setProperty("width",(this._getOffsetWidth()+"px"));}},_onInit:function(p_sType,p_aArgs,p_oMenu){if(((this.parent&&!this.lazyLoad)||(!this.parent&&this.cfg.getProperty("position")=="static")||(!this.parent&&!this.lazyLoad&&this.cfg.getProperty("position")=="dynamic"))&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree();}\r
+if(this.itemData){this.addItems(this.itemData);}}\r
+else if(this.lazyLoad){this.cfg.fireQueue();}},_onBeforeRender:function(p_sType,p_aArgs,p_oMenu){var oConfig=this.cfg,oEl=this.element,nListElements=this._aListElements.length;if(nListElements>0){var i=0,bFirstList=true,oUL,oGroupTitle;do{oUL=this._aListElements[i];if(oUL){if(bFirstList){Dom.addClass(oUL,"first-of-type");bFirstList=false;}\r
+if(!Dom.isAncestor(oEl,oUL)){this.appendToBody(oUL);}\r
+oGroupTitle=this._aGroupTitleElements[i];if(oGroupTitle){if(!Dom.isAncestor(oEl,oGroupTitle)){oUL.parentNode.insertBefore(oGroupTitle,oUL);}\r
+Dom.addClass(oUL,"hastitle");}}\r
+i++;}\r
+while(i<nListElements);}},_onRender:function(p_sType,p_aArgs,p_oMenu){if(this.cfg.getProperty("position")=="dynamic"){var sWidth=this.element.parentNode.tagName.toUpperCase()=="BODY"?this.element.offsetWidth:this._getOffsetWidth();this.cfg.setProperty("width",(sWidth+"px"));}},_onBeforeShow:function(p_sType,p_aArgs,p_oMenu){if(this.lazyLoad&&this.getItemGroups().length===0){if(this.srcElement){this._initSubTree();}\r
+if(this.itemData){if(this.parent&&this.parent.parent&&this.parent.parent.srcElement&&this.parent.parent.srcElement.tagName.toUpperCase()=="SELECT"){var nOptions=this.itemData.length;for(var n=0;n<nOptions;n++){if(this.itemData[n].tagName){this.addItem((new this.ITEM_TYPE(this.itemData[n])));}}}\r
+else{this.addItems(this.itemData);}}\r
+if(this.srcElement){this.render();}\r
+else{if(this.parent){this.render(this.parent.element);}\r
+else{this.render(this.cfg.getProperty("container"));}}}},_onShow:function(p_sType,p_aArgs,p_oMenu){this.setInitialFocus();var oParent=this.parent;if(oParent){var oParentMenu=oParent.parent,aParentAlignment=oParentMenu.cfg.getProperty("submenualignment"),aAlignment=this.cfg.getProperty("submenualignment");if((aParentAlignment[0]!=aAlignment[0])&&(aParentAlignment[1]!=aAlignment[1])){this.cfg.setProperty("submenualignment",[aParentAlignment[0],aParentAlignment[1]]);}\r
+if(!oParentMenu.cfg.getProperty("autosubmenudisplay")&&oParentMenu.cfg.getProperty("position")=="static"){oParentMenu.cfg.setProperty("autosubmenudisplay",true);function disableAutoSubmenuDisplay(p_oEvent){if(p_oEvent.type=="mousedown"||(p_oEvent.type=="keydown"&&p_oEvent.keyCode==27)){var oTarget=Event.getTarget(p_oEvent);if(oTarget!=oParentMenu.element||!YAHOO.util.Dom.isAncestor(oParentMenu.element,oTarget)){oParentMenu.cfg.setProperty("autosubmenudisplay",false);Event.removeListener(document,"mousedown",disableAutoSubmenuDisplay);Event.removeListener(document,"keydown",disableAutoSubmenuDisplay);}}}\r
+Event.addListener(document,"mousedown",disableAutoSubmenuDisplay);Event.addListener(document,"keydown",disableAutoSubmenuDisplay);}}},_onBeforeHide:function(p_sType,p_aArgs,p_oMenu){var oActiveItem=this.activeItem;if(oActiveItem){var oConfig=oActiveItem.cfg;oConfig.setProperty("selected",false);var oSubmenu=oConfig.getProperty("submenu");if(oSubmenu){oSubmenu.hide();}\r
+oActiveItem.blur();}},_onParentMenuConfigChange:function(p_sType,p_aArgs,p_oSubmenu){var sPropertyName=p_aArgs[0][0],oPropertyValue=p_aArgs[0][1];switch(sPropertyName){case"iframe":case"constraintoviewport":case"hidedelay":case"showdelay":case"clicktohide":case"effect":p_oSubmenu.cfg.setProperty(sPropertyName,oPropertyValue);break;}},_onParentMenuRender:function(p_sType,p_aArgs,p_oSubmenu){var oParentMenu=p_oSubmenu.parent.parent,oConfig={constraintoviewport:oParentMenu.cfg.getProperty("constraintoviewport"),xy:[0,0],clicktohide:oParentMenu.cfg.getProperty("clicktohide"),effect:oParentMenu.cfg.getProperty("effect"),showdelay:oParentMenu.cfg.getProperty("showdelay"),hidedelay:oParentMenu.cfg.getProperty("hidedelay")};if(this.cfg.getProperty("position")==oParentMenu.cfg.getProperty("position")){oConfig.iframe=oParentMenu.cfg.getProperty("iframe");}\r
+p_oSubmenu.cfg.applyConfig(oConfig);if(!this.lazyLoad){if(Dom.inDocument(this.element)){this.render();}\r
+else{this.render(this.parent.element);}}},_onSubmenuBeforeShow:function(p_sType,p_aArgs,p_oSubmenu){var oParent=this.parent,aAlignment=oParent.parent.cfg.getProperty("submenualignment");this.cfg.setProperty("context",[oParent.element,aAlignment[0],aAlignment[1]]);},_onSubmenuShow:function(p_sType,p_aArgs,p_oSubmenu){var oParent=this.parent;oParent.submenuIndicator.alt=oParent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;},_onSubmenuHide:function(p_sType,p_aArgs,p_oSubmenu){var oParent=this.parent;oParent.submenuIndicator.alt=oParent.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;},_onMenuItemFocus:function(p_sType,p_aArgs,p_oItem){this.activeItem=p_oItem;},_onMenuItemBlur:function(p_sType,p_aArgs){this.activeItem=null;},_onMenuItemConfigChange:function(p_sType,p_aArgs,p_oItem){var sProperty=p_aArgs[0][0];switch(sProperty){case"submenu":var oSubmenu=p_aArgs[0][1];if(oSubmenu){this._configureSubmenu(p_oItem);}\r
+break;case"text":case"helptext":if(this.element.style.width){var sWidth=this._getOffsetWidth()+"px";Dom.setStyle(this.element,"width",sWidth);}\r
+break;}},enforceConstraints:function(type,args,obj){var oConfig=this.cfg,pos=args[0],x=pos[0],y=pos[1],offsetHeight=this.element.offsetHeight,offsetWidth=this.element.offsetWidth,viewPortWidth=YAHOO.util.Dom.getViewportWidth(),viewPortHeight=YAHOO.util.Dom.getViewportHeight(),scrollX=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollY=Math.max(document.documentElement.scrollTop,document.body.scrollTop),topConstraint=scrollY+10,leftConstraint=scrollX+10,bottomConstraint=scrollY+viewPortHeight-offsetHeight-10,rightConstraint=scrollX+viewPortWidth-offsetWidth-10,aContext=oConfig.getProperty("context"),oContextElement=aContext?aContext[0]:null;if(x<10){x=leftConstraint;}else if((x+offsetWidth)>viewPortWidth){if(oContextElement&&((x-oContextElement.offsetWidth)>offsetWidth)){x=(x-(oContextElement.offsetWidth+offsetWidth));}\r
+else{x=rightConstraint;}}\r
+if(y<10){y=topConstraint;}else if(y>bottomConstraint){if(oContextElement&&(y>offsetHeight)){y=((y+oContextElement.offsetHeight)-offsetHeight);}\r
+else{y=bottomConstraint;}}\r
+oConfig.setProperty("x",x,true);oConfig.setProperty("y",y,true);oConfig.setProperty("xy",[x,y],true);},configVisible:function(p_sType,p_aArgs,p_oMenu){if(this.cfg.getProperty("position")=="dynamic"){YAHOO.widget.Menu.superclass.configVisible.call(this,p_sType,p_aArgs,p_oMenu);}\r
+else{var bVisible=p_aArgs[0],sDisplay=Dom.getStyle(this.element,"display");if(bVisible){if(sDisplay!="block"){this.beforeShowEvent.fire();Dom.setStyle(this.element,"display","block");this.showEvent.fire();}}\r
+else{if(sDisplay=="block"){this.beforeHideEvent.fire();Dom.setStyle(this.element,"display","none");this.hideEvent.fire();}}}},configPosition:function(p_sType,p_aArgs,p_oMenu){var sCSSPosition=p_aArgs[0]=="static"?"static":"absolute",oCfg=this.cfg;Dom.setStyle(this.element,"position",sCSSPosition);if(sCSSPosition=="static"){oCfg.setProperty("iframe",false);Dom.setStyle(this.element,"display","block");oCfg.setProperty("visible",true);}\r
+else{Dom.setStyle(this.element,"visibility","hidden");}\r
+if(sCSSPosition=="absolute"){var nZIndex=oCfg.getProperty("zindex");if(!nZIndex||nZIndex===0){nZIndex=this.parent?(this.parent.parent.cfg.getProperty("zindex")+1):1;oCfg.setProperty("zindex",nZIndex);}}},configIframe:function(p_sType,p_aArgs,p_oMenu){if(this.cfg.getProperty("position")=="dynamic"){YAHOO.widget.Menu.superclass.configIframe.call(this,p_sType,p_aArgs,p_oMenu);}},configHideDelay:function(p_sType,p_aArgs,p_oMenu){var nHideDelay=p_aArgs[0],oMouseOutEvent=this.mouseOutEvent,oMouseOverEvent=this.mouseOverEvent,oKeyDownEvent=this.keyDownEvent;if(nHideDelay>0){if(!this._hideDelayEventHandlersAssigned){oMouseOutEvent.subscribe(this._execHideDelay,true);oMouseOverEvent.subscribe(this._cancelHideDelay,this,true);oKeyDownEvent.subscribe(this._cancelHideDelay,this,true);this._hideDelayEventHandlersAssigned=true;}}\r
+else{oMouseOutEvent.unsubscribe(this._execHideDelay,this);oMouseOverEvent.unsubscribe(this._cancelHideDelay,this);oKeyDownEvent.unsubscribe(this._cancelHideDelay,this);this._hideDelayEventHandlersAssigned=false;}},configContainer:function(p_sType,p_aArgs,p_oMenu){var oElement=p_aArgs[0];if(typeof oElement=='string'){this.cfg.setProperty("container",document.getElementById(oElement),true);}},initEvents:function(){YAHOO.widget.Menu.superclass.initEvents.call(this);var CustomEvent=YAHOO.util.CustomEvent;this.mouseOverEvent=new CustomEvent("mouseOverEvent",this);this.mouseOutEvent=new CustomEvent("mouseOutEvent",this);this.mouseDownEvent=new CustomEvent("mouseDownEvent",this);this.mouseUpEvent=new CustomEvent("mouseUpEvent",this);this.clickEvent=new CustomEvent("clickEvent",this);this.keyPressEvent=new CustomEvent("keyPressEvent",this);this.keyDownEvent=new CustomEvent("keyDownEvent",this);this.keyUpEvent=new CustomEvent("keyUpEvent",this);this.itemAddedEvent=new CustomEvent("itemAddedEvent",this);this.itemRemovedEvent=new CustomEvent("itemRemovedEvent",this);},getRoot:function(){var oItem=this.parent;if(oItem){var oParentMenu=oItem.parent;return oParentMenu?oParentMenu.getRoot():this;}\r
+else{return this;}},toString:function(){return("Menu "+this.id);},setItemGroupTitle:function(p_sGroupTitle,p_nGroupIndex){if(typeof p_sGroupTitle=="string"&&p_sGroupTitle.length>0){var nGroupIndex=typeof p_nGroupIndex=="number"?p_nGroupIndex:0,oTitle=this._aGroupTitleElements[nGroupIndex];if(oTitle){oTitle.innerHTML=p_sGroupTitle;}\r
+else{oTitle=document.createElement(this.GROUP_TITLE_TAG_NAME);oTitle.innerHTML=p_sGroupTitle;this._aGroupTitleElements[nGroupIndex]=oTitle;}\r
+var i=this._aGroupTitleElements.length-1,nFirstIndex;do{if(this._aGroupTitleElements[i]){Dom.removeClass(this._aGroupTitleElements[i],"first-of-type");nFirstIndex=i;}}\r
+while(i--);if(nFirstIndex!==null){Dom.addClass(this._aGroupTitleElements[nFirstIndex],"first-of-type");}}},addItem:function(p_oItem,p_nGroupIndex){if(p_oItem){return this._addItemToGroup(p_nGroupIndex,p_oItem);}},addItems:function(p_aItems,p_nGroupIndex){function isArray(p_oValue){return(typeof p_oValue=="object"&&p_oValue.constructor==Array);}\r
+if(isArray(p_aItems)){var nItems=p_aItems.length,aItems=[],oItem;for(var i=0;i<nItems;i++){oItem=p_aItems[i];if(isArray(oItem)){aItems[aItems.length]=this.addItems(oItem,i);}\r
+else{aItems[aItems.length]=this._addItemToGroup(p_nGroupIndex,oItem);}}\r
+if(aItems.length){return aItems;}}},insertItem:function(p_oItem,p_nItemIndex,p_nGroupIndex){if(p_oItem){return this._addItemToGroup(p_nGroupIndex,p_oItem,p_nItemIndex);}},removeItem:function(p_oObject,p_nGroupIndex){if(typeof p_oObject!="undefined"){var oItem;if(p_oObject instanceof YAHOO.widget.MenuItem){oItem=this._removeItemFromGroupByValue(p_nGroupIndex,p_oObject);}\r
+else if(typeof p_oObject=="number"){oItem=this._removeItemFromGroupByIndex(p_nGroupIndex,p_oObject);}\r
+if(oItem){oItem.destroy();return oItem;}}},getItemGroups:function(){return this._aItemGroups;},getItem:function(p_nItemIndex,p_nGroupIndex){if(typeof p_nItemIndex=="number"){var aGroup=this._getItemGroup(p_nGroupIndex);if(aGroup){return aGroup[p_nItemIndex];}}},destroy:function(){this.mouseOverEvent.unsubscribeAll();this.mouseOutEvent.unsubscribeAll();this.mouseDownEvent.unsubscribeAll();this.mouseUpEvent.unsubscribeAll();this.clickEvent.unsubscribeAll();this.keyPressEvent.unsubscribeAll();this.keyDownEvent.unsubscribeAll();this.keyUpEvent.unsubscribeAll();this.itemAddedEvent.unsubscribeAll();this.itemRemovedEvent.unsubscribeAll();var nItemGroups=this._aItemGroups.length,nItems,oItemGroup,oItem,i,n;if(nItemGroups>0){i=nItemGroups-1;do{oItemGroup=this._aItemGroups[i];if(oItemGroup){nItems=oItemGroup.length;if(nItems>0){n=nItems-1;do{oItem=this._aItemGroups[i][n];if(oItem){oItem.destroy();}}\r
+while(n--);}}}\r
+while(i--);}\r
+YAHOO.widget.Menu.superclass.destroy.call(this);},setInitialFocus:function(){var oItem=this._getFirstEnabledItem();if(oItem){oItem.focus();}},setInitialSelection:function(){var oItem=this._getFirstEnabledItem();if(oItem){oItem.cfg.setProperty("selected",true);}},clearActiveItem:function(p_bBlur){if(this.cfg.getProperty("showdelay")>0){this._cancelShowDelay();}\r
+var oActiveItem=this.activeItem;if(oActiveItem){var oConfig=oActiveItem.cfg;oConfig.setProperty("selected",false);var oSubmenu=oConfig.getProperty("submenu");if(oSubmenu){oSubmenu.hide();}\r
+if(p_bBlur){oActiveItem.blur();}}},initDefaultConfig:function(){YAHOO.widget.Menu.superclass.initDefaultConfig.call(this);var oConfig=this.cfg;oConfig.addProperty("visible",{value:false,handler:this.configVisible,validator:this.cfg.checkBoolean});oConfig.addProperty("constraintoviewport",{value:true,handler:this.configConstrainToViewport,validator:this.cfg.checkBoolean,supercedes:["iframe","x","y","xy"]});oConfig.addProperty("position",{value:"dynamic",handler:this.configPosition,validator:this._checkPosition,supercedes:["visible"]});oConfig.addProperty("submenualignment",{value:["tl","tr"]});oConfig.addProperty("autosubmenudisplay",{value:true,validator:oConfig.checkBoolean});oConfig.addProperty("showdelay",{value:0,validator:oConfig.checkNumber});oConfig.addProperty("hidedelay",{value:0,validator:oConfig.checkNumber,handler:this.configHideDelay,suppressEvent:true});oConfig.addProperty("clicktohide",{value:true,validator:oConfig.checkBoolean});this.cfg.addProperty("container",{value:document.body,handler:this.configContainer});}});})();YAHOO.widget.MenuModule=YAHOO.widget.Menu;(function(){var Dom=YAHOO.util.Dom,Module=YAHOO.widget.Module,Menu=YAHOO.widget.Menu;YAHOO.widget.MenuItem=function(p_oObject,p_oConfig){if(p_oObject){if(p_oConfig){this.parent=p_oConfig.parent;this.value=p_oConfig.value;}\r
+this.init(p_oObject,p_oConfig);}};YAHOO.widget.MenuItem.prototype={SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarorght8_nrm_1.gif",SELECTED_SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarorght8_hov_1.gif",DISABLED_SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarorght8_dim_1.gif",COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT:"Collapsed. Click to expand.",EXPANDED_SUBMENU_INDICATOR_ALT_TEXT:"Expanded. Click to collapse.",DISABLED_SUBMENU_INDICATOR_ALT_TEXT:"Disabled.",CHECKED_IMAGE_PATH:"nt/ic/ut/bsc/menuchk8_nrm_1.gif",SELECTED_CHECKED_IMAGE_PATH:"nt/ic/ut/bsc/menuchk8_hov_1.gif",DISABLED_CHECKED_IMAGE_PATH:"nt/ic/ut/bsc/menuchk8_dim_1.gif",CHECKED_IMAGE_ALT_TEXT:"Checked.",DISABLED_CHECKED_IMAGE_ALT_TEXT:"Checked. (Item disabled.)",CSS_CLASS_NAME:"yuimenuitem",SUBMENU_TYPE:null,IMG_ROOT:"http://us.i1.yimg.com/us.yimg.com/i/",IMG_ROOT_SSL:"https://a248.e.akamai.net/sec.yimg.com/i/",_oAnchor:null,_oText:null,_oHelpTextEM:null,_oSubmenu:null,_checkImage:null,constructor:YAHOO.widget.MenuItem,imageRoot:null,isSecure:Module.prototype.isSecure,index:null,groupIndex:null,parent:null,element:null,srcElement:null,value:null,submenuIndicator:null,browser:Module.prototype.browser,destroyEvent:null,mouseOverEvent:null,mouseOutEvent:null,mouseDownEvent:null,mouseUpEvent:null,clickEvent:null,keyPressEvent:null,keyDownEvent:null,keyUpEvent:null,focusEvent:null,blurEvent:null,init:function(p_oObject,p_oConfig){this.imageRoot=(this.isSecure)?this.IMG_ROOT_SSL:this.IMG_ROOT;if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=Menu;}\r
+this.cfg=new YAHOO.util.Config(this);this.initDefaultConfig();var oConfig=this.cfg;if(this._checkString(p_oObject)){this._createRootNodeStructure();oConfig.setProperty("text",p_oObject);}\r
+else if(this._checkDOMNode(p_oObject)){switch(p_oObject.tagName.toUpperCase()){case"OPTION":this._createRootNodeStructure();oConfig.setProperty("text",p_oObject.text);this.srcElement=p_oObject;break;case"OPTGROUP":this._createRootNodeStructure();oConfig.setProperty("text",p_oObject.label);this.srcElement=p_oObject;this._initSubTree();break;case"LI":var oAnchor=this._getFirstElement(p_oObject,"A"),sURL="#",sTarget,sText;if(oAnchor){sURL=oAnchor.getAttribute("href");sTarget=oAnchor.getAttribute("target");if(oAnchor.innerText){sText=oAnchor.innerText;}\r
+else{var oRange=oAnchor.ownerDocument.createRange();oRange.selectNodeContents(oAnchor);sText=oRange.toString();}}\r
+else{var oText=p_oObject.firstChild;sText=oText.nodeValue;oAnchor=document.createElement("a");oAnchor.setAttribute("href",sURL);p_oObject.replaceChild(oAnchor,oText);oAnchor.appendChild(oText);}\r
+this.srcElement=p_oObject;this.element=p_oObject;this._oAnchor=oAnchor;var oEmphasisNode=this._getFirstElement(oAnchor),bEmphasis=false,bStrongEmphasis=false;if(oEmphasisNode){this._oText=oEmphasisNode.firstChild;switch(oEmphasisNode.tagName.toUpperCase()){case"EM":bEmphasis=true;break;case"STRONG":bStrongEmphasis=true;break;}}\r
+else{this._oText=oAnchor.firstChild;}\r
+oConfig.setProperty("text",sText,true);oConfig.setProperty("url",sURL,true);oConfig.setProperty("target",sTarget,true);oConfig.setProperty("emphasis",bEmphasis,true);oConfig.setProperty("strongemphasis",bStrongEmphasis,true);this._initSubTree();break;}}\r
+if(this.element){Dom.addClass(this.element,this.CSS_CLASS_NAME);var CustomEvent=YAHOO.util.CustomEvent;this.destroyEvent=new CustomEvent("destroyEvent",this);this.mouseOverEvent=new CustomEvent("mouseOverEvent",this);this.mouseOutEvent=new CustomEvent("mouseOutEvent",this);this.mouseDownEvent=new CustomEvent("mouseDownEvent",this);this.mouseUpEvent=new CustomEvent("mouseUpEvent",this);this.clickEvent=new CustomEvent("clickEvent",this);this.keyPressEvent=new CustomEvent("keyPressEvent",this);this.keyDownEvent=new CustomEvent("keyDownEvent",this);this.keyUpEvent=new CustomEvent("keyUpEvent",this);this.focusEvent=new CustomEvent("focusEvent",this);this.blurEvent=new CustomEvent("blurEvent",this);if(p_oConfig){oConfig.applyConfig(p_oConfig);}\r
+oConfig.fireQueue();}},_getFirstElement:function(p_oElement,p_sTagName){var oElement;if(p_oElement.firstChild&&p_oElement.firstChild.nodeType==1){oElement=p_oElement.firstChild;}\r
+else if(p_oElement.firstChild&&p_oElement.firstChild.nextSibling&&p_oElement.firstChild.nextSibling.nodeType==1){oElement=p_oElement.firstChild.nextSibling;}\r
+if(p_sTagName){return(oElement&&oElement.tagName.toUpperCase()==p_sTagName)?oElement:false;}\r
+return oElement;},_checkString:function(p_oObject){return(typeof p_oObject=="string");},_checkDOMNode:function(p_oObject){return(p_oObject&&p_oObject.tagName);},_createRootNodeStructure:function(){this.element=document.createElement("li");this._oText=document.createTextNode("");this._oAnchor=document.createElement("a");this._oAnchor.appendChild(this._oText);this.cfg.refireEvent("url");this.element.appendChild(this._oAnchor);},_initSubTree:function(){var oSrcEl=this.srcElement,oConfig=this.cfg;if(oSrcEl.childNodes.length>0){if(this.parent.lazyLoad&&this.parent.srcElement&&this.parent.srcElement.tagName.toUpperCase()=="SELECT"){oConfig.setProperty("submenu",{id:Dom.generateId(),itemdata:oSrcEl.childNodes});}\r
+else{var oNode=oSrcEl.firstChild,aOptions=[];do{if(oNode&&oNode.tagName){switch(oNode.tagName.toUpperCase()){case"DIV":oConfig.setProperty("submenu",oNode);break;case"OPTION":aOptions[aOptions.length]=oNode;break;}}}\r
+while((oNode=oNode.nextSibling));var nOptions=aOptions.length;if(nOptions>0){var oMenu=new this.SUBMENU_TYPE(Dom.generateId());oConfig.setProperty("submenu",oMenu);for(var n=0;n<nOptions;n++){oMenu.addItem((new oMenu.ITEM_TYPE(aOptions[n])));}}}}},_preloadImage:function(p_sPath){var sPath=this.imageRoot+p_sPath;if(!document.images[sPath]){var oImage=document.createElement("img");oImage.src=sPath;oImage.name=sPath;oImage.id=sPath;oImage.style.display="none";document.body.appendChild(oImage);}},configText:function(p_sType,p_aArgs,p_oItem){var sText=p_aArgs[0];if(this._oText){this._oText.nodeValue=sText;}},configHelpText:function(p_sType,p_aArgs,p_oItem){var me=this,oHelpText=p_aArgs[0],oEl=this.element,oConfig=this.cfg,aNodes=[oEl,this._oAnchor],oImg=this.submenuIndicator;function initHelpText(){Dom.addClass(aNodes,"hashelptext");if(oConfig.getProperty("disabled")){oConfig.refireEvent("disabled");}\r
+if(oConfig.getProperty("selected")){oConfig.refireEvent("selected");}}\r
+function removeHelpText(){Dom.removeClass(aNodes,"hashelptext");oEl.removeChild(me._oHelpTextEM);me._oHelpTextEM=null;}\r
+if(this._checkDOMNode(oHelpText)){if(this._oHelpTextEM){this._oHelpTextEM.parentNode.replaceChild(oHelpText,this._oHelpTextEM);}\r
+else{this._oHelpTextEM=oHelpText;oEl.insertBefore(this._oHelpTextEM,oImg);}\r
+initHelpText();}\r
+else if(this._checkString(oHelpText)){if(oHelpText.length===0){removeHelpText();}\r
+else{if(!this._oHelpTextEM){this._oHelpTextEM=document.createElement("em");oEl.insertBefore(this._oHelpTextEM,oImg);}\r
+this._oHelpTextEM.innerHTML=oHelpText;initHelpText();}}\r
+else if(!oHelpText&&this._oHelpTextEM){removeHelpText();}},configURL:function(p_sType,p_aArgs,p_oItem){var sURL=p_aArgs[0];if(!sURL){sURL="#";}\r
+this._oAnchor.setAttribute("href",sURL);},configTarget:function(p_sType,p_aArgs,p_oItem){var sTarget=p_aArgs[0],oAnchor=this._oAnchor;if(sTarget&&sTarget.length>0){oAnchor.setAttribute("target",sTarget);}\r
+else{oAnchor.removeAttribute("target");}},configEmphasis:function(p_sType,p_aArgs,p_oItem){var bEmphasis=p_aArgs[0],oAnchor=this._oAnchor,oText=this._oText,oConfig=this.cfg,oEM;if(bEmphasis&&oConfig.getProperty("strongemphasis")){oConfig.setProperty("strongemphasis",false);}\r
+if(oAnchor){if(bEmphasis){oEM=document.createElement("em");oEM.appendChild(oText);oAnchor.appendChild(oEM);}\r
+else{oEM=this._getFirstElement(oAnchor,"EM");if(oEM){oAnchor.removeChild(oEM);oAnchor.appendChild(oText);}}}},configStrongEmphasis:function(p_sType,p_aArgs,p_oItem){var bStrongEmphasis=p_aArgs[0],oAnchor=this._oAnchor,oText=this._oText,oConfig=this.cfg,oStrong;if(bStrongEmphasis&&oConfig.getProperty("emphasis")){oConfig.setProperty("emphasis",false);}\r
+if(oAnchor){if(bStrongEmphasis){oStrong=document.createElement("strong");oStrong.appendChild(oText);oAnchor.appendChild(oStrong);}\r
+else{oStrong=this._getFirstElement(oAnchor,"STRONG");if(oStrong){oAnchor.removeChild(oStrong);oAnchor.appendChild(oText);}}}},configChecked:function(p_sType,p_aArgs,p_oItem){var bChecked=p_aArgs[0],oEl=this.element,oConfig=this.cfg,oImg;if(bChecked){this._preloadImage(this.CHECKED_IMAGE_PATH);this._preloadImage(this.SELECTED_CHECKED_IMAGE_PATH);this._preloadImage(this.DISABLED_CHECKED_IMAGE_PATH);oImg=document.createElement("img");oImg.src=(this.imageRoot+this.CHECKED_IMAGE_PATH);oImg.alt=this.CHECKED_IMAGE_ALT_TEXT;var oSubmenu=this.cfg.getProperty("submenu");if(oSubmenu){oEl.insertBefore(oImg,oSubmenu.element);}\r
+else{oEl.appendChild(oImg);}\r
+Dom.addClass([oEl,oImg],"checked");this._checkImage=oImg;if(oConfig.getProperty("disabled")){oConfig.refireEvent("disabled");}\r
+if(oConfig.getProperty("selected")){oConfig.refireEvent("selected");}}\r
+else{oImg=this._checkImage;Dom.removeClass([oEl,oImg],"checked");if(oImg){oEl.removeChild(oImg);}\r
+this._checkImage=null;}},configDisabled:function(p_sType,p_aArgs,p_oItem){var bDisabled=p_aArgs[0],oAnchor=this._oAnchor,aNodes=[this.element,oAnchor],oEM=this._oHelpTextEM,oConfig=this.cfg,oImg,sImgSrc,sImgAlt;if(oEM){aNodes[2]=oEM;}\r
+if(this.cfg.getProperty("checked")){sImgAlt=this.CHECKED_IMAGE_ALT_TEXT;sImgSrc=this.CHECKED_IMAGE_PATH;oImg=this._checkImage;if(bDisabled){sImgAlt=this.DISABLED_CHECKED_IMAGE_ALT_TEXT;sImgSrc=this.DISABLED_CHECKED_IMAGE_PATH;}\r
+oImg.src=document.images[(this.imageRoot+sImgSrc)].src;oImg.alt=sImgAlt;}\r
+oImg=this.submenuIndicator;if(bDisabled){if(oConfig.getProperty("selected")){oConfig.setProperty("selected",false);}\r
+oAnchor.removeAttribute("href");Dom.addClass(aNodes,"disabled");sImgSrc=this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH;sImgAlt=this.DISABLED_SUBMENU_INDICATOR_ALT_TEXT;}\r
+else{oAnchor.setAttribute("href",oConfig.getProperty("url"));Dom.removeClass(aNodes,"disabled");sImgSrc=this.SUBMENU_INDICATOR_IMAGE_PATH;sImgAlt=this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;}\r
+if(oImg){oImg.src=this.imageRoot+sImgSrc;oImg.alt=sImgAlt;}},configSelected:function(p_sType,p_aArgs,p_oItem){if(!this.cfg.getProperty("disabled")){var bSelected=p_aArgs[0],oEM=this._oHelpTextEM,aNodes=[this.element,this._oAnchor],oImg=this.submenuIndicator,sImgSrc;if(oEM){aNodes[aNodes.length]=oEM;}\r
+if(oImg){aNodes[aNodes.length]=oImg;}\r
+if(this.cfg.getProperty("checked")){sImgSrc=this.imageRoot+(bSelected?this.SELECTED_CHECKED_IMAGE_PATH:this.CHECKED_IMAGE_PATH);this._checkImage.src=document.images[sImgSrc].src;}\r
+if(bSelected){Dom.addClass(aNodes,"selected");sImgSrc=this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH;}\r
+else{Dom.removeClass(aNodes,"selected");sImgSrc=this.SUBMENU_INDICATOR_IMAGE_PATH;}\r
+if(oImg){oImg.src=document.images[(this.imageRoot+sImgSrc)].src;}}},configSubmenu:function(p_sType,p_aArgs,p_oItem){var oEl=this.element,oSubmenu=p_aArgs[0],oImg=this.submenuIndicator,oConfig=this.cfg,aNodes=[this.element,this._oAnchor],oMenu,bLazyLoad=this.parent&&this.parent.lazyLoad;if(oSubmenu){if(oSubmenu instanceof Menu){oMenu=oSubmenu;oMenu.parent=this;oMenu.lazyLoad=bLazyLoad;}\r
+else if(typeof oSubmenu=="object"&&oSubmenu.id&&!oSubmenu.nodeType){var sSubmenuId=oSubmenu.id,oSubmenuConfig=oSubmenu;oSubmenuConfig.lazyload=bLazyLoad;oSubmenuConfig.parent=this;oMenu=new this.SUBMENU_TYPE(sSubmenuId,oSubmenuConfig);this.cfg.setProperty("submenu",oMenu,true);}\r
+else{oMenu=new this.SUBMENU_TYPE(oSubmenu,{lazyload:bLazyLoad,parent:this});this.cfg.setProperty("submenu",oMenu,true);}\r
+if(oMenu){this._oSubmenu=oMenu;if(!oImg){this._preloadImage(this.SUBMENU_INDICATOR_IMAGE_PATH);this._preloadImage(this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH);this._preloadImage(this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH);oImg=document.createElement("img");oImg.src=(this.imageRoot+this.SUBMENU_INDICATOR_IMAGE_PATH);oImg.alt=this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;oEl.appendChild(oImg);this.submenuIndicator=oImg;Dom.addClass(aNodes,"hassubmenu");if(oConfig.getProperty("disabled")){oConfig.refireEvent("disabled");}\r
+if(oConfig.getProperty("selected")){oConfig.refireEvent("selected");}}}}\r
+else{Dom.removeClass(aNodes,"hassubmenu");if(oImg){oEl.removeChild(oImg);}\r
+if(this._oSubmenu){this._oSubmenu.destroy();}}},initDefaultConfig:function(){var oConfig=this.cfg,CheckBoolean=oConfig.checkBoolean;oConfig.addProperty("text",{value:"",handler:this.configText,validator:this._checkString,suppressEvent:true});oConfig.addProperty("helptext",{handler:this.configHelpText});oConfig.addProperty("url",{value:"#",handler:this.configURL,suppressEvent:true});oConfig.addProperty("target",{handler:this.configTarget,suppressEvent:true});oConfig.addProperty("emphasis",{value:false,handler:this.configEmphasis,validator:CheckBoolean,suppressEvent:true});oConfig.addProperty("strongemphasis",{value:false,handler:this.configStrongEmphasis,validator:CheckBoolean,suppressEvent:true});oConfig.addProperty("checked",{value:false,handler:this.configChecked,validator:this.cfg.checkBoolean,suppressEvent:true,supercedes:["disabled"]});oConfig.addProperty("disabled",{value:false,handler:this.configDisabled,validator:CheckBoolean,suppressEvent:true});oConfig.addProperty("selected",{value:false,handler:this.configSelected,validator:CheckBoolean,suppressEvent:true});oConfig.addProperty("submenu",{handler:this.configSubmenu});},getNextEnabledSibling:function(){if(this.parent instanceof Menu){var nGroupIndex=this.groupIndex;function getNextArrayItem(p_aArray,p_nStartIndex){return p_aArray[p_nStartIndex]||getNextArrayItem(p_aArray,(p_nStartIndex+1));}\r
+var aItemGroups=this.parent.getItemGroups(),oNextItem;if(this.index<(aItemGroups[nGroupIndex].length-1)){oNextItem=getNextArrayItem(aItemGroups[nGroupIndex],(this.index+1));}\r
+else{var nNextGroupIndex;if(nGroupIndex<(aItemGroups.length-1)){nNextGroupIndex=nGroupIndex+1;}\r
+else{nNextGroupIndex=0;}\r
+var aNextGroup=getNextArrayItem(aItemGroups,nNextGroupIndex);oNextItem=getNextArrayItem(aNextGroup,0);}\r
+return(oNextItem.cfg.getProperty("disabled")||oNextItem.element.style.display=="none")?oNextItem.getNextEnabledSibling():oNextItem;}},getPreviousEnabledSibling:function(){if(this.parent instanceof Menu){var nGroupIndex=this.groupIndex;function getPreviousArrayItem(p_aArray,p_nStartIndex){return p_aArray[p_nStartIndex]||getPreviousArrayItem(p_aArray,(p_nStartIndex-1));}\r
+function getFirstItemIndex(p_aArray,p_nStartIndex){return p_aArray[p_nStartIndex]?p_nStartIndex:getFirstItemIndex(p_aArray,(p_nStartIndex+1));}\r
+var aItemGroups=this.parent.getItemGroups(),oPreviousItem;if(this.index>getFirstItemIndex(aItemGroups[nGroupIndex],0)){oPreviousItem=getPreviousArrayItem(aItemGroups[nGroupIndex],(this.index-1));}\r
+else{var nPreviousGroupIndex;if(nGroupIndex>getFirstItemIndex(aItemGroups,0)){nPreviousGroupIndex=nGroupIndex-1;}\r
+else{nPreviousGroupIndex=aItemGroups.length-1;}\r
+var aPreviousGroup=getPreviousArrayItem(aItemGroups,nPreviousGroupIndex);oPreviousItem=getPreviousArrayItem(aPreviousGroup,(aPreviousGroup.length-1));}\r
+return(oPreviousItem.cfg.getProperty("disabled")||oPreviousItem.element.style.display=="none")?oPreviousItem.getPreviousEnabledSibling():oPreviousItem;}},focus:function(){var oParent=this.parent,oAnchor=this._oAnchor,oActiveItem=oParent.activeItem;function setFocus(){try{oAnchor.focus();}\r
+catch(e){}}\r
+if(!this.cfg.getProperty("disabled")&&oParent&&oParent.cfg.getProperty("visible")&&this.element.style.display!="none"){if(oActiveItem){oActiveItem.blur();}\r
+window.setTimeout(setFocus,0);this.focusEvent.fire();}},blur:function(){var oParent=this.parent;if(!this.cfg.getProperty("disabled")&&oParent&&Dom.getStyle(oParent.element,"visibility")=="visible"){this._oAnchor.blur();this.blurEvent.fire();}},destroy:function(){var oEl=this.element;if(oEl){var oSubmenu=this.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.destroy();}\r
+this.mouseOverEvent.unsubscribeAll();this.mouseOutEvent.unsubscribeAll();this.mouseDownEvent.unsubscribeAll();this.mouseUpEvent.unsubscribeAll();this.clickEvent.unsubscribeAll();this.keyPressEvent.unsubscribeAll();this.keyDownEvent.unsubscribeAll();this.keyUpEvent.unsubscribeAll();this.focusEvent.unsubscribeAll();this.blurEvent.unsubscribeAll();this.cfg.configChangedEvent.unsubscribeAll();var oParentNode=oEl.parentNode;if(oParentNode){oParentNode.removeChild(oEl);this.destroyEvent.fire();}\r
+this.destroyEvent.unsubscribeAll();}},toString:function(){return("MenuItem: "+this.cfg.getProperty("text"));}};})();YAHOO.widget.MenuModuleItem=YAHOO.widget.MenuItem;YAHOO.widget.ContextMenu=function(p_oElement,p_oConfig){YAHOO.widget.ContextMenu.superclass.constructor.call(this,p_oElement,p_oConfig);};YAHOO.extend(YAHOO.widget.ContextMenu,YAHOO.widget.Menu,{_oTrigger:null,contextEventTarget:null,init:function(p_oElement,p_oConfig){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.ContextMenuItem;}\r
+YAHOO.widget.ContextMenu.superclass.init.call(this,p_oElement);this.beforeInitEvent.fire(YAHOO.widget.ContextMenu);if(p_oConfig){this.cfg.applyConfig(p_oConfig,true);}\r
+this.initEvent.fire(YAHOO.widget.ContextMenu);},_removeEventHandlers:function(){var Event=YAHOO.util.Event,oTrigger=this._oTrigger,bOpera=(this.browser=="opera");Event.removeListener(oTrigger,(bOpera?"mousedown":"contextmenu"),this._onTriggerContextMenu);if(bOpera){Event.removeListener(oTrigger,"click",this._onTriggerClick);}},_onTriggerClick:function(p_oEvent,p_oMenu){if(p_oEvent.ctrlKey){YAHOO.util.Event.stopEvent(p_oEvent);}},_onTriggerContextMenu:function(p_oEvent,p_oMenu){YAHOO.widget.MenuManager.hideVisible();var Event=YAHOO.util.Event,oConfig=this.cfg;if(p_oEvent.type=="mousedown"&&!p_oEvent.ctrlKey){return;}\r
+this.contextEventTarget=Event.getTarget(p_oEvent);var nX=Event.getPageX(p_oEvent),nY=Event.getPageY(p_oEvent);oConfig.applyConfig({xy:[nX,nY],visible:true});oConfig.fireQueue();Event.stopEvent(p_oEvent);},toString:function(){return("ContextMenu "+this.id);},initDefaultConfig:function(){YAHOO.widget.ContextMenu.superclass.initDefaultConfig.call(this);this.cfg.addProperty("trigger",{handler:this.configTrigger});},destroy:function(){this._removeEventHandlers();YAHOO.widget.ContextMenu.superclass.destroy.call(this);},configTrigger:function(p_sType,p_aArgs,p_oMenu){var Event=YAHOO.util.Event,oTrigger=p_aArgs[0];if(oTrigger){if(this._oTrigger){this._removeEventHandlers();}\r
+this._oTrigger=oTrigger;var bOpera=(this.browser=="opera");Event.addListener(oTrigger,(bOpera?"mousedown":"contextmenu"),this._onTriggerContextMenu,this,true);if(bOpera){Event.addListener(oTrigger,"click",this._onTriggerClick,this,true);}}\r
+else{this._removeEventHandlers();}}});YAHOO.widget.ContextMenuItem=function(p_oObject,p_oConfig){YAHOO.widget.ContextMenuItem.superclass.constructor.call(this,p_oObject,p_oConfig);};YAHOO.extend(YAHOO.widget.ContextMenuItem,YAHOO.widget.MenuItem,{init:function(p_oObject,p_oConfig){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.ContextMenu;}\r
+YAHOO.widget.ContextMenuItem.superclass.init.call(this,p_oObject);var oConfig=this.cfg;if(p_oConfig){oConfig.applyConfig(p_oConfig,true);}\r
+oConfig.fireQueue();},toString:function(){return("MenuBarItem: "+this.cfg.getProperty("text"));}});YAHOO.widget.MenuBar=function(p_oElement,p_oConfig){YAHOO.widget.MenuBar.superclass.constructor.call(this,p_oElement,p_oConfig);};YAHOO.extend(YAHOO.widget.MenuBar,YAHOO.widget.Menu,{init:function(p_oElement,p_oConfig){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuBarItem;}\r
+YAHOO.widget.MenuBar.superclass.init.call(this,p_oElement);this.beforeInitEvent.fire(YAHOO.widget.MenuBar);if(p_oConfig){this.cfg.applyConfig(p_oConfig,true);}\r
+this.initEvent.fire(YAHOO.widget.MenuBar);},CSS_CLASS_NAME:"yuimenubar",_onKeyDown:function(p_sType,p_aArgs,p_oMenuBar){var Event=YAHOO.util.Event,oEvent=p_aArgs[0],oItem=p_aArgs[1],oSubmenu;if(oItem&&!oItem.cfg.getProperty("disabled")){var oItemCfg=oItem.cfg;switch(oEvent.keyCode){case 37:case 39:if(oItem==this.activeItem&&!oItemCfg.getProperty("selected")){oItemCfg.setProperty("selected",true);}\r
+else{var oNextItem=(oEvent.keyCode==37)?oItem.getPreviousEnabledSibling():oItem.getNextEnabledSibling();if(oNextItem){this.clearActiveItem();oNextItem.cfg.setProperty("selected",true);if(this.cfg.getProperty("autosubmenudisplay")){oSubmenu=oNextItem.cfg.getProperty("submenu");if(oSubmenu){oSubmenu.show();oSubmenu.activeItem.blur();oSubmenu.activeItem=null;}}\r
+oNextItem.focus();}}\r
+Event.preventDefault(oEvent);break;case 40:if(this.activeItem!=oItem){this.clearActiveItem();oItemCfg.setProperty("selected",true);oItem.focus();}\r
+oSubmenu=oItemCfg.getProperty("submenu");if(oSubmenu){if(oSubmenu.cfg.getProperty("visible")){oSubmenu.setInitialSelection();oSubmenu.setInitialFocus();}\r
+else{oSubmenu.show();}}\r
+Event.preventDefault(oEvent);break;}}\r
+if(oEvent.keyCode==27&&this.activeItem){oSubmenu=this.activeItem.cfg.getProperty("submenu");if(oSubmenu&&oSubmenu.cfg.getProperty("visible")){oSubmenu.hide();this.activeItem.focus();}\r
+else{this.activeItem.cfg.setProperty("selected",false);this.activeItem.blur();}\r
+Event.preventDefault(oEvent);}},_onClick:function(p_sType,p_aArgs,p_oMenuBar){YAHOO.widget.MenuBar.superclass._onClick.call(this,p_sType,p_aArgs,p_oMenuBar);var oItem=p_aArgs[1];if(oItem&&!oItem.cfg.getProperty("disabled")){var Event=YAHOO.util.Event,Dom=YAHOO.util.Dom,oEvent=p_aArgs[0],oTarget=Event.getTarget(oEvent),oActiveItem=this.activeItem,oConfig=this.cfg;if(oActiveItem&&oActiveItem!=oItem){this.clearActiveItem();}\r
+oItem.cfg.setProperty("selected",true);oItem.focus();var oSubmenu=oItem.cfg.getProperty("submenu");if(oSubmenu&&oTarget!=oItem.submenuIndicator){if(oSubmenu.cfg.getProperty("visible")){oSubmenu.hide();}\r
+else{oSubmenu.show();}}}},toString:function(){return("MenuBar "+this.id);},initDefaultConfig:function(){YAHOO.widget.MenuBar.superclass.initDefaultConfig.call(this);var oConfig=this.cfg;oConfig.addProperty("position",{value:"static",handler:this.configPosition,validator:this._checkPosition,supercedes:["visible"]});oConfig.addProperty("submenualignment",{value:["tl","bl"]});oConfig.addProperty("autosubmenudisplay",{value:false,validator:oConfig.checkBoolean});}});YAHOO.widget.MenuBarItem=function(p_oObject,p_oConfig){YAHOO.widget.MenuBarItem.superclass.constructor.call(this,p_oObject,p_oConfig);};YAHOO.extend(YAHOO.widget.MenuBarItem,YAHOO.widget.MenuItem,{init:function(p_oObject,p_oConfig){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.Menu;}\r
+YAHOO.widget.MenuBarItem.superclass.init.call(this,p_oObject);var oConfig=this.cfg;if(p_oConfig){oConfig.applyConfig(p_oConfig,true);}\r
+oConfig.fireQueue();},CSS_CLASS_NAME:"yuimenubaritem",SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarodwn8_nrm_1.gif",SELECTED_SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarodwn8_hov_1.gif",DISABLED_SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarodwn8_dim_1.gif",toString:function(){return("MenuBarItem: "+this.cfg.getProperty("text"));}});
\ No newline at end of file
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.com/yui/license.txt\r
-version: 0.12.0\r
+version: 0.12.1\r
*/\r
\r
/**\r
*/\r
(function() {\r
\r
-var Dom = YAHOO.util.Dom;\r
-var Event = YAHOO.util.Event;\r
+var Dom = YAHOO.util.Dom,\r
+ Event = YAHOO.util.Event;\r
\r
/**\r
* Singleton that manages a collection of all menus and menu items. Listens for\r
* @class MenuManager\r
* @static\r
*/\r
-YAHOO.widget.MenuManager = new function() {\r
+YAHOO.widget.MenuManager = function() {\r
\r
// Private member variables\r
\r
// Flag indicating if the DOM event handlers have been attached\r
\r
- var m_bInitializedEventHandlers = false;\r
+ var m_bInitializedEventHandlers = false,\r
\r
- // Collection of menus\r
+ // Collection of menus\r
\r
- var m_oMenus = {};\r
+ m_oMenus = {},\r
\r
\r
- // Collection of menu items\r
+ // Collection of menu items\r
\r
- var m_oItems = {};\r
+ m_oItems = {},\r
\r
- // Collection of visible menus\r
+ // Collection of visible menus\r
\r
- var m_oVisibleMenus = {};\r
+ m_oVisibleMenus = {},\r
\r
- // Logger\r
+ // Logger\r
\r
\r
+ me = this;\r
+\r
// Private methods\r
\r
/**\r
- * Adds an item to the collection of known menu items.\r
+ * @method addItem\r
+ * @description Adds an item to the collection of known menu items.\r
* @private\r
* @param {YAHOO.widget.MenuItem} p_oItem Object specifying the MenuItem\r
* instance to be added.\r
*/\r
- var addItem = function(p_oItem) {\r
+ function addItem(p_oItem) {\r
\r
var sYUIId = Dom.generateId();\r
\r
\r
}\r
\r
- };\r
+ }\r
\r
/**\r
- * Removes an item from the collection of known menu items.\r
+ * @method removeItem\r
+ * @description Removes an item from the collection of known menu items.\r
* @private\r
* @param {YAHOO.widget.MenuItem} p_oItem Object specifying the MenuItem\r
* instance to be removed.\r
*/\r
- var removeItem = function(p_oItem) {\r
+ function removeItem(p_oItem) {\r
\r
var sYUIId = p_oItem.element.getAttribute("yuiid");\r
\r
\r
}\r
\r
- };\r
+ }\r
\r
/**\r
- * Finds the root DIV node of a menu or the root LI node of a menu item.\r
+ * @method getMenuRootElement\r
+ * @description Finds the root DIV node of a menu or the root LI node of a\r
+ * menu item.\r
* @private\r
* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-\r
* one-html.html#ID-58190037">HTMLElement</a>} p_oElement Object specifying\r
* an HTML element.\r
*/\r
- var getMenuRootElement = function(p_oElement) {\r
+ function getMenuRootElement(p_oElement) {\r
\r
var oParentNode;\r
\r
\r
}\r
\r
- };\r
+ }\r
\r
// Private event handlers\r
\r
/**\r
- * Generic, global event handler for all of a menu's DOM-based\r
+ * @method onDOMEvent\r
+ * @description Generic, global event handler for all of a menu's DOM-based\r
* events. This listens for events against the document object. If the\r
* target of a given event is a member of a menu or menu item's DOM, the\r
* instance's corresponding Custom Event is fired.\r
* @param {Event} p_oEvent Object representing the DOM event object passed\r
* back by the event utility (YAHOO.util.Event).\r
*/\r
- var onDOMEvent = function(p_oEvent) {\r
+ function onDOMEvent(p_oEvent) {\r
\r
// Get the target node of the DOM event\r
\r
- var oTarget = Event.getTarget(p_oEvent);\r
+ var oTarget = Event.getTarget(p_oEvent),\r
\r
// See if the target of the event was a menu, or a menu item\r
\r
- var oElement = getMenuRootElement(oTarget);\r
-\r
- var oMenuItem;\r
- var oMenu;\r
+ oElement = getMenuRootElement(oTarget),\r
+ oMenuItem,\r
+ oMenu;\r
\r
if(oElement) {\r
\r
"keydown": "keyDownEvent",\r
"keyup": "keyUpEvent",\r
"keypress": "keyPressEvent"\r
- };\r
+ },\r
\r
- var sCustomEventType = oEventTypes[p_oEvent.type];\r
+ sCustomEventType = oEventTypes[p_oEvent.type];\r
\r
// Fire the Custom Even that corresponds the current DOM event\r
\r
\r
}\r
\r
- };\r
+ }\r
\r
/**\r
- * "destroy" event handler for a menu.\r
+ * @method onMenuDestroy\r
+ * @description "destroy" event handler for a menu.\r
* @private\r
* @param {String} p_sType String representing the name of the event that\r
* was fired.\r
* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
* fired the event.\r
*/\r
- var onMenuDestroy = function(p_sType, p_aArgs, p_oMenu) {\r
+ function onMenuDestroy(p_sType, p_aArgs, p_oMenu) {\r
\r
- this.removeMenu(p_oMenu);\r
+ if(p_oMenu && m_oMenus[p_oMenu.id]) {\r
\r
- };\r
+ delete m_oMenus[p_oMenu.id];\r
+\r
+\r
+ }\r
+\r
+ }\r
\r
/**\r
- * "destroy" event handler for a MenuItem instance.\r
+ * @method onItemDestroy\r
+ * @description "destroy" event handler for a MenuItem instance.\r
* @private\r
* @param {String} p_sType String representing the name of the event that\r
* was fired.\r
* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
* that fired the event.\r
*/\r
- var onItemDestroy = function(p_sType, p_aArgs, p_oItem) {\r
+ function onItemDestroy(p_sType, p_aArgs, p_oItem) {\r
\r
var sYUIId = p_oItem.element.getAttribute("yuiid");\r
\r
\r
}\r
\r
- };\r
+ }\r
\r
/**\r
- * Event handler for when the "visible" configuration property\r
+ * @method onMenuVisibleConfigChange\r
+ * @description Event handler for when the "visible" configuration property\r
* of a Menu instance changes.\r
* @private\r
* @param {String} p_sType String representing the name of the event that\r
* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
* fired the event.\r
*/\r
- var onMenuVisibleConfigChange = function(p_sType, p_aArgs, p_oMenu) {\r
+ function onMenuVisibleConfigChange(p_sType, p_aArgs, p_oMenu) {\r
\r
var bVisible = p_aArgs[0];\r
\r
\r
}\r
\r
- };\r
-\r
- /**\r
- * "itemadded" event handler for a Menu instance.\r
- * @private\r
- * @param {String} p_sType String representing the name of the event that\r
- * was fired.\r
- * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
- */\r
- var onItemAdded = function(p_sType, p_aArgs) {\r
-\r
- addItem(p_aArgs[0]);\r
-\r
- };\r
-\r
-\r
- /**\r
- * "itemremoved" event handler for a Menu instance.\r
- * @private\r
- * @param {String} p_sType String representing the name of the event that\r
- * was fired.\r
- * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
- */\r
- var onItemRemoved = function(p_sType, p_aArgs) {\r
-\r
- removeItem(p_aArgs[0]);\r
-\r
- };\r
-\r
- // Privileged methods\r
-\r
- /**\r
- * @method addMenu\r
- * @description Adds a menu to the collection of known menus.\r
- * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu instance\r
- * to be added.\r
- */\r
- this.addMenu = function(p_oMenu) {\r
-\r
- if(p_oMenu && p_oMenu.id && !m_oMenus[p_oMenu.id]) {\r
-\r
- m_oMenus[p_oMenu.id] = p_oMenu;\r
-\r
-\r
- if(!m_bInitializedEventHandlers) {\r
-\r
- var oDoc = document;\r
-\r
- Event.addListener(oDoc, "mouseover", onDOMEvent, this, true);\r
- Event.addListener(oDoc, "mouseout", onDOMEvent, this, true);\r
- Event.addListener(oDoc, "mousedown", onDOMEvent, this, true);\r
- Event.addListener(oDoc, "mouseup", onDOMEvent, this, true);\r
- Event.addListener(oDoc, "click", onDOMEvent, this, true);\r
- Event.addListener(oDoc, "keydown", onDOMEvent, this, true);\r
- Event.addListener(oDoc, "keyup", onDOMEvent, this, true);\r
- Event.addListener(oDoc, "keypress", onDOMEvent, this, true);\r
-\r
- m_bInitializedEventHandlers = true;\r
-\r
-\r
- }\r
-\r
- p_oMenu.destroyEvent.subscribe(onMenuDestroy, p_oMenu, this);\r
-\r
- p_oMenu.cfg.subscribeToConfigEvent(\r
- "visible",\r
- onMenuVisibleConfigChange,\r
- p_oMenu\r
- );\r
-\r
- p_oMenu.itemAddedEvent.subscribe(onItemAdded);\r
- p_oMenu.itemRemovedEvent.subscribe(onItemRemoved);\r
-\r
-\r
- }\r
-\r
- };\r
-\r
- /**\r
- * @method removeMenu\r
- * @description Removes a menu from the collection of known menus.\r
- * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu instance\r
- * to be removed.\r
- */\r
- this.removeMenu = function(p_oMenu) {\r
-\r
- if(p_oMenu && m_oMenus[p_oMenu.id]) {\r
-\r
- delete m_oMenus[p_oMenu.id];\r
-\r
-\r
- }\r
-\r
- };\r
-\r
- /**\r
- * @method hideVisible\r
- * @description Hides all visible, dynamically positioned menus.\r
- */\r
- this.hideVisible = function() {\r
-\r
- var oMenu;\r
-\r
- for(var i in m_oVisibleMenus) {\r
-\r
- if(m_oVisibleMenus.hasOwnProperty(i)) {\r
-\r
- oMenu = m_oVisibleMenus[i];\r
-\r
- if(oMenu.cfg.getProperty("position") == "dynamic") {\r
-\r
- oMenu.hide();\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
- };\r
-\r
- /**\r
- * @method getMenus\r
- * @description Returns an array of all menus registered with the\r
- * menu manger.\r
- * @return {Array}\r
- */\r
- this.getMenus = function() {\r
-\r
- return m_oMenus;\r
-\r
- };\r
-\r
- /**\r
- * @method getMenu\r
- * @description Returns a menu with the specified id.\r
- * @param {String} p_sId String specifying the id of the menu to\r
- * be retrieved.\r
- * @return {YAHOO.widget.Menu}\r
- */\r
- this.getMenu = function(p_sId) {\r
-\r
- if(m_oMenus[p_sId]) {\r
-\r
- return m_oMenus[p_sId];\r
-\r
- }\r
-\r
- };\r
-\r
-\r
- /**\r
- * @method toString\r
- * @description Returns a string representing the menu manager.\r
- * @return {String}\r
- */\r
- this.toString = function() {\r
-\r
- return ("MenuManager");\r
-\r
- };\r
-\r
-};\r
-\r
-})();\r
-\r
-(function() {\r
-\r
-var Dom = YAHOO.util.Dom;\r
-var Event = YAHOO.util.Event;\r
-\r
-/**\r
-* The Menu class creates a container that holds a vertical list representing\r
-* a set of options or commands. Menu is the base class for all\r
-* menu containers.\r
-* @param {String} p_oElement String specifying the id attribute of the\r
-* <code><div></code> element of the menu.\r
-* @param {String} p_oElement String specifying the id attribute of the\r
-* <code><select></code> element to be used as the data source\r
-* for the menu.\r
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
-* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object\r
-* specifying the <code><div></code> element of the menu.\r
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
-* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement\r
-* Object specifying the <code><select></code> element to be used as\r
-* the data source for the menu.\r
-* @param {Object} p_oConfig Optional. Object literal specifying the\r
-* configuration for the menu. See configuration class documentation for\r
-* more details.\r
-* @namespace YAHOO.widget\r
-* @class Menu\r
-* @constructor\r
-* @extends YAHOO.widget.Overlay\r
-*/\r
-YAHOO.widget.Menu = function(p_oElement, p_oConfig) {\r
-\r
- if(p_oConfig) {\r
-\r
- this.parent = p_oConfig.parent;\r
-\r
- this.lazyLoad = p_oConfig.lazyLoad || p_oConfig.lazyload;\r
-\r
- this.itemData = p_oConfig.itemData || p_oConfig.itemdata;\r
-\r
}\r
\r
- YAHOO.widget.Menu.superclass.constructor.call(\r
- this,\r
- p_oElement,\r
- p_oConfig\r
- );\r
-\r
-};\r
-\r
-YAHOO.extend(YAHOO.widget.Menu, YAHOO.widget.Overlay, {\r
-\r
-// Constants\r
-\r
-/**\r
-* @property CSS_CLASS_NAME\r
-* @description String representing the CSS class(es) to be applied to the\r
-* menu's <code><div></code> element.\r
-* @default "yuimenu"\r
-* @final\r
-* @type String\r
-*/\r
-CSS_CLASS_NAME: "yuimenu",\r
-\r
-/**\r
-* @property ITEM_TYPE\r
-* @description Object representing the type of menu item to instantiate and\r
-* add when parsing the child nodes (either <code><li></code> element,\r
-* <code><optgroup></code> element or <code><option></code>)\r
-* of the menu's source HTML element.\r
-* @default YAHOO.widget.MenuItem\r
-* @final\r
-* @type YAHOO.widget.MenuItem\r
-*/\r
-ITEM_TYPE: null,\r
-\r
-/**\r
-* @property GROUP_TITLE_TAG_NAME\r
-* @description String representing the tagname of the HTML element used to\r
-* title the menu's item groups.\r
-* @default H6\r
-* @final\r
-* @type String\r
-*/\r
-GROUP_TITLE_TAG_NAME: "h6",\r
-\r
-// Private properties\r
-\r
-/**\r
-* @property _nHideDelayId\r
-* @description Number representing the time-out setting used to cancel the\r
-* hiding of a menu.\r
-* @default null\r
-* @private\r
-* @type Number\r
-*/\r
-_nHideDelayId: null,\r
-\r
-/**\r
-* @property _nShowDelayId\r
-* @description Number representing the time-out setting used to cancel the\r
-* showing of a menu.\r
-* @default null\r
-* @private\r
-* @type Number\r
-*/\r
-_nShowDelayId: null,\r
-\r
-/**\r
-* @property _hideDelayEventHandlersAssigned\r
-* @description Boolean indicating if the "mouseover" and "mouseout" event\r
-* handlers used for hiding the menu via a call to "window.setTimeout" have\r
-* already been assigned.\r
-* @default false\r
-* @private\r
-* @type Boolean\r
-*/\r
-_hideDelayEventHandlersAssigned: false,\r
-\r
-/**\r
-* @property _bHandledMouseOverEvent\r
-* @description Boolean indicating the current state of the menu's\r
-* "mouseover" event.\r
-* @default false\r
-* @private\r
-* @type Boolean\r
-*/\r
-_bHandledMouseOverEvent: false,\r
-\r
-/**\r
-* @property _bHandledMouseOutEvent\r
-* @description Boolean indicating the current state of the menu's\r
-* "mouseout" event.\r
-* @default false\r
-* @private\r
-* @type Boolean\r
-*/\r
-_bHandledMouseOutEvent: false,\r
-\r
-/**\r
-* @property _aGroupTitleElements\r
-* @description Array of HTML element used to title groups of menu items.\r
-* @default []\r
-* @private\r
-* @type Array\r
-*/\r
-_aGroupTitleElements: null,\r
-\r
-/**\r
-* @property _aItemGroups\r
-* @description Array of menu items.\r
-* @default []\r
-* @private\r
-* @type Array\r
-*/\r
-_aItemGroups: null,\r
-\r
-/**\r
-* @property _aListElements\r
-* @description Array of <code><ul></code> elements, each of which is\r
-* the parent node for each item's <code><li></code> element.\r
-* @default []\r
-* @private\r
-* @type Array\r
-*/\r
-_aListElements: null,\r
-\r
-// Public properties\r
-\r
-/**\r
-* @property lazyLoad\r
-* @description Boolean indicating if the menu's "lazy load" feature is\r
-* enabled. If set to "true," initialization and rendering of the menu's\r
-* items will be deferred until the first time it is made visible. This\r
-* property should be set via the constructor using the configuration\r
-* object literal.\r
-* @default false\r
-* @type Boolean\r
-*/\r
-lazyLoad: false,\r
-\r
-/**\r
-* @property itemData\r
-* @description Array of items to be added to the menu. The array can contain\r
-* strings representing the text for each item to be created, object literals\r
-* representing the menu item configuration properties, or MenuItem instances.\r
-* This property should be set via the constructor using the configuration\r
-* object literal.\r
-* @default null\r
-* @type Array\r
-*/\r
-itemData: null,\r
-\r
-/**\r
-* @property activeItem\r
-* @description Object reference to the item in the menu that has focus.\r
-* @default null\r
-* @type YAHOO.widget.MenuItem\r
-*/\r
-activeItem: null,\r
-\r
-/**\r
-* @property parent\r
-* @description Object reference to the menu's parent menu or menu item.\r
-* This property can be set via the constructor using the configuration\r
-* object literal.\r
-* @default null\r
-* @type YAHOO.widget.MenuItem\r
-*/\r
-parent: null,\r
-\r
-/**\r
-* @property srcElement\r
-* @description Object reference to the HTML element (either\r
-* <code><select></code> or <code><div></code>) used to\r
-* create the menu.\r
-* @default null\r
-* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
-* level-one-html.html#ID-94282980">HTMLSelectElement</a>|<a\r
-* href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.\r
-* html#ID-22445964">HTMLDivElement</a>\r
-*/\r
-srcElement: null,\r
-\r
-// Events\r
-\r
-/**\r
-* @event mouseOverEvent\r
-* @description Fires when the mouse has entered the menu. Passes back\r
-* the DOM Event object as an argument.\r
-*/\r
-mouseOverEvent: null,\r
-\r
-/**\r
-* @event mouseOutEvent\r
-* @description Fires when the mouse has left the menu. Passes back the DOM\r
-* Event object as an argument.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-mouseOutEvent: null,\r
-\r
-/**\r
-* @event mouseDownEvent\r
-* @description Fires when the user mouses down on the menu. Passes back the\r
-* DOM Event object as an argument.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-mouseDownEvent: null,\r
-\r
-/**\r
-* @event mouseUpEvent\r
-* @description Fires when the user releases a mouse button while the mouse is\r
-* over the menu. Passes back the DOM Event object as an argument.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-mouseUpEvent: null,\r
-\r
-/**\r
-* @event clickEvent\r
-* @description Fires when the user clicks the on the menu. Passes back the\r
-* DOM Event object as an argument.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-clickEvent: null,\r
-\r
-/**\r
-* @event keyPressEvent\r
-* @description Fires when the user presses an alphanumeric key when one of the\r
-* menu's items has focus. Passes back the DOM Event object as an argument.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-keyPressEvent: null,\r
-\r
-/**\r
-* @event keyDownEvent\r
-* @description Fires when the user presses a key when one of the menu's items\r
-* has focus. Passes back the DOM Event object as an argument.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-keyDownEvent: null,\r
-\r
-/**\r
-* @event keyUpEvent\r
-* @description Fires when the user releases a key when one of the menu's items\r
-* has focus. Passes back the DOM Event object as an argument.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-keyUpEvent: null,\r
-\r
-/**\r
-* @event itemAddedEvent\r
-* @description Fires when an item is added to the menu.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-itemAddedEvent: null,\r
-\r
-/**\r
-* @event itemRemovedEvent\r
-* @description Fires when an item is removed to the menu.\r
-* @type YAHOO.util.CustomEvent\r
-*/\r
-itemRemovedEvent: null,\r
-\r
-/**\r
-* @method init\r
-* @description The Menu class's initialization method. This method is\r
-* automatically called by the constructor, and sets up all DOM references\r
-* for pre-existing markup, and creates required markup if it is not\r
-* already present.\r
-* @param {String} p_oElement String specifying the id attribute of the\r
-* <code><div></code> element of the menu.\r
-* @param {String} p_oElement String specifying the id attribute of the\r
-* <code><select></code> element to be used as the data source\r
-* for the menu.\r
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
-* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object\r
-* specifying the <code><div></code> element of the menu.\r
-* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
-* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement\r
-* Object specifying the <code><select></code> element to be used as\r
-* the data source for the menu.\r
-* @param {Object} p_oConfig Optional. Object literal specifying the\r
-* configuration for the menu. See configuration class documentation for\r
-* more details.\r
-*/\r
-init: function(p_oElement, p_oConfig) {\r
-\r
- this._aItemGroups = [];\r
- this._aListElements = [];\r
- this._aGroupTitleElements = [];\r
-\r
- if(!this.ITEM_TYPE) {\r
-\r
- this.ITEM_TYPE = YAHOO.widget.MenuItem;\r
-\r
- }\r
-\r
- var oElement;\r
-\r
- if(typeof p_oElement == "string") {\r
-\r
- oElement = document.getElementById(p_oElement);\r
-\r
- }\r
- else if(p_oElement.tagName) {\r
-\r
- oElement = p_oElement;\r
-\r
- }\r
-\r
- if(oElement && oElement.tagName) {\r
-\r
- switch(oElement.tagName.toUpperCase()) {\r
-\r
- case "DIV":\r
-\r
- this.srcElement = oElement;\r
-\r
- if(!oElement.id) {\r
-\r
- oElement.setAttribute("id", Dom.generateId());\r
-\r
- }\r
-\r
- /*\r
- Note: we don't pass the user config in here yet\r
- because we only want it executed once, at the lowest\r
- subclass level.\r
- */\r
-\r
- YAHOO.widget.Menu.superclass.init.call(this, oElement);\r
-\r
- this.beforeInitEvent.fire(YAHOO.widget.Menu);\r
-\r
-\r
- break;\r
-\r
- case "SELECT":\r
-\r
- this.srcElement = oElement;\r
-\r
-\r
- /*\r
- The source element is not something that we can use\r
- outright, so we need to create a new Overlay\r
-\r
- Note: we don't pass the user config in here yet\r
- because we only want it executed once, at the lowest\r
- subclass level.\r
- */\r
-\r
- YAHOO.widget.Menu.superclass.init.call(this, Dom.generateId());\r
-\r
- this.beforeInitEvent.fire(YAHOO.widget.Menu);\r
-\r
- break;\r
-\r
- }\r
-\r
- }\r
- else {\r
-\r
- /*\r
- Note: we don't pass the user config in here yet\r
- because we only want it executed once, at the lowest\r
- subclass level.\r
- */\r
-\r
- YAHOO.widget.Menu.superclass.init.call(this, p_oElement);\r
-\r
- this.beforeInitEvent.fire(YAHOO.widget.Menu);\r
-\r
- }\r
-\r
- if(this.element) {\r
-\r
- var oEl = this.element;\r
-\r
- Dom.addClass(oEl, this.CSS_CLASS_NAME);\r
-\r
- // Subscribe to Custom Events\r
-\r
- this.initEvent.subscribe(this._onInit, this, true);\r
- this.beforeRenderEvent.subscribe(this._onBeforeRender, this, true);\r
- this.renderEvent.subscribe(this._onRender, this, true);\r
- this.beforeShowEvent.subscribe(this._onBeforeShow, this, true);\r
- this.showEvent.subscribe(this._onShow, this, true);\r
- this.beforeHideEvent.subscribe(this._onBeforeHide, this, true);\r
- this.mouseOverEvent.subscribe(this._onMouseOver, this, true);\r
- this.mouseOutEvent.subscribe(this._onMouseOut, this, true);\r
- this.clickEvent.subscribe(this._onClick, this, true);\r
- this.keyDownEvent.subscribe(this._onKeyDown, this, true);\r
-\r
- if(p_oConfig) {\r
-\r
- this.cfg.applyConfig(p_oConfig, true);\r
-\r
- }\r
-\r
- // Register the Menu instance with the MenuManager\r
-\r
- YAHOO.widget.MenuManager.addMenu(this);\r
-\r
-\r
- this.initEvent.fire(YAHOO.widget.Menu);\r
-\r
- }\r
-\r
-},\r
-\r
-// Private methods\r
-\r
-/**\r
-* @method _initSubTree\r
-* @description Iterates the childNodes of the source element to find nodes\r
-* used to instantiate menu and menu items.\r
-* @private\r
-*/\r
-_initSubTree: function() {\r
-\r
- var oNode;\r
-\r
- if(this.srcElement.tagName == "DIV") {\r
-\r
- /*\r
- Populate the collection of item groups and item\r
- group titles\r
- */\r
-\r
- oNode = this.body.firstChild;\r
-\r
- var nGroup = 0;\r
- var sGroupTitleTagName = this.GROUP_TITLE_TAG_NAME.toUpperCase();\r
-\r
- do {\r
-\r
- if(oNode && oNode.tagName) {\r
-\r
- switch(oNode.tagName.toUpperCase()) {\r
-\r
- case sGroupTitleTagName:\r
-\r
- this._aGroupTitleElements[nGroup] = oNode;\r
-\r
- break;\r
-\r
- case "UL":\r
-\r
- this._aListElements[nGroup] = oNode;\r
- this._aItemGroups[nGroup] = [];\r
- nGroup++;\r
-\r
- break;\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
- while((oNode = oNode.nextSibling));\r
-\r
- /*\r
- Apply the "first-of-type" class to the first UL to mimic\r
- the "first-of-type" CSS3 psuedo class.\r
- */\r
-\r
- if(this._aListElements[0]) {\r
-\r
- Dom.addClass(this._aListElements[0], "first-of-type");\r
-\r
- }\r
-\r
- }\r
-\r
- oNode = null;\r
-\r
- if(this.srcElement.tagName) {\r
-\r
- switch(this.srcElement.tagName.toUpperCase()) {\r
-\r
- case "DIV":\r
-\r
- if(this._aListElements.length > 0) {\r
-\r
-\r
- var i = this._aListElements.length - 1;\r
-\r
- do {\r
-\r
- oNode = this._aListElements[i].firstChild;\r
-\r
-\r
- do {\r
-\r
- if(oNode && oNode.tagName) {\r
-\r
- switch(oNode.tagName.toUpperCase()) {\r
-\r
- case "LI":\r
-\r
-\r
- this.addItem(\r
- new this.ITEM_TYPE(\r
- oNode,\r
- { parent: this }\r
- ),\r
- i\r
- );\r
-\r
- break;\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
- while((oNode = oNode.nextSibling));\r
-\r
- }\r
- while(i--);\r
-\r
- }\r
-\r
- break;\r
-\r
- case "SELECT":\r
-\r
-\r
- oNode = this.srcElement.firstChild;\r
-\r
- do {\r
-\r
- if(oNode && oNode.tagName) {\r
-\r
- switch(oNode.tagName.toUpperCase()) {\r
-\r
- case "OPTGROUP":\r
- case "OPTION":\r
-\r
-\r
- this.addItem(\r
- new this.ITEM_TYPE(\r
- oNode,\r
- { parent: this }\r
- )\r
- );\r
-\r
- break;\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
- while((oNode = oNode.nextSibling));\r
-\r
- break;\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _getFirstEnabledItem\r
-* @description Returns the first enabled item in the menu.\r
-* @return {YAHOO.widget.MenuItem}\r
-* @private\r
-*/\r
-_getFirstEnabledItem: function() {\r
-\r
- var nGroups = this._aItemGroups.length;\r
- var oItem;\r
- var aItemGroup;\r
-\r
- for(var i=0; i<nGroups; i++) {\r
-\r
- aItemGroup = this._aItemGroups[i];\r
-\r
- if(aItemGroup) {\r
-\r
- var nItems = aItemGroup.length;\r
-\r
- for(var n=0; n<nItems; n++) {\r
-\r
- oItem = aItemGroup[n];\r
-\r
- if(\r
- !oItem.cfg.getProperty("disabled") &&\r
- oItem.element.style.display != "none"\r
- ) {\r
-\r
- return oItem;\r
-\r
- }\r
-\r
- oItem = null;\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _checkPosition\r
-* @description Checks to make sure that the value of the "position" property\r
-* is one of the supported strings. Returns true if the position is supported.\r
-* @private\r
-* @param {Object} p_sPosition String specifying the position of the menu.\r
-* @return {Boolean}\r
-*/\r
-_checkPosition: function(p_sPosition) {\r
-\r
- if(typeof p_sPosition == "string") {\r
-\r
- var sPosition = p_sPosition.toLowerCase();\r
-\r
- return ("dynamic,static".indexOf(sPosition) != -1);\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _addItemToGroup\r
-* @description Adds a menu item to a group.\r
-* @private\r
-* @param {Number} p_nGroupIndex Number indicating the group to which the\r
-* item belongs.\r
-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
-* instance to be added to the menu.\r
-* @param {String} p_oItem String specifying the text of the item to be added\r
-* to the menu.\r
-* @param {Object} p_oItem Object literal containing a set of menu item\r
-* configuration properties.\r
-* @param {Number} p_nItemIndex Optional. Number indicating the index at\r
-* which the menu item should be added.\r
-* @return {YAHOO.widget.MenuItem}\r
-*/\r
-_addItemToGroup: function(p_nGroupIndex, p_oItem, p_nItemIndex) {\r
-\r
- var oItem;\r
-\r
- if(p_oItem instanceof this.ITEM_TYPE) {\r
-\r
- oItem = p_oItem;\r
- oItem.parent = this;\r
-\r
- }\r
- else if(typeof p_oItem == "string") {\r
-\r
- oItem = new this.ITEM_TYPE(p_oItem, { parent: this });\r
-\r
- }\r
- else if(typeof p_oItem == "object" && p_oItem.text) {\r
-\r
- var sText = p_oItem.text;\r
-\r
- delete p_oItem["text"];\r
-\r
- p_oItem.parent = this;\r
-\r
- oItem = new this.ITEM_TYPE(sText, p_oItem);\r
-\r
- }\r
-\r
- if(oItem) {\r
-\r
- var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;\r
-\r
- var aGroup = this._getItemGroup(nGroupIndex);\r
-\r
- var oGroupItem;\r
-\r
- if(!aGroup) {\r
-\r
- aGroup = this._createItemGroup(nGroupIndex);\r
-\r
- }\r
-\r
- if(typeof p_nItemIndex == "number") {\r
-\r
- var bAppend = (p_nItemIndex >= aGroup.length);\r
-\r
- if(aGroup[p_nItemIndex]) {\r
-\r
- aGroup.splice(p_nItemIndex, 0, oItem);\r
-\r
- }\r
- else {\r
-\r
- aGroup[p_nItemIndex] = oItem;\r
-\r
- }\r
-\r
- oGroupItem = aGroup[p_nItemIndex];\r
-\r
- if(oGroupItem) {\r
-\r
- if(\r
- bAppend &&\r
- (\r
- !oGroupItem.element.parentNode ||\r
- oGroupItem.element.parentNode.nodeType == 11\r
- )\r
- ) {\r
-\r
- this._aListElements[nGroupIndex].appendChild(\r
- oGroupItem.element\r
- );\r
-\r
- }\r
- else {\r
-\r
-\r
- /**\r
- * Returns the next sibling of an item in an array.\r
- * @private\r
- * @param {p_aArray} Array to search.\r
- * @param {p_nStartIndex} Number indicating the index to\r
- * start searching the array.\r
- * @return {Object}\r
- */\r
- var getNextItemSibling =\r
-\r
- function(p_aArray, p_nStartIndex) {\r
-\r
- return (\r
- p_aArray[p_nStartIndex] ||\r
- getNextItemSibling(\r
- p_aArray,\r
- (p_nStartIndex+1)\r
- )\r
- );\r
-\r
- };\r
-\r
-\r
- var oNextItemSibling =\r
- getNextItemSibling(aGroup, (p_nItemIndex+1));\r
-\r
- if(\r
- oNextItemSibling &&\r
- (\r
- !oGroupItem.element.parentNode ||\r
- oGroupItem.element.parentNode.nodeType == 11\r
- )\r
- ) {\r
-\r
- this._aListElements[nGroupIndex].insertBefore(\r
- oGroupItem.element,\r
- oNextItemSibling.element\r
- );\r
-\r
- }\r
-\r
- }\r
-\r
-\r
- oGroupItem.parent = this;\r
-\r
- this._subscribeToItemEvents(oGroupItem);\r
-\r
- this._configureSubmenu(oGroupItem);\r
-\r
- this._updateItemProperties(nGroupIndex);\r
-\r
-\r
- this.itemAddedEvent.fire(oGroupItem);\r
-\r
- return oGroupItem;\r
-\r
- }\r
-\r
- }\r
- else {\r
-\r
- var nItemIndex = aGroup.length;\r
-\r
- aGroup[nItemIndex] = oItem;\r
-\r
- oGroupItem = aGroup[nItemIndex];\r
-\r
-\r
- if(oGroupItem) {\r
-\r
- if(\r
- !Dom.isAncestor(\r
- this._aListElements[nGroupIndex],\r
- oGroupItem.element\r
- )\r
- ) {\r
-\r
- this._aListElements[nGroupIndex].appendChild(\r
- oGroupItem.element\r
- );\r
-\r
- }\r
-\r
- oGroupItem.element.setAttribute("groupindex", nGroupIndex);\r
- oGroupItem.element.setAttribute("index", nItemIndex);\r
-\r
- oGroupItem.parent = this;\r
-\r
- oGroupItem.index = nItemIndex;\r
- oGroupItem.groupIndex = nGroupIndex;\r
-\r
- this._subscribeToItemEvents(oGroupItem);\r
-\r
- this._configureSubmenu(oGroupItem);\r
-\r
- if(nItemIndex === 0) {\r
-\r
- Dom.addClass(oGroupItem.element, "first-of-type");\r
-\r
- }\r
-\r
-\r
-\r
- this.itemAddedEvent.fire(oGroupItem);\r
-\r
- return oGroupItem;\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _removeItemFromGroupByIndex\r
-* @description Removes a menu item from a group by index. Returns the menu\r
-* item that was removed.\r
-* @private\r
-* @param {Number} p_nGroupIndex Number indicating the group to which the menu\r
-* item belongs.\r
-* @param {Number} p_nItemIndex Number indicating the index of the menu item\r
-* to be removed.\r
-* @return {YAHOO.widget.MenuItem}\r
-*/\r
-_removeItemFromGroupByIndex: function(p_nGroupIndex, p_nItemIndex) {\r
-\r
- var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;\r
- var aGroup = this._getItemGroup(nGroupIndex);\r
-\r
- if(aGroup) {\r
-\r
- var aArray = aGroup.splice(p_nItemIndex, 1);\r
- var oItem = aArray[0];\r
-\r
- if(oItem) {\r
-\r
- // Update the index and className properties of each member\r
-\r
- this._updateItemProperties(nGroupIndex);\r
-\r
- if(aGroup.length === 0) {\r
-\r
- // Remove the UL\r
-\r
- var oUL = this._aListElements[nGroupIndex];\r
-\r
- if(this.body && oUL) {\r
-\r
- this.body.removeChild(oUL);\r
-\r
- }\r
-\r
- // Remove the group from the array of items\r
-\r
- this._aItemGroups.splice(nGroupIndex, 1);\r
-\r
-\r
- // Remove the UL from the array of ULs\r
-\r
- this._aListElements.splice(nGroupIndex, 1);\r
-\r
-\r
- /*\r
- Assign the "first-of-type" class to the new first UL\r
- in the collection\r
- */\r
-\r
- oUL = this._aListElements[0];\r
-\r
- if(oUL) {\r
-\r
- Dom.addClass(oUL, "first-of-type");\r
-\r
- }\r
-\r
- }\r
-\r
-\r
- this.itemRemovedEvent.fire(oItem);\r
-\r
- // Return a reference to the item that was removed\r
-\r
- return oItem;\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _removeItemFromGroupByValue\r
-* @description Removes a menu item from a group by reference. Returns the\r
-* menu item that was removed.\r
-* @private\r
-* @param {Number} p_nGroupIndex Number indicating the group to which the\r
-* menu item belongs.\r
-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
-* instance to be removed.\r
-* @return {YAHOO.widget.MenuItem}\r
-*/\r
-_removeItemFromGroupByValue: function(p_nGroupIndex, p_oItem) {\r
-\r
- var aGroup = this._getItemGroup(p_nGroupIndex);\r
-\r
- if(aGroup) {\r
-\r
- var nItems = aGroup.length;\r
- var nItemIndex = -1;\r
-\r
- if(nItems > 0) {\r
-\r
- var i = nItems-1;\r
-\r
- do {\r
-\r
- if(aGroup[i] == p_oItem) {\r
-\r
- nItemIndex = i;\r
- break;\r
-\r
- }\r
-\r
- }\r
- while(i--);\r
-\r
- if(nItemIndex > -1) {\r
-\r
- return this._removeItemFromGroupByIndex(\r
- p_nGroupIndex,\r
- nItemIndex\r
- );\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _updateItemProperties\r
-* @description Updates the "index," "groupindex," and "className" properties\r
-* of the menu items in the specified group.\r
-* @private\r
-* @param {Number} p_nGroupIndex Number indicating the group of items to update.\r
-*/\r
-_updateItemProperties: function(p_nGroupIndex) {\r
-\r
- var aGroup = this._getItemGroup(p_nGroupIndex);\r
- var nItems = aGroup.length;\r
-\r
- if(nItems > 0) {\r
-\r
- var i = nItems - 1;\r
- var oItem;\r
- var oLI;\r
-\r
- // Update the index and className properties of each member\r
-\r
- do {\r
-\r
- oItem = aGroup[i];\r
-\r
- if(oItem) {\r
-\r
- oLI = oItem.element;\r
-\r
- oItem.index = i;\r
- oItem.groupIndex = p_nGroupIndex;\r
-\r
- oLI.setAttribute("groupindex", p_nGroupIndex);\r
- oLI.setAttribute("index", i);\r
-\r
- Dom.removeClass(oLI, "first-of-type");\r
-\r
- }\r
-\r
- }\r
- while(i--);\r
-\r
- if(oLI) {\r
-\r
- Dom.addClass(oLI, "first-of-type");\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _createItemGroup\r
-* @description Creates a new menu item group (array) and its associated\r
-* <code><ul></code> element. Returns an aray of menu item groups.\r
-* @private\r
-* @param {Number} p_nIndex Number indicating the group to create.\r
-* @return {Array}\r
-*/\r
-_createItemGroup: function(p_nIndex) {\r
-\r
- if(!this._aItemGroups[p_nIndex]) {\r
-\r
- this._aItemGroups[p_nIndex] = [];\r
-\r
- var oUL = document.createElement("ul");\r
-\r
- this._aListElements[p_nIndex] = oUL;\r
-\r
- return this._aItemGroups[p_nIndex];\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _getItemGroup\r
-* @description Returns the menu item group at the specified index.\r
-* @private\r
-* @param {Number} p_nIndex Number indicating the index of the menu item group\r
-* to be retrieved.\r
-* @return {Array}\r
-*/\r
-_getItemGroup: function(p_nIndex) {\r
-\r
- var nIndex = ((typeof p_nIndex == "number") ? p_nIndex : 0);\r
-\r
- return this._aItemGroups[nIndex];\r
-\r
-},\r
-\r
-/**\r
-* @method _configureSubmenu\r
-* @description Subscribes the menu item's submenu to its parent menu's events.\r
-* @private\r
-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
-* instance with the submenu to be configured.\r
-*/\r
-_configureSubmenu: function(p_oItem) {\r
-\r
- var oSubmenu = p_oItem.cfg.getProperty("submenu");\r
-\r
- if(oSubmenu) {\r
-\r
- /*\r
- Listen for configuration changes to the parent menu\r
- so they they can be applied to the submenu.\r
- */\r
-\r
- this.cfg.configChangedEvent.subscribe(\r
- this._onParentMenuConfigChange,\r
- oSubmenu,\r
- true\r
- );\r
-\r
- this.renderEvent.subscribe(\r
- this._onParentMenuRender,\r
- oSubmenu,\r
- true\r
- );\r
-\r
- oSubmenu.beforeShowEvent.subscribe(\r
- this._onSubmenuBeforeShow,\r
- oSubmenu,\r
- true\r
- );\r
-\r
- oSubmenu.showEvent.subscribe(\r
- this._onSubmenuShow,\r
- oSubmenu,\r
- true\r
- );\r
-\r
- oSubmenu.hideEvent.subscribe(\r
- this._onSubmenuHide,\r
- oSubmenu,\r
- true\r
- );\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _subscribeToItemEvents\r
-* @description Subscribes a menu to a menu item's event.\r
-* @private\r
-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
-* instance whose events should be subscribed to.\r
-*/\r
-_subscribeToItemEvents: function(p_oItem) {\r
-\r
- p_oItem.focusEvent.subscribe(this._onMenuItemFocus, p_oItem, this);\r
-\r
- p_oItem.blurEvent.subscribe(this._onMenuItemBlur, this, true);\r
-\r
- p_oItem.cfg.configChangedEvent.subscribe(\r
- this._onMenuItemConfigChange,\r
- p_oItem,\r
- this\r
- );\r
-\r
-},\r
-\r
-/**\r
-* @method _getOffsetWidth\r
-* @description Returns the offset width of the menu's\r
-* <code><div></code> element.\r
-* @private\r
-*/\r
-_getOffsetWidth: function() {\r
-\r
- var oClone = this.element.cloneNode(true);\r
-\r
- Dom.setStyle(oClone, "width", "");\r
-\r
- document.body.appendChild(oClone);\r
-\r
- var sWidth = oClone.offsetWidth;\r
-\r
- document.body.removeChild(oClone);\r
-\r
- return sWidth;\r
-\r
-},\r
-\r
-/**\r
-* @method _cancelHideDelay\r
-* @description Cancels the call to "hideMenu."\r
-* @private\r
-*/\r
-_cancelHideDelay: function() {\r
-\r
- var oRoot = this.getRoot();\r
-\r
- if(oRoot._nHideDelayId) {\r
-\r
- window.clearTimeout(oRoot._nHideDelayId);\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _execHideDelay\r
-* @description Hides the menu after the number of milliseconds specified by\r
-* the "hidedelay" configuration property.\r
-* @private\r
-*/\r
-_execHideDelay: function() {\r
-\r
- this._cancelHideDelay();\r
-\r
- var oRoot = this.getRoot();\r
- var me = this;\r
-\r
- var hideMenu = function() {\r
-\r
- if(oRoot.activeItem) {\r
-\r
- oRoot.clearActiveItem();\r
-\r
- }\r
-\r
- if(oRoot == me && me.cfg.getProperty("position") == "dynamic") {\r
-\r
- me.hide();\r
-\r
- }\r
-\r
- };\r
-\r
- oRoot._nHideDelayId =\r
- window.setTimeout(hideMenu, oRoot.cfg.getProperty("hidedelay"));\r
-\r
-},\r
-\r
-/**\r
-* @method _cancelShowDelay\r
-* @description Cancels the call to the "showMenu."\r
-* @private\r
-*/\r
-_cancelShowDelay: function() {\r
-\r
- var oRoot = this.getRoot();\r
-\r
- if(oRoot._nShowDelayId) {\r
-\r
- window.clearTimeout(oRoot._nShowDelayId);\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _execShowDelay\r
-* @description Shows the menu after the number of milliseconds specified by\r
-* the "showdelay" configuration property have ellapsed.\r
-* @private\r
-* @param {YAHOO.widget.Menu} p_oMenu Object specifying the menu that should\r
-* be made visible.\r
-*/\r
-_execShowDelay: function(p_oMenu) {\r
-\r
- this._cancelShowDelay();\r
-\r
- var oRoot = this.getRoot();\r
-\r
- var showMenu = function() {\r
-\r
- p_oMenu.show();\r
-\r
- };\r
-\r
- oRoot._nShowDelayId =\r
- window.setTimeout(showMenu, oRoot.cfg.getProperty("showdelay"));\r
-\r
-},\r
-\r
-// Protected methods\r
-\r
-/**\r
-* @method _onMouseOver\r
-* @description "mouseover" event handler for the menu.\r
-* @protected\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-_onMouseOver: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- var oEvent = p_aArgs[0];\r
- var oItem = p_aArgs[1];\r
- var oTarget = Event.getTarget(oEvent);\r
-\r
- if(\r
- !this._bHandledMouseOverEvent &&\r
- (oTarget == this.element || Dom.isAncestor(this.element, oTarget))\r
- ) {\r
-\r
- // MENU MOUSEOVER LOGIC HERE\r
-\r
- this.clearActiveItem();\r
-\r
- this._bHandledMouseOverEvent = true;\r
- this._bHandledMouseOutEvent = false;\r
-\r
- }\r
-\r
- if(\r
- oItem && !oItem.handledMouseOverEvent &&\r
- (oTarget == oItem.element || Dom.isAncestor(oItem.element, oTarget))\r
- ) {\r
-\r
- var oItemCfg = oItem.cfg;\r
-\r
- // Select and focus the current menu item\r
-\r
- oItemCfg.setProperty("selected", true);\r
- oItem.focus();\r
-\r
- if(this.cfg.getProperty("autosubmenudisplay")) {\r
-\r
- // Show the submenu this menu item\r
-\r
- var oSubmenu = oItemCfg.getProperty("submenu");\r
-\r
- if(oSubmenu) {\r
-\r
- if(this.cfg.getProperty("showdelay") > 0) {\r
-\r
- this._execShowDelay(oSubmenu);\r
-\r
- }\r
- else {\r
-\r
- oSubmenu.show();\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
- oItem.handledMouseOverEvent = true;\r
- oItem.handledMouseOutEvent = false;\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _onMouseOut\r
-* @description "mouseout" event handler for the menu.\r
-* @protected\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-_onMouseOut: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- var oEvent = p_aArgs[0];\r
- var oItem = p_aArgs[1];\r
- var oRelatedTarget = Event.getRelatedTarget(oEvent);\r
- var bMovingToSubmenu = false;\r
-\r
- if(oItem) {\r
-\r
- var oItemCfg = oItem.cfg;\r
- var oSubmenu = oItemCfg.getProperty("submenu");\r
-\r
- if(\r
- oSubmenu &&\r
- (\r
- oRelatedTarget == oSubmenu.element ||\r
- Dom.isAncestor(oSubmenu.element, oRelatedTarget)\r
- )\r
- ) {\r
-\r
- bMovingToSubmenu = true;\r
-\r
- }\r
-\r
- if(\r
- !oItem.handledMouseOutEvent &&\r
- (\r
- (\r
- oRelatedTarget != oItem.element &&\r
- !Dom.isAncestor(oItem.element, oRelatedTarget)\r
- ) || bMovingToSubmenu\r
- )\r
- ) {\r
-\r
- if(this.cfg.getProperty("showdelay") > 0) {\r
-\r
- this._cancelShowDelay();\r
-\r
- }\r
-\r
- if(!bMovingToSubmenu) {\r
-\r
- oItemCfg.setProperty("selected", false);\r
-\r
- }\r
-\r
- if(this.cfg.getProperty("autosubmenudisplay")) {\r
-\r
- if(oSubmenu) {\r
-\r
- if(\r
- !(\r
- oRelatedTarget == oSubmenu.element ||\r
- YAHOO.util.Dom.isAncestor(\r
- oSubmenu.element,\r
- oRelatedTarget\r
- )\r
- )\r
- ) {\r
-\r
- oSubmenu.hide();\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
- oItem.handledMouseOutEvent = true;\r
- oItem.handledMouseOverEvent = false;\r
-\r
- }\r
-\r
- }\r
-\r
- if(\r
- !this._bHandledMouseOutEvent &&\r
- (\r
- (\r
- oRelatedTarget != this.element &&\r
- !Dom.isAncestor(this.element, oRelatedTarget)\r
- )\r
- || bMovingToSubmenu\r
- )\r
- ) {\r
-\r
- this._bHandledMouseOutEvent = true;\r
- this._bHandledMouseOverEvent = false;\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _onClick\r
-* @description "click" event handler for the menu.\r
-* @protected\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-_onClick: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- var oEvent = p_aArgs[0];\r
- var oItem = p_aArgs[1];\r
- var oTarget = Event.getTarget(oEvent);\r
-\r
- if(oItem) {\r
-\r
- var oItemCfg = oItem.cfg;\r
- var oSubmenu = oItemCfg.getProperty("submenu");\r
-\r
- /*\r
- ACCESSIBILITY FEATURE FOR SCREEN READERS:\r
- Expand/collapse the submenu when the user clicks\r
- on the submenu indicator image.\r
- */\r
-\r
- if(oTarget == oItem.submenuIndicator && oSubmenu) {\r
-\r
- if(oSubmenu.cfg.getProperty("visible")) {\r
-\r
- oSubmenu.hide();\r
-\r
- }\r
- else {\r
-\r
- this.clearActiveItem();\r
-\r
- this.activeItem = oItem;\r
-\r
- oItem.cfg.setProperty("selected", true);\r
-\r
- oSubmenu.show();\r
-\r
- }\r
-\r
- }\r
- else {\r
-\r
- var sURL = oItemCfg.getProperty("url");\r
- var bCurrentPageURL = (sURL.substr((sURL.length-1),1) == "#");\r
- var sTarget = oItemCfg.getProperty("target");\r
- var bHasTarget = (sTarget && sTarget.length > 0);\r
-\r
- /*\r
- Prevent the browser from following links\r
- equal to "#"\r
- */\r
-\r
- if(\r
- oTarget.tagName.toUpperCase() == "A" &&\r
- bCurrentPageURL && !bHasTarget\r
- ) {\r
-\r
- Event.preventDefault(oEvent);\r
-\r
- }\r
-\r
- if(\r
- oTarget.tagName.toUpperCase() != "A" &&\r
- !bCurrentPageURL && !bHasTarget\r
- ) {\r
-\r
- /*\r
- Follow the URL of the item regardless of\r
- whether or not the user clicked specifically\r
- on the anchor element.\r
- */\r
-\r
- document.location = sURL;\r
-\r
- }\r
-\r
- /*\r
- If the item doesn't navigate to a URL and it doesn't have\r
- a submenu, then collapse the menu tree.\r
- */\r
-\r
- if(bCurrentPageURL && !oSubmenu) {\r
-\r
- var oRoot = this.getRoot();\r
-\r
- if(oRoot.cfg.getProperty("position") == "static") {\r
-\r
- oRoot.clearActiveItem();\r
-\r
- }\r
- else {\r
-\r
- oRoot.hide();\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _onKeyDown\r
-* @description "keydown" event handler for the menu.\r
-* @protected\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-_onKeyDown: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- var oEvent = p_aArgs[0];\r
- var oItem = p_aArgs[1];\r
- var oSubmenu;\r
-\r
- if(oItem) {\r
-\r
- var oItemCfg = oItem.cfg;\r
- var oParentItem = this.parent;\r
- var oRoot;\r
- var oNextItem;\r
-\r
- switch(oEvent.keyCode) {\r
-\r
- case 38: // Up arrow\r
- case 40: // Down arrow\r
-\r
- if(\r
- oItem == this.activeItem &&\r
- !oItemCfg.getProperty("selected")\r
- ) {\r
-\r
- oItemCfg.setProperty("selected", true);\r
-\r
- }\r
- else {\r
-\r
- oNextItem = (oEvent.keyCode == 38) ?\r
- oItem.getPreviousEnabledSibling() :\r
- oItem.getNextEnabledSibling();\r
-\r
- if(oNextItem) {\r
-\r
- this.clearActiveItem();\r
-\r
- oNextItem.cfg.setProperty("selected", true);\r
- oNextItem.focus();\r
-\r
- }\r
-\r
- }\r
-\r
- Event.preventDefault(oEvent);\r
-\r
- break;\r
-\r
-\r
- case 39: // Right arrow\r
-\r
- oSubmenu = oItemCfg.getProperty("submenu");\r
-\r
- if(oSubmenu) {\r
-\r
- if(!oItemCfg.getProperty("selected")) {\r
-\r
- oItemCfg.setProperty("selected", true);\r
-\r
- }\r
-\r
- oSubmenu.show();\r
-\r
- oSubmenu.setInitialSelection();\r
-\r
- }\r
- else {\r
-\r
- oRoot = this.getRoot();\r
-\r
- if(oRoot instanceof YAHOO.widget.MenuBar) {\r
-\r
- oNextItem = oRoot.activeItem.getNextEnabledSibling();\r
-\r
- if(oNextItem) {\r
-\r
- oRoot.clearActiveItem();\r
-\r
- oNextItem.cfg.setProperty("selected", true);\r
-\r
- oSubmenu = oNextItem.cfg.getProperty("submenu");\r
-\r
- if(oSubmenu) {\r
-\r
- oSubmenu.show();\r
-\r
- }\r
-\r
- oNextItem.focus();\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
-\r
- Event.preventDefault(oEvent);\r
-\r
- break;\r
-\r
-\r
- case 37: // Left arrow\r
-\r
- if(oParentItem) {\r
-\r
- var oParentMenu = oParentItem.parent;\r
-\r
- if(oParentMenu instanceof YAHOO.widget.MenuBar) {\r
-\r
- oNextItem =\r
- oParentMenu.activeItem.getPreviousEnabledSibling();\r
-\r
- if(oNextItem) {\r
-\r
- oParentMenu.clearActiveItem();\r
-\r
- oNextItem.cfg.setProperty("selected", true);\r
-\r
- oSubmenu = oNextItem.cfg.getProperty("submenu");\r
-\r
- if(oSubmenu) {\r
-\r
- oSubmenu.show();\r
-\r
- }\r
-\r
- oNextItem.focus();\r
-\r
- }\r
-\r
- }\r
- else {\r
-\r
- this.hide();\r
-\r
- oParentItem.focus();\r
-\r
- }\r
-\r
- }\r
-\r
- Event.preventDefault(oEvent);\r
-\r
- break;\r
-\r
- }\r
-\r
- }\r
-\r
- if(oEvent.keyCode == 27) { // Esc key\r
-\r
- if(this.cfg.getProperty("position") == "dynamic") {\r
-\r
- this.hide();\r
-\r
- if(this.parent) {\r
-\r
- this.parent.focus();\r
-\r
- }\r
-\r
- }\r
- else if(this.activeItem) {\r
-\r
- oSubmenu = this.activeItem.cfg.getProperty("submenu");\r
-\r
- if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {\r
-\r
- oSubmenu.hide();\r
- this.activeItem.focus();\r
-\r
- }\r
- else {\r
-\r
- this.activeItem.cfg.setProperty("selected", false);\r
- this.activeItem.blur();\r
-\r
- }\r
-\r
- }\r
-\r
- Event.preventDefault(oEvent);\r
-\r
- }\r
-\r
-},\r
-\r
-// Private methods\r
-\r
-/**\r
-* @method _onInit\r
-* @description "init" event handler for the menu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-_onInit: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- if(\r
- (\r
- (this.parent && !this.lazyLoad) ||\r
- (!this.parent && this.cfg.getProperty("position") == "static") ||\r
- (\r
- !this.parent &&\r
- !this.lazyLoad &&\r
- this.cfg.getProperty("position") == "dynamic"\r
- )\r
- ) &&\r
- this.getItemGroups().length === 0\r
- ) {\r
-\r
- if(this.srcElement) {\r
-\r
- this._initSubTree();\r
-\r
- }\r
-\r
- if(this.itemData) {\r
-\r
- this.addItems(this.itemData);\r
-\r
- }\r
-\r
- }\r
- else if(this.lazyLoad) {\r
-\r
- this.cfg.fireQueue();\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _onBeforeRender\r
-* @description "beforerender" event handler for the menu. Appends all of the\r
-* <code><ul></code>, <code><li></code> and their accompanying\r
-* title elements to the body element of the menu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-_onBeforeRender: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- var oConfig = this.cfg;\r
- var oEl = this.element;\r
- var nListElements = this._aListElements.length;\r
-\r
- if(nListElements > 0) {\r
-\r
- var i = 0;\r
- var bFirstList = true;\r
- var oUL;\r
- var oGroupTitle;\r
-\r
- do {\r
-\r
- oUL = this._aListElements[i];\r
-\r
- if(oUL) {\r
-\r
- if(bFirstList) {\r
-\r
- Dom.addClass(oUL, "first-of-type");\r
- bFirstList = false;\r
-\r
- }\r
-\r
- if(!Dom.isAncestor(oEl, oUL)) {\r
-\r
- this.appendToBody(oUL);\r
-\r
- }\r
-\r
- oGroupTitle = this._aGroupTitleElements[i];\r
-\r
- if(oGroupTitle) {\r
-\r
- if(!Dom.isAncestor(oEl, oGroupTitle)) {\r
-\r
- oUL.parentNode.insertBefore(oGroupTitle, oUL);\r
-\r
- }\r
-\r
- Dom.addClass(oUL, "hastitle");\r
-\r
- }\r
-\r
- }\r
-\r
- i++;\r
-\r
- }\r
- while(i < nListElements);\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _onRender\r
-* @description "render" event handler for the menu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-_onRender: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- if(this.cfg.getProperty("position") == "dynamic") {\r
-\r
- var sWidth =\r
- this.element.parentNode.tagName.toUpperCase() == "BODY" ?\r
- this.element.offsetWidth : this._getOffsetWidth();\r
-\r
- this.cfg.setProperty("width", (sWidth + "px"));\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _onBeforeShow\r
-* @description "beforeshow" event handler for the menu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-_onBeforeShow: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- if(this.lazyLoad && this.getItemGroups().length === 0) {\r
-\r
- if(this.srcElement) {\r
-\r
- this._initSubTree();\r
-\r
- }\r
-\r
- if(this.itemData) {\r
-\r
- if(\r
- this.parent && this.parent.parent &&\r
- this.parent.parent.srcElement &&\r
- this.parent.parent.srcElement.tagName.toUpperCase() == "SELECT"\r
- ) {\r
-\r
- var nOptions = this.itemData.length;\r
-\r
- for(var n=0; n<nOptions; n++) {\r
-\r
- if(this.itemData[n].tagName) {\r
-\r
- this.addItem((new this.ITEM_TYPE(this.itemData[n])));\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
- else {\r
-\r
- this.addItems(this.itemData);\r
-\r
- }\r
-\r
- }\r
-\r
- if(this.srcElement) {\r
-\r
- this.render();\r
-\r
- }\r
- else {\r
-\r
- if(this.parent) {\r
-\r
- this.render(this.parent.element);\r
-\r
- }\r
- else {\r
-\r
- this.render(this.cfg.getProperty("container"));\r
-\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _onShow\r
-* @description "show" event handler for the menu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that fired\r
-* the event.\r
-*/\r
-_onShow: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- this.setInitialFocus();\r
-\r
- var oParent = this.parent;\r
-\r
- if(oParent) {\r
-\r
- var oParentMenu = oParent.parent;\r
-\r
- var aParentAlignment = oParentMenu.cfg.getProperty("submenualignment");\r
- var aAlignment = this.cfg.getProperty("submenualignment");\r
-\r
- if(\r
- (aParentAlignment[0] != aAlignment[0]) &&\r
- (aParentAlignment[1] != aAlignment[1])\r
- ) {\r
-\r
- this.cfg.setProperty(\r
- "submenualignment",\r
- [ aParentAlignment[0], aParentAlignment[1] ]\r
- );\r
-\r
- }\r
-\r
- if(\r
- !oParentMenu.cfg.getProperty("autosubmenudisplay") &&\r
- oParentMenu.cfg.getProperty("position") == "static"\r
- ) {\r
-\r
- oParentMenu.cfg.setProperty("autosubmenudisplay", true);\r
-\r
- /**\r
- * "click" event handler for the document\r
- * @private\r
- * @param {Event} p_oEvent Object reference for the DOM event object\r
- * passed back by the event utility (YAHOO.util.Event).\r
- */\r
- var disableAutoSubmenuDisplay = function(p_oEvent) {\r
-\r
- if(\r
- p_oEvent.type == "mousedown" ||\r
- (p_oEvent.type == "keydown" && p_oEvent.keyCode == 27)\r
- ) {\r
-\r
- /*\r
- Set the "autosubmenudisplay" to "false" if the user\r
- clicks outside the menu bar.\r
- */\r
-\r
- var oTarget = Event.getTarget(p_oEvent);\r
-\r
- if(\r
- oTarget != oParentMenu.element ||\r
- !YAHOO.util.Dom.isAncestor(oParentMenu.element, oTarget)\r
- ) {\r
-\r
- oParentMenu.cfg.setProperty(\r
- "autosubmenudisplay",\r
- false\r
- );\r
-\r
- Event.removeListener(\r
- document,\r
- "mousedown",\r
- disableAutoSubmenuDisplay\r
- );\r
-\r
- Event.removeListener(\r
- document,\r
- "keydown",\r
- disableAutoSubmenuDisplay\r
- );\r
-\r
- }\r
-\r
- }\r
-\r
- };\r
-\r
- Event.addListener(document, "mousedown", disableAutoSubmenuDisplay);\r
- Event.addListener(document, "keydown", disableAutoSubmenuDisplay);\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _onBeforeHide\r
-* @description "beforehide" event handler for the menu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that fired\r
-* the event.\r
-*/\r
-_onBeforeHide: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- this.clearActiveItem(true);\r
-\r
-},\r
-\r
-/**\r
-* @method _onParentMenuConfigChange\r
-* @description "configchange" event handler for a submenu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
-* subscribed to the event.\r
-*/\r
-_onParentMenuConfigChange: function(p_sType, p_aArgs, p_oSubmenu) {\r
-\r
- var sPropertyName = p_aArgs[0][0];\r
- var oPropertyValue = p_aArgs[0][1];\r
-\r
- switch(sPropertyName) {\r
-\r
- case "iframe":\r
- case "constraintoviewport":\r
- case "hidedelay":\r
- case "showdelay":\r
- case "clicktohide":\r
- case "effect":\r
-\r
- p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue);\r
-\r
- break;\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _onParentMenuRender\r
-* @description "render" event handler for a submenu. Renders a\r
-* submenu in response to the firing of its parent's "render" event.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
-* subscribed to the event.\r
-*/\r
-_onParentMenuRender: function(p_sType, p_aArgs, p_oSubmenu) {\r
-\r
- /*\r
- Set the "constraintoviewport" configuration\r
- property to match the parent Menu\r
- */\r
-\r
- var oParentMenu = p_oSubmenu.parent.parent;\r
-\r
- var oConfig = {\r
-\r
- constraintoviewport:\r
- oParentMenu.cfg.getProperty("constraintoviewport"),\r
-\r
- xy: [0,0],\r
-\r
- clicktohide:\r
- oParentMenu.cfg.getProperty("clicktohide"),\r
-\r
- effect:\r
- oParentMenu.cfg.getProperty("effect")\r
-\r
- };\r
-\r
- var nShowDelay = oParentMenu.cfg.getProperty("showdelay");\r
-\r
- if(nShowDelay > 0) {\r
-\r
- oConfig.showdelay = nShowDelay;\r
-\r
- }\r
-\r
- var nHideDelay = oParentMenu.cfg.getProperty("hidedelay");\r
-\r
- if(nHideDelay > 0) {\r
-\r
- oConfig.hidedelay = nHideDelay;\r
-\r
- }\r
-\r
- /*\r
- Only sync the "iframe" configuration property if the parent\r
- menu's "position" configuration is the same.\r
- */\r
-\r
- if(\r
- this.cfg.getProperty("position") ==\r
- oParentMenu.cfg.getProperty("position")\r
- ) {\r
-\r
- oConfig.iframe = oParentMenu.cfg.getProperty("iframe");\r
-\r
- }\r
-\r
-\r
- p_oSubmenu.cfg.applyConfig(oConfig);\r
-\r
- if(!this.lazyLoad) {\r
-\r
- if(Dom.inDocument(this.element)) {\r
-\r
- this.render();\r
-\r
- }\r
- else {\r
-\r
- this.render(this.parent.element);\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method _onSubmenuBeforeShow\r
-* @description "beforeshow" event handler for a submenu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
-* subscribed to the event.\r
-*/\r
-_onSubmenuBeforeShow: function(p_sType, p_aArgs, p_oSubmenu) {\r
-\r
- var oParent = this.parent;\r
- var aAlignment = oParent.parent.cfg.getProperty("submenualignment");\r
-\r
- this.cfg.setProperty(\r
- "context",\r
- [oParent.element, aAlignment[0], aAlignment[1]]\r
- );\r
-\r
- oParent.submenuIndicator.alt = oParent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;\r
-\r
-},\r
-\r
-/**\r
-* @method _onSubmenuShow\r
-* @description "show" event handler for a submenu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
-* subscribed to the event.\r
-*/\r
-_onSubmenuShow: function(p_sType, p_aArgs, p_oSubmenu) {\r
-\r
- var oParent = this.parent;\r
-\r
- oParent.submenuIndicator.alt = oParent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;\r
-\r
-},\r
-\r
-/**\r
-* @method _onSubmenuHide\r
-* @description "hide" Custom Event handler for a submenu.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r
-* subscribed to the event.\r
-*/\r
-_onSubmenuHide: function(p_sType, p_aArgs, p_oSubmenu) {\r
-\r
- var oParent = this.parent;\r
-\r
- oParent.submenuIndicator.alt = oParent.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;\r
-\r
-},\r
-\r
-/**\r
-* @method _onMenuItemFocus\r
-* @description "focus" event handler for the menu's items.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
-* that fired the event.\r
-*/\r
-_onMenuItemFocus: function(p_sType, p_aArgs, p_oItem) {\r
-\r
- this.activeItem = p_oItem;\r
-\r
-},\r
-\r
-/**\r
-* @method _onMenuItemBlur\r
-* @description "blur" event handler for the menu's items.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event\r
-* that was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-*/\r
-_onMenuItemBlur: function(p_sType, p_aArgs) {\r
-\r
- this.activeItem = null;\r
-\r
-},\r
-\r
-/**\r
-* @method _onMenuItemConfigChange\r
-* @description "configchange" event handler for the menu's items.\r
-* @private\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r
-* that fired the event.\r
-*/\r
-_onMenuItemConfigChange: function(p_sType, p_aArgs, p_oItem) {\r
-\r
- var sProperty = p_aArgs[0][0];\r
-\r
- switch(sProperty) {\r
-\r
- case "submenu":\r
-\r
- var oSubmenu = p_aArgs[0][1];\r
-\r
- if(oSubmenu) {\r
-\r
- this._configureSubmenu(p_oItem);\r
-\r
- }\r
-\r
- break;\r
-\r
- case "text":\r
- case "helptext":\r
-\r
- /*\r
- A change to an item's "text" or "helptext"\r
- configuration properties requires the width of the parent\r
- menu to be recalculated.\r
- */\r
-\r
- if(this.element.style.width) {\r
-\r
- var sWidth = this._getOffsetWidth() + "px";\r
-\r
- Dom.setStyle(this.element, "width", sWidth);\r
-\r
- }\r
-\r
- break;\r
-\r
- }\r
-\r
-},\r
-\r
-// Public event handlers for configuration properties\r
-\r
-/**\r
-* @method enforceConstraints\r
-* @description The default event handler executed when the moveEvent is fired,\r
-* if the "constraintoviewport" configuration property is set to true.\r
-* @param {String} type The name of the event that was fired.\r
-* @param {Array} args Collection of arguments sent when the\r
-* event was fired.\r
-* @param {Array} obj Array containing the current Menu instance\r
-* and the item that fired the event.\r
-*/\r
-enforceConstraints: function(type, args, obj) {\r
-\r
- var oConfig = this.cfg;\r
-\r
- var pos = args[0];\r
-\r
- var x = pos[0];\r
- var y = pos[1];\r
-\r
- var bod = document.getElementsByTagName('body')[0];\r
- var htm = document.getElementsByTagName('html')[0];\r
-\r
- var bodyOverflow = Dom.getStyle(bod, "overflow");\r
- var htmOverflow = Dom.getStyle(htm, "overflow");\r
-\r
- var offsetHeight = this.element.offsetHeight;\r
- var offsetWidth = this.element.offsetWidth;\r
-\r
- var viewPortWidth = Dom.getClientWidth();\r
- var viewPortHeight = Dom.getClientHeight();\r
-\r
- var scrollX = window.scrollX || document.body.scrollLeft;\r
- var scrollY = window.scrollY || document.body.scrollTop;\r
-\r
- var topConstraint = scrollY + 10;\r
- var leftConstraint = scrollX + 10;\r
- var bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10;\r
- var rightConstraint = scrollX + viewPortWidth - offsetWidth - 10;\r
-\r
- var aContext = oConfig.getProperty("context");\r
- var oContextElement = aContext ? aContext[0] : null;\r
-\r
-\r
- if (x < 10) {\r
-\r
- x = leftConstraint;\r
-\r
- } else if ((x + offsetWidth) > viewPortWidth) {\r
-\r
- if(\r
- oContextElement &&\r
- ((x - oContextElement.offsetWidth) > offsetWidth)\r
- ) {\r
-\r
- x = (x - (oContextElement.offsetWidth + offsetWidth));\r
-\r
- }\r
- else {\r
-\r
- x = rightConstraint;\r
-\r
- }\r
-\r
- }\r
-\r
- if (y < 10) {\r
-\r
- y = topConstraint;\r
-\r
- } else if (y > bottomConstraint) {\r
-\r
- if(oContextElement && (y > offsetHeight)) {\r
-\r
- y = ((y + oContextElement.offsetHeight) - offsetHeight);\r
-\r
- }\r
- else {\r
-\r
- y = bottomConstraint;\r
-\r
- }\r
-\r
- }\r
-\r
- oConfig.setProperty("x", x, true);\r
- oConfig.setProperty("y", y, true);\r
-\r
-},\r
-\r
-/**\r
-* @method configVisible\r
-* @description Event handler for when the "visible" configuration property\r
-* the menu changes.\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-configVisible: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- if(this.cfg.getProperty("position") == "dynamic") {\r
-\r
- YAHOO.widget.Menu.superclass.configVisible.call(\r
- this,\r
- p_sType,\r
- p_aArgs,\r
- p_oMenu\r
- );\r
-\r
- }\r
- else {\r
-\r
- var bVisible = p_aArgs[0];\r
- var sDisplay = Dom.getStyle(this.element, "display");\r
-\r
- if(bVisible) {\r
-\r
- if(sDisplay != "block") {\r
- this.beforeShowEvent.fire();\r
- Dom.setStyle(this.element, "display", "block");\r
- this.showEvent.fire();\r
- }\r
-\r
- }\r
- else {\r
-\r
- if(sDisplay == "block") {\r
- this.beforeHideEvent.fire();\r
- Dom.setStyle(this.element, "display", "none");\r
- this.hideEvent.fire();\r
- }\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method configPosition\r
-* @description Event handler for when the "position" configuration property\r
-* of the menu changes.\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-configPosition: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- var sCSSPosition = p_aArgs[0] == "static" ? "static" : "absolute";\r
- var oCfg = this.cfg;\r
-\r
- Dom.setStyle(this.element, "position", sCSSPosition);\r
-\r
- if(sCSSPosition == "static") {\r
-\r
- /*\r
- Remove the iframe for statically positioned menus since it will\r
- intercept mouse events.\r
- */\r
-\r
- oCfg.setProperty("iframe", false);\r
-\r
- // Statically positioned menus are visible by default\r
-\r
- Dom.setStyle(this.element, "display", "block");\r
-\r
- oCfg.setProperty("visible", true);\r
-\r
- }\r
- else {\r
-\r
- /*\r
- Even though the "visible" property is queued to\r
- "false" by default, we need to set the "visibility" property to\r
- "hidden" since Overlay's "configVisible" implementation checks the\r
- element's "visibility" style property before deciding whether\r
- or not to show an Overlay instance.\r
- */\r
-\r
- Dom.setStyle(this.element, "visibility", "hidden");\r
-\r
- }\r
-\r
- if(sCSSPosition == "absolute") {\r
-\r
- var nZIndex = oCfg.getProperty("zindex");\r
-\r
- if(!nZIndex || nZIndex === 0) {\r
-\r
- nZIndex = this.parent ?\r
- (this.parent.parent.cfg.getProperty("zindex") + 1) : 1;\r
-\r
- oCfg.setProperty("zindex", nZIndex);\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method configIframe\r
-* @description Event handler for when the "iframe" configuration property of\r
-* the menu changes.\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-configIframe: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- if(this.cfg.getProperty("position") == "dynamic") {\r
-\r
- YAHOO.widget.Menu.superclass.configIframe.call(\r
- this,\r
- p_sType,\r
- p_aArgs,\r
- p_oMenu\r
- );\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method configHideDelay\r
-* @description Event handler for when the "hidedelay" configuration property\r
-* of the menu changes.\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-configHideDelay: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- var nHideDelay = p_aArgs[0];\r
- var oMouseOutEvent = this.mouseOutEvent;\r
- var oMouseOverEvent = this.mouseOverEvent;\r
- var oKeyDownEvent = this.keyDownEvent;\r
-\r
- if(nHideDelay > 0) {\r
-\r
- /*\r
- Only assign event handlers once. This way the user change\r
- the value for the hidedelay as many times as they want.\r
- */\r
-\r
- if(!this._hideDelayEventHandlersAssigned) {\r
-\r
- oMouseOutEvent.subscribe(this._execHideDelay, true);\r
- oMouseOverEvent.subscribe(this._cancelHideDelay, this, true);\r
- oKeyDownEvent.subscribe(this._cancelHideDelay, this, true);\r
-\r
- this._hideDelayEventHandlersAssigned = true;\r
-\r
- }\r
-\r
- }\r
- else {\r
-\r
- oMouseOutEvent.unsubscribe(this._execHideDelay, this);\r
- oMouseOverEvent.unsubscribe(this._cancelHideDelay, this);\r
- oKeyDownEvent.unsubscribe(this._cancelHideDelay, this);\r
-\r
- this._hideDelayEventHandlersAssigned = false;\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method configContainer\r
-* @description Event handler for when the "container" configuration property\r
-of the menu changes.\r
-* @param {String} p_sType String representing the name of the event that\r
-* was fired.\r
-* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
-* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r
-* fired the event.\r
-*/\r
-configContainer: function(p_sType, p_aArgs, p_oMenu) {\r
-\r
- var oElement = p_aArgs[0];\r
-\r
- if(typeof oElement == 'string') {\r
-\r
- this.cfg.setProperty(\r
- "container",\r
- document.getElementById(oElement),\r
- true\r
- );\r
-\r
- }\r
-\r
-},\r
-\r
-// Public methods\r
-\r
-/**\r
-* Event handler called when the resize monitor element's "resize" evet is fired.\r
-*/\r
-onDomResize: function(e, obj) {\r
-\r
- if(!this._handleResize) {\r
-\r
- this._handleResize = true;\r
- return;\r
-\r
- }\r
-\r
- var oConfig = this.cfg;\r
-\r
- if(oConfig.getProperty("position") == "dynamic") {\r
-\r
- oConfig.setProperty("width", (this._getOffsetWidth() + "px"));\r
-\r
- }\r
-\r
- YAHOO.widget.Menu.superclass.onDomResize.call(this, e, obj);\r
-\r
-},\r
-\r
-/**\r
-* @method initEvents\r
-* @description Initializes the custom events for the menu.\r
-*/\r
-initEvents: function() {\r
-\r
- YAHOO.widget.Menu.superclass.initEvents.call(this);\r
-\r
- // Create custom events\r
-\r
- var CustomEvent = YAHOO.util.CustomEvent;\r
-\r
- this.mouseOverEvent = new CustomEvent("mouseOverEvent", this);\r
- this.mouseOutEvent = new CustomEvent("mouseOutEvent", this);\r
- this.mouseDownEvent = new CustomEvent("mouseDownEvent", this);\r
- this.mouseUpEvent = new CustomEvent("mouseUpEvent", this);\r
- this.clickEvent = new CustomEvent("clickEvent", this);\r
- this.keyPressEvent = new CustomEvent("keyPressEvent", this);\r
- this.keyDownEvent = new CustomEvent("keyDownEvent", this);\r
- this.keyUpEvent = new CustomEvent("keyUpEvent", this);\r
- this.itemAddedEvent = new CustomEvent("itemAddedEvent", this);\r
- this.itemRemovedEvent = new CustomEvent("itemRemovedEvent", this);\r
-\r
-},\r
-\r
-/**\r
-* @method getRoot\r
-* @description Finds the menu's root menu.\r
-*/\r
-getRoot: function() {\r
-\r
- var oItem = this.parent;\r
-\r
- if(oItem) {\r
-\r
- var oParentMenu = oItem.parent;\r
-\r
- return oParentMenu ? oParentMenu.getRoot() : this;\r
-\r
- }\r
- else {\r
-\r
- return this;\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method toString\r
-* @description Returns a string representing the menu.\r
-* @return {String}\r
-*/\r
-toString: function() {\r
-\r
- return ("Menu " + this.id);\r
-\r
-},\r
-\r
-/**\r
-* @method setItemGroupTitle\r
-* @description Sets the title of a group of menu items.\r
-* @param {String} p_sGroupTitle String specifying the title of the group.\r
-* @param {Number} p_nGroupIndex Optional. Number specifying the group to which\r
-* the title belongs.\r
-*/\r
-setItemGroupTitle: function(p_sGroupTitle, p_nGroupIndex) {\r
-\r
- if(typeof p_sGroupTitle == "string" && p_sGroupTitle.length > 0) {\r
-\r
- var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0;\r
- var oTitle = this._aGroupTitleElements[nGroupIndex];\r
-\r
- if(oTitle) {\r
-\r
- oTitle.innerHTML = p_sGroupTitle;\r
-\r
- }\r
- else {\r
-\r
- oTitle = document.createElement(this.GROUP_TITLE_TAG_NAME);\r
-\r
- oTitle.innerHTML = p_sGroupTitle;\r
-\r
- this._aGroupTitleElements[nGroupIndex] = oTitle;\r
-\r
- }\r
-\r
- var i = this._aGroupTitleElements.length - 1;\r
- var nFirstIndex;\r
-\r
- do {\r
-\r
- if(this._aGroupTitleElements[i]) {\r
-\r
- Dom.removeClass(this._aGroupTitleElements[i], "first-of-type");\r
-\r
- nFirstIndex = i;\r
-\r
- }\r
-\r
- }\r
- while(i--);\r
-\r
- if(nFirstIndex !== null) {\r
-\r
- Dom.addClass(\r
- this._aGroupTitleElements[nFirstIndex],\r
- "first-of-type"\r
- );\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method addItem\r
-* @description Appends an item to the menu.\r
-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
-* instance to be added to the menu.\r
-* @param {String} p_oItem String specifying the text of the item to be added\r
-* to the menu.\r
-* @param {Object} p_oItem Object literal containing a set of menu item\r
-* configuration properties.\r
-* @param {Number} p_nGroupIndex Optional. Number indicating the group to\r
-* which the item belongs.\r
-* @return {YAHOO.widget.MenuItem}\r
-*/\r
-addItem: function(p_oItem, p_nGroupIndex) {\r
-\r
- if(p_oItem) {\r
-\r
- return this._addItemToGroup(p_nGroupIndex, p_oItem);\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method addItems\r
-* @description Adds an array of items to the menu.\r
-* @param {Array} p_aItems Array of items to be added to the menu. The array\r
-* can contain strings specifying the text for each item to be created, object\r
-* literals specifying each of the menu item configuration properties,\r
-* or MenuItem instances.\r
-* @param {Number} p_nGroupIndex Optional. Number specifying the group to\r
-* which the items belongs.\r
-* @return {Array}\r
-*/\r
-addItems: function(p_aItems, p_nGroupIndex) {\r
-\r
- function isArray(p_oValue) {\r
-\r
- return (typeof p_oValue == "object" && p_oValue.constructor == Array);\r
-\r
- }\r
-\r
- if(isArray(p_aItems)) {\r
-\r
- var nItems = p_aItems.length;\r
- var aItems = [];\r
- var oItem;\r
-\r
- for(var i=0; i<nItems; i++) {\r
-\r
- oItem = p_aItems[i];\r
-\r
- if(isArray(oItem)) {\r
-\r
- aItems[aItems.length] = this.addItems(oItem, i);\r
-\r
- }\r
- else {\r
-\r
- aItems[aItems.length] =\r
- this._addItemToGroup(p_nGroupIndex, oItem);\r
-\r
- }\r
-\r
- }\r
-\r
- if(aItems.length) {\r
-\r
- return aItems;\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method insertItem\r
-* @description Inserts an item into the menu at the specified index.\r
-* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r
-* instance to be added to the menu.\r
-* @param {String} p_oItem String specifying the text of the item to be added\r
-* to the menu.\r
-* @param {Object} p_oItem Object literal containing a set of menu item\r
-* configuration properties.\r
-* @param {Number} p_nItemIndex Number indicating the ordinal position at which\r
-* the item should be added.\r
-* @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r
-* the item belongs.\r
-* @return {YAHOO.widget.MenuItem}\r
-*/\r
-insertItem: function(p_oItem, p_nItemIndex, p_nGroupIndex) {\r
-\r
- if(p_oItem) {\r
-\r
- return this._addItemToGroup(p_nGroupIndex, p_oItem, p_nItemIndex);\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method removeItem\r
-* @description Removes the specified item from the menu.\r
-* @param {YAHOO.widget.MenuItem} p_oObject Object reference for the MenuItem\r
-* instance to be removed from the menu.\r
-* @param {Number} p_oObject Number specifying the index of the item\r
-* to be removed.\r
-* @param {Number} p_nGroupIndex Optional. Number specifying the group to\r
-* which the item belongs.\r
-* @return {YAHOO.widget.MenuItem}\r
-*/\r
-removeItem: function(p_oObject, p_nGroupIndex) {\r
-\r
- if(typeof p_oObject != "undefined") {\r
-\r
- var oItem;\r
-\r
- if(p_oObject instanceof YAHOO.widget.MenuItem) {\r
-\r
- oItem = this._removeItemFromGroupByValue(p_nGroupIndex, p_oObject);\r
-\r
- }\r
- else if(typeof p_oObject == "number") {\r
-\r
- oItem = this._removeItemFromGroupByIndex(p_nGroupIndex, p_oObject);\r
-\r
- }\r
-\r
- if(oItem) {\r
-\r
- oItem.destroy();\r
-\r
- return oItem;\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method getItemGroups\r
-* @description Returns a multi-dimensional array of all of the items in the menu.\r
-* @return {Array}\r
-*/\r
-getItemGroups: function() {\r
-\r
- return this._aItemGroups;\r
-\r
-},\r
-\r
-/**\r
-* @method getItem\r
-* @description Returns the item at the specified index.\r
-* @param {Number} p_nItemIndex Number indicating the ordinal position of the\r
-* item to be retrieved.\r
-* @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r
-* the item belongs.\r
-* @return {YAHOO.widget.MenuItem}\r
-*/\r
-getItem: function(p_nItemIndex, p_nGroupIndex) {\r
-\r
- if(typeof p_nItemIndex == "number") {\r
-\r
- var aGroup = this._getItemGroup(p_nGroupIndex);\r
-\r
- if(aGroup) {\r
-\r
- return aGroup[p_nItemIndex];\r
-\r
- }\r
-\r
- }\r
-\r
-},\r
-\r
-/**\r
-* @method destroy\r
-* @description Removes the menu's <code><div></code> element\r
-* (and accompanying child nodes) from the document.\r
-*/\r
-destroy: function() {\r
-\r
- // Remove Custom Event listeners\r
-\r
- this.mouseOverEvent.unsubscribeAll();\r
- this.mouseOutEvent.unsubscribeAll();\r
- this.mouseDownEvent.unsubscribeAll();\r
- this.mouseUpEvent.unsubscribeAll();\r
- this.clickEvent.unsubscribeAll();\r
- this.keyPressEvent.unsubscribeAll();\r
- this.keyDownEvent.unsubscribeAll();\r
- this.keyUpEvent.unsubscribeAll();\r
-\r
- var nItemGroups = this._aItemGroups.length;\r
- var nItems;\r
- var oItemGroup;\r
- var oItem;\r
- var i;\r
- var n;\r
-\r
- // Remove all items\r
-\r
- if(nItemGroups > 0) {\r
-\r
- i = nItemGroups - 1;\r
-\r
- do {\r
-\r
- oItemGroup = this._aItemGroups[i];\r
-\r
- if(oItemGroup) {\r
-\r
- nItems = oItemGroup.length;\r
-\r
- if(nItems > 0) {\r
+ /**\r
+ * @method onItemAdded\r
+ * @description "itemadded" event handler for a Menu instance.\r
+ * @private\r
+ * @param {String} p_sType String representing the name of the event that\r
+ * was fired.\r
+ * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+ */\r
+ function onItemAdded(p_sType, p_aArgs) {\r
\r
- n = nItems - 1;\r
+ addItem(p_aArgs[0]);\r
\r
- do {\r
+ }\r
\r
- oItem = this._aItemGroups[i][n];\r
\r
- if(oItem) {\r
+ /**\r
+ * @method onItemRemoved\r
+ * @description "itemremoved" event handler for a Menu instance.\r
+ * @private\r
+ * @param {String} p_sType String representing the name of the event that\r
+ * was fired.\r
+ * @param {Array} p_aArgs Array of arguments sent when the event was fired.\r
+ */\r
+ function onItemRemoved(p_sType, p_aArgs) {\r
\r
- oItem.destroy();\r
- }\r
+ removeItem(p_aArgs[0]);\r
\r
- }\r
- while(n--);\r
+ }\r
\r
- }\r
+ return {\r
\r
- }\r
+ // Privileged methods\r
\r
- }\r
- while(i--);\r
+ /**\r
+ * @method addMenu\r
+ * @description Adds a menu to the collection of known menus.\r
+ * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu\r
+ * instance to be added.\r
+ */\r
+ addMenu: function(p_oMenu) {\r
\r
- }\r
+ if(p_oMenu && p_oMenu.id && !m_oMenus[p_oMenu.id]) {\r
\r
- // Continue with the superclass implementation of this method\r
+ m_oMenus[p_oMenu.id] = p_oMenu;\r
\r
- YAHOO.widget.Menu.superclass.destroy.call(this);\r
\r
+ if(!m_bInitializedEventHandlers) {\r
\r
-},\r
+ var oDoc = document;\r
\r
-/**\r
-* @method setInitialFocus\r
-* @description Sets focus to the menu's first enabled item.\r
-*/\r
-setInitialFocus: function() {\r
+ Event.addListener(oDoc, "mouseover", onDOMEvent, me, true);\r
+ Event.addListener(oDoc, "mouseout", onDOMEvent, me, true);\r
+ Event.addListener(oDoc, "mousedown", onDOMEvent, me, true);\r
+ Event.addListener(oDoc, "mouseup", onDOMEvent, me, true);\r
+ Event.addListener(oDoc, "click", onDOMEvent, me, true);\r
+ Event.addListener(oDoc, "keydown", onDOMEvent, me, true);\r
+ Event.addListener(oDoc, "keyup", onDOMEvent, me, true);\r
+ Event.addListener(oDoc, "keypress", onDOMEvent, me, true);\r
\r
- var oItem = this._getFirstEnabledItem();\r
+ m_bInitializedEventHandlers = true;\r
\r
- if(oItem) {\r
\r
- oItem.focus();\r
- }\r
+ }\r
\r
-},\r
+ p_oMenu.destroyEvent.subscribe(onMenuDestroy, p_oMenu, me);\r
\r
-/**\r
-* @method setInitialSelection\r
-* @description Sets the "selected" configuration property of the menu's first\r
-* enabled item to "true."\r
-*/\r
-setInitialSelection: function() {\r
+ p_oMenu.cfg.subscribeToConfigEvent(\r
+ "visible",\r
+ onMenuVisibleConfigChange,\r
+ p_oMenu\r
+ );\r
\r
- var oItem = this._getFirstEnabledItem();\r
+ p_oMenu.itemAddedEvent.subscribe(onItemAdded);\r
+ p_oMenu.itemRemovedEvent.subscribe(onItemRemoved);\r
\r
- if(oItem) {\r
\r
- oItem.cfg.setProperty("selected", true);\r
- }\r
+ }\r
\r
-},\r
+ },\r
\r
-/**\r
-* @method clearActiveItem\r
-* @description Sets the "selected" configuration property of the menu's active\r
-* item to "false" and hides the item's submenu.\r
-* @param {Boolean} p_bBlur Boolean indicating if the menu's active item\r
-* should be blurred.\r
-*/\r
-clearActiveItem: function(p_bBlur) {\r
\r
- if(this.cfg.getProperty("showdelay") > 0) {\r
+ /**\r
+ * @method removeMenu\r
+ * @description Removes a menu from the collection of known menus.\r
+ * @param {YAHOO.widget.Menu} p_oMenu Object specifying the Menu\r
+ * instance to be removed.\r
+ */\r
+ removeMenu: function(p_oMenu) {\r
\r
- this._cancelShowDelay();\r
+ if(p_oMenu && m_oMenus[p_oMenu.id]) {\r
\r
- }\r
+ delete m_oMenus[p_oMenu.id];\r
\r
- var oActiveItem = this.activeItem;\r
\r
- if(oActiveItem) {\r
+ }\r
\r
- var oConfig = oActiveItem.cfg;\r
+ },\r
\r
- oConfig.setProperty("selected", false);\r
\r
- var oSubmenu = oConfig.getProperty("submenu");\r
+ /**\r
+ * @method hideVisible\r
+ * @description Hides all visible, dynamically positioned menus.\r
+ */\r
+ hideVisible: function() {\r
\r
- if(oSubmenu) {\r
+ var oMenu;\r
\r
- oSubmenu.hide();\r
+ for(var i in m_oVisibleMenus) {\r
\r
- }\r
+ if(m_oVisibleMenus.hasOwnProperty(i)) {\r
\r
- if(p_bBlur) {\r
+ oMenu = m_oVisibleMenus[i];\r
\r
- oActiveItem.blur();\r
+ if(oMenu.cfg.getProperty("position") == "dynamic") {\r
\r
- }\r
+ oMenu.hide();\r
\r
- }\r
+ }\r
\r
-},\r
+ }\r
\r
-/**\r
-* @description Initializes the class's configurable properties which can be\r
-* changed using the menu's Config object ("cfg").\r
-* @method initDefaultConfig\r
-*/\r
-initDefaultConfig: function() {\r
+ }\r
\r
- YAHOO.widget.Menu.superclass.initDefaultConfig.call(this);\r
+ },\r
\r
- var oConfig = this.cfg;\r
+ /**\r
+ * @method getMenus\r
+ * @description Returns an array of all menus registered with the\r
+ * menu manger.\r
+ * @return {Array}\r
+ */\r
+ getMenus: function() {\r
\r
- // Add configuration properties\r
+ return m_oMenus;\r
\r
- /*\r
- Change the default value for the "visible" configuration\r
- property to "false" by re-adding the property.\r
- */\r
+ },\r
\r
- /**\r
- * @config visible\r
- * @description Boolean indicating whether or not the menu is visible. If\r
- * the menu's "position" configuration property is set to "dynamic" (the\r
- * default), this property toggles the menu's <code><div></code>\r
- * element's "visibility" style property between "visible" (true) or\r
- * "hidden" (false). If the menu's "position" configuration property is\r
- * set to "static" this property toggles the menu's\r
- * <code><div></code> element's "display" style property\r
- * between "block" (true) or "none" (false).\r
- * @default false\r
- * @type Boolean\r
- */\r
- oConfig.addProperty(\r
- "visible",\r
- {\r
- value:false,\r
- handler:this.configVisible,\r
- validator:this.cfg.checkBoolean\r
- }\r
- );\r
+ /**\r
+ * @method getMenu\r
+ * @description Returns a menu with the specified id.\r
+ * @param {String} p_sId String specifying the id of the menu to\r
+ * be retrieved.\r
+ * @return {YAHOO.widget.Menu}\r
+ */\r
+ getMenu: function(p_sId) {\r
\r
- /*\r
- Change the default value for the "constraintoviewport" configuration\r
- property to "true" by re-adding the property.\r
- */\r
+ if(m_oMenus[p_sId]) {\r
\r
- /**\r
- * @config constraintoviewport\r
- * @description Boolean indicating if the menu will try to remain inside\r
- * the boundaries of the size of viewport.\r
- * @default true\r
- * @type Boolean\r
- */\r
- oConfig.addProperty(\r
- "constraintoviewport",\r
- {\r
- value:true,\r
- handler:this.configConstrainToViewport,\r
- validator:this.cfg.checkBoolean,\r
- supercedes:["iframe","x","y","xy"]\r
- }\r
- );\r
+ return m_oMenus[p_sId];\r
\r
- /**\r
- * @config position\r
- * @description String indicating how a menu should be positioned on the\r
- * screen. Possible values are "static" and "dynamic." Static menus are\r
- * visible by default and reside in the normal flow of the document\r
- * (CSS position: static). Dynamic menus are hidden by default, reside\r
- * out of the normal flow of the document (CSS position: absolute), and\r
- * can overlay other elements on the screen.\r
- * @default dynamic\r
- * @type String\r
- */\r
- oConfig.addProperty(\r
- "position",\r
- {\r
- value: "dynamic",\r
- handler: this.configPosition,\r
- validator: this._checkPosition,\r
- supercedes: ["visible"]\r
- }\r
- );\r
+ }\r
\r
- /**\r
- * @config submenualignment\r
- * @description Array defining how submenus should be aligned to their\r
- * parent menu item. The format is: [itemCorner, submenuCorner]. By default\r
- * a submenu's top left corner is aligned to its parent menu item's top\r
- * right corner.\r
- * @default ["tl","tr"]\r
- * @type Array\r
- */\r
- oConfig.addProperty("submenualignment", { value: ["tl","tr"] } );\r
+ },\r
\r
- /**\r
- * @config autosubmenudisplay\r
- * @description Boolean indicating if submenus are automatically made\r
- * visible when the user mouses over the menu's items.\r
- * @default true\r
- * @type Boolean\r
- */\r
- oConfig.addProperty(\r
- "autosubmenudisplay",\r
- {\r
- value: true,\r
- validator: oConfig.checkBoolean\r
- }\r
- );\r
\r
- /**\r
- * @config showdelay\r
- * @description Number indicating the time (in milliseconds) that should\r
- * expire before a submenu is made visible when the user mouses over\r
- * the menu's items.\r
- * @default 0\r
- * @type Number\r
- */\r
- oConfig.addProperty(\r
- "showdelay",\r
- {\r
- value: 0,\r
- validator: oConfig.checkNumber\r
- }\r
- );\r
+ /**\r
+ * @method toString\r
+ * @description Returns a string representing the menu manager.\r
+ * @return {String}\r
+ */\r
+ toString: function() {\r
\r
- /**\r
- * @config hidedelay\r
- * @description Number indicating the time (in milliseconds) that should\r
- * expire before the menu is hidden.\r
- * @default 0\r
- * @type Number\r
- */\r
- oConfig.addProperty(\r
- "hidedelay",\r
- {\r
- value: 0,\r
- validator: oConfig.checkNumber,\r
- handler: this.configHideDelay,\r
- suppressEvent: true\r
- }\r
- );\r
+ return ("MenuManager");\r
\r
- /**\r
- * @config clicktohide\r
- * @description Boolean indicating if the menu will automatically be\r
- * hidden if the user clicks outside of it.\r
- * @default true\r
- * @type Boolean\r
- */\r
- oConfig.addProperty(\r
- "clicktohide",\r
- {\r
- value: true,\r
- validator: oConfig.checkBoolean\r
}\r
- );\r
-\r
- /**\r
- * @config container\r
- * @description HTML element reference or string specifying the id\r
- * attribute of the HTML element that the menu's markup should be rendered into.\r
- * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r
- * level-one-html.html#ID-58190037">HTMLElement</a>|String\r
- * @default document.body\r
- */\r
- this.cfg.addProperty(\r
- "container",\r
- { value:document.body, handler:this.configContainer }\r
- );\r
\r
-}\r
-\r
-}); // END YAHOO.extend\r
+ };\r
\r
+}();\r
+\r
+})();\r\r
+\r\r
+\r\r
+(function() {\r\r
+\r\r
+var Dom = YAHOO.util.Dom,\r\r
+ Event = YAHOO.util.Event;\r\r
+\r\r
+\r\r
+/**\r\r
+* The Menu class creates a container that holds a vertical list representing\r\r
+* a set of options or commands. Menu is the base class for all\r\r
+* menu containers.\r\r
+* @param {String} p_oElement String specifying the id attribute of the\r\r
+* <code><div></code> element of the menu.\r\r
+* @param {String} p_oElement String specifying the id attribute of the\r\r
+* <code><select></code> element to be used as the data source\r\r
+* for the menu.\r\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r\r
+* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object\r\r
+* specifying the <code><div></code> element of the menu.\r\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r\r
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement\r\r
+* Object specifying the <code><select></code> element to be used as\r\r
+* the data source for the menu.\r\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r\r
+* configuration for the menu. See configuration class documentation for\r\r
+* more details.\r\r
+* @namespace YAHOO.widget\r\r
+* @class Menu\r\r
+* @constructor\r\r
+* @extends YAHOO.widget.Overlay\r\r
+*/\r\r
+YAHOO.widget.Menu = function(p_oElement, p_oConfig) {\r\r
+\r\r
+ if(p_oConfig) {\r\r
+\r\r
+ this.parent = p_oConfig.parent;\r\r
+\r\r
+ this.lazyLoad = p_oConfig.lazyLoad || p_oConfig.lazyload;\r\r
+\r\r
+ this.itemData = p_oConfig.itemData || p_oConfig.itemdata;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.constructor.call(\r\r
+ this,\r\r
+ p_oElement,\r\r
+ p_oConfig\r\r
+ );\r\r
+\r\r
+};\r\r
+\r\r
+YAHOO.extend(YAHOO.widget.Menu, YAHOO.widget.Overlay, {\r\r
+\r\r
+\r\r
+\r\r
+// Constants\r\r
+\r\r
+\r\r
+/**\r\r
+* @property CSS_CLASS_NAME\r\r
+* @description String representing the CSS class(es) to be applied to the\r\r
+* menu's <code><div></code> element.\r\r
+* @default "yuimenu"\r\r
+* @final\r\r
+* @type String\r\r
+*/\r\r
+CSS_CLASS_NAME: "yuimenu",\r\r
+\r\r
+\r\r
+/**\r\r
+* @property ITEM_TYPE\r\r
+* @description Object representing the type of menu item to instantiate and\r\r
+* add when parsing the child nodes (either <code><li></code> element,\r\r
+* <code><optgroup></code> element or <code><option></code>)\r\r
+* of the menu's source HTML element.\r\r
+* @default YAHOO.widget.MenuItem\r\r
+* @final\r\r
+* @type YAHOO.widget.MenuItem\r\r
+*/\r\r
+ITEM_TYPE: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property GROUP_TITLE_TAG_NAME\r\r
+* @description String representing the tagname of the HTML element used to\r\r
+* title the menu's item groups.\r\r
+* @default H6\r\r
+* @final\r\r
+* @type String\r\r
+*/\r\r
+GROUP_TITLE_TAG_NAME: "h6",\r\r
+\r\r
+\r\r
+\r\r
+// Private properties\r\r
+\r\r
+\r\r
+/**\r\r
+* @property _nHideDelayId\r\r
+* @description Number representing the time-out setting used to cancel the\r\r
+* hiding of a menu.\r\r
+* @default null\r\r
+* @private\r\r
+* @type Number\r\r
+*/\r\r
+_nHideDelayId: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property _nShowDelayId\r\r
+* @description Number representing the time-out setting used to cancel the\r\r
+* showing of a menu.\r\r
+* @default null\r\r
+* @private\r\r
+* @type Number\r\r
+*/\r\r
+_nShowDelayId: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property _hideDelayEventHandlersAssigned\r\r
+* @description Boolean indicating if the "mouseover" and "mouseout" event\r\r
+* handlers used for hiding the menu via a call to "window.setTimeout" have\r\r
+* already been assigned.\r\r
+* @default false\r\r
+* @private\r\r
+* @type Boolean\r\r
+*/\r\r
+_hideDelayEventHandlersAssigned: false,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property _bHandledMouseOverEvent\r\r
+* @description Boolean indicating the current state of the menu's\r\r
+* "mouseover" event.\r\r
+* @default false\r\r
+* @private\r\r
+* @type Boolean\r\r
+*/\r\r
+_bHandledMouseOverEvent: false,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property _bHandledMouseOutEvent\r\r
+* @description Boolean indicating the current state of the menu's\r\r
+* "mouseout" event.\r\r
+* @default false\r\r
+* @private\r\r
+* @type Boolean\r\r
+*/\r\r
+_bHandledMouseOutEvent: false,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property _aGroupTitleElements\r\r
+* @description Array of HTML element used to title groups of menu items.\r\r
+* @default []\r\r
+* @private\r\r
+* @type Array\r\r
+*/\r\r
+_aGroupTitleElements: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property _aItemGroups\r\r
+* @description Array of menu items.\r\r
+* @default []\r\r
+* @private\r\r
+* @type Array\r\r
+*/\r\r
+_aItemGroups: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property _aListElements\r\r
+* @description Array of <code><ul></code> elements, each of which is\r\r
+* the parent node for each item's <code><li></code> element.\r\r
+* @default []\r\r
+* @private\r\r
+* @type Array\r\r
+*/\r\r
+_aListElements: null,\r\r
+\r\r
+\r\r
+\r\r
+// Public properties\r\r
+\r\r
+\r\r
+/**\r\r
+* @property lazyLoad\r\r
+* @description Boolean indicating if the menu's "lazy load" feature is\r\r
+* enabled. If set to "true," initialization and rendering of the menu's\r\r
+* items will be deferred until the first time it is made visible. This\r\r
+* property should be set via the constructor using the configuration\r\r
+* object literal.\r\r
+* @default false\r\r
+* @type Boolean\r\r
+*/\r\r
+lazyLoad: false,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property itemData\r\r
+* @description Array of items to be added to the menu. The array can contain\r\r
+* strings representing the text for each item to be created, object literals\r\r
+* representing the menu item configuration properties, or MenuItem instances.\r\r
+* This property should be set via the constructor using the configuration\r\r
+* object literal.\r\r
+* @default null\r\r
+* @type Array\r\r
+*/\r\r
+itemData: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property activeItem\r\r
+* @description Object reference to the item in the menu that has focus.\r\r
+* @default null\r\r
+* @type YAHOO.widget.MenuItem\r\r
+*/\r\r
+activeItem: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property parent\r\r
+* @description Object reference to the menu's parent menu or menu item.\r\r
+* This property can be set via the constructor using the configuration\r\r
+* object literal.\r\r
+* @default null\r\r
+* @type YAHOO.widget.MenuItem\r\r
+*/\r\r
+parent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @property srcElement\r\r
+* @description Object reference to the HTML element (either\r\r
+* <code><select></code> or <code><div></code>) used to\r\r
+* create the menu.\r\r
+* @default null\r\r
+* @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r\r
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>|<a\r\r
+* href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.\r\r
+* html#ID-22445964">HTMLDivElement</a>\r\r
+*/\r\r
+srcElement: null,\r\r
+\r\r
+\r\r
+\r\r
+// Events\r\r
+\r\r
+\r\r
+/**\r\r
+* @event mouseOverEvent\r\r
+* @description Fires when the mouse has entered the menu. Passes back\r\r
+* the DOM Event object as an argument.\r\r
+*/\r\r
+mouseOverEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event mouseOutEvent\r\r
+* @description Fires when the mouse has left the menu. Passes back the DOM\r\r
+* Event object as an argument.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+mouseOutEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event mouseDownEvent\r\r
+* @description Fires when the user mouses down on the menu. Passes back the\r\r
+* DOM Event object as an argument.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+mouseDownEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event mouseUpEvent\r\r
+* @description Fires when the user releases a mouse button while the mouse is\r\r
+* over the menu. Passes back the DOM Event object as an argument.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+mouseUpEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event clickEvent\r\r
+* @description Fires when the user clicks the on the menu. Passes back the\r\r
+* DOM Event object as an argument.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+clickEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event keyPressEvent\r\r
+* @description Fires when the user presses an alphanumeric key when one of the\r\r
+* menu's items has focus. Passes back the DOM Event object as an argument.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+keyPressEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event keyDownEvent\r\r
+* @description Fires when the user presses a key when one of the menu's items\r\r
+* has focus. Passes back the DOM Event object as an argument.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+keyDownEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event keyUpEvent\r\r
+* @description Fires when the user releases a key when one of the menu's items\r\r
+* has focus. Passes back the DOM Event object as an argument.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+keyUpEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event itemAddedEvent\r\r
+* @description Fires when an item is added to the menu.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+itemAddedEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @event itemRemovedEvent\r\r
+* @description Fires when an item is removed to the menu.\r\r
+* @type YAHOO.util.CustomEvent\r\r
+*/\r\r
+itemRemovedEvent: null,\r\r
+\r\r
+\r\r
+/**\r\r
+* @method init\r\r
+* @description The Menu class's initialization method. This method is\r\r
+* automatically called by the constructor, and sets up all DOM references\r\r
+* for pre-existing markup, and creates required markup if it is not\r\r
+* already present.\r\r
+* @param {String} p_oElement String specifying the id attribute of the\r\r
+* <code><div></code> element of the menu.\r\r
+* @param {String} p_oElement String specifying the id attribute of the\r\r
+* <code><select></code> element to be used as the data source\r\r
+* for the menu.\r\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r\r
+* level-one-html.html#ID-22445964">HTMLDivElement</a>} p_oElement Object\r\r
+* specifying the <code><div></code> element of the menu.\r\r
+* @param {<a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r\r
+* level-one-html.html#ID-94282980">HTMLSelectElement</a>} p_oElement\r\r
+* Object specifying the <code><select></code> element to be used as\r\r
+* the data source for the menu.\r\r
+* @param {Object} p_oConfig Optional. Object literal specifying the\r\r
+* configuration for the menu. See configuration class documentation for\r\r
+* more details.\r\r
+*/\r\r
+init: function(p_oElement, p_oConfig) {\r\r
+\r\r
+ this._aItemGroups = [];\r\r
+ this._aListElements = [];\r\r
+ this._aGroupTitleElements = [];\r\r
+\r\r
+\r\r
+ if(!this.ITEM_TYPE) {\r\r
+\r\r
+ this.ITEM_TYPE = YAHOO.widget.MenuItem;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ var oElement;\r\r
+\r\r
+ if(typeof p_oElement == "string") {\r\r
+\r\r
+ oElement = document.getElementById(p_oElement);\r\r
+\r\r
+ }\r\r
+ else if(p_oElement.tagName) {\r\r
+\r\r
+ oElement = p_oElement;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(oElement && oElement.tagName) {\r\r
+\r\r
+ switch(oElement.tagName.toUpperCase()) {\r\r
+\r\r
+ case "DIV":\r\r
+\r\r
+ this.srcElement = oElement;\r\r
+\r\r
+ if(!oElement.id) {\r\r
+\r\r
+ oElement.setAttribute("id", Dom.generateId());\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ /*\r\r
+ Note: we don't pass the user config in here yet\r\r
+ because we only want it executed once, at the lowest\r\r
+ subclass level.\r\r
+ */\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.init.call(this, oElement);\r\r
+\r\r
+ this.beforeInitEvent.fire(YAHOO.widget.Menu);\r\r
+\r\r
+\r\r
+\r\r
+ break;\r\r
+\r\r
+ case "SELECT":\r\r
+\r\r
+ this.srcElement = oElement;\r\r
+\r\r
+\r\r
+ /*\r\r
+ The source element is not something that we can use\r\r
+ outright, so we need to create a new Overlay\r\r
+\r\r
+ Note: we don't pass the user config in here yet\r\r
+ because we only want it executed once, at the lowest\r\r
+ subclass level.\r\r
+ */\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.init.call(this, Dom.generateId());\r\r
+\r\r
+ this.beforeInitEvent.fire(YAHOO.widget.Menu);\r\r
+\r\r
+\r\r
+\r\r
+ break;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ /*\r\r
+ Note: we don't pass the user config in here yet\r\r
+ because we only want it executed once, at the lowest\r\r
+ subclass level.\r\r
+ */\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.init.call(this, p_oElement);\r\r
+\r\r
+ this.beforeInitEvent.fire(YAHOO.widget.Menu);\r\r
+\r\r
+\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(this.element) {\r\r
+\r\r
+ var oEl = this.element;\r\r
+\r\r
+ Dom.addClass(oEl, this.CSS_CLASS_NAME);\r\r
+\r\r
+\r\r
+ // Subscribe to Custom Events\r\r
+\r\r
+ this.initEvent.subscribe(this._onInit, this, true);\r\r
+ this.beforeRenderEvent.subscribe(this._onBeforeRender, this, true);\r\r
+ this.renderEvent.subscribe(this._onRender, this, true);\r\r
+ this.beforeShowEvent.subscribe(this._onBeforeShow, this, true);\r\r
+ this.showEvent.subscribe(this._onShow, this, true);\r\r
+ this.beforeHideEvent.subscribe(this._onBeforeHide, this, true);\r\r
+ this.mouseOverEvent.subscribe(this._onMouseOver, this, true);\r\r
+ this.mouseOutEvent.subscribe(this._onMouseOut, this, true);\r\r
+ this.clickEvent.subscribe(this._onClick, this, true);\r\r
+ this.keyDownEvent.subscribe(this._onKeyDown, this, true);\r\r
+\r\r
+ YAHOO.widget.Module.textResizeEvent.subscribe(\r\r
+ this._onTextResize,\r\r
+ this,\r\r
+ true\r\r
+ );\r\r
+\r\r
+\r\r
+ if(p_oConfig) {\r\r
+\r\r
+ this.cfg.applyConfig(p_oConfig, true);\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ // Register the Menu instance with the MenuManager\r\r
+\r\r
+ YAHOO.widget.MenuManager.addMenu(this);\r\r
+\r\r
+\r\r
+ this.initEvent.fire(YAHOO.widget.Menu);\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+\r\r
+// Private methods\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _initSubTree\r\r
+* @description Iterates the childNodes of the source element to find nodes\r\r
+* used to instantiate menu and menu items.\r\r
+* @private\r\r
+*/\r\r
+_initSubTree: function() {\r\r
+\r\r
+ var oNode;\r\r
+\r\r
+ if(this.srcElement.tagName == "DIV") {\r\r
+\r\r
+ /*\r\r
+ Populate the collection of item groups and item\r\r
+ group titles\r\r
+ */\r\r
+\r\r
+ oNode = this.body.firstChild;\r\r
+\r\r
+ var nGroup = 0,\r\r
+ sGroupTitleTagName = this.GROUP_TITLE_TAG_NAME.toUpperCase();\r\r
+\r\r
+ do {\r\r
+\r\r
+ if(oNode && oNode.tagName) {\r\r
+\r\r
+ switch(oNode.tagName.toUpperCase()) {\r\r
+\r\r
+ case sGroupTitleTagName:\r\r
+\r\r
+ this._aGroupTitleElements[nGroup] = oNode;\r\r
+\r\r
+ break;\r\r
+\r\r
+ case "UL":\r\r
+\r\r
+ this._aListElements[nGroup] = oNode;\r\r
+ this._aItemGroups[nGroup] = [];\r\r
+ nGroup++;\r\r
+\r\r
+ break;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ while((oNode = oNode.nextSibling));\r\r
+\r\r
+\r\r
+ /*\r\r
+ Apply the "first-of-type" class to the first UL to mimic\r\r
+ the "first-of-type" CSS3 psuedo class.\r\r
+ */\r\r
+\r\r
+ if(this._aListElements[0]) {\r\r
+\r\r
+ Dom.addClass(this._aListElements[0], "first-of-type");\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ oNode = null;\r\r
+\r\r
+\r\r
+ if(this.srcElement.tagName) {\r\r
+\r\r
+ var sSrcElementTagName = this.srcElement.tagName.toUpperCase();\r\r
+\r\r
+\r\r
+ switch(sSrcElementTagName) {\r\r
+\r\r
+ case "DIV":\r\r
+\r\r
+ if(this._aListElements.length > 0) {\r\r
+\r\r
+\r\r
+ var i = this._aListElements.length - 1;\r\r
+\r\r
+ do {\r\r
+\r\r
+ oNode = this._aListElements[i].firstChild;\r\r
+\r\r
+\r\r
+ do {\r\r
+\r\r
+ if(\r\r
+ oNode &&\r\r
+ oNode.tagName &&\r\r
+ oNode.tagName.toUpperCase() == "LI"\r\r
+ ) {\r\r
+\r\r
+\r\r
+ this.addItem(\r\r
+ new this.ITEM_TYPE(\r\r
+ oNode,\r\r
+ { parent: this }\r\r
+ ),\r\r
+ i\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ while((oNode = oNode.nextSibling));\r\r
+\r\r
+ }\r\r
+ while(i--);\r\r
+\r\r
+ }\r\r
+\r\r
+ break;\r\r
+\r\r
+ case "SELECT":\r\r
+\r\r
+\r\r
+ oNode = this.srcElement.firstChild;\r\r
+\r\r
+ do {\r\r
+\r\r
+ if(oNode && oNode.tagName) {\r\r
+\r\r
+ switch(oNode.tagName.toUpperCase()) {\r\r
+\r\r
+ case "OPTGROUP":\r\r
+ case "OPTION":\r\r
+\r\r
+\r\r
+ this.addItem(\r\r
+ new this.ITEM_TYPE(\r\r
+ oNode,\r\r
+ { parent: this }\r\r
+ )\r\r
+ );\r\r
+\r\r
+ break;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ while((oNode = oNode.nextSibling));\r\r
+\r\r
+ break;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _getFirstEnabledItem\r\r
+* @description Returns the first enabled item in the menu.\r\r
+* @return {YAHOO.widget.MenuItem}\r\r
+* @private\r\r
+*/\r\r
+_getFirstEnabledItem: function() {\r\r
+\r\r
+ var nGroups = this._aItemGroups.length,\r\r
+ oItem,\r\r
+ aItemGroup;\r\r
+\r\r
+ for(var i=0; i<nGroups; i++) {\r\r
+\r\r
+ aItemGroup = this._aItemGroups[i];\r\r
+\r\r
+ if(aItemGroup) {\r\r
+\r\r
+ var nItems = aItemGroup.length;\r\r
+\r\r
+ for(var n=0; n<nItems; n++) {\r\r
+\r\r
+ oItem = aItemGroup[n];\r\r
+\r\r
+ if(\r\r
+ !oItem.cfg.getProperty("disabled") &&\r\r
+ oItem.element.style.display != "none"\r\r
+ ) {\r\r
+\r\r
+ return oItem;\r\r
+\r\r
+ }\r\r
+\r\r
+ oItem = null;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _checkPosition\r\r
+* @description Checks to make sure that the value of the "position" property\r\r
+* is one of the supported strings. Returns true if the position is supported.\r\r
+* @private\r\r
+* @param {Object} p_sPosition String specifying the position of the menu.\r\r
+* @return {Boolean}\r\r
+*/\r\r
+_checkPosition: function(p_sPosition) {\r\r
+\r\r
+ if(typeof p_sPosition == "string") {\r\r
+\r\r
+ var sPosition = p_sPosition.toLowerCase();\r\r
+\r\r
+ return ("dynamic,static".indexOf(sPosition) != -1);\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _addItemToGroup\r\r
+* @description Adds a menu item to a group.\r\r
+* @private\r\r
+* @param {Number} p_nGroupIndex Number indicating the group to which the\r\r
+* item belongs.\r\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r\r
+* instance to be added to the menu.\r\r
+* @param {String} p_oItem String specifying the text of the item to be added\r\r
+* to the menu.\r\r
+* @param {Object} p_oItem Object literal containing a set of menu item\r\r
+* configuration properties.\r\r
+* @param {Number} p_nItemIndex Optional. Number indicating the index at\r\r
+* which the menu item should be added.\r\r
+* @return {YAHOO.widget.MenuItem}\r\r
+*/\r\r
+_addItemToGroup: function(p_nGroupIndex, p_oItem, p_nItemIndex) {\r\r
+\r\r
+ var oItem;\r\r
+\r\r
+ if(p_oItem instanceof this.ITEM_TYPE) {\r\r
+\r\r
+ oItem = p_oItem;\r\r
+ oItem.parent = this;\r\r
+\r\r
+ }\r\r
+ else if(typeof p_oItem == "string") {\r\r
+\r\r
+ oItem = new this.ITEM_TYPE(p_oItem, { parent: this });\r\r
+\r\r
+ }\r\r
+ else if(typeof p_oItem == "object") {\r\r
+\r\r
+ p_oItem.parent = this;\r\r
+\r\r
+ oItem = new this.ITEM_TYPE(p_oItem.text, p_oItem);\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(oItem) {\r\r
+\r\r
+ var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0,\r\r
+ aGroup = this._getItemGroup(nGroupIndex),\r\r
+ oGroupItem;\r\r
+\r\r
+\r\r
+ if(!aGroup) {\r\r
+\r\r
+ aGroup = this._createItemGroup(nGroupIndex);\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(typeof p_nItemIndex == "number") {\r\r
+\r\r
+ var bAppend = (p_nItemIndex >= aGroup.length);\r\r
+\r\r
+\r\r
+ if(aGroup[p_nItemIndex]) {\r\r
+\r\r
+ aGroup.splice(p_nItemIndex, 0, oItem);\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ aGroup[p_nItemIndex] = oItem;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ oGroupItem = aGroup[p_nItemIndex];\r\r
+\r\r
+ if(oGroupItem) {\r\r
+\r\r
+ if(\r\r
+ bAppend &&\r\r
+ (\r\r
+ !oGroupItem.element.parentNode ||\r\r
+ oGroupItem.element.parentNode.nodeType == 11\r\r
+ )\r\r
+ ) {\r\r
+\r\r
+ this._aListElements[nGroupIndex].appendChild(\r\r
+ oGroupItem.element\r\r
+ );\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+\r\r
+ /**\r\r
+ * Returns the next sibling of an item in an array.\r\r
+ * @private\r\r
+ * @param {p_aArray} Array to search.\r\r
+ * @param {p_nStartIndex} Number indicating the index to\r\r
+ * start searching the array.\r\r
+ * @return {Object}\r\r
+ */\r\r
+ function getNextItemSibling(p_aArray, p_nStartIndex) {\r\r
+\r\r
+ return (\r\r
+ p_aArray[p_nStartIndex] ||\r\r
+ getNextItemSibling(\r\r
+ p_aArray,\r\r
+ (p_nStartIndex+1)\r\r
+ )\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ var oNextItemSibling =\r\r
+ getNextItemSibling(aGroup, (p_nItemIndex+1));\r\r
+\r\r
+ if(\r\r
+ oNextItemSibling &&\r\r
+ (\r\r
+ !oGroupItem.element.parentNode ||\r\r
+ oGroupItem.element.parentNode.nodeType == 11\r\r
+ )\r\r
+ ) {\r\r
+\r\r
+ this._aListElements[nGroupIndex].insertBefore(\r\r
+ oGroupItem.element,\r\r
+ oNextItemSibling.element\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ oGroupItem.parent = this;\r\r
+\r\r
+ this._subscribeToItemEvents(oGroupItem);\r\r
+\r\r
+ this._configureSubmenu(oGroupItem);\r\r
+\r\r
+ this._updateItemProperties(nGroupIndex);\r\r
+\r\r
+\r\r
+ this.itemAddedEvent.fire(oGroupItem);\r\r
+\r\r
+ return oGroupItem;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ var nItemIndex = aGroup.length;\r\r
+\r\r
+ aGroup[nItemIndex] = oItem;\r\r
+\r\r
+ oGroupItem = aGroup[nItemIndex];\r\r
+\r\r
+\r\r
+ if(oGroupItem) {\r\r
+\r\r
+ if(\r\r
+ !Dom.isAncestor(\r\r
+ this._aListElements[nGroupIndex],\r\r
+ oGroupItem.element\r\r
+ )\r\r
+ ) {\r\r
+\r\r
+ this._aListElements[nGroupIndex].appendChild(\r\r
+ oGroupItem.element\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+ oGroupItem.element.setAttribute("groupindex", nGroupIndex);\r\r
+ oGroupItem.element.setAttribute("index", nItemIndex);\r\r
+\r\r
+ oGroupItem.parent = this;\r\r
+\r\r
+ oGroupItem.index = nItemIndex;\r\r
+ oGroupItem.groupIndex = nGroupIndex;\r\r
+\r\r
+ this._subscribeToItemEvents(oGroupItem);\r\r
+\r\r
+ this._configureSubmenu(oGroupItem);\r\r
+\r\r
+ if(nItemIndex === 0) {\r\r
+\r\r
+ Dom.addClass(oGroupItem.element, "first-of-type");\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+\r\r
+ this.itemAddedEvent.fire(oGroupItem);\r\r
+\r\r
+ return oGroupItem;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _removeItemFromGroupByIndex\r\r
+* @description Removes a menu item from a group by index. Returns the menu\r\r
+* item that was removed.\r\r
+* @private\r\r
+* @param {Number} p_nGroupIndex Number indicating the group to which the menu\r\r
+* item belongs.\r\r
+* @param {Number} p_nItemIndex Number indicating the index of the menu item\r\r
+* to be removed.\r\r
+* @return {YAHOO.widget.MenuItem}\r\r
+*/\r\r
+_removeItemFromGroupByIndex: function(p_nGroupIndex, p_nItemIndex) {\r\r
+\r\r
+ var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0,\r\r
+ aGroup = this._getItemGroup(nGroupIndex);\r\r
+\r\r
+ if(aGroup) {\r\r
+\r\r
+ var aArray = aGroup.splice(p_nItemIndex, 1),\r\r
+ oItem = aArray[0];\r\r
+\r\r
+ if(oItem) {\r\r
+\r\r
+ // Update the index and className properties of each member\r\r
+\r\r
+ this._updateItemProperties(nGroupIndex);\r\r
+\r\r
+ if(aGroup.length === 0) {\r\r
+\r\r
+ // Remove the UL\r\r
+\r\r
+ var oUL = this._aListElements[nGroupIndex];\r\r
+\r\r
+ if(this.body && oUL) {\r\r
+\r\r
+ this.body.removeChild(oUL);\r\r
+\r\r
+ }\r\r
+\r\r
+ // Remove the group from the array of items\r\r
+\r\r
+ this._aItemGroups.splice(nGroupIndex, 1);\r\r
+\r\r
+\r\r
+ // Remove the UL from the array of ULs\r\r
+\r\r
+ this._aListElements.splice(nGroupIndex, 1);\r\r
+\r\r
+\r\r
+ /*\r\r
+ Assign the "first-of-type" class to the new first UL\r\r
+ in the collection\r\r
+ */\r\r
+\r\r
+ oUL = this._aListElements[0];\r\r
+\r\r
+ if(oUL) {\r\r
+\r\r
+ Dom.addClass(oUL, "first-of-type");\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ this.itemRemovedEvent.fire(oItem);\r\r
+\r\r
+\r\r
+ // Return a reference to the item that was removed\r\r
+\r\r
+ return oItem;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _removeItemFromGroupByValue\r\r
+* @description Removes a menu item from a group by reference. Returns the\r\r
+* menu item that was removed.\r\r
+* @private\r\r
+* @param {Number} p_nGroupIndex Number indicating the group to which the\r\r
+* menu item belongs.\r\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r\r
+* instance to be removed.\r\r
+* @return {YAHOO.widget.MenuItem}\r\r
+*/\r\r
+_removeItemFromGroupByValue: function(p_nGroupIndex, p_oItem) {\r\r
+\r\r
+ var aGroup = this._getItemGroup(p_nGroupIndex);\r\r
+\r\r
+ if(aGroup) {\r\r
+\r\r
+ var nItems = aGroup.length,\r\r
+ nItemIndex = -1;\r\r
+\r\r
+ if(nItems > 0) {\r\r
+\r\r
+ var i = nItems-1;\r\r
+\r\r
+ do {\r\r
+\r\r
+ if(aGroup[i] == p_oItem) {\r\r
+\r\r
+ nItemIndex = i;\r\r
+ break;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ while(i--);\r\r
+\r\r
+ if(nItemIndex > -1) {\r\r
+\r\r
+ return this._removeItemFromGroupByIndex(\r\r
+ p_nGroupIndex,\r\r
+ nItemIndex\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _updateItemProperties\r\r
+* @description Updates the "index," "groupindex," and "className" properties\r\r
+* of the menu items in the specified group.\r\r
+* @private\r\r
+* @param {Number} p_nGroupIndex Number indicating the group of items to update.\r\r
+*/\r\r
+_updateItemProperties: function(p_nGroupIndex) {\r\r
+\r\r
+ var aGroup = this._getItemGroup(p_nGroupIndex),\r\r
+ nItems = aGroup.length;\r\r
+\r\r
+ if(nItems > 0) {\r\r
+\r\r
+ var i = nItems - 1,\r\r
+ oItem,\r\r
+ oLI;\r\r
+\r\r
+ // Update the index and className properties of each member\r\r
+\r\r
+ do {\r\r
+\r\r
+ oItem = aGroup[i];\r\r
+\r\r
+ if(oItem) {\r\r
+\r\r
+ oLI = oItem.element;\r\r
+\r\r
+ oItem.index = i;\r\r
+ oItem.groupIndex = p_nGroupIndex;\r\r
+\r\r
+ oLI.setAttribute("groupindex", p_nGroupIndex);\r\r
+ oLI.setAttribute("index", i);\r\r
+\r\r
+ Dom.removeClass(oLI, "first-of-type");\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ while(i--);\r\r
+\r\r
+\r\r
+ if(oLI) {\r\r
+\r\r
+ Dom.addClass(oLI, "first-of-type");\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _createItemGroup\r\r
+* @description Creates a new menu item group (array) and its associated\r\r
+* <code><ul></code> element. Returns an aray of menu item groups.\r\r
+* @private\r\r
+* @param {Number} p_nIndex Number indicating the group to create.\r\r
+* @return {Array}\r\r
+*/\r\r
+_createItemGroup: function(p_nIndex) {\r\r
+\r\r
+ if(!this._aItemGroups[p_nIndex]) {\r\r
+\r\r
+ this._aItemGroups[p_nIndex] = [];\r\r
+\r\r
+ var oUL = document.createElement("ul");\r\r
+\r\r
+ this._aListElements[p_nIndex] = oUL;\r\r
+\r\r
+ return this._aItemGroups[p_nIndex];\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _getItemGroup\r\r
+* @description Returns the menu item group at the specified index.\r\r
+* @private\r\r
+* @param {Number} p_nIndex Number indicating the index of the menu item group\r\r
+* to be retrieved.\r\r
+* @return {Array}\r\r
+*/\r\r
+_getItemGroup: function(p_nIndex) {\r\r
+\r\r
+ var nIndex = ((typeof p_nIndex == "number") ? p_nIndex : 0);\r\r
+\r\r
+ return this._aItemGroups[nIndex];\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _configureSubmenu\r\r
+* @description Subscribes the menu item's submenu to its parent menu's events.\r\r
+* @private\r\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r\r
+* instance with the submenu to be configured.\r\r
+*/\r\r
+_configureSubmenu: function(p_oItem) {\r\r
+\r\r
+ var oSubmenu = p_oItem.cfg.getProperty("submenu");\r\r
+\r\r
+ if(oSubmenu) {\r\r
+\r\r
+ /*\r\r
+ Listen for configuration changes to the parent menu\r\r
+ so they they can be applied to the submenu.\r\r
+ */\r\r
+\r\r
+ this.cfg.configChangedEvent.subscribe(\r\r
+ this._onParentMenuConfigChange,\r\r
+ oSubmenu,\r\r
+ true\r\r
+ );\r\r
+\r\r
+ this.renderEvent.subscribe(\r\r
+ this._onParentMenuRender,\r\r
+ oSubmenu,\r\r
+ true\r\r
+ );\r\r
+\r\r
+ oSubmenu.beforeShowEvent.subscribe(\r\r
+ this._onSubmenuBeforeShow,\r\r
+ oSubmenu,\r\r
+ true\r\r
+ );\r\r
+\r\r
+ oSubmenu.showEvent.subscribe(\r\r
+ this._onSubmenuShow,\r\r
+ oSubmenu,\r\r
+ true\r\r
+ );\r\r
+\r\r
+ oSubmenu.hideEvent.subscribe(\r\r
+ this._onSubmenuHide,\r\r
+ oSubmenu,\r\r
+ true\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _subscribeToItemEvents\r\r
+* @description Subscribes a menu to a menu item's event.\r\r
+* @private\r\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r\r
+* instance whose events should be subscribed to.\r\r
+*/\r\r
+_subscribeToItemEvents: function(p_oItem) {\r\r
+\r\r
+ p_oItem.focusEvent.subscribe(this._onMenuItemFocus, p_oItem, this);\r\r
+\r\r
+ p_oItem.blurEvent.subscribe(this._onMenuItemBlur, this, true);\r\r
+\r\r
+ p_oItem.cfg.configChangedEvent.subscribe(\r\r
+ this._onMenuItemConfigChange,\r\r
+ p_oItem,\r\r
+ this\r\r
+ );\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _getOffsetWidth\r\r
+* @description Returns the offset width of the menu's\r\r
+* <code><div></code> element.\r\r
+* @private\r\r
+*/\r\r
+_getOffsetWidth: function() {\r\r
+\r\r
+ var oClone = this.element.cloneNode(true);\r\r
+\r\r
+ Dom.setStyle(oClone, "width", "");\r\r
+\r\r
+ document.body.appendChild(oClone);\r\r
+\r\r
+ var sWidth = oClone.offsetWidth;\r\r
+\r\r
+ document.body.removeChild(oClone);\r\r
+\r\r
+ return sWidth;\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _cancelHideDelay\r\r
+* @description Cancels the call to "hideMenu."\r\r
+* @private\r\r
+*/\r\r
+_cancelHideDelay: function() {\r\r
+\r\r
+ var oRoot = this.getRoot();\r\r
+\r\r
+ if(oRoot._nHideDelayId) {\r\r
+\r\r
+ window.clearTimeout(oRoot._nHideDelayId);\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _execHideDelay\r\r
+* @description Hides the menu after the number of milliseconds specified by\r\r
+* the "hidedelay" configuration property.\r\r
+* @private\r\r
+*/\r\r
+_execHideDelay: function() {\r\r
+\r\r
+ this._cancelHideDelay();\r\r
+\r\r
+ var oRoot = this.getRoot(),\r\r
+ me = this;\r\r
+\r\r
+ function hideMenu() {\r\r
+\r\r
+ if(oRoot.activeItem) {\r\r
+\r\r
+ oRoot.clearActiveItem();\r\r
+\r\r
+ }\r\r
+\r\r
+ if(oRoot == me && me.cfg.getProperty("position") == "dynamic") {\r\r
+\r\r
+ me.hide();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ oRoot._nHideDelayId =\r\r
+ window.setTimeout(hideMenu, oRoot.cfg.getProperty("hidedelay"));\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _cancelShowDelay\r\r
+* @description Cancels the call to the "showMenu."\r\r
+* @private\r\r
+*/\r\r
+_cancelShowDelay: function() {\r\r
+\r\r
+ var oRoot = this.getRoot();\r\r
+\r\r
+ if(oRoot._nShowDelayId) {\r\r
+\r\r
+ window.clearTimeout(oRoot._nShowDelayId);\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _execShowDelay\r\r
+* @description Shows the menu after the number of milliseconds specified by\r\r
+* the "showdelay" configuration property have ellapsed.\r\r
+* @private\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object specifying the menu that should\r\r
+* be made visible.\r\r
+*/\r\r
+_execShowDelay: function(p_oMenu) {\r\r
+\r\r
+ var oRoot = this.getRoot();\r\r
+\r\r
+ function showMenu() {\r\r
+\r\r
+ p_oMenu.show();\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ oRoot._nShowDelayId =\r\r
+ window.setTimeout(showMenu, oRoot.cfg.getProperty("showdelay"));\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+\r\r
+// Protected methods\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onMouseOver\r\r
+* @description "mouseover" event handler for the menu.\r\r
+* @protected\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onMouseOver: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var oEvent = p_aArgs[0],\r\r
+ oItem = p_aArgs[1],\r\r
+ oTarget = Event.getTarget(oEvent);\r\r
+\r\r
+\r\r
+ if(\r\r
+ !this._bHandledMouseOverEvent &&\r\r
+ (oTarget == this.element || Dom.isAncestor(this.element, oTarget))\r\r
+ ) {\r\r
+\r\r
+ this.clearActiveItem();\r\r
+\r\r
+ this._bHandledMouseOverEvent = true;\r\r
+ this._bHandledMouseOutEvent = false;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(\r\r
+ oItem && !oItem.handledMouseOverEvent &&\r\r
+ !oItem.cfg.getProperty("disabled") &&\r\r
+ (oTarget == oItem.element || Dom.isAncestor(oItem.element, oTarget))\r\r
+ ) {\r\r
+\r\r
+ var nShowDelay = this.cfg.getProperty("showdelay"),\r\r
+ bShowDelay = (nShowDelay > 0);\r\r
+\r\r
+\r\r
+ if(bShowDelay) {\r\r
+\r\r
+ this._cancelShowDelay();\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ var oActiveItem = this.activeItem;\r\r
+\r\r
+ if(oActiveItem) {\r\r
+\r\r
+ oActiveItem.cfg.setProperty("selected", false);\r\r
+\r\r
+ var oActiveSubmenu = oActiveItem.cfg.getProperty("submenu");\r\r
+\r\r
+ if(oActiveSubmenu) {\r\r
+\r\r
+ oActiveSubmenu.hide();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ var oItemCfg = oItem.cfg;\r\r
+\r\r
+ // Select and focus the current menu item\r\r
+\r\r
+ oItemCfg.setProperty("selected", true);\r\r
+ oItem.focus();\r\r
+\r\r
+\r\r
+ if(this.cfg.getProperty("autosubmenudisplay")) {\r\r
+\r\r
+ // Show the submenu this menu item\r\r
+\r\r
+ var oSubmenu = oItemCfg.getProperty("submenu");\r\r
+\r\r
+ if(oSubmenu) {\r\r
+\r\r
+ if(bShowDelay) {\r\r
+\r\r
+ this._execShowDelay(oSubmenu);\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ oSubmenu.show();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ oItem.handledMouseOverEvent = true;\r\r
+ oItem.handledMouseOutEvent = false;\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onMouseOut\r\r
+* @description "mouseout" event handler for the menu.\r\r
+* @protected\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onMouseOut: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var oEvent = p_aArgs[0],\r\r
+ oItem = p_aArgs[1],\r\r
+ oRelatedTarget = Event.getRelatedTarget(oEvent),\r\r
+ bMovingToSubmenu = false;\r\r
+\r\r
+\r\r
+ if(oItem && !oItem.cfg.getProperty("disabled")) {\r\r
+\r\r
+ var oItemCfg = oItem.cfg,\r\r
+ oSubmenu = oItemCfg.getProperty("submenu");\r\r
+\r\r
+\r\r
+ if(\r\r
+ oSubmenu &&\r\r
+ (\r\r
+ oRelatedTarget == oSubmenu.element ||\r\r
+ Dom.isAncestor(oSubmenu.element, oRelatedTarget)\r\r
+ )\r\r
+ ) {\r\r
+\r\r
+ bMovingToSubmenu = true;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(\r\r
+ !oItem.handledMouseOutEvent &&\r\r
+ (\r\r
+ (\r\r
+ oRelatedTarget != oItem.element &&\r\r
+ !Dom.isAncestor(oItem.element, oRelatedTarget)\r\r
+ ) || bMovingToSubmenu\r\r
+ )\r\r
+ ) {\r\r
+\r\r
+ if(\r\r
+ !oSubmenu ||\r\r
+ (oSubmenu && !oSubmenu.cfg.getProperty("visible"))\r\r
+ ) {\r\r
+\r\r
+ oItem.cfg.setProperty("selected", false);\r\r
+\r\r
+ if(\r\r
+ oSubmenu &&\r\r
+ oSubmenu.cfg.getProperty("showdelay") &&\r\r
+ !oSubmenu.cfg.getProperty("visible")\r\r
+ ) {\r\r
+\r\r
+ this._cancelShowDelay();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ oItem.handledMouseOutEvent = true;\r\r
+ oItem.handledMouseOverEvent = false;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(\r\r
+ !this._bHandledMouseOutEvent &&\r\r
+ (\r\r
+ (\r\r
+ oRelatedTarget != this.element &&\r\r
+ !Dom.isAncestor(this.element, oRelatedTarget)\r\r
+ )\r\r
+ || bMovingToSubmenu\r\r
+ )\r\r
+ ) {\r\r
+\r\r
+ this._bHandledMouseOutEvent = true;\r\r
+ this._bHandledMouseOverEvent = false;\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onClick\r\r
+* @description "click" event handler for the menu.\r\r
+* @protected\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onClick: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var oEvent = p_aArgs[0],\r\r
+ oItem = p_aArgs[1],\r\r
+ oTarget = Event.getTarget(oEvent);\r\r
+\r\r
+ if(oItem && !oItem.cfg.getProperty("disabled")) {\r\r
+\r\r
+ var oItemCfg = oItem.cfg,\r\r
+ oSubmenu = oItemCfg.getProperty("submenu");\r\r
+\r\r
+\r\r
+ /*\r\r
+ ACCESSIBILITY FEATURE FOR SCREEN READERS:\r\r
+ Expand/collapse the submenu when the user clicks\r\r
+ on the submenu indicator image.\r\r
+ */\r\r
+\r\r
+ if(oTarget == oItem.submenuIndicator && oSubmenu) {\r\r
+\r\r
+ if(oSubmenu.cfg.getProperty("visible")) {\r\r
+\r\r
+ oSubmenu.hide();\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ this.clearActiveItem();\r\r
+\r\r
+ this.activeItem = oItem;\r\r
+\r\r
+ oItem.cfg.setProperty("selected", true);\r\r
+\r\r
+ oSubmenu.show();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ var sURL = oItemCfg.getProperty("url"),\r\r
+ bCurrentPageURL = (sURL.substr((sURL.length-1),1) == "#"),\r\r
+ sTarget = oItemCfg.getProperty("target"),\r\r
+ bHasTarget = (sTarget && sTarget.length > 0);\r\r
+\r\r
+ /*\r\r
+ Prevent the browser from following links\r\r
+ equal to "#"\r\r
+ */\r\r
+\r\r
+ if(\r\r
+ oTarget.tagName.toUpperCase() == "A" &&\r\r
+ bCurrentPageURL && !bHasTarget\r\r
+ ) {\r\r
+\r\r
+ Event.preventDefault(oEvent);\r\r
+\r\r
+ }\r\r
+\r\r
+ if(\r\r
+ oTarget.tagName.toUpperCase() != "A" &&\r\r
+ !bCurrentPageURL && !bHasTarget\r\r
+ ) {\r\r
+\r\r
+ /*\r\r
+ Follow the URL of the item regardless of\r\r
+ whether or not the user clicked specifically\r\r
+ on the anchor element.\r\r
+ */\r\r
+\r\r
+ document.location = sURL;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ /*\r\r
+ If the item doesn't navigate to a URL and it doesn't have\r\r
+ a submenu, then collapse the menu tree.\r\r
+ */\r\r
+\r\r
+ if(bCurrentPageURL && !oSubmenu) {\r\r
+\r\r
+ var oRoot = this.getRoot();\r\r
+\r\r
+ if(oRoot.cfg.getProperty("position") == "static") {\r\r
+\r\r
+ oRoot.clearActiveItem();\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ oRoot.hide();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onKeyDown\r\r
+* @description "keydown" event handler for the menu.\r\r
+* @protected\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onKeyDown: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var oEvent = p_aArgs[0],\r\r
+ oItem = p_aArgs[1],\r\r
+ oSubmenu;\r\r
+\r\r
+ if(oItem && !oItem.cfg.getProperty("disabled")) {\r\r
+\r\r
+ var oItemCfg = oItem.cfg,\r\r
+ oParentItem = this.parent,\r\r
+ oRoot,\r\r
+ oNextItem;\r\r
+\r\r
+\r\r
+ switch(oEvent.keyCode) {\r\r
+\r\r
+ case 38: // Up arrow\r\r
+ case 40: // Down arrow\r\r
+\r\r
+ if(\r\r
+ oItem == this.activeItem &&\r\r
+ !oItemCfg.getProperty("selected")\r\r
+ ) {\r\r
+\r\r
+ oItemCfg.setProperty("selected", true);\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ oNextItem = (oEvent.keyCode == 38) ?\r\r
+ oItem.getPreviousEnabledSibling() :\r\r
+ oItem.getNextEnabledSibling();\r\r
+\r\r
+ if(oNextItem) {\r\r
+\r\r
+ this.clearActiveItem();\r\r
+\r\r
+ oNextItem.cfg.setProperty("selected", true);\r\r
+ oNextItem.focus();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ Event.preventDefault(oEvent);\r\r
+\r\r
+ break;\r\r
+\r\r
+\r\r
+ case 39: // Right arrow\r\r
+\r\r
+ oSubmenu = oItemCfg.getProperty("submenu");\r\r
+\r\r
+ if(oSubmenu) {\r\r
+\r\r
+ if(!oItemCfg.getProperty("selected")) {\r\r
+\r\r
+ oItemCfg.setProperty("selected", true);\r\r
+\r\r
+ }\r\r
+\r\r
+ oSubmenu.show();\r\r
+\r\r
+ oSubmenu.setInitialSelection();\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ oRoot = this.getRoot();\r\r
+\r\r
+ if(oRoot instanceof YAHOO.widget.MenuBar) {\r\r
+\r\r
+ oNextItem = oRoot.activeItem.getNextEnabledSibling();\r\r
+\r\r
+ if(oNextItem) {\r\r
+\r\r
+ oRoot.clearActiveItem();\r\r
+\r\r
+ oNextItem.cfg.setProperty("selected", true);\r\r
+\r\r
+ oSubmenu = oNextItem.cfg.getProperty("submenu");\r\r
+\r\r
+ if(oSubmenu) {\r\r
+\r\r
+ oSubmenu.show();\r\r
+\r\r
+ }\r\r
+\r\r
+ oNextItem.focus();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ Event.preventDefault(oEvent);\r\r
+\r\r
+ break;\r\r
+\r\r
+\r\r
+ case 37: // Left arrow\r\r
+\r\r
+ if(oParentItem) {\r\r
+\r\r
+ var oParentMenu = oParentItem.parent;\r\r
+\r\r
+ if(oParentMenu instanceof YAHOO.widget.MenuBar) {\r\r
+\r\r
+ oNextItem =\r\r
+ oParentMenu.activeItem.getPreviousEnabledSibling();\r\r
+\r\r
+ if(oNextItem) {\r\r
+\r\r
+ oParentMenu.clearActiveItem();\r\r
+\r\r
+ oNextItem.cfg.setProperty("selected", true);\r\r
+\r\r
+ oSubmenu = oNextItem.cfg.getProperty("submenu");\r\r
+\r\r
+ if(oSubmenu) {\r\r
+\r\r
+ oSubmenu.show();\r\r
+\r\r
+ }\r\r
+\r\r
+ oNextItem.focus();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ this.hide();\r\r
+\r\r
+ oParentItem.focus();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ Event.preventDefault(oEvent);\r\r
+\r\r
+ break;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(oEvent.keyCode == 27) { // Esc key\r\r
+\r\r
+ if(this.cfg.getProperty("position") == "dynamic") {\r\r
+\r\r
+ this.hide();\r\r
+\r\r
+ if(this.parent) {\r\r
+\r\r
+ this.parent.focus();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else if(this.activeItem) {\r\r
+\r\r
+ oSubmenu = this.activeItem.cfg.getProperty("submenu");\r\r
+\r\r
+ if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {\r\r
+\r\r
+ oSubmenu.hide();\r\r
+ this.activeItem.focus();\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ this.activeItem.cfg.setProperty("selected", false);\r\r
+ this.activeItem.blur();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ Event.preventDefault(oEvent);\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onTextResize\r\r
+* @description "textresize" event handler for the menu.\r\r
+* @protected\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onTextResize: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ if(this.browser == "gecko" && !this._handleResize) {\r\r
+\r\r
+ this._handleResize = true;\r\r
+ return;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ var oConfig = this.cfg;\r\r
+\r\r
+ if(oConfig.getProperty("position") == "dynamic") {\r\r
+\r\r
+ oConfig.setProperty("width", (this._getOffsetWidth() + "px"));\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+\r\r
+// Private methods\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onInit\r\r
+* @description "init" event handler for the menu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onInit: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ if(\r\r
+ (\r\r
+ (this.parent && !this.lazyLoad) ||\r\r
+ (!this.parent && this.cfg.getProperty("position") == "static") ||\r\r
+ (\r\r
+ !this.parent &&\r\r
+ !this.lazyLoad &&\r\r
+ this.cfg.getProperty("position") == "dynamic"\r\r
+ )\r\r
+ ) &&\r\r
+ this.getItemGroups().length === 0\r\r
+ ) {\r\r
+\r\r
+ if(this.srcElement) {\r\r
+\r\r
+ this._initSubTree();\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(this.itemData) {\r\r
+\r\r
+ this.addItems(this.itemData);\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else if(this.lazyLoad) {\r\r
+\r\r
+ this.cfg.fireQueue();\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onBeforeRender\r\r
+* @description "beforerender" event handler for the menu. Appends all of the\r\r
+* <code><ul></code>, <code><li></code> and their accompanying\r\r
+* title elements to the body element of the menu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onBeforeRender: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var oConfig = this.cfg,\r\r
+ oEl = this.element,\r\r
+ nListElements = this._aListElements.length;\r\r
+\r\r
+\r\r
+ if(nListElements > 0) {\r\r
+\r\r
+ var i = 0,\r\r
+ bFirstList = true,\r\r
+ oUL,\r\r
+ oGroupTitle;\r\r
+\r\r
+\r\r
+ do {\r\r
+\r\r
+ oUL = this._aListElements[i];\r\r
+\r\r
+ if(oUL) {\r\r
+\r\r
+ if(bFirstList) {\r\r
+\r\r
+ Dom.addClass(oUL, "first-of-type");\r\r
+ bFirstList = false;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(!Dom.isAncestor(oEl, oUL)) {\r\r
+\r\r
+ this.appendToBody(oUL);\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ oGroupTitle = this._aGroupTitleElements[i];\r\r
+\r\r
+ if(oGroupTitle) {\r\r
+\r\r
+ if(!Dom.isAncestor(oEl, oGroupTitle)) {\r\r
+\r\r
+ oUL.parentNode.insertBefore(oGroupTitle, oUL);\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ Dom.addClass(oUL, "hastitle");\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ i++;\r\r
+\r\r
+ }\r\r
+ while(i < nListElements);\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onRender\r\r
+* @description "render" event handler for the menu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onRender: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ if(this.cfg.getProperty("position") == "dynamic") {\r\r
+\r\r
+ var sWidth =\r\r
+ this.element.parentNode.tagName.toUpperCase() == "BODY" ?\r\r
+ this.element.offsetWidth : this._getOffsetWidth();\r\r
+\r\r
+ this.cfg.setProperty("width", (sWidth + "px"));\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onBeforeShow\r\r
+* @description "beforeshow" event handler for the menu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+_onBeforeShow: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ if(this.lazyLoad && this.getItemGroups().length === 0) {\r\r
+\r\r
+ if(this.srcElement) {\r\r
+\r\r
+ this._initSubTree();\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(this.itemData) {\r\r
+\r\r
+ if(\r\r
+ this.parent && this.parent.parent &&\r\r
+ this.parent.parent.srcElement &&\r\r
+ this.parent.parent.srcElement.tagName.toUpperCase() == "SELECT"\r\r
+ ) {\r\r
+\r\r
+ var nOptions = this.itemData.length;\r\r
+\r\r
+ for(var n=0; n<nOptions; n++) {\r\r
+\r\r
+ if(this.itemData[n].tagName) {\r\r
+\r\r
+ this.addItem((new this.ITEM_TYPE(this.itemData[n])));\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ this.addItems(this.itemData);\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(this.srcElement) {\r\r
+\r\r
+ this.render();\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ if(this.parent) {\r\r
+\r\r
+ this.render(this.parent.element);\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ this.render(this.cfg.getProperty("container"));\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onShow\r\r
+* @description "show" event handler for the menu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that fired\r\r
+* the event.\r\r
+*/\r\r
+_onShow: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ this.setInitialFocus();\r\r
+\r\r
+ var oParent = this.parent;\r\r
+\r\r
+ if(oParent) {\r\r
+\r\r
+ var oParentMenu = oParent.parent,\r\r
+ aParentAlignment = oParentMenu.cfg.getProperty("submenualignment"),\r\r
+ aAlignment = this.cfg.getProperty("submenualignment");\r\r
+\r\r
+\r\r
+ if(\r\r
+ (aParentAlignment[0] != aAlignment[0]) &&\r\r
+ (aParentAlignment[1] != aAlignment[1])\r\r
+ ) {\r\r
+\r\r
+ this.cfg.setProperty(\r\r
+ "submenualignment",\r\r
+ [ aParentAlignment[0], aParentAlignment[1] ]\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(\r\r
+ !oParentMenu.cfg.getProperty("autosubmenudisplay") &&\r\r
+ oParentMenu.cfg.getProperty("position") == "static"\r\r
+ ) {\r\r
+\r\r
+ oParentMenu.cfg.setProperty("autosubmenudisplay", true);\r\r
+\r\r
+\r\r
+ /**\r\r
+ * "click" event handler for the document\r\r
+ * @private\r\r
+ * @param {Event} p_oEvent Object reference for the DOM event object\r\r
+ * passed back by the event utility (YAHOO.util.Event).\r\r
+ */\r\r
+ function disableAutoSubmenuDisplay(p_oEvent) {\r\r
+\r\r
+ if(\r\r
+ p_oEvent.type == "mousedown" ||\r\r
+ (p_oEvent.type == "keydown" && p_oEvent.keyCode == 27)\r\r
+ ) {\r\r
+\r\r
+ /*\r\r
+ Set the "autosubmenudisplay" to "false" if the user\r\r
+ clicks outside the menu bar.\r\r
+ */\r\r
+\r\r
+ var oTarget = Event.getTarget(p_oEvent);\r\r
+\r\r
+ if(\r\r
+ oTarget != oParentMenu.element ||\r\r
+ !YAHOO.util.Dom.isAncestor(oParentMenu.element, oTarget)\r\r
+ ) {\r\r
+\r\r
+ oParentMenu.cfg.setProperty(\r\r
+ "autosubmenudisplay",\r\r
+ false\r\r
+ );\r\r
+\r\r
+ Event.removeListener(\r\r
+ document,\r\r
+ "mousedown",\r\r
+ disableAutoSubmenuDisplay\r\r
+ );\r\r
+\r\r
+ Event.removeListener(\r\r
+ document,\r\r
+ "keydown",\r\r
+ disableAutoSubmenuDisplay\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ Event.addListener(document, "mousedown", disableAutoSubmenuDisplay);\r\r
+ Event.addListener(document, "keydown", disableAutoSubmenuDisplay);\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onBeforeHide\r\r
+* @description "beforehide" event handler for the menu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that fired\r\r
+* the event.\r\r
+*/\r\r
+_onBeforeHide: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var oActiveItem = this.activeItem;\r\r
+\r\r
+ if(oActiveItem) {\r\r
+\r\r
+ var oConfig = oActiveItem.cfg;\r\r
+\r\r
+ oConfig.setProperty("selected", false);\r\r
+\r\r
+ var oSubmenu = oConfig.getProperty("submenu");\r\r
+\r\r
+ if(oSubmenu) {\r\r
+\r\r
+ oSubmenu.hide();\r\r
+\r\r
+ }\r\r
+\r\r
+ oActiveItem.blur();\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onParentMenuConfigChange\r\r
+* @description "configchange" event handler for a submenu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r\r
+* subscribed to the event.\r\r
+*/\r\r
+_onParentMenuConfigChange: function(p_sType, p_aArgs, p_oSubmenu) {\r\r
+\r\r
+ var sPropertyName = p_aArgs[0][0],\r\r
+ oPropertyValue = p_aArgs[0][1];\r\r
+\r\r
+ switch(sPropertyName) {\r\r
+\r\r
+ case "iframe":\r\r
+ case "constraintoviewport":\r\r
+ case "hidedelay":\r\r
+ case "showdelay":\r\r
+ case "clicktohide":\r\r
+ case "effect":\r\r
+\r\r
+ p_oSubmenu.cfg.setProperty(sPropertyName, oPropertyValue);\r\r
+\r\r
+ break;\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onParentMenuRender\r\r
+* @description "render" event handler for a submenu. Renders a\r\r
+* submenu in response to the firing of its parent's "render" event.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r\r
+* subscribed to the event.\r\r
+*/\r\r
+_onParentMenuRender: function(p_sType, p_aArgs, p_oSubmenu) {\r\r
+\r\r
+ var oParentMenu = p_oSubmenu.parent.parent,\r\r
+\r\r
+ oConfig = {\r\r
+\r\r
+ constraintoviewport:\r\r
+ oParentMenu.cfg.getProperty("constraintoviewport"),\r\r
+\r\r
+ xy: [0,0],\r\r
+\r\r
+ clicktohide:\r\r
+ oParentMenu.cfg.getProperty("clicktohide"),\r\r
+\r\r
+ effect:\r\r
+ oParentMenu.cfg.getProperty("effect"),\r\r
+\r\r
+ showdelay:\r\r
+ oParentMenu.cfg.getProperty("showdelay"),\r\r
+\r\r
+ hidedelay:\r\r
+ oParentMenu.cfg.getProperty("hidedelay")\r\r
+\r\r
+ };\r\r
+\r\r
+\r\r
+ /*\r\r
+ Only sync the "iframe" configuration property if the parent\r\r
+ menu's "position" configuration is the same.\r\r
+ */\r\r
+\r\r
+ if(\r\r
+ this.cfg.getProperty("position") ==\r\r
+ oParentMenu.cfg.getProperty("position")\r\r
+ ) {\r\r
+\r\r
+ oConfig.iframe = oParentMenu.cfg.getProperty("iframe");\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ p_oSubmenu.cfg.applyConfig(oConfig);\r\r
+\r\r
+\r\r
+ if(!this.lazyLoad) {\r\r
+\r\r
+ if(Dom.inDocument(this.element)) {\r\r
+\r\r
+ this.render();\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ this.render(this.parent.element);\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onSubmenuBeforeShow\r\r
+* @description "beforeshow" event handler for a submenu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r\r
+* subscribed to the event.\r\r
+*/\r\r
+_onSubmenuBeforeShow: function(p_sType, p_aArgs, p_oSubmenu) {\r\r
+\r\r
+ var oParent = this.parent,\r\r
+ aAlignment = oParent.parent.cfg.getProperty("submenualignment");\r\r
+\r\r
+ this.cfg.setProperty(\r\r
+ "context",\r\r
+ [oParent.element, aAlignment[0], aAlignment[1]]\r\r
+ );\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onSubmenuShow\r\r
+* @description "show" event handler for a submenu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r\r
+* subscribed to the event.\r\r
+*/\r\r
+_onSubmenuShow: function(p_sType, p_aArgs, p_oSubmenu) {\r\r
+\r\r
+ var oParent = this.parent;\r\r
+\r\r
+ oParent.submenuIndicator.alt = oParent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onSubmenuHide\r\r
+* @description "hide" Custom Event handler for a submenu.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oSubmenu Object representing the submenu that\r\r
+* subscribed to the event.\r\r
+*/\r\r
+_onSubmenuHide: function(p_sType, p_aArgs, p_oSubmenu) {\r\r
+\r\r
+ var oParent = this.parent;\r\r
+\r\r
+ oParent.submenuIndicator.alt = oParent.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onMenuItemFocus\r\r
+* @description "focus" event handler for the menu's items.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r\r
+* that fired the event.\r\r
+*/\r\r
+_onMenuItemFocus: function(p_sType, p_aArgs, p_oItem) {\r\r
+\r\r
+ this.activeItem = p_oItem;\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onMenuItemBlur\r\r
+* @description "blur" event handler for the menu's items.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event\r\r
+* that was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+*/\r\r
+_onMenuItemBlur: function(p_sType, p_aArgs) {\r\r
+\r\r
+ this.activeItem = null;\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method _onMenuItemConfigChange\r\r
+* @description "configchange" event handler for the menu's items.\r\r
+* @private\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object representing the menu item\r\r
+* that fired the event.\r\r
+*/\r\r
+_onMenuItemConfigChange: function(p_sType, p_aArgs, p_oItem) {\r\r
+\r\r
+ var sProperty = p_aArgs[0][0];\r\r
+\r\r
+ switch(sProperty) {\r\r
+\r\r
+ case "submenu":\r\r
+\r\r
+ var oSubmenu = p_aArgs[0][1];\r\r
+\r\r
+ if(oSubmenu) {\r\r
+\r\r
+ this._configureSubmenu(p_oItem);\r\r
+\r\r
+ }\r\r
+\r\r
+ break;\r\r
+\r\r
+ case "text":\r\r
+ case "helptext":\r\r
+\r\r
+ /*\r\r
+ A change to an item's "text" or "helptext"\r\r
+ configuration properties requires the width of the parent\r\r
+ menu to be recalculated.\r\r
+ */\r\r
+\r\r
+ if(this.element.style.width) {\r\r
+\r\r
+ var sWidth = this._getOffsetWidth() + "px";\r\r
+\r\r
+ Dom.setStyle(this.element, "width", sWidth);\r\r
+\r\r
+ }\r\r
+\r\r
+ break;\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+\r\r
+// Public event handlers for configuration properties\r\r
+\r\r
+\r\r
+/**\r\r
+* @method enforceConstraints\r\r
+* @description The default event handler executed when the moveEvent is fired,\r\r
+* if the "constraintoviewport" configuration property is set to true.\r\r
+* @param {String} type The name of the event that was fired.\r\r
+* @param {Array} args Collection of arguments sent when the\r\r
+* event was fired.\r\r
+* @param {Array} obj Array containing the current Menu instance\r\r
+* and the item that fired the event.\r\r
+*/\r\r
+enforceConstraints: function(type, args, obj) {\r\r
+\r\r
+ var oConfig = this.cfg,\r\r
+ pos = args[0],\r\r
+\r\r
+ x = pos[0],\r\r
+ y = pos[1],\r\r
+\r\r
+ offsetHeight = this.element.offsetHeight,\r\r
+ offsetWidth = this.element.offsetWidth,\r\r
+\r\r
+ viewPortWidth = YAHOO.util.Dom.getViewportWidth(),\r\r
+ viewPortHeight = YAHOO.util.Dom.getViewportHeight(),\r\r
+\r\r
+ scrollX = Math.max(\r\r
+ document.documentElement.scrollLeft,\r\r
+ document.body.scrollLeft\r\r
+ ),\r\r
+\r\r
+ scrollY = Math.max(\r\r
+ document.documentElement.scrollTop,\r\r
+ document.body.scrollTop\r\r
+ ),\r\r
+\r\r
+ topConstraint = scrollY + 10,\r\r
+ leftConstraint = scrollX + 10,\r\r
+ bottomConstraint = scrollY + viewPortHeight - offsetHeight - 10,\r\r
+ rightConstraint = scrollX + viewPortWidth - offsetWidth - 10,\r\r
+\r\r
+ aContext = oConfig.getProperty("context"),\r\r
+ oContextElement = aContext ? aContext[0] : null;\r\r
+\r\r
+\r\r
+ if (x < 10) {\r\r
+\r\r
+ x = leftConstraint;\r\r
+\r\r
+ } else if ((x + offsetWidth) > viewPortWidth) {\r\r
+\r\r
+ if(\r\r
+ oContextElement &&\r\r
+ ((x - oContextElement.offsetWidth) > offsetWidth)\r\r
+ ) {\r\r
+\r\r
+ x = (x - (oContextElement.offsetWidth + offsetWidth));\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ x = rightConstraint;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ if (y < 10) {\r\r
+\r\r
+ y = topConstraint;\r\r
+\r\r
+ } else if (y > bottomConstraint) {\r\r
+\r\r
+ if(oContextElement && (y > offsetHeight)) {\r\r
+\r\r
+ y = ((y + oContextElement.offsetHeight) - offsetHeight);\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ y = bottomConstraint;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ oConfig.setProperty("x", x, true);\r\r
+ oConfig.setProperty("y", y, true);\r\r
+ oConfig.setProperty("xy", [x,y], true);\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method configVisible\r\r
+* @description Event handler for when the "visible" configuration property\r\r
+* the menu changes.\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+configVisible: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ if(this.cfg.getProperty("position") == "dynamic") {\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.configVisible.call(\r\r
+ this,\r\r
+ p_sType,\r\r
+ p_aArgs,\r\r
+ p_oMenu\r\r
+ );\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ var bVisible = p_aArgs[0],\r\r
+ sDisplay = Dom.getStyle(this.element, "display");\r\r
+\r\r
+ if(bVisible) {\r\r
+\r\r
+ if(sDisplay != "block") {\r\r
+ this.beforeShowEvent.fire();\r\r
+ Dom.setStyle(this.element, "display", "block");\r\r
+ this.showEvent.fire();\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ if(sDisplay == "block") {\r\r
+ this.beforeHideEvent.fire();\r\r
+ Dom.setStyle(this.element, "display", "none");\r\r
+ this.hideEvent.fire();\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method configPosition\r\r
+* @description Event handler for when the "position" configuration property\r\r
+* of the menu changes.\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+configPosition: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var sCSSPosition = p_aArgs[0] == "static" ? "static" : "absolute",\r\r
+ oCfg = this.cfg;\r\r
+\r\r
+ Dom.setStyle(this.element, "position", sCSSPosition);\r\r
+\r\r
+\r\r
+ if(sCSSPosition == "static") {\r\r
+\r\r
+ /*\r\r
+ Remove the iframe for statically positioned menus since it will\r\r
+ intercept mouse events.\r\r
+ */\r\r
+\r\r
+ oCfg.setProperty("iframe", false);\r\r
+\r\r
+\r\r
+ // Statically positioned menus are visible by default\r\r
+\r\r
+ Dom.setStyle(this.element, "display", "block");\r\r
+\r\r
+ oCfg.setProperty("visible", true);\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ /*\r\r
+ Even though the "visible" property is queued to\r\r
+ "false" by default, we need to set the "visibility" property to\r\r
+ "hidden" since Overlay's "configVisible" implementation checks the\r\r
+ element's "visibility" style property before deciding whether\r\r
+ or not to show an Overlay instance.\r\r
+ */\r\r
+\r\r
+ Dom.setStyle(this.element, "visibility", "hidden");\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(sCSSPosition == "absolute") {\r\r
+\r\r
+ var nZIndex = oCfg.getProperty("zindex");\r\r
+\r\r
+ if(!nZIndex || nZIndex === 0) {\r\r
+\r\r
+ nZIndex = this.parent ?\r\r
+ (this.parent.parent.cfg.getProperty("zindex") + 1) : 1;\r\r
+\r\r
+ oCfg.setProperty("zindex", nZIndex);\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method configIframe\r\r
+* @description Event handler for when the "iframe" configuration property of\r\r
+* the menu changes.\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+configIframe: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ if(this.cfg.getProperty("position") == "dynamic") {\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.configIframe.call(\r\r
+ this,\r\r
+ p_sType,\r\r
+ p_aArgs,\r\r
+ p_oMenu\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method configHideDelay\r\r
+* @description Event handler for when the "hidedelay" configuration property\r\r
+* of the menu changes.\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+configHideDelay: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var nHideDelay = p_aArgs[0],\r\r
+ oMouseOutEvent = this.mouseOutEvent,\r\r
+ oMouseOverEvent = this.mouseOverEvent,\r\r
+ oKeyDownEvent = this.keyDownEvent;\r\r
+\r\r
+ if(nHideDelay > 0) {\r\r
+\r\r
+ /*\r\r
+ Only assign event handlers once. This way the user change\r\r
+ the value for the hidedelay as many times as they want.\r\r
+ */\r\r
+\r\r
+ if(!this._hideDelayEventHandlersAssigned) {\r\r
+\r\r
+ oMouseOutEvent.subscribe(this._execHideDelay, true);\r\r
+ oMouseOverEvent.subscribe(this._cancelHideDelay, this, true);\r\r
+ oKeyDownEvent.subscribe(this._cancelHideDelay, this, true);\r\r
+\r\r
+ this._hideDelayEventHandlersAssigned = true;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ oMouseOutEvent.unsubscribe(this._execHideDelay, this);\r\r
+ oMouseOverEvent.unsubscribe(this._cancelHideDelay, this);\r\r
+ oKeyDownEvent.unsubscribe(this._cancelHideDelay, this);\r\r
+\r\r
+ this._hideDelayEventHandlersAssigned = false;\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method configContainer\r\r
+* @description Event handler for when the "container" configuration property\r\r
+of the menu changes.\r\r
+* @param {String} p_sType String representing the name of the event that\r\r
+* was fired.\r\r
+* @param {Array} p_aArgs Array of arguments sent when the event was fired.\r\r
+* @param {YAHOO.widget.Menu} p_oMenu Object representing the menu that\r\r
+* fired the event.\r\r
+*/\r\r
+configContainer: function(p_sType, p_aArgs, p_oMenu) {\r\r
+\r\r
+ var oElement = p_aArgs[0];\r\r
+\r\r
+ if(typeof oElement == 'string') {\r\r
+\r\r
+ this.cfg.setProperty(\r\r
+ "container",\r\r
+ document.getElementById(oElement),\r\r
+ true\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+\r\r
+// Public methods\r\r
+\r\r
+\r\r
+/**\r\r
+* @method initEvents\r\r
+* @description Initializes the custom events for the menu.\r\r
+*/\r\r
+initEvents: function() {\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.initEvents.call(this);\r\r
+\r\r
+ // Create custom events\r\r
+\r\r
+ var CustomEvent = YAHOO.util.CustomEvent;\r\r
+\r\r
+ this.mouseOverEvent = new CustomEvent("mouseOverEvent", this);\r\r
+ this.mouseOutEvent = new CustomEvent("mouseOutEvent", this);\r\r
+ this.mouseDownEvent = new CustomEvent("mouseDownEvent", this);\r\r
+ this.mouseUpEvent = new CustomEvent("mouseUpEvent", this);\r\r
+ this.clickEvent = new CustomEvent("clickEvent", this);\r\r
+ this.keyPressEvent = new CustomEvent("keyPressEvent", this);\r\r
+ this.keyDownEvent = new CustomEvent("keyDownEvent", this);\r\r
+ this.keyUpEvent = new CustomEvent("keyUpEvent", this);\r\r
+ this.itemAddedEvent = new CustomEvent("itemAddedEvent", this);\r\r
+ this.itemRemovedEvent = new CustomEvent("itemRemovedEvent", this);\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method getRoot\r\r
+* @description Finds the menu's root menu.\r\r
+*/\r\r
+getRoot: function() {\r\r
+\r\r
+ var oItem = this.parent;\r\r
+\r\r
+ if(oItem) {\r\r
+\r\r
+ var oParentMenu = oItem.parent;\r\r
+\r\r
+ return oParentMenu ? oParentMenu.getRoot() : this;\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ return this;\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method toString\r\r
+* @description Returns a string representing the menu.\r\r
+* @return {String}\r\r
+*/\r\r
+toString: function() {\r\r
+\r\r
+ return ("Menu " + this.id);\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method setItemGroupTitle\r\r
+* @description Sets the title of a group of menu items.\r\r
+* @param {String} p_sGroupTitle String specifying the title of the group.\r\r
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to which\r\r
+* the title belongs.\r\r
+*/\r\r
+setItemGroupTitle: function(p_sGroupTitle, p_nGroupIndex) {\r\r
+\r\r
+ if(typeof p_sGroupTitle == "string" && p_sGroupTitle.length > 0) {\r\r
+\r\r
+ var nGroupIndex = typeof p_nGroupIndex == "number" ? p_nGroupIndex : 0,\r\r
+ oTitle = this._aGroupTitleElements[nGroupIndex];\r\r
+\r\r
+\r\r
+ if(oTitle) {\r\r
+\r\r
+ oTitle.innerHTML = p_sGroupTitle;\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ oTitle = document.createElement(this.GROUP_TITLE_TAG_NAME);\r\r
+\r\r
+ oTitle.innerHTML = p_sGroupTitle;\r\r
+\r\r
+ this._aGroupTitleElements[nGroupIndex] = oTitle;\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ var i = this._aGroupTitleElements.length - 1,\r\r
+ nFirstIndex;\r\r
+\r\r
+ do {\r\r
+\r\r
+ if(this._aGroupTitleElements[i]) {\r\r
+\r\r
+ Dom.removeClass(this._aGroupTitleElements[i], "first-of-type");\r\r
+\r\r
+ nFirstIndex = i;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ while(i--);\r\r
+\r\r
+\r\r
+ if(nFirstIndex !== null) {\r\r
+\r\r
+ Dom.addClass(\r\r
+ this._aGroupTitleElements[nFirstIndex],\r\r
+ "first-of-type"\r\r
+ );\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+\r\r
+/**\r\r
+* @method addItem\r\r
+* @description Appends an item to the menu.\r\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r\r
+* instance to be added to the menu.\r\r
+* @param {String} p_oItem String specifying the text of the item to be added\r\r
+* to the menu.\r\r
+* @param {Object} p_oItem Object literal containing a set of menu item\r\r
+* configuration properties.\r\r
+* @param {Number} p_nGroupIndex Optional. Number indicating the group to\r\r
+* which the item belongs.\r\r
+* @return {YAHOO.widget.MenuItem}\r\r
+*/\r\r
+addItem: function(p_oItem, p_nGroupIndex) {\r\r
+\r\r
+ if(p_oItem) {\r\r
+\r\r
+ return this._addItemToGroup(p_nGroupIndex, p_oItem);\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method addItems\r\r
+* @description Adds an array of items to the menu.\r\r
+* @param {Array} p_aItems Array of items to be added to the menu. The array\r\r
+* can contain strings specifying the text for each item to be created, object\r\r
+* literals specifying each of the menu item configuration properties,\r\r
+* or MenuItem instances.\r\r
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to\r\r
+* which the items belongs.\r\r
+* @return {Array}\r\r
+*/\r\r
+addItems: function(p_aItems, p_nGroupIndex) {\r\r
+\r\r
+ function isArray(p_oValue) {\r\r
+\r\r
+ return (typeof p_oValue == "object" && p_oValue.constructor == Array);\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(isArray(p_aItems)) {\r\r
+\r\r
+ var nItems = p_aItems.length,\r\r
+ aItems = [],\r\r
+ oItem;\r\r
+\r\r
+\r\r
+ for(var i=0; i<nItems; i++) {\r\r
+\r\r
+ oItem = p_aItems[i];\r\r
+\r\r
+ if(isArray(oItem)) {\r\r
+\r\r
+ aItems[aItems.length] = this.addItems(oItem, i);\r\r
+\r\r
+ }\r\r
+ else {\r\r
+\r\r
+ aItems[aItems.length] =\r\r
+ this._addItemToGroup(p_nGroupIndex, oItem);\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ if(aItems.length) {\r\r
+\r\r
+ return aItems;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method insertItem\r\r
+* @description Inserts an item into the menu at the specified index.\r\r
+* @param {YAHOO.widget.MenuItem} p_oItem Object reference for the MenuItem\r\r
+* instance to be added to the menu.\r\r
+* @param {String} p_oItem String specifying the text of the item to be added\r\r
+* to the menu.\r\r
+* @param {Object} p_oItem Object literal containing a set of menu item\r\r
+* configuration properties.\r\r
+* @param {Number} p_nItemIndex Number indicating the ordinal position at which\r\r
+* the item should be added.\r\r
+* @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r\r
+* the item belongs.\r\r
+* @return {YAHOO.widget.MenuItem}\r\r
+*/\r\r
+insertItem: function(p_oItem, p_nItemIndex, p_nGroupIndex) {\r\r
+\r\r
+ if(p_oItem) {\r\r
+\r\r
+ return this._addItemToGroup(p_nGroupIndex, p_oItem, p_nItemIndex);\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method removeItem\r\r
+* @description Removes the specified item from the menu.\r\r
+* @param {YAHOO.widget.MenuItem} p_oObject Object reference for the MenuItem\r\r
+* instance to be removed from the menu.\r\r
+* @param {Number} p_oObject Number specifying the index of the item\r\r
+* to be removed.\r\r
+* @param {Number} p_nGroupIndex Optional. Number specifying the group to\r\r
+* which the item belongs.\r\r
+* @return {YAHOO.widget.MenuItem}\r\r
+*/\r\r
+removeItem: function(p_oObject, p_nGroupIndex) {\r\r
+\r\r
+ if(typeof p_oObject != "undefined") {\r\r
+\r\r
+ var oItem;\r\r
+\r\r
+ if(p_oObject instanceof YAHOO.widget.MenuItem) {\r\r
+\r\r
+ oItem = this._removeItemFromGroupByValue(p_nGroupIndex, p_oObject);\r\r
+\r\r
+ }\r\r
+ else if(typeof p_oObject == "number") {\r\r
+\r\r
+ oItem = this._removeItemFromGroupByIndex(p_nGroupIndex, p_oObject);\r\r
+\r\r
+ }\r\r
+\r\r
+ if(oItem) {\r\r
+\r\r
+ oItem.destroy();\r\r
+\r\r
+\r\r
+ return oItem;\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method getItemGroups\r\r
+* @description Returns a multi-dimensional array of all of the items in the menu.\r\r
+* @return {Array}\r\r
+*/\r\r
+getItemGroups: function() {\r\r
+\r\r
+ return this._aItemGroups;\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method getItem\r\r
+* @description Returns the item at the specified index.\r\r
+* @param {Number} p_nItemIndex Number indicating the ordinal position of the\r\r
+* item to be retrieved.\r\r
+* @param {Number} p_nGroupIndex Optional. Number indicating the group to which\r\r
+* the item belongs.\r\r
+* @return {YAHOO.widget.MenuItem}\r\r
+*/\r\r
+getItem: function(p_nItemIndex, p_nGroupIndex) {\r\r
+\r\r
+ if(typeof p_nItemIndex == "number") {\r\r
+\r\r
+ var aGroup = this._getItemGroup(p_nGroupIndex);\r\r
+\r\r
+ if(aGroup) {\r\r
+\r\r
+ return aGroup[p_nItemIndex];\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method destroy\r\r
+* @description Removes the menu's <code><div></code> element\r\r
+* (and accompanying child nodes) from the document.\r\r
+*/\r\r
+destroy: function() {\r\r
+\r\r
+ // Remove Custom Event listeners\r\r
+\r\r
+ this.mouseOverEvent.unsubscribeAll();\r\r
+ this.mouseOutEvent.unsubscribeAll();\r\r
+ this.mouseDownEvent.unsubscribeAll();\r\r
+ this.mouseUpEvent.unsubscribeAll();\r\r
+ this.clickEvent.unsubscribeAll();\r\r
+ this.keyPressEvent.unsubscribeAll();\r\r
+ this.keyDownEvent.unsubscribeAll();\r\r
+ this.keyUpEvent.unsubscribeAll();\r\r
+ this.itemAddedEvent.unsubscribeAll();\r\r
+ this.itemRemovedEvent.unsubscribeAll();\r\r
+\r\r
+ var nItemGroups = this._aItemGroups.length,\r\r
+ nItems,\r\r
+ oItemGroup,\r\r
+ oItem,\r\r
+ i,\r\r
+ n;\r\r
+\r\r
+\r\r
+ // Remove all items\r\r
+\r\r
+ if(nItemGroups > 0) {\r\r
+\r\r
+ i = nItemGroups - 1;\r\r
+\r\r
+ do {\r\r
+\r\r
+ oItemGroup = this._aItemGroups[i];\r\r
+\r\r
+ if(oItemGroup) {\r\r
+\r\r
+ nItems = oItemGroup.length;\r\r
+\r\r
+ if(nItems > 0) {\r\r
+\r\r
+ n = nItems - 1;\r\r
+\r\r
+ do {\r\r
+\r\r
+ oItem = this._aItemGroups[i][n];\r\r
+\r\r
+ if(oItem) {\r\r
+\r\r
+ oItem.destroy();\r\r
+ }\r\r
+\r\r
+ }\r\r
+ while(n--);\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+ while(i--);\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ // Continue with the superclass implementation of this method\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.destroy.call(this);\r\r
+\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method setInitialFocus\r\r
+* @description Sets focus to the menu's first enabled item.\r\r
+*/\r\r
+setInitialFocus: function() {\r\r
+\r\r
+ var oItem = this._getFirstEnabledItem();\r\r
+\r\r
+ if(oItem) {\r\r
+\r\r
+ oItem.focus();\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method setInitialSelection\r\r
+* @description Sets the "selected" configuration property of the menu's first\r\r
+* enabled item to "true."\r\r
+*/\r\r
+setInitialSelection: function() {\r\r
+\r\r
+ var oItem = this._getFirstEnabledItem();\r\r
+\r\r
+ if(oItem) {\r\r
+\r\r
+ oItem.cfg.setProperty("selected", true);\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @method clearActiveItem\r\r
+* @description Sets the "selected" configuration property of the menu's active\r\r
+* item to "false" and hides the item's submenu.\r\r
+* @param {Boolean} p_bBlur Boolean indicating if the menu's active item\r\r
+* should be blurred.\r\r
+*/\r\r
+clearActiveItem: function(p_bBlur) {\r\r
+\r\r
+ if(this.cfg.getProperty("showdelay") > 0) {\r\r
+\r\r
+ this._cancelShowDelay();\r\r
+\r\r
+ }\r\r
+\r\r
+\r\r
+ var oActiveItem = this.activeItem;\r\r
+\r\r
+ if(oActiveItem) {\r\r
+\r\r
+ var oConfig = oActiveItem.cfg;\r\r
+\r\r
+ oConfig.setProperty("selected", false);\r\r
+\r\r
+ var oSubmenu = oConfig.getProperty("submenu");\r\r
+\r\r
+ if(oSubmenu) {\r\r
+\r\r
+ oSubmenu.hide();\r\r
+\r\r
+ }\r\r
+\r\r
+ if(p_bBlur) {\r\r
+\r\r
+ oActiveItem.blur();\r\r
+\r\r
+ }\r\r
+\r\r
+ }\r\r
+\r\r
+},\r\r
+\r\r
+\r\r
+/**\r\r
+* @description Initializes the class's configurable properties which can be\r\r
+* changed using the menu's Config object ("cfg").\r\r
+* @method initDefaultConfig\r\r
+*/\r\r
+initDefaultConfig: function() {\r\r
+\r\r
+ YAHOO.widget.Menu.superclass.initDefaultConfig.call(this);\r\r
+\r\r
+ var oConfig = this.cfg;\r\r
+\r\r
+ // Add configuration properties\r\r
+\r\r
+ /*\r\r
+ Change the default value for the "visible" configuration\r\r
+ property to "false" by re-adding the property.\r\r
+ */\r\r
+\r\r
+ /**\r\r
+ * @config visible\r\r
+ * @description Boolean indicating whether or not the menu is visible. If\r\r
+ * the menu's "position" configuration property is set to "dynamic" (the\r\r
+ * default), this property toggles the menu's <code><div></code>\r\r
+ * element's "visibility" style property between "visible" (true) or\r\r
+ * "hidden" (false). If the menu's "position" configuration property is\r\r
+ * set to "static" this property toggles the menu's\r\r
+ * <code><div></code> element's "display" style property\r\r
+ * between "block" (true) or "none" (false).\r\r
+ * @default false\r\r
+ * @type Boolean\r\r
+ */\r\r
+ oConfig.addProperty(\r\r
+ "visible",\r\r
+ {\r\r
+ value:false,\r\r
+ handler:this.configVisible,\r\r
+ validator:this.cfg.checkBoolean\r\r
+ }\r\r
+ );\r\r
+\r\r
+\r\r
+ /*\r\r
+ Change the default value for the "constraintoviewport" configuration\r\r
+ property to "true" by re-adding the property.\r\r
+ */\r\r
+\r\r
+ /**\r\r
+ * @config constraintoviewport\r\r
+ * @description Boolean indicating if the menu will try to remain inside\r\r
+ * the boundaries of the size of viewport.\r\r
+ * @default true\r\r
+ * @type Boolean\r\r
+ */\r\r
+ oConfig.addProperty(\r\r
+ "constraintoviewport",\r\r
+ {\r\r
+ value:true,\r\r
+ handler:this.configConstrainToViewport,\r\r
+ validator:this.cfg.checkBoolean,\r\r
+ supercedes:["iframe","x","y","xy"]\r\r
+ }\r\r
+ );\r\r
+\r\r
+\r\r
+ /**\r\r
+ * @config position\r\r
+ * @description String indicating how a menu should be positioned on the\r\r
+ * screen. Possible values are "static" and "dynamic." Static menus are\r\r
+ * visible by default and reside in the normal flow of the document\r\r
+ * (CSS position: static). Dynamic menus are hidden by default, reside\r\r
+ * out of the normal flow of the document (CSS position: absolute), and\r\r
+ * can overlay other elements on the screen.\r\r
+ * @default dynamic\r\r
+ * @type String\r\r
+ */\r\r
+ oConfig.addProperty(\r\r
+ "position",\r\r
+ {\r\r
+ value: "dynamic",\r\r
+ handler: this.configPosition,\r\r
+ validator: this._checkPosition,\r\r
+ supercedes: ["visible"]\r\r
+ }\r\r
+ );\r\r
+\r\r
+\r\r
+ /**\r\r
+ * @config submenualignment\r\r
+ * @description Array defining how submenus should be aligned to their\r\r
+ * parent menu item. The format is: [itemCorner, submenuCorner]. By default\r\r
+ * a submenu's top left corner is aligned to its parent menu item's top\r\r
+ * right corner.\r\r
+ * @default ["tl","tr"]\r\r
+ * @type Array\r\r
+ */\r\r
+ oConfig.addProperty("submenualignment", { value: ["tl","tr"] } );\r\r
+\r\r
+\r\r
+ /**\r\r
+ * @config autosubmenudisplay\r\r
+ * @description Boolean indicating if submenus are automatically made\r\r
+ * visible when the user mouses over the menu's items.\r\r
+ * @default true\r\r
+ * @type Boolean\r\r
+ */\r\r
+ oConfig.addProperty(\r\r
+ "autosubmenudisplay",\r\r
+ {\r\r
+ value: true,\r\r
+ validator: oConfig.checkBoolean\r\r
+ }\r\r
+ );\r\r
+\r\r
+\r\r
+ /**\r\r
+ * @config showdelay\r\r
+ * @description Number indicating the time (in milliseconds) that should\r\r
+ * expire before a submenu is made visible when the user mouses over\r\r
+ * the menu's items.\r\r
+ * @default 0\r\r
+ * @type Number\r\r
+ */\r\r
+ oConfig.addProperty(\r\r
+ "showdelay",\r\r
+ {\r\r
+ value: 0,\r\r
+ validator: oConfig.checkNumber\r\r
+ }\r\r
+ );\r\r
+\r\r
+\r\r
+ /**\r\r
+ * @config hidedelay\r\r
+ * @description Number indicating the time (in milliseconds) that should\r\r
+ * expire before the menu is hidden.\r\r
+ * @default 0\r\r
+ * @type Number\r\r
+ */\r\r
+ oConfig.addProperty(\r\r
+ "hidedelay",\r\r
+ {\r\r
+ value: 0,\r\r
+ validator: oConfig.checkNumber,\r\r
+ handler: this.configHideDelay,\r\r
+ suppressEvent: true\r\r
+ }\r\r
+ );\r\r
+\r\r
+\r\r
+ /**\r\r
+ * @config clicktohide\r\r
+ * @description Boolean indicating if the menu will automatically be\r\r
+ * hidden if the user clicks outside of it.\r\r
+ * @default true\r\r
+ * @type Boolean\r\r
+ */\r\r
+ oConfig.addProperty(\r\r
+ "clicktohide",\r\r
+ {\r\r
+ value: true,\r\r
+ validator: oConfig.checkBoolean\r\r
+ }\r\r
+ );\r\r
+\r\r
+\r\r
+ /**\r\r
+ * @config container\r\r
+ * @description HTML element reference or string specifying the id\r\r
+ * attribute of the HTML element that the menu's markup should be rendered into.\r\r
+ * @type <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/\r\r
+ * level-one-html.html#ID-58190037">HTMLElement</a>|String\r\r
+ * @default document.body\r\r
+ */\r\r
+ this.cfg.addProperty(\r\r
+ "container",\r\r
+ { value:document.body, handler:this.configContainer }\r\r
+ );\r\r
+\r\r
+}\r\r
+\r\r
+}); // END YAHOO.extend\r\r
+\r\r
})();\r
\r
/**\r
\r
(function() {\r
\r
-var Dom = YAHOO.util.Dom;\r
-var Module = YAHOO.widget.Module;\r
-var Menu = YAHOO.widget.Menu;\r
+var Dom = YAHOO.util.Dom,\r
+ Module = YAHOO.widget.Module,\r
+ Menu = YAHOO.widget.Menu;\r
\r
/**\r
* Creates an item for a menu.\r
\r
// Get the anchor node (if it exists)\r
\r
- var oAnchor = this._getFirstElement(p_oObject, "A");\r
- var sURL = "#";\r
- var sTarget = null;\r
- var sText = null;\r
+ var oAnchor = this._getFirstElement(p_oObject, "A"),\r
+ sURL = "#",\r
+ sTarget,\r
+ sText;\r
\r
// Capture the "text" and/or the "URL"\r
\r
\r
// Check if emphasis has been applied to the MenuItem\r
\r
- var oEmphasisNode = this._getFirstElement(oAnchor);\r
- var bEmphasis = false;\r
- var bStrongEmphasis = false;\r
+ var oEmphasisNode = this._getFirstElement(oAnchor),\r
+ bEmphasis = false,\r
+ bStrongEmphasis = false;\r
\r
if(oEmphasisNode) {\r
\r
*/\r
_initSubTree: function() {\r
\r
- var oSrcEl = this.srcElement;\r
- var oConfig = this.cfg;\r
+ var oSrcEl = this.srcElement,\r
+ oConfig = this.cfg;\r
\r
if(oSrcEl.childNodes.length > 0) {\r
\r
}\r
else {\r
\r
- var oNode = oSrcEl.firstChild;\r
- var aOptions = [];\r
+ var oNode = oSrcEl.firstChild,\r
+ aOptions = [];\r
\r
do {\r
\r
*/\r
configHelpText: function(p_sType, p_aArgs, p_oItem) {\r
\r
- var me = this;\r
- var oHelpText = p_aArgs[0];\r
- var oEl = this.element;\r
- var oConfig = this.cfg;\r
- var aNodes = [oEl, this._oAnchor];\r
- var oImg = this.submenuIndicator;\r
+ var me = this,\r
+ oHelpText = p_aArgs[0],\r
+ oEl = this.element,\r
+ oConfig = this.cfg,\r
+ aNodes = [oEl, this._oAnchor],\r
+ oImg = this.submenuIndicator;\r
\r
/**\r
* Adds the "hashelptext" class to the necessary nodes and refires the\r
* "selected" and "disabled" configuration events.\r
* @private\r
*/\r
- var initHelpText = function() {\r
+ function initHelpText() {\r
\r
Dom.addClass(aNodes, "hashelptext");\r
\r
\r
}\r
\r
- };\r
+ }\r
\r
/**\r
* Removes the "hashelptext" class and corresponding DOM element (EM).\r
* @private\r
*/\r
- var removeHelpText = function() {\r
+ function removeHelpText() {\r
\r
Dom.removeClass(aNodes, "hashelptext");\r
\r
oEl.removeChild(me._oHelpTextEM);\r
me._oHelpTextEM = null;\r
\r
- };\r
+ }\r
\r
if(this._checkDOMNode(oHelpText)) {\r
\r
*/\r
configTarget: function(p_sType, p_aArgs, p_oItem) {\r
\r
- var sTarget = p_aArgs[0];\r
- var oAnchor = this._oAnchor;\r
+ var sTarget = p_aArgs[0],\r
+ oAnchor = this._oAnchor;\r
\r
if(sTarget && sTarget.length > 0) {\r
\r
*/\r
configEmphasis: function(p_sType, p_aArgs, p_oItem) {\r
\r
- var bEmphasis = p_aArgs[0];\r
- var oAnchor = this._oAnchor;\r
- var oText = this._oText;\r
- var oConfig = this.cfg;\r
- var oEM;\r
+ var bEmphasis = p_aArgs[0],\r
+ oAnchor = this._oAnchor,\r
+ oText = this._oText,\r
+ oConfig = this.cfg,\r
+ oEM;\r
\r
if(bEmphasis && oConfig.getProperty("strongemphasis")) {\r
\r
\r
oEM = this._getFirstElement(oAnchor, "EM");\r
\r
- oAnchor.removeChild(oEM);\r
- oAnchor.appendChild(oText);\r
+ if(oEM) {\r
+\r
+ oAnchor.removeChild(oEM);\r
+ oAnchor.appendChild(oText);\r
+\r
+ }\r
\r
}\r
\r
*/\r
configStrongEmphasis: function(p_sType, p_aArgs, p_oItem) {\r
\r
- var bStrongEmphasis = p_aArgs[0];\r
- var oAnchor = this._oAnchor;\r
- var oText = this._oText;\r
- var oConfig = this.cfg;\r
- var oStrong;\r
+ var bStrongEmphasis = p_aArgs[0],\r
+ oAnchor = this._oAnchor,\r
+ oText = this._oText,\r
+ oConfig = this.cfg,\r
+ oStrong;\r
\r
if(bStrongEmphasis && oConfig.getProperty("emphasis")) {\r
\r
\r
oStrong = this._getFirstElement(oAnchor, "STRONG");\r
\r
- oAnchor.removeChild(oStrong);\r
- oAnchor.appendChild(oText);\r
+ if(oStrong) {\r
+\r
+ oAnchor.removeChild(oStrong);\r
+ oAnchor.appendChild(oText);\r
+\r
+ }\r
\r
}\r
\r
*/\r
configChecked: function(p_sType, p_aArgs, p_oItem) {\r
\r
- var bChecked = p_aArgs[0];\r
- var oEl = this.element;\r
- var oConfig = this.cfg;\r
- var oImg;\r
+ var bChecked = p_aArgs[0],\r
+ oEl = this.element,\r
+ oConfig = this.cfg,\r
+ oImg;\r
\r
\r
if(bChecked) {\r
*/\r
configDisabled: function(p_sType, p_aArgs, p_oItem) {\r
\r
- var bDisabled = p_aArgs[0];\r
- var oAnchor = this._oAnchor;\r
- var aNodes = [this.element, oAnchor];\r
- var oEM = this._oHelpTextEM;\r
- var oConfig = this.cfg;\r
- var oImg;\r
- var sImgSrc;\r
- var sImgAlt;\r
+ var bDisabled = p_aArgs[0],\r
+ oAnchor = this._oAnchor,\r
+ aNodes = [this.element, oAnchor],\r
+ oEM = this._oHelpTextEM,\r
+ oConfig = this.cfg,\r
+ oImg,\r
+ sImgSrc,\r
+ sImgAlt;\r
\r
if(oEM) {\r
\r
\r
if(!this.cfg.getProperty("disabled")) {\r
\r
- var bSelected = p_aArgs[0];\r
- var oEM = this._oHelpTextEM;\r
- var aNodes = [this.element, this._oAnchor];\r
- var oImg = this.submenuIndicator;\r
- var sImgSrc;\r
+ var bSelected = p_aArgs[0],\r
+ oEM = this._oHelpTextEM,\r
+ aNodes = [this.element, this._oAnchor],\r
+ oImg = this.submenuIndicator,\r
+ sImgSrc;\r
\r
if(oEM) {\r
\r
*/\r
configSubmenu: function(p_sType, p_aArgs, p_oItem) {\r
\r
- var oEl = this.element;\r
- var oSubmenu = p_aArgs[0];\r
- var oImg = this.submenuIndicator;\r
- var oConfig = this.cfg;\r
- var aNodes = [this.element, this._oAnchor];\r
- var oMenu;\r
- var bLazyLoad = this.parent && this.parent.lazyLoad;\r
+ var oEl = this.element,\r
+ oSubmenu = p_aArgs[0],\r
+ oImg = this.submenuIndicator,\r
+ oConfig = this.cfg,\r
+ aNodes = [this.element, this._oAnchor],\r
+ oMenu,\r
+ bLazyLoad = this.parent && this.parent.lazyLoad;\r
\r
if(oSubmenu) {\r
\r
!oSubmenu.nodeType\r
) {\r
\r
- var sSubmenuId = oSubmenu.id;\r
- var oSubmenuConfig = oSubmenu;\r
-\r
- delete oSubmenu["id"];\r
+ var sSubmenuId = oSubmenu.id,\r
+ oSubmenuConfig = oSubmenu;\r
\r
oSubmenuConfig.lazyload = bLazyLoad;\r
oSubmenuConfig.parent = this;\r
*/\r
initDefaultConfig : function() {\r
\r
- var oConfig = this.cfg;\r
- var CheckBoolean = oConfig.checkBoolean;\r
+ var oConfig = this.cfg,\r
+ CheckBoolean = oConfig.checkBoolean;\r
\r
// Define the config properties\r
\r
* start searching the array.\r
* @return {Object}\r
*/\r
- var getNextArrayItem = function(p_aArray, p_nStartIndex) {\r
+ function getNextArrayItem(p_aArray, p_nStartIndex) {\r
\r
return p_aArray[p_nStartIndex] ||\r
getNextArrayItem(p_aArray, (p_nStartIndex+1));\r
\r
- };\r
+ }\r
\r
\r
- var aItemGroups = this.parent.getItemGroups();\r
- var oNextItem;\r
+ var aItemGroups = this.parent.getItemGroups(),\r
+ oNextItem;\r
\r
\r
if(this.index < (aItemGroups[nGroupIndex].length - 1)) {\r
* start searching the array.\r
* @return {Object}\r
*/\r
- var getPreviousArrayItem = function(p_aArray, p_nStartIndex) {\r
+ function getPreviousArrayItem(p_aArray, p_nStartIndex) {\r
\r
return p_aArray[p_nStartIndex] ||\r
getPreviousArrayItem(p_aArray, (p_nStartIndex-1));\r
\r
- };\r
+ }\r
\r
/**\r
* Get the index of the first item in an array\r
* start searching the array.\r
* @return {Object}\r
*/\r
- var getFirstItemIndex = function(p_aArray, p_nStartIndex) {\r
+ function getFirstItemIndex(p_aArray, p_nStartIndex) {\r
\r
return p_aArray[p_nStartIndex] ?\r
p_nStartIndex :\r
getFirstItemIndex(p_aArray, (p_nStartIndex+1));\r
\r
- };\r
+ }\r
\r
- var aItemGroups = this.parent.getItemGroups();\r
- var oPreviousItem;\r
+ var aItemGroups = this.parent.getItemGroups(),\r
+ oPreviousItem;\r
\r
if(\r
this.index > getFirstItemIndex(aItemGroups[nGroupIndex], 0)\r
*/\r
focus: function() {\r
\r
- var oParent = this.parent;\r
- var oAnchor = this._oAnchor;\r
- var oActiveItem = oParent.activeItem;\r
+ var oParent = this.parent,\r
+ oAnchor = this._oAnchor,\r
+ oActiveItem = oParent.activeItem;\r
+\r
+ function setFocus() {\r
+\r
+ try {\r
+\r
+ oAnchor.focus();\r
+\r
+ }\r
+ catch(e) {\r
+\r
+ }\r
+\r
+ }\r
\r
if(\r
!this.cfg.getProperty("disabled") &&\r
\r
}\r
\r
- try {\r
-\r
- oAnchor.focus();\r
-\r
- }\r
- catch(e) {\r
+ /*\r
+ Setting focus via a timer fixes a race condition in Firefox, IE\r
+ and Opera where the browser viewport jumps as it trys to\r
+ position and focus the menu.\r
+ */\r
\r
- }\r
+ window.setTimeout(setFocus, 0);\r
\r
this.focusEvent.fire();\r
\r
\r
if(oEl) {\r
\r
+ // If the item has a submenu, destroy it first\r
+\r
+ var oSubmenu = this.cfg.getProperty("submenu");\r
+\r
+ if(oSubmenu) {\r
+\r
+ oSubmenu.destroy();\r
+\r
+ }\r
+\r
// Remove CustomEvent listeners\r
\r
this.mouseOverEvent.unsubscribeAll();\r
*/\r
_removeEventHandlers: function() {\r
\r
- var Event = YAHOO.util.Event;\r
- var oTrigger = this._oTrigger;\r
- var bOpera = (this.browser == "opera");\r
+ var Event = YAHOO.util.Event,\r
+ oTrigger = this._oTrigger,\r
+ bOpera = (this.browser == "opera");\r
\r
// Remove the event handlers from the trigger(s)\r
\r
\r
YAHOO.widget.MenuManager.hideVisible();\r
\r
- var Event = YAHOO.util.Event;\r
- var oConfig = this.cfg;\r
+ var Event = YAHOO.util.Event,\r
+ oConfig = this.cfg;\r
\r
if(p_oEvent.type == "mousedown" && !p_oEvent.ctrlKey) {\r
\r
\r
// Position and display the context menu\r
\r
- var nX = Event.getPageX(p_oEvent);\r
- var nY = Event.getPageY(p_oEvent);\r
+ var nX = Event.getPageX(p_oEvent),\r
+ nY = Event.getPageY(p_oEvent);\r
\r
oConfig.applyConfig( { xy:[nX, nY], visible:true } );\r
oConfig.fireQueue();\r
*/\r
configTrigger: function(p_sType, p_aArgs, p_oMenu) {\r
\r
- var Event = YAHOO.util.Event;\r
- var oTrigger = p_aArgs[0];\r
+ var Event = YAHOO.util.Event,\r
+ oTrigger = p_aArgs[0];\r
\r
if(oTrigger) {\r
\r
*/\r
_onKeyDown: function(p_sType, p_aArgs, p_oMenuBar) {\r
\r
- var Event = YAHOO.util.Event;\r
- var oEvent = p_aArgs[0];\r
- var oItem = p_aArgs[1];\r
- var oItemCfg = oItem.cfg;\r
- var oSubmenu;\r
+ var Event = YAHOO.util.Event,\r
+ oEvent = p_aArgs[0],\r
+ oItem = p_aArgs[1],\r
+ oSubmenu;\r
\r
- switch(oEvent.keyCode) {\r
+ if(oItem && !oItem.cfg.getProperty("disabled")) {\r
\r
- case 27: // Esc key\r
+ var oItemCfg = oItem.cfg;\r
\r
- if(this.cfg.getProperty("position") == "dynamic") {\r
+ switch(oEvent.keyCode) {\r
\r
- this.hide();\r
+ case 37: // Left arrow\r
+ case 39: // Right arrow\r
\r
- if(this.parent) {\r
+ if(\r
+ oItem == this.activeItem &&\r
+ !oItemCfg.getProperty("selected")\r
+ ) {\r
\r
- this.parent.focus();\r
+ oItemCfg.setProperty("selected", true);\r
\r
}\r
+ else {\r
\r
- }\r
- else if(this.activeItem) {\r
+ var oNextItem = (oEvent.keyCode == 37) ?\r
+ oItem.getPreviousEnabledSibling() :\r
+ oItem.getNextEnabledSibling();\r
\r
- oSubmenu = this.activeItem.cfg.getProperty("submenu");\r
+ if(oNextItem) {\r
\r
- if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {\r
+ this.clearActiveItem();\r
\r
- oSubmenu.hide();\r
- this.activeItem.focus();\r
+ oNextItem.cfg.setProperty("selected", true);\r
\r
- }\r
- else {\r
\r
- this.activeItem.cfg.setProperty("selected", false);\r
- this.activeItem.blur();\r
+ if(this.cfg.getProperty("autosubmenudisplay")) {\r
\r
- }\r
+ oSubmenu = oNextItem.cfg.getProperty("submenu");\r
\r
- }\r
+ if(oSubmenu) {\r
\r
+ oSubmenu.show();\r
+ oSubmenu.activeItem.blur();\r
+ oSubmenu.activeItem = null;\r
\r
- Event.preventDefault(oEvent);\r
+ }\r
\r
- break;\r
+ }\r
\r
- case 37: // Left arrow\r
- case 39: // Right arrow\r
+ oNextItem.focus();\r
\r
- if(\r
- oItem == this.activeItem &&\r
- !oItemCfg.getProperty("selected")\r
- ) {\r
+ }\r
\r
- oItemCfg.setProperty("selected", true);\r
+ }\r
\r
- }\r
- else {\r
+ Event.preventDefault(oEvent);\r
+\r
+ break;\r
\r
- var oNextItem = (oEvent.keyCode == 37) ?\r
- oItem.getPreviousEnabledSibling() :\r
- oItem.getNextEnabledSibling();\r
+ case 40: // Down arrow\r
\r
- if(oNextItem) {\r
+ if(this.activeItem != oItem) {\r
\r
this.clearActiveItem();\r
\r
- oNextItem.cfg.setProperty("selected", true);\r
+ oItemCfg.setProperty("selected", true);\r
+ oItem.focus();\r
\r
- if(this.cfg.getProperty("autosubmenudisplay")) {\r
+ }\r
\r
- oSubmenu = oNextItem.cfg.getProperty("submenu");\r
+ oSubmenu = oItemCfg.getProperty("submenu");\r
\r
- if(oSubmenu) {\r
+ if(oSubmenu) {\r
\r
- oSubmenu.show();\r
- oSubmenu.activeItem.blur();\r
- oSubmenu.activeItem = null;\r
+ if(oSubmenu.cfg.getProperty("visible")) {\r
\r
- }\r
+ oSubmenu.setInitialSelection();\r
+ oSubmenu.setInitialFocus();\r
\r
}\r
+ else {\r
\r
- oNextItem.focus();\r
-\r
- }\r
-\r
- }\r
-\r
- Event.preventDefault(oEvent);\r
-\r
- break;\r
-\r
- case 40: // Down arrow\r
+ oSubmenu.show();\r
\r
- if(this.activeItem != oItem) {\r
+ }\r
\r
- this.clearActiveItem();\r
+ }\r
\r
- oItemCfg.setProperty("selected", true);\r
- oItem.focus();\r
+ Event.preventDefault(oEvent);\r
\r
- }\r
+ break;\r
\r
- oSubmenu = oItemCfg.getProperty("submenu");\r
+ }\r
\r
- if(oSubmenu) {\r
+ }\r
\r
- if(oSubmenu.cfg.getProperty("visible")) {\r
+ if(oEvent.keyCode == 27 && this.activeItem) { // Esc key\r
\r
- oSubmenu.setInitialSelection();\r
- oSubmenu.setInitialFocus();\r
+ oSubmenu = this.activeItem.cfg.getProperty("submenu");\r
\r
- }\r
- else {\r
+ if(oSubmenu && oSubmenu.cfg.getProperty("visible")) {\r
\r
- oSubmenu.show();\r
+ oSubmenu.hide();\r
+ this.activeItem.focus();\r
\r
- }\r
+ }\r
+ else {\r
\r
- }\r
+ this.activeItem.cfg.setProperty("selected", false);\r
+ this.activeItem.blur();\r
\r
- Event.preventDefault(oEvent);\r
+ }\r
\r
- break;\r
+ Event.preventDefault(oEvent);\r
\r
}\r
\r
\r
var oItem = p_aArgs[1];\r
\r
- if(oItem) {\r
+ if(oItem && !oItem.cfg.getProperty("disabled")) {\r
\r
- var Event = YAHOO.util.Event;\r
- var Dom = YAHOO.util.Dom;\r
+ var Event = YAHOO.util.Event,\r
+ Dom = YAHOO.util.Dom,\r
\r
- var oEvent = p_aArgs[0];\r
- var oTarget = Event.getTarget(oEvent);\r
+ oEvent = p_aArgs[0],\r
+ oTarget = Event.getTarget(oEvent),\r
\r
- var oActiveItem = this.activeItem;\r
- var oConfig = this.cfg;\r
+ oActiveItem = this.activeItem,\r
+ oConfig = this.cfg;\r
\r
// Hide any other submenus that might be visible\r
\r
YUI Library - Reset+Fonts+Grids (RFG) - Release Notes\r
\r
+Version 0.12.1\r
+\r
+ * No changes.\r
+\r
Version 0.12.0\r
\r
* Initial release.\r
-/*\r
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
-Code licensed under the BSD License:\r
-http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
-*/\r
-\r
-/*=============*/\r
-/* reset.css */\r
-/*=============*/\r
-\r
-body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}\r
-table{border-collapse:collapse;border-spacing:0;}\r
-fieldset,img{border:0;}\r
-address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}\r
-ol,ul {list-style:none;}\r
-caption,th {text-align:left;}\r
-h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}\r
-q:before,q:after{content:'';}\r
-abbr,acronym {border:0;}\r
-\r
-/*=============*/\r
-/* fonts.css */\r
-/*=============*/\r
-\r
-/**\r
- * 84.5% for !IE, keywords for IE to preserve user font-size adjustment\r
- * Percents could work for IE, but for backCompat purposes, we are using keywords.\r
- * x-small is for IE6/7 quirks mode.\r
- *\r
- */\r
-body {font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}\r
-table {font-size:inherit;font:100%;}\r
-/**\r
- * 99% for safari; 100% is too large\r
- */\r
-select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}\r
-/**\r
- * Bump up !IE to get to 13px equivalent\r
- */\r
-pre, code {font:115% monospace;*font-size:100%;}\r
-/**\r
- * Default line-height based on font-size rather than "computed-value"\r
- * see: http://www.w3.org/TR/CSS21/visudet.html#line-height\r
- */\r
-body * {line-height:1.22em;}\r
-\r
-/*=============*/\r
-/* grids.css */\r
-/*=============*/\r
-\r
-/* for all templates and grids */\r
-body{text-align:center;}\r
-#ft{clear:both;}\r
-/**/\r
-/* 750 centered, and backward compatibility */\r
-#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7 {\r
- margin:auto;text-align:left;\r
- width:57.69em;*width:56.3em;min-width:750px;}\r
-/* 950 centered */\r
-#doc2 {\r
- width:73.074em;*width:71.313em;min-width:950px;}\r
-/* 100% with 10px viewport side matting */\r
-#doc3 {\r
- margin:auto 10px; /* not for structure, but so content doesn't bleed to edge */\r
- width:auto;}\r
-\r
-/* below required for all fluid grids; adjust widths and margins above accordingly */\r
-\r
- /* to preserve source-order independence for Gecko */\r
- .yui-b{position:relative;}\r
- .yui-b{_position:static;} /* for IE < 7 */\r
- #yui-main .yui-b{position:static;}\r
-\r
-#yui-main {width:100%;}\r
-.yui-t1 #yui-main,\r
-.yui-t2 #yui-main,\r
-.yui-t3 #yui-main{float:right;margin-left:-25em;/* IE: preserve layout at narrow widths */}\r
-\r
-.yui-t4 #yui-main,\r
-.yui-t5 #yui-main,\r
-.yui-t6 #yui-main{float:left;margin-right:-25em;/* IE: preserve layout at narrow widths */}\r
-\r
-.yui-t1 .yui-b {\r
- float:left;\r
- width:12.3207em;*width:12.0106em;}\r
-.yui-t1 #yui-main .yui-b{\r
- margin-left:13.3207em;*margin-left:13.0106em;\r
-}\r
-\r
-.yui-t2 .yui-b {\r
- float:left;\r
- width:13.8456em;*width:13.512em;}\r
-.yui-t2 #yui-main .yui-b {\r
- margin-left:14.8456em;*margin-left:14.512em;\r
-}\r
-\r
-.yui-t3 .yui-b {\r
- float:left;\r
- width:23.0759em;*width:22.52em;}\r
-.yui-t3 #yui-main .yui-b {\r
- margin-left:24.0759em;*margin-left:23.52em;\r
-}\r
-\r
-.yui-t4 .yui-b {\r
- float:right;\r
- width:13.8456em;*width:13.512em;}\r
-.yui-t4 #yui-main .yui-b {\r
- margin-right:14.8456em;*margin-right:14.512em;\r
-}\r
-\r
-.yui-t5 .yui-b {\r
- float:right;\r
- width:18.4608em;*width:18.016em;}\r
-.yui-t5 #yui-main .yui-b {\r
- margin-right:19.4608em;*margin-right:19.016em;\r
-}\r
-\r
-.yui-t6 .yui-b {\r
- float:right;\r
- width:23.0759em;*width:22.52em;}\r
-.yui-t6 #yui-main .yui-b {\r
- margin-right:24.0759em;*margin-right:23.52em;\r
-}\r
-\r
-.yui-t7 #yui-main .yui-b {\r
- display:block;margin:0 0 1em 0;\r
-}\r
-#yui-main .yui-b {float:none;width:auto;}\r
-/* GRIDS (not TEMPLATES) */\r
-.yui-g .yui-u,\r
-.yui-g .yui-g,\r
-.yui-gc .yui-u,\r
-.yui-gc .yui-g .yui-u,\r
-.yui-ge .yui-u,\r
-.yui-gf .yui-u{float:right;display:inline;}\r
-.yui-g div.first,\r
-.yui-gc div.first,\r
-.yui-gc div.first div.first,\r
-.yui-gd div.first,\r
-.yui-ge div.first,\r
-.yui-gf div.first{float:left;}\r
-.yui-g .yui-u,\r
-.yui-g .yui-g{width:49.1%;}\r
-.yui-g .yui-g .yui-u,\r
-.yui-gc .yui-g .yui-u {width:48.1%;}\r
-.yui-gb .yui-u,\r
-.yui-gc .yui-u,\r
-.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}\r
-.yui-gb div.first,\r
-.yui-gc div.first,\r
-.yui-gd div.first{margin-left:0;}\r
-.yui-gc div.first,\r
-.yui-gd .yui-u{width:66%;}\r
-.yui-gd div.first{width:32%;}\r
-.yui-ge .yui-u{width:24%;}\r
-.yui-ge div.first,\r
-.yui-gf .yui-u{width:74.2%;}\r
-.yui-gf div.first{width:24%;}\r
-.yui-ge div.first{width:74.2%;}\r
-#bd:after,\r
-.yui-g:after,\r
-.yui-gb:after,\r
-.yui-gc:after,\r
-.yui-gd:after,\r
-.yui-ge:after,\r
-.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}\r
-#bd,\r
-.yui-g,\r
-.yui-gb,\r
-.yui-gc,\r
-.yui-gd,\r
-.yui-ge,\r
-.yui-gf{zoom:1;}
\ No newline at end of file
+/*Copyright (c) 2006,Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version 0.12.1*/\r
+/*reset.css*/body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;}\r
+/*fonts.css*/body{font:13px arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}table {font-size:inherit;font:100%;}select, input, textarea {font:99% arial,helvetica,clean,sans-serif;}pre, code {font:115% monospace;*font-size:100%;}body * {line-height:1.22em;}\r
+/*grids.css*/body{text-align:center;}#ft{clear:both;}#doc,#doc2,#doc3,.yui-t1,.yui-t2,.yui-t3,.yui-t4,.yui-t5,.yui-t6,.yui-t7{margin:auto;text-align:left;width:57.69em;*width:56.3em;min-width:750px;}#doc2{width:73.074em;*width:71.313em;min-width:950px;}#doc3{margin:auto 10px;width:auto;}.yui-b{position:relative;}.yui-b{_position:static;}#yui-main .yui-b{position:static;}#yui-main{width:100%;}.yui-t1 #yui-main,.yui-t2 #yui-main,.yui-t3 #yui-main{float:right;margin-left:-25em;}.yui-t4 #yui-main,.yui-t5 #yui-main,.yui-t6 #yui-main{float:left;margin-right:-25em;}.yui-t1 .yui-b{float:left;width:12.3207em;*width:12.0106em;}.yui-t1 #yui-main .yui-b{margin-left:13.3207em;*margin-left:13.0106em;}.yui-t2 .yui-b{float:left;width:13.8456em;*width:13.512em;}.yui-t2 #yui-main .yui-b{margin-left:14.8456em;*margin-left:14.512em;}.yui-t3 .yui-b{float:left;width:23.0759em;*width:22.52em;}.yui-t3 #yui-main .yui-b{margin-left:24.0759em;*margin-left:23.52em;}.yui-t4 .yui-b{float:right;width:13.8456em;*width:13.512em;}.yui-t4 #yui-main .yui-b{margin-right:14.8456em;*margin-right:14.512em;}.yui-t5 .yui-b{float:right;width:18.4608em;*width:18.016em;}.yui-t5 #yui-main .yui-b{margin-right:19.4608em;*margin-right:19.016em;}.yui-t6 .yui-b{float:right;width:23.0759em;*width:22.52em;}.yui-t6 #yui-main .yui-b{margin-right:24.0759em;*margin-right:23.52em;}.yui-t7 #yui-main .yui-b{display:block;margin:0 0 1em 0;}#yui-main .yui-b{float:none;width:auto;}.yui-g .yui-u,.yui-g .yui-g,.yui-gc .yui-u,.yui-gc .yui-g .yui-u,.yui-ge .yui-u,.yui-gf .yui-u{float:right;display:inline;}.yui-g div.first,.yui-gc div.first,.yui-gc div.first div.first,.yui-gd div.first,.yui-ge div.first,.yui-gf div.first{float:left;}.yui-g .yui-u,.yui-g .yui-g{width:49.1%;}.yui-g .yui-g .yui-u,.yui-gc .yui-g .yui-u{width:48.1%;}.yui-gb .yui-u,.yui-gc .yui-u,.yui-gd .yui-u{float:left;margin-left:2%;*margin-left:1.895%;width:32%;}.yui-gb div.first,.yui-gc div.first,.yui-gd div.first{margin-left:0;}.yui-gc div.first,.yui-gd .yui-u{width:66%;}.yui-gd div.first{width:32%;}.yui-ge .yui-u{width:24%;}.yui-ge div.first,.yui-gf .yui-u{width:74.2%;}.yui-gf div.first{width:24%;}.yui-ge div.first{width:74.2%;}#bd:after,.yui-g:after,.yui-gb:after,.yui-gc:after,.yui-gd:after,.yui-ge:after,.yui-gf:after{content:".";display:block;height:0;clear:both;visibility:hidden;}#bd,.yui-g,.yui-gb,.yui-gc,.yui-gd,.yui-ge,.yui-gf{zoom:1;}
\ No newline at end of file
YUI Library - Reset - Release Notes\r
\r
+Version 0.12.1\r
+\r
+ * No changes.\r
+\r
Version 0.12.0\r
\r
* Added: h1,h2,h3,h4,h5,h6{font-weight:normal;}\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;}
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.1 */ body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul {list-style:none;}caption,th {text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym {border:0;}
\ No newline at end of file
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
+version: 0.12.1\r
*/\r
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}\r
table{border-collapse:collapse;border-spacing:0;}\r
Slider - Release Notes\r
\r
+0.12.1\r
+\r
+ * Removed unneccessary getXY calls that were contribuing to slower performance\r
+ in FireFox when the slider was deeply nested in the DOM.\r
+\r
0.12.0\r
\r
* Added "slideStart", "slideEnd", and "change" custom events. The abstract\r
-/*\r
+/* \r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
-*/\r
-\r
+version: 0.12.1\r
+*/ \r
/**\r
- * The Slider component is a UI control that enables the user to adjust\r
- * values in a finite range along one or two axes. Typically, the Slider\r
- * control is used in a web application as a rich, visual replacement\r
- * for an input box that takes a number as input. The Slider control can\r
- * also easily accommodate a second dimension, providing x,y output for\r
+ * The Slider component is a UI control that enables the user to adjust \r
+ * values in a finite range along one or two axes. Typically, the Slider \r
+ * control is used in a web application as a rich, visual replacement \r
+ * for an input box that takes a number as input. The Slider control can \r
+ * also easily accommodate a second dimension, providing x,y output for \r
* a selection point chosen from a rectangular region.\r
*\r
* @module slider\r
\r
/**\r
* A DragDrop implementation that can be used as a background for a\r
- * slider. It takes a reference to the thumb instance\r
- * so it can delegate some of the events to it. The goal is to make the\r
- * thumb jump to the location on the background when the background is\r
- * clicked.\r
+ * slider. It takes a reference to the thumb instance \r
+ * so it can delegate some of the events to it. The goal is to make the \r
+ * thumb jump to the location on the background when the background is \r
+ * clicked. \r
*\r
* @class Slider\r
* @extends YAHOO.util.DragDrop\r
+ * @uses YAHOO.util.EventProvider\r
* @constructor\r
- * @param {String} id The id of the element linked to this instance\r
- * @param {String} sGroup The group of related DragDrop items\r
- * @param {String} sType The type of slider (horiz, vert, region)\r
+ * @param {String} id The id of the element linked to this instance\r
+ * @param {String} sGroup The group of related DragDrop items\r
+ * @param {SliderThumb} oThumb The thumb for this slider\r
+ * @param {String} sType The type of slider (horiz, vert, region)\r
*/\r
YAHOO.widget.Slider = function(sElementId, sGroup, oThumb, sType) {\r
if (sElementId) {\r
+ this.init(sElementId, sGroup, true);\r
+ this.initSlider(sType);\r
+ this.initThumb(oThumb);\r
+ }\r
+};\r
+\r
+/**\r
+ * Factory method for creating a horizontal slider\r
+ * @method YAHOO.widget.Slider.getHorizSlider\r
+ * @static\r
+ * @param {String} sBGElId the id of the slider's background element\r
+ * @param {String} sHandleElId the id of the thumb element\r
+ * @param {int} iLeft the number of pixels the element can move left\r
+ * @param {int} iRight the number of pixels the element can move right\r
+ * @param {int} iTickSize optional parameter for specifying that the element \r
+ * should move a certain number pixels at a time.\r
+ * @return {Slider} a horizontal slider control\r
+ */\r
+YAHOO.widget.Slider.getHorizSlider = \r
+ function (sBGElId, sHandleElId, iLeft, iRight, iTickSize) {\r
+ return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
+ new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, \r
+ iLeft, iRight, 0, 0, iTickSize), "horiz");\r
+};\r
+\r
+/**\r
+ * Factory method for creating a vertical slider\r
+ * @method YAHOO.widget.Slider.getVertSlider\r
+ * @static\r
+ * @param {String} sBGElId the id of the slider's background element\r
+ * @param {String} sHandleElId the id of the thumb element\r
+ * @param {int} iUp the number of pixels the element can move up\r
+ * @param {int} iDown the number of pixels the element can move down\r
+ * @param {int} iTickSize optional parameter for specifying that the element \r
+ * should move a certain number pixels at a time.\r
+ * @return {Slider} a vertical slider control\r
+ */\r
+YAHOO.widget.Slider.getVertSlider = \r
+ function (sBGElId, sHandleElId, iUp, iDown, iTickSize) {\r
+ return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
+ new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, 0, 0, \r
+ iUp, iDown, iTickSize), "vert");\r
+};\r
+\r
+/**\r
+ * Factory method for creating a slider region like the one in the color\r
+ * picker example\r
+ * @method YAHOO.widget.Slider.getSliderRegion\r
+ * @static\r
+ * @param {String} sBGElId the id of the slider's background element\r
+ * @param {String} sHandleElId the id of the thumb element\r
+ * @param {int} iLeft the number of pixels the element can move left\r
+ * @param {int} iRight the number of pixels the element can move right\r
+ * @param {int} iUp the number of pixels the element can move up\r
+ * @param {int} iDown the number of pixels the element can move down\r
+ * @param {int} iTickSize optional parameter for specifying that the element \r
+ * should move a certain number pixels at a time.\r
+ * @return {Slider} a slider region control\r
+ */\r
+YAHOO.widget.Slider.getSliderRegion = \r
+ function (sBGElId, sHandleElId, iLeft, iRight, iUp, iDown, iTickSize) {\r
+ return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
+ new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, iLeft, iRight, \r
+ iUp, iDown, iTickSize), "region");\r
+};\r
+\r
+/**\r
+ * By default, animation is available if the animation library is detected.\r
+ * @property YAHOO.widget.Slider.ANIM_AVAIL\r
+ * @static\r
+ * @type boolean\r
+ */\r
+YAHOO.widget.Slider.ANIM_AVAIL = true;\r
+\r
+YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {\r
+\r
+ /**\r
+ * Initializes the slider. Executed in the constructor\r
+ * @method initSlider\r
+ * @param {string} sType the type of slider (horiz, vert, region)\r
+ */\r
+ initSlider: function(sType) {\r
\r
/**\r
* The type of the slider (horiz, vert, region)\r
*/\r
this.type = sType;\r
\r
- this.init(sElementId, sGroup, true);\r
-\r
//this.removeInvalidHandleType("A");\r
\r
this.logger = new YAHOO.widget.LogWriter(this.toString());\r
\r
- var self = this;\r
-\r
/**\r
- * Event the fires when the value of the control changes. If\r
+ * Event the fires when the value of the control changes. If \r
* the control is animated the event will fire every point\r
* along the way.\r
* @event change\r
- * @param {int} new\r
- * @param {int} firstOffset the number of pixels the thumb has moved\r
- * from its start position. Normal horizontal and vertical sliders will only\r
- * have the firstOffset. Regions will have both, the first is the horizontal\r
- * offset, the second the vertical.\r
- * @param {int} secondOffset the y offset for region sliders\r
+ * @param {int} newOffset|x the new offset for normal sliders, or the new\r
+ * x offset for region sliders\r
+ * @param {int} y the number of pixels the thumb has moved on the y axis\r
+ * (region sliders only)\r
*/\r
this.createEvent("change", this);\r
\r
/**\r
- * Event that fires at the end of a slider thumb move.\r
+ * Event that fires at the beginning of a slider thumb move.\r
* @event slideStart\r
*/\r
this.createEvent("slideStart", this);\r
*/\r
this.createEvent("slideEnd", this);\r
\r
- /**\r
- * A YAHOO.widget.SliderThumb instance that we will use to\r
- * reposition the thumb when the background is clicked\r
- * @property thumb\r
- * @type YAHOO.widget.SliderThumb\r
- */\r
- this.thumb = oThumb;\r
-\r
- // add handler for the handle onchange event\r
- oThumb.onChange = function() {\r
- self.handleThumbChange();\r
- };\r
-\r
/**\r
* Overrides the isTarget property in YAHOO.util.DragDrop\r
* @property isTarget\r
* @private\r
*/\r
this.isTarget = false;\r
-\r
+ \r
/**\r
* Flag that determines if the thumb will animate when moved\r
* @property animate\r
\r
/**\r
* moveComplete is set to true when the slider has moved to its final\r
- * destination. For animated slider, this value can be checked in\r
+ * destination. For animated slider, this value can be checked in \r
* the onChange handler to make it possible to execute logic only\r
* when the move is complete rather than at all points along the way.\r
*\r
* @default 0.2\r
*/\r
this.animationDuration = 0.2;\r
+ },\r
\r
- if (oThumb._isHoriz && oThumb.xTicks && oThumb.xTicks.length) {\r
- this.tickPause = Math.round(360 / oThumb.xTicks.length);\r
- } else if (oThumb.yTicks && oThumb.yTicks.length) {\r
- this.tickPause = Math.round(360 / oThumb.yTicks.length);\r
- }\r
+ /**\r
+ * Initializes the slider's thumb. Executed in the constructor.\r
+ * @method initThumb\r
+ * @param {YAHOO.widget.SliderThumb} t the slider thumb\r
+ */\r
+ initThumb: function(t) {\r
\r
- this.logger.log("tickPause: " + this.tickPause);\r
+ var self = this;\r
\r
- // delegate thumb methods\r
- oThumb.onMouseDown = function () { return self.focus(); };\r
- //oThumb.b4MouseDown = function () { return self.b4MouseDown(); };\r
- // oThumb.lock = function() { self.lock(); };\r
- // oThumb.unlock = function() { self.unlock(); };\r
- oThumb.onMouseUp = function() { self.thumbMouseUp(); };\r
- oThumb.onDrag = function() { self.fireEvents(); };\r
- oThumb.onAvailable = function() { return self.setStartSliderState(); };\r
- }\r
-};\r
+ /**\r
+ * A YAHOO.widget.SliderThumb instance that we will use to \r
+ * reposition the thumb when the background is clicked\r
+ * @property thumb\r
+ * @type YAHOO.widget.SliderThumb\r
+ */\r
+ this.thumb = t;\r
+ t.cacheBetweenDrags = true;\r
\r
-/**\r
- * Factory method for creating a horizontal slider\r
- * @method YAHOO.widget.Slider.getHorizSlider\r
- * @static\r
- * @param {String} sBGElId the id of the slider's background element\r
- * @param {String} sHandleElId the id of the thumb element\r
- * @param {int} iLeft the number of pixels the element can move left\r
- * @param {int} iRight the number of pixels the element can move right\r
- * @param {int} iTickSize optional parameter for specifying that the element\r
- * should move a certain number pixels at a time.\r
- * @return {Slider} a horizontal slider control\r
- */\r
-YAHOO.widget.Slider.getHorizSlider =\r
- function (sBGElId, sHandleElId, iLeft, iRight, iTickSize) {\r
- return new YAHOO.widget.Slider(sBGElId, sBGElId,\r
- new YAHOO.widget.SliderThumb(sHandleElId, sBGElId,\r
- iLeft, iRight, 0, 0, iTickSize), "horiz");\r
-};\r
+ // add handler for the handle onchange event\r
+ t.onChange = function() { \r
+ self.handleThumbChange(); \r
+ };\r
\r
-/**\r
- * Factory method for creating a vertical slider\r
- * @method YAHOO.widget.Slider.getVertSlider\r
- * @static\r
- * @param {String} sBGElId the id of the slider's background element\r
- * @param {String} sHandleElId the id of the thumb element\r
- * @param {int} iUp the number of pixels the element can move up\r
- * @param {int} iDown the number of pixels the element can move down\r
- * @param {int} iTickSize optional parameter for specifying that the element\r
- * should move a certain number pixels at a time.\r
- * @return {Slider} a vertical slider control\r
- */\r
-YAHOO.widget.Slider.getVertSlider =\r
- function (sBGElId, sHandleElId, iUp, iDown, iTickSize) {\r
- return new YAHOO.widget.Slider(sBGElId, sBGElId,\r
- new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, 0, 0,\r
- iUp, iDown, iTickSize), "vert");\r
-};\r
+ if (t._isHoriz && t.xTicks && t.xTicks.length) {\r
+ this.tickPause = Math.round(360 / t.xTicks.length);\r
+ } else if (t.yTicks && t.yTicks.length) {\r
+ this.tickPause = Math.round(360 / t.yTicks.length);\r
+ }\r
\r
-/**\r
- * Factory method for creating a slider region like the one in the color\r
- * picker example\r
- * @method YAHOO.widget.Slider.getSliderRegion\r
- * @static\r
- * @param {String} sBGElId the id of the slider's background element\r
- * @param {String} sHandleElId the id of the thumb element\r
- * @param {int} iLeft the number of pixels the element can move left\r
- * @param {int} iRight the number of pixels the element can move right\r
- * @param {int} iUp the number of pixels the element can move up\r
- * @param {int} iDown the number of pixels the element can move down\r
- * @param {int} iTickSize optional parameter for specifying that the element\r
- * should move a certain number pixels at a time.\r
- * @return {Slider} a slider region control\r
- */\r
-YAHOO.widget.Slider.getSliderRegion =\r
- function (sBGElId, sHandleElId, iLeft, iRight, iUp, iDown, iTickSize) {\r
- return new YAHOO.widget.Slider(sBGElId, sBGElId,\r
- new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, iLeft, iRight,\r
- iUp, iDown, iTickSize), "region");\r
-};\r
+ this.logger.log("tickPause: " + this.tickPause);\r
\r
-/**\r
- * By default, animation is available if the animation library is detected.\r
- * @property YAHOO.widget.Slider.ANIM_AVAIL\r
- * @static\r
- * @type boolean\r
- */\r
-YAHOO.widget.Slider.ANIM_AVAIL = true;\r
+ // delegate thumb methods\r
+ t.onMouseDown = function () { return self.focus(); };\r
+ t.onMouseUp = function() { self.thumbMouseUp(); };\r
+ t.onDrag = function() { self.fireEvents(true); };\r
+ t.onAvailable = function() { return self.setStartSliderState(); };\r
\r
-YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {\r
+ },\r
\r
+ /**\r
+ * Executed when the slider element is available\r
+ * @method onAvailable\r
+ */\r
onAvailable: function() {\r
var Event = YAHOO.util.Event;\r
Event.on(this.id, "keydown", this.handleKeyDown, this, true);\r
Event.on(this.id, "keypress", this.handleKeyPress, this, true);\r
},\r
-\r
+ \r
+ /**\r
+ * Executed when a keypress event happens with the control focused.\r
+ * Prevents the default behavior for navigation keys. The actual\r
+ * logic for moving the slider thumb in response to a key event\r
+ * happens in handleKeyDown.\r
+ * @param {Event} e the keypress event\r
+ */\r
handleKeyPress: function(e) {\r
if (this.enableKeys) {\r
var Event = YAHOO.util.Event;\r
default:\r
}\r
}\r
- },\r
+ },\r
\r
+ /**\r
+ * Executed when a keydown event happens with the control focused.\r
+ * Updates the slider value and display when the keypress is an\r
+ * arrow key, home, or end as long as enableKeys is set to true.\r
+ * @param {Event} e the keydown event\r
+ */\r
handleKeyDown: function(e) {\r
if (this.enableKeys) {\r
var Event = YAHOO.util.Event;\r
case 0x28: v += this.keyIncrement; break;\r
\r
// home\r
- case 0x24: h = t.leftConstraint;\r
- v = t.topConstraint;\r
+ case 0x24: h = t.leftConstraint; \r
+ v = t.topConstraint; \r
break;\r
\r
// end\r
- case 0x23: h = t.rightConstraint;\r
- v = t.bottomConstraint;\r
+ case 0x23: h = t.rightConstraint; \r
+ v = t.bottomConstraint; \r
break;\r
\r
default: changeValue = false;\r
\r
/**\r
* Initialization that sets up the value offsets once the elements are ready\r
- * @method setSliderStartState\r
+ * @method setStartSliderState\r
*/\r
setStartSliderState: function() {\r
\r
\r
if (el) {\r
/**\r
- * The center of the slider element is stored so we can position\r
+ * The center of the slider element is stored so we can position \r
* place it in the correct position when the background is clicked\r
* @property thumbCenterPoint\r
* @type {"x": int, "y": int}\r
*/\r
- this.thumbCenterPoint = {\r
- x: parseInt(el.offsetWidth/2, 10),\r
- y: parseInt(el.offsetHeight/2, 10)\r
+ this.thumbCenterPoint = { \r
+ x: parseInt(el.offsetWidth/2, 10), \r
+ y: parseInt(el.offsetHeight/2, 10) \r
};\r
}\r
\r
} catch(e) {\r
// Prevent permission denied unhandled exception in FF that can\r
// happen when setting focus while another element is handling\r
- // the blur. @TODO this is still writing to the error log\r
+ // the blur. @TODO this is still writing to the error log \r
// (unhandled error) in FF1.5 with strict error checking on.\r
}\r
}\r
* @param {int} secondOffset the y offset for region sliders\r
* @deprecated use instance.subscribe("change") instead\r
*/\r
- onChange: function (firstOffset, secondOffset) {\r
- /* override me */\r
+ onChange: function (firstOffset, secondOffset) { \r
+ /* override me */ \r
this.logger.log("onChange: " + firstOffset + ", " + secondOffset);\r
},\r
\r
* @method onSlideStart\r
* @deprecated use instance.subscribe("slideStart") instead\r
*/\r
- onSlideStart: function () {\r
- /* override me */\r
+ onSlideStart: function () { \r
+ /* override me */ \r
this.logger.log("onSlideStart");\r
},\r
\r
* @method onSliderEnd\r
* @deprecated use instance.subscribe("slideEnd") instead\r
*/\r
- onSlideEnd: function () {\r
- /* override me */\r
+ onSlideEnd: function () { \r
+ /* override me */ \r
this.logger.log("onSlideEnd");\r
},\r
\r
* @method getValue\r
* @return {int} the current value\r
*/\r
- getValue: function () {\r
+ getValue: function () { \r
return this.thumb.getValue();\r
},\r
\r
* @method getXValue\r
* @return {int} the current horizontal offset\r
*/\r
- getXValue: function () {\r
+ getXValue: function () { \r
return this.thumb.getXValue();\r
},\r
\r
* @method getYValue\r
* @return {int} the current vertical offset\r
*/\r
- getYValue: function () {\r
+ getYValue: function () { \r
return this.thumb.getYValue();\r
},\r
\r
* @method handleThumbChange\r
* @private\r
*/\r
- handleThumbChange: function () {\r
+ handleThumbChange: function () { \r
var t = this.thumb;\r
if (t._isRegion) {\r
t.onChange(t.getXValue(), t.getYValue());\r
* Provides a way to set the value of the slider in code.\r
* @method setValue\r
* @param {int} newOffset the number of pixels the thumb should be\r
- * positioned away from the initial start point\r
+ * positioned away from the initial start point \r
* @param {boolean} skipAnim set to true to disable the animation\r
* for this move action (but not others).\r
* @param {boolean} force ignore the locked setting and set value anyway\r
\r
var t = this.thumb;\r
var newX, newY;\r
- this.verifyOffset();\r
+ this.verifyOffset(true);\r
if (t._isRegion) {\r
return false;\r
} else if (t._isHoriz) {\r
/**\r
* Checks the background position element position. If it has moved from the\r
* baseline position, the constraints for the thumb are reset\r
+ * @param checkPos {boolean} check the position instead of using cached value\r
* @method verifyOffset\r
* @return {boolean} True if the offset is the same as the baseline.\r
*/\r
- verifyOffset: function() {\r
+ verifyOffset: function(checkPos) {\r
\r
var newPos = YAHOO.util.Dom.getXY(this.getEl());\r
- this.logger.log("newPos: " + newPos);\r
+ //var newPos = [this.initPageX, this.initPageY];\r
+\r
+ this.logger.log("newPos: " + newPos, "warn");\r
\r
if (newPos[0] != this.baselinePos[0] || newPos[1] != this.baselinePos[1]) {\r
this.logger.log("background moved, resetting constraints");\r
},\r
\r
/**\r
- * Move the associated slider moved to a timeout to try to get around the\r
- * mousedown stealing moz does when I move the slider element between the\r
+ * Move the associated slider moved to a timeout to try to get around the \r
+ * mousedown stealing moz does when I move the slider element between the \r
* cursor and the background during the mouseup event\r
* @method moveThumb\r
* @param {int} x the X coordinate of the click\r
// this.thumb._animating = true;\r
this.lock();\r
\r
+ // cache the current thumb pos\r
+ this.curCoord = YAHOO.util.Dom.getXY(this.thumb.getEl());\r
+\r
setTimeout( function() { self.moveOneTick(p); }, this.tickPause );\r
\r
} else if (this.animate && YAHOO.widget.Slider.ANIM_AVAIL && !skipAnim) {\r
// this.thumb._animating = true;\r
this.lock();\r
\r
- var oAnim = new YAHOO.util.Motion(\r
- t.id, { points: { to: p } },\r
- this.animationDuration,\r
+ var oAnim = new YAHOO.util.Motion( \r
+ t.id, { points: { to: p } }, \r
+ this.animationDuration, \r
YAHOO.util.Easing.easeOut );\r
\r
oAnim.onComplete.subscribe( function() { self.endMove(); } );\r
*/\r
moveOneTick: function(finalCoord) {\r
\r
- var t = this.thumb;\r
- var curCoord = YAHOO.util.Dom.getXY(t.getEl());\r
- var tmp;\r
+ var t = this.thumb, tmp;\r
+\r
+\r
+ // redundant call to getXY since we set the position most of time prior \r
+ // to getting here. Moved to this.curCoord\r
+ //var curCoord = YAHOO.util.Dom.getXY(t.getEl());\r
+\r
+ // alignElWithMouse caches position in lastPageX, lastPageY .. doesn't work\r
+ //var curCoord = [this.lastPageX, this.lastPageY];\r
\r
// var thresh = Math.min(t.tickSize + (Math.floor(t.tickSize/2)), 10);\r
// var thresh = 10;\r
var nextCoord = null;\r
\r
if (t._isRegion) {\r
- nextCoord = this._getNextX(curCoord, finalCoord);\r
- var tmpX = (nextCoord) ? nextCoord[0] : curCoord[0];\r
- nextCoord = this._getNextY([tmpX, curCoord[1]], finalCoord);\r
+ nextCoord = this._getNextX(this.curCoord, finalCoord);\r
+ var tmpX = (nextCoord) ? nextCoord[0] : this.curCoord[0];\r
+ nextCoord = this._getNextY([tmpX, this.curCoord[1]], finalCoord);\r
\r
} else if (t._isHoriz) {\r
- nextCoord = this._getNextX(curCoord, finalCoord);\r
+ nextCoord = this._getNextX(this.curCoord, finalCoord);\r
} else {\r
- nextCoord = this._getNextY(curCoord, finalCoord);\r
+ nextCoord = this._getNextY(this.curCoord, finalCoord);\r
}\r
\r
- this.logger.log("moveOneTick: " +\r
+ this.logger.log("moveOneTick: " + \r
" finalCoord: " + finalCoord +\r
- " curCoord: " + curCoord +\r
+ " this.curCoord: " + this.curCoord +\r
" nextCoord: " + nextCoord);\r
\r
if (nextCoord) {\r
\r
+ // cache the position\r
+ this.curCoord = nextCoord;\r
+\r
// move to the next coord\r
// YAHOO.util.Dom.setXY(t.getEl(), nextCoord);\r
\r
// YAHOO.util.Dom.setStyle(el, "top", (nextCoord[1] + this.thumb.deltaSetXY[1]) + "px");\r
\r
this.thumb.alignElWithMouse(t.getEl(), nextCoord[0], nextCoord[1]);\r
-\r
+ \r
// check if we are in the final position, if not make a recursive call\r
if (!(nextCoord[0] == finalCoord[0] && nextCoord[1] == finalCoord[1])) {\r
var self = this;\r
- setTimeout(function() { self.moveOneTick(finalCoord); },\r
+ setTimeout(function() { self.moveOneTick(finalCoord); }, \r
this.tickPause);\r
} else {\r
this.endMove();\r
this.focus();\r
this.moveThumb(x, y);\r
}\r
-\r
+ \r
},\r
\r
/**\r
* the middle of an animation as the event will fire when the animation is\r
* complete\r
* @method fireEvents\r
+ * @param {boolean} thumbEvent set to true if this event is fired from an event\r
+ * that occurred on the thumb. If it is, the state of the\r
+ * thumb dd object should be correct. Otherwise, the event\r
+ * originated on the background, so the thumb state needs to\r
+ * be refreshed before proceeding.\r
* @private\r
*/\r
- fireEvents: function () {\r
+ fireEvents: function (thumbEvent) {\r
\r
var t = this.thumb;\r
// this.logger.log("FireEvents: " + t._isRegion);\r
\r
- t.cachePosition();\r
+ if (!thumbEvent) {\r
+ t.cachePosition();\r
+ }\r
\r
if (! this.isLocked()) {\r
if (t._isRegion) {\r
* @method toString\r
* @return {string} string representation of the instance\r
*/\r
- toString: function () {\r
+ toString: function () { \r
return ("Slider (" + this.type +") " + this.id);\r
}\r
\r
* @param {int} iRight the number of pixels the element can move right\r
* @param {int} iUp the number of pixels the element can move up\r
* @param {int} iDown the number of pixels the element can move down\r
- * @param {int} iTickSize optional parameter for specifying that the element\r
+ * @param {int} iTickSize optional parameter for specifying that the element \r
* should move a certain number pixels at a time.\r
*/\r
YAHOO.widget.SliderThumb = function(id, sGroup, iLeft, iRight, iUp, iDown, iTickSize) {\r
\r
if (id) {\r
- this.init(id, sGroup);\r
+ //this.init(id, sGroup);\r
+ YAHOO.widget.SliderThumb.superclass.constructor.call(this, id, sGroup);\r
\r
/**\r
- * The id of the thumbs parent HTML element (the slider background\r
+ * The id of the thumbs parent HTML element (the slider background \r
* element).\r
* @property parentElId\r
* @type string\r
*/\r
this.scroll = false;\r
\r
-};\r
+}; \r
\r
YAHOO.extend(YAHOO.widget.SliderThumb, YAHOO.util.DD, {\r
\r
/**\r
- * The (X and Y) difference between the thumb location and its parent\r
+ * The (X and Y) difference between the thumb location and its parent \r
* (the slider background) when the control is instantiated.\r
* @property startOffset\r
* @type [int, int]\r
*/\r
_graduated: false,\r
\r
+\r
/**\r
* Returns the difference between the location of the thumb and its parent.\r
* @method getOffsetFromParent\r
* @param {[int, int]} parentPos Optionally accepts the position of the parent\r
* @type [int, int]\r
*/\r
- getOffsetFromParent: function(parentPos) {\r
+ getOffsetFromParent0: function(parentPos) {\r
var myPos = YAHOO.util.Dom.getXY(this.getEl());\r
var ppos = parentPos || YAHOO.util.Dom.getXY(this.parentElId);\r
\r
return [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ];\r
},\r
\r
+ getOffsetFromParent: function(parentPos) {\r
+\r
+ var el = this.getEl();\r
+\r
+ if (!this.deltaOffset) {\r
+\r
+ var myPos = YAHOO.util.Dom.getXY(el);\r
+ var ppos = parentPos || YAHOO.util.Dom.getXY(this.parentElId);\r
+\r
+ var newOffset = [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ];\r
+\r
+ var l = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );\r
+ var t = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );\r
+\r
+ var deltaX = l - newOffset[0];\r
+ var deltaY = t - newOffset[1];\r
+\r
+ if (isNaN(deltaX) || isNaN(deltaY)) {\r
+ this.logger.log("element does not have a position style def yet");\r
+ } else {\r
+ this.deltaOffset = [deltaX, deltaY];\r
+ }\r
+\r
+ } else {\r
+ var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );\r
+ var newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );\r
+\r
+ newOffset = [newLeft + this.deltaOffset[0], newTop + this.deltaOffset[1]];\r
+ }\r
+\r
+ return newOffset;\r
+\r
+ //return [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ];\r
+ },\r
+\r
/**\r
* Set up the slider, must be called in the constructor of all subclasses\r
* @method initSlider\r
*/\r
initSlider: function (iLeft, iRight, iUp, iDown, iTickSize) {\r
\r
+\r
+ //document these. new for 0.12.1\r
+ this.initLeft = iLeft;\r
+ this.initRight = iRight;\r
+ this.initUp = iUp;\r
+ this.initDown = iDown;\r
+\r
this.setXConstraint(iLeft, iRight, iTickSize);\r
this.setYConstraint(iUp, iDown, iTickSize);\r
\r
this._graduated = true;\r
}\r
\r
- this._isHoriz = (iLeft || iRight);\r
+ this._isHoriz = (iLeft || iRight); \r
this._isVert = (iUp || iDown);\r
- this._isRegion = (this._isHoriz && this._isVert);\r
+ this._isRegion = (this._isHoriz && this._isVert); \r
\r
},\r
\r
*/\r
clearTicks: function () {\r
YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);\r
+ this.tickSize = 0;\r
this._graduated = false;\r
},\r
\r
+\r
/**\r
* Gets the current offset from the element's start position in\r
* pixels.\r
getValue: function () {\r
if (!this.available) { return 0; }\r
var val = (this._isHoriz) ? this.getXValue() : this.getYValue();\r
- this.logger.log("getVal: " + val);\r
+ //this.logger.log("getVal: " + val);\r
return val;\r
},\r
\r
* @method toString\r
* @return {string} string representation of the instance\r
*/\r
- toString: function () {\r
+ toString: function () { \r
return "SliderThumb " + this.id;\r
},\r
\r
* @method onChange\r
* @private\r
*/\r
- onChange: function (x, y) {\r
+ onChange: function (x, y) { \r
}\r
\r
});\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ YAHOO.widget.Slider=function(_1,_2,_3,_4){if(_1){this.type=_4;this.init(_1,_2,true);var _5=this;this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);this.thumb=_3;_3.onChange=function(){_5.handleThumbChange();};this.isTarget=false;this.animate=YAHOO.widget.Slider.ANIM_AVAIL;this.backgroundEnabled=true;this.tickPause=40;this.enableKeys=true;this.keyIncrement=20;this.moveComplete=true;this.animationDuration=0.2;if(_3._isHoriz&&_3.xTicks&&_3.xTicks.length){this.tickPause=Math.round(360/_3.xTicks.length);}else{if(_3.yTicks&&_3.yTicks.length){this.tickPause=Math.round(360/_3.yTicks.length);}}_3.onMouseDown=function(){return _5.focus();};_3.onMouseUp=function(){_5.thumbMouseUp();};_3.onDrag=function(){_5.fireEvents();};_3.onAvailable=function(){return _5.setStartSliderState();};}};YAHOO.widget.Slider.getHorizSlider=function(_6,_7,_8,_9,_10){return new YAHOO.widget.Slider(_6,_6,new YAHOO.widget.SliderThumb(_7,_6,_8,_9,0,0,_10),"horiz");};YAHOO.widget.Slider.getVertSlider=function(_11,_12,iUp,_14,_15){return new YAHOO.widget.Slider(_11,_11,new YAHOO.widget.SliderThumb(_12,_11,0,0,iUp,_14,_15),"vert");};YAHOO.widget.Slider.getSliderRegion=function(_16,_17,_18,_19,iUp,_20,_21){return new YAHOO.widget.Slider(_16,_16,new YAHOO.widget.SliderThumb(_17,_16,_18,_19,iUp,_20,_21),"region");};YAHOO.widget.Slider.ANIM_AVAIL=true;YAHOO.extend(YAHOO.widget.Slider,YAHOO.util.DragDrop,{onAvailable:function(){var _22=YAHOO.util.Event;_22.on(this.id,"keydown",this.handleKeyDown,this,true);_22.on(this.id,"keypress",this.handleKeyPress,this,true);},handleKeyPress:function(e){if(this.enableKeys){var _24=YAHOO.util.Event;var kc=_24.getCharCode(e);switch(kc){case 37:case 38:case 39:case 40:case 36:case 35:_24.preventDefault(e);break;default:}}},handleKeyDown:function(e){if(this.enableKeys){var _26=YAHOO.util.Event;var kc=_26.getCharCode(e),t=this.thumb;var h=this.getXValue(),v=this.getYValue();var _28=false;var _29=true;switch(kc){case 37:h-=this.keyIncrement;break;case 38:v-=this.keyIncrement;break;case 39:h+=this.keyIncrement;break;case 40:v+=this.keyIncrement;break;case 36:h=t.leftConstraint;v=t.topConstraint;break;case 35:h=t.rightConstraint;v=t.bottomConstraint;break;default:_29=false;}if(_29){if(t._isRegion){this.setRegionValue(h,v,true);}else{var _30=(t._isHoriz)?h:v;this.setValue(_30,true);}_26.stopEvent(e);}}},setStartSliderState:function(){this.setThumbCenterPoint();this.baselinePos=YAHOO.util.Dom.getXY(this.getEl());this.thumb.startOffset=this.thumb.getOffsetFromParent(this.baselinePos);if(this.thumb._isRegion){if(this.deferredSetRegionValue){this.setRegionValue.apply(this,this.deferredSetRegionValue,true);this.deferredSetRegionValue=null;}else{this.setRegionValue(0,0,true);}}else{if(this.deferredSetValue){this.setValue.apply(this,this.deferredSetValue,true);this.deferredSetValue=null;}else{this.setValue(0,true,true);}}},setThumbCenterPoint:function(){var el=this.thumb.getEl();if(el){this.thumbCenterPoint={x:parseInt(el.offsetWidth/2,10),y:parseInt(el.offsetHeight/2,10)};}},lock:function(){this.thumb.lock();this.locked=true;},unlock:function(){this.thumb.unlock();this.locked=false;},thumbMouseUp:function(){if(!this.isLocked()&&!this.moveComplete){this.endMove();}},getThumb:function(){return this.thumb;},focus:function(){var el=this.getEl();if(el.focus){try{el.focus();}catch(e){}}this.verifyOffset();if(this.isLocked()){return false;}else{this.onSlideStart();return true;}},onChange:function(_32,_33){},onSlideStart:function(){},onSlideEnd:function(){},getValue:function(){return this.thumb.getValue();},getXValue:function(){return this.thumb.getXValue();},getYValue:function(){return this.thumb.getYValue();},handleThumbChange:function(){var t=this.thumb;if(t._isRegion){t.onChange(t.getXValue(),t.getYValue());this.fireEvent("change",{x:t.getXValue(),y:t.getYValue()});}else{t.onChange(t.getValue());this.fireEvent("change",t.getValue());}},setValue:function(_35,_36,_37){if(!this.thumb.available){this.deferredSetValue=arguments;return false;}if(this.isLocked()&&!_37){return false;}if(isNaN(_35)){return false;}var t=this.thumb;var _38,newY;this.verifyOffset();if(t._isRegion){return false;}else{if(t._isHoriz){this.onSlideStart();_38=t.initPageX+_35+this.thumbCenterPoint.x;this.moveThumb(_38,t.initPageY,_36);}else{this.onSlideStart();newY=t.initPageY+_35+this.thumbCenterPoint.y;this.moveThumb(t.initPageX,newY,_36);}}return true;},setRegionValue:function(_39,_40,_41){if(!this.thumb.available){this.deferredSetRegionValue=arguments;return false;}if(this.isLocked()&&!force){return false;}if(isNaN(_39)){return false;}var t=this.thumb;if(t._isRegion){this.onSlideStart();var _42=t.initPageX+_39+this.thumbCenterPoint.x;var _43=t.initPageY+_40+this.thumbCenterPoint.y;this.moveThumb(_42,_43,_41);return true;}return false;},verifyOffset:function(){var _44=YAHOO.util.Dom.getXY(this.getEl());if(_44[0]!=this.baselinePos[0]||_44[1]!=this.baselinePos[1]){this.thumb.resetConstraints();this.baselinePos=_44;return false;}return true;},moveThumb:function(x,y,_47){var t=this.thumb;var _48=this;if(!t.available){return;}t.setDelta(this.thumbCenterPoint.x,this.thumbCenterPoint.y);var _p=t.getTargetCoord(x,y);var p=[_p.x,_p.y];this.fireEvent("slideStart");if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&t._graduated&&!_47){this.lock();setTimeout(function(){_48.moveOneTick(p);},this.tickPause);}else{if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&!_47){this.lock();var _51=new YAHOO.util.Motion(t.id,{points:{to:p}},this.animationDuration,YAHOO.util.Easing.easeOut);_51.onComplete.subscribe(function(){_48.endMove();});_51.animate();}else{t.setDragElPos(x,y);this.endMove();}}},moveOneTick:function(_52){var t=this.thumb;var _53=YAHOO.util.Dom.getXY(t.getEl());var tmp;var _55=null;if(t._isRegion){_55=this._getNextX(_53,_52);var _56=(_55)?_55[0]:_53[0];_55=this._getNextY([_56,_53[1]],_52);}else{if(t._isHoriz){_55=this._getNextX(_53,_52);}else{_55=this._getNextY(_53,_52);}}if(_55){this.thumb.alignElWithMouse(t.getEl(),_55[0],_55[1]);if(!(_55[0]==_52[0]&&_55[1]==_52[1])){var _57=this;setTimeout(function(){_57.moveOneTick(_52);},this.tickPause);}else{this.endMove();}}else{this.endMove();}},_getNextX:function(_58,_59){var t=this.thumb;var _60;var tmp=[];var _61=null;if(_58[0]>_59[0]){_60=t.tickSize-this.thumbCenterPoint.x;tmp=t.getTargetCoord(_58[0]-_60,_58[1]);_61=[tmp.x,tmp.y];}else{if(_58[0]<_59[0]){_60=t.tickSize+this.thumbCenterPoint.x;tmp=t.getTargetCoord(_58[0]+_60,_58[1]);_61=[tmp.x,tmp.y];}else{}}return _61;},_getNextY:function(_62,_63){var t=this.thumb;var _64;var tmp=[];var _65=null;if(_62[1]>_63[1]){_64=t.tickSize-this.thumbCenterPoint.y;tmp=t.getTargetCoord(_62[0],_62[1]-_64);_65=[tmp.x,tmp.y];}else{if(_62[1]<_63[1]){_64=t.tickSize+this.thumbCenterPoint.y;tmp=t.getTargetCoord(_62[0],_62[1]+_64);_65=[tmp.x,tmp.y];}else{}}return _65;},b4MouseDown:function(e){this.thumb.autoOffset();this.thumb.resetConstraints();},onMouseDown:function(e){if(!this.isLocked()&&this.backgroundEnabled){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.focus();this.moveThumb(x,y);}},onDrag:function(e){if(!this.isLocked()){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.moveThumb(x,y,true);}},endMove:function(){this.unlock();this.moveComplete=true;this.fireEvents();},fireEvents:function(){var t=this.thumb;t.cachePosition();if(!this.isLocked()){if(t._isRegion){var _66=t.getXValue();var _67=t.getYValue();if(_66!=this.previousX||_67!=this.previousY){this.onChange(_66,_67);this.fireEvent("change",{x:_66,y:_67});}this.previousX=_66;this.previousY=_67;}else{var _68=t.getValue();if(_68!=this.previousVal){this.onChange(_68);this.fireEvent("change",_68);}this.previousVal=_68;}if(this.moveComplete){this.onSlideEnd();this.fireEvent("slideEnd");this.moveComplete=false;}}},toString:function(){return ("Slider ("+this.type+") "+this.id);}});YAHOO.augment(YAHOO.widget.Slider,YAHOO.util.EventProvider);YAHOO.widget.SliderThumb=function(id,_70,_71,_72,iUp,_73,_74){if(id){this.init(id,_70);this.parentElId=_70;}this.isTarget=false;this.tickSize=_74;this.maintainOffset=true;this.initSlider(_71,_72,iUp,_73,_74);this.scroll=false;};YAHOO.extend(YAHOO.widget.SliderThumb,YAHOO.util.DD,{startOffset:null,_isHoriz:false,_prevVal:0,_graduated:false,getOffsetFromParent:function(_75){var _76=YAHOO.util.Dom.getXY(this.getEl());var _77=_75||YAHOO.util.Dom.getXY(this.parentElId);return [(_76[0]-_77[0]),(_76[1]-_77[1])];},initSlider:function(_78,_79,iUp,_80,_81){this.setXConstraint(_78,_79,_81);this.setYConstraint(iUp,_80,_81);if(_81&&_81>1){this._graduated=true;}this._isHoriz=(_78||_79);this._isVert=(iUp||_80);this._isRegion=(this._isHoriz&&this._isVert);},clearTicks:function(){YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);this._graduated=false;},getValue:function(){if(!this.available){return 0;}var val=(this._isHoriz)?this.getXValue():this.getYValue();return val;},getXValue:function(){if(!this.available){return 0;}var _83=this.getOffsetFromParent();return (_83[0]-this.startOffset[0]);},getYValue:function(){if(!this.available){return 0;}var _84=this.getOffsetFromParent();return (_84[1]-this.startOffset[1]);},toString:function(){return "SliderThumb "+this.id;},onChange:function(x,y){}});if("undefined"==typeof YAHOO.util.Anim){YAHOO.widget.Slider.ANIM_AVAIL=false;}
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.1 */\r
+YAHOO.widget.Slider=function(sElementId,sGroup,oThumb,sType){if(sElementId){this.init(sElementId,sGroup,true);this.initSlider(sType);this.initThumb(oThumb);}};YAHOO.widget.Slider.getHorizSlider=function(sBGElId,sHandleElId,iLeft,iRight,iTickSize){return new YAHOO.widget.Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,iLeft,iRight,0,0,iTickSize),"horiz");};YAHOO.widget.Slider.getVertSlider=function(sBGElId,sHandleElId,iUp,iDown,iTickSize){return new YAHOO.widget.Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,0,0,iUp,iDown,iTickSize),"vert");};YAHOO.widget.Slider.getSliderRegion=function(sBGElId,sHandleElId,iLeft,iRight,iUp,iDown,iTickSize){return new YAHOO.widget.Slider(sBGElId,sBGElId,new YAHOO.widget.SliderThumb(sHandleElId,sBGElId,iLeft,iRight,iUp,iDown,iTickSize),"region");};YAHOO.widget.Slider.ANIM_AVAIL=true;YAHOO.extend(YAHOO.widget.Slider,YAHOO.util.DragDrop,{initSlider:function(sType){this.type=sType;this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);this.isTarget=false;this.animate=YAHOO.widget.Slider.ANIM_AVAIL;this.backgroundEnabled=true;this.tickPause=40;this.enableKeys=true;this.keyIncrement=20;this.moveComplete=true;this.animationDuration=0.2;},initThumb:function(t){var self=this;this.thumb=t;t.cacheBetweenDrags=true;t.onChange=function(){self.handleThumbChange();};if(t._isHoriz&&t.xTicks&&t.xTicks.length){this.tickPause=Math.round(360/t.xTicks.length);}else if(t.yTicks&&t.yTicks.length){this.tickPause=Math.round(360/t.yTicks.length);}\r
+t.onMouseDown=function(){return self.focus();};t.onMouseUp=function(){self.thumbMouseUp();};t.onDrag=function(){self.fireEvents(true);};t.onAvailable=function(){return self.setStartSliderState();};},onAvailable:function(){var Event=YAHOO.util.Event;Event.on(this.id,"keydown",this.handleKeyDown,this,true);Event.on(this.id,"keypress",this.handleKeyPress,this,true);},handleKeyPress:function(e){if(this.enableKeys){var Event=YAHOO.util.Event;var kc=Event.getCharCode(e);switch(kc){case 0x25:case 0x26:case 0x27:case 0x28:case 0x24:case 0x23:Event.preventDefault(e);break;default:}}},handleKeyDown:function(e){if(this.enableKeys){var Event=YAHOO.util.Event;var kc=Event.getCharCode(e),t=this.thumb;var h=this.getXValue(),v=this.getYValue();var horiz=false;var changeValue=true;switch(kc){case 0x25:h-=this.keyIncrement;break;case 0x26:v-=this.keyIncrement;break;case 0x27:h+=this.keyIncrement;break;case 0x28:v+=this.keyIncrement;break;case 0x24:h=t.leftConstraint;v=t.topConstraint;break;case 0x23:h=t.rightConstraint;v=t.bottomConstraint;break;default:changeValue=false;}\r
+if(changeValue){if(t._isRegion){this.setRegionValue(h,v,true);}else{var newVal=(t._isHoriz)?h:v;this.setValue(newVal,true);}\r
+Event.stopEvent(e);}}},setStartSliderState:function(){this.setThumbCenterPoint();this.baselinePos=YAHOO.util.Dom.getXY(this.getEl());this.thumb.startOffset=this.thumb.getOffsetFromParent(this.baselinePos);if(this.thumb._isRegion){if(this.deferredSetRegionValue){this.setRegionValue.apply(this,this.deferredSetRegionValue,true);this.deferredSetRegionValue=null;}else{this.setRegionValue(0,0,true);}}else{if(this.deferredSetValue){this.setValue.apply(this,this.deferredSetValue,true);this.deferredSetValue=null;}else{this.setValue(0,true,true);}}},setThumbCenterPoint:function(){var el=this.thumb.getEl();if(el){this.thumbCenterPoint={x:parseInt(el.offsetWidth/2,10),y:parseInt(el.offsetHeight/2,10)};}},lock:function(){this.thumb.lock();this.locked=true;},unlock:function(){this.thumb.unlock();this.locked=false;},thumbMouseUp:function(){if(!this.isLocked()&&!this.moveComplete){this.endMove();}},getThumb:function(){return this.thumb;},focus:function(){var el=this.getEl();if(el.focus){try{el.focus();}catch(e){}}\r
+this.verifyOffset();if(this.isLocked()){return false;}else{this.onSlideStart();return true;}},onChange:function(firstOffset,secondOffset){},onSlideStart:function(){},onSlideEnd:function(){},getValue:function(){return this.thumb.getValue();},getXValue:function(){return this.thumb.getXValue();},getYValue:function(){return this.thumb.getYValue();},handleThumbChange:function(){var t=this.thumb;if(t._isRegion){t.onChange(t.getXValue(),t.getYValue());this.fireEvent("change",{x:t.getXValue(),y:t.getYValue()});}else{t.onChange(t.getValue());this.fireEvent("change",t.getValue());}},setValue:function(newOffset,skipAnim,force){if(!this.thumb.available){this.deferredSetValue=arguments;return false;}\r
+if(this.isLocked()&&!force){return false;}\r
+if(isNaN(newOffset)){return false;}\r
+var t=this.thumb;var newX,newY;this.verifyOffset(true);if(t._isRegion){return false;}else if(t._isHoriz){this.onSlideStart();newX=t.initPageX+newOffset+this.thumbCenterPoint.x;this.moveThumb(newX,t.initPageY,skipAnim);}else{this.onSlideStart();newY=t.initPageY+newOffset+this.thumbCenterPoint.y;this.moveThumb(t.initPageX,newY,skipAnim);}\r
+return true;},setRegionValue:function(newOffset,newOffset2,skipAnim){if(!this.thumb.available){this.deferredSetRegionValue=arguments;return false;}\r
+if(this.isLocked()&&!force){return false;}\r
+if(isNaN(newOffset)){return false;}\r
+var t=this.thumb;if(t._isRegion){this.onSlideStart();var newX=t.initPageX+newOffset+this.thumbCenterPoint.x;var newY=t.initPageY+newOffset2+this.thumbCenterPoint.y;this.moveThumb(newX,newY,skipAnim);return true;}\r
+return false;},verifyOffset:function(checkPos){var newPos=YAHOO.util.Dom.getXY(this.getEl());if(newPos[0]!=this.baselinePos[0]||newPos[1]!=this.baselinePos[1]){this.thumb.resetConstraints();this.baselinePos=newPos;return false;}\r
+return true;},moveThumb:function(x,y,skipAnim){var t=this.thumb;var self=this;if(!t.available){return;}\r
+t.setDelta(this.thumbCenterPoint.x,this.thumbCenterPoint.y);var _p=t.getTargetCoord(x,y);var p=[_p.x,_p.y];this.fireEvent("slideStart");if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&t._graduated&&!skipAnim){this.lock();this.curCoord=YAHOO.util.Dom.getXY(this.thumb.getEl());setTimeout(function(){self.moveOneTick(p);},this.tickPause);}else if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&!skipAnim){this.lock();var oAnim=new YAHOO.util.Motion(t.id,{points:{to:p}},this.animationDuration,YAHOO.util.Easing.easeOut);oAnim.onComplete.subscribe(function(){self.endMove();});oAnim.animate();}else{t.setDragElPos(x,y);this.endMove();}},moveOneTick:function(finalCoord){var t=this.thumb,tmp;var nextCoord=null;if(t._isRegion){nextCoord=this._getNextX(this.curCoord,finalCoord);var tmpX=(nextCoord)?nextCoord[0]:this.curCoord[0];nextCoord=this._getNextY([tmpX,this.curCoord[1]],finalCoord);}else if(t._isHoriz){nextCoord=this._getNextX(this.curCoord,finalCoord);}else{nextCoord=this._getNextY(this.curCoord,finalCoord);}\r
+if(nextCoord){this.curCoord=nextCoord;this.thumb.alignElWithMouse(t.getEl(),nextCoord[0],nextCoord[1]);if(!(nextCoord[0]==finalCoord[0]&&nextCoord[1]==finalCoord[1])){var self=this;setTimeout(function(){self.moveOneTick(finalCoord);},this.tickPause);}else{this.endMove();}}else{this.endMove();}},_getNextX:function(curCoord,finalCoord){var t=this.thumb;var thresh;var tmp=[];var nextCoord=null;if(curCoord[0]>finalCoord[0]){thresh=t.tickSize-this.thumbCenterPoint.x;tmp=t.getTargetCoord(curCoord[0]-thresh,curCoord[1]);nextCoord=[tmp.x,tmp.y];}else if(curCoord[0]<finalCoord[0]){thresh=t.tickSize+this.thumbCenterPoint.x;tmp=t.getTargetCoord(curCoord[0]+thresh,curCoord[1]);nextCoord=[tmp.x,tmp.y];}else{}\r
+return nextCoord;},_getNextY:function(curCoord,finalCoord){var t=this.thumb;var thresh;var tmp=[];var nextCoord=null;if(curCoord[1]>finalCoord[1]){thresh=t.tickSize-this.thumbCenterPoint.y;tmp=t.getTargetCoord(curCoord[0],curCoord[1]-thresh);nextCoord=[tmp.x,tmp.y];}else if(curCoord[1]<finalCoord[1]){thresh=t.tickSize+this.thumbCenterPoint.y;tmp=t.getTargetCoord(curCoord[0],curCoord[1]+thresh);nextCoord=[tmp.x,tmp.y];}else{}\r
+return nextCoord;},b4MouseDown:function(e){this.thumb.autoOffset();this.thumb.resetConstraints();},onMouseDown:function(e){if(!this.isLocked()&&this.backgroundEnabled){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.focus();this.moveThumb(x,y);}},onDrag:function(e){if(!this.isLocked()){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.moveThumb(x,y,true);}},endMove:function(){this.unlock();this.moveComplete=true;this.fireEvents();},fireEvents:function(thumbEvent){var t=this.thumb;if(!thumbEvent){t.cachePosition();}\r
+if(!this.isLocked()){if(t._isRegion){var newX=t.getXValue();var newY=t.getYValue();if(newX!=this.previousX||newY!=this.previousY){this.onChange(newX,newY);this.fireEvent("change",{x:newX,y:newY});}\r
+this.previousX=newX;this.previousY=newY;}else{var newVal=t.getValue();if(newVal!=this.previousVal){this.onChange(newVal);this.fireEvent("change",newVal);}\r
+this.previousVal=newVal;}\r
+if(this.moveComplete){this.onSlideEnd();this.fireEvent("slideEnd");this.moveComplete=false;}}},toString:function(){return("Slider ("+this.type+") "+this.id);}});YAHOO.augment(YAHOO.widget.Slider,YAHOO.util.EventProvider);YAHOO.widget.SliderThumb=function(id,sGroup,iLeft,iRight,iUp,iDown,iTickSize){if(id){YAHOO.widget.SliderThumb.superclass.constructor.call(this,id,sGroup);this.parentElId=sGroup;}\r
+this.isTarget=false;this.tickSize=iTickSize;this.maintainOffset=true;this.initSlider(iLeft,iRight,iUp,iDown,iTickSize);this.scroll=false;};YAHOO.extend(YAHOO.widget.SliderThumb,YAHOO.util.DD,{startOffset:null,_isHoriz:false,_prevVal:0,_graduated:false,getOffsetFromParent0:function(parentPos){var myPos=YAHOO.util.Dom.getXY(this.getEl());var ppos=parentPos||YAHOO.util.Dom.getXY(this.parentElId);return[(myPos[0]-ppos[0]),(myPos[1]-ppos[1])];},getOffsetFromParent:function(parentPos){var el=this.getEl();if(!this.deltaOffset){var myPos=YAHOO.util.Dom.getXY(el);var ppos=parentPos||YAHOO.util.Dom.getXY(this.parentElId);var newOffset=[(myPos[0]-ppos[0]),(myPos[1]-ppos[1])];var l=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var t=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);var deltaX=l-newOffset[0];var deltaY=t-newOffset[1];if(isNaN(deltaX)||isNaN(deltaY)){}else{this.deltaOffset=[deltaX,deltaY];}}else{var newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);newOffset=[newLeft+this.deltaOffset[0],newTop+this.deltaOffset[1]];}\r
+return newOffset;},initSlider:function(iLeft,iRight,iUp,iDown,iTickSize){this.initLeft=iLeft;this.initRight=iRight;this.initUp=iUp;this.initDown=iDown;this.setXConstraint(iLeft,iRight,iTickSize);this.setYConstraint(iUp,iDown,iTickSize);if(iTickSize&&iTickSize>1){this._graduated=true;}\r
+this._isHoriz=(iLeft||iRight);this._isVert=(iUp||iDown);this._isRegion=(this._isHoriz&&this._isVert);},clearTicks:function(){YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);this.tickSize=0;this._graduated=false;},getValue:function(){if(!this.available){return 0;}\r
+var val=(this._isHoriz)?this.getXValue():this.getYValue();return val;},getXValue:function(){if(!this.available){return 0;}\r
+var newOffset=this.getOffsetFromParent();return(newOffset[0]-this.startOffset[0]);},getYValue:function(){if(!this.available){return 0;}\r
+var newOffset=this.getOffsetFromParent();return(newOffset[1]-this.startOffset[1]);},toString:function(){return"SliderThumb "+this.id;},onChange:function(x,y){}});if("undefined"==typeof YAHOO.util.Anim){YAHOO.widget.Slider.ANIM_AVAIL=false;}
\ No newline at end of file
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
+version: 0.12.1\r
*/ \r
-\r
/**\r
* The Slider component is a UI control that enables the user to adjust \r
* values in a finite range along one or two axes. Typically, the Slider \r
*\r
* @class Slider\r
* @extends YAHOO.util.DragDrop\r
+ * @uses YAHOO.util.EventProvider\r
* @constructor\r
- * @param {String} id The id of the element linked to this instance\r
- * @param {String} sGroup The group of related DragDrop items\r
- * @param {String} sType The type of slider (horiz, vert, region)\r
+ * @param {String} id The id of the element linked to this instance\r
+ * @param {String} sGroup The group of related DragDrop items\r
+ * @param {SliderThumb} oThumb The thumb for this slider\r
+ * @param {String} sType The type of slider (horiz, vert, region)\r
*/\r
YAHOO.widget.Slider = function(sElementId, sGroup, oThumb, sType) {\r
if (sElementId) {\r
+ this.init(sElementId, sGroup, true);\r
+ this.initSlider(sType);\r
+ this.initThumb(oThumb);\r
+ }\r
+};\r
+\r
+/**\r
+ * Factory method for creating a horizontal slider\r
+ * @method YAHOO.widget.Slider.getHorizSlider\r
+ * @static\r
+ * @param {String} sBGElId the id of the slider's background element\r
+ * @param {String} sHandleElId the id of the thumb element\r
+ * @param {int} iLeft the number of pixels the element can move left\r
+ * @param {int} iRight the number of pixels the element can move right\r
+ * @param {int} iTickSize optional parameter for specifying that the element \r
+ * should move a certain number pixels at a time.\r
+ * @return {Slider} a horizontal slider control\r
+ */\r
+YAHOO.widget.Slider.getHorizSlider = \r
+ function (sBGElId, sHandleElId, iLeft, iRight, iTickSize) {\r
+ return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
+ new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, \r
+ iLeft, iRight, 0, 0, iTickSize), "horiz");\r
+};\r
+\r
+/**\r
+ * Factory method for creating a vertical slider\r
+ * @method YAHOO.widget.Slider.getVertSlider\r
+ * @static\r
+ * @param {String} sBGElId the id of the slider's background element\r
+ * @param {String} sHandleElId the id of the thumb element\r
+ * @param {int} iUp the number of pixels the element can move up\r
+ * @param {int} iDown the number of pixels the element can move down\r
+ * @param {int} iTickSize optional parameter for specifying that the element \r
+ * should move a certain number pixels at a time.\r
+ * @return {Slider} a vertical slider control\r
+ */\r
+YAHOO.widget.Slider.getVertSlider = \r
+ function (sBGElId, sHandleElId, iUp, iDown, iTickSize) {\r
+ return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
+ new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, 0, 0, \r
+ iUp, iDown, iTickSize), "vert");\r
+};\r
+\r
+/**\r
+ * Factory method for creating a slider region like the one in the color\r
+ * picker example\r
+ * @method YAHOO.widget.Slider.getSliderRegion\r
+ * @static\r
+ * @param {String} sBGElId the id of the slider's background element\r
+ * @param {String} sHandleElId the id of the thumb element\r
+ * @param {int} iLeft the number of pixels the element can move left\r
+ * @param {int} iRight the number of pixels the element can move right\r
+ * @param {int} iUp the number of pixels the element can move up\r
+ * @param {int} iDown the number of pixels the element can move down\r
+ * @param {int} iTickSize optional parameter for specifying that the element \r
+ * should move a certain number pixels at a time.\r
+ * @return {Slider} a slider region control\r
+ */\r
+YAHOO.widget.Slider.getSliderRegion = \r
+ function (sBGElId, sHandleElId, iLeft, iRight, iUp, iDown, iTickSize) {\r
+ return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
+ new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, iLeft, iRight, \r
+ iUp, iDown, iTickSize), "region");\r
+};\r
+\r
+/**\r
+ * By default, animation is available if the animation library is detected.\r
+ * @property YAHOO.widget.Slider.ANIM_AVAIL\r
+ * @static\r
+ * @type boolean\r
+ */\r
+YAHOO.widget.Slider.ANIM_AVAIL = true;\r
+\r
+YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {\r
+\r
+ /**\r
+ * Initializes the slider. Executed in the constructor\r
+ * @method initSlider\r
+ * @param {string} sType the type of slider (horiz, vert, region)\r
+ */\r
+ initSlider: function(sType) {\r
\r
/**\r
* The type of the slider (horiz, vert, region)\r
*/\r
this.type = sType;\r
\r
- this.init(sElementId, sGroup, true);\r
-\r
//this.removeInvalidHandleType("A");\r
\r
\r
- var self = this;\r
-\r
/**\r
* Event the fires when the value of the control changes. If \r
* the control is animated the event will fire every point\r
* along the way.\r
* @event change\r
- * @param {int} new\r
- * @param {int} firstOffset the number of pixels the thumb has moved\r
- * from its start position. Normal horizontal and vertical sliders will only\r
- * have the firstOffset. Regions will have both, the first is the horizontal\r
- * offset, the second the vertical.\r
- * @param {int} secondOffset the y offset for region sliders\r
+ * @param {int} newOffset|x the new offset for normal sliders, or the new\r
+ * x offset for region sliders\r
+ * @param {int} y the number of pixels the thumb has moved on the y axis\r
+ * (region sliders only)\r
*/\r
this.createEvent("change", this);\r
\r
/**\r
- * Event that fires at the end of a slider thumb move.\r
+ * Event that fires at the beginning of a slider thumb move.\r
* @event slideStart\r
*/\r
this.createEvent("slideStart", this);\r
*/\r
this.createEvent("slideEnd", this);\r
\r
- /**\r
- * A YAHOO.widget.SliderThumb instance that we will use to \r
- * reposition the thumb when the background is clicked\r
- * @property thumb\r
- * @type YAHOO.widget.SliderThumb\r
- */\r
- this.thumb = oThumb;\r
-\r
- // add handler for the handle onchange event\r
- oThumb.onChange = function() { \r
- self.handleThumbChange(); \r
- };\r
-\r
/**\r
* Overrides the isTarget property in YAHOO.util.DragDrop\r
* @property isTarget\r
* @default 0.2\r
*/\r
this.animationDuration = 0.2;\r
+ },\r
\r
- if (oThumb._isHoriz && oThumb.xTicks && oThumb.xTicks.length) {\r
- this.tickPause = Math.round(360 / oThumb.xTicks.length);\r
- } else if (oThumb.yTicks && oThumb.yTicks.length) {\r
- this.tickPause = Math.round(360 / oThumb.yTicks.length);\r
- }\r
+ /**\r
+ * Initializes the slider's thumb. Executed in the constructor.\r
+ * @method initThumb\r
+ * @param {YAHOO.widget.SliderThumb} t the slider thumb\r
+ */\r
+ initThumb: function(t) {\r
\r
+ var self = this;\r
\r
- // delegate thumb methods\r
- oThumb.onMouseDown = function () { return self.focus(); };\r
- //oThumb.b4MouseDown = function () { return self.b4MouseDown(); };\r
- // oThumb.lock = function() { self.lock(); };\r
- // oThumb.unlock = function() { self.unlock(); };\r
- oThumb.onMouseUp = function() { self.thumbMouseUp(); };\r
- oThumb.onDrag = function() { self.fireEvents(); };\r
- oThumb.onAvailable = function() { return self.setStartSliderState(); };\r
- }\r
-};\r
+ /**\r
+ * A YAHOO.widget.SliderThumb instance that we will use to \r
+ * reposition the thumb when the background is clicked\r
+ * @property thumb\r
+ * @type YAHOO.widget.SliderThumb\r
+ */\r
+ this.thumb = t;\r
+ t.cacheBetweenDrags = true;\r
\r
-/**\r
- * Factory method for creating a horizontal slider\r
- * @method YAHOO.widget.Slider.getHorizSlider\r
- * @static\r
- * @param {String} sBGElId the id of the slider's background element\r
- * @param {String} sHandleElId the id of the thumb element\r
- * @param {int} iLeft the number of pixels the element can move left\r
- * @param {int} iRight the number of pixels the element can move right\r
- * @param {int} iTickSize optional parameter for specifying that the element \r
- * should move a certain number pixels at a time.\r
- * @return {Slider} a horizontal slider control\r
- */\r
-YAHOO.widget.Slider.getHorizSlider = \r
- function (sBGElId, sHandleElId, iLeft, iRight, iTickSize) {\r
- return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
- new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, \r
- iLeft, iRight, 0, 0, iTickSize), "horiz");\r
-};\r
+ // add handler for the handle onchange event\r
+ t.onChange = function() { \r
+ self.handleThumbChange(); \r
+ };\r
\r
-/**\r
- * Factory method for creating a vertical slider\r
- * @method YAHOO.widget.Slider.getVertSlider\r
- * @static\r
- * @param {String} sBGElId the id of the slider's background element\r
- * @param {String} sHandleElId the id of the thumb element\r
- * @param {int} iUp the number of pixels the element can move up\r
- * @param {int} iDown the number of pixels the element can move down\r
- * @param {int} iTickSize optional parameter for specifying that the element \r
- * should move a certain number pixels at a time.\r
- * @return {Slider} a vertical slider control\r
- */\r
-YAHOO.widget.Slider.getVertSlider = \r
- function (sBGElId, sHandleElId, iUp, iDown, iTickSize) {\r
- return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
- new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, 0, 0, \r
- iUp, iDown, iTickSize), "vert");\r
-};\r
+ if (t._isHoriz && t.xTicks && t.xTicks.length) {\r
+ this.tickPause = Math.round(360 / t.xTicks.length);\r
+ } else if (t.yTicks && t.yTicks.length) {\r
+ this.tickPause = Math.round(360 / t.yTicks.length);\r
+ }\r
\r
-/**\r
- * Factory method for creating a slider region like the one in the color\r
- * picker example\r
- * @method YAHOO.widget.Slider.getSliderRegion\r
- * @static\r
- * @param {String} sBGElId the id of the slider's background element\r
- * @param {String} sHandleElId the id of the thumb element\r
- * @param {int} iLeft the number of pixels the element can move left\r
- * @param {int} iRight the number of pixels the element can move right\r
- * @param {int} iUp the number of pixels the element can move up\r
- * @param {int} iDown the number of pixels the element can move down\r
- * @param {int} iTickSize optional parameter for specifying that the element \r
- * should move a certain number pixels at a time.\r
- * @return {Slider} a slider region control\r
- */\r
-YAHOO.widget.Slider.getSliderRegion = \r
- function (sBGElId, sHandleElId, iLeft, iRight, iUp, iDown, iTickSize) {\r
- return new YAHOO.widget.Slider(sBGElId, sBGElId, \r
- new YAHOO.widget.SliderThumb(sHandleElId, sBGElId, iLeft, iRight, \r
- iUp, iDown, iTickSize), "region");\r
-};\r
\r
-/**\r
- * By default, animation is available if the animation library is detected.\r
- * @property YAHOO.widget.Slider.ANIM_AVAIL\r
- * @static\r
- * @type boolean\r
- */\r
-YAHOO.widget.Slider.ANIM_AVAIL = true;\r
+ // delegate thumb methods\r
+ t.onMouseDown = function () { return self.focus(); };\r
+ t.onMouseUp = function() { self.thumbMouseUp(); };\r
+ t.onDrag = function() { self.fireEvents(true); };\r
+ t.onAvailable = function() { return self.setStartSliderState(); };\r
\r
-YAHOO.extend(YAHOO.widget.Slider, YAHOO.util.DragDrop, {\r
+ },\r
\r
+ /**\r
+ * Executed when the slider element is available\r
+ * @method onAvailable\r
+ */\r
onAvailable: function() {\r
var Event = YAHOO.util.Event;\r
Event.on(this.id, "keydown", this.handleKeyDown, this, true);\r
Event.on(this.id, "keypress", this.handleKeyPress, this, true);\r
},\r
\r
+ /**\r
+ * Executed when a keypress event happens with the control focused.\r
+ * Prevents the default behavior for navigation keys. The actual\r
+ * logic for moving the slider thumb in response to a key event\r
+ * happens in handleKeyDown.\r
+ * @param {Event} e the keypress event\r
+ */\r
handleKeyPress: function(e) {\r
if (this.enableKeys) {\r
var Event = YAHOO.util.Event;\r
default:\r
}\r
}\r
- },\r
+ },\r
\r
+ /**\r
+ * Executed when a keydown event happens with the control focused.\r
+ * Updates the slider value and display when the keypress is an\r
+ * arrow key, home, or end as long as enableKeys is set to true.\r
+ * @param {Event} e the keydown event\r
+ */\r
handleKeyDown: function(e) {\r
if (this.enableKeys) {\r
var Event = YAHOO.util.Event;\r
\r
/**\r
* Initialization that sets up the value offsets once the elements are ready\r
- * @method setSliderStartState\r
+ * @method setStartSliderState\r
*/\r
setStartSliderState: function() {\r
\r
\r
var t = this.thumb;\r
var newX, newY;\r
- this.verifyOffset();\r
+ this.verifyOffset(true);\r
if (t._isRegion) {\r
return false;\r
} else if (t._isHoriz) {\r
/**\r
* Checks the background position element position. If it has moved from the\r
* baseline position, the constraints for the thumb are reset\r
+ * @param checkPos {boolean} check the position instead of using cached value\r
* @method verifyOffset\r
* @return {boolean} True if the offset is the same as the baseline.\r
*/\r
- verifyOffset: function() {\r
+ verifyOffset: function(checkPos) {\r
\r
var newPos = YAHOO.util.Dom.getXY(this.getEl());\r
+ //var newPos = [this.initPageX, this.initPageY];\r
+\r
\r
if (newPos[0] != this.baselinePos[0] || newPos[1] != this.baselinePos[1]) {\r
this.thumb.resetConstraints();\r
if (this.animate && YAHOO.widget.Slider.ANIM_AVAIL && t._graduated && !skipAnim) {\r
// this.thumb._animating = true;\r
this.lock();\r
- \r
+\r
+ // cache the current thumb pos\r
+ this.curCoord = YAHOO.util.Dom.getXY(this.thumb.getEl());\r
+\r
setTimeout( function() { self.moveOneTick(p); }, this.tickPause );\r
\r
} else if (this.animate && YAHOO.widget.Slider.ANIM_AVAIL && !skipAnim) {\r
*/\r
moveOneTick: function(finalCoord) {\r
\r
- var t = this.thumb;\r
- var curCoord = YAHOO.util.Dom.getXY(t.getEl());\r
- var tmp;\r
+ var t = this.thumb, tmp;\r
+\r
+ // redundant call to getXY since we set the position most of time prior \r
+ // to getting here. Moved to this.curCoord\r
+ //var curCoord = YAHOO.util.Dom.getXY(t.getEl());\r
+\r
+ // alignElWithMouse caches position in lastPageX, lastPageY .. doesn't work\r
+ //var curCoord = [this.lastPageX, this.lastPageY];\r
\r
// var thresh = Math.min(t.tickSize + (Math.floor(t.tickSize/2)), 10);\r
// var thresh = 10;\r
var nextCoord = null;\r
\r
if (t._isRegion) {\r
- nextCoord = this._getNextX(curCoord, finalCoord);\r
- var tmpX = (nextCoord) ? nextCoord[0] : curCoord[0];\r
- nextCoord = this._getNextY([tmpX, curCoord[1]], finalCoord);\r
+ nextCoord = this._getNextX(this.curCoord, finalCoord);\r
+ var tmpX = (nextCoord) ? nextCoord[0] : this.curCoord[0];\r
+ nextCoord = this._getNextY([tmpX, this.curCoord[1]], finalCoord);\r
\r
} else if (t._isHoriz) {\r
- nextCoord = this._getNextX(curCoord, finalCoord);\r
+ nextCoord = this._getNextX(this.curCoord, finalCoord);\r
} else {\r
- nextCoord = this._getNextY(curCoord, finalCoord);\r
+ nextCoord = this._getNextY(this.curCoord, finalCoord);\r
}\r
\r
\r
if (nextCoord) {\r
\r
+ // cache the position\r
+ this.curCoord = nextCoord;\r
+\r
// move to the next coord\r
// YAHOO.util.Dom.setXY(t.getEl(), nextCoord);\r
\r
* the middle of an animation as the event will fire when the animation is\r
* complete\r
* @method fireEvents\r
+ * @param {boolean} thumbEvent set to true if this event is fired from an event\r
+ * that occurred on the thumb. If it is, the state of the\r
+ * thumb dd object should be correct. Otherwise, the event\r
+ * originated on the background, so the thumb state needs to\r
+ * be refreshed before proceeding.\r
* @private\r
*/\r
- fireEvents: function () {\r
+ fireEvents: function (thumbEvent) {\r
\r
var t = this.thumb;\r
\r
- t.cachePosition();\r
+ if (!thumbEvent) {\r
+ t.cachePosition();\r
+ }\r
\r
if (! this.isLocked()) {\r
if (t._isRegion) {\r
YAHOO.widget.SliderThumb = function(id, sGroup, iLeft, iRight, iUp, iDown, iTickSize) {\r
\r
if (id) {\r
- this.init(id, sGroup);\r
+ //this.init(id, sGroup);\r
+ YAHOO.widget.SliderThumb.superclass.constructor.call(this, id, sGroup);\r
\r
/**\r
* The id of the thumbs parent HTML element (the slider background \r
* @param {[int, int]} parentPos Optionally accepts the position of the parent\r
* @type [int, int]\r
*/\r
- getOffsetFromParent: function(parentPos) {\r
+ getOffsetFromParent0: function(parentPos) {\r
var myPos = YAHOO.util.Dom.getXY(this.getEl());\r
var ppos = parentPos || YAHOO.util.Dom.getXY(this.parentElId);\r
\r
return [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ];\r
},\r
\r
+ getOffsetFromParent: function(parentPos) {\r
+\r
+ var el = this.getEl();\r
+\r
+ if (!this.deltaOffset) {\r
+\r
+ var myPos = YAHOO.util.Dom.getXY(el);\r
+ var ppos = parentPos || YAHOO.util.Dom.getXY(this.parentElId);\r
+\r
+ var newOffset = [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ];\r
+\r
+ var l = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );\r
+ var t = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );\r
+\r
+ var deltaX = l - newOffset[0];\r
+ var deltaY = t - newOffset[1];\r
+\r
+ if (isNaN(deltaX) || isNaN(deltaY)) {\r
+ } else {\r
+ this.deltaOffset = [deltaX, deltaY];\r
+ }\r
+\r
+ } else {\r
+ var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );\r
+ var newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );\r
+\r
+ newOffset = [newLeft + this.deltaOffset[0], newTop + this.deltaOffset[1]];\r
+ }\r
+\r
+ return newOffset;\r
+\r
+ //return [ (myPos[0] - ppos[0]), (myPos[1] - ppos[1]) ];\r
+ },\r
+\r
/**\r
* Set up the slider, must be called in the constructor of all subclasses\r
* @method initSlider\r
*/\r
initSlider: function (iLeft, iRight, iUp, iDown, iTickSize) {\r
\r
+ //document these. new for 0.12.1\r
+ this.initLeft = iLeft;\r
+ this.initRight = iRight;\r
+ this.initUp = iUp;\r
+ this.initDown = iDown;\r
+\r
this.setXConstraint(iLeft, iRight, iTickSize);\r
this.setYConstraint(iUp, iDown, iTickSize);\r
\r
*/\r
clearTicks: function () {\r
YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);\r
+ this.tickSize = 0;\r
this._graduated = false;\r
},\r
\r
-Tabview Release Notes\r
+*** version 0.12.1 ***\r
+\r
+* tabs.css renamed to tabview.css\r
+* calls to "set" now queued so they can be made before "contentReady"\r
+\r
\r
*** version 0.12.0 ***\r
\r
-* Initial release\r
+* TabView widget introduced\r
\r
+* Note: border_tabs.css included as basic skin to enable "tabs" look\r
background-color:#f6f7ee; /* active tab, tab hover, and content bgcolor */\r
}\r
\r
-.yui-navset-top .yui-nav .selected a {\r
- border-bottom:0; /* no bottom border for active tab */\r
+.yui-navset .yui-nav li em { padding:.5em; } /* tab padding */\r
+\r
+/* defaults to orientation "top" */\r
+.yui-navset .yui-nav .selected a {\r
+ border-bottom-width:0; /* no bottom border for active tab */\r
padding-bottom:1px; /* to match height of other tabs */\r
}\r
\r
-.yui-navset-top .yui-content {\r
+.yui-navset .yui-content {\r
margin-top:-1px; /* for active tab overlap */\r
}\r
\r
+/* overrides for other orientations */\r
+\r
.yui-navset-bottom .yui-nav .selected a {\r
- border-top:0; /* no bottom border for active tab */\r
- padding-top:1px; /* to match height of other tabs */\r
+ border-width:0 1px 1px; /* no top border for active tab */\r
+ padding:1px 0 0; /* to match height of other tabs */\r
}\r
\r
.yui-navset-bottom .yui-content {\r
- margin-bottom:-1px; /* for active tab overlap */\r
+ margin:0 0 -1px; /* for active tab overlap */\r
}\r
\r
.yui-navset-left .yui-nav li.selected a {\r
- border-right:0; /* no bottom border for active tab */\r
- padding-right:1px; /* to match height of other tabs */\r
+ border-width:1px 0 1px 1px; /* no right border for active tab */\r
+ padding:0 1px 0 0; /* to match width of other tabs */\r
}\r
\r
.yui-navset-left .yui-content {\r
- margin-left:-1px; /* for active tab overlap */\r
+ margin:0 0 0 -1px; /* for active tab overlap */\r
}\r
\r
.yui-navset-right .yui-nav li.selected a {\r
- border-left:0; /* no bottom border for active tab */\r
- padding-left:1px; /* to match height of other tabs */\r
+ border-width:1px 1px 1px 0; /* no left border for active tab */\r
+ padding:0 0 0 1px; /* to match width of other tabs */\r
}\r
\r
.yui-navset-right .yui-content {\r
- margin-right:-1px; /* for active tab overlap */\r
- *margin-right:0; /* except IE */\r
+ margin:0 -1px 0 0; /* for active tab overlap */\r
}
\ No newline at end of file
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
+version: 0.12.1\r
*/\r
+\r
(function() {\r
\r
YAHOO.util.Lang = {\r
set: function(key, value, silent) {\r
var el = this.get('element');\r
if (!el) {\r
- this._queue[key] = ['set', arguments];\r
+ this._queue[this._queue.length] = ['set', arguments];\r
return false;\r
}\r
\r
\r
\r
YAHOO.augment(YAHOO.util.Element, AttributeProvider);\r
-})();(function() {\r
+})();\r
+(function() {\r
var Dom = YAHOO.util.Dom,\r
Event = YAHOO.util.Event,\r
Lang = YAHOO.util.Lang;\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ (function(){YAHOO.util.Lang={isArray:function(val){if(val.constructor&&val.constructor.toString().indexOf('Array')>-1){return true;}else{return YAHOO.util.Lang.isObject(val)&&val.constructor==Array;}},isBoolean:function(val){return typeof val=='boolean';},isFunction:function(val){return typeof val=='function';},isNull:function(val){return val===null;},isNumber:function(val){return!isNaN(val);},isObject:function(val){return typeof val=='object'||YAHOO.util.Lang.isFunction(val);},isString:function(val){return typeof val=='string';},isUndefined:function(val){return typeof val=='undefined';}};})();YAHOO.util.Attribute=function(hash,owner){if(owner){this.owner=owner;this.configure(hash,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,validator:null,getValue:function(){return this.value;},setValue:function(value,silent){var beforeRetVal;var owner=this.owner;var name=this.name;var event={type:name,prevValue:this.getValue(),newValue:value};if(this.readOnly||(this.writeOnce&&this._written)){return false;}if(this.validator&&!this.validator.call(owner,value)){return false;}if(!silent){beforeRetVal=owner.fireBeforeChangeEvent(event);if(beforeRetVal===false){YAHOO.log('setValue '+name+'cancelled by beforeChange event','info','Attribute');return false;}}if(this.method){this.method.call(owner,value);}this.value=value;this._written=true;event.type=name;if(!silent){this.owner.fireChangeEvent(event);}return true;},configure:function(map,init){map=map||{};this._written=false;this._initialConfig=this._initialConfig||{};for(var key in map){if(key&&map.hasOwnProperty(key)){this[key]=map[key];if(init){this._initialConfig[key]=map[key];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig);},refresh:function(silent){this.setValue(this.value,silent);}};(function(){var Lang=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(key){var configs=this._configs||{};var config=configs[key];if(!config){YAHOO.log(key+' not found','error','AttributeProvider');return undefined;}return config.value;},set:function(key,value,silent){var configs=this._configs||{};var config=configs[key];if(!config){YAHOO.log('set failed: '+key+' not found','error','AttributeProvider');return false;}return config.setValue(value,silent);},getAttributeKeys:function(){var configs=this._configs;var keys=[];var config;for(var key in configs){config=configs[key];if(configs.hasOwnProperty(key)&&!Lang.isUndefined(config)){keys[keys.length]=key;}}return keys;},setAttributes:function(map,silent){for(var key in map){if(map.hasOwnProperty(key)){this.set(key,map[key],silent);}}},resetValue:function(key,silent){var configs=this._configs||{};if(configs[key]){this.set(key,configs[key]._initialConfig.value,silent);return true;}return false;},refresh:function(key,silent){var configs=this._configs;key=((Lang.isString(key))?[key]:key)||this.getAttributeKeys();for(var i=0,len=key.length;i<len;++i){if(configs[key[i]]&&!Lang.isUndefined(configs[key[i]].value)&&!Lang.isNull(configs[key[i]].value)){configs[key[i]].refresh(silent);}}},register:function(key,map){this._configs=this._configs||{};if(this._configs[key]){return false;}map.name=key;this._configs[key]=new YAHOO.util.Attribute(map,this);return true;},getAttributeConfig:function(key){var configs=this._configs||{};var config=configs[key]||{};var map={};for(key in config){if(config.hasOwnProperty(key)){map[key]=config[key];}}return map;},configureAttribute:function(key,map,init){var configs=this._configs||{};if(!configs[key]){YAHOO.log('unable to configure, '+key+' not found','error','AttributeProvider');return false;}configs[key].configure(map,init);},resetAttributeConfig:function(key){var configs=this._configs||{};configs[key].resetConfig();},fireBeforeChangeEvent:function(e){var type='before';type+=e.type.charAt(0).toUpperCase()+e.type.substr(1)+'Change';e.type=type;return this.fireEvent(e.type,e);},fireChangeEvent:function(e){e.type+='Change';return this.fireEvent(e.type,e);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var Dom=YAHOO.util.Dom,Lang=YAHOO.util.Lang,EventPublisher=YAHOO.util.EventPublisher,AttributeProvider=YAHOO.util.AttributeProvider;YAHOO.util.Element=function(el,map){if(arguments.length){this.init(el,map);}};YAHOO.util.Element.prototype={DOM_EVENTS:null,appendChild:function(child){child=child.get?child.get('element'):child;this.get('element').appendChild(child);},getElementsByTagName:function(tag){return this.get('element').getElementsByTagName(tag);},hasChildNodes:function(){return this.get('element').hasChildNodes();},insertBefore:function(element,before){element=element.get?element.get('element'):element;before=(before&&before.get)?before.get('element'):before;this.get('element').insertBefore(element,before);},removeChild:function(child){child=child.get?child.get('element'):child;this.get('element').removeChild(child);return true;},replaceChild:function(newNode,oldNode){newNode=newNode.get?newNode.get('element'):newNode;oldNode=oldNode.get?oldNode.get('element'):oldNode;return this.get('element').replaceChild(newNode,oldNode);},initAttributes:function(map){map=map||{};var element=Dom.get(map.element)||null;this.register('element',{value:element,readOnly:true});},addListener:function(type,fn,obj,scope){var el=this.get('element');var scope=scope||this;el=this.get('id')||el;if(!this._events[type]){if(this.DOM_EVENTS[type]){YAHOO.util.Event.addListener(el,type,function(e){if(e.srcElement&&!e.target){e.target=e.srcElement;}this.fireEvent(type,e);},obj,scope);}this.createEvent(type,this);this._events[type]=true;}this.subscribe.apply(this,arguments);},on:function(){this.addListener.apply(this,arguments);},removeListener:function(type,fn){this.unsubscribe.apply(this,arguments);},addClass:function(className){Dom.addClass(this.get('element'),className);},getElementsByClassName:function(className,tag){return Dom.getElementsByClassName(className,tag,this.get('element'));},hasClass:function(className){return Dom.hasClass(this.get('element'),className);},removeClass:function(className){return Dom.removeClass(this.get('element'),className);},replaceClass:function(oldClassName,newClassName){return Dom.replaceClass(this.get('element'),oldClassName,newClassName);},setStyle:function(property,value){return Dom.setStyle(this.get('element'),property,value);},getStyle:function(property){return Dom.getStyle(this.get('element'),property);},fireQueue:function(){var queue=this._queue;for(var i=0,len=queue.length;i<len;++i){this[queue[i][0]].apply(this,queue[i][1]);}},appendTo:function(parent,before){parent=(parent.get)?parent.get('element'):Dom.get(parent);before=(before&&before.get)?before.get('element'):Dom.get(before);var element=this.get('element');var newAddition=!Dom.inDocument(element);if(!element){YAHOO.log('appendTo failed: element not available','error','Element');return false;}if(!parent){YAHOO.log('appendTo failed: parent not available','error','Element');return false;}if(element.parent!=parent){if(before){parent.insertBefore(element,before);}else{parent.appendChild(element);}}YAHOO.log(element+'appended to '+parent);if(!newAddition){return false;}var keys=this.getAttributeKeys();for(var key in keys){if(!Lang.isUndefined(element[key])){this.refresh(key);}}},get:function(key){var configs=this._configs||{};var el=configs.element;if(el&&!configs[key]&&!Lang.isUndefined(el.value[key])){return el.value[key];}return AttributeProvider.prototype.get.call(this,key);},set:function(key,value,silent){var el=this.get('element');if(!el){this._queue[key]=['set',arguments];return false;}if(!this._configs[key]&&!Lang.isUndefined(el[key])){_registerHTMLAttr(this,key);}return AttributeProvider.prototype.set.apply(this,arguments);},register:function(key){var configs=this._configs||{};var element=this.get('element')||null;if(element&&!Lang.isUndefined(element[key])){YAHOO.log(key+' is reserved for '+element,'error','Element');return false;}return AttributeProvider.prototype.register.apply(this,arguments);},configureAttribute:function(property,map,init){if(!this._configs[property]&&this._configs.element&&!Lang.isUndefined(this._configs.element[property])){_registerHTMLAttr(this,property,map);return false;}return AttributeProvider.prototype.configure.apply(this,arguments);},getAttributeKeys:function(){var el=this.get('element');var keys=AttributeProvider.prototype.getAttributeKeys.call(this);for(var key in el){if(!this._configs[key]){keys[key]=keys[key]||el[key];}}return keys;},init:function(el,attr){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};attr=attr||{};attr.element=attr.element||el||null;this.DOM_EVENTS={'click':true,'keydown':true,'keypress':true,'keyup':true,'mousedown':true,'mousemove':true,'mouseout':true,'mouseover':true,'mouseup':true};var readyHandler=function(){this.initAttributes(attr);this.setAttributes(attr,true);this.fireQueue();this.fireEvent('contentReady',{type:'contentReady',target:attr.element});};if(Lang.isString(el)){_registerHTMLAttr(this,'id',{value:el});YAHOO.util.Event.onAvailable(el,function(){attr.element=Dom.get(el);this.fireEvent('available',{type:'available',target:attr.element});},this,true);YAHOO.util.Event.onContentReady(el,function(){readyHandler.call(this);},this,true);}else{readyHandler.call(this);}}};var _registerHTMLAttr=function(self,key,map){var el=self.get('element');map=map||{};map.name=key;map.method=map.method||function(value){el[key]=value;};map.value=map.value||el[key];self._configs[key]=new YAHOO.util.Attribute(map,self);};YAHOO.augment(YAHOO.util.Element,AttributeProvider);})();(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Lang=YAHOO.util.Lang;Tab=function(el,attr){attr=attr||{};if(arguments.length==1&&!Lang.isString(el)&&!el.nodeName){attr=el;el=attr.element;}if(!el&&!attr.element){el=_createTabElement.call(this,attr);}this.loadHandler={success:function(o){this.set('content',o.responseText);},failure:function(o){YAHOO.log('loading failed: '+o.statusText,'error','Tab');}};Tab.superclass.constructor.call(this,el,attr);this.DOM_EVENTS={};};YAHOO.extend(Tab,YAHOO.util.Element);var proto=Tab.prototype;proto.LABEL_TAGNAME='em';proto.ACTIVE_CLASSNAME='selected';proto.DISABLED_CLASSNAME='disabled';proto.LOADING_CLASSNAME='loading';proto.dataConnection=null;proto.loadHandler=null;proto.toString=function(){var el=this.get('element');var id=el.id||el.tagName;return"Tab "+id;};proto.initAttributes=function(attr){attr=attr||{};Tab.superclass.initAttributes.call(this,attr);var el=this.get('element');this.register('activationEvent',{value:attr.activationEvent||'click'});this.register('labelEl',{value:attr.labelEl||_getlabelEl.call(this),method:function(value){var current=this.get('labelEl');if(current){if(current==value){return false;}this.replaceChild(value,current);}else if(el.firstChild){this.insertBefore(value,el.firstChild);}else{this.appendChild(value);}}});this.register('label',{value:attr.label||_getLabel.call(this),method:function(value){var labelEl=this.get('labelEl');if(!labelEl){this.set('labelEl',_createlabelEl.call(this));}_setLabel.call(this,value);}});this.register('contentEl',{value:attr.contentEl||document.createElement('div'),method:function(value){var current=this.get('contentEl');if(current){if(current==value){return false;}this.replaceChild(value,current);}}});this.register('content',{value:attr.content,method:function(value){this.get('contentEl').innerHTML=value;}});var _dataLoaded=false;this.register('dataSrc',{value:attr.dataSrc});this.register('cacheData',{value:attr.cacheData||false,validator:Lang.isBoolean});this.register('loadMethod',{value:attr.loadMethod||'GET',validator:Lang.isString});this.register('dataLoaded',{value:false,validator:Lang.isBoolean,writeOnce:true});this.register('dataTimeout',{value:attr.dataTimeout||null,validator:Lang.isNumber});this.register('active',{value:attr.active||this.hasClass(this.ACTIVE_CLASSNAME),method:function(value){if(value===true){this.addClass(this.ACTIVE_CLASSNAME);this.set('title','active');}else{this.removeClass(this.ACTIVE_CLASSNAME);this.set('title','');}},validator:function(value){return Lang.isBoolean(value)&&!this.get('disabled');}});this.register('disabled',{value:attr.disabled||this.hasClass(this.DISABLED_CLASSNAME),method:function(value){if(value===true){Dom.addClass(this.get('element'),this.DISABLED_CLASSNAME);}else{Dom.removeClass(this.get('element'),this.DISABLED_CLASSNAME);}},validator:Lang.isBoolean});this.register('href',{value:attr.href||'#',method:function(value){this.getElementsByTagName('a')[0].href=value;},validator:Lang.isString});this.register('contentVisible',{value:attr.contentVisible,method:function(value){if(value==true){this.get('contentEl').style.display='block';if(this.get('dataSrc')){if(!this.get('dataLoaded')||!this.get('cacheData')){_dataConnect.call(this);}}}else{this.get('contentEl').style.display='none';}},validator:Lang.isBoolean});};var _createTabElement=function(attr){var el=document.createElement('li');var a=document.createElement('a');a.href=attr.href||'#';el.appendChild(a);var label=attr.label||null;var labelEl=attr.labelEl||null;if(labelEl){if(!label){label=_getLabel.call(this,labelEl);}}else{labelEl=_createlabelEl.call(this);}a.appendChild(labelEl);return el;};var _getlabelEl=function(){return this.getElementsByTagName(this.LABEL_TAGNAME)[0];};var _createlabelEl=function(){var el=document.createElement(this.LABEL_TAGNAME);return el;};var _setLabel=function(label){var el=this.get('labelEl');el.innerHTML=label;};var _getLabel=function(){var label,el=this.get('labelEl');if(!el){return undefined;}return el.innerHTML;};var _dataConnect=function(){if(!YAHOO.util.Connect){YAHOO.log('YAHOO.util.Connect dependency not met','error','Tab');return false;}Dom.addClass(this.get('contentEl').parentNode,this.LOADING_CLASSNAME);this.dataConnection=YAHOO.util.Connect.asyncRequest(this.get('loadMethod'),this.get('dataSrc'),{success:function(o){this.loadHandler.success.call(this,o);this.set('dataLoaded',true);this.dataConnection=null;Dom.removeClass(this.get('contentEl').parentNode,this.LOADING_CLASSNAME);},failure:function(o){this.loadHandler.failure.call(this,o);this.dataConnection=null;Dom.removeClass(this.get('contentEl').parentNode,this.LOADING_CLASSNAME);},scope:this,timeout:this.get('dataTimeout')});};YAHOO.widget.Tab=Tab;})();(function(){YAHOO.widget.TabView=function(el,attr){attr=attr||{};if(arguments.length==1&&!Lang.isString(el)&&!el.nodeName){attr=el;el=attr.element||null;}if(!el&&!attr.element){el=_createTabViewElement.call(this,attr);}YAHOO.widget.TabView.superclass.constructor.call(this,el,attr);};YAHOO.extend(YAHOO.widget.TabView,YAHOO.util.Element);var proto=YAHOO.widget.TabView.prototype;var Dom=YAHOO.util.Dom;var Lang=YAHOO.util.Lang;var Event=YAHOO.util.Event;var Tab=YAHOO.widget.Tab;proto.CLASSNAME='yui-navset';proto.TAB_PARENT_CLASSNAME='yui-nav';proto.CONTENT_PARENT_CLASSNAME='yui-content';proto._tabParent=null;proto._contentParent=null;proto.addTab=function(tab,index){var tabs=this.get('tabs');if(!tabs){this._queue[this._queue.length]=['addTab',arguments];return false;}index=(index===undefined)?tabs.length:index;var before=this.getTab(index);var self=this;var el=this.get('element');var tabParent=this._tabParent;var contentParent=this._contentParent;var tabElement=tab.get('element');var contentEl=tab.get('contentEl');if(before){tabParent.insertBefore(tabElement,before.get('element'));}else{tabParent.appendChild(tabElement);}if(contentEl&&!Dom.isAncestor(contentParent,contentEl)){contentParent.appendChild(contentEl);}if(!tab.get('active')){tab.set('contentVisible',false,true);}else{this.set('activeTab',tab,true);}var activate=function(e){YAHOO.util.Event.preventDefault(e);self.set('activeTab',this);};tab.addListener(tab.get('activationEvent'),activate);tab.addListener('activationEventChange',function(e){if(e.prevValue!=e.newValue){tab.removeListener(e.prevValue,activate);tab.addListener(e.newValue,activate);}});tabs.splice(index,0,tab);};proto.DOMEventHandler=function(e){var el=this.get('element');var target=YAHOO.util.Event.getTarget(e);var tabParent=this._tabParent;if(Dom.isAncestor(tabParent,target)){var tabEl;var tab=null;var contentEl;var tabs=this.get('tabs');for(var i=0,len=tabs.length;i<len;i++){tabEl=tabs[i].get('element');contentEl=tabs[i].get('contentEl');if(target==tabEl||Dom.isAncestor(tabEl,target)){tab=tabs[i];break;}}if(tab){tab.fireEvent(e.type,e);}}};proto.getTab=function(index){return this.get('tabs')[index];};proto.getTabIndex=function(tab){var index=null;var tabs=this.get('tabs');for(var i=0,len=tabs.length;i<len;++i){if(tab==tabs[i]){index=i;break;}}return index;};proto.removeTab=function(tab){var tabCount=this.get('tabs').length;var index=this.getTabIndex(tab);var nextIndex=index+1;if(tab==this.get('activeTab')){if(tabCount>1){if(index+1==tabCount){this.set('activeIndex',index-1);}else{this.set('activeIndex',index+1);}}}this._tabParent.removeChild(tab.get('element'));this._contentParent.removeChild(tab.get('contentEl'));this._configs.tabs.value.splice(index,1);};proto.toString=function(){var name=this.get('id')||this.get('tagName');return"TabView "+name;};proto.contentTransition=function(newTab,oldTab){newTab.set('contentVisible',true);oldTab.set('contentVisible',false);};proto.initAttributes=function(attr){YAHOO.widget.TabView.superclass.initAttributes.call(this,attr);if(!attr.orientation){attr.orientation='top';}var el=this.get('element');this.register('tabs',{value:[],readOnly:true});this._tabParent=this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,'ul')[0]||_createTabParent.call(this);this._contentParent=this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,'div')[0]||_createContentParent.call(this);this.register('orientation',{value:attr.orientation,method:function(value){var current=this.get('orientation');this.addClass('yui-navset-'+value);if(current!=value){this.removeClass('yui-navset-'+current);}switch(value){case'bottom':this.appendChild(this._tabParent);break;}}});this.register('activeIndex',{value:attr.activeIndex,method:function(value){this.set('activeTab',this.getTab(value));},validator:function(value){return!this.getTab(value).get('disabled');}});this.register('activeTab',{value:attr.activeTab,method:function(tab){var activeTab=this.get('activeTab');if(tab){tab.set('active',true);}if(activeTab&&activeTab!=tab){activeTab.set('active',false);}if(activeTab&&tab!=activeTab){this.contentTransition(tab,activeTab);}else if(tab){tab.set('contentVisible',true);}},validator:function(value){return!value.get('disabled');}});if(this._tabParent){_initTabs.call(this);}for(var type in this.DOM_EVENTS){if(this.DOM_EVENTS.hasOwnProperty(type)){this.addListener.call(this,type,this.DOMEventHandler);}}};var _initTabs=function(){var tab,attr,contentEl;var el=this.get('element');var tabs=_getChildNodes(this._tabParent);var contentElements=_getChildNodes(this._contentParent);for(var i=0,len=tabs.length;i<len;++i){attr={};if(contentElements[i]){attr.contentEl=contentElements[i];}tab=new YAHOO.widget.Tab(tabs[i],attr);this.addTab(tab);if(tab.hasClass(tab.ACTIVE_CLASSNAME)){this._configs.activeTab.value=tab;}}};var _createTabViewElement=function(attr){var el=document.createElement('div');if(this.CLASSNAME){el.className=this.CLASSNAME;}return el;};var _createTabParent=function(attr){var el=document.createElement('ul');if(this.TAB_PARENT_CLASSNAME){el.className=this.TAB_PARENT_CLASSNAME;}this.get('element').appendChild(el);return el;};var _createContentParent=function(attr){var el=document.createElement('div');if(this.CONTENT_PARENT_CLASSNAME){el.className=this.CONTENT_PARENT_CLASSNAME;}this.get('element').appendChild(el);return el;};var _getChildNodes=function(el){var nodes=[];var childNodes=el.childNodes;for(var i=0,len=childNodes.length;i<len;++i){if(childNodes[i].nodeType==1){nodes[nodes.length]=childNodes[i];}}return nodes;};})();
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.1 */\r
+(function(){YAHOO.util.Lang={isArray:function(val){if(val.constructor&&val.constructor.toString().indexOf('Array')>-1){return true;}else{return YAHOO.util.Lang.isObject(val)&&val.constructor==Array;}},isBoolean:function(val){return typeof val=='boolean';},isFunction:function(val){return typeof val=='function';},isNull:function(val){return val===null;},isNumber:function(val){return!isNaN(val);},isObject:function(val){return typeof val=='object'||YAHOO.util.Lang.isFunction(val);},isString:function(val){return typeof val=='string';},isUndefined:function(val){return typeof val=='undefined';}};})();YAHOO.util.Attribute=function(hash,owner){if(owner){this.owner=owner;this.configure(hash,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,validator:null,getValue:function(){return this.value;},setValue:function(value,silent){var beforeRetVal;var owner=this.owner;var name=this.name;var event={type:name,prevValue:this.getValue(),newValue:value};if(this.readOnly||(this.writeOnce&&this._written)){return false;}\r
+if(this.validator&&!this.validator.call(owner,value)){return false;}\r
+if(!silent){beforeRetVal=owner.fireBeforeChangeEvent(event);if(beforeRetVal===false){return false;}}\r
+if(this.method){this.method.call(owner,value);}\r
+this.value=value;this._written=true;event.type=name;if(!silent){this.owner.fireChangeEvent(event);}\r
+return true;},configure:function(map,init){map=map||{};this._written=false;this._initialConfig=this._initialConfig||{};for(var key in map){if(key&&map.hasOwnProperty(key)){this[key]=map[key];if(init){this._initialConfig[key]=map[key];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig);},refresh:function(silent){this.setValue(this.value,silent);}};(function(){var Lang=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(key){var configs=this._configs||{};var config=configs[key];if(!config){return undefined;}\r
+return config.value;},set:function(key,value,silent){var configs=this._configs||{};var config=configs[key];if(!config){return false;}\r
+return config.setValue(value,silent);},getAttributeKeys:function(){var configs=this._configs;var keys=[];var config;for(var key in configs){config=configs[key];if(configs.hasOwnProperty(key)&&!Lang.isUndefined(config)){keys[keys.length]=key;}}\r
+return keys;},setAttributes:function(map,silent){for(var key in map){if(map.hasOwnProperty(key)){this.set(key,map[key],silent);}}},resetValue:function(key,silent){var configs=this._configs||{};if(configs[key]){this.set(key,configs[key]._initialConfig.value,silent);return true;}\r
+return false;},refresh:function(key,silent){var configs=this._configs;key=((Lang.isString(key))?[key]:key)||this.getAttributeKeys();for(var i=0,len=key.length;i<len;++i){if(configs[key[i]]&&!Lang.isUndefined(configs[key[i]].value)&&!Lang.isNull(configs[key[i]].value)){configs[key[i]].refresh(silent);}}},register:function(key,map){this._configs=this._configs||{};if(this._configs[key]){return false;}\r
+map.name=key;this._configs[key]=new YAHOO.util.Attribute(map,this);return true;},getAttributeConfig:function(key){var configs=this._configs||{};var config=configs[key]||{};var map={};for(key in config){if(config.hasOwnProperty(key)){map[key]=config[key];}}\r
+return map;},configureAttribute:function(key,map,init){var configs=this._configs||{};if(!configs[key]){return false;}\r
+configs[key].configure(map,init);},resetAttributeConfig:function(key){var configs=this._configs||{};configs[key].resetConfig();},fireBeforeChangeEvent:function(e){var type='before';type+=e.type.charAt(0).toUpperCase()+e.type.substr(1)+'Change';e.type=type;return this.fireEvent(e.type,e);},fireChangeEvent:function(e){e.type+='Change';return this.fireEvent(e.type,e);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var Dom=YAHOO.util.Dom,Lang=YAHOO.util.Lang,EventPublisher=YAHOO.util.EventPublisher,AttributeProvider=YAHOO.util.AttributeProvider;YAHOO.util.Element=function(el,map){if(arguments.length){this.init(el,map);}};YAHOO.util.Element.prototype={DOM_EVENTS:null,appendChild:function(child){child=child.get?child.get('element'):child;this.get('element').appendChild(child);},getElementsByTagName:function(tag){return this.get('element').getElementsByTagName(tag);},hasChildNodes:function(){return this.get('element').hasChildNodes();},insertBefore:function(element,before){element=element.get?element.get('element'):element;before=(before&&before.get)?before.get('element'):before;this.get('element').insertBefore(element,before);},removeChild:function(child){child=child.get?child.get('element'):child;this.get('element').removeChild(child);return true;},replaceChild:function(newNode,oldNode){newNode=newNode.get?newNode.get('element'):newNode;oldNode=oldNode.get?oldNode.get('element'):oldNode;return this.get('element').replaceChild(newNode,oldNode);},initAttributes:function(map){map=map||{};var element=Dom.get(map.element)||null;this.register('element',{value:element,readOnly:true});},addListener:function(type,fn,obj,scope){var el=this.get('element');var scope=scope||this;el=this.get('id')||el;if(!this._events[type]){if(this.DOM_EVENTS[type]){YAHOO.util.Event.addListener(el,type,function(e){if(e.srcElement&&!e.target){e.target=e.srcElement;}\r
+this.fireEvent(type,e);},obj,scope);}\r
+this.createEvent(type,this);this._events[type]=true;}\r
+this.subscribe.apply(this,arguments);},on:function(){this.addListener.apply(this,arguments);},removeListener:function(type,fn){this.unsubscribe.apply(this,arguments);},addClass:function(className){Dom.addClass(this.get('element'),className);},getElementsByClassName:function(className,tag){return Dom.getElementsByClassName(className,tag,this.get('element'));},hasClass:function(className){return Dom.hasClass(this.get('element'),className);},removeClass:function(className){return Dom.removeClass(this.get('element'),className);},replaceClass:function(oldClassName,newClassName){return Dom.replaceClass(this.get('element'),oldClassName,newClassName);},setStyle:function(property,value){return Dom.setStyle(this.get('element'),property,value);},getStyle:function(property){return Dom.getStyle(this.get('element'),property);},fireQueue:function(){var queue=this._queue;for(var i=0,len=queue.length;i<len;++i){this[queue[i][0]].apply(this,queue[i][1]);}},appendTo:function(parent,before){parent=(parent.get)?parent.get('element'):Dom.get(parent);before=(before&&before.get)?before.get('element'):Dom.get(before);var element=this.get('element');var newAddition=!Dom.inDocument(element);if(!element){return false;}\r
+if(!parent){return false;}\r
+if(element.parent!=parent){if(before){parent.insertBefore(element,before);}else{parent.appendChild(element);}}\r
+if(!newAddition){return false;}\r
+var keys=this.getAttributeKeys();for(var key in keys){if(!Lang.isUndefined(element[key])){this.refresh(key);}}},get:function(key){var configs=this._configs||{};var el=configs.element;if(el&&!configs[key]&&!Lang.isUndefined(el.value[key])){return el.value[key];}\r
+return AttributeProvider.prototype.get.call(this,key);},set:function(key,value,silent){var el=this.get('element');if(!el){this._queue[this._queue.length]=['set',arguments];return false;}\r
+if(!this._configs[key]&&!Lang.isUndefined(el[key])){_registerHTMLAttr(this,key);}\r
+return AttributeProvider.prototype.set.apply(this,arguments);},register:function(key){var configs=this._configs||{};var element=this.get('element')||null;if(element&&!Lang.isUndefined(element[key])){return false;}\r
+return AttributeProvider.prototype.register.apply(this,arguments);},configureAttribute:function(property,map,init){if(!this._configs[property]&&this._configs.element&&!Lang.isUndefined(this._configs.element[property])){_registerHTMLAttr(this,property,map);return false;}\r
+return AttributeProvider.prototype.configure.apply(this,arguments);},getAttributeKeys:function(){var el=this.get('element');var keys=AttributeProvider.prototype.getAttributeKeys.call(this);for(var key in el){if(!this._configs[key]){keys[key]=keys[key]||el[key];}}\r
+return keys;},init:function(el,attr){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};attr=attr||{};attr.element=attr.element||el||null;this.DOM_EVENTS={'click':true,'keydown':true,'keypress':true,'keyup':true,'mousedown':true,'mousemove':true,'mouseout':true,'mouseover':true,'mouseup':true};var readyHandler=function(){this.initAttributes(attr);this.setAttributes(attr,true);this.fireQueue();this.fireEvent('contentReady',{type:'contentReady',target:attr.element});};if(Lang.isString(el)){_registerHTMLAttr(this,'id',{value:el});YAHOO.util.Event.onAvailable(el,function(){attr.element=Dom.get(el);this.fireEvent('available',{type:'available',target:attr.element});},this,true);YAHOO.util.Event.onContentReady(el,function(){readyHandler.call(this);},this,true);}else{readyHandler.call(this);}}};var _registerHTMLAttr=function(self,key,map){var el=self.get('element');map=map||{};map.name=key;map.method=map.method||function(value){el[key]=value;};map.value=map.value||el[key];self._configs[key]=new YAHOO.util.Attribute(map,self);};YAHOO.augment(YAHOO.util.Element,AttributeProvider);})();(function(){var Dom=YAHOO.util.Dom,Event=YAHOO.util.Event,Lang=YAHOO.util.Lang;Tab=function(el,attr){attr=attr||{};if(arguments.length==1&&!Lang.isString(el)&&!el.nodeName){attr=el;el=attr.element;}\r
+if(!el&&!attr.element){el=_createTabElement.call(this,attr);}\r
+this.loadHandler={success:function(o){this.set('content',o.responseText);},failure:function(o){}};Tab.superclass.constructor.call(this,el,attr);this.DOM_EVENTS={};};YAHOO.extend(Tab,YAHOO.util.Element);var proto=Tab.prototype;proto.LABEL_TAGNAME='em';proto.ACTIVE_CLASSNAME='selected';proto.DISABLED_CLASSNAME='disabled';proto.LOADING_CLASSNAME='loading';proto.dataConnection=null;proto.loadHandler=null;proto.toString=function(){var el=this.get('element');var id=el.id||el.tagName;return"Tab "+id;};proto.initAttributes=function(attr){attr=attr||{};Tab.superclass.initAttributes.call(this,attr);var el=this.get('element');this.register('activationEvent',{value:attr.activationEvent||'click'});this.register('labelEl',{value:attr.labelEl||_getlabelEl.call(this),method:function(value){var current=this.get('labelEl');if(current){if(current==value){return false;}\r
+this.replaceChild(value,current);}else if(el.firstChild){this.insertBefore(value,el.firstChild);}else{this.appendChild(value);}}});this.register('label',{value:attr.label||_getLabel.call(this),method:function(value){var labelEl=this.get('labelEl');if(!labelEl){this.set('labelEl',_createlabelEl.call(this));}\r
+_setLabel.call(this,value);}});this.register('contentEl',{value:attr.contentEl||document.createElement('div'),method:function(value){var current=this.get('contentEl');if(current){if(current==value){return false;}\r
+this.replaceChild(value,current);}}});this.register('content',{value:attr.content,method:function(value){this.get('contentEl').innerHTML=value;}});var _dataLoaded=false;this.register('dataSrc',{value:attr.dataSrc});this.register('cacheData',{value:attr.cacheData||false,validator:Lang.isBoolean});this.register('loadMethod',{value:attr.loadMethod||'GET',validator:Lang.isString});this.register('dataLoaded',{value:false,validator:Lang.isBoolean,writeOnce:true});this.register('dataTimeout',{value:attr.dataTimeout||null,validator:Lang.isNumber});this.register('active',{value:attr.active||this.hasClass(this.ACTIVE_CLASSNAME),method:function(value){if(value===true){this.addClass(this.ACTIVE_CLASSNAME);this.set('title','active');}else{this.removeClass(this.ACTIVE_CLASSNAME);this.set('title','');}},validator:function(value){return Lang.isBoolean(value)&&!this.get('disabled');}});this.register('disabled',{value:attr.disabled||this.hasClass(this.DISABLED_CLASSNAME),method:function(value){if(value===true){Dom.addClass(this.get('element'),this.DISABLED_CLASSNAME);}else{Dom.removeClass(this.get('element'),this.DISABLED_CLASSNAME);}},validator:Lang.isBoolean});this.register('href',{value:attr.href||'#',method:function(value){this.getElementsByTagName('a')[0].href=value;},validator:Lang.isString});this.register('contentVisible',{value:attr.contentVisible,method:function(value){if(value==true){this.get('contentEl').style.display='block';if(this.get('dataSrc')){if(!this.get('dataLoaded')||!this.get('cacheData')){_dataConnect.call(this);}}}else{this.get('contentEl').style.display='none';}},validator:Lang.isBoolean});};var _createTabElement=function(attr){var el=document.createElement('li');var a=document.createElement('a');a.href=attr.href||'#';el.appendChild(a);var label=attr.label||null;var labelEl=attr.labelEl||null;if(labelEl){if(!label){label=_getLabel.call(this,labelEl);}}else{labelEl=_createlabelEl.call(this);}\r
+a.appendChild(labelEl);return el;};var _getlabelEl=function(){return this.getElementsByTagName(this.LABEL_TAGNAME)[0];};var _createlabelEl=function(){var el=document.createElement(this.LABEL_TAGNAME);return el;};var _setLabel=function(label){var el=this.get('labelEl');el.innerHTML=label;};var _getLabel=function(){var label,el=this.get('labelEl');if(!el){return undefined;}\r
+return el.innerHTML;};var _dataConnect=function(){if(!YAHOO.util.Connect){return false;}\r
+Dom.addClass(this.get('contentEl').parentNode,this.LOADING_CLASSNAME);this.dataConnection=YAHOO.util.Connect.asyncRequest(this.get('loadMethod'),this.get('dataSrc'),{success:function(o){this.loadHandler.success.call(this,o);this.set('dataLoaded',true);this.dataConnection=null;Dom.removeClass(this.get('contentEl').parentNode,this.LOADING_CLASSNAME);},failure:function(o){this.loadHandler.failure.call(this,o);this.dataConnection=null;Dom.removeClass(this.get('contentEl').parentNode,this.LOADING_CLASSNAME);},scope:this,timeout:this.get('dataTimeout')});};YAHOO.widget.Tab=Tab;})();(function(){YAHOO.widget.TabView=function(el,attr){attr=attr||{};if(arguments.length==1&&!Lang.isString(el)&&!el.nodeName){attr=el;el=attr.element||null;}\r
+if(!el&&!attr.element){el=_createTabViewElement.call(this,attr);}\r
+YAHOO.widget.TabView.superclass.constructor.call(this,el,attr);};YAHOO.extend(YAHOO.widget.TabView,YAHOO.util.Element);var proto=YAHOO.widget.TabView.prototype;var Dom=YAHOO.util.Dom;var Lang=YAHOO.util.Lang;var Event=YAHOO.util.Event;var Tab=YAHOO.widget.Tab;proto.CLASSNAME='yui-navset';proto.TAB_PARENT_CLASSNAME='yui-nav';proto.CONTENT_PARENT_CLASSNAME='yui-content';proto._tabParent=null;proto._contentParent=null;proto.addTab=function(tab,index){var tabs=this.get('tabs');if(!tabs){this._queue[this._queue.length]=['addTab',arguments];return false;}\r
+index=(index===undefined)?tabs.length:index;var before=this.getTab(index);var self=this;var el=this.get('element');var tabParent=this._tabParent;var contentParent=this._contentParent;var tabElement=tab.get('element');var contentEl=tab.get('contentEl');if(before){tabParent.insertBefore(tabElement,before.get('element'));}else{tabParent.appendChild(tabElement);}\r
+if(contentEl&&!Dom.isAncestor(contentParent,contentEl)){contentParent.appendChild(contentEl);}\r
+if(!tab.get('active')){tab.set('contentVisible',false,true);}else{this.set('activeTab',tab,true);}\r
+var activate=function(e){YAHOO.util.Event.preventDefault(e);self.set('activeTab',this);};tab.addListener(tab.get('activationEvent'),activate);tab.addListener('activationEventChange',function(e){if(e.prevValue!=e.newValue){tab.removeListener(e.prevValue,activate);tab.addListener(e.newValue,activate);}});tabs.splice(index,0,tab);};proto.DOMEventHandler=function(e){var el=this.get('element');var target=YAHOO.util.Event.getTarget(e);var tabParent=this._tabParent;if(Dom.isAncestor(tabParent,target)){var tabEl;var tab=null;var contentEl;var tabs=this.get('tabs');for(var i=0,len=tabs.length;i<len;i++){tabEl=tabs[i].get('element');contentEl=tabs[i].get('contentEl');if(target==tabEl||Dom.isAncestor(tabEl,target)){tab=tabs[i];break;}}\r
+if(tab){tab.fireEvent(e.type,e);}}};proto.getTab=function(index){return this.get('tabs')[index];};proto.getTabIndex=function(tab){var index=null;var tabs=this.get('tabs');for(var i=0,len=tabs.length;i<len;++i){if(tab==tabs[i]){index=i;break;}}\r
+return index;};proto.removeTab=function(tab){var tabCount=this.get('tabs').length;var index=this.getTabIndex(tab);var nextIndex=index+1;if(tab==this.get('activeTab')){if(tabCount>1){if(index+1==tabCount){this.set('activeIndex',index-1);}else{this.set('activeIndex',index+1);}}}\r
+this._tabParent.removeChild(tab.get('element'));this._contentParent.removeChild(tab.get('contentEl'));this._configs.tabs.value.splice(index,1);};proto.toString=function(){var name=this.get('id')||this.get('tagName');return"TabView "+name;};proto.contentTransition=function(newTab,oldTab){newTab.set('contentVisible',true);oldTab.set('contentVisible',false);};proto.initAttributes=function(attr){YAHOO.widget.TabView.superclass.initAttributes.call(this,attr);if(!attr.orientation){attr.orientation='top';}\r
+var el=this.get('element');this.register('tabs',{value:[],readOnly:true});this._tabParent=this.getElementsByClassName(this.TAB_PARENT_CLASSNAME,'ul')[0]||_createTabParent.call(this);this._contentParent=this.getElementsByClassName(this.CONTENT_PARENT_CLASSNAME,'div')[0]||_createContentParent.call(this);this.register('orientation',{value:attr.orientation,method:function(value){var current=this.get('orientation');this.addClass('yui-navset-'+value);if(current!=value){this.removeClass('yui-navset-'+current);}\r
+switch(value){case'bottom':this.appendChild(this._tabParent);break;}}});this.register('activeIndex',{value:attr.activeIndex,method:function(value){this.set('activeTab',this.getTab(value));},validator:function(value){return!this.getTab(value).get('disabled');}});this.register('activeTab',{value:attr.activeTab,method:function(tab){var activeTab=this.get('activeTab');if(tab){tab.set('active',true);}\r
+if(activeTab&&activeTab!=tab){activeTab.set('active',false);}\r
+if(activeTab&&tab!=activeTab){this.contentTransition(tab,activeTab);}else if(tab){tab.set('contentVisible',true);}},validator:function(value){return!value.get('disabled');}});if(this._tabParent){_initTabs.call(this);}\r
+for(var type in this.DOM_EVENTS){if(this.DOM_EVENTS.hasOwnProperty(type)){this.addListener.call(this,type,this.DOMEventHandler);}}};var _initTabs=function(){var tab,attr,contentEl;var el=this.get('element');var tabs=_getChildNodes(this._tabParent);var contentElements=_getChildNodes(this._contentParent);for(var i=0,len=tabs.length;i<len;++i){attr={};if(contentElements[i]){attr.contentEl=contentElements[i];}\r
+tab=new YAHOO.widget.Tab(tabs[i],attr);this.addTab(tab);if(tab.hasClass(tab.ACTIVE_CLASSNAME)){this._configs.activeTab.value=tab;}}};var _createTabViewElement=function(attr){var el=document.createElement('div');if(this.CLASSNAME){el.className=this.CLASSNAME;}\r
+return el;};var _createTabParent=function(attr){var el=document.createElement('ul');if(this.TAB_PARENT_CLASSNAME){el.className=this.TAB_PARENT_CLASSNAME;}\r
+this.get('element').appendChild(el);return el;};var _createContentParent=function(attr){var el=document.createElement('div');if(this.CONTENT_PARENT_CLASSNAME){el.className=this.CONTENT_PARENT_CLASSNAME;}\r
+this.get('element').appendChild(el);return el;};var _getChildNodes=function(el){var nodes=[];var childNodes=el.childNodes;for(var i=0,len=childNodes.length;i<len;++i){if(childNodes[i].nodeType==1){nodes[nodes.length]=childNodes[i];}}\r
+return nodes;};})();
\ No newline at end of file
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
+version: 0.12.1\r
*/\r
+\r
(function() {\r
\r
YAHOO.util.Lang = {\r
if (!silent) {\r
beforeRetVal = owner.fireBeforeChangeEvent(event);\r
if (beforeRetVal === false) {\r
- YAHOO.log('setValue ' + name +\r
- 'cancelled by beforeChange event', 'info', 'Attribute');\r
return false;\r
}\r
}\r
var config = configs[key];\r
\r
if (!config) {\r
- YAHOO.log(key + ' not found', 'error', 'AttributeProvider');\r
return undefined;\r
}\r
\r
var config = configs[key];\r
\r
if (!config) {\r
- YAHOO.log('set failed: ' + key + ' not found',\r
- 'error', 'AttributeProvider');\r
return false;\r
}\r
\r
var configs = this._configs || {};\r
\r
if (!configs[key]) {\r
- YAHOO.log('unable to configure, ' + key + ' not found',\r
- 'error', 'AttributeProvider');\r
return false;\r
}\r
\r
var newAddition = !Dom.inDocument(element);\r
\r
if (!element) {\r
- YAHOO.log('appendTo failed: element not available',\r
- 'error', 'Element');\r
return false;\r
}\r
\r
if (!parent) {\r
- YAHOO.log('appendTo failed: parent not available',\r
- 'error', 'Element');\r
return false;\r
}\r
\r
}\r
}\r
\r
- YAHOO.log(element + 'appended to ' + parent);\r
\r
if (!newAddition) {\r
return false; // note return; no refresh if in document\r
set: function(key, value, silent) {\r
var el = this.get('element');\r
if (!el) {\r
- this._queue[key] = ['set', arguments];\r
+ this._queue[this._queue.length] = ['set', arguments];\r
return false;\r
}\r
\r
var element = this.get('element') || null;\r
\r
if ( element && !Lang.isUndefined(element[key]) ) {\r
- YAHOO.log(key + ' is reserved for ' + element,\r
- 'error', 'Element');\r
return false;\r
}\r
\r
*/\r
\r
YAHOO.augment(YAHOO.util.Element, AttributeProvider);\r
-})();(function() {\r
+})();\r
+(function() {\r
var Dom = YAHOO.util.Dom,\r
Event = YAHOO.util.Event,\r
Lang = YAHOO.util.Lang;\r
this.set('content', o.responseText);\r
},\r
failure: function(o) {\r
- YAHOO.log('loading failed: ' + o.statusText,\r
- 'error', 'Tab');\r
}\r
};\r
\r
\r
var _dataConnect = function() {\r
if (!YAHOO.util.Connect) {\r
- YAHOO.log('YAHOO.util.Connect dependency not met',\r
- 'error', 'Tab');\r
return false;\r
}\r
\r
TreeView - Release Notes\r
\r
+0.12.1\r
+\r
+ * Added custom events for expandComplete and collapseComplete. These events are\r
+ needed in situations where the implementer needs to resize or reposition \r
+ something based on the new offset.\r
+\r
+ * Added a "nowrap" property to Node, and set the default to false. Specifies\r
+ whether or not the content area of the node should be allowed to wrap\r
+ naturally.\r
+\r
+ * Added additional HTML elements to preserve the tree presentation when constrained\r
+ by a parent element.\r
+\r
0.12.0\r
\r
* TreeView now augments EventProvider, and has custom events for expand,\r
-/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */\r
+/*\r
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
+Code licensed under the BSD License:\r
+http://developer.yahoo.net/yui/license.txt\r
+version: 0.12.1\r
+*/\r
\r
/* first or middle sibling, no children */\r
.ygtvtn {\r
- width:16px; height:22px; \r
- background: url(tn.gif) 0 0 no-repeat; \r
+ width:16px; height:22px;\r
+ background: url(tn.gif) 0 0 no-repeat;\r
}\r
\r
/* first or middle sibling, collapsable */\r
.ygtvtm {\r
- width:16px; height:22px; \r
+ width:16px; height:22px;\r
cursor:pointer ;\r
- background: url(tm.gif) 0 0 no-repeat; \r
+ background: url(tm.gif) 0 0 no-repeat;\r
}\r
\r
/* first or middle sibling, collapsable, hover */\r
.ygtvtmh {\r
- width:16px; height:22px; \r
+ width:16px; height:22px;\r
cursor:pointer ;\r
- background: url(tmh.gif) 0 0 no-repeat; \r
+ background: url(tmh.gif) 0 0 no-repeat;\r
}\r
\r
/* first or middle sibling, expandable */\r
.ygtvtp {\r
- width:16px; height:22px; \r
+ width:16px; height:22px;\r
cursor:pointer ;\r
- background: url(tp.gif) 0 0 no-repeat; \r
+ background: url(tp.gif) 0 0 no-repeat;\r
}\r
\r
/* first or middle sibling, expandable, hover */\r
.ygtvtph {\r
- width:16px; height:22px; \r
+ width:16px; height:22px;\r
cursor:pointer ;\r
- background: url(tph.gif) 0 0 no-repeat; \r
+ background: url(tph.gif) 0 0 no-repeat;\r
}\r
\r
/* last sibling, no children */\r
.ygtvln {\r
- width:16px; height:22px; \r
- background: url(ln.gif) 0 0 no-repeat; \r
+ width:16px; height:22px;\r
+ background: url(ln.gif) 0 0 no-repeat;\r
}\r
\r
/* Last sibling, collapsable */\r
.ygtvlm {\r
- width:16px; height:22px; \r
+ width:16px; height:22px;\r
cursor:pointer ;\r
- background: url(lm.gif) 0 0 no-repeat; \r
+ background: url(lm.gif) 0 0 no-repeat;\r
}\r
\r
/* Last sibling, collapsable, hover */\r
.ygtvlmh {\r
- width:16px; height:22px; \r
+ width:16px; height:22px;\r
cursor:pointer ;\r
- background: url(lmh.gif) 0 0 no-repeat; \r
+ background: url(lmh.gif) 0 0 no-repeat;\r
}\r
\r
/* Last sibling, expandable */\r
-.ygtvlp { \r
- width:16px; height:22px; \r
+.ygtvlp {\r
+ width:16px; height:22px;\r
cursor:pointer ;\r
- background: url(lp.gif) 0 0 no-repeat; \r
+ background: url(lp.gif) 0 0 no-repeat;\r
}\r
\r
/* Last sibling, expandable, hover */\r
-.ygtvlph { \r
+.ygtvlph {\r
width:16px; height:22px; cursor:pointer ;\r
- background: url(lph.gif) 0 0 no-repeat; \r
+ background: url(lph.gif) 0 0 no-repeat;\r
}\r
\r
/* Loading icon */\r
-.ygtvloading { \r
- width:16px; height:22px; \r
- background: url(loading.gif) 0 0 no-repeat; \r
+.ygtvloading {\r
+ width:16px; height:22px;\r
+ background: url(loading.gif) 0 0 no-repeat;\r
}\r
\r
-/* the style for the empty cells that are used for rendering the depth \r
+/* the style for the empty cells that are used for rendering the depth\r
* of the node */\r
-.ygtvdepthcell { \r
- width:16px; height:22px; \r
- background: url(vline.gif) 0 0 no-repeat; \r
+.ygtvdepthcell {\r
+ width:16px; height:22px;\r
+ background: url(vline.gif) 0 0 no-repeat;\r
}\r
\r
.ygtvblankdepthcell { width:16px; height:22px; }\r
\r
/* the style of the div around each node */\r
-.ygtvitem { } \r
+.ygtvitem { }\r
\r
/* the style of the div around each node's collection of children */\r
-.ygtvchildren { } \r
-* html .ygtvchildren { height:2%; } \r
+.ygtvchildren { }\r
+* html .ygtvchildren { height:2%; }\r
\r
/* the style of the text label in ygTextNode */\r
-.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover { \r
+.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover {\r
margin-left:2px;\r
text-decoration: none;\r
}\r
-/*\r
+/* \r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
-*/\r
-\r
+version: 0.12.1\r
+*/ \r
/**\r
* The treeview widget is a generic tree building tool.\r
* @module treeview\r
* Contains the tree view state data and the root node.\r
*\r
* @class TreeView\r
+ * @uses YAHOO.util.EventProvider\r
* @constructor\r
* @param {string|HTMLElement} id The id of the element, or the element\r
* itself that the tree will be inserted into.\r
/**\r
* Sets up the animation for expanding children\r
* @method setExpandAnim\r
- * @param {string} type the type of animation (acceptable values defined\r
+ * @param {string} type the type of animation (acceptable values defined \r
* in YAHOO.widget.TVAnim)\r
*/\r
setExpandAnim: function(type) {\r
/**\r
* Sets up the animation for collapsing children\r
* @method setCollapseAnim\r
- * @param {string} the type of animation (acceptable values defined in\r
+ * @param {string} the type of animation (acceptable values defined in \r
* YAHOO.widget.TVAnim)\r
*/\r
setCollapseAnim: function(type) {\r
if (this._expandAnim && this._animCount < this.maxAnim) {\r
// this.locked = true;\r
var tree = this;\r
- var a = YAHOO.widget.TVAnim.getAnim(this._expandAnim, el,\r
+ var a = YAHOO.widget.TVAnim.getAnim(this._expandAnim, el, \r
function() { tree.expandComplete(node); });\r
- if (a) {\r
+ if (a) { \r
++this._animCount;\r
this.fireEvent("animStart", {\r
- "node": node,\r
+ "node": node, \r
"type": "expand"\r
});\r
a.animate();\r
if (this._collapseAnim && this._animCount < this.maxAnim) {\r
// this.locked = true;\r
var tree = this;\r
- var a = YAHOO.widget.TVAnim.getAnim(this._collapseAnim, el,\r
+ var a = YAHOO.widget.TVAnim.getAnim(this._collapseAnim, el, \r
function() { tree.collapseComplete(node); });\r
- if (a) {\r
+ if (a) { \r
++this._animCount;\r
this.fireEvent("animStart", {\r
- "node": node,\r
+ "node": node, \r
"type": "collapse"\r
});\r
a.animate();\r
this.logger.log("expand complete: " + this.id);\r
--this._animCount;\r
this.fireEvent("animComplete", {\r
- "node": node,\r
+ "node": node, \r
"type": "expand"\r
});\r
// this.locked = false;\r
this.logger.log("collapse complete: " + this.id);\r
--this._animCount;\r
this.fireEvent("animComplete", {\r
- "node": node,\r
+ "node": node, \r
"type": "collapse"\r
});\r
// this.locked = false;\r
this.createEvent("animComplete", this);\r
\r
/**\r
- * Fires when a node is going to be expanded. Return false to stop\r
- * the expand.\r
+ * Fires when a node is going to be collapsed. Return false to stop\r
+ * the collapse.\r
* @event collapse\r
* @type CustomEvent\r
- * @param {YAHOO.widget.Node} node the node that is expanding/collapsing\r
+ * @param {YAHOO.widget.Node} node the node that is collapsing\r
*/\r
this.createEvent("collapse", this);\r
\r
/**\r
- * Fires when a node is going to be collapsed. Return false to stop\r
+ * Fires after a node is successfully collapsed. This event will not fire\r
+ * if the "collapse" event was cancelled.\r
+ * @event collapseComplete\r
+ * @type CustomEvent\r
+ * @param {YAHOO.widget.Node} node the node that was collapsed\r
+ */\r
+ this.createEvent("collapseComplete", this);\r
+\r
+ /**\r
+ * Fires when a node is going to be expanded. Return false to stop\r
* the collapse.\r
* @event expand\r
* @type CustomEvent\r
- * @param {YAHOO.widget.Node} node the node that is expanding/collapsing\r
+ * @param {YAHOO.widget.Node} node the node that is expanding\r
*/\r
this.createEvent("expand", this);\r
\r
+ /**\r
+ * Fires after a node is successfully expanded. This event will not fire\r
+ * if the "expand" event was cancelled.\r
+ * @event expandComplete\r
+ * @type CustomEvent\r
+ * @param {YAHOO.widget.Node} node the node that was expanded\r
+ */\r
+ this.createEvent("expandComplete", this);\r
+\r
this._nodes = [];\r
\r
// store a global reference\r
this.logger = new YAHOO.widget.LogWriter(this.toString());\r
\r
this.logger.log("tree init: " + this.id);\r
+\r
+ //YAHOO.util.Event.onContentReady(this.id, this.handleAvailable, this, true);\r
+ YAHOO.util.Event.on(this.id, "click", this.handleClick, this, true);\r
},\r
\r
+\r
+ //handleAvailable: function() {\r
+ //var Event = YAHOO.util.Event;\r
+ //Event.on(this.id, \r
+ //},\r
+\r
/**\r
* Renders the tree boilerplate and visible nodes\r
* @method draw\r
* @method setDynamicLoad\r
* @param {function} fnDataLoader the function that will be called to get the data\r
* @param iconMode {int} configures the icon that is displayed when a dynamic\r
- * load node is expanded the first time without children. By default, the\r
+ * load node is expanded the first time without children. By default, the \r
* "collapse" icon will be used. If set to 1, the leaf node icon will be\r
* displayed.\r
*/\r
- setDynamicLoad: function(fnDataLoader, iconMode) {\r
+ setDynamicLoad: function(fnDataLoader, iconMode) { \r
this.root.setDynamicLoad(fnDataLoader, iconMode);\r
},\r
\r
* will be expanded.\r
* @method expandAll\r
*/\r
- expandAll: function() {\r
+ expandAll: function() { \r
if (!this.locked) {\r
- this.root.expandAll();\r
+ this.root.expandAll(); \r
}\r
},\r
\r
* Collapses all expanded child nodes in the entire tree.\r
* @method collapseAll\r
*/\r
- collapseAll: function() {\r
+ collapseAll: function() { \r
if (!this.locked) {\r
- this.root.collapseAll();\r
+ this.root.collapseAll(); \r
}\r
},\r
\r
},\r
\r
/**\r
- * Returns a collection of nodes that have a matching property\r
- * and value in the data object that was passed into its constructor.\r
+ * Returns a collection of nodes that have a matching property \r
+ * and value in the data object that was passed into its constructor. \r
* @method getNodesByProperty\r
* @param {object} property the property to search (usually a string)\r
* @param {object} value the value we want to find (usuall an int or string)\r
},\r
\r
/**\r
- * Removes the node and its children, and optionally refreshes the\r
+ * Removes the node and its children, and optionally refreshes the \r
* branch of the tree that was affected.\r
* @method removeNode\r
* @param {Node} The node to remove\r
* @param {boolean} autoRefresh automatically refreshes branch if true\r
* @return {boolean} False is there was a problem, true otherwise.\r
*/\r
- removeNode: function(node, autoRefresh) {\r
+ removeNode: function(node, autoRefresh) { \r
\r
// Don't delete the root node\r
if (node.isRoot()) {\r
* @method removeChildren\r
* @param {Node} node the node to purge\r
*/\r
- removeChildren: function(node) {\r
+ removeChildren: function(node) { \r
this.logger.log("Removing children for " + node);\r
while (node.children.length) {\r
this._deleteNode(node.children[0]);\r
* @method _deleteNode\r
* @private\r
*/\r
- _deleteNode: function(node) {\r
+ _deleteNode: function(node) { \r
// Remove all the child nodes first\r
this.removeChildren(node);\r
\r
},\r
\r
/**\r
- * Removes the node from the tree, preserving the child collection\r
- * to make it possible to insert the branch into another part of the\r
+ * Removes the node from the tree, preserving the child collection \r
+ * to make it possible to insert the branch into another part of the \r
* tree, or another tree.\r
* @method popNode\r
* @param {Node} the node to remove\r
*/\r
- popNode: function(node) {\r
+ popNode: function(node) { \r
var p = node.parent;\r
\r
// Update the parent's collection of children\r
node.nextSibling = null;\r
node.tree = null;\r
\r
- // Update the tree's node collection\r
+ // Update the tree's node collection \r
delete this._nodes[node.index];\r
},\r
\r
var styles = ["tn","tm","tmh","tp","tph","ln","lm","lmh","lp","lph","loading"];\r
\r
var sb = [];\r
-\r
- for (var i = 0; i < styles.length; ++i) {\r
+ \r
+ for (var i = 0; i < styles.length; ++i) { \r
sb[sb.length] = '<span class="' + prefix + styles[i] + '"> </span>';\r
}\r
\r
\r
document.body.appendChild(f);\r
\r
- YAHOO.widget.TreeView.removeHandler(window,\r
+ YAHOO.widget.TreeView.removeHandler(window, \r
"load", YAHOO.widget.TreeView.preload);\r
\r
};\r
\r
-YAHOO.widget.TreeView.addHandler(window,\r
+YAHOO.widget.TreeView.addHandler(window, \r
"load", YAHOO.widget.TreeView.preload);\r
\r
/**\r
* response to mouse events is handled in Node subclasses.\r
* @namespace YAHOO.widget\r
* @class Node\r
+ * @uses YAHOO.util.EventProvider\r
* @param oData {object} a string or object containing the data that will\r
* be used to render this node\r
* @param oParent {Node} this node's parent node\r
/**\r
* This node's child node collection.\r
* @property children\r
- * @type Node[]\r
+ * @type Node[] \r
*/\r
children: null,\r
\r
\r
/**\r
* Should we render children for a collapsed node? It is possible that the\r
- * implementer will want to render the hidden data... @todo verify that we\r
+ * implementer will want to render the hidden data... @todo verify that we \r
* need this, and implement it if we do.\r
* @property renderHidden\r
* @type boolean\r
*/\r
iconMode: 0,\r
\r
+ /**\r
+ * Specifies whether or not the content area of the node should be allowed\r
+ * to wrap.\r
+ * @property nowrap\r
+ * @type boolean\r
+ * @default true\r
+ */\r
+ nowrap: false,\r
+\r
/**\r
* The node type\r
* @property _type\r
* The parentChange event is fired when a parent element is applied\r
* to the node. This is useful if you need to apply tree-level\r
* properties to a tree that need to happen if a node is moved from\r
- * one tre to another.\r
+ * one tree to another.\r
*\r
* @event parentChange\r
* @type CustomEvent\r
\r
return this;\r
},\r
-\r
+ \r
/**\r
* Inserts this node after the supplied node\r
* @method insertAfter\r
* Returns true if the Node is a child of supplied Node\r
* @method isChildOf\r
* @param parentNode {Node} the Node to check\r
- * @return {boolean} The node index if this Node is a child of\r
+ * @return {boolean} The node index if this Node is a child of \r
* supplied Node, else -1.\r
* @private\r
*/\r
/*\r
getSpacerId: function() {\r
return "ygtvspacer" + this.index;\r
- },\r
+ }, \r
*/\r
\r
/**\r
* @return {string} the javascript url for toggling this node\r
*/\r
getToggleLink: function() {\r
- return "YAHOO.widget.TreeView.getNode(\'" + this.tree.id + "\'," +\r
+ return "YAHOO.widget.TreeView.getNode(\'" + this.tree.id + "\'," + \r
this.index + ").toggle()";\r
},\r
\r
\r
if (!this.getEl()) {\r
this.expanded = false;\r
- return;\r
- }\r
-\r
- // hide the child div\r
- this.hideChildren();\r
- this.expanded = false;\r
+ } else {\r
+ // hide the child div\r
+ this.hideChildren();\r
+ this.expanded = false;\r
\r
- this.updateIcon();\r
+ this.updateIcon();\r
+ }\r
\r
// this.getSpacer().title = this.getStateText();\r
\r
+ ret = this.tree.fireEvent("collapseComplete", this);\r
+\r
},\r
\r
/**\r
this.logger.log("Expand was stopped by the abstract onExpand");\r
return;\r
}\r
-\r
+ \r
ret = this.tree.fireEvent("expand", this);\r
\r
if (false === ret) {\r
if (! this.multiExpand) {\r
var sibs = this.getSiblings();\r
for (var i=0; i<sibs.length; ++i) {\r
- if (sibs[i] != this && sibs[i].expanded) {\r
- sibs[i].collapse();\r
+ if (sibs[i] != this && sibs[i].expanded) { \r
+ sibs[i].collapse(); \r
}\r
}\r
}\r
\r
this.showChildren();\r
+\r
+ ret = this.tree.fireEvent("expandComplete", this);\r
},\r
\r
updateIcon: function() {\r
* @return {string} the css class hover state\r
* @method getHoverStyle\r
*/\r
- getHoverStyle: function() {\r
+ getHoverStyle: function() { \r
var s = this.getStyle();\r
- if (this.hasChildren(true) && !this.isLoading) {\r
- s += "h";\r
+ if (this.hasChildren(true) && !this.isLoading) { \r
+ s += "h"; \r
}\r
return s;\r
},\r
* Recursively expands all of this node's children.\r
* @method expandAll\r
*/\r
- expandAll: function() {\r
+ expandAll: function() { \r
for (var i=0;i<this.children.length;++i) {\r
var c = this.children[i];\r
if (c.isDynamic()) {\r
* Recursively collapses all of this node's children.\r
* @method collapseAll\r
*/\r
- collapseAll: function() {\r
+ collapseAll: function() { \r
for (var i=0;i<this.children.length;++i) {\r
this.children[i].collapse();\r
this.children[i].collapseAll();\r
* @method setDynamicLoad\r
* @param fmDataLoader {function} the function that will be used to get the data.\r
* @param iconMode {int} configures the icon that is displayed when a dynamic\r
- * load node is expanded the first time without children. By default, the\r
+ * load node is expanded the first time without children. By default, the \r
* "collapse" icon will be used. If set to 1, the leaf node icon will be\r
* displayed.\r
*/\r
- setDynamicLoad: function(fnDataLoader, iconMode) {\r
+ setDynamicLoad: function(fnDataLoader, iconMode) { \r
if (fnDataLoader) {\r
this.dataLoader = fnDataLoader;\r
this._dynLoad = true;\r
* @method isRoot\r
* @return {boolean} true if this is the root node\r
*/\r
- isRoot: function() {\r
+ isRoot: function() { \r
return (this == this.tree.root);\r
},\r
\r
* @method isDynamic\r
* @return {boolean} true if this node's children are to be loaded dynamically\r
*/\r
- isDynamic: function() {\r
+ isDynamic: function() { \r
var lazy = (!this.isRoot() && (this._dynLoad || this.tree.root._dynLoad));\r
// this.logger.log("isDynamic: " + lazy);\r
return lazy;\r
* Checks if this node has children. If this node is lazy-loading and the\r
* children have not been rendered, we do not know whether or not there\r
* are actual children. In most cases, we need to assume that there are\r
- * children (for instance, the toggle needs to show the expandable\r
+ * children (for instance, the toggle needs to show the expandable \r
* presentation state). In other times we want to know if there are rendered\r
* children. For the latter, "checkForLazyLoad" should be false.\r
* @method hasChildren\r
* @return {boolean} true if this has children or if it might and we are\r
* checking for this condition.\r
*/\r
- hasChildren: function(checkForLazyLoad) {\r
- return ( this.children.length > 0 ||\r
+ hasChildren: function(checkForLazyLoad) { \r
+ return ( this.children.length > 0 || \r
(checkForLazyLoad && this.isDynamic() && !this.dynamicLoadComplete) );\r
},\r
\r
if (this.dataLoader) {\r
this.logger.log("Using dynamic loader defined for this node");\r
\r
- setTimeout(\r
+ setTimeout( \r
function() {\r
- node.dataLoader(node,\r
- function() {\r
- node.loadComplete();\r
+ node.dataLoader(node, \r
+ function() { \r
+ node.loadComplete(); \r
});\r
}, 10);\r
-\r
+ \r
} else if (this.tree.root.dataLoader) {\r
this.logger.log("Using the tree-level dynamic loader");\r
\r
- setTimeout(\r
+ setTimeout( \r
function() {\r
- node.tree.root.dataLoader(node,\r
- function() {\r
- node.loadComplete();\r
+ node.tree.root.dataLoader(node, \r
+ function() { \r
+ node.loadComplete(); \r
});\r
}, 10);\r
\r
// this.children[i].childrenRendered = false;\r
sb[sb.length] = this.children[i].getHtml();\r
}\r
-\r
+ \r
this.childrenRendered = true;\r
\r
return sb.join("");\r
}\r
\r
var p = this.parent;\r
-\r
+ \r
while (p.depth > depth) {\r
p = p.parent;\r
}\r
* @return {string} the css class for the spacer\r
*/\r
getDepthStyle: function(depth) {\r
- return (this.getAncestor(depth).nextSibling) ?\r
+ return (this.getAncestor(depth).nextSibling) ? \r
"ygtvdepthcell" : "ygtvblankdepthcell";\r
},\r
\r
* @method getNodeHtml\r
* @return {string} The HTML that will render this node.\r
*/\r
- getNodeHtml: function() {\r
+ getNodeHtml: function() { \r
this.logger.log("Generating html");\r
- return "";\r
+ return ""; \r
},\r
\r
/**\r
YAHOO.augment(YAHOO.widget.Node, YAHOO.util.EventProvider);\r
\r
/**\r
- * A custom YAHOO.widget.Node that handles the unique nature of\r
+ * A custom YAHOO.widget.Node that handles the unique nature of \r
* the virtual, presentationless root node.\r
* @namespace YAHOO.widget\r
* @class RootNode\r
// special case where the node has no presentation. So we have\r
// to alter the standard properties a bit.\r
this.init(null, null, true);\r
-\r
+ \r
/*\r
* For the root node, we get the tree reference from as a param\r
* to the constructor instead of from the parent element.\r
};\r
\r
YAHOO.extend(YAHOO.widget.RootNode, YAHOO.widget.Node, {\r
-\r
+ \r
// overrides YAHOO.widget.Node\r
- getNodeHtml: function() {\r
- return "";\r
+ getNodeHtml: function() { \r
+ return ""; \r
},\r
\r
- toString: function() {\r
+ toString: function() { \r
return "RootNode";\r
},\r
\r
- loadComplete: function() {\r
+ loadComplete: function() { \r
this.tree.draw();\r
}\r
\r
*/\r
YAHOO.widget.TextNode = function(oData, oParent, expanded) {\r
\r
- if (oData) {\r
+ if (oData) { \r
this.init(oData, oParent, expanded);\r
this.setUpLabel(oData);\r
}\r
};\r
\r
YAHOO.extend(YAHOO.widget.TextNode, YAHOO.widget.Node, {\r
-\r
+ \r
/**\r
* The CSS class for the label href. Defaults to ygtvlabel, but can be\r
* overridden to provide a custom presentation for a specific node.\r
label: null,\r
\r
textNodeParentChange: function() {\r
-\r
+ \r
/**\r
* Custom event that is fired when the text node label is clicked. The\r
* custom event is defined on the tree instance, so there is a single\r
- * event that handles all nodes in the tree. The node clicked is\r
+ * event that handles all nodes in the tree. The node clicked is \r
* provided as an argument\r
*\r
* @event labelClick\r
if (this.tree && !this.tree.hasEvent("labelClick")) {\r
this.tree.createEvent("labelClick", this.tree);\r
}\r
-\r
+ \r
},\r
\r
/**\r
* @method setUpLabel\r
* @param oData string containing the label, or an object with a label property\r
*/\r
- setUpLabel: function(oData) {\r
-\r
+ setUpLabel: function(oData) { \r
+ \r
// set up the custom event on the tree\r
this.textNodeParentChange();\r
this.subscribe("parentChange", this.textNodeParentChange);\r
oData = { label: oData };\r
}\r
this.label = oData.label;\r
-\r
+ \r
// update the link\r
if (oData.href) {\r
this.href = oData.href;\r
* @method getLabelEl\r
* @return {object} the element\r
*/\r
- getLabelEl: function() {\r
+ getLabelEl: function() { \r
return document.getElementById(this.labelElId);\r
},\r
\r
// overrides YAHOO.widget.Node\r
- getNodeHtml: function() {\r
+ getNodeHtml: function() { \r
this.logger.log("Generating html");\r
var sb = [];\r
\r
sb[sb.length] = '<table border="0" cellpadding="0" cellspacing="0">';\r
sb[sb.length] = '<tr>';\r
-\r
+ \r
for (var i=0;i<this.depth;++i) {\r
- // sb[sb.length] = '<td class="ygtvdepthcell"> </td>';\r
- sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '"> </td>';\r
+ //sb[sb.length] = '<td><div class="' + this.getDepthStyle(i) + '"> </div></td>';\r
+ //sb[sb.length] = '<td><div class="' + this.getDepthStyle(i) + '"></div></td>';\r
+ sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '"><div class="ygtvspacer"></div></td>';\r
}\r
\r
var getNode = 'YAHOO.widget.TreeView.getNode(\'' +\r
}\r
sb[sb.length] = ' onclick="javascript:' + this.getToggleLink() + '">';\r
\r
+ sb[sb.length] = '<div class="ygtvspacer">';\r
+\r
/*\r
sb[sb.length] = '<img id="' + this.getSpacerId() + '"';\r
sb[sb.length] = ' alt=""';\r
sb[sb.length] = ' />';\r
*/\r
\r
- sb[sb.length] = ' ';\r
+ //sb[sb.length] = ' ';\r
\r
+ sb[sb.length] = '</div>';\r
sb[sb.length] = '</td>';\r
- sb[sb.length] = '<td>';\r
+ sb[sb.length] = '<td ';\r
+ sb[sb.length] = (this.nowrap) ? ' nowrap="nowrap" ' : '';\r
+ sb[sb.length] = ' >';\r
sb[sb.length] = '<a';\r
sb[sb.length] = ' id="' + this.labelElId + '"';\r
sb[sb.length] = ' class="' + this.labelStyle + '"';\r
* @scope the anchor tag clicked\r
* @return false to cancel the anchor click\r
*/\r
- onLabelClick: function(me) {\r
+ onLabelClick: function(me) { \r
me.logger.log("onLabelClick " + me.label);\r
return me.tree.fireEvent("labelClick", me);\r
//return true;\r
},\r
\r
- toString: function() {\r
+ toString: function() { \r
return "TextNode (" + this.index + ") " + this.label;\r
}\r
\r
});\r
/**\r
- * A menu-specific implementation that differs from TextNode in that only\r
+ * A menu-specific implementation that differs from TextNode in that only \r
* one sibling can be expanded at a time.\r
* @namespace YAHOO.widget\r
* @class MenuNode\r
* @constructor\r
*/\r
YAHOO.widget.MenuNode = function(oData, oParent, expanded) {\r
- if (oData) {\r
+ if (oData) { \r
this.init(oData, oParent, expanded);\r
this.setUpLabel(oData);\r
}\r
\r
YAHOO.extend(YAHOO.widget.MenuNode, YAHOO.widget.TextNode, {\r
\r
- toString: function() {\r
+ toString: function() { \r
return "MenuNode (" + this.index + ") " + this.label;\r
}\r
\r
* have an icon\r
*/\r
YAHOO.widget.HTMLNode = function(oData, oParent, expanded, hasIcon) {\r
- if (oData) {\r
+ if (oData) { \r
this.init(oData, oParent, expanded);\r
this.initContent(oData, hasIcon);\r
}\r
YAHOO.extend(YAHOO.widget.HTMLNode, YAHOO.widget.Node, {\r
\r
/**\r
- * The CSS class for the html content container. Defaults to ygtvhtml, but\r
+ * The CSS class for the html content container. Defaults to ygtvhtml, but \r
* can be overridden to provide a custom presentation for a specific node.\r
* @property contentStyle\r
* @type string\r
* @param {boolean} hasIcon determines if the node will be rendered with an\r
* icon or not\r
*/\r
- initContent: function(oData, hasIcon) {\r
+ initContent: function(oData, hasIcon) { \r
if (typeof oData == "string") {\r
oData = { html: oData };\r
}\r
* @method getContentEl\r
* @return {HTMLElement} the element\r
*/\r
- getContentEl: function() {\r
+ getContentEl: function() { \r
return document.getElementById(this.contentElId);\r
},\r
\r
// overrides YAHOO.widget.Node\r
- getNodeHtml: function() {\r
+ getNodeHtml: function() { \r
this.logger.log("Generating html");\r
var sb = [];\r
\r
sb[sb.length] = '<table border="0" cellpadding="0" cellspacing="0">';\r
sb[sb.length] = '<tr>';\r
-\r
+ \r
for (var i=0;i<this.depth;++i) {\r
- sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '"> </td>';\r
+ //sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '"> </td>';\r
+ sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '"><div class="ygtvspacer"></div></td>';\r
}\r
\r
if (this.hasIcon) {\r
sb[sb.length] = 'YAHOO.widget.TreeView.getNode(\'';\r
sb[sb.length] = this.tree.id + '\',' + this.index + ').getStyle()"';\r
}\r
- sb[sb.length] = '> </td>';\r
+ //sb[sb.length] = '> </td>';\r
+ sb[sb.length] = '><div class="ygtvspacer"></div></td>';\r
}\r
\r
sb[sb.length] = '<td';\r
sb[sb.length] = ' id="' + this.contentElId + '"';\r
sb[sb.length] = ' class="' + this.contentStyle + '"';\r
+ sb[sb.length] = (this.nowrap) ? ' nowrap="nowrap" ' : '';\r
sb[sb.length] = ' >';\r
sb[sb.length] = this.html;\r
sb[sb.length] = '</td>';\r
return sb.join("");\r
},\r
\r
- toString: function() {\r
+ toString: function() { \r
return "HTMLNode (" + this.index + ")";\r
}\r
\r
s.filter = "alpha(opacity=10)";\r
s.display = "";\r
\r
- var dur = 0.4;\r
+ var dur = 0.4; \r
var a = new YAHOO.util.Anim(this.el, {opacity: {from: 0.1, to: 1, unit:""}}, dur);\r
a.onComplete.subscribe( function() { tvanim.onComplete(); } );\r
a.animate();\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ YAHOO.widget.TreeView=function(id){if(id){this.init(id);}};YAHOO.widget.TreeView.prototype={id:null,_el:null,_nodes:null,locked:false,_expandAnim:null,_collapseAnim:null,_animCount:0,maxAnim:2,setExpandAnim:function(_2){if(YAHOO.widget.TVAnim.isValid(_2)){this._expandAnim=_2;}},setCollapseAnim:function(_3){if(YAHOO.widget.TVAnim.isValid(_3)){this._collapseAnim=_3;}},animateExpand:function(el,_5){if(this._expandAnim&&this._animCount<this.maxAnim){var _6=this;var a=YAHOO.widget.TVAnim.getAnim(this._expandAnim,el,function(){_6.expandComplete(_5);});if(a){++this._animCount;this.fireEvent("animStart",{"node":_5,"type":"expand"});a.animate();}return true;}return false;},animateCollapse:function(el,_8){if(this._collapseAnim&&this._animCount<this.maxAnim){var _9=this;var a=YAHOO.widget.TVAnim.getAnim(this._collapseAnim,el,function(){_9.collapseComplete(_8);});if(a){++this._animCount;this.fireEvent("animStart",{"node":_8,"type":"collapse"});a.animate();}return true;}return false;},expandComplete:function(_10){--this._animCount;this.fireEvent("animComplete",{"node":_10,"type":"expand"});},collapseComplete:function(_11){--this._animCount;this.fireEvent("animComplete",{"node":_11,"type":"collapse"});},init:function(id){this.id=id;if("string"!==typeof id){this._el=id;this.id=this.generateId(id);}this.createEvent("animStart",this);this.createEvent("animComplete",this);this.createEvent("collapse",this);this.createEvent("expand",this);this._nodes=[];YAHOO.widget.TreeView.trees[this.id]=this;this.root=new YAHOO.widget.RootNode(this);},draw:function(){var _12=this.root.getHtml();this.getEl().innerHTML=_12;this.firstDraw=false;},getEl:function(){if(!this._el){this._el=document.getElementById(this.id);}return this._el;},regNode:function(_13){this._nodes[_13.index]=_13;},getRoot:function(){return this.root;},setDynamicLoad:function(_14,_15){this.root.setDynamicLoad(_14,_15);},expandAll:function(){if(!this.locked){this.root.expandAll();}},collapseAll:function(){if(!this.locked){this.root.collapseAll();}},getNodeByIndex:function(_16){var n=this._nodes[_16];return (n)?n:null;},getNodeByProperty:function(_18,_19){for(var i in this._nodes){var n=this._nodes[i];if(n.data&&_19==n.data[_18]){return n;}}return null;},getNodesByProperty:function(_21,_22){var _23=[];for(var i in this._nodes){var n=this._nodes[i];if(n.data&&_22==n.data[_21]){_23.push(n);}}return (_23.length)?_23:null;},removeNode:function(_24,_25){if(_24.isRoot()){return false;}var p=_24.parent;if(p.parent){p=p.parent;}this._deleteNode(_24);if(_25&&p&&p.childrenRendered){p.refresh();}return true;},removeChildren:function(_27){while(_27.children.length){this._deleteNode(_27.children[0]);}_27.childrenRendered=false;_27.dynamicLoadComplete=false;if(_27.expanded){_27.collapse();}else{_27.updateIcon();}},_deleteNode:function(_28){this.removeChildren(_28);this.popNode(_28);},popNode:function(_29){var p=_29.parent;var a=[];for(var i=0,len=p.children.length;i<len;++i){if(p.children[i]!=_29){a[a.length]=p.children[i];}}p.children=a;p.childrenRendered=false;if(_29.previousSibling){_29.previousSibling.nextSibling=_29.nextSibling;}if(_29.nextSibling){_29.nextSibling.previousSibling=_29.previousSibling;}_29.parent=null;_29.previousSibling=null;_29.nextSibling=null;_29.tree=null;delete this._nodes[_29.index];},toString:function(){return "TreeView "+this.id;},generateId:function(el){var id=el.id;if(!id){id="yui-tv-auto-id-"+YAHOO.widget.TreeView.counter;++YAHOO.widget.TreeView.counter;}return id;},onExpand:function(_30){},onCollapse:function(_31){}};YAHOO.augment(YAHOO.widget.TreeView,YAHOO.util.EventProvider);YAHOO.widget.TreeView.nodeCount=0;YAHOO.widget.TreeView.trees=[];YAHOO.widget.TreeView.counter=0;YAHOO.widget.TreeView.getTree=function(_32){var t=YAHOO.widget.TreeView.trees[_32];return (t)?t:null;};YAHOO.widget.TreeView.getNode=function(_34,_35){var t=YAHOO.widget.TreeView.getTree(_34);return (t)?t.getNodeByIndex(_35):null;};YAHOO.widget.TreeView.addHandler=function(el,_36,fn){if(el.addEventListener){el.addEventListener(_36,fn,false);}else{if(el.attachEvent){el.attachEvent("on"+_36,fn);}}};YAHOO.widget.TreeView.removeHandler=function(el,_38,fn){if(el.removeEventListener){el.removeEventListener(_38,fn,false);}else{if(el.detachEvent){el.detachEvent("on"+_38,fn);}}};YAHOO.widget.TreeView.preload=function(_39){_39=_39||"ygtv";var _40=["tn","tm","tmh","tp","tph","ln","lm","lmh","lp","lph","loading"];var sb=[];for(var i=0;i<_40.length;++i){sb[sb.length]="<span class=\""+_39+_40[i]+"\"> </span>";}var f=document.createElement("div");var s=f.style;s.position="absolute";s.top="-1000px";s.left="-1000px";f.innerHTML=sb.join("");document.body.appendChild(f);YAHOO.widget.TreeView.removeHandler(window,"load",YAHOO.widget.TreeView.preload);};YAHOO.widget.TreeView.addHandler(window,"load",YAHOO.widget.TreeView.preload);YAHOO.widget.Node=function(_44,_45,_46){if(_44){this.init(_44,_45,_46);}};YAHOO.widget.Node.prototype={index:0,children:null,tree:null,data:null,parent:null,depth:-1,href:null,target:"_self",expanded:false,multiExpand:true,renderHidden:false,childrenRendered:false,dynamicLoadComplete:false,previousSibling:null,nextSibling:null,_dynLoad:false,dataLoader:null,isLoading:false,hasIcon:true,iconMode:0,_type:"Node",init:function(_47,_48,_49){this.data=_47;this.children=[];this.index=YAHOO.widget.TreeView.nodeCount;++YAHOO.widget.TreeView.nodeCount;this.expanded=_49;this.createEvent("parentChange",this);if(_48){_48.appendChild(this);}},applyParent:function(_50){if(!_50){return false;}this.tree=_50.tree;this.parent=_50;this.depth=_50.depth+1;if(!this.href){this.href="javascript:"+this.getToggleLink();}if(!this.multiExpand){this.multiExpand=_50.multiExpand;}this.tree.regNode(this);_50.childrenRendered=false;for(var i=0,len=this.children.length;i<len;++i){this.children[i].applyParent(this);}this.fireEvent("parentChange");return true;},appendChild:function(_51){if(this.hasChildren()){var sib=this.children[this.children.length-1];sib.nextSibling=_51;_51.previousSibling=sib;}this.children[this.children.length]=_51;_51.applyParent(this);return _51;},appendTo:function(_53){return _53.appendChild(this);},insertBefore:function(_54){var p=_54.parent;if(p){if(this.tree){this.tree.popNode(this);}var _55=_54.isChildOf(p);p.children.splice(_55,0,this);if(_54.previousSibling){_54.previousSibling.nextSibling=this;}this.previousSibling=_54.previousSibling;this.nextSibling=_54;_54.previousSibling=this;this.applyParent(p);}return this;},insertAfter:function(_56){var p=_56.parent;if(p){if(this.tree){this.tree.popNode(this);}var _57=_56.isChildOf(p);if(!_56.nextSibling){return this.appendTo(p);}p.children.splice(_57+1,0,this);_56.nextSibling.previousSibling=this;this.previousSibling=_56;this.nextSibling=_56.nextSibling;_56.nextSibling=this;this.applyParent(p);}return this;},isChildOf:function(_58){if(_58&&_58.children){for(var i=0,len=_58.children.length;i<len;++i){if(_58.children[i]===this){return i;}}}return -1;},getSiblings:function(){return this.parent.children;},showChildren:function(){if(!this.tree.animateExpand(this.getChildrenEl(),this)){if(this.hasChildren()){this.getChildrenEl().style.display="";}}},hideChildren:function(){if(!this.tree.animateCollapse(this.getChildrenEl(),this)){this.getChildrenEl().style.display="none";}},getElId:function(){return "ygtv"+this.index;},getChildrenElId:function(){return "ygtvc"+this.index;},getToggleElId:function(){return "ygtvt"+this.index;},getEl:function(){return document.getElementById(this.getElId());},getChildrenEl:function(){return document.getElementById(this.getChildrenElId());},getToggleEl:function(){return document.getElementById(this.getToggleElId());},getToggleLink:function(){return "YAHOO.widget.TreeView.getNode('"+this.tree.id+"',"+this.index+").toggle()";},collapse:function(){if(!this.expanded){return;}var ret=this.tree.onCollapse(this);if(false===ret){return;}ret=this.tree.fireEvent("collapse",this);if(false===ret){return;}if(!this.getEl()){this.expanded=false;return;}this.hideChildren();this.expanded=false;this.updateIcon();},expand:function(){if(this.expanded){return;}var ret=this.tree.onExpand(this);if(false===ret){return;}ret=this.tree.fireEvent("expand",this);if(false===ret){return;}if(!this.getEl()){this.expanded=true;return;}if(!this.childrenRendered){this.getChildrenEl().innerHTML=this.renderChildren();}else{}this.expanded=true;this.updateIcon();if(this.isLoading){this.expanded=false;return;}if(!this.multiExpand){var _60=this.getSiblings();for(var i=0;i<_60.length;++i){if(_60[i]!=this&&_60[i].expanded){_60[i].collapse();}}}this.showChildren();},updateIcon:function(){if(this.hasIcon){var el=this.getToggleEl();if(el){el.className=this.getStyle();}}},getStyle:function(){if(this.isLoading){return "ygtvloading";}else{var loc=(this.nextSibling)?"t":"l";var _62="n";if(this.hasChildren(true)||(this.isDynamic()&&!this.getIconMode())){_62=(this.expanded)?"m":"p";}return "ygtv"+loc+_62;}},getHoverStyle:function(){var s=this.getStyle();if(this.hasChildren(true)&&!this.isLoading){s+="h";}return s;},expandAll:function(){for(var i=0;i<this.children.length;++i){var c=this.children[i];if(c.isDynamic()){alert("Not supported (lazy load + expand all)");break;}else{if(!c.multiExpand){alert("Not supported (no multi-expand + expand all)");break;}else{c.expand();c.expandAll();}}}},collapseAll:function(){for(var i=0;i<this.children.length;++i){this.children[i].collapse();this.children[i].collapseAll();}},setDynamicLoad:function(_64,_65){if(_64){this.dataLoader=_64;this._dynLoad=true;}else{this.dataLoader=null;this._dynLoad=false;}if(_65){this.iconMode=_65;}},isRoot:function(){return (this==this.tree.root);},isDynamic:function(){var _66=(!this.isRoot()&&(this._dynLoad||this.tree.root._dynLoad));return _66;},getIconMode:function(){return (this.iconMode||this.tree.root.iconMode);},hasChildren:function(_67){return (this.children.length>0||(_67&&this.isDynamic()&&!this.dynamicLoadComplete));},toggle:function(){if(!this.tree.locked&&(this.hasChildren(true)||this.isDynamic())){if(this.expanded){this.collapse();}else{this.expand();}}},getHtml:function(){this.childrenRendered=false;var sb=[];sb[sb.length]="<div class=\"ygtvitem\" id=\""+this.getElId()+"\">";sb[sb.length]=this.getNodeHtml();sb[sb.length]=this.getChildrenHtml();sb[sb.length]="</div>";return sb.join("");},getChildrenHtml:function(){var sb=[];sb[sb.length]="<div class=\"ygtvchildren\"";sb[sb.length]=" id=\""+this.getChildrenElId()+"\"";if(!this.expanded){sb[sb.length]=" style=\"display:none;\"";}sb[sb.length]=">";if((this.hasChildren(true)&&this.expanded)||(this.renderHidden&&!this.isDynamic())){sb[sb.length]=this.renderChildren();}sb[sb.length]="</div>";return sb.join("");},renderChildren:function(){var _68=this;if(this.isDynamic()&&!this.dynamicLoadComplete){this.isLoading=true;this.tree.locked=true;if(this.dataLoader){setTimeout(function(){_68.dataLoader(_68,function(){_68.loadComplete();});},10);}else{if(this.tree.root.dataLoader){setTimeout(function(){_68.tree.root.dataLoader(_68,function(){_68.loadComplete();});},10);}else{return "Error: data loader not found or not specified.";}}return "";}else{return this.completeRender();}},completeRender:function(){var sb=[];for(var i=0;i<this.children.length;++i){sb[sb.length]=this.children[i].getHtml();}this.childrenRendered=true;return sb.join("");},loadComplete:function(){this.getChildrenEl().innerHTML=this.completeRender();this.dynamicLoadComplete=true;this.isLoading=false;this.expand();this.tree.locked=false;},getAncestor:function(_69){if(_69>=this.depth||_69<0){return null;}var p=this.parent;while(p.depth>_69){p=p.parent;}return p;},getDepthStyle:function(_70){return (this.getAncestor(_70).nextSibling)?"ygtvdepthcell":"ygtvblankdepthcell";},getNodeHtml:function(){return "";},refresh:function(){this.getChildrenEl().innerHTML=this.completeRender();if(this.hasIcon){var el=this.getToggleEl();if(el){el.className=this.getStyle();}}},toString:function(){return "Node ("+this.index+")";}};YAHOO.augment(YAHOO.widget.Node,YAHOO.util.EventProvider);YAHOO.widget.RootNode=function(_71){this.init(null,null,true);this.tree=_71;};YAHOO.extend(YAHOO.widget.RootNode,YAHOO.widget.Node,{getNodeHtml:function(){return "";},toString:function(){return "RootNode";},loadComplete:function(){this.tree.draw();}});YAHOO.widget.TextNode=function(_72,_73,_74){if(_72){this.init(_72,_73,_74);this.setUpLabel(_72);}};YAHOO.extend(YAHOO.widget.TextNode,YAHOO.widget.Node,{labelStyle:"ygtvlabel",labelElId:null,label:null,textNodeParentChange:function(){if(this.tree&&!this.tree.hasEvent("labelClick")){this.tree.createEvent("labelClick",this.tree);}},setUpLabel:function(_75){this.textNodeParentChange();this.subscribe("parentChange",this.textNodeParentChange);if(typeof _75=="string"){_75={label:_75};}this.label=_75.label;if(_75.href){this.href=_75.href;}if(_75.target){this.target=_75.target;}if(_75.style){this.labelStyle=_75.style;}this.labelElId="ygtvlabelel"+this.index;},getLabelEl:function(){return document.getElementById(this.labelElId);},getNodeHtml:function(){var sb=[];sb[sb.length]="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";sb[sb.length]="<tr>";for(var i=0;i<this.depth;++i){sb[sb.length]="<td class=\""+this.getDepthStyle(i)+"\"> </td>";}var _76="YAHOO.widget.TreeView.getNode('"+this.tree.id+"',"+this.index+")";sb[sb.length]="<td";sb[sb.length]=" id=\""+this.getToggleElId()+"\"";sb[sb.length]=" class=\""+this.getStyle()+"\"";if(this.hasChildren(true)){sb[sb.length]=" onmouseover=\"this.className=";sb[sb.length]=_76+".getHoverStyle()\"";sb[sb.length]=" onmouseout=\"this.className=";sb[sb.length]=_76+".getStyle()\"";}sb[sb.length]=" onclick=\"javascript:"+this.getToggleLink()+"\">";sb[sb.length]=" ";sb[sb.length]="</td>";sb[sb.length]="<td>";sb[sb.length]="<a";sb[sb.length]=" id=\""+this.labelElId+"\"";sb[sb.length]=" class=\""+this.labelStyle+"\"";sb[sb.length]=" href=\""+this.href+"\"";sb[sb.length]=" target=\""+this.target+"\"";sb[sb.length]=" onclick=\"return "+_76+".onLabelClick("+_76+")\"";if(this.hasChildren(true)){sb[sb.length]=" onmouseover=\"document.getElementById('";sb[sb.length]=this.getToggleElId()+"').className=";sb[sb.length]=_76+".getHoverStyle()\"";sb[sb.length]=" onmouseout=\"document.getElementById('";sb[sb.length]=this.getToggleElId()+"').className=";sb[sb.length]=_76+".getStyle()\"";}sb[sb.length]=" >";sb[sb.length]=this.label;sb[sb.length]="</a>";sb[sb.length]="</td>";sb[sb.length]="</tr>";sb[sb.length]="</table>";return sb.join("");},onLabelClick:function(me){return me.tree.fireEvent("labelClick",me);},toString:function(){return "TextNode ("+this.index+") "+this.label;}});YAHOO.widget.MenuNode=function(_78,_79,_80){if(_78){this.init(_78,_79,_80);this.setUpLabel(_78);}this.multiExpand=false;};YAHOO.extend(YAHOO.widget.MenuNode,YAHOO.widget.TextNode,{toString:function(){return "MenuNode ("+this.index+") "+this.label;}});YAHOO.widget.HTMLNode=function(_81,_82,_83,_84){if(_81){this.init(_81,_82,_83);this.initContent(_81,_84);}};YAHOO.extend(YAHOO.widget.HTMLNode,YAHOO.widget.Node,{contentStyle:"ygtvhtml",contentElId:null,content:null,initContent:function(_85,_86){if(typeof _85=="string"){_85={html:_85};}this.html=_85.html;this.contentElId="ygtvcontentel"+this.index;this.hasIcon=_86;},getContentEl:function(){return document.getElementById(this.contentElId);},getNodeHtml:function(){var sb=[];sb[sb.length]="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";sb[sb.length]="<tr>";for(var i=0;i<this.depth;++i){sb[sb.length]="<td class=\""+this.getDepthStyle(i)+"\"> </td>";}if(this.hasIcon){sb[sb.length]="<td";sb[sb.length]=" id=\""+this.getToggleElId()+"\"";sb[sb.length]=" class=\""+this.getStyle()+"\"";sb[sb.length]=" onclick=\"javascript:"+this.getToggleLink()+"\"";if(this.hasChildren(true)){sb[sb.length]=" onmouseover=\"this.className=";sb[sb.length]="YAHOO.widget.TreeView.getNode('";sb[sb.length]=this.tree.id+"',"+this.index+").getHoverStyle()\"";sb[sb.length]=" onmouseout=\"this.className=";sb[sb.length]="YAHOO.widget.TreeView.getNode('";sb[sb.length]=this.tree.id+"',"+this.index+").getStyle()\"";}sb[sb.length]="> </td>";}sb[sb.length]="<td";sb[sb.length]=" id=\""+this.contentElId+"\"";sb[sb.length]=" class=\""+this.contentStyle+"\"";sb[sb.length]=" >";sb[sb.length]=this.html;sb[sb.length]="</td>";sb[sb.length]="</tr>";sb[sb.length]="</table>";return sb.join("");},toString:function(){return "HTMLNode ("+this.index+")";}});YAHOO.widget.TVAnim=function(){return {FADE_IN:"TVFadeIn",FADE_OUT:"TVFadeOut",getAnim:function(_87,el,_88){if(YAHOO.widget[_87]){return new YAHOO.widget[_87](el,_88);}else{return null;}},isValid:function(_89){return (YAHOO.widget[_89]);}};}();YAHOO.widget.TVFadeIn=function(el,_90){this.el=el;this.callback=_90;};YAHOO.widget.TVFadeIn.prototype={animate:function(){var _91=this;var s=this.el.style;s.opacity=0.1;s.filter="alpha(opacity=10)";s.display="";var dur=0.4;var a=new YAHOO.util.Anim(this.el,{opacity:{from:0.1,to:1,unit:""}},dur);a.onComplete.subscribe(function(){_91.onComplete();});a.animate();},onComplete:function(){this.callback();},toString:function(){return "TVFadeIn";}};YAHOO.widget.TVFadeOut=function(el,_93){this.el=el;this.callback=_93;};YAHOO.widget.TVFadeOut.prototype={animate:function(){var _94=this;var dur=0.4;var a=new YAHOO.util.Anim(this.el,{opacity:{from:1,to:0.1,unit:""}},dur);a.onComplete.subscribe(function(){_94.onComplete();});a.animate();},onComplete:function(){var s=this.el.style;s.display="none";s.filter="alpha(opacity=100)";this.callback();},toString:function(){return "TVFadeOut";}};
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.1 */\r
+YAHOO.widget.TreeView=function(id){if(id){this.init(id);}};YAHOO.widget.TreeView.prototype={id:null,_el:null,_nodes:null,locked:false,_expandAnim:null,_collapseAnim:null,_animCount:0,maxAnim:2,setExpandAnim:function(type){if(YAHOO.widget.TVAnim.isValid(type)){this._expandAnim=type;}},setCollapseAnim:function(type){if(YAHOO.widget.TVAnim.isValid(type)){this._collapseAnim=type;}},animateExpand:function(el,node){if(this._expandAnim&&this._animCount<this.maxAnim){var tree=this;var a=YAHOO.widget.TVAnim.getAnim(this._expandAnim,el,function(){tree.expandComplete(node);});if(a){++this._animCount;this.fireEvent("animStart",{"node":node,"type":"expand"});a.animate();}\r
+return true;}\r
+return false;},animateCollapse:function(el,node){if(this._collapseAnim&&this._animCount<this.maxAnim){var tree=this;var a=YAHOO.widget.TVAnim.getAnim(this._collapseAnim,el,function(){tree.collapseComplete(node);});if(a){++this._animCount;this.fireEvent("animStart",{"node":node,"type":"collapse"});a.animate();}\r
+return true;}\r
+return false;},expandComplete:function(node){--this._animCount;this.fireEvent("animComplete",{"node":node,"type":"expand"});},collapseComplete:function(node){--this._animCount;this.fireEvent("animComplete",{"node":node,"type":"collapse"});},init:function(id){this.id=id;if("string"!==typeof id){this._el=id;this.id=this.generateId(id);}\r
+this.createEvent("animStart",this);this.createEvent("animComplete",this);this.createEvent("collapse",this);this.createEvent("collapseComplete",this);this.createEvent("expand",this);this.createEvent("expandComplete",this);this._nodes=[];YAHOO.widget.TreeView.trees[this.id]=this;this.root=new YAHOO.widget.RootNode(this);YAHOO.util.Event.on(this.id,"click",this.handleClick,this,true);},draw:function(){var html=this.root.getHtml();this.getEl().innerHTML=html;this.firstDraw=false;},getEl:function(){if(!this._el){this._el=document.getElementById(this.id);}\r
+return this._el;},regNode:function(node){this._nodes[node.index]=node;},getRoot:function(){return this.root;},setDynamicLoad:function(fnDataLoader,iconMode){this.root.setDynamicLoad(fnDataLoader,iconMode);},expandAll:function(){if(!this.locked){this.root.expandAll();}},collapseAll:function(){if(!this.locked){this.root.collapseAll();}},getNodeByIndex:function(nodeIndex){var n=this._nodes[nodeIndex];return(n)?n:null;},getNodeByProperty:function(property,value){for(var i in this._nodes){var n=this._nodes[i];if(n.data&&value==n.data[property]){return n;}}\r
+return null;},getNodesByProperty:function(property,value){var values=[];for(var i in this._nodes){var n=this._nodes[i];if(n.data&&value==n.data[property]){values.push(n);}}\r
+return(values.length)?values:null;},removeNode:function(node,autoRefresh){if(node.isRoot()){return false;}\r
+var p=node.parent;if(p.parent){p=p.parent;}\r
+this._deleteNode(node);if(autoRefresh&&p&&p.childrenRendered){p.refresh();}\r
+return true;},removeChildren:function(node){while(node.children.length){this._deleteNode(node.children[0]);}\r
+node.childrenRendered=false;node.dynamicLoadComplete=false;if(node.expanded){node.collapse();}else{node.updateIcon();}},_deleteNode:function(node){this.removeChildren(node);this.popNode(node);},popNode:function(node){var p=node.parent;var a=[];for(var i=0,len=p.children.length;i<len;++i){if(p.children[i]!=node){a[a.length]=p.children[i];}}\r
+p.children=a;p.childrenRendered=false;if(node.previousSibling){node.previousSibling.nextSibling=node.nextSibling;}\r
+if(node.nextSibling){node.nextSibling.previousSibling=node.previousSibling;}\r
+node.parent=null;node.previousSibling=null;node.nextSibling=null;node.tree=null;delete this._nodes[node.index];},toString:function(){return"TreeView "+this.id;},generateId:function(el){var id=el.id;if(!id){id="yui-tv-auto-id-"+YAHOO.widget.TreeView.counter;++YAHOO.widget.TreeView.counter;}\r
+return id;},onExpand:function(node){},onCollapse:function(node){}};YAHOO.augment(YAHOO.widget.TreeView,YAHOO.util.EventProvider);YAHOO.widget.TreeView.nodeCount=0;YAHOO.widget.TreeView.trees=[];YAHOO.widget.TreeView.counter=0;YAHOO.widget.TreeView.getTree=function(treeId){var t=YAHOO.widget.TreeView.trees[treeId];return(t)?t:null;};YAHOO.widget.TreeView.getNode=function(treeId,nodeIndex){var t=YAHOO.widget.TreeView.getTree(treeId);return(t)?t.getNodeByIndex(nodeIndex):null;};YAHOO.widget.TreeView.addHandler=function(el,sType,fn){if(el.addEventListener){el.addEventListener(sType,fn,false);}else if(el.attachEvent){el.attachEvent("on"+sType,fn);}};YAHOO.widget.TreeView.removeHandler=function(el,sType,fn){if(el.removeEventListener){el.removeEventListener(sType,fn,false);}else if(el.detachEvent){el.detachEvent("on"+sType,fn);}};YAHOO.widget.TreeView.preload=function(prefix){prefix=prefix||"ygtv";var styles=["tn","tm","tmh","tp","tph","ln","lm","lmh","lp","lph","loading"];var sb=[];for(var i=0;i<styles.length;++i){sb[sb.length]='<span class="'+prefix+styles[i]+'"> </span>';}\r
+var f=document.createElement("div");var s=f.style;s.position="absolute";s.top="-1000px";s.left="-1000px";f.innerHTML=sb.join("");document.body.appendChild(f);YAHOO.widget.TreeView.removeHandler(window,"load",YAHOO.widget.TreeView.preload);};YAHOO.widget.TreeView.addHandler(window,"load",YAHOO.widget.TreeView.preload);YAHOO.widget.Node=function(oData,oParent,expanded){if(oData){this.init(oData,oParent,expanded);}};YAHOO.widget.Node.prototype={index:0,children:null,tree:null,data:null,parent:null,depth:-1,href:null,target:"_self",expanded:false,multiExpand:true,renderHidden:false,childrenRendered:false,dynamicLoadComplete:false,previousSibling:null,nextSibling:null,_dynLoad:false,dataLoader:null,isLoading:false,hasIcon:true,iconMode:0,nowrap:false,_type:"Node",init:function(oData,oParent,expanded){this.data=oData;this.children=[];this.index=YAHOO.widget.TreeView.nodeCount;++YAHOO.widget.TreeView.nodeCount;this.expanded=expanded;this.createEvent("parentChange",this);if(oParent){oParent.appendChild(this);}},applyParent:function(parentNode){if(!parentNode){return false;}\r
+this.tree=parentNode.tree;this.parent=parentNode;this.depth=parentNode.depth+1;if(!this.href){this.href="javascript:"+this.getToggleLink();}\r
+if(!this.multiExpand){this.multiExpand=parentNode.multiExpand;}\r
+this.tree.regNode(this);parentNode.childrenRendered=false;for(var i=0,len=this.children.length;i<len;++i){this.children[i].applyParent(this);}\r
+this.fireEvent("parentChange");return true;},appendChild:function(childNode){if(this.hasChildren()){var sib=this.children[this.children.length-1];sib.nextSibling=childNode;childNode.previousSibling=sib;}\r
+this.children[this.children.length]=childNode;childNode.applyParent(this);return childNode;},appendTo:function(parentNode){return parentNode.appendChild(this);},insertBefore:function(node){var p=node.parent;if(p){if(this.tree){this.tree.popNode(this);}\r
+var refIndex=node.isChildOf(p);p.children.splice(refIndex,0,this);if(node.previousSibling){node.previousSibling.nextSibling=this;}\r
+this.previousSibling=node.previousSibling;this.nextSibling=node;node.previousSibling=this;this.applyParent(p);}\r
+return this;},insertAfter:function(node){var p=node.parent;if(p){if(this.tree){this.tree.popNode(this);}\r
+var refIndex=node.isChildOf(p);if(!node.nextSibling){return this.appendTo(p);}\r
+p.children.splice(refIndex+1,0,this);node.nextSibling.previousSibling=this;this.previousSibling=node;this.nextSibling=node.nextSibling;node.nextSibling=this;this.applyParent(p);}\r
+return this;},isChildOf:function(parentNode){if(parentNode&&parentNode.children){for(var i=0,len=parentNode.children.length;i<len;++i){if(parentNode.children[i]===this){return i;}}}\r
+return-1;},getSiblings:function(){return this.parent.children;},showChildren:function(){if(!this.tree.animateExpand(this.getChildrenEl(),this)){if(this.hasChildren()){this.getChildrenEl().style.display="";}}},hideChildren:function(){if(!this.tree.animateCollapse(this.getChildrenEl(),this)){this.getChildrenEl().style.display="none";}},getElId:function(){return"ygtv"+this.index;},getChildrenElId:function(){return"ygtvc"+this.index;},getToggleElId:function(){return"ygtvt"+this.index;},getEl:function(){return document.getElementById(this.getElId());},getChildrenEl:function(){return document.getElementById(this.getChildrenElId());},getToggleEl:function(){return document.getElementById(this.getToggleElId());},getToggleLink:function(){return"YAHOO.widget.TreeView.getNode(\'"+this.tree.id+"\',"+\r
+this.index+").toggle()";},collapse:function(){if(!this.expanded){return;}\r
+var ret=this.tree.onCollapse(this);if(false===ret){return;}\r
+ret=this.tree.fireEvent("collapse",this);if(false===ret){return;}\r
+if(!this.getEl()){this.expanded=false;}else{this.hideChildren();this.expanded=false;this.updateIcon();}\r
+ret=this.tree.fireEvent("collapseComplete",this);},expand:function(){if(this.expanded){return;}\r
+var ret=this.tree.onExpand(this);if(false===ret){return;}\r
+ret=this.tree.fireEvent("expand",this);if(false===ret){return;}\r
+if(!this.getEl()){this.expanded=true;return;}\r
+if(!this.childrenRendered){this.getChildrenEl().innerHTML=this.renderChildren();}else{}\r
+this.expanded=true;this.updateIcon();if(this.isLoading){this.expanded=false;return;}\r
+if(!this.multiExpand){var sibs=this.getSiblings();for(var i=0;i<sibs.length;++i){if(sibs[i]!=this&&sibs[i].expanded){sibs[i].collapse();}}}\r
+this.showChildren();ret=this.tree.fireEvent("expandComplete",this);},updateIcon:function(){if(this.hasIcon){var el=this.getToggleEl();if(el){el.className=this.getStyle();}}},getStyle:function(){if(this.isLoading){return"ygtvloading";}else{var loc=(this.nextSibling)?"t":"l";var type="n";if(this.hasChildren(true)||(this.isDynamic()&&!this.getIconMode())){type=(this.expanded)?"m":"p";}\r
+return"ygtv"+loc+type;}},getHoverStyle:function(){var s=this.getStyle();if(this.hasChildren(true)&&!this.isLoading){s+="h";}\r
+return s;},expandAll:function(){for(var i=0;i<this.children.length;++i){var c=this.children[i];if(c.isDynamic()){alert("Not supported (lazy load + expand all)");break;}else if(!c.multiExpand){alert("Not supported (no multi-expand + expand all)");break;}else{c.expand();c.expandAll();}}},collapseAll:function(){for(var i=0;i<this.children.length;++i){this.children[i].collapse();this.children[i].collapseAll();}},setDynamicLoad:function(fnDataLoader,iconMode){if(fnDataLoader){this.dataLoader=fnDataLoader;this._dynLoad=true;}else{this.dataLoader=null;this._dynLoad=false;}\r
+if(iconMode){this.iconMode=iconMode;}},isRoot:function(){return(this==this.tree.root);},isDynamic:function(){var lazy=(!this.isRoot()&&(this._dynLoad||this.tree.root._dynLoad));return lazy;},getIconMode:function(){return(this.iconMode||this.tree.root.iconMode);},hasChildren:function(checkForLazyLoad){return(this.children.length>0||(checkForLazyLoad&&this.isDynamic()&&!this.dynamicLoadComplete));},toggle:function(){if(!this.tree.locked&&(this.hasChildren(true)||this.isDynamic())){if(this.expanded){this.collapse();}else{this.expand();}}},getHtml:function(){this.childrenRendered=false;var sb=[];sb[sb.length]='<div class="ygtvitem" id="'+this.getElId()+'">';sb[sb.length]=this.getNodeHtml();sb[sb.length]=this.getChildrenHtml();sb[sb.length]='</div>';return sb.join("");},getChildrenHtml:function(){var sb=[];sb[sb.length]='<div class="ygtvchildren"';sb[sb.length]=' id="'+this.getChildrenElId()+'"';if(!this.expanded){sb[sb.length]=' style="display:none;"';}\r
+sb[sb.length]='>';if((this.hasChildren(true)&&this.expanded)||(this.renderHidden&&!this.isDynamic())){sb[sb.length]=this.renderChildren();}\r
+sb[sb.length]='</div>';return sb.join("");},renderChildren:function(){var node=this;if(this.isDynamic()&&!this.dynamicLoadComplete){this.isLoading=true;this.tree.locked=true;if(this.dataLoader){setTimeout(function(){node.dataLoader(node,function(){node.loadComplete();});},10);}else if(this.tree.root.dataLoader){setTimeout(function(){node.tree.root.dataLoader(node,function(){node.loadComplete();});},10);}else{return"Error: data loader not found or not specified.";}\r
+return"";}else{return this.completeRender();}},completeRender:function(){var sb=[];for(var i=0;i<this.children.length;++i){sb[sb.length]=this.children[i].getHtml();}\r
+this.childrenRendered=true;return sb.join("");},loadComplete:function(){this.getChildrenEl().innerHTML=this.completeRender();this.dynamicLoadComplete=true;this.isLoading=false;this.expand();this.tree.locked=false;},getAncestor:function(depth){if(depth>=this.depth||depth<0){return null;}\r
+var p=this.parent;while(p.depth>depth){p=p.parent;}\r
+return p;},getDepthStyle:function(depth){return(this.getAncestor(depth).nextSibling)?"ygtvdepthcell":"ygtvblankdepthcell";},getNodeHtml:function(){return"";},refresh:function(){this.getChildrenEl().innerHTML=this.completeRender();if(this.hasIcon){var el=this.getToggleEl();if(el){el.className=this.getStyle();}}},toString:function(){return"Node ("+this.index+")";}};YAHOO.augment(YAHOO.widget.Node,YAHOO.util.EventProvider);YAHOO.widget.RootNode=function(oTree){this.init(null,null,true);this.tree=oTree;};YAHOO.extend(YAHOO.widget.RootNode,YAHOO.widget.Node,{getNodeHtml:function(){return"";},toString:function(){return"RootNode";},loadComplete:function(){this.tree.draw();}});YAHOO.widget.TextNode=function(oData,oParent,expanded){if(oData){this.init(oData,oParent,expanded);this.setUpLabel(oData);}};YAHOO.extend(YAHOO.widget.TextNode,YAHOO.widget.Node,{labelStyle:"ygtvlabel",labelElId:null,label:null,textNodeParentChange:function(){if(this.tree&&!this.tree.hasEvent("labelClick")){this.tree.createEvent("labelClick",this.tree);}},setUpLabel:function(oData){this.textNodeParentChange();this.subscribe("parentChange",this.textNodeParentChange);if(typeof oData=="string"){oData={label:oData};}\r
+this.label=oData.label;if(oData.href){this.href=oData.href;}\r
+if(oData.target){this.target=oData.target;}\r
+if(oData.style){this.labelStyle=oData.style;}\r
+this.labelElId="ygtvlabelel"+this.index;},getLabelEl:function(){return document.getElementById(this.labelElId);},getNodeHtml:function(){var sb=[];sb[sb.length]='<table border="0" cellpadding="0" cellspacing="0">';sb[sb.length]='<tr>';for(var i=0;i<this.depth;++i){sb[sb.length]='<td class="'+this.getDepthStyle(i)+'"><div class="ygtvspacer"></div></td>';}\r
+var getNode='YAHOO.widget.TreeView.getNode(\''+\r
+this.tree.id+'\','+this.index+')';sb[sb.length]='<td';sb[sb.length]=' id="'+this.getToggleElId()+'"';sb[sb.length]=' class="'+this.getStyle()+'"';if(this.hasChildren(true)){sb[sb.length]=' onmouseover="this.className=';sb[sb.length]=getNode+'.getHoverStyle()"';sb[sb.length]=' onmouseout="this.className=';sb[sb.length]=getNode+'.getStyle()"';}\r
+sb[sb.length]=' onclick="javascript:'+this.getToggleLink()+'">';sb[sb.length]='<div class="ygtvspacer">';sb[sb.length]='</div>';sb[sb.length]='</td>';sb[sb.length]='<td ';sb[sb.length]=(this.nowrap)?' nowrap="nowrap" ':'';sb[sb.length]=' >';sb[sb.length]='<a';sb[sb.length]=' id="'+this.labelElId+'"';sb[sb.length]=' class="'+this.labelStyle+'"';sb[sb.length]=' href="'+this.href+'"';sb[sb.length]=' target="'+this.target+'"';sb[sb.length]=' onclick="return '+getNode+'.onLabelClick('+getNode+')"';if(this.hasChildren(true)){sb[sb.length]=' onmouseover="document.getElementById(\'';sb[sb.length]=this.getToggleElId()+'\').className=';sb[sb.length]=getNode+'.getHoverStyle()"';sb[sb.length]=' onmouseout="document.getElementById(\'';sb[sb.length]=this.getToggleElId()+'\').className=';sb[sb.length]=getNode+'.getStyle()"';}\r
+sb[sb.length]=' >';sb[sb.length]=this.label;sb[sb.length]='</a>';sb[sb.length]='</td>';sb[sb.length]='</tr>';sb[sb.length]='</table>';return sb.join("");},onLabelClick:function(me){return me.tree.fireEvent("labelClick",me);},toString:function(){return"TextNode ("+this.index+") "+this.label;}});YAHOO.widget.MenuNode=function(oData,oParent,expanded){if(oData){this.init(oData,oParent,expanded);this.setUpLabel(oData);}\r
+this.multiExpand=false;};YAHOO.extend(YAHOO.widget.MenuNode,YAHOO.widget.TextNode,{toString:function(){return"MenuNode ("+this.index+") "+this.label;}});YAHOO.widget.HTMLNode=function(oData,oParent,expanded,hasIcon){if(oData){this.init(oData,oParent,expanded);this.initContent(oData,hasIcon);}};YAHOO.extend(YAHOO.widget.HTMLNode,YAHOO.widget.Node,{contentStyle:"ygtvhtml",contentElId:null,content:null,initContent:function(oData,hasIcon){if(typeof oData=="string"){oData={html:oData};}\r
+this.html=oData.html;this.contentElId="ygtvcontentel"+this.index;this.hasIcon=hasIcon;},getContentEl:function(){return document.getElementById(this.contentElId);},getNodeHtml:function(){var sb=[];sb[sb.length]='<table border="0" cellpadding="0" cellspacing="0">';sb[sb.length]='<tr>';for(var i=0;i<this.depth;++i){sb[sb.length]='<td class="'+this.getDepthStyle(i)+'"><div class="ygtvspacer"></div></td>';}\r
+if(this.hasIcon){sb[sb.length]='<td';sb[sb.length]=' id="'+this.getToggleElId()+'"';sb[sb.length]=' class="'+this.getStyle()+'"';sb[sb.length]=' onclick="javascript:'+this.getToggleLink()+'"';if(this.hasChildren(true)){sb[sb.length]=' onmouseover="this.className=';sb[sb.length]='YAHOO.widget.TreeView.getNode(\'';sb[sb.length]=this.tree.id+'\','+this.index+').getHoverStyle()"';sb[sb.length]=' onmouseout="this.className=';sb[sb.length]='YAHOO.widget.TreeView.getNode(\'';sb[sb.length]=this.tree.id+'\','+this.index+').getStyle()"';}\r
+sb[sb.length]='><div class="ygtvspacer"></div></td>';}\r
+sb[sb.length]='<td';sb[sb.length]=' id="'+this.contentElId+'"';sb[sb.length]=' class="'+this.contentStyle+'"';sb[sb.length]=(this.nowrap)?' nowrap="nowrap" ':'';sb[sb.length]=' >';sb[sb.length]=this.html;sb[sb.length]='</td>';sb[sb.length]='</tr>';sb[sb.length]='</table>';return sb.join("");},toString:function(){return"HTMLNode ("+this.index+")";}});YAHOO.widget.TVAnim=function(){return{FADE_IN:"TVFadeIn",FADE_OUT:"TVFadeOut",getAnim:function(type,el,callback){if(YAHOO.widget[type]){return new YAHOO.widget[type](el,callback);}else{return null;}},isValid:function(type){return(YAHOO.widget[type]);}};}();YAHOO.widget.TVFadeIn=function(el,callback){this.el=el;this.callback=callback;};YAHOO.widget.TVFadeIn.prototype={animate:function(){var tvanim=this;var s=this.el.style;s.opacity=0.1;s.filter="alpha(opacity=10)";s.display="";var dur=0.4;var a=new YAHOO.util.Anim(this.el,{opacity:{from:0.1,to:1,unit:""}},dur);a.onComplete.subscribe(function(){tvanim.onComplete();});a.animate();},onComplete:function(){this.callback();},toString:function(){return"TVFadeIn";}};YAHOO.widget.TVFadeOut=function(el,callback){this.el=el;this.callback=callback;};YAHOO.widget.TVFadeOut.prototype={animate:function(){var tvanim=this;var dur=0.4;var a=new YAHOO.util.Anim(this.el,{opacity:{from:1,to:0.1,unit:""}},dur);a.onComplete.subscribe(function(){tvanim.onComplete();});a.animate();},onComplete:function(){var s=this.el.style;s.display="none";s.filter="alpha(opacity=100)";this.callback();},toString:function(){return"TVFadeOut";}};
\ No newline at end of file
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
+version: 0.12.1\r
*/ \r
-\r
/**\r
* The treeview widget is a generic tree building tool.\r
* @module treeview\r
* Contains the tree view state data and the root node.\r
*\r
* @class TreeView\r
+ * @uses YAHOO.util.EventProvider\r
* @constructor\r
* @param {string|HTMLElement} id The id of the element, or the element\r
* itself that the tree will be inserted into.\r
this.createEvent("animComplete", this);\r
\r
/**\r
- * Fires when a node is going to be expanded. Return false to stop\r
- * the expand.\r
+ * Fires when a node is going to be collapsed. Return false to stop\r
+ * the collapse.\r
* @event collapse\r
* @type CustomEvent\r
- * @param {YAHOO.widget.Node} node the node that is expanding/collapsing\r
+ * @param {YAHOO.widget.Node} node the node that is collapsing\r
*/\r
this.createEvent("collapse", this);\r
\r
/**\r
- * Fires when a node is going to be collapsed. Return false to stop\r
+ * Fires after a node is successfully collapsed. This event will not fire\r
+ * if the "collapse" event was cancelled.\r
+ * @event collapseComplete\r
+ * @type CustomEvent\r
+ * @param {YAHOO.widget.Node} node the node that was collapsed\r
+ */\r
+ this.createEvent("collapseComplete", this);\r
+\r
+ /**\r
+ * Fires when a node is going to be expanded. Return false to stop\r
* the collapse.\r
* @event expand\r
* @type CustomEvent\r
- * @param {YAHOO.widget.Node} node the node that is expanding/collapsing\r
+ * @param {YAHOO.widget.Node} node the node that is expanding\r
*/\r
this.createEvent("expand", this);\r
\r
+ /**\r
+ * Fires after a node is successfully expanded. This event will not fire\r
+ * if the "expand" event was cancelled.\r
+ * @event expandComplete\r
+ * @type CustomEvent\r
+ * @param {YAHOO.widget.Node} node the node that was expanded\r
+ */\r
+ this.createEvent("expandComplete", this);\r
+\r
this._nodes = [];\r
\r
// store a global reference\r
this.root = new YAHOO.widget.RootNode(this);\r
\r
\r
+\r
+ //YAHOO.util.Event.onContentReady(this.id, this.handleAvailable, this, true);\r
+ YAHOO.util.Event.on(this.id, "click", this.handleClick, this, true);\r
},\r
\r
+ //handleAvailable: function() {\r
+ //var Event = YAHOO.util.Event;\r
+ //Event.on(this.id, \r
+ //},\r
+\r
/**\r
* Renders the tree boilerplate and visible nodes\r
* @method draw\r
* response to mouse events is handled in Node subclasses.\r
* @namespace YAHOO.widget\r
* @class Node\r
+ * @uses YAHOO.util.EventProvider\r
* @param oData {object} a string or object containing the data that will\r
* be used to render this node\r
* @param oParent {Node} this node's parent node\r
*/\r
iconMode: 0,\r
\r
+ /**\r
+ * Specifies whether or not the content area of the node should be allowed\r
+ * to wrap.\r
+ * @property nowrap\r
+ * @type boolean\r
+ * @default true\r
+ */\r
+ nowrap: false,\r
+\r
/**\r
* The node type\r
* @property _type\r
* The parentChange event is fired when a parent element is applied\r
* to the node. This is useful if you need to apply tree-level\r
* properties to a tree that need to happen if a node is moved from\r
- * one tre to another.\r
+ * one tree to another.\r
*\r
* @event parentChange\r
* @type CustomEvent\r
\r
if (!this.getEl()) {\r
this.expanded = false;\r
- return;\r
- }\r
-\r
- // hide the child div\r
- this.hideChildren();\r
- this.expanded = false;\r
+ } else {\r
+ // hide the child div\r
+ this.hideChildren();\r
+ this.expanded = false;\r
\r
- this.updateIcon();\r
+ this.updateIcon();\r
+ }\r
\r
// this.getSpacer().title = this.getStateText();\r
\r
+ ret = this.tree.fireEvent("collapseComplete", this);\r
+\r
},\r
\r
/**\r
}\r
\r
this.showChildren();\r
+\r
+ ret = this.tree.fireEvent("expandComplete", this);\r
},\r
\r
updateIcon: function() {\r
sb[sb.length] = '<tr>';\r
\r
for (var i=0;i<this.depth;++i) {\r
- // sb[sb.length] = '<td class="ygtvdepthcell"> </td>';\r
- sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '"> </td>';\r
+ //sb[sb.length] = '<td><div class="' + this.getDepthStyle(i) + '"> </div></td>';\r
+ //sb[sb.length] = '<td><div class="' + this.getDepthStyle(i) + '"></div></td>';\r
+ sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '"><div class="ygtvspacer"></div></td>';\r
}\r
\r
var getNode = 'YAHOO.widget.TreeView.getNode(\'' +\r
}\r
sb[sb.length] = ' onclick="javascript:' + this.getToggleLink() + '">';\r
\r
+ sb[sb.length] = '<div class="ygtvspacer">';\r
+\r
/*\r
sb[sb.length] = '<img id="' + this.getSpacerId() + '"';\r
sb[sb.length] = ' alt=""';\r
sb[sb.length] = ' />';\r
*/\r
\r
- sb[sb.length] = ' ';\r
+ //sb[sb.length] = ' ';\r
\r
+ sb[sb.length] = '</div>';\r
sb[sb.length] = '</td>';\r
- sb[sb.length] = '<td>';\r
+ sb[sb.length] = '<td ';\r
+ sb[sb.length] = (this.nowrap) ? ' nowrap="nowrap" ' : '';\r
+ sb[sb.length] = ' >';\r
sb[sb.length] = '<a';\r
sb[sb.length] = ' id="' + this.labelElId + '"';\r
sb[sb.length] = ' class="' + this.labelStyle + '"';\r
sb[sb.length] = '<tr>';\r
\r
for (var i=0;i<this.depth;++i) {\r
- sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '"> </td>';\r
+ //sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '"> </td>';\r
+ sb[sb.length] = '<td class="' + this.getDepthStyle(i) + '"><div class="ygtvspacer"></div></td>';\r
}\r
\r
if (this.hasIcon) {\r
sb[sb.length] = 'YAHOO.widget.TreeView.getNode(\'';\r
sb[sb.length] = this.tree.id + '\',' + this.index + ').getStyle()"';\r
}\r
- sb[sb.length] = '> </td>';\r
+ //sb[sb.length] = '> </td>';\r
+ sb[sb.length] = '><div class="ygtvspacer"></div></td>';\r
}\r
\r
sb[sb.length] = '<td';\r
sb[sb.length] = ' id="' + this.contentElId + '"';\r
sb[sb.length] = ' class="' + this.contentStyle + '"';\r
+ sb[sb.length] = (this.nowrap) ? ' nowrap="nowrap" ' : '';\r
sb[sb.length] = ' >';\r
sb[sb.length] = this.html;\r
sb[sb.length] = '</td>';\r
utilities.js Release Notes\r
\r
+*** version 0.12.1 ***\r
+\r
+ * Includes 0.12.1 revisions to all YUI utilities and includes yahoo.js.\r
+\r
*** version 0.12.0 ***\r
\r
The utilities.js file rolls up all of the YUI utility components into a single\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txtversion: 0.12.0 */\r
-if(typeof YAHOO=="undefined"){var YAHOO={};}YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;++i){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}return o;};YAHOO.log=function(_2,_3,_4){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(_2,_3,_4);}else{return false;}};YAHOO.extend=function(_6,_7,_8){var F=function(){};F.prototype=_7.prototype;_6.prototype=new F();_6.prototype.constructor=_6;_6.superclass=_7.prototype;if(_7.prototype.constructor==Object.prototype.constructor){_7.prototype.constructor=_7;}if(_8){for(var i in _8){_6.prototype[i]=_8[i];}}};YAHOO.augment=function(r,s){var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i<a.length;++i){rp[a[i]]=sp[a[i]];}}else{for(p in sp){if(!rp[p]){rp[p]=sp[p];}}}};YAHOO.namespace("util","widget","example");(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={};var ua=navigator.userAgent.toLowerCase(),isOpera=(ua.indexOf('opera')>-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);var patterns={HYPHEN:/(-[a-z])/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}if(propertyCache[property]){return propertyCache[property];}while(patterns.HYPHEN.exec(property)){property=property.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}propertyCache[property]=property;return property;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}return val/100;break;default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};}if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}break;default:el.style[property]=val;}};}else{setStyle=function(el,property,val){el.style[property]=val;};}YAHOO.util.Dom={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]=Y.Dom.get(el[i]);}return collection;}return null;},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if(el.parentNode===null||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'){if(Y.Dom.getStyle(parentNode,'display')!='inline'){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}if(parentNode.parentNode){parentNode=parentNode.parentNode;}else{parentNode=null;}}return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){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);}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var region=new Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root){var method=function(el){return Y.Dom.hasClass(el,className);};return Y.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 Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return;}el['className']=[el['className'],className].join(' ');};Y.Dom.batch(el,f,Y.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);}};Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(oldClassName===newClassName){return false;}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);}};Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';el=el||{};var f=function(el){if(el){el=Y.Dom.get(el);}else{el={};}if(!el.id){el.id=prefix+id_counter++;}return el.id;};return Y.Dom.batch(el,f,Y.Dom,true);},isAncestor:function(haystack,needle){haystack=Y.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||parent.tagName.toUpperCase()=='HTML'){return false;}parent=parent.parentNode;}return false;}};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root){tag=tag||'*';root=Y.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=Y.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=el[i];}collection[collection.length]=method.call(scope,el[i],o);}return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}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&®ion.right<=this.right&®ion.top>=this.top&®ion.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();YAHOO.util.CustomEvent=function(_1,_2,_3,_4){this.type=_1;this.scope=_2||window;this.silent=_3;this.signature=_4||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var _5="_YUICEOnSubscribe";if(_1!==_5){this.subscribeEvent=new YAHOO.util.CustomEvent(_5,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,_7,_8){if(this.subscribeEvent){this.subscribeEvent.fire(fn,_7,_8);}this.subscribers.push(new YAHOO.util.Subscriber(fn,_7,_8));},unsubscribe:function(fn,_9){var _10=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,_9)){this._delete(i);_10=true;}}return _10;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}var _14=[],ret=true,i;for(i=0;i<arguments.length;++i){_14.push(arguments[i]);}var _15=_14.length;if(!this.silent){}for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}var _16=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var _17=null;if(_14.length>0){_17=_14[0];}ret=s.fn.call(_16,_17,s.obj);}else{ret=s.fn.call(_16,this.type,_14,s.obj);}if(false===ret){if(!this.silent){}return false;}}}return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}},_delete:function(_18){var s=this.subscribers[_18];if(s){delete s.fn;delete s.obj;}this.subscribers.splice(_18,1);},toString:function(){return "CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,_20){this.fn=fn;this.obj=obj||null;this.override=_20;};YAHOO.util.Subscriber.prototype.getScope=function(_21){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return _21;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return (this.fn==fn&&this.obj==obj);}else{return (this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return "Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var _22=false;var _23=[];var _24=[];var _25=[];var _26=[];var _27=0;var _28=[];var _29=[];var _30=0;return {POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ: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)),_interval:null,startInterval:function(){if(!this._interval){var _31=this;var _32=function(){_31._tryPreloadAttach();};this._interval=setInterval(_32,this.POLL_INTERVAL);}},onAvailable:function(_33,_34,_35,_36){_28.push({id:_33,fn:_34,obj:_35,override:_36,checkReady:false});_27=this.POLL_RETRYS;this.startInterval();},onContentReady:function(_37,_38,_39,_40){_28.push({id:_37,fn:_38,obj:_39,override:_40,checkReady:true});_27=this.POLL_RETRYS;this.startInterval();},addListener:function(el,_42,fn,obj,_43){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],_42,fn,obj,_43)&&ok;}return ok;}else{if(typeof el=="string"){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,_42,fn,obj,_43);});return true;}}}if(!el){return false;}if("unload"==_42&&obj!==this){_24[_24.length]=[el,_42,fn,obj,_43];return true;}var _46=el;if(_43){if(_43===true){_46=obj;}else{_46=_43;}}var _47=function(e){return fn.call(_46,YAHOO.util.Event.getEvent(e),obj);};var li=[el,_42,fn,_47,_46];var _50=_23.length;_23[_50]=li;if(this.useLegacyEvent(el,_42)){var _51=this.getLegacyIndex(el,_42);if(_51==-1||el!=_25[_51][0]){_51=_25.length;_29[el.id+_42]=_51;_25[_51]=[el,_42,el["on"+_42]];_26[_51]=[];el["on"+_42]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),_51);};}_26[_51].push(li);}else{this._simpleAdd(el,_42,_47,false);}return true;},fireLegacyEvent:function(e,_52){var ok=true;var le=_26[_52];for(var i=0,len=le.length;i<len;++i){var li=le[i];if(li&&li[this.WFN]){var _54=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(_54,e);ok=(ok&&ret);}}return ok;},getLegacyIndex:function(el,_56){var key=this.generateId(el)+_56;if(typeof _29[key]=="undefined"){return -1;}else{return _29[key];}},useLegacyEvent:function(el,_58){if(!el.addEventListener&&!el.attachEvent){return true;}else{if(this.isSafari){if("click"==_58||"dblclick"==_58){return true;}}}return false;},removeListener:function(el,_59,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else{if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],_59,fn)&&ok);}return ok;}}if(!fn||!fn.call){return this.purgeElement(el,false,_59);}if("unload"==_59){for(i=0,len=_24.length;i<len;i++){var li=_24[i];if(li&&li[0]==el&&li[1]==_59&&li[2]==fn){_24.splice(i,1);return true;}}return false;}var _60=null;var _61=arguments[3];if("undefined"==typeof _61){_61=this._getCacheIndex(el,_59,fn);}if(_61>=0){_60=_23[_61];}if(!el||!_60){return false;}if(this.useLegacyEvent(el,_59)){var _62=this.getLegacyIndex(el,_59);var _63=_26[_62];if(_63){for(i=0,len=_63.length;i<len;++i){li=_63[i];if(li&&li[this.EL]==el&&li[this.TYPE]==_59&&li[this.FN]==fn){_63.splice(i,1);}}}}else{this._simpleRemove(el,_59,_60[this.WFN],false);}delete _23[_61][this.WFN];delete _23[_61][this.FN];_23.splice(_61,1);return true;},getTarget:function(ev,_65){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(_67){if(_67&&3==_67.nodeType){return _67.parentNode;}else{return _67;}},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.keyCode||0;},_getCacheIndex:function(el,_71,fn){for(var i=0,len=_23.length;i<len;++i){var li=_23[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==_71){return i;}}return -1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+_30;++_30;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(){},_load:function(e){_22=true;var EU=YAHOO.util.Event;if(this.isIE){EU._simpleRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}this.locked=true;var _75=!_22;if(!_75){_75=(_27>0);}var _76=[];for(var i=0,len=_28.length;i<len;++i){var _77=_28[i];if(_77){var el=this.getEl(_77.id);if(el){if(!_77.checkReady||_22||el.nextSibling||(document&&document.body)){var _78=el;if(_77.override){if(_77.override===true){_78=_77.obj;}else{_78=_77.override;}}_77.fn.call(_78,_77.obj);delete _28[i];}}else{_76.push(_77);}}}_27=(_76.length===0)?0:_27-1;if(_75){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;return true;},purgeElement:function(el,_79,_80){var _81=this.getListeners(el,_80);if(_81){for(var i=0,len=_81.length;i<len;++i){var l=_81[i];this.removeListener(el,l.type,l.fn);}}if(_79&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],_79,_80);}}},getListeners:function(el,_83){var _84=[];if(_23&&_23.length>0){for(var i=0,len=_23.length;i<len;++i){var l=_23[i];if(l&&l[this.EL]===el&&(!_83||_83===l[this.TYPE])){_84.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}return (_84.length)?_84:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=_24.length;i<len;++i){l=_24[i];if(l){var _85=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){_85=l[EU.OBJ];}else{_85=l[EU.ADJ_SCOPE];}}l[EU.FN].call(_85,EU.getEvent(e),l[EU.OBJ]);delete _24[i];l=null;_85=null;}}if(_23&&_23.length>0){j=_23.length;while(j){index=j-1;l=_23[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}j=j-1;}l=null;EU.clearCache();}for(i=0,len=_25.length;i<len;++i){delete _25[i][0];delete _25[i];}EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return [dd.scrollTop,dd.scrollLeft];}else{if(db){return [db.scrollTop,db.scrollLeft];}else{return [0,0];}}},_simpleAdd:function(){if(window.addEventListener){return function(el,_87,fn,_88){el.addEventListener(_87,fn,(_88));};}else{if(window.attachEvent){return function(el,_89,fn,_90){el.attachEvent("on"+_89,fn);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,_91,fn,_92){el.removeEventListener(_91,fn,(_92));};}else{if(window.detachEvent){return function(el,_93,fn){el.detachEvent("on"+_93,fn);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(document&&document.body){EU._load();}else{EU._simpleAdd(window,"load",EU._load);}EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(_94,_95,_96,_97){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_94];if(ce){ce.subscribe(_95,_96,_97);}else{this.__yui_subscribers=this.__yui_subscribers||{};var _99=this.__yui_subscribers;if(!_99[_94]){_99[_94]=[];}_99[_94].push({fn:_95,obj:_96,override:_97});}},unsubscribe:function(_100,p_fn,_102){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_100];if(ce){return ce.unsubscribe(p_fn,_102);}else{return false;}},createEvent:function(_103,_104){this.__yui_events=this.__yui_events||{};var opts=_104||{};var _106=this.__yui_events;if(_106[_103]){}else{var _107=opts.scope||this;var _108=opts.silent||null;var ce=new YAHOO.util.CustomEvent(_103,_107,_108,YAHOO.util.CustomEvent.FLAT);_106[_103]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[_103];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}return _106[_103];},fireEvent:function(_110,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_110];if(ce){var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}return ce.fire.apply(ce,args);}else{return null;}},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}return false;}};YAHOO.util.Anim=function(el,attributes,duration,method){if(el){this.init(el,attributes,duration,method);}};YAHOO.util.Anim.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName;return("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(attr,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attr,val,unit){if(this.patterns.noNegatives.test(attr)){val=(val>0)?val:0;}YAHOO.util.Dom.setStyle(this.getEl(),attr,val+unit);},getAttribute:function(attr){var el=this.getEl();var val=YAHOO.util.Dom.getStyle(el,attr);if(val!=='auto'&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);}var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||(YAHOO.util.Dom.getStyle(el,'position')=='absolute'&&pos)){val=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;}return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return'px';}return'';},setRuntimeAttribute:function(attr){var start;var end;var attributes=this.attributes;this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=='undefined');};if(!isset(attributes[attr]['to'])&&!isset(attributes[attr]['by'])){return false;}start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]['by'][i];}}else{end=start+attributes[attr]['by'];}}this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);},init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var actualFrames=0;el=YAHOO.util.Dom.get(el);this.attributes=attributes||{};this.duration=duration||1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.getEl=function(){return el;};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;YAHOO.util.AnimMgr.registerElement(this);};this.stop=function(finish){if(finish){this.currentFrame=this.totalFrames;this._onTween.fire();}YAHOO.util.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var attr in this.attributes){this.setRuntimeAttribute(attr);}isAnimated=true;actualFrames=0;startTime=new Date();};var onTween=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){return('duration: '+data.duration+', currentFrame: '+data.currentFrame);};this.onTween.fire(data);var runtimeAttributes=this.runtimeAttributes;for(var attr in runtimeAttributes){this.setAttribute(attr,this.doMethod(attr,runtimeAttributes[attr].start,runtimeAttributes[attr].end),runtimeAttributes[attr].unit);}actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new YAHOO.util.CustomEvent('_start',this,true);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this,true);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onComplete=new YAHOO.util.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=200;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){tween._onComplete.fire();index=index||getIndex(tween);if(index!=-1){queue.splice(index,1);}tweenCount-=1;if(tweenCount<=0){this.stop();}};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){if(queue[i].isAnimated()){this.unRegister(tween,i);}}queue=[];thread=null;tweenCount=0;}else{this.unRegister(tween);}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null){tween.currentFrame+=1;if(tween.useSeconds){correctFrame(tween);}tween._onTween.fire();}else{YAHOO.util.AnimMgr.stop(tween,i);}}};var getIndex=function(anim){for(var i=0,len=queue.length;i<len;++i){if(queue[i]==anim){return i;}}return-1;};var correctFrame=function(tween){var frames=tween.totalFrames;var frame=tween.currentFrame;var expected=(tween.currentFrame*tween.duration*1000/tween.totalFrames);var elapsed=(new Date()-tween.getStartTime());var tweak=0;if(elapsed<tween.duration*1000){tweak=Math.round((elapsed/expected-1)*tween.currentFrame);}else{tweak=frames-(frame+1);}if(tweak>0&&isFinite(tweak)){if(tween.currentFrame+tweak>=frames){tweak=frames-(frame+1);}tween.currentFrame+=tweak;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(points,t){var n=points.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[points[i][0],points[i][1]];}for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}return[tmp[0][0],tmp[0][1]];};};(function(){YAHOO.util.ColorAnim=function(el,attributes,duration,method){YAHOO.util.ColorAnim.superclass.constructor.call(this,el,attributes,duration,method);};YAHOO.extend(YAHOO.util.ColorAnim,YAHOO.util.Anim);var Y=YAHOO.util;var superclass=Y.ColorAnim.superclass;var proto=Y.ColorAnim.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("ColorAnim "+id);};proto.patterns.color=/color$/i;proto.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;proto.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;proto.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;proto.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;proto.parseColor=function(s){if(s.length==3){return s;}var c=this.patterns.hex.exec(s);if(c&&c.length==4){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}c=this.patterns.rgb.exec(s);if(c&&c.length==4){return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}c=this.patterns.hex3.exec(s);if(c&&c.length==4){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}return null;};proto.getAttribute=function(attr){var el=this.getEl();if(this.patterns.color.test(attr)){var val=YAHOO.util.Dom.getStyle(el,attr);if(this.patterns.transparent.test(val)){var parent=el.parentNode;val=Y.Dom.getStyle(parent,attr);while(parent&&this.patterns.transparent.test(val)){parent=parent.parentNode;val=Y.Dom.getStyle(parent,attr);if(parent.tagName.toUpperCase()=='HTML'){val='#fff';}}}}else{val=superclass.getAttribute.call(this,attr);}return val;};proto.doMethod=function(attr,start,end){var val;if(this.patterns.color.test(attr)){val=[];for(var i=0,len=start.length;i<len;++i){val[i]=superclass.doMethod.call(this,attr,start[i],end[i]);}val='rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')';}else{val=superclass.doMethod.call(this,attr,start,end);}return val;};proto.setRuntimeAttribute=function(attr){superclass.setRuntimeAttribute.call(this,attr);if(this.patterns.color.test(attr)){var attributes=this.attributes;var start=this.parseColor(this.runtimeAttributes[attr].start);var end=this.parseColor(this.runtimeAttributes[attr].end);if(typeof attributes[attr]['to']==='undefined'&&typeof attributes[attr]['by']!=='undefined'){end=this.parseColor(attributes[attr].by);for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+end[i];}}this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;}};})();YAHOO.util.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(!a||a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(!a||a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(!a||a<Math.abs(c)){a=c;var s=p/4;}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-YAHOO.util.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},bounceBoth:function(t,b,c,d){if(t<d/2)return YAHOO.util.Easing.bounceIn(t*2,0,c,d)*.5+b;return YAHOO.util.Easing.bounceOut(t*2-d,0,c,d)*.5+c*.5+b;}};(function(){YAHOO.util.Motion=function(el,attributes,duration,method){if(el){YAHOO.util.Motion.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Motion,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Motion.superclass;var proto=Y.Motion.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Motion "+id);};proto.patterns.points=/^points$/i;proto.setAttribute=function(attr,val,unit){if(this.patterns.points.test(attr)){unit=unit||'px';superclass.setAttribute.call(this,'left',val[0],unit);superclass.setAttribute.call(this,'top',val[1],unit);}else{superclass.setAttribute.call(this,attr,val,unit);}};proto.getAttribute=function(attr){if(this.patterns.points.test(attr)){var val=[superclass.getAttribute.call(this,'left'),superclass.getAttribute.call(this,'top')];}else{val=superclass.getAttribute.call(this,attr);}return val;};proto.doMethod=function(attr,start,end){var val=null;if(this.patterns.points.test(attr)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;val=Y.Bezier.getPosition(this.runtimeAttributes[attr],t);}else{val=superclass.doMethod.call(this,attr,start,end);}return val;};proto.setRuntimeAttribute=function(attr){if(this.patterns.points.test(attr)){var el=this.getEl();var attributes=this.attributes;var start;var control=attributes['points']['control']||[];var end;var i,len;if(control.length>0&&!(control[0]instanceof Array)){control=[control];}else{var tmp=[];for(i=0,len=control.length;i<len;++i){tmp[i]=control[i];}control=tmp;}if(Y.Dom.getStyle(el,'position')=='static'){Y.Dom.setStyle(el,'position','relative');}if(isset(attributes['points']['from'])){Y.Dom.setXY(el,attributes['points']['from']);}else{Y.Dom.setXY(el,Y.Dom.getXY(el));}start=this.getAttribute('points');if(isset(attributes['points']['to'])){end=translateValues.call(this,attributes['points']['to'],start);var pageXY=Y.Dom.getXY(this.getEl());for(i=0,len=control.length;i<len;++i){control[i]=translateValues.call(this,control[i],start);}}else if(isset(attributes['points']['by'])){end=[start[0]+attributes['points']['by'][0],start[1]+attributes['points']['by'][1]];for(i=0,len=control.length;i<len;++i){control[i]=[start[0]+control[i][0],start[1]+control[i][1]];}}this.runtimeAttributes[attr]=[start];if(control.length>0){this.runtimeAttributes[attr]=this.runtimeAttributes[attr].concat(control);}this.runtimeAttributes[attr][this.runtimeAttributes[attr].length]=end;}else{superclass.setRuntimeAttribute.call(this,attr);}};var translateValues=function(val,start){var pageXY=Y.Dom.getXY(this.getEl());val=[val[0]-pageXY[0]+start[0],val[1]-pageXY[1]+start[1]];return val;};var isset=function(prop){return(typeof prop!=='undefined');};})();(function(){YAHOO.util.Scroll=function(el,attributes,duration,method){if(el){YAHOO.util.Scroll.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Scroll,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Scroll.superclass;var proto=Y.Scroll.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Scroll "+id);};proto.doMethod=function(attr,start,end){var val=null;if(attr=='scroll'){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=superclass.doMethod.call(this,attr,start,end);}return val;};proto.getAttribute=function(attr){var val=null;var el=this.getEl();if(attr=='scroll'){val=[el.scrollLeft,el.scrollTop];}else{val=superclass.getAttribute.call(this,attr);}return val;};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};})();(function(){var _1=YAHOO.util.Event;var _2=YAHOO.util.Dom;YAHOO.util.DragDrop=function(id,_4,_5){if(id){this.init(id,_4,_5);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=_2.get(this.id);}return this._domRef;},getDragEl:function(){return _2.get(this.dragElId);},init:function(id,_9,_10){this.initTarget(id,_9,_10);_1.on(this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,_11,_12){this.config=_12||{};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}this.id=id;this.addToGroup((_11)?_11:"default");this.handleElId=id;_1.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(_13,_14,_15,_16){if(!_14&&0!==_14){this.padding=[_13,_13,_13,_13];}else{if(!_15&&0!==_15){this.padding=[_13,_14,_13,_14];}else{this.padding=[_13,_14,_15,_16];}}},setInitPosition:function(_17,_18){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}var dx=_17||0;var dy=_18||0;var p=_2.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||_2.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(_24){this.groups[_24]=true;this.DDM.regDragDrop(this,_24);},removeFromGroup:function(_25){if(this.groups[_25]){delete this.groups[_25];}this.DDM.removeDDFromGroup(this,_25);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}_1.on(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){_1.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return (this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var _27=e.which||e.button;if(this.primaryButtonOnly&&_27>1){return;}if(this.isLocked()){return;}this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(_1.getPageX(e),_1.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var _29=_1.getTarget(e);return (this.isValidHandleChild(_29)&&(this.id==this.handleElId||this.DDM.handleWasClicked(_29,this.id)));},addInvalidHandleType:function(_30){var _31=_30.toUpperCase();this.invalidHandleTypes[_31]=_31;},addInvalidHandleId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(_32){this.invalidHandleClasses.push(_32);},removeInvalidHandleType:function(_33){var _34=_33.toUpperCase();delete this.invalidHandleTypes[_34];},removeInvalidHandleId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=_2.generateId(id);}delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(_35){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==_35){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(_37){var _38=true;var _39;try{_39=_37.nodeName.toUpperCase();}catch(e){_39=_37.nodeName;}_38=_38&&!this.invalidHandleTypes[_39];_38=_38&&!this.invalidHandleIds[_37.id];for(var i=0,len=this.invalidHandleClasses.length;_38&&i<len;++i){_38=!_2.hasClass(_37,this.invalidHandleClasses[i]);}return _38;},setXTicks:function(_40,_41){this.xTicks=[];this.xTickSize=_41;var _42={};for(var i=this.initPageX;i>=this.minX;i=i-_41){if(!_42[i]){this.xTicks[this.xTicks.length]=i;_42[i]=true;}}for(i=this.initPageX;i<=this.maxX;i=i+_41){if(!_42[i]){this.xTicks[this.xTicks.length]=i;_42[i]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(_43,_44){this.yTicks=[];this.yTickSize=_44;var _45={};for(var i=this.initPageY;i>=this.minY;i=i-_44){if(!_45[i]){this.yTicks[this.yTicks.length]=i;_45[i]=true;}}for(i=this.initPageY;i<=this.maxY;i=i+_44){if(!_45[i]){this.yTicks[this.yTicks.length]=i;_45[i]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(_46,_47,_48){this.leftConstraint=_46;this.rightConstraint=_47;this.minX=this.initPageX-_46;this.maxX=this.initPageX+_47;if(_48){this.setXTicks(this.initPageX,_48);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,_50,_51){this.topConstraint=iUp;this.bottomConstraint=_50;this.minY=this.initPageY-iUp;this.maxY=this.initPageY+_50;if(_51){this.setYTicks(this.initPageY,_51);}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,_53){if(!_53){return val;}else{if(_53[0]>=val){return _53[0];}else{for(var i=0,len=_53.length;i<len;++i){var _54=i+1;if(_53[_54]&&_53[_54]>=val){var _55=val-_53[i];var _56=_53[_54]-val;return (_56>_55)?_53[i]:_53[_54];}}return _53[_53.length-1];}}},toString:function(){return ("DragDrop "+this.id);}};})();if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var _57=YAHOO.util.Event;return {ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initalized:false,locked:false,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,mode:0,_execOnAll:function(_58,_59){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;}oDD[_58].apply(oDD,_59);}}},_onLoad:function(){this.init();_57.on(document,"mouseup",this.handleMouseUp,this,true);_57.on(document,"mousemove",this.handleMouseMove,this,true);_57.on(window,"unload",this._onUnload,this,true);_57.on(window,"resize",this._onResize,this,true);},_onResize:function(e){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(oDD,_61){if(!this.initialized){this.init();}if(!this.ids[_61]){this.ids[_61]={};}this.ids[_61][oDD.id]=oDD;},removeDDFromGroup:function(oDD,_62){if(!this.ids[_62]){this.ids[_62]={};}var obj=this.ids[_62];if(obj&&obj[oDD.id]){delete obj[oDD.id];}},_remove:function(oDD){for(var g in oDD.groups){if(g&&this.ids[g][oDD.id]){delete this.ids[g][oDD.id];}}delete this.handleIds[oDD.id];},regHandle:function(_65,_66){if(!this.handleIds[_65]){this.handleIds[_65]={};}this.handleIds[_65][_66]=_66;},isDragDrop:function(id){return (this.getDDById(id))?true:false;},getRelated:function(_67,_68){var _69=[];for(var i in _67.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}if(!_68||dd.isTarget){_69[_69.length]=dd;}}}return _69;},isLegalTarget:function(oDD,_71){var _72=this.getRelated(oDD,true);for(var i=0,len=_72.length;i<len;++i){if(_72[i].id==_71.id){return true;}}return false;},isTypeOfDD:function(oDD){return (oDD&&oDD.__ygDragDrop);},isHandle:function(_73,_74){return (this.handleIds[_73]&&this.handleIds[_73][_74]);},getDDById:function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}return null;},handleMouseDown:function(e,oDD){this.currentTarget=YAHOO.util.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=YAHOO.util.Event.getPageX(e);this.startY=YAHOO.util.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX,DDM.startY);},this.clickTimeThresh);},startDrag:function(x,y){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(x,y);this.dragCurrent.startDrag(x,y);}this.dragThreshMet=true;},handleMouseUp:function(e){if(!this.dragCurrent){return;}clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(e,true);}else{}this.stopDrag(e);this.stopEvent(e);},stopEvent:function(e){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(e);}if(this.preventDefault){YAHOO.util.Event.preventDefault(e);}},stopDrag:function(e){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}this.dragCurrent.onMouseUp(e);}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e){if(!this.dragCurrent){return true;}if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}if(!this.dragThreshMet){var _76=Math.abs(this.startX-YAHOO.util.Event.getPageX(e));var _77=Math.abs(this.startY-YAHOO.util.Event.getPageY(e));if(_76>this.clickPixelThresh||_77>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);this.fireEvents(e,false);}this.stopEvent(e);return true;},fireEvents:function(e,_78){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var _80=[];var _81=[];var _82=[];var _83=[];var _84=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}if(!this.isOverTarget(pt,ddo,this.mode)){_81.push(ddo);}_80[i]=true;delete this.dragOvers[i];}for(var _86 in dc.groups){if("string"!=typeof _86){continue;}for(i in this.ids[_86]){var oDD=this.ids[_86][i];if(!this.isTypeOfDD(oDD)){continue;}if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode)){if(_78){_83.push(oDD);}else{if(!_80[oDD.id]){_84.push(oDD);}else{_82.push(oDD);}this.dragOvers[oDD.id]=oDD;}}}}}if(this.mode){if(_81.length){dc.b4DragOut(e,_81);dc.onDragOut(e,_81);}if(_84.length){dc.onDragEnter(e,_84);}if(_82.length){dc.b4DragOver(e,_82);dc.onDragOver(e,_82);}if(_83.length){dc.b4DragDrop(e,_83);dc.onDragDrop(e,_83);}}else{var len=0;for(i=0,len=_81.length;i<len;++i){dc.b4DragOut(e,_81[i].id);dc.onDragOut(e,_81[i].id);}for(i=0,len=_84.length;i<len;++i){dc.onDragEnter(e,_84[i].id);}for(i=0,len=_82.length;i<len;++i){dc.b4DragOver(e,_82[i].id);dc.onDragOver(e,_82[i].id);}for(i=0,len=_83.length;i<len;++i){dc.b4DragDrop(e,_83[i].id);dc.onDragDrop(e,_83[i].id);}}if(_78&&!_83.length){dc.onInvalidDrop(e);}},getBestMatch:function(dds){var _89=null;var len=dds.length;if(len==1){_89=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(dd.cursorIsOver){_89=dd;break;}else{if(!_89||_89.overlap.getArea()<dd.overlap.getArea()){_89=dd;}}}}return _89;},refreshCache:function(_90){for(var _91 in _90){if("string"!=typeof _91){continue;}for(var i in this.ids[_91]){var oDD=this.ids[_91][i];if(this.isTypeOfDD(oDD)){var loc=this.getLocation(oDD);if(loc){this.locationCache[oDD.id]=loc;}else{delete this.locationCache[oDD.id];}}}}},verifyEl:function(el){try{if(el){var _93=el.offsetParent;if(_93){return true;}}}catch(e){}return false;},getLocation:function(oDD){if(!this.isTypeOfDD(oDD)){return null;}var el=oDD.getEl(),pos,x1,x2,y1,y2,t,r,b,l;try{pos=YAHOO.util.Dom.getXY(el);}catch(e){}if(!pos){return null;}x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);},isOverTarget:function(pt,_94,_95){var loc=this.locationCache[_94.id];if(!loc||!this.useCache){loc=this.getLocation(_94);this.locationCache[_94.id]=loc;}if(!loc){return false;}_94.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||!dc.getTargetCoord||(!_95&&!dc.constrainX&&!dc.constrainY)){return _94.cursorIsOver;}_94.overlap=null;var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();var _96=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var _97=_96.intersect(loc);if(_97){_94.overlap=_97;return (_95)?true:_94.cursorIsOver;}else{return false;}},_onUnload:function(e,me){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);for(i in this.elementCache){delete this.elementCache[i];}this.elementCache={};this.ids={};},elementCache:{},getElWrapper:function(id){var _99=this.elementCache[id];if(!_99||!_99.el){_99=this.elementCache[id]=new this.ElementWrapper(YAHOO.util.Dom.get(id));}return _99;},getElement:function(id){return YAHOO.util.Dom.get(id);},getCss:function(id){var el=YAHOO.util.Dom.get(id);return (el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return YAHOO.util.Dom.getX(el);},getPosY:function(el){return YAHOO.util.Dom.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else{if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}}},getScroll:function(){var t,l,dde=document.documentElement,db=document.body;if(dde&&(dde.scrollTop||dde.scrollLeft)){t=dde.scrollTop;l=dde.scrollLeft;}else{if(db){t=db.scrollTop;l=db.scrollLeft;}else{YAHOO.log("could not get scroll property");}}return {top:t,left:l};},getStyle:function(el,_104){return YAHOO.util.Dom.getStyle(el,_104);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(_105,_106){var _107=YAHOO.util.Dom.getXY(_106);YAHOO.util.Dom.setXY(_105,_107);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(a,b){return (a-b);},_timeoutCount:0,_addListeners:function(){var DDM=YAHOO.util.DDM;if(YAHOO.util.Event&&document){DDM._onLoad();}else{if(DDM._timeoutCount>2000){}else{setTimeout(DDM._addListeners,10);if(document&&document.body){DDM._timeoutCount+=1;}}}},handleWasClicked:function(node,id){if(this.isHandle(id,node.id)){return true;}else{var p=node.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}YAHOO.util.DD=function(id,_111,_112){if(id){this.init(id,_111,_112);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(_113,_114){var x=_113-this.startPageX;var y=_114-this.startPageY;this.setDelta(x,y);},setDelta:function(_115,_116){this.deltaX=_115;this.deltaY=_116;},setDragElPos:function(_117,_118){var el=this.getDragEl();this.alignElWithMouse(el,_117,_118);},alignElWithMouse:function(el,_119,_120){var _121=this.getTargetCoord(_119,_120);if(!this.deltaSetXY){var _122=[_121.x,_121.y];YAHOO.util.Dom.setXY(el,_122);var _123=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var _124=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[_123-_121.x,_124-_121.y];}else{YAHOO.util.Dom.setStyle(el,"left",(_121.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(_121.y+this.deltaSetXY[1])+"px");}this.cachePosition(_121.x,_121.y);this.autoScroll(_121.x,_121.y,el.offsetHeight,el.offsetWidth);},cachePosition:function(_125,_126){if(_125){this.lastPageX=_125;this.lastPageY=_126;}else{var _127=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=_127[0];this.lastPageY=_127[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var _130=this.DDM.getClientHeight();var _131=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var _135=w+x;var _136=(_130+st-y-this.deltaY);var _137=(_131+sl-x-this.deltaX);var _138=40;var _139=(document.all)?80:30;if(bot>_130&&_136<_138){window.scrollTo(sl,st+_139);}if(y<st&&st>0&&y-st<_138){window.scrollTo(sl,st-_139);}if(_135>_131&&_137<_138){window.scrollTo(sl+_139,st);}if(x<sl&&sl>0&&x-sl<_138){window.scrollTo(sl-_139,st);}}},getTargetCoord:function(_140,_141){var x=_140-this.deltaX;var y=_141-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}if(x>this.maxX){x=this.maxX;}}if(this.constrainY){if(y<this.minY){y=this.minY;}if(y>this.maxY){y=this.maxY;}}x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return {x:x,y:y};},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){this.autoOffset(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},b4Drag:function(e){this.setDragElPos(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},toString:function(){return ("DD "+this.id);}});YAHOO.util.DDProxy=function(id,_142,_143){if(id){this.init(id,_142,_143);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this;var body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}var div=this.getDragEl();if(!div){div=document.createElement("div");div.id=this.dragElId;var s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;body.insertBefore(div,body.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(_147,_148){var el=this.getEl();var _149=this.getDragEl();var s=_149.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}this.setDragElPos(_147,_148);YAHOO.util.Dom.setStyle(_149,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var DOM=YAHOO.util.Dom;var el=this.getEl();var _151=this.getDragEl();var bt=parseInt(DOM.getStyle(_151,"borderTopWidth"),10);var br=parseInt(DOM.getStyle(_151,"borderRightWidth"),10);var bb=parseInt(DOM.getStyle(_151,"borderBottomWidth"),10);var bl=parseInt(DOM.getStyle(_151,"borderLeftWidth"),10);if(isNaN(bt)){bt=0;}if(isNaN(br)){br=0;}if(isNaN(bb)){bb=0;}if(isNaN(bl)){bl=0;}var _156=Math.max(0,el.offsetWidth-br-bl);var _157=Math.max(0,el.offsetHeight-bt-bb);DOM.setStyle(_151,"width",_156+"px");DOM.setStyle(_151,"height",_157+"px");}},b4MouseDown:function(e){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);this.setDragElPos(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(e){var DOM=YAHOO.util.Dom;var lel=this.getEl();var del=this.getDragEl();DOM.setStyle(del,"visibility","");DOM.setStyle(lel,"visibility","hidden");YAHOO.util.DDM.moveToEl(lel,del);DOM.setStyle(del,"visibility","hidden");DOM.setStyle(lel,"visibility","");},toString:function(){return ("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(id,_160,_161){if(id){this.initTarget(id,_160,_161);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return ("DDTarget "+this.id);}});\r
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txtversion: 0.12.1 */\r
+if(typeof YAHOO=="undefined"){var YAHOO={};}\r
+YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;++i){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}\r
+return o;};YAHOO.log=function(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.extend=function(subc,superc,overrides){var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;}\r
+if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}}};YAHOO.augment=function(r,s){var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i<a.length;++i){rp[a[i]]=sp[a[i]];}}else{for(p in sp){if(!rp[p]){rp[p]=sp[p];}}}};YAHOO.namespace("util","widget","example");\r
+\r
+(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={};var ua=navigator.userAgent.toLowerCase(),isOpera=(ua.indexOf('opera')>-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);var patterns={HYPHEN:/(-[a-z])/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}\r
+if(propertyCache[property]){return propertyCache[property];}\r
+while(patterns.HYPHEN.exec(property)){property=property.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}\r
+propertyCache[property]=property;return property;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}\r
+return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}\r
+return val/100;break;default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};}\r
+if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}\r
+break;default:el.style[property]=val;}};}else{setStyle=function(el,property,val){el.style[property]=val;};}\r
+YAHOO.util.Dom={get:function(el){if(!el){return null;}\r
+if(typeof el!='string'&&!(el instanceof Array)){return el;}\r
+if(typeof el=='string'){return document.getElementById(el);}\r
+else{var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=Y.Dom.get(el[i]);}\r
+return collection;}\r
+return null;},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if(el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none'){return false;}\r
+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;}}\r
+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];}\r
+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;}}\r
+if(isSafari&&this.getStyle(el,'position')=='absolute'){pos[0]-=document.body.offsetLeft;pos[1]-=document.body.offsetTop;}}\r
+if(el.parentNode){parentNode=el.parentNode;}\r
+else{parentNode=null;}\r
+while(parentNode&&parentNode.tagName.toUpperCase()!='BODY'&&parentNode.tagName.toUpperCase()!='HTML')\r
+{if(Y.Dom.getStyle(parentNode,'display')!='inline'){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}\r
+if(parentNode.parentNode){parentNode=parentNode.parentNode;}else{parentNode=null;}}\r
+return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative';}\r
+var pageXY=this.getXY(el);if(pageXY===false){return false;}\r
+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;}\r
+if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop;}\r
+if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}\r
+if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}\r
+if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true);}}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var region=new Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root){var method=function(el){return Y.Dom.hasClass(el,className);};return Y.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 Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return;}\r
+el['className']=[el['className'],className].join(' ');};Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,className)){return;}\r
+var c=el['className'];el['className']=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}};Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(oldClassName===newClassName){return false;}\r
+var re=new RegExp('(?:^|\\s+)'+oldClassName+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return;}\r
+el['className']=el['className'].replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}};Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';el=el||{};var f=function(el){if(el){el=Y.Dom.get(el);}else{el={};}\r
+if(!el.id){el.id=prefix+id_counter++;}\r
+return el.id;};return Y.Dom.batch(el,f,Y.Dom,true);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false;}\r
+var f=function(needle){if(haystack.contains&&!isSafari){return haystack.contains(needle);}\r
+else if(haystack.compareDocumentPosition){return!!(haystack.compareDocumentPosition(needle)&16);}\r
+else{var parent=needle.parentNode;while(parent){if(parent==haystack){return true;}\r
+else if(!parent.tagName||parent.tagName.toUpperCase()=='HTML'){return false;}\r
+parent=parent.parentNode;}\r
+return false;}};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root){tag=tag||'*';var nodes=[];if(root){root=Y.Dom.get(root);if(!root){return nodes;}}else{root=document;}\r
+var elements=root.getElementsByTagName(tag);if(!elements.length&&(tag=='*'&&root.all)){elements=root.all;}\r
+for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];}}\r
+return nodes;},batch:function(el,method,o,override){var id=el;el=Y.Dom.get(el);var scope=(override)?o:window;if(!el||el.tagName||!el.length){if(!el){return false;}\r
+return method.call(scope,el,o);}\r
+var collection=[];for(var i=0,len=el.length;i<len;++i){if(!el[i]){id=el[i];}\r
+collection[collection.length]=method.call(scope,el[i],o);}\r
+return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}\r
+return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}\r
+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&®ion.right<=this.right&®ion.top>=this.top&®ion.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];}\r
+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();\r
+\r
+YAHOO.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this.scope=oScope||window;this.silent=silent;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}\r
+var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);}\r
+this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}\r
+return found;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}\r
+var args=[],ret=true,i;for(i=0;i<arguments.length;++i){args.push(arguments[i]);}\r
+var argslength=args.length;if(!this.silent){}\r
+for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}\r
+var scope=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var param=null;if(args.length>0){param=args[0];}\r
+ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);}\r
+if(false===ret){if(!this.silent){}\r
+return false;}}}\r
+return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}\r
+this.subscribers.splice(index,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=obj||null;this.override=override;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}\r
+return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;return{POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ: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)),_interval:null,startInterval:function(){if(!this._interval){var self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:false});retryCount=this.POLL_RETRYS;this.startInterval();},onContentReady:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:true});retryCount=this.POLL_RETRYS;this.startInterval();},addListener:function(el,sType,fn,obj,override){if(!fn||!fn.call){return false;}\r
+if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=this.on(el[i],sType,fn,obj,override)&&ok;}\r
+return ok;}else if(typeof el=="string"){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,sType,fn,obj,override);});return true;}}\r
+if(!el){return false;}\r
+if("unload"==sType&&obj!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,obj,override];return true;}\r
+var scope=el;if(override){if(override===true){scope=obj;}else{scope=override;}}\r
+var wrappedFn=function(e){return fn.call(scope,YAHOO.util.Event.getEvent(e),obj);};var li=[el,sType,fn,wrappedFn,scope];var index=listeners.length;listeners[index]=li;if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1||el!=legacyEvents[legacyIndex][0]){legacyIndex=legacyEvents.length;legacyMap[el.id+sType]=legacyIndex;legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];legacyHandlers[legacyIndex]=[];el["on"+sType]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),legacyIndex);};}\r
+legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(e){this.removeListener(el,sType,fn);return false;}}\r
+return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true;var le=legacyHandlers[legacyIndex];for(var i=0,len=le.length;i<len;++i){var li=le[i];if(li&&li[this.WFN]){var scope=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}\r
+return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(!el.addEventListener&&!el.attachEvent){return true;}else if(this.isSafari){if("click"==sType||"dblclick"==sType){return true;}}\r
+return false;},removeListener:function(el,sType,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],sType,fn)&&ok);}\r
+return ok;}\r
+if(!fn||!fn.call){return this.purgeElement(el,false,sType);}\r
+if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners.splice(i,1);return true;}}\r
+return false;}\r
+var cacheItem=null;var index=arguments[3];if("undefined"==typeof index){index=this._getCacheIndex(el,sType,fn);}\r
+if(index>=0){cacheItem=listeners[index];}\r
+if(!el||!cacheItem){return false;}\r
+if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist.splice(i,1);break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(e){return false;}}\r
+delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners.splice(index,1);return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}\r
+return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}\r
+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;}}\r
+return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}\r
+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;}\r
+c=c.caller;}}\r
+return ev;},getCharCode:function(ev){return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}\r
+return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}\r
+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(){},_load:function(e){loadComplete=true;var EU=YAHOO.util.Event;if(this.isIE){EU._simpleRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}\r
+this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0);}\r
+var notAvail=[];for(var i=0,len=onAvailStack.length;i<len;++i){var item=onAvailStack[i];if(item){var el=this.getEl(item.id);if(el){if(!item.checkReady||loadComplete||el.nextSibling||(document&&document.body)){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}\r
+item.fn.call(scope,item.obj);onAvailStack[i]=null;}}else{notAvail.push(item);}}}\r
+retryCount=(notAvail.length===0)?0:retryCount-1;if(tryAgain){onAvailStack=notAvail;this.startInterval();}else{clearInterval(this._interval);this._interval=null;}\r
+this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn);}}\r
+if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var elListeners=[];if(listeners&&listeners.length>0){for(var i=0,len=listeners.length;i<len;++i){var l=listeners[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){elListeners.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}\r
+return(elListeners.length)?elListeners:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=unloadListeners.length;i<len;++i){l=unloadListeners[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else{scope=l[EU.ADJ_SCOPE];}}\r
+l[EU.FN].call(scope,EU.getEvent(e),l[EU.OBJ]);unloadListeners[i]=null;l=null;scope=null;}}\r
+unloadListeners=null;if(listeners&&listeners.length>0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}\r
+j=j-1;}\r
+l=null;EU.clearCache();}\r
+for(i=0,len=legacyEvents.length;i<len;++i){legacyEvents[i][0]=null;legacyEvents[i]=null;}\r
+legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(document&&document.body){EU._load();}else{EU._simpleAdd(window,"load",EU._load);}\r
+EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}\r
+YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,p_override){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];}\r
+subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}else{return false;}},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=opts.silent||null;var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}\r
+this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}\r
+return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}\r
+return ce.fire.apply(ce,args);}else{return null;}},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}\r
+return false;}};\r
+\r
+YAHOO.util.Anim=function(el,attributes,duration,method){if(el){this.init(el,attributes,duration,method);}};YAHOO.util.Anim.prototype={toString:function(){var el=this.getEl();var id=el.id||el.tagName;return("Anim "+id);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(attr,start,end){return this.method(this.currentFrame,start,end-start,this.totalFrames);},setAttribute:function(attr,val,unit){if(this.patterns.noNegatives.test(attr)){val=(val>0)?val:0;}\r
+YAHOO.util.Dom.setStyle(this.getEl(),attr,val+unit);},getAttribute:function(attr){var el=this.getEl();var val=YAHOO.util.Dom.getStyle(el,attr);if(val!=='auto'&&!this.patterns.offsetUnit.test(val)){return parseFloat(val);}\r
+var a=this.patterns.offsetAttribute.exec(attr)||[];var pos=!!(a[3]);var box=!!(a[2]);if(box||(YAHOO.util.Dom.getStyle(el,'position')=='absolute'&&pos)){val=el['offset'+a[0].charAt(0).toUpperCase()+a[0].substr(1)];}else{val=0;}\r
+return val;},getDefaultUnit:function(attr){if(this.patterns.defaultUnit.test(attr)){return'px';}\r
+return'';},setRuntimeAttribute:function(attr){var start;var end;var attributes=this.attributes;this.runtimeAttributes[attr]={};var isset=function(prop){return(typeof prop!=='undefined');};if(!isset(attributes[attr]['to'])&&!isset(attributes[attr]['by'])){return false;}\r
+start=(isset(attributes[attr]['from']))?attributes[attr]['from']:this.getAttribute(attr);if(isset(attributes[attr]['to'])){end=attributes[attr]['to'];}else if(isset(attributes[attr]['by'])){if(start.constructor==Array){end=[];for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+attributes[attr]['by'][i];}}else{end=start+attributes[attr]['by'];}}\r
+this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;this.runtimeAttributes[attr].unit=(isset(attributes[attr].unit))?attributes[attr]['unit']:this.getDefaultUnit(attr);},init:function(el,attributes,duration,method){var isAnimated=false;var startTime=null;var actualFrames=0;el=YAHOO.util.Dom.get(el);this.attributes=attributes||{};this.duration=duration||1;this.method=method||YAHOO.util.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=YAHOO.util.AnimMgr.fps;this.getEl=function(){return el;};this.isAnimated=function(){return isAnimated;};this.getStartTime=function(){return startTime;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}\r
+this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(YAHOO.util.AnimMgr.fps*this.duration):this.duration;YAHOO.util.AnimMgr.registerElement(this);};this.stop=function(finish){if(finish){this.currentFrame=this.totalFrames;this._onTween.fire();}\r
+YAHOO.util.AnimMgr.stop(this);};var onStart=function(){this.onStart.fire();this.runtimeAttributes={};for(var attr in this.attributes){this.setRuntimeAttribute(attr);}\r
+isAnimated=true;actualFrames=0;startTime=new Date();};var onTween=function(){var data={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};data.toString=function(){return('duration: '+data.duration+', currentFrame: '+data.currentFrame);};this.onTween.fire(data);var runtimeAttributes=this.runtimeAttributes;for(var attr in runtimeAttributes){this.setAttribute(attr,this.doMethod(attr,runtimeAttributes[attr].start,runtimeAttributes[attr].end),runtimeAttributes[attr].unit);}\r
+actualFrames+=1;};var onComplete=function(){var actual_duration=(new Date()-startTime)/1000;var data={duration:actual_duration,frames:actualFrames,fps:actualFrames/actual_duration};data.toString=function(){return('duration: '+data.duration+', frames: '+data.frames+', fps: '+data.fps);};isAnimated=false;actualFrames=0;this.onComplete.fire(data);};this._onStart=new YAHOO.util.CustomEvent('_start',this,true);this.onStart=new YAHOO.util.CustomEvent('start',this);this.onTween=new YAHOO.util.CustomEvent('tween',this);this._onTween=new YAHOO.util.CustomEvent('_tween',this,true);this.onComplete=new YAHOO.util.CustomEvent('complete',this);this._onComplete=new YAHOO.util.CustomEvent('_complete',this,true);this._onStart.subscribe(onStart);this._onTween.subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=200;this.delay=1;this.registerElement=function(tween){queue[queue.length]=tween;tweenCount+=1;tween._onStart.fire();this.start();};this.unRegister=function(tween,index){tween._onComplete.fire();index=index||getIndex(tween);if(index!=-1){queue.splice(index,1);}\r
+tweenCount-=1;if(tweenCount<=0){this.stop();}};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){if(queue[i].isAnimated()){this.unRegister(tween,i);}}\r
+queue=[];thread=null;tweenCount=0;}\r
+else{this.unRegister(tween);}};this.run=function(){for(var i=0,len=queue.length;i<len;++i){var tween=queue[i];if(!tween||!tween.isAnimated()){continue;}\r
+if(tween.currentFrame<tween.totalFrames||tween.totalFrames===null)\r
+{tween.currentFrame+=1;if(tween.useSeconds){correctFrame(tween);}\r
+tween._onTween.fire();}\r
+else{YAHOO.util.AnimMgr.stop(tween,i);}}};var getIndex=function(anim){for(var i=0,len=queue.length;i<len;++i){if(queue[i]==anim){return i;}}\r
+return-1;};var correctFrame=function(tween){var frames=tween.totalFrames;var frame=tween.currentFrame;var expected=(tween.currentFrame*tween.duration*1000/tween.totalFrames);var elapsed=(new Date()-tween.getStartTime());var tweak=0;if(elapsed<tween.duration*1000){tweak=Math.round((elapsed/expected-1)*tween.currentFrame);}else{tweak=frames-(frame+1);}\r
+if(tweak>0&&isFinite(tweak)){if(tween.currentFrame+tweak>=frames){tweak=frames-(frame+1);}\r
+tween.currentFrame+=tweak;}};};YAHOO.util.Bezier=new function()\r
+{this.getPosition=function(points,t)\r
+{var n=points.length;var tmp=[];for(var i=0;i<n;++i){tmp[i]=[points[i][0],points[i][1]];}\r
+for(var j=1;j<n;++j){for(i=0;i<n-j;++i){tmp[i][0]=(1-t)*tmp[i][0]+t*tmp[parseInt(i+1,10)][0];tmp[i][1]=(1-t)*tmp[i][1]+t*tmp[parseInt(i+1,10)][1];}}\r
+return[tmp[0][0],tmp[0][1]];};};(function(){YAHOO.util.ColorAnim=function(el,attributes,duration,method){YAHOO.util.ColorAnim.superclass.constructor.call(this,el,attributes,duration,method);};YAHOO.extend(YAHOO.util.ColorAnim,YAHOO.util.Anim);var Y=YAHOO.util;var superclass=Y.ColorAnim.superclass;var proto=Y.ColorAnim.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("ColorAnim "+id);};proto.patterns.color=/color$/i;proto.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;proto.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;proto.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;proto.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;proto.parseColor=function(s){if(s.length==3){return s;}\r
+var c=this.patterns.hex.exec(s);if(c&&c.length==4){return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];}\r
+c=this.patterns.rgb.exec(s);if(c&&c.length==4){return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];}\r
+c=this.patterns.hex3.exec(s);if(c&&c.length==4){return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];}\r
+return null;};proto.getAttribute=function(attr){var el=this.getEl();if(this.patterns.color.test(attr)){var val=YAHOO.util.Dom.getStyle(el,attr);if(this.patterns.transparent.test(val)){var parent=el.parentNode;val=Y.Dom.getStyle(parent,attr);while(parent&&this.patterns.transparent.test(val)){parent=parent.parentNode;val=Y.Dom.getStyle(parent,attr);if(parent.tagName.toUpperCase()=='HTML'){val='#fff';}}}}else{val=superclass.getAttribute.call(this,attr);}\r
+return val;};proto.doMethod=function(attr,start,end){var val;if(this.patterns.color.test(attr)){val=[];for(var i=0,len=start.length;i<len;++i){val[i]=superclass.doMethod.call(this,attr,start[i],end[i]);}\r
+val='rgb('+Math.floor(val[0])+','+Math.floor(val[1])+','+Math.floor(val[2])+')';}\r
+else{val=superclass.doMethod.call(this,attr,start,end);}\r
+return val;};proto.setRuntimeAttribute=function(attr){superclass.setRuntimeAttribute.call(this,attr);if(this.patterns.color.test(attr)){var attributes=this.attributes;var start=this.parseColor(this.runtimeAttributes[attr].start);var end=this.parseColor(this.runtimeAttributes[attr].end);if(typeof attributes[attr]['to']==='undefined'&&typeof attributes[attr]['by']!=='undefined'){end=this.parseColor(attributes[attr].by);for(var i=0,len=start.length;i<len;++i){end[i]=start[i]+end[i];}}\r
+this.runtimeAttributes[attr].start=start;this.runtimeAttributes[attr].end=end;}};})();YAHOO.util.Easing={easeNone:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(!a||a<Math.abs(c)){a=c;var s=p/4;}\r
+else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(!a||a<Math.abs(c)){a=c;var s=p/4;}\r
+else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(!a||a<Math.abs(c)){a=c;var s=p/4;}\r
+else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=='undefined')s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-YAHOO.util.Easing.bounceOut(d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},bounceBoth:function(t,b,c,d){if(t<d/2)return YAHOO.util.Easing.bounceIn(t*2,0,c,d)*.5+b;return YAHOO.util.Easing.bounceOut(t*2-d,0,c,d)*.5+c*.5+b;}};(function(){YAHOO.util.Motion=function(el,attributes,duration,method){if(el){YAHOO.util.Motion.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Motion,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Motion.superclass;var proto=Y.Motion.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Motion "+id);};proto.patterns.points=/^points$/i;proto.setAttribute=function(attr,val,unit){if(this.patterns.points.test(attr)){unit=unit||'px';superclass.setAttribute.call(this,'left',val[0],unit);superclass.setAttribute.call(this,'top',val[1],unit);}else{superclass.setAttribute.call(this,attr,val,unit);}};proto.getAttribute=function(attr){if(this.patterns.points.test(attr)){var val=[superclass.getAttribute.call(this,'left'),superclass.getAttribute.call(this,'top')];}else{val=superclass.getAttribute.call(this,attr);}\r
+return val;};proto.doMethod=function(attr,start,end){var val=null;if(this.patterns.points.test(attr)){var t=this.method(this.currentFrame,0,100,this.totalFrames)/100;val=Y.Bezier.getPosition(this.runtimeAttributes[attr],t);}else{val=superclass.doMethod.call(this,attr,start,end);}\r
+return val;};proto.setRuntimeAttribute=function(attr){if(this.patterns.points.test(attr)){var el=this.getEl();var attributes=this.attributes;var start;var control=attributes['points']['control']||[];var end;var i,len;if(control.length>0&&!(control[0]instanceof Array)){control=[control];}else{var tmp=[];for(i=0,len=control.length;i<len;++i){tmp[i]=control[i];}\r
+control=tmp;}\r
+if(Y.Dom.getStyle(el,'position')=='static'){Y.Dom.setStyle(el,'position','relative');}\r
+if(isset(attributes['points']['from'])){Y.Dom.setXY(el,attributes['points']['from']);}\r
+else{Y.Dom.setXY(el,Y.Dom.getXY(el));}\r
+start=this.getAttribute('points');if(isset(attributes['points']['to'])){end=translateValues.call(this,attributes['points']['to'],start);var pageXY=Y.Dom.getXY(this.getEl());for(i=0,len=control.length;i<len;++i){control[i]=translateValues.call(this,control[i],start);}}else if(isset(attributes['points']['by'])){end=[start[0]+attributes['points']['by'][0],start[1]+attributes['points']['by'][1]];for(i=0,len=control.length;i<len;++i){control[i]=[start[0]+control[i][0],start[1]+control[i][1]];}}\r
+this.runtimeAttributes[attr]=[start];if(control.length>0){this.runtimeAttributes[attr]=this.runtimeAttributes[attr].concat(control);}\r
+this.runtimeAttributes[attr][this.runtimeAttributes[attr].length]=end;}\r
+else{superclass.setRuntimeAttribute.call(this,attr);}};var translateValues=function(val,start){var pageXY=Y.Dom.getXY(this.getEl());val=[val[0]-pageXY[0]+start[0],val[1]-pageXY[1]+start[1]];return val;};var isset=function(prop){return(typeof prop!=='undefined');};})();(function(){YAHOO.util.Scroll=function(el,attributes,duration,method){if(el){YAHOO.util.Scroll.superclass.constructor.call(this,el,attributes,duration,method);}};YAHOO.extend(YAHOO.util.Scroll,YAHOO.util.ColorAnim);var Y=YAHOO.util;var superclass=Y.Scroll.superclass;var proto=Y.Scroll.prototype;proto.toString=function(){var el=this.getEl();var id=el.id||el.tagName;return("Scroll "+id);};proto.doMethod=function(attr,start,end){var val=null;if(attr=='scroll'){val=[this.method(this.currentFrame,start[0],end[0]-start[0],this.totalFrames),this.method(this.currentFrame,start[1],end[1]-start[1],this.totalFrames)];}else{val=superclass.doMethod.call(this,attr,start,end);}\r
+return val;};proto.getAttribute=function(attr){var val=null;var el=this.getEl();if(attr=='scroll'){val=[el.scrollLeft,el.scrollTop];}else{val=superclass.getAttribute.call(this,attr);}\r
+return val;};proto.setAttribute=function(attr,val,unit){var el=this.getEl();if(attr=='scroll'){el.scrollLeft=val[0];el.scrollTop=val[1];}else{superclass.setAttribute.call(this,attr,val,unit);}};})();\r
+\r
+(function(){var Event=YAHOO.util.Event;var Dom=YAHOO.util.Dom;YAHOO.util.DragDrop=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.util.DragDrop.prototype={id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){},startDrag:function(x,y){},b4Drag:function(e){},onDrag:function(e){},onDragEnter:function(e,id){},b4DragOver:function(e){},onDragOver:function(e,id){},b4DragOut:function(e){},onDragOut:function(e,id){},b4DragDrop:function(e){},onDragDrop:function(e,id){},onInvalidDrop:function(e){},b4EndDrag:function(e){},endDrag:function(e){},b4MouseDown:function(e){},onMouseDown:function(e){},onMouseUp:function(e){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=Dom.get(this.id);}\r
+return this._domRef;},getDragEl:function(){return Dom.get(this.dragElId);},init:function(id,sGroup,config){this.initTarget(id,sGroup,config);Event.on(this.id,"mousedown",this.handleMouseDown,this,true);},initTarget:function(id,sGroup,config){this.config=config||{};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.generateId(id);}\r
+this.id=id;this.addToGroup((sGroup)?sGroup:"default");this.handleElId=id;Event.onAvailable(id,this.handleOnAvailable,this,true);this.setDragElId(id);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(iTop,iRight,iBot,iLeft){if(!iRight&&0!==iRight){this.padding=[iTop,iTop,iTop,iTop];}else if(!iBot&&0!==iBot){this.padding=[iTop,iRight,iTop,iRight];}else{this.padding=[iTop,iRight,iBot,iLeft];}},setInitPosition:function(diffX,diffY){var el=this.getEl();if(!this.DDM.verifyEl(el)){return;}\r
+var dx=diffX||0;var dy=diffY||0;var p=Dom.getXY(el);this.initPageX=p[0]-dx;this.initPageY=p[1]-dy;this.lastPageX=p[0];this.lastPageY=p[1];this.setStartPosition(p);},setStartPosition:function(pos){var p=pos||Dom.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=p[0];this.startPageY=p[1];},addToGroup:function(sGroup){this.groups[sGroup]=true;this.DDM.regDragDrop(this,sGroup);},removeFromGroup:function(sGroup){if(this.groups[sGroup]){delete this.groups[sGroup];}\r
+this.DDM.removeDDFromGroup(this,sGroup);},setDragElId:function(id){this.dragElId=id;},setHandleElId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.generateId(id);}\r
+this.handleElId=id;this.DDM.regHandle(this.id,id);},setOuterHandleElId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.generateId(id);}\r
+Event.on(id,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(id);this.hasOuterHandles=true;},unreg:function(){Event.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(e,oDD){var button=e.which||e.button;if(this.primaryButtonOnly&&button>1){return;}\r
+if(this.isLocked()){return;}\r
+this.DDM.refreshCache(this.groups);var pt=new YAHOO.util.Point(Event.getPageX(e),Event.getPageY(e));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(pt,this)){}else{if(this.clickValidator(e)){this.setStartPosition();this.b4MouseDown(e);this.onMouseDown(e);this.DDM.handleMouseDown(e,this);this.DDM.stopEvent(e);}else{}}},clickValidator:function(e){var target=Event.getTarget(e);return(this.isValidHandleChild(target)&&(this.id==this.handleElId||this.DDM.handleWasClicked(target,this.id)));},addInvalidHandleType:function(tagName){var type=tagName.toUpperCase();this.invalidHandleTypes[type]=type;},addInvalidHandleId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.generateId(id);}\r
+this.invalidHandleIds[id]=id;},addInvalidHandleClass:function(cssClass){this.invalidHandleClasses.push(cssClass);},removeInvalidHandleType:function(tagName){var type=tagName.toUpperCase();delete this.invalidHandleTypes[type];},removeInvalidHandleId:function(id){if(typeof id!=="string"){YAHOO.log("id is not a string, assuming it is an HTMLElement");id=Dom.generateId(id);}\r
+delete this.invalidHandleIds[id];},removeInvalidHandleClass:function(cssClass){for(var i=0,len=this.invalidHandleClasses.length;i<len;++i){if(this.invalidHandleClasses[i]==cssClass){delete this.invalidHandleClasses[i];}}},isValidHandleChild:function(node){var valid=true;var nodeName;try{nodeName=node.nodeName.toUpperCase();}catch(e){nodeName=node.nodeName;}\r
+valid=valid&&!this.invalidHandleTypes[nodeName];valid=valid&&!this.invalidHandleIds[node.id];for(var i=0,len=this.invalidHandleClasses.length;valid&&i<len;++i){valid=!Dom.hasClass(node,this.invalidHandleClasses[i]);}\r
+return valid;},setXTicks:function(iStartX,iTickSize){this.xTicks=[];this.xTickSize=iTickSize;var tickMap={};for(var i=this.initPageX;i>=this.minX;i=i-iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}\r
+for(i=this.initPageX;i<=this.maxX;i=i+iTickSize){if(!tickMap[i]){this.xTicks[this.xTicks.length]=i;tickMap[i]=true;}}\r
+this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(iStartY,iTickSize){this.yTicks=[];this.yTickSize=iTickSize;var tickMap={};for(var i=this.initPageY;i>=this.minY;i=i-iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}\r
+for(i=this.initPageY;i<=this.maxY;i=i+iTickSize){if(!tickMap[i]){this.yTicks[this.yTicks.length]=i;tickMap[i]=true;}}\r
+this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(iLeft,iRight,iTickSize){this.leftConstraint=iLeft;this.rightConstraint=iRight;this.minX=this.initPageX-iLeft;this.maxX=this.initPageX+iRight;if(iTickSize){this.setXTicks(this.initPageX,iTickSize);}\r
+this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(iUp,iDown,iTickSize){this.topConstraint=iUp;this.bottomConstraint=iDown;this.minY=this.initPageY-iUp;this.maxY=this.initPageY+iDown;if(iTickSize){this.setYTicks(this.initPageY,iTickSize);}\r
+this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var dx=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var dy=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(dx,dy);}else{this.setInitPosition();}\r
+if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}\r
+if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(val,tickArray){if(!tickArray){return val;}else if(tickArray[0]>=val){return tickArray[0];}else{for(var i=0,len=tickArray.length;i<len;++i){var next=i+1;if(tickArray[next]&&tickArray[next]>=val){var diff1=val-tickArray[i];var diff2=tickArray[next]-val;return(diff2>diff1)?tickArray[i]:tickArray[next];}}\r
+return tickArray[tickArray.length-1];}},toString:function(){return("DragDrop "+this.id);}};})();if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var Event=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initalized:false,locked:false,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(sMethod,args){for(var i in this.ids){for(var j in this.ids[i]){var oDD=this.ids[i][j];if(!this.isTypeOfDD(oDD)){continue;}\r
+oDD[sMethod].apply(oDD,args);}}},_onLoad:function(){this.init();Event.on(document,"mouseup",this.handleMouseUp,this,true);Event.on(document,"mousemove",this.handleMouseMove,this,true);Event.on(window,"unload",this._onUnload,this,true);Event.on(window,"resize",this._onResize,this,true);},_onResize:function(e){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,regDragDrop:function(oDD,sGroup){if(!this.initialized){this.init();}\r
+if(!this.ids[sGroup]){this.ids[sGroup]={};}\r
+this.ids[sGroup][oDD.id]=oDD;},removeDDFromGroup:function(oDD,sGroup){if(!this.ids[sGroup]){this.ids[sGroup]={};}\r
+var obj=this.ids[sGroup];if(obj&&obj[oDD.id]){delete obj[oDD.id];}},_remove:function(oDD){for(var g in oDD.groups){if(g&&this.ids[g][oDD.id]){delete this.ids[g][oDD.id];}}\r
+delete this.handleIds[oDD.id];},regHandle:function(sDDId,sHandleId){if(!this.handleIds[sDDId]){this.handleIds[sDDId]={};}\r
+this.handleIds[sDDId][sHandleId]=sHandleId;},isDragDrop:function(id){return(this.getDDById(id))?true:false;},getRelated:function(p_oDD,bTargetsOnly){var oDDs=[];for(var i in p_oDD.groups){for(j in this.ids[i]){var dd=this.ids[i][j];if(!this.isTypeOfDD(dd)){continue;}\r
+if(!bTargetsOnly||dd.isTarget){oDDs[oDDs.length]=dd;}}}\r
+return oDDs;},isLegalTarget:function(oDD,oTargetDD){var targets=this.getRelated(oDD,true);for(var i=0,len=targets.length;i<len;++i){if(targets[i].id==oTargetDD.id){return true;}}\r
+return false;},isTypeOfDD:function(oDD){return(oDD&&oDD.__ygDragDrop);},isHandle:function(sDDId,sHandleId){return(this.handleIds[sDDId]&&this.handleIds[sDDId][sHandleId]);},getDDById:function(id){for(var i in this.ids){if(this.ids[i][id]){return this.ids[i][id];}}\r
+return null;},handleMouseDown:function(e,oDD){this.currentTarget=YAHOO.util.Event.getTarget(e);this.dragCurrent=oDD;var el=oDD.getEl();this.startX=YAHOO.util.Event.getPageX(e);this.startY=YAHOO.util.Event.getPageY(e);this.deltaX=this.startX-el.offsetLeft;this.deltaY=this.startY-el.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var DDM=YAHOO.util.DDM;DDM.startDrag(DDM.startX,DDM.startY);},this.clickTimeThresh);},startDrag:function(x,y){clearTimeout(this.clickTimeout);if(this.dragCurrent){this.dragCurrent.b4StartDrag(x,y);this.dragCurrent.startDrag(x,y);}\r
+this.dragThreshMet=true;},handleMouseUp:function(e){if(!this.dragCurrent){return;}\r
+clearTimeout(this.clickTimeout);if(this.dragThreshMet){this.fireEvents(e,true);}else{}\r
+this.stopDrag(e);this.stopEvent(e);},stopEvent:function(e){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(e);}\r
+if(this.preventDefault){YAHOO.util.Event.preventDefault(e);}},stopDrag:function(e){if(this.dragCurrent){if(this.dragThreshMet){this.dragCurrent.b4EndDrag(e);this.dragCurrent.endDrag(e);}\r
+this.dragCurrent.onMouseUp(e);}\r
+this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(e){if(!this.dragCurrent){return true;}\r
+if(YAHOO.util.Event.isIE&&!e.button){this.stopEvent(e);return this.handleMouseUp(e);}\r
+if(!this.dragThreshMet){var diffX=Math.abs(this.startX-YAHOO.util.Event.getPageX(e));var diffY=Math.abs(this.startY-YAHOO.util.Event.getPageY(e));if(diffX>this.clickPixelThresh||diffY>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}\r
+if(this.dragThreshMet){this.dragCurrent.b4Drag(e);this.dragCurrent.onDrag(e);this.fireEvents(e,false);}\r
+this.stopEvent(e);return true;},fireEvents:function(e,isDrop){var dc=this.dragCurrent;if(!dc||dc.isLocked()){return;}\r
+var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);var pt=new YAHOO.util.Point(x,y);var oldOvers=[];var outEvts=[];var overEvts=[];var dropEvts=[];var enterEvts=[];for(var i in this.dragOvers){var ddo=this.dragOvers[i];if(!this.isTypeOfDD(ddo)){continue;}\r
+if(!this.isOverTarget(pt,ddo,this.mode)){outEvts.push(ddo);}\r
+oldOvers[i]=true;delete this.dragOvers[i];}\r
+for(var sGroup in dc.groups){if("string"!=typeof sGroup){continue;}\r
+for(i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(!this.isTypeOfDD(oDD)){continue;}\r
+if(oDD.isTarget&&!oDD.isLocked()&&oDD!=dc){if(this.isOverTarget(pt,oDD,this.mode)){if(isDrop){dropEvts.push(oDD);}else{if(!oldOvers[oDD.id]){enterEvts.push(oDD);}else{overEvts.push(oDD);}\r
+this.dragOvers[oDD.id]=oDD;}}}}}\r
+if(this.mode){if(outEvts.length){dc.b4DragOut(e,outEvts);dc.onDragOut(e,outEvts);}\r
+if(enterEvts.length){dc.onDragEnter(e,enterEvts);}\r
+if(overEvts.length){dc.b4DragOver(e,overEvts);dc.onDragOver(e,overEvts);}\r
+if(dropEvts.length){dc.b4DragDrop(e,dropEvts);dc.onDragDrop(e,dropEvts);}}else{var len=0;for(i=0,len=outEvts.length;i<len;++i){dc.b4DragOut(e,outEvts[i].id);dc.onDragOut(e,outEvts[i].id);}\r
+for(i=0,len=enterEvts.length;i<len;++i){dc.onDragEnter(e,enterEvts[i].id);}\r
+for(i=0,len=overEvts.length;i<len;++i){dc.b4DragOver(e,overEvts[i].id);dc.onDragOver(e,overEvts[i].id);}\r
+for(i=0,len=dropEvts.length;i<len;++i){dc.b4DragDrop(e,dropEvts[i].id);dc.onDragDrop(e,dropEvts[i].id);}}\r
+if(isDrop&&!dropEvts.length){dc.onInvalidDrop(e);}},getBestMatch:function(dds){var winner=null;var len=dds.length;if(len==1){winner=dds[0];}else{for(var i=0;i<len;++i){var dd=dds[i];if(this.mode==this.INTERSECT&&dd.cursorIsOver){winner=dd;break;}else{if(!winner||!winner.overlap||(dd.overlap&&winner.overlap.getArea()<dd.overlap.getArea())){winner=dd;}}}}\r
+return winner;},refreshCache:function(groups){for(var sGroup in groups){if("string"!=typeof sGroup){continue;}\r
+for(var i in this.ids[sGroup]){var oDD=this.ids[sGroup][i];if(this.isTypeOfDD(oDD)){var loc=this.getLocation(oDD);if(loc){this.locationCache[oDD.id]=loc;}else{delete this.locationCache[oDD.id];}}}}},verifyEl:function(el){try{if(el){var parent=el.offsetParent;if(parent){return true;}}}catch(e){}\r
+return false;},getLocation:function(oDD){if(!this.isTypeOfDD(oDD)){return null;}\r
+var el=oDD.getEl(),pos,x1,x2,y1,y2,t,r,b,l;try{pos=YAHOO.util.Dom.getXY(el);}catch(e){}\r
+if(!pos){return null;}\r
+x1=pos[0];x2=x1+el.offsetWidth;y1=pos[1];y2=y1+el.offsetHeight;t=y1-oDD.padding[0];r=x2+oDD.padding[1];b=y2+oDD.padding[2];l=x1-oDD.padding[3];return new YAHOO.util.Region(t,r,b,l);},isOverTarget:function(pt,oTarget,intersect){var loc=this.locationCache[oTarget.id];if(!loc||!this.useCache){loc=this.getLocation(oTarget);this.locationCache[oTarget.id]=loc;}\r
+if(!loc){return false;}\r
+oTarget.cursorIsOver=loc.contains(pt);var dc=this.dragCurrent;if(!dc||!dc.getTargetCoord||(!intersect&&!dc.constrainX&&!dc.constrainY)){return oTarget.cursorIsOver;}\r
+oTarget.overlap=null;var pos=dc.getTargetCoord(pt.x,pt.y);var el=dc.getDragEl();var curRegion=new YAHOO.util.Region(pos.y,pos.x+el.offsetWidth,pos.y+el.offsetHeight,pos.x);var overlap=curRegion.intersect(loc);if(overlap){oTarget.overlap=overlap;return(intersect)?true:oTarget.cursorIsOver;}else{return false;}},_onUnload:function(e,me){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}\r
+this._execOnAll("unreg",[]);for(i in this.elementCache){delete this.elementCache[i];}\r
+this.elementCache={};this.ids={};},elementCache:{},getElWrapper:function(id){var oWrapper=this.elementCache[id];if(!oWrapper||!oWrapper.el){oWrapper=this.elementCache[id]=new this.ElementWrapper(YAHOO.util.Dom.get(id));}\r
+return oWrapper;},getElement:function(id){return YAHOO.util.Dom.get(id);},getCss:function(id){var el=YAHOO.util.Dom.get(id);return(el)?el.style:null;},ElementWrapper:function(el){this.el=el||null;this.id=this.el&&el.id;this.css=this.el&&el.style;},getPosX:function(el){return YAHOO.util.Dom.getX(el);},getPosY:function(el){return YAHOO.util.Dom.getY(el);},swapNode:function(n1,n2){if(n1.swapNode){n1.swapNode(n2);}else{var p=n2.parentNode;var s=n2.nextSibling;if(s==n1){p.insertBefore(n1,n2);}else if(n2==n1.nextSibling){p.insertBefore(n2,n1);}else{n1.parentNode.replaceChild(n2,n1);p.insertBefore(n1,s);}}},getScroll:function(){var t,l,dde=document.documentElement,db=document.body;if(dde&&(dde.scrollTop||dde.scrollLeft)){t=dde.scrollTop;l=dde.scrollLeft;}else if(db){t=db.scrollTop;l=db.scrollLeft;}else{YAHOO.log("could not get scroll property");}\r
+return{top:t,left:l};},getStyle:function(el,styleProp){return YAHOO.util.Dom.getStyle(el,styleProp);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(moveEl,targetEl){var aCoord=YAHOO.util.Dom.getXY(targetEl);YAHOO.util.Dom.setXY(moveEl,aCoord);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(a,b){return(a-b);},_timeoutCount:0,_addListeners:function(){var DDM=YAHOO.util.DDM;if(YAHOO.util.Event&&document){DDM._onLoad();}else{if(DDM._timeoutCount>2000){}else{setTimeout(DDM._addListeners,10);if(document&&document.body){DDM._timeoutCount+=1;}}}},handleWasClicked:function(node,id){if(this.isHandle(id,node.id)){return true;}else{var p=node.parentNode;while(p){if(this.isHandle(id,p.id)){return true;}else{p=p.parentNode;}}}\r
+return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}\r
+YAHOO.util.DD=function(id,sGroup,config){if(id){this.init(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(iPageX,iPageY){var x=iPageX-this.startPageX;var y=iPageY-this.startPageY;this.setDelta(x,y);},setDelta:function(iDeltaX,iDeltaY){this.deltaX=iDeltaX;this.deltaY=iDeltaY;},setDragElPos:function(iPageX,iPageY){var el=this.getDragEl();this.alignElWithMouse(el,iPageX,iPageY);},alignElWithMouse:function(el,iPageX,iPageY){var oCoord=this.getTargetCoord(iPageX,iPageY);if(!this.deltaSetXY){var aCoord=[oCoord.x,oCoord.y];YAHOO.util.Dom.setXY(el,aCoord);var newLeft=parseInt(YAHOO.util.Dom.getStyle(el,"left"),10);var newTop=parseInt(YAHOO.util.Dom.getStyle(el,"top"),10);this.deltaSetXY=[newLeft-oCoord.x,newTop-oCoord.y];}else{YAHOO.util.Dom.setStyle(el,"left",(oCoord.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(el,"top",(oCoord.y+this.deltaSetXY[1])+"px");}\r
+this.cachePosition(oCoord.x,oCoord.y);this.autoScroll(oCoord.x,oCoord.y,el.offsetHeight,el.offsetWidth);},cachePosition:function(iPageX,iPageY){if(iPageX){this.lastPageX=iPageX;this.lastPageY=iPageY;}else{var aCoord=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=aCoord[0];this.lastPageY=aCoord[1];}},autoScroll:function(x,y,h,w){if(this.scroll){var clientH=this.DDM.getClientHeight();var clientW=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=40;var scrAmt=(document.all)?80:30;if(bot>clientH&&toBot<thresh){window.scrollTo(sl,st+scrAmt);}\r
+if(y<st&&st>0&&y-st<thresh){window.scrollTo(sl,st-scrAmt);}\r
+if(right>clientW&&toRight<thresh){window.scrollTo(sl+scrAmt,st);}\r
+if(x<sl&&sl>0&&x-sl<thresh){window.scrollTo(sl-scrAmt,st);}}},getTargetCoord:function(iPageX,iPageY){var x=iPageX-this.deltaX;var y=iPageY-this.deltaY;if(this.constrainX){if(x<this.minX){x=this.minX;}\r
+if(x>this.maxX){x=this.maxX;}}\r
+if(this.constrainY){if(y<this.minY){y=this.minY;}\r
+if(y>this.maxY){y=this.maxY;}}\r
+x=this.getTick(x,this.xTicks);y=this.getTick(y,this.yTicks);return{x:x,y:y};},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(e){this.autoOffset(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},b4Drag:function(e){this.setDragElPos(YAHOO.util.Event.getPageX(e),YAHOO.util.Event.getPageY(e));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(id,sGroup,config){if(id){this.init(id,sGroup,config);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var self=this;var body=document.body;if(!body||!body.firstChild){setTimeout(function(){self.createFrame();},50);return;}\r
+var div=this.getDragEl();if(!div){div=document.createElement("div");div.id=this.dragElId;var s=div.style;s.position="absolute";s.visibility="hidden";s.cursor="move";s.border="2px solid #aaa";s.zIndex=999;body.insertBefore(div,body.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(iPageX,iPageY){var el=this.getEl();var dragEl=this.getDragEl();var s=dragEl.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(s.width,10)/2),Math.round(parseInt(s.height,10)/2));}\r
+this.setDragElPos(iPageX,iPageY);YAHOO.util.Dom.setStyle(dragEl,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var DOM=YAHOO.util.Dom;var el=this.getEl();var dragEl=this.getDragEl();var bt=parseInt(DOM.getStyle(dragEl,"borderTopWidth"),10);var br=parseInt(DOM.getStyle(dragEl,"borderRightWidth"),10);var bb=parseInt(DOM.getStyle(dragEl,"borderBottomWidth"),10);var bl=parseInt(DOM.getStyle(dragEl,"borderLeftWidth"),10);if(isNaN(bt)){bt=0;}\r
+if(isNaN(br)){br=0;}\r
+if(isNaN(bb)){bb=0;}\r
+if(isNaN(bl)){bl=0;}\r
+var newWidth=Math.max(0,el.offsetWidth-br-bl);var newHeight=Math.max(0,el.offsetHeight-bt-bb);DOM.setStyle(dragEl,"width",newWidth+"px");DOM.setStyle(dragEl,"height",newHeight+"px");}},b4MouseDown:function(e){var x=YAHOO.util.Event.getPageX(e);var y=YAHOO.util.Event.getPageY(e);this.autoOffset(x,y);this.setDragElPos(x,y);},b4StartDrag:function(x,y){this.showFrame(x,y);},b4EndDrag:function(e){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(e){var DOM=YAHOO.util.Dom;var lel=this.getEl();var del=this.getDragEl();DOM.setStyle(del,"visibility","");DOM.setStyle(lel,"visibility","hidden");YAHOO.util.DDM.moveToEl(lel,del);DOM.setStyle(del,"visibility","hidden");DOM.setStyle(lel,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(id,sGroup,config){if(id){this.initTarget(id,sGroup,config);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});\r
+\r
YAHOO.util.Connect={_msxml_progid:['MSXML2.XMLHTTP.3.0','MSXML2.XMLHTTP','Microsoft.XMLHTTP'],_http_header:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:'application/x-www-form-urlencoded',_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,setProgId:function(id)\r
{this._msxml_progid.unshift(id);},setDefaultPostHeader:function(b)\r
{this._use_default_post_header=b;},setPollingInterval:function(i)\r
else if(typeof secureURI=='string'){io.src=secureUri;}}\r
else{var io=document.createElement('iframe');io.id=frameId;io.name=frameId;}\r
io.style.position='absolute';io.style.top='-1000px';io.style.left='-1000px';document.body.appendChild(io);},appendPostData:function(postData)\r
-{var formElements=new Array();var postMessage=postData.split('&');for(var i=0;i<postMessage.length;i++){var delimitPos=postMessage[i].indexOf('=');if(delimitPos!=-1){formElements[i]=document.createElement('input');formElements[i].type='hidden';formElements[i].name=postMessage[i].substring(0,delimitPos);formElements[i].value=postMessage[i].substring(delimitPos+1);this._formNode.appendChild(formElements[i]);}}\r
+{var formElements=[];var postMessage=postData.split('&');for(var i=0;i<postMessage.length;i++){var delimitPos=postMessage[i].indexOf('=');if(delimitPos!=-1){formElements[i]=document.createElement('input');formElements[i].type='hidden';formElements[i].name=postMessage[i].substring(0,delimitPos);formElements[i].value=postMessage[i].substring(delimitPos+1);this._formNode.appendChild(formElements[i]);}}\r
return formElements;},uploadFile:function(id,callback,uri,postData){var frameId='yuiIO'+id;var io=document.getElementById(frameId);this._formNode.action=uri;this._formNode.method='POST';this._formNode.target=frameId;if(this._formNode.encoding){this._formNode.encoding='multipart/form-data';}\r
else{this._formNode.enctype='multipart/form-data';}\r
if(postData){var oElements=this.appendPostData(postData);}\r
yahoo-event-dom.js Release Notes\r
\r
+*** version 0.12.1 ***\r
+\r
+ * Includes 0.12.1 revisions to yahoo.js, event.js, and dom.js.\r
+\r
*** version 0.12.0 ***\r
\r
The yahoo-event-dom.js file rolls up the three most commonly-used YUI Utilities\r
into a single file; it includes the following files:\r
\r
* Yahoo Global Object\r
-* Event\r
* Dom\r
+* Event\r
\r
These three files serve as a common foundation for most YUI components and\r
third-party implementations. On pages where you do not need additional YUI\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txtversion: 0.12.0 */ if(typeof YAHOO=="undefined"){var YAHOO={};}YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;++i){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}return o;};YAHOO.log=function(_2,_3,_4){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(_2,_3,_4);}else{return false;}};YAHOO.extend=function(_6,_7,_8){var F=function(){};F.prototype=_7.prototype;_6.prototype=new F();_6.prototype.constructor=_6;_6.superclass=_7.prototype;if(_7.prototype.constructor==Object.prototype.constructor){_7.prototype.constructor=_7;}if(_8){for(var i in _8){_6.prototype[i]=_8[i];}}};YAHOO.augment=function(r,s){var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i<a.length;++i){rp[a[i]]=sp[a[i]];}}else{for(p in sp){if(!rp[p]){rp[p]=sp[p];}}}};YAHOO.namespace("util","widget","example");(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={};var ua=navigator.userAgent.toLowerCase(),isOpera=(ua.indexOf('opera')>-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);var patterns={HYPHEN:/(-[a-z])/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}if(propertyCache[property]){return propertyCache[property];}while(patterns.HYPHEN.exec(property)){property=property.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}propertyCache[property]=property;return property;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}return val/100;break;default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};}if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}break;default:el.style[property]=val;}};}else{setStyle=function(el,property,val){el.style[property]=val;};}YAHOO.util.Dom={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]=Y.Dom.get(el[i]);}return collection;}return null;},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if(el.parentNode===null||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'){if(Y.Dom.getStyle(parentNode,'display')!='inline'){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}if(parentNode.parentNode){parentNode=parentNode.parentNode;}else{parentNode=null;}}return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){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);}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var region=new Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root){var method=function(el){return Y.Dom.hasClass(el,className);};return Y.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 Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return;}el['className']=[el['className'],className].join(' ');};Y.Dom.batch(el,f,Y.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);}};Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(oldClassName===newClassName){return false;}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);}};Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';el=el||{};var f=function(el){if(el){el=Y.Dom.get(el);}else{el={};}if(!el.id){el.id=prefix+id_counter++;}return el.id;};return Y.Dom.batch(el,f,Y.Dom,true);},isAncestor:function(haystack,needle){haystack=Y.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||parent.tagName.toUpperCase()=='HTML'){return false;}parent=parent.parentNode;}return false;}};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root){tag=tag||'*';root=Y.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=Y.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=el[i];}collection[collection.length]=method.call(scope,el[i],o);}return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}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&®ion.right<=this.right&®ion.top>=this.top&®ion.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();YAHOO.util.CustomEvent=function(_1,_2,_3,_4){this.type=_1;this.scope=_2||window;this.silent=_3;this.signature=_4||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var _5="_YUICEOnSubscribe";if(_1!==_5){this.subscribeEvent=new YAHOO.util.CustomEvent(_5,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,_7,_8){if(this.subscribeEvent){this.subscribeEvent.fire(fn,_7,_8);}this.subscribers.push(new YAHOO.util.Subscriber(fn,_7,_8));},unsubscribe:function(fn,_9){var _10=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,_9)){this._delete(i);_10=true;}}return _10;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}var _14=[],ret=true,i;for(i=0;i<arguments.length;++i){_14.push(arguments[i]);}var _15=_14.length;if(!this.silent){}for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}var _16=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var _17=null;if(_14.length>0){_17=_14[0];}ret=s.fn.call(_16,_17,s.obj);}else{ret=s.fn.call(_16,this.type,_14,s.obj);}if(false===ret){if(!this.silent){}return false;}}}return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}},_delete:function(_18){var s=this.subscribers[_18];if(s){delete s.fn;delete s.obj;}this.subscribers.splice(_18,1);},toString:function(){return "CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,_20){this.fn=fn;this.obj=obj||null;this.override=_20;};YAHOO.util.Subscriber.prototype.getScope=function(_21){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return _21;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return (this.fn==fn&&this.obj==obj);}else{return (this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return "Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var _22=false;var _23=[];var _24=[];var _25=[];var _26=[];var _27=0;var _28=[];var _29=[];var _30=0;return {POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ: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)),_interval:null,startInterval:function(){if(!this._interval){var _31=this;var _32=function(){_31._tryPreloadAttach();};this._interval=setInterval(_32,this.POLL_INTERVAL);}},onAvailable:function(_33,_34,_35,_36){_28.push({id:_33,fn:_34,obj:_35,override:_36,checkReady:false});_27=this.POLL_RETRYS;this.startInterval();},onContentReady:function(_37,_38,_39,_40){_28.push({id:_37,fn:_38,obj:_39,override:_40,checkReady:true});_27=this.POLL_RETRYS;this.startInterval();},addListener:function(el,_42,fn,obj,_43){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],_42,fn,obj,_43)&&ok;}return ok;}else{if(typeof el=="string"){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,_42,fn,obj,_43);});return true;}}}if(!el){return false;}if("unload"==_42&&obj!==this){_24[_24.length]=[el,_42,fn,obj,_43];return true;}var _46=el;if(_43){if(_43===true){_46=obj;}else{_46=_43;}}var _47=function(e){return fn.call(_46,YAHOO.util.Event.getEvent(e),obj);};var li=[el,_42,fn,_47,_46];var _50=_23.length;_23[_50]=li;if(this.useLegacyEvent(el,_42)){var _51=this.getLegacyIndex(el,_42);if(_51==-1||el!=_25[_51][0]){_51=_25.length;_29[el.id+_42]=_51;_25[_51]=[el,_42,el["on"+_42]];_26[_51]=[];el["on"+_42]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),_51);};}_26[_51].push(li);}else{this._simpleAdd(el,_42,_47,false);}return true;},fireLegacyEvent:function(e,_52){var ok=true;var le=_26[_52];for(var i=0,len=le.length;i<len;++i){var li=le[i];if(li&&li[this.WFN]){var _54=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(_54,e);ok=(ok&&ret);}}return ok;},getLegacyIndex:function(el,_56){var key=this.generateId(el)+_56;if(typeof _29[key]=="undefined"){return -1;}else{return _29[key];}},useLegacyEvent:function(el,_58){if(!el.addEventListener&&!el.attachEvent){return true;}else{if(this.isSafari){if("click"==_58||"dblclick"==_58){return true;}}}return false;},removeListener:function(el,_59,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else{if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],_59,fn)&&ok);}return ok;}}if(!fn||!fn.call){return this.purgeElement(el,false,_59);}if("unload"==_59){for(i=0,len=_24.length;i<len;i++){var li=_24[i];if(li&&li[0]==el&&li[1]==_59&&li[2]==fn){_24.splice(i,1);return true;}}return false;}var _60=null;var _61=arguments[3];if("undefined"==typeof _61){_61=this._getCacheIndex(el,_59,fn);}if(_61>=0){_60=_23[_61];}if(!el||!_60){return false;}if(this.useLegacyEvent(el,_59)){var _62=this.getLegacyIndex(el,_59);var _63=_26[_62];if(_63){for(i=0,len=_63.length;i<len;++i){li=_63[i];if(li&&li[this.EL]==el&&li[this.TYPE]==_59&&li[this.FN]==fn){_63.splice(i,1);}}}}else{this._simpleRemove(el,_59,_60[this.WFN],false);}delete _23[_61][this.WFN];delete _23[_61][this.FN];_23.splice(_61,1);return true;},getTarget:function(ev,_65){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(_67){if(_67&&3==_67.nodeType){return _67.parentNode;}else{return _67;}},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.keyCode||0;},_getCacheIndex:function(el,_71,fn){for(var i=0,len=_23.length;i<len;++i){var li=_23[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==_71){return i;}}return -1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+_30;++_30;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(){},_load:function(e){_22=true;var EU=YAHOO.util.Event;if(this.isIE){EU._simpleRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}this.locked=true;var _75=!_22;if(!_75){_75=(_27>0);}var _76=[];for(var i=0,len=_28.length;i<len;++i){var _77=_28[i];if(_77){var el=this.getEl(_77.id);if(el){if(!_77.checkReady||_22||el.nextSibling||(document&&document.body)){var _78=el;if(_77.override){if(_77.override===true){_78=_77.obj;}else{_78=_77.override;}}_77.fn.call(_78,_77.obj);delete _28[i];}}else{_76.push(_77);}}}_27=(_76.length===0)?0:_27-1;if(_75){this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;return true;},purgeElement:function(el,_79,_80){var _81=this.getListeners(el,_80);if(_81){for(var i=0,len=_81.length;i<len;++i){var l=_81[i];this.removeListener(el,l.type,l.fn);}}if(_79&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],_79,_80);}}},getListeners:function(el,_83){var _84=[];if(_23&&_23.length>0){for(var i=0,len=_23.length;i<len;++i){var l=_23[i];if(l&&l[this.EL]===el&&(!_83||_83===l[this.TYPE])){_84.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}return (_84.length)?_84:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=_24.length;i<len;++i){l=_24[i];if(l){var _85=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){_85=l[EU.OBJ];}else{_85=l[EU.ADJ_SCOPE];}}l[EU.FN].call(_85,EU.getEvent(e),l[EU.OBJ]);delete _24[i];l=null;_85=null;}}if(_23&&_23.length>0){j=_23.length;while(j){index=j-1;l=_23[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}j=j-1;}l=null;EU.clearCache();}for(i=0,len=_25.length;i<len;++i){delete _25[i][0];delete _25[i];}EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return [dd.scrollTop,dd.scrollLeft];}else{if(db){return [db.scrollTop,db.scrollLeft];}else{return [0,0];}}},_simpleAdd:function(){if(window.addEventListener){return function(el,_87,fn,_88){el.addEventListener(_87,fn,(_88));};}else{if(window.attachEvent){return function(el,_89,fn,_90){el.attachEvent("on"+_89,fn);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,_91,fn,_92){el.removeEventListener(_91,fn,(_92));};}else{if(window.detachEvent){return function(el,_93,fn){el.detachEvent("on"+_93,fn);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(document&&document.body){EU._load();}else{EU._simpleAdd(window,"load",EU._load);}EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(_94,_95,_96,_97){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_94];if(ce){ce.subscribe(_95,_96,_97);}else{this.__yui_subscribers=this.__yui_subscribers||{};var _99=this.__yui_subscribers;if(!_99[_94]){_99[_94]=[];}_99[_94].push({fn:_95,obj:_96,override:_97});}},unsubscribe:function(_100,p_fn,_102){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_100];if(ce){return ce.unsubscribe(p_fn,_102);}else{return false;}},createEvent:function(_103,_104){this.__yui_events=this.__yui_events||{};var opts=_104||{};var _106=this.__yui_events;if(_106[_103]){}else{var _107=opts.scope||this;var _108=opts.silent||null;var ce=new YAHOO.util.CustomEvent(_103,_107,_108,YAHOO.util.CustomEvent.FLAT);_106[_103]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[_103];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}return _106[_103];},fireEvent:function(_110,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[_110];if(ce){var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}return ce.fire.apply(ce,args);}else{return null;}},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}return false;}};
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.1 */\r
+if(typeof YAHOO=="undefined"){var YAHOO={};}\r
+YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;++i){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}\r
+return o;};YAHOO.log=function(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.extend=function(subc,superc,overrides){var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;}\r
+if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}}};YAHOO.augment=function(r,s){var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i<a.length;++i){rp[a[i]]=sp[a[i]];}}else{for(p in sp){if(!rp[p]){rp[p]=sp[p];}}}};YAHOO.namespace("util","widget","example");\r
+(function(){var Y=YAHOO.util,getStyle,setStyle,id_counter=0,propertyCache={};var ua=navigator.userAgent.toLowerCase(),isOpera=(ua.indexOf('opera')>-1),isSafari=(ua.indexOf('safari')>-1),isGecko=(!isOpera&&!isSafari&&ua.indexOf('gecko')>-1),isIE=(!isOpera&&ua.indexOf('msie')>-1);var patterns={HYPHEN:/(-[a-z])/i};var toCamel=function(property){if(!patterns.HYPHEN.test(property)){return property;}\r
+if(propertyCache[property]){return propertyCache[property];}\r
+while(patterns.HYPHEN.exec(property)){property=property.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}\r
+propertyCache[property]=property;return property;};if(document.defaultView&&document.defaultView.getComputedStyle){getStyle=function(el,property){var value=null;var computed=document.defaultView.getComputedStyle(el,'');if(computed){value=computed[toCamel(property)];}\r
+return el.style[property]||value;};}else if(document.documentElement.currentStyle&&isIE){getStyle=function(el,property){switch(toCamel(property)){case'opacity':var val=100;try{val=el.filters['DXImageTransform.Microsoft.Alpha'].opacity;}catch(e){try{val=el.filters('alpha').opacity;}catch(e){}}\r
+return val/100;break;default:var value=el.currentStyle?el.currentStyle[property]:null;return(el.style[property]||value);}};}else{getStyle=function(el,property){return el.style[property];};}\r
+if(isIE){setStyle=function(el,property,val){switch(property){case'opacity':if(typeof el.style.filter=='string'){el.style.filter='alpha(opacity='+val*100+')';if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1;}}\r
+break;default:el.style[property]=val;}};}else{setStyle=function(el,property,val){el.style[property]=val;};}\r
+YAHOO.util.Dom={get:function(el){if(!el){return null;}\r
+if(typeof el!='string'&&!(el instanceof Array)){return el;}\r
+if(typeof el=='string'){return document.getElementById(el);}\r
+else{var collection=[];for(var i=0,len=el.length;i<len;++i){collection[collection.length]=Y.Dom.get(el[i]);}\r
+return collection;}\r
+return null;},getStyle:function(el,property){property=toCamel(property);var f=function(element){return getStyle(element,property);};return Y.Dom.batch(el,f,Y.Dom,true);},setStyle:function(el,property,val){property=toCamel(property);var f=function(element){setStyle(element,property,val);};Y.Dom.batch(el,f,Y.Dom,true);},getXY:function(el){var f=function(el){if(el.parentNode===null||el.offsetParent===null||this.getStyle(el,'display')=='none'){return false;}\r
+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;}}\r
+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];}\r
+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;}}\r
+if(isSafari&&this.getStyle(el,'position')=='absolute'){pos[0]-=document.body.offsetLeft;pos[1]-=document.body.offsetTop;}}\r
+if(el.parentNode){parentNode=el.parentNode;}\r
+else{parentNode=null;}\r
+while(parentNode&&parentNode.tagName.toUpperCase()!='BODY'&&parentNode.tagName.toUpperCase()!='HTML')\r
+{if(Y.Dom.getStyle(parentNode,'display')!='inline'){pos[0]-=parentNode.scrollLeft;pos[1]-=parentNode.scrollTop;}\r
+if(parentNode.parentNode){parentNode=parentNode.parentNode;}else{parentNode=null;}}\r
+return pos;};return Y.Dom.batch(el,f,Y.Dom,true);},getX:function(el){var f=function(el){return Y.Dom.getXY(el)[0];};return Y.Dom.batch(el,f,Y.Dom,true);},getY:function(el){var f=function(el){return Y.Dom.getXY(el)[1];};return Y.Dom.batch(el,f,Y.Dom,true);},setXY:function(el,pos,noRetry){var f=function(el){var style_pos=this.getStyle(el,'position');if(style_pos=='static'){this.setStyle(el,'position','relative');style_pos='relative';}\r
+var pageXY=this.getXY(el);if(pageXY===false){return false;}\r
+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;}\r
+if(isNaN(delta[1])){delta[1]=(style_pos=='relative')?0:el.offsetTop;}\r
+if(pos[0]!==null){el.style.left=pos[0]-pageXY[0]+delta[0]+'px';}\r
+if(pos[1]!==null){el.style.top=pos[1]-pageXY[1]+delta[1]+'px';}\r
+if(!noRetry){var newXY=this.getXY(el);if((pos[0]!==null&&newXY[0]!=pos[0])||(pos[1]!==null&&newXY[1]!=pos[1])){this.setXY(el,pos,true);}}};Y.Dom.batch(el,f,Y.Dom,true);},setX:function(el,x){Y.Dom.setXY(el,[x,null]);},setY:function(el,y){Y.Dom.setXY(el,[null,y]);},getRegion:function(el){var f=function(el){var region=new Y.Region.getRegion(el);return region;};return Y.Dom.batch(el,f,Y.Dom,true);},getClientWidth:function(){return Y.Dom.getViewportWidth();},getClientHeight:function(){return Y.Dom.getViewportHeight();},getElementsByClassName:function(className,tag,root){var method=function(el){return Y.Dom.hasClass(el,className);};return Y.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 Y.Dom.batch(el,f,Y.Dom,true);},addClass:function(el,className){var f=function(el){if(this.hasClass(el,className)){return;}\r
+el['className']=[el['className'],className].join(' ');};Y.Dom.batch(el,f,Y.Dom,true);},removeClass:function(el,className){var re=new RegExp('(?:^|\\s+)'+className+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,className)){return;}\r
+var c=el['className'];el['className']=c.replace(re,' ');if(this.hasClass(el,className)){this.removeClass(el,className);}};Y.Dom.batch(el,f,Y.Dom,true);},replaceClass:function(el,oldClassName,newClassName){if(oldClassName===newClassName){return false;}\r
+var re=new RegExp('(?:^|\\s+)'+oldClassName+'(?:\\s+|$)','g');var f=function(el){if(!this.hasClass(el,oldClassName)){this.addClass(el,newClassName);return;}\r
+el['className']=el['className'].replace(re,' '+newClassName+' ');if(this.hasClass(el,oldClassName)){this.replaceClass(el,oldClassName,newClassName);}};Y.Dom.batch(el,f,Y.Dom,true);},generateId:function(el,prefix){prefix=prefix||'yui-gen';el=el||{};var f=function(el){if(el){el=Y.Dom.get(el);}else{el={};}\r
+if(!el.id){el.id=prefix+id_counter++;}\r
+return el.id;};return Y.Dom.batch(el,f,Y.Dom,true);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false;}\r
+var f=function(needle){if(haystack.contains&&!isSafari){return haystack.contains(needle);}\r
+else if(haystack.compareDocumentPosition){return!!(haystack.compareDocumentPosition(needle)&16);}\r
+else{var parent=needle.parentNode;while(parent){if(parent==haystack){return true;}\r
+else if(!parent.tagName||parent.tagName.toUpperCase()=='HTML'){return false;}\r
+parent=parent.parentNode;}\r
+return false;}};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){return this.isAncestor(document.documentElement,el);};return Y.Dom.batch(el,f,Y.Dom,true);},getElementsBy:function(method,tag,root){tag=tag||'*';var nodes=[];if(root){root=Y.Dom.get(root);if(!root){return nodes;}}else{root=document;}\r
+var elements=root.getElementsByTagName(tag);if(!elements.length&&(tag=='*'&&root.all)){elements=root.all;}\r
+for(var i=0,len=elements.length;i<len;++i){if(method(elements[i])){nodes[nodes.length]=elements[i];}}\r
+return nodes;},batch:function(el,method,o,override){var id=el;el=Y.Dom.get(el);var scope=(override)?o:window;if(!el||el.tagName||!el.length){if(!el){return false;}\r
+return method.call(scope,el,o);}\r
+var collection=[];for(var i=0,len=el.length;i<len;++i){if(!el[i]){id=el[i];}\r
+collection[collection.length]=method.call(scope,el[i],o);}\r
+return collection;},getDocumentHeight:function(){var scrollHeight=(document.compatMode!='CSS1Compat')?document.body.scrollHeight:document.documentElement.scrollHeight;var h=Math.max(scrollHeight,Y.Dom.getViewportHeight());return h;},getDocumentWidth:function(){var scrollWidth=(document.compatMode!='CSS1Compat')?document.body.scrollWidth:document.documentElement.scrollWidth;var w=Math.max(scrollWidth,Y.Dom.getViewportWidth());return w;},getViewportHeight:function(){var height=self.innerHeight;var mode=document.compatMode;if((mode||isIE)&&!isOpera){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;}\r
+return height;},getViewportWidth:function(){var width=self.innerWidth;var mode=document.compatMode;if(mode||isIE){width=(mode=='CSS1Compat')?document.documentElement.clientWidth:document.body.clientWidth;}\r
+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&®ion.right<=this.right&®ion.top>=this.top&®ion.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];}\r
+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();\r
+YAHOO.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this.scope=oScope||window;this.silent=silent;this.signature=signature||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}\r
+var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEvent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(fn,obj,override){if(this.subscribeEvent){this.subscribeEvent.fire(fn,obj,override);}\r
+this.subscribers.push(new YAHOO.util.Subscriber(fn,obj,override));},unsubscribe:function(fn,obj){var found=false;for(var i=0,len=this.subscribers.length;i<len;++i){var s=this.subscribers[i];if(s&&s.contains(fn,obj)){this._delete(i);found=true;}}\r
+return found;},fire:function(){var len=this.subscribers.length;if(!len&&this.silent){return true;}\r
+var args=[],ret=true,i;for(i=0;i<arguments.length;++i){args.push(arguments[i]);}\r
+var argslength=args.length;if(!this.silent){}\r
+for(i=0;i<len;++i){var s=this.subscribers[i];if(s){if(!this.silent){}\r
+var scope=s.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var param=null;if(args.length>0){param=args[0];}\r
+ret=s.fn.call(scope,param,s.obj);}else{ret=s.fn.call(scope,this.type,args,s.obj);}\r
+if(false===ret){if(!this.silent){}\r
+return false;}}}\r
+return true;},unsubscribeAll:function(){for(var i=0,len=this.subscribers.length;i<len;++i){this._delete(len-1-i);}},_delete:function(index){var s=this.subscribers[index];if(s){delete s.fn;delete s.obj;}\r
+this.subscribers.splice(index,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(fn,obj,override){this.fn=fn;this.obj=obj||null;this.override=override;};YAHOO.util.Subscriber.prototype.getScope=function(defaultScope){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}\r
+return defaultScope;};YAHOO.util.Subscriber.prototype.contains=function(fn,obj){if(obj){return(this.fn==fn&&this.obj==obj);}else{return(this.fn==fn);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+(this.obj||"")+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var loadComplete=false;var listeners=[];var unloadListeners=[];var legacyEvents=[];var legacyHandlers=[];var retryCount=0;var onAvailStack=[];var legacyMap=[];var counter=0;return{POLL_RETRYS:200,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,OBJ: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)),_interval:null,startInterval:function(){if(!this._interval){var self=this;var callback=function(){self._tryPreloadAttach();};this._interval=setInterval(callback,this.POLL_INTERVAL);}},onAvailable:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:false});retryCount=this.POLL_RETRYS;this.startInterval();},onContentReady:function(p_id,p_fn,p_obj,p_override){onAvailStack.push({id:p_id,fn:p_fn,obj:p_obj,override:p_override,checkReady:true});retryCount=this.POLL_RETRYS;this.startInterval();},addListener:function(el,sType,fn,obj,override){if(!fn||!fn.call){return false;}\r
+if(this._isValidCollection(el)){var ok=true;for(var i=0,len=el.length;i<len;++i){ok=this.on(el[i],sType,fn,obj,override)&&ok;}\r
+return ok;}else if(typeof el=="string"){var oEl=this.getEl(el);if(oEl){el=oEl;}else{this.onAvailable(el,function(){YAHOO.util.Event.on(el,sType,fn,obj,override);});return true;}}\r
+if(!el){return false;}\r
+if("unload"==sType&&obj!==this){unloadListeners[unloadListeners.length]=[el,sType,fn,obj,override];return true;}\r
+var scope=el;if(override){if(override===true){scope=obj;}else{scope=override;}}\r
+var wrappedFn=function(e){return fn.call(scope,YAHOO.util.Event.getEvent(e),obj);};var li=[el,sType,fn,wrappedFn,scope];var index=listeners.length;listeners[index]=li;if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);if(legacyIndex==-1||el!=legacyEvents[legacyIndex][0]){legacyIndex=legacyEvents.length;legacyMap[el.id+sType]=legacyIndex;legacyEvents[legacyIndex]=[el,sType,el["on"+sType]];legacyHandlers[legacyIndex]=[];el["on"+sType]=function(e){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(e),legacyIndex);};}\r
+legacyHandlers[legacyIndex].push(li);}else{try{this._simpleAdd(el,sType,wrappedFn,false);}catch(e){this.removeListener(el,sType,fn);return false;}}\r
+return true;},fireLegacyEvent:function(e,legacyIndex){var ok=true;var le=legacyHandlers[legacyIndex];for(var i=0,len=le.length;i<len;++i){var li=le[i];if(li&&li[this.WFN]){var scope=li[this.ADJ_SCOPE];var ret=li[this.WFN].call(scope,e);ok=(ok&&ret);}}\r
+return ok;},getLegacyIndex:function(el,sType){var key=this.generateId(el)+sType;if(typeof legacyMap[key]=="undefined"){return-1;}else{return legacyMap[key];}},useLegacyEvent:function(el,sType){if(!el.addEventListener&&!el.attachEvent){return true;}else if(this.isSafari){if("click"==sType||"dblclick"==sType){return true;}}\r
+return false;},removeListener:function(el,sType,fn){var i,len;if(typeof el=="string"){el=this.getEl(el);}else if(this._isValidCollection(el)){var ok=true;for(i=0,len=el.length;i<len;++i){ok=(this.removeListener(el[i],sType,fn)&&ok);}\r
+return ok;}\r
+if(!fn||!fn.call){return this.purgeElement(el,false,sType);}\r
+if("unload"==sType){for(i=0,len=unloadListeners.length;i<len;i++){var li=unloadListeners[i];if(li&&li[0]==el&&li[1]==sType&&li[2]==fn){unloadListeners.splice(i,1);return true;}}\r
+return false;}\r
+var cacheItem=null;var index=arguments[3];if("undefined"==typeof index){index=this._getCacheIndex(el,sType,fn);}\r
+if(index>=0){cacheItem=listeners[index];}\r
+if(!el||!cacheItem){return false;}\r
+if(this.useLegacyEvent(el,sType)){var legacyIndex=this.getLegacyIndex(el,sType);var llist=legacyHandlers[legacyIndex];if(llist){for(i=0,len=llist.length;i<len;++i){li=llist[i];if(li&&li[this.EL]==el&&li[this.TYPE]==sType&&li[this.FN]==fn){llist.splice(i,1);break;}}}}else{try{this._simpleRemove(el,sType,cacheItem[this.WFN],false);}catch(e){return false;}}\r
+delete listeners[index][this.WFN];delete listeners[index][this.FN];listeners.splice(index,1);return true;},getTarget:function(ev,resolveTextNode){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(node){if(node&&3==node.nodeType){return node.parentNode;}else{return node;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}\r
+return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}\r
+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;}}\r
+return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}\r
+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;}\r
+c=c.caller;}}\r
+return ev;},getCharCode:function(ev){return ev.charCode||ev.keyCode||0;},_getCacheIndex:function(el,sType,fn){for(var i=0,len=listeners.length;i<len;++i){var li=listeners[i];if(li&&li[this.FN]==fn&&li[this.EL]==el&&li[this.TYPE]==sType){return i;}}\r
+return-1;},generateId:function(el){var id=el.id;if(!id){id="yuievtautoid-"+counter;++counter;el.id=id;}\r
+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(){},_load:function(e){loadComplete=true;var EU=YAHOO.util.Event;if(this.isIE){EU._simpleRemove(window,"load",EU._load);}},_tryPreloadAttach:function(){if(this.locked){return false;}\r
+this.locked=true;var tryAgain=!loadComplete;if(!tryAgain){tryAgain=(retryCount>0);}\r
+var notAvail=[];for(var i=0,len=onAvailStack.length;i<len;++i){var item=onAvailStack[i];if(item){var el=this.getEl(item.id);if(el){if(!item.checkReady||loadComplete||el.nextSibling||(document&&document.body)){var scope=el;if(item.override){if(item.override===true){scope=item.obj;}else{scope=item.override;}}\r
+item.fn.call(scope,item.obj);onAvailStack[i]=null;}}else{notAvail.push(item);}}}\r
+retryCount=(notAvail.length===0)?0:retryCount-1;if(tryAgain){onAvailStack=notAvail;this.startInterval();}else{clearInterval(this._interval);this._interval=null;}\r
+this.locked=false;return true;},purgeElement:function(el,recurse,sType){var elListeners=this.getListeners(el,sType);if(elListeners){for(var i=0,len=elListeners.length;i<len;++i){var l=elListeners[i];this.removeListener(el,l.type,l.fn);}}\r
+if(recurse&&el&&el.childNodes){for(i=0,len=el.childNodes.length;i<len;++i){this.purgeElement(el.childNodes[i],recurse,sType);}}},getListeners:function(el,sType){var elListeners=[];if(listeners&&listeners.length>0){for(var i=0,len=listeners.length;i<len;++i){var l=listeners[i];if(l&&l[this.EL]===el&&(!sType||sType===l[this.TYPE])){elListeners.push({type:l[this.TYPE],fn:l[this.FN],obj:l[this.OBJ],adjust:l[this.ADJ_SCOPE],index:i});}}}\r
+return(elListeners.length)?elListeners:null;},_unload:function(e){var EU=YAHOO.util.Event,i,j,l,len,index;for(i=0,len=unloadListeners.length;i<len;++i){l=unloadListeners[i];if(l){var scope=window;if(l[EU.ADJ_SCOPE]){if(l[EU.ADJ_SCOPE]===true){scope=l[EU.OBJ];}else{scope=l[EU.ADJ_SCOPE];}}\r
+l[EU.FN].call(scope,EU.getEvent(e),l[EU.OBJ]);unloadListeners[i]=null;l=null;scope=null;}}\r
+unloadListeners=null;if(listeners&&listeners.length>0){j=listeners.length;while(j){index=j-1;l=listeners[index];if(l){EU.removeListener(l[EU.EL],l[EU.TYPE],l[EU.FN],index);}\r
+j=j-1;}\r
+l=null;EU.clearCache();}\r
+for(i=0,len=legacyEvents.length;i<len;++i){legacyEvents[i][0]=null;legacyEvents[i]=null;}\r
+legacyEvents=null;EU._simpleRemove(window,"unload",EU._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var dd=document.documentElement,db=document.body;if(dd&&(dd.scrollTop||dd.scrollLeft)){return[dd.scrollTop,dd.scrollLeft];}else if(db){return[db.scrollTop,db.scrollLeft];}else{return[0,0];}},_simpleAdd:function(){if(window.addEventListener){return function(el,sType,fn,capture){el.addEventListener(sType,fn,(capture));};}else if(window.attachEvent){return function(el,sType,fn,capture){el.attachEvent("on"+sType,fn);};}else{return function(){};}}(),_simpleRemove:function(){if(window.removeEventListener){return function(el,sType,fn,capture){el.removeEventListener(sType,fn,(capture));};}else if(window.detachEvent){return function(el,sType,fn){el.detachEvent("on"+sType,fn);};}else{return function(){};}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(document&&document.body){EU._load();}else{EU._simpleAdd(window,"load",EU._load);}\r
+EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}\r
+YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(p_type,p_fn,p_obj,p_override){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){ce.subscribe(p_fn,p_obj,p_override);}else{this.__yui_subscribers=this.__yui_subscribers||{};var subs=this.__yui_subscribers;if(!subs[p_type]){subs[p_type]=[];}\r
+subs[p_type].push({fn:p_fn,obj:p_obj,override:p_override});}},unsubscribe:function(p_type,p_fn,p_obj){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){return ce.unsubscribe(p_fn,p_obj);}else{return false;}},createEvent:function(p_type,p_config){this.__yui_events=this.__yui_events||{};var opts=p_config||{};var events=this.__yui_events;if(events[p_type]){}else{var scope=opts.scope||this;var silent=opts.silent||null;var ce=new YAHOO.util.CustomEvent(p_type,scope,silent,YAHOO.util.CustomEvent.FLAT);events[p_type]=ce;if(opts.onSubscribeCallback){ce.subscribeEvent.subscribe(opts.onSubscribeCallback);}\r
+this.__yui_subscribers=this.__yui_subscribers||{};var qs=this.__yui_subscribers[p_type];if(qs){for(var i=0;i<qs.length;++i){ce.subscribe(qs[i].fn,qs[i].obj,qs[i].override);}}}\r
+return events[p_type];},fireEvent:function(p_type,arg1,arg2,etc){this.__yui_events=this.__yui_events||{};var ce=this.__yui_events[p_type];if(ce){var args=[];for(var i=1;i<arguments.length;++i){args.push(arguments[i]);}\r
+return ce.fire.apply(ce,args);}else{return null;}},hasEvent:function(type){if(this.__yui_events){if(this.__yui_events[type]){return true;}}\r
+return false;}};
\ No newline at end of file
YAHOO Global Namespace - Release Notes\r
\r
+0.12.1\r
+ * No change\r
+\r
0.12.0\r
\r
* Added YAHOO.augment, which copies all or part of the prototype of one\r
-/*\r
+/* \r
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
-*/\r
-\r
+version: 0.12.1\r
+*/ \r
/**\r
* The YAHOO object is the single global object used by YUI Library. It\r
* contains utility function for setting up namespaces, inheritance, and\r
* @title YAHOO Global\r
*/\r
\r
-/**\r
- * The YAHOO global namespace object\r
- * @class YAHOO\r
- * @static\r
- */\r
if (typeof YAHOO == "undefined") {\r
+ /**\r
+ * The YAHOO global namespace object\r
+ * @class YAHOO\r
+ * @static\r
+ */\r
var YAHOO = {};\r
}\r
\r
*\r
* @method namespace\r
* @static\r
- * @param {String*} arguments 1-n namespaces to create\r
+ * @param {String*} arguments 1-n namespaces to create \r
* @return {Object} A reference to the last namespace object created\r
*/\r
YAHOO.namespace = function() {\r
* @static\r
* @param {Function} subc the object to modify\r
* @param {Function} superc the object to inherit\r
- * @param {String[]} overrides additional properties/methods to add to the\r
+ * @param {Object} overrides additional properties/methods to add to the\r
* subclass prototype. These will override the\r
- * matching items obtained from the superclass\r
+ * matching items obtained from the superclass \r
* if present.\r
*/\r
YAHOO.extend = function(subc, superc, overrides) {\r
rp[a[i]] = sp[a[i]];\r
}\r
} else {\r
- for (p in sp) {\r
+ for (p in sp) { \r
if (!rp[p]) {\r
rp[p] = sp[p];\r
}\r
-/* Copyright (c) 2006, Yahoo! Inc. All rights reserved.Code licensed under the BSD License:http://developer.yahoo.net/yui/license.txt version: 0.12.0 */ if(typeof YAHOO=="undefined"){var YAHOO={};}YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;++i){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}return o;};YAHOO.log=function(_2,_3,_4){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(_2,_3,_4);}else{return false;}};YAHOO.extend=function(_6,_7,_8){var F=function(){};F.prototype=_7.prototype;_6.prototype=new F();_6.prototype.constructor=_6;_6.superclass=_7.prototype;if(_7.prototype.constructor==Object.prototype.constructor){_7.prototype.constructor=_7;}if(_8){for(var i in _8){_6.prototype[i]=_8[i];}}};YAHOO.augment=function(r,s){var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i<a.length;++i){rp[a[i]]=sp[a[i]];}}else{for(p in sp){if(!rp[p]){rp[p]=sp[p];}}}};YAHOO.namespace("util","widget","example");
\ No newline at end of file
+/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.12.1 */\r
+if(typeof YAHOO=="undefined"){var YAHOO={};}\r
+YAHOO.namespace=function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;++i){d=a[i].split(".");o=YAHOO;for(j=(d[0]=="YAHOO")?1:0;j<d.length;++j){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}\r
+return o;};YAHOO.log=function(msg,cat,src){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(msg,cat,src);}else{return false;}};YAHOO.extend=function(subc,superc,overrides){var F=function(){};F.prototype=superc.prototype;subc.prototype=new F();subc.prototype.constructor=subc;subc.superclass=superc.prototype;if(superc.prototype.constructor==Object.prototype.constructor){superc.prototype.constructor=superc;}\r
+if(overrides){for(var i in overrides){subc.prototype[i]=overrides[i];}}};YAHOO.augment=function(r,s){var rp=r.prototype,sp=s.prototype,a=arguments,i,p;if(a[2]){for(i=2;i<a.length;++i){rp[a[i]]=sp[a[i]];}}else{for(p in sp){if(!rp[p]){rp[p]=sp[p];}}}};YAHOO.namespace("util","widget","example");
\ No newline at end of file
Copyright (c) 2006, Yahoo! Inc. All rights reserved.\r
Code licensed under the BSD License:\r
http://developer.yahoo.net/yui/license.txt\r
-version: 0.12.0\r
+version: 0.12.1\r
*/ \r
-\r
/**\r
* The YAHOO object is the single global object used by YUI Library. It\r
* contains utility function for setting up namespaces, inheritance, and\r
* @title YAHOO Global\r
*/\r
\r
-/**\r
- * The YAHOO global namespace object\r
- * @class YAHOO\r
- * @static\r
- */\r
if (typeof YAHOO == "undefined") {\r
+ /**\r
+ * The YAHOO global namespace object\r
+ * @class YAHOO\r
+ * @static\r
+ */\r
var YAHOO = {};\r
}\r
\r
* @static\r
* @param {Function} subc the object to modify\r
* @param {Function} superc the object to inherit\r
- * @param {String[]} overrides additional properties/methods to add to the\r
+ * @param {Object} overrides additional properties/methods to add to the\r
* subclass prototype. These will override the\r
* matching items obtained from the superclass \r
* if present.\r