$(document).ready(function() {
  $(".panel").fadeTo(0, 0);
	
   if($(window).width() <= 1024 || $(window).height() <= 768) {
		//alert("klein scherm"); 
		$(".panel").css( { width: "850px", top: "200px" } );
		$(".right").css( { width: "600px" } );
		$(".txt").css( { width: "554px", height: "200px" } );
  }
   
  $('.txt').jScrollPane( { dragMaxHeight: 40, showArrows: 1 } );
  $.fn.supersized.options = {  
	  startwidth: 550,  
	  startheight: 330,
	  vertical_center: 1,
	  slideshow: 1,
	  transition: 1,
	  slide_interval: 8000  
  };
  $('#supersize').supersized(); 
  
  $('.formSubmit').click(function() {
		var fout = 0;
		if( $("#contactpersoon").val() == "" ) {
			fout = 1;
			$("#contactpersoon").addClass("error");
		} else {
			$("#contactpersoon").removeClass("error");
		}
		if( $("#bedrijf").val() == "" ) {
			fout = 1;
			$("#bedrijf").addClass("error");
		} else {
			$("#bedrijf").removeClass("error");
		}
		if( $("#emailadres").val() == "" ) {
			fout = 1;
			$("#emailadres").addClass("error");
		} else {
			$("#emailadres").removeClass("error");
		}
		if( $("#telefoon").val() == "" ) {
			fout = 1;
			$("#telefoon").addClass("error");
		} else {
			$("#telefoon").removeClass("error");
		}
		if( $("#opmerkingen").val() == "" ) {
			fout = 1;
			$("#opmerkingen").addClass("error");
		} else {
			$("#opmerkingen").removeClass("error");
		}
		if( $("#code").val() == "" ) {
			fout = 1;
			$("#code").addClass("error");
		} else {
			$("#code").removeClass("error");
		}
		if(fout ==  0) {
			$(this).parent().submit();
		}
   });
  
  // Schuif stukje in als er geen submenu is
  if( $("#smenu").size() == 0 ) {
		$(".panel").css("left", "-100px"); 
  }

});
