<!--
function parsePart(form,formid)
{
// Display the appropriate page based on a generic partnumber type
	//alert(formid);
  if (formid == 2) {
       partnumber = getFamily(form.partnum[form.partnum.selectedIndex].value);
  }
   else {
       partnumber = getFamily(form.partnum.value);
  }

	//alert(partnumber);
// alert('in parsePart'+partnumber);
  if (partnumber=="")
  {
    if (formid == 1) {
      alert("Please enter a part number.");
      form.partnum.focus();
	  }
    else {
      alert("Please select a Product Line.");
      form.partnum.focus();
	 }

  }
  else if (partnumber=="VICINABRICK")	window.location="/pro_main.php?url=1,328&lang_code=gb";		    
  else if (partnumber=="VTM")			window.location="pro_main.php?url=1,34&lang_code=gb";
  else if (partnumber=="BCM")			window.location="pro_main.php?url=1,33&lang_code=gb";
  else if (partnumber=="FPA")			window.location="pro_main.php?url=1,20&lang_code=gb";
  else if (partnumber=="VICHIP")		window.location="pro_main.php?url=1&lang_code=gb";
  else if (partnumber=="QPO-1")			window.location="picorpower/picor_power.php?pro_id=11&lang_code=gb"; // picor
  else if (partnumber=="ENMODS")		window.location="pro_main.php?url=3,7,43&lang_code=gb";
  else if (partnumber=="VIPACARRAY")	window.location="pro_main.php?url=2,1,3&lang_code=gb";               // pro_main.php?url=2,1,2  is incorrect.
  else if (partnumber=="MICRORAM")		window.location="pro_main.php?url=2,3,37&lang_code=gb";
  else if (partnumber=="BADGER")		window.location="pro_main.php?url=13,42&lang_code=gb";
  else if (partnumber=="POWERBANK")		window.location="pro_main.php?url=13,43&lang_code=gb";
  else if (partnumber=="VP")			window.location="pro_main.php?url=2,1,2&lang_code=gb";
  else if (partnumber=="VC")			window.location="pro_main.php?url=2,1,2&lang_code=gb";
  else if (partnumber=="VA")			window.location="pro_main.php?url=2,1,2&lang_code=gb";
  else if (partnumber=="VIPAC")			window.location="pro_main.php?url=2,1,2&lang_code=gb";
  else if (partnumber=="VI200")			window.location="pro_main.php?url=2,2,7&lang_code=gb";
  else if (partnumber=="VIJ00")			window.location="pro_main.php?url=2,2,7&lang_code=gb";
  else if (partnumber=="BATMOD")		window.location="pro_main.php?url=2,2,9&lang_code=gb";
  else if (partnumber=="AIMS")			window.location="pro_main.php?url=3,7,47&lang_code=gb";
  else if (partnumber=="ARMS")			window.location="pro_main.php?url=3,7,45&lang_code=gb";
  else if (partnumber=="HAMS")			window.location="pro_main.php?url=3,7,46&lang_code=gb";
  else if (partnumber=="IAMS")			window.location="pro_main.php?url=2,3,13&lang_code=gb";
  else if (partnumber=="RAMS")			window.location="pro_main.php?url=2,3,17&lang_code=gb";
  else if (partnumber=="FLATPAC")		window.location="pro_main.php?url=3,5,20&lang_code=gb";
  else if (partnumber=="FLATPAC-EN")	window.location="pro_main.php?url=3,5,21&lang_code=gb";
  else if (partnumber=="COMPAC")		window.location="pro_main.php?url=2,1,4&lang_code=gb";
  else if (partnumber=="MEGAPAC")		window.location="pro_main.php?url=3,5,23&lang_code=gb";
  else if (partnumber=="CONVERTERPAC")  window.location="pro_main.php?url=3,5,23&lang_code=gb";
  else if (partnumber=="MEGAMOD")		window.location="pro_main.php?url=2,1,5&lang_code=gb";
  else if (partnumber=="MI200")			window.location="pro_main.php?url=4,16,116&lang_code=gb";
  else if (partnumber=="MIJ00")			window.location="pro_main.php?url=4,16,117&lang_code=gb";
  else if (partnumber=="MIAIMS")		window.location="pro_main.php?url=4,17,120&lang_code=gb";
  else if (partnumber=="MIIAMS")		window.location="pro_main.php?url=4,17,121&lang_code=gb";
  else if (partnumber=="MIRAMS")		window.location="pro_main.php?url=4,17,122&lang_code=gb";
  else if (partnumber=="MICOMPAC")		window.location="pro_main.php?url=4,18,123&lang_code=gb";
  else if (partnumber=="MIMEGAMOD")		window.location="pro_main.php?url=4,18,126&lang_code=gb";
  else if (partnumber=="LOPAC")			window.location="pro_main.php?url=3,5,22&lang_code=gb";
  else if (partnumber=="2NDGEN")		window.location="pro_main.php?url=2,2,6&lang_code=gb";
  else if (partnumber=="IAM48")			window.location="pro_main.php?url=2,3,13&lang_code=gb";
  else if (partnumber=="FM48")			window.location="pro_main.php?url=2,3,14&lang_code=gb";
  else if (partnumber=="FIAM")			window.location="pro_main.php?url=2,3,16&lang_code=gb";
  else if (partnumber=="FARM")			window.location="pro_main.php?url=3,7,44&lang_code=gb";
  else if (partnumber=="SURFMATE")		window.location="pro_main.php?url=5,13&lang_code=gb";
  else if (partnumber=="INMATE")		window.location="pro_main.php?url=5,13&lang_code=gb";
  else if (partnumber=="ACCESSORIES")	window.location="pro_main.php?url=5&lang_code=gb";
  else if (partnumber=="ACCESSORIESOP") window.location="pro_main.php?url=5&lang_code=gb";
  else if (partnumber=="ACCESSORIESMO") window.location="pro_main.php?url=5,12&lang_code=gb"; //products/accessories/2nd_gen_mounting/";
  else if (partnumber=="ACCESSORIESPC") window.location="pro_main.php?url=5,9&lang_code=gb";  //products/accessories/components/";
  else if (partnumber=="POWERSTICK")	window.location="pro_main.php?url=2,2&lang_code=gb";  //products/dc-dc/converter_modules/";
  else if (partnumber=="MFIAM")			window.location="pro_main.php?url=4,17,118&lang_code=gb"; //products/military/filter_modules/m-fiam/";
  else {
    form.partnum.value = "";
    alert('       There was no matching part found.\n\n       Please try again or call your local\nVicor Representative, Distributor or Vicor Office.');
  }

}



