/* Tests to figure out the browser */
var ie4=document.all
var ns6=document.getElementById&&!document.all
var isDisabled=1;
var borev="";

function buildPartNum() {
	   
//   document.write("<b>PartNumber</b>: "+getPartNumber()+"<br><b>PartSpecials</b>: "+getSpecials()+"<br><b>PartAccessories</b>: "+getAccessories());

// If the Part Number has an 'X' in it, only allow RFQ.
// Example: H6B-N2.5C-11.00X1.38V1S11
 
  var partNumber = getPartNumberForEmail();
  var pos = partNumber.search("X");
    
//  alert("partNumber = " + partNumber);
//  alert("Pos = " + pos);
  
  if(pos == 15)
  {
    alert("ERROR:\n\nCAD files not available for parts with user defined special ports.\nPlease submit a RFQ to ensure specification is valid and to obtain a CAD file.");
  }
  else
    VirtualCAD(getPartNumber(), getSpecials(), getAccessories());
}


function setParameters(data){
		eval("if("+data+")s_result = s_result+\"|"+data+"=\"+"+data+"");
}

function setParametersForEmail(data){
		eval("if("+data+")s_result = s_result+\"%0A            "+data+"=\"+"+data+"");
}



function setFirstVariable() {
  	document.part_graphic.src = 'newimages/blank.gif';
}

function getPartNumber()
{
 	 return "$VCI_PartNumber=" + document.partbuilderform.partno.value; 
}

function getPartNumberForEmail()
{
 	 return document.partbuilderform.partno.value; 
}


function getSpecials()
{
	s_result="";

$VCI_Specify_Piston_Seals=escape(document.partbuilderform.fieldnos3.value);
$VCI_Specify_Port=escape(document.partbuilderform.fieldnos4.value);
$VCI_Specify_Rod_Seals=escape(document.partbuilderform.fieldnos5.value);
$VCI_Specify_Rod_Thread=escape(document.partbuilderform.partno14.value);
VCI_Specify_Rod_Th_A=document.partbuilderform.fieldnos6.value;
VCI_Head_Cushion=document.partbuilderform.partno5.value;
VCI_Cap_Cushion=document.partbuilderform.partno6.value;
VCI_XI=document.partbuilderform.fieldnos7.value;
VCI_XI=VCI_XI.replace("\"", "");

VCI_Stop_tube=document.partbuilderform.fieldnos10.value;
VCI_Stop_tube=VCI_Stop_tube.replace("\"", "");

VCI_Specify_Rod_Th_A=VCI_Specify_Rod_Th_A.replace("\"", "");

VCI_ERE=document.partbuilderform.fieldnos8.value;
VCI_ERE_D=document.partbuilderform.fieldnos9.value;
VCI_ERE=VCI_ERE.replace("\"", "");
VCI_ERE_D=VCI_ERE_D.replace("\"", "");


if(listA[19]==1){VCI_EXT_K_PLT=1;} else {VCI_EXT_K_PLT=0;}

rslt="";

for(i=0;i<=listA.length;i++){
	if(i>10 && i!=16 && i!=18 && i!=22){
		listBB=listB[i];
		if(i==15)listBB=listBB+" "+document.partbuilderform.fieldnos10.value;
		if(i==12 && am[8])listBB =document.partbuilderform.tmps8.value+" "+listBB;
		if(i==12 && !am[8])listBB=document.partbuilderform.tmps7.value+" "+listBB;
                                                                                  
		if(i==17 && am[10])listBB =listBB+" "+document.partbuilderform.tmps10.value;
		if(i==17 && !am[10])listBB=listBB+" "+document.partbuilderform.tmps9.value;
                                                                                  
		if(i==20 && am[12])listBB =listBB+" "+document.partbuilderform.tmps12.value;
		if(i==20 && !am[12])listBB=listBB+" "+document.partbuilderform.tmps11.value;
		
		if(i==21 && am[14])listBB=listBB+" ("+document.partbuilderform.tmps14.value+")";
		if(i==21 && !am[14])listBB=listBB+" ("+document.partbuilderform.tmps13.value+")";

		if(i==21 && document.partbuilderform.fieldnos12.value)listBB=document.partbuilderform.fieldnos12.value+" "+listBB;
		
		strng=""+listBB;
		strng2=strng.toUpperCase()
		
		if(listA[i])rslt=rslt+escape(strng2)+"^";	
	}
}

		listBB=listB[18]
		if(document.partbuilderform.fieldnos8.value)
			listBB=listBB+" "+document.partbuilderform.fieldnos8.value;
			strng=""+listBB;
			strng2=strng.toUpperCase()

		if(listA[18])rslt=rslt+escape(strng2)+"^";	

		listBB=listB[22]
		if(document.partbuilderform.fieldnos9.value)
			listBB=listBB+" "+document.partbuilderform.fieldnos9.value;
			strng=""+listBB;
			strng2=strng.toUpperCase()
		if(listA[18] && document.partbuilderform.fieldnos9.value)rslt=rslt+escape(strng2)+"^";	

		listBB=listB[16];
		if(document.partbuilderform.fieldnos11.value)listBB=document.partbuilderform.fieldnos11.value+" "+listBB;
			strng=""+listBB;
			strng2=strng.toUpperCase()
		
		if(listA[16])rslt=rslt+escape(strng2)+"^";	



   if($VCI_Specify_Piston_Seals)s_result = s_result+"|$VCI_Specify_Piston_Seals="+$VCI_Specify_Piston_Seals;
   if($VCI_Specify_Port)s_result = s_result+"|$VCI_Specify_Port="+$VCI_Specify_Port;
   if($VCI_Specify_Rod_Seals)s_result = s_result+"|$VCI_Specify_Rod_Seals="+$VCI_Specify_Rod_Seals;
   if($VCI_Specify_Rod_Thread)s_result = s_result+"|$VCI_Specify_Rod_Thread="+$VCI_Specify_Rod_Thread;
   if(VCI_Specify_Rod_Th_A)s_result = s_result+"|VCI_Specify_Rod_Th_A="+VCI_Specify_Rod_Th_A;
   if(VCI_Head_Cushion)s_result = s_result+"|VCI_Head_Cushion="+VCI_Head_Cushion;
   if(VCI_Cap_Cushion)s_result = s_result+"|VCI_Cap_Cushion="+VCI_Cap_Cushion;
   if(VCI_XI)s_result = s_result+"|VCI_XI="+VCI_XI;
   if(VCI_Stop_tube)s_result = s_result+"|VCI_Stop_tube="+VCI_Stop_tube;   
   if(VCI_ERE)s_result = s_result+"|VCI_ERE="+VCI_ERE;
   if(VCI_ERE_D)s_result = s_result+"|VCI_ERE_D="+VCI_ERE_D;
   
   s_result = s_result+"|VCI_EXT_K_PLT="+VCI_EXT_K_PLT;
   s_result = s_result+"|$VCI_Specials_text="+rslt;
   if(s_result)s_result=s_result.substring(1,s_result.length);

  	return s_result;

}


















function getSpecialsForEmail()
{
	s_result="";




$VCI_Specify_Piston_Seals=document.partbuilderform.fieldnos3.value;
$VCI_Specify_Port=document.partbuilderform.fieldnos4.value;
$VCI_Specify_Rod_Seals=document.partbuilderform.fieldnos5.value;
$VCI_Specify_Rod_Thread=document.partbuilderform.partno14.value;
VCI_Specify_Rod_Th_A=document.partbuilderform.fieldnos6.value;
VCI_Head_Cushion=document.partbuilderform.partno5.value;
VCI_Cap_Cushion=document.partbuilderform.partno6.value;
VCI_XI=document.partbuilderform.fieldnos7.value;

VCI_XI=VCI_XI.replace("\"", "");
VCI_Specify_Rod_Th_A=VCI_Specify_Rod_Th_A.replace("\"", "");

VCI_ERE=document.partbuilderform.fieldnos8.value;
VCI_ERE_D=document.partbuilderform.fieldnos9.value;
VCI_ERE=VCI_ERE.replace("\"", "");
VCI_ERE_D=VCI_ERE_D.replace("\"", "");


if(listA[19]==1){VCI_EXT_K_PLT=1;} else {VCI_EXT_K_PLT=0;}


rslt="";

for(i=0;i<=listA.length;i++){
	if(i>10 && i!=16){
		listBB=listB[i];
		if(i==15)listBB=listBB+" "+document.partbuilderform.fieldnos10.value;
		if(i==18)listBB=listBB+" "+document.partbuilderform.fieldnos8.value;
		if(i==12 && am[8])listBB =document.partbuilderform.tmps8.value+" "+listBB;
		if(i==12 && !am[8])listBB=document.partbuilderform.tmps7.value+" "+listBB;
                                                                                  
		if(i==17 && am[10])listBB =listBB+" "+document.partbuilderform.tmps10.value;
		if(i==17 && !am[10])listBB=listBB+" "+document.partbuilderform.tmps9.value;
                                                                                  
		if(i==20 && am[12])listBB =listBB+" "+document.partbuilderform.tmps12.value;
		if(i==20 && !am[12])listBB=listBB+" "+document.partbuilderform.tmps11.value;
		
		if(i==21 && am[14])listBB=listBB+" ("+document.partbuilderform.tmps14.value+")";
		if(i==21 && !am[14])listBB=listBB+" ("+document.partbuilderform.tmps13.value+")";

		if(i==21 && document.partbuilderform.fieldnos12.value)listBB=document.partbuilderform.fieldnos12.value+" "+listBB;
		
		if(listA[i])rslt=rslt+listBB+"%0A            ";	
	}
}

		listBB=listB[16];
		if(document.partbuilderform.fieldnos11.value)listBB=document.partbuilderform.fieldnos11.value+" "+listBB;
		
		if(listA[16])rslt=rslt+escape(listBB)+"%0A            ";	
		
		s_result=rslt;
		


   if($VCI_Specify_Piston_Seals)s_result = s_result+"%0A            Piston Seals "+$VCI_Specify_Piston_Seals;
   if($VCI_Specify_Port)s_result = s_result+"%0A            Port "+$VCI_Specify_Port;
   if($VCI_Specify_Rod_Seals)s_result = s_result+"%0A            Rod Seals "+$VCI_Specify_Rod_Seals;
   if($VCI_Specify_Rod_Thread)s_result = s_result+"%0A            Rod Thread "+$VCI_Specify_Rod_Thread+" "+VCI_Specify_Rod_Th_A;
   if(VCI_Head_Cushion > 0)s_result = s_result+"%0A            Head Cushion Position "+VCI_Head_Cushion;
   if(VCI_Cap_Cushion > 0)s_result = s_result+"%0A            Cap Cushion Position "+VCI_Cap_Cushion;
   
 	return s_result;

}













