$(document).ready(function(){

						   

/*******************************************************

LEAVE ALL THESE ALONE - THEY ARE STANDARD

*******************************************************/

	// fixes png images for ie6.

	$(document).pngFix();



	// opens anything pdf link to a new page.

	$("a[href*=.pdf]").click(function()	{

		window.open( $(this).attr('href') );

        return false;

	});

	

	// opens a link to a new page

	$('a[rel="external"]').click( function() {

        window.open( $(this).attr('href') );

        return false;

    });

	

	

	$('input[type="text"]').addClass("idleField");

	$('input[type="text"]').focus(function() {

		$(this).removeClass("idleField").addClass("focusField");

		if (this.value == this.defaultValue){ 

			this.value = '';

		}

		if(this.value != this.defaultValue){

			this.select();

		}

	});

	$('input[type="text"]').blur(function() {

		$(this).removeClass("focusField").addClass("idleField");

		if ($.trim(this.value) == ''){

			this.value = (this.defaultValue ? this.defaultValue : '');

		}

	});

/*******************************************************

FOR THIS WEBSITE.

*******************************************************/



	// Lets Deal with the drop down menus.							

	$("#van-one li").hover(

		function(){ $("ul", this).fadeIn("slow"); }, 

		function() { } 

	);

	if (document.all) {

		$("#van-one li").hoverClass("sfHover");

	}


	//$('a[rel*=facebox]').facebox({ image: 'stairs.jpg' }, 'my-groovy-style')
	$('a[rel*=facebox]').facebox();
	$('a[rel*=facebox-cap]').mousedown(function() {
			var caption = $(this).attr('title');
			$('reveal.facebox', function() {
				$("p.caption").html(caption);
				//$('<p class="caption">' + caption + '</p>').appendTo('.content'); 
			});
	}); 

	


	$("ul.colorChart li:nth-child(7n)").css("margin-right","0");











	// validate the contact form

	$("#contactForm").validate({

		rules: {

			fullName: "required",

			userEmail: "required",

			comment: "required"

		},

		messages: {

			fullName: "",

			userEmail: "",

			comment: ""

		}

	});

}); // END DOM

// For the Dropdowns in the main menu as well.

$.fn.hoverClass = function(c) {

	return this.each(function(){

		$(this).hover( 

			function() { $(this).addClass(c);  },

			function() { $(this).removeClass(c); }

		);

	});

};



function openSendFriendPop()

{

	var linkURL = $('a[rel="send_to_friend"]').attr("href");

	window.open(linkURL,"Send to a Friend","menubar=no,width=580,height=240,toolbar=no" );

	return false;

}

function popUp(URL)

{

	day = new Date();

	id = day.getTime();

	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=580,height=240,left = 350,top = 392');");

}






