function preloadImages() {
	if (document.images) {
		pic1 = new Image(300,225); 
		pic1.src = "http://localhost/sevenlemons/2009/pix/popup_guys.jpg"; 
	}
}

// JavaScript Document

function checkDomainForm() {
	if (document.domainForm.tld.options[document.domainForm.tld.selectedIndex].value == "co.za") {
		document.domainForm.target = "_blank";
		document.domainForm.action = "http://co.za/cgi-bin/whois.sh";
	} else {
		document.domainForm.action = "whois-results.php";
	}
}

function checkSMSSignup() {
	var fullname = document.smsform.fullname;
	var companyname = document.smsform.companyname;
	var cellphone = document.smsform.cellphone;
	var othercontact = document.smsform.othercontact;
	var email = document.smsform.email;
	
	if (fullname.value == "") {
		alert("Please enter your Full Name");
		fullname.focus();
		return false;
	}
	if (companyname.value == "") {
		alert("Please enter your Company Name\nIf not applicable, type N/A");
		companyname.focus();
		return false;
	}
	if (cellphone.value == "") {
		alert("Please enter your Cellphone Number");
		cellphone.focus();
		return false;
	}
	if (othercontact.value == "") {
		alert("Please enter your Other Contact Number");
		othercontact.focus();
		return false;
	}
	if (email.value == "") {
		alert("Please enter your E-Mail Address");
		email.focus();
		return false;
	}
	if (email.value.indexOf("@") == -1) {
		alert("Please enter a valid E-Mail Address");
		email.focus();
		return false;
	}
	document.smsform.action = "services-bulk-sms-action.php";
	return true;
}

function checkSignup() {
	var fullname = document.signupform.fullname;
	var companyname = document.signupform.companyname;
	var cellphone = document.signupform.cellphone;
	var othercontact = document.signupform.othercontact;
	var email = document.signupform.email;
	
	if (fullname.value == "") {
		alert("Please enter your Full Name");
		fullname.focus();
		return false;
	}
	if (companyname.value == "") {
		alert("Please enter your Company Name\nIf not applicable, type N/A");
		companyname.focus();
		return false;
	}
	if (cellphone.value == "") {
		alert("Please enter your Cellphone Number");
		cellphone.focus();
		return false;
	}
	if (othercontact.value == "") {
		alert("Please enter your Other Contact Number");
		othercontact.focus();
		return false;
	}
	if (email.value == "") {
		alert("Please enter your E-Mail Address");
		email.focus();
		return false;
	}
	if (email.value.indexOf("@") == -1) {
		alert("Please enter a valid E-Mail Address");
		email.focus();
		return false;
	}
	document.signupform.action = "signup-action.php";
	return true;
}

function checkQuotation() {
	var fullname = document.quotationform.fullname;
	var companyname = document.quotationform.companyname;
	var cellphone = document.quotationform.cellphone;
	var othercontact = document.quotationform.othercontact;
	var email = document.quotationform.email;
	var message = document.quotationform.message;
	
	if (fullname.value == "") {
		alert("Please enter your Full Name");
		fullname.focus();
		return false;
	}
	if (companyname.value == "") {
		alert("Please enter your Company Name\nIf not applicable, type N/A");
		companyname.focus();
		return false;
	}
	if (cellphone.value == "") {
		alert("Please enter your Cellphone Number");
		cellphone.focus();
		return false;
	}
	if (othercontact.value == "") {
		alert("Please enter your Other Contact Number");
		othercontact.focus();
		return false;
	}
	if (email.value == "") {
		alert("Please enter your E-Mail Address");
		email.focus();
		return false;
	}
	if (email.value.indexOf("@") == -1) {
		alert("Please enter a valid E-Mail Address");
		email.focus();
		return false;
	}
	if (message.value == "") {
		alert("Please enter a Brief Decription of Requirements");
		message.focus();
		return false;
	}
	if (message.value.indexOf('"') != -1) {
		alert("Please remove the quotation mark/s from your Brief Decription of Requirements");
		message.focus();
		return false;
	}
	document.quotationform.action = "services-get-quotation-action.php";
	return true;
}

function checkGetAQuoteForm() {
	var fullname = document.forms["getaquoteform"].fullname;
	var email = document.forms["getaquoteform"].email;
	var phone = document.forms["getaquoteform"].phone;
	var desc = document.forms["getaquoteform"].desc;
	var relates = document.forms["getaquoteform"].relates;
	var treatas = document.forms["getaquoteform"].treatas;
	var type = document.forms["getaquoteform"].type;
	var submitit = document.forms["getaquoteform"].submitit;
	
	if (document.getElementById("fullname").value == "") {
		alert("Please enter your Full Name");
		document.getElementById("fullname").focus();
		return false;
	}
	/*if (document.forms["getaquoteform"].email.value == "") {
		alert("Please enter either your E-Mail Address");
		document.forms["getaquoteform"].email.focus();
		return false;
	}
	if (document.forms["getaquoteform"].email.value.indexOf("@") == -1) {
		alert("Please enter a valid Current E-Mail Address");
		document.forms["getaquoteform"].email.focus();
		return false;
	}
	if (document.forms["getaquoteform"].email.value.indexOf(".") == -1) {
		alert("Please enter a valid Current E-Mail Address");
		document.forms["getaquoteform"].email.focus();
		return false;
	}
	if (document.forms["getaquoteform"].phone.value == "") {
		alert("Please enter a Phone / Cell Number we can reach you on in connection with your quote / enquiry");
		document.forms["getaquoteform"].phone.focus();
		return false;
	}
	if (document.forms["getaquoteform"].desc.value == "") {
		alert("Please enter your Comments / Enquiry");
		document.forms["getaquoteform"].desc.focus();
		return false;
	}
	document.forms["getaquoteform"].type.value = document.forms["getaquoteform"].treatas.options[document.forms["getaquoteform"].treatas.selectedIndex].value;
	document.forms["getaquoteform"].submitit.value = "yes";
	return true;*/
}

function checkLogin() {
	var username = document.myform.username;
	var password = document.myform.password;
	
	if (username.value == "") {
		alert("Please enter Username");
		username.focus();
		return false;
	}
	if (password.value == "") {
		alert("Please enter Password");
		password.focus();
		return false;
	}
	
	document.myform.action = "validate.php";
	return true;
}