// JavaScript Document

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}


var lhs = "foxair";
var rhs = "foxair.com.au";

function print_mail_to_link() 
{
   document.write("<a href=\"mailto");
   document.write(":" + lhs + "@");
   document.write(rhs + "\">" + lhs + "@" + rhs + "<\/a>");
}

function print_mail_to_unlink() 
{
   document.write(lhs + "@" + rhs);
}


function check_form(contact) { 
	if ((contact.fname.value == "") || (contact.fname.value.indexOf('@', 0) != -1)) { 
		alert("Please Enter Your First Name!"); 
		contact.fname.focus(); 
		return (false); 
	} 
	if ((contact.lname.value == "") || (contact.lname.value.indexOf('@', 0) != -1)) { 
		alert("Please Enter Your Last Name!"); 
		contact.lname.focus(); 
		return (false); 
	} 
	if (contact.email.value.indexOf('@', 0) == -1) { 
		alert("Please Enter A Valid Email!"); 
		contact.email.focus(); 
		return (false); 
	} 
	if ((contact.phone.value == "") || (contact.phone.value.indexOf('@', 0) != -1)) { 
		alert("Please Enter A Phone Number!"); 
		contact.phone.focus(); 
		return (false); 
	} 
	if ((contact.message.value == "") || (contact.message.value.indexOf('@', 0) != -1)) { 
		alert("Please Enter Your Enquiry/Message!"); 
		contact.message.focus(); 
		return (false); 
	} 
	return (true); 
} 

function checkform(dlform) { 
	if ((dlform.fname.value == "") || (dlform.fname.value.indexOf('@', 0) != -1)) { 
		alert("Please Enter Your First Name!"); 
		dlform.fname.focus(); 
		return (false); 
	} 
	if ((dlform.lname.value == "") || (dlform.lname.value.indexOf('@', 0) != -1)) { 
		alert("Please Enter Your Last Name!"); 
		dlform.lname.focus(); 
		return (false); 
	} 
	if ((dlform.phone.value == "") || (dlform.phone.value.indexOf('@', 0) != -1)) { 
		alert("Please Enter A Phone Number!"); 
		dlform.phone.focus(); 
		return (false); 
	} 
	if (dlform.email.value.indexOf('@', 0) == -1) { 
		alert("Please Enter A Valid Email!"); 
		dlform.email.focus(); 
		return (false); 
	} 
	return (true); 
} 