image1 = new Image();
image1.src = "images/content_law_selected.jpg";

image2 = new Image();
image2.src = "images/content_power_selected.jpg";

image3 = new Image();
image3.src = "images/content_dock_selected.jpg";

image4 = new Image();
image4.src = "images/content_sign_selected.jpg";

image5 = new Image();
image5.src = "images/content_grass_selected.jpg";

image6 = new Image();
image6.src = "images/content_manatees_selected.jpg";

image7 = new Image();
image7.src = "images/content_water_selected.jpg";

image8 = new Image();
image8.src = "images/content_boating_selected.jpg";						

var ids=new Array('law_selected', 'power_selected', 'dock_selected', 'sign_selected', 'grass_selected', 'manatees_selected', 'water_selected', 'boating_selected');
var scrollids=new Array('scrollbox_wrapper', 'scrollbox_wrapper_law', 'scrollbox_wrapper_power', 'scrollbox_wrapper_dock', 'scrollbox_wrapper_sign', 'scrollbox_wrapper_grass', 'scrollbox_wrapper_manatees', 'scrollbox_wrapper_water', 'scrollbox_wrapper_boating', 'scrollbox_wrapper_map');
var currentscrollid='scrollbox_wrapper';

function law(){
	switchid('law_selected');
	switchscrollid('scrollbox_wrapper_law');
	currentscrollid='scrollbox_wrapper_law';
	fadeIn('law_selected');
}

function power(){
	switchid('power_selected');
	switchscrollid('scrollbox_wrapper_power');
	currentscrollid='scrollbox_wrapper_power';
	fadeIn('power_selected');
}

function dock(){
	switchid('dock_selected');
	switchscrollid('scrollbox_wrapper_dock');
	currentscrollid='scrollbox_wrapper_dock';
	fadeIn('dock_selected');
}

function sign(){
	switchid('sign_selected');
	switchscrollid('scrollbox_wrapper_sign');
	currentscrollid='scrollbox_wrapper_sign';
	fadeIn('sign_selected');
}

function grass(){
	switchid('grass_selected');
	switchscrollid('scrollbox_wrapper_grass');
	currentscrollid='scrollbox_wrapper_grass';
	fadeIn('grass_selected');
}

function manatees(){
	switchid('manatees_selected');
	switchscrollid('scrollbox_wrapper_manatees');
	currentscrollid='scrollbox_wrapper_manatees';
	fadeIn('manatees_selected');
}

function water(){
	switchid('water_selected');
	switchscrollid('scrollbox_wrapper_water');
	currentscrollid='scrollbox_wrapper_water';
	fadeIn('water_selected');
}

function boating(){
	switchid('boating_selected');
	switchscrollid('scrollbox_wrapper_boating');
	currentscrollid='scrollbox_wrapper_boating';
	fadeIn('boating_selected');
}

function map(){
	if(mouseover) {
		switchscrollid('scrollbox_wrapper_map');
	}
}

function showcurrentscrollid(){
	switchscrollid(currentscrollid);	
}

function switchid(id){	
	hideallids();
	showdiv(id);
}

function switchscrollid(id){	
	hideallscrollids();
	showdiv(id);
}
	
function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hideallscrollids(){
	//loop through the array and hide each element by id
	for (var i=0;i<scrollids.length;i++){
		hidediv(scrollids[i]);
	}		  
}
	
function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}	

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
		}
	}
}

var mouseover = false;

function mouseoverStart() {
	mouseover = true;	
	switchMap();
}

function mouseoverEnd() {
	mouseover = false;
}

function switchMap() {
	setTimeout("map()", 500);
}