var IE = document.all?true:false;

function GiveFalse() {
if(IE) {
event.returnValue = false;
}
return false;
}
function valbutton(thisform) {
var customString=new Array();  
var tempcustomString;
customString[0]="UA G - 250 - E - MSD - ";
var temp = thisform.colourchange.selectedIndex;
var selectBox = thisform.colourchange.options[temp].text;
if (selectBox=='White Light')
{
	customString[1]="W - ";
	if ((thisform.wheelcontrol.selectedIndex!=0)||(thisform.colourwheel.selectedIndex!=0)||(thisform.motor.selectedIndex!=0))
{
	alert("White Light light source selected - resetting wheel control & colour wheel options.");	
	thisform.wheelcontrol.selectedIndex = 0;  
	thisform.colourwheel.selectedIndex = 0;	
	thisform.motor.selectedIndex = 0;  
}	
}
else
{
	customString[1]="C - "; 
} 
temp = thisform.wheelcontrol.selectedIndex;
selectBox = thisform.wheelcontrol.options[temp].text;
if (selectBox=='None')
{
	if (thisform.colourchange.selectedIndex==1)
	{
		alert("You must select another wheel control option to use with a colour changing light source");
		return; 
	}
	customString[2]="X - ";
}
else if (selectBox=='Continuous')
{
	customString[2]="C -  ";
}
else if (selectBox=='Switch')
{
	customString[2]="S - ";
}
else if (selectBox=='Sep. feed')
{
	customString[2]="F - ";
} 
else
{
	if((thisform.colourwheel.selectedIndex!=8) || (thisform.motor.selectedIndex!=4))
	{
		alert("You have selected AVR wheel control so both the colour wheel and the motor speed must be AVR types.");
		thisform.reset(); 
		tempcustomString="UA G - 250 - E - MSD - W - X - M - XX - XX - X"; 
		document.getElementById('theString').innerHTML = "<strong>" + tempcustomString + "</strong>";
		return;
	}
	else
	{
	customString[2]="V - ";
	}
} 

customString[3]="M - ";
	
temp = thisform.colourwheel.selectedIndex;
selectBox = thisform.colourwheel.options[temp].text;  
if (selectBox=='------------------------------------------')
{
	alert("No Colour Wheel option selected - please select one.");
	return;
}
if (selectBox=='None')
{
	if (thisform.colourchange.selectedIndex==1)
	{
		alert("You must select another colour wheel option to use with a colour changing light source");
		thisform.reset(); 
		tempcustomString="UA G - 250 - E - MSD - W - X - M - XX - XX - X"; 
		document.getElementById('theString').innerHTML = "<strong>" + tempcustomString + "</strong>";
		return; 
	}
	customString[4]="XX - ";
}
else if (selectBox=='2 Colour Varicolour')
{
	customString[4]="V2 - ";
}
else if (selectBox=='3 Colour Varicolour')
{
	customString[4]="V3 - ";
} 
else if (selectBox=='4 Colour Varicolour')
{
	customString[4]="V4 - ";
}
else if (selectBox=='6 Colour Varicolour')
{
	customString[4]="V6 - ";
}
else if (selectBox=='Metal Twinkle')
{
	customString[4]="MT - ";
}
else if (selectBox=='Dimmer')
{
	customString[4]="DW - ";
}	 
else if (selectBox=='Colour Filter')
{
	customString[4]="FL - ";
}  
else if (selectBox=='AVR Dichroic')
{
	if((thisform.wheelcontrol.selectedIndex!=4) || (thisform.motor.selectedIndex!=4))
	{
		alert("You have selected an AVR colour wheel so both the wheel control and the motor speed must be AVR types.");
		thisform.reset(); 
		tempcustomString="UA G - 250 - E - MSD - W - X - M - XX - XX - X"; 
		document.getElementById('theString').innerHTML = "<strong>" + tempcustomString + "</strong>";
		return;
	}
	else
	{ 
	customString[4]="AV - "; 
	}
	
} 
else if (selectBox=='6 Colour Dichroic & Twinkle')
{
	customString[4]="DS - ";
}
else if (selectBox=='2 Colour Varicolour & Twinkle')
{
	customString[4]="2S - ";
}
else if (selectBox=='3 Colour Varicolour & Twinkle')
{
	customString[4]="3S - ";
}
else if (selectBox=='4 Colour Varicolour & Twinkle')
{
	customString[4]="4S - ";
}
else if (selectBox=='6 Colour Varicolour & Twinkle')
{
	customString[4]="6S - ";
}
else {
	customString[4]="D6 - ";
} 
temp = thisform.motor.selectedIndex;
selectBox = thisform.motor.options[temp].text;
if (selectBox=='0.5rpm')
{
	customString[5]="05";
}
else if (selectBox=='1 rpm')
{
	customString[5]="10";
}
else if (selectBox=='3 rpm')
{
	customString[5]="30";
} 
else if (selectBox=='5 rpm')
{
	customString[5]="50";
}
else if (selectBox=='None')
{
	if (thisform.colourchange.selectedIndex==1)
	{
		alert("You must select another motor option to use with a colour changing light source");
		return; 
	}
	customString[5]="XX";
}
else
{
	if((thisform.wheelcontrol.selectedIndex!=4) || (thisform.colourwheel.selectedIndex!=8))
	{
		alert("You have selected an AVR motor so both the wheel control and the colour wheel must be AVR types.");
		thisform.reset(); 
		tempcustomString="UA G - 250 - E - MSD - W - X - M - XX - XX - X"; 
		document.getElementById('theString').innerHTML = "<strong>" + tempcustomString + "</strong>";
		return;
	}
	else
	{ 
	customString[5]="AV";	 
	}
} 
customString[6]=" - X";
var n; 
var cust="";
for (n=0;n<=6;n++)
{ 
cust+=customString[n];
}
document.getElementById('theString').innerHTML = "<strong>" + cust + "</strong>";

}


