/*These global variables and functions are needed for each unique instance of REQ2. To run your own version you must first get a 
Google Maps key http://code.google.com/apis/maps/signup.html and put it into the head of the html:
<script src= "YOUR GOOGLE MAPS KEY HERE" type="text/javascript"></script>
This key will only work on the domain that you register it to and on your local machine.


Author: Jon Connolly
Pacific Northwest Seismic Network, University of Washington
joncon@u.washington.edu
*/

//define map center and zoom level here by entering map lat and lon center and zoom level.
//the greater the zoom level the larger the scale
var mapParam = {
	lat: 45.07,
 	lon: -120.95,
	zoom: 6
};

//define event file path here. This is the file that comes from merge.xml
var eventXml = "xml/req2.xml";

//define authorative network code here. This will cause all network events to plot as 
// circles and all non- network events to plot as squares
var authorNW = "UW";

//webicorder types. This is an array of webicorder type names. These names must match the 
//names of the checkbox id in the html and the names of the webicorder xml files. In other words
//the codes assumes both the individual xml file and the coresponding checkbox have the same name.
//if checkbox has id ="something" then the xml file needs to be name "something.xml"
//edit out or add check boxes in html as needed. For the PNSN, these names match the naming scheme of the 
//html address where they live.

var webiNames = ['pnsn', 'bb', 'volc', 'smo_n', 'smo_sea', 'smo_s'];


//get links for event pages--including imports. Edit this file as needed. You must include all networks that are in your xml
//file--including the authoritative network. params: net = networkcode, id = event id as provided by QDDS
function getLink(net, id){
	if(net.toUpperCase() =="UW"){
	 	return "<a href = 'http://www.pnsn.org/recenteqs/Quakes/uw" + id + ".htm'>"
	}
	if(net.toUpperCase() =="US"){
	 return "<a href = 'http://earthquake.usgs.gov/eqcenter/recenteqsus/Quakes/us" + id +".php'>"
	}
	if(net.toUpperCase() == "NN"){
		return "<a href =' http://www.seismo.unr.edu/Catalog/nbe.html'>";
	}
	if(net.toUpperCase()=="NC"){
		return "<a href ='http://quake.wr.usgs.gov/recenteqs/Quakes/nc" + id + ".htm'>"
	}
}

//get links for the webicorder. Edit as needed. See webicorder xml schema for param names.
function getWebiLink(typ, nam, chan, net, time){
	var path = "http://www.pnsn.org/WEBICORDER/" + typ.toUpperCase() + "/" + nam + "_" + chan + "_" + net + "." + time;
	var img = "<img src =" + path + ".gif alt = 'Webicorder not available'/>";
	return "<a href=" + path  + ".html> Go to this Webicorder</a> <br/> " + img;
}