// JavaScript Document

function initValidation() {
	var objForm = document.forms['emailForm'];
	
	if (objForm.name != null) {
		objForm.name.required = 1;
	}
	if (objForm.adress != null) {
		objForm.adress.required = 1;
	}
	if (objForm.fromEMail != null) {
		objForm.fromEMail.required = 1;
		objForm.fromEMail.regexp = "JSVAL_RX_EMAIL";
	}
	if (objForm.delivery != null) {
		objForm.delivery.required = 1;
	}
	if (objForm.agb != null) {
		objForm.agb.required = 1;
		realname = "agbError";
	}
	if (objForm.firstname != null) {
		objForm.firstname.required = 1;
	}
	if (objForm.secondname != null) {
		objForm.secondname.required = 1;
	}
	if (objForm.toEMail1 != null) {
		objForm.toEMail1.required = 1;
		objForm.toEMail1.regexp = "JSVAL_RX_EMAIL";
	}
}

function submitForm() {
	var validateState = validateCompleteForm(document.forms['emailForm'], 'error');
	if(validateState == true) document.forms['emailForm'].submit();
}
