
	//Hide email addresses from SPAM Harvesters
	function eatmy(shorts,usetext) {
	
		var nospam = "&#064";
		var eatme = "mooreadamsoncraig.co.uk";
		if (usetext == "") {
			document.writeln("<A href='mailto:"+shorts+nospam+eatme+"'>"+shorts+nospam+eatme+"</A>");
		} else {
			document.writeln("<A href='mailto:"+shorts+nospam+eatme+"'>"+usetext+"</A>");	
		}
	}

	//Hide email addresses from SPAM Harvesters
	function AndMe(shorts,eatme) {
	
		var nospam = "&#064";
		document.writeln("<A href='mailto:"+shorts+nospam+eatme+"'>"+shorts+nospam+eatme+"</A>");

	}
    
 function ShowBox(bid){
	if (bid==1) {
		box1.style.display ="";
		f1.src = "folder_open.gif";
	}

	if (bid==2) {
		box2.style.display = "";
		f2.src = "folder_open.gif";
	}

	if (bid==3) {
		box3.style.display = "";
		f3.src = "folder_open.gif";
	}

	if (bid==4) {
		box4.style.display = "";
		f4.src = "folder_open.gif";
	}

	if (bid==5) {
		box5.style.display = "";
		f5.src = "folder_open.gif";
	}

	if (bid==6) {
		box1.style.display = "";
		box2.style.display = "";
		box3.style.display = "";
		box4.style.display = "";
		box5.style.display = "";
		f1.src = "folder_open.gif";
		f2.src = "folder_open.gif";
		f3.src = "folder_open.gif";
		f4.src = "folder_open.gif";
		f5.src = "folder_open.gif";
	}

	if (bid==7) {
		box1.style.display = "none";
		box2.style.display = "none";
		box3.style.display = "none";
		box4.style.display = "none";
		box5.style.display = "none";
		f1.src = "folder.gif";
		f2.src = "folder.gif";
		f3.src = "folder.gif";
		f4.src = "folder.gif";
		f5.src = "folder.gif";	}
  }



// If you use/modify this code for your own use, please leave this comment in so others can find the source
// Author is Dan Wardle, 30 June 2003. Contact details and source code available at http://surveylab.co.uk
	
function SubmitForm() {
	var strAlert = "Please enter a valid email address"
	var check = "pass"
	   
	//If any of these tests fail, change the check value to "fail"
	if (document.form1.QxEmail.value == "") {
		check = "fail"; //Nothing entered
	} else {
		//Divide the email into the name part and the domain part
		emailarray = document.form1.QxEmail.value.split("@");
		if (emailarray.length != 2) {
			check="fail";	//Too many @
		} else {
			//Examine the name part
			if (emailarray[0].search("^[A-Za-z0-9]") == -1) check="fail"; //Start of name needs alphanumeric
			if (emailarray[0].search("[A-Za-z0-9]$") == -1) check="fail"; //End of name needs alphanumeric
			if (emailarray[0].search("[\.\_\-]+") > 0) { //dot, dash and underscore are ok, but only in middle of name
				if (emailarray[0].search("[A-Za-z0-9][\.\_\-][A-Za-z0-9]+$") == -1) check="fail"; 
			}
							
			//Examine the domain part
			//First 2 characters must be alphanumeric, so should last 2. At least one dot should be present
			if (emailarray[1].search("^[A-Za-z0-9][A-Za-z0-9\-]+[\.]+[A-Za-z0-9]{2,}") == -1) check="fail";
			if (document.form1.QxEmail.value.indexOf("..") >= 0) check="fail"; // Two dots together not allowed
		}//End if emailarray
	}//End if document.form

	//If the check value is "fail", display the message and do not submit the form
	if (check == "fail") {
		alert (strAlert);
		return false
			
	//If the check isn't "fail", then it must be "pass"
	} else {
		return true;
	}
} //End function