function tamingselect(){function e(e,t){return new RegExp("\\b"+t+"\\b").test(e.className)}function t(t,n,a){var o=t.className;t.className=e(t,n)?o.replace(n,a):o.replace(a,n)}function n(t,n){e(t,n)||(t.className+=""==t.className?n:" "+n)}if(document.getElementById||document.createTextNode){for(var a="turnintodropdown",o="turnintoselect",r="dropcontainer",i="activetrigger",d="trigger",l="dropdownhidden",c="dropdownvisible",s=0,m=new Array,g=document.getElementsByTagName("select"),p=0;pp;p++)m[p].parentNode.removeChild(m[p])}}window.onload=function(){tamingselect(),$(document).on("click",function(e){var t=$(".dropcontainer .dropdownvisible");t===e.target||t.has(e.target).length||$(".dropcontainer ul").removeClass("dropdownvisible").addClass("dropdownhidden")}),$(document).on("click",function(e){var t=$(".category-search a:first");t===e.target||t.has(e.target).length||t.removeClass("activetrigger").addClass("trigger")})};