


$(document).ready(function() {

    isAuthenticated();
    isOnline();
    setChat();


    $('textarea').elastic();

    $("DIV.ContainerPanel > DIV.collapsePanelHeader > DIV.ArrowExpand").toggle(
        function() {
            $(this).parent().next("div.Content").show("fast");
            $(this).attr("class", "ArrowClose");
        },
        function() {
            $(this).parent().next("div.Content").hide("fast");
            $(this).attr("class", "ArrowExpand");
        });

    $('#mycarousel').jcarousel({
        itemLoadCallback: mycarousel_itemLoadCallback
    });


    $('#loginForm').submit(function(e) {
        login();
        e.preventDefault();
    });

    $('#logoffForm').submit(function(e) {
        logoff();
        e.preventDefault();
    });

    $("#login-email").blur(function() {
        if ($("#login-email").val().length == 0) $("#login-email").val("Email Address");
    });

    $("#login-email").focus(function() {
        if ($("#login-email").val() == "Email Address") $("#login-email").val("");
    });

    $('#login-password-clear').focus(function() {
        $('#login-password-clear').hide();
        $('#login-password').show();
        $('#login-password').focus();
    });


    $("#login-password").blur(function() {
        if ($("#login-password").val().length == 0) {
            $('#login-password').hide();
            $('#login-password-clear').show();
        }
    });



    $(".popup a").hover(function() {
        $(this).next("em").stop(true, true).animate({ opacity: "show", top: "-50" }, "slow");
    }, function() {
        $(this).next("em").animate({ opacity: "hide", top: "-60" }, "fast");
    });






    $("#modal-login").fancybox({
        'overlayOpacity': 0.7,
        'hideOnOverlayClick': false,
        'hideOnContentClick': false,
        'scrolling': 'no',
        'titleShow': false,
        'onClosed': function() {
            $("#login_error").hide();
        }
    });


    loadTicker();
//    $(".newsticker-jcarousellite").jCarouselLite({
//        vertical: true,
//        hoverPause: true,
//        visible: 3,
//        auto: 500,
//        speed: 1000
//    });

    addOptions(); //FROM master_script_functions.js

});






