// JavaScript Document
function text(champ){
if(champ.value==""){
champ.style.background="#FFBBBB";
}
}

function emaill(object)
{
	var test=0;
	var test1=0;
  with (object)
  {
  if(value!=""){
    for (var i=0;i<value.length;i++)
    {
      var ch = value.substring(i,i+1);
      if ( ch=="@" )
      {
		  test=1;
	  }
	}
	for (var i=0;i<value.length;i++)
    {
      var ch1 = value.substring(i,i+1);
      if ( ch1=="." )
      {
		  test1=1;
	  }
	}
		if((test==1)&&(test1==1))
		{
    	object.style.background='#C6FFDA';
		}else{
		object.style.background='#FFBBBB';
		}
	}else{
		object.style.background='#FFBBBB';
		}
	}
}


function tell(object)
{
	with(object)
	{
	if(value!=""){
		for(var i=0;i<value.length;i++)
		{
		var ch=value.substring(i,i+1);
		if( ch<"0" || ch>"9" )
		{
		object.style.background='#FFBBBB';
		}
		else{
		object.style.background='#C6FFDA';
		}
		}
		}else{
		object.style.background='#FFBBBB';
		}
	}
}

function confsup(id){
y=confirm('confirmer la suppression?');
if(y){
window.location.href="index1.php?page=gestion_partenaires.php&var="+id;
}
}


function verif_date(){
var msg="";
af=document.form1.af.value;
mf=document.form1.mf.value;
jf=document.form1.jf.value;
ad=document.form1.ad.value;
md=document.form1.md.value;
jd=document.form1.jd.value;

if(af<ad){
document.form1.af.style.background="#FFBBBB";

}
else if((af==ad)&&(mf<md)){
document.form1.mf.style.background="#FFBBBB";
}
else if((af==ad)&&(mf==md)&&(jf<jd)){
document.form1.jf.style.background="#FFBBBB";
}
else{
document.form1.submit();
}
}
