function expandmenu(state) 
{
	document.getElementById("default").style.display = "none";
	if (state == "sandwich") {
		document.getElementById("sandwich").style.display = "inline";
	}else{
		document.getElementById("sandwich").style.display = "none";
	}
/*	if (state == "spec_sandwich") {
		document.getElementById("spec_sandwich").style.display = "inline";
	}else{
		document.getElementById("spec_sandwich").style.display = "none";
	}
*/	if (state == "soup") {
		document.getElementById("soup").style.display = "inline";
	}else{
		document.getElementById("soup").style.display = "none";
	}
	if (state == "calzone") {
		document.getElementById("calzone").style.display = "inline";
	}else{
		document.getElementById("calzone").style.display = "none";
	}
}

function expandupdate(state) 
{
//	document.getElementById("default").style.display = "none";
	if (state == "uemail") {
		document.getElementById("uemail").style.display = "inline";
	}else{
		document.getElementById("uemail").style.display = "none";
	}
	if (state == "uphone") {
		document.getElementById("uphone").style.display = "inline";
	}else{
		document.getElementById("uphone").style.display = "none";
	}
	if (state == "upass") {
		document.getElementById("upass").style.display = "inline";
	}else{
		document.getElementById("upass").style.display = "none";
	}
}


function trims(str)
{
  return str.replace(/^\s+|\s+$/g, '');
}


function validateForm(x)
{
	var qty = x.Quantity.value;
	qty = trims(qty);
	var patt1=/^[0-9]{1,2}$/;
	if (!patt1.test(qty))
	{
	  alert("Please enter a valid quantity");
	  return false;
	}
	var myOption = -1;
	for (i=x.Item.length-1; i > -1; i--) 
	{
	  if (x.Item[i].checked) 
	  {
		  myOption = i;
		  i = -1;
	  }
	}
	if (myOption == -1) 
	{
	  alert("Please make a selection ");
	  return false;
	}
	if (x.name == 'soup_form'){
	  s=x.Size.selectedIndex;
	  if (s==0){
	    alert("Please select a size");
	    return false;
	  }
	}
	return true;
}
