// JavaScript Document
function changeRackWidth (selRackWidth)
{
	var object = document.FSelectCabinet.RackHeight;
	var objectD = document.FSelectCabinet.RackDepth;
	object.options.length = 0;
	objectD.options.length = 0;
	if (selRackWidth == "600")
	{
		object.options[object.options.length] = new Option('12 U','12');
		object.options[object.options.length] = new Option('18 U','18');
		object.options[object.options.length] = new Option('24 U','24');
		object.options[object.options.length] = new Option('30 U','30');
		object.options[object.options.length] = new Option('36 U','36');
		object.options[object.options.length] = new Option('39 U','39');
		object.options[object.options.length] = new Option('42 U','42');
		object.options[object.options.length] = new Option('45 U','45');
		object.options[object.options.length] = new Option('48 U','48');
	}
	if (selRackWidth == "800")
	{
		object.options[object.options.length] = new Option('39 U','39');
		object.options[object.options.length] = new Option('42 U','42');
		object.options[object.options.length] = new Option('45 U','45');
		object.options[object.options.length] = new Option('48 U','48');
	}
	
}

function changeRackHeight (selRackHeight)
{
	var object = document.FSelectCabinet.RackDepth;
	object.options.length = 0;
	if (selRackHeight == "")
	{
		object.options[object.options.length] = new Option('Error ocoured, please start over','0');
	}
	
	if (selRackHeight == "12" || selRackHeight == "18")
	{
		object.options[object.options.length] = new Option('900 mm','900');
		object.options[object.options.length] = new Option('1050 mm','1050');
	}
	
	else
	{
		object.options[object.options.length] = new Option('900 mm','900');
		object.options[object.options.length] = new Option('1050 mm','1050');
		object.options[object.options.length] = new Option('1200 mm','1200');
	}
}

/*function GetProduct()
{
	var message = "The following fields are empty or invalid:\n\n";
	var isValid = true;
	if(document.FSelectCabinet.RackWidth.value == "")
	{
		message += " Width\n";
		isValid = false;
	}
	if(document.FSelectCabinet.RackHeight.value == "")
	{
		message += " Height\n";
		isValid = false;
	}
	if(document.FSelectCabinet.RackDepth.value == "")
	{
		message += " Depth\n";
		isValid = false;
	}	
	message += "\nPlease complete the form then resubmit."
	
	if(!isValid)
	{
		alert(message);
	}
	else
	{
		getURL();
	}
}
function getURL()
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url = "universal_racks2.asp";
	url += "?width=" + document.FSelectCabinet.RackWidth.value;
	url += "&height=" + document.FSelectCabinet.RackHeight.value;
	url += "&depth=" + document.FSelectCabinet.RackDepth.value;
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}*/