$(document).ready(function(){
						   
/*******************************************************
LEAVE ALL THESE ALONE - THEY ARE STANDARD
*******************************************************/
	// fixes png images for ie6.
	jQuery(document).pngFix();

	// opens anything pdf link to a new page.
	$("a[href*=.pdf]").click(function()	{
		$(this).attr({"target":"_self"});
		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.
*******************************************************/
	/*$(document).bind("contextmenu",function(e){
        return false;
    });*/
	
	$("#vanID li a.aboutUs").css("padding-left","0");
	$("#vanID li.vanLast a").css("padding-right","0");
	
	// footer
	$(".footerLine1 a:last").css("border-right","none");
	
	

	// Lets Deal with the drop down menus.							
	$("#nav li").hover(
		function(){ $("ul", this).fadeIn("slow"); }, 
		function() { } 
	);
	if (document.all) {
		$("#nav li").hoverClass("sfHover");
	}
	$(".main:nth-child(5)").css("color","lime"); //.css("padding-right","0");



	// FOR THE EVENT CATEGORY DROP DOWN. WHEN ONE IS SELECTED THE URL WILL CHANGE
	$("#eCat").change(function(){
		var infoValue = $("#eCat :selected").val();
		location.href = infoValue;
	});




	$('select').addClass("idleField").css("padding","1px");
	$('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 the contact textarea	
	$('#comment').addClass("idleField");
	$('#comment').focus(function() {
		$(this).removeClass("idleField").addClass("focusField");
		if (this.value == this.defaultValue){ 
			this.value = '';
		}
		if(this.value != this.defaultValue){
			this.select();
		}
	});
	$('#comment').blur(function() {
		$(this).removeClass("focusField").addClass("idleField");
		if ($.trim(this.value) == ''){
			this.value = (this.defaultValue ? this.defaultValue : '');
		}
	});

	
	
	
	// 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=300,left = 350,top = 392');");
}



