$(document).ready(function() {
	
	if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) {
	    var viewportmeta = document.querySelector('meta[name="viewport"]');
	    if (viewportmeta) {
	        viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0';
	        document.body.addEventListener('gesturestart', function () {
	            viewportmeta.content = 'width=device-width, minimum-scale=0.25, maximum-scale=1.6';
	        }, false);
	    }
	}
	
	var fields = ".form_11, .form_12, .form_13, .form_14, .form_15, .form_16";
	var ua = navigator.userAgent;
	var checker = {
	  mobile: ua.match(/(iPhone|iPod|iPad|BlackBerry|Android)/)
	};
   	
   	if(!checker.mobile){
		$("#menu .sub").hover(function () {
		  	html_height = $('html').height() - 145;
		  	wrapper_height = $('#wrapper').height() - 155;
		  		  	
		  	if(html_height > wrapper_height)	$(this).height(html_height);
		    else								$(this).height(wrapper_height);
		  		
		    $(".back").fadeIn(10);
		  }, function () {
		  	$(".back").fadeOut(10);
		  }
		);
	}
	
	$(".modal").fancybox({
		'autoDimensions'	: false,
		'padding'			: 30,
		'overlayColor'		: '#1f2221'
	});
	
	if($("#veilingen").length > 0) {
		$("#veilingen").hide().fadeIn(700).addClass("loading");
		$.get("/home/veilingen-voorpagina", function(data){
			$("#veilingen").removeClass("loading").hide();
			$("#veilingen").html(data).fadeIn(700);
		});
	}
	
});









