//Google Maps API and Events Ticker JS Functions
//John Driftmier, http://www.treenumbertwo.com
//January 2009
//
//This document hold all of the required functions for the Event Ticker and the Google Maps API.
//Note that all these were written for EXODUS -- the core files needed to run the Google Maps API are
//hosted directly on Google's site and referenced to at the top of index.html.


//Google Maps Functions-------------------------------------------------------------------
//Basically for use in setting up the points on the map-----------------------------------

  // A function to create the marker for the Google Maps API
  function createMarker(point,name,html) {
	var marker = new GMarker(point);
	GEvent.addListener(marker, "click", function() {
	  marker.openInfoWindowHtml(html);
	});
	gmarkers.push(marker);
	return marker;
  }
  
// This function picks up the click and opens the corresponding info window. Easier than using GEvent every time, also works better with the list randomizer. go figure.
      function myclick(i) {
        GEvent.trigger(gmarkers[i], "click");
      }


//Events Ticker Functions-----------------------------------------------------------
//----------------------------------------------------------------------------------

//starts the ticker, also decides which method to use depending on browser.
function start() {
		if (document.all) iemarquee(ticker);
		else if (document.getElementById)
				ns6marquee(document.getElementById('ticker'));
}

//methods to use depending on browser type
function iemarquee(whichdiv){
		iediv=eval(whichdiv)
		sheight += 50;
		iediv.style.pixelTop=sheight
		iediv.innerHTML=msg 
		sizeup=iediv.offsetHeight
		ieslide()
}

function ieslide(){
		if (iediv.style.pixelTop>=sizeup*(-1)){
				iediv.style.pixelTop-=sspeed
				setTimeout("ieslide()",100)
		}
		else{
				iediv.style.pixelTop=sheight
				ieslide()
		}
}

function ns6marquee(whichdiv){
		ns6div=eval(whichdiv)
		sheight += 50;
		ns6div.style.top=sheight + "px";
		ns6div.innerHTML=msg
		sizeup=ns6div.offsetHeight
		ns6slide()
}
function ns6slide(){
		if (parseInt(ns6div.style.top)>=sizeup*(-1)){
				theTop = parseInt(ns6div.style.top)-sspeed
				ns6div.style.top = theTop + "px";
				setTimeout("ns6slide()",100)
		}
		else {
				ns6div.style.top = sheight + "px";
				ns6slide()
		}
}