$(document).ready(function(){	
	
	
	
	setAnswers();
	
	$(window).resize(function(){
		setAnswers();
	});

	
	$("strong#thankyou").fadeIn(2000);
	
	$("#overlay").click(function () {
		$("#dialog").hide();
		$(this).fadeOut(200);
		
	});
	
	
	$(".galleryitem").hover(function () {
		$(this).addClass("act");
	  }, function () {
		$(this).removeClass("act");
	});
	
	$(".btn a, .btn input").hover(function () {
		$(this).parent().parent().removeClass("act");
		$(this).parent().parent().addClass("mo");
	  }, function () {
		$(this).parent().parent().removeClass("act");
		$(this).parent().parent().removeClass("mo");
	});
	
	$(".btn a, .btn input").mousedown(function () {
		$(this).parent().parent().removeClass("mo");
		$(this).parent().parent().addClass("act");
	  }, function () {
		$(this).parent().parent().removeClass("act");
		$(this).parent().parent().addClass("mo");
	});
	
	$(".btn_big, .johnlineplus").hover(function () {
		$(this).removeClass("act");
		$(this).addClass("mo");
	  }, function () {
		$(this).removeClass("act");
		$(this).removeClass("mo");
	});
	
	$(".btn_big, .johnlineplus").mousedown(function () {
		$(this).removeClass("mo");
		$(this).addClass("act");
	  }, function () {
		$(this).removeClass("act");
		$(this).addClass("mo");
	});

	
	$(".tab").hover(function () {
		$(this).addClass("mo");
	  }, function () {
		$(this).removeClass("mo");
	});
	
	var inputtxt = $("input#askjohn").val();
	
	$("input#askjohn").hover(function () {
		$(this).parent().parent().addClass("mo");
	  }, function () {
		$(this).parent().parent().removeClass("mo");
	});
	
	$("input#askjohn").focus(function(){
		$(this).parent().parent().addClass("act");
		if($(this).val() == inputtxt){
			$(this).val("");
		}
		$("#letop").html("Vul je naam in.").fadeIn(300);
	});
	
	$("input#askjohn").blur(function(){
		$(this).parent().parent().removeClass("act");
		if($(this).val() == ""){
			$(this).val(inputtxt);
		}
		$("#letop").html("Vul je naam in.").fadeIn(300);
	});
	
	$('#gallery').serialScroll({
		items:'div',
		prev:'#galleryleft',
		next:'#galleryright',
		start:0,
		duration:1200,
		force:true,
		stop:true,
		lock:false,
		step: 3,
		cycle: true,
		easing:'easeOutElastic'
	});
	
	$('.videoblock_gallery').serialScroll({
		//target:'.videoblock_lijst',
		items:'div',
		prev:'.videoblock_left',
		next:'.videoblock_right',
		start:1,
		duration:1200,
		force:true,
		stop:true,
		lock:false,
		step: 1,
		cycle: true,
		easing:'easeOutElastic'
	});
});

function setAnswers(){
	var offset 		= 	$("#WRAPPER").offset();
	var positie 	= 	offset.left;
	
	var origwidth	=	$(".johnline").width();
	var wJohnline	=	parseInt(positie + 600);
	var wJohnline2	=	parseInt(positie + 540);
	
	
	
	
	$(".johnline").css("width",wJohnline+"px");
	$(".johnline_content").css("width",wJohnline2+"px");
};





