// Standard jQuery header
;(function($) {

	$.noConflict();
	
    $(document).ready(function() {
    
    
    	// Contact dropdown control

    	$("#ContactWrapper").hide();
    	$("#Overlay").hide();
    	var docHeight = $(document).height();
    	$("#Overlay").height(docHeight);
     
    	$("#OpenContact").click(function () {
    		$("#Overlay").fadeIn("slow",function() {
    			$("#ContactWrapper").fadeIn("slow");
    		});
    	});	
    	
    	$(".dropHeader a").click(function () {
    		$(".contentDrop").fadeOut("slow",function() {
    			$("#Overlay").fadeOut("slow");
    		});
    	});	

    	$("#Overlay").click(function () {
    		$(".contentDrop").fadeOut("slow",function () {
    			$("#Overlay").fadeOut("slow");
    		});
    	});	
    
    	// Sharing Block Hover Dropdown
    	
		//$("#SharingLinks").css({'top' : '-128px'});
		
		
		$("#SharingLinks").hover(
			function(){
				$("#SharingLinks").delay(500).animate({'top' : '0px'},250);
			},
			function(){
				$("#SharingLinks").stop(true,false).delay(750).animate({'top' : '-160px'},250);
			}
		);
    
    	// Navigation Pop-Ups
    	
    	$("li.navPopUp,li.navPopUpXL").css({'margin-top' : '68px'});
    	    	
    	$(".navPopUp").hover(
			function () {
				$(this).delay(350).animate({"margin-top": "20px"}, "slow");
			}, 
			function () {
				$(this).stop(true,false).delay(750).animate({"margin-top": "68px"}, "slow");
			}
		);
		
    	// Navigation Pop-Ups - Expanded List
    	    	
    	$(".navPopUpXL").hover(
			function () {
				$(this).delay(350).animate({"margin-top": "0px"}, "slow");
			}, 
			function () {
				$(this).stop(true,false).delay(750).animate({"margin-top": "68px"}, "slow");
			}
		);


		// Contact Form Validation
		
		$("#ContactForm_PageContact").validate({
			rules:{
				Name:{
					required: true,
					minlength: 2
				},
				Email:{
					required: true,
					email: true
				},
				Message: {
					required: true,
					minlength: 20
				}
			},
			messages:{
				Name: "Please enter your name",
				Email: "Please enter a valid email address",
				Message: "Please enter 20 character minimum"
			}
		});

    // Standard jQuery footer
    })
})(jQuery);	
