$(document).ready(function() {
	
	$("#menu, h3, h2,.text2").each(function(){
		   Cufon.replace(this, {
               hover: true,
               fontFamily: 'font'
           });
           $(this).css({
               visibility: "visible"
           });
	})
	
	
	$("h1").each(function(){
            Cufon.replace(this, {
                hover: true,
                fontFamily: 'font'
            });
            $(this).css({
                visibility: "visible"
            });
        });
	
	
	
	$(".headlines div").hover(function(){
		$(this).children("a").hide().addClass($(this).attr("class")+"-active").fadeIn("slow");
	},function(){
		
		$(this).children("a").removeClass().fadeOut("slow");
		
	})
	
	$(".aktualita1,.aktualita2").hover(function(){
		$(this).addClass('aktualita-hover');
		$(this).find('.perex-image1').hide();
		$(this).find('.perex-image2').show();
	},function(){
		$(this).removeClass('aktualita-hover');
		$(this).find('.perex-image1').show();
		$(this).find('.perex-image2').hide();
	}).click(function(){
		location.href=$(this).find("a").attr("href");
	})
	
	$('.photolist').cycle({timeout: 0});
    $('.photolist').hover( function(){
    
    if($(this).find("img:first").css("opacity")==1) {	
    		$(this).cycle({timeout: 100,speed:400});
    	}else{ 	
    		$(this).cycle('resume');
    	}
    },
	 function(){    	
	 	$(this).cycle('pause');
	})
	
	$('.gallery ul').cycle({
        fx:     'fade',
        prev:   '#prev',
        next:   '#next',
        speed: 500,
        timeout: 0
   }); 
    
    $(".gallery ul ").click(function() {
		$("#next").click();
		return false;
 })

	

}); 
	
