$(document).ready(function(){

	// Tekst delay 
	$('.slogan').delay(500).fadeIn(750);


	// Scroll 
	$('.omhoog').click(function(event){
	event.preventDefault();
		$('html, body').animate({scrollTop:0}, 'slow');
	});


	// Portfolio 
	$('.portfolioItem').hover(function() {
		$('img', this).animate({opacity:1}, 150);
	}, function() {
		$('img', this).animate({opacity:.5}, 250);
	});
	

	// Portfolio 
	$('.hoofdMenu li.hoofditem').hover(function() {
		$('a.sifr', this).animate({opacity:1}, 150);
	}, function() {
		$('a.sifr', this).animate({opacity:0.6}, 250);
	});

	
	// Hoofdmenu sub
	$(".hoofdMenu li").hover(function() {
		$(this).addClass("over");
		$('.hoofdMenuSub', this).stop(true, true).slideDown(250);
	}, function() {
		$(this).removeClass("over");
		$('.hoofdMenuSub', this).stop(true, true).slideUp(0);
	});


	// Home slider
	$('#homeSlider').cycle({
		fx: 		'fade',
		timeout:	6000,
		speed:		500,
		pager:		'#homeSliderNav',
		pause:   	1
	});
	
	
	// Home slider Text
	$("#homeSlider").hover(function() {
		$('.homeSliderTitel', this).stop(true, true).animate({ marginTop: '205px'}, 200);
	}, function() {
		$('.homeSliderTitel', this).stop(true, true).delay(500).animate({ marginTop: '245px'}, 200);    
	});

	
	// Tooltips
    $('.socialIcon').tipsy({
		fade: false,     // fade tooltips in/out?
		gravity: 's',    // gravity
		offset: 4,       // pixel offset of tooltip from element
		opacity: 1,    // opacity of tooltip
	});
	

	// Social media 
	$('.socialIcon').hover(function() {
		$(this).stop(true, true).animate({opacity:1}, 150);
	}, function() {
		$(this).stop(true, true).animate({opacity:.3}, 250);
	});
	


	// Zoeken
	jQuery(function($){
		if(! ( $.browser.msie && parseInt($.browser.version)==7 ) ) {
			typewriter();
			setInterval(function(){ typewriter() },60000);
		}
	});

	$("#s").bind('focusin',function(){ $(this).val(''); });
	
	function typewriter(){
		$("#s").val('');
			var i=0,str = "Vul uw zoekwoord in..";
			var timer = setInterval(function(){
			if(i==str.length) {
				clearInterval(timer);
				return;
			}
		$("#s").val($("#s").val()+str[i]);
		i++;
		},100);
	}
});


