 /* ************************************************************* */ 
 //Retourne:
	  //   0 si date_1=date_2
  	//   1 si date_1>date_2
	  //  -1 si date_1<date_2	  
function compare(date_1, date_2){
	    diff = date_1.getTime()-date_2.getTime();
	     return (diff==0?diff:diff/Math.abs(diff));
}
/* ************************************************************* */ 
function MygetDate(strDate){	  
	  day = strDate.substring(0,2);
		month = strDate.substring(3,5);
		month--;
		year = strDate.substring(6,10);
		d = new Date(year,month,day); 
		return d;  
}
/* ************************************************************* */ 
function Mail_Valide(eMail)
{
	Un_Tableau=eMail.split("@")
	if(Un_Tableau.length!=2)
	{
		return false;
	}
	Un_Tableau=Un_Tableau[1].split(".")
	if(Un_Tableau.length<2)
	{
		return false;
	}
	if ((Un_Tableau[Un_Tableau.length-1].length<2))
	{
		return false;
	}
	return true;
}

/* ************************************************************* */ 
function Recherche_Mois(MoisAnnee)
{
	Formulaire=document.FORMRECHRAP;	
	Formulaire.TEXTERECHERCHE.value="";
	Formulaire.MOISCOURANTRECHERCHE.value=MoisAnnee;
	Formulaire.submit();
}
/* ************************************************************* */ 
function Recherche_Rapide()
{
	Formulaire=document.FORMRECHRAP;	

	if(Formulaire.TEXTERECHERCHE.value!="")
	{
		Formulaire.MOISCOURANTRECHERCHE.value="";
		Formulaire.submit();
	}
}
/* ************************************************************* */ 
function LanceResaRapide()
{
	Formulaire=document.FORMRESARAP;
	if(Formulaire.SPECID.value==0)
	{
		alert("Vous devez sélectionner un spectacle.");
		return false;
	}
	UrlAppel=Formulaire.ALCION.value+Formulaire.SPECID.value;
	UnNom='Reservation_'+Formulaire.SPECID.value;
	MM_openBrWindow(UrlAppel,UnNom,'status=0, resizable=1, menubar=0, scrollbars=0, locationbar=0, scrollbars=0 ,width=980,height=700');
}
/* ************************************************************* */
