Cufon.replace('.contact, h1, pod_txt, h2');
Cufon.replace('.del_cas');

$(document).ready(function () {
    var pathname = window.location + "";
    if (pathname.indexOf("Prepis.aspx") != -1 || pathname.indexOf("Reference.aspx") != -1 || pathname.indexOf("Povezave.aspx") != -1 || pathname.indexOf("PosebnaPonudba.aspx") != -1 || pathname.indexOf("Kontakt.aspx") != -1 || pathname.indexOf("Lokacija.aspx") != -1 || pathname.indexOf("Storitve.aspx") != -1 || pathname.indexOf("ZalogaVozil.aspx") != -1)

    { $(".bg_main").css("background", "url(Img/crte_ozadje.png) bottom right no-repeat"); $(".bg_main_red").css("background", "url('Img/avtodom_ozadje.png') top left repeat-x"); $(".bg_main_red").css("background-color", "#A02C42"); }
    


});

/*Navigation*/
$(document).ready(function () {
    $("#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: "-43" 
        }, 350);
    }, function () { 
        $(this).find("span").stop().animate({
            marginTop: "0"
        }, 350);
    });
});

/*CONTACT*/

/*Hitri Kontakt*/
$(document).ready(function () {
    $buildingup = false;
    $(".contact_button, .test").click(function () {

        if ($buildingup == false) {
            $("#cont_form").stop().animate({ top: '-240px' }, { queue: false, duration: 750, easing: 'easeInOutBack' });
            $buildingup = true;

        } else {
            $("#cont_form").stop().animate({ top: '-965px' }, { queue: false, duration: 750, easing: 'easeInOutBack' });
            $buildingup = false;

        }

    });

    $("#ex").click(function () {
        $("#cont_form").stop().animate({ top: '-965px' }, { queue: false, duration: 750, easing: 'easeInOutBack' });
        $buildingup = false;

    });
});


/*ACCORDATION*/
$(document).ready(function () {

    //Set default open/close settings
    $('.acc_container').hide(); //Hide/close all containers
    var pathname = window.location + "";
    if (pathname.indexOf("Financiranje") != -1) {
        $('#Financiranje').addClass('active').next().show();
    }
    else {
        $('.acc_trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container
    }
    

    //On Click
    $('.acc_trigger').click(function () {
        if ($(this).next().is(':hidden')) { //If immediate next container is closed...
            $('.acc_trigger').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
            $(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
        }
        return false; //Prevent the browser jump to the link anchor
    });

});