function getAccessoriesForEmail()
{

	s_result="";
	
	$VCI_acc_ROD="";
	$VCI_acc_ROD_Pin="";
	$VCI_acc_ROD_Bracket="";
	
	$VCI_acc_ROD_D="";
	$VCI_acc_ROD_Pin_D="";
	$VCI_acc_ROD_Bracket_D="";
	
	$VCI_acc_mount_Pin="";
	$VCI_acc_mount_Bracket="";

	bp="";


   if(document.partbuilderform.partno3.value=="D"){

		if(listA2[20])$VCI_acc_ROD=listAFinal[20];
		if(listA2[21])$VCI_acc_ROD=listAFinal[21];
		if(listA2[22])$VCI_acc_ROD=listAFinal[22];
		if(listA2[23])$VCI_acc_ROD=listAFinal[23];		
		if(listA2[45])$VCI_acc_ROD=listAFinal[45];		

		if(listA2[24])$VCI_acc_ROD_Pin=listAFinal[24];
		if(listA2[26])$VCI_acc_ROD_Pin=listAFinal[26];
		if(listA2[28])$VCI_acc_ROD_Pin=listAFinal[28];
		if(listA2[31])$VCI_acc_ROD_Pin=listAFinal[31];		

		if(listA2[25])$VCI_acc_ROD_Bracket=listAFinal[25];
		if(listA2[27])$VCI_acc_ROD_Bracket=listAFinal[27];
		if(listA2[29])$VCI_acc_ROD_Bracket=listAFinal[29];
		if(listA2[30])$VCI_acc_ROD_Bracket=listAFinal[30];		


		if(listA2[32])$VCI_acc_ROD_D=listAFinal[32];
		if(listA2[33])$VCI_acc_ROD_D=listAFinal[33];
		if(listA2[34])$VCI_acc_ROD_D=listAFinal[34];
		if(listA2[35])$VCI_acc_ROD_D=listAFinal[35];		
		if(listA2[46])$VCI_acc_ROD_D=listAFinal[46];		

		if(listA2[36])$VCI_acc_ROD_Pin_D=listAFinal[36];
		if(listA2[38])$VCI_acc_ROD_Pin_D=listAFinal[38];
		if(listA2[40])$VCI_acc_ROD_Pin_D=listAFinal[40];
		if(listA2[43])$VCI_acc_ROD_Pin_D=listAFinal[43];		

		if(listA2[37])$VCI_acc_ROD_Bracket_D=listAFinal[37];
		if(listA2[39])$VCI_acc_ROD_Bracket_D=listAFinal[39];
		if(listA2[41])$VCI_acc_ROD_Bracket_D=listAFinal[41];
		if(listA2[42])$VCI_acc_ROD_Bracket_D=listAFinal[42];		


		bp=""+$VCI_acc_ROD_Bracket_D;
		bp=bp.substr(0,3);
		if(bp=="12-"){
			$tmp=$VCI_acc_ROD_Pin_D;
			$VCI_acc_ROD_Pin_D=$VCI_acc_ROD_Bracket_D;
			$VCI_acc_ROD_Bracket_D="";
			if($tmp)$VCI_acc_ROD_Bracket_D=$tmp;
		}

		bp=""+$VCI_acc_ROD_Bracket;
		bp=bp.substr(0,3);
		if(bp=="12-"){
			$tmp=$VCI_acc_ROD_Pin;
			$VCI_acc_ROD_Pin=$VCI_acc_ROD_Bracket;
			$VCI_acc_ROD_Bracket="";
			if($tmp)$VCI_acc_ROD_Bracket=$tmp;
		}



		
		if($VCI_acc_ROD)s_result=s_result+"%0A            Accessories, attached to the head rod end "+$VCI_acc_ROD
		if($VCI_acc_ROD_Pin)s_result=s_result+"%0A            Pin "+$VCI_acc_ROD_Pin
		if($VCI_acc_ROD_Bracket)s_result=s_result+"%0A            Bracket "+$VCI_acc_ROD_Bracket

		if($VCI_acc_ROD_D)s_result=s_result+"%0A            Accessories, attached to the cap rod end "+$VCI_acc_ROD_D
		if($VCI_acc_ROD_Pin_D)s_result=s_result+"%0A            Pin "+$VCI_acc_ROD_Pin_D
		if($VCI_acc_ROD_Bracket_D)s_result=s_result+"%0A            Bracket "+$VCI_acc_ROD_Bracket_D

	
	} else {

		if(listA2[1])$VCI_acc_ROD=listAFinal[1];
		if(listA2[4])$VCI_acc_ROD=listAFinal[4];
		if(listA2[8])$VCI_acc_ROD=listAFinal[8];
		if(listA2[9])$VCI_acc_ROD=listAFinal[9];		
		if(listA2[44])$VCI_acc_ROD=listAFinal[44];		

		if(listA2[5] )$VCI_acc_ROD_Pin=listAFinal[5];
		if(listA2[11])$VCI_acc_ROD_Pin=listAFinal[11];
		if(listA2[12])$VCI_acc_ROD_Pin=listAFinal[12];
		if(listA2[13])$VCI_acc_ROD_Pin=listAFinal[13];		

		if(listA2[3]) $VCI_acc_ROD_Bracket=listAFinal[3];
		if(listA2[6]) $VCI_acc_ROD_Bracket=listAFinal[6];
		if(listA2[7]) $VCI_acc_ROD_Bracket=listAFinal[7];
		if(listA2[10])$VCI_acc_ROD_Bracket=listAFinal[10];		



	 	   
		if(listA2[14])$VCI_acc_mount_Pin=listAFinal[14];
		if(listA2[17])$VCI_acc_mount_Pin=listAFinal[17];
		
		if(listA2[15])$VCI_acc_mount_Bracket=listAFinal[15];
		if(listA2[16])$VCI_acc_mount_Bracket=listAFinal[16];
		if(listA2[18])$VCI_acc_mount_Bracket=listAFinal[18];
		if(listA2[19])$VCI_acc_mount_Bracket=listAFinal[19];		


		bp=""+$VCI_acc_ROD_Bracket;
		bp=bp.substr(0,3);
		if(bp=="12-"){
			$tmp=$VCI_acc_ROD_Pin;
			$VCI_acc_ROD_Pin=$VCI_acc_ROD_Bracket;
			$VCI_acc_ROD_Bracket="";
			if($tmp)$VCI_acc_ROD_Bracket=$tmp;
		}

		bp=""+$VCI_acc_mount_Bracket;
		bp=bp.substr(0,3);
		if(bp=="12-"){
			$tmp=$VCI_acc_mount_Pin;
			$VCI_acc_mount_Pin=$VCI_acc_mount_Bracket;
			$VCI_acc_mount_Bracket="";
			if($tmp)$VCI_acc_ROD_Bracket=$tmp;
		}



		if($VCI_acc_ROD)s_result=s_result+"%0A            Accessories, attached to the rod end "+$VCI_acc_ROD
		if($VCI_acc_ROD_Pin)s_result=s_result+"%0A            Pin "+$VCI_acc_ROD_Pin
		if($VCI_acc_ROD_Bracket)s_result=s_result+"%0A            Bracket "+$VCI_acc_ROD_Bracket
   		

		if($VCI_acc_mount_Pin){
			s_result=s_result+"%0A            Accessories, attached to the mount "+$VCI_acc_mount_Pin+" "+$VCI_acc_mount_Bracket;
		} else {
			if($VCI_acc_mount_Bracket)s_result=s_result+"%0A            Accessories, attached to the mount "+$VCI_acc_mount_Bracket;
		}
	
	}

  return s_result;
}















