function agrandir() {
  false;
}

function opennewwindow(page, fenetre, hauteur, largeur) {
options='height='+hauteur+',width='+largeur+',left=2, top=2,toolbar=no,scrollbars=yes';
newwindow=window.open(page, '_blank',options); 
}

function affichemaxi(chemin,couleur)
	{
	Imageslim = new Image;
	Imageslim.src = chemin;
	titre='Tunisie Leasing';
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0,height=10,width=10,left=10, top=10');
	html = '<HTML><HEAD><TITLE>'+titre+'</TITLE><link href="../../styles/styles.css" rel="stylesheet" type="text/css"></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0 bgcolor="#F7F9FB"><table width="100%" height="100%" cellspacing=0 cellpadding=0><tr><td align="center" valign="middle">';
	html =html+'<table border=0 cellspacing=0 cellpadding=0 align=center><tr><td background="../../images/bg_pop.gif"><img src="../../images/pix.gif" height="6"></td></tr><tr><td class="picture_gr" bgcolor="#FFFFFF"><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+60,document.imageTest.height+100);window.moveTo(100,100);"></td></tr>';
	html=html+'<tr><td><table width="100%" cellspacing=0 cellpadding=0><tr><td bgcolor="#FFEF2C"><img src="../../images/pix.gif" height="3"></td></tr><tr><td bgcolor="#FFFFFF"><img src="../../images/pix.gif" height="1"></td></tr><tr><td align="right" class="texte" height="25" background="../../images/bg_recherche.gif"><a href="#" onClick="javascript:window.close()"><img src="../../images/fermer.gif" hspace="4" border="0"></a></td></tr></table></td></tr>';
	html=html+'</table></td></tr></table>';
	html=html+'</BODY></HTML>';
	
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close();
	}

function Verifmail()
{

	adresse = document.mailing.email.value;
	var place = adresse.indexOf("@",1);
	var point = adresse.indexOf(".",place+1);
	if ((place > -1)&&(adresse.length >2)&&(point > 1))
		{
		opennewwindow('mailing_rep.php?email='+document.mailing.email.value+'','mailing','300','520');
		return false;
		}
	else
		{
		alert(' Invalid e-mail adress!!');
        document.mailing.email.focus();
		return false;		
		}
}
 function isNumValid(val, min, max)// min < val <= max
 {
  val = val.replace(",",".");
  max = parseInt(max)
  if(val == "" || isNaN(val * 2) || val <= min || val > max)
    return false;
  else
   return true;
 }
 function verifForm(formulaire)
{
/////////PRENOM
if(document.contact.prenom.value == "")
 {
alert(' Entrez votre prénom svp !!');
document.contact.prenom.focus();
return false; 
 }
 ///////////NOM
if(document.contact.nom.value == "")
 {
alert(' Entrez votre nom svp !!');
document.contact.nom.focus();
return false; 
 }
/////////////MAIL



	adresse = document.contact.mail.value;
	var place = adresse.indexOf("@",1);
	var point = adresse.indexOf(".",place+1);
	if ((place > -1)&&(adresse.length >2)&&(point > 1))
		{

}
	else
		{
		alert('Adresse email invalide!!');
        document.contact.mail.focus();
return false;		
}
	
if(document.contact.mail.value == "")
 {
alert(' Entrez votre adresse Email !!');
document.contact.mail.focus();
return false; 
 }
/////////SUJET
if(document.contact.sujet.value == "")
 {
alert(' Choisissez l\'objet de votre message !!');
return false; 
 }
 /////////message
if(document.contact.message.value == "")
 {
alert(' Saisissez votre message !!');
document.contact.message.focus();
return false; 
 }


else
return true;
}

function verifDemande(formulaire)
{
/////////PRENOM
if(document.contact.prenom.value == "")
 {
alert(' Entrez votre prénom svp !!');
document.contact.prenom.focus();
return false; 
 }
 ///////////NOM
if(document.contact.nom.value == "")
 {
alert(' Entrez votre nom svp !!');
document.contact.nom.focus();
return false; 
 }
/////////////MAIL



	adresse = document.contact.mail.value;
	var place = adresse.indexOf("@",1);
	var point = adresse.indexOf(".",place+1);
	if ((place > -1)&&(adresse.length >2)&&(point > 1))
		{

}
	else
		{
		alert('Adresse email invalide!!');
        document.contact.mail.focus();
return false;		
}
	
if(document.contact.mail.value == "")
 {
alert(' Entrez votre adresse Email !!');
document.contact.mail.focus();
return false; 
 }
/////////SUJET
if(document.contact.ouvert.value == "")
 {
alert(' Choisissez l\'objet de votre message !!');
return false; 
 }

if(document.contact.ouvert.value == 1)
	{
	if(document.contact.cin.value=="") 
		{
		alert(' Entrez le numero de votre CIN !!');
		document.getElementById('tab1').style.display='';
		document.contact.cin.focus();
		return false;
		}
	if(document.contact.compte.value=="") 
		{
		alert(' Entrez le numero de votre compte !!');
		document.getElementById('tab1').style.display='';
		document.contact.compte.focus();
		return false;
		}
	}
if(document.contact.ouvert.value == 2)
	{
	if(document.contact.commentaire2.value=="") 
		{
		alert(' Saisissez votre message !!');
		document.getElementById('tab2').style.display='';
		document.contact.commentaire2.focus();
		return false;
		}
	
	}


else
return true;
}
 function verifDonnees()
 {
	var montranch = document.myform.montantcred.value;
 	if(!isNumValid(montranch, 0, 10000000))
	{ 
    alert("Le montant du credit est invalide");
    return false; 
	}
	var taux = document.myform.taux.value;
  if(!isNumValid(taux, 5, 12))
  { 
    alert("Le taux est invalide");
    return false;
  }
  var periodicite = document.myform.periodicite.value;
  var nombre = document.myform.nombre.value;
  if(nombre%periodicite!=0)
  {
    alert("Le nombre de mois de remboursement doit etre divisible par la periodicite;");
    return false;
  }
  
  
  document.myform.montant.value = document.myform.montant.value.replace(",",".");
  document.myform.taux.value = document.myform.taux.value.replace(",",".");
 return true;
  


  
 }
 
 
 function montre(id) {
var d = document.getElementById('tab'+id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('tab'+i)) {document.getElementById('tab'+i).style.display='none';}
		if (document.getElementById('lien_tab'+i)) {document.getElementById('lien_tab'+i).style.backgroundImage='url(../../images/tab_documents_off.gif)';}
	}
	
if (d) {d.style.display='block';}
if (document.getElementById('lien_tab'+id)) {document.getElementById('lien_tab'+id).style.backgroundImage='url(../../images/tab_documents_on.gif)';}
	

}

function verifCand(formulaire)
{
	 ///////////NOM
if(document.contact.nom.value == "")
 {
alert(' Entrez votre nom svp !!');
document.contact.nom.focus();
return false; 
 }
/////////PRENOM
if(document.contact.prenom.value == "")
 {
alert(' Entrez votre prénom svp !!');
document.contact.prenom.focus();
return false; 
 }

/////////////MAIL



	adresse = document.contact.mail.value;
	var place = adresse.indexOf("@",1);
	var point = adresse.indexOf(".",place+1);
	if ((place > -1)&&(adresse.length >2)&&(point > 1))
		{

}
	else
		{
		alert('Adresse email invalide!!');
        document.contact.mail.focus();
return false;		
}
	
if(document.contact.mail.value == "")
 {
alert(' Entrez votre adresse Email svp  !!');
document.contact.mail.focus();
return false; 
 }
/////////tel
if(document.contact.tel.value == "")
 {
alert(' Entrez votre Numéro de téléphone svp  !!');
document.contact.tel.focus();
return false; 
 }
 /////////lettre
//if(document.contact.lettre.value == "")
// {
//alert(' Inserez votre lettre d\'accompagnement svp  !!');
//document.contact.lettre.focus();
//return false; 
// }
  /////////cv
//if(document.contact.cv.value == "")
// {
//alert(' Inserez votre CV svp  !!');
//document.contact.cv.focus();
//return false; 
// }
 /////////code
if(document.contact.code.value == "")
 {
alert(' Recopiez le code svp  !!');
document.contact.code.focus();
return false; 
 }

else
return true;
}

function lightWindow_launch(url,largeur,hauteur){
			myLightWindow.activateWindow({
	       href: url,
		   iframeEmbed:true,
		   title: '', 
		   author: '', 
	       caption: '',
		   height : hauteur,
			width :largeur
	        });
}   
