

	
	function FormSubmit()
	{
		if ( ValidateForm() )
		{
			var oForm = document.contactus;
			oForm.action = "contactus.php";
			oForm.submit();
		}
	}
	function ValidateForm()
	{
		var oForm = document.contactus;
		if ( oForm.given.value == "" || oForm.surname.value == "" || oForm.myemail.value == "")
		{
			alert("All Required Fields Must be Completed");
			oForm.given.focus();
			return false;
		}
		if ( ! ValidEmailAddress(oForm.myemail.value) )
		{
			alert("The Email Address must be a valid Email");
			return false;
		}

		return true;
	}
	function ValidEmailAddress(strEmailAddress)
	{
		var re = /^[a-zA-Z0-9\_\-\'\&\*\!\#]+(\.[a-zA-Z0-9\_\-\'\&\*\!\#]+)*\@[a-zA-Z0-9\_\-\'\&\*\!\#]+(\.[a-zA-Z0-9\_\-\'\&\*\!\#]+)*\.([A-Za-z]{2,4}|[0-9]{1,3})$/;
		if (!re.test(strEmailAddress))
		{
			return false;
		}
		return true;
	}
	function flipImage(url)
	{
		if (window.event.srcElement.tagName == "IMG" )
		{
			window.event.srcElement.src = url;
		}
	}

	function PopUpProduct( popupLocation  ){
	
		var popupWidth = 950;
		var popupHeight = 850;
		var statusBarOn = true;
	
		var heightspeed = 20; 	// vertical speed
		var widthspeed 	= 20;  	// horizontal speed
		var leftdist 	= (screen.width - popupWidth) / 2;    	// distance to left edge of window
		var topdist 	= (screen.height - popupHeight) / 2;   	// distance to top edge of window
		if (document.all)
		{
			if (statusBarOn) 
			{
				var popup = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=4,height=4,scrollbars=yes,resizable=yes,status=yes");
			} 
			else
			{ 
				var popup = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=4,height=4,scrollbars=yes,resizable=yes,status=yes");
			}
	
			for (sizeheight = 1; sizeheight < popupHeight; sizeheight += heightspeed) 
			{
				popup.resizeTo("1", sizeheight);
			}
			for (sizewidth = 1; sizewidth < popupWidth; sizewidth += widthspeed) 
			{
				popup.resizeTo(sizewidth, sizeheight);
			}
			
			popup.resizeTo(popupWidth, popupHeight);
			popup.location = popupLocation;
		}
		else
		{
			var popup = window.open(popupLocation,"","left=" + leftdist + ",top=" + topdist + ",width=" + popupWidth + ",height=" + popupHeight + ",scrollbars=yes");
		}
	
}

	function PopUp( popupLocation  ){
	
		var popupWidth = 950;
		var popupHeight = 850;
		var statusBarOn = true;
	
		var heightspeed = 20; 	// vertical speed
		var widthspeed 	= 20;  	// horizontal speed
		var leftdist 	= (screen.width - popupWidth) / 2;    	// distance to left edge of window
		var topdist 	= (screen.height - popupHeight) / 2;   	// distance to top edge of window
		if (document.all)
		{
			if (statusBarOn) 
			{
				var popup = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=4,height=4,scrollbars=yes,resizable=yes,status=yes");
			} 
			else
			{ 
				var popup = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=4,height=4,scrollbars=yes,resizable=yes,status=yes");
			}
	
			for (sizeheight = 1; sizeheight < popupHeight; sizeheight += heightspeed) 
			{
				popup.resizeTo("1", sizeheight);
			}
			for (sizewidth = 1; sizewidth < popupWidth; sizewidth += widthspeed) 
			{
				popup.resizeTo(sizewidth, sizeheight);
			}
			
			popup.resizeTo(popupWidth, popupHeight);
			popup.location = popupLocation;
		}
		else
		{
			var popup = window.open(popupLocation,"","left=" + leftdist + ",top=" + topdist + ",width=" + popupWidth + ",height=" + popupHeight + ",scrollbars=yes");
		}
	
}

function PopUpFieldSelector( popupLocation, field ){
	
		var popupWidth = 950;
		var popupHeight = 850;
		var statusBarOn = true;
	
		var heightspeed = 20; 	// vertical speed
		var widthspeed 	= 20;  	// horizontal speed
		var leftdist 	= (screen.width - popupWidth) / 2;    	// distance to left edge of window
		var topdist 	= (screen.height - popupHeight) / 2;   	// distance to top edge of window
		if (document.all)
		{
			if (statusBarOn) 
			{
				var popup = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=4,height=4,scrollbars=yes,resizable=yes,status=yes");
			} 
			else
			{ 
				var popup = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=4,height=4,scrollbars=yes,resizable=yes,status=yes");
			}
	
			for (sizeheight = 1; sizeheight < popupHeight; sizeheight += heightspeed) 
			{
				popup.resizeTo("1", sizeheight);
			}
			for (sizewidth = 1; sizewidth < popupWidth; sizewidth += widthspeed) 
			{
				popup.resizeTo(sizewidth, sizeheight);
			}
			
			popup.resizeTo(popupWidth, popupHeight);
			popup.location = popupLocation + "?field=" + field;
		}
		else
		{
			var popup = window.open(popupLocation + "?field=" + field,"","left=" + leftdist + ",top=" + topdist + ",width=" + popupWidth + ",height=" + popupHeight + ",scrollbars=yes");
		}
	
}
