var currentDeck = "";

function showDeck(deck, shipID)
{


	// Hide current deck and display selected deckplan
	var cDeck = obj("deck_" + currentDeck);
	cDeck.style.display = 'none';
	
	var selectedDeck = obj("deck_" + deck);
	selectedDeck.style.display = 'block';
	
	currentDeck = deck;
	
	// Grab new deck categories
	var categoryListing = obj("categoryListing");
	categoryListing.innerHTML = "";

	xmlHttp = GetXmlHttpObject(popCatList);
	var params = "id=" + escape(shipID) + "&deck=" + escape(deck);
	xmlHttp.open("POST", "/ajax/ajx_getDeckCategories.php", true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.send(params);	
	return true;
}


function popCatList()
{
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
	
		if (xmlHttp.status == 200) {

			document.body.style.cursor = 'wait';

			// Get xml document
			//var shipsXML = xmlHttp.responseXML.documentElement;
			//var ships = shipsXML.getElementsByTagName("ship");
						
			// Clear out departure city list and add ALL to the list
			//var shipnames = obj("shipnames");
			//var dates = obj("dates");
			//clearSelectList(shipnames);
			//clearSelectList(dates);
			
			// Add default to shipnames and sail dates
			//addOption(shipnames, "Select a Ship", "");
			//addOption(dates, "Select a Sail Date", "");

			// Loop through deals
			//for (i = 0; i < ships.length; i++) {

				// Add ship to drop down list
				//addOption(shipnames, URLDecode(ships[i].getAttribute('name')), URLDecode(ships[i].getAttribute('id')));
				
			//}
			
			//document.body.style.cursor = 'default';			
	
			// Cleanup
			delete xmlHttp;
			xmlHttp = null;		
			return true;
		}
		else {
			alert(xmlHttp.status);
		}
	}

	return false;

}


