﻿
$(function () {


    // KUN KOMMENTERT UT UNDER UTVIKLING - KOMMENTER INN VED RELEASE
    //    var counter = 0;
    //    setInterval(function () {
    //        $(".fadein a:eq(0)").fadeOut(300).next('a').fadeIn().end().appendTo(".fadein");
    //        //activeBullet(counter++);
    //    }, 6000);

    //    //    function activeBullet() {
    //    //        console.log("hoho - " + counter);
    //    //    }

    //    $('.slide-out-div').tabSlideOut({
    //        tabHandle: '.FacebookSideTab',
    //        pathToTabImage: '/Customers/Bere/Bennett/Skin/Images/side-tab-facebook.jpg',
    //        tabLocation: 'right',
    //        speed: 300,
    //        action: 'click',
    //        topPos: '100px',
    //        leftPos: '19px',
    //        fixedPosition: true
    //    });

    $("#CaseList").slideshow({
        autoScroll: true,
        autoScrollDelay: 5000,
        carousel: true,
        navigation: false,
        transition: "fade"
    });

    $(".no-touch #EmployeeList li.hasShare").hover(function () {
        $(this).addClass("hover");
        return false;
    }, function () {
        $(this).removeClass("hover");
        return false;
    });


    $(".no-touch #PorfolioList li").hover(function () {
        $(this).addClass("hover");
        return false;
    }, function () {
        $(this).removeClass("hover");
        return false;
    });


    // CreateSlideshow();

    if ($.browser.webkit && $(".no-touch").exists()) {
        $("#Teasers img:last").load(CreateSlideshow);
        console.log("is webkit");
    } else {
        CreateSlideshow();
    }

    //BIGLINKS 
    $(".blogPost").biglink();

});

function CreateSlideshow() {
    
    // TEASERSLIDESHOW
    $("#Teasers").slideshow({
        autoScroll: false,
        autoScrollDelay: 5000,
        showPages: true,
        carousel: true,
        responsive: true
    });
}
