$(document).ready( function(){
      //mainNav drop-downs
      $("div.mainNav > ul > li").hover( 
        function(){ 
            $(".mainSubNav", this).show();
            $(".mainSubNav li").addClass("sfHover");
            $(".mainSubNav li a").addClass("sfHover");            
        }, 
        function() {
            $(".mainSubNav", this).hide();
            $(".mainSubNav li").removeClass("sfHover");
            $(".mainSubNav li a").removeClass("sfHover");
        } 
    );
    if (document.all) {
        $("div.mainNav > ul > li").hoverClass("sfHover");
    }
                   
    $('#rotator').cycle({//video rotator
        speed: 1000, 
        timeout: 8000,
        next: '#nextVid',
        prev: '#prevVid',                 
        height: '120px',
        cleartype: 1                
    });                
    //buttons for video rotator
    $('#prevArrow').hover(
        function() {
            $('#prevArrow').attr('src','../img/arrow_left_tan.gif');
        },
       function() {
            $('#prevArrow').attr('src','../img/arrow_left_black.gif');
        }
    );
    $('#nextArrow').hover(
        function() {
            $('#nextArrow').attr('src','../img/arrow_right_tan.gif');
        },
        function() {
            $('#nextArrow').attr('src','../img/arrow_right_black.gif');
        }
    );
    //uncomment to cycle news
    $('#news').cycle({ 
        fx:       'scrollDown', 
        speed:    1450,
        height:   '75px',                
        timeout:  8000,
        cleartype: 1
    });                    
    $('#quoteModule').cycle({
        speed: 1000, 
        timeout: 8000,                 
        height: '135px',
        cleartype: 1                
    });
                
    if($('.eventGroup').length > 1){
        $('#events').cycle({ 
            fx:       'scrollDown', 
            speed:    1450,
            height:   '138px',                
            timeout:  8000,
            cleartype: 1
        });
    } 
    $(".credit").click(function () {                
        openWindowSpecifySize('http://wagner.nyu.edu/inc/story_popup.php?type=student&id='
                       +$(this).attr("id"),"_blank",400,500);
    });            
    
});

            
$.fn.hoverClass = function(c) {
    return this.each(function(){
        $(this).hover( 
            function() {                 
                $(this).addClass(c);                
            },
            function() { 
                $(this).removeClass(c);                 
            }
        );
    });
};       

