function RegisterNamespace(name){eval(name+" = new Object();")}function RegisterEnum(name){eval(name+" = new "+name+"();")}function RegisterGlobal(name){eval(name+" = new "+name+"();")}RegisterNamespace("pJSfw2009");pJSfw2009.DropDownPanel=function(c,b,a){this._target=c||null;this._opener=b||null;this._tdimensions=null;this._olocation=null;this._toffset={top:0,left:0};this._shown=false;this._calculatedPosition=false;this._alignment=pJSfw2009.Alignment.RIGHT;this._animate=false;this._duration=pJSfw2009.AnimationSpeed.FAST;this._autohide=true;this._enabled=true;this._fixedTarget=a;this._refixTarget=false;this._showTriggerEvent=pJSfw2009.Events.CLICK;this._hideTriggerEvent=pJSfw2009.Events.BLUR;this._init()};pJSfw2009.DropDownPanel.prototype={_init:function(){if(this._target){if(typeof pJSfw2009.panels=="undefined"){pJSfw2009.panels=new Object()}pJSfw2009.panels[this._target.id]=this;this._tdimensions=this._target.getDimensions();this._odimensions={top:0,left:0};this._target.hide();if(this._fixedTarget){this._target.setStyle({position:"absolute"});this._target.innerHTML="<div style='display:block'></div>"+this._target.innerHTML}if(this._opener){this._addOpenerHandlers();this._olocation=this._opener.positionedOffset();this._odimensions=this._opener.getDimensions()}}},getEvents:function(){if(!this._events){this._events=new Sys.EventHandlerList()}return this._events},_openerOnClick:function(a){if(this.isEnabled()){if(this.isShown()){this.hidePanel()}else{this.showPanel()}}Event.stop(a)},_openerOnBlur:function(a){if(this.isEnabled()){if(this.isShown()){this.hidePanel()}}},_bodyOnClick:function(a){if(this.isEnabled()){if(this.isShown()){this.hidePanel()}}},_calculatePosition:function(){if(this._olocation){if(this._alignment==pJSfw2009.Alignment.RIGHT){var a=this._olocation.left+this._toffset.left}else{var a=this._olocation.left+this._toffset.left-(this._tdimensions.width-this._odimensions.width)}this._target.setStyle({top:(this._olocation.top+this._toffset.top+this._odimensions.height)+"px",left:a+"px"})}},showPanel:function(){if(pJSfw2009.showedPanel){pJSfw2009.panels[pJSfw2009.showedPanel].hidePanel()}this._target.fire(pJSfw2009.Events.SHOWING,"");if(this._calculatedPosition){this._calculatePosition()}if(this._animate){this._target.slideDown({delay:0,duration:this._duration,beforeStart:Function.createDelegate(this,function(){this._enabled=false}),afterFinish:Function.createDelegate(this,function(){this._target.fire(pJSfw2009.Events.SHOWN,"");this._enabled=true})})}else{this._target.show();this._target.fire(pJSfw2009.Events.SHOWN,"")}this._shown=true},hidePanel:function(){this._target.fire(pJSfw2009.Events.HIDING,"");if(this._animate){this._target.slideUp({delay:0,duration:this._duration,beforeStart:Function.createDelegate(this,function(){this._enabled=false}),afterFinish:Function.createDelegate(this,function(){this._target.fire(pJSfw2009.Events.HIDDEN,null);this._enabled=true})})}else{this._target.hide();this._enabled=true;this._target.fire(pJSfw2009.Events.HIDDEN,null)}this._shown=false},_addOpenerHandlers:function(){this._opener.observe(this._showTriggerEvent,Function.createDelegate(this,this._openerOnClick));Event.observe(document.body,pJSfw2009.Events.CLICK,Function.createDelegate(this,this._bodyOnClick))},_removeOpenerHandlers:function(){this._opener.stopObserving(this._showTriggerEvent,this._targetOnClick);Event.stopObserving(document.body,pJSfw2009.Events.CLICK,Function.createDelegate(this,this._bodyOnClick))},isShown:function(){return this._shown},isEnabled:function(){return this._enabled},setShowTriggerEvent:function(a){this._showTriggerEvent=a},getShowTriggerEvent:function(){return this._showTriggerEvent},setCalculatedPosition:function(a,b){this._calculatedPosition=a;if(b){this.setAlignment(b)}},getCalculatedPosition:function(){return this._calculatedPosition},setFixedTarget:function(a){this._fixedTarget=a},getFixedTarget:function(){return this._fixedTarget},setRefixedTarget:function(a){this._refixedTarget=a},getRefixedTarget:function(){return this._refixedTarget},setAlignment:function(a){this._alignment=a},getAlignment:function(){return this._alignment},setAnimate:function(a,b){this._animate=a;if(b){this._duration=b}},getAnimate:function(){return this._animate},setAutoHide:function(a){Event.stopObserving(document.body,pJSfw2009.Events.CLICK,this._bodyOnClick);if(a){Event.observe(document.body,pJSfw2009.Events.CLICK,Function.createDelegate(this,this._bodyOnClick))}this._autohide=a},getAutoHide:function(){return this._autohide},addOnShowing:function(a){this._target.observe(pJSfw2009.Events.SHOWING,a)},removeOnShowing:function(a){this._target.stopObserving(pJSfw2009.Events.SHOWING,a)},addOnShown:function(a){this._target.observe(pJSfw2009.Events.SHOWN,a)},removeOnShown:function(a){this._target.stopObserving(pJSfw2009.Events.SHOWN,a)},addOnHiding:function(a){this._target.observe(pJSfw2009.Events.HIDING,a)},removeOnHiding:function(a){this._target.stopObserving(pJSfw2009.Events.HIDING,a)},addOnHidden:function(a){this._target.observe(pJSfw2009.Events.HIDDEN,a)},removeOnHidden:function(a){this._target.stopObserving(pJSfw2009.Events.HIDDEN,a)}};pJSfw2009.Events=function(){};pJSfw2009.Events.prototype={CLICK:"click",OVER:"mouseover",OUT:"mouseout",FOCUS:"focus",BLUR:"blur",SHOWING:"dropdownevents:showing",SHOWN:"dropdownevents:shown",HIDING:"dropdownevents:hiding",HIDDEN:"dropdownevents:hidden"};RegisterGlobal("pJSfw2009.Events");pJSfw2009.Alignment=function(){};pJSfw2009.Alignment.prototype={RIGHT:"right",LEFT:"left",TOP:"top",BOTTOM:"bottom"};RegisterGlobal("pJSfw2009.Alignment");pJSfw2009.AnimationSpeed=function(){};pJSfw2009.AnimationSpeed.prototype={SLOW:2,NORMAL:1,FAST:0.2};RegisterGlobal("pJSfw2009.AnimationSpeed");Function.__typeName="Function";Function.__class=true;Function.createCallback=function Function$createCallback(c,a){var b=Function._validateParams(arguments,[{name:"method",type:Function},{name:"context",mayBeNull:true}]);if(b){throw b}return function(){var d=arguments.length;if(d>0){var e=[];for(var f=0;f<d;f++){e[f]=arguments[f]}e[d]=a;return c.apply(this,e)}return c.call(this,a)}};Function.createDelegate=function Function$createDelegate(a,c){var b=Function._validateParams(arguments,[{name:"instance",mayBeNull:true},{name:"method",type:Function}]);if(b){throw b}return function(){return c.apply(a,arguments)}};Function.emptyFunction=Function.emptyMethod=function Function$emptyMethod(){if(arguments.length!==0){throw Error.parameterCount()}};Function._validateParams=function Function$_validateParams(g,c){var f;f=Function._validateParameterCount(g,c);if(f){f.popStackFrame();return f}for(var b=0;b<g.length;b++){var a=c[Math.min(b,c.length-1)];var d=a.name;if(a.parameterArray){d+="["+(b-c.length+1)+"]"}f=Function._validateParameter(g[b],a,d);if(f){f.popStackFrame();return f}}return null};Function._validateParameterCount=function Function$_validateParameterCount(g,c){var b=c.length;var d=0;for(var a=0;a<c.length;a++){if(c[a].parameterArray){b=Number.MAX_VALUE}else{if(!c[a].optional){d++}}}if(g.length<d||g.length>b){var f=Error.parameterCount();f.popStackFrame();return f}return null};Function._validateParameter=function Function$_validateParameter(d,o,k){var m;var f=o.type;var b=!!o.integer;var g=!!o.domElement;var l=!!o.mayBeNull;m=Function._validateParameterType(d,f,b,g,l,k);if(m){m.popStackFrame();return m}var p=o.elementType;var n=!!o.elementMayBeNull;if(f===Array&&typeof(d)!=="undefined"&&d!==null&&(p||!n)){var a=!!o.elementInteger;var j=!!o.elementDomElement;for(var h=0;h<d.length;h++){var c=d[h];m=Function._validateParameterType(c,p,a,j,n,k+"["+h+"]");if(m){m.popStackFrame();return m}}}return null};Function._validateParameterType=function Function$_validateParameterType(d,f,c,g,k,j){var l;if(typeof(d)==="undefined"){if(k){return null}else{l=Error.argumentUndefined(j);l.popStackFrame();return l}}if(d===null){if(k){return null}else{l=Error.argumentNull(j);l.popStackFrame();return l}}if(f&&f.__enum){if(typeof(d)!=="number"){l=Error.argumentType(j,Object.getType(d),f);l.popStackFrame();return l}if((d%1)===0){var p=f.prototype;if(!f.__flags||(d===0)){for(var h in p){if(p[h]===d){return null}}}else{var o=d;for(var h in p){var a=p[h];if(a===0){continue}if((a&d)===a){o-=a}if(o===0){return null}}}}l=Error.argumentOutOfRange(j,d,String.format(Sys.Res.enumInvalidValue,d,f.getName()));l.popStackFrame();return l}if(g){var b;if(typeof(d.nodeType)!=="number"){var n=d.ownerDocument||d.document||d;if(n!=d){var m=n.defaultView||n.parentWindow;b=(m!=d)&&!(m.document&&d.document&&(m.document===d.document))}else{b=(typeof(n.body)==="undefined")}}else{b=(d.nodeType===3)}if(b){l=Error.argument(j,Sys.Res.argumentDomElement);l.popStackFrame();return l}}if(f===Number&&c){if((d%1)!==0){l=Error.argumentOutOfRange(j,d,Sys.Res.argumentInteger);l.popStackFrame();return l}}return null};