<!--
function noenter() {
  return !(window.event && window.event.keyCode == 13); 
}
  
function echeck(str) {
		var filter=/^.+@.+\..{2,3}$/
		var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/
		if (filter.test(str) && !str.match(illegalChars)) {
			return true;
		} else {
			return false;
		}
}

function showErr(where, what) {
	var el = document.getElementById(where)
	el.firstChild.nodeValue = what
	if (el.getAttribute("custStyle") != null) {
		el.className = "warn" 
	}
}

function clearErr(where, what) {
	var el = document.getElementById(where)
	el.firstChild.nodeValue = what
	if (el.getAttribute("custStyle") != null) {
		el.className = "normal" 
	}
}

function ValidateForm(source) {
	var err = new Boolean(false);

	switch (source){
		case "id_email": 
			var emailID=document.signup.email;
			if (echeck(emailID.value)==false) {	
				showErr(source,"enter valid email");
				err = true;
			} else {
				clearErr(source,"email");
			}		
		break;
		case "id_firstname":
			var len  =document.signup.firstname.value.length;
			if (len == 0) {
				showErr(source,"enter first name");
				err = true;
			} else {
				clearErr(source,"first name");
			}		
		break;
		case "id_lastname": 
			var len  =document.signup.lastname.value.length;
			if (len == 0) {
				showErr(source,"enter last name");
				err = true;
			} else {
				clearErr(source,"last name");
			}		
		break;
		case "id_nationality": 
			var cn  =document.signup.nationality.value;
			if (cn == "none") {
				showErr(source,"select nationality");
				err = true;
			} else {
				clearErr(source,"nationality");
			}		
		break;
	}
	if (err==true) {
		return false;
	} else {
		return true;
	}
 }

 function ValidateFormAll() {
 	var good = true;
	good = ValidateForm("id_email") && good;
	good = ValidateForm("id_firstname") && good;
	good = ValidateForm("id_lastname") && good;
	good = ValidateForm("id_nationality") && good;
	if (good == true) {
		document.signup.submit();
	}
 }

// -->

