function navOver(imgName)
{
	var theImage = document.getElementById(imgName);
	
	if(theImage.src.indexOf("_off.gif") != -1)
	{
		theImage.src = theImage.src.replace("_off.gif","_on.gif");
	}
	
	else
	{
		theImage.src = theImage.src.replace("_on.gif","_off.gif");
	}
}

function validateEnquiryForm(theForm)
{
	
	valid = true;
	message = "Please enter the following sections before proceeding:\n\n";
	
	if(theForm.elements["txtFirstName"].value == "")
	{
		message += "Your first name\n";	
		valid = false;
	}

	if(theForm.elements["txtSurname"].value == "")
	{
		message += "Your surname\n";		
		valid = false;
	}

	if(theForm.elements["txtPhoneNumber"].value == "")
	{
		message += "Your phone number\n";	
		valid = false;
	}	
	
	if(theForm.elements["txtStreetAddress"].value == "")
	{
		message += "Your street address\n";			
		valid = false;
	}

	if(theForm.elements["txtSuburb"].value == "")
	{
		message += "Your suburb\n";
		
		valid = false;
	}		
	
	if(theForm.elements["txtCountry"].value == "")
	{
		message += "Your country\n";			
		valid = false;
	}		
	
	if(theForm.elements["txtEmailAddress"].value == "")
	{
		message += "Your email address\n";			
		valid = false
	}	
		
	if(theForm.elements["txtEmailAddress"].value != "")	
	{	
		var supEmail = theForm.elements["txtEmailAddress"].value;
		var emLen = supEmail.length;
		var posAt = supEmail.indexOf('@')
		var posDot = supEmail.lastIndexOf('.')
		if((emLen < 7) || (posAt < 1) || (posDot <= (posAt + 1)) || (posDot >= (emLen - 1)))
		{
			message += "Valid email address\n";				
			valid = false;
		}
	}		
			
	if(valid)
	{			
		return true;
	}
	else
	{		
		alert(message);
		return false;
	}		
}

/* SuFR */
function doSufr(sufrTag, sufrSrc, sufrWidth, sufrHeight)
{
	var theSufrTag = document.getElementsByTagName(sufrTag);	

	for(var i=0; i<theSufrTag.length; i++)
	{
		var obj = theSufrTag[i];
		obj.setAttribute('id', 'tag'+i);
		
		if(theSufrTag[i].firstChild != null)
		{
			var pageTxt = theSufrTag[i].firstChild.data;
			pageTxt = pageTxt.replace('&', '{and}');		
		}
		else
		{
			var pageTxt = "Article Title";
		}
		
		swfobject.embedSWF(sufrSrc + "?pageTxt=" + pageTxt + "&sufrId=sufr" + i, 'tag'+i, sufrWidth, sufrHeight, "6", "expressInstall.swf", "false", {wmode:"transparent"});				
		document.getElementsByTagName(sufrTag)[i].style.width = sufrWidth;			
	}
}