function getAccessories()
{

	s_result="";
	
	$VCI_acc_ROD="";
	$VCI_acc_ROD_Pin="";
	$VCI_acc_ROD_Bracket="";
	
	$VCI_acc_ROD_D="";
	$VCI_acc_ROD_Pin_D="";
	$VCI_acc_ROD_Bracket_D="";
	
	$VCI_acc_mount_Pin="";
	$VCI_acc_mount_Bracket="";

	bp="";


   if(document.partbuilderform.partno3.value=="D"){

		if(listA2[20])$VCI_acc_ROD=listAFinal[20];
		if(listA2[21])$VCI_acc_ROD=listAFinal[21];
		if(listA2[22])$VCI_acc_ROD=listAFinal[22];
		if(listA2[23])$VCI_acc_ROD=listAFinal[23];		
		if(listA2[45])$VCI_acc_ROD=listAFinal[45];		

		if(listA2[24])$VCI_acc_ROD_Pin=listAFinal[24];
		if(listA2[26])$VCI_acc_ROD_Pin=listAFinal[26];
		if(listA2[28])$VCI_acc_ROD_Pin=listAFinal[28];
		if(listA2[31])$VCI_acc_ROD_Pin=listAFinal[31];		

		if(listA2[25])$VCI_acc_ROD_Bracket=listAFinal[25];
		if(listA2[27])$VCI_acc_ROD_Bracket=listAFinal[27];
		if(listA2[29])$VCI_acc_ROD_Bracket=listAFinal[29];
		if(listA2[30])$VCI_acc_ROD_Bracket=listAFinal[30];		


		if(listA2[32])$VCI_acc_ROD_D=listAFinal[32];
		if(listA2[33])$VCI_acc_ROD_D=listAFinal[33];
		if(listA2[34])$VCI_acc_ROD_D=listAFinal[34];
		if(listA2[35])$VCI_acc_ROD_D=listAFinal[35];		
		if(listA2[46])$VCI_acc_ROD_D=listAFinal[46];		

		if(listA2[36])$VCI_acc_ROD_Pin_D=listAFinal[36];
		if(listA2[38])$VCI_acc_ROD_Pin_D=listAFinal[38];
		if(listA2[40])$VCI_acc_ROD_Pin_D=listAFinal[40];
		if(listA2[43])$VCI_acc_ROD_Pin_D=listAFinal[43];		

		if(listA2[37])$VCI_acc_ROD_Bracket_D=listAFinal[37];
		if(listA2[39])$VCI_acc_ROD_Bracket_D=listAFinal[39];
		if(listA2[41])$VCI_acc_ROD_Bracket_D=listAFinal[41];
		if(listA2[42])$VCI_acc_ROD_Bracket_D=listAFinal[42];		

		bp=""+$VCI_acc_ROD_Bracket_D;
		bp=bp.substr(0,3);
		if(bp=="12-"){
			$tmp=$VCI_acc_ROD_Pin_D;
			$VCI_acc_ROD_Pin_D=$VCI_acc_ROD_Bracket_D;
			$VCI_acc_ROD_Bracket_D="";
			if($tmp)$VCI_acc_ROD_Bracket_D=$tmp;
		}

		bp=""+$VCI_acc_ROD_Bracket;
		bp=bp.substr(0,3);
		if(bp=="12-"){
			$tmp=$VCI_acc_ROD_Pin;
			$VCI_acc_ROD_Pin=$VCI_acc_ROD_Bracket;
			$VCI_acc_ROD_Bracket="";
			if($tmp)$VCI_acc_ROD_Bracket=$tmp;
		}



   		setParameters("$VCI_acc_ROD");
		setParameters("$VCI_acc_ROD_Pin");
		setParameters("$VCI_acc_ROD_Bracket");

	 	setParameters("$VCI_acc_ROD_D");        
 		setParameters("$VCI_acc_ROD_Pin_D");
 		setParameters("$VCI_acc_ROD_Bracket_D");
		


	
	} else {

		if(listA2[1])$VCI_acc_ROD=listAFinal[1];
		if(listA2[4])$VCI_acc_ROD=listAFinal[4];
		if(listA2[8])$VCI_acc_ROD=listAFinal[8];
		if(listA2[9])$VCI_acc_ROD=listAFinal[9];		
		if(listA2[44])$VCI_acc_ROD=listAFinal[44];		

		if(listA2[5] )$VCI_acc_ROD_Pin=listAFinal[5];
		if(listA2[11])$VCI_acc_ROD_Pin=listAFinal[11];
		if(listA2[12])$VCI_acc_ROD_Pin=listAFinal[12];
		if(listA2[13])$VCI_acc_ROD_Pin=listAFinal[13];		

		if(listA2[3]) $VCI_acc_ROD_Bracket=listAFinal[3];
		if(listA2[6]) $VCI_acc_ROD_Bracket=listAFinal[6];
		if(listA2[7]) $VCI_acc_ROD_Bracket=listAFinal[7];
		if(listA2[10])$VCI_acc_ROD_Bracket=listAFinal[10];		



	 	   
		if(listA2[14])$VCI_acc_mount_Pin=listAFinal[14];
		if(listA2[17])$VCI_acc_mount_Pin=listAFinal[17];
		
		if(listA2[15])$VCI_acc_mount_Bracket=listAFinal[15];
		if(listA2[16])$VCI_acc_mount_Bracket=listAFinal[16];
		if(listA2[18])$VCI_acc_mount_Bracket=listAFinal[18];
		if(listA2[19])$VCI_acc_mount_Bracket=listAFinal[19];		

		bp=""+$VCI_acc_ROD_Bracket;
		bp=bp.substr(0,3);
		if(bp=="12-"){
			$tmp=$VCI_acc_ROD_Pin;
			$VCI_acc_ROD_Pin=$VCI_acc_ROD_Bracket;
			$VCI_acc_ROD_Bracket="";
			if($tmp)$VCI_acc_ROD_Bracket=$tmp;
		}

		bp=""+$VCI_acc_mount_Bracket;
		bp=bp.substr(0,3);
		if(bp=="12-"){
			$tmp=$VCI_acc_mount_Pin;
			$VCI_acc_mount_Pin=$VCI_acc_mount_Bracket;
			$VCI_acc_mount_Bracket="";
			if($tmp)$VCI_acc_ROD_Bracket=$tmp;
		}


   		setParameters("$VCI_acc_ROD");
		setParameters("$VCI_acc_ROD_Pin");
		setParameters("$VCI_acc_ROD_Bracket");
		
		setParameters("$VCI_acc_mount_Pin");
		setParameters("$VCI_acc_mount_Bracket");
   		
	
	}

   if(s_result)s_result=s_result.substring(1,s_result.length);		


  return s_result;
}

function createRFQ()
{
	
  var s_result="";
  
  
  var QTY=prompt("Please enter QTY", 1);  	
  var to_address       = "RFQ@YatesInd.com"; // For testing, change to contact@VirtualCAD.com
  var subject          = "RFQ: " + getPartNumberForEmail();
  var body_intro       = "Hello,%0A%0APlease provide a quote for the cylinder with quantity and delivery date as noted below.%0A%0A";
  var body_header      = "Quote Data:%0A-----------%0A%0A";
  var body_partnumber  = "Part Number%0A            " + getPartNumberForEmail();

VCI_XI=document.partbuilderform.fieldnos7.value;
VCI_XI=VCI_XI.replace("\"", "");
if(VCI_XI)body_partnumber = body_partnumber + "%0A            Trunnion 'T' Mount. XI = "+VCI_XI+"\"";
  
  body_partnumber = body_partnumber + "%0A%0A";

  var body_quantity    = "Quantity Required%0A            " + QTY			    + "%0A%0A";
  var body_delivery    = "Date Required%0A            " + "PLEASE SPECIFY" + "%0A%0A";
  var body_specials    = "Specials%0A            " + getSpecialsForEmail()    + "%0A%0A";
  var body_accessories = "Accessories%0A            " + getAccessoriesForEmail() + "%0A%0A";
  var body_bye         = "%0AThanks,%0A%0A%0A";
  
  var body_message = body_intro + body_header + body_partnumber + body_quantity + body_delivery + body_specials + body_accessories + body_bye;

  var mailto_link = 'mailto:'+to_address+'?subject='+subject+'&body='+body_message;
	
//	document.write(body_message);
  win = window.open(mailto_link,'emailWindow');
  win.close();
}




function preload(imgObj,imgSrc) {
	eval(imgObj+' = new Image()')
	eval(imgObj+'.src = "'+imgSrc+'"')
}

preload('j101','newimages/A.gif');
preload('j102','newimages/B.gif');
preload('j103','newimages/C.gif');
preload('j104','newimages/DC.gif');
preload('j105','newimages/DVgif');
preload('j106','newimages/E.gif');
preload('j107','newimages/F.gif');
preload('j108','newimages/G.gif');
preload('j109','newimages/H.gif');
preload('j110','newimages/J.gif');
preload('j111','newimages/K.gif');
preload('j112','newimages/L.gif');
preload('j113','newimages/M.gif');
preload('j114','newimages/N.gif');
preload('j115','newimages/P.gif');
preload('j116','newimages/Q.gif');
preload('j117','newimages/R.gif');
preload('j118','newimages/S.gif');
preload('j119','newimages/T.gif');
preload('j120','newimages/U.gif');
preload('j121','newimages/V.gif');
preload('j122','newimages/W.gif');
preload('j123','newimages/X.gif');
preload('j124','newimages/Y.gif');
preload('j125','newimages/Z.gif');
preload('rj125','newimages/C1.gif');
preload('gj125','newimages/R1.gif');
preload('bj125','newimages/F1.gif');
preload('bj1','newimages/length.gif');
preload('bj2','newimages/length-over.gif');
preload('bj1','newimages/quantity.gif');
preload('bj2','newimages/quantity-over.gif');

preload('j3','newimages/arrow.gif');
preload('j4','newimages/blank.gif');
preload('j5','newimages/bore.gif');
preload('j6','newimages/bore-over.gif');
preload('j7','newimages/cushions.gif');
preload('j8','newimages/cushions-over.gif');
preload('j9','newimages/cylinder.gif');
preload('j10','newimages/cylinder-over.gif');
preload('j11','newimages/loadingimages.gif');
preload('j59','newimages/rodd.gif');
preload('j60','newimages/rodend.gif');
preload('j61','newimages/rodend-over.gif');
preload('j62','newimages/rodd-over.gif');
preload('j63','newimages/stroke.gif');
preload('j64','newimages/strokeNote.gif');
preload('j642','newimages/strokeNote2.gif');
preload('j643','newimages/strokeNote3.gif');
preload('j65','newimages/stroke-over.gif');
preload('j66','newimages/typeA.gif');
preload('j67','newimages/typeB.gif');
preload('j68','newimages/typeC.gif');
preload('j69','newimages/typeD.gif');
preload('j70','newimages/typeF.gif');
preload('j71','newimages/typeP.gif');
preload('j72','newimages/bg1.gif');
preload('j73','newimages/top.gif');
preload('j74','newimages/bot.gif');
preload('j75','newimages/header.gif');
preload('j76','newimages/footer.gif');
preload('j77','newimages/bg2.gif');
preload('j78','newimages/bg3.gif');
preload('j79','newimages/fe1.gif');
preload('j80','newimages/fe2.gif');
preload('j81','newimages/fe3.gif');
preload('j82','newimages/ports.gif');
preload('j83','newimages/download.gif');
preload('j84','newimages/download-over.gif');
preload('j85','newimages/ports-over.gif');
preload('j87','newimages/bg4.gif');
preload('j88','newimages/bg.gif');
preload('j89','newimages/series1.gif');
preload('j90','newimages/series2.gif');
preload('j91','newimages/series3.gif');
preload('j92','newimages/dd.gif');
preload('j93','newimages/p1.gif');
preload('j94','newimages/p2.gif');
preload('j95','newimages/p3.gif');
preload('j96','newimages/p4.gif');
preload('j97','newimages/spec.gif');
preload('j98','newimages/spec-over.gif');

preload('j201','newimages/tp.gif');
preload('j202','newimages/tp-over.gif');
preload('j203','newimages/rtl.gif');
preload('j204','newimages/rtl-over.gif');

preload('j205','newimages/erel.gif');
preload('j206','newimages/erel-over.gif');
preload('j207','newimages/errel.gif');
preload('j208','newimages/errel-over.gif');

preload('j301','newimages/part1.jpg');
preload('j302','newimages/part2.jpg');
preload('j303','newimages/part3.jpg');
preload('j304','newimages/cad.gif');


preload('j401','newimages/0.gif');
preload('j402','newimages/1.gif');
preload('j403','newimages/a1.gif');
preload('j404','newimages/a2.gif');
preload('j405','newimages/a3.gif');
preload('j406','newimages/a4.gif');
preload('j407','newimages/a5.gif');
preload('j408','newimages/a6.gif');
preload('j409','newimages/a7.gif');
preload('j410','newimages/a8.gif');
preload('j411','newimages/a9.gif');
preload('j412','newimages/a10.gif');
preload('j413','newimages/a11.gif');
preload('j414','newimages/a12.gif');
preload('j415','newimages/a13.gif');
preload('j416','newimages/a14.gif');
preload('j417','newimages/a15.gif');
preload('j418','newimages/a16.gif');
preload('j419','newimages/a17.gif');
preload('j420','newimages/a18.gif');
preload('j421','newimages/a19.gif');
preload('j422','newimages/a20.gif');
preload('j422','newimages/a21.gif');

