// JavaScript Document

function MM_showHideLayers(){
  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_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;
}

var boxy_fenetre;

function creer_boxy(div_id){
	if(!boxy_fenetre){
		boxy_fenetre = new Boxy('<span>'+$("#lot_"+div_id).html()+'</span>', {title: $("#lot_"+div_id).attr('title')});
	}else{
		boxy_fenetre.setContent('<span>'+$("#lot_"+div_id).html()+'</span>');
		boxy_fenetre.setTitle($("#lot_"+div_id).attr('title'));
		boxy_fenetre.center();
		boxy_fenetre.show();
	}
}


function creer_boxy_actu(div_id){
	if(!boxy_fenetre){
		boxy_fenetre = new Boxy('<span>'+$("#actu_acc_"+div_id).html()+'</span>', {title: $("#actu_acc_"+div_id).attr('title')});
	}else{
		boxy_fenetre.setContent('<span>'+$("#actu_acc_"+div_id).html()+'</span>');
		boxy_fenetre.setTitle($("#actu_acc_"+div_id).attr('title'));
		boxy_fenetre.center();
		boxy_fenetre.show();
	}
}

function fnVerif(){
	if (document.contact.nom.value==""){
		alert("Renseignez votre Nom");
		document.contact.nom.focus();
		return  false;
		}
	if (document.contact.tel.value==""){
		alert("Renseignez votre téléphone");
		document.contact.tel.focus();
		return  false;
		}
	if (document.contact.message.value==""){
		alert("N'oubliez pas votre message");
		document.contact.message.focus();
		return  false;
		 }
	var email=document.contact.email.value;
	if (""==email){
		alert("Renseignez votre Email");
		document.contact.email.focus();
		return false;
	}else if (    ( -1== email.indexOf( '@' ,0)  )  ||  ( -1==email.indexOf('.',0 )  )    ) {
		// l'adresse entrée est incorrecte
		alert("adresse Email incorrecte");
		document.contact.email.focus();
		return false;
	}
}

function fnVerifMoratoire(){
	if (document.photo.nom.value==""){
		alert("Renseignez votre Nom");
		document.photo.nom.focus();
		return  false;
		}
	if (document.photo.message.value==""){
		alert("N'oubliez pas votre message");
		document.photo.message.focus();
		return  false;
		 }
	var email=document.photo.email.value;
	if (""==email){
		alert("Renseignez votre Email");
		document.photo.email.focus();
		return false;
	}else if (    ( -1== email.indexOf( '@' ,0)  )  ||  ( -1==email.indexOf('.',0 )  )    ) {
		// l'adresse entrée est incorrecte
		alert("adresse Email incorrecte");
		document.photo.email.focus();
		return false;
	}
}
