// Javascript validation for DINER Resources

<!--
function checkDINER(form){
	var isGood = true;
	var alertStr = "";
		
		if (form.STR_TITLE.value.length == 0) {
			isGood = false;
			alertStr += "You must enter a Title.\n";
		}

		if (form.STR_TITLE.value.length > 256) {
			isGood = false;
			alertStr += "Title can be no longer than 256 characters (" + form.STR_TITLE.value.length + ").\n";
		}
		
		if (form.STR_DESCRIPTION.value.length == 0) {
			isGood = false;
			alertStr += "You must enter a Description.\n";
		}		
		
		if (form.STR_DESCRIPTION.value.length > 2048) {
			isGood = false;
			alertStr += "Description can be no longer than 2048 characters (" + form.STR_DESCRIPTION.value.length + ").\n";
		}
		
		if (form.STR_AUTHOR.value.length == 0) {
			isGood = false;
			alertStr += "You must enter an Author.\n";
		}
		
		if (form.STR_AUTHOR_ORG.value.length == 0) {
			isGood = false;
			alertStr += "You must enter an Author Organisation.\n";
		}
		
		if (form.YEAR.value.length == 0) {
			isGood = false;
			alertStr += "You must enter a published date.\n";
		}
		
		if (form.STR_CONTACT_NAME.value.length == 0) {
			isGood = false;
			alertStr += "You must enter your name.\n";
		}
		
		if (form.STR_CONTACT_EMAIL.value.length == 0) {
			isGood = false;
			alertStr += "You must enter your email address.\n";
		}
	
	if( !isGood ){
		alert(alertStr);
	}
	return isGood;

}

function checkLOCUM(form){
	var isGood = true;
	var alertStr = "";
		
		if (form.GEOGRAPHICAL_PREFERENCE.value.length == 0) {
			isGood = false;
			alertStr += "You must enter a geographical preference.\n";
		}
		
	
	if( !isGood ){
		alert(alertStr);
	}
	return isGood;

}

	
//-->
