/*检测浏览器版本*/

is=[];
is.select	= true;
is.dom	= document.getElementById?1:0;
is.ua	= navigator.userAgent.toLowerCase();
is.ie	= is.ua.match(/msie/)||0;
is.ie6	= is.ua.match(/msie 6/)||0;
is.ie5	= is.ua.match(/msie 5/)||0;
is.ie50	= is.ua.match(/msie 5\.0/)||0;
is.mac	= is.ua.match(/mac/)||0;
if (!is.dom||is.mac||is.ie50) is.select  = false;

/*主函数*/

var select  = function()
{
	if((!this.itemlist) && is.select)
	{
		this.name			= new Array("");
		this.isinit			= new Array();
		this.itemlist		= new Array();
		this.valuelist		= new Array();
		
		this.isedit			= new Array();
		this.ishow			= new Array();
		this.showinit		= new Array();
		this.width			= new Array();
		this.height			= new Array();
		this.showitem		= new Array();
		
		this.outbgcolor		= new Array();
		this.bordercolor	= new Array();
		this.inbgcolor		= new Array();
		this.inobgcolor		= new Array();
		this.bgcolor		= new Array();
		this.obgcolor		= new Array();
		this.linecolor		= new Array();
		this.textcolor		= new Array();
		
		this.incode			= new Array();
		this.outcode		= new Array();
		this.itemcode		= new Array();
		this.htmlcode		= new Array();
		
		this.alpha		= new Array();
		this.CurrItem		= new Array();
		this.defaultitem	= new Array();
		this.ParaItem		= new Array("","width","height","showitem","showinit","outbgcolor","bordercolor","inbgcolor","inobgcolor","bgcolor","obgcolor","linecolor","textcolor","isedit","ishow","defaultitem","alpha","宽度","高度","显示项目数","显示初始化","外背景色","边框色","内背景色","变换内背景色","下拉背景色","变换下拉背景色","分隔线色","字体色","是否可编辑","是否显示","默认选项","透明度");
		this.CurrSelect		= 0;
		this.OverMode		= 0;		//1为超连接方式 0为js方式
	}
}
/* 分隔线生成 */
select.prototype.wLine	= function()
{
	var wLine_para_tmp;
	var i, wLineCount, wLineColor1, wLineColor2, wLineStart;
	wLineCount	= ((arguments[0])?Math.abs(arguments[0]):15);
	wLineColor1 = ((arguments[1])?arguments[1]:"#000000");
	wLineColor2 = ((arguments[2])?arguments[2]:"");
	wLineStart	= ((arguments[3])?arguments[3]:1);
	wLineCount	= ((wLineCount % 2 == 0)?wLineCount - 1:wLineCount);
	wLine_para_tmp = '<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="1" height="' + wLineCount + '">';
	for(i=0;i<wLineCount;i++)
	{
		wLine_para_tmp += '<tr><td' + ((i%2!=wLineStart)?' bgcolor="' + wLineColor1 + '"':((wLineColor2!="")?' bgcolor="' + wLineColor2 + '"':"")) + '></td></tr>';
	}
	wLine_para_tmp += '</table>';
	return wLine_para_tmp;
}
/* 圆角表格生成 */
select.prototype.rtLoad		= function()
{
	var rtLoad_para_tmp;
	rtLoad_para_tmp = arguments.length;
	if(arguments.length==17)
	{
		var rtLoad_HTML		= "";
		var rtLoad_tmp		= "";
		var rtLoad_Diff		= 0;
		var rtLoad_rtMode	= arguments[0];
		var rtLoad_name 	= arguments[1];
		var rtLoad_width	= arguments[2];
		var rtLoad_height	= arguments[3];
		var rtLoad_rlt		= arguments[4];
		var rtLoad_rrt		= arguments[5];
		var rtLoad_rlb		= arguments[6];
		var rtLoad_rrb		= arguments[7];
		var rtLoad_align	= arguments[8];
		var rtLoad_valign	= arguments[9];
		var rtLoad_outbg	= arguments[10];
		var rtLoad_border	= arguments[11];
		var rtLoad_inbg		= arguments[12];
		var rtLoad_inobg	= arguments[13];
		var rtLoad_padding	= arguments[14]
		var rtLoad_content	= arguments[15];
		var rtLoad_action	= arguments[16];
		
		switch(rtLoad_rtMode)
		{
			case 1:
				rtLoad_Diff = 2;
				var rtWArray=new Array(1,rtLoad_width - rtLoad_Diff,1);
				var rtHArray=new Array(1,rtLoad_height - rtLoad_Diff,1);
				break;
			case 2:
				rtLoad_Diff = 4;
				var rtWArray=new Array(1,1,rtLoad_width - rtLoad_Diff,1,1);
				var rtHArray=new Array(1,1,rtLoad_height - rtLoad_Diff,1,1);
				break;
			case 3:
				rtLoad_Diff = 8;
				var rtWArray=new Array(1,1,2,rtLoad_width - rtLoad_Diff,2,1,1);
				var rtHArray=new Array(1,1,2,rtLoad_height - rtLoad_Diff,2,1,1);
				break;
			case 4:
				rtLoad_Diff = 10;
				var rtWArray=new Array(1,1,1,2,rtLoad_width - rtLoad_Diff,2,1,1,1);
				var rtHArray=new Array(1,1,1,2,rtLoad_height - rtLoad_Diff,2,1,1,1);
				break;
			case 5:
				rtLoad_Diff = 14;
				var rtWArray=new Array(1,1,1,2,2,rtLoad_width - rtLoad_Diff,2,2,1,1,1);
				var rtHArray=new Array(1,1,1,2,2,rtLoad_height - rtLoad_Diff,2,2,1,1,1);
				break;
			case 6:
				rtLoad_Diff = 12;
				var rtWArray=new Array(1,1,1,1,1,1,rtLoad_width - rtLoad_Diff,1,1,1,1,1,1);
				var rtHArray=new Array(1,1,1,1,1,1,rtLoad_height - rtLoad_Diff,1,1,1,1,1,1);
				break;
			default:
				rtLoad_Diff = 8;
				var rtWArray=new Array(1,1,2,rtLoad_width - rtLoad_Diff,2,1,1);
				var rtHArray=new Array(1,1,2,rtLoad_height - rtLoad_Diff,2,1,1);
				break;
		}
		
		if(rtWArray&&rtHArray)
		{
			var rtM=rtWArray.length-rtWArray.length%2;
			var rtN=rtM/2;
		}
		
		if(rtWArray&&rtHArray&&rtM&&rtN)
		{
			rtLoad_HTML = '<div id="position_' + rtLoad_name + '" onclick="' + rtLoad_action + '" oncontextmenu="' + rtLoad_action + ';return false" style="width:' + rtLoad_width + ';height:' + rtLoad_height + ';cursor:default;">';
			rtLoad_HTML += '<table border="0" cellpadding="0" cellspacing="0">';
			rtLoad_HTML += '';
			
			for(rtLoad_para_i=0;rtLoad_para_i<=rtM;rtLoad_para_i++)
			{
				rtLoad_HTML += '<tr>';
				for(rtLoad_para_j=0;rtLoad_para_j<=rtM;rtLoad_para_j++)
				{
					rtLoad_HTML += '<td width="' + rtWArray[rtLoad_para_j] +'" height="' + rtHArray[rtLoad_para_i] + '"';
					rtLoad_para_m = ((rtLoad_para_i>=rtN)?(rtLoad_para_i-rtN):(rtN-rtLoad_para_i));
					rtLoad_para_n = ((rtLoad_para_i>=rtN)?(rtM-(rtLoad_para_i-rtN)):(rtM-(rtN-rtLoad_para_i)));
					rtLoad_tmp = '';
					if(rtLoad_para_i<rtN&&rtLoad_para_j<rtN)	//检验左上角
					{
						if(rtLoad_rlt)
							rtLoad_tmp = ' bgcolor="' + ((rtLoad_para_j==rtLoad_para_m||rtLoad_para_j==rtLoad_para_n)?rtLoad_border:rtLoad_outbg) + '"';
						else
							rtLoad_tmp = ' bgcolor="' + ((rtLoad_para_i==0||rtLoad_para_j==0)?rtLoad_border:rtLoad_inbg) + '"';
					}
					if(rtLoad_para_i<rtN&&rtLoad_para_j>rtN)	//检验右上角
					{
						if(rtLoad_rrt)
							rtLoad_tmp = ' bgcolor="' + ((rtLoad_para_j==rtLoad_para_m||rtLoad_para_j==rtLoad_para_n)?rtLoad_border:rtLoad_outbg) + '"';
						else
							rtLoad_tmp = ' bgcolor="' + ((rtLoad_para_i==0||rtLoad_para_j==rtM)?rtLoad_border:rtLoad_outbg) + '"';
					}
					if(rtLoad_para_i>rtN&&rtLoad_para_j<rtN)	//检验左下角
					{
						if(rtLoad_rlb)
							rtLoad_tmp = ' bgcolor="' + ((rtLoad_para_j==rtLoad_para_m||rtLoad_para_j==rtLoad_para_n)?rtLoad_border:rtLoad_outbg) + '"';
						else
							rtLoad_tmp = ' bgcolor="' + ((rtLoad_para_i==rtM||rtLoad_para_j==0)?rtLoad_border:rtLoad_outbg) + '"';
					}
					if(rtLoad_para_i>rtN&&rtLoad_para_j>rtN)	//检验右下角
					{
						if(rtLoad_rrb)
							rtLoad_tmp = ' bgcolor="' + ((rtLoad_para_j==rtLoad_para_m||rtLoad_para_j==rtLoad_para_n)?rtLoad_border:rtLoad_outbg) + '"';
						else
							rtLoad_tmp = ' bgcolor="' + ((rtLoad_para_i==rtM||rtLoad_para_j==rtM)?rtLoad_border:rtLoad_outbg) + '"';
					}
					rtLoad_HTML += ((rtLoad_tmp==' bgcolor=""')?'':rtLoad_tmp);
					rtLoad_tmp = '';
					if(rtLoad_para_i==rtN&&rtLoad_para_j==rtN)	//内容所在正中
					{
						rtLoad_HTML += ' id="' + rtLoad_name + '_bg" align="' + rtLoad_align + '" valign="' + rtLoad_valign + '"';
						rtLoad_tmp = ((rtLoad_inbg!='')?' bgcolor="' + rtLoad_inbg + '"':'');
						rtLoad_HTML += ((rtLoad_tmp=='')?'':rtLoad_tmp);
						rtLoad_HTML += ((rtLoad_inobg!=''&&rtLoad_inbg!=rtLoad_inobg)?' onmouseover="for(i=0;i<' + rtLoad_name + '_bg.length;i++)' + rtLoad_name + '_bg[i].style.backgroundColor=\'' + rtLoad_inobg + '\'" onmouseout="for(i=0;i<' + rtLoad_name + '_bg.length;i++)' + rtLoad_name + '_bg[i].style.backgroundColor=\'' + rtLoad_inbg + '\'"':'');
						rtLoad_HTML += 'style="' + ((rtLoad_padding!=''&&rtLoad_padding>0)?'padding:' + rtLoad_padding + 'px;':'') + 'font-size:12px;">' + rtLoad_content;
					}
					else if((rtLoad_para_i==rtN&&rtLoad_para_j==0)||(rtLoad_para_i==0&&rtLoad_para_j==rtN)||(rtLoad_para_i==rtN&&rtLoad_para_j==rtM)||(rtLoad_para_i==rtM&&rtLoad_para_j==rtN))		//边框上色
					{
						rtLoad_HTML += ((rtLoad_border!='')?' bgcolor="' + rtLoad_border + '">':'');
					}
					else if((rtLoad_para_i==rtN&&rtLoad_para_j<rtN)||(rtLoad_para_i==rtN&&rtLoad_para_j>rtN)||(rtLoad_para_i<rtN&&rtLoad_para_j==rtN)||(rtLoad_para_i>rtN&&rtLoad_para_j==rtN))		//边框内内容外四边
					{
						rtLoad_HTML += ((rtLoad_inobg!=''&&rtLoad_inbg!=rtLoad_inobg)?' onmouseover="for(i=0;i<' + rtLoad_name + '_bg.length;i++)' + rtLoad_name + '_bg[i].style.backgroundColor=\'' + rtLoad_inobg + '\'" onmouseout="for(i=0;i<' + rtLoad_name + '_bg.length;i++)' + rtLoad_name + '_bg[i].style.backgroundColor=\'' + rtLoad_inbg + '\'"':'');
						rtLoad_HTML += ' id="' + rtLoad_name + '_bg"';
						rtLoad_tmp = ' bgcolor="' + ((rtLoad_inbg!='')?rtLoad_inbg:'') + '"';
						rtLoad_HTML += ((rtLoad_tmp.toLowerCase()==' bgcolor=""')?'':rtLoad_tmp) + '>';
					}
					else	//边框外四角
					{
						rtLoad_tmp = ' bgcolor="' + ((rtLoad_outbg!='')?rtLoad_outbg:'') + '"';
						rtLoad_HTML += ((rtLoad_tmp.toLowerCase()==' bgcolor=""')?'':rtLoad_tmp) + '>';
					}
					rtLoad_HTML += '</td>';
				}
				rtLoad_HTML += '</tr>';
			}
			rtLoad_HTML += '</table></div>';
			rtLoad_para_tmp = rtLoad_HTML;
		}
	}
	return(rtLoad_para_tmp);
}

