$(document).ready(function(){
	$.localScroll({offset: {top:-220}, speed: 800});

	

	
	
	
	
	
	$('#form1').submit(function(){
		naam = $('input[name="naam"]').val();
		email = $('input[name="email"]').val();
		bericht = $('textarea[name="bericht"]').val();
		
		
		
		if(bericht == ''){ errors = "Vul een bericht in.";}
		if(email == ''){ errors = "Vul een email adres in.";}
		if(naam == ''){ errors = "Vul een naam in.";}
		
		if(errors != ''){ alert(errors); errors = '';
		return false;}
	});
	

	
	$("a[href='#close']").live("click", function(){
	  $('#portfolioImage').fadeOut();
	  setTimeout(function(){
		  $('#portfolioImage').remove();
	  },500);
      $("#overlay").fadeOut();
	  return false;
    });
	
	$("#portfolio img").click(function(){
		
		rel = $(this).attr('rel');
		newConstruct = "<div id='portfolioImage'><a href='#close'>Terug naar de site</a><img src='images/portfolio/" + rel + "_L.jpg' /></div>";
		setTimeout(function(){
			$('#portfolioImage a').fadeIn(0);
			$('#portfolioImage a').animate({top:0},300);
		},200);
		$("#hook").html(newConstruct);
		$('#overlay').fadeIn();
		$('#portfolioImage img').animate({marginTop:50});
	});
	
	$('a[href="#web"]').click(function(){
		$('#portfolioSelect a').removeClass('active');
		$(this).addClass('active');
		$('.largeBox[rel="graphics"]').css({display:"none"});
		$('.largeBox[rel="web"]').css({display:"block"});
		return false;
	});
	$('a[href="#graphics"]').click(function(){
		$('#portfolioSelect a').removeClass('active');
		$(this).addClass('active');
		$('.largeBox[rel="graphics"]').css({display:"block"});
		$('.largeBox[rel="web"]').css({display:"none"});
		return false;
	});
});


