function PopUp(strUrl, strName, isizeX, isizeY) {
  var PopUp = null;
  PopUp = window.open(strUrl, strName, 'width='+isizeX+',height='+isizeY+',toolbar=no,scrollbars=no,statusbar=no,menubar=no,left=15,top=15,resizable=no,personalbar=no,locationbar=no');
  PopUp.focus();
}

function PopImg(nom,ext,x,y) {
str='<';
var a=x-5,b=y-5;
var PopImg=null;
var fic="Images/im_pages/"+nom+"."+ext;
PopImg=window.open('','pop'+nom,'width='+x+',height='+y+',toolbar=no,scrollbars=no,statusbar=no,menubar=no,left=15,top=15,resizable=no,personalbar=no,locationbar=no');PopImg.document.write('<html><head><title>Agi-Soft France</title></head><body background="'+fic+'" onBlur="javascript:self.close();"><table width="100%" height="100%" align="center" valign="middle"><tr><td><a href="javascript:self.close();"><img src="Images/shim.gif" width="'+a+'" height="'+b+'" alt="Environ 5 sec. de chargement - Cliquez pour fermer la fen&ecirc;tre" border="0"></a></td></tr></table></body>'+str+'script language="javascript">self.focus();'+str+'/script></html>');
PopImg.focus();
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		_14index_03 = newImage("Images/im_acc/14index_03.gif");
		_15index_06 = newImage("Images/im_acc/15index_06.gif");
		_16index_08 = newImage("Images/im_acc/16index_08.gif");
		_17index_10 = newImage("Images/im_acc/17index_10.gif");
		_18index_12 = newImage("Images/im_acc/18index_12.gif");
		preloadFlag = true;
	}
}

function tableau() {
  this.length = tableau.arguments.length
  for (var i = 0; i < this.length; i++)
  this[i+1] = tableau.arguments[i]
}

function date() {
	var tablJour = new tableau("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi");
	var tablMois = new tableau("Janvier","F&eacute;vrier","Mars","Avril","Mai","Juin","Juillet","Ao&ucirc;t","Septembre","Octobre","Novembre","D&eacute;cembre");
	var DateJour = new Date();
  strdate=tablJour[(DateJour.getDay()+1)]+' '+DateJour.getDate()+' ';
  strdate+=tablMois[(DateJour.getMonth()+1)]+' ';
  if (document.layers) {
    strdate+=(DateJour.getFullYear());
  } else {
    strdate+=DateJour.getFullYear();
  }
	return strdate;
}

// Donne la valeur d'un bouton radio
function getRadioValue(whichRadio)
{
  for (var i=0; i<whichRadio.length; i++)
  {
    if (whichRadio[i].checked) return whichRadio[i].value;
  }
  return "";
}

function testform() {
	
  if (document.F1.nom.value.length <= 2) {
    alert("Indiquez votre nom !");
    window.document.F1.nom.focus();
    return;
  }
  
  if (document.F1.prenom.value.length <= 2) {
    alert("Indiquez votre prénom !");
    window.document.F1.prenom.focus();
    return;
  }  


  if (getRadioValue(document.F1.adressetype) == "") {
    alert("Indiquez la nature de l'adresse !");
    window.document.F1.adressetype.focus();
    return;
  }

  if (document.F1.adresse1.value.length <= 2) {
    alert("Indiquez votre adresse !");
    window.document.F1.adresse1.focus();
    return;
  }

  if (document.F1.codepostal.value.length <= 2) {
    alert("Indiquez votre code postal !");
    window.document.F1.codepostal.focus();
    return;
  }

  if (document.F1.ville.value.length <= 2) {
    alert("Indiquez votre ville !");
    window.document.F1.ville.focus();
    return;
  }
    	
  if (isValidMail(window.document.F1.email.value) == false) {
    alert("Email incorrect ou absent");
    window.document.F1.email.focus();
    return;
  }

  if (document.F1.message.value=="") {
    alert("Indiquez votre message !");
    window.document.messagevisiteur.ville.focus();
    return;
  }


document.F1.submit();
}

function isValidMail(Email) {
  var strTmp = Email;
  i = strTmp.indexOf("@",0);
  if (i <= 3) return false;
  i = strTmp.indexOf("@", i+1);
  if (i > 0) return false;
  i = strTmp.lastIndexOf(".");
  if (i < 2) return false;
  i = strTmp.lastIndexOf("à");
  if (i > 0) return false;
  i = strTmp.lastIndexOf("â");
  if (i > 0) return false;
  i = strTmp.lastIndexOf("è");
  if (i > 0) return false;
  i = strTmp.lastIndexOf("é");
  if (i > 0) return false;
  i = strTmp.lastIndexOf("ê");
  if (i > 0) return false;
  i = strTmp.lastIndexOf("ë");
  if (i > 0) return false;
  i = strTmp.lastIndexOf("î");
  if (i > 0) return false;
  i = strTmp.lastIndexOf("ï");
  if (i > 0) return false;
  i = strTmp.lastIndexOf("ô");
  if (i > 0) return false;
  i = strTmp.lastIndexOf("ö");
  if (i > 0) return false;
  i = strTmp.lastIndexOf("ù");
  if (i > 0) return false;
  i = strTmp.lastIndexOf("û");
  if (i > 0) return false;
  return true;
}

function raz() {
document.F1.nom.value='';
document.F1.prenom.value='';
document.F1.societe.value='';
document.F1.profession.value='';
document.F1.adresse1.value='';
document.F1.adresse2.value='';
document.F1.codepostal.value='';
document.F1.ville.value='';
document.F1.pays.value='';
document.F1.email.value='';
document.F1.tel.value='';
document.F1.fax.value='';
document.F1.profession.value='';
document.F1.message.value='';
alert(document.F1.civ.value);
document.F1.civ.value='Mr';
alert(document.F1.civ.ckecked);
}

function verif() {
  if (isValidMail(window.document.F1.email.value) == false) {
    alert("Email incorrect ou absent");
    window.document.F1.email.focus();
    return;
  }
  if (document.F1.objet.value.length < 2) {
    alert("Saisissez un objet !");
    window.document.F1.objet.focus();
    return;
  }
  if (document.F1.message.value.length <= 5) {
    alert("Saisissez un message !");
    window.document.F1.message.focus();
    return;
  }
  var today = new Date();  
  document.F1.date.value = today.getDate()+"/"+(today.getMonth()+1)+"/"+today.getFullYear()+" "+today.getHours()+":"+today.getMinutes()+":"+today.getSeconds();
  document.F1.submit();
}