select.prototype.addselect	= function()
{
	if(arguments.length>0)
	{
		this.CurrSelect	= this.name.length;
		
		this.name[this.CurrSelect]			= arguments[0];
		this.isinit[this.CurrSelect]		= false;
		this.showinit[this.CurrSelect]		= false;
		this.defaultitem[this.CurrSelect]	= 0;
		this.itemlist[this.CurrSelect]		= new Array();
		this.valuelist[this.CurrSelect]		= new Array();
		this.setselect();
		return(this.CurrSelect);
	}
}
select.prototype.setselect	= function()
{
	if(arguments.length==0)
	{
		this.CurrSelect	= this.name.length-1;
		
		this.isedit[this.CurrSelect]		= false;
		this.ishow[this.CurrSelect]			= false;
		this.showinit[this.CurrSelect]		= false;
		this.width[this.CurrSelect]			= 100;					//总长
		this.height[this.CurrSelect]		= 18;					//高度
		this.showitem[this.CurrSelect]		= 5;					//显示项目数目
		
		this.outbgcolor[this.CurrSelect]	= "";					//外背景色
		this.bordercolor[this.CurrSelect]	= "#AFAFAF";			//边框色
		this.inbgcolor[this.CurrSelect]		= "";					//内背景色
		this.inobgcolor[this.CurrSelect]	= "";					//变换内背景色
		this.bgcolor[this.CurrSelect]		= "";					//下拉背景色
		this.obgcolor[this.CurrSelect]		= "#F8F8F8";			//变换下拉背景色
		this.linecolor[this.CurrSelect]		= "#AFAFAF";			//分隔线色
		this.textcolor[this.CurrSelect]		= "#000000";			//文本色

		this.incode[this.CurrSelect]		= "";
		this.outcode[this.CurrSelect]		= "";
		this.itemcode[this.CurrSelect]		= "";
		this.htmlcode[this.CurrSelect]		= "";
		this.alpha[this.CurrSelect]		= 95;
		
	}
	else if(arguments.length==2||arguments.length==3)
	{
		this.CurrSelect	= ((arguments.length==2)?(this.name.length-1):Math.abs(arguments[0]));
		setselect_para_j = 0;
		for(setselect_para_i=0;setselect_para_i<this.ParaItem.length;setselect_para_i++)
		{
			if(this.ParaItem[setselect_para_i]==arguments[arguments.length-2]||arguments[arguments.length-2]==setselect_para_i)
			{
				setselect_para_j = setselect_para_i;
				break;
			}
		}
		if(setselect_para_j > (this.ParaItem.length-1)/2) setselect_para_j = setselect_para_j - (this.ParaItem.length-1) / 2;
		if(IsNumeric(arguments[arguments.length-1]))
			eval("this."+this.ParaItem[setselect_para_j]+"[this.CurrSelect]="+arguments[arguments.length-1]);
		else
			eval("this."+this.ParaItem[setselect_para_j]+"[this.CurrSelect]='"+arguments[arguments.length-1]+"'");
		//if(this.showinit[this.CurrSelect]) this.show(this.CurrSelect);
	}
}
select.prototype.additem	= function()
{
	if(arguments.length>0)
	{
		this.isinit[this.CurrSelect] = true;
		this.CurrSelect	= ((IsNumeric(arguments[0]))?(Math.abs(arguments[0])):(this.name.length-1));
		this.CurrSelect	= ((Math.abs(this.CurrSelect)>=this.name.length)?(this.name.length-1):(this.CurrSelect));
		additem_para_s	= ((IsNumeric(arguments[0]))?1:0);
		if(arguments.length>3)
		{
			additem_para_i = Math.abs(((arguments.length - additem_para_s) - ((arguments.length - additem_para_s) % 2))/2);
			for(additem_para_j=0;additem_para_j<additem_para_i;additem_para_j++)
			{
				additem_para_k = this.itemlist[this.CurrSelect].length;
				this.itemlist[this.CurrSelect][additem_para_k]	= arguments[additem_para_j * 2 / 1 + additem_para_s];
				this.valuelist[this.CurrSelect][additem_para_k]	= arguments[additem_para_j * 2 / 1 + additem_para_s / 1 + 1];
			}
		}
		else
		{
			additem_para_i = this.itemlist[this.CurrSelect].length;
			this.itemlist[this.CurrSelect][additem_para_i]	= arguments[additem_para_s];
			this.valuelist[this.CurrSelect][additem_para_i]	= ((additem_para_s / 1 + 1>=arguments.length)?"":arguments[additem_para_s / 1 + 1]);
		}
		this.showitem[this.CurrSelect] = this.itemlist[this.CurrSelect].length;
		if(this.showinit[this.CurrSelect]) this.show(this.CurrSelect);
	}
}
select.prototype.getOutLine	= function()
{
	this.CurrSelect	= ((IsNumeric(arguments[0]))?(Math.abs(arguments[0])):(this.name.length-1));
	if(this.isinit[this.CurrSelect])
	{
		var wLoadin_tmp;
		wLoadin_tmp =  '<table oncontextmenu="return false" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;filter:alpha(opacity='+ this.alpha[this.CurrSelect] +');" width="' + (this.width[this.CurrSelect]-4) + '" height="' + (this.height[this.CurrSelect]-4) + '">';
		wLoadin_tmp += '<tr>';
		wLoadin_tmp += '<td width="' + (this.width[this.CurrSelect]-19) + '" align="center">';
		wLoadin_tmp += '<span style="position:relative;top:-1px;padding:0px;"><input id="select_' + this.name[this.CurrSelect] + '" oncontextmenu="return false" name="select_' + this.name[this.CurrSelect] + '" type="text"'
		wLoadin_tmp += ((this.isedit[this.CurrSelect])?' onKeydown="if(event.keyCode==13&&this.value.length>0){wxselect.additem(' + this.CurrSelect + ',this.value);return false;}"':' onselectstart="return false" readonly')
		wLoadin_tmp += ' size="20" style="cursor:default;color:' + this.textcolor[this.CurrSelect] + ';border:0px solid #656566;background-color:transparent;width:' + (this.width[this.CurrSelect]-25) + ';padding:0px;font-family:Tahoma;height:12px;font-size:11px" value="' + this.itemlist[this.CurrSelect][this.defaultitem[this.CurrSelect]] + '"></span><input type="hidden" name="' + this.name[this.CurrSelect] + '" id="' + this.name[this.CurrSelect] + '" value="' + this.valuelist[this.CurrSelect][this.defaultitem[this.CurrSelect]] + '">';
		wLoadin_tmp += '</td><td width="1" valign="bottom">' + this.wLine(Math.abs(this.height[this.CurrSelect]-4),this.linecolor[this.CurrSelect]) + '</td>';
		wLoadin_tmp += '<td width="14" valign="top" onselectstart="return false">';
		wLoadin_tmp += '<span style="position:relative;top:' + ((this.height[this.CurrSelect]>20)?1:-3) + 'px;"><input id="button_' + this.name[this.CurrSelect] + '" oncontextmenu="return false" type="button" style="cursor:default;color:' + this.textcolor[this.CurrSelect] + ';border:0px;background-color:transparent;height:' + (this.height[this.CurrSelect]-4) + 'px;font-family:Webdings;font-size:12px" value="6" onfocus="blur()"></span></td>';
		wLoadin_tmp += '</tr>';
		wLoadin_tmp += '</table>';
		this.incode[this.CurrSelect] = wLoadin_tmp;
		this.outcode[this.CurrSelect] = this.rtLoad(2,this.name[this.CurrSelect],this.width[this.CurrSelect],this.height[this.CurrSelect],true,true,true,true,"center","top",this.outbgcolor[this.CurrSelect],this.bordercolor[this.CurrSelect],this.inbgcolor[this.CurrSelect],this.inobgcolor[this.CurrSelect],0,"$$$内容$$$","wxselect.setpos(" + this.CurrSelect + ")");
		
		var wOverflow, wWidth, wHeight;
		if(this.itemlist[this.CurrSelect].length>this.showitem[this.CurrSelect])
		{
			wOverflow	=	"auto";		//滚动条状态
			wWidth		=	this.width[this.CurrSelect] - 18;
			wHeight		=	this.showitem[this.CurrSelect] * 18;
		}
		else
		{
			wOverflow	=	"hidden";	//滚动条状态
			wWidth		=	this.width[this.CurrSelect] - 2;
			wHeight		=	this.itemlist[this.CurrSelect].length * 18;
			this.showitem[this.CurrSelect] = this.itemlist[this.CurrSelect].length;
		}
		wHeight = ((this.itemlist[this.CurrSelect].length==1||wOverflow=='hidden')?wHeight-2:wHeight);
		wLoadin_tmp = '<style>\nbody         { overflow-x:hidden; overflow-y:scroll;cursor: default;SCROLLBAR-HIGHLIGHT-COLOR: buttonface; SCROLLBAR-SHADOW-COLOR: buttonface; SCROLLBAR-3DLIGHT-COLOR: buttonhighlight; SCROLLBAR-TRACK-COLOR: #eeeeee; SCROLLBAR-DARKSHADOW-COLOR: buttonshadow }\n</style>';
		wLoadin_tmp	+= ((this.OverMode==1)?'<style>\nA.menu_' + this.name[this.CurrSelect] + ' {	}\nA:hover.menu_' + this.name[this.CurrSelect] + ' {	background-color:'+ this.obgcolor[this.CurrSelect] +'	}\n</style>':'');
		wLoadin_tmp += '<div id="layer_' + this.name[this.CurrSelect] + '" onselectstart="return false" oncontextmenu="return false"';
		wLoadin_tmp += ' style="position:absolute;left:' + (this.width[this.CurrSelect]) + ';filter:alpha(opacity=' + this.alpha[this.CurrSelect] + ');width:宽度px;text-align:center;display:none;">';
		wLoadin_tmp += '<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="宽度"><tr><td width="宽度" height="2"><table border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse;border-left:1px solid ' + this.bordercolor[this.CurrSelect] + ';border-bottom:0px solid ' + this.bordercolor[this.CurrSelect] + ';border-right:1px solid ' + this.bordercolor[this.CurrSelect] + ';" width="宽度"><tr><td width="宽度" height="2"></td></tr><tr><td width="宽度" height="2"' + ((this.bgcolor[this.CurrSelect]=='')?'':' bgcolor="' + this.bgcolor[this.CurrSelect] + '"') +'>';
		wLoadin_tmp += '<div id="data_' + this.name[this.CurrSelect] + '" style="overflow-y:滚动状态;border:0px;height:高度px;width:宽度px;" onscroll="//if(this.scrollTop%18!=0){this.scrollTop=((this.scrollTop-this.scrollTop%18)/1+1)*18;}">';
		wLoadin_tmp += '<table border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse;" width="宽度">';
		wLoadin_tmp =  wLoadin_tmp.replace(/滚动状态/g,wOverflow);
		wLoadin_tmp =  wLoadin_tmp.replace(/宽度/g,wWidth);
		wLoadin_tmp =  wLoadin_tmp.replace(/高度/g,wHeight);
		for(getOutLine_para_i=0;getOutLine_para_i<this.itemlist[this.CurrSelect].length;getOutLine_para_i++)
		{
			wLoadin_tmp += '<tr><td height="' + (this.itemlist[this.CurrSelect].length==1||(wOverflow=='hidden'&&getOutLine_para_i==this.itemlist[this.CurrSelect].length-1)?16:18) + '" onmouseup="select_' + this.name[this.CurrSelect] + '.value=this.item;' + this.name[this.CurrSelect] + '.value=this.value;wxselect.setselect(' + this.CurrSelect + ',\'defaultitem\',' + getOutLine_para_i + ');if(this.value.length>0)window.open(this.value,\'\',\'\');" item="' + this.itemlist[this.CurrSelect][getOutLine_para_i] + '" value="' + this.valuelist[this.CurrSelect][getOutLine_para_i] + '">'
			wLoadin_tmp += ((this.OverMode==1)?'<a href="arguments:' + this.itemlist[this.CurrSelect][getOutLine_para_i] + '" onmouseover="window.status=\'\';" onclick="return false;" style="cursor:default" class="menu_' + this.name[this.CurrSelect] + '">':'');
			wLoadin_tmp += '<table border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse;" width="100%" height="100%"><tr>';
			wLoadin_tmp += '<td width="100%" height="100%"';
			if(getOutLine_para_i==this.itemlist[this.CurrSelect].length-1)
				wLoadin_tmp += ((this.OverMode==1)?'':' id="' + this.name[this.CurrSelect] + '_itembg" onmouseover="for(i=0;i<' + this.name[this.CurrSelect] + '_itembg.length;i++)' + this.name[this.CurrSelect] + '_itembg[i].style.background=\'' + this.obgcolor[this.CurrSelect] + '\'" onmouseout="for(i=0;i<' + this.name[this.CurrSelect] + '_itembg.length;i++)' + this.name[this.CurrSelect] + '_itembg[i].style.background=\'' + this.bgcolor[this.CurrSelect] + '\'"');
			else
				wLoadin_tmp += ((this.OverMode==1)?'':' onmouseover="this.style.background=\'' + this.obgcolor[this.CurrSelect] + '\'" onmouseout="this.style.background=\'' + this.bgcolor[this.CurrSelect] + '\'"');
			wLoadin_tmp += ' style="padding-left:4px;font-family:Tahoma;font-size:11px;cursor:default;color:' + this.textcolor[this.CurrSelect] + ';word-break:break-all;">';
			wLoadin_tmp += this.itemlist[this.CurrSelect][getOutLine_para_i] + '</td>';
			wLoadin_tmp += '</tr></table>';
			wLoadin_tmp += ((this.OverMode==1)?'</a>':'');
			wLoadin_tmp += '</td></tr>';
		}
		wLoadin_tmp += '</table>';
		wLoadin_tmp += '</div>';
		wLoadin_tmp += '</td></tr></table>';
		wLoadin_tmp += '<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="' + this.width[this.CurrSelect] + '">';
		for(getOutLine_para_i=0;getOutLine_para_i<2;getOutLine_para_i++)
		{
			wLoadin_tmp += '<tr>';
			for(getOutLine_para_j=0;getOutLine_para_j<5;getOutLine_para_j++)
			{
				wLoadin_tmp += '<td width="' + ((getOutLine_para_j==2)?this.width[this.CurrSelect]-4:1) + '" height="1"';
				if(getOutLine_para_i==0&&getOutLine_para_j==2)
					wLoadin_tmp += ((this.bgcolor[this.CurrSelect]!='')?' bgcolor="' + this.bgcolor[this.CurrSelect] + '"':'') + ' id="' + this.name[this.CurrSelect] + '_itembg"></td>';
				else
					wLoadin_tmp += (((getOutLine_para_i==0&&getOutLine_para_j%2==1)||(getOutLine_para_i==1&&getOutLine_para_j==2))?' bgcolor="' + this.bordercolor[this.CurrSelect] + '"':'') + '></td>';
			}
			wLoadin_tmp += '</tr>';
		}
		wLoadin_tmp += '</table>';
		wLoadin_tmp += '</td></tr></table></div>';
		this.itemcode[this.CurrSelect] = wLoadin_tmp;
		this.htmlcode[this.CurrSelect] = this.outcode[this.CurrSelect].replace("$$$内容$$$",this.incode[this.CurrSelect]) + this.itemcode[this.CurrSelect];
		return(this.htmlcode[this.CurrSelect]);
	}
	else
		return('<font style="font-size:11px;font-family:Tahoma;color:#FF3300">Error! the data don\'t initialized!</font>');
}
select.prototype.getselect	= function()
{
	for(getselect_para_i=0;getselect_para_i<this.name.length;getselect_para_i++)
	{
		if(getselect_para_i==(arguments[0]))
		{
			if(!arguments[1]) return(this.name[getselect_para_i]);
			break;
		}
		else if(this.name[getselect_para_i]==arguments[0])
		{
			if(!arguments[1]) return(getselect_para_i+1);
			break;
		}
	}
	if(arguments[1] && arguments[1]>0)
	{
		switch(arguments[1])
		{
			case 1:return(this.width[getselect_para_i]);
			case 2:return(this.height[getselect_para_i]);
			case 3:return(this.showitem[getselect_para_i]);
			case 4:return(this.outbgcolor[getselect_para_i]);
			case 5:return(this.bordercolor[getselect_para_i]);
			case 6:return(this.bgcolor[getselect_para_i]);
			case 7:return(this.textcolor[getselect_para_i]);
			case 8:return(this.inbgcolor[getselect_para_i]);
			case 9:return(this.linecolor[getselect_para_i]);
			case 10:
				var getselect_para_k = 0;
				for(getselect_para_j=0;getselect_para_j<this.name.length;getselect_para_j++)
				{
					if(this.showinit[getselect_para_j]) getselect_para_k++;
				}
				return(getselect_para_k);
				break;
		}
	}
}
select.prototype.show	= function()
{
	this.CurrSelect	= ((IsNumeric(arguments[0]))?(Math.abs(arguments[0])):(this.name.length-1));
	var show_para_tmp;
	if(this.showinit[this.CurrSelect])
	{
		show_para_tmp = this.getOutLine([this.CurrSelect]);
		if(this.getselect(this.CurrSelect,10)>1)
			Wselect_main_layer[this.CurrSelect-1].innerHTML=show_para_tmp;
		else
			Wselect_main_layer.innerHTML=show_para_tmp;
		this.setpos(this.CurrSelect);
	}
	else if(arguments[0]&&arguments[1])
	{
		this.showinit[this.CurrSelect] = true;
		return('<div id="Wxselect_main_layer">' + this.getOutLine([this.CurrSelect]) + '</div>');
	}
	else
	{
		this.showinit[this.CurrSelect] = true;
		document.write('<div id="Wxselect_main_layer">' + this.getOutLine([this.CurrSelect]) + '</div>');
		this.setpos();
	}
}
select.prototype.setpos	= function()
{
	for(setpos_para_i=1;setpos_para_i<this.name.length;setpos_para_i++)		//在所有下拉菜单的集合中
	{
		if(this.showinit[setpos_para_i])	//如果当前状态是可显示
		{
			if(setpos_para_i==arguments[0])
			{
				setpos_tmp =  "document.all.layer_"+this.getselect(setpos_para_i)+".style.zIndex=6000;"
				if(eval("document.all.layer_"+this.getselect(setpos_para_i)+".style.display")=="none")
				{
					setpos_tmp +=  "document.all.layer_"+this.getselect(setpos_para_i)+".style.display='';"
				}
				else
				{
					setpos_tmp +=  "document.all.layer_"+this.getselect(setpos_para_i)+".style.display='none';"
				}
			}
			else
			{
				setpos_tmp =  "document.all.layer_"+this.getselect(setpos_para_i)+".style.zIndex=" + (5999-setpos_para_i) + ";"
				setpos_tmp +=  "document.all.layer_"+this.getselect(setpos_para_i)+".style.display='none';"
			}
			setpos_tmp += "document.all.layer_"+this.getselect(setpos_para_i)+".style.left="+(this.getposition(eval("position_"+this.getselect(setpos_para_i)),1))+";";
			setpos_tmp += "document.all.layer_"+this.getselect(setpos_para_i)+".style.top="+(this.getposition(eval("position_"+this.getselect(setpos_para_i)))/1+this.height[setpos_para_i]-2)+";";
			//alert(setpos_tmp);
			eval(setpos_tmp);
		}
	}
}
select.prototype.getposition	= function()
{
	if(arguments[0])
	{
		var getposition_para_t=arguments[0].offsetTop;
		var getposition_para_l=arguments[0].offsetLeft;
		while(arguments[0]=arguments[0].offsetParent){	getposition_para_t+=arguments[0].offsetTop;	getposition_para_l+=arguments[0].offsetLeft;	}
		return ((arguments[1])?getposition_para_l:getposition_para_t);
	}
	else
		return(0);
}
select.prototype.wsact	= function()
{
	wsact_para_i=event.srcElement.id.indexOf("position_");
	wsact_para_j=event.srcElement.id.indexOf("select_");
	wsact_para_k=event.srcElement.id.indexOf("change_");
	wsact_para_l=event.srcElement.id.indexOf("button_");
	wsact_para_m=event.srcElement.id.indexOf("layer_");
	wsact_para_n=event.srcElement.id.indexOf("_bg");
	if(wsact_para_i<0 && wsact_para_j<0 && wsact_para_k<0 && wsact_para_l<0 && wsact_para_m<0 && wsact_para_n<0)
	{
		this.setpos();
	}
}
function IsNumeric()
{
	return((Math.abs(arguments[0])==0)?true:((Math.abs(arguments[0])/Math.abs(arguments[0])!=1)?false:true));
}
function document.onclick()
{
	wxselect.wsact();
}
function document.oncontextmenu()
{
	wxselect.wsact();
}
function window.onresize()
{
	wxselect.setpos();
}
window.onerror = new Function("return false;");
var wxselect = new select();









