<!--
function getSwf(id, src, width, height, color) {
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '" id="' + id + '" align="middle">\n');
    document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
    document.write('<param name="movie" value="' + src + '" />\n');
    document.write('<param name="quality" value="high" />\n');
    document.write('<param name="wmode" value="transparent" />\n');
    document.write('<param name="bgcolor" value="' + color + '" />\n');
    document.write('<embed src="' + src + '" quality="high" wmode="transparent" bgcolor="' + color + '" width="' + width + '" height="' + height + '" name="' + id + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
    document.write('</object>\n');
}

// champs obligatoires
function checkrequiredfields() {
    for(i=0; i < checkrequiredfields.arguments.length; i++) {
        if (document.main.elements[checkrequiredfields.arguments[i]].value == "") {
            alert("Champs obligatoire ");
            document.main.elements[checkrequiredfields.arguments[i]].className='required';
            document.main.elements[checkrequiredfields.arguments[i]].focus();
            return false;
        }
    }
    return true;
}

function showmenu(liste) {
	if ((document.getElementById(liste))) {
		var e = document.getElementById(liste);
		if (e.style.display == 'none') {
			e.style.display = 'block';
		} else {
			e.style.display = 'none';
		}
		return true;
	} else {
		return false;
	}
}

// Clean
function cleanform() {
	document.main.p_cat.value = "";
	document.main.p_ss_cat.value = "";
	document.main.p_sous_ss_cat.value = "";				
    document.main.p_show.value = "";
    document.main.p_action.value = ""; 
    document.main.marque.value = "";

}

// load produits par marque
function load_marque(id_marque) {
    if(id_marque == "9") {   
        document.main.rub.value = "selfdiet"; 
        document.main.ssr.value = "home";  
    }else {
        document.main.rub.value = "produit"; 
        document.main.ssr.value = "home";          
    }        
	document.main.p_show.value = "";
    document.main.p_marque.value = id_marque;
    document.main.p_action.value = "marque";
    document.main.produit.value = "";
    document.main.submit();
}

// load produit par produit
function load_produit(id_produit) {  
    document.main.rub.value = "produit"; 
    document.main.ssr.value = "produit_seul";
	document.main.p_cat.value = "";	
    document.main.p_show.value = id_produit;
    document.main.p_action.value = "produit_seul"; 
    document.main.marque.value = "";
    document.main.submit();
}

// load produit par categorie
function load_categorie(id_categorie) {
		var menu = 'menu_' + id_categorie;
    document.main.rub.value = "produit"; 
    document.main.ssr.value = "home";       
    document.main.p_cat.value = id_categorie;
    document.main.p_ss_cat.value = "";
    document.main.p_sous_ss_cat.value = "";
    document.main.p_action.value = "categorie"; 
    document.main.marque.value = ""; 
    document.main.produit.value = "";  
        document.main.offpg.value = "";
    document.main.offset.value = "";
    document.main.nbrows.value = "4";
    document.main.prev_nbrows.value = "";        
    document.main.submit();
}

// load produit par categorie
function load_sscategorie(id_categorie) {  
	document.main.p_sous_ss_cat.value = "";	      
    document.main.rub.value = "produit"; 
    document.main.ssr.value = "home";       
    document.main.p_ss_cat.value = id_categorie;
    document.main.p_action.value = "categorie"; 
    document.main.marque.value = ""; 
    document.main.produit.value = "";  
        document.main.offpg.value = "";
    document.main.offset.value = "";
    document.main.nbrows.value = "4";
    document.main.prev_nbrows.value = "";       
    document.main.submit();
}

function load_sous_sscategorie(id_categorie) {      
    document.main.rub.value = "produit"; 
    document.main.ssr.value = "home";       
    document.main.p_sous_ss_cat.value = id_categorie;
    document.main.p_action.value = "categorie"; 
    document.main.marque.value = ""; 
    document.main.produit.value = "";     
        document.main.offpg.value = "";
    document.main.offset.value = "";
    document.main.nbrows.value = "4";
    document.main.prev_nbrows.value = "";     
    document.main.submit();
}

function langue(ln) {
    document.main.ln.value = ln;      
    document.main.submit();        
} 

function panier_ajout(id_produit) {
    document.main.p_show.value = id_produit;    
    document.main.p_panier.value = "panier_ajout"; 
    document.main.submit();              
}

function supp(id){
	if (confirm("Etes-vous sûr de vouloir supprimer ce produit ?")) {
	    document.main.p_show.value = id;
	    document.main.p_panier.value = "panier_del";
	    document.main.submit();
	}
}

function supp_selfdiet(id,selfdiet){
	if (confirm("Etes-vous sûr de vouloir supprimer ce produit ?")) {
	    document.main.p_show.value = id;
	    document.main.p_self.value = selfdiet;	    
	    document.main.p_panier.value = "selfdiet_del";
	    document.main.submit();
	}
}

function detail_produit(id_produit) {
    document.main.rub.value = "produit"; 
    document.main.ssr.value = "detail_produit";     
    document.main.p_show.value = id_produit;    
    document.main.submit();        
}

function popup(lien,id_produit) {
    document.main.p_show.value = id_produit;
	titre = Math.round(Math.random() * 4294967295);
	window.open(lien, titre, 'toolbar=no,resizable=yes,menubar=no,location=no,status=no,scrollbars=yes,width=650,height=650');
}

// Ouvrir une popup du produit selfdiet sélectionné
function popup_produit_self(lien) {
	titre = Math.round(Math.random() * 4294967295);
	window.open(lien, titre, 'toolbar=no,resizable=yes,menubar=no,location=no,status=no,scrollbars=yes,width=650,height=650');
}
 
function voir_panier() {  
    document.main.rub.value = "panier"; 
    document.main.ssr.value = "home"; 
    document.main.marque.value = ""; 
    document.main.produit.value = "";        
    document.main.submit();        
}  

// Changer la quantité
function load_quantite(id_produit,p_form) {    
    if(parseInt(document.main.form_quantite1.value) == document.main.form_quantite1.value) {
    	document.main.p_show.value = id_produit;
    document.main.p_form.value = p_form;        
    document.main.p_panier.value = "change_quantite";       
        document.main.submit();
    }else {
        alert("Votre quantité n'est pas valide.");    
    }        
}

// Valider sa commande
function valider() {      
    document.main.rub.value = "espace";
    document.main.ssr.value = "confirmer";         
    document.main.submit();
}
 
// Inscription
function inscription() {      
    document.main.rub.value = "inscription";  
    document.main.submit();
} 

// Paiement
function paiement() {           
    document.main.submit();
}

// Newsletter
function newsletter_add() {
    document.main.rub.value = "ajoutnewsletter";    
	document.main.p_newsletter.value = "newsletter_add";
    document.main.submit();
}

function favoris() {
	window.external.addfavorite("http://www.paranutri.com/","Paranutri"); 
}

function construction(langue) {
    if(langue == "en") {   
        alert("Under construction");
    }
    if(langue == "nl") {   
        alert("Website in aanmaak");
    }       
}
   
//-->
