// JavaScript Document



function goAirport() {
	if (document.forms[0].rbtnLanguage[0].checked) {
		top.location.href="airport/en/index.htm";
	} else {
		if (document.forms[0].rbtnLanguage[1].checked) {
			top.location.href="airport/en/index.htm";		
		} else {
			if (document.forms[0].rbtnLanguage[2].checked) {
				top.location.href="airport/nl/index.htm";		
			} else {
				window.alert("Please make your language selection");
			}
		}
	}
}

function goGarita() {
	if (document.forms[0].rbtnLanguage[0].checked) {
			top.location.href="lagarita/en/index.htm";			
	} else {
		if (document.forms[0].rbtnLanguage[1].checked) {
			top.location.href="lagarita/en/index.htm";			
		} else {
			if (document.forms[0].rbtnLanguage[2].checked) {
				top.location.href="lagarita/nl/index.htm";			
			} else {
				window.alert("Please make your language selection");
			}
		}
	}
}

function writeLegend(vLegend) {
	document.write(vLegend);
}

// parameters affecting the look
tHeaderBGColor 	= "#6D763D"; // #ffcc00
tFontSize 		= "2";
tCellPadding	= "4";
tCellSpacing	= "0";
tBorder			= "1";


function showTables() {
	displayTable(headerTitles, tData);
//	displayTable(headerTitles2, tData2);
}


function displayTable(vHeader, vDetail, vCols, vRows)  {
	document.write("<table border=" + tBorder
		+ " cellspacing=" + tCellSpacing
		+ " cellpadding=" + tCellPadding + ">")

	// print header
	document.write("<tr valign=top bgcolor='" + tHeaderBGColor + "'>");
	for (var i = 0;i < vCols; i++) {
		document.write("<td valign=top>"
			+ "<font size=" + tFontSize + ">" + vHeader[i] + "</font></td>");
	}
	document.write('</tr>');
	displayHRow(vDetail, vCols, vRows);
	document.write('</table>');
} // end function


function displayHRow(vDetail, vCols, vRows) {
	// does one row of the table, in horizontal view orientation
	for (var i = 0; i< vRows; i++) {
		document.write('<tr valign=top>');

		for (var j = 0;j < vCols; j++) {
			document.write("<td valign=top>"
				+ "<font size=" + tFontSize + ">"
				+ vDetail[(i * vCols) + j]
				+ "</font></td>");
		}
		document.write('</tr>');
	}
} // end function

// show Popup
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

// Valida formulario de contact us
function validateContactForm()
{
	if (document.frm.nombre.value == "") {
		document.frm.nombre.focus();
		window.alert("Please write your name.");
	} else {
		if (document.frm.email.value == "") {
			document.frm.email.focus();
			window.alert("Plase write your e-mail address.");
		} else {
			document.frm.submit();
		}
	}
}

function validateRoomReservationForm()
{
	if (document.frmMain.edFirstName.value == "") {
		document.frmMain.edFirstName.focus();
		window.alert("Please write your name");
	} else {
		if(document.frmMain.edLastName.value == "") {
			document.frmMain.edLastName.focus();
			window.alert("Please write your last name");
		} else {
			if (document.frmMain.edEmail.value == "") {
				document.frmMain.edEmail.focus();
				window.alert("Please write your e-mail address");
			} else {
				if (document.frmMain.edPhone.value == "") {
					document.frmMain.edPhone.focus();
					window.alert("Please write your phone number");
				} else {
					document.frmMain.submit();
				}
			}
		}
	}
}


// Validad Reservation Form - Car Rental
function validateReservationForm()
{
	if (document.frmMain.edName.value == "") {
		document.frmMain.edName.focus();
		window.alert("Please write your name");
	} else {
		if (document.frmMain.edEmail.value == "") {
			document.frmMain.edEmail.focus();
			window.alert("Please write your e-mail");
		} else {
			document.frmMain.submit();
		}
	}	
}

// Valida Quotation Form
function validateQuotationForm() 
{
	if (document.frmMain.edName.value == "") {
		document.frmMain.edName.focus();
		window.alert("Please write your name");
	} else {
		if (document.frmMain.edEmail.value == "") {
			document.frmMain.edEmail.focus();
			window.alert("Please write your e-mail");
		} else {
			document.frmMain.submit();
		}
	}
}

	