// SET VARIABLES 
var visibleLayer="disagree";
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
ns3up = (browserName == "Netscape" && browserVer >= 3);
ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4);
browsertext='Trojan Club Beach Cities';
window.status=browsertext;  // this sets the bottom text of the browser window 

// This funtion is used to hide layers
function layerToggle(layerName){
	//note that the layer name must be unique for any object on the page (you cannot
	//even have a button or field and a layer with the same name) 
	if (layerName == visibleLayer) return; //else continue execution
	if (document.layers) { //netscape 4
		l1 = eval("document.layers." + visibleLayer);
		l2 = eval("document.layers." + layerName);
		}
	else { //IE4 & up & Mozilla 5 & up
		l1 = eval("document.getElementById('" + visibleLayer + "')");
		l2 = eval("document.getElementById('" + layerName + "')");
		}
	l1.style.visibility = "hidden";
	l2.style.visibility = "visible";
	visibleLayer = layerName;
	
}//layerToggle

function statusnormal(){
// this resets the text on the bottom left of the browser window.
window.status=browsertext; 
return true;
}

function statuschange(newvalue){
window.status=newvalue; 
}

function newwin(path, height, width){
//This opens a pop up... define the size of it.
window.open(path,"Add","Height="+height+",Width="+width+", scrollbars=no");
}

function newaction(path, height, width,ID){
//Used as a confirmation before the variables are passed to the popup window.
if(confirm("Are you sure you want to delete ID "+ID+"?")){
		window.open(path,"Delete","Height="+height+",Width="+width);
	}
else{
	alert ("No action was taken.");
	}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function preloadImages() {
	var doc=document;
	if(doc.images){
		if(!doc.p)
			doc.p=new Array();
		var count,j=doc.p.length,a=preloadImages.arguments;
		for(count=0; count<a.length; count++)
			if (a[count].indexOf("#")!=0){
				doc.p[j]=new Image;
				doc.p[j++].src=a[count];
			}
	}
}


function submitRSVPform(form){
//checks the values of the RSVP form.
	if(form.eventDetails.value==""){
	alert('Please select an Event.');
	return false
	}

	if(form.firstName.value==""){
	alert('Please enter FIRST name.');
	return false
	}
	
	if(form.lastName.value==""){
	alert('Please enter LAST name.');
	return false
	}
	
	if(form.email.value==""){
	alert('Email is a REQUIRED field.');
	return false
	}

	var tempemail=form.email.value;

	if (tempemail.indexOf('@')==-1){
		alert('Valid Email address is required.');
	return false
	}
	
	if(form.email.value!=form.email2.value){
		alert('Email addresses do not match.');
		return false
	}


if((form.numGuests.value=="")||(isNaN(parseInt(form.numGuests.value)))){
	alert('Please check Number of Guests.');
	return false
	}
	
		else{
	return true
	}
}

function submitMAILform(form){
	if(form.firstName.value==""){
	alert('Please enter FIRST name.');
	return false
	}
	
	if(form.lastName.value==""){
	alert('Please enter LAST name.');
	return false
	}
	
	if(form.email.value==""){
	alert('Email is a REQUIRED field.');
	return false
	}

	var tempemail=form.email.value;

	if (tempemail.indexOf('@')==-1){
		alert('Valid Email address is required.');
	return false
	}
	
	if(form.email.value!=form.email2.value){
		alert('Email addresses do not match.');
		return false
	}

	if(form.addr.value==""){
	alert('Please enter ADDRESS.');
	return false
	}
	if(form.city.value==""){
	alert('Please enter CITY.');
	return false
	}
	if(form.zip.value==""){
	alert('Please enter ZIP.');
	return false
	}
	if(form.phone.value==""){
	alert('Please enter PHONE.');
	return false
	}
	
	else{
	return true
	}
}
 
		
function closeNGo(filename) 
{		
	parent.window.opener.location= filename;
	parent.close();
}
 
//-->