function Select_PartNo_Action(theForm,Att)
{
	var Select_Word;
	var actionurl="";
	if(Att=="1")
	{
		Select_Word=new Select_Word_CN();
		actionurl="/CN";
	}else{
		Select_Word=new Select_Word_EN();
		actionurl="/EN";
	}
	if(!Select_Check_PartNo(theForm,Select_Word))return false;
	actionurl+="/Stock/"+getBuy_TypeFile(Default_Get_Buy_Type())+"?PartNo="+Get_PartNo(theForm);
	top.location.href=actionurl;
	return false;
}

function Select_PartNo_Mfg_Action(theForm,Att)
{
	var Select_Word;
	var actionurl="";
	if(Att=="1")
	{
		Select_Word=new Select_Word_CN();
		actionurl="/CN";
	}else{
		Select_Word=new Select_Word_EN();
		actionurl="/EN";
	}
	if(!Select_Check_PartNo(theForm,Select_Word))return false;	
	actionurl+="/Stock/"+getBuy_TypeFile(Default_Get_Buy_Type())+"?PartNo="+Get_PartNo(theForm);
	if(Get_Mfg(theForm)!="")
	{
		actionurl+="&Mfg="+Get_Mfg(theForm)
	}
	top.location.href=actionurl;
	return false;
}

function Select_Check_PartNo(theForm,Select_Word)
{
	if(Get_PartNo(theForm)=="")
	{
		alert(Select_Word.FILL_PARTNO);
		theForm.PartNo.focus();
		return false;
	}
	if(Get_PartNo(theForm).length<4)
	{
		alert(Select_Word.FILL_4_CHARS);
		theForm.PartNo.focus();
		return false;
	}
	return true;
}

function Get_PartNo(theForm)
{
	return theForm.PartNo.value.trim();
}


function Get_Mfg(theForm)
{
	return theForm.Mfg.value.trim();
}

function getBuy_TypeValue(theForm)
{
	var Buy_TypeValue=SelectedItemValue(theForm.name,"Buy_Type");	
	return Buy_TypeValue;
}
function getBuy_TypeFile(Buy_TypeValue)
{	
	var FileName="";
	switch(Buy_TypeValue)
	{
		case "1":
			FileName="Search_HotOffer.htm";
			break;
		case "2":
			FileName="Search_Stock.htm";
			break;
		case "4":
			FileName="Search_ElseOffer.htm";
			break;			
		case "7":
			FileName="Search_Stock_All.htm";
			break;
		case "8":
			FileName="Search_Demand.htm";
			break;
		case "16":
			FileName="Search_EMDemand.htm";
			break;
		case "24":
			FileName="Search_DemandAll.htm";
			break;
	}
	return FileName;
}
