// pod chrome sa jakies problemy przy document ready
jQuery(window).load(function(){
	if(jQuery('.promo_paints1').length)
	{
		var h = jQuery.browser.opera || jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 9 ? jQuery('.promo_paints1 img').css('height').replace('px', '') : jQuery('.promo_paints1 img').height()
		jQuery('.promo_paints1 img').css('margin-top', (416 - h) / 2);	
		
		var h = jQuery.browser.opera || jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 9 ? jQuery('.promo_paints1 img').css('width').replace('px', '') : jQuery('.promo_paints1 img').width()
		jQuery('.promo_paints1 img').css('margin-left', (422 - h) / 2);
	}
	
	
	if(jQuery('.promo_paints3').length)
	{
		var h = jQuery.browser.opera || jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 9 ? jQuery('.promo_paints3 img').css('height').replace('px', '') : jQuery('.promo_paints3 img').height()
		jQuery('.promo_paints3 img').css('margin-top', (300 - h) / 2);	
		
		var h = jQuery.browser.opera || jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 9 ? jQuery('.promo_paints3 img').css('width').replace('px', '') : jQuery('.promo_paints3 img').width()
		jQuery('.promo_paints3 img').css('margin-left', (305 - h) / 2);	
	}	
	
	jQuery.each(jQuery('#mycarousel li img, .promo_paints2 img'), function() {
		var h = jQuery.browser.opera || jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 9 ? jQuery(this).css('height').replace('px', '') : jQuery(this).height()
		jQuery(this).css('margin-top', (200 - h) / 2);
		
		var h = jQuery.browser.opera || jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 9 ? jQuery(this).css('width').replace('px', '') : jQuery(this).width()
		jQuery(this).css('margin-left', (200 - h) / 2);
	});
	
	jQuery.each(jQuery('.promo_paints4 img'), function() {
		var h = jQuery.browser.opera || jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 9 ? jQuery(this).css('height').replace('px', '') : jQuery(this).height()
		jQuery(this).css('margin-top', (150 - h) / 2);
		
		var h = jQuery.browser.opera || jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 9 ? jQuery(this).css('width').replace('px', '') : jQuery(this).width()
		jQuery(this).css('margin-left', (150 - h) / 2);
	});		
});


jQuery(document).ready(function() {
	
	if(jQuery('.promo_paints1').length)
	{
		var h = jQuery.browser.opera || jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 9 ? jQuery('.promo_paints1 img').css('height').replace('px', '') : jQuery('.promo_paints1 img').height()
		jQuery('.promo_paints1 img').css('margin-top', (416 - h) / 2);	
		
		var h = jQuery.browser.opera || jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 9 ? jQuery('.promo_paints1 img').css('width').replace('px', '') : jQuery('.promo_paints1 img').width()
		jQuery('.promo_paints1 img').css('margin-left', (422 - h) / 2);
	}
	
	if(jQuery('.promo_paints3').length)
	{
		var h = jQuery.browser.opera || jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 9 ? jQuery('.promo_paints3 img').css('height').replace('px', '') : jQuery('.promo_paints3 img').height()
		jQuery('.promo_paints3 img').css('margin-top', (300 - h) / 2);	
		
		var h = jQuery.browser.opera || jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 9 ? jQuery('.promo_paints3 img').css('width').replace('px', '') : jQuery('.promo_paints3 img').width()
		jQuery('.promo_paints3 img').css('margin-left', (305 - h) / 2);	
	}

	jQuery.each(jQuery('#mycarousel li img, .promo_paints2 img'), function() {
		var h = jQuery.browser.opera || jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 9 ? jQuery(this).css('height').replace('px', '') : jQuery(this).height()
		jQuery(this).css('margin-top', (200 - h) / 2);
		
		var h = jQuery.browser.opera || jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 9 ? jQuery(this).css('width').replace('px', '') : jQuery(this).width()
		jQuery(this).css('margin-left', (200 - h) / 2);
	});	

	jQuery.each(jQuery('.promo_paints4 img'), function() {
		var h = jQuery.browser.opera || jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 9 ? jQuery(this).css('height').replace('px', '') : jQuery(this).height()
		jQuery(this).css('margin-top', (150 - h) / 2);
		
		var h = jQuery.browser.opera || jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 9 ? jQuery(this).css('width').replace('px', '') : jQuery(this).width()
		jQuery(this).css('margin-left', (150 - h) / 2);
	});			
	
	// rozsuwane menu w panelu admina
	jQuery('#menu_glowne > ul > li').find('ul').hide().end().find('a').click(function() {
		jQuery(this).next().slideToggle();
	});
	
	jQuery('#mycarousel').jcarousel({
		vertical: false,
		scroll: 2,
		auto: 2,
		buttonNextHTML: null,
		buttonPrevHTML: null,
		wrap: 'last'
	});
});
	

