// Russell Thompson
// Project: New Smyrna Beach Condo
// Page: JavaScript / AJAX code for gallery
// March, 2006
// Cross Browser System v1.0

// DECLARATIONS AND ASSIGNMENTS

var maxImages = 3;
var imageArray = new Array();
var directionsArray = new Array();

imageArray[0] = "../images/condo_map_01.jpg";
imageArray[1] = "../images/condo_map_02.jpg";
imageArray[2] = "../images/condo_map_03.jpg";

directionsArray[0] = "South on I-95<br />Traveling south (from Jacksonville, St. Augustine, etc.), take exit 249A.  This is the SR-44 / New Smyrna Beach exit and it will put you on SR-44 east bound.<br /><br />Follow SR-44 into New Smyrna Beach.  In New Smyrna Beach you will go over a train overpass - this will be the first 'bridge' you come to.  As you come down the east side of this overpass you will come to a double intersection [ <a class=\"pointer\" onclick=\"javascript:mapChange('map_03');\">see Map C</a> ].  Go straight through both intersections.  At this point you will be on Florida - A1A.<br /><br />Continue straight over the South Causeway and onto the island.  Go straight through three stoplight.  You are now on South Atlantic Avenue or CR - A1A.  Follow this for approximately 4.3 miles.  There are two more stoplight (the first is a cross-walk light at a beach access point, the other has a 7-11 on the corner), continue straight through these lights.  Oceanwalk Condominiums are on the right side of the road.<br /><br />There are 'gate signs' at the entrance of Oceanwalk.  If you find yourself at the Merritt Island Wildlife Refuge, you've gone just a few miles too far.";
directionsArray[1] = "North on I-95<br />Traveling north (from Miami, Fort Lauderdale, etc.) take exit 249.  This is the SR-44 / DeLand / New Smyrna Beach exit.  Stay right on the exit ramp and merge onto SR-44 East.<br /><br />Follow SR-44 into New Smyrna Beach.  In New Smyrna Beach you will go over a train overpass - this will be the first 'bridge' you come to.  As you come down the east side of this overpass you will come to a double intersection [ <a class=\"pointer\" onclick=\"javascript:mapChange('map_03');\">see Map C</a> ].  Go straight through both intersections.  At this point you will be on Florida - A1A.<br /><br />Continue straight over the South Causeway and onto the island.  Go straight through three stoplight.  You are now on South Atlantic Avenue or CR - A1A.  Follow this for approximately 4.3 miles.  There are two more stoplight (the first is a cross-walk light at a beach access point, the other has a 7-11 on the corner), continue straight through these lights.  Oceanwalk Condominiums are on the right side of the road.<br /><br />There are 'gate signs' at the entrance of Oceanwalk.  If you find yourself at the Merritt Island Wildlife Refuge, you've gone just a few miles too far.";
directionsArray[2] = "West Florida / I-4<br />From west Florida (the Tampa Bay area, Orlando, etc.) take I-4 East to exit 118.  This is the SR-44 / New Smyrna Beach exit.  At the end of the exit ramp, take East SR-44 - this is a left at the end of the ramp.<br /><br />Follow SR-44 into New Smyrna Beach.  In New Smyrna Beach you will go over a train overpass - this will be the first 'bridge' you come to.  As you come down the east side of this overpass you will come to a double intersection [ <a class=\"pointer\" onclick=\"javascript:mapChange('map_03');\">see Map C</a> ].  Go straight through both intersections.  At this point you will be on Florida - A1A.<br /><br />Continue straight over the South Causeway and onto the island.  Go straight through three stoplight.  You are now on South Atlantic Avenue or CR - A1A.  Follow this for approximately 4.3 miles.  There are two more stoplight (the first is a cross-walk light at a beach access point, the other has a 7-11 on the corner), continue straight through these lights.  Oceanwalk Condominiums are on the right side of the road.<br /><br />There are 'gate signs' at the entrance of Oceanwalk.  If you find yourself at the Merritt Island Wildlife Refuge, you've gone just a few miles too far.";
directionsArray[3] = "&nbsp;";


// PRE-LOAD THE IMAGES

for (var i = 0; i < maxImages; i++)
{
	eval ('pic' + i + ' = new Image();');
	eval ('pic' + i + '.src = imageArray[i];');
}

// DOCUMENT EVENTS

function mapChange(map)
{	
	switch (map)
	{
		case "map_01":
			document.mapImage.src = imageArray[0];
		break;
		
		case "map_02":
			document.mapImage.src = imageArray[1];
		break;

		case "map_03":
			document.mapImage.src = imageArray[2];
		break;
	}
}

function directionChange(directions)
{	
	switch (directions)
	{
		case "south_95":
			document.getElementById('directions').innerHTML = directionsArray[0];
		break;
		
		case "north_95":
			document.getElementById('directions').innerHTML = directionsArray[1];
		break;
		
		case "west_fl":
			document.getElementById('directions').innerHTML = directionsArray[2];
		break;
		
		case "clear":
			document.getElementById('directions').innerHTML = directionsArray[3];
		break;
	}
}

