<!--
// global variables
var overlays = [];
var current = null;
var mapCtrl = null;
var nwsOverlay = null;

var centerPxl;

function thisMovie(movieName) {
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document[movieName];
}

//URL monitoring
function AJ() {
	var obj;
	if (window.XMLHttpRequest) obj= new XMLHttpRequest(); 
	else if (window.ActiveXObject){
		try{
			obj= new ActiveXObject('MSXML2.XMLHTTP.3.0');
		}
		catch(er){
			try{
				obj= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(er){
				obj= false;
			}
		}
	}
	return obj;
}

function isThere(url) {
	var req= new AJ(); // XMLHttpRequest object
	try {
		req.open("HEAD", url, false);
		req.send(null);		
		return req.status== 200 ? true : false;
	}
	catch (er) {
		return false;
	}
}

function init(alat, alon, z)
{
	
	if (!GBrowserIsCompatible()) {
		alert("Sorry, the Google Maps API is not compatible with this browser");
		return;
	}

	//start coordinates
	var lat = alat ? alat : 40;//25.8;
	var lon = alon ? alon : -90;// -80.3;
	var zoom = z ? z : 3;
	//alert(lat + " " + lon);
	
	//create the map
	mapCtrl = new GMap2(document.getElementById("map"));
	mapCtrl.setCenter(new GLatLng(lat, lon), zoom );
	Map_Hybrid();
	
	//calculate bounds
	
	//initialize radar
	thisMovie("WeatherRadar").initRadar(); 
	//alert( bounds.getCenter().lat() + " " +  bounds.getCenter().lng() + " " +   lngdiff + " " +   latdiff);
	//thisMovie("WeatherRadar").initRadar(zoom);
	//thisMovie("WeatherRadar").updateBounnds(minlat,maxlat,minlng,maxlng);
        
}

// NWS Bulletins overlay controls
function gmAddNWSOverlay()
{
	//if ( nwsOverlay != null ) return;
	
	// ------------------- by madz
	/*
	var urlTemplate = 'http://localhost/cgi-bin/mapserv.exe?';
		urlTemplate += 'map=/ms4w/apps/test/nws.map&';
		urlTemplate += 'layers=warnings&';
		urlTemplate += 'mode=tile&';
		urlTemplate += 'tilemode=gmap&';
		urlTemplate += 'tile={X}+{Y}+{Z}';
	*/
	
	var urlTemplate = 'http://miami.zoomradar.net/cgi-bin/mapserv?';
		urlTemplate += 'map=/var/www/html/nwsbulletins/nws.map&';
		urlTemplate += 'layers=other warnings&';
		urlTemplate += 'mode=tile&';
		urlTemplate += 'tilemode=gmap&';
		urlTemplate += 'tile={X}+{Y}+{Z}';
		
	var myLayer = new GTileLayer(null,0,18,{
									tileUrlTemplate:urlTemplate,
									isPng:true,
									opacity:0.7 });
									
	nwsOverlay = new GTileLayerOverlay(myLayer);
	
	mapCtrl.addOverlay(nwsOverlay);
	// ----------------------------------
	/*
	GEvent.addListener(mapCtrl, "click", function() {
		alert("You clicked the map.");
	});

	*/
	// ----------------------------------
	
	
}

function gmRemoveNWSOverlay()
{
	//if ( nwsOverlay == null ) return;
	mapCtrl.removeOverlay(nwsOverlay);
	nwsOverlay = null;
}

//geographic -> pixel coordinates conversion
function getPixel(lat,lng) {

  //alert("get pixel" + lat + " "  + lng);
 //alert (mapCtrl.fromLatLngToContainerPixel(new GLatLng(lat,lng)));
 //  thisMovie("WeatherRadar").setStart(mapCtrl.fromLatLngToContainerPixel(new GLatLng(lat,lng)).x,mapCtrl.fromLatLngToContainerPixel(new GLatLng(lat,lng)).y);
 
//thisMovie("WeatherRadar").setStart(0,0);


}

function getCenterLat()
{
	var latLng = mapCtrl.getCenter();
	return latLng.lat();
}

function getCenterLng()
{
	var latLng = mapCtrl.getCenter();
	return latLng.lng();
}

function getPixelX(lat,lng) 
{
	var pix = mapCtrl.fromLatLngToContainerPixel(new GLatLng(lat,lng));

	return pix.x;
}

function getPixelY(lat,lng) 
{
	var pix = mapCtrl.fromLatLngToContainerPixel(new GLatLng(lat,lng));

	return pix.y;
}

function getMaxMinLatLonFromPixels(width, height) 
{
	var posLT = mapCtrl.fromContainerPixelToLatLng(new GPoint(0,0));
	var posRB = mapCtrl.fromContainerPixelToLatLng(new GPoint(width,height));

	var returnValue = ""+posLT.lat()+", "+posLT.lng()+", "+posRB.lat()+", "+posRB.lng()+"";

	return returnValue;
}

// by madz
function getLatLonFromPixels(x, y) 
{
	var coords = mapCtrl.fromContainerPixelToLatLng(new GPoint(x,y));

	var returnValue = "lat="+coords.lat()+"&lon="+coords.lng();

	return returnValue;
}



function updateImage()
{
 	thisMovie("WeatherRadar").updateRadar();
}

function updateBounds()
{
 	thisMovie("WeatherRadar").setBounds(mapCtrl.getBounds().getSouthWest().lat(),mapCtrl.getBounds().getSouthWest().lng(),mapCtrl.getBounds().getNorthEast().lat(),mapCtrl.getBounds().getNorthEast().lng());
}
//Go to area
function Map_Goto(lat, lon, zoom)
{
	mapCtrl.setCenter(new GLatLng(lat, lon), zoom);
	updateImage();
}

//Zoom buttons handlers
function Map_SetZoom(newZoomLevel)
{
	mapCtrl.setZoom(newZoomLevel);
	updateImage();
}
function Map_ZoomIn()
{
	mapCtrl.zoomIn();
	updateImage();
}
function Map_ZoomOut()
{
	mapCtrl.zoomOut();
	updateImage();
}

//drag to new possition
function Map_Drag(dx, dy)
{
//alert(dx);
   mapCtrl.getDragObject().moveBy(new GSize(dx, dy));
}

//Map types buttons handlers
function Map_Road(){
	mapCtrl.setMapType(G_NORMAL_MAP);	//This is the normal street map type.
}
function Map_Satelite(){
	mapCtrl.setMapType(G_SATELLITE_MAP);	//This map type shows Google Earth satellite images.
}
function Map_Hybrid(){
	mapCtrl.setMapType(G_HYBRID_MAP);	//This map type shows transparent street maps over Google Earth satellite images.
}
function Map_Terrian(){
	mapCtrl.setMapType(G_PHYSICAL_MAP);	//NOTE: Available for 2.94+ map versions ONLY. This map type shows physial features of the earth(landforms).
}

function returnNewBounds(){
thisMovie("WeatherRadar").newBounds(mapCtrl.getBounds().getSouthWest().lat(),mapCtrl.getBounds().getSouthWest().lng(),mapCtrl.getBounds().getNorthEast().lat(),mapCtrl.getBounds().getNorthEast().lng(),"ini");
}

function returnNewBoundsAndReload (){
thisMovie("WeatherRadar").addNewObservations(mapCtrl.getBounds().getSouthWest().lat(),mapCtrl.getBounds().getSouthWest().lng(),mapCtrl.getBounds().getNorthEast().lat(),mapCtrl.getBounds().getNorthEast().lng(),"reload");
}
function returnLocalTime(_lat,_lng){
          var script = document.createElement('script');
          document.body.appendChild(script);
          script.src = 'http://ws.geonames.org/' + 'timezone' + 'JSON?lat=' + _lat + '&lng=' + _lng + '&callback=loadJSON';
          //alert('http://ws.geonames.org/' + 'timezone' + 'JSON?lat=' + _lat + '&lng=' + _lng + '&callback=loadJSON');
 
}
  function loadJSON(result) {
      //
     //alert(JSON.stringify(result));
     //
     thisMovie("WeatherRadar").localTime(JSON.stringify(result));
 }

//----------------------------------------
//-        Lat49 Ads Start               -
//----------------------------------------
		
	//Map's top-left point's coordinates
		var mapXCoordinate = 0;
		var mapYCoordinate = 0;
		
		
		//Ad aligns
		var ad_125x125_align = "default"; //Available values: "default", "top-right", "top-left", "bottom-right" and "bottom-left"
		var ad_234x60_align = "default"; //Available values: "default", "top-right", "top-left", "bottom-right" and "bottom-left"

		var google_ad_align = "default"; //Available values: "default", "top-right", "top-left", "bottom-right" and "bottom-left"

		//Parameters used to save map's previous place
		var adLat;
		var adLng;
		var adZoom;
		var count = 0;
		
		var lat49_ad_type = "normal"; //"normal" || "both" || "125x125" || "234x60"

		//Displayed Ad type: "lat49" or "google" or "iab"
		var ad_provider = "lat49";

		//disables Ads for some time
		var adds_disabled = false;
		
		//enable/disables pushpins
		var show_pushpins = false;
		
		//Pushs all ads down
		var pushAdDown = 0;

	function setMapListeners(){
		
		if(mapCtrl==null || thisMovie("WeatherRadar")==null){
			setTimeout("setMapListeners()", 1000);
			return;
		}
		
		//Disables Ads
		if(show_ads == false || ad_provider != "lat49"){
			return;
		}
		
		if(mapType == "640x500_under"){
			document.getElementById("adcontainer_125x125").style.left = 510;
			document.getElementById("adcontainer_125x125").style.top = 505+pushAdDown;
			Lat49.initAds(PUBLISHER_ID);
			adLat = 0;
			adLng = 0;
			adZoom = 0;
			detectChanges();
			defineAvailableAd();
			return;
		}else if(mapType == "700x500_under"){
			document.getElementById("adcontainer_125x125").style.left = 550;
			document.getElementById("adcontainer_125x125").style.top = 505+pushAdDown;
			Lat49.initAds(PUBLISHER_ID);
			adLat = 0;
			adLng = 0;
			adZoom = 0;
			detectChanges();
			defineAvailableAd();
			return;
		}
		
		var deltaXAd = 0;
		var deltaYAd = 0;
		if(mapType == "500x500"){
			deltaXAd = -200;
			if(ad_125x125_align == "default"){
				ad_125x125_align = "top-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_align = "bottom-right";
			}
		}else if(mapType == "700x500"){
			if(ad_125x125_align == "default"){
				ad_125x125_align = "top-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_align = "bottom-right";//"top-right";
			}
		}else if(mapType == "740x500"){
			deltaXAd = 40;
			if(ad_125x125_align == "default"){
				ad_125x125_align = "top-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_align = "bottom-right";//"top-right";
			}
		}else if(mapType == "740x710"){
			deltaXAd = 40;
			deltaYAd = 210;
			if(ad_125x125_align == "default"){
				ad_125x125_align = "top-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_align = "bottom-right";//"top-right";
			}
		}else if(mapType == "850x500"){
			deltaXAd = 150;
			if(ad_125x125_align == "default"){
				ad_125x125_align = "top-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_align = "bottom-right";//"top-right";
			}
		}else if(mapType == "1000x710"){
			deltaXAd = 300;
			deltaYAd = 210;
			if(ad_125x125_align == "default"){
				ad_125x125_align = "bottom-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_align = "bottom-right";
			}
		}else if(mapType == "985x710"){
			deltaXAd = 285;
			deltaYAd = 210;
			if(ad_125x125_align == "default"){
				ad_125x125_align = "bottom-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_align = "bottom-right";
			}
		}else if(mapType == "640x500"){
			deltaXAd = -60;
			deltaYAd = 0;
			if(ad_125x125_align == "default"){
				ad_125x125_align = "top-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_align = "bottom-right";
			}
		}else if(mapType == "630x500"){
			deltaXAd = -70;
			deltaYAd = 0;
			if(ad_125x125_align == "default"){
				ad_125x125_align = "top-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_align = "bottom-right";
			}
		}else if(mapType == "640x480"){
			deltaXAd = -60;
			deltaYAd = -20;
			if(ad_125x125_align == "default"){
				ad_125x125_align = "top-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_align = "bottom-right";
			}
		}else if(mapType == "640x500_custom"){
			deltaXAd = -60;
			deltaYAd = 0;
			if(ad_125x125_align == "default"){
				ad_125x125_align = "top-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_align = "bottom-right";
			}
		}else{
			deltaXAd = 230;
			deltaYAd = 210;
			if(ad_125x125_align == "default"){
				ad_125x125_align = "bottom-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_align = "bottom-right";
			}
		}
		
		//Shows Ads
		//document.getElementById("adcontainer_125x125").style.visibility = "visible";
		//document.getElementById("adcontainer_234x60").style.visibility = "visible";
		
		//Sets Ad Places for 125x125
		if(lat49_ad_type != "234x60"){
			if(ad_125x125_align == "top-left"){
				document.getElementById("adcontainer_125x125").style.left = mapXCoordinate + 3;
				document.getElementById("adcontainer_125x125").style.top = mapYCoordinate + 3+pushAdDown;
				//document.getElementById("adcontainer_125x125").lat49adposition = "top-left";
			}else if(ad_125x125_align == "bottom-left"){
				document.getElementById("adcontainer_125x125").style.left = mapXCoordinate + 3;
				document.getElementById("adcontainer_125x125").style.top = mapYCoordinate + 353+pushAdDown;
				//document.getElementById("adcontainer_125x125").lat49adposition = "bottom-left";
			}else if(ad_125x125_align == "bottom-right"){
				document.getElementById("adcontainer_125x125").style.left = mapXCoordinate + deltaXAd + 567;//right = 3;
				document.getElementById("adcontainer_125x125").style.top = mapYCoordinate + deltaYAd + 353+pushAdDown;
				//document.getElementById("adcontainer_125x125").lat49adposition = "bottom-right";
			}else{
				document.getElementById("adcontainer_125x125").style.left = mapXCoordinate + deltaXAd + 572;//right = 3;
				document.getElementById("adcontainer_125x125").style.top = mapYCoordinate + 3+pushAdDown;
				//document.getElementById("adcontainer_125x125").lat49adposition = "top-right";	
			}
		}else{
			//Sets Ad Places for 234x60
			if(ad_234x60_align == "top-left"){
				document.getElementById("adcontainer_234x60").style.left = mapXCoordinate + 3;
				document.getElementById("adcontainer_234x60").style.top = mapYCoordinate + 3+pushAdDown;
				//document.getElementById("adcontainer_234x60").lat49adposition = "top-left";
			}else if(ad_234x60_align == "bottom-left"){
				document.getElementById("adcontainer_234x60").style.left = mapXCoordinate + 3;//right = 3;
				document.getElementById("adcontainer_234x60").style.top = mapYCoordinate + 410+pushAdDown;//bottom = 87;
				//document.getElementById("adcontainer_234x60").lat49adposition = "bottom-left";
			}else if(ad_234x60_align == "bottom-right"){
				document.getElementById("adcontainer_234x60").style.left = mapXCoordinate + deltaXAd + 455;//right = 3;
				document.getElementById("adcontainer_234x60").style.top = mapYCoordinate + deltaYAd + 410+pushAdDown;//bottom = 87;
				//document.getElementById("adcontainer_234x60").lat49adposition = "bottom-right";
			}else{
				document.getElementById("adcontainer_234x60").style.left = mapXCoordinate + deltaXAd + 455;//right = 3;
				document.getElementById("adcontainer_234x60").style.top = mapYCoordinate + deltaYAd + 3+pushAdDown;//bottom = 87;	
				//document.getElementById("adcontainer_234x60").lat49adposition = "top-right";
			}
		}
		
		
		Lat49.initAds(PUBLISHER_ID);
		
		/*var center = mapCtrl.getCenter();
        var lat = center.lat();
        var lng = center.lng();
        var zoomlevel = Lat49.Tile.convertGMap2Zoom(mapCtrl.getZoom());
		
		adLat = lat;
		adLng = lng;
		adZoom = zoomlevel;*/
		
		adLat = 0;
		adLng = 0;
		adZoom = 0;
		
		if(show_pushpins){ 
			AdPushpin.setMap(mapCtrl);  //pass the map to the pushpin class
			AdPushpin.setPubid(PUBLISHER_ID);
		}
		
		detectChanges();
		defineAvailableAd();
	}
	
	
	function detectChanges(){
		
		 
		
		//count++;
		
		//document.getElementById("results").value = "Starting "+count;
		//document.getElementById("results").style.color = "#666666";
		
		var center = mapCtrl.getCenter();
        var lat = center.lat();
        var lng = center.lng();
        var zoomlevel = Lat49.Tile.convertGMap2Zoom(mapCtrl.getZoom());
		
		//document.getElementById("results").value = "Counted "+count;
		//document.getElementById("results").style.color = "#666666";
		
		if(adLat!=lat || adLng!=lng || adZoom!=zoomlevel){
				
				adLat = lat;
				adLng = lng;
				adZoom = zoomlevel;
				
				if(show_pushpins){
					  var pin_bnds = mapCtrl.getBounds();
					  var pin_center = pin_bnds.getCenter();
					  var pin_lat = pin_center.lat();
					  var pin_lon = pin_center.lng();

					  //get the bottom left corner and top right corner of map
					  var pin_south = pin_bnds.getSouthWest().lat();
					  var pin_west = pin_bnds.getSouthWest().lng();
					  var pin_north = pin_bnds.getNorthEast().lat();
					  var pin_east = pin_bnds.getNorthEast().lng();
					  
					  var ad_types = new Object();
					  //ad_types['adcontainer_125x125']=Lat49.Ads.BUTTON;
					  //if(mapType != "640x500_under" && mapType != "700x500_under") ad_types['adcontainer_234x60']=Lat49.Ads.HALF_BANNER;
					  if(lat49_ad_type != "234x60") ad_types['adcontainer_125x125']=Lat49.Ads.BUTTON;
					  else  ad_types['adcontainer_234x60']=Lat49.Ads.HALF_BANNER;

					  try {
						var pin_zoomlevel = Lat49.Tile.convertGMap2Zoom(mapCtrl.getZoom());
						//Only display the Mapit Panel if the pins are within the map view.
						Lat49.updateMultiAdsByLatLonWithExtents(ad_types, pin_lat, pin_lon, pin_zoomlevel, pin_south, pin_west, pin_north, pin_east);
					  } catch(e) {}
				}else{
				
					var ad_types = new Object();
					//ad_types['adcontainer_125x125']=Lat49.Ads.BUTTON;
					//if(mapType != "640x500_under" && mapType != "700x500_under") ad_types['adcontainer_234x60']=Lat49.Ads.HALF_BANNER;
					if(lat49_ad_type != "234x60") ad_types['adcontainer_125x125']=Lat49.Ads.BUTTON;
					else  ad_types['adcontainer_234x60']=Lat49.Ads.HALF_BANNER;

					Lat49.updateMultiAdsByLatLon(ad_types, adLat, adLng, adZoom);
				}
		}else{
				//document.getElementById("results").value = count + ": " + "No Changes";
				//document.getElementById("results").style.color = "#00FF00";
		}
		
		setTimeout ( "detectChanges()", 5000 );	
		
	}
	
	function defineAvailableAd(){
		
		if(mapType == "640x500_under" || mapType == "700x500_under"){
			document.getElementById('adcontainer_125x125').style.visibility = "visible";
			setTimeout ( "defineAvailableAd()", 1000 );	
			return;
		}
		
		if(lat49_ad_type != "234x60"){
			document.getElementById('adcontainer_125x125').style.visibility = "visible";
			if(adds_disabled) document.getElementById('adcontainer_125x125').style.visibility = "hidden";
			setTimeout ( "defineAvailableAd()", 1000 );
			return;
		}else{  
			document.getElementById('adcontainer_234x60').style.visibility = "visible";
			if(adds_disabled) document.getElementById('adcontainer_234x60').style.visibility = "hidden";
			setTimeout ( "defineAvailableAd()", 1000 );
			return;
		}	
		
		//the code below will not work anymore
		
		if(adds_disabled){
			document.getElementById('adcontainer_234x60').style.visibility = "hidden";
			if(mapType != "640x500_under" && mapType != "700x500_under") document.getElementById('adcontainer_125x125').style.visibility = "hidden";
			setTimeout ( "defineAvailableAd()", 1000 );
			return;
		}
		
				
		var bigAdValue = document.getElementById('adcontainer_234x60').innerHTML;
		var answerLength = bigAdValue.length;

		var smallAdValue = document.getElementById('adcontainer_125x125').innerHTML;
		var answerLengthSmall = smallAdValue.length;

		
		//document.getElementById("inner1").innerHTML = document.getElementById('adcontainer_125x125').innerHTML;
		//document.getElementById("inner2").innerHTML = document.getElementById('adcontainer_234x60').innerHTML;


		//var isUnavailable = bigAdValue.indexOf("No current ad");
		//if(isUnavailable >= 0 || bigAdValue==""){
		/*if(answerLength < 200){
			document.getElementById('adcontainer_234x60').style.visibility = "hidden";
			
			//var smallAdValue = document.getElementById('adcontainer_125x125').innerHTML;
			//var answerLengthSmall = smallAdValue.length;
			//var isUnavailableSmall = smallAdValue.indexOf("No current ad");
			//if(isUnavailableSmall >= 0 || smallAdValue==""){
			if(answerLengthSmall < 200){
				document.getElementById('adcontainer_125x125').style.visibility = "hidden";
			}else{
				document.getElementById('adcontainer_125x125').style.visibility = "visible";
			}
		}else{
			document.getElementById('adcontainer_234x60').style.visibility = "visible";
			document.getElementById('adcontainer_125x125').style.visibility = "hidden";	
		}*/
		
		if(lat49_ad_type == "234x60"){
			document.getElementById('adcontainer_234x60').style.visibility = "visible";
			document.getElementById('adcontainer_125x125').style.visibility = "hidden";
			setTimeout ( "defineAvailableAd()", 1000 );
			return;
		}
		
		if(lat49_ad_type == "125x125"){
			document.getElementById('adcontainer_234x60').style.visibility = "hidden";
			document.getElementById('adcontainer_125x125').style.visibility = "visible";
			setTimeout ( "defineAvailableAd()", 1000 );
			return;
		}
		if(lat49_ad_type == "both"){
			document.getElementById('adcontainer_234x60').style.visibility = "visible";
			document.getElementById('adcontainer_125x125').style.visibility = "visible";
			setTimeout ( "defineAvailableAd()", 1000 );
			return;
		}

		if(answerLengthSmall < 200){
			document.getElementById('adcontainer_125x125').style.visibility = "hidden";

			if(answerLength < 200){
				document.getElementById('adcontainer_234x60').style.visibility = "hidden";
			}else{
				document.getElementById('adcontainer_234x60').style.visibility = "visible";
			}	
		}else{
			document.getElementById('adcontainer_125x125').style.visibility = "visible";
			document.getElementById('adcontainer_234x60').style.visibility = "hidden";
		}


		
		setTimeout ( "defineAvailableAd()", 1000 );	
	}

	
	function putAds(timeout)
	{
		//puts google ads
		prepareGoogleAds(null, timeout);
		return;
		
		//and disables lat49 ads
		if(ad_provider == "google"){

			var google_ad_top = 0;
			var google_ad_left = 0;

			var google_ad_deltaX = 0;
			var google_ad_deltaY = 0;

			if(mapType == "500x500"){
				google_ad_deltaX = -200;
				google_ad_deltaY = 0;
			}else if(mapType == "700x500"){
				google_ad_deltaX = 0;
				google_ad_deltaY = 0;
			}else if(mapType == "850x500"){
				google_ad_deltaX = 150;
				google_ad_deltaY = 0;
			}else if(mapType == "640x500"){
				google_ad_deltaX = -60;
				google_ad_deltaY = 0;
			}else if(mapType == "630x500"){
				google_ad_deltaX = -70;
				google_ad_deltaY = 0;
			}else{
				google_ad_deltaX = 300;
				google_ad_deltaY = 210;
			}

			if(google_ad_align == "default"){
				google_ad_align = "bottom-right";
			}

			if(google_ad_align == "top-right"){
				google_ad_top = google_ad_deltaY + 5;
				google_ad_left = google_ad_deltaX + 570;
			}else if(google_ad_align == "top-left"){
				google_ad_top = google_ad_deltaY + 5;
				google_ad_left = google_ad_deltaX + 5;
			}else if(google_ad_align == "bottom-left"){
				google_ad_top = google_ad_deltaY + 340;
				google_ad_left = google_ad_deltaX + 5;
			}else{
				google_ad_top = google_ad_deltaY + 340;
				google_ad_left = google_ad_deltaX + 570;
			}
			
			google_ad_top = google_ad_top + pushAdDown;

			var ad_innerHTML = '<div id="google_ad_125x125" style="position:absolute; top: '+google_ad_top+'px; left: '+google_ad_left+'px; width: 125px; height: 125px; z-index:99998">'
						+ '<iframe src="google_ad_template_new.html" scrolling="no" frameborder="0" width="125" height="125" allowtransparency="true" style="background-color: #CCCCCC;" marginheight="0" marginwidth="0"></iframe>'
						+'</div>';
			document.write(ad_innerHTML);

			//iframeG = document.getElementById("google_125x125_ad_iframe");
			//iframeG.allowTransparency = true; /* IE only */
			//iframeG.style.backgroundColor = 'transparent';

			setTimeout("checkGoogleAds()", 1000);
			return;
		}
		
		var pin_attributes = "";
		if(show_pushpins) pin_attributes = 'onlat49pushpin="AdPushpin.showPushPin" onlat49hidepushpin="AdPushpin.hidePushPin" ';
		
		if(mapType == "640x500_under"){
			var smallAddHTML = '<div id="adcontainer_125x125" '+pin_attributes+'lat49adposition="bottom-right" style="position:absolute; width:125; height:125; z-index:99997; visibility:hidden;"></div>';
			document.write(smallAddHTML);
			setTimeout("setMapListeners()", 4000);
			return;
		}else if(mapType == "700x500_under"){
			var smallAddHTML = '<div id="adcontainer_125x125"  '+pin_attributes+'lat49adposition="bottom-right" style="position:absolute; width:125; height:125; z-index:99997; visibility:hidden;"></div>';
			document.write(smallAddHTML);
			setTimeout("setMapListeners()", 4000);
			return;
		}

		var ad_125x125_alignHTML = ad_125x125_align;
		var ad_234x60_alignHTML = ad_234x60_align;
		if(mapType == "500x500"){
			if(ad_125x125_align == "default"){
				ad_125x125_alignHTML = "top-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_alignHTML = "bottom-right";
			}
		}else if(mapType == "700x500"){
			if(ad_125x125_align == "default"){
				ad_125x125_alignHTML = "top-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_alignHTML = "bottom-right";
			}
		}else if(mapType == "740x500"){
			if(ad_125x125_align == "default"){
				ad_125x125_alignHTML = "top-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_alignHTML = "bottom-right";
			}
		}else if(mapType == "640x500"){
			if(ad_125x125_align == "default"){
				ad_125x125_alignHTML = "top-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_alignHTML = "bottom-right";
			}
		}else if(mapType == "630x500"){
			if(ad_125x125_align == "default"){
				ad_125x125_alignHTML = "top-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_alignHTML = "bottom-right";
			}
		}else if(mapType == "640x480"){
			if(ad_125x125_align == "default"){
				ad_125x125_alignHTML = "top-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_alignHTML = "bottom-right";
			}
		}else if(mapType == "640x500_custom"){
			if(ad_125x125_align == "default"){
				ad_125x125_alignHTML = "top-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_alignHTML = "bottom-right";
			}
		}else{
			if(ad_125x125_align == "default"){
				ad_125x125_alignHTML = "bottom-right";
			}
			if(ad_234x60_align == "default"){
				ad_234x60_alignHTML = "bottom-right";
			}
		}
		var smallAddHTML = '<div id="adcontainer_125x125"  '+pin_attributes+'lat49adposition="' + ad_125x125_alignHTML + '" style="position:absolute; width:125; height:125; z-index:99997; visibility:hidden;"></div>';
		var bigAddHTML = '<div id="adcontainer_234x60"  '+pin_attributes+'lat49adposition="' + ad_234x60_alignHTML + '" style="position:absolute; width:234; height:60; z-index:99998; visibility:hidden;"></div>';
		
		if(lat49_ad_type == "234x60")
			document.write(bigAddHTML);
		else
			document.write(smallAddHTML);
		
		setTimeout("setMapListeners()", 4000);
	}

	function checkGoogleAds()
	{
		var googleAd125x125 = document.getElementById('google_ad_125x125');
		if(googleAd125x125 == null) return;
		
		if(adds_disabled)
		googleAd125x125.style.visibility = "hidden";
		else
		googleAd125x125.style.visibility = "visible";

		setTimeout ( "checkGoogleAds()", 1000 );
	}

//----------------------------------------
//-        Google on map ads
//----------------------------------------
	
	function prepareGoogleAds(google_ad_slot, timeout)
	{
		if(show_ads == false) return;
		
		if (timeout==undefined) timeout = 60000;
		
		var google_ad_width = 300;
		var google_ad_height = 250;
		
		var google_ad_top = 5;
		var google_ad_left = 500 - google_ad_width - 5;
		
		if(mapType == "700x500"){
			google_ad_left = 700 - google_ad_width - 5;
		}else if(mapType == "640x500"){
			google_ad_left = 640 - google_ad_width - 5;
		}else if(mapType == "630x500"){
			google_ad_left = 630 - google_ad_width - 5;
		}else if(mapType == "740x500"){
			google_ad_left = 740 - google_ad_width - 5;
		}else if(mapType == "600x500"){
			google_ad_left = 600 - google_ad_width - 5;
		}else if(mapType == "640x480"){
			google_ad_left = 640 - google_ad_width - 5;
		}else if(mapType == "600x480"){
			google_ad_left = 600 - google_ad_width - 5;
		}else if(mapType == "640x500_custom"){
			google_ad_left = 640 - google_ad_width - 5;
		}else if(mapType == "700x500_under"){
			google_ad_left = 700 - google_ad_width - 5;
		}else if(mapType == "850x500_under"){
			google_ad_left = 850 - google_ad_width - 5;
		}else  if(mapType == "640x500_under"){
			google_ad_left = 640 - google_ad_width - 5;
		}else if(mapType == "640x500_custom"){
			google_ad_left = 640 - google_ad_width - 5;
		}else if(mapType == "930x710"){
			google_ad_left = 930 - google_ad_width - 5;
		}else{
			google_ad_left = 500 - google_ad_width - 5;
		}
		
		var ad_divHTML =  '<div id="google_ad_div_container" style="position:absolute; top: '+google_ad_top+'px; left: '+google_ad_left+'px; width: 300px; height: 250px; z-index:99997;  visibility: hidden;">' 
			+ '<div id="google_ad_div" style="width: 300px; height: 250px;"></div>' 
			+ '<div id="google_ad_div_close" style="position: absolute;top: 0px; right: 0px; width: 20px; height: 20px; z-index:999999; background-image: url(\'ad_close.png\'); background-repeat: no-repeat; background-position: 0px 0px; cursor: pointer;" onMouseOver="updateAdClose(\'over\');" onMouseOut="updateAdClose(\'out\');" onClick="updateAdClose(\'close\');"></div>'
		+ '</div>';
		
		document.write(ad_divHTML);
		
		var ad_slot = '';
		if(google_ad_slot != null && google_ad_slot != '') ad_slot = google_ad_slot;
		
		setTimeout("insertGoogleAds("+ad_slot+")", timeout);
	}
	
	function insertGoogleAds(google_ad_slot){
		var ad_slot = "ad_slot=";
		if(google_ad_slot !=null && google_ad_slot != '') ad_slot="ad_slot="+google_ad_slot;
	
		var note_of_ad = "google_notes=";
		if(google_notes != "none") note_of_ad="google_notes="+google_notes; 
		
		var ad_innerHTML = '<iframe src="google_ad_300x250.php?'+ad_slot+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="300" height="250" allowtransparency="true" marginheight="0" marginwidth="0"></iframe>';
		
		document.getElementById("google_ad_div").innerHTML = ad_innerHTML;
		document.getElementById("google_ad_div_container").style.visibility = 'visible';
	}
	
	function updateAdClose(mode){
		if(mode == 'close'){
			document.getElementById("google_ad_div_container").style.visibility = "hidden";
		}else if(mode == 'over'){
			document.getElementById("google_ad_div_close").style.backgroundPosition = "0px -20px";
		}else{
			document.getElementById("google_ad_div_close").style.backgroundPosition = "0px 0px";
		}
	}
	
//----------------------------------------
//-        IAB (http://www.iab.net/) ads -
//----------------------------------------

	var google_notes = "none";

	function putIabAds(id_460x60, custom_version, custom_height)
	{
		var iab_left = 0;
		var iab_top = 500;
		var iab_width = 700;
		var iab_height = 135;
		
		var id_of_ad = "id_468x60=";
		if(id_460x60!=null) id_of_ad="id_468x60="+id_460x60;
		
		var note_of_ad = "google_notes=";
		if(google_notes != "none") note_of_ad="google_notes="+google_notes; 

		if(mapType == "640x480"){
			iab_top = 480;
		}
		if(mapType == "500x500"){
			iab_width = 500;
		}
		if(mapType == "740x500"){
			iab_width = 740;
			iab_height = 100;
		}
		if(mapType == "850x500"){
			iab_width = 850;
			iab_height = 100;
		}

		if(mapType == "640x500" || mapType == "640x500_under"){
			iab_width = 640;
		}
		if(mapType == "630x500" || mapType == "630x500_under"){
			iab_width = 630;
		}
		if(mapType == "700x500" && custom_version!=null){
			iab_height = 70;
		}
		if(mapType == "500x500" && custom_version!=null){
			iab_width = 500;
			iab_height = 70;
		}
		if(mapType == "640x500" && custom_version!=null){
			iab_width = 640;
			iab_height = 70;
		}
		if(mapType == "640x480"){
			iab_width = 640;
			iab_height = 70;
		}
		if(mapType == "700x500" && custom_height!=null){
			iab_height = 100;
		}
		if(mapType == "640x500" && custom_height!=null){
			iab_height = 100;
		}
		if(mapType == "930x710"){
			iab_top = 710;
			iab_width = 930;
			iab_height = 100;
		}
		if(mapType == "500x500" && custom_height!=null){
			iab_height = 70;
		}
		
		var iab_inner = '<iframe src="iab_700x500.php?'+id_of_ad+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="700" height="135" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		
		if(mapType == "700x500_under"){
			iab_inner = '<iframe src="iab_700x500.php?hide_120x90=true&'+id_of_ad+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="700" height="135" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		}
		if(mapType == "500x500"){
			iab_inner = '<iframe src="iab_500x500.php?'+id_of_ad+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="500" height="135" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		}
		if(mapType == "640x500"){
			iab_inner = '<iframe src="iab_640x500.php?'+id_of_ad+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="640" height="135" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		}
		if(mapType == "630x500"){
			iab_inner = '<iframe src="iab_630x70.php?'+id_of_ad+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="630" height="135" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		}
		if(mapType == "740x500"){
			iab_inner = '<iframe src="iab_740x500.php?'+id_of_ad+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="740" height="100" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		}
		if(mapType == "640x480"){
			iab_inner = '<iframe src="iab_640x70.php?'+id_of_ad+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="640" height="70" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		}
		if(mapType == "640x500_under"){
			iab_inner = '<iframe src="iab_640x500.php?hide_120x90=true&'+id_of_ad+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="640" height="135" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		}
		if(mapType == "640x500_custom"){
			iab_inner = '<iframe src="iab_640x500.php?'+id_of_ad+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="640" height="135" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		}
		if(mapType == "930x710"){
			if(id_460x60!=null) id_of_ad="id_728x90="+id_460x60;
			iab_inner = '<iframe src="iab_930x710.php?'+id_of_ad+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="930" height="100" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		}
		
		if(mapType == "700x500" && custom_version!=null){
			iab_inner = '<iframe src="iab_700x500_small.php?'+note_of_ad+'" scrolling="no" frameborder="0" width="700" height="70" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		}
		if(mapType == "700x500" && custom_height!=null){
			iab_inner = '<iframe src="iab_700x500_middle.php?'+note_of_ad+'" scrolling="no" frameborder="0" width="700" height="100" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		}
		if(mapType == "640x500" && custom_height!=null){
			iab_inner = '<iframe src="iab_640x500_middle.php?'+note_of_ad+'" scrolling="no" frameborder="0" width="640" height="100" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		}
		if(mapType == "500x500" && custom_version!=null){
			iab_inner = '<iframe src="iab_500x70.php?'+id_of_ad+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="500" height="70" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		}
		
		if(mapType == "640x500" && custom_version!=null){
			iab_inner = '<iframe src="iab_640x500_small.php?'+id_of_ad+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="640" height="70" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		}
		
		iab_top = iab_top + pushAdDown;
		
		var backgroundDivHTML = '<div id="iab_ads" style="left: '+iab_left+'px; top: '+iab_top+'px; width: '+iab_width+'px; height: '+iab_height+'px; position:absolute;">'
						+iab_inner
						+'<div>';
		document.write(backgroundDivHTML);			
	}
	
	function putIabAdOnMap(id_460x60, left, top, on_type, forceWidth, forceHeight)
	{
		var on_width = 468;
		var on_height = 60;
		if(on_type=="728x90"){
			on_width = 728;
			on_height = 90;
		}
		
		if(forceWidth != null){
			on_width = forceWidth;
		}
		if(forceHeight != null){
			on_height = forceHeight; 
		}
		
		var id_of_ad = "";
		if(id_460x60!=null) id_of_ad="id_468x60="+id_460x60;
		
		var note_of_ad = "";
		if(google_notes != "none") note_of_ad="google_notes="+google_notes; 
		
		var iab_inner = '<iframe src="iab_468x60.php?'+id_of_ad+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="468" height="60" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		if(on_type=="728x90") iab_inner = '<iframe src="iab_728x90.php?'+id_of_ad+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="'+on_width+'" height="'+on_height+'" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		
		top = top + pushAdDown;

		var backgroundDivHTML = '<div id="iab_ad_468x60" style="left: '+left+'px; top: '+top+'px; width: '+on_width+'px; height: '+on_height+'px; position:absolute;">'
						+iab_inner
						+'<div>';
		document.write(backgroundDivHTML);			
	}
	
	function putIabAdOverMap(id_728x90)
	{
		var on_width = 930;
		var on_height = 100;
		
		var id_of_ad = "";
		if(id_728x90!=null) id_of_ad="id_468x60="+id_728x90;
		
		var note_of_ad = "";
		if(google_notes != "none") note_of_ad="google_notes="+google_notes; 
		
		var iab_inner = '<iframe src="iab_728x90.php?'+id_of_ad+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="930" height="100" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
		
		if(mapType == "740x710"){
			iab_inner = '<iframe src="iab_740x90.php?'+id_of_ad+'&'+note_of_ad+'" scrolling="no" frameborder="0" width="740" height="100" style="background-color: #FFFFFF;" marginheight="0" marginwidth="0"></iframe>';
			on_width=740;
		}

		var backgroundDivHTML = '<div id="iab_ad_728x90" style="left: 0px; top: 0px; width: '+on_width+'px; height: '+on_height+'px; position:absolute;">'
						+iab_inner
						+'<div>';
		document.write(backgroundDivHTML);			
	}


//----------------------------------------
//-        GeoCoder Start               -
//----------------------------------------

	
//Added zoom when used GeoCoder
var geoAddZoom = 4;

//Sets Listener for GeoCoder
function setGeoListeners(){
		
	if(mapCtrl==null || thisMovie("WeatherRadar")==null){
		setTimeout("setGeoListeners()", 1000);
		return;
	}

	if(show_geocoder == false){
		return;
	}

	document.getElementById('search-wrapper').style.visibility = "visible";
}

function hideGeocoder(){

	document.getElementById('search-wrapper').style.top = "-100px";
}

function showGeocoder(){
//	alert("Show");
	document.getElementById('search-wrapper').style.top = "3px";
}

function changeMapPositionToAddress(addressGeocoder)
{
	var geocoder = new GClientGeocoder();
	var placeName = addressGeocoder;
	geocoder.getLocations(placeName, parseResponse);
}

function changeMapPosition()
{
	var geocoder = new GClientGeocoder();
	var placeName = document.getElementById('search-box').value;
	geocoder.getLocations(placeName, parseResponse);
}

function parseResponse(response) {
	if (!response || response.Status.code != 200) {
		alert("Sorry, that address didn't work.\nTry using a different address.");
		return false;
	} else {
		place = response.Placemark[0];
		var lat = place.Point.coordinates[1];
		var lng = place.Point.coordinates[0];
		
		Map_Goto(lat, lng, geoAddZoom+4+parseInt(response.Placemark[0].AddressDetails.Accuracy) );
		thisMovie("WeatherRadar").updateTempsAndZoom(8+parseInt(response.Placemark[0].AddressDetails.Accuracy));
	}
	
}

function changeLatLonZoom(lat, lon, zoom){
		Map_Goto(lat, lon, zoom );
		thisMovie("WeatherRadar").updateTempsAndZoom(zoom);
}

function putGeocoder(){
	var geoCoderDIV = '<div id="search-wrapper" style="visibility: hidden; position:absolute; top: 3px; left: 362px; background:#BBBBBB; border:solid 1px; display: block; text-align:center; width: 148px; height: 40px; font-size: 11px; font-weight: bold; z-index:99999">\n<form action="" style="margin:0px; padding:0px;" onSubmit="changeMapPosition(); return false;">\nTake me to: <BR>\n<input type="text" id="search-box" value="" size="12" style="height: 20px; width: 100px; font-size: 10px; margin: 0px;" />\n<input type="button" onClick="changeMapPosition(); return false;" value="Go" style="height: 22px; widht: 100px; font-size: 10px; margin: -1px;" />\n</form>\n</div>';

	if(mapType == "640x500_custom"){
		geoCoderDIV = '<div id="search-wrapper" style="visibility: hidden; position:absolute; top: 3px; left: 354px; background:#BBBBBB; border:solid 1px; display: block; text-align:center; width: 148px; height: 40px; font-size: 11px; font-weight: bold; z-index:99999">\n<form action="" style="margin:0px; padding:0px;" onSubmit="changeMapPosition(); return false;">\nTake me to: <BR>\n<input type="text" id="search-box" value="" size="12" style="height: 20px; width: 100px; font-size: 10px; margin: 0px;" />\n<input type="button" onClick="changeMapPosition(); return false;" value="Go" style="height: 22px; widht: 100px; font-size: 10px; margin: -1px;" />\n</form>\n</div>';
	}

	document.write(geoCoderDIV);


	setTimeout("setGeoListeners()", 4000);
}

function updateGeocoder(show){
	//if(document.getElementById('search-wrapper') == null) {return;}
	if(show == "false"){
		if(document.getElementById('search-wrapper') != null)
		document.getElementById('search-wrapper').style.visibility = "hidden";

		adds_disabled = true;

	}else{
		if(document.getElementById('search-wrapper') != null)
		document.getElementById('search-wrapper').style.visibility = "visible";

		adds_disabled = false;
	}
}

var geocoderReturnAddress = "";

function defineAddressFromXY(x, y){
	var geocoder = new GClientGeocoder(); 
	var latlng = mapCtrl.fromContainerPixelToLatLng(new GPoint(x, y));

	geocoderReturnAddress = "";
	
	geocoder.getLocations(latlng, showAddress); 
	function showAddress(response) { 
		if (!response || response.Status.code != 200) { 
			geocoderReturnAddress = "Error: "+response.Status.code; 
		} else { 
			geocoderReturnAddress = response.Placemark[0].address; 
		} 
	}

}

function getGeocoderAddress(){
	var returnAddress = geocoderReturnAddress;
	geocoderReturnAddress = "";
	return returnAddress;
}

//:: Lat49 Pushpins
var AdPushpin = function()
{
  //private members
  var map = null;
  var markersArray = new Array();

  //public members
  return { 

    // Set the map variable and define the pushpin icon.
    setMap:function(m)
    {
      map = m;
    },

    setPubid:function(id)
    {
      pubid = id;
    },

    //Update the marker info with a title and address
    updateMarker:function(marker,title, address, pinid)
    {
      GEvent.addListener(marker, "click", function() {
      marker.openInfoWindowHtml("<b>" + title + "</b><br> " + address);});
      Lat49.trackPinClick(pinid,pubid);
    },

    //Hide all the pushpins
    hidePushPin:function()
    {	
      /*for (var i = 0; i < markersArray.length; i++) 
      {
        map.removeOverlay(markersArray[i]);
      }
   
      markersArray = new Array();*/
	  
	  thisMovie("WeatherRadar").hidePushPin();
    },

    //Push new markers into the markersArray and display them on the map.
   /*
    * The parameter, loc, is an array of objects that have the following attributes:
    * lat <double> - the latitude
    * lon <double> - the longitude
    * title <string> - the title of the pushpin
    * address <string> - the information associated with the pushpin
    * pinurl <string> - the url of the image of the pushpin itself
    * pinid <int> - the id of the pushpin
    *
    */ 

showPushPin:function(loc)
    { 
      var maxpins = 100;
	  //alert("pins: "+loc.length);
	  var pushpins = new Array();

      for (var i=0; i<loc.length;i++)
      {
        if(i<=maxpins)
        {
		  pushpins.push(new Array(loc[i].lat, loc[i].lon, loc[i].pinurl, loc[i].title, loc[i].address, loc[i].pinid));
		
          /*var point = new GLatLng(loc[i].lat, loc[i].lon);

          var adicon = new GIcon(G_DEFAULT_ICON);
          adicon.image = loc[i].pinurl;
          adicon.shadow ="";
          adicon.iconSize = new GSize(36,32);

          var marker =  new GMarker(point,{clickable: true, bouncy: true, icon:adicon});
          map.addOverlay(marker);
         
          // add markers to array
          markersArray.push(marker);
          this.updateMarker(marker, loc[i].title, loc[i].address, loc[i].pinid);*/
        }
      }
	  
	  //if(pushpins.length > 0)  alert("lat: "+pushpins[0][0]+", lon: "+pushpins[0][1]+"\nURL: "+pushpins[0][2]+"\nTitle: "+pushpins[0][3]+"\nAddress: "+pushpins[0][4]);
		//alert(thisMovie("WeatherRadar")==null);
		thisMovie("WeatherRadar").showPushPin(pushpins);
	}
  }
}();





