/*****************************************************************************************
Function SHOWMODEL takes input from either the text box into which a user enters a model 
number, or an incoming parameter.  Let's look at each of these two possibilities.  

If the CatalogIndex page loads normally, someone may enter a model number into the "Find 
Model" text box, and then push the button.  When this happens, ShowModel is called with a 
pass parameter of zero (0), indicating that ShowModel has to grab the contents of the
text box and use it as the value for ModelVal.  However, if we navigate to the CatalogIndex
page using a query of this form: brunson.us/p/CatalogIndex.asp?Model=xxx, then ShowModel
is called using the pass parameter (xxx), and ShowModel does not load the contents of the
form's text box.

Then, ShowModel determines which catalog page should be displayed.  If there is no appropriate 
catalog page available, it displays a dialog box indicating this.

As described above, ModelVal holds the model number in question, gleaned either from the text 
box or sent as a pass parameter in the call to ShowModel(xxx).  It is immediately converted to 
all upper case.

Var ViewPage is a boolean which indicates that a page will be displayed.  It is initially
set to "true", but is reset to "false" if no page is found.

Var CustomPage is a string which can hold a specific page address if needed.  For example, 
if a code word, such as "xxxx" is entered into the text box, the program can be made to take 
you to a specific named page, not simply direct you to "XXXX.asp".

There is also initially a test for certain special part numbers, which have many multiple 
variations.  For example, this program does not look for all of the variations in the HRT90
targets, such as HRT90-2500-250-250.  In this case, if someone entered that entire part
number, the program would simply parse out the first 4 characters in the string and 
reassign ModelVal to "HRT90".  This is a function which is used only in specific cases,
where one page contains several part number variations.

The variable "Status" will hold text "Valid", "Discontinued" or "Replaced".  If "Replaced", 
another variable "Replacment" will be loaded with the replacement model number and the 
browser will be redirected to that page.
*/

function ShowModel(Incoming)

