function cleanInput() {
	var frm = document.photoFrm;
	if(frm.authorName.value.match(/(<([^>]+)>)/ig)) {
		alert("Sorry, no HTML allowed...");
		return false;
	} else if ((frm.authorName.value.match("http://")) || (frm.authorName.value.match("www.")) || (frm.authorName.value.match(".com"))) {
		alert("Sorry, no URLs allowed...");
		return false;
	} else {
		if(validate('photoFrm')){
			return true;
		}
	}
	return false;
}

function validate(form) {
// Checking if at least one period button is selected. Or not.
	var frm = document.photoFrm;
	if (!frm.age.checked){ 
		alert("You must agree to the terms by selecting the checkbox to participate.");
		return false; 
	}
	
	if (!frm.photo.value) { 
		alert("Please Select a Photo");
		return false; 
	}

	if (!frm.authorName.value) { 
		alert("Please Enter Your Nickname");
	    return false; 
	}
	//document.forms[fname].submit();
	return true;
}

/*
function submitform(fname) {
	alert(validate(document.forms[fname]));
	alert("hello1");
  if (validate(document.forms[fname]) == true) {
    document.forms[fname].submit();
  }

}
*/