preload('j423','newimages/ia1.gif');
preload('j424','newimages/ia2.gif');
preload('j425','newimages/ia3.gif');
preload('j426','newimages/ia4.gif');
preload('j427','newimages/ia5.gif');
preload('j428','newimages/ia6.gif');
preload('j429','newimages/ia7.gif');
preload('j430','newimages/ia8.gif');
preload('j431','newimages/ia9.gif');
preload('j432','newimages/ia10.gif');
preload('j433','newimages/ia11.gif');
preload('j434','newimages/ia18.gif');
preload('j435','newimages/ia19.gif');

preload('j500','newimages/ia18_1.gif');
preload('j501','newimages/ia18_2.gif');
preload('j502','newimages/ia18_3.gif');
preload('j503','newimages/ia18_4.gif');
preload('j504','newimages/ia18_5.gif');
preload('j505','newimages/ia18_6.gif');
preload('j506','newimages/ia18_7.gif');
preload('j507','newimages/ia18_8.gif');
preload('j508','newimages/ia18_9.gif');



var prevStrokeValue="";
var prevStrokeValue2="";
var arr_ext=new Array();
var special_inc=0;


partNumber=1;

	function KeyPress(e)
	{
		var kk = navigator.appName == 'Netscape' ? e.which : e.keyCode;
		if (kk == 13)
		{
			return false;
		}
		return true;
	}




function clearAll(){
	partNumber=1;
	special_inc=0;
	hpos="";
	cpos="";
	interval="";
	specials="-";
	document.part_graphic.src = 'newimages/blank.gif';
	document.getElementById("partNum1").className="vis1";
	document.getElementById("partNum2").className="vis2";
	document.getElementById("partNum31").className="vis2";
	document.getElementById("partNum32").className="vis2";
	document.getElementById("rfq").className="vis2";
   	document.pic_part.src = 'newimages/part1.jpg';

		for(i=0;i<47;i++){
			listA2[i]=0;
			listA[i]=0;
			listAFinal[i]=0;
			am[i]=0;
			if(i!=1 && i!=46)eval("document.ib"+(i+1)+".src='newimages/0.gif'")
		}

		for(i=12;i<22;i++){
			eval("document.ia"+i+".src='newimages/0.gif'")
		}

    bclear(3);
    bclear(4);
    bclear(5);
    bclear(6);
    bclear(7);
	bclear(8);
    bclear(9);
    bclear(10);
    bclear(11);
    bclear(12);



	setupNextSelection(1);
}

	
function nextPart(){
		bs=document.partbuilderform.fieldno7.value;
	    if(bs.search("(STD)") != -1){
			bs=bs.substring(0,bs.length-6);
	    }
	    if(bs.search("(2:1)") != -1){
			bs=bs.substring(0,bs.length-6);
	    }

		bs=bs.substring(0,bs.length-1);		
		n=document.partbuilderform.partno1.value
		n1=document.partbuilderform.partno2.value

if(partNumber==3){
	buildPartNum();
} else {
    if(partNumber==1 && isDisabled) return false;
	if(partNumber==1 && !isDisabled){	
	
		var fld="";
		fld=document.partbuilderform.fieldno8.value+document.partbuilderform.fieldno10.value+document.partbuilderform.fieldno12.value;
		if(fld.search("pecify") != -1)
			alert("WARNING:\n\nPlease contact Yates to verify the special port \nparameters selected are feasible.");

		
		document.getElementById("da12").className="vis1";
		if(n!="H2" && n!="H4" && n!="H6")
			document.getElementById("da12").className="vis2";
		document.getElementById("da13").className="vis1";
		if(n!="A2" && n!="H2" && n!="A4" && n!="L4")
			document.getElementById("da13").className="vis2";
		
		document.getElementById("da14").className="vis1";
		if(n!="A4" && n!="L4")
			document.getElementById("da14").className="vis2";

		document.getElementById("da19").className="vis1";
		if((n1!="A" && n1!="B" && n1!="E" && n1!="-A" && n1!="-B" && n1!="-E") || n=="A2" || n=="H2")
			document.getElementById("da19").className="vis2";


		if((n=="A4" || n=="L4") && metrix[bs]>8.1){
			document.getElementById("da13").className="vis2";		
			document.getElementById("da14").className="vis2";
		}


		if(n=="A2" || n=="H2")
			document.getElementById("da20").className="vis2";
		else 
			document.getElementById("da20").className="vis1";
		
		
		document.getElementById("da16").className="vis2";
		document.getElementById("da21").className="vis2";

		document.getElementById("aas7").className="vis2";
		document.getElementById("aas8").className="vis2";
		document.getElementById("aas9").className="vis2";
		document.getElementById("aas10").className="vis2";
		document.getElementById("aas11").className="vis2";
		document.getElementById("aas12").className="vis2";
		document.getElementById("ext10").className="vis2";
		document.getElementById("ext11").className="vis2";
		document.getElementById("ext12").className="vis2";
		document.getElementById("aas13").className="vis2";
		document.getElementById("aas14").className="vis2";
			
			
		document.getElementById("partNum1").className="vis2";
		document.getElementById("partNum2").className="vis1";
	   	document.pic_part.src = 'newimages/part2.jpg';


		pn=document.partbuilderform.partno.value;		
		if(pn.substr(pn.length-3,1)=="S")special_inc=1;

		setAFinal();
	}
	
	if(partNumber==2){
		document.getElementById("partNum2").className="vis2";

		for(i=1;i<47;i++){
			if(i!=2)eval("document.getElementById(\"aa"+i+"\").className=\"vis2\"");
		}

		for(i=1;i<7;i++){
			eval("document.getElementById(\"aas"+i+"\").className=\"vis2\"");
			
		}

			document.getElementById("z1").className="vis2";
			document.getElementById("z2").className="vis2";
			document.getElementById("z3").className="vis2";
			document.getElementById("z4").className="vis2";
		
		if(document.partbuilderform.partno3.value=="D"){
			tpm=0;
			tp=document.partbuilderform.partno13.value;
			tp=tp.substr(0,1);


			if(tp==1 || tp==2 || tp==8){				
				checkA(20);
				checkA(21);
				checkA(32);
				checkA(33);
			}
			if(tp==3 || tp==4){
				checkA(22);
				checkA(34);
			}
			if(tp==9){
				checkA(23);
				checkA(35);
			}
			
				checkA(45);
				checkA(46);

			if(tpm==1){
				document.getElementById("z3").className="vis1";
				document.getElementById("z4").className="vis1";				
				document.getElementById("partNum32").className="vis1";
			}
			
		} else {						
			tpm=0;
			tpm1=0;
			tp=document.partbuilderform.partno13.value;
			tp=tp.substr(0,1);
			
					
			if(tp==1 || tp==2 || tp==8){
				checkA(1);
				checkA(4);
			}
			if(tp==3 || tp==4){
				checkA(9);
			}
			if(tp==9){
				checkA(8);
			}
				checkA(44);
						
			if(tpm==1)document.getElementById("z1").className="vis1";
			tpm1=tpm;
			tpm=0;

		

			s=document.partbuilderform.partno1.value;
			tp=document.partbuilderform.partno2.value;
			
			if(s=="H6"){
				if(tp=="V"){
					checkA(14);
					checkA(15);
				}
				if(tp=="C"){
					checkA(18);
					checkA(19);
				}
				if(tp=="Q"){
					checkA(16);
					checkA(17);
				}
			}

			if(s=="A4"){
				if(tp=="-V" || tp=="DV"){
					checkA(14);
					checkA(15);
				}
				if(tp=="-C"){
					checkA(18);
					checkA(19);
				}
				if(tp=="-Q"){
					checkA(16);
					checkA(17);
				}
				if(tp=="DC"){
					checkA(18);
				}
			}


			if(s=="A2"){
				if(tp=="DV"){
					checkA(14);
					checkA(15);
				}
				if(tp=="-C" || tp=="DC"){
					checkA(18);
					checkA(19);
				}
			}


			if(tpm==1)document.getElementById("z2").className="vis1";
			if(tpm+tpm1)document.getElementById("partNum31").className="vis1";			
		}
		
		
		document.getElementById("rfq").className="vis1";
	    document.download.src='newimages/cad.gif';
	   	document.pic_part.src = 'newimages/part3.jpg';

	}
	partNumber++;
	document.part_graphic.src = 'newimages/blank.gif';

}
}


function checkA(num){
	var chk=""+listAFinal[num];
	if(listAFinal[num] && chk.length>5){
		document.getElementById("aa"+num).className="vis1"; 
		tpm=1;
	}
}

	
function setAFinal(){
	
		s=document.partbuilderform.partno1.value;
		tp=document.partbuilderform.partno2.value;
	
	
		tp1=document.partbuilderform.partno13.value;
		tp2=document.partbuilderform.fieldno11.value;

		bs=document.partbuilderform.fieldno7.value;


	    if(bs.search("(STD)") != -1){
			bs=bs.substring(0,bs.length-6);
	    }
	    if(bs.search("(2:1)") != -1){
			bs=bs.substring(0,bs.length-6);
	    }

		bs=bs.substring(0,bs.length-1);
		tp1=tp1.substring(0,1);


	    if(tp2.search("(STD)") != -1){
			tp2=tp2.substring(0,tp2.length-6);
	    }
	    if(tp2.search("(2:1)") != -1){
			tp2=tp2.substring(0,tp2.length-6);
	    }

		tp2=tp2.substring(0,tp2.length-1);


		tp8=tp1-1;
		tp3=0;
		if(tp8==7)tp8=4;
		if(tp8>=0 && tp8<5){
			for(i=0;i<rodc.length;i++){
				if(rodc[i][tp8]==tp2){					
					if((s=="A2" || s=="H2") && i<=8)tp3=rodc[i][5];
					if((s!="A2" && s!="H2"))tp3=rodc[i][5];
				}
			}
		}
		
		listAFinal[44]=tp3;
		listAFinal[45]=tp3;
		listAFinal[46]=tp3;


		if(tp1==3)tp1=50;
		if(tp1==8)tp1=3;
		
		tp3=0;
		if(tp1>0 && tp1<4){
			for(i=0;i<fcb.length;i++){
				if(fcb[i][tp1-1]==tp2)tp3=fcb[i][3];
			}
		}
				
		listAFinal[1]=tp3;
		listAFinal[20]=tp3;
		listAFinal[32]=tp3;
		
		
		if(s=="H6"){
			if(tp=="Q"){
				if(fcc1[bs])listAFinal[17]=fcc1[bs];
			}
		}

		if(s=="A4"){
			if(tp=="-Q"){
				if(fcc2[bs])listAFinal[17]=fcc2[bs];
			}
		}


		tp3=0;
		if(tp1>0 && tp1<4){
			for(i=0;i<fcb.length;i++){
				if(fcb2[i][tp1-1]==tp2)tp3=fcb2[i][3];
			}
		}
		
		listAFinal[4]=tp3;
		listAFinal[21]=tp3;
		listAFinal[33]=tp3;

		if(tp1==4 || tp1==50){			
			if(fcd[tp2]){			
				listAFinal[9] =fcd[tp2];
				listAFinal[22]=fcd[tp2];
				listAFinal[34]=fcd[tp2];
			}
		}
		
		if(tp1==9){
			if(fcf[tp2]){
				listAFinal[8] =fcf[tp2][0];
				listAFinal[23]=fcf[tp2][0];
				listAFinal[35]=fcf[tp2][0];

			}
		}


		if(s=="H6"){
			if(tp=="V"){
				if(fce1[bs])listAFinal[14]=fce1[bs];
			}
		}

		if(s=="A4"){
			if(tp=="-V" || tp=="DV"){
				if(fce2[bs])listAFinal[14]=fce2[bs];
			}
		}

		if(s=="A2"){
			if(tp=="DV"){
				if(fce3[bs])listAFinal[14]=fce3[bs];
			}
		}



		if(listAFinal[4]){
			listAFinal[3] =fcg1[listAFinal[4]][0];
			listAFinal[13]=fcg1[listAFinal[4]][1];

			listAFinal[28]=fcg1[listAFinal[4]][0];
			listAFinal[29]=fcg1[listAFinal[4]][1];

			listAFinal[40]=fcg1[listAFinal[4]][0];
			listAFinal[41]=fcg1[listAFinal[4]][1];
		}

		if(listAFinal[1]){
			listAFinal[6] =fcg2[listAFinal[1]][0];
			listAFinal[5] =fcg2[listAFinal[1]][1];
			
			if(fcg3[listAFinal[1]]){
				listAFinal[7] =fcg3[listAFinal[1]][0];			
				listAFinal[12]=fcg3[listAFinal[1]][1];
			}

			listAFinal[25]=fcg2[listAFinal[1]][0];
			listAFinal[24]=fcg2[listAFinal[1]][1];
			if(fcg3[listAFinal[1]]){
				listAFinal[26]=fcg3[listAFinal[1]][0];
				listAFinal[27]=fcg3[listAFinal[1]][1];
			}

			listAFinal[37]=fcg2[listAFinal[1]][0];
			listAFinal[36]=fcg2[listAFinal[1]][1];
			if(fcg3[listAFinal[1]]){
				listAFinal[39]=fcg3[listAFinal[1]][0];
				listAFinal[38]=fcg3[listAFinal[1]][1];			
			}
		}

		if(listAFinal[9]){
			listAFinal[10]=fcg4[listAFinal[9]][0];
			listAFinal[11]=fcg4[listAFinal[9]][1];

			listAFinal[30]=fcg4[listAFinal[9]][0];
			listAFinal[31]=fcg4[listAFinal[9]][1];

			listAFinal[42]=fcg4[listAFinal[9]][0];
			listAFinal[43]=fcg4[listAFinal[9]][1];
		}




		if(s=="H6" && fch1[bs]){
			if(tp=="V"){
				if(fch1[bs][0])listAFinal[15]=fch1[bs][0];
			}
			if(tp=="C"){
				if(fch1[bs][1])listAFinal[18]=fch1[bs][1];
				if(fch1[bs][2])listAFinal[19]=fch1[bs][2];
			}
			if(tp=="Q"){
				if(fch1[bs][3])listAFinal[16]=fch1[bs][3];
			}
		}

		if(s=="A4"  && fch2[bs]){
			if(tp=="DV"){
				if(fch2[bs][0])listAFinal[15]=fch2[bs][0];
			}
			if(tp=="-V"){
				if(fch2[bs][1])listAFinal[15]=fch2[bs][1];
			}
			if(tp=="DC"){
				if(fch2[bs][2])listAFinal[18]=fch2[bs][2];
			}
			if(tp=="-C"){
				if(fch2[bs][3])listAFinal[18]=fch2[bs][3];
			}

			if(tp=="-C"){
				if(fch2[bs][4])listAFinal[19]=fch2[bs][4];
			}
			if(tp=="-Q"){
				if(fch2[bs][5])listAFinal[16]=fch2[bs][5];
			}


		}


		if(s=="A2" && fch3[bs]){
			if(tp=="DV"){
				if(fch3[bs][0])listAFinal[15]=fch3[bs][0];
			}
			if(tp=="DC" || tp=="-C"){
				if(fch3[bs][1])listAFinal[18]=fch3[bs][1];
				if(fch3[bs][2])listAFinal[19]=fch3[bs][2];
			}

		}

}


function SetS(){
	special_inc++;
	pn=document.partbuilderform.partno.value;
	document.partbuilderform.partno.value=pn.substr(0,pn.length-3)+"S"+pn.substr(pn.length-2,2);
}	

function unSetS(){
	if(special_inc>0)special_inc--;
	if(special_inc<1){
		pn=document.partbuilderform.partno.value;
		document.partbuilderform.partno.value=pn.substr(0,pn.length-3)+"-"+pn.substr(pn.length-2,2);
	}	
}	

	
function setList(num){
	
	if(listA[num])unSetS(); else SetS();
	
	pv1=document.partbuilderform.partno1.value;
	
	listA[num]=1-listA[num];
	eval("document.ia"+num+".src='newimages/"+listA[num]+".gif'")
	eval("document.partbuilderform.temp"+num+".focus()");



	if(num==12 && listA[num]==1){
		setAM(7,8)
		document.getElementById("aas7").className="vis1";
		document.getElementById("aas8").className="vis1";		
	}
		
	if(num==12 && listA[num]==0){
		document.partbuilderform.temp12.focus();			
		setAM(7,8)		
		document.getElementById("aas7").className="vis2";		
		document.getElementById("aas8").className="vis2";		

	}


	if(num==16 && listA[num]==1){
		if(listA[21])setList(21);
		spec_disabled[11]=0;
		document.getElementById("ext11").className="vis1";		
		setupNextSpec(11);
		document.partbuilderform.fieldnos11.value="";
		document.partbuilderform.fieldnos11.focus();
	}
		
	if(num==16 && listA[num]==0){
		spec_disabled[11]=1;
		document.partbuilderform.temp16.focus();			
		imgInact(menuImages2[8]);
		document.partbuilderform.fieldnos11.value="";
		document.getElementById("ext11").className="vis2";		
		

	}

	if(num==21 && listA[num]==1){
		setAM(13,14)

		if(listA[16])setList(16);
		spec_disabled[12]=0;
		document.getElementById("ext12").className="vis1";		
		setupNextSpec(12);
		document.partbuilderform.fieldnos12.value="";
		document.partbuilderform.fieldnos12.focus();

		document.getElementById("aas13").className="vis1";
		document.getElementById("aas14").className="vis1";		
	}
		
	if(num==21 && listA[num]==0){
		document.partbuilderform.fieldnos12.value="";
		spec_disabled[12]=1;
		document.partbuilderform.temp21.focus();			
		imgInact(menuImages2[9]);

		document.getElementById("ext12").className="vis2";		
		document.getElementById("aas13").className="vis2";
		document.getElementById("aas14").className="vis2";		
		
	}





	if(num==17 && listA[num]==1){
		setAM(9,10);
		document.getElementById("aas9").className="vis1";
		document.getElementById("aas10").className="vis1";		
	}
		
	if(num==17 && listA[num]==0){
		document.partbuilderform.temp17.focus();			
		setAM(9,10);	
		document.getElementById("aas9").className="vis2";		
		document.getElementById("aas10").className="vis2";		

	}




	if(num==14 && listA[num]==1){		
		if((pv1=="A4" || pv1=="H4" || pv1=="L4") && listA[20])setList(20);
	}


	if(num==20 && listA[num]==1){

      	if(pv1=="H6")setAM(11,12);
        else setAM(12,11);
        if(pv1=="H6")document.getElementById("aas11").className="vis1";
		document.getElementById("aas12").className="vis1";	
		
		if((pv1=="A4" || pv1=="H4" || pv1=="L4") && listA[14])setList(14);
	}
		
	if(num==20 && listA[num]==0){
		document.partbuilderform.temp20.focus();			
		setAM(11,12)		
		document.getElementById("aas11").className="vis2";		
		document.getElementById("aas12").className="vis2";		

	}

	


	if(num==18 && listA[num]==1){
		spec_disabled[8]=0;
		spec_disabled[9]=0;
		document.getElementById("ext08").className="vis1";		
		if(document.partbuilderform.partno3.value=="D")document.getElementById("ext09").className="vis1";
		setupNextSpec(8);
	}
		
	if(num==18 && listA[num]==0){
		spec_disabled[8]=1;
		spec_disabled[9]=1;
		document.partbuilderform.temp18.focus();			
		imgInact(menuImages2[7]);
		
		document.getElementById("ext08").className="vis2";		
		document.getElementById("ext09").className="vis2";

	}



	if(num==15 && listA[num]==1){
		spec_disabled[10]=0;
		document.getElementById("ext10").className="vis1";		
		setupNextSpec(10);
		document.partbuilderform.fieldnos10.focus();
	}
		
	if(num==15 && listA[num]==0){
		spec_disabled[10]=1;
		document.partbuilderform.temp15.focus();			
		imgInact(menuImages2[6]);
		document.getElementById("ext10").className="vis2";		
		

	}


		bs=document.partbuilderform.fieldno7.value;


	    if(bs.search("(STD)") != -1){
			bs=bs.substring(0,bs.length-6);
	    }
	    if(bs.search("(2:1)") != -1){
			bs=bs.substring(0,bs.length-6);
	    }

		bs=bs.substring(0,bs.length-1);

		if(document.partbuilderform.partno1.value=="A4" || document.partbuilderform.partno1.value=="L4"){
			if(num==13 && listA[13] && !listA[14]) setList(14);
			if(num==14 && !listA[14] && listA[13]) setList(13);
		}
		
		if(num==13 && listA[num]==1 && (document.partbuilderform.partno1.value=="A2") && metrix[bs]<=8.1){
			document.getElementById("da16").className="vis1";
			document.getElementById("da21").className="vis1";
		}
		
		if(num==13 && listA[num]==0){
			document.getElementById("da16").className="vis2";
			document.getElementById("da21").className="vis2";
			if(listA[16])setList(16);
			if(listA[21])setList(21);
		}
	
		if((num==13 || num==14) && (document.partbuilderform.partno1.value=="A4" || document.partbuilderform.partno1.value=="L4") && listA[13] && listA[14] && metrix[bs]<=8.1){
			document.getElementById("da16").className="vis1";
			document.getElementById("da21").className="vis1";
		}
		if((num==13 || num==14) && (document.partbuilderform.partno1.value=="A4" || document.partbuilderform.partno1.value=="L4") && (!listA[13] || !listA[14])){
			document.getElementById("da16").className="vis2";
			document.getElementById("da21").className="vis2";
			if(listA[16])setList(16);
			if(listA[21])setList(21);
		}
	
} 