{
var ViewPage=true;
var CustomPage="null";
var Status="Valid";

/*  
Check to see if the pass parameter was zero (0).  If so, we know that the call
came from a push of the "Find Model" button, and we set ModelVal to the contents of
the text box in the form on the CatalogIndex page.  But if it's not zero, we know
that the model number was actually passed to ShowModel, and we set ModelVal to the
incoming number.  																*/

if (Incoming == 0)
  ModelVal=document.FrmGetModel.TxtInputModel.value;
else
{
  ModelVal=Incoming;
}


/* 	          SPECIAL PART NUMBER TEST SECTION
Here we test for specific part numbers and make special assignment
of catalog pages.  There are a couple of things going on in this 
section, but basically we are catching multiple variations on the 
same part number and sending them to the correct page.  I.e., if the 
entry is 5TH-3125, 5TH-2500, or 5TH-3750, etc. - they all get sent 
to the 5TH page.  However in the process, we have to allow for the 
fact that a lot of the part numbers start with the same characters.
That is, for example, we can't just look at the first 3 characters
and send everything that starts with 5TH to the 5TH page.  We have
to watch for all of the other variations such as 5THE and 5THE-M, etc.
Therefore, each of the case statements below has a number of IF
statements underneath that does further testing to determine the
product page that is actually being requested.  Note that we also make
this section somewhat forgiving with regard to the hypens.  If someone
enters "1.5THM", we redirect to page "1.5TH-M".  Of course, we also
catch an entry of "1.5TH-M" as well.  The only thing to watch out for is
if the engineers actually give two distinctly different products the 
same model number, differing only by the hyphen, i.e., something 
like "X-YY" and "XYY".
	
CAUTION WHEN DOING THIS: 
When adding additional exceptions to the CASE statements below 
(using IF statements), be SURE to put the IF statements in ascending 
order of number of characters, i.e., PNShort_3, then PNShort_4, then 
PNShort_5, etc.  This will avoid mistakes.  For example, of the 
incoming entry is "5THMF", you must have the IF statement which 
redirects to "5THMF" AFTER the IF statement for "5THM".  Then, if you
have only IF statements, you must put the first ModelVal assignment
PRIOR to all of the IF statements, e.g., "ModelVal=PNShort_2;" must
be the first statement before the IF statements, otherwise ModelVal 
will be the last assignment, always set to, in this example, PNShort_2.

*/

ModelVal=ModelVal.toUpperCase();			//Convert everything to upper case


//-------->  TEST FOR PERIOD AT START OF PART NUMBER
/* This quick test removes any period that is at the start of any 
** ModelVal that is entered by the user.  Some of the part numbers
** (e.g., for target holders) start with a period, i.e. ".5THDN"
** or ".875THS", so we want to remove that period from the start
** of ModelVal.  After that, we drive on like everything was normal,
** minding our own business.
*/

if (ModelVal.substring(0,1) == ".")			//If the first character of ModelVal is a ".", then reset ModelVal so that
  	ModelVal=ModelVal.substr(1);			//new ModelVal equals old ModelVal, but ignoring the first character.
  											//'substr' method returns everything in string starting at indexed character, in this case, "1".
if (ModelVal.substring(0,2) == "0.") 		//VERY FIRST THING - we remove "0." at first of an entry.  This allows 
 	ModelVal = ModelVal.substr(2);			//people to put either "0.5xxx", or just "5xxx", for example.


var PNShort_1=ModelVal.substring(0,1);
var PNShort_2=ModelVal.substring(0,2);
var PNShort_3=ModelVal.substring(0,3);
var PNShort_4=ModelVal.substring(0,4);
var PNShort_5=ModelVal.substring(0,5);
var PNShort_6=ModelVal.substring(0,6);
var PNShort_7=ModelVal.substring(0,7);
var PNShort_8=ModelVal.substring(0,8);
var PNShort_9=ModelVal.substring(0,9);


switch(PNShort_2)
{  	
  case "TB":
  	ModelVal="TB";										//Set ModelVal to TB
  	if (PNShort_3 == "TBA") ModelVal="TBA";				//unless the entry was TBA
  	if (PNShort_3 == "TBP") ModelVal="TBP";				//or unless the entry was TBP
  	break;
  	
  	
  case "BP":
  	ModelVal="BP";
  	break;
}

switch(PNShort_3)
{
  case "5RH":
    ModelVal="0.5RH";
    break;
    
  case "5TH":
  	ModelVal="0.5TH";									

    if (PNShort_4 == "5THE") ModelVal="0.5THE";
  	if (PNShort_4 == "5THV") ModelVal="0.5THV";
	if (PNShort_4 == "5THM") ModelVal="0.5TH-M";
	if (PNShort_4 == "5THS") ModelVal="0.5THS"; 

    if (PNShort_5 == "5THDN") ModelVal="0.5THDN";
    if (PNShort_5 == "5THEM") ModelVal="0.5THE-M";
  	if (PNShort_5 == "5THMF") ModelVal="0.5THMF";
	if (PNShort_5 == "5TH-M") ModelVal="0.5TH-M";
    
    if (PNShort_6 == "5THDNT") ModelVal="0.5THDN-T";
  	if (PNShort_6 == "5THE-M") ModelVal="0.5THE-M";

    if (PNShort_7 == "5THDN-T") ModelVal="0.5THDN-T";
    
    break;
    
    
  case "232":
	ModelVal=PNShort_3;  
	
	if (PNShort_5 == "232SP") ModelVal="232-SP";
	
	if (PNShort_6 == "232-SP") ModelVal="232-SP";
	break;
	
	
  case "234":
	ModelVal=PNShort_3;
	
	if (PNShort_5=="234CF") ModelVal="234CF";
	break;
	
	
  case "330":
    ModelVal="330";
    break;
    
    
  case "331":
    ModelVal="331";
    break;
    
    
  case "333":
    ModelVal="333";
    break;
    
    
  case "395":
	ModelVal="395";
	break;
	
	
  case "406":
	ModelVal="406";
	break;  
	
	
  case "705":
    ModelVal="705";
    break;
    
    
  case "707":
    ModelVal="707";
    break;
    
    
  case "708":
    ModelVal="708";
    break;
    
    
  case "717":
  	ModelVal="717";
  	
  	if (PNShort_4 == "717B") ModelVal="717-B";
  	
	if (PNShort_5 == "717-B") ModelVal="717-B";
	break;
	
	
  case "719":
	ModelVal="719";
	break;
	
	
  case "BXT":
  	ModelVal="BXT";
  	break;
  	
  	
  case "MAS":
	ModelVal="MGS";
	break;
	
	
  case "MGS":
	ModelVal="MGS";
	break;
	
	
  case "SMR":
    ModelVal="SMR";
    break;
    
    
  case "THB":
    ModelVal=PNShort_3;
    break;
    
}


switch(PNShort_4)
{
  case "5INV":
  	ModelVal="0.5INV";
  	break;
 

  case "5SMR":
    ModelVal="SMR";
    break;
     	
  	
  case "400L":
  	ModelVal="400L-T";
  	break;
  	
  	
  case "400S":
    ModelVal="400S-D";
    break;  	
    
}

switch(PNShort_5)
{
  case "1.5TH":   
  	ModelVal="1.5TH";
  	
  	if (PNShort_6 == "1.5THE") ModelVal="1.5THE";
  	if (PNShort_6 == "1.5THF") ModelVal="1.5THF";
  	if (PNShort_6 == "1.5THM") ModelVal="1.5TH-M";
  	if (PNShort_6 == "1.5THR") ModelVal="1.5THR";
  	if (PNShort_6 == "1.5THS") ModelVal="1.5THS";
  	if (PNShort_6 == "1.5THT") ModelVal="1.5THT";
  		
  	if (PNShort_7 == "1.5TH-M") ModelVal="1.5TH-M";
  	if (PNShort_7 == "1.5THCP") ModelVal="1.5THCP";
  	if (PNShort_7 == "1.5THDN") ModelVal="1.5THDN";
  	if (PNShort_7 == "1.5THLE") ModelVal="1.5THLE";
  	if (PNShort_7 == "1.5THMF") ModelVal="1.5THMF";
  	if (PNShort_7 == "1.5THSB") ModelVal="1.5THSB";
  	
  	if (PNShort_8 == "1.5THEDN") ModelVal="1.5THEDN";
	if (PNShort_8 == "1.5THNDN") ModelVal="1.5THNDN";
  	if (PNShort_8 == "1.5THRTL") ModelVal="1.5THR";
  	
  	if (PNShort_9 == "1.5THR-TL") ModelVal="1.5THR";
	break;
	
  case "875TH":
    ModelVal="0.875TH";
    
    if (PNShort_6 == "875THS") ModelVal="0.875THS";
    break;
    
	
  case "230-F":
  	ModelVal="230-F";
  	break;
  	
  	
  case "875TH":
    ModelVal="0.875TH";
    
    if (PNShort_6 == "875THS") ModelVal="0.875THS";
    break;
    
    
  case "12409":
    ModelVal="12409";
    break;
    
    
  case "12587":
	ModelVal="12587";
	break;
}


switch(PNShort_6)
{
  case "1.5LTE":
    ModelVal="1.5LTE";
	break;
	

  case "1.5INV":
    ModelVal="1.5INV";
    break;
    

  case "1.5SMR":
    ModelVal="SMR";
    break;


  case "875SMR":
  	ModelVal="SMR";
  	break;
  	
    
  case "SRT-HT":
    ModelVal="SRT-HT";
    break;


  case "SRT-PS":
    ModelVal="SRT-PS";
    break;
}


switch(PNShort_7)
{
 case "SRT-VAC":
   ModelVal="SRT-VAC";
   break;


 case "SRT-VAE":
   ModelVal="SRT-VAE";
   break;


 case "SRT-VAN":
   ModelVal="SRT-VAN";
   break;


 case "SRT-VAS":
   ModelVal="SRT-VAS";
   break;


 case "SRT-3MO":
   ModelVal="SRT-3MO";
   break;  
}


//***************************************************************
//***************************************************************
// ------->   END SPECIAL PART NUMBER TEST SECTION
//***************************************************************
//***************************************************************


switch(ModelVal)

 { 
 case "1.5ADP-.5": break;
 case "1.5ADP-.875": break;
 case "1.5ADPRPR":
 	ModelVal="1.5ADP-RPR";
 	break;
 case "1.5ADP-RPR": break; 	
 case "1.5THF": break;
 case "1.5THE": break;
 case "1.5THLE": break;
 case "1.5INV": break;
 case "1.5LRB": break;
 case "1.5-LRB":
    ModelVal="1.5LRB";
    break;
 case "1.5LTE": break;    
 case "1.5THR": break;
 case "1.5THRTL":
    ModelVal="1.5THR";
    break; 
 case "1.5THR-TL":
    ModelVal="1.5THR";
    break;
 case "1.5THMF": break;
 case "1.5TH": break;
 case "1.5THCP": break;
 case "1.5THDN": break;
 case "1.5THEDN": break;
 case "1.5THNDN": break;
 case "1.5THSB": break;
 case "1.5LK-F": break;
 case "1.5LKF":
 	ModelVal="1.5LK-F"
 	break;
 case "1.5LK-P": break;
 case "1.5LKP":
 	ModelVal="1.5LK-P";
 	break;
 case "1.5THS": break;
 case "1.5THT": break;
 case "0.5INV": break;
 case "0.5RH": break;
 case "0.5TH": break;
 case "0.5THDN": break;
 case "0.5THDN-T": break;
 case "0.5THE": break;
 case "0.5THE-M": break;
 case "0.5THMF": break;
 case "0.5TH-M": break;
 case "0.5THS": break;
 case "0.5THV": break;
 case "18-0001":
 	ModelVal="18-0001";
 	break;
 case "75-H": break;
 case "75":
	ModelVal="75-H";
	break;
 case "76-RH": break;
 case "76":
	ModelVal="76-RH";
	break;
 case "76-RH190":
	ModelVal="76-RH";
	break;
 case "81":
 	Status="Replaced";
 	Replacement="2062";
    break;
 case "81-1": 
	var Msg="The 81-1 has been replaced by the 2062";
	Msg+="\n used in conjunction with a 1241.  Your";
 	Msg+="\n browser will be redirected to that page.";
 	alert(Msg);
    ModelVal="2062";
   break;
 case "82": 
 	Status="Replaced";
 	Replacement="C47280";
   break;
 case "83": 
 	Status="Replaced";
 	Replacement="2022";
   break;
 case "83-M":
 	Status="Replaced";
 	Replacement="2024";
   break;
 case "83-1": 
	var Msg="The 83-1 has been replaced by the 2022";
	Msg+="\n used in conjunction with a 2240.";
 	Msg+="\n Your browser will be redirected to that page.";
 	alert(Msg);
    ModelVal="2022";
   break;
 case "88-6": break;
 case "89": break;
 case "160": break;
 case "160-A":
	ModelVal="160-A";
	break;
 case "160A":
	ModelVal="160-A";
	break;
 case "160M":
	ModelVal="160";
	break;
 case "160-M":
	ModelVal="160";
	break;
 case "160M-A":
	ModelVal="160-A";
	break;
 case "160MA":
	ModelVal="160-A";
	break;
 case "185":
 	Status="Replaced";
 	Replacement="6202";
    break;
 case "185-10": break;
 case "186": break;
 case "187": break;
 case "187-S": break;
 case "188": break;
 case "190": break;
 case "190-20":
	ModelVal="190";
	break;
 case "190-50":
	ModelVal="190";
	break;
 case "190-M":
	ModelVal="190";
	break;
 case "190-W":
    alert('The 190-W has been replaced by the 190-WG. \n Your browser will be redirected to that page.')
    ModelVal="190";
    break;
 case "190-WG":
	ModelVal="190";
	break;
 case "190A":
     Status="Discontinued";
    break;
 case "190A-1":
    Status="Discontinued";
    break;
 case "190A-2":
    Status="Discontinued";
    break;
 case "190A-3":
    Status="Discontinued";
    break;
 case "190A-4":
    Status="Discontinued";
    break;
 case "190A-5":
    Status="Discontinued";
    break;
 case "191":
 	Status="Replaced";
 	Replacement="196-1";
    break;
 case "192":
 	Status="Replaced";
 	Replacement="196-1";
    break;
 case "193":
 	Status="Replaced";
 	Replacement="193-L";
    break;
 case "193-L": break;
 case "194-TM": break;
 case "196-1": break;
 case "198":
 	Status="Replaced";
 	Replacement="198-1";
    break;
 case "198-1": break;
 case "230": break;
 case "230STK":
	ModelVal="230";
	break;
 case "230-0":
	ModelVal="230";
	break;
 case "230-2":
	ModelVal="230";
	break;
 case "230-R":
	ModelVal="230";
	break;
 case "230-F": break;
 case "230-HO":
	ModelVal="230";
	break;
 case "230-H":
	ModelVal="230";
	break;
 case "230-HC":
	ModelVal="230";
	break;
 case "230-HR":
	ModelVal="230";
	break;
 case "230STK-H":
	ModelVal="230";
	break;
 case "231": break;
 case "231STK":
	ModelVal="231";
	break;
 case "231-0":
	ModelVal="231";
	break;
 case "231-2":
	ModelVal="231";
	break;
 case "231-R":
	ModelVal="231";
	break;
 case "231STK-H":
	ModelVal="231";
	break;
 case "231-HO":
	ModelVal="231";
	break;
 case "231-H":
	ModelVal="231";
	break;
 case "231-HC":
	ModelVal="231";
	break;
 case "231-HR":
	ModelVal="231";
	break;
 case "231-MOD":
	ModelVal="231";
	break;
 case "232": break;
 case "232-SP": break;
 case "233": break;
 case "233STK":
	ModelVal="233";
	break;
 case "233-0":
	ModelVal="233";
	break;
 case "233-2":
	ModelVal="233";
	break;
 case "233-R":
	ModelVal="233";
	break;
 case "233STK-H":
	ModelVal="233";
	break;
 case "233-HO":
	ModelVal="233";
	break;
 case "233-H":
	ModelVal="233";
	break;
 case "233-HC":
	ModelVal="233";
	break;
 case "233-HR":
	ModelVal="233";
	break;
 case "234":  break;
 case "234CF": break;
 case "235-0":  
  	Status="Replaced";
 	Replacement="802";
    break;
 case "235-3":  break;
 case "235-5":  break;
 case "235-6":  break;
 case "235-7":
    Status="Discontinued";
    break;
 case "235-10":
    Status="Discontinued";
    break;
 case "235-12":  break;
 case "235-14":
    Status="Discontinued";
    break;
 case "235-16":  break;
 case "235-17":  break;
 case "235-18":  break;
 case "235-19":
 	Status="Replaced";
 	Replacement="235-20";
    break;
 case "235-20":  break;
 case "235-H": 
 	var Msg="The 235-H has been replaced by the 802";
	Msg+="\n used in conjunction with a 235-17.  Your";	
 	Msg+="\n browser will be redirected to the 802.";
 	alert(Msg);
    ModelVal="802";
break;
 case "237": break;
 case "239": break;
 case "239STK":
	ModelVal="239";
	break;
 case "239-0":
	ModelVal="239";
	break;
 case "239-2":
	ModelVal="239";
	break;
 case "271": break;
 case "272":
	ModelVal="272-15";
	break;
 case "272-15": break;
 case "272-MC":
	ModelVal="272-15";
	break;
 case "273": break;
 case "273-2":
 	var Msg="The 273-2 has been discontinued, but the";
	Msg+="\n 273-4 is a similar product.  Your";	
 	Msg+="\n browser will be redirected to that page.";
 	alert(Msg);
    ModelVal="273";
    break;
 case "273-3":
 	var Msg="The 273-3 has been discontinued, but the";
	Msg+="\n 273-4 is a similar product.  Your";	
 	Msg+="\n browser will be redirected to that page.";
 	alert(Msg);
    ModelVal="273";
    break;
 case "273-4":
	ModelVal="273";
	break;
 case "273-5":
 	var Msg="The 273-5 has been discontinued, but the";
	Msg+="\n 273-4 is a similar product.  Your";	
 	Msg+="\n browser will be redirected to that page.";
 	alert(Msg);
    ModelVal="273";
    break;
 case "284-1":
    Status="Discontinued";
    break;
 case "284-2":
    Status="Discontinued";
    break;
 case "284-3":
    Status="Discontinued";
    break;
 case "284-4":
    Status="Discontinued";
    break;
 case "284-5":
    Status="Discontinued";
    break;
 case "284-M": break;
 case "290": break;
 case "330": break;
 case "331": break;
 case "333": break;
 case "381": break;
 case "381-1":
   	ModelVal="381";
	break;
 case "381-S":
	ModelVal="381";
	break;
 case "390": break;
 case "395": break;
 case "400L-T": break;
 case "400S-D": break;
 case "406":
    ModelVal="406-6";
    break;
 case "470":
 	ModelVal="470NA";
 	break;
 case "470NA": break;
 case "500":
  	Status="Replaced";
 	Replacement="509";
    break;
 case "501":
  	Status="Replaced";
 	Replacement="509";
    break;
 case "502":
  	Status="Replaced";
 	Replacement="509";
    break;
 case "504":
   	Status="Replaced";
 	Replacement="509";
    break;
 case "504-R":
  	Status="Replaced";
 	Replacement="509";
    break;
 case "505":
  	Status="Replaced";
 	Replacement="509";
    break;
 case "505-110":
  	Status="Replaced";
 	Replacement="509";
    break;
 case "505-220":
  	Status="Replaced";
 	Replacement="509";f
    break;
 case "508":
  	Status="Replaced";
 	Replacement="509";
    break;
 case "509": break;    
 case "521":
	ModelVal="521-B";
	break;
 case "521-B": break;
 case "545": 
	ModelVal="545-1";
	break;
 case "545-1":  break;
 case "545-190":
	ModelVal="545-1";
	break;
 case "560":
	ModelVal="560-2";
	break;
 case "560-2": break;
 case "562":
	ModelVal="562-A";
	break;
 case "562-A": break;
 case "562-VA": break;
 case "562-VA-120":
 	ModelVal="562-VA";
	break;
 case "562-VA-160":
 	ModelVal="562-VA";
	break;
 case "562-41": break;
 case "563": break;
 case "563-40": 
    ModelVal="563";
    break;
 case "564":
	ModelVal="564W";
	break;
 case "564W": break;
 case "564W-3":
    alert('The 564W-3 has been replaced by the 6003. \n Your browser will be redirected to that page.')
    ModelVal="564W";
	break;
 case "564W-5": 
	ModelVal="564W";
	break;
 case "564W-10": 
    alert('The 564W-10 has been replaced by the 6010. \n Your browser will be redirected to that page.')
	ModelVal="564W";
	break;
 case "564W-20": 
    alert('The 564W-20 has been replaced by the 6020. \n Your browser will be redirected to that page.') 
	ModelVal="564W";
	break;
 case "564W-40":
    alert('The 564W-40 has been replaced by the 6040. \n Your browser will be redirected to that page.') 
	ModelVal="564W";
	break;
 case "564W-80":
	ModelVal="564W-Metric";
	break;
 case "564W-130":
	ModelVal="564W-Metric";
	break;
 case "564W-250":
	ModelVal="564W-Metric";
	break;
 case "564W-500":
	ModelVal="564W-Metric";
	break;
 case "564W-CE": break;
 case "564W-CM": 
	ModelVal="564W-CE";
	break;
 case "565": break;
 case "705": break;
 case "706":
    ModelVal="706-1W";
    break;
 case "706-1":
 	Status="Replaced";
 	Replacement="706-1W";
    break;
 case "706-1W": break;
 case "707": break;
 case "708": break;
 case "709": 
	ModelVal="705";
	break;
 case "710": break;
 case "711": break;
 case "714": 
	ModelVal="711";
	break;
 case "717": break;
 case "717-B": break;
 case "719":
 	Status="Replaced";
 	Replacement="717";
    break;
 case "720": break;
 case "720-2": break;
 case "721": break;
 case "721-C": break;
 case "737-2":
 	Status="Replaced";
 	Replacement="18-0001";
    break;
 case "740-A": break;
 case "740-AK":
   ModelVal="740-A";
   break;
 case "744-4":
    Status="Discontinued";
    break;
 case "771":
 	Status="Replaced";
 	Replacement="76-RH";
    break;
 case "771-H":
 	Status="Replaced";
 	Replacement="76-RH";
    break;
 case "795": break;
 case "800": break;
 case "800-MOD": break;
 case "801-1": break;
 case "802":	break;
 case "802-3":
 	ModelVal="802";
	break;
 case "803": break;
 case "803-1": break;
 case "803-2":
 	ModelVal="803-1";
 	break;
 case "803-3":
 	ModelVal="803-1";
 	break;
 case "803-C": 
 	ModelVal="803";
 	break;
 case "803-CL": break;
 case "803-CP": break;
 case "803-E": break;
 case "803-M": break;
 case "803-MC":
	ModelVal="803-M";
	break;
 case "803-MCL": break;
 case "803-MCP": break;
 case "803-T": break;
 case "810":	break;
 case "0.875TH": break;
 case "0.875THS": break;
 case "1010":
  	Status="Replaced";
  	Replacement="76-RH";
    break;
 case "1012":
  	Status="Replaced";
  	Replacement="76-RH";
    break;
 case "1013":
 	Status="Replaced";
 	Replacement="76-RH";
    break;
 case "1014":
 	Status="Replaced";
 	Replacement="76-RH";
    break;
 case "1026":
 	Status="Replaced";
 	Replacement="76-RH";
    break;
 case "1111":
    Status="Discontinued";
    break;
 case "1112":
	var Msg="The 1112 has been replaced by the 160";
	Msg+="\n used in conjunction with a 15206.  We";
	Msg+="\n call this combination 160-A.  Your";	
 	Msg+="\n browser will be redirected to that page.";
 	alert(Msg);
    ModelVal="160-A";
    break;
 case "1113":
    Status="Discontinued";
	break;
 case "1211":
  	Status="Replaced";
 	Replacement="509";
    break;
 case "1231":
  	Status="Replaced";
 	Replacement="1241";
 	break;
 case "1241": break;
 case "1260": break;
 case "2022": break;
 case "2023":
 	Status="Replaced";
 	Replacement="C47280";
    break;
 case "2024": break;
 case "2024BL": break;
 case "2024-BL":
    ModelVal="2024BL";
    break;
 case "2030": break;
 case "2062": break;
 case "2062-NAR":
    ModelVal="2062";
    break;
 case "2230":
  	Status="Replaced";
 	Replacement="2240";
    break;
 case "2240": break;
 case "2240-02":
	ModelVal="2240";
	break;
 case "2302": break;
 case "3010":
 	Status="Replaced";
 	Replacement="545-1";
    break;
 case "3012":
 	Status="Replaced";
 	Replacement="545-1";
    break;
 case "3205": break;
 case "3220":
 	Status="Replaced";
 	Replacement="187-S";
    break;
 case "3230":
 	Status="Replaced";
 	Replacement="187-S";
    break;
 case "3250":
     Status="Discontinued";
     break;
 case "3260": 
     Status="Discontinued";
     break;
 case "3280": break;
 case "4010":
 	Status="Replaced";
 	Replacement="271";
    break;
 case "4030":
 	Status="Replaced";
 	Replacement="272-15";
    break;
 case "4111":
     Status="Discontinued";
     break;
 case "5016":
    alert('The 5016 has been replaced by the 231-HR. \n Your browser will be redirected to that page.')
    ModelVal="231";
    break;
 case "5025": 
    alert('The 5025 has been replaced by the 230-HR. \n Your browser will be redirected to that page.')
    ModelVal="230";
    break;
 case "5030": break;
 case "5035": break;
 case "5037":
   ModelVal="5030";
   break;
 case "5048": 
   alert('The 5048 has been replaced by the 234-5. \n Your browser will be redirected to that page.')
   ModelVal="234";
   break;
 case "5050": 
   alert('The 5050 has been replaced by the 234-10. \n Your browser will be redirected to that page.')
   ModelVal="234";
   break;
 case "5052": 
   alert('The 5052 has been replaced by the 234-20. \n Your browser will be redirected to that page.')
   ModelVal="234";
   break;
 case "5060":
   Status="Replaced"; 
   Replacement="800-MOD";
   break;
 case "5070":
  	Status="Replaced";
 	Replacement="198-1";
    break;
 case "5085":
 	var Msg="The 5085 has been replaced by the 802";
	Msg+="\n used in conjunction with a 235-17.";
 	Msg+="\n Your browser will be redirected to the 802.";
 	alert(Msg);
    ModelVal="802";
    break;
 case "5086":
    Status="Discontinued";
    break;
 case "5087":
 	var Msg="The 5087 has been replaced by the 802-3";
	Msg+="\n used in conjunction with a 235-17.";
 	Msg+="\n Your browser will be redirected to the 802-3.";
 	alert(Msg);
    ModelVal="802";
	break;
 case "5100":
 	Status="Replaced";
 	Replacement="521-B";
   break;
 case "5101":
   Status="Discontinued";
   break;
 case "5102":
   Status="Discontinued";
   break;
 case "5103":
   Status="Replaced";
   Replacement="521-B";
   break;
 case "5142":
   Status="Replaced";
   Replacement="565";
   break;
 case "5144": break;
 case "5146": break;
 case "5150": break;
 case "5160": break;
 case "5170": break;
 case "5175": break;
 case "5180":
 	var Msg="The 5180 has been replaced by the 5170";
	Msg+="\n used in conjunction with a 560-2 and a 565.";
 	Msg+="\n Your browser will be redirected to the 5170.";
 	alert(Msg);
    ModelVal="5170";
	break;
 case "5182":
 	var Msg="The 5182 has been discontinued.  A possible";
	Msg+="\n replacement is the 5192.  Your browser";
 	Msg+="\n will be redirected to that page.";
 	alert(Msg);
    ModelVal="5192";
    break;
 case "5191": break;
 case "5192": break;
 case "5201": break;
 case "5511":
  	Status="Replaced";
 	Replacement="509";
    break;
 case "5514":
  	Status="Replaced";
 	Replacement="509";
    break;
 case "5514-1": 
  	Status="Replaced";
 	Replacement="509";
    break;
 case "5514-2": 
  	Status="Replaced";
 	Replacement="509";
    break;
 case "5520": break;
 case "6003":
	ModelVal="564W";
	break;
 case "6003M": 
    alert('The 6003M has been replaced by the 564W-80. \n Your browser will be redirected to that page.')
    ModelVal="564W-Metric";
    break;
 case "6010":
	ModelVal="564W";
	break;
 case "6020":
	ModelVal="564W";
	break;
 case "6020M": 
    alert('The 6020M has been replaced by the 564W-250. \n Your browser will be redirected to that page.')
    ModelVal="564W-Metric";
    break;
 case "6040":
	ModelVal="564W";
	break;
 case "6040M":
	ModelVal="564W-Metric";
	break;
 case "6041": 
    alert('The 6041 has been replaced by the 564W-130. \n Your browser will be redirected to that page.')
    ModelVal="564W-Metric";
    break;
 case "6061":
	ModelVal="564W";
	break;
 case "6110": break;
 case "6120": break;
 case "6125": break;
 case "6130": break;
 case "6150": break;
 case "6160":
    Status="Replaced";
    Replacement="705";
    break;
 case "6163":
    Status="Replaced";
    Replacement="705";
    break;
 case "6165": break;
 case "6166": break;
 case "6168":
    Status="Replaced";
    Replacement="795";
    break;
 case "6170":
    Status="Replaced";
    Replacement="395";
    break;
 case "6175":
    Status="Replaced";
    Replacement="395";
    break;
 case "6202": break;
 case "6204": break;
 case "6250": break;
 case "7020": 
 	Status="Replaced";
 	Replacement="290";
    break;
 case "7101": break;
 case "8415":
    ModelVal="8415SY";
    break;
 case "8415SY": break;
 case "8665-G1": 
	ModelVal="PN8665-G1"
	break;
 case "8665-G2":
	ModelVal="PN8665-G1";
	break;
 case "8665-G3":
	ModelVal="PN8665-G3";
	break;
 case "8665-G4":
	ModelVal="PN8665-G3";
	break;
 case "8678":
    ModelVal="PN8678";
    break;
 case "8678-G1":
    ModelVal="PN8678";
    break;
 case "9026":
    Status="Replaced";
    Replacement="235-5";
   break;
 case "12406":
	ModelVal="PN12406-G1";
	break;
 case "12406-G1":
	ModelVal="PN12406-G1";
	break;
 case "12409":
	ModelVal="PN12409";
	break;
 case "12410-G1":
 	ModelVal="PN12410-G1";
 	break;
 case "12410-G2":
 	ModelVal="PN12410-G2";
 	break;
 case "12410-G3":
 	ModelVal="PN12410-G2";
 	break;
 case "12410-G4":
 	ModelVal="PN12410-G1";
 	break;
 case "12587":
	ModelVal="PN12409";
	break;
 case "14158":
    ModelVal="PN14159";
    break;	
 case "14159":
	ModelVal="PN14159";
	break;
 case "15084":
    ModelVal="PN15084";
    break;
 case "15079":
    ModelVal="PN15079";
    break;
 case "15199": 
    ModelVal="PN15199";
    break;
 case "15206":
    ModelVal="PN15206";
    break;
 case "B46632": break;
 case "BP": break;
 case "BXT": break;
 case "C47280": break;
 case "C47280-NAR":
    ModelVal="C47280"
    break;
 case "LRB":
    ModelVal="1.5LRB";
    break;
 case "LT":
    ModelVal="LTTARGETKIT";
    break;
 case "LTE":
    ModelVal="1.5LTE";
    break;
 case "LT TARGET KIT":
    ModelVal="LTTARGETKIT";
    break;
 case "LTTARGETKIT": break;
 case "LT TARGET KIT METRIC":
    ModelVal="LTTARGETKITMET";
    break;
 case "LTTARGETKITMETRIC":
    ModelVal="LTTARGETKITMET";
    break;
 case "MGS": break;
 case "MVTB": break;
 case "SMR": break;
 case "SRT-3MO": break;
 	case "3MO":
 	  ModelVal="SRT-3MO";
 	  break;
 case "SRT-HT": break;
 	case "HT":
 	  ModelVal="SRT-HT";
 	  break;
 case "SRT-PS": break;
 	case "PS":
 	  ModelVal="SRT-PS";
 	  break;
 case "SRT-VAC": break;
 	case "VAC":
 	  ModelVal="SRT-VAC";
 	  break;
 case "SRT-VAE": break;
 	case "VAE":
 	  ModelVal="SRT-VAE";
 	  break;
 case "SRT-VAN": break;
 	case "VAN":
 	  ModelVal="SRT-VAN";
 	  break;
 case "SRT-VAS": break;
	 case "VAS": 
	   ModelVal="SRT-VAS";
	   break;
 case "TB": break;
 case "TBA": break;	   
 case "TETRA":
 	ModelVal="400S-D";
 	break;
 case "TETRALOCK":
 	ModelVal="400S-D";
 	break;
 case "TETRA LOCK":
 	ModelVal="400S-D";
 	break;
 case "TETRALOCK LIGHT":
 	ModelVal="400L-T";
 	break;
 case "TETRALOCK LITE":
 	ModelVal="400L-T";
 	break;
 case "TETRA LOCK LITE":
 	ModelVal="400L-T";
 	break;
 case "THB": break;
 case "THMF": break;
 
 	
// case "HRT90":
//	ModelVal="PN_HRT90";
//	break;
	
// Special section for checking NSN numbers.  Each NSN number has 6 brute-force variations.
 case "NSN 4290-P71-6110":
   ModelVal="6110";
   break;
 case "4290-P71-6110":
   ModelVal="6110";
   break;
 case "4290P716110":
   ModelVal="6110";
   break;
 case "NSN 4290P716110":
   ModelVal="6110";
   break;
 case "NSN4290P716110":
   ModelVal="6110";
   break;
 case "NSN4290-P71-6110":
   ModelVal="6110";
   break;
   
 case "NSN 4920-00-509-5592":
   ModelVal="6120";
   break;
 case "4920-00-509-5592":
   ModelVal="6120";
   break;
 case "4920005095592":
   ModelVal="6120";
   break;
 case "NSN 4920005095592":
   ModelVal="6120";
   break;
 case "NSN4920005095592":
   ModelVal="6120";
   break;
 case "NSN4920-00-509-5592":
   ModelVal="6120";
   break;

 case "NSN-6650-01-197-0587":
   ModelVal="6250";
   break;
 case "6650-01-197-0587":
   ModelVal="6250";
   break;
 case "6650011970587":
   ModelVal="6250";
   break;
 case "NSN 6650011970587":
   ModelVal="6250";
   break;
 case "NSN6650011970587":
   ModelVal="6250";
   break;
 case "NSN6650-01-197-0587":
   ModelVal="6250";
   break;
   
 case "NSN 6650-01-542-7154RN":
   ModelVal="160-A";
   break;
 case "6650-01-542-7154RN":
   ModelVal="160-A";
   break;
 case "6650015427154RN":
   ModelVal="160-A";
   break;
 case "NSN 6650015427154RN":
   ModelVal="160-A";
   break;
 case "NSN6650015427154RN":
   ModelVal="160-A";
   break;
 case "NSN6650-01-542-7154RN":
   ModelVal="160-A";
   break;
   
 case "NSN 6920-00-X11-1495":
   ModelVal="6150";
   break; 
 case "6920-00-X11-1495":
   ModelVal="6150";
   break; 
 case "692000X111495":
   ModelVal="6150";
   break; 
 case "NSN 692000X111495":
   ModelVal="6150";
   break; 
 case "NSN692000X111495":
   ModelVal="6150";
   break; 
 case "NSN6920-00-X11-1495":
   ModelVal="6150";
   break; 
   
// End special section for checking NSN numbers:
 
 case "":
 	var Msg="Please enter a model number";
 	ViewPage=false;
 	alert(Msg);
	document.FrmGetModel.TxtInputModel.value="";
	document.FrmGetModel.TxtInputModel.focus();
 	break;
 default:
 	var Msg= ModelVal + " is either not a current model or part \nnumber,";
  	Msg+= " or is not part of our online catalog. \nYou may";
 	Msg+= " wish to use the 'Browse by Category' \nfunction on this page instead.";
 	alert(Msg);
	document.FrmGetModel.TxtInputModel.value="";
	document.FrmGetModel.TxtInputModel.focus();
	ViewPage=false;
	break;
 } //end switch (ModelVal)


//Begin section that actually writes the page
  
   if (ViewPage==true)
    {//Switch statement below chooses whether you are going to jump to a custom page or use
     //ModelVal to construct the page.
    switch(CustomPage)
      {
     case "null":
       //Switch statement below handles valid, discontinued, or replaced pages differently
       switch(Status)
        {
        //Put up a message indicating a product has been discontinued....
        case "Discontinued":
          var Msg="We're sorry, but the " + ModelVal + " has been discontinued.";
          Msg+=" \nPlease contact us for a possible replacement.";
 	      alert(Msg);
 	      Window.document.FrmGetModel.TxtInputModel.focus();
  	    //Line above resets the form and deletes input from the model text field.
  	    break;
        //...or put redirect to a product replacing the discontinued product...
        case "Replaced":
          var Msg="The " + ModelVal + " has been replaced by the " + Replacement+".";
          Msg+= "\nYour browser will be redirected to that page."
 	      alert(Msg);
          var NewPage= "../Products/" + Replacement + ".asp";
 	    break;
 	    //...or put up the page normally.
 	    case "Valid":
          var NewPage= "../Products/" + ModelVal + ".asp";
          break;
         }//end switch(Status) statement
       break;  
     default:
       var NewPage= CustomPage;
       break;
       }//end switch(CustomPage) statement

	//Fall through here to actually write the page.
    document.FrmGetModel.TxtInputModel.value="";
    document.location=NewPage;}

}// end function ShowModel  
// -->
