﻿$(document).ready(function () {
    var curnotice = 1;
    $('#submit').hover(
            function () { // Change the input image's source when we "roll on"
                $(this).attr({ src: 'images/head_login_on.gif' });
            },
            function () { // Change the input image's source back to the default on "roll off"
                $(this).attr({ src: 'images/head_login_off.gif' });
            }
        );
    function setanno() {
        $("#curanno").html(curnotice + " of " + $(".notice").hide().eq(curnotice - 1).show().end().length);
    };
    $("#nextanno").click(function () {
        if (++curnotice > $(".notice").length) curnotice = 1;
        setanno();
        return false;
    });
    $("#prevanno").click(function () {
        if (--curnotice == 0) curnotice = $(".notice").length;
        setanno();
        return false;
    });
    $(".clip").click(function () {
        $.fancybox({
            'padding': 0,
            'autoScale': false,
            'transitionIn': 'none',
            'transitionOut': 'none',
            'title': this.title,
            'width': 680,
            'height': 495,
            'hideOnOverlayClick': false,
            'href': this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
            'type': 'swf',
            'swf': {
                'wmode': 'transparent',
                'allowfullscreen': 'true'
            }
        });
        return false;
    });
    if ($(".notice").length < 2) $("#prevanno,#nextanno,#curanno").hide();
    setanno();
});

