<!--

//This function divides the value of the island by 100 and uses the remainder function to calculate the degree of latitude. //The value of each island is made up of four figures which represent lon/lat.

function calLat(num)
	{
	tempNum=Math.round(num);
	lat=tempNum%100;
	if(lat<10)
		{
		lat=("0"+lat);
		}
	return(lat);
	}

//This function divides the value of the island by 100 and uses the integer function to calculate the degree of longitude. //The value of each island is made up of four figures which represent lon/lat.  ie barbados is 5913.  For more accurate results simply use six or eight figures to represent lon/lat and divide by 10000 or 100000.

function calLon(num)
	{
	tempNum=Math.round(num);
	lon=parseInt(tempNum/100);
	if(lon<0)
		{
		lon="0";
		}
	return(lon);
	}

/*This function passes the values from the form named "hurry" to the lat and lon functions.  the var lon becomes equal to the negative of lon since the caribbean is west of GMT/UT.  It then creates a var newWin with the url containing the vars calc in the two previous functions and the variables obtained from the values of the select options in the form named "hurry".  Other options can be chosen by adding appropriate fields to the form and passing their value to the function and incorporating them into the newWin Url using "&nameOfOption"+valueSelected+ which combines the javascript value with the html statement.*/



function pickMap(island, product, zoom, type)
	{
        lat=calLat(island);
	lon=(calLon(island)*-1);
	parent.picture.location.href = "http://www.ghcc.msfc.nasa.gov/cgi-bin/get-goes?satellite=GOES-E%20HURRICANE&lat="+lat+"&lon="+lon+"&zoom="+zoom+"&type="+type+"&info="+product+"&palette=spect.pal&width=450&height=450";
	}