$(document).ready(function() 
{
	// ****
	// Contact form validation
	// ****
	if ($("#form-contact").length > 0)
		$("#form-contact").validate();

	// ****
	// Used on the home page only.  Shows and hides the "Services in the spotlight" titles
	// ****
	if ($(".spotlight").length > 0)
	{
		$(".spotlight a span").hide();
		$(".spotlight a").hover(
			function () {
				$(this).find("span").fadeIn();
			}, 
			function () {
				$(this).find("span").fadeOut();
			}
		);
	}
	
	// ****
	// Used on the home page only.  Triggers the header image cycling.
	// ****
	if ($(".home .photos").length > 0)
	{
		$(".home .photos").cycle();
	}
	
	// ****
	// Adds a "lightbox" to map links.
	// ****
	if ($(".gmap-view").length > 0)
	{
		$(".gmap-view").each(function(e) { $(this).attr("href", $(this).attr("href")+"?iframe=true&width=700&height=350") } );
		$(".gmap-view").prettyPhoto({theme: 'dark_rounded'});
	}

	if ($(".gmap-map a").length > 0)
	{
		$(".gmap-map a").click( function() { $("#gmap-body").attr("src",($(this).attr("href"))); location.href="#gmap-body"; return false; } );
		$(".gmap-reload").click( function() { $("#gmap-body").attr("src",($(this).attr("href"))); location.href="#gmap-body"; return false; } );
	}
	
});