function EnhancedDropdown(){this.dropdownStateCollapsed=true;this.actingElements=new Array();this.reactingElement=null;this.imageDropdownCollapsedPath="";this.imageDropdownExpandedPath="";this.additionalOffsetLeft=null;this.additionalOffsetTop=null;this.effectTime=200;this.init=init;this.handleDropdown=handleDropdown;this.checkGlobalCloseEvent=checkGlobalCloseEvent;this.checkIsParentElement=checkIsParentElement;this.getOffsetTop=getOffsetTop;this.getOffsetLeft=getOffsetLeft}function init(g,h,d,a,f,b,e){if(document.getElementById(h)==null){alert("Reacting Element (popup) does not exist!");return false}if(g==null){alert("Acting Element is not defined!");return false}else{if(g instanceof Array){for(var c=0;c<g.length;c++){if(document.getElementById(g[c])==null){alert(c+" Element of Acting Element Array does not exist!");return false}}}else{if(document.getElementById(g)==null){alert("Acting Element does not exist!");return false}}}if(g instanceof Array){for(var c=0;c<g.length;c++){this.actingElements[c]=document.getElementById(g[c]);this.actingElements[c].onclick=createMethodReference(this,"handleDropdown")}}else{this.actingElements[0]=document.getElementById(g);this.actingElements[0].onclick=createMethodReference(this,"handleDropdown")}this.reactingElement=document.getElementById(h);this.imageDropdownCollapsedPath=d;this.imageDropdownExpandedPath=a;this.additionalOffsetLeft=f;this.additionalOffsetTop=b;this.effectTime=e;jQuery(document).bind("click",createMethodReference(this,"checkGlobalCloseEvent"))}function handleDropdown(){var b=this.getOffsetLeft(this.actingElements[0])+this.additionalOffsetLeft;var a=this.getOffsetTop(this.actingElements[0])+this.additionalOffsetTop;if(!this.dropdownStateCollapsed){this.actingElements[0].src=this.imageDropdownCollapsedPath;jQuery("#"+this.reactingElement.id).animate({height:"toggle",opacity:"toggle"},{duration:this.effectTime});this.dropdownStateCollapsed=true}else{this.actingElements[0].src=this.imageDropdownExpandedPath;jQuery("#"+this.reactingElement.id).css({position:"absolute",top:a,left:b}).animate({height:"toggle",opacity:"toggle"},{duration:this.effectTime});this.dropdownStateCollapsed=false}}function checkGlobalCloseEvent(d){if(!this.dropdownStateCollapsed){var b=(d&&d.target)||(event&&event.srcElement);var c=false;for(var a=0;a<this.actingElements.length&&!c;a++){if(b==this.actingElements[a]){c=true}}if(this.checkIsParentElement(b,this.reactingElement)&&!c){this.handleDropdown()}else{null}}}function checkIsParentElement(a){while(a.parentNode){if(a==this.reactingElement){return false}a=a.parentNode}return true}function getOffsetTop(a){var b=0;while(a!=null){b+=a.offsetTop;a=a.offsetParent}return b}function getOffsetLeft(a){var b=0;while(a!=null){b+=a.offsetLeft;a=a.offsetParent}return b}function createMethodReference(b,a){return function(){b[a].apply(b,arguments)}};