$( document ).ready( function(){
	
	//init lightbox
	$('a.lightbox').lightbox();
	
	//hide all info rows
	$( "tr.info" ).css( "display", "none" );
		
	//show info row on view_details click
	$( ".product_title a.show_info" ).click( function(){
    	$( this ).parent().parent().next().toggle();
    	$( this ).blur();
    	return false;
 	});
 	
 	
 	// Initialize click handler for add to cart buttons
 	$(".add_to_cart").click(
 		function(){
 			var root = $(this).parent().parent().parent();
 			$name = $('.show_info', root).text();
 			$productId = $('input[@name=productId]', root).attr('value');
 			$quantity = $('input[@name=quantity]', root).attr('value');
 			$price = PriceToNumber($('td:eq(4)', root).text());
 			if( cartUrl != -1 ) addToCart( $name, $productId, $quantity, $price);
 			 			
 			return false;
 		}
 	);
 	
 	
 	$('#wrapper_box').after('<div id="cart_alert"><h1>Item successfully added to cart:</h1><table><tr><td class="quantity">1x</td><td>Solar Module ETSolar ET-P636110</td><td class="total">179,37 &euro;</td></tr></table><p class="total">Total: 179.37 &euro;</p>	<a class="submit close" href="#">ok</a><a class="submit cart" href="#">View Cart</a></div>');
});







