// Function to nagivate through product info tabs
function showTab(tab)
{
 	var tabs = new Array("info","delivery","sizing");	// Array of all tabs
	// Loop through all tabs to hide or show as appropriate
	for (i=0;i<tabs.length;i++)
	{
	 	if (tabs[i] == tab) {
		   // Make tab ACTIVE
			document.getElementById("prod_"+tabs[i]).style.display = "block";		   // Show content
			document.getElementById("tab_"+tabs[i]).style.backgroundColor = "#8CA9C7"; // Change tab colour
			document.getElementById("link_"+tabs[i]).style.color = "#000000"; 		   // Change link colour
		}
		else {
		   // Make tab INACTIVE
			document.getElementById("prod_"+tabs[i]).style.display = "none";		   // Hide content
			document.getElementById("tab_"+tabs[i]).style.backgroundColor = "#1C406F"; // Change tab colour
			document.getElementById("link_"+tabs[i]).style.color = "#FFFFFF"; 		   // Change link colour
		};
	};
	return false;
};
showTab("info"); // Default tab to display

// Function to check basket item is available
function checkAvail()
{
	var colour = document.Basket.colour.value;
	var length = document.Basket.length.value;
	var size = document.Basket.size.value;

	var key = length+","+colour+","+size;
	if (avail[key] == "on")
	{
	   	document.getElementById("availability").innerHTML = "<b>AVAILABLE</b>";
		document.Basket.submit.disabled = false;
	}
	else
	{
	   	document.getElementById("availability").innerHTML = "<b>UNAVAILABLE</b><br>(Select an alternative size)";
		document.Basket.submit.disabled = true;
	};
};
checkAvail();

