function validateForm(objForm){
	ValidateHaveErrors = false;
	ValidateHaveErrors = !ValidateFileTypes(objForm);
	ValidateContactForm(objForm);
	if (!ValidateTextArea(objForm.txtComments, "CommentsError", false)){
		if (!ValidateHaveErrors) ValidateHaveErrors = true;
	}
	if (ValidateHaveErrors) alert("You have entered invalid data in one or more fields.  Please review.");		
	return (!ValidateHaveErrors);
}

function ValidateFileTypes(objForm){
	for (var intIndex=1;intIndex<=5;intIndex++){
		if(objForm['file' + intIndex].value.length != 0){							
			if (!checkImage(objForm['file' + intIndex].value)){
				return false;
			}			
		}					
	}
	return true;
}

function checkImage(strFile){
	var OK = new Array ('.jpg', '.gif', '.png');
	for (var intIndex = 0; intIndex < OK.length; intIndex++){	
		if (strFile.substring(strFile.length-4,strFile.length).toLowerCase().indexOf(OK[intIndex]) != -1){
			return true; // one of the file extensions found
		}
	}
	return false;	
}

/* 
This small function makes sure that the progress indicator and server-side
processing page receive the new progress ID we just created.  Also, it pops up the 
progress window
*/
function startupload(intProgressID, objForm) {
	var blnImageToUpload = false;
	for (var intIndex=1;intIndex<=5;intIndex++){
		if(objForm['file' + intIndex].value.length != 0){				
			blnImageToUpload = true;														
		}					
	}
	if (blnImageToUpload){
		window.open("/Contact/_Progress.asp?progressid=" + intProgressID,"_blank","height=100,width=500,status=no,toolbar=no,menubar=no,location=no,resizable=no");			
	}
}
	

