jQuery.noConflict();
jQuery(document).ready(function($){

	/* equal product height */
	$('.product-row').each(function(){
		$(this).find('.product .text').equalHeightColumns();
	});

	/* show login */
	$('#loginLink').click(function(e){
		e.preventDefault();
		$('#login').slideToggle();
	});

	/* image popup */
	$('#productimages a').fancybox({
		overlayOpacity: 0.8,
		overlayColor: '#000'
	});
	$("a.shippingcosts, a.popup").fancybox({
		'width'						: 800,
		'height'					: '80%',
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'						: 'iframe',
		overlayOpacity: 0.8,
		overlayColor: '#000'
	});

	/* checkout info buttons */
	$("a.popup_small").live("click",function(elem){
		elem.preventDefault();
		var href = this.href;
		$.fancybox({
			'href'					: href,
			'width'					: 400,
			'height'				: 300,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'type'					: 'iframe',
			overlayOpacity: 0.6,
			overlayColor: '#000'
		});
	});

	/* search */
	default_text = 'Ihr Suchbegriff...';
	$('#keywords').focusin(function(){
		$this = $(this);
		$this.css('color', '#333');
		if ($this.val() == default_text) {
			$this.val('');
		}
	}).focusout(function(){
		$this = $(this);
		$this.css('color', '#999');
		if ($this.val() == '') {
			$this.val(default_text);
		}
	});

	/* shopping cart update quantity */
	$('#cart_quantity select.shopping_cart').change(function(){
		$('#cart_quantity').submit();
	});

	/* js test logging*/
	if ($('#jstest').length) {
		$.get('inc/js_test.inc.php?js='+$('#jstest').attr('data-cartid'));
	}

});

function showWaitMessage() {
	document.getElementById("infoDiv").style.display = "none";
	document.getElementById("waitingDiv").style.display = "block";
}

