/* chkForm_eng.js */


function CheckIfEmail(teststring)
{
	ok=true;
	if((teststring.indexOf('@') == -1) 
		|| (teststring.indexOf('@') == 0)
		|| (teststring.indexOf('@') == (teststring.length-1))
		|| (teststring.indexOf('.', teststring.indexOf('@')) == -1 )) ok=false;
		return ok;
}


/*---------------Formulareinträge überprüfen-----------------*/
function CheckForm()
{
	if (document.enquiry.fName.value == '')
		{
		alert ('Please make sure the First Name field was completed.');
		document.enquiry.fName.focus();
		return false;
		}
	if (document.enquiry.lName.value == '')
		{
		alert ('Please make sure the Last Name field was completed.');
		document.enquiry.lName.focus();
		return false;
		}
	if (!CheckIfEmail(document.enquiry.email.value))
		{
		alert ('Please make sure the E-mail field was properly completed.');
		document.enquiry.email.focus();
		return false;
		}
		alert ('Thank you for your enquiry, we will be responding to it soon.');
		return true;
}

/*---------------DemoVersion Formulareinträge überprüfen-----------------*/
function CheckDemoForm()
{
	if (document.demoVersionFrm.demoFname.value == '')
		{
		alert ('Please make sure the First Name field was completed.');
		document.demoVersionFrm.demoFname.focus();
		return false;
		}
	if (document.demoVersionFrm.demoLname.value == '')
		{
		alert ('Please make sure the Last Name field was completed.');
		document.demoVersionFrm.demoLname.focus();
		return false;
		}
	if (!CheckIfEmail(document.demoVersionFrm.demoEmail.value))
		{
		alert ('Please make sure the E-mail field was properly completed.');
		document.demoVersionFrm.demoEmail.focus();
		return false;
		}
		alert ('Thank you for your interest in the Demo-Version.\nAn automatic email with download details will be sent to the email address you specified.');
		return true;
}

