
//function getinfo (station)
//	  Act upon a weather station click event
//	  Displays weather station data an iframe that has the name and id of "reports"
//	  Displays a cam image (if available) in the DIV tag with id "thumb".  The cam image is a link to a MoT page.
//	  REQUIRES: datafile to be loaded (included) by host page that defines the following data structure:
//	  	Stations = {
//	  		stationid : [station_url, cam_thumb_url, Mot_page_url],
//	  			....
//	  	}
//	  
//	  IN: station = station ID
//   RETURNS: nothing
//   SIDE: as above
//	  REQUIRES:
//		an IFRAME with both the name and the id attributes to be set to "reports".
//		a DIV with the id attribute of "thumb".
//		datafile to be loaded (included) by host page that defines the following data structure:
//	  		Stations = {
//	  			stationid : [station_url, cam_thumb_url, Mot_page_url],
//	  				....
//	  		}
//	  
//	  Called from ActionScript by:
//	  	import flash.external.*;
//	  	  ... 
//	  	var localfunctionreference:String = "getinfo";
//	  	ExternalInterface.call(localfunctionreference, stationid);

var theWin = '';

//function getinfo (station) {
////	alert ("GETINFO :: Have station: " station);
//	var cam_div = document.getElementById('thumb');
//	var weatherblurb = Stations[station][0];
//	var thumbimg = Stations[station][1];
//	var camurl = Stations[station][2];
//	
//	frames['reports'].location.href = weatherblurb;	// set url for IFRAME  - points to weather station data
//
//	var camstring;
//	if (thumbimg == undefined) { // no thumb image
//		camstring = "";
//	}
//	else {		                // We have a thumb image
//		camstring = "<a href=\"" + camurl  + "\" target=\"_blank\"><img width=\"140\" src=\"" +  thumbimg + "\"/></a>";
//	}
//	cam_div.innerHTML = camstring;
//}
//////////////////////////////////////////////////////////////

//function doaHighway (URL)
// Open a browser window to a specified URL
// IN: 	URL = the url to open in the new window.
// OUT: 	no return value of relevance
// SIDE:	any previously opened windows with the name "_winner" will be closed before a new window is opened.
//			when the new window opens, the focus is explicitely made to the new window.
//	NOTE:	This function may genreate a pop-up warning in some browsers.

function doaHighway (URL) {
	if (!theWin.closed && theWin.location) {
		theWin.close();
	}
	theWin=window.open(URL, "_winner", "top=10, left=10, resizable=yes, scrollbars=yes, menubar=no, location=no, toolbar=no");
	if (!theWin.opener) {
		theWin.opener = self;
	}
	if (window.focus) {theWin.focus(); }
	return false;
}

function doaWxStn (station_id) {
	if (!theWin.closed && theWin.location) {
		theWin.close();
	}
	theWin=window.open(Stations[station_id][0], "_winner", "top=10, left=10, resizable=yes, scrollbars=yes, menubar=no, location=no, toolbar=no");
	if (!theWin.opener) {
		theWin.opener = self;
	}
	if (window.focus) {theWin.focus(); }
	return false;
}




