$(document).ready(function(){
  	//Cufon.replace("#head .menu a", {fontFamily: "Franklin Gothic Demi Cond", textShadow: '1px 1px #000', hover: {fontFamily: "Franklin Gothic Demi Cond", textShadow: '1px 1px #000'}});
	Cufon.replace("#head .menu a", {fontFamily: "Franklin Gothic Demi Cond"});
	Cufon.replace("h2.title, .bar h1, .contact_box h2", {fontFamily: "Franklin Gothic Medium Cond"});
	
  	$("a[rel='gallery']").lightBox();
	$("a[rel='gallery1']").lightBox();
	$("a[rel='gallery2']").lightBox();
	$("a[rel='reference']").lightBox({txtImage: 'referencja'});
});
$(function(){
	var current_word = -1;
	
	function word_change() 
	{
		var c = parseInt($(".bar .n").length);
		if (current_word > -1) {
			$(".bar .n").eq(current_word%c).fadeOut(500);
		} else {
			$(".bar .n").hide();
		}
		
		current_word++;	
		$(".bar .n").eq(current_word%c).fadeIn(500);
		setTimeout(word_change, 6000);
	}
	
	word_change();
	
	var current_banner = -1;
	
	function banner_change() 
	{
		var c = parseInt($("#banners .banner").length);
		if (current_banner > -1) {
			$("#banners .banner").animate({opacity: 0}, 500);
		} else {
			$("#banners .banner").animate({opacity: 0}, 1);
		}
		
		current_banner++;
		$("#banners .banner").eq(current_banner%c).animate({opacity: 1}, 500);
		setTimeout(banner_change, 6000);
	}
	
	banner_change();
});
