
var arAreas = Array();
arAreas["Perdido Key"] = Array("Harbour Pointe","Palacio","River Colony","Spanish Key");
arAreas["Fort Walton Beach"] = Array("Waterscape","Island Echos","Islander Beach Resort","Bella Riva","Harbour Pointe","Heron at Destin West");
arAreas["Destin"] = Array("Avalon Dunes","Beach House","Crescent","Crystal Sands","Crystal Villas","Emerald Shores","Gulfview","Gulfview II","Leeward Key","Nantucket Cottages","Sundestin","Captiva at Tops'l","Tops'l Master Association","The Summit at Tops'l","Sierra Dunes at Tops'l","Tops'l Tennis Village");
arAreas["Beaches of South Walton"] = Array("Dunes of Seagrove","High Pointe Resort");
arAreas["Panama City Beach"] = Array("Sunrise Beach","Seychelles","Tidewater Beach Resort");
function vdsFillOptCommunity(areaName){
	if(areaName == 'Ft Walton Beach & Okaloosa Island'){
		areaName = 'Fort Walton Beach';
	}
        for(i=document.frmCommunity.Community.options.length -1;i>=0;i--){
                document.frmCommunity.Community.options[i] = null;
        }
        document.frmCommunity.Community.options[0] = new Option("Any","",true,true);
        if(arAreas[areaName] == null){
                document.frmCommunity.Community.options[0].text = "N/A";
        }else if(arAreas[areaName].length == 0){
                document.frmCommunity.Community.options[0].text = "N/A";
        }else{
                for(i=0;i<arAreas[areaName].length;i++){
                        document.frmCommunity.Community.options[i +1] = new Option(arAreas[areaName][i],arAreas[areaName][i]);
                }
        }
}
function vdsSendCommunityLink()
{
	var vdsLink = '';
	var area = document.frmCommunity.area.options[document.frmCommunity.area.selectedIndex].value;
	if(area == 'Ft Walton Beach & Okaloosa Island'){
		area = 'Fort Walton Beach';
	}
	var community = document.frmCommunity.Community.options[document.frmCommunity.Community.selectedIndex].value;
	area = area.replace(/\W/g,'-');
	area = area.toLowerCase();
	community = community.replace(/\W/g,'-');
	community = community.toLowerCase();
	if(area && community){
		vdsLink = '/nwfl/'+area+'/'+community+'/index.htm';
		document.location.href=vdsLink;
	}else{
		if(area){
			alert('You must choose a Community');
		}else{
			alert('You must choose an Area');
		}
	}
}

