function initMenu(menu) {   			//roziwjanie menu pionowe	
	 $('#'+menu+' ul').hide();
	// $('#'+menu+' ul#idd').show();
	   $('#'+menu+' li a').click(
	   function() {
		   $(this).next().slideToggle(menu);				
		   }
	   );
	    $('#'+menu+' ul.toggled').show();
   }
	function initMap(menu) {   			//rozwijana mapa strony
		$('.'+menu+' ul').hide();
		$('.'+menu+' a').click(function() {
			$(this).parent().children().eq(1).slideToggle(menu);				
			if($(this).children().eq(0).attr('src')=='http://www.programinwestycyjny-poig.itee.radom.pl/test/images/minus.png'){
				$(this).children().eq(0).attr('src','http://www.programinwestycyjny-poig.itee.radom.pl/test/images/plus.png');
			}else{
				$(this).children().eq(0).attr('src','http://www.programinwestycyjny-poig.itee.radom.pl/test/images/minus.png');
			}
		});
   }

 // //////////////////// przeniesone ze script.php
	$.fn.cycle.defaults.speed   = 600;
	$.fn.cycle.defaults.timeout = 2000;

 // //////////////////// przeniesone ze script.php

$(document).ready(function(){	
		
			$.fn.cycle.defaults.timeout = 5000;
			$('#LOGO').cycle({
				fx:      'turnDown',
				cleartypeNoBg: 'true'
				//,delay:  -100
			});
			
			$("a[rel*='external']").click(function() {
				window.open($(this).attr('href'), 'external','');
				return false;
			});
			$("area[class*='external']").click(function() {
				window.open($(this).attr('href'), 'external','');
				return false;
			});
		// ////////////////////////////////////////////////////////////////////////////////// MAPA.php								 
		initMap('mapa_rozwin');		
		// ////////////////////////////////////////////////////////////////////////////////// przewijanie do góry
		$('a.top, a.top_odb').click(function(){
			 $('html, body').animate({scrollTop: '0px'}, 300);
			 return false;
		});

		// ////////////////////////////////////////////////////////////////////////////// //menu pionowe	
		initMenu('menu_vertical');								 
		
		// ////////////////////////////////////////////////////////////////////////////   // nawigacja
		
		$("#HEAD_NAV div:first-child a:first-child > img").hover(function() {
											$(this).attr("src","http://www.programinwestycyjny-poig.itee.radom.pl/test/images/up_glowna.png");
											}, function() {
											$(this).attr("src","http://www.programinwestycyjny-poig.itee.radom.pl/test/images/glowna.png");
										});
		$("#HEAD_NAV div:first-child a:nth-child(2) > img").hover(function() {
											$(this).attr("src","http://www.programinwestycyjny-poig.itee.radom.pl/test/images/up_kontakt.png");
											}, function() {
											$(this).attr("src","http://www.programinwestycyjny-poig.itee.radom.pl/test/images/kontakt.png");
										});
		$("#HEAD_NAV div:first-child a:nth-child(3)  > img").hover(function() {
											$(this).attr("src","http://www.programinwestycyjny-poig.itee.radom.pl/test/images/up_mapa.png");
											}, function() {
											$(this).attr("src","http://www.programinwestycyjny-poig.itee.radom.pl/test/images/mapa.png");
										});
		$("#HEAD_NAV div:last-child img").css({'border':'2px solid #c9c9c8','margin-top':'12px','margin-right':'13px'});
		$("#HEAD_NAV div:last-child").css({'float':'right'});											
		$("#HEAD_NAV div:last-child img").hover(function() {
											$(this).css({'border':'2px solid rgb(3,172,200)'});
											}, function() {
											$(this).css({'border':'2px solid #c9c9c8'});
										});
		
		
		// ////////////////////////////////////////////////////////////////////////////    // INDEX.html
		$("#INDEX p:first-child").css({/* 'font-size':'88%',
										'font-weight':'bold',
										'margin-bottom':'5px',
										'color':'rgb(33,44,134)' */});
		
		$("#INDEX div#TYTULP").css({	'margin-left':'10px',
										'margin-top':'20px',
										'padding':'15px 0 15px 0' ,
										'text-align':'center','font-size':'127%'
									});
		$("#INDEX #TYTULP div").css({'color':'black',
									'margin':'0 auto',
									'text-align':'left'
									});
		$("#INDEX #TYTULP img").css({	'margin-left':'90px',
										'margin-right':'10px',
										'float':'left',
										'verical-align':'middle'										
										});
		$("#INDEX p:nth-child(3)").css({'font-size':'88%',
										'font-weight':'bold',
										'color':'black',
										'text-align':'left',
										'margin-top':'20px',
										'margin-left':'60px'});
		$("#INDEX p:nth-child(4)").css({'font-size':'88%',
										'text-align':'left',
										'color':'black',
										'margin-left':'90px'});
		$("#INDEX p:nth-child(5)").css({'font-size':'86%',
										'text-align':'left',
										'color':'black',
										'margin-left':'120px'});		
		
		// ////////////////////////////////////////////////////////////////////////////   // pokazywanie/ukrywanie AKTUALNOSCI.html
		
		$(".aktual-tresc").hide();
		$("#AKTUAL .aktual-more").live("click", function(){
			if ($(this).text() == 'WIĘCEJ...') {
				$(this).parent().children().filter(".aktual-body").children().filter(".aktual-tresc").slideDown(500);
				$(this).text("UKRYJ...");
				$(this).css({'background':'url(http://www.programinwestycyjny-poig.itee.radom.pl/test/images/zwin.png) no-repeat left'});
				
			} else {
				$(this).parent().children().filter(".aktual-body").children().filter(".aktual-tresc").slideUp(200);
				$(this).text("WIĘCEJ...");
				$(this).css({'background':'url(http://www.programinwestycyjny-poig.itee.radom.pl/test/images/rozwin.png) no-repeat left'});
			}
			return false;
		});
		$("#AKTUAL .aktual-tytul, #AKTUAL .aktual-tytul-tresc").live("click", function(){
				
			if ($(this).parent().parent().children().filter(".aktual-more").text() == 'WIĘCEJ...') {
				$(this).parent().children().filter(".aktual-tresc").slideDown(500);
				$(this).parent().parent().children().filter(".aktual-more").text("UKRYJ...");
				$(this).parent().parent().children().filter(".aktual-more").css({'background':'url(http://www.programinwestycyjny-poig.itee.radom.pl/test/images/zwin.png) no-repeat left'});
				
			} else {
				$(this).parent().children().filter(".aktual-tresc").slideUp(200);				
				$(this).parent().parent().children().filter(".aktual-more").text("WIĘCEJ...");
				$(this).parent().parent().children().filter(".aktual-more").css({'background':'url(http://www.programinwestycyjny-poig.itee.radom.pl/test/images/rozwin.png) no-repeat left'});
			}
			return false;
		});
		$("#ZWIN_ROZWIN").live("click", function(){
				
			if ($(this).text() == 'Pokaż wszystkie aktulaności') {
				$(".aktual-tresc").slideDown(500);
				$(".aktual-more").text("UKRYJ...");
				$(".aktual-more").css({'background':'url(http://www.programinwestycyjny-poig.itee.radom.pl/test/images/zwin.png) no-repeat left'});
				$(this).text("Ukryj wszystkie aktulaności");
				$(this).css({'background':'url(http://www.programinwestycyjny-poig.itee.radom.pl/test/images/zwin.png) no-repeat left'});
			}else{			
				$(".aktual-tresc").slideUp(200);				
				$(".aktual-more").text("WIĘCEJ..."); 
				$(".aktual-more").css({'background':'url(http://www.programinwestycyjny-poig.itee.radom.pl/test/images/rozwin.png) no-repeat left'});
				$(this).text("Pokaż wszystkie aktulaności");
				$(this).css({'background':'url(http://www.programinwestycyjny-poig.itee.radom.pl/test/images/rozwin.png) no-repeat left'});
			}
			return false;
		});
		

		
		// ////////////////////////////////////////////////////////////////////////////    // OPROJEKCIE.html
		
		initMenu('oprojekcie');	
		
		// ////////////////////////////////////////////////////////////////////////////    // OFERTA.php
	
	
	$('#OFERTA_WSPOLPRACY #OFERTA_KONTAKT tr td:first-child').css({ 	'width':'345px',
												//'color':'#f99001',												
												'padding-right':'10px',
												 'font-size':'90%', 
												'vertical-align':'top'
												});
	$('#OFERTA_WSPOLPRACY #OFERTA_KONTAKT tr:odd td:first-child').css({
												'text-align':'right',
												'text-shadow':'-1px -1px 5px #f99001',													
												'font-weight':'bold',
												 'font-size':'110%'
												});
		// ////////////////////////////////////////////////////////////////////////////    // WNIOSKODAWCA.php
		
		/* $("#WNIOSKODAWCA p:nth-child(1)").css({'color':'white',
												'font-size':'130%',
												'font-weight':'bold',
												'text-align':'center'}); */
		/* $("#WNIOSKODAWCA p:nth-child(3), #WNIOSKODAWCA p:nth-child(4)").css({'margin':'15px 30px 0 30px',
																				'text-align':'justify'
												}); */
		$("#ITEE").css({'width':'200px','height':'65px'});
		$("#ITEE").mouseover(function(){$(this).css({'height':'97px',
																	'width':'300px',
																	'margin-top':'-20px',
																	'margin-bottom':'-12px',
																	'z-index':'2',
																	'position':'relative'
																	})});
		$("#ITEE").mouseout(function(){$(this).css({'height':'73px',
																	'width':'200px',
																	'height':'65px',
																	'margin-top':'0px',
																	'margin-bottom':'0px',
																	'z-index':'2',
																	'position':'static'
																	})});
		$("#WNIOSKODAWCA a:nth-child(5)").css({'display':'block',
												'width':'100%',
												'text-align':'center',
												'color':'black',
												'margin':'0 auto'});
		$("#WNIOSKODAWCA a:nth-child(5) > img").css({'vertical-align':'middle'});
		
		
	// ////////////////////////////////////////////////////////////////////////////    // STRONY.php
		 $('#STRONY').css({ 'width':'90%',
							'border-collapse':'collapse',
							'margin':'0 auto'});
		$('#STRONY a').css({ 'display':'block'});
		
		$('#STRONY .strona').css({ 'padding-left':'40px',
										'padding-top':'5px',
												'height':'20px',
												'font-size':'90%',
												'font-weight':'bold',
												'vertical-align':'middle',
												'background':'url(http://www.programinwestycyjny-poig.itee.radom.pl/test/images/mini_www.png) no-repeat 20px 4px'
												});
		$('#STRONY .strona a').css({ 'color':'#545986' });
		$('#STRONY tr td').css({ 'font-weight':'bold',
												'height':'52px',
												'vertical-align':'middle',
												'padding-left':'10px',
												'background':'url(http://www.programinwestycyjny-poig.itee.radom.pl/test/images/link.png) no-repeat left'
												});
		$('#STRONY tr td#link_itee').css({ 'background':'none'
												});
		$('#STRONY tr:nth-child(6) td').css({ 'background':'none'
												});
		$('#STRONY .przerwa').css({ 'height':'10px',
									'border':'0',
									'background':'none',
									'vertical-align':'middle'});
		$("#STRONY div.przesuwanie").css({'background': 'url(http://www.programinwestycyjny-poig.itee.radom.pl/test/images/li_poziom_oprojekcie.png) no-repeat scroll left top',
								
								'padding':'6px',
								'width':'100%'
		});
		$("#STRONY div.przesuwaniel").css({'background': 'url(http://www.programinwestycyjny-poig.itee.radom.pl/test/images/kropki_lewe.png) no-repeat scroll left top',
								
								'padding':'6px',
								'width':'100%'
		});
		$('#STRONY .td_przesuwanie').css({ 'height':'auto',
									'border':'0',
									'background':'none',
									'padding':'0',
									'vertical-align':'middle'});
		$('#STRONY .td_przesuwanie:first-child').css({'padding-left':'24px'});
		$('#STRONY .td_przesuwanie:odd').css({'padding-left':'49px'});

	

	// ////////////////////////////////////////////////////////////////////////////    // KONTAKT.php
		$('#KONTAKT_ITEE').css({ 'width':'90%',
							'border-collapse':'collapse',
							'margin':'0 auto'});
		$('#KONTAKT_ITEE tr td:first-child').css({ 	'text-align':'center','width':'40%'
											});
		$('#KONTAKT').css({ 'width':'90%',
							'border-collapse':'collapse',
							'margin':'0 auto'});
		
		$('#KONTAKT tr td:first-child').css({ 	'width':'38%',
												'height':'20px',
												//'color':'#f78516',
												'color':'rgb(100,100,100)',
												'padding-right':'10px',
												'text-align':'right',
												/* 'font-size':'90%', */
												'font-weight':'bold',
												'vertical-align':'top'
												});
		$('#KONTAKT tr:nth-child(2) td:first-child').css({ 'color':'rgb(100,100,100)',
												'font-size':'100%'
												});
		$('#KONTAKT tr:nth-child(4) td:first-child').css({ 'color':'rgb(100,100,100)',
												'font-size':'100%'
												});
		$('#KONTAKT tr td:last-child').css({ 'padding-left':'10px',
												'font-weight':'bold',
												'vertical-align':'top'
												});
		$('#KONTAKT tr.grupy td:first-child').css({
												'text-align':'left',
												'width':'50px',
												'padding-left':'80px',
												'color':'#df5e0b',
												'font-weight':'bolder',
												'font-size':'95%'
													});
		$('#KONTAKT tr.grupy td:first-child span:first-child').css({ 
												'position':'relative',
												'top':'16px'
												});	
		$('#KONTAKT tr.grupy td:first-child span:nth-child(3)').css({ 
												'position':'relative',
												'top':'88px'
												});		
		$('#KONTAKT tr.grupy td:first-child span:nth-child(5)').css({ 
												'position':'relative',
												'top':'159px'
												});		
		$('#KONTAKT tr.grupy td:first-child span:nth-child(7)').css({ 
												'position':'relative',
												'top':'229px'
												});		
		$('#KONTAKT tr.grupy td:first-child span:nth-child(9)').css({ 
												'position':'relative',
												'top':'302px'
												});														
		$("#KONTAKT div.przesuwanie").css({'background': 'url(http://www.programinwestycyjny-poig.itee.radom.pl/test/images/kropki_lewe.png) no-repeat scroll left top',
								
								'padding':'6px',
								'width':'100%'
		});
		$("#KONTAKT div.przesuwaniel").css({'background': 'url(http://www.programinwestycyjny-poig.itee.radom.pl/test/images/li_poziom_oprojekcie.png) no-repeat scroll left top',
								
								'padding':'6px',
								'width':'100%'
		});
		$('#KONTAKT .td_przesuwanie').css({ 'height':'auto',
									'border':'0',
									'background':'none',
									'padding':'0',
									'vertical-align':'middle'});

});// koniec document.ready !!!!!!!!!!!




