
function isDate(d) {
		if (d == "") 
			return false;				
		e = new RegExp("^[0-9]{1,2}\/[0-9]{1,2}\/([0-9]{2}|[0-9]{4})$");				
		if (!e.test(d))
			return false;
		j = parseInt(d.split("/")[0], 10);
		m = parseInt(d.split("/")[1], 10);
		a = parseInt(d.split("/")[2], 10);
		if (a < 1000) {
			if (a < 89)	a+=2000;
				else a+=1900;
			}
		if (a%4 == 0 && a%100 !=0 || a%400 == 0) fev = 29;
			else fev = 28;
		nbJours = new Array(31,fev,31,30,31,30,31,31,30,31,30,31);
		return ( m >= 1 && m <=12 && j >= 1 && j <= nbJours[m-1] );
}

function compare(date_1, date_2){
		diff = date_1.getTime()-date_2.getTime();
	    return (diff==0?diff:Math.ceil(diff/(60*60*24*1000)));
}
function getDte(strDate){	  
		day = strDate.substring(0,2);
		month = strDate.substring(3,5);
		year = strDate.substring(6,10);
		d = new Date(0,0,0,0,0,0);
		d.setDate(day);
		d.setMonth(month-1);
		d.setFullYear(year);
		return d;  
}


function datedujour(){
	var d = new Date();
	var curr_date = d.getDate();
	var curr_month = d.getMonth()+1;
	var curr_year = d.getFullYear();
	if (curr_date < 9) curr_date = "0"+curr_date;
	if (curr_month < 9) curr_month = "0"+curr_month;
	return curr_date + "/" + curr_month + "/" + curr_year;
}

