<!--
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.01
  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 && d.getElementById) x=d.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 validEmail(email) {
	invalidChars = " /:,;";

	if (email == "") { return false; }
	
	for (i=0; i<invalidChars.length; i++) {		// does it contain any invalid chars?
		badChar = invalidChars.charAt(i);
		if (email.indexOf(badChar,0) > -1) { return false; }
	}
	
	atPos = email.indexOf("@",1);               // there must be one "@" symbol?
	
	if (atPos == -1) { return false; }
	
	if (email.indexOf("@",atPos+1) != -1) { return false; }
	
	periodPos = email.indexOf(".",atPos)       // and at least one "." after the "@"
	
	if (periodPos == -1) { return false; }
	
	if (periodPos+3 > email.length) { return false; }
	
	return true;
}

function itemChecked(radioitem) {
	checkeditem = -1;
	for (i=0; i<radioitem.length; i++)	{
			if (radioitem[i].checked) {
				checkeditem = i;
			}
	}
	
	if (checkeditem == -1)	{ return false; }
	
	return true;
}

function toggleInvoice() {

	if ( document.res.seats.selectedIndex < 5 && document.res.tables.selectedIndex == 0 ) {
		 document.res.payment[0].checked = true;
		 document.res.payment[1].disabled = true; }
	if ( document.res.seats.selectedIndex >= 5 || document.res.tables.selectedIndex > 0 ) {
		 document.res.payment[1].disabled = false; } }

//Toggle between member and non-member
function toggleMembership() {
	if ( document.res.membership[0].checked ) {
		 document.res.nonfsacompany.value = ""
		 document.res.nonfsacompany.disabled = true
		 document.res.fsacompany.disabled = false
	} else {
		 document.res.fsacompany.selectedIndex = 0
		 document.res.fsacompany.disabled = true
		 document.res.nonfsacompany.disabled = false } }

//Calculating the reservation
function displayprice() {
	
	var vSeats = document.res.seats.value;
	var vTables = document.res.tables.value;
	
	if ( document.res.membership[0].checked ) {
	vTotal = (vSeats * 200) + (vTables * 1950);
	} else { 
	vTotal = (vSeats * 250) + (vTables * 2450); }
	
	document.res.res_seats.value = (vSeats * 1) + (vTables * 10);
	document.res.res_total.value = "$" + vTotal; }

//Checking the form values
function checkForm(form) {
	
	if ( form.first_name.value == "" ) {
		alert("Please indicate your FIRST NAME");
		res.first_name.focus();
		return false; }

	if ( form.last_name.value == "" ) {
		alert("Please indicate your LAST NAME");
		res.last_name.focus();
		return false; }

	if ( form.title.value == "" ) {
		alert("Please indicate your JOB TITLE");
		res.title.focus();
		return false; }
	
	if ( !itemChecked(form.membership) ) {
		alert("Please indicate your GSA MEMBERSHIP STATUS");
		res.membership[0].focus();
		return false; }

	if ( form.membership[0].checked && form.fsacompany[0].selected ) {
		alert("Please indicate your COMPANY");
		res.fsacompany.focus();
		return false; }

	if ( !form.membership[0].checked && form.nonfsacompany.value == "" ) {
		alert("Please indicate your COMPANY NAME");
		res.nonfsacompany.focus();
		return false; }

	if ( form.co_type.selectedIndex == 0 ) {
		alert("Please indicate your COMPANY TYPE");
		res.co_type.focus();
		return false; }

	if ( form.address1.value == "" ) {
		alert("Please indicate your ADDRESS");
		res.address1.focus();
		return false; }

	if ( form.city.value == "" ) {
		alert("Please indicate your CITY");
		res.city.focus();
		return false; }
	
	if ( form.phone.value == "" ) {
		alert("Please indicate your PHONE NUMBER");
		res.phone.focus();
		return false; }
			
	if (!validEmail(form.email.value)) {
		alert("Invalid email address");
		res.email.focus();
		res.email.select();
		return false; }
	
	if ( form.OSfirst_name.value == "" ) {
		alert("Please indicate the FIRST NAME of the Contact");
		res.OSfirst_name.focus();
		return false; }

	if ( form.OSlast_name.value == "" ) {
		alert("Please indicate the LAST NAME of the Contact");
		res.OSlast_name.focus();
		return false; }

	if ( form.OStitle.value == "" ) {
		alert("Please indicate the JOB TITLE of the Contact");
		res.OStitle.focus();
		return false; }
	
	if ( form.OScompany.value == "" ) {
		alert("Please indicate the COMPANY of the Contact");
		res.OScompany.focus();
		return false; }
		
	if ( form.OSphone.value == "" ) {
		alert("Please indicate the PHONE NUMBER of the Contact");
		res.OSphone.focus();
		return false; }
			
	if (!validEmail(form.OSemail.value)) {
		alert("Invalid email address");
		res.OSemail.focus();
		res.OSemail.select();
		return false; }

	if ( (form.seats[0].selected) && (form.tables[0].selected) ) {
		alert("Please specify how many reservations you would like");
		res.seats.focus();
		return false; }

	return true;

}

//-->