$(window).load(function () {

	$('#logo').mouseenter( function() {
		$(this).stop().animate({ 'opacity' : 0.7 }, 300 );
		});

	$('#logo').mouseleave( function() {
		$(this).stop().animate({ 'opacity' : 1 }, 300, function() {
			$(this).removeAttr('style');
			});
		});

	$('.thumb img, .resource img').mouseenter( function() {
		$(this).stop().animate({ 'opacity' : 0.7 }, 200 );
		});

	$('.thumb img, .resource img').mouseleave( function() {
		$(this).stop().animate({ 'opacity' : 1 }, 300, function() {
			$(this).removeAttr('style');
			});
		});
		
	$("li a.projects").click( function() {
	alert("Coming Soon!");
	});

	$("#contact").validate();

	$.validator.setDefaults({
		submitHandler: function() {

			$form = $(this).closest('form');
			$name = $('input[name=name]', $form);
			$phone = $('input[name=phone]', $form);
			$company = $('input[name=company]', $form);
			$message = $('input[name=message]', $form);

			if ($name.val() != $name.attr('data-default') ) {
			} else {
				$('input[name=name]', $form).val('');
				}
			if ($phone.val() != $phone.attr('data-default') ) {
			} else {
				$('input[name=phone]', $form).val('');
				}
			if ($company.val() != $company.attr('data-default') ) {
			} else {
				$('input[name=company]', $form).val('');
				}
			if ($message.val() != $message.attr('data-default') ) {
			} else {
				$('textarea[name=message]', $form).val('');
				}

		}
	});

	$('input[type=text], textarea').each(function() {

		var field = $(this);
		var default_value = field.val();

		field.focus(function() {
			if (field.val() == default_value) {
				field.val('').removeClass('inactive');
				}
			});

		field.blur(function() {
			if (field.val() == '') {
				field.val(default_value).addClass('inactive');
				}
			});

		});

	});
