Cufon.set('fontFamily', 'EurostileEx');
Cufon.replace('h1, h3', { hover: true });
Cufon.set('fontFamily', 'Eurostile');
Cufon.replace('h2, h4, h6');
Cufon.replace('#hnav li a.top', { hover: true });


$(function(){
  //Cufon.now();
  $(".fancybox").fancybox();  
  $(".noShow").remove();
  
  if ( $('#hnav').length > 0 ) {
      
  $("#hnav #hn4 ul").hover( 
      function() {
        $(this).prev().css({ 'background-color' : '#ee7f01' , 'background-position' : '155px -33px' , '-moz-border-radius' : '4px 4px 0 0' , '-webkit-border-top-left-radius' : '4px' , '-webkit-border-top-right-radius' : '4px' , '-webkit-border-bottom-left-radius' : '0' , '-webkit-border-bottom-right-radius' : '0' , 'border-radius' : '4px 4px 0 0' , 'padding-bottom' : '12px' });               
      },
      function() {
        $(this).prev().removeAttr('style');        
      });
  $("#hnav #hn5 ul").hover( 
      function() {
        $(this).prev().css({ 'background-color' : '#EE7F01' , 'background-position' : '112px -33px' , '-moz-border-radius' : '4px 4px 0 0' , '-webkit-border-top-left-radius' : '4px' , '-webkit-border-top-right-radius' : '4px' , '-webkit-border-bottom-left-radius' : '0' , '-webkit-border-bottom-right-radius' : '0' , 'border-radius' : '4px 4px 0 0' , 'padding-bottom' : '12px' });        
      },
      function() {
        $(this).prev().removeAttr('style');        
      });
  $("#hnav #hn6 ul").hover( 
      function() {
        $(this).prev().css({ 'background-color' : '#EE7F01' , 'background-position' : '112px -33px' , '-moz-border-radius' : '4px 4px 0 0' , '-webkit-border-top-left-radius' : '4px' , '-webkit-border-top-right-radius' : '4px' , '-webkit-border-bottom-left-radius' : '0' , '-webkit-border-bottom-right-radius' : '0' , 'border-radius' : '4px 4px 0 0' , 'padding-bottom' : '12px' });        
      },
      function() {
        $(this).prev().removeAttr('style');        
      });
  }


  $('#hnav #hn4').prepend('<a class="teaser" href="/50-jahre-bw-film-ab" title="Film ab!"></a>');
  $('#hnav a.teaser').hover(function() {
    $('#hnav li#hn4 ul').css('visibility','hidden');
  }, function() {
    $('#hnav li#hn4 ul').removeAttr('style');
  });

  /*
  if ( !$.browser.msie) {         
    $("#content").css('opacity', .1);
    $("#content").fadeTo('slow', 1);
  };
  */
  });
  
  
$(window).load(function() {
    
    var slides = $('#slider').children('img').length;
    var startslide = Math.floor(Math.random() * (slides-1));    

	$('#slider').nivoSlider({
	  effect:'random',
		slices:15,
		animSpeed:500,
		pauseTime:8000,
		startSlide:startslide, //Set starting Slide (0 index)
		directionNav:false, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:false, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
		controlNavThumbsSearch: '.jpg', //Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
		keyboardNav:false, //Use left & right arrows
		pauseOnHover:true, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.8, //Universal caption opacity
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){} //Triggers after all slides
  });
});

