
var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

function checkmail(e, echeck){
	var returnval=emailfilter.test(e.value);
	if (returnval==false){
		alert("Ange en korrekt e-postadress.");
		e.focus();
		e.select();
	} else {
		var strInput = e.value;
		var strInput2 = echeck.value;
		
		if (strInput != strInput2) {
			alert("Please confirm the email adress.");
			echeck.focus();
			echeck.select();
			return false;
		}
	}
	return returnval;
}

function checkonemail(e){
	var returnval=emailfilter.test(e.value);
	if (returnval==false){
		//alert("Ange en korrekt e-postadress.");
		e.focus();
		e.select();
	} 
	return returnval;
}

function checkpassword( val, val2, str ) {
	var strInput = val.value;
	var strInput2 = val2.value;

	if ( strInput!= strInput2 ) {
		alert(str);
		val2.focus();
		val2.select();
		return false;
	} else {
		return true;
	}
}


