	<!--
	//this script sets up two variables (isNN4up, isIE4up) which indicate browser type
	var isIE4up = (document.all)? true: false;
	var isNN4up = (document.layers)? true: false;
	var myspan;
	var firstBadField;
	var firstBadFieldFound = 0;

	function setFirstBadField ( objBadField ) {
		//set global variables 
		if (firstBadFieldFound == 0)
		{
			firstBadField = objBadField;
			firstBadFieldFound = 1;
		}
		return true;
	}

	function sendToFirstBadField () {
		if (firstBadFieldFound == 1)
		{
			if (firstBadField.type =='text')
			{
				firstBadField.select();
			}
			firstBadField.focus();
		}
		//reset global variable for confirmation of locating first bad field
		firstBadFieldFound = 0;
		return true;
	}
	
	function toggleAsterisk(elementID, newState2){
		elementID= 'asterisk' + elementID;
		if (isIE4up) {
			document.all[elementID].style.visibility = newState2;
		} else {
			if (isNN4up) {
				document[elementID].visibility = newState2;
			}
		}
	}	
	function markField(formField, bg, asteriskNumber, newState) {
		var browser = navigator.appName;
		var version = navigator.appVersion;
		var fieldNumber = 0;
		if (browser == "Microsoft Internet Explorer") {
			// Internet Explorer, so color backgrounds for input boxes
			if (formField.style) {formField.style.backgroundColor = bg;}
			toggleAsterisk(asteriskNumber, newState);
		} else if (browser == "Netscape") {
			// Netscape Navigator 
			toggleAsterisk(asteriskNumber, newState);
		}
		//If this is the first bad field, make a pointer to that object so it can receive focus upon validation completion
		if ((firstBadFieldFound == 0) && (newState == 'visible')) {
			//give focus to the form element
			firstBadField = formField;
			firstBadFieldFound = 1;
		}
	}
	function unMarkFields(objForm) {
		// Unmark all fields
		var elToUnmark = '';
		var intNumOfSpans = 0;
		var intNumberOfFields = 0;
		//alert(intNumOfSpans);
		if (isIE4up) {
			intNumOfSpans = document.all.length;
			intNumberOfFields = objForm.elements.length;
			// remove asterisks and background colors (for form elements containing a '_'
			for (i=0; i<intNumOfSpans; i++){
				if (document.all[i].id.toString().indexOf('asterisk') == 0) {
					elToUnmark = document.all[i].id.toString().replace('asterisk','');
					toggleAsterisk(elToUnmark, 'hidden');
				}
			}
			for (i=0; i<intNumberOfFields; i++){
				if ((objForm.elements[i].style) && (objForm.elements[i].name.indexOf('_') > -1)) {
					objForm.elements[i].style.backgroundColor = '#FFFFFF';
				}			
			}
		} else {
			intNumOfSpans = lyrPageContents.layer.document.layers.length;
			objAsteriskLayer = null;
			//remove asterisks for netscape
			for (i=0; i<intNumOfSpans; i++) {
				objAsteriskLayer = lyrPageContents.layer.document.layers[i];
				if (objAsteriskLayer.name.toString().indexOf('asterisk') == 0) {
					elToUnmark = objAsteriskLayer.name.toString().replace('asterisk','');
					toggleAsterisk(elToUnmark, 'hidden');
				}
			}
		}
		return true;
	}
	
	//Function:		isReadyToSubmit
	//Created By:	Reid Guest, Pixelera.com
	//Created:		05/08/2000
	//Modified: 		August 16, 2000
	//Modified By:	Reid Guest, Pixelera.com
	//Purpose:		This function is used to verify any form.
	//				It cycles through all form elements, verifying mandatory fields, email addresses,
	//				comparing password fields, and ignoring buttons.
	//Paramters:	formObject
	//					the form object to be validated/verified.
	//				passwordMinimum, passwordMaximum
	//					the minimum acceptable length for a password
	//
	//Usage:		Name mandatory text fields "mandaory_" + Field_Name ("_" replace spaces)
	//				Name email address fields "email_" + Field_Name ("_" replace spaces)
	//				Name password field "password_" + Field_Name ("_" replace spaces)
	//				Name password confirmation field "confirm_password_" + Field_Name ("_" replace spaces)				


	function isReadyToSubmit(objForm, passwordMinimum, passwordMaximum, strAdditionalErrorMessage){
		// Declare varialble which controls whether the form will be submitted or not.
		// If the value is 1 (true), the form will be submitted; otherwise no action will be taken
		var intReadyToSubmit = 0;
		// Declare variable to count the number of elements in the form
		var intNumberOfElements = 0;
		// Declare array variable contains the index of each form element requiring validation
		var arrProblematicFields = [];
		// Declare message string which provides error diagnostics for all problematic fields in the form
		var strErrorMessage = '';
		//if there are addtional error messages from previous scripting then include at beginning of error message
		if (strAdditionalErrorMessage)
		{
			strErrorMessage = strAdditionalErrorMessage + strErrorMessage;
		}
		// Declare the standard looping variables to parse the form elements
		var i = 0;
		var j = 0;
		var k = 0;
		// Declare object used as temporary storage for field objects
		var objInputField;
		// Declare variable to store string equivalents of each element's NAME attribute
		var strInputName = '';
		var strInputName2 = '';	//used for creating error messages w/o modifiying the first string (above)
		// Declare variables to store equivalents of each element's VALUE attribute
		// (second one is only used for passwords)
		var strInputValue = '';
		var strInputValue2 = '';
		// Declare variables for retrieving input from prompt dialog boxes
		// (second one is only used for passwords)
		var x = '';
		var y = ''; 
		// Declare variables to store password fields & indicate password's existence
		var objPassword;
		var objConfirm;
		var passwordFound = 0;
		var confirmationFound = 0;
		// Field number (extracted from field name) to identify which asterisk to display
		var strFieldNumber = '';
		
		// Determine number of fields to validate
		intNumberOfElements = objForm.elements.length;
		for (i=0; i<intNumberOfElements; i++){
			//Determine if the field requires validation
			objInputField = objForm.elements[i];
			strInputName = objInputField.name;
			strInputValue = objInputField.value;
			strFieldNumber = strInputName.slice(1,3);

			// mandatory field check
			if (strInputName.indexOf('mandatory_') > -1) {
				if (strInputValue=='') {
					strInputName = strInputName.replace('mandatory_','');
					strInputName = strInputName.replace('telephone_','');
					strInputName = strInputName.replace('email_','');
					strInputName = strInputName.replace('ccnumber_','');
					strInputName2 = strInputName.replace(/_/g,' ');		
					strInputName2 = strInputName2.replace(strFieldNumber,'');
					strErrorMessage = strErrorMessage + '     -' + strInputName2 + ' est un champ obligatoire\n';
					markField(objInputField,'#DDDDFF',strFieldNumber,'visible');
				} else {
					markField(objInputField,'#FFFFFF',strFieldNumber,'hidden');
				}
			}
			// phone number format verification
			if ((strInputName.indexOf('telephone_') > -1) && (strInputValue.length > 0)) {
				if ((strInputValue.indexOf('(') != 0) || (strInputValue.indexOf(')') != 4) || (strInputValue.indexOf('-') != 8) || (strInputValue.length!=13)) {
					strInputName = strInputName.replace('mandatory_','');
					strInputName = strInputName.replace('telephone_','');
					strInputName2 = strInputName.replace(/_/g,' ');
					strInputName2 = strInputName2.replace(strFieldNumber,'');
					strErrorMessage = strErrorMessage + '     -' + strInputName2 + ' n\'est pas valide\n            (ie. (613)247-0071)\n';
					markField(objInputField,'#DDDDFF',strFieldNumber,'visible');
				} else {
					markField(objInputField,'#FFFFFF',strFieldNumber,'hidden');
				}
			}	
			// email verification
			if (strInputName.indexOf('email_') > -1) {
				if ((strInputValue.indexOf('@') < 1) || (strInputValue.lastIndexOf('.') < (strInputValue.indexOf('@') + 2))) {
					strInputName = strInputName.replace('mandatory_','');
					strInputName = strInputName.replace('email_','');
					strInputName2 = strInputName.replace(/_/g,' ');
					strInputName2 = strInputName2.replace(strFieldNumber,'');
					strErrorMessage = strErrorMessage + '     -' + strInputName2 + ' n\'est pas valide\n            (eg. votrenom@votrehost.com)\n';
					markField(objInputField,'#DDDDFF',strFieldNumber,'visible');
				} else {
					markField(objInputField,'#FFFFFF',strFieldNumber,'hidden');
				}
			}	
			// credit card number verification
			if (strInputName.indexOf('ccnumber_') > -1) {
				var intLenInput = 0;
				var flg = 0;
				var str='';
				var spc='';
				var arw='';

				// Remove extra info
				strInputName = strInputName.replace('mandatory_','');
				strInputName = strInputName.replace('ccnumber_','');
				intLenInput = strInputName.length;
				strInputName = strInputName.substr(3, intLenInput);   // remove field number from start eg. '01_'
				strInputName2 = strInputName.replace(/_/g,' ');
				strInputName2 = strInputName2.replace(strFieldNumber,'');

				// Make sure only numbers and spaces in date
				for (var j=0; j < strInputValue.length; j++) {
					//alert('for: ' + j + '!');
					cmp='0123456789 ';
					tst=strInputValue.substring(j,j+1);
					if (cmp.indexOf(tst) < 0) {
						flg++;
						str += tst;
						spc += tst;
						arw += '^';
					} else {
						arw += '_';
					}
				}
				intLenInput = strInputValue.length;
				if ((flg != 0) || (strInputValue=='') || (intLenInput < 8) || (intLenInput > 20)) {     // if the number was invalid
					if (spc.indexOf(' ') > -1) {
						str += ' and a space';
					}
					//alert(inputText + '\r' + arw + '\rSorry, the quantity must be number. You have entered ' + flg + ' unacceptable characters (' + str + ').');
					strErrorMessage = strErrorMessage + '     - ' + strInputName2 + ' n\'est pas valide\n                It may only contain numbers or spaces\n                It must be between 8 and 19 characters.\n';
					markField(objInputField,'#DDDDFF',strFieldNumber,'visible');
				} else {
					markField(objInputField,'#FFFFFF',strFieldNumber,'hidden');
				}
			}	

			// password search and store
			if (strInputName.indexOf('password_') > -1) {
				if (strInputName.indexOf('confirm_') > -1) {
					objConfirm = objInputField;
					confirmationFound = 1;
				} else {
					objPassword = objInputField;
					passwordFound = 1;
				}	
			}

			// mandatory field check (drop-down lists)
			if (strInputName.indexOf("select_") > -1) {
				if (objInputField.selectedIndex <= 0) {
					strInputName = strInputName.replace('select_','');
					strInputName = strInputName.replace(/_/g,' ');
					strInputName = strInputName.replace(strFieldNumber,'');
					strErrorMessage = strErrorMessage + '     -' + strInputName + ' est un champ obligatoire\n';
					markField(objInputField,'#DDDDFF',strFieldNumber,'visible');
				} else {
					markField(objInputField,'#FFFFFF',strFieldNumber,'hidden');
				}					
			}
		}
		
		// Ensure passwords are valid and matching (using password objects created earlier
		if (confirmationFound && passwordFound) {
			// Validate length of password		
			strInputValue = objPassword.value;
			strInputValue2 = objConfirm.value;
			if (((strInputValue.length < passwordMinimum) || (strInputValue.length > passwordMaximum)) || ((strInputValue2.length < passwordMinimum) || (strInputValue2.length > passwordMaximum)) || (strInputValue != strInputValue2)) {
				strErrorMessage = strErrorMessage + '     -  Les Mot de Passe ne matche pas (' + passwordMinimum + '-' + passwordMaximum + ' characteurs)\n';
				strInputName = objPassword.name;
				strFieldNumber = strInputName.slice(1,3);
				markField(objPassword,'#DDDDFF',strFieldNumber,'visible');
				strInputName = objConfirm.name;
				strFieldNumber = strInputName.slice(1,3);
				markField(objConfirm,'#DDDDFF',strFieldNumber,'visible');
			} else {
				strInputName = objPassword.name;
				strFieldNumber = strInputName.slice(1,3);
				markField(objPassword,'#FFFFFF',strFieldNumber,'hidden');
				strInputName = objConfirm.name;
				strFieldNumber = strInputName.slice(1,3);
				markField(objConfirm,'#FFFFFF',strFieldNumber,'hidden');
			}
		}
		
		// Done checking form elements, now return a value to the calling event.
		if (strErrorMessage=='') {
			intReadyToSubmit = 1;
		} else {
			messageWindowWidth = 400;
			intXCenter = ((window.innerWidth - messageWindowWidth) / 2);
//z		intYCenter = ((window.innerWidth - 200) / 2);
			strErrorMessage = 'Les erreurs suivantes sont apparues lors du traitement du formulaire :\n' + strErrorMessage + '\nSVP corrigez les champs marques "*" et retournez le formulaire.\n\n';
			alert(strErrorMessage);
			// JUMP TO FIRST BAD FIELD (IF THERE WERE ERRORS ENCOUNTERED WITHIN IsReadyToSubmit)
			//sendToFirstBadField();
		}
		//reset global variable for confirmation of locating first bad field
		//firstBadFieldFound = 0;

		return (intReadyToSubmit);
	}
	//-->
