﻿<!--
var whatForm, whatTo, whatText;

function selectLocation(destination,location,development) {

	var found = 0;
    whatTo = document.forms['mainform'].elements['Destination'];
	for(i=0;i<whatTo.length;i++) {
		if ( whatTo.options[i].value == destination ) {
			found = i;
			break;
		}		
	}
    whatTo.options[found].selected = true;	
    destreshow(found);

	var found = 0;
    whatTo = document.forms['mainform'].elements['Location'];
	for(i=0;i<whatTo.length;i++) {
		if ( whatTo.options[i].value == location ) {
			found = i;
			break;
		}		
	}
    whatTo.options[found].selected = true;	
    reshow(found);
    
    found = 0;
    whatTo = document.forms['mainform'].elements['Development'];
	for(i=0;i<whatTo.length;i++) {
		if ( whatTo.options[i].value == development ) {
			found = i;
			break;
		}		
	}
    whatTo.options[found].selected = true;	
    
}

function reshow(number) {
    whatFrom = document.forms['mainform'].elements['Location'];
    number++;
    whatTo = document.forms['mainform'].elements['Development'];

    for (var i = whatTo.length;i > 0;i--)
        whatTo.options[0] = null;

    whatText = whatFrom.options[whatFrom.selectedIndex].value;

    showDevelopments();

    return false;
}

function destreshow(number) {
    whatFrom = document.forms['mainform'].elements['Destination'];
    number++;
    whatTo = document.forms['mainform'].elements['Location'];

    for (var i = whatTo.length;i > 0;i--)
        whatTo.options[0] = null;

    whatText = whatFrom.options[whatFrom.selectedIndex].value;

	showLocations();
    showDevelopments();

    return false;
}

function opt(href,text) {
    var optionName = new Option(text, href, false, false)
    var length = whatTo.length;
    whatTo.options[length] = optionName;
}
function showDestination() {
whatTo = document.forms['mainform'].elements['Destination'];
opt('Los Cabos','Los Cabos, Mexico');
opt('Hawaii','Hawaii');
}
function showLocations() {
whatTo = document.forms['mainform'].elements['Location'];
if (whatText == 'Los Cabos') {
opt('All','Locations (All)');
opt('Cabo San Lucas','Cabo San Lucas');
opt('Corridor','Corridor');
opt('East Cape','East Cape');
opt('La Paz','La Paz');
opt('San Jose del Cabo','San Jose del Cabo');
opt('Punta de Mita','Punta de Mita');
}

if (whatText == 'Hawaii') {
opt('All','Locations (All)');
opt('Maui','Maui');
}

}

function showDevelopments() {
if (whatText == 'All') {
opt('All','Developments (All)');
}
if (whatText == 'Maui') {
opt('All','Developments (All)');
opt('Wailea','Wailea');
opt('Wailea','Wailea');
}

if (whatText == 'Cabo San Lucas') {
opt('All','Developments (All)');
opt('Cabo Bello','Cabo Bello');
opt('Hacienda','Hacienda');
opt('Pedregal','Pedregal');
opt('Punta Ballena','Punta Ballena');
opt('Santa Carmella','Santa Carmella');
opt('Villa La Estancia','Villa La Estancia');
}

if (whatText == 'Corridor') {
opt('All','Developments (All)');
opt('Blue Sea','Blue Sea');
opt('Cabo Colorado','Cabo Colorado');
opt('Cabo del Sol','Cabo del Sol');
opt('Cabo Real','Cabo Real');
opt('Cerro Colorado','Cerro Colorado');
opt('Chileno Bay','Chileno Bay');
opt('Costa Brava','Costa Brava');
opt('El Tezal','El Tezal');
opt('El Tule','El Tule');
opt('Las Ventanas','Las Ventanas');
opt('Palmilla','Palmilla');
opt('Punta Bella','Punta Bella');
opt('Querencia','Querencia');
}

if (whatText == 'East Cape') {
opt('All','Developments (All)');
opt('Zacatitos','Zacatitos');
}

if (whatText == 'La Paz') {
opt('All','Developments (All)');
opt('Bahia de los Suenos','Bahia de los Suenos');
}

if (whatText == 'San Jose del Cabo') {
opt('All','Developments (All)');
opt('Costa Azul','Costa Azul');
opt('El Encanto','El Encanto');
opt('El Zalate','El Zalate');
opt('La Jolla','La Jolla');
opt('Laguna Hills','Laguna Hills');
opt('Las Mananitas','Las Mananitas');
opt('Mykonos','Mykonos');
opt('Privadas','Privadas');
opt('Puerto Los Cabos','Puerto Los Cabos');
opt('Sampaguita','Sampaguita');
}

if (whatText == 'Punta de Mita') {
opt('All','Developments (All)');
opt('La Punta Estates','La Punta Estates');
opt('Real del Mar','Real del Mar');
}

}

//-->

