//----------------------------------------------------------------------------------------------------
//
//  File : formFieldsJS.js
//
//  @author : Matthias Pieroth
//
//  @date : 14.02.2003
//
//  description : Javascript functions for checking the validity of formFields like mail-adresses etc.
//
//----------------------------------------------------------------------------------------------------

/**  @method checkemail
 *   @param  email        a mail adress
 *
 *   description : function checks the correctness of a mail-adress
 */
function checkemail(email){
	var str = email;
	
	if (email.value.indexOf ('@', 0) == -1 || str.length < 6 || email.value.indexOf ('.',0) == -1){
	    // not valid
 		return 1;
 	}
	// valid
	return 0;
}

/**  @method checkMailGoURL
 *   @param  email        a mail adress
 *           iLang        the language (0 = german, 1 = englisch, 2 = polish )
 *           strURL       a site to jump
 *
 *   description : function checks the correctness of the mail-adress and forward the correctness (0 = correct)
 *                 to a specified URL (= strURL)
 */
function checkMailGoURL(email, iLang, strURL)
{
   iLang *= 2;
   var iRes = checkemail(email) + iLang;
   
   // Submit ersetzen durch popups mit strURLOK und strURLError
   window.open(strURL+'?CORRECT='+iRes+'&EMAIL='+email.value+'','','toolbar=no, statusbar=no, resizable=no, scrollbars=no, width=400, height=200');
}



