﻿// JScript File

function CheckForm()
{
	var personName=document.getElementById('txtName').value;
	var email=document.getElementById('txtRecipient').value;
	
	if(personName=="" || email=="")
	{
		alert("Error: You must enter a name and recipient email address, otherwise we won't be able to send the menu!");
		return false;
	}
	else
	{
		document.forms[1].submit();
	}	
}

function CheckContactForm()
{
	var personName=document.getElementById('txtName').value;
	var email=document.getElementById('txtEmail').value;
	
	if(personName=="" || email=="")
	{
		alert("Error: You must enter your name and email address, otherwise we won't be able to contact you!");
		return false;
	}
	else
	{
		document.forms[1].submit();
	}	
}


function SwapImage(imgNum,over)
{
	if(over)
	{
		document.getElementById('featureImage'+imgNum).src='images/buttons/feature'+imgNum+'_on.jpg';
	}
	else
	{
		document.getElementById('featureImage'+imgNum).src='images/buttons/feature'+imgNum+'.jpg';
	}
}

function SwapColour(divNum,over)
{
	if(over)
	{
		if(document.all)
		{
			//alert('doc all');
			rightFeature1.style.background='#627059;';
			//document.all.rightFeature1.style.color='#FCEFCD;';
		}
		else if(!document.all && document.getElementById)
		{
			document.getElementById('rightFeature'+divNum).style.backgroundColor='#627059;';
			document.getElementById('rightFeature'+divNum).style.color='#FCEFCD;';
		}
	}
	else
	{
		if(document.all)
		{
			document.all.rightfeature1.style.backgroundColor='#FFFFFF;';
			document.all.rightfeature1.style.color='#5C6A59;';
		}
		else if(!document.all && document.getElementById)
		{
			document.getElementById('rightFeature'+divNum).style.backgroundColor='#FFFFFF;';
			document.getElementById('rightFeature'+divNum).style.color='#5C6A59;';
		}
	}
}