
function checkEmail(myForm) {
	var check = false;
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.epost.value)){
//	if(myForm.fornamn.value=='') check=false; else check=true;
	if(myForm.efternamn.value=='') check=false; else check=true;
		if(check == true) return (true)
		else alert ("Du måste fylla i alla fält.")
	return (false)
}
else alert("Fyll i en korrekt e-postadress.")
return (false)
}

function backa(){ 
	history.go(-1)
}

function fram(){ 
	history.go(1)
}

//param(row,color )
function setRowColor(theRow, theRowColor){
	if (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined') {
		return false;
	}
var row_cell = theRow.cells.length;
	for (var i = 0; i < row_cell; i++) {
		theRow.cells[i].bgColor = theRowColor;
	}
	return true;
} // end setRowColor() function

// Replace bg on object
function ReplaceBGcolor(object,newcolor){
/*	object.style.backgroundColor = newcolor;*/


	if (typeof(object.style) == 'undefined' || typeof(object.cells) == 'undefined') {
		return false;
	}
var row_cell = object.cells.length;
	for (var i = 0; i < row_cell; i++) {
		object.cells[i].bgColor = newcolor;
	}
	return true;

}








// Check date string to 10 char
//---------------------------------------------------------
function checkDateString(str_){
	var str = new String;
	var valid = true;
	str = str_;

	if (str.length ==10){
		valid = validate_num(str);
		if (valid){
			if (str_.substr(4, 1) == "-"){
			}else{	valid = false;}
		}
		
		
		if (valid){
			if (str_.substr(7, 1) == "-"){
			}else{	valid = false;}
		}
	}else{
		if (str.length ==0){
		}else{	valid = false;}
	}
		return valid;
}










