$(document).ready(function() {

	// loop through all form fields and style default text
	$("fieldset input, fieldset textarea").each(
		function(i){
			if ($(this).attr('placeholder') != '') {
		        if ($(this).val() == $(this).attr('placeholder')) {
		            $(this).addClass('inactive');
		        }
		    }
	    }
	);
	
	// show and hide the default text on form fields
	$("fieldset input, fieldset textarea").focus(
		function() {
			if ($(this).attr('placeholder') != '') {
				if ($(this).val() == $(this).attr('placeholder')) {
					$(this).removeClass('inactive');
					$(this).val('');
				}
			}
		}
	);
	$("fieldset input, fieldset textarea").blur(
		function() {
			if ($(this).attr('placeholder') != '') {
				if ($.trim($(this).val()) == '') {
					$(this).addClass('inactive');
					$(this).val($(this).attr('placeholder'));
				}
			}
		}
	);
	
	// expose the contact form
	$('#contact').prepend('<a class="close" href="#">Close</a>');
	$('a.contact-trigger').click(function(){
		$('#contact').animate({'left':'0px'}, 250);
		return false;
	});
	$('#contact a.close').click(function(){
		$('#contact').animate({'left':'-615px'}, 250);
		return false;
	});

});
