//*** Place any JavaScript to be loaded in the <head> area here. ***
$(document).ready(function() {

	//Append the InputFocus() and InputBlur() functions to any elements with the class "clearfocus"
	$(".clearfocus").focus(function() { InputFocus(this); });
	$(".clearfocus").blur(function() { InputBlur(this); });
	
	//preload CSS images
	//$.preloadCssImages();
	
	//put in transparent background on dropdown menus
	$(".nav ul li").append('<div class="background"></div>');
	$(".subnav ul li").append('<div class="background"></div>');
	
	//add in fancybox/lightbox to .lightbox class
	$(".lightbox").fancybox();
	$(".racing-lightbox").fancybox({
		'width' : 987,
		'height': '99%'
	});
	$(".vision-lightbox").fancybox({
		'width' : 717,
		'height' : 516,
	});
	
});


//*** Functions ***

function InputFocus(element) {
	if (element.value == element.defaultValue) {
		element.value = "";
	}
}

function InputBlur(element) {
	if (element.value == "") {
		element.value = element.defaultValue;
	}
}
