function checkdataID()
{
	var selID = document.formVenderCPU.ProductID;
	if (selID.length > 0)
	{
		var str = "";
		for(var i=0; i<selID.length; i++)
		{
			if (i>0) str+= ",";
			str += selID[i].value;
		}
		location.href=location.pathname + "?ProductID=" + str;
	}
	else
		return false;
}


function checkdataType()
{
	var fm = document.formProductType;
	var bool_chedked = false;
	if (fm.CPUType[0].selected == false) bool_chedked = true;
	if (fm.ChipsetType[0].selected == false) bool_chedked = true;
	var LinkValue = "?CPUType=" + fm.CPUType.value + "&ChipsetType=" + fm.ChipsetType.value;
	var Ary_RadioName = new Array(2);
	Ary_RadioName[0] = "VGAOnBoard";
	Ary_RadioName[1] = "RAIDOnBoard";
	var intCount = Ary_RadioName.length;
	for (var i=0; i<intCount; i++)
	{
		var fm2 = eval("fm." + Ary_RadioName[i]);
		for(var j=0; j<fm2.length; j++)
		{
			if (fm2[j].checked)
			{
				LinkValue += "&" + Ary_RadioName[i] + "=" + fm2[j].value;
				bool_chedked = true;
			}
		}
	}
	if (bool_chedked)
		location.href=location.pathname + LinkValue;
	else
		alert("Error");
}


function insProductNameValue(strName, strValue)
{
	var sel2 = document.formVenderCPU.form_ProductID;
	var num2 = sel2.length;
	var option = new Option(strName, strValue);
	sel2.options[num2] = option;
	SelectWidth();
}


function delall(){
	var sedcount = document.formVenderCPU.form_ProductID.length;
	for (var i=0; i<sedcount; i++){
		document.formVenderCPU.form_ProductID.options[0] = null;
	}
	SelectWidth();
}


function Add_ProductID()
{
	var conformable = false;
	var sel1 = document.formVenderCPU.form_ProductID;
	var sel2 = document.formVenderCPU.ProductID;
	if (sel2.length < 6)
	{
		if (sel1.selectedIndex > -1)
		{
			var num = sel1.selectedIndex;
			var sedcount = sel2.length;
			var option = new Option(sel1.options[num].text, sel1.options[num].value);
			for (i=0; i<sel2.length; i++){
				if (sel1.options[num].text == sel2.options[i].text){
					conformable = true;
					break;
				}
			}
			if (conformable == false){
				var num2 = sel2.length;
				var chked = true;
				if(chked == true) sel2.options[num2] = option;
			}
		}
	}
	else
		alert(str_txt_ComparisonSheet_AlertError_Motherboard);
	SelectWidth();
}


function Del_ProductID()
{
	var sel = document.formVenderCPU.ProductID;
	var item = sel.options.length;
	if (sel.selectedIndex > -1)
	{
		var num = sel.selectedIndex;
		sel.options[num] = null;
		SelectWidth();
	}
}


function SelectWidth()
{
	ary_sel = new Array("form_ProductID", "ProductID");
	var j, bln_width;
	var sel = "";
	for(var i=0; i<ary_sel.length; i++)
	{
		bln_width = false;
		sel = eval("document.formVenderCPU." + ary_sel[i]);
		for(j=0; j<sel.length; j++)
		{
			if (sel[j].text.length>25)
			{
				bln_width = true;
				break;
			}
		}
		if (bln_width == false)
			sel.style.width = "170px";
		else
			sel.style.width = "200px";
	}
}
//SelectWidth();