function addToFavorites() {
    var loc = "http://www.freshandfashion.fr";
    var title = "Fresh'n'Fashion";
    if(document.all)window.external.AddFavorite(loc,title);
    else if(window.sidebar)window.sidebar.addPanel(title,loc,'');
}

function addToFavorites2(loc, title) {
    if(document.all)window.external.AddFavorite(loc,title);
    else if(window.sidebar)window.sidebar.addPanel(title,loc,'');
}

function setHomepage() {
    if (document.all) {
        document.body.style.behavior='url(#default#homepage)';
        document.body.setHomePage('http://www.freshandfashion.fr');
    }
    else if (window.sidebar) {
        if(window.netscape) {
            try {  
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
            }  
            catch(e) {  
                alert("this action was avoid by your browser, if you want to enable, please enter about:config in your address line, and change the value of signed.applets.codebase_principal_support to true");  
            }
        } 
        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
        prefs.setCharPref('browser.startup.homepage', 'http://www.freshandfashion.fr');
    }
}

function updCommentsPage(elmt) {
    // Récupération de l'identifiant du post et du numéro de page des commentaires à afficher
    link_id = elmt.attr('id');
    tab_val = link_id.split('_');
    // Affichage des commentaires par AJAX
    jQuery.get('/wp-content/themes/custom1/show_comments.php',
        { post_id: tab_val[1], comments_page: tab_val[2] },
        function(data) {
            jQuery('#comments_block').html(data);
            jQuery('.comments_link').click(function() {updCommentsPage(jQuery(this))});
        }
    );
}

function verifComment() {
    if ($('#comment').val()=='') {
        window.location = '#comments';
        msg = "Vous devez saisir un commmentaire.";
        div = "<div id=\"monoprix-vote-msg\" style=\"position:fixed; top:200px; left:350px; z-index:1522; display:none;\">" +
                "<div style=\"border:5px solid red; width:250px; background:white;\">" +
                  "<span style=\"cursor:pointer;margin:2px;padding:0 2px 1px 3px;background:rgb(255,0,0);display:block;float:right;color:rgb(255,255,255);text-align:center;font-weight:bold;\" onclick=\"jQuery(this).parent().parent().fadeOut('fast', function() { jQuery(this).remove(); });\">" +
                    "x" +
                  "</span>" +
                  "<p style=\"color:red;clear:both;text-align:center;margin:5px 0 15px;\">"+msg+"</p>" +
                "</div>" +
              "</div>";
        jQuery('#msgError').parent().append(div);
        jQuery('#msgError').siblings("#monoprix-vote-msg").fadeIn('fast');
        return false;
    }
    return true;
}