// JavaScript Document
function roll_over(img_name, img_src) {
   document[img_name].src = img_src;
}

function mouseOver(imgid,imgpath) {
	document.getElementById(imgid).src =imgpath;
}
function mouseOut(imgid,imgpath) {
	document.getElementById(imgid).src =imgpath;
}

$(document).ready(function() {
	$(".gallery_img").fadeTo("fast", 1.0); 
	$(".gallery_img").hover(function() {
	$(this).fadeTo("fast", 0.6);}, 
	function() {
		$(this).fadeTo("fast", 1.0); 
	});
	
	$(".location_img").fadeTo("fast", 1.0); 
	$(".location_img").hover(function() {
	$(this).fadeTo("fast", 0.6);},
	function() {
		$(this).fadeTo("fast", 1.0); 
	});
	
	$(".community_img").fadeTo("fast", 1.0);
	$(".community_img").hover(function() {
	$(this).fadeTo("fast", 0.6);}, 
	function() {
		$(this).fadeTo("fast", 1.0);
	});	
	
	$(".coupon_img").fadeTo("fast", 1.0);
	$(".coupon_img").hover(function() {
	$(this).fadeTo("fast", 0.6);}, 
	function() {
		$(this).fadeTo("fast", 1.0); 
	});		

	$(".print_menu").fadeTo("fast", 1.0); 
	$(".print_menu").hover(function() {
	$(this).fadeTo("fast", 0.8);}, 
	function() {
		$(this).fadeTo("fast", 1.0); 
	});	
	
	$(".social").fadeTo("fast", 1.0); 
	$(".social").hover(function() {
	$(this).fadeTo("fast", 0.8);}, 
	function() {
		$(this).fadeTo("fast", 1.0); 
	});		

});

function clearText(thefield) {
  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
} 
function replaceText(thefield) {
  if (thefield.value=="") { thefield.value = thefield.defaultValue }
}

function ValidateMain() {
	if (document.mainstreet.saddr.value=='Enter starting address (400 Main Street, Longmont CO)' || document.mainstreet.saddr.value=='') {
      alert("Please your starting address to get directions to our Main Street Location.");
	  document.mainstreet.saddr.focus();	
      return false;
	}
}
function ValidateHover() {
	if (document.hoverstreet.saddr.value=='Enter starting address (1729 Hover Street, Longmont CO)' || document.hoverstreet.saddr.value=='') {
      alert("Please your starting address to get directions to our Hover Street Drive Thru Location.");
	  document.hoverstreet.saddr.focus();	
      return false;
	}
}
function ValidateFrancis() {
	if (document.francisstreet.saddr.value=='Enter starting address (1139 Francis Street, Longmont CO)' || document.francisstreet.saddr.value=='') {
      alert("Please your starting address to get directions to our Francis Street Location.");
	  document.francisstreet.saddr.focus();	
      return false;
	}
}
