<!--
// -->code = prompt('Entrez le mot de passe. Vous avez 1 seul essais... Attention, respecter les majuscules et les minuscules','Entrer le mot de passe ici'); 
// -->if (code != "nino")//Remplacer votremotdepasse par le mot de passe que vous allez choisir... 
// -->        { 
// -->        location.href="mauvaiscode.html";//ici c'est la page ou est redirige le visiteur qui entre le mauvais mot de passe 
// -->        } 


function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
};
function refresh() 
    { 
    document.location.reload(); 
                return false; 
    }; 
/*
 * Fonction d'affichage d'une fenêtre de type 'popup'.
  OPTION : "menubar=no,scrollbars=no,statusbar=no,resizable=no"
 */
	var info=null;

	function popupcentree(page,largeur,hauteur,options)
	{
		var top=(screen.height-hauteur)/2;
		var left=(screen.width-largeur)/2;
		
	if (info)
	{
		info.close();
		info=window.open(page,"info","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
		info.focus();	
	}
	else
	{
		info=window.open(page,"info","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
		info.focus();	
	}
	}
	//////////////////////////////////////
		function popupcentree1(page,largeur,hauteur,options)
	{
		var top=(screen.height-hauteur)/2;
		var left=(screen.width-largeur)/2;
	if (info)
	{
		info.close();
//		info=window.open("'"+page+"'","info","top='"+top+"',left='"+left+"',width='"+largeur+"',height='"+hauteur+"','"+options+"'");
		info=window.open('"'+page+'"','info','top="'+top+'",left="'+left+'",width="'+largeur+'",height="'+hauteur+'","'+options+'"');

		info.focus();	
	}
	else
	{
		info=window.open('"'+page+'"','info','top="'+top+'",left="'+left+'",width="'+largeur+'",height="'+hauteur+'","'+options+'"');
		
		info.focus();	
	}
	}
// fin Fonction popupcentree
var emailFilter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/ ;
var telephoneFilter  = /([0-9])/ ;
var societeFilter = /^([a-zA-Z0-9_\.\-\ ])+$/ ;

function checkForm(f) {

	if(f.nom.value.length==0) {
		alert('Le champs « Nom » est obligatoire') ;
		f.nom.focus() ;
		return false ;
	}
	if(f.prenom.value.length==0) {
		alert('Le champs « Prénom » est obligatoire') ;
		f.prenom.focus() ;
		return false ;
	}
	if(f.tel.value.length>0 && !telephoneFilter.test(f.tel.value)) {
		alert('Le champs « Téléphone » est incorect') ;
		f.tel.focus() ;
		return false ;
	}
	if(f.tel.value.length<10) {
		alert('Le champs « Téléphone » se compose de 10 chiffres') ;
		f.tel.focus() ;
		return false ;
	}	
	if(f.email.value.length==0) {
		alert('Le champs « E-mail » est obligatoire') ;
		f.email.focus() ;
		return false ;
	}	
	if(f.email.value.length>0 && !emailFilter.test(f.email.value)) {
		alert('Le champs « E-Mail » est incorect') ;
		f.email.focus() ;
		return false ;
	}
/*	if(f.sujet.value.length==0) {
		alert('Le champs « Sujet » est obligatoire') ;
		f.sujet.focus() ;
		return false ;
	}*/

	if(f.message.value.length==0) {
		alert('Le champs « Message » est obligatoire') ;
		f.message.focus() ;
		return false ;
	}
	
	return true ;
}
////********************************************
function checkForm2(f) {

	if(f.nom.value.length==0) {
		alert('Le champs « Nom » est obligatoire') ;
		f.nom.focus() ;
		return false ;
	}
	if(f.prenom.value.length==0) {
		alert('Le champs « Prénom » est obligatoire') ;
		f.prenom.focus() ;
		return false ;
	}
	if(f.telephone.value.length>0 && !telephoneFilter.test(f.telephone.value)) {
		alert('Le champs « Téléphone » est incorect') ;
		f.telephone.focus() ;
		return false ;
	}
	if(f.telephone.value.length<10) {
		alert('Le champs « Téléphone » se compose de 10 chiffres') ;
		f.telephone.focus() ;
		return false ;
	}	
	if(f.email.value.length==0) {
		alert('Le champs « E-mail » est obligatoire') ;
		f.email.focus() ;
		return false ;
	}	
	if(f.email.value.length>0 && !emailFilter.test(f.email.value)) {
		alert('Le champs « E-Mail » est incorect') ;
		f.email.focus() ;
		return false ;
	}
	if(f.cp.value.length==0) {
		alert('Le champs « code postal » est obligatoire') ;
		f.cp.focus() ;
		return false ;
	}

	if(f.message.value.length==0) {
		alert('Le champs « Message » est obligatoire') ;
		f.message.focus() ;
		return false ;
	}
	
	return true ;
}

///*********************************

function checkTransfert(f) {

	if(f.ch1.value.length==0) {
		alert('Le champs « ENTREPRISE » est obligatoire') ;
		return false ;
	};
	if(f.file.value.length==0) {
		alert('Le champs « FICHIER » est obligatoire') ;
		f.file.focus();
		return false ;
	};
	f.submit();
	return true ;
}

////********************************************
function checkLogin(f) {

	if(f.login.value.length==0) {
		alert('Le champs « LOGIN » est obligatoire') ;
		f.login.focus() ;
		return false ;
	}
	if(f.password.value.length==0) {
		alert('Le champs « PASSWORD » est obligatoire') ;
		f.password.focus() ;
		return false ;
	}
		
	f.submit();
	return true ;
}
//***********************************************
function checksaisie(f) {

	if(f.login.value.length==0) {
		alert('Le champs « LOGIN » est obligatoire') ;
		f.login.focus() ;
		return false ;
	}
	if(f.password.value.length==0) {
		alert('Le champs « PASSWORD » est obligatoire') ;
		f.password.focus() ;
		return false ;
	}
	if(f.nom.value.length==0) {
		alert('Le champs « NOM » est obligatoire') ;
		f.nom.focus() ;
		return false ;
	}		
	if(f.prenom.value.length==0) {
		alert('Le champs « PRENOM » est obligatoire') ;
		f.prenom.focus() ;
		return false ;
	}
	if(f.societe.value.length==0) {
		alert('Le champs « SOCIETE » est obligatoire') ;
		f.societe.focus() ;
		return false ;
	}	
	if(!societeFilter.test(f.societe.value)) {
		alert('Le champs « SAISIE INCORRECT - SOCIETE» est obligatoire') ;
		f.societe.focus() ;
		return false ;
	}	
	f.submit();
	return true ;
}
//**************************************************
function checksupp(f) {

	if(f.supp.value.length==0) {
		alert('Le champs « LOGIN » est obligatoire') ;
		f.supp.focus() ;
		return false ;
	}

if (confirm('Êtes vous sûre de vouloir supprimer le client : '+f.supp.value))	
{
	f.submit();
	return true ;
} 
else 
{return false;}
}
//**************************************************
function checkmodif(f) {

	if(f.societe_modif.value.length==0) {
		alert('Le champs « SOCIETE » est obligatoire') ;
		f.societe_modif.focus() ;
		return false ;
	}
	if(f.modif.value.length==0) {
		alert('Le champs « LOGIN » est obligatoire') ;
		f.modif.focus() ;
		return false ;
	}
	if(f.modif_pass.value.length==0) {
		if (document.form1.creasol.checked==false && document.form1.cpem.checked==false && document.form1.ac_cons.checked==false)
		{
		alert('Le champs « PASSWORD » est obligatoire') ;
		f.modif_pass.focus() ;
		return false ;
		}
	}
	
if (confirm('Êtes vous sûre de vouloir modifier le client : '+f.modif.value))	
{
	f.submit();
	return true ;
} 
else 
{return false;}
}
////*********************************************
function affiche_dossier(a)
{
	if (a==1)
	return "\nLA PREVISION : \n\nLa réalisation d'un prévisionnel. \n\nLa réalisation d'un tableau de bord .";
	if (a==2)
	return "\nLA FORMATION : \n\n• Durée 3 journées (à ajuster selon les besoins)\n\n• 2 journées : Fomation sur le logiciel de facturation SAGE ou CIEL pour les boutiques\n\n• 1 journée : Initiation à la comptabilité et à la gestion.";
	if (a==3)
	return "\nLE FINANCEMENT ET LES AIDES PUBLIQUES :\n\nL’obtention des aides diverses, du prêt d’honneur, du PCE, d’un prêt bancaire complèmentaire, la réalisation du dossier ACCRE, etc.";
	if (a==4)
	return "\nLE JURIDIQUE : \n\nLa constitution d’une société, le choix du régime fiscal et social. ";
	if (a==5)
	return "\nL’INFORMATIQUE : \n\nLa fourniture des moyens informatiques à travers un logiciel de facturation SAGE ou un programme CIEL pour les boutiques . ";
}

/*function telecharge(path,rep)
{
//alert(document.form2.documents.options[document.form2.documents.selectedIndex].value);
//window.location="telechargement.php?path="+path+"&"+"file="+document.form2.documents.options[document.form2.documents.selectedIndex].value+"&"+"rep="+rep;
alert('ok');
//window.open("telechargement.php?path="+path+"&"+"file="+document.form2.documents.options[document.form2.documents.selectedIndex].value+"&"+"rep="+rep,"top");
window.location.href = 'telechargement.php';
}*/

function telecharge1()
{
//	alert("ok");
	return document.form2.documents.options[document.form2.documents.selectedIndex].value;
}
function closelogin()
{
	close;
}
