// JavaScript Document


$(document).ready(function(){	
	
	
	var p = 1;
	$('.list').each(function(){
		if(p%2==0) {
			$(this).addClass('elem2');
			p=1;
		}
		else {
			p++;
		}
	});
	
	
	// change all buttons like basket and waiting room
	$('img').each(function(){
		if($(this).attr('src')=='img/przechowalnia.gif') {
			$(this).attr({'src' : 'szablon/img/waiting.png'});
		}
	});
	
	$('img').each(function(){
		if($(this).attr('src')=='img/przechowalnia_usun.gif') {
			$(this).attr({'src' : 'szablon/img/waiting_delete.png'});
		}
	});
	
	$('.produktIndexButtons input').each(function(){
		$(this).attr({ 'src' : 'szablon/img/basket.png' });	
	});
	
	$('.promoButtons input').each(function(){
		$(this).attr({ 'src' : 'szablon/img/basket.png' });	
	});
	
	var indexBox = 1;
	$('.produktIndexBox').each(function(){
		if(indexBox%2==0) {
			$(this).css({
				'margin-left': 0, 
				'margin-right' : 0
			});
			indexBox = 1;
		}
		else
			indexBox++;
	});
	
	$('.shortInfo').each(function(){
		var shortInfo = $(this).find('div').html();
		var shortInfo_new = shortInfo.substr(0,100)+"...";
		
		
		 $(this).find('div').html(shortInfo_new);
		
	});
	
	$('.productToBasket').find('input:image',function(){
			$(this).attr({'src':'szablon/img/p_koszyk.gif'});	
	});
	
	// png fix for IE
	$(document).pngFix( );
	
});
