  function startmenu()
  {
  	menu0.style.display = "none";
  	menu1.style.display = "none";
  	menu2.style.display = "none";
  }
  
  function menu0func()
  {
  	if(menu0.style.display == "none")
  	{
  		startmenu();
  		menu0.style.display = "block";
  	}
  	else
  	{
  		startmenu();
  	}
  }
  function menu1func()
  {
  	if(menu1.style.display == "none")
  	{
  		startmenu();
  		menu1.style.display = "block";
  	}
  	else
  	{
  		startmenu();
  	}
  }
  function menu2func()
  {
  	if(menu2.style.display == "none")
  	{
  		startmenu();
  		menu2.style.display = "block";
  	}
  	else
  	{
  		startmenu();
  	}
  }


  function Checkout(ItemID, Price, Shipping)
  {

	document.cookie = "BuyItem="+ escape(ItemID) + ";0; path=/";
	document.cookie = "PriceItem=" + Price + ";0; path=/";
	document.cookie = "ShipItem=" + Shipping + ";0; path=/";

    window.open('buyitem.html');
 }

function getCookie(n) {
var cookiecontent = new String();
if(document.cookie.length > 0) {
	var cookiename = n+ '=';
	var cookiebegin = document.cookie.indexOf(cookiename);
	var cookieend = 0;
	if(cookiebegin > -1) {
		cookiebegin += cookiename.length;
		cookieend = document.cookie.indexOf(";",cookiebegin);
		if(cookieend < cookiebegin) { cookieend = document.cookie.length; }
		cookiecontent = document.cookie.substring(cookiebegin,cookieend);
		}
	}
return unescape(cookiecontent);
}

  function wipeCookie()
  {

	document.cookie = "BuyItem="+"" + ";0; path=/";
	document.cookie = "PriceItem=" + "" + ";0; path=/";
	document.cookie = "ShipItem=" + "" + ";0; path=/";

    window.close();
 }

function CheckForm()
{
   var form_ok = true;

   var buyer_ok = true;
      if (document.buyitem.buyer.value == "") buyer_ok = false;

   address_ok = true;
      if (document.buyitem.LineAddress.value =="") address_ok = false;
      if (document.buyitem.City.value =="") address_ok = false;
      if (document.buyitem.State.value =="") address_ok = false;
      if (document.buyitem.Zip.value =="") address_ok = false;

   phone_ok = true;
      if (document.buyitem.PhoneNo.value =="") phone_ok = false;

   insure_ok = false;
      for (i=0; i<=1; i++)
         {
         if (document.buyitem.insurance[i].checked) insure_ok = true;
         }


   form_ok = (buyer_ok && address_ok && phone_ok && insure_ok);

   if (form_ok) {
      alert("This form will generate an message in your email program. You will need to send it from there.");
      } else {
      alert("Please fill out ALL the required fields.");
      }

   return form_ok;
}