var selects=document.getElementsByTagName("select"),isIE=document.all&&window.ActiveXObject&&!window.opera?true:false;function $(a){return document.getElementById(a)}function stopBubbling(a){a.stopPropagation()}function rSelects(){for(i=0;i<selects.length;i++){selects[i].style.display="none";select_tag=document.createElement("div");select_tag.id="select_"+selects[i].name;select_tag.className="select_box";selects[i].parentNode.insertBefore(select_tag,selects[i]);select_info=document.createElement("div");select_info.id="select_info_"+selects[i].name;select_info.className="tag_select";select_info.style.cursor="pointer";select_tag.appendChild(select_info);select_ul=document.createElement("ul");select_ul.id="options_"+selects[i].name;select_ul.className="tag_options";select_ul.style.position="absolute";select_ul.style.display="none";select_ul.style.zIndex="999";select_tag.appendChild(select_ul);rOptions(i,selects[i].name);mouseSelects(selects[i].name);if(isIE)selects[i].onclick=new Function("clickLabels3('"+selects[i].name+"');window.event.cancelBubble = true;");else if(!isIE){selects[i].onclick=new Function("clickLabels3('"+selects[i].name+"')");selects[i].addEventListener("click",stopBubbling,false)}}}function rOptions(a,b){var d=selects[a].getElementsByTagName("option"),c="options_"+b;for(n=0;n<selects[a].options.length;n++){option_li=document.createElement("li");option_li.style.cursor="pointer";option_li.className="open";$(c).appendChild(option_li);option_text=document.createTextNode(selects[a].options[n].text);option_li.appendChild(option_text);option_selected=selects[a].options[n].selected;if(option_selected){option_li.className="open_selected";option_li.id="selected_"+b;$("select_info_"+b).appendChild(document.createTextNode(option_li.innerHTML))}option_li.onmouseover=function(){this.className="open_hover"};option_li.onmouseout=function(){if(this.id=="selected_"+b)this.className="open_selected";else this.className="open"};option_li.onclick=new Function("clickOptions("+a+","+n+",'"+selects[a].name+"')")}}function mouseSelects(b){var a="select_info_"+b;$(a).onmouseover=function(){if(this.className=="tag_select")this.className="tag_select_hover"};$(a).onmouseout=function(){if(this.className=="tag_select_hover")this.className="tag_select"};if(isIE)$(a).onclick=new Function("clickSelects('"+b+"');window.event.cancelBubble = true;");else if(!isIE){$(a).onclick=new Function("clickSelects('"+b+"');");$("select_info_"+b).addEventListener("click",stopBubbling,false)}}function clickSelects(b){var a="select_info_"+b,c="options_"+b;for(i=0;i<selects.length;i++)if(selects[i].name==b){if($(a).className=="tag_select_hover"){$(a).className="tag_select_open";$(c).style.display=""}else if($(a).className=="tag_select_open"){$(a).className="tag_select_hover";$(c).style.display="none"}}else{$("select_info_"+selects[i].name).className="tag_select";$("options_"+selects[i].name).style.display="none"}}function clickOptions(d,b,a){var c=$("options_"+a).getElementsByTagName("li");$("selected_"+a).className="open";$("selected_"+a).id="";c[b].id="selected_"+a;c[b].className="open_hover";$("select_"+a).removeChild($("select_info_"+a));select_info=document.createElement("div");select_info.id="select_info_"+a;select_info.className="tag_select";select_info.style.cursor="pointer";$("options_"+a).parentNode.insertBefore(select_info,$("options_"+a));mouseSelects(a);$("select_info_"+a).appendChild(document.createTextNode(c[b].innerHTML));$("options_"+a).style.display="none";$("select_info_"+a).className="tag_select";selects[d].options[b].selected="selected"}window.onload=function(){bodyclick=document.getElementsByTagName("body").item(0);rSelects();bodyclick.onclick=function(){for(i=0;i<selects.length;i++){$("select_info_"+selects[i].name).className="tag_select";$("options_"+selects[i].name).style.display="none"}}}