function checkform()
{
	if((document.frm.nom.value == "") || (document.frm.prenom.value == "") || (document.frm.ville.value == "") || (document.frm.tel.value == "") )
	{
		alert ('Veuillez renseigner les champs obligatoires !');
		return false;
	}
	if(!verifiermail(document.frm.mail.value)){
		return false;
	}
	
	return true;
}
function verifiermail(mail) 
{
	//mail = ""+mail+"";
      if (!(mail.indexOf("@")>=0) )
	  {
         alert("Le mail doit être du format adresse@ !");
         return false
      }
	  
	  if(!(mail.lastIndexOf(".")<mail.length -2) || !(mail.lastIndexOf(".")>=mail.length -4)) 
	  {
         alert("Mail invalide !");
		 return false
      }
	  return true;
}

/*window.onload=montre;*/
function montre(id) {

var d = document.getElementById(id);
	for (var i = 1; i<=4; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
	
if (d) {d.style.display='block';return true;}
//document.getElementById('menu1').value =1;
}



/*************************/

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];}
}

/************************/

var tab_image = new Array(21);
for (var i=0; i< tab_image.length;i++)
	tab_image[i]= new Image();
tab_image[0].src='images/menu2_02.gif';
tab_image[1].src='images/menu2_03.gif';
tab_image[2].src='images/menu2_04.gif';
tab_image[3].src='images/menu2_5.gif';
tab_image[4].src='images/menu3_01.gif';
tab_image[5].src='images/menu3_02.gif';
tab_image[6].src='images/menu3_03.gif';
tab_image[7].src='images/menu4_04.gif';
tab_image[8].src='images/menu5_01.gif';
tab_image[9].src='images/menu5_02.gif';

tab_image[10].src='images/ss_menu_ent_06_bis.gif';
tab_image[11].src='images/ss_menu_ent_08_bis.gif';
tab_image[12].src='images/ss_menu_ent_15_bis.gif';
tab_image[13].src='images/ss_menu_ent_22_bis.gif';
tab_image[14].src='images/ss_menu_moyens_09_bis.gif';
tab_image[15].src='images/ss_menu_moyens_17_bis.gif';
tab_image[16].src='images/ss_menu_moyens_23_bis.gif';
tab_image[17].src='images/ss_menu_atouts_01_bis.gif';
tab_image[18].src='images/ss_menu_atouts_02_bis.gif';
tab_image[19].src='images/ss_menu_contacts_24_bis.gif';
tab_image[20].src='images/ss_menu_contacts_26_bis.gif';

var n=0;

function change() {
n= ++n; 
if (n == tab_image.length) n=0;
window.document.image1.src=tab_image[0].src;
window.document.image2.src=tab_image[1].src;
window.document.image3.src=tab_image[2].src;
window.document.image4.src=tab_image[3].src;//alert(n);
if(document.getElementById('page').value == 'metier') window.document.ss_menu1.src = tab_image[10].src;
else if(document.getElementById('page').value == 'historique') window.document.ss_menu2.src = tab_image[11].src;
else if(document.getElementById('page').value == 'organigramme') window.document.ss_menu3.src = tab_image[12].src;
else if(document.getElementById('page').value == 'qualite') window.document.ss_menu4.src = tab_image[13].src;
}

function change2() {
n= ++n;
if (n == tab_image.length) n=0;
window.document.image1.src='images/menu_04.gif';
window.document.image2.src=tab_image[4].src;
window.document.image3.src=tab_image[5].src;
window.document.image4.src=tab_image[6].src;
if(document.getElementById('page').value == 'series') window.document.ss_menu5.src = tab_image[14].src;
else if(document.getElementById('page').value == 'performances') window.document.ss_menu6.src = tab_image[15].src;
else if(document.getElementById('page').value == 'demandes') window.document.ss_menu7.src = tab_image[16].src;
}

function change3() {
n= ++n;
if (n == tab_image.length) n=0;
window.document.image1.src='images/menu_04.gif';
window.document.image2.src='images/menu_05.jpg';
window.document.image3.src=tab_image[8].src;
window.document.image4.src=tab_image[9].src;
if(document.getElementById('page').value == 'equipe') window.document.ss_menu8.src = tab_image[17].src;
if(document.getElementById('page').value == 'reactivite') window.document.ss_menu9.src = tab_image[18].src;
}

function change4() {
n= ++n;
if (n == tab_image.length) n=0;
window.document.image1.src='images/menu_04.gif';
window.document.image2.src='images/menu_05.jpg';
window.document.image3.src='images/menu_06.jpg';
/*window.document.image2.src='images/menu2_03.gif';
window.document.image3.src='images/menu2_04.gif';*/
window.document.image4.src=tab_image[7].src;
if(document.getElementById('page').value == 'contacts') window.document.ss_menu10.src = tab_image[19].src;
if(document.getElementById('page').value == 'acces') window.document.ss_menu11.src = tab_image[20].src;
}



/******Popup***/
var photographie=0;
var wind=null;

function Photo(fichier, titre)
{
	this.fichier = fichier;
	this.titre = titre;
}

var photos=new Array();

photos[0]=new Photo('images/notremetier_atelier_b.jpg','Notre métier');
photos[1]=new Photo('images/laser-fusion-web013GD.jpg','Nos Moyens');
photos[2]=new Photo('images/DUC4888GD.jpg','Nos Moyens');
photos[3]=new Photo('images/nosmoyens_grandesseries3_b.jpg','Nos Moyens');
photos[4]=new Photo('images/nosmoyens_grandesseries4_b.jpg','Nos Moyens');
photos[5]=new Photo('images/DUC4944GD.jpg','Nos Moyens');
photos[6]=new Photo('images/nosmoyens_hauteperf2_b.jpg','Nos Moyens');
photos[7]=new Photo('images/nosmoyens_hauteperf3_b.jpg','Nos Moyens');
photos[8]=new Photo('images/nosmoyens_hauteperf4_b.jpg','Nos Moyens');
photos[9]=new Photo('images/nosmoyens_autresdemandes1_b.jpg','Nos Moyens');
photos[10]=new Photo('images/nosmoyens_autresdemandes2_b.jpg','Nos Moyens');
photos[11]=new Photo('images/nosmoyens_autresdemandes3_b.gif','Nos Moyens');
photos[12]=new Photo('images/nosmoyens_autresdemandes4_b.jpg','Nos Moyens');
photos[13]=new Photo('images/laser-fusion-web039GD.jpg','Notre métier');
photos[14]=new Photo('images/atouts_01_b.jpg','Nos atouts');
photos[15]=new Photo('images/atouts_03_b.jpg','Nos atouts');
photos[16]=new Photo('images/laser-fusion-web010GD.jpg','Nos atouts');
photos[17]=new Photo('images/DUC4919GD.jpg','Nos atouts');
photos[18]=new Photo('images/atouts_09_b.jpg','Nos atouts');
photos[19]=new Photo('images/atouts_10_b.jpg','Nos atouts');
photos[20]=new Photo('images/atouts_11_b.jpg','Nos atouts');
photos[21]=new Photo('images/DUC4939GD.jpg','Nos atouts');
photos[22]=new Photo('images/atouts_14_b.jpg','Nos atouts');
photos[23]=new Photo('images/nosatouts_sgateau.jpg','Nos atouts');
photos[24]=new Photo('images/laser-fusion-web010GD.jpg','Réactivité');
photos[30]=new Photo('images/historique/image001.jpg','Historique');
photos[31]=new Photo('images/historique/image005.png','Historique');
photos[32]=new Photo('images/historique/image009.jpg','Historique');
photos[33]=new Photo('images/historique/image011.png','Historique');
photos[34]=new Photo('images/historique/image013.jpg','Historique');
photos[35]=new Photo('images/historique/image021.jpg','Historique');
photos[36]=new Photo('images/historique/image023.jpg','Historique');
photos[37]=new Photo('images/historique/image025.jpg','Historique');
photos[38]=new Photo('images/historique/image026.jpg','Historique');
photos[39]=new Photo('images/historique/image028.jpg','Historique');
// ajoute ici tes autres images ...

function charger_image(idx)
{
	photographie=photos[idx];
	wind=open("popup.html",'popup','width=800,height=600,toolbar=no,scrollbars=no,resizable=no'); 
	return false;
}
/**************/


/*var tab_ss_menu = new Array(10);
for (var i=0; i< tab_ss_menu.length;i++)
	tab_ss_menu[i]= new Image();
tab_ss_menu[0].src='images/ss_menu_ent_bis_03.gif';


function change_ss_menu()
{
	n= ++n;
	if (n == tab_image.length) n=0;
	window.document.ss_menu1.src = tab_ss_menu[0].src;
}

function change_ss_menu()
{
	if(document.getElementById('page').value == 'metier')
	{
		alert('ok');
		window.document.ss_menu1.src = 'images/ss_menu_ent_bis_03.gif';
		return true;
	}
	else window.document.ss_menu1.src ='images/ss_menu_ent_06.gif';
}*/
