function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}

function visu_article(refart) { //v2.0
//MM_openBrWindow('ajout-panier.php?refart={$pgListeGroupe[i].ar_code}','commande','scrollbars=yes,resizable=yes,width=600,height=300')
url='fiche-mat.php?refart=' + refart;
window.open(url,'fiche_article','scrollbars=yes,resizable=yes,width=700,height=600');
}

function finAffichage() {
    removeBar("progressbar");
    //document.getElementById("message").innerHTML='Vous pouvez utiliser la fonction "Recherche" (Ctrl+F) de votre navigateur pour localiser rapidement un article.';
    document.getElementById("message").innerHTML='';
}

function init_pays(champ)
{
 if ( (champ.value != "") && (document.forms["coordonnees"].pays.value=="-") )
 	document.forms["coordonnees"].pays.value="FR";
}
function valider(btn)
{
	document.coordonnees.bouton.value=btn;
	document.coordonnees.submit();
}

function onload_page(imprimer)
{

	MM_preloadImages('images/boutons/ok_s.gif','images/boutons/envoyer_s.gif', 'images/boutons/retouretape1_s.gif');
	if (imprimer==1)
		MM_openBrWindow('cde-prepa-print.php','Commande_type','scrollbars=yes,resizable=yes,width=750,height=700');
}

/* 
 Affiche pafe aide en ligne / section = section d'aide ex "2-1":
 +++ calculer section en fct url
2–1 Créer un compte  http://qualite.sodipro.fr/catalogue/compte1.php
4-0 Sur toutes les pages, à côté du menu Rechercher
4-2 Recherche avancée http://qualite.sodipro.fr/catalogue/rech-avancee.php
4-4 Recherche par « Votre liste de Prix » https://www.sodipro.fr/catalogue/liste-prix-client.php
5-0 - Liste articles http://qualite.sodipro.fr/catalogue/liste-art-lsf.php?recherche=becher+pmp+100&x=5&y=11
6–0 passer une commande http://qualite.sodipro.fr/catalogue/commande1.php
7–0 Historique des commandes http://qualite.sodipro.fr/catalogue/histo-cde.php
7-2 Détail et suivi de la commande : http://qualite.sodipro.fr/catalogue/histo-cde.php/ commande N° truc….
8-0 Commandes types http://qualite.sodipro.fr/catalogue/cde-type-liste.php
9–0 Commandes à valider http://qualite.sodipro.fr/catalogue/cde-valid.php
10-0 Demande de devis http://qualite.sodipro.fr/catalogue/devis-liste.php
11–0 Les Fiches de données de sécurité http://qualite.sodipro.fr/catalogue/fiche-securite.php
 */
function affiche_aide(section)
{
	// table page - index d'aide (anchor _TocX-Y)
	var topic= new Array()
	topic['compte1.php']='2–1';
	topic['rech-avancee.php']='4-2';
	topic['liste-prix-client.php']='4-4';
	topic['liste-art-lsf.php']='5-0';
	topic['commande1.php']='6–0';
	topic['detail-cde.php?cde']='7-2';
	topic['histo-cde.php']='7–0';
	topic['cde-type-liste.php']='8-0';
	topic['cde-valid.php']='9–0';
	topic['devis-liste.php']='10-0';
	topic['fiche-securite.php']='11–0';

	var sPath = window.location.href; // .pathname
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1); // detail-cde.php?cde=CW00000710
	

	var url='html/aide.html';	
	if (section !='')
		url += '#_Toc'+section;	
	else
		for ( var page in topic ) 
		    if ( sPage.substr(0,page.length)==page ) {
		    	url += '#_Toc'+topic[page];
		    	break;
			}	

	window.open(url,'Aide','scrollbars=yes,resizable=yes,width=500,height=450');
	
}
