// JavaScript Document
function ValidateToilet()
{
	if (document.frmeasyspec.hidtoilet.value == 1)
	{
		var arr = new Array(6);
		arr[0] = "0";
		arr[1] = "A";
		arr[2] = "B";
		arr[3] = "C";
		arr[4] = "D";
		arr[5] = "E";
		arr[6] = "F";		

		//1	Axis
		if (document.frmeasyspec.cubicletype.selectedIndex == 0)
		{
			alert ("Choose Cubicles > Toilet type");return false;
		}

		//1	Axis
		if (document.frmeasyspec.cubicletype.selectedIndex == 1)
				document.frmeasyspec.frmtoiletvalues.value = "WC1A";
		//2	Impact		
		if (document.frmeasyspec.cubicletype.selectedIndex == 2)
		{	
			if (document.frmeasyspec.selimpact.selectedIndex == 0)
				{ alert ("Choose Cubicles > Toilet > Impact options"); return false; }
			else
				{ document.frmeasyspec.frmtoiletvalues.value = "WC" + document.frmeasyspec.cubicletype.selectedIndex ;
				  document.frmeasyspec.frmtoiletvalues.value += arr[document.frmeasyspec.selimpact.selectedIndex];}								
		}
		//3	Splash
		if (document.frmeasyspec.cubicletype.selectedIndex == 3)
				document.frmeasyspec.frmtoiletvalues.value = "WC3A";
		//4	Ultima
		if (document.frmeasyspec.cubicletype.selectedIndex == 4)
		{
			if ((document.frmeasyspec.selultima1.selectedIndex == 0) || (document.frmeasyspec.selultima2.selectedIndex == 0) || (										document.frmeasyspec.selultima3.selectedIndex == 0))
			{ alert ("Choose Cubicles > Toilet > All Ultima options"); return false; }
			else
			{
				document.frmeasyspec.frmtoiletvalues.value = "WC" + document.frmeasyspec.cubicletype.selectedIndex + arr[document.frmeasyspec.selultima1.selectedIndex] + arr[document.frmeasyspec.selultima2.selectedIndex] + arr[document.frmeasyspec.selultima3.selectedIndex];
			}
		}
		//5	Minima			
		if (document.frmeasyspec.cubicletype.selectedIndex == 5)
		{
			if ((document.frmeasyspec.selminima1.selectedIndex == 0) || (document.frmeasyspec.selminima2.selectedIndex == 0))
			{ alert ("Choose Cubicles > Toilet > All Minima options"); return false; }
			else
			{
				document.frmeasyspec.frmtoiletvalues.value = "WC" + document.frmeasyspec.cubicletype.selectedIndex + arr[document.frmeasyspec.selminima1.selectedIndex] + arr[document.frmeasyspec.selminima2.selectedIndex] ;
			}
		}
		
		//6	Linea
		if (document.frmeasyspec.cubicletype.selectedIndex == 6)
		{
			if ((document.frmeasyspec.sellinea1.selectedIndex == 0) || (document.frmeasyspec.sellinea2.selectedIndex == 0))
			{ alert ("Choose Cubicles > Toilet > All Linea options"); return false; }
			else
			{
				document.frmeasyspec.frmtoiletvalues.value = "WC" + document.frmeasyspec.cubicletype.selectedIndex + arr[document.frmeasyspec.sellinea1.selectedIndex] + arr[document.frmeasyspec.sellinea2.selectedIndex] ;
			}
		}
		//7	Truline
		if (document.frmeasyspec.cubicletype.selectedIndex == 7)
		{
			if ((document.frmeasyspec.seltruline1.selectedIndex == 0) || (document.frmeasyspec.seltruline2.selectedIndex == 0))
			{ alert ("Choose Cubicles > Toilet > All Truline options"); return false; }
			else
			{
				document.frmeasyspec.frmtoiletvalues.value = "WC" + document.frmeasyspec.cubicletype.selectedIndex + arr[document.frmeasyspec.seltruline1.selectedIndex] + arr[document.frmeasyspec.seltruline2.selectedIndex] ;
			}
		}
		//8	Coolite
		if (document.frmeasyspec.cubicletype.selectedIndex == 8)
				document.frmeasyspec.frmtoiletvalues.value = "WC8A";
		//9	Aqualine
		if (document.frmeasyspec.cubicletype.selectedIndex == 9)
				document.frmeasyspec.frmtoiletvalues.value = "WC9A";
		//10 Playtime
		if (document.frmeasyspec.cubicletype.selectedIndex == 10)
		{
			if ((document.frmeasyspec.selplaytime1.selectedIndex == 0))
			{ alert ("Choose Cubicles > Toilet > All Playtime options"); return false; }
			else
			{
				document.frmeasyspec.frmtoiletvalues.value = "WC" + document.frmeasyspec.cubicletype.selectedIndex + arr[document.frmeasyspec.selplaytime1.selectedIndex] + arr[document.frmeasyspec.selplaytime2.selectedIndex];
			}
		}
		//11s Urban
		if (document.frmeasyspec.cubicletype.selectedIndex == 11)
				document.frmeasyspec.frmtoiletvalues.value = "WC11A";
				
		//12 Acorn
		if (document.frmeasyspec.cubicletype.selectedIndex == 12)
		{	
			if (document.frmeasyspec.selacron1.selectedIndex == 0)
				{ alert ("Choose Cubicles > Toilet > Acorn options"); return false; }
			else
				{ document.frmeasyspec.frmtoiletvalues.value = "WC" + document.frmeasyspec.cubicletype.selectedIndex ;
				  document.frmeasyspec.frmtoiletvalues.value += arr[document.frmeasyspec.selacron1.selectedIndex];}								
		}
		//alert (document.frmeasyspec.frmtoiletvalues.value);	

	}
	else
	{
		document.frmeasyspec.frmtoiletvalues.value = "";
	}
	return true;
}