var ua		= navigator.userAgent.toLowerCase();
var vie		= ua.match(/msie/)||0;
var vie6	= ua.match(/msie 6/)||0;
var vie5	= ua.match(/msie 5/)||0;
var vie50	= ua.match(/msie 5\.0/)||0;

function wxline()
{
	//高/宽度 横竖 主色颜色 开始 间隔1 间隔2
	var wxLine_para_tmp;
	var i, j, wxLineCount, wxLineColor1, wxLineColor2, wxLineStart;
	wxLineWH = ((arguments[0])?arguments[0]:0);
	wxLineMode = ((arguments[1])?arguments[1]:0);
	wxLineColor = ((arguments[2])?arguments[2]:"#000000");
	wxLineStart	= ((arguments[3])?arguments[3]:0);
	wxLineSpace1 = ((arguments[4])?arguments[4]:1);
	wxLineSpace2 = ((arguments[5])?arguments[5]:1);

	if(wxLineWH==0)
		return("");
	else
	{
		wxLineSpace = wxLineSpace1/1 + wxLineSpace2;
		wxLineWH = wxLineWH - wxLineWH % wxLineSpace;
		wxLine_para_tmp = '<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"';
		wxLine_para_tmp += ((wxLineMode==0)?' width="' + wxLineWH + '" height="1"':' width="1" height="' + wxLineWH + '"') + '>';
		wxLine_para_tmp += ((wxLineMode==0)?'<tr>':'');
		for(i=0;i<(wxLineWH/wxLineSpace);i++)
		{
			for(j=0;j<2;j++)
			{
				wxLine_para_tmp += ((wxLineMode==0)?'':'<tr>');
				wxLine_para_tmp += '<td' + ((j==wxLineStart)?' bgcolor="' + wxLineColor + '"':'');
				wxLine_para_tmp += ((wxLineMode==0)?' width="' + ((j==0)?wxLineSpace1:wxLineSpace2) + '" height="1"':' width="1" height="' + ((j==0)?wxLineSpace1:wxLineSpace2) + '"');
				wxLine_para_tmp +=  '></td>';
				wxLine_para_tmp += ((wxLineMode==0)?'':'</tr>');
			}
		}
		wxLine_para_tmp += ((wxLineMode==0)?'</tr>':'');
		wxLine_para_tmp += '</table>';
		/*w = window.open("","_webxf_error_win","width=390,height=190");
		var d = w.document;
		d.open();
		d.write(wxLine_para_tmp);
		d.close();
		w.focus();*/
		return wxLine_para_tmp;
	}
}