/**
* Standaard functies/acties	
**/
$(document).ready(function(){
	$('#contact').validate();
});

/**
* Resizing
**/

/**
* WEBSHOPFUNCTIES
**/
$(document).ready(function(){
	function adjustMargin(){
		var sWindowHeight = $(window).height();
		var iReserved = 800;
		var iReserved = $('#header').height()+$('#container').height()+$('#menu').height();
		var iContentHeight = 30;//$('#content').height();
		
		var iMargin = ((((sWindowHeight-iReserved)-iContentHeight)*1)/2).toFixed(0);
		
		if(iMargin>=1){
			$('#header').css('margin-top',(((iMargin)*1)+10) + 'px');
		}
		else{
			$('#header').css('margin-top','0px');
		}
	}
	
	/**
	* Forms valideren
	**/
	$('#form1').validate();
	$('#form2').validate();
	$('#form3').validate();
	
	
	$(document).bind("contextmenu",function(e){
        return false;
    });
    
    $('#thumbsholder img').hover(function(){
    	$(this).stop().fadeTo(100,1);
    },function(){
    	$(this).stop().fadeTo(100,0.5);
    });
    
    
    /**
    * Menu hover
    **/
    $('#menu .hoofditem').hover(function() {
        $('a',this).css('color', '#000');
    }, function() {
        $('a',this).css('color', '');
    });

    
    /**
    * Submenu hover
    **/
    $('.submenu li').hover(function(){
    	$(this).css('background-color','#fff');
    	$(this).fadeTo('fast',1);
    },function(){
    	$(this).css('background-color','');
    	$(this).fadeTo('fast',0.8);
    });
    
    /**
    * Fix submenu
    **/
    var submenuHeight = $('.submenu').height()-3;
    //$('.submenu').css('top',''+submenuHeight+'px');

    /**
    * MArgins verdelen
    **/
  	adjustMargin();
    $(window).resize(function() {
	  adjustMargin();
	});
	
	//$('#thumbsholder').toggle();
	//$('#previousThumbs').toggle();
	//$('#nextThumbs').toggle();
	$('#toggleThumbs').click(function(){
		var iSpeed =200;
		$('#thumbsholder').toggle(iSpeed);
		$('#previousThumbs').toggle(iSpeed);
		$('#nextThumbs').toggle(iSpeed);
	});
});
