/*****************************************************************************
 *
 *  Copyright            : Copyright (C) Morgen32
 *  Email                : info @ morgen32.nl
 *	
 *  
 *  Disclaimer:
 *	Niets uit dit script mag zonder toestemming van de maker van deze
 *	scripting gekopieerd, of doorverkocht worden aan derden. De maker van deze
 *	scripting blijft ten alle tijden copyright op dit product houden. De 
 *	scripting is ter beschikking gesteld door Morgen32.
 *	Dit programma is GEEN vrije software, en mag niet worden doorverkocht en/
 * 	of gewijzigd worden tenzij de eigenaar toestemming hiervoor heeft verleend
 *
 *****************************************************************************/

$(document).ready(function(){
						   
	if ($(window).width() < 1024) {
		$("#sidebar").css({marginLeft: "-375px"});
	}
	
	$("#content").slideDown(300,function(){
		$("#fontsettings").animate({opacity: "1"});
	});
	
	$("a").click(function(){
		var url = $(this).attr("href");
		var height = $("#content").height();
		
		$("#fontsettings").css("zIndex",1);
		$("#fontsettings").animate({marginLeft: "300px",opacity: "0"},100);
		$("#content").css({height: height+"px"});
		$("#content").animate({height: "0px"},300,"",function(){
			$(this).hide();
			if (url.indexOf("http") != -1) 	{ window.location = url; }
			else 							{ window.location = domain+"/"+url; }
		});
		return false;
	});
	
	$("#list_assortment li, #list_assortment .detail").hover(
		function(){ $(this).find(".detail").css({opacity: 0, display: "block"}).stop(true,true).animate({opacity: 1}); },
		function(){ $(this).find(".detail").css({opacity: 0, display: "none"}); }
	);
	
	$("#list_images li").hover(
		function(){ $(this).find("div").css({opacity: 0, display: "block"}).stop(true,true).animate({opacity: 1}); },
		function(){ $(this).find("div").css({opacity: 0, display: "none"}); }
   );
	$("#list_images div").click(function(){
		$(this).css({opacity: 0, display: "none"});
	});
	
	$("#order").submit(function(){
		var valvar = $("#order").find("select[name='id_variant']").val();
		var valnum = $("#order").find("select[name='num']").val();
		if (!valvar || !valnum) {
			alert('Kies aub een maat en aantal!');
			return false;
		} else {
			return;
		}
	});
});
