	var loginForm;

	//Initialization function
	function processForm() {
		if (document.getElementById('contactform')) {
		//Attaching the onSubmit event to the login form
		loginForm = document.getElementById('contactform');
		loginForm.onsubmit = function () {
			return canSubmit(this);
		}
		
		//Setting focus to the user field
		loginForm.fname.focus();
	}
	}
	function filled(field) {
		if (field.value == "" || field.value == null) {
			return false;
		} else {
			return true;
		}
	}
	
	function canSubmit(form) {
		if (!filled(form.fname)) {
			var thisform = form.fname;
			var title = thisform.title;
			thisform.style.borderColor = "#ff0000";
			thisform.previousSibling.previousSibling.style.color = "#ff0000";
			thisform.previousSibling.previousSibling.style.fontSize = "0.75em";
			thisform.previousSibling.previousSibling.innerHTML = title;
			thisform.focus();
			return false;
		}
		
		if (!filled(form.lname)) {
			var thisform = form.lname;
			var title = thisform.title;
			thisform.style.borderColor = "#ff0000";
			thisform.previousSibling.previousSibling.style.color = "#ff0000";
			thisform.previousSibling.previousSibling.style.fontSize = "0.75em";
			thisform.previousSibling.previousSibling.innerHTML = title;
			thisform.focus();
			return false;
		}

		if (!filled(form.email)) {
			var thisform = form.email;
			var title = thisform.title;
			thisform.style.borderColor = "#ff0000";
			thisform.previousSibling.previousSibling.style.color = "#ff0000";
			thisform.previousSibling.previousSibling.style.fontSize = "0.75em";
			thisform.previousSibling.previousSibling.innerHTML = title;
			thisform.focus();
			return false;
		}

		if (!filled(form.word)) {
			var thisform = form.word;
			var title = thisform.title;
			thisform.style.borderColor = "#ff0000";
			thisform.previousSibling.previousSibling.style.color = "#ff0000";
			thisform.previousSibling.previousSibling.style.fontSize = "0.75em";
			thisform.previousSibling.previousSibling.innerHTML = title;
			thisform.focus();
			return false;
		}

		if (!filled(form.subject)) {
			var thisform = form.subject;
			var title = thisform.title;
			thisform.style.borderColor = "#ff0000";
			thisform.previousSibling.previousSibling.style.color = "#ff0000";
			thisform.previousSibling.previousSibling.style.fontSize = "0.75em";
			thisform.previousSibling.previousSibling.innerHTML = title;
			thisform.focus();
			return false;
		}
		
		if (!filled(form.body)) {
			var thisform = form.body;
			var title = thisform.title;
			thisform.style.borderColor = "#ff0000";
			thisform.previousSibling.previousSibling.style.color = "#ff0000";
			thisform.previousSibling.previousSibling.style.fontSize = "0.75em";
			thisform.previousSibling.previousSibling.innerHTML = title;
			thisform.focus();
			return false;
		}
		
		return true;
	}
