	function isEmpty(field)
	{
		if (field.value == "")
		{
			field.focus();
			field.blur();
			field.select();
			return true;
		}
		return false;
	}
	
	function isRadioChecked(field, size)
	{
		for (var i=0;i<size;i++)
		{
			if ( field[i].checked == true)
				return true;
		}
		return false;

	}
	
	function isEmail(field)
	{
		if (!evalEmail(field.value))
		{
			field.focus();
			field.blur();
			field.select();
			return false;
		}
		return true;
	}


	function evalEmail(checkThisEmail)
	{
		var myEMailIsValid = true;
		var myAtSymbolAt = checkThisEmail.indexOf('@');
		var myLastDotAt = checkThisEmail.lastIndexOf('.');
		var mySpaceAt = checkThisEmail.indexOf(' ');
		var myLength = checkThisEmail.length;
		
		
		// at least one @ must be present and not before position 2
		// @yellow.com : NOT valid
		// x@yellow.com : VALID
		
		if (myAtSymbolAt < 1 ) 
		 {myEMailIsValid = false}
		
		
		// at least one . (dot) afer the @ is required
		// x@yellow : NOT valid
		// x.y@yellow : NOT valid
		// x@yellow.org : VALID
		
		if (myLastDotAt < myAtSymbolAt) 
		 {myEMailIsValid = false}
		
		// at least two characters [com, uk, fr, ...] must occur after the last . (dot)
		// x.y@yellow. : NOT valid
		// x.y@yellow.a : NOT valid
		// x.y@yellow.ca : VALID
		
		if (myLength - myLastDotAt <= 2) 
		 {myEMailIsValid = false}
		
		
		// no empty space " " is permitted (one may trim the email)
		// x.y@yell ow.com : NOT valid
		
		if (mySpaceAt != -1) 
		 {myEMailIsValid = false}
		
		
		return myEMailIsValid
	}
	
	
