﻿$(document).ready(function () {
    //alert("document finished");
    $('#slideshow')
    .cycle({
        fx: 'fade',
        speed: 500,
        timeout: 5000,
        pager: "#slide-pager"
    });

    $(".ArticleImageLeft").wrap("<div class='ArticleImageContainer RoundImage AlignLeft' />");

    $(".ArticleImageLeft").wrap("<div class='ArticleImageContainer RoundImage AlignRight' />");

    $(".ArticleImageContainer").css("background-image", function () {
        return "url('" + $(this).find("img").addClass("invisible").attr("src") + "')";
    });
    // <div class="RoundImage AlignRight" style="background-image: url(<web:ImageSrc MaxHeight=200 MaxWidth=300 runat=server Name=Image1 />);">      

    Cufon.replace("h1, h2, h3, .cufonize");

    $(".ArticleImageLeft, .ArticleImageRight, .RoundImage").corner("11px");

    $(".puffMainContainer").corner("tl 11px").corner("bl 11px");

    $(".NavigationLinksContainer").corner("tr 12px").corner("br 12px");

    $("#slide-pager a").corner("6px");
    //0 11px 11px 0;

    $(".FooterLinks li:last-child").css("border-right", "0");



    //byter ut level1 i menun om det finns undersidor (typ som på DNA tester), om det inte finns undersidor ska det inte göras
    $("#leftMenu .level1").each(function (index) {
        if ($(this).find("ul li").length > 0) {
            $(this).find(">a").replaceWith("<span style='color:#666;border-bottom: 1px solid #efefef;display:block;padding: 5px 5px 5px 5px;font-weight:bold;background-color:#efefef;'>" + $(this).find(">a").text() + "</span>");
        }
    });

});



