//categorieFilter
$(document).ready(function() {
	$('#menu ul li a').hover(function() {
		$(this).stop().animate({ 'padding-top': '5px'}, 100);
	}, function() {
		$(this).stop().animate({ 'padding-top': '10px'}, 100);
	});
	
	$("a.fancybox").fancybox();		
});

$('.categorieFilter').click(function() {
	var cat = $(this).attr("title");
	if($(this).hasClass("onzichtbaar")) {
		$(".cat"+cat).fadeIn();
		$(this).removeClass("onzichtbaar");
	} else {
		$(".cat"+cat).fadeOut();	
		$(this).addClass("onzichtbaar");
	}
	
});

$('.toevoegenaanwinkelmand').click(function() {
	var link = "?pagina=webshop&product=" + $("#code").val() + "&actie=toevoegen&maat=" + $("#maat").val() + "";
	location.href = link;
	return false;
});

$('.aantal').click(function() {
	var link = "?pagina=webshop&actie=aantalwijzigen&id=" + $(this).attr("rel") + "&aantal=" + $(this).val() + "";
	location.href = link;
	return false;
});

$('.adresform_submit').click(function() {
	//var link = $(this).attr("href");
	var link = 'http://bruidsboutiqueaurelia.nl/?pagina=bestellen&actie=adresgegevensopslaan';
	var newlink = '?pagina=bestellen&actie=betaalwijze';
	
	$.post(link, $("#bestelform").serialize(), function(data) {
		if(data == 'succes') {
			location.href = newlink;
		} else {
		  $('#feedback').html(data);
		}
	});	
	
	//location.href = link;
	//alert(link);
	return false;
});



