/*
selectInput v1.1
code:by Deeka
date:2008/09/17
QQ:80140281
e-mail:huangdijia@163.com
技术群:24810664
修正：1.FF与IE下的样式小问题
	  2.INPUT长度问题
	  3.窗口大小改变问题（感谢CSSRAIN的宝贵意见）
支持多个input(特别鸣谢==,cssrain,及帮忙测试的群友们)
*/
$.fn.inputer = function(o) {
	var obj = this;
	
	jQuery.each(obj,function(i,obj_sub){
		var inputerId = "_inputer" + obj_sub.id;
		
		var iset = $("input[id=" + obj_sub.id + "]").offset();
		$("input[id=" + obj_sub.id + "]").after("<select id='" + inputerId + "' name='"+ inputerId +"'></select>");
		
		//IE和FF有一点点区别
		$("select[id=" + inputerId + "]").width($(obj_sub).width() + ($.browser.msie?6:4) + "px");
		
		$("select[id=" + inputerId + "]").css({position:"absolute",
			display:"none",
			left:function(){return iset.left;},
			top:function(){return $.browser.msie?iset.top:iset.top + 1 +"px"},
			clip:"rect(1px " + ($("select[id=" + inputerId + "]").width() + ($.browser.msie?6:8) + "px") + " " + ($("select[id=" + inputerId + "]").height() + ($.browser.msie?1:2) + "px") + " " + ($("select[id=" + inputerId + "]").width() - 15 + "px") + ")",
			"font-size":obj.css("font-size")
		});
		
		var option = "<option value=''></option>";
		$.each(o,function(ovar,opt){
			option += '<option value=' + ovar + '>' + opt + '</option>';			
		});
		
		$("select[id=" + inputerId + "]").html(option)
		.css({display:"block"})
		.change(function(){
			$("input[id=" + obj_sub.id +"]").val($("option:selected",this).html());
		});
	});
	
};