function css() {

	
	/* wykończenia list */
	$('.mod-menu li a').wrap('<span></span>');

	if($('input[name=add_user]').attr('checked') == true)
		$('#schowek-1').show();
	else
		$('#schowek-1').hide();
	

	if($('input[name=f_vat]').attr('checked') == true)
		$('#schowek-2').show();
	else
		$('#schowek-2').hide();
	
	$('.mod-menu ul ul a').wrap('<span></span>');
	
	$('input[name=add_user]').bind('click', function() {
		if($(this).attr('checked') == true){
			$('#schowek-1').show();
		}
		else{
			$('#schowek-1').hide();
		}
	});

	$('input[name=f_vat]').bind('click', function() {
		if($(this).attr('checked') == true){
			$('#schowek-2').show();
		}
		else{
			$('#schowek-2').hide();
		}
	});	
	
	$('#content .mod .h').before('<span class="h-top"></span>');
	
	$('.prod-list').each(function(){
		$(this).children('.i').each(function(i){
			if(i%3 == 2) 
				$(this).after('<li class="divider"><hr /></li>');
		});
	});
	
	$('.col-list').each(function(){
		$(this).children('.i').each(function(i){
			if(i%2 == 1) 
				$(this).addClass('last-in-row').after('<li class="divider"><hr /></li>');
		});
	});
	
	/* wykończenia modułów */
	$('#content .mod, .side-bar .mod-1 .i, #welcome-info .tab').append('<div class="x"></div>');
	$('.side-bar #mod-login.login .h').append('<img src="/image/img-logout.png" />');
	$('.mod-goodies .h').append('<img src="/image/img-goodies.png" />');
	$('#mod-cart .h').append('<img src="/image/img-cart.png" />');
	$('#mod-subscribe .h').append('<img src="/image/img-biuletyn.png" />');
	
	
	/* funkcje */
	$('#welcome-info').tabs();
	
	/* obliczanie sumy koszyka */
	if($('#tbl-cart').size() > 0){
		var ship_val, total_val;
		total_val = $('.cart-grand-total').html();
		ship_val = document.getElementById('shipping-method').selectedIndex;
		ship_val = $('#shipping-method option').eq(ship_val).attr('value');
		ship_val = ship_val == 0 ? 0: ship_arr[ship_val];
		$('.cart-grand-total').attr('rel',total_val);
		
		
		chargeShipping(ship_val,total_val);
		
		$('select#shipping-method').change(function(){
			ship_val = $(this).val();
			ship_val = ship_val == 0 ? 0: ship_arr[ship_val];
			total_val = $('.cart-grand-total').attr('rel');
			chargeShipping(ship_val,total_val);
	
		});	
	} // if
		
	function chargeShipping(ship,total){
		ship_val = parseInt(ship);
		total_val = parseInt(total);
		
		if(ship_val == 0)
			$('.cart-shipping-method').parent().hide();
		else {
			$('.cart-shipping-method').parent().show();
			$('.cart-shipping-method').html(ship_val);
		}
		$('.cart-grand-total').html(total_val+ship_val);
	}


	/* go on for IE in generall */
	if($.browser.msie){
		
		/* take care IE 6 only */
		if($.browser.version <= 6) {
			$('#top #nav li:first-child, #breadcrumbs li:first-child, #content .mod .h .cats-list li:first-child, .tbl-prods th:first-child, .tbl-prods td:first-child, .side-bar #mod-login form ul li:first-child, #footer ul li:first-child').addClass('first-child');
			
			
			$('img').css('behavior','url(/pliki/javascript/iepngfix.htc)');
			
			$('#welcome-info .tabs-nav li, .side-bar .mod-menu li span').hover(function(){
				$(this).addClass('hover');
			},function(){
				$(this).removeClass('hover');
			});
			
			$('input').each(function(){
				t = $(this).attr('type');
				$(this).addClass(t);
			});
			
		}
		
		$('.tbl-prods th:last-child, .tbl-prods td:last-child, .prod-list .divider:last-child ').addClass('last-child');
	}
	

		
}

$(document).ready(css);


jQuery.fn.tabs = function(){
	return this.each(function(i){
	
		t_nav = $(this).find('.tabs-nav');
		t_item = $(t_nav).find('li');
		t_trigger = $(t_item).find('a');
		t_tab = $(this).find('.tab');
		
		
		
		$(t_item).each(function(i){
			t_act = 0;
			_loop = true;
			if($(this).is('.act')){
				t_act = i;
				_loop = false;
			}
			if(t_act == 0){
				$(t_item).eq(0).addClass('act');
				$(t_tab).eq(0).show();
			}
			else{
				$(t_tab).hide();
				$(t_tab).eq(t_act).show();
			}
			return _loop;
		});
		
		
		$(t_trigger).click(function(t){
			t.preventDefault();
			$this = $(this);
			t_item = $this.parent();
			
			t_id = $this.attr('href');
			t_id = t_id.split('#')[1];
			$(t_item).siblings().removeClass('act');
			$(t_item).addClass('act');
			$(t_item).parent().siblings('.tab').hide();
			$('#'+t_id).show();
		});
		

	}); // each	
};	
