﻿// JScript File

// Author: I. D'Anna
// Sep 2009

// Objective:
// functions to show and hide div tags which provide functionality such as hotspot targets and table formatted data


// On load of the Web page display all hotspots available for user selection for a few moments, the hide them
function OnStartDisplay(totalTargets)
{
var t1=setTimeout("document.getElementById('ProximityTarget1').style.display='none'",600);
var t2=setTimeout("document.getElementById('ProximityTarget2').style.display='none'",800);
}

// When the mouse enters a target zone, show the target hotspot to persuade the user to the hotspot
function showProximityTarget(ID,total)
{
	i=1;
	for(i;i<=total;i++)
	{
		if(i != ID)
		{
			document.getElementById("ProximityTarget"+i).style.display="none";
		}
		else
		{
			document.getElementById("ProximityTarget"+ID).style.display="block";
		}
	}
}

function HideProximityTarget(ID)
{	    
       	document.getElementById("ProximityTarget"+ID).style.display="none";
}


// Show user selected (onmouseover) popup table and hide all others
// Parameters: 
//	ID	- current target selected by user
//	total	- total number of targets on Web page
function showPopUp(ID,total)
{
	i=1;
	for(i;i<=total;i++)
        {
        	if(i != ID)
		//hide all other divs if not user selected (ID)
            	{
	        	document.getElementById("LocContents"+i).style.display="none";
		}
            	else
		//show the user selected div (ID)
	        {
	                document.getElementById("LocContents"+ID).style.display="block";
        	}
	}
}


function closePopUp(ID)
{
	document.getElementById("LocContents"+ID).style.display="none";
}