// JavaScript Document

// Put cursor on the first field
function focusOnFirst() {
	// Check if a form existed in a page
	if (document.forms.length > 0) {
		// Find the first field that isn't hidden
		for (var i=0; i < document.forms[0].elements.length; i++) {
			var oField = document.forms[0].elements[i];
			if (oField.type == "text") {
				oField.focus();
				return;
			}
		}
	}
}

// Show warning message if required field is missing
function showFormMessage() {
	var str=window.location;
	var text=str.toString();

	if(text.match("missing"))
		document.getElementById("missing_field").style.display="block";
	if(text.match("sent"))
		document.getElementById("sent_confirmed").style.display="block";
	return;
}
