<!--

/***************************************************
BEGIN FORM VALIDATION SECTION
***************************************************/

	function Trim(trim_value)
	{
		if(trim_value.length < 1)
		{
			return "";
		}
		trim_value = RTrim(trim_value);
		trim_value = LTrim(trim_value);
		if(trim_value == "")
		{
			return "";
		}
		else
		{
			return trim_value;
		}
	}

	function RTrim(trim_value)
	{
		var w_space = String.fromCharCode(32);
		var v_length = trim_value.length;
		var strTemp = "";
		if(v_length < 0)
		{
			return "";
		}
		var iTemp = v_length -1;
		while(iTemp > -1)
		{
			if(trim_value.charAt(iTemp) == w_space)
			{
			}
			else
			{
				strTemp = trim_value.substring(0,iTemp +1);
				break;
			}
			iTemp = iTemp-1;
		}
		return strTemp;
	}

	function LTrim(trim_value)
	{
		var w_space = String.fromCharCode(32);
		if(v_length < 1)
		{
			return "";
		}
		var v_length = trim_value.length;
		var strTemp = "";
		var iTemp = 0;
		while(iTemp < v_length)
		{
			if(trim_value.charAt(iTemp) == w_space)
			{
			}
			else
			{
				strTemp = trim_value.substring(iTemp,v_length);
				break;
			}
			iTemp = iTemp + 1;
		}
		return strTemp;
	}

	function isValidEmail(email)
	{
		var valid = email.search( /^[^@]+@([-a-zA-Z0-9]+\.)+[-a-zA-Z0-9]{2,5}/ );
		if( valid == 0 )
		{
			return true;
		}
		else
		{
			return false;
		}
	}

	function doSubmit()
	{
		var errMsg = "";
		var focusElement = null;
		var nameElement = document.forms[0].elements[2];
		var phoneElement = document.forms[0].elements[3];
		var emailElement = document.forms[0].elements[4];
		nameElement.value = Trim(nameElement.value);
		phoneElement.value = Trim(phoneElement.value);
		emailElement.value = Trim(emailElement.value);
		var v_name = nameElement.value;
		var v_phone = phoneElement.value;
		var v_email = emailElement.value;
		if (v_name.length < 1)
		{
			errMsg += " * Please enter your name.\n";
			focusElement = nameElement;
		}
		if ((v_phone.length < 1) && (v_email.length < 1))
		{
			errMsg += " * Please enter your phone number and/or email address, so that we can respond to your enquiry.\n";
			if (focusElement == null)
			{
				focusElement = phoneElement;
			}
		}
		if ((v_email.length > 0) && (!isValidEmail(v_email)))
		{
			errMsg += " * Please enter a valid email address.\n";
			if (focusElement == null)
			{
				focusElement = emailElement;
			}
		}
		if (errMsg.length > 0)
		{
			alert(errMsg);
		}
		else
		{
			document.forms[0].submit();
		}
	}

/***************************************************
END FORM VALIDATION SECTION
***************************************************/

function setHref(link)
{
	link.href = "mailto:enquiries@medicalconnect.com.au";
	return true;
}

function checkFontsInstalled()
{
	var wid1 = document.getElementById("fontTest1").offsetWidth;
	var wid2 = document.getElementById("fontTest2").offsetWidth;
	var fontsInstalled = (wid1 != wid2);
	if (!fontsInstalled)
	{
		var newWidth = "900px";
		document.getElementById("header").style.width = newWidth;
		document.getElementById("banner").style.width = newWidth;
		document.getElementById("menu").style.width = newWidth;
		document.getElementById("titleDiv").style.width = newWidth;
		document.getElementById("holder").style.width = newWidth;
		var secondTitle = document.getElementById("titleDiv2");
		if (secondTitle != null)
		{
			secondTitle.style.width = newWidth;
			if (navigator.userAgent != null && navigator.userAgent.indexOf("MSIE 6.0") > -1)
			{
				document.getElementById("holder").style.width = "890px";
			}
		}
		
		document.getElementById("footer").style.width = newWidth;
	}
}

// -->