	function validateForm001()
   	{
   		strPrenom = document.getElementById('strPrenom');
   		strNom = document.getElementById('strNom');
   		strEmail = document.getElementById('strEmail');
   		strEmail2 = document.getElementById('strEmail2');
		strTitre_fr = document.getElementById('strTitre_fr');
		strTitre_en = document.getElementById('strTitre_en');
		strAdresse_fr = document.getElementById('strAdresse_fr');
		strAddress_en = document.getElementById('strAddress_en');
		strVille = document.getElementById('strVille');
		str_Secteur = document.getElementById('str_Secteur');
		strChambre = document.getElementById('strChambre');
		strBain = document.getElementById('strBain');
		strRoom = document.getElementById('strRoom');
		strEtage = document.getElementById('strEtage');
		strPrix = document.getElementById('strPrix');
		strFeatures = document.getElementById('strFeatures');
		strFeatures_en = document.getElementById('strFeatures_en');
		strWantedDate = document.getElementById('strWantedDate');
		
		strLearnedAbout = document.getElementById('strLearnedAbout');
		strLearnedAboutOther = document.getElementById('strLearnedAboutOther');
		strSecurity = document.getElementById('strSecurity');
		FormSecurite = document.getElementById('FormSecurite'); 



strPic1 = document.getElementById('pPic1')
strPic2 = document.getElementById('pPic2')
strPic3 = document.getElementById('pPic3')
strPic4 = document.getElementById('pPic4')
strPic5 = document.getElementById('pPic5')
strPic6 = document.getElementById('pPic6')
strPic7 = document.getElementById('pPic7')
strPic8 = document.getElementById('pPic8')
strPic9 = document.getElementById('pPic9')
strPic10 = document.getElementById('pPic10')
strPic11 = document.getElementById('pPic11')


	var vValidExtensions = ".GIF .JPG";
	var vValidCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-_~."
	var vEmptyCount = 0;
	
	var vArray = new Array(strPic1.value,strPic2.value,strPic3.value,strPic4.value,strPic5.value,strPic6.value,strPic7.value,strPic8.value,strPic9.value,strPic10.value,strPic11.value);


        document.getElementById('strPrenomError').style.display = 'none';
        document.getElementById('strNomError').style.display = 'none';   		
   		document.getElementById('strEmailError').style.display = 'none';
   		document.getElementById('strEmail2Error').style.display = 'none';
   		document.getElementById('strTitre_frError').style.display = 'none';
		document.getElementById('strTitre_enError').style.display = 'none';
		document.getElementById('strAdresse_frError').style.display = 'none';
		document.getElementById('strAddress_enError').style.display = 'none';
		document.getElementById('strVilleError').style.display = 'none';
		document.getElementById('str_SecteurError').style.display = 'none';
		document.getElementById('strChambreError').style.display = 'none';
		document.getElementById('strBainError').style.display = 'none';
		document.getElementById('strRoomError').style.display = 'none';
		document.getElementById('strEtageError').style.display = 'none';
		document.getElementById('strPrixError').style.display = 'none';
		document.getElementById('strFeaturesError').style.display = 'none';
		document.getElementById('strFeatures_enError').style.display = 'none';
		document.getElementById('strSecurityError').style.display = 'none';
		document.getElementById('strWantedDateError').style.display = 'none';
        document.getElementById('pPic1Error').style.display = 'none';
		
		document.getElementById('strLearnedAboutError').style.display = 'none';
		document.getElementById('strLearnedAboutOtherError').style.display = 'none';
		
		
		strPrenom.style.borderColor = '#000000';
   		strNom.style.borderColor  = '#000000';
   		strEmail.style.borderColor  = '#000000';
   		strEmail2.style.borderColor  = '#000000';
		strTitre_fr.style.borderColor  = '#000000';
		strTitre_en.style.borderColor  = '#000000';
		strAdresse_fr.style.borderColor  = '#000000';
		strAddress_en.style.borderColor  = '#000000';
		strVille.style.borderColor  = '#000000';
		str_Secteur.style.borderColor  = '#000000';
		strChambre.style.borderColor  = '#000000';
		strBain.style.borderColor  = '#000000';
		strRoom.style.borderColor  = '#000000';
		strEtage.style.borderColor  = '#000000';
		strPrix.style.borderColor  = '#000000';
		strFeatures.style.borderColor  = '#000000';
		strFeatures_en.style.borderColor  = '#000000';
		strSecurity.style.borderColor  = '#000000';
		strWantedDate.style.borderColor  = '#000000';
		strPic1.style.borderColor  = '#000000';
	
		strLearnedAbout.style.borderColor  = '#000000';
		strLearnedAboutOther.style.borderColor  = '#000000';
		


Invalide = true;
Focus = "";

   		if(strPrenom.value == '') 
   		{ 
   		    strPrenom.style.border = '1px solid #dd7627';
   		    document.getElementById('strPrenomError').style.display = 'inline';
   		    document.getElementById('strPrenomError').innerHTML = '(required)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strPrenom').focus();
			}
			Invalide = false;
   		}
   		   		
   		if(strNom.value == '') 
   		{ 
   		    strNom.style.border = '1px solid #dd7627';
   		    document.getElementById('strNomError').style.display = 'inline';
   		    document.getElementById('strNomError').innerHTML = '(required)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strNom').focus();
			}
   		    Invalide = false;
   		}
   		
   		if(strEmail.value == '') 
   		{ 
   		    strEmail.style.border = '1px solid #dd7627';
   		    document.getElementById('strEmailError').style.display = 'inline';
   		    document.getElementById('strEmailError').innerHTML = '(required)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strEmail').focus();
			}
   		    Invalide = false;
   		}

   		if(!isValidEmail(strEmail.value)) 
   		{ 
   		    strEmail.style.border = '1px solid #dd7627';   		    
   		    document.getElementById('strEmailError').style.display = 'inline';
   		    document.getElementById('strEmailError').innerHTML = '(invalid)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strEmail').focus();
			}
   		    Invalide = false;   		
   		}   		   		   		
   		
   		if(strEmail2.value == '') 
   		{ 
   		    strEmail2.style.border = '1px solid #dd7627';
   		    document.getElementById('strEmail2Error').style.display = 'inline';
   		    document.getElementById('strEmail2Error').innerHTML = '(required)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strEmail2').focus();
			}
   		    Invalide = false;
   		}
		
   		if(strEmail.value != strEmail2.value) 
   		{ 
			strEmail2.style.border = '1px solid #dd7627';
   		    document.getElementById('strEmail2Error').style.display = 'inline';
   		    document.getElementById('strEmail2Error').innerHTML = '(Not the same)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strEmail2').focus();
			}
   		    Invalide = false;
   		}
		

   		if(strTitre_fr.value == '') 
   		{ 
   		    strTitre_fr.style.border = '1px solid #dd7627';
   		    document.getElementById('strTitre_frError').style.display = 'inline';
   		    document.getElementById('strTitre_frError').innerHTML = '(required)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strTitre_fr').focus();
			}
   		    Invalide = false;
   		}
   		if(strTitre_en.value == '') 
   		{ 
   		    strTitre_en.style.border = '1px solid #dd7627';
   		    document.getElementById('strTitre_enError').style.display = 'inline';
   		    document.getElementById('strTitre_enError').innerHTML = '(required)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strTitre_en').focus();
			}
   		    Invalide = false;
   		}
   		if(strAdresse_fr.value == '') 
   		{ 
   		    strAdresse_fr.style.border = '1px solid #dd7627';
   		    document.getElementById('strAdresse_frError').style.display = 'inline';
   		    document.getElementById('strAdresse_frError').innerHTML = '(required)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strAdresse_fr').focus();
			}
   		    Invalide = false;
   		}
   		if(strAddress_en.value == '') 
   		{ 
   		    strAddress_en.style.border = '1px solid #dd7627';
   		    document.getElementById('strAddress_enError').style.display = 'inline';
   		    document.getElementById('strAddress_enError').innerHTML = '(required)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strAddress_en').focus();
			}
   		    Invalide = false;
   		}
   		if(strVille.value == 'choose') 
   		{ 
   		    strVille.style.border = '1px solid #dd7627';
   		    document.getElementById('strVilleError').style.display = 'inline';
   		    document.getElementById('strVilleError').innerHTML = '(required)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strVille').focus();
			}
   		    Invalide = false;
   		}
   	   	if(str_Secteur.value == 'choose') 
   		{ 
   		    str_Secteur.style.border = '1px solid #dd7627';
   		    document.getElementById('str_SecteurError').style.display = 'inline';
   		    document.getElementById('str_SecteurError').innerHTML = '(required)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('str_Secteur').focus();
			}
   		    Invalide = false;
   		}
		if(strChambre.value == '' || isNaN(strChambre.value)) 
   		{ 
   		    strChambre.style.border = '1px solid #dd7627';
   		    document.getElementById('strChambreError').style.display = 'inline';
			
			if(strChambre.value == '')
			{
   		   		 document.getElementById('strChambreError').innerHTML = '(required)'; 
			}
			if(isNaN(strChambre.value))
			{
   		   		 document.getElementById('strChambreError').innerHTML = '(Please, insert number)'; 
			}
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strChambre').focus();
			}
   		    Invalide = false;
   		}
   		if(strBain.value == '' || isNaN(strBain.value)) 
   		{ 
   		    strBain.style.border = '1px solid #dd7627';
   		    document.getElementById('strBainError').style.display = 'inline';
			if(strBain.value == '')
			{
   		   		 document.getElementById('strBainError').innerHTML = '(required)'; 
			}
			if(isNaN(strBain.value))
			{
   		   		 document.getElementById('strBainError').innerHTML = '(vous devez entrer un nombre)'; 
			}
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strBain').focus();
			}
   		    Invalide = false;
   		}
   		if(strRoom.value == '' || isNaN(strRoom.value)) 
   		{ 
   		    strRoom.style.border = '1px solid #dd7627';
   		    document.getElementById('strRoomError').style.display = 'inline';
			if(strRoom.value == '')
			{
   		   		 document.getElementById('strRoomError').innerHTML = '(required)'; 
			}
			if(isNaN(strRoom.value))
			{
   		   		 document.getElementById('strRoomError').innerHTML = '(vous devez entrer un nombre)'; 
			}
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strRoom').focus();
			}
   		    Invalide = false;
   		}
   		if(strEtage.value == '' || isNaN(strEtage.value)) 
   		{ 
   		    strEtage.style.border = '1px solid #dd7627';
   		    document.getElementById('strEtageError').style.display = 'inline';
			if(strEtage.value == '')
			{
   		   		 document.getElementById('strEtageError').innerHTML = '(required)'; 
			}
			if(isNaN(strEtage.value))
			{
   		   		 document.getElementById('strEtageError').innerHTML = '(vous devez entrer un nombre)'; 
			}
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strEtage').focus();
			}
   		    Invalide = false;
   		}
   		if(strPrix.value == ''  || isNaN(strPrix.value)) 
   		{ 
   		    strPrix.style.border = '1px solid #dd7627';
   		    document.getElementById('strPrixError').style.display = 'inline';
			if(strPrix.value == '')
			{
   		   		 document.getElementById('strPrixError').innerHTML = '(required)'; 
			}
			if(isNaN(strPrix.value))
			{
   		   		 document.getElementById('strPrixError').innerHTML = '(vous devez entrer un nombre)'; 
			}
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strPrix').focus();
			}
   		    Invalide = false;
   		}
   		
   		if(strWantedDate.value == '') 
   		{ 
   		    strWantedDate.style.border = '1px solid #dd7627';
   		    document.getElementById('strWantedDateError').style.display = 'inline';
   		    document.getElementById('strWantedDateError').innerHTML = '(required)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strWantedDate').focus();
			}
   		    Invalide = false;
   		}
		if(strFeatures.value == '') 
   		{ 
   		    strFeatures.style.border = '1px solid #dd7627';
   		    document.getElementById('strFeaturesError').style.display = 'inline';
   		    document.getElementById('strFeaturesError').innerHTML = '(required)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strFeatures').focus();
			}
   		    Invalide = false;
   		}

		if(strFeatures_en.value == '') 
   		{ 
   		    strFeatures_en.style.border = '1px solid #dd7627';
   		    document.getElementById('strFeatures_enError').style.display = 'inline';
   		    document.getElementById('strFeatures_enError').innerHTML = '(required)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strFeatures_en').focus();
			}
   		    Invalide = false;
   		}




	for(i=0; i<11; ++i){
		vTextboxValue = vArray[i];
		if(vTextboxValue == ""){
			++vEmptyCount;
				document.getElementById('pPic'+(i+1)) .style.border = '1px solid #000000';
				document.getElementById('pPic'+(i+1)+'Error').style.display = 'none';
		}
		else{
			vFilename = GetFilename(vTextboxValue);
			vExtension = GetExtension(vFilename);
			vValidFilename = true;
			vPeriodCount = 0;

			for(j=0; j<vFilename.length; ++j){
				vChar = vFilename.substr(j, 1);

				if(vChar == "."){++vPeriodCount;}

				if(vValidCharacters.indexOf(vChar) == -1){
					vValidFilename = false;
				}
			}

			if(vPeriodCount > 1){vValidFilename = false;}

			if(vValidExtensions.indexOf(vExtension) == -1){
				 vError = '(Only: '+ vValidExtensions +' are accepted.)'
				 vValidFilename = false;
			}
			else if(vFilename.indexOf(" ") != -1){
				vError = "No space is allowed for your file name. Please rename your file.";
				vValidFilename = false;
			}
			else if(vFilename.length > 35){
				vError = "The name of your file must be less than 30 characters.";
				vValidFilename = false;
			}
			else if(vValidFilename == false){
				vError = "The name of your file is invalid.";
				vValidFilename = false;
			}
			
			
			strPic = document.getElementById('pPic'+(i+1)) 
			if(vValidFilename == false)
			{
				strPic.style.border = '1px solid #dd7627';
				document.getElementById('pPic'+(i+1)+'Error').style.display = 'inline';
				document.getElementById('pPic'+(i+1)+'Error').innerHTML = vError; 
				
				if(Focus=="")
				{
					Focus = "true"
					document.getElementById('strPrenom').focus();
				}
				Invalide = false;
			}
			
		}
	}

		if(strPic1.value == '') 
   		{ 
   		    strPic1.style.border = '1px solid #dd7627';
   		    document.getElementById('pPic1Error').style.display = 'inline';
   		    document.getElementById('pPic1Error').innerHTML = '(required)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				strPic1.focus();
			}
   		    Invalide = false;
   		}


		if(strLearnedAbout.value == 'Choose') 
   		{ 
   		    strLearnedAbout.style.border = '1px solid #dd7627';
   		    document.getElementById('strLearnedAboutError').style.display = 'inline';
   		    document.getElementById('strLearnedAboutError').innerHTML = '(required)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				strLearnedAbout.focus();
			}
   		    Invalide = false;
   		}
		if(strLearnedAbout.value == 'Autre')
		{
			if(strLearnedAboutOther.value == '') 
			{ 
				strLearnedAboutOther.style.border = '1px solid #dd7627';
				document.getElementById('strLearnedAboutOtherError').style.display = 'inline';
				document.getElementById('strLearnedAboutOtherError').innerHTML = '(required)'; 
				
				if(Focus=="")
				{
					Focus = "true"
					strLearnedAboutOther.focus();
				}
				Invalide = false;
			}
		}
   		if(strSecurity.value != FormSecurite.value) 
   		{ 
   		    strSecurity.style.border = '1px solid #dd7627';
   		    document.getElementById('strSecurityError').style.display = 'inline';
   		    document.getElementById('strSecurityError').innerHTML = '(Not the same)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strSecurity').focus();
			}
   		    Invalide = false;
   		}   
		
		
		if(Invalide != false)
		{
   			return true;
		}else
		{
			return false;	
		}
	}

	
   	function isValidEmail(str) 
   	{
        return (str.lastIndexOf(".") > 2) && (str.indexOf("@") > 0) && (str.lastIndexOf(".") > (str.indexOf("@")+1)) && (str.indexOf("@") == str.lastIndexOf("@"));
    }
	
	function GetFilename(pFullpath){
	vLastSlashLocation = pFullpath.lastIndexOf("\\");
		if(vLastSlashLocation == -1){
			return pFullpath;
		}
		else{
			return pFullpath.substr(vLastSlashLocation + 1);
		}
	}
	
	function GetExtension(pFilename){
		if(pFilename.length > 4){
			return pFilename.substr(pFilename.length-4, 4).toUpperCase();
		}
		else{
			return "unknown";
		}
	}

