// JavaScript Document

function changesourceimage(currentpic) { //gets the current href and sends to the script

	var placeholder = document.getElementById("imgsource"); //gets the source image
	var currentimage = placeholder.getAttribute("src"); //captures the default image being displayed
	var source = currentpic.getAttribute("href"); //gets the link to the image
	placeholder.setAttribute("src", source); //when image link clicked, set the source of the placeholder
	
	currentpic.onmouseout = function() {
		placeholder.setAttribute("src", currentimage); //resets the image to default
	}
}

function formchk() {
	
		if(document.getElementById("name").value == "") {
			alert("Please fill out your name");
			document.getElementById("name").focus();
		return false;
		}

		if(document.getElementById("telephone").value == "") {
			alert("Please fill out your telephone number");
			document.getElementById("telephone").focus();
		return false;
		}
		

		if(document.getElementById("email").value == "") {
			alert("Please fill out your email");
			document.getElementById("email").focus();
		return false;
		
		}
		
		if(document.getElementById("enquiry").value == "") {
			alert("Please fill out your enquiry details");
			document.getElementById("enquiry").focus();
		return false;
		}
		else {
		return true;
		}
	}
