UI.extend.htmlSelect=function(option){var opt={type:this.getAttribute("type")||1,skip:this.getAttribute("skip")||"orange"};opt=$.extend(opt,option);var first=$(this).find("option").first();var arr=$(this).find("option");var templeteHtml="";var clickSelector="";var className="";if(opt.skip=="orange"){className="_orange"}switch(parseInt(opt.type)){case 1:var str="";for(var i=1;i'+n.html()+''}templeteHtml=''+first.html()+''+' ";var pt=$(this).parent();var change=this.onchange;var id=this.id;var name=this.name;$(this).replaceWith("
"+templeteHtml+"
");var make=pt.find("[click]");make.mousedown(function(){$("ul[type=2]").hide();return false}).click(function(){var list=$(this).nextAll(".show_listbox");list.toggle(150);if($(window).height()-20"+n.html()+""}var id=this.id||"";templeteHtml='
'+first.html()+""+' '+' "+"
";var pt=$(this).parent();var change=this.onchange;$(this).replaceWith("
"+templeteHtml+"
");var make=pt.find("[click]");make.mousedown(function(){}).click(function(){var list=$(this).nextAll(".select_listvalue");list.toggle();if(list.find("li").length==0){return}if($(window).height()-20"+n.html()+""}templeteHtml='
'+' "+' '+"
";var pt=$(this).parent();var change=this.onchange;var className=this.className;$(this).replaceWith("
"+templeteHtml+"
");var make=pt.find("[click]");pt.find("input").click(function(){$(this).next().toggle()});make.click(function(){$(this).prev().toggle();var input=$(this).prev().prev();if($(this).prev().is(":visible")){input.focus()}return false}).prev().prev().blur(function(){var elt=this;setTimeout(function(){$(elt).next().hide()},100)}).next().find("li").mousedown(function(){$(this).parent().parent().hide().prev().val(this.innerHTML);change&&change.call(this)});break}};$(document).mousedown(function(e){var obj=e.srcElement||e.target;var main=$(".htmlSelect ul:visible");if(main.length==0){return}var m=main.parent().parent()[0];if(m.contains(obj)||m==obj){return}if($(obj).parents(".type_showselect").length>0||$(obj).parents(".show_select").length>0){return}main.each(function(){if(!$(this).attr("class")){$(this).parent().hide()}else{$(this).hide()}})});