DropDownMenu=window.DropDownMenu=function(R,A,J,O){var P={escape:27,left:37,up:38,right:39,down:40,enter:13};var B;var K;var Q;var F;var D;var T;var S;var H=true;var C=false;DropDownMenu.fn=DropDownMenu.prototype={init:function(d,a,b,c){if(typeof d=="object"&&d.nodeType){B=d;K=$(B);Q=K.find(a)[0];F=K.find(b)[0];D=$(Q);T=$(F);$.extend(B,DropDownMenu.fn);U();V();return B}if(typeof d==="string"){return DropDownMenu($(d)[0],a,b,c)}return null},CLASSNAME:"DropDownMenu"};return new DropDownMenu.fn.init(R,A,J,O);function U(){S=$('<div tabindex="-1" style="width:0px;height:0px;-moz-outline-style: none;outline:none; display:inline; position;absolute;"></div>');K.append(S);if(T.hasClass("collapsed")){H=false}if(T.hasClass("expanded")){H=true}}function V(){D.bind("click",N);S.bind("keyup",E);S.bind("blur",y);T.bind("mouseenter",z);T.bind("mouseleave",I)}function N(){L()}function L(){if(H){M()}else{G()}}function G(){H=true;D.removeClass("collapsed").addClass("expanded");T.removeClass("collapsed").addClass("expanded").show();S.focus()}function M(){if(H===false){return}H=false;D.removeClass("expanded").addClass("collapsed");T.removeClass("expanded").addClass("collapsed").hide();S.blur()}function y(){setTimeout(function(){if(!C){M()}else{S.focus()}},150)}function z(){C=true;S.focus()}function I(){C=false}function E(a){if(a.keyCode==P.escape){M()}}};
