$(document).ready(function() {
	$('body').removeClass('noJS').addClass('hasJS');
	
	// Portfolio Images
	var origContWidth = $('.screenshot').width();
	var origImgWidth = $('.screenshot a').width();
	var origImgHeight = $('.screenshot a').height();
	var time = 1000;
	
	$('.screenshot').mouseover(function(){		
		$(this).stop().animate({
			width: "798px"
		}, time);
		$('a', this).stop().animate({
			width: "784px",
			height: "441px"
		}, time);
	}).mouseout(function(){
		$(this).stop().animate({
			width: origContWidth
		}, time);
		$('a', this).stop().animate({
			width: origImgWidth,
			height: origImgHeight
		}, time);
	});
	
	// Form Validation
	$('#contact-form').submit(function() {
		$('.error').remove();
		var hasError = false;
		$('.req-field').removeClass('warning');

		$('.req-field').each(function(){
			if ($(this).val() ==  ''){
				$(this).addClass('warning').after('<span class="error">This is a required field</span>');
			};
		});

		if ($('#info').val() != ""){
			$('#info').after('<span class="error">You seem like spam</span>');
			return false;
		}

		if ($('.req-field').hasClass('warning')) {
			return false;
		} else {
			return true;
		}
	});

});

