//
// Define map spec as globals here
//

var mapArray = new Array(
		// new Map( Map Name, Image Location, Image Map name, "Parent Map Name, "Display Scale", "Array of Decorations Id tag" );
new Map("overview","./maps/sc_map_overview.png","#overviewmap","","Overview", new Array( "scaleBar1","insetTxt","insetImg" ) ),

new Map("citrus_county","./maps/sc_map_citrus_county.png","#citrus","overview","County", new Array( ) ),
new Map("south_lake_county","./maps/sc_map_south_lake_county.png","#south_lake","overview","County", new Array( ) ),
new Map("north_lake_county","./maps/sc_map_north_lake_county.png","#north_lake","overview","County", new Array( ) ),
new Map("levy_county","./maps/sc_map_levy_county.png","#levy","overview","County", new Array( ) ),
new Map("marion_county","./maps/sc_map_marion_county.png","#marion","overview","County", new Array( ) ),
new Map("hernando_pasco_county","./maps/sc_map_hernando_pasco_county.png","#hernando_pasco","overview","County", new Array( ) ),
new Map("north_sumter_county","./maps/sc_map_north_sumter_county.png","#north_sumter","overview","County", new Array( ) ),
new Map("south_sumter_county","./maps/sc_map_south_sumter_county.png","#south_sumter","overview","County", new Array( ) ),

new Map("north_lake_ul_quad","./maps/sc_map_north_lake_ul_quad.png","#detailmap","north_lake_county","Detail", new Array( ) ),
new Map("north_lake_ur_quad","./maps/sc_map_north_lake_ur_quad.png","#detailmap","north_lake_county","Detail", new Array( ) ),
new Map("north_lake_ll_quad","./maps/sc_map_north_lake_ll_quad.png","#detailmap","north_lake_county","Detail", new Array( ) ),
new Map("north_lake_lr_quad","./maps/sc_map_north_lake_lr_quad.png","#detailmap","north_lake_county","Detail", new Array( ) ),

new Map("south_lake_ul_quad","./maps/sc_map_south_lake_ul_quad.png","#detailmap","south_lake_county","Detail", new Array( ) ),
new Map("south_lake_ll_quad","./maps/sc_map_south_lake_ll_quad.png","#detailmap","south_lake_county","Detail", new Array( ) ),

new Map("citrus_ul_quad","./maps/sc_map_citrus_ul_quad.png","#detailmap","citrus_county","Detail", new Array( ) ),
new Map("citrus_ll_quad","./maps/sc_map_citrus_ll_quad.png","#detailmap","citrus_county","Detail", new Array( ) ),

new Map("marion_ul_quad","./maps/sc_map_marion_ul_quad.png","#detailmap","marion_county","Detail", new Array( ) ),
new Map("marion_ur_quad","./maps/sc_map_marion_ur_quad.png","#detailmap","marion_county","Detail", new Array( ) ),
new Map("marion_ll_quad","./maps/sc_map_marion_ll_quad.png","#detailmap","marion_county","Detail", new Array( ) ),
new Map("marion_lr_quad","./maps/sc_map_marion_lr_quad.png","#detailmap","marion_county","Detail", new Array( ) ),

new Map("north_sumter_ll_quad","./maps/sc_map_north_sumter_ll_quad.png","#detailmap","north_sumter_county","Detail", new Array( ) ),
new Map("north_sumter_lr_quad","./maps/sc_map_north_sumter_lr_quad.png","#detailmap","north_sumter_county","Detail", new Array( ) ),

new Map("south_sumter_ul_quad","./maps/sc_map_south_sumter_ul_quad.png","#detailmap","south_sumter_county","Detail", new Array( ) ),
new Map("south_sumter_ur_quad","./maps/sc_map_south_sumter_ur_quad.png","#detailmap","south_sumter_county","Detail", new Array( ) ),
new Map("south_sumter_lr_quad","./maps/sc_map_south_sumter_lr_quad.png","#detailmap","south_sumter_county","Detail", new Array( ) ),

new Map("hernando_pasco_ul_quad","./maps/sc_map_hernando_pasco_ul_quad.png","#detailmap","hernando_pasco_county","Detail", new Array( ) ),
new Map("hernando_pasco_ll_quad","./maps/sc_map_hernando_pasco_ll_quad.png","#detailmap","hernando_pasco_county","Detail", new Array( ) )

		);

var aMapControl = new MapControl( "mapCanvas", mapArray );

aMapControl.setZoomScales( new Array( "Overview","County","Detail" ) );

// zoom control custom objects
var emptyImg = new Image();
emptyImg.src = "./images/empty.png";
var activeImg = new Image();
activeImg.src = "./images/bullet.gif";

aMapControl.setBlankImg( emptyImg );
aMapControl.setPointImg( activeImg );


function loadMaps()
{

	aMapControl.updateZoomControl("Overview");
	aMapControl.setMap("overview");
}

// HIGHLIGHT FUNCTIONS
// check for browser support highlighting is only available for IE 6+
var detect = navigator.userAgent.toLowerCase();

function checkIt(string)
{

	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
function browserSupported()
{
	// checks if msie and version is higher than 5
	return ( checkIt("msie") && detect.charAt(place + thestring.length) > 5 )
}
function highlight( anImagePath )
{
	if( !browserSupported() )
		return;

	var anImg = document.getElementById( 'mapHighlight' );

	anImg.style.visibility = 'visible';
	anImg.src = anImagePath;
}
function unHighlight()
{
	if( !browserSupported() )
		return;

	var anImg = document.getElementById( 'mapHighlight' );
	anImg.style.visibility = 'hidden';
}