function fieldOn(field) {
	theField = document.getElementById(field);
	theField.value = '';
}

function fieldOff(fieldId,intValue) {
	theField = document.getElementById(fieldId);
	if(theField.value=='') {
		theField.value=intValue;
	}
}

function validateForm(formId) {
	required = new Array('name|Your Name:','email|Your Email Address:','report|Your Weather Report:');
	for(var x=0;x<required.length;x++) {
		field=required[x].split("|");
		if(document.getElementById(field[0]).value==field[1]) {
			alert('Please include your ' + field[0] + '.');
			document.getElementById(field[0]).focus();
			return false;
		}
	}	
}

function fileCheck(fieldId) {
		
	field = document.getElementById(fieldId);
	
	if ((field.value.length != -1) && (field.value.lastIndexOf('.') != -1)) {
		intPathIndex = field.value.lastIndexOf('.');
		strExt = field.value.substr(intPathIndex + 1);
		strExt = strExt.toUpperCase()
	
		if (strExt != 'JPG') {
			alert("You can only upload JPEG images. The file \n you are trying to uploaded is not a JPEG.");
			field.value=null;
			return;
		}
	
	}

}