﻿//Fonction permettant l'ajout en favoris du site
function addToFavorites() {
    if (navigator.appName != 'Microsoft Internet Explorer')
        window.sidebar.addPanel(document.title, location.href, '');
    else
        window.external.AddFavorite(location.href, document.title);
}

var id_accroche = 0;

function animAccroche(id) {
    if (id != id_accroche) {
        var accroche = '';
        var title = '';
        if (id == 1) {
            accroche = accroche1;
            title = title1;
            $('.bt_solutions_particuliers').attr('style', 'margin-left:0px');
            $('.bt_solutions_industriels').attr('style', 'margin-left:20px');
            $('.bandeau_solutions').css('background', 'url(' + rooturl + 'Content/Images/Layout/img_bandeau_home.jpg) no-repeat left top');       
        }
        else {
            accroche = accroche2;
            title = title2;
            $('.bt_solutions_particuliers').attr('style', 'margin-left:20px');
            $('.bt_solutions_industriels').attr('style', 'margin-left:0px');
            $('.bandeau_solutions').css('background', 'url(' + rooturl + 'Content/Images/Layout/img_bandeau_home2.jpg) no-repeat left top');
        }
        if ($('#texte_accroche').html() != accroche) {
            $('#texte_accroche').stop(true, true).html(accroche).effect('slide', {}, 600, function() { $('#texte_accroche').show(); });
            $('#title_accroche').stop(true, true).html(title).effect('slide', {}, 600, function() { $('#title_accroche').show(); });
        }
        id_accroche = id;
    }
}

function leftMenuToggle(id) {
    var myobj = $('#sub_' + id);
    if (myobj.length > 0) {
        $('#sub_' + id).toggle();
        return false;
    }
    else
        return true;
}
