//When the page has loaded...
$(document).ready(function() {
	
	//Fix the drop down menu mouse over action for IE 6...
	$('.IE6 #navigation li').mouseenter(function() {
		$('ul', this).css('visibility', 'visible');
	});
	
	//Fix the drop down menu mouse out action for IE 6...
	$('.IE6 #navigation li').mouseleave(function() {
		$('ul', this).css('visibility', 'hidden');
	});
	
	//Start image slideshow...
	$('#slideshow').cycle();
	
	//Display fancybox links...
	$('a.fancybox').fancybox({height: 710, overlayColor: '#000000', overlayOpacity: 0.75, padding: 0, width: 505});
	
	//Call Me Autofill
	$("#callname").attr("value", "Your name");
	$("#callphone").attr("value", "Your phone number");
	$("#callemail").attr("value", "Your email address");
	$("#callname").css("color", "#999999");
	$("#callphone").css("color", "#999999");
	$("#callemail").css("color", "#999999");
	$("#callname").click(function () {if ($(this).attr("value") == "Your name") {$(this).attr("value", "");$("#callname").css("color", "#666666");}});
	$("#callname").blur(function () {if ($(this).attr("value") == "") {$(this).attr("value", "Your name");$("#callname").css("color", "#999999");}});
	$("#callphone").click(function () {if ($(this).attr("value") == "Your phone number") {$(this).attr("value", "");$("#callphone").css("color", "#666666");}});
	$("#callphone").blur(function () {if ($(this).attr("value") == "") {$(this).attr("value", "Your phone number");$("#callphone").css("color", "#999999");}});	
	$("#callemail").click(function () {if ($(this).attr("value") == "Your email address") {$(this).attr("value", "");$("#callemail").css("color", "#666666");}});
	$("#callemail").blur(function () {if ($(this).attr("value") == "") {$(this).attr("value", "Your email address");$("#callemail").css("color", "#999999");}});

	/* Call Me Check */
	function call() {
		if ($("#callname").attr("value") == "Your name") {
			alert("Please enter your name.");
			return false;
		} else if ($("#callemail").attr("value") == "Your email address") {
			alert("Please enter a valid email address.");
			return false;
		} else if ($("#callphone").attr("value") == "Your phone number") {
			alert("Please enter your phone number.");
			return false;
		} else {
			$("#callme").submit();
		}
	}
	
	$("#callme").click(function() {
		return call();
	});
	
});
