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").not("select.neoCustomDropDown.neocontrol-initialized");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(V).bind("change",function(X){neo.CustomDropDown.setCDDText(document.getElementById(jQuery(this).attr("cdd")),jQuery("#"+jQuery(this).attr("id")+" :selected").text());
});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"});jQuery(V).addClass("neocontrol-initialized");}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";
jQuery(shim).bind("click",neo.CustomDropDown.close);document.body.appendChild(shim);}jQuery(shim).css({"width":"100%","height":jQuery(document).height()-5});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+22<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;}}if(neo.isRtl){if(jQuery(J).children().length<B){T=T-6;jQuery("#customDDOptions a").css({"text-indent":"4px","direction":"rtl"});}}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,setCDDText:H};}();neo.neoCustomInput=neo.neoCustomInput?neo.neoCustomInput:new Object();neo.neoCustomInput=function(){function I(K){var J=K==undefined?jQuery("input.neoCustomInput"):jQuery(K);
jQuery.each(J,function(L,M){A(M);});jQuery("body").trigger("neoCheckBoxLoaded");}function A(L){if(jQuery(L).attr("id")==""||jQuery(L).attr("id")==undefined){var K="cc_"+Math.floor(Math.random()*1234567890);jQuery(L).attr("id",K);}else{var K=jQuery(L).attr("id");
}var J=E(L,L.type);jQuery(L).after(J);jQuery(J).attr("ccinputid",K);jQuery(J).attr("id",K+"_div");jQuery(L).attr("ccdivid",K+"_div");G(L);jQuery(J).css({"marginTop":jQuery(L).css("marginTop"),"marginRight":jQuery(L).css("marginRight"),"marginBottom":jQuery(L).css("marginBottom"),"marginLeft":jQuery(L).css("marginLeft")});
jQuery(L).css({"visibility":"hidden","position":"absolute"});}function D(K){var J=K.currentTarget;var L=document.getElementById(jQuery(J).attr("ccinputid"));if(L.disabled){return false;}if(!L.checked){L.checked=true;}else{L.checked=false;}G(L);}function B(O){var K=O.currentTarget;
var P=document.getElementById(jQuery(K).attr("ccinputid"));var M=K.id;var J=jQuery("#"+M).attr("name");var N=document.getElementsByTagName("DIV");for(var L=0;L<N.length;L++){if(N[L].getAttribute("name")==J){jQuery(N[L]).removeClass("customRadioSelected");}}P.checked=true;
jQuery("#"+M).addClass("customRadioSelected");jQuery(P).click();}function E(N,L){var J=Number(jQuery(N).width())-24;var K=document.createElement("div");var M=document.createElement("img");M.src="/cws/images/spacer.gif";K.appendChild(M);switch(L){case"radio":K.className="customRadioControl";
jQuery(K).attr("name",N.name);jQuery(K).click(function(O){neo.neoCustomInput.setRadioChecked(O);});break;case"checkbox":K.className="customCheckBoxControl";M.width=13;M.height=13;jQuery(K).click(function(O){neo.neoCustomInput.setChecked(O);});break;default:}return K;
}function C(J){J.disabled=true;G(J);}function F(J){J.disabled=false;G(J);}function H(K,J){if(J){K.checked=true;}else{K.checked=false;}G(K);}function G(K){var J=document.getElementById(jQuery(K).attr("ccdivid"));jQuery(J).attr("class","customCheckBoxControl");
if(K.disabled&&K.checked){jQuery(J).addClass("customCheckBoxSelectedDisabled");}else{if(K.disabled&&!K.checked){jQuery(J).addClass("customCheckBoxDisabled");}else{if(!K.disabled&&K.checked){jQuery(J).addClass("customCheckBoxSelected");}}}}return{init:I,setChecked:D,setRadioChecked:B,disable:C,enable:F,checked:H};
}();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;},getScrollX:function(){var A=0;if(document.body.scrollLeft){A=document.body.scrollLeft;}else{if(document.documentElement.scrollLeft){A=document.documentElement.scrollLeft;
}}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"";
}};
