(function(b){var a="";b.fn.dd=function(k){$this=this;k=b.extend({height:120,visibleRows:7,rowHeight:23,showIcon:true,zIndex:9999,style:"",theme:"dd"},k);var r="";var o={};o.insideWindow=true;o.keyboardAction=false;o.currentKey=null;var F=false;config={postElementHolder:"_msddHolder",postID:"_msdd",postTitleID:"_title",postTitleTextID:"_titletext",postChildID:"_child",postAID:"_msa",postOPTAID:"_msopta",postInputID:"_msinput",postArrowID:"_arrow",postInputhidden:"_inp"};styles={dd:k.theme,ddTitle:"ddTitle",arrow:"arrow",ddChild:"ddChild",disbaled:0.3};attributes={actions:"onfocus,onblur,onchange,onclick,ondblclick,onmousedown,onmouseup,onmouseover,onmousemove,onmouseout,onkeypress,onkeydown,onkeyup",prop:"size,multiple,disabled,tabindex"};var n=b(this).attr("id");var A=b(this).attr("style");k.style+=(A==undefined)?"":A;var l=b(this).children();F=(b(this).attr("size")>0||b(this).attr("multiple")==true)?true:false;if(F){k.visibleRows=b(this).attr("size")}var u={};e();function D(G){return n+config[G]}function x(H){var G=H;var I=b(G).attr("style");return I}function h(H){var G=b("#"+n+" option:selected");if(G.length>1){for(var I=0;I";G+=""+b(Q).attr("label")+"";var M=b(Q).children();M.each(function(V){var X=M[V];var Z=J+"_"+(O)+"_"+(V);var Y=b(X).attr("title");Y=(Y.length==0)?"":' ';var W=b(X).text();var aa=b(X).val();var U=(b(X).attr("disabled")==true)?"disabled":"enabled";u[Z]={html:Y+W,value:aa,text:W,index:X.index,id:Z};var T=x(X);if(h(X.index)==true){G+='';G+=Y+W+""});G+=""}else{var K=I+"_"+(O);var R=b(Q).attr("title");R=(R.length==0)?"":' ';var L=b(Q).text();var S=b(Q).val();var N=(b(Q).attr("disabled")==true)?"disabled":"enabled";u[K]={html:R+L,value:S,text:L,index:Q.index,id:K};var P=x(Q);if(h(Q.index)==true){G+='';G+=R+L+""}});return G}function d(){var I=D("postID");var G=D("postChildID");var H=k.style;sDiv="";sDiv+='
';var G='
'+L+H+"
";return G}function e(){var P=false;var J=D("postID");var R=D("postTitleID");var M=D("postTitleTextID");var N=D("postChildID");var Q=D("postArrowID");var L=b("#"+n).width();var K=k.style;if(b("#"+J).length>0){b("#"+J).remove();P=true}var I='
";I+="
";if(P==true){var H=D("postElementHolder");b("#"+H).after(I)}else{b("#"+n).after(I)}b("#"+J).css("width",L+"px");b("#"+N).css("width",(L-2)+"px");if(l.length>k.visibleRows){var O=parseInt(b("#"+N+" a:first").css("padding-bottom"))+parseInt(b("#"+N+" a:first").css("padding-top"));var G=((k.rowHeight)*k.visibleRows)-O;b("#"+N).css("height",G+"px")}if(P==false){B();j(n)}if(b("#"+n).attr("disabled")==true){b("#"+J).css("opacity",styles.disbaled)}else{s();if(!F){b("#"+R).bind("mouseover",function(S){v(1)});b("#"+R).bind("mouseout",function(S){v(0)})}b("#"+N+" a.enabled").bind("click",function(T){T.preventDefault();q(this);if(!F){b("#"+N).unbind("mouseover");f(false);var S=(k.showIcon==false)?b(this).text():b(this).html();z(S);E()}g()});b("#"+N+" a.disabled").css("opacity",styles.disbaled);if(F){b("#"+N).bind("mouseover",function(S){if(!o.keyboardAction){o.keyboardAction=true;b(document).bind("keydown",function(T){var U=T.keyCode;o.currentKey=U;if(U==39||U==40){T.preventDefault();T.stopPropagation();t();g()}if(U==37||U==38){T.preventDefault();T.stopPropagation();i();g()}})}})}b("#"+N).bind("mouseout",function(S){f(false);b(document).unbind("keydown");o.keyboardAction=false;o.currentKey=null});if(!F){b("#"+R).bind("click",function(S){f(false);if(b("#"+N+":visible").length==1){b("#"+N).unbind("mouseover")}else{b("#"+N).bind("mouseover",function(T){f(true)});w()}})}b("#"+R).bind("mouseout",function(S){f(false)})}}function C(G){for(var H in u){if(u[H].index==G){return u[H]}}}function q(M){var K=D("postChildID");if(!F){b("#"+K+" a.selected").removeClass("selected")}var G=b("#"+K+" a.selected").attr("id");if(G!=undefined){var N=(o.oldIndex==undefined||o.oldIndex==null)?u[G].index:o.oldIndex}if(M&&!F){b(M).addClass("selected")}if(F){var L=o.currentKey;if(b("#"+n).attr("multiple")==true){if(L==17){o.oldIndex=u[b(M).attr("id")].index;b(M).toggleClass("selected")}else{if(L==16){b("#"+K+" a.selected").removeClass("selected");b(M).addClass("selected");var I=b(M).attr("id");var H=u[I].index;for(var J=Math.min(N,H);J<=Math.max(N,H);J++){b("#"+C(J).id).addClass("selected")}}else{b("#"+K+" a.selected").removeClass("selected");b(M).addClass("selected");o.oldIndex=u[b(M).attr("id")].index}}}else{b("#"+K+" a.selected").removeClass("selected");b(M).addClass("selected");o.oldIndex=u[b(M).attr("id")].index}}}function j(G){document.getElementById(G).refresh=function(H){b("#"+this.id).dd(k)}}function f(G){o.insideWindow=G}function m(){return o.insideWindow}function s(){var G=D("postID");var H=attributes.actions.split(",");for(var K=0;K
");b("#"+n).appendTo(b("#"+G))}function z(G){var H=D("postTitleTextID");b("#"+H).html(G)}function t(){var L=D("postTitleTextID");var K=D("postChildID");var J=b("#"+K+" a.enabled");for(var M=0;M=parseInt(b("#"+K).height())){b("#"+K).scrollTop((b("#"+K).scrollTop())+b("#"+G).height()+b("#"+G).height())}break}}}function i(){var L=D("postTitleTextID");var K=D("postChildID");var J=b("#"+K+" a.enabled");for(var M=0;M1){var L=b("#"+n+" > option:selected").removeAttr("selected");for(var K=0;K