	function updateConfiguration(select) {
		switch (select.id) {
			case "chassis":
				makeAjaxRequest("GetCompatiblePowerSupply", select.value, $("psu"));
				updateMotherboard(select.value, $("psu").value);
				updateRaidController(select.value, $("motherboard").value);
				updateHardDrive(select.value, $("motherboard").value, $("raid-controller").value);
				
				$("psu").enable();
				$("motherboard").enable();
				$("raid-controller").enable();
				$("hard-drive").enable();
				break;
			case "psu":
				updateMotherboard($("chassis").value, select.value);
				$("psu-quantity").enable();
				break;
			case "motherboard":
				makeAjaxRequest("GetCompatibleCPU", select.value, $("cpu"));
				makeAjaxRequest("GetCompatibleMemory", select.value, $("memory"));
				updateHardDrive($("chassis").value, select.value, $("raid-controller").value);
				updateRaidController($("chassis").value, select.value);
				makeAjaxRequest("GetCompatibleOpenE", select.value, $("operating-system"));
				$("motherboard-quantity").enable();
				$("cpu").enable();
				$("memory").enable();
				$("operating-system").enable();
				break;
			case "cpu":
				makeQuantityRequest("cpu-quantity", select.value, $("motherboard").value);
				//Make CPU QTY Request
				$("cpu-quantity").enable();
				break;
			case "memory":
				makeQuantityRequest("memory-quantity", select.value, $("motherboard").value);
				$("memory-quantity").enable();
				break;
			case "raid-controller":
				updateHardDrive($("chassis").value, $("motherboard").value, select.value);
				getRaidQuantity(select.value, $("chassis").value, $("motherboard").value);
				$("raidcontroller-quantity").enable();			
				break;
			case "hard-drive":
				getHardDriveQuantity(select.value, $("chassis").value, $("motherboard").value, $("raid-controller").value);
				$("harddrive-quantity").enable();
				break;
			case "operating-system":
				makeQuantityRequest("operating-system-quantity", select.value, $("motherboard").value);
				$("operating-system-quantity").enable();
				break;
		}
	}
	
	function updateMotherboard(chassisId, psuId) {
		var output = new Ajax.Request("/resource/application/service/configuration.php", {
			parameters: { 
				Action: "GetCompatibleMotherboard",
				ChassisId: chassisId,
				PsuId: psuId
			},
			asynchronous: false,
	 		onSuccess: function(transport) {
	 			var response = transport.responseText.evalJSON();
	 			if (response.success) {
	 				updateOptions($("motherboard"), response.data);
	 			}
	 		}
	 	});
	}
	
	function updateRaidController(chassisId, motherboardId) {
		var output = new Ajax.Request("/resource/application/service/configuration.php", {
			parameters: { 
				Action: "GetCompatibleRaid",
				ChassisId: chassisId,
				MotherboardId: motherboardId
			},
			asynchronous: false,
	 		onSuccess: function(transport) {
	 			var response = transport.responseText.evalJSON();
	 			if (response.success) {
	 				updateOptions($("raid-controller"), response.data);
	 			}
	 		}
	 	});
	}
	
	function updateHardDrive(chassisId, motherboardId, raidControllerId) {
		var output = new Ajax.Request("/resource/application/service/configuration.php", {
			parameters: { 
				Action: "GetCompatibleHardDrive",
				ChassisId: chassisId,
				MotherboardId: motherboardId,
				RaidControllerId: raidControllerId
			},
			asynchronous: false,
	 		onSuccess: function(transport) {
	 			var response = transport.responseText.evalJSON();
	 			if (response.success) {
	 				updateOptions($("hard-drive"), response.data);
	 			}
	 		}
	 	});
	}
	
	function makeAjaxRequest(action, productId, element) {
		var output = new Ajax.Request("/resource/application/service/configuration.php", {
			parameters: { 
				Action: action,
				ProductId: productId
			},
			asynchronous: false,
	 		onSuccess: function(transport) {
	 			var response = transport.responseText.evalJSON();
	 			if (response.success) {
	 				updateOptions(element, response.data);
	 			}
	 		}
	 	});
	}
	
	function getHardDriveQuantity(hardDriveId, chassisId, motherboardId, raidControllerId) {
		var output = new Ajax.Request("/resource/application/service/configuration.php", {
			parameters: { 
				Action: "GetQuantityHardDrive",
				HardDriveId: hardDriveId,
				ChassisId: chassisId,
				MotherboardId: motherboardId,
				RaidControllerId: raidControllerId
			},
			asynchronous: false,
  		onSuccess: function(transport) {
  			var response = transport.responseText.evalJSON();
  			if (response.success) {
  				updateQuantity($("harddrive-quantity"), response.Min, response.Max);
  			}
  		}
  	});
	}
	
	function getRaidQuantity(raidId, chassisId, motherboardId) {
		var output = new Ajax.Request("/resource/application/service/configuration.php", {
			parameters: { 
				Action: "GetQuantityRaid",
				RaidId: raidId,
				ChassisId: chassisId,
				MotherboardId: motherboardId
			},
			asynchronous: false,
  		onSuccess: function(transport) {
  			var response = transport.responseText.evalJSON();
  			if (response.success) {
  				updateQuantity($("raidcontroller-quantity"), response.Min, response.Max);
  			}
  		}
  	});
	}
	
	function makeQuantityRequest(element, productId, compatibleProductId) {
		var output = new Ajax.Request("/resource/application/service/configuration.php", {
			parameters: { 
				Action: "GetQuantity",
				ProductId: productId,
				CompatibleProductId: compatibleProductId
			},
			asynchronous: false,
  		onSuccess: function(transport) {
  			var response = transport.responseText.evalJSON();
  			if (response.success) {
  				updateQuantity(element, response.Min, response.Max);
  			}
  		}
  	});
	}
	
	function updateQuantity(select, minQuantity, maxQuantity) {
		select = $(select);
		select.innerHTML = "";
		for (i = minQuantity; i <= maxQuantity; i++) {
			var option = document.createElement("option");
			option.value = i;
			option.innerHTML = "x " + i;	
			select.appendChild(option);
		}
		select.appendChild(option);
	}
	
	function updateOptions(select, products) {
		select = $(select);
		select.innerHTML = "";
		var option = document.createElement("option");
		option.innerHTML = "--- Please select " + select.id.replace("-", " ") + " ---";
		option.value = "";
		select.appendChild(option);
		
		products.each(function(product) {
			var option = document.createElement("option");
			option.value = product.Id.Data;
			option.innerHTML = product.Name.Data;					
			select.appendChild(option);
		});
	}