// JavaScript Document

$(document).ready(function(){
	
	/* ------- nadanie wysokości .circle_blue ------- */
	var winHeight = $(window).height();
	var wrappHeight = $('#wrapper').height();
	
	if (winHeight > wrappHeight + 110) {
		$('.circle_blue').height(winHeight - 110);
	} else {
		$('.circle_blue').height(wrappHeight);
	}
	
	/* ------- dodawanie <li></li> w galerii ------- */
	$('.gallery_box ul').first().attr('id','portfolio');
	$('.gallery_box ul').first().addClass('details');
	
	var nrDivPort = $('ul#portfolio > li').size();
	
	for( i = 0; i < nrDivPort; i++ ){
		$('ul#slide_nav').append('<li class="slide_'+ i +'"><span>'+ (i + 1) +'</span></li>');
		$('ul#portfolio-desc').append('<li></li>');
	};
	
	/* usuniecie separatora z menu gornego i dolnego */
	$('.main_menu li').last().css({background: 'none'});
	$('.foot_menu li').last().css({background: 'none'});
	
	/* usuniecie separatora z panelu w cenniku */
	$('.blue_price_mid').each(function(){
		$(this).children('div').last().css({background: 'none'});
	})
	
	/* rozwijane menu w sidebar-left */
	/*$('.cont_3x_fifth ul li').each(function(){
		$(this).hover(function(){
			$(this).children('ol').toggle();	
		})	
	})*/
	
	$('.cont_3x_fifth li ol').each(function(){
		$(this).children('li').last().css({marginBottom: '0'});
	})
	
	$('.cont_3x_fifth ul li span').first().css({background: 'none'});
	
	/* tabelka cennik */
	$('.cont_price_list table').each(function(){
		$(this).attr('width', '656');
		$(this).children().children('tr').first().addClass('cont_price_head');
		$(this).children().children('tr').first().css({border: '0 none'});
	})
	$('.cont_price_list table tr').each(function(){
		$(this).children().attr('width', '159');
		$(this).children().first().attr('width', '318').css({paddingLeft: '35px'});
		$(this).children().first('th').addClass('brd_blue_box_left');
		$(this).children('th').addClass('brd_blue_box');
		$(this).children('th').last().removeClass('brd_blue_box').css({paddingRight: '10px'}).addClass('brd_blue_box_right');
		$(this).children().attr('valign', 'top');
	})
	
	/* losowy obrazek po odswierzeniu strony */
	$('.gallery_box_260 ul li img').css({display: 'none'});	
	$('.gallery_box_260 ul li img').eq(Math.ceil(Math.random()*($('.gallery_box_260 ul li img').size()-1))).show();
	
	$('.gallery_box_260 img:hidden').parent('li').hide();
	
})


