﻿/// <reference path="jquery-1.3.2-vsdoc2.js" />

$(document).ready(function() {
    //Login box in header
    $("#login-container #login-btn a").click(function(e) {
        e.preventDefault();
        if ($("#login").hasClass("login-active")) {
            //set button text:
            $(this).html('Logga in')
            $("#login").animate({ height: '0px' }, 1000, "easeOutExpo",
                    function() { $("#login").removeClass("login-active"); });
                    
            
        }
        else {
            //var newHeight = $("#login #loginbox").css('height')
            $("#login").css({ 'height': '0px' }).addClass("login-active").animate({ height: 110 }, 700, "easeInOutExpo", function() { $("#LoginForm input[id$='UserName']").focus(); });

            //set button text:
            $(this).html('Stäng')
            
            
        }
        return false;
    });

    if ($("#startpage").length > 0) {
        //Startpage article slider
        $('#articles-slideshow').cycle({
            fx: 'scrollHorz', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
            speed: 500,
            timeout: 0,  // milliseconds between slide transitions (0 to disable auto advance) 
            pause: 0,      // true to enable "pause on hover" 
            nowrap: 0, // This option prevents the slideshow from wrapping to the first/last slide.
            next: '#next-article',
            prev: '#prev-article'
        });
        //Startpage press tabs
        $("ul.tabs").tabs("div.panes > div");
    }


    if ($("#pressarchiveTabs").length > 0) {
        //Pressarchive press tabs
        $("#pressarchiveTabs ul.tabs").tabs("div.panes > div.NewsArchiveList");
    }

});
