$(document).ready(function(){
	$('.iefix').parent().pngFix();

	//Tabs
	
	$("li.tab").hover(function(){
		if($(this).hasClass('active')){
			return;
		}else{
			$(this).css("background-position", "0 -70px");
		}
		},
		function(){
		if($(this).hasClass('active')){
			$(this).css("background-position", "0 0px");
		}else{
			$(this).css("background-position", "0 -35px");
		}
	});
	
	$("li.tab").click(function(){
		var curTab = $('li.tab').index(this);
		$('div.tab').hide();
		$('div.tab').eq(curTab).show();
		$('li.tab').removeClass('active');
		$('li.tab').eq(curTab).addClass('active');
		$("li.tab:not(this)").css("background-position", "0 -35px");
		$(this).css("background-position", "0 0px");
	});
	
	//form validation
	$('form#contact').submit(function(){
		var requiredIndex = $('.required').length;
		var required = $('.required');
		for(x=0;x<requiredIndex;x++){
			if(required.eq(x).val()==""){
			   requiredError();
			   return false;
			}
		}
		/*if($('.required').attr('value')==""){
			alert((!$('.required').attr('value')=="").length);
			return false;
		}else{
			alert('hello');
			return false;
		}*/
		//return false;
	});
	
	function requiredError(){
		$('.error').slideDown();
	}
});