function setAList(num, num2){

	k1=-1;
	k2=-1;
	for(i=0;i<3;i++){
		for(j=0;j<5;j++){
			if(acp[i][j]==num){
				k1=i;
				k2=j;
			}
		}
	}

	if(k2>=0){
		for(j=0;j<5;j++){
			if(j!=k2){
				if(listA2[acp[k1][j]]) setAList(acp[k1][j],0);
			}
		}
	}


	if(app[num])if(listA2[app[num][0]])setAList(app[num][0],app[num][1]);
	
	listA2[num]=1-listA2[num];
	eval("document.ib"+num+".src='newimages/"+listA2[num]+".gif'");
	eval("document.partbuilderform.tmp"+num+".focus()");
//	if(num2>0)setAList(num2,0);
	



	aop1=aop[num];
	if(aop1)if(listA2[num]){		

		for(i=0;i<aop1.length;i++){
			if(listAFinal[aop1[i]] && aop1[i]!=12 && aop1[i]!=26 && aop1[i]!=38)eval("document.getElementById(\"aa"+aop1[i]+"\").className=\"vis1\"")
		}

	} else {

		for(i=0;i<aop1.length;i++){
			eval("document.getElementById(\"aa"+aop1[i]+"\").className=\"vis2\"")
			listA2[aop1[i]]=0;
			eval("document.ib"+aop1[i]+".src='newimages/0.gif'");
		}
	}
		
	
	if(num==1)setAMfields(num,1);	
	if(num==20)setAMfields(num,3);	
	if(num==32)setAMfields(num,5);	
} 


function setAMfields(num, nums){

	if(listA2[num]){

		tp3=listAFinal[num];
		
		if(tp3 && fca[tp3]){
			eval("document.partbuilderform.tmps"+nums+".value=fca[tp3][0]");
			eval("document.partbuilderform.tmps"+(nums+1)+".value=fca[tp3][1]");
			document.getElementById("aas"+nums).className="vis1";
			document.getElementById("aas"+(nums+1)).className="vis1";
		}

	}
	if(listA2[num]==0){
		setAM(nums,nums+1);
		document.getElementById("aas"+nums).className="vis2";
		document.getElementById("aas"+(nums+1)).className="vis2";
	}
	
}

function setAM(num, num2){
	if(am[num]==0){
		am[num]=1;
		am[num2]=0;

		if(listAFinal[1]  && am[2] ) { var laf=new String(listAFinal[1] ); listAFinal[1] =laf.substring(0,laf.length-1);listAFinal[1] =listAFinal[1] +"M";}
		if(listAFinal[20] && am[4] ) { var laf=new String(listAFinal[20]); listAFinal[20]=laf.substring(0,laf.length-1);listAFinal[20]=listAFinal[20]+"M";}
		if(listAFinal[32] && am[6] ) { var laf=new String(listAFinal[32]); listAFinal[32]=laf.substring(0,laf.length-1);listAFinal[32]=listAFinal[32]+"M";}
		if(listAFinal[1]  && am[1] ) { var laf=new String(listAFinal[1] ); listAFinal[1] =laf.substring(0,laf.length-1);listAFinal[1] =listAFinal[1] +"A";}
		if(listAFinal[20] && am[3] ) { var laf=new String(listAFinal[20]); listAFinal[20]=laf.substring(0,laf.length-1);listAFinal[20]=listAFinal[20]+"A";}
		if(listAFinal[32] && am[5] ) { var laf=new String(listAFinal[32]); listAFinal[32]=laf.substring(0,laf.length-1);listAFinal[32]=listAFinal[32]+"A";}

	}

	eval("document.ibs"+num+".src='newimages/1.gif'");
	eval("document.ibs"+num2+".src='newimages/0.gif'");
//	eval("document.partbuilderform.tmps"+num+".focus()");
} 





function setListImg(num){
	if(num<12 || num==18 || num==19){
		if(num==18){
			  pn13=document.partbuilderform.partno13.value			  
			  pn13=pn13.substr(0,1);
			  if(pn13==1 || pn13==2 || pn13==3 || pn13==4 || pn13==5 || pn13==6 || pn13==7 || pn13==8 || pn13==9)num=num+"_"+pn13;
		}
			eval("document.part_graphic.src='newimages/ia"+num+".gif'");		
	} else {
		document.part_graphic.src="newimages/blank.gif";
	}
}	

	
	
function setSpecValue(num){

		eval("stmp=document.partbuilderform.fieldnos"+num+".value");


		if(!stmp){
			if(!spec_disabled[num]){
				setupNextSpec(num);				
				eval("document.partbuilderform.fieldnos"+num+".focus()");
			}
		} else{

			if(num==3)setPistonSeals("next");
			if(num==4)setPorts("next");
			if(num==5)setRodSeals("next");
			if(num==6)setRodThread("next");
			if(num==7)setMounting("next");
			if(num==8 && document.partbuilderform.partno3.value=="D"){
				setupNextSpec(9);
				imgInact(menuImages2[5]);
			}
			if(num==8 && document.partbuilderform.partno3.value!="D"){
				imgInact(menuImages2[5]);
			}
			if(num==9){
				imgInact(menuImages2[6]);
			}
			if(num==10){
				imgInact(menuImages2[7]);
			}
			if(num==11){
				imgInact(menuImages2[8]);
			}
			if(num==12){
				imgInact(menuImages2[9]);
			}

			
			if(num==0){

/*

		   	  if(document.partbuilderform.partno2.value=="T" || document.partbuilderform.partno2.value=="-T"){
		   	  	vll=document.partbuilderform.fieldnos7.value;
   			    vll = vll.replace("\"", "");		   	 
		   	  	if(newval-vll<0){
		   	  		newval=vll;
		   	  		document.partbuilderform.fieldnos0.value=vll+"\"";
		   	  	}
		   	  }
*/

		      strokepartno = 100*newval;
		      strokepartno2 = strokepartno.toFixed(0);
		      if ((strokepartno2 <= 999) && (strokepartno2 >= 100)) {
			 strokepartno2 = "-" + strokepartno2;
		      }
		      else if ((strokepartno2 <= 99) && (strokepartno2 >= 1)){
		         strokepartno2 = "--" + strokepartno2;
		      }

		      document.partbuilderform.partno9.value = strokepartno2.substr(0,2)+"."+strokepartno2.substr(2,4);
			  if(document.partbuilderform.partno1.value=="H6" && newval<100){
			  		document.partbuilderform.partno9.value="-"+document.partbuilderform.partno9.value;
			  }
			  if(document.partbuilderform.partno1.value=="H6" && newval>=100){
			  		strokepartno=document.partbuilderform.partno9.value;
			  		strokepartno2=strokepartno.substr(0,2)+strokepartno.substr(3,1)+"."+strokepartno.substr(4,2);
			  		document.partbuilderform.partno9.value=strokepartno2;
			  }
				
  			  setupNextSelection(10);
			  document.part_graphic.src = 'newimages/blank.gif';
		      }				
			}

}

function setSpecNumValue(num){
	
	eval("newval = document.partbuilderform.fieldnos"+num+".value");
	   newval = newval.replace("\"", "");

		  stmp = newval;
		  if(stmp>100 && document.partbuilderform.partno1.value!="H6")stmp="99.99";
		  if(stmp>1000 && document.partbuilderform.partno1.value=="H6")stmp="999.99";
		  if(stmp<0.13 && num!=8 && num!=9)stmp="0.13";
		  if(stmp<0.13 && (num==8 || num==9))stmp="0";
		  if((num==11 || num==12) && stmp=="0.13")stmp="1";
		  stmp1=stmp+"\"";
		if(num!=11 && num!=12)eval("document.partbuilderform.fieldnos"+num+".value=stmp1");
		newval=stmp;

	   allcharsRegExp = /[^\.\d]/g
	   newval2 = newval.replace(allcharsRegExp, "");
	   if(newval2!=newval){
	   		eval("document.partbuilderform.fieldnos"+num+".value =\"\"");
	   		eval("document.partbuilderform.fieldnos"+num+".focus()");
		} else {
	   		if(num!=11 && num!=12){
	   			if(newval!="")
	   			eval("document.partbuilderform.fieldnos"+num+".value=newval+'\"'");	   			
	   		} else {
	   			eval("document.partbuilderform.fieldnos"+num+".value=newval.replace('.','')");	   				   				   			
	   		}
		}
		
		setSpecValue(num);
}


function setupNextSpec(num){
   if(num!=6 && num!=7)document.part_graphic.src = 'newimages/strokeNote2.gif'
   if(num>6)document.part_graphic.src = 'newimages/strokeNote3.gif'
   if(num>0){
		if(num<10)document.getElementById("ext0"+num).className="vis1";
		if(num>9)document.getElementById("ext"+num).className="vis1";
		spec_disabled[num]=0;
		
	    imgAct(menuImages2[num-3]);
   }
   
    for (i=0; i<menuImages.length; i++) {
		    imgInact(menuImages[i]);
    }
	
	eval("document.partbuilderform.fieldnos"+num+".value=\"\"");
	eval("document.partbuilderform.fieldnos"+num+".focus()");
}

function bclear(id){
	if(id<10)document.getElementById("ext0"+id).className="vis2";
	else document.getElementById("ext"+id).className="vis2";
	spec_disabled[id]=1;
	if(id>2)eval("document.partbuilderform.fieldnos"+id+".value=''");
}




