function emailvalidation(entered, alertbox)
{
// E-mail-Validation (c) Henrik Petersen / NetKontoret
// Explained at www.echoecho.com/jsforms.htm
// Please do not remove the this line and the two lines above.
with (entered)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
lastpos=value.length-1;
if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2)
{if (alertbox) {alert(alertbox);} return false;}
else {return true;}
}
}

function urlvalidation(entered, alertbox)
{
// E-mail-Validation (c) Henrik Petersen / NetKontoret
// Explained at www.echoecho.com/jsforms.htm
// Please do not remove the this line and the two lines above.
with (entered)
{
dotpos=value.lastIndexOf(".");
lastpos=value.length-1;
if (lastpos-dotpos>3 || lastpos-dotpos<2)
{if (alertbox) {alert(alertbox);} return false;}
else {return true;}
}
}

function emptyvalidation(entered, alertbox)
{
// Emptyfield-Validation (c) Henrik Petersen / NetKontoret
// Explained at www.echoecho.com/jsforms.htm
// Please do not remove the this line and the two lines above.
	with (entered){
		if (value==null || value==""){
			if (alertbox!="") {
				alert(alertbox);
			}
			return false;
		}else{
			return true;
		}
	}
}

function formvalidation(thisform)
{
with (thisform)
{
if (emptyvalidation(artistname,"Please enter your name.")==false) {artistname.focus(); return false;};
if (emailvalidation(artistemail,"Please enter your e-mailadress.")==false) {artistemail.focus(); return false;};
if (emptyvalidation(desireddomain,"Please enter the titel of your page.")==false) {desireddomain.focus(); return false;};
if (emptyvalidation(artistdescription,"Please enter some words about you and your artwork.")==false) {artistdescription.focus(); return false;};
if (emptyvalidation(sampleurl,"")==false){
if (emptyvalidation(sampleimage,"Please choose an image to upload!")==false) {sampleimage.focus(); return false;};
}else if (urlvalidation(sampleurl, "Invalid URL!") == false) {sampleurl.focus(); return false;};
}
}

function formvalidation3(thisform)
{
with (thisform)
{
if (emailvalidation(feedback_email,"Invalid or missing email.\nPlease enter your e-mailadress.")==false) {feedback_email.focus(); return false;};
if (emptyvalidation(feedback_text,"Please enter a text.")==false) {feedback_text.focus(); return false;};
}
}