	var whitespace = " \t\n\r";
	function isEmpty(field, alerttxt)
	{
		with (field) {
		var i;
		if((value == null) || (value.length == 0))
		{
		window.alert(alerttxt);
		return true;
		}

		for(i = 0; i < value.length; i++)
		{
			var c = value.charAt(i);
			if(whitespace.indexOf(c) == -1)
			{
				return false;
			}
		}
		window.alert(alerttxt);
		return true;
		}
	}
	
	function isAlpha(field, alerttxt, minimum)
	{
		var count;
		var c;
		with (field) {
		if(value.length < minimum)
		{
			window.alert(alerttxt);
				return false;
		}
		for(count = 0; count < value.length; count++)
		{
			c = value.charCodeAt(count);
			if(c < 65)
			{
				if(c == 32)
				{
					continue;
				}
				window.alert(alerttxt);
				return false;
			}
			if((c > 90) && (c < 97))
			{
				window.alert(alerttxt);
				return false;
			}
			if(c > 122)
			{
				window.alert(alerttxt);
				return false;
			}
		}
		return true;
		}
	}

	function validate_email(field,alerttxt)
	{
		with (field)
		{
			apos=value.indexOf("@")
			dotpos=value.lastIndexOf(".")
			if (apos<1||dotpos-apos<2) {
				window.alert(alerttxt);
				return false;
			} else {
				return true;
			}
		}
	}
	
	function validate_subscribe_form(thisform)
	{
		with (thisform)
		{
			if (isEmpty(name, "Your name must be filled")) {
				name.focus();
				return false;
				
			} else if (!isAlpha(name, "Invalid name format!", 0)) {
				name.focus();
				return false;
				
			} else if (validate_email(djcdl,"Your email format is invalid")==false) {
				djcdl.focus();
				return false;
			}
		}
	}
	
	