function getFamily(product)
// Parses a part number pattern into a generic part number type or family
{
  Family = "";

  if (product=="") return Family;
     // Strip out all hyphens and convert to Upper Case
     NewProduct =  product.toUpperCase();
     Uproduct = cleanString(NewProduct);
     //    alert('Uproduct ' + Uproduct + '<---');
	 Uproduct29 = Uproduct.substring(0,29);
	 Uproduct28 = Uproduct.substring(0,28);
	 Uproduct27 = Uproduct.substring(0,27);
	 Uproduct26 = Uproduct.substring(0,26);
	 Uproduct25 = Uproduct.substring(0,25);
	 Uproduct24 = Uproduct.substring(0,24);
	 Uproduct23 = Uproduct.substring(0,23);
	 Uproduct22 = Uproduct.substring(0,22);
	 Uproduct21 = Uproduct.substring(0,21);
	 Uproduct20 = Uproduct.substring(0,20);
	 Uproduct19 = Uproduct.substring(0,19);
	 Uproduct18 = Uproduct.substring(0,18);
	 Uproduct17 = Uproduct.substring(0,17);
	 Uproduct16 = Uproduct.substring(0,16);
	 Uproduct15 = Uproduct.substring(0,15);
	 Uproduct14 = Uproduct.substring(0,14);
	 Uproduct13 = Uproduct.substring(0,13);
	 Uproduct12 = Uproduct.substring(0,12);
	 Uproduct11 = Uproduct.substring(0,11);
	 Uproduct10 = Uproduct.substring(0,10);
	 Uproduct9 = Uproduct.substring(0,9);
	 Uproduct8 = Uproduct.substring(0,8);
	 Uproduct7 = Uproduct.substring(0,7);
     Uproduct6 = Uproduct.substring(0,6);
     Uproduct5 = Uproduct.substring(0,5);
     Uproduct4 = Uproduct.substring(0,4);
     Uproduct3 = Uproduct.substring(0,3);
     Uproduct2 = Uproduct.substring(0,2);

     if (NewProduct.lastIndexOf('-BM')!="-1") Family="BATMOD"
	 else if (Uproduct3=="J00") Family="VIJ00"
	 else if (Uproduct14=="VIC IN A BRICK") Family="VICINABRICK"
	 else if (Uproduct14=="VIC-IN-A-BRICK") Family="VICINABRICK"
	 else if (Uproduct11=="VICINABRICK") Family="VICINABRICK"
	 else if (Uproduct16=="FACTORIZED POWER") Family="FPA"
	 else if (Uproduct3=="FPA") Family="FPA"
	 else if (Uproduct29=="FACTORIZED POWER ARCHITECTURE") Family="FPA"
	 else if (Uproduct3=="VTM") Family="VTM"
	 else if (Uproduct29=="VOLTAGE TRANSFORMATION MODULE") Family="VTM"
	// else if (Uproduct3=="PRM") Family="PRM"
	 else if (Uproduct3=="BCM") Family="BCM"
	 else if (Uproduct20=="BUS CONVERTER MODULE") Family="BCM"
	 else if (Uproduct6=="VICHIP") Family="VICHIP"
	 else if (Uproduct7=="VI CHIP") Family="VICHIP"
	 else if (Uproduct7=="V ICHIP") Family="VICHIP"
	 else if (Uproduct8=="STANDOFF") Family="ACCESSORIES"
	 else if (Uproduct9=="STANDOFFS") Family="ACCESSORIES"
	 else if (Uproduct9=="STAND OFF") Family="ACCESSORIES"
	 else if (Uproduct10=="STAND OFFS") Family="ACCESSORIES"
	 else if (Uproduct4=="AIMS") Family="AIMS"
	 else if (Uproduct3=="AIM") Family="AIMS"
     else if (Uproduct5=="VIAIM") Family="AIMS"
	 else if (Uproduct4=="ARMS") Family="ARMS"
	 else if (Uproduct3=="ARM") Family="ARMS"
     else if (Uproduct5=="VIARM") Family="ARMS"
	 else if (Uproduct6=="BATMOD") Family="BATMOD"
     else if (Uproduct5=="HAMS") Family="HAMS"
	 else if (Uproduct3=="HAM") Family="HAMS"
     else if (Uproduct5=="VIBAM") Family="HAMS"
     else if (Uproduct5=="VIHAM") Family="HAMS"
	 else if (Uproduct4=="IAMS") Family="IAMS"
	 else if (Uproduct5=="VIIAM" || Uproduct3=="VIA") Family="IAMS"
	 else if (Uproduct4=="RAMS") Family="RAMS"
	 else if (Uproduct3=="RAM") Family="RAMS"
     else if (Uproduct5=="VIRAM") Family="RAMS"
	 else if (Uproduct11=="VIPAC ARRAY") Family="VIPACARRAY"
	 else if (Uproduct10=="VIPACARRAY")  Family="VIPACARRAY"
	 else if (Uproduct5=="VIPAC") Family="VIPAC"
	 else if (Uproduct2=="VP") Family="VIPAC"
	 else if (Uproduct2=="VC") Family="VIPAC"
	 else if (Uproduct2=="VA") Family="VIPAC"
     else if (Uproduct5=="VI200") Family="VI200"
     else if (Uproduct3=="VI2") Family="VI200"
     else if (Uproduct3=="VIB") Family="VI200"
	 else if (Uproduct5=="VIJ00") Family="VIJ00"
     else if (Uproduct3=="VIJ") Family="VIJ00"
	 else if (Uproduct3=="JR") Family="VIJ00"
     else if (Uproduct6=="ENMODS") Family="ENMODS"
	 else if (Uproduct5=="ENMOD") Family="ENMODS"
	 else if (Uproduct9=="FLATPACEN") Family="FLATPAC-EN"
     else if (Uproduct10=="FLATPAC-EN") Family="FLATPAC-EN"
	 else if (Uproduct8=="FLAT PAC") Family="FLATPAC"
	 else if (Uproduct7=="FLATPAC") Family="FLATPAC"
     else if (Uproduct4=="VILU") Family="FLATPAC"
     else if (Uproduct4=="VIMU") Family="FLATPAC"
     else if (Uproduct4=="VINU") Family="FLATPAC"
     else if (Uproduct4=="VIPU") Family="FLATPAC"
     else if (Uproduct4=="VIQU") Family="FLATPAC"
     else if (Uproduct4=="VIRU") Family="FLATPAC"
     else if (Uproduct4=="VILF") Family="FLATPAC"
     else if (Uproduct4=="VIMF") Family="FLATPAC"
     else if (Uproduct4=="VINF") Family="FLATPAC"
     else if (Uproduct4=="VIPF") Family="FLATPAC"
     else if (Uproduct4=="VIQF") Family="FLATPAC"
     else if (Uproduct4=="VIRF") Family="FLATPAC"
     else if (Uproduct4=="VIMA") Family="FLATPAC"
     else if (Uproduct4=="VINA") Family="FLATPAC"
     else if (Uproduct4=="VIPA") Family="FLATPAC"
     else if (Uproduct4=="VIQA") Family="FLATPAC"
     else if (Uproduct4=="VIRA") Family="FLATPAC"
	 else if (Uproduct7=="COM PAC") Family="COMPAC"
	 else if (Uproduct6=="COMPAC") Family="COMPAC"
     else if (Uproduct4=="VILC") Family="COMPAC"
     else if (Uproduct4=="VIMC") Family="COMPAC"
     else if (Uproduct4=="VINC") Family="COMPAC"
     else if (Uproduct4=="VIPC") Family="COMPAC"
     else if (Uproduct4=="VIQC") Family="COMPAC"
     else if (Uproduct4=="VIRC") Family="COMPAC"
	 else if (Uproduct11=="URAM") Family="MICRORAM"
	 else if (Uproduct11=="U RAM") Family="MICRORAM"
	 else if (Uproduct11=="MICRO RAM") Family="MICRORAM"
	 else if (Uproduct10=="MICRORAM") Family="MICRORAM"
	 else if (Uproduct11=="MEGA MODULE") Family="MEGAMOD"
	 else if (Uproduct10=="MEGAMODULE") Family="MEGAMOD"
	 else if (Uproduct8=="MEGA MOD") Family="MEGAMOD"
	 else if (Uproduct7=="MEGAMOD") Family="MEGAMOD"
	 else if (Uproduct4=="MEGA") Family="MEGAMOD"
     else if (Uproduct3=="VIL") Family="MEGAMOD"
     else if (Uproduct3=="VIM") Family="MEGAMOD"
     else if (Uproduct3=="VIN") Family="MEGAMOD"
     else if (Uproduct3=="VIP") Family="MEGAMOD"
     else if (Uproduct3=="VIQ") Family="MEGAMOD"
     else if (Uproduct3=="VIR") Family="MEGAMOD"
     else if (Uproduct4=="VILJ") Family="MEGAMOD"
     else if (Uproduct4=="VIPJ") Family="MEGAMOD"
     else if (Uproduct4=="VIRJ") Family="MEGAMOD"
     else if (Uproduct5=="MIAIM") Family="MIAIMS"
     else if (Uproduct5=="MIIAM" || Uproduct3=="MIA") Family="MIIAMS"
     else if (Uproduct5=="MIRAM") Family="MIRAMS"
	 else if (Uproduct5=="MI200") Family="MI200"
     else if (Uproduct3=="MI2") Family="MI200"
     else if (Uproduct3=="MIB") Family="MI200"
	 else if (Uproduct5=="MIJ00") Family="MIJ00"
     else if (Uproduct3=="MIJ") Family="MIJ00"
	 else if (Uproduct8=="MICOMPAC") Family="MICOMPAC"
     else if (Uproduct4=="MILC") Family="MICOMPAC"
     else if (Uproduct4=="MIMC") Family="MICOMPAC"
     else if (Uproduct4=="MINC") Family="MICOMPAC"
     else if (Uproduct4=="MIPC") Family="MICOMPAC"
     else if (Uproduct4=="MIQC") Family="MICOMPAC"
     else if (Uproduct4=="MIRC") Family="MICOMPAC"
	 else if (Uproduct9=="MIMEGAMOD") Family="MIMEGAMOD"
     else if (Uproduct3=="MIL") Family="MIMEGAMOD"
     else if (Uproduct3=="MIM") Family="MIMEGAMOD"
     else if (Uproduct3=="MIN") Family="MIMEGAMOD"
     else if (Uproduct3=="MIP") Family="MIMEGAMOD"
     else if (Uproduct3=="MIQ") Family="MIMEGAMOD"
     else if (Uproduct3=="MIR") Family="MIMEGAMOD"
     else if (Uproduct4=="MILJ") Family="MIMEGAMOD"
     else if (Uproduct4=="MIPJ") Family="MIMEGAMOD"
     else if (Uproduct4=="MIRJ") Family="MIMEGAMOD"
     else if (Uproduct6=="BADGER") Family="BADGER"
	 else if (Uproduct5=="QPO-1") Family="QPO-1"
	 else if (Uproduct4=="QPO1") Family="QPO-1"
	 else if (Uproduct3=="QPO") Family="QPO-1"
	 else if (Uproduct9=="POWERBANK") Family="POWERBANK"
	 else if (Uproduct10=="POWER BANK") Family="POWERBANK"
	 else if (Uproduct8=="PFC MINI") Family="LOPAC"
	 else if (Uproduct7=="PFCMINI") Family="LOPAC"
     else if (Uproduct2=="PM") Family="LOPAC"
	 else if (Uproduct5=="LOPAC") Family="LOPAC"
     else if (Uproduct8=="PFCMICRO") Family="LOPAC"
	 else if (Uproduct9=="PFCMICROS") Family="LOPAC"
	 else if (Uproduct9=="PFC MICRO") Family="LOPAC"
	 else if (Uproduct10=="PFC MICROS") Family="LOPAC"
	 else if (Uproduct6=="BUSMOD") Family="ACCESSORIES"
	 else if (Uproduct7=="BUSMODS") Family="ACCESSORIES"
     else if (Uproduct7=="BUS MOD") Family="ACCESSORIES"
	 else if (Uproduct8=="BUS MODS") Family="ACCESSORIES"
	 else if (Uproduct6=="FINMOD") Family="ACCESSORIES"
	 else if (Uproduct7=="FINMODS") Family="ACCESSORIES"
     else if (Uproduct7=="FIN MOD") Family="ACCESSORIES"
	 else if (Uproduct8=="FIN MODS") Family="ACCESSORIES"
	 else if (Uproduct7=="SLIMMOD") Family="ACCESSORIES"
	 else if (Uproduct8=="SLIMMODS") Family="ACCESSORIES"
	 else if (Uproduct8=="SLIM MOD") Family="ACCESSORIES"
	 else if (Uproduct9=="SLIM MODS") Family="ACCESSORIES"
	 else if (Uproduct8=="MEGA PAC") Family="MEGAPAC"
	 else if (Uproduct7=="MEGAPAC") Family="MEGAPAC"
     else if (Uproduct2=="MD") Family="MEGAPAC"
     else if (Uproduct2=="MP") Family="MEGAPAC"
     else if (Uproduct2=="MM") Family="MEGAPAC"
	 else if (Uproduct14=="2ND GENERATION") Family="2NDGEN"
	 else if (Uproduct13=="2NDGENERATION") Family="2NDGEN"
	 else if (Uproduct7=="2ND GEN") Family="2NDGEN"
	 else if (Uproduct6=="2NDGEN") Family="2NDGEN"
	 else if (Uproduct3=="V24") Family="2NDGEN"
     else if (Uproduct3=="V48") Family="2NDGEN"
     else if (Uproduct4=="V300") Family="2NDGEN"
     else if (Uproduct4=="V375") Family="2NDGEN"
     else if (Uproduct5=="IAM48") Family="IAM48"
	 else if (Uproduct4=="FM48") Family="FM48"
     else if (Uproduct2=="FM") Family="FM48"
     else if (Uproduct4=="FIAM") Family="FIAM"
     else if (Uproduct4=="FARM") Family="FARM"
     else if (Uproduct10=="POWERSTICK") Family="POWERSTICK"
	 else if (Uproduct11=="POWER STICK") Family="POWERSTICK"
	 else if (Uproduct5=="MFIAM") Family="MFIAM"
	 else if (Uproduct12=="CONVERTERPAC") Family="CONVERTERPAC"
     else if (Uproduct.substring(0,1)=="J") Family= "CONVERTERPAC"
     else if (Uproduct.substring(0,1)=="D") Family= "CONVERTERPAC"
     else if (Uproduct.substring(0,1)=="R") Family= "CONVERTERPAC"
     else if (Uproduct.substring(0,1)=="B") Family= "CONVERTERPAC"
     else if (Uproduct.substring(0,1)=="L") Family= "CONVERTERPAC"
     else if (Uproduct.substring(0,1)=="U") Family= "CONVERTERPAC"
     else if (Uproduct.substring(0,1)=="F") Family= "CONVERTERPAC"
     else if (Uproduct.substring(0,1)=="M" && Uproduct.indexOf("/") > -1 ) Family= "CONVERTERPAC"
     else if (Uproduct.substring(0,1)=="X") Family= "CONVERTERPAC"
	 else if (Uproduct8=="SURFMATE") Family="SURFMATE"
	 else if (Uproduct9=="SURF MATE") Family="SURFMATE"
	 else if (Uproduct8=="INMATE") Family="INMATE"
	 else if (Uproduct9=="IN MATE") Family="INMATE"
	 else if (Uproduct11=="ACCESSORIES") Family="ACCESSORIES"
	 else if (Uproduct3=="PAC") Family="ACCESSORIESPC"
     else if (Uproduct8=="PAC CHIP") Family="ACCESSORIESPC" 
	 else if (Uproduct10=="COMPONENTS") Family="ACCESSORIES"
     else if (Uproduct13=="INTERCONNECTS") Family="ACCESSORIES" 
	 else if (Uproduct12=="THERMAL MGMT") Family="ACCESSORIES" 
	 else if (Uproduct18=="THERMAL MANAGEMENT") Family="ACCESSORIES" 
	 else if (Uproduct16=="MOUNTING OPTIONS") Family="ACCESSORIESMO"
	 else if (Uproduct17=="PACKAGING OPTIONS") Family="ACCESSORIESOP"
	 else if (Uproduct3=="IAM") Family="IAMS"
	 else if (Uproduct.substring(0,1)=="0") Family="ACCESSORIES"
     else if (Uproduct.substring(0,1)=="1") Family="ACCESSORIES"
     else if (Uproduct.substring(0,1)=="2") Family="ACCESSORIES"
     else if (Uproduct.substring(0,1)=="3") Family="ACCESSORIES"
     else if (Uproduct.substring(0,2)=="88") Family="ACCESSORIES"
     else if (Uproduct.substring(0,3)=="HUB") Family="ACCESSORIES"
     else Family="INVALID";

  //    alert('Family = ' + Family);
        return Family;
}

function cleanString(StringVal)
// strips out all hyphens from the part number to allow easier parsing logic
{
   NewVal = " "

   for (var i = 0;i < StringVal.length; i++)
   {
     if (StringVal.substring(i,i+1) != "-") NewVal = NewVal + StringVal.substring(i,i+1);
   }

   NewVal= NewVal.substring(1,NewVal.length);
   return NewVal;
}

//-->

