function handleKeys(e) {
    var key;
    if(window.event)
        key = window.event.keyCode;     //IE
    else
        key = e.which;     //firefox
    return key;
}

function validateForm() {
    if (document.form1.keywords.value == 'Keywords' || document.form1.keywords.value == 'Mots clés') {
        document.form1.keywords.value = '';
    }
    document.form1.submit();
}

function validateFormOurPeople() {
    if (document.form1.profNm.value == 'Name' || document.form1.profNm.value == 'Nom') {
        document.form1.profNm.value = '';
    }
    if (document.form1.keywords.value == 'Keywords' || document.form1.keywords.value == 'Mots clés') {
        document.form1.keywords.value = '';
    }
    document.form1.submit();
}

function validateEventsForm() {
    if (document.form1.keywords.value == 'Keywords' || document.form1.keywords.value == 'Mots clés') {
        document.form1.keywords.value = '';
    }
	document.form1.submit();
}
function validateEventsForm2() {
	var strErrorMsg;
		strErrorMsg = '';
    if (document.form2.keywords.value == 'Keywords' || document.form1.keywords.value == 'Mots clés') {
        document.form2.keywords.value = '';
    }
    if (document.form2.fromDate.value == '...') {
        document.form2.fromDate.value = '';
    }
    if (document.form2.toDate.value == '...') {
        document.form2.toDate.value = '';
    }
	if (document.form2.fromDate.value != '' && document.form2.toDate.value != '') {
		var arrFromDate, arrToDate, newFromDate, newToDate;
		arrFromDate = document.form2.fromDate.value.split("/");
		arrToDate = document.form2.toDate.value.split("/");
		newFromDate = arrFromDate[2] + arrFromDate[0] + arrFromDate[1];
		newToDate = arrToDate[2] + arrToDate[0] + arrToDate[1];
		if(newFromDate > newToDate){
			strErrorMsg = 'Invalid date selection';
		}
	}
	if (strErrorMsg != '') {
		alert(strErrorMsg);
	} else {
		document.form2.submit();
	}
}
