//***Test navigateur
var navig = navigator.appVersion
var vers = navig.substring(0, 3);
if ( vers<4.0)
{
alert("\nLa version de votre navigateur [version " + vers + "] ne vous permet pas de visualiser le DHTML ! \nÀ bientôt...");
history.back();
}
var ms = navigator.appVersion.indexOf("MSIE")
ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4)

var NET = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4);
var invis = (NET) ? 'hide' : 'hidden';
var vis = (NET) ? 'show' : 'visible';
var oObject = (NET) ? '[object Form]' : '[object]';

function showlr(dd,L){
NS=(dd.layers)?1:0;
IE=(dd.all)?1:0;
if(NS)dd.layers[L].visibility='show';
else if (IE)obg=dd.all[L];
else obg=dd.getElementById(L);
if(!NS)obg.style.visibility='visible'
}
function hidelr(dd,L){
NS=(dd.layers)?1:0;
IE=(dd.all)?1:0;
if(NS)dd.layers[L].visibility='hide';
else if (IE)obg=dd.all[L];
else obg=dd.getElementById(L);
if(!NS)obg.style.visibility='hidden'
}


//======================================
function doPopup(url,width,height) 
{
aujourdhui = new Date();
milliseconde = aujourdhui.getTime()

windowprops = "left=50,top=50,width=" + width + ",height=" + height;
preview = window.open(url, "preview"+milliseconde, windowprops);
}
var taux=6.55957; var lequel="";
function convF(f) {
var E=Math.round(100*parseFloat(f.franc.value)/taux)/100;
if (isNaN(E)) { 
alert("Montant incorrect"); f.franc.focus();
} else {
f.euro.value=E;
}
}
function convE(f) {
var F=Math.round(100*parseFloat(f.euro.value)*taux)/100;
if (isNaN(F)) { 
alert("Montant incorrect"); f.euro.focus();
} else {
f.franc.value=F;
}
}
//======================================
//*****************************************		
//***Vérifier si une ligne à été sélectionnée dans la boîte Select <oSelect> laquelle est decrit sur la page par un <nom>
//*** retourne  true si sélectiionné ou false si non séléctionné 
function ControlSelect(oSelect,nom)
{
if (oSelect.selectedIndex==-1)
	{
	alert('Sélectionnez une valeur dans la boîte de liste : '+nom)
	return false
	}
else
	{
	return true	
	}
}
//*****************************************
		

//***Retourne valeur de la ligne sélectionné dans une boîte Select <oSelect>
function ValeurSelectSiple(oSelect)
{
	return oSelect.options[oSelect.selectedIndex].value
}
//*****************************************

//***Retourne texte de la ligne sélectionnée dans une boîte Select <oSelect>
function TexteSelectSiple(oSelect)
{
	return oSelect.options[oSelect.selectedIndex].text
}
//*****************************************
//======================================================	
function queDesChifres(vStr)
{var i,strModifie,strNum
	strNum='0123456789'
	strModifie='';
	for(i=0;i<vStr.length;i++)
		{
		if(strNum.indexOf(vStr.substring(i,i+1))>-1)
			{strModifie=strModifie+vStr.substring(i,i+1);}
		}
	return strModifie;
}
//*****************************************
//***Ouvre une duexième fenêtre	
function OpenPopUp(url1)
{
//alert(url1)
var mafenetre1
//var ouvre = 1;
var szParams1 = "toolbar=no,scrollbars=yes,width=100,height=100,resizable=no,screenX=1,screenY=1,alwaysRaised=yes";
window.defaultStatus ='Info';
mafenetre1 = window.open(url1, "", szParams1);
mafenetre1.focus();
}	
//*** Retourne index de bouton radio <oRadio> selectionne
function SelectedIndexRadio(oRadio)
{var i;
for (i=0;i<oRadio.length;i++)
{
if (oRadio[i].checked==true)
return i;
}
return -1;
} 
//***Ouvre une duexième fenêtre	
function OpenPopUpParam(url1,vW,vH)
{
var mafenetre1;
//var ouvre = 1;
var szParams1 = "toolbar=no,scrollbars=yes,width="+vW+",height="+vH+",resizable=no,screenX=1,screenY=1,alwaysRaised=yes";
window.defaultStatus ='Info';
mafenetre1 = window.open(url1, "", szParams1);
mafenetre1.focus();
}	
//*** Retourne index de bouton radio <oRadio> selectionne
function SelectedIndexRadio(oRadio)
{var i;
for (i=0;i<oRadio.length;i++)
{
if (oRadio[i].checked==true)
return i;
}
return -1;
} 
//==========================================

function replace(chaine,car1,car2)//remplace tous les caractéres car1 par car2 dans la chaine "chaine"
{

var i,nouvelleChaine
nouvelleChaine=''
for (i=0;i<chaine.length;i++)
{
if(chaine.substring(i,i+1)==car1)
	{nouvelleChaine=nouvelleChaine+car2}
else
	{nouvelleChaine=nouvelleChaine+chaine.substring(i,i+1)	}	

}
return nouvelleChaine;
}
//==========================================
function image_on_off(oImage,imagePath)
{
oImage.src=imagePath;
}
//==========================================
function page(nPage)
{
document.form_page.nPageEnCours.value=nPage;
document.form_page.submit();
}
//==========================================
function ImageOnOff(oImage,Src1,Src2,Alt1,Alt2)
{
var strSrc,strSrcRoot,strSrcTmp,AltTmp,indSrc,lenSrc;
strSrc=oImage.src;
lenSrc=strSrc.length;
indSrc=strSrc.lastIndexOf('/')+1;

strSrcRoot=strSrc.substring(0,indSrc);
strSrcTmp=strSrc.substring(indSrc,lenSrc);
if(strSrcTmp==Src1)
	{
	strSrcTmp=Src2;
	AltTmp=Alt2;
	document.form1.a.value=1;
	}
else
	{
	strSrcTmp=Src1	;
	AltTmp=Alt1;
	document.form1.a.value=-1;	
	}
strSrc=strSrcRoot+strSrcTmp;
oImage.src=strSrc;
oImage.alt=AltTmp;
}
//==========================================
 function addbookmark(bookmarkurl,bookmarktitle){
 window.external.AddFavorite(bookmarkurl,bookmarktitle)
 }
 //**********************************
function deselect(oSelect)
{
var i;
oSelect.options.selectedIndex=0;
for (i=0; i < oSelect.length; i++)
        {oSelect.options[i].selected=false;}
}
