function show_hidediv_problems(div_id, state_id){ 
	if (state_id == "show") {
		document.getElementById(div_id).style.display="block"; 		
		if (div_id == "typo") {
			document.frmSiteComments.TYPO_URL.focus();
		}
		else if (div_id == "broken") {
			document.frmSiteComments.BROKEN_URL.focus();
		}
	} else if (state_id == "hide") {
		document.getElementById(div_id).style.display="none"; 
	}
	
}


function enableFormSubmit () {
	document.frmSiteComments.Submit.disabled = false;
}

function validate_EventFeedBack(formName) {

//	var name_pattern = /\w/i;
	
//	var test_pattern = /^[a-z][-a-z0-9_ ]{0,50}$/i;
	
	var test_pattern = /^[a-z][-a-z ]{0,50}$/i;
	
	var name_pattern = test_pattern;	

	if (formName.CONTACT_NAME.value == "") {
		alert("Please enter your name.");
		formName.CONTACT_NAME.focus();
		return false;
	}
	else if (formName.CONTACT_NAME.value.search(name_pattern) == -1) {
		alert("Please enter your name without any special characters.");
//		alert ('formName.CONTACT_NAME.value.search(name_pattern):' + formName.CONTACT_NAME.value.search(name_pattern));		
		formName.CONTACT_NAME.focus();
		return false;
	}	
//	alert ('formName.CONTACT_NAME.value.search(name_pattern):' + formName.CONTACT_NAME.value.search(name_pattern));

	var email_address_pattern = /^.+@.+\..+$/;
	
	if (formName.CONTACT_EMAIL.value == "") {
		alert("Please enter your email address.");
		formName.CONTACT_EMAIL.focus();
		return false;
	}
	else if (formName.CONTACT_EMAIL.value.search(email_address_pattern) == -1) {
		alert("Please enter your email address in the correct format.");
		formName.CONTACT_EMAIL.focus();
		return false;
	}	
	
	if (formName.WEB_ERROR[0].checked) {	
		if (formName.TYPO_URL.value == "") {
			alert ("Please add the page URL that contains a typographical error.");
			formName.TYPO_URL.focus();
			return false;
		}
	}

	if (formName.WEB_ERROR[1].checked) {	
		if (formName.BROKEN_URL.value == "") {
			alert ("Please add the page URL that contains the broken link.");
			formName.BROKEN_URL.focus();
			return false;
		}

		if (formName.BROKEN_LINK.value == "") {
			alert ("Please add the page URL for the broken link.");
			formName.BROKEN_LINK.focus();
			return false;
		}

		if (formName.BROKEN_CORRECT_LINK.value == "") {
			alert ("Please add the page URL for the correct link.");
			formName.BROKEN_CORRECT_LINK.focus();
			return false;
		}

	}

	if (formName.COMMENTS.value == "") {
		alert ("Please add comments to the web site feedback form.");
		formName.COMMENTS.focus();
		return false;
	}

	if (formName.SECURITY_CODE.value == "") {
		alert ("Please enter the Security Code.");
		formName.SECURITY_CODE.focus();
		return false;
	}

	return true;
}