
var setupMoviePlayer = function() {
    //Youtube layer
    //Activate FancyBox
    $("a#youtube_layer").fancybox({
        'zoomSpeedIn': 0,
        'zoomSpeedOut': 0,
        'overlayShow': true,
        'frameWidth': 425,
        'frameHeight': 344
    });

    //Clickable div.banner
    $(".banner").click(function() {
        if ($(this).find("a").attr("target") == "_blank")
            window.open($(this).find("a").attr("href"));
        else {
            window.location = $(this).find("a").attr("href");
            return false;
        }
    });

    //Clickable video thmbnail		
    $(".mainImage ul li").click(function() {
        window.location = $(this).find("a").attr("href"); return false;
    });

    //popup tool tip thumb
    $(".mainImage ul li a").hover(function() {
        $(this).next("em").animate({ opacity: "show", top: "-60" }, "slow");
    },
    function() {
        $(this).next("em").fadeOut("slow");
    });
}


function pausecomp(millis) {
    var date = new Date();
    var curDate = null;

    do { curDate = new Date(); }
    while (curDate - date < millis);
}

$(document).ready(function() {
    setupMoviePlayer();
});
