$(function() {
    $("input:submit", ".login_form").button();
});
$(document).ready(function() {

    if (typeof(animations) != "undefined" && animations == "off") {
        $("#topnav a").css("color", "#fff");
    }
    else {
        $("#topnav li").prepend("<span></span>");

        $("#topnav li").each(function() {
            var linkText = $(this).find("a").html();
            $(this).find("span").show().html(linkText);
        });

        $("#topnav li").hover(function() {
            $(this).find("span").stop().animate({
                marginTop: "-40"
            }, 250);
        } , function() {
            $(this).find("span").stop().animate({
                marginTop: "0"
            }, 250);
        });
        $("ul#topnav li").hover(function() {
            $(this).css({
                'background': 'none'
            });
            $(this).find("p").show();
        }, function() {
            $(this).css({
                'background': 'none'
            });
            $(this).find("p").hide();
        });

        $(function() {
            $("#dialog").dialog({
                autoOpen: false,
                modal: true
            });
        });
    }

    $(function() {
        $("ul#newsscroller").show(0);
        $("ul#newsscroller").liScroll({
            travelocity: 0.03
        });
    });

    if (typeof(nfo) != "undefined") {
        dl_info();
        if (typeof(dl) != "undefined") {
            file[5] = $.base64Decode(dl);
        }
        if (typeof(file[5]) != "undefined" && typeof(wait) == "undefined") {
            pdl();
        }
        if (typeof(interval) != "undefined" && typeof(wait) != "undefined") {
            dl_countdown();
        }
    }

    window.setInterval("keep_alive()", 10*60*1000);
});
