<!--
var beenhere = false;
var completed = true;
var arrWarnings=new Array("Please specify your gender.","Please specify your gender.","Please specify your name.","Please specify the name of your company.","Please specify your business telephone number.","Please specify the URL of your website.","Please specify your e-mail address.","You did not enter your password, or entered it incorrectly.","Please re-enter your password","Please choose your Nedstat Pro account","Please choose your Nedstat Pro account","Please choose your Nedstat Pro account","You have to accept the terms and conditions of Nedstat to enter the trail period.");
var msgIdentical = "The two passwords you entered are not identical. Please enter the exact same password twice.";var msgError     = "Minimum password length is 6 \nPassword must consists of at least one normal character, e.g. \'a\', \'b\', or \'C\' and least one special character, e.g. \'1\', \'2\', \'#\'or \'*\'";var msgEmail="The e-mail address XX is invalid.";

function passwordcheck(){
	var allowEmptyPassword = false; // false on apply
	var minPasswordLength  = 6;

	function isNormalChar(character) 
	{
		return (character >= 'a' && character <= 'z') || (character >= 'A' && character <= 'Z');
	}

	var form = document.forms[0];

	if(form.password.value != form.password2.value) 
	{
		alert(msgIdentical);
		return false;
	}

	if(allowEmptyPassword && form.password.value == "")
		return true;

	if(form.password.value.length < minPasswordLength) 
	{
		alert(msgError);
		return false;
	}

	var normalChar;
	var specialChar;
	for(var i = 0; i < form.password.value.length; i++) 
	{
		if(isNormalChar(form.password.value.charAt(i)))
			normalChar = true;
		else
			specialChar = true;
	}

	if(!normalChar) 
	{
		alert(msgError);
		return false;
	}

	if(!specialChar) 
	{
		alert(msgError);
		return false;
	}

	return true;
}

//------------------------------------------------------------------------------
function isvalidemailaddress(syntax)
{
	// the underscore is explicitly mentioned, 
	// because IE 5.2.2. for the MAC does not support the underscore correctly
	var validemailsyntax = /^[\w_-]+(\.[\w_-]+)*@[\w-]+(\.[\w-]+)*(\.[a-zA-Z]{2,4})$/;
	return syntax.match(validemailsyntax);
}
//------------------------------------------------------------------------------>

function Validate(p) 
{
	elem = document.forms[0].elements[p];

	switch(elem.type)
	{
		case ("hidden"):
			return 1;
			break;
		case ("password"):
			return passwordcheck();
			break;
		case ("text"):
			if (elem.value == "" || elem.value == "http://")
			{
				alert(arrWarnings[p]);
				elem.focus();
				return 0;
			}
			if (elem.name=="email")
			{
				if (!isvalidemailaddress(elem.value))
				{
					alert(msgEmail.replace('XX',elem.value));
					return 0;
				}				
			}				
			break;
		case ("radio"):
			if (elem.name=="versie")
			{
				if (document.forms[0].versie[0].checked == false &&
					document.forms[0].versie[1].checked == false &&
					document.forms[0].versie[2].checked == false)
				{
					alert(arrWarnings[p]);
					elem.focus();
					return 0;
				}
			}
			if (document.forms[0].geslacht[0].checked == false && document.forms[0].geslacht[1].checked == false && beenhere  == false)
			{
				alert(arrWarnings[p]);
				beenhere = true;
				elem.focus();
				return 0;
			}
			break;
		case ("checkbox"):
			if (!elem.checked) alert(arrWarnings[p]);
			elem.focus();
			return elem.checked;
			break;
		case ("button"):
			elem.disabled = true;
			break;
	}
	return 1;
}

function CheckAgreement(cntrname)
{
	beenhere = false;
	completed = true;
	for (x = 0; x < document.forms[0].elements.length ; x++)
	{
		completed &= Validate(x);
		if (!completed) break;
	}
	if (completed) 
	{
		//document.forms[0].submit();
		sitestatForm(document.forms[0],'http://nl.sitestat.com/nedstat/uk/s?'+ cntrname +'&category=apply&prod=pro&cntry=uk&lng=en');
		// disable the submit button
		document.forms[0].submitbutton.disabled = true; //IE
		if (document.layers /* NS4 */)
		{
			// Because Netscape can NOT disable form elements we 'simulate' 
			// this 'feature' by 'blurring the focus away' from the button
			// and assigning an event handler which blurs the button if the button 
			// gets the focus again (by using keyboard TAB or mouse click)
			document.forms[0].submitbutton.onfocus = killfocus;
			document.forms[0].submitbutton.onclick = killfocus;
			killfocus();
		}
	}
}

function killfocus()
{
document.forms[0].submitbutton.blur();
}
//-->
