// Menu Images
if (document.images) 
{
  ViewOn = new Image();
  ViewOn.src = "view_on.gif";
  ViewOff = new Image();
  ViewOff.src = "view.gif";
}

// Function to 'activate' images.
function imgOn(imgName, imgIndex)
{
  if (document.images) 
  {
    if (imgIndex)
    {
      fullName = imgName + "_" + imgIndex;
      document[fullName].src = eval(imgName + "On.src");
    }
    else
    {
      document[imgName].src = eval(imgName + "On.src");
    }
  }
}

// Function to 'deactivate' images.
function imgOff(imgName, imgIndex)
{
  if (document.images) 
  {
    if (imgIndex)
    {
      fullName = imgName + "_" + imgIndex;
      document[fullName].src = eval(imgName + "Off.src");
    }
    else
    {
      document[imgName].src = eval(imgName + "Off.src");
    }
  }
}

// Function to 'activate' images in forms.
function imgFormOn(Element, imgName)
{
    Element.src = eval(imgName + "On.src");
}

// Function to 'deactivate' images in forms.
function imgFormOff(Element, imgName)
{
    Element.src = eval(imgName + "Off.src");
}

// Function to take the user to the specified location gallery
function goLocation(selectName)
{
  selectValues = selectName.options[selectName.selectedIndex].value.split(",");

  window.location.href = "gallery.php?GalleryId=" + selectValues[0] +
    "&Type=L&Contents=" + selectValues[1];
}

// Function to take the user to the specified subject gallery
function goSubject(selectName)
{
  selectValues = selectName.options[selectName.selectedIndex].value.split(",");

  window.location.href = "gallery.php?GalleryId=" + selectValues[0] +
    "&Type=S&Contents=" + selectValues[1];
}

// Redirect a Page
function RedirectPage(RedirectURL)
{
    setTimeout("window.location.href = '" + RedirectURL + "'", 4000);
    
    return true;
}

// Re-submit the cart form
function SubmitCart()
{
			var cartForm = document.getElementById("cart_form");			
			cartForm.action = "cart.php";
			cartForm.submit();			
}

// Re-submit the cart form
function SubmitCheckout()
{
			var checkoutForm = document.getElementById("checkout_form");			
			checkoutForm.action = "checkout.php";
			checkoutForm.submit();			
}

function unhide(divID) 
{
  var item = document.getElementById(divID);
	
  if (item) 
	{
    item.className = (item.className=='hidden')?'unhidden':'hidden';
  }
}