$(document).ready(function() {

  // any image with a 'toggle' class will toggle when you mouse over it
  // (unless it has the 'on' class, in which case it should stay on)
  $("img.toggle:not(.on)").hover(function() {
      var src = $(this).attr('src');
      src = src.replace(/_(on|off)\./, '_on.');
      $(this).attr('src', src);

    }, function() {
      var src = $(this).attr('src');
      src = src.replace(/_(on|off)\./, '_off.');
      $(this).attr('src', src);

    });
    
    $('#about').hover(function(){
		$('#div1').attr('src', '/images/nav_div_on.gif');
	}, function() {
		  $('#div1').attr('src', '/images/nav_div.gif');
		}
	)
	
	$('#buzz').hover(function(){
		$('#div1').attr('src', '/images/nav_div_on.gif');
		$('#div2').attr('src', '/images/nav_div_on.gif');
	}, function() {
		  $('#div1').attr('src', '/images/nav_div.gif');
		  $('#div2').attr('src', '/images/nav_div.gif');
		}
	)
	
	$('#locations').hover(function(){
		$('#div2').attr('src', '/images/nav_div_on.gif');
		$('#div3').attr('src', '/images/nav_div_on.gif');
	}, function() {
		  $('#div2').attr('src', '/images/nav_div.gif');
		  $('#div3').attr('src', '/images/nav_div.gif');
		}
	)
	
	$('#contact').hover(function(){
		$('#div3').attr('src', '/images/nav_div_on.gif');
	}, function() {
		  $('#div3').attr('src', '/images/nav_div.gif');
		}
	)

	$("#success").fadeIn(1000).fadeOut(1000);




	
	
});

function validateLocationData(){
	var s = "";
	with (document.frmLocation) {
	if (Email.value.length == 0) {
		s += "\nPlease provide your email address."
	}
	if (s.length==0) {
		with (document.frmLocation) {
		} 
		return true;
	}
		else {
			alert("Your sign up could not be completed for the following reason(s):\n" + s);
			return false;
		}
	}
}


function validateBuyerData(){
	var s = "";
	with (document.frmBuy) {
	if (Email.value.length == 0) {
		s += "\nPlease provide your email address."
	}
	if (s.length==0) {
		with (document.frmBuy) {
		} 
		return true;
	}
		else {
			alert("Your sign up could not be completed for the following reason(s):\n" + s);
			return false;
		}
	}
}

function validateShippingData(){
	var s = "";
	with (document.frmShipping) {
	if (Name.value.length == 0) {
		s += "\nPlease tell us your name."
	}
	if (Address1.value.length == 0) {
		s += "\nPlease tell us your address."
	}
	if (City.value.length == 0) {
		s += "\nPlease tell us your city."
	}
	if (State.value.length == 0) {
		s += "\nPlease tell us your state."
	}
	if (Zip.value.length == 0) {
		s += "\nPlease tell us your zip code."
	}
	if (Email.value.length == 0) {
		s += "\nPlease tell us your email address."
	}
	if (s.length==0) {
		with (document.frmShipping) {
		} 
		return true;
	}
		else {
			alert("Your sign up could not be completed for the following reason(s):\n" + s);
			return false;
		}
	}
}

function validatePaymentData(){
	var s = "";
	with (document.DoDirectPaymentForm) {
	if (firstName.value.length == 0) {
		s += "\nPlease tell us your first name."
	}
	if (lastName.value.length == 0) {
		s += "\nPlease tell us your last name."
	}
	if (creditCardNumber.value.length == 0) {
		s += "\nPlease enter your credit card number."
	}
	if (cvv2Number.value.length == 0) {
		s += "\nPlease enter the CVN for your credit cart."
	}
	if (address1.value.length == 0) {
		s += "\nPlease enter your address."
	}
	if (city.value.length == 0) {
		s += "\nPlease enter the name of your city."
	}
	if (state.value.length == 0) {
		s += "\nPlease enter your state."
	}
	if (zip.value.length == 0) {
		s += "\nPlease enter your ZIP code."
	}
	if (s.length==0) {
		with (document.DoDirectPaymentForm) {
		} 
		return true;
	}
		else {
			alert("Your sign up could not be completed for the following reason(s):\n" + s);
			return false;
		}
	}
}


function confirmDelete(delUrl) {
  if (confirm("Are you sure you want to remove this item?")) {
    document.location = delUrl;
  }
}

function confirmEmpty(delUrl) {
  if (confirm("Are you sure you want to empty your cart?")) {
    document.location = delUrl;
  }
}