menuImages = ['cylinder', 'mounting', 'double', 'cushions', 'headcushion', 'capcushion' , 'bore', 'piston', 'stroke', 'ports', 'rodd', 'rodseals','rodend', 'rodthread', 'headport','capport' ];
menuImages2= ['spec3', 'spec4', 'spec5', 'spec6', 'spec7', 'spec8','spec9', 'spec10','spec11','spec12'];

function clearPartNum() {
   document.partbuilderform.partno.value = '';
}

/* Set menu values and swap images etc. */

function setupNextSelection(source_number) {
	
      for (i=0; i<menuImages.length; i++) {
		 if (i == (source_number - 1)) {
		    imgAct(menuImages[i]);
		 } else {
		    imgInact(menuImages[i]);
		 }
      }

      for (i=0; i<menuImages2.length; i++) {
		 if (i == (source_number - 1)) {
		 } else {
		    imgInact(menuImages2[i]);
		 }
      }

	
      menuItemActive = (source_number - 1);

	  if(source_number<2)specials="-";

      isDisabled=1;
      document.download.src='newimages/download.gif';
	  document.partn.src = 'newimages/partno.gif';


	  if(source_number>=3){
	   nwl=document.partbuilderform.partno2.value;
	   	   
	   if(nwl.length==1 && document.partbuilderform.partno1.value!="H6")nwl="-"+nwl;
	   document.partbuilderform.partno2.value=nwl;
	  }
	  if(source_number==16){
		  for (i=1; i<=source_number-1; i++) {
			  
			  if(i!=9){
				  var fld="";
				  eval("fld=document.partbuilderform.fieldno" + i + ".value;");				  
				  if(fld.search("pecify") != -1)specials="S";
			  }
		  }
		  pn13=document.partbuilderform.partno13.value
		  if(pn13.substr(pn13.length-1,1)!="S" && pn13.substr(pn13.length-1,1)!="-")
		  	document.partbuilderform.partno13.value=document.partbuilderform.partno13.value+specials;
		  specials="-";
	  }

      for (i=source_number; i<=16; i++) {
	 	if(i!=9){
	 		eval("document.partbuilderform.partno" + i + ".value = '';");
	 		eval("document.partbuilderform.fieldno" + i + ".value = '';");	 	 
	 	} else{
	 		document.partbuilderform.partno9.value = "";
	 		document.partbuilderform.fieldnos0.value = "";
	 	} 
      }
      clearPartNum();

	  
	  for (i=1; i<=source_number-1; i++) {
	      if(i!=5 && i!=6 && i!=14)eval("document.partbuilderform.partno.value=document.partbuilderform.partno.value+document.partbuilderform.partno"+i+".value");
      }
      if(source_number<5)bclear(1);
      if(source_number<6)bclear(2);
      if(source_number<9)bclear(3);
      if(source_number<11)bclear(4);
      if(source_number<13)bclear(5);
      if(source_number<14)bclear(6);
      if(source_number<2)bclear(7);
   }

   /* *** SET VALUES FROM MENU SELECTIONS *** */
   function setSeries(newcode, newval) {
      document.partbuilderform.fieldno1.value = newval;
      buildMountingTopMenu();
      buildMountingSubMenus();
      buildRodEndMenu();

      setupNextSelection(2);
   }


function setRodDiameter(number) {
   var numRodDiameter = number;
   if(numRodDiameter.search("(2:1)") == -1 && numRodDiameter.search("(STD)") == -1){
   		document.partbuilderform.fieldno11.value = numRodDiameter + "\"";
   } else {
   		document.partbuilderform.fieldno11.value = numRodDiameter.substring(0,numRodDiameter.length-6) + "\""+numRodDiameter.substring(numRodDiameter.length-6,numRodDiameter.length);  
   		
   }
   setupNextSelection(12);
}

/* If you've finished selecting but accidentally mouseover and then mousout of the stroke field, everything resets.
 * To keep this from happening, we store the value on mouseover with this function and see if it's changed on mouseout in setStrokeValue.
 */


function setRodSeals(newval) {
   if(newval!="next")document.partbuilderform.fieldno12.value = newval;
   if(newval!="next" && newval.search("pecify") == -1)bclear(5);
   if(newval.search("pecify") != -1){
  	    setupNextSpec(5);	
   } else {
	   setupNextSelection(13);	
   }
}

function setRodEnd(newval) {
   document.partbuilderform.fieldno13.value = newval;
   buildRodThreadMenu(newval);   

  if(newval.search("pecify") != -1){
		document.getElementById("ext06").className="vis1";
	   	setupNextSelection(14);
   } else {
		document.getElementById("ext06").className="vis2";
	   	setupNextSelection(15);   	
   }
      
}
function setRodThread(newval) {
   if(newval!="next")document.partbuilderform.fieldno14.value = newval;
   if(newval!="next")setupNextSpec(6);	
   if(newval=="next")setupNextSelection(15);
}
function setHeadPort(newval) {
   document.partbuilderform.fieldno15.value = newval;
   setupNextSelection(16);
}
function setCapPort(newval) {
   document.partbuilderform.fieldno16.value = newval;
   setupNextSelection(17);
    isDisabled=0;
    document.download.src='newimages/download-over.gif';
	document.partn.src='newimages/partno-over.gif';
}




function setBoreSize(newval) {
   document.partbuilderform.fieldno7.value = newval+"\"";
   borev=newval;
   buildHeadPortMenu();
   buildCapPortMenu();
   buildPortsMenu(newval);
   buildPistonSealsMenu(newval);
   buildRodSealsMenu(newval);
   setupNextSelection(8);
}
function setPistonSeals(newval) {
   if(newval!="next")document.partbuilderform.fieldno8.value = newval;

   if(newval!="next" && newval.search("pecify") == -1)bclear(3);
   if(newval.search("pecify") != -1){
  	    setupNextSpec(3);	
   } else {
	   setupNextSelection(9);	
	   document.part_graphic.src = 'newimages/strokeNote.gif'
	   document.partbuilderform.fieldnos0.focus();
	
   }
}

function setPorts(newval) {
   if(newval!="next")document.partbuilderform.fieldno10.value = newval;
   if(newval!="next" && newval.search("pecify") == -1)bclear(4);

   buildRodMenu(borev);   

   if(newval.search("pecify") != -1){
  	    setupNextSpec(4);	
   } else {
	   setupNextSelection(11);	
   }
}


function setCushions(newval) {
   document.partbuilderform.fieldno4.value = newval;
   nwl1=document.partbuilderform.partno4.value;

	buildHeadCushionMenu();
	buildCapCushionMenu();	
   
   
   if(nwl1=="R"){
	   	setupNextSelection(5);
		document.getElementById("ext01").className="vis1";
		bclear(2);
   }
   if(nwl1=="C"){
	   	setupNextSelection(6);
		document.getElementById("ext02").className="vis1";
		bclear(1);
   }


   if(nwl1=="B"){
	   	setupNextSelection(5);
		document.getElementById("ext01").className="vis1";
		document.getElementById("ext02").className="vis1";
   }
   
   if(nwl1=="N"){
		bclear(1);
		bclear(2);
	   	setupNextSelection(7);
   }
}

function setHeadCushion(newval) {
   document.partbuilderform.fieldno5.value = newval;
   nwl=document.partbuilderform.partno4.value;
   if(nwl=="R")setupNextSelection(7);	
   else setupNextSelection(6);	
   arr_ext["ext01"]=document.partbuilderform.partno5.value;
}
function setCapCushion(newval) {
   document.partbuilderform.fieldno6.value = newval;
   setupNextSelection(7);	
}

function setDoubleRod(newval) {
   document.partbuilderform.fieldno3.value = newval;
   setupNextSelection(4);
}

function setPortPosition(newval) {
   	document.partbuilderform.fieldno8.value = newval;
   	setupNextSelection(9);
    isDisabled=0;
    document.download.src='newimages/download-over.gif';
	document.partn.src='newimages/partno.gif';
}

function setMounting(newval) {
   if(newval!="next"){
   	document.partbuilderform.fieldno2.value = newval;   
   	buildBoreSizeMenu();   
   	t=document.partbuilderform.partno2.value
   	if(t=="H")hpos="1"; else hpos="0";
   	
   	if(t=="Q" || t=="R" || t=="S" || t=="C" || t=="DC" || t=="DV" || t=="V") cpos="1";
    }else{
    	cpos=0;	
    }

    buildDoubleRodMenu();
    buildCushionsMenu();

   if(newval!="next" && newval.search("pecify") == -1)bclear(7);
   if(newval.search("MT4") != -1){
     setupNextSpec(7);	
   } else {

    if(menu3)setupNextSelection(3); else setupNextSelection(4);
   }

}


/* Set up the menu divs */
   /* Normal single-level menus */
   if (ie4||ns6) {
      document.write('<div id="dropmenudiv" class="menustyle" style="visibility:hidden;width: 280px" ')
      document.write(' onmouseover="clearhidemenu(\'dropmenudiv\')" onmouseout="delayhidemenu(\'dropmenudiv\')"></div>')
   }

/* Menus that have cascading children */
   if (ie4||ns6) {
      document.write('<div id="dropmenudiv-top" class="menustyle" style="visibility:hidden;width: 180px" ')
      document.write(' onmouseover="clearhidemenu(\'dropmenudiv-top\'); clearhidemenu2(\'dropmenudiv-sub\')" onmouseout="delayhidemenu(\'dropmenudiv-top\'); delayhidemenu2(\'dropmenudiv-sub\')"></div>')
   }

/* Child menus of dropmenudiv-top menus */
   if (ie4||ns6) {
      document.write('<div id="dropmenudiv-sub" class="menustyle" style="visibility:hidden;width: 180px" ')
      document.write(' onmouseover="clearhidemenu(\'dropmenudiv-top\'); clearhidemenu2(\'dropmenudiv-sub\')" onmouseout="delayhidemenu(\'dropmenudiv-top\'); delayhidemenu2(\'dropmenudiv-sub\')"></div>')
   }

/* Makes it easier to build menus */
   function build_menu_link(functionName, builderfieldname, builderval, label, graphic) {
      result = "<A HREF=";
      result = result + '"javascript:';
      result = result + "document.partbuilderform." + builderfieldname + ".value = '" + builderval + "'; ";
      result = result + functionName + "; "; 
      result = result + 'hidemenu(' + "'dropmenudiv'" + '); "' 
      if (graphic != undefined) {
	 result = result + ' onmouseover="swapimage(\'' + graphic + '\')" '
      }
      result = result + '>' + label + "</a>";
      return result;
   }

/* Makes it easier to build menus that have sub-menus */
   function build_top_menu_link(submenuname, label, graphic) {
      result = "<A HREF='#' onclick='return false;' "
      result = result + 'onMouseover="clearhidemenu(); clearhidemenu2(); return dropdownmenu(this, event, ' + submenuname + ', \'275px\', \'dropmenudiv-sub\', \'sub\')">' + label + "<img src=newimages/arrow.gif width=9 height=7 border=0 align=absmiddle></a>";
      return result;
   }

/* Makes it easier to build menus that extend from other menus */
   function build_sub_menu_link(functionName, builderfieldname, builderval, label, graphic) {
      result = "<A HREF=";
      result = result + '"javascript: '; 
      result = result + "document.partbuilderform." + builderfieldname + ".value = '" + builderval + "'; ";
      result = result + ' ' + functionName + '; ';
      result = result + "hidemenu('dropmenudiv-sub'); hidemenu('dropmenudiv-top'); ";
      result = result + "\" ";
      if (graphic != undefined) {
	 result = result + ' onmouseover="swapimage(\'' + graphic + '\')" ';
      }
      result = result + '>' + label + "</a>";
      return result;
   }

function swapimage(imgName) {
   if(imgName=="newimages/C.gif" && document.partbuilderform.partno1.value == "A2")imgName="newimages/C1.gif";
   if(imgName=="newimages/R.gif" && document.partbuilderform.partno1.value == "H6")imgName="newimages/R1.gif";
   if(imgName=="newimages/F.gif" && document.partbuilderform.partno1.value == "H6")imgName="newimages/F1.gif";
   if(imgName!="newimages/")document.part_graphic.src = imgName;
   if(imgName=="newimages/")document.part_graphic.src ="newimages/blank.gif";
   
   
   ptmp=0;
   if(imgName=="newimages/type1.gif")ptmp=1;
   if(imgName=="newimages/type2.gif")ptmp=2;
   if(imgName=="newimages/type3.gif")ptmp=3;
   if(imgName=="newimages/type4.gif")ptmp=4;
   if(imgName=="newimages/type5.gif")ptmp=5;
   if(imgName=="newimages/type6.gif")ptmp=6;
   if(imgName=="newimages/type7.gif")ptmp=7;
   if(imgName=="newimages/type8.gif")ptmp=8;
   if(imgName=="newimages/type9.gif")ptmp=9;
   
   if(ptmp==0)document.getElementById("length_thread").className="vis5";
   if(ptmp>0){

	   rdi=document.partbuilderform.partno11.value; 
		
	   for(i=0;i<16; i++){
	
	   		zrd=lttext1[i][0];
	   		zz1=lttext1[i][ptmp];
	   		zz2=lttext2[i][ptmp];
			
			if(i<12 || (i>11 && document.partbuilderform.partno1.value=="H6"))
	
		    if(zrd-rdi<=0.01){
		    	document.getElementById("length_thread").innerHTML="<b>Thread:</b> "+ zz2 + zz1; 
		    	document.getElementById("length_thread").className="vis1";
		    }
	
	   	}
   		
   }

}

function imgAct(imgName) {
   imgName2=imgName;
   if(imgName.search("spec") != -1)imgName2="spec";
   if(imgName=="spec6")imgName2="rtl";
   if(imgName=="spec7")imgName2="tp";
   if(imgName=="spec8")imgName2="erel";
   if(imgName=="spec9")imgName2="errel";
   if(imgName=="spec10")imgName2="length";
   if(imgName=="spec11" || imgName=="spec12")imgName2="quantity";
   document[imgName].src = "newimages/" + imgName2 + "-over.gif";
}

function imgInact(imgName) {
	imgName2=imgName;
   if(imgName.search("spec") != -1)imgName2="spec";
   if(imgName=="spec6")imgName2="rtl";
   if(imgName=="spec7")imgName2="tp";
   if(imgName=="spec8")imgName2="erel";
   if(imgName=="spec9")imgName2="errel";
   if(imgName=="spec10")imgName2="length";
   if(imgName=="spec11" || imgName=="spec12")imgName2="quantity";
   document[imgName].src = "newimages/" + imgName2 + ".gif";
}



/***********************************************
* AnyLink Vertical Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************
* Heavily modified by Andrew Burke for cascading menus and 'clarity'
* http://www.andrewburke.ca
***********************************************/
   var disappeardelay=150  //menu disappear speed onMouseout (in miliseconds)
   var horizontaloffset=0 //horizontal offset of menu from default location. (0-5 is a good value)

/* Climbs back up the collection of offset parents for the passed 'what' to get the absolute page position - either 'left' or 'top'*/
   function getposOffset(what, offsettype){
      var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
      var parentEl=what.offsetParent;
      while (parentEl!=null){
	 if (offsettype=="left") {
	    totaloffset = totaloffset + parentEl.offsetLeft;
	 } else {
	    totaloffset = totaloffset + parentEl.offsetTop;
	 }
	 parentEl=parentEl.offsetParent;
      }
      return totaloffset;
   }

/* sets up the target_menu div style to show correctly or to hide, depending on the passed event */
   function showhide(obj, e, visible, hidden, menuwidth, target_menu){
      if (ie4||ns6)
	 target_menu.style.left=target_menu.style.top=-500
      target_menu.widthobj=target_menu.style
      target_menu.widthobj.width=menuwidth
      if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
	 obj.visibility=visible
      else if (e.type=="click")
      obj.visibility=hidden
   }

function iecompattest(){
   return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

/* Rearranges menu to keep within the browser window */
   function clearbrowseredge(obj, whichedge, target_menu){
      var edgeoffset=0
      if (whichedge=="rightedge"){
	 var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
	 target_menu.contentmeasure=target_menu.offsetWidth
	 if (windowedge-target_menu.x-obj.offsetWidth < target_menu.contentmeasure)
	    edgeoffset=target_menu.contentmeasure+obj.offsetWidth
      }
      else{
	 var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
	 var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
	 target_menu.contentmeasure=target_menu.offsetHeight
	 if (windowedge-target_menu.y < target_menu.contentmeasure){ //move menu up?
	    edgeoffset=target_menu.contentmeasure-obj.offsetHeight
	    if ((target_menu.y-topedge)<target_menu.contentmeasure) //up no good either? (position at top of viewable window then)
	       edgeoffset=target_menu.y
	 }
      }
      return edgeoffset
   }

/* builds a menu from the passed menuitems_list array and puts it into the target_menu div */
   function populatemenu(menuitems_list, target_menu){
      if (ie4||ns6) {
	 target_menu.innerHTML=menuitems_list.join("")
      }
   }

/* Wraps up the ugly code and browser-specific conditions for finding the menu with the passed name */
   function getMenuByName(targetMenuName) {
      targetMenu = null;

      // Get the menu DIV by the passed name - if browser doesn't support getElementById, get generic version
      if (document.getElementById) {
	 targetMenu = document.getElementById(targetMenuName) 
      } else {
	 /* this part doesn't seem to do anything */
	    targetMenu = dropmenudiv
      }
      return targetMenu;
   }

/* Builds and displays the menu with the passed contents, width, and name */
function dropdownmenu(obj, e, menucontents, menuwidth, target_menu_name, sub_flag){
   clearhidemenu(target_menu_name);
   target_menu = getMenuByName(target_menu_name);
   hide_other_menus(target_menu_name);
   
   if (window.event) {
      event.cancelBubble=true;
   } else if (e.stopPropagation) {
      e.stopPropagation();
   }
   populatemenu(menucontents, target_menu);
   
   if (ie4||ns6){
      showhide(target_menu.style, e, "visible", "hidden", menuwidth, target_menu);

      target_menu.x=getposOffset(obj, "left");
      target_menu.y=getposOffset(obj, "top");

      // adjust slightly down for sub-menus
      if (sub_flag == 'sub') {
	 target_menu.x -= 3;
	 target_menu.y -= 7;
      } else {
	 target_menu.x -= 1;
	 target_menu.y -= 5;
      }
      
      target_menu.style.left=target_menu.x+obj.offsetWidth+horizontaloffset+"px";
      target_menu.style.top=target_menu.y+"px";
   }
   
   return clickreturnvalue();
}

/* returns false if browser compatible - otherwise return true */
function clickreturnvalue(){
   if (ie4||ns6) return false
   else return true
}

/* Called from dropdownmenu() - makes sure to hide other menus based on the passed name */
function hide_other_menus(menu_name) {
   if (menu_name == 'dropmenudiv') {
      top_menu = getMenuByName('dropmenudiv-top');
      hidemenu(top_menu);
      sub_menu = getMenuByName('dropmenudiv-sub');
      hidemenu(sub_menu);
   }
   if (menu_name == 'dropmenudiv-top') {
      regular_menu = getMenuByName('dropmenudiv');
      hidemenu(regular_menu);
   }
}

/* Starts a timer that calls hidemenu on the passed menu after the specified # of miliseconds.
 * This timer is cancelled by clearhidemenu() */
function delayhidemenu(menu_name){
   if (ie4||ns6) {
      delayhide=setTimeout("hidemenu('" + menu_name + "')", disappeardelay)
   }
}

/* Starts a timer like delayhidemenu but stores it in another variable so we can track more than one menu timeout - handy for cascading menus */
function delayhidemenu2(menu_name){
   if (ie4||ns6) {
      delayhide2=setTimeout("hidemenu('" + menu_name + "')", disappeardelay)
   }
}

/* Clears the timer set in delayhidemenu - which cancels the hide operation */
function clearhidemenu(){
   if (typeof delayhide!="undefined") {
      clearTimeout(delayhide)
   }
}

/* Clears the timer set in delayhidemenu2 - which cancels the other hide operation */
function clearhidemenu2(){
   if (typeof delayhide2!="undefined") {
      clearTimeout(delayhide2)
   }
}

/* Hides the specified menu element - you can pass the actual element or the name of the element */
function hidemenu(target_menu){
   if (typeof target_menu != "undefined"){
      if (typeof target_menu == "string") {
	 target_menu_obj = getMenuByName(target_menu);    
      } else {
	 target_menu_obj = target_menu;
      }
      if (ie4||ns6) {
	 target_menu_obj.style.visibility="hidden"
      }
   }
}
   

/* FireBug logging */
function printfire() {
   if (document.createEvent) {
      printfire.args = arguments;
      var ev = document.createEvent("Events");
      ev.initEvent("printfire", false, true);
      dispatchEvent(ev);
   }
}


