// JavaScript Document
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_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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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 MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
  var ok=false; document.MM_returnValue = false;
  with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
    ok=(plugins && plugins[plgIn]);
  } else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
    if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
    else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
    else ok=autoGo; }
  if (!ok) theURL=altURL; if (theURL) window.location=theURL;
}

function PopupImage(val) {
	titre="Zoom";
	w=open('','zoom','width=100,height=100,toolbar=no,scrollbars=no,resizable=yes');	
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE>");
	w.document.write("<script language='javascript'> function resizeMe() { if (navigator.appName == 'Netscape') { adjWidth = document.images[0].width; adjHeight = document.images[0].height;}else{ adjWidth = document.images[0].width+13; adjHeight = document.images[0].height+32;} self.resizeTo(adjWidth, adjHeight);}");
	w.document.write("</script></HEAD>");	
	w.document.write("<BODY onload='resizeMe();window.focus();' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><a href=javascript:self.close();><IMG src='"+val+"' alt=Clickez&nbsp;pour&nbsp;fermer border=0></a></BODY></HTML>");
	w.document.close();
}

function popUp(myUrl,nom,w,h) {
	myWindow = window.open(myUrl,nom,"toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,copyhistory=0,resizable=1,width="+w+",height="+h);
	myWindow.location = myUrl;
	}

function mellist()
{

	if(document.form1.nom.value.search(/[a-zA-Z]/)==-1)
	{
	alert('Nom necessaire');
	document.form1.nom.focus();
	return false;
	}
	
		if(document.form1.prenom.value.search(/[a-zA-Z]/)==-1)
	{
	alert('Prénom necessaire');
	document.form1.prenom.focus();
	return false;
	}
	
	if(document.form1.mail.value =='')
	{
	alert('e-mail necessaire');
	document.form1.mail.focus();
	return false;
	}
	
	if(document.form1.mail.value != "" )
	{
		if (document.form1.mail.value.search(/^[-a-zA-Z0-9._]*[-a-zA-Z0-9_]@[-a-zA-Z0-9_]+(\.[-a-zA-Z0-9_]+)*\.[a-zA-Z]{2,3}$/) < 0)
		{
			alert("adresse mail incorecte");
			document.form1.mail.focus();
			return false;
		};
	};
		return true;
}



	
	
	function previs()
{

document.f2.ref.value = document.f1.ref.value;
document.f2.des.value = document.f1.des.value;
document.f2.txt.value = document.f1.txt.value;
document.f2.prix_seul.value = document.f1.prix_seul.value;
document.f2.ex_prix_q.value = document.f1.ex_prix_q.value;
document.f2.ex_nb.value = document.f1.ex_nb.value;
document.f2.ex_marquage.value = document.f1.ex_marquage.value;
document.f2.pub.value = document.f1.pub.value;
document.f2.particularites.value = document.f1.particularites.value;
// radio visible
for (var a=0; a<document.f1.visible.length;a++)
	{
		if (document.f1.visible[a].checked)
		{
		document.f2.visible.value=document.f1.visible[a].value;
		}
	}
	//radio new
for (var a=0; a<document.f1.nouv.length;a++)
	{
		if (document.f1.nouv[a].checked)
		{
		document.f2.nouv.value=document.f1.nouv[a].value;
		}
	}
	
document.f2.submit();	
}

function cli_fr()
{

	if(document.form1.nom.value.search(/[a-zA-Z]/)==-1)
	{
	alert('Nom nécessaire');
	document.form1.nom.focus();
	return false;
	}
	
	if(document.form1.prenom.value.search(/[a-zA-Z]/)==-1)
	{
	alert('Prénom nécessaire');
	document.form1.prenom.focus();
	return false;
	}

	if(document.form1.tel.value.search(/[0-9]/)==-1)
	{
	alert('Téléphone nécessaire');
	document.form1.tel.focus();
	return false;
	}
	
	if(document.form1.email.value =='')
	{
	alert('e-mail nécessaire');
	document.form1.email.focus();
	return false;
	}
	
	if(document.form1.email.value != "" )
	{
		if (document.form1.email.value.search(/^[-a-zA-Z0-9._]*[-a-zA-Z0-9_]@[-a-zA-Z0-9_]+(\.[-a-zA-Z0-9_]+)*\.[a-zA-Z]{2,3}$/) < 0)
		{
			alert("adresse mail incorecte");
			document.form1.email.focus();
			return false;
		};
	};
	
	
	return true;

}


// cacher le calque des news
function cache()
{
	if (document.getElementById) {
	element = document.getElementById("encart");
	} else if (document.all) {
	element = document.all["encart"];
	} 

element.style.visibility='hidden';

}
