
$(document).ready(function() {
	
	//--- ShowCase slideshow ---
	if($('#showCase li').length > 0) {
		$('#showCase ul') 
			.before('<div id="sliderpages">')
			.cycle({ 
				pager:  '#sliderpages' 
			}
		);
	}
		
	//--- ShowCaseSmall slideshow ---
	if($('#showCaseSmall li').length > 0) $('#showCaseSmall ul').cycle();
	
	//--- Cart functie: product toevoegen ---
	$('#addProductLink').click(function() {
		var $this = $(this);
		var sUrl = $.trim($this.attr('href')) + '&' + (Math.random() * 100);
		$.ajax({
			url: sUrl,
			success: function(data) {
				location.reload();
			}
		});
	});
	
	//--- Cart functie: winkelwagen legen ---
	if($('#emptyCartNow').length > 0) {
		var sUrl2 = '/ajaxcart.aspx?action=empty&' + (Math.random() * 100);
		$.ajax({
			url: sUrl2,
			success: function(data) {
				if($.trim(data) != 'empty') location.reload();
			}
		});
	}
	
	//--- Cart functie: formulier met producten vullen ---
	if($('.hiddenProduct').length > 0) {
		var prodText = "";
		$('.hiddenProduct').each(function() {
			prodText += $(this).val() + "\n";
		});
		$('.contourField.producten textarea').val(prodText);
	}
	
	//--- Tweets Carousel ---
	if($('.jcarousellite li').length > 0) {
		$(".jcarousellite").jCarouselLite({
			vertical: true,
			visible: 1,
			auto:5000,
			speed:1500
		});
	}
	
   //--- Even out home divs ---
	evenOut('.homeBox');
});

//--- Prevent curvyCorners IE alert ---
var curvyCornersVerbose = false;

//--- Even out divs ---
function evenOut(el) {
	var group = $(el);
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}

