function checkTextEmpty(theText){
	if ( theText.value != "" ) {
		return true;
	}
	return false;
}

function cf() {
	var i;
	var myArray = new Array("email","Context","budget");
	var myItems = new Array("your email address","the context or planned usage of the foto(s)","your budget range");

	for (i = 0; i < myArray.length; i++) {
		if (!checkTextEmpty(eval("document.mf." + myArray[i]))) {
			alert('Please enter ' + myItems[i] + '.');
			return false;
		}
	}
	
if (!checkEmail(eval("document.mf.email"))) {
		alert('Please enter a valid email address.');
		return false;
	}

	return true;
}

	function checkEmail(theField) {
		var validEmail = 1;
		var tfV = theField.value;
		var whereAt = tfV.indexOf("@");
		var whereDot = tfV.indexOf(".",whereAt);
	
		if ( (whereAt == -1) || (whereDot == -1) ) {
			validEmail = 0;
		}
		if ( whereAt < 1 ){
			validEmail = 0;
		}
		if ( (whereDot - whereAt) < 2 ){
			validEmail = 0;
		}
		if ( (tfV.length - whereDot) < 3 ){
			validEmail = 0;
		}

		if (validEmail) {
			return true;
		} else {
			return false;
		}
}

var submitcount=0;
   function checkSubmit() {

      if (submitcount == 0)
      {
      submitcount++;
      document.mf.submit();
      }
   }

