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/custom2/show_comments.php',
        { post_id: tab_val[1], comments_page: tab_val[2], isBlog: 1 },
        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.";
        jQuery('#msgError').parent().append("<div id=\"monoprix-vote-msg\" style=\"position:fixed; top:100px; left:350px; z-index:1522; display:none;\"><div style=\"border:5px solid red; width:250px; background:white;\"><p style=\"color:red;\">"+msg+"</p><p align=\"right\" style=\"margin:0;\"><a href=\"javascript:void(0);\" onclick=\"jQuery(this).parent().parent().parent().fadeOut('fast', function() { jQuery(this).remove(); });\">Fermer</a></p></div></div>");
        jQuery('#msgError').siblings("#monoprix-vote-msg").fadeIn('fast');
        return false;
    }
    return true;
}