String.prototype.contains=function(A){return this.indexOf(A)!=-1;};String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"");};var neo=neo?neo:new Object();neo.CustomDropDown=neo.CustomDropDown?neo.CustomDropDown:new Object();neo.Utils=neo.Utils?neo.Utils:new Object();
neo.CustomDropDown=function(){var N;var F;var J;var E=false;var B=10;var D=20;function K(){var U=jQuery("select.neoCustomDropDown");for(var T=0;T<U.length;T++){P(U[T]);}jQuery("body").trigger("neoDropDownLoaded");}function P(V){if(jQuery(V).attr("id")==""||jQuery(V).attr("id")==undefined){var U="sel_"+Math.floor(Math.random()*1234567890);
jQuery(V).attr("id",U);}else{var U=jQuery(V).attr("id");}var W=V.parentNode;var T=S(V);jQuery(T).click(function(X){neo.CustomDropDown.show(X);});jQuery(V).after(T);jQuery(T).attr("sel",U);jQuery(T).attr("id",U+"_cDD");jQuery(V).attr("cdd",U+"_cDD");if(V.disabled){jQuery(T).attr("disabled",true);
jQuery(T).addClass("disabled");}H(T,jQuery("#"+V.id+" option:selected").text());jQuery(V).css({"visibility":"hidden","position":"absolute"});}function Q(T){F=T.currentTarget;if(jQuery(F).attr("disabled")=="true"){return ;}N=document.getElementById(jQuery(F).attr("sel"));
O();C();A();jQuery(J).css("display","block");jQuery(window).bind("resize",neo.CustomDropDown.close);E=true;}function G(){jQuery(J).remove();jQuery(shim).remove();N=null;F=null;J=null;jQuery(window).unbind("resize",neo.CustomDropDown.close);E=false;}function S(W){var T=Number(jQuery(W).width())-24;
var V=document.createElement("div");V.className="customDropDownControl";var X=document.createElement("span");X.className="ddButton";var U=document.createElement("span");U.className="ddText";jQuery(V).css("width",T);jQuery(U).css("width",T-3);V.appendChild(U);
V.appendChild(X);return V;}function L(){var V=jQuery("#"+jQuery(N).attr("id")).children();for(var U=0,W=0;U<V.length;U++){if(V[U].nodeName.toLowerCase()=="optgroup"){var X=document.createElement("span");jQuery(X).html(jQuery(V[U]).attr("label"));J.appendChild(X);
var T=jQuery(V[U]).find("option");for(var Y=0;Y<T.length;Y++){I(T[Y],J,W,true);W++;}}else{I(V[U],J,W);W++;}}}function I(X,W,V,T){var U=document.createElement("a");jQuery(U).attr("optIndex",V);if(T){jQuery(U).html("&nbsp; &nbsp;"+jQuery(X).text());}else{jQuery(U).html(jQuery(X).text());
}jQuery(U).click(function(Y){neo.CustomDropDown.setSelected(Y);});jQuery(U).mouseover(function(Y){neo.CustomDropDown.setHighlighted(Y);});jQuery(U).mouseout(function(Y){neo.CustomDropDown.setHighlighted(Y);});W.appendChild(U);}function O(){if(document.getElementById("customDDOptions")){J=document.getElementById("customDDOptions");
}else{J=document.createElement("div");jQuery(J).attr("id","customDDOptions");jQuery(J).addClass("customDDOptions");document.body.appendChild(J);}jQuery(J).css("width","auto");L();}function A(){if(document.getElementById("customDDShim")){shim=document.getElementById("customDDShim");
}else{shim=document.createElement("div");shim.id="customDDShim";shim.onclick=G;document.body.appendChild(shim);}jQuery(shim).css("width",document.body.clientWidth);jQuery(shim).css("height",jQuery().height());jQuery(shim).css("display","block");}function C(){jQuery(J).css("overflow","auto");
var V=jQuery(J).children().length;jQuery(J).css("height",V>B?B*D:V*D);var Y=Number(jQuery(F).outerWidth()-2);var a=Number(jQuery(F).outerHeight());var b=Number(jQuery(J).outerWidth());var W=Number(jQuery(J).outerHeight());var T=b;if(b<Y){b=T=Y;if(jQuery(J).children().length>B){T-=24;
}else{jQuery(J).css("overflow","hidden");}}else{if(jQuery(J).children().length>B){b+=24;}}jQuery(J).css("width",b);jQuery(J).find("a, span").css("width",T);if(neo.Utils.getParam("lc")=="ar"||neo.Utils.getParam("lc")=="he"){var Z=(neo.Utils.findPosX(F)+Y)-b;
if(Z<0){Z=neo.Utils.findPosX(F);}}else{var Z=neo.Utils.findPosX(F);if(Z+b>jQuery(window).width()-24){Z=(Z+Y)-(b+26);}}jQuery(J).css("left",Z);var U=neo.Utils.findPosY(F)+a-1;var X=neo.Utils.getScrollY();if((U-X)+W>jQuery(window).height()-22){U=(U-a-W)+2;}jQuery(J).css("top",U);
}function M(U){var T=U.currentTarget;N.selectedIndex=T.getAttribute("optIndex");clickEvents=jQuery.data(N,"events");jQuery(N).change();H(F,jQuery(T).text());G();}function R(U){var T=U.currentTarget;if(U.type=="mouseover"){jQuery(T).addClass("highlighted");}else{if(U.type=="mouseout"){jQuery(T).removeClass("highlighted");
}}}function H(U,T){jQuery("#"+U.id+" span.ddText").text(T.trim());}return{init:K,show:Q,close:G,setSelected:M,setHighlighted:R,setPosition:C};}();jQuery(document).ready(function(){neo.CustomDropDown.init();});neo.Utils={findPosX:function(A){var B=0;if(A.offsetParent){while(1){B+=A.offsetLeft;
if(!A.offsetParent){break;}A=A.offsetParent;}}else{if(A.x){B+=A.x;}}return B;},findPosY:function(B){var A=0;if(B.offsetParent){while(1){A+=B.offsetTop;if(!B.offsetParent){break;}B=B.offsetParent;}}else{if(B.y){A+=B.y;}}return A;},getScrollY:function(){var A=0;
if(document.body.scrollTop){A=document.body.scrollTop;}else{if(document.documentElement.scrollTop){A=document.documentElement.scrollTop;}}return A;},getParam:function(E){var C=document.location.href;var B=C.indexOf("#");if(B!=-1){C=C.substr(0,B);}var A="";var F=new Array();
if(C.contains("?")){A=C.split("?");A=A[1];}if(A.contains("&")){F=A.split("&");}else{if(A.contains("=")){F.push(A);}}for(var D=0;D<F.length;D++){param=F[D].split("=");if(param[0]==E){return param[1];}}return"";}};