// ========================================================================================
// Program:	This script has been written to handle the "contact us"
//			section of websites which require an automated response
//			from the web servers POP3 mail server technology.
// Authors:	James Bishop
// Created:	13th June 2005
// Version:	v1.00
// Company:	Subversa (Digital Business)
// ========================================================================================

function process(link) {
	window.location.href = home+link;
}

function contact_ok() {
	var contact = document.forms[0].contact.value;
	var company = document.forms[0].company.value;
	var email = document.forms[0].email.value;
	var phone = document.forms[0].phone.value;
	var comments = document.forms[0].comments.value;
	
	if(contact.length < 1) {
		alert('You have not entered your Name.');
		return false;
	}

	/*
	if(company.length < 1) {
		alert('You have not entered your Company.');
		return false;
	}
	*/
	
	if(phone.length < 1) {
		if(email.length < 1) {
			alert('You must enter your phone number or email address.');
			return false;
		} else {
			alert('You have not entered your phone number.');
			return false;
		}
	}
	
	if(email.length > 1 && (email.length < 7 || email.indexOf('@') == -1)) {
		alert('Your email address is incorrect.');
		return false;
	}

	if(comments.length < 1) {
		alert('You have not entered any details of request.');
		return false;
	}
	
	if(confirm('Are you sure that the details you have entered are correct?')) {
		document.forms[0].action = 'confirm.html';
		document.forms[0].method = 'post';
		document.forms[0].submit();
	}
}


