$(document).ready(function() {
	$("li").hover(
      function () {
        $(this).addClass('hover');
      }, 
      function () {
        $(this).removeClass('hover');
      }
    );
    
    $('body.contactUs form input.clearForm').show();
    $('body.contactUs form input.clearForm').click(function () { 
    	$(this).parent('p').parent('form').each(function(){
	        this.reset();
	  	});
    });

	$('a[ref="nolink"]').css('cursor','default').click(function () { 
	    return(false);
	});
	
	var container = $("#content div.error-container");
	$.validator.setDefaults({
		errorLabelContainer: container
	});
	
	
	$('body.contactUs #contact-mailer').validate({
		rules: {
					name: "required",
					email: {
						required: true,
						email: true
					},
					needs: "required"
				},
		messages: {
			name: "Please enter your name",
			email: {
				required: "Please enter your email",
				email: "Email isn't formated correctly"
			},
			needs: "Please tell us your needs"
		}
	});
	
	$('a[rel*=facebox]').click( function() {
		thisdoc = $(this).attr('target');
		thislink = $(this).attr('href');
		thislink = thislink+"?myDoc="+thisdoc;
		$.post(thislink, function(data) {
		    $.facebox(data);
		  });
		return(false);
	});
	
	/*$('a[rel*=facebox]').click( function() {
		thisdoc = $(this).attr('target');
		thislink = $(this).attr('href');
		thislink = thislink+"?myDoc="+thisdoc;
		$.post(thislink, function(data) {
		    alert(data);
		  });
		
		
		return(false);
	});
	*/
});
