function mouseLeaves (element, evt) {
if (typeof evt.toElement != 'undefined' && evt.toElement && typeof element.contains != 'undefined') {
return !element.contains(evt.toElement);
}
else if (typeof evt.relatedTarget != 'undefined' && evt.relatedTarget) {
return !contains(element, evt.relatedTarget);
}
}

function contains (container, containee) {
while (containee) {
if (container == containee) {
return true;
}
containee = containee.parentNode;
}
return false;
}

function hideElement (element) {
if (element.style) {
$(element).fadeOut("500");
}
}

function showElement (element) {
if (element.style)
{
if (element.style.display == "block")
{
$(element).fadeOut("500");
}
else
{
//$(".topDDMenus").css("display", "none");
$(".topDDMenu").fadeOut("500");
$(element).fadeIn("500");
}
}
}

function hideAll()
{
$(".topDDMenu").fadeOut("500");
}

$(document).ready(function() {
  $('form > center > iframe').hide();
  $('.topNavADiv').hover(function() {
    $(this).addClass('selectedDiv');
  }, function() {
    $(this).removeClass('selectedDiv');
	hideAll();
  });
  
  $(document).ready(function() {
  $('.catNav ul li').hover(function() {
    $(this).addClass('selected2');
  }, function() {
    $(this).removeClass('selected2');
  });
});
});

function changeTabbedItem(b){
if(b == "1")
{
$(".tabbedLinks").css("background", "url(http://lib.store.yahoo.net/lib/shopwildthings/ey-tabbed-links-bg.jpg) no-repeat scroll center top");
}
else if(b == "2")
{
$(".tabbedLinks").css("background", "url(http://lib.store.yahoo.net/lib/shopwildthings/ey-tabbed-links-bg.jpg) no-repeat scroll center -65px");
}
else if(b == "3")
{
$(".tabbedLinks").css("background", "url(http://lib.store.yahoo.net/lib/shopwildthings/ey-tabbed-links-bg.jpg) no-repeat scroll center -130px");
}
else if(b == "4")
{
$(".tabbedLinks").css("background", "url(http://lib.store.yahoo.net/lib/shopwildthings/ey-tabbed-links-bg.jpg) no-repeat scroll center -195px");
}
else
{
$(".tabbedLinks").css("background", "url(http://lib.store.yahoo.net/lib/shopwildthings/ey-tabbed-links-bg.jpg) no-repeat scroll center -260px");
}

$(".tabbedA").removeClass('selectedTab');
$("#TabbedA" + b).addClass('selectedTab');
$(".tabbedItemsTable").css("display", "none");
$("#TabbedItemsTable" + b).css("display", "block");

}

function changeTab(b){
$(".tabs").css("display","none");
$("#Tab"+b).css("display","block");
}

function check()
{
  if(document.thecontactform.name.value.length==0)
  {
   alert('Please enter your name');
   document.thecontactform.name.focus();
   return;
  }
  if(document.thecontactform.email.value.length==0)
  {
   alert('Please enter your email address');
   document.thecontactform.email.focus();
   return;
  }
  if(document.thecontactform.phone.value.length==0)
  {
   alert('Please enter your phone number');
   document.thecontactform.phone.focus();
   return;
  }
  if(document.thecontactform.subject.value.length==0)
  {
   alert('Please enter a subject for the email');
   document.thecontactform.subject.focus();
   return;
  }
  if(document.thecontactform.message.value.length==0)
  {
   alert('Please enter your inquiry');
   document.thecontactform.message.focus();
   return;
  }
document.thecontactform.submit();
}
