// JavaScript Document

function resizeOuterTo(w,h) {
 if (parseInt(navigator.appVersion)>3) {
   if (navigator.appName=="Netscape") {
    top.outerWidth=w;
    top.outerHeight=h;
	
   }
   else top.resizeTo(w,h);

 }
}

	
// checks resolution
this.screenWidth = this.screen.width


function reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {
	  
	  if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; 
	}
	
	} else if (innerWidth!=document.pgW || innerHeight!=document.pgH) {location.reload()};
}
reloadPage(true);
//-->

// popup
function popme(mypage, myname, w, h, s) 
	{
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+s+',resizable=false'
		win = window.open(mypage, myname, winprops)
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}

	var h = '::::: PLEASE NOTE :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\n\n';
	var b = '\n\n::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::';
	
function contactUs(){
	var da = document.contactForm

		
		 if( da.contactPerson.value=='')
		{	
		alert(h + 'Please enter the name of a contact person.' + b);
		da.contactPerson.select();
		}
		else if(da.message.value=='')
		{
		alert(h + 'Please enter a message.' + b)
		da.message.select();
		}
		else if(da.areaCode.value!='' && isNaN(da.areaCode.value))
		{
		alert(h + 'Please enter a valid area code.' + b)
		da.areaCode.select();
		}		
		else if(isNaN(da.phone.value) || isNaN(da.cell.value) || isNaN(da.fax.value))
		{
		alert(h + 'Please enter a valid number.' + b)
		
			if(isNaN(da.phone.value)){da.phone.select();}
			if(isNaN(da.cell.value)){da.cell.select();}
			if(isNaN(da.fax.value)){da.fax.select();}
			
		}		
		else if(da.email.value=='')
		{
		alert(h + 'Please enter your e-mail address.' + b)
		da.email.focus();
		}
		else if(da.email.value.indexOf('@',0)==-1 || da.email.value.indexOf('.',0)==-1)
		{
		alert(h + 'Please enter a valid e-mail address.' + b)
		da.email.select();
		}
		else
		{
		if(confirm(h + "Send this form?" + b)){
		//da.action="contactUs_procc.asp";
		//da.method="post";
		da.submit()
		}
		}
		
		}
		
function goBooking(){
	var da = document.bookingForm

		
		 if( da.realname.value=='')
		{	
		alert(h + 'Please enter the name of a contact person.' + b);
		da.realname.select();
		}
		else if(isNaN(da.phone.value) || isNaN(da.cell.value) || isNaN(da.fax.value))
		{
		alert(h + 'Please enter a valid number.' + b)
		
			if(isNaN(da.phone.value)){da.phone.select();}
			if(isNaN(da.cell.value)){da.cell.select();}
			if(isNaN(da.fax.value)){da.fax.select();}
			
		}		
		else if(da.email.value=='')
		{
		alert(h + 'Please enter your e-mail address.' + b)
		da.email.focus();
		}
		else if(da.email.value.indexOf('@',0)==-1 || da.email.value.indexOf('.',0)==-1)
		{
		alert(h + 'Please enter a valid e-mail address.' + b)
		da.email.select();
		}
		else
		{
		if(confirm(h + "Send this form?" + b)){
		//da.action="booking_procc.asp";
		//da.method="get";
		da.submit()
		}
		}
		
		}