function validateForm(whichForm) {
	var boolIsValid = true;
	var strErrorMessage = "";
	//1) check for content with firstname, lastname, address, city, province, postalcode
	//2) if email is supplied, check format
	if (whichForm.to_fname.value == "") {
		strErrorMessage += "Veuillez entrer le pr\351nom de votre ami(e).\n";
		boolIsValid = false;
	}
	if (whichForm.to_lname.value == "") {
		strErrorMessage += "Veuillez entrer le nom de famille de votre ami(e).\n";
		boolIsValid = false;
	}
	if (!validateEmail(whichForm.to_email.value)) {
		strErrorMessage += "Veuillez entrer l'adresse \351lectronique valide de votre ami(e).\n";
		boolIsValid = false;
	}
	if (whichForm.from_fname.value == "") {
		strErrorMessage += "Veuillez entrer votre pr\351nom.\n";
		boolIsValid = false;
	}
	if (whichForm.from_lname.value == "") {
		strErrorMessage += "Veuillez entrer votre nom de famille.\n";
		boolIsValid = false;
	}
	if (!validateEmail(whichForm.from_email.value)) {
		strErrorMessage += "Veuillez entrer une adresse \351lectronique valide.\n";
		boolIsValid = false;
	}
	if (whichForm.from_phone.value == "") {
		strErrorMessage += "Veuillez entrer votre num\351ro de t\351l\351phone.\n";
		boolIsValid = false;
	}
	if (whichForm.from_address.value == "") {
		strErrorMessage += "Veuillez entrer votre adresse.\n";
		boolIsValid = false;
	}
	if (whichForm.from_city.value == "") {
		strErrorMessage += "Veuillez entrer le nom de votre ville.\n";
		boolIsValid = false;
	}
	if (whichForm.from_pcode.value == "") {
		strErrorMessage += "Veuillez entrer votre code postal.\n";
		boolIsValid = false;
	}
	if (whichForm.from_message.value == "") {
		strErrorMessage += "Veuillez entrer votre message.\n";
		boolIsValid = false;
	}
	/*if (whichForm.rules.checked != true) {
		strErrorMessage += "Veuillez indiquer que vous avez lu les r\350glements.\n";
		boolIsValid = false;
	}*/
	if (!boolIsValid) {
		alert(strErrorMessage);
	}
	return boolIsValid;
}

function submitForm(whichForm) {
	if (validateForm(whichForm)) {
		whichForm.submit();
	}
}

function validateEmail(strValue) {
	//var strEmailRegExp = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
	//var objRegExp = new RegExp(strEmailRegExp);
	var objRegExp = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	return objRegExp.test(strValue);
}

function openWindow(content) {
	strWinParams = "status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=1,height=300,width=400";
	objWin = window.open(content+".cfm",content+"Window",strWinParams);
}
