$(document).ready(function(){
   
    
    $('.newsText').each(function () {

        var current = $(this);

        current.attr("box_height", current.height());

        if(current.height()<58){
            current.children(".dots").css("visibility", "hidden");
            current.attr("box_height", "56");
        }
    });
            
            
   $("p.newsText").css("height", "56px");
 

    
     
     
    $("#news div.newsCover").mouseover(function()
    {
        //if($(this).next("div.newsText").height()=="60px"){
        
        $(this).siblings("p.newsText").children(".dots").fadeIn(0);
        $(this).next("p.newsText").children(".dots").fadeOut(0);
       // }
        
        $(this).next("p.newsText").stop().animate({
            "height": $(this).next("p.newsText").attr("box_height") + "px"
        }, "normal").siblings("p.newsText").stop().animate({
            "height": "56px"
        }, "normal");
        
        
        
    });
     
     
     $(".fbIcon").hover(
function() {
$("img.fbGrey").stop().animate({"opacity": "0"}, "normal");
$("img.fb").stop().animate({"opacity": "1"}, "normal");
},
function() {
$("img.fbGrey").stop().animate({"opacity": "1"}, 1500);
$("img.fb").stop().animate({"opacity": "0"}, 1500);
});


 $(".youtubeIcon").hover(
function() {
$("img.youtubeGrey").stop().animate({"opacity": "0"}, "normal");
$("img.youtube").stop().animate({"opacity": "1"}, "normal");
},
function() {
$("img.youtubeGrey").stop().animate({"opacity": "1"}, 1500);
$("img.youtube").stop().animate({"opacity": "0"}, 1500);
});
 $('#trailerWrapperCover').fadeIn(0);
    
    
      $('#trailerOpen').click(function() {
        $("#trailerWrapperCover").stop().fadeOut(50);
        $('#bodyWrapper').slideUp('slow', function() {
            // Animation complete.
            });
    });
  
    $('#trailerClose').click(function() {
        $('#bodyWrapper').slideDown('slow', function() {
            // Animation complete.
            });
    // $('#trailerWrapper').stop().animate({"opacity": "0"}, 0);   
    });      
   
    $('#trailerOpen').pulse({
        opacity: [0,1]
    }, { 
        duration: 2500,
        times: 999999    
    });

   $("a[rel='homepage']").colorbox();
   
      var $height = $('#homepageWrapper').height();
   $('#bodyWrapper').height($height);
});

         




