var Site = {

	cd: function(url) {

		if(confirm('Bent u zeker dat u dit product wil verwijderen?')) window.location.href = url;

	},

	cp: function() {

		if(jQuery('select[name="qty"]').length && jQuery('input[name="price"]').length && jQuery('div.price').length) {

			var val = jQuery('select[name="qty"]').attr('value') * jQuery('input[name="price"]').attr('value');
			val = parseFloat(val).toFixed(2);

			jQuery('div.price').html('&euro; '+val);
			//jQuery('div.price').html('&euro; '+val.replace('.', ',', val));

		}

	},

	em: function() {

		document.write('<a href=\'mailto&#58;info&#64;%62r&#105;%&#54;7%69%74t%6&#53;r%6&#49;&#118;e&#37;6C&#46;&#99;om\'>info&#64;brigit&#116;erave&#108;&#46;com</a>');

	},

	fb: function() {

		if(jQuery('a.fb').length) jQuery('a.fb').fancybox({overlayColor:'#000', overlayOpacity:'0.7'});

	}

};

// execute some scripts when document is loaded
jQuery(document).ready(function () {

	// check body-wrapper
	if(jQuery('#body-wrapper').length) {

		var minHeight = 550;
		if(jQuery('#body-wrapper').height() < minHeight) jQuery('#body-wrapper').css({height:minHeight+'px'});

	}

	// set equal heights for products description
	if(jQuery('ul.list-products').length) {

		var maxHeight = 0;
		jQuery('ul.list-products .description').each(function(){if(jQuery(this).height() > maxHeight) maxHeight = jQuery(this).height();});
		jQuery('ul.list-products .description').css({height:maxHeight+'px'});

	}

	// see if we have to calculate our price
	if(jQuery('select[name="qty"]').length) {

		jQuery('select[name="qty"]').change(function(){Site.cp()});
		Site.cp();

	}

	// fancybox
	Site.fb();

});

