$(document).ready(function(){
	
	$('body, img, div').pngFix();
	
	$("#enquiryForm").validate({
		errorClass: "inputError", 
		errorElement: "div",
		highlight: function(element, errorClass) {
			$(element).addClass("inputErrorHighlight");
		},
		unhighlight: function(element, errorClass) {
			$(element).removeClass("inputErrorHighlight").removeClass("inputError");
		}
	});
	
	$("#editForm").validate({
		errorClass: "inputError", 
		errorElement: "div",
		highlight: function(element, errorClass) {
			$(element).addClass("inputErrorHighlight");
		},
		unhighlight: function(element, errorClass) {
			$(element).removeClass("inputErrorHighlight").removeClass("inputError");
		},
		rules: {
			meta: {required: true, maxlength: 255 },
			name: { required: true },
			pcontent: { required: true }
		},
		messages: {
			meta: 'REQUIRED FIELD - Max length of 255!',
			name: 'REQUIRED FIELD: Please enter a page title!',
			pcontent: 'REQUIRED FIELD: Please enter page content!'
		}

	});
	
	$('#header').hide();
	$('#header').fadeIn('slow');
	
	$('#header a img#logo, #header img#buildings').hover( 
		function () { $(this).stop().animate({ "opacity": 0.5 }); }, 
		function () { $(this).stop().animate({ "opacity": 1 }); }
	);
	
	
	$('#hlpMetaDesc').hide();
	$("img#metaHelp").click(function () {
		$('#hlpMetaDesc').toggle();
	});
	
	$('div.success').fadeOut().fadeIn().fadeOut().fadeIn().fadeOut(25000);
	
	
});