function SetDefault(Elem,Text)
{
	if(Elem.value == "")
	{
		Elem.value = Text;
	}
}

function ClearDefault(Elem,Text)
{
	if(Elem.value == Text)
	{
		Elem.value = "";
	}
}


/*
Validate the e-mail address (returns true if all ok)
*/
function validateEmail(email) {
	invalidChars = "/:,;£$€{[]}|´!\"#¤%&()=?`½§\\*+'<>æøå^"

	for (i=0; i < invalidChars.length; i++) {
		checkChar = invalidChars.charAt(i)
		if (email.indexOf(checkChar, 0) > - 1) {
			return false;
		}
	}

	onPos = email.indexOf("@", 1);
	if (onPos == -1) {
		return false;
	}

	if (email.indexOf("@", onPos+1) != -1)	{
		return false;
	}	

	dotPos = email.indexOf(".", onPos);
	if (dotPos == -1) {
		return false;
	}

	if (dotPos+3 > email.length) {
		return false;
	}

	return true;
}
