/*Script for Platform Scale Selection Trail
Script works on principle of checking each criterion in turn against each model of scale.  Where that scale satisfies that criterion then the counter for that scale is incremented by +1.  The scale(s) gaining a total count of 4 have satisfied all criteria input by the user*/


function PSselect()
{

var mountingtype = document.scaleselect.type.selectedIndex;
var maxload = document.scaleselect.capacity.selectedIndex;
var palletyn = document.scaleselect.pallet.selectedIndex;
var finishcover = document.scaleselect.finish.selectedIndex;

function getselectedIndex(){
return mountingtype;
return maxload;
return palletyn;
return finishcover;
}

var Outcome1 = new Array(0,0,0,0);
var Outcome2 = new Array(1,1,1,1);
var Outcome3 = new Array(2,2,2,2);
var Outcome4 = new Array(3,3,3,3);



var UserInput = new Array(mountingtype,maxload,palletyn,finishcover);

//.Setting counter to zero for each type of scale
var ColtJCount=0;
var ColtCount=0;
var PumaCount=0;
var PantherCount=0;
var StallionCount=0;
var MustangCount=0;

//.Test for Mounting Type
//.Surface
if (Outcome1[0] == UserInput[0])
{ColtJCount=ColtJCount+1, ColtCount=ColtCount+1, PumaCount=PumaCount+1, PantherCount=PantherCount+1, StallionCount=StallionCount+1, MustangCount=MustangCount+1};
//.Pit
if (Outcome2[0] == UserInput[0])
{ColtJCount=ColtJCount, ColtCount=ColtCount, PumaCount=PumaCount, PantherCount=PantherCount, StallionCount=StallionCount+1, MustangCount=MustangCount+1};
//.Unsure
if (Outcome3[0] == UserInput[0])
{ColtJCount=ColtJCount+1, ColtCount=ColtCount+1, PumaCount=PumaCount+1, PantherCount=PantherCount+1, StallionCount=StallionCount+1, MustangCount=MustangCount+1};


//.Test for Max Load
//.<60kg
if (Outcome1[1] == UserInput[1])
{ColtJCount=ColtJCount+1, ColtCount=ColtCount+1, PumaCount=PumaCount, PantherCount=PantherCount, StallionCount=StallionCount, MustangCount=MustangCount};
//.60kg to 300kg
if (Outcome2[1] == UserInput[1])
{ColtJCount=ColtJCount, ColtCount=ColtCount+1, PumaCount=PumaCount, PantherCount=PantherCount, StallionCount=StallionCount, MustangCount=MustangCount};
//.300kg to 3000kg
if (Outcome3[1] == UserInput[1])
{ColtJCount=ColtJCount, ColtCount=ColtCount, PumaCount=PumaCount+1, PantherCount=PantherCount+1, StallionCount=StallionCount, MustangCount=MustangCount+1};
//.3000kg to 10000kg
if (Outcome4[1] == UserInput[1])
{ColtJCount=ColtJCount, ColtCount=ColtCount, PumaCount=PumaCount, PantherCount=PantherCount, StallionCount=StallionCount+1, MustangCount=MustangCount};


//.Test for Pallet facility
//.No pallet facility
if (Outcome1[2] == UserInput[2])
{ColtJCount=ColtJCount+1, ColtCount=ColtCount+1, PumaCount=PumaCount, PantherCount=PantherCount+1, StallionCount=StallionCount+1, MustangCount=MustangCount+1};
//.Yes - pallet facility
if (Outcome2[2] == UserInput[2])
{ColtJCount=ColtJCount, ColtCount=ColtCount, PumaCount=PumaCount+1, PantherCount=PantherCount, StallionCount=StallionCount+1, MustangCount=MustangCount+1};
//.Unsure
if (Outcome3[2] == UserInput[2])
{ColtJCount=ColtJCount+1, ColtCount=ColtCount+1, PumaCount=PumaCount+1, PantherCount=PantherCount+1, StallionCount=StallionCount+1, MustangCount=MustangCount+1};


//.Test for Finish type
//.Galvanised
if (Outcome1[3] == UserInput[3])
{ColtJCount=ColtJCount, ColtCount=ColtCount, PumaCount=PumaCount, PantherCount=PantherCount, StallionCount=StallionCount+1, MustangCount=MustangCount+1};
//.Stainless Steel
if (Outcome2[3] == UserInput[3])
{ColtJCount=ColtJCount+1, ColtCount=ColtCount+1, PumaCount=PumaCount+1, PantherCount=PantherCount+1, StallionCount=StallionCount, MustangCount=MustangCount};
//.Unsure
if (Outcome3[3] == UserInput[3])
{ColtJCount=ColtJCount+1, ColtCount=ColtCount+1, PumaCount=PumaCount+1, PantherCount=PantherCount+1, StallionCount=StallionCount+1, MustangCount=MustangCount+1};



/*Code below is for checking criteria correct in coding - used for testing only
alert("ColtJ= "+ColtJCount+ " Colt= "+ColtCount+" Mustang= "+MustangCount+" Panther= "+PantherCount+" Stallion= "+StallionCount+" Puma= "+PumaCount )
*/


//.Check if any satisfy criteria
if (ColtJCount<4&ColtCount<4&PumaCount<4&PantherCount<4&StallionCount<4&MustangCount<4)
alert ("No Shering platform scales satisfy all the criteria you have input.                                 Please try again with less restrictive options.");




else


//.Code below opens pop-up window with selection of hyperlinks for platform scales that fit criteria

{
var popUpWin = window.open('explanations/ps_list.htm','popup','width=529,height=290,top=230,left=233,scrollbars');

popUpWin.document.writeln("<TITLE>Platform Scales List</TITLE>");
popUpWin.document.writeln("<LINK href=\"../styles.css\" type=text/css rel=stylesheet>");
popUpWin.document.writeln("<P>The following Shering platform scales meet your criteria:</P><UL>");



if (ColtJCount==4)
{popUpWin.document.writeln("<LI><A href=\"javascript:window.close();opener.document.location=\'coltjunior.htm\';\">Colt Junior Bench Scale</A>")};

if (ColtCount==4)
{popUpWin.document.writeln("<LI><A href=\"javascript:window.close();opener.document.location=\'colt.htm\';\">Colt Low Capacity</A>")};

if (MustangCount==4)
{popUpWin.document.writeln("<LI><A href=\"javascript:window.close();opener.document.location=\'mustang.htm\';\">Mustang Mid Capacity</A>")};

if (PantherCount==4)
{popUpWin.document.writeln("<LI><A href=\"javascript:window.close();opener.document.location=\'panther.htm\';\">Panther Low Profile</A>")};

if (StallionCount==4)
{popUpWin.document.writeln("<LI><A href=\"javascript:window.close();opener.document.location=\'stallion.htm\';\">Stallion High Capacity</A>")};

if (PumaCount==4)
{popUpWin.document.writeln("<LI><A href=\"javascript:window.close();opener.document.location=\'puma.htm\';\">Puma Pallet Scale</A>")};


popUpWin.document.writeln("</UL>");

popUpWin.document.writeln("<CENTER><input type=button value=\"Close this window\" onClick=window.close()></CENTER>");

popUpWin.focus();


       }


}




