// JavaScript Document

$(document).ready(function(){
	
	// Cycle throught the header graphics
	$("#header_graphic_container").cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		speed: 1000, 
		timeout: 5000, 
		pause: 1
	});
	
	// Set the 'newWindow' class to open links in new windows
	$('a.newWindow').click(function(){
		window.open(this.href,'newWindow','location=1,menubar=1,toolbar=1,status=1,scrollbars=1,resizable=1,width=1000,height=760');
		return false;
	})
	
	// Setup the Why your Home Needs Gutters tooltips
  $("#whyList a[title]").tooltip({

		// custom positioning
		position: 'center right',

		// move tooltip a little bit to the right
		offset: [0, 0],

		// there is no delay when the mouse is moved away from the trigger
		delay: 0
	});
	
	// Prevent the Why Your Home Needs Gutters links from following
	$("#whyList a").click(function() { 
		return false;
 });
	
}); // End document.ready


// Check the quote form inputs
function checkQuoteForm(frm) {
	
	if(frm.contactName.value == "") {
		alert("Please enter your Contact Name.");
		frm.contactName.focus();
		return false;
	}
	
	if((frm.phoneNumber.value == "") && (frm.email.value == "")) {
		alert("Please enter a Phone Number and/or Email Address.");
		frm.phoneNumber.focus();
		return false;
	}
	
	if(frm.street.value == "") {
		alert("Please enter the Street Address of your property.");
		frm.street.focus();
		return false;
	}
	
	if(frm.zipcode.value == "") {
		alert("Please enter the Zip Code of your property.");
		frm.zipcode.focus();
		return false;
	}
	
	return true;
}
