// JavaScript Document

function validateForm()
{
	var err = "";
	var f = document.forms["downloadForm"];
	var x;
	
	x = f["firstname"].value;
	if (x==null || x=="") {
  		err = err + "Please provide first name!<br/>";
  	}
	
	x = f["lastname"].value;
	if (x==null || x=="") {
  		err = err + "Please provide last name!<br/>";
  	}

	x = f["email"].value;
	if (x==null || x=="") {
  		err = err + "Please provide your email!<br/>";
  	}

	else if (x != f["email2"].value) {
  		err = err + "Please repeat email identically!<br/>";
  	}
	
	else if (!((x.indexOf(".") > 0) && (x.indexOf("@") > 0))) {
  		err = err + "Your email address does not look valid!<br/>";
  	}
 
	if (document.forms["licenseForm"]["license"].checked == false) {
  		err = err + "You have to accept the license for continuing download!<br/>";
  	}

	if (f["privacy"].checked == false) {
  		err = err + "You have to accept the privacy policy for continuing download!<br/>";
  	}

	x = f["country"].value;
	if (x==null || x=="") {
  		err = err + "Please select your country!<br/>";
  	}
	
	if (err != "") {
		window.location.replace("index.php?page=AU&error=" + err);
		return false;
	}
	
	return true;
}


