/**
 * @author code1
 */
$(function(){

$(".jakas,.zoom").lightBox();

			$("#top ul#top_menu li a img").hover(function(){
				if($(this).attr("src").indexOf("_hover") == -1) {
					var newSrc = $(this).attr("src").replace(".jpg","_hover.jpg#hover");
					$(this).attr("src",newSrc);
				}
				
			},
			function(){
				if($(this).attr("src").indexOf("_hover.jpg#hover") != -1) {
					var oldSrc = $(this).attr("src").replace("_hover.jpg#hover",".jpg");
					$(this).attr("src",oldSrc);
				}
			});
			
			});
			
$(function(){



			$("#zakladki a img").hover(function(){
				if($(this).attr("src").indexOf("_hover") == -1) {
					var newSrc = $(this).attr("src").replace(".png","_hover.png#hover");
					$(this).attr("src",newSrc);
				}
				
			},
			function(){
				if($(this).attr("src").indexOf("_hover.png#hover") != -1) {
					var oldSrc = $(this).attr("src").replace("_hover.png#hover",".png");
					$(this).attr("src",oldSrc);
				}
			});
			
			});
			
$(function(){



			$("#wrap a.links img").hover(function(){
				if($(this).attr("src").indexOf("_hover") == -1) {
					var newSrc = $(this).attr("src").replace(".png","_hover.png#hover");
					$(this).attr("src",newSrc);
				}
				
			},
			function(){
				if($(this).attr("src").indexOf("_hover.png#hover") != -1) {
					var oldSrc = $(this).attr("src").replace("_hover.png#hover",".png");
					$(this).attr("src",oldSrc);
				}
			});
			
			});
$(function(){

    $("ul#top_menu li").hover(function(){
    
        $(this).addClass("hover");
        $('ul:first',this).css('visibility', 'visible');
    
    }, function(){
    
        $(this).removeClass("hover");
        $('ul:first',this).css('visibility', 'hidden');
    
    });
    


});


$(function(){
	$('.edytuj_mnie').click(function(){
		
		
		var answer = confirm("Czy na pewno chcesz edytować ten element?");
			if (answer){
			return true;
		}
		else{
			return false;
		}
	});
	$('.first_link').click(function(){
		
		
		var answer = confirm("Czy na pewno chcesz usunąć ten element?");
			if (answer){
			return true;
		}
		else{
			return false;
		}
	});
	$('.usun_mnie').click(function(){
			var answer = confirm("Czy na pewno chcesz usunąć ten element?");
				if (answer){
				return true;
			}
			else{
				return false;
			}
	});

	});
	
	$(function(){
		var ilosc = $('.adres').size();
		for(n=0;n<=ilosc;n=n+2){
			$('.adres:eq('+n+')').addClass('odd')
		}
		for(n=0;n<=ilosc;n=n+4){
			$('.adres:eq('+n+')').addClass('color');
			var dodaj = n+1;
			$('.adres:eq('+dodaj+')').addClass('color');
		}
	})

$(document).ready(function() {
	Cufon.replace('h2.section_header',{
	fontSize: '18px',
	color: '#ffffff',
	textShadow: '1px 1px rgba(0, 0, 0, 0.5)'
});
	$('#color_filter').change(function(){
		
		var main_link = color_link;
		var link = $(this).val();
		
		window.location=main_link+'/'+link; 
	})
});


