// JavaScript Document

function changecolour (name) {
//Changes the color of name (in this case name is the search input) to be white
	name.style.color = "#000000";
}

////////////////////////////////////////////////////////////////////////////////////////////

function returncolour (name) {
//if there is no text in name (in this case name is the search input) make name equal "search..."
	if (name.value.length == "0") {
		name.value = "Name";
		name.style.color =  "#61636c";
	}
}

function checkclear (name) {
//if name (in this case name is the search input) equals "search..." make it blank
	if (name.value == "Name") {
		name.value = "";
	}
}

function returncolour1 (name) {
//if there is no text in name (in this case name is the search input) make name equal "search..."
	if (name.value.length == "0") {
		name.value = "Email Address";
		name.style.color =  "#61636c";
	}
}

function checkclear1 (name) {
//if name (in this case name is the search input) equals "search..." make it blank
	if (name.value == "Email Address") {
		name.value = "";
	}
}

function returncolour2 (name) {
//if there is no text in name (in this case name is the search input) make name equal "search..."
	if (name.value.length == "0") {
		name.value = "Phone";
		name.style.color =  "#61636c";
	}
}

function checkclear2 (name) {
//if name (in this case name is the search input) equals "search..." make it blank
	if (name.value == "Phone") {
		name.value = "";
	}
}

function returncolour3 (name) {
//if there is no text in name (in this case name is the search input) make name equal "search..."
	if (name.value.length == "0") {
		name.value = "Company";
		name.style.color =  "#61636c";
	}
}

function checkclear3 (name) {
//if name (in this case name is the search input) equals "search..." make it blank
	if (name.value == "Company") {
		name.value = "";
	}
}

function returncolour4 (name) {
//if there is no text in name (in this case name is the search input) make name equal "search..."
	if (name.value.length == "0") {
		name.value = "Your Message";
		name.style.color =  "#61636c";
	}
}

function checkclear4 (name) {
//if name (in this case name is the search input) equals "search..." make it blank
	if (name.value == "Your Message") {
		name.value = "";
	}
}




////////////////////////// Validate Search Form //////////////////////////////////////////

function contactvalidate (f) {
var error = ""; 
var errlvl = 0;
if (f.f_name.value == "Name") {
f.f_name.style.border =  "1px solid #9e0c23";
errlvl =1;
}

if (f.f_email.value == "Email Address") {
f.f_email.style.border =  "1px solid #9e0c23";
errlvl =1;
}

if (errlvl ==1) {
return false;
} else {
return true;
}
}
