jQuery.cookie=function(H,D,A){if(typeof D!="undefined"){A=A||{};if(D===null){D="";A.expires=-1}var G="";if(A.expires&&(typeof A.expires=="number"||A.expires.toUTCString)){var B;if(typeof A.expires=="number"){B=new Date();B.setTime(B.getTime()+(A.expires*60*60*1000))}else{B=A.expires}G="; expires="+B.toUTCString()}var K=A.path?"; path="+(A.path):"";var C=A.domain?"; domain="+(A.domain):"";var I=A.secure?"; secure":"";document.cookie=[H,"=",encodeURIComponent(D),G,K,C,I].join("")}else{var F=null;if(document.cookie&&document.cookie!=""){var L=document.cookie.split(";");for(var J=0;J<L.length;J++){var E=jQuery.trim(L[J]);if(E.substring(0,H.length+1)==(H+"=")){F=decodeURIComponent(E.substring(H.length+1));break}}}return F}};
var GlobalSearchDefaultText="";var isLoggedIn=false;jQuery(document).ready(function(){jQuery("#superdrop_btn").click(function(){toggleSuperdrop()});jQuery("#global_search").focus(function(){if(jQuery("#global_search").val()==GlobalSearchDefaultText){jQuery("#global_search").val("")}});jQuery("#global_search").blur(function(){if(jQuery("#global_search").val()==""){jQuery("#global_search").val(GlobalSearchDefaultText)}});if(jQuery("#global_search").length>0){GlobalSearchDefaultText=jQuery("#global_search").val()}jQuery(".lang_select ul a").click(function(){if(jQuery("#login").is(":visible")){jQuery("#login").slideUp("fast",function(){jQuery("#langsel").slideDown("normal",function(){jQuery(".lang_select ul a").addClass("active")})})}else{if(jQuery("#langsel").is(":hidden")){jQuery("#langsel").slideDown("normal",function(){jQuery(".lang_select ul a").addClass("active")})}else{jQuery("#langsel").slideUp("normal",function(){jQuery(".lang_select ul a").removeClass("active")})}}});jQuery("#langsel").mouseenter(function(){if(typeof(lt)!="undefined"){clearTimeout(lt)}});jQuery(".lang_select ul a").mouseleave(function(){lt=setTimeout("closeSelector()",1500)});jQuery(".lang_select ul a").mouseenter(function(){if(typeof(lt)!="undefined"){clearTimeout(lt)}});jQuery("#langsel").mouseleave(function(){lt=setTimeout("closeSelector()",1500)});var B=jQuery("#global_select").width();jQuery("#global_select").sSelect();jQuery(".newListSelected").css({width:B+10+"px"});jQuery(".newList").css({width:B+10+"px",top:"25px"});var A=jQuery(".g_search_select").width()+200;jQuery(".globalsearch .rel").css({width:A+"px",margin:"auto",visibility:"visible"});jQuery(".newList").mouseleave(function(){selecttimer=setTimeout("closeSelect()",1500)});jQuery(".newList").mouseenter(function(){if(typeof(selecttimer)!="undefined"){clearTimeout(selecttimer)}})});function resolveLoginState(){if(isLoggedIn==false){jQuery("#login_btn").click(function(){if(jQuery("#langsel").is(":visible")){jQuery("#langsel").slideUp("fast",function(){jQuery("#login").slideDown("normal",function(){jQuery("#login_btn").addClass("active");jQuery("#txtemail").focus()})})}else{if(jQuery("#login").is(":hidden")){jQuery("#login").slideDown("normal",function(){jQuery("#login_btn").addClass("active");jQuery("#txtemail").focus()})}else{jQuery("#login").slideUp("normal",function(){jQuery("#login_btn").removeClass("active")})}}});jQuery("#login").mouseenter(function(){if(typeof(lgt)!="undefined"){clearTimeout(lgt)}});var A=function(){lgt=setTimeout("closeLogin()",1500)};jQuery("#login").bind("mouseleave",A);jQuery("#login_btn").mouseenter(function(){if(typeof(lgt)!="undefined"){clearTimeout(lgt)}});jQuery("#login_form #txtemail").focus(function(){jQuery("#login").unbind("mouseleave",A)});jQuery("#login_form #txtemail").blur(function(){jQuery("#login").bind("mouseleave",A)});jQuery("#login_form #txtpwd").focus(function(){jQuery("#login").unbind("mouseleave",A)});jQuery("#login_form #txtpwd").blur(function(){jQuery("#login").bind("mouseleave",A)})}}function closeSelector(){jQuery("#langsel").slideUp("normal",function(){jQuery(".lang_select ul a").removeClass("active");clearTimeout(lt)})}function closeLogin(){jQuery("#login").slideUp("normal",function(){jQuery("#login_btn").removeClass("active");clearTimeout(lgt)})}function toggleSuperdrop(){if(jQuery(".globaldrop").is(":hidden")){jQuery(".globaldrop").slideDown("slow",function(){jQuery("#superdrop_btn").addClass("active")})}else{jQuery(".globaldrop").slideUp("slow",function(){jQuery("#superdrop_btn").removeClass("active")})}}function closeSelect(){if(typeof(selecttimer)!="undefined"){clearTimeout(selecttimer)}jQuery(".newList").hide()}function selectReplacement(G){G.className+=" replaced";var F=document.createElement("ul");F.className="selectReplacement";var A=G.options;for(var E=0;E<A.length;E++){var C;if(A[E].selected){C=E;break}else{C=0}}for(var E=0;E<A.length;E++){var D=document.createElement("li");var B=document.createTextNode(A[E].text);D.appendChild(B);D.selIndex=A[E].index;D.selectID=G.id;D.onclick=function(){selectMe(this)};if(E==C){D.className="selected";D.onclick=function(){this.parentNode.className+=" selectOpen";this.onclick=function(){selectMe(this)}}}if(window.attachEvent){D.onmouseover=function(){this.className+=" hover"};D.onmouseout=function(){this.className=this.className.replace(new RegExp(" hover\\b"),"")}}F.appendChild(D)}G.parentNode.insertBefore(F,G)}function selectMe(C){var B=C.parentNode.getElementsByTagName("li");for(var A=0;A<B.length;A++){if(B[A]!=C){B[A].className="";B[A].onclick=function(){selectMe(this)}}else{setVal(C.selectID,C.selIndex);C.className="selected";C.parentNode.className=C.parentNode.className.replace(new RegExp(" selectOpen\\b"),"");C.onclick=function(){C.parentNode.className+=" selectOpen";this.onclick=function(){selectMe(this)}}}}}function setVal(B,A){var C=document.getElementById(B);C.selectedIndex=A}function setForm(B){var A=document.getElementById(B);selectReplacement(A)}function executeFunctionOnEnter(B,C){B=B||window.event;var A=B.keyCode||B.which;if(A==13){C();return false}else{return true}};
(function(A){A("html").addClass("stylish-select");Array.prototype.indexOf=function(C,D){for(var B=(D||0);B<this.length;B++){if(this[B]==C){return B}}};A.fn.extend({getSetSSValue:function(B){if(B){A(this).val(B).change();return this}else{return A(this).find(":selected").val()}},resetSS:function(){var B=A(this).data("ssOpts");$this=A(this);$this.next().remove();$this.unbind().sSelect(B)}});A.fn.sSelect=function(B){return this.each(function(){var N={defaultText:"Please select",animationSpeed:0,ddMaxHeight:""};var Q=A.extend(N,B),W=A(this),O=A('<div class="selectedTxt"></div>'),G=A('<div class="newListSelected" tabindex="0"></div>'),D=A('<ul class="newList"></ul>'),I=-1,V=-1,R=[],L=false,K=false,Z;A(this).data("ssOpts",B);G.insertAfter(W);O.prependTo(G);D.appendTo(G);W.hide();if(W.children("optgroup").length==0){W.children().each(function(b){var c=A(this).text();var a=A(this).val();R.push(c.charAt(0).toLowerCase());if(A(this).attr("selected")==true){Q.defaultText=c;V=b}D.append(A("<li value="+a+'><a href="JavaScript:void(0);" >'+c+"</a></li>").data("key",a))});Z=D.children().children()}else{W.children("optgroup").each(function(){var a=A(this).attr("label"),c=A('<li class="newListOptionTitle">'+a+"</li>");c.appendTo(D);var b=A("<ul></ul>");b.appendTo(c);A(this).children().each(function(){++I;var e=A(this).text();var d=A(this).val();R.push(e.charAt(0).toLowerCase());if(A(this).attr("selected")==true){Q.defaultText=e;V=I}b.append(A('<li><a href="JavaScript:void(0);">'+e+"</a></li>").data("key",d))})});Z=D.find("ul li a")}var T=D.height(),S=G.height(),C=Z.length;if(V!=-1){M(V,true)}else{O.text(Q.defaultText)}function E(){var b=G.offset().top,a=jQuery(window).height(),c=jQuery(window).scrollTop();if(T>parseInt(Q.ddMaxHeight)){T=parseInt(Q.ddMaxHeight)}b=b-c;if(b+T>=a){D.css({top:"-"+T+"px",height:T});W.onTop=true}else{D.css({top:S+"px",height:T});W.onTop=false}}E();A(window).resize(function(){E()});A(window).scroll(function(){E()});function H(){G.css("position","relative")}function U(){G.css("position","static")}O.click(function(a){a.stopPropagation();A(".newList").not(A(this).next()).hide().parent().removeClass("newListSelFocus");D.toggle();H();Z.eq(V).focus()});Z.click(function(b){var a=A(b.target);V=Z.index(a);K=true;M(V);D.hide();G.css("position","static")});Z.hover(function(b){var a=A(b.target);a.addClass("newListHover")},function(b){var a=A(b.target);a.removeClass("newListHover")});function M(a,d){Z.removeClass("hiLite").eq(a).addClass("hiLite");if(D.is(":visible")){Z.eq(a).focus()}var c=Z.eq(a).text();var b=Z.eq(a).parent().data("key");if(d==true){W.val(b);O.text(c);return false}W.val(b);W.change();O.text(c)}W.change(function(a){$targetInput=A(a.target);if(K==true){K=false;return false}$currentOpt=$targetInput.find(":selected");V=$targetInput.find("option").index($currentOpt);M(V,true)});function F(a){a.onkeydown=function(d){var c;if(d==null){c=event.keyCode}else{c=d.which}K=true;switch(c){case 40:case 39:J();return false;break;case 38:case 37:P();return false;break;case 33:case 36:Y();return false;break;case 34:case 35:X();return false;break;case 13:case 27:D.hide();U();return false;break}keyPressed=String.fromCharCode(c).toLowerCase();var b=R.indexOf(keyPressed);if(typeof b!="undefined"){++V;V=R.indexOf(keyPressed,V);if(V==-1||V==null||L!=keyPressed){V=R.indexOf(keyPressed)}M(V);L=keyPressed;return false}}}function J(){if(V<(C-1)){++V;M(V)}}function P(){if(V>0){--V;M(V)}}function Y(){V=0;M(V)}function X(){V=C-1;M(V)}G.click(function(){F(this)});G.focus(function(){A(this).addClass("newListSelFocus");F(this)});G.blur(function(){A(this).removeClass("newListSelFocus")});A("body").click(function(){G.removeClass("newListSelFocus");D.hide();U()});O.hover(function(b){var a=A(b.target);a.parent().addClass("newListSelHover")},function(b){var a=A(b.target);a.parent().removeClass("newListSelHover")});D.css("left","0").hide()})}})(jQuery);
