// Definitions - all the numbers and definitions for the OceanMAPS products Javascript
var GlobalCode="IDYOC";
var GlobalRegion=getQueryVariable("region");
var GlobalForecastType=getQueryVariable("forecast");
var GlobalName;
var GlobalForecastName;
var GlobalFileType=".jpg";
var GlobalPlaying = 'No';
var interval = 1000;
var AnimPlaying = 0;

switch (GlobalRegion) {
	case "10":
		GlobalName="South Western Australia";
		break;
	case "11":
		GlobalName="North Western Australia";
		break;
	case "12":
		GlobalName="Northern Territory";
		break;		
	case "13":
		GlobalName="Queensland";
		break;
	case "14":
		GlobalName="New South Wales";
		break;
	case "15":
		GlobalName="Victoria/Tasmania";
		break;		
	case "17":
		GlobalName="South Australia";
		break;
	case "18":
		GlobalName="Cocos (Keeling) Islands";
		break;
	case "19":
		GlobalName="Christmas Island";
		break;
	case "20":
		GlobalName="Lord Howe Island";
		break;
	case "21":
		GlobalName="Macquarie Island";
		break;
	case "22":
		GlobalName="Norfolk Island";
		break;
	default: GlobalName="Unknown Region";
}

switch (GlobalForecastType) {
	case "1":
		GlobalForecastName="Sea surface temperature";
		break;
	case "2":
		GlobalForecastName="Sea surface temperature and currents";
		break;
	case "3":
		GlobalForecastName="Sea level anomaly";
		break;		
	case "4":
		GlobalForecastName="Sea level anomaly and currents";
		break;
	case "5":
		GlobalForecastName="Sea surface salinity";
		break;	
	default: GlobalForecastName="Unknown Forecast Type";
}

function getQueryVariable(variable) {
		var query = window.location.search.substring(1);
		var vars = query.split("&");
		for (var i=0;i<vars.length;i++) {
			var pair = vars[i].split("=");
			if (pair[0] == variable) {
				return pair[1];
				}
			}
	alert('Query Variable ' + variable + ' not found');
	}
