$(document).ready(function(){	
	$('#flash_container').flashembed({
    	src: '/_p/flash/index.swf',
        width: 926,
        height: 446,
        id: 'mainFlash',
        wmode: 'transparent'
	});
	
	$('#logos').flashembed({
    	src: '/_p/flash/loga.swf',
        width: 800,
        height: 105,
        id: 'logo',
        wmode: 'transparent'
	});
	
	$("#print").click(function() {
		window.print();
		return false;
	});
	
	$("#back").click(function() {
		window.history.back();
		return false;
	});
	
	$(".next").click(function() {
		var rel = $("#photo img.gallery-photo").attr("rel");
		$.post("/galeria/next", { photo: rel },
			  function(data){ 
			  	$("#photo img.gallery-photo").attr("src", "/gallery/medium/"+data+"_p.jpg"); 
			  	$("#photo img.gallery-photo").attr("rel", data);
			}
		);
		
		return false;
	});
	
	$(".previous").click(function() {
		var rel = $("#photo img.gallery-photo").attr("rel");
		$.post("/galeria/prev", { photo: rel },
			  function(data){ 
			  	$("#photo img.gallery-photo").attr("src", "/gallery/medium/"+data+"_p.jpg"); 
			  	$("#photo img.gallery-photo").attr("rel", data);
			}
		);
		
		return false;
	});
	
	$("#loading").ajaxStart(function(){ 
		$("#photo img.gallery-photo").hide();
  		$(this).show(); 
	});
	
	$("#loading").ajaxComplete(function(){ 
		$(this).hide(); 
		$("#photo img.gallery-photo").show();
	});
	
	$(".slide").slide();
	$(".slide .mask a").click(function() {
		var rel = $(this).attr("rel");
		$.post("/galeria/change", { photo: rel },
			  function(data){ 
			  	$("#photo img.gallery-photo").attr("src", "/gallery/medium/"+data+"_p.jpg"); 
			  	$("#photo img.gallery-photo").attr("rel", data);
			}
		);
		return false;
	});

         $(".banner_zamknij").click(function() {
            $('#banner_fly').hide();
            return false
        })
});

var myriad = {
	src: '/_p/flash/myriad.swf'
};


sIFR.activate(myriad);

sIFR.replace (myriad, {
	selector: '#main h2',
	css: {
      '.sIFR-root': { 'color': '#1D1C1C', 'font-weight' : 'bold' }
    },
    wmode: 'transparent'
});

sIFR.replace (myriad, {
	selector: '#main h3',
	css: {
      '.sIFR-root': { 'color': '#451905', 'font-weight' : 'bold' }
    },
    wmode: 'transparent'
});


