/* for LC home page, jump through the splash movie when hovering over the two
 * <li>'s in the homePromo area */
function moviePlayFrame(movie, f) {
    if (typeof(movie) == 'object' || (typeof(movie) == 'function' && movie.Play)) {
        if (movie.PercentLoaded() == 100) {
            movie.StopPlay();
            movie.GotoFrame(f);
            movie.Play();
        }
    }
}

$(document).ready(function(){

    var themovie = window.document.lcAniMovie1;
    var frame0 = 5;
    var frame1 = 33;
    var frame2 = 70;
    
    // jQuery.fn.hover() runs arg1 on mouseover, arg2 on mouseout. We play at
    // frame1 or frame2 depending on which of the two div's triggered this event.
    $('#homePromoW').find('div.hptext').hover(function(e) {
                                                              var pid = $(e.currentTarget).parent().attr('id');
                                                              $(this).find('h2 > a').addClass('hover');
                                                              moviePlayFrame(themovie, (pid == 'homePromoItem1')? frame1 : frame2);
                                                          },
                                              function(e) {
                                                              $(this).find('h2 > a').removeClass('hover');
                                                              moviePlayFrame(themovie, frame0);
                                                          });

});

