function AllerA(URL, bHome) {
// ------------------------------------------------------------
// Dirige vers l'URL indiquee en demandant confirmation pour la langue
// ------------------------------------------------------------
	if (bHome)
	{
	    // Si on redirige vers la page d'accueil
		if (confirm('The current page is not available in English.\nYou will be redirected to the home page.'))
		{
			document.location = URL;
		}
	}
	else
	{
	    // Sinon, c'est qu'on redirige vers une page en fran&ccedil;ais seulement
		if (confirm('Htmledit description is only available in French.\nDo you want to switch to French language?'))
		{
			document.location = URL;
		}
	}
	return;
}

function VerifierEmail(oChamp) {
// ------------------------------------------------------------
// Verfie que l'email passe en parametre est bon
// ------------------------------------------------------------
		var pos, point,value;
		value=oChamp.value;
		pos=value.indexOf("@")+1;
		if (pos>1) {
				point=value.indexOf(".", pos);
				if (point>pos && point<value.length-1) return true;
		}
		alert('L\'adresse e-mail est erron\xE9e');
		oChamp.value="";
		oChamp.focus();
		return false;
}

function popUp(URL,options)
{
   var my_win;
	my_win = window.open(URL,'mywin',options);
	if(my_win && !my_win.closed){
		my_win.focus();
	}
	return;
}

function PopUpMailingList(typ) {
// ------------------------------------------------------------
// Verfie que l'email entre est bon et ouvre une pop up
// pour l'inscription ou la desinscription de la mailing list
//
// typ = "i" si inscription
// typ = "d" si desinscription
// ------------------------------------------------------------
   var cv_win;
   oemail = document.formMail.textmail;
   if (VerifierEmail(oemail))
		{
			cv_win = window.open('http://www.htmledit.com/mailinglist/mailinglistMAJ.php?mode=' + typ + '&email=' + oemail.value,'MailingList','width=400,height=300,toolbars=no');
			if(cv_win && !cv_win.closed){
				cv_win.focus();
			}
	}
	return;
}


function preloadImages() { //v3.0
// ------------------------------------------------------------
// Precharge les images pour le RollOver
// ------------------------------------------------------------
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=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 swapImgRestore() { //v3.0
// ------------------------------------------------------------
// Affiche une image
// ------------------------------------------------------------
	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 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=findObj(n,d.layers[i].document);
	if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function swapImage() { //v3.0
// ------------------------------------------------------------
//
// ------------------------------------------------------------
	var i,j=0,x,a=swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
