﻿//Global for deactivate
var deactivate = true;

//Show hide the info boxes
function showHideInfoBox(showMe) {
	for (i = 1; i <= 8; i++) {
		var meBoxHide = document.getElementById("showInfoBox" + i);
		if (meBoxHide) {
		    meBoxHide.style.display = "none";
		}
	}
	var meBoxShow = document.getElementById("showInfoBox" + showMe);
	meBoxShow.style.display = "block";
	

}

//Do the mouseover functions
function highlight_map(region, out) {


    if (deactivate == true) {
	    var LinkItem = document.getElementById("area_" + region);
	    var HighlightItem = document.getElementById("area_highlight");

	    if (!out) {
		    LinkItem.style.textDecoration = "underline";
		    HighlightItem.style.backgroundPosition = -200 * region + 'px 0px';
	    } else {
		    LinkItem.style.textDecoration = "none";
		    HighlightItem.style.backgroundPosition = "0px 0px";
	    }

	    showHideInfoBox(region);
	    return true;

    }
   }

   function disableMap() {
   	deactivate = false;
   }
   
   function hideMap() {
   	$(".map").hide();
   	$(".map").parent().hide();
	$(".map").parent().next().css({float: "left", width:"100%"});
   }


//Do the mouseover functions
function highlight_map_region(region, out) {

	if (deactivate == true) {

		deactivate = true;
		
    	var LinkItem = document.getElementById("area_" + region);
	    var HighlightItem = document.getElementById("area_highlight");

	    if (!out) {
		    LinkItem.style.textDecoration = "underline";
		    HighlightItem.style.backgroundPosition = -200 * region + 'px 0px';
	    } else {
		    LinkItem.style.textDecoration = "none";
		    HighlightItem.style.backgroundPosition = "0px 0px";
	    }
        
	    showHideInfoBox(region);
	    return true;
    }
    
	
}
