// Script for validating inputs.
function checkOnSubmit(formName, r) {
    document.getElementById(yav_config.errorsdiv).className = '';
    document.getElementById(yav_config.errorsdiv).style.display = 'none';
    var alertType = 'inline';
    if (yav.performCheck(formName, r, alertType)) {
        alert('Form validated (you usually submit your form now)');
    } else if (alertType=='jsVar') {
        alert('jsErrors variable contains the array of errors:\n\n' +jsErrors + '\n\n Use this variable like you prefer!');
    } else {
		document.getElementById(yav_config.errorsdiv).style.display="block";
		return false;
	}
	return false;

}

function validate() {
	//alert(document.getElementById('inputform').ontologyLabel.value);
	if ((document.getElementById('form1').webURI.value == "") ) {
		alert("Mandatory fields - Please choose a URI!");
		return false;
		}
	return true;
	}

function checkOpeningHours() {
    var msg;
    var reg_1 = new RegExp("^([0-1][0-9]|[2][0-3]):([0-5][0-9])$");
    if ( reg_1.test(document.forms['form1'].opens11.value) ) {
		msg = null;
	} else {
	    msg = 'OpeningHour is invalid.';
	}
	return msg;
}

