function poprawCienie(){
	jQuery('.st_cien').each(function(){
		t = jQuery(this);
		
		var borderR = t.css('border-right-width').replace('px', '');
		borderR = parseInt(borderR, 10);
		var borderT = t.css('border-top-width').replace('px', '');
		borderT = parseInt(borderT, 10);
		var borderB = t.css('border-bottom-width').replace('px', '');
		borderB = parseInt(borderB, 10);
		var borderL = t.css('border-left-width').replace('px', '');
		borderL = parseInt(borderL, 10);
	
		var tHeight = t.innerHeight();
		var tWidth = t.innerWidth();
		
		jQuery(this).find('.st_cien_img.rt').css({
			top: '-'+borderT+'px',
			right: '-'+(8.0+borderR)+'px'	
		});
		jQuery(this).find('.st_cien_img.r').css({
			height: (tHeight-20.0+borderT+borderB)+'px',
			right: '-'+(8.0+borderR)+'px',
			top: (20.0-borderT)+'px'
		});
		jQuery(this).find('.st_cien_img.rb').css({
			right: '-'+(8.0+borderR)+'px',
			bottom: '-'+(borderB+8.0)+'px'
		});
		jQuery(this).find('.st_cien_img.b').css({
			width: (tWidth-20.0-20.0+borderL+borderR)+'px',
			bottom: '-'+(8.0+borderB)+'px',
			right: (20.0-8.0-borderR)+'px'
		});
		jQuery(this).find('.st_cien_img.lb').css({
			bottom: '-'+(8.0+borderB)+'px',
			left: borderL+'px'	
		});
	});
}
	
jQuery(document).ready(function(){
	var stImgPath = '/templates/img';
	
	/* aktualnosci */
	jQuery('#page.aktualnosci ul').wrap('<div id="aktualnosci_l"></div>');
	jQuery('#aktualnosci_l').before('<div id="aktualnosci_p"></div>');
	jQuery('#aktualnosci_p').append(jQuery('#aktualnosci_l ul').clone());
	jQuery('#aktualnosci_l li:gt(4)').remove();
	jQuery('#aktualnosci_p li:lt(5)').remove();
	
	var vertBarCss = {};
	var vertBarHeight = jQuery('#page.aktualnosci').innerHeight() - 80;
	if (vertBarHeight < 0) vertBarHeight = 0;
	
	jQuery('#page.aktualnosci')
		.css({position: 'relative'})
		.append(
			jQuery(
				'<img src="' + stImgPath + '/st_news_separator_v.gif" alt="" style="position: absolute;" />'
			).css({
				width: '3px',
				height: vertBarHeight,
				top: '60px',
				left: '425px'
			})
		);

	/* strona zwykla */
	/*
	//wciecie na obrazek - usuniete na zyczenie
	if (jQuery('#imagesList1').length && jQuery('#pageDescription').length) {
		jQuery('#pageDescription').css({
			width: (parseInt(jQuery('#pageDescription').css('width').replace('px', ''), 10) - jQuery('#imagesList1').outerWidth() - 30.0) + 'px',
			marginLeft: (jQuery('#imagesList1').outerWidth() + 30.0) +'px'
		});
	}
	*/
	
	/* cienie */
	jQuery('.st_cien').each(function(){
		var t = jQuery(this);
		t.css({overflow: 'visible', position: 'relative'});
		
		var borderR = t.css('border-right-width').replace('px', '');
		borderR = parseInt(borderR, 10);
		var borderT = t.css('border-top-width').replace('px', '');
		borderT = parseInt(borderT, 10);
		var borderB = t.css('border-bottom-width').replace('px', '');
		borderB = parseInt(borderB, 10);
		var borderL = t.css('border-left-width').replace('px', '');
		borderL = parseInt(borderL, 10);
		
		var tHeight = t.innerHeight();
		var tWidth = t.innerWidth();

		t.append(
			jQuery(
				'<img class="st_cien_img rt" src="' + stImgPath + '/st_cien_rt.png" alt="" style="z-index: 21; position: absolute; width: 8px; height: 20px;" />'
			).css({
				top: '-'+borderT+'px',
				right: '-'+(8.0+borderR)+'px'	
			})
		);
		t.append(
			jQuery(
				'<img class="st_cien_img r" src="' + stImgPath + '/st_cien_r.png" alt="" style="z-index: 21; position: absolute; width: 8px;" />'
			).css({
				height: (tHeight-20.0+borderT+borderB)+'px',
				right: '-'+(8.0+borderR)+'px',
				top: (20.0-borderT)+'px'
			})
		);
		t.append(
			jQuery(
				'<img class="st_cien_img rb" src="' + stImgPath + '/st_cien_rb.png" alt="" style="z-index: 21; position: absolute; height: 8px; width: 20px" />'
			).css({
				right: '-'+(8.0+borderR)+'px',
				bottom: '-'+(borderB+8.0)+'px'
			})
		);
		t.append(
			jQuery(
				'<img class="st_cien_img b" src="' + stImgPath + '/st_cien_b.png" alt="" style="z-index: 21; position: absolute; height: 8px;" />'
			).css({
				width: (tWidth-20.0-20.0+borderL+borderR)+'px',
				bottom: '-'+(8.0+borderB)+'px',
				right: (20.0-8.0-borderR)+'px'
			})
		);
		t.append(
			jQuery(
				'<img class="st_cien_img lb" src="' + stImgPath + '/st_cien_lb.png" alt="" style="z-index: 21; position: absolute; width: 20px; height: 8px;" />'
			).css({
				bottom: '-'+(8.0+borderB)+'px',
				left: borderL+'px'	
			})
		);
	});
	setTimeout('poprawCienie()', 500);
});//doc ready