//.###############################################################

/*Script for Weighbridge Selection Trail
Script works on principle of checking each criterion in turn against each model of weighbridge.  Where that weighbridge satisfies that criterion then the counter for that weighbridgeis incremented by +1.  The weighbridge(s) gaining a total count of 4 have satisfied all criteria input by the user*/


function WBselect()
	{
var mountingtype = document.wbselect.type.selectedIndex;
var existing = document.wbselect.newold.selectedIndex;
var dirtysite = document.wbselect.dirty.selectedIndex;
var spacesite = document.wbselect.space.selectedIndex;

function getselectedIndex(){
return mountingtype;
return existing;
return dirtysite;
return spacesite;
}

var Outcome5 = new Array(0,0,0,0);
var Outcome6 = new Array(1,1,1,1);
var Outcome7 = new Array(2,2,2,2);
var Outcome8 = new Array(3,3,3,3);



var UserInput = new Array(mountingtype,existing,dirtysite,spacesite);

//.Setting counter to zero for each type of weighbridge
var NTLPCount=0;
var NTHPCount=0;
var ETCount=0;
var TigerSCount=0;
var TigerPCount=0;
var BronzeCount=0;


//.Test for Mounting Type
//.Surface
if (Outcome5[0] == UserInput[0])
{NTLPCount=NTLPCount+1, NTHPCount=NTHPCount+1, TigerSCount=TigerSCount+1, TigerPCount=TigerPCount,BronzeCount=BronzeCount+1};
//.Shallow Pit
if (Outcome6[0] == UserInput[0])
{NTLPCount=NTLPCount, NTHPCount=NTHPCount, ETCount=ETCount, TigerSCount=TigerSCount, TigerPCount=TigerPCount+1, BronzeCount=BronzeCount};
//.Deep Pit
if (Outcome7[0] == UserInput[0])
{NTLPCount=NTLPCount, NTHPCount=NTHPCount, ETCount=ETCount+1, TigerSCount=TigerSCount, TigerPCount=TigerPCount, BronzeCount=BronzeCount};
//.Unsure
if (Outcome8[0] == UserInput[0])
{NTLPCount=NTLPCount+1, NTHPCount=NTHPCount+1, ETCount=ETCount+1, TigerSCount=TigerSCount+1, TigerPCount=TigerPCount+1, BronzeCount=BronzeCount+1};


//.Test for New or Existing
//.New
if (Outcome5[1] == UserInput[1])
{NTLPCount=NTLPCount+1, NTHPCount=NTHPCount+1, ETCount=ETCount, TigerSCount=TigerSCount+1, TigerPCount=TigerPCount+1, BronzeCount=BronzeCount+1};
//.Existing
if (Outcome6[1] == UserInput[1])
{NTLPCount=NTLPCount+1, NTHPCount=NTHPCount+1, ETCount=ETCount+1, TigerSCount=TigerSCount+1, TigerPCount=TigerPCount+1, BronzeCount=BronzeCount+1};



//.Test for dirty site
//.Dirty - Yes
if (Outcome5[2] == UserInput[2])
{NTLPCount=NTLPCount, NTHPCount=NTHPCount+1, ETCount=ETCount+1, TigerSCount=TigerSCount, TigerPCount=TigerPCount,  BronzeCount=BronzeCount};
//.Dirty - No
if (Outcome6[2] == UserInput[2])
{NTLPCount=NTLPCount+1, NTHPCount=NTHPCount, ETCount=ETCount+1, TigerSCount=TigerSCount+1, TigerPCount=TigerPCount+1, BronzeCount=BronzeCount+1};
//.Unsure
if (Outcome7[2] == UserInput[2])
{NTLPCount=NTLPCount+1, NTHPCount=NTHPCount+1, ETCount=ETCount+1, TigerSCount=TigerSCount+1, TigerPCount=TigerPCount+1,BronzeCount=BronzeCount+1};


//.Test for space problem
//.Space a problem - Yes
if (Outcome5[3] == UserInput[3])
{NTLPCount=NTLPCount, NTHPCount=NTHPCount, ETCount=ETCount, TigerSCount=TigerSCount+1, TigerPCount=TigerPCount+1, BronzeCount=BronzeCount};
//.Space a problem - No
if (Outcome6[3] == UserInput[3])
{NTLPCount=NTLPCount+1, NTHPCount=NTHPCount+1, ETCount=ETCount+1, TigerSCount=TigerSCount, TigerPCount=TigerPCount+1,BronzeCount=BronzeCount+1};
//.Unsure
if (Outcome7[3] == UserInput[3])
{NTLPCount=NTLPCount+1, NTHPCount=NTHPCount+1, ETCount=ETCount+1, TigerSCount=TigerSCount+1, TigerPCount=TigerPCount+1,BronzeCount=BronzeCount+1};



/*Section below now superfluous

//.Identifying those weighbridges that satisfy criteria 
var NTLP="";
var NTHP="";
var ET="";
var TigerS="";
var TigerP="";
var Bronze="";

if (NTLPCount==4)
{NTLP="9020 Low Profile    "};
if (NTHPCount==4)
{NTHP="9020 High Profile    "};
if (ETCount==4)
{ET="8020 Deep Pit Mounted       "};
if (TigerSCount==4)
{TigerS="Tiger Surface Mounted     "};
if (TigerPCount==4)
{TigerP="Tiger Shallow Pit Mounted     "};
if (BronzeCount==4)
{Bronze="Bronze    "};

*/


//.Check which weighbridges satisfy criteria
if (NTLPCount<4&NTHPCount<4&ETCount<4&TigerSCount<4&TigerPCount<4&BronzeCount<4)
alert ("No Shering weighbridges satisfy all the criteria you have input.                                           Please try again with less restrictive options.");

else

//Code below opens pop-up window with selection of hyperlinks for weighbridges that fit criteria


{
var popUpWin = window.open('explanations/wb_list.htm','popup','width=529,height=290,top=230,left=233,scrollbars');

popUpWin.document.writeln("<TITLE>Weighbridges List</TITLE>");
popUpWin.document.writeln("<LINK href=\"../styles.css\" type=text/css rel=stylesheet>");
popUpWin.document.writeln("<P>The following Shering weighbridges meet your criteria:</P><UL>");



if (NTLPCount==4)
{popUpWin.document.writeln("<LI><A href=\"javascript:window.close();opener.document.location=\'9020.htm\';\">9020 Low Profile</A>")};

if (NTHPCount==4)
{popUpWin.document.writeln("<LI><A href=\"javascript:window.close();opener.document.location=\'9020.htm\';\">9020 High Profile</A>")};

if (ETCount==4)
{popUpWin.document.writeln("<LI><A href=\"javascript:window.close();opener.document.location=\'8020.htm\';\">8020 Deep Pit Mounted</A>")};

if (TigerSCount==4)
{popUpWin.document.writeln("<LI><A href=\"javascript:window.close();opener.document.location=\'tiger.htm\';\">Tiger Surface Mounted</A>")};

if (TigerPCount==4)
{popUpWin.document.writeln("<LI><A href=\"javascript:window.close();opener.document.location=\'tiger.htm\';\">Tiger Shallow Pit Mounted</A>")};

if (BronzeCount==4)
{popUpWin.document.writeln("<LI><A href=\"javascript:window.close();opener.document.location=\'bronze.htm\';\">Bronze</A>")};


popUpWin.document.writeln("</UL>");

popUpWin.document.writeln("<CENTER><input type=button value=\"Close this window\" onClick=window.close()></CENTER>");

popUpWin.focus();


}


	}
