/*
    ============== (C) Copyright Relate.IT - All rights reserved ===============

    The copyright to the contents herein is the property of Relate.IT. The 
    contents may be used and/or copied only with the written permission of
    Relate.IT, or in accordance with the terms and conditions stipulated in 
    the agreement/contract under which the contents have been supplied.

    Contact information:
    
    Relate.IT
    van Suchtelenstraat 18
    7491 KC Delden(ov)              Phone:     +31615315133
    THE NETHERLANDS                 Internet:  http://www.relate-it.eu

    ============================================================================
    $Id: inputValidation.js,v 1.1 2008/09/18 13:57:53 cvs Exp $ 
    ============================================================================
*/

function validateSubscriberForm(theForm) {
	var alertString = "";
	
	alertString += chkEmailField(theForm.email, 
		"Geen geldig e-mail adres opgegeven.\nEntered e-mail address is invalid");
		
    if (alertString != "") {
        alert(alertString);
        return false;
    } else {
        return true;
    }
}

function chkEmailField (theField, errmsg) {
	var emailPat =
        /^[A-Za-z0-9\-\.\_]*@[A-Za-z0-9\-\.\_]+\.[A-Za-z]{2,4}$/;
	var matchArray = theField.value.match(emailPat);
	if (matchArray == null) {
		theField.focus();
		return errmsg;
	} else {
		return "";
	}
}
