/*
THE ONLY WAY YOUR EVENT LIST WILL GET UPDATED IS BY POINTING TO THIS URL
http://www.weaselsspfld.com/javascript/this_months_mc_events.js

Last Update : Sun, 14 Mar 2010 03:20:10 -0700

this javascript file gets updated by server side code.
don't just copy this file or you'll have outdated events.
point your script tag to the url above.

WFFW

Johnny T
*/
document.write("<script src=\"http://www.weaselsspfld.com/javascript/wms.js\" type=\"text/javascript\"></script>");

	var rallyMap;
	var rallyMapCenter = new GLatLng(38.8402805,-97.6114237);
	var rallyMapZoom = 5;
	var rallyMapRotateSpeed = 5000;
	var rallyMapRotateTimer = 0;
	var rallyMapDivID = "RallyMap";

	var rally_icon = new GIcon();
	rally_icon.image = "http://www.weaselsspfld.com/images/rally_mark.png";
	rally_icon.iconSize = new GSize(30, 23);
	rally_icon.iconAnchor = new GPoint(15, 12);
	rally_icon.infoWindowAnchor = new GPoint(20, 6);
	var rallyGMarkers = new Array();
	var rallies = new Array();
rallies[0]= {title:'Bandit Girls4th Annual Thunder Bikefest',description:'MAR. 20-22-Bandit Girls4th Annual Thunder Bikefest. Plantersville. Info: 334-413-6632;www.thebanditgirl.net',url:'http://www.thebanditgirl.net',lat:'32.5945587',long:'-86.9414291'};
rallies[1]= {title:'3rd Annual Rideto the Ruins',description:'MAR. 7-3rd Annual Rideto the Ruins. Coolidge. Info: 520-723-3009; www.coolidgechamber.org',url:'http://www.coolidgechamber.org',lat:'32.977839',long:'-111.517624'};
rallies[2]= {title:'3rd Annual AllAmerican Poker Run',description:'MAR. 21-3rd Annual AllAmerican Poker Run. F.O.E. Kingman. Info: 928-681-2640',url:'http://www.weaselsspfld.com/events/motorcycle_rally_by_state/ARIZONA.php',lat:'35.189443',long:'-114.0530065'};
rallies[3]= {title:'14thAnnual Lost Dutchman M/C Goldrush Run',description:'MAR. 22-14thAnnual Lost Dutchman M/C Goldrush Run. Mesa. Info: 602-463-7886; www.lostdutchmanmc.com',url:'http://www.lostdutchmanmc.com',lat:'33.4222685',long:'-111.8226402'};
rallies[4]= {title:'12th Annual ArizonaBike Week',description:'MAR. 27-APR. 5-12th Annual ArizonaBike Week. Scottsdale. Info: 480-704-1142; www.azbikeweek.com',url:'http://www.azbikeweek.com',lat:'33.5092103',long:'-111.8990327'};
rallies[5]= {title:'Hogs OnThe High Seas Mexican Riviera',description:'MAR. 29-APR. 5-Hogs OnThe High Seas Mexican Riviera. Port of Los Angeles. Info: 800-444-8795;www.hogsonthehighseas.com',url:'http://www.hogsonthehighseas.com',lat:'34.0239015',long:'-118.1720157'};
rallies[6]= {title:'1st AnnualBroomstick Pool Tournament',description:'MAR. 21-21st AnnualBroomstick Pool Tournament. Monmouth. Info: www.centralilabate.org',url:'http://www.centralilabate.org',lat:'40.9114271',long:'-90.6473576'};
rallies[7]= {title:'Motorcycle SwapMeet',description:'MAR. 29-Motorcycle SwapMeet. Fairgrounds, Detroit. Info: 800-968-4242; www.motorcycleswap.com',url:'http://www.motorcycleswap.com',lat:'42.331427',long:'-83.0457538'};
rallies[8]= {title:'Donnie SmithInvitational Bike Show',description:'MAR. 28-29-Donnie SmithInvitational Bike Show. Saint Paul RiverCentre. Info:www.donniesmithbikeshow.com',url:'http://www.donniesmithbikeshow.com',lat:'44.9444101',long:'-93.0932742'};
rallies[9]= {title:'M/C SwapMeet',description:'MAR. 8-M/C SwapMeet. State Fairgrounds, Sedalia. Info: 816-228-5811;www.jwswapmeet.com',url:'http://www.jwswapmeet.com',lat:'38.7044609',long:'-93.2282613'};
rallies[10]= {title:'11th AnnualFreedom of Road Riders Kearney Bike Show',description:'MAR. 30-11th AnnualFreedom of Road Riders Kearney Bike Show. VFW Post 5717, Kearney. Info: 816-365-9615,www.forrlocal29.com',url:'http://www.forrlocal29.com',lat:'39.3677802',long:'-94.3621703'};
rallies[11]= {title:'Motorcycle SwapMeet',description:'MAR. 15-Motorcycle SwapMeet. I-X Center, Cleveland. Info: 800-968-4242; www.motorcycleswap.com',url:'http://www.motorcycleswap.com',lat:'41.4994954',long:'-81.6954088'};
rallies[12]= {title:'Walnecks SwapMeet',description:'MAR. 29-Walnecks SwapMeet. Clark County Fairgrounds, Springfield. Info: 630-985-2097;www.walneckswap.com',url:'http://www.walneckswap.com',lat:'39.9242266',long:'-83.8088172'};
rallies[13]= {title:'Wild Heart SC Support Party',description:'MAR. 28-Wild Heart SC Support Party. RockCity Lounge, Little Rock. Info: 501-909-9430',url:'http://www.weaselsspfld.com/events/motorcycle_rally_by_state/SOUTH_CAROLINA.php',lat:'34.4055519',long:'-79.3038711'};
rallies[14]= {title:'Vietnam Vets Memorial Hwy Run',description:'MAR. 15-17-Vietnam Vets Memorial Hwy Run.Ambassador Motel, Perryton. Info: 806-771-5822',url:'http://www.weaselsspfld.com/events/motorcycle_rally_by_state/TEXAS.php',lat:'36.4000313',long:'-100.8026505'};
rallies[15]= {title:'6TH AnnualSouth Texas Motorcycle Show',description:'MAR. 20-22-6TH AnnualSouth Texas Motorcycle Show. Freeman Coliseum, San Antonio. Info: 210-832-8444ext. 202; www.txbikeshow.com',url:'http://www.txbikeshow.com',lat:'29.4241219',long:'-98.4936282'};
rallies[16]= {title:'25th AnnualCircuit Riders Campout',description:'MAR. 27-29-25th AnnualCircuit Riders Campout. Daniel Springs Baptist Camp, Gary. Info: 903-852-5043;www.circuitriderscfm.org',url:'http://www.circuitriderscfm.org',lat:'32.0312957',long:'-94.3972091'};
rallies[17]= {title:'Bikes andInk',description:'MAR. 21-22-Bikes andInk. The Show Place. Richmond. Info: 386-252-3101; www.cycleprousa.com',url:'http://www.cycleprousa.com',lat:'37.5537575',long:'-77.4602617'};
	function rallyMapInitializeMap() {
		rallyMap = new GMap(document.getElementById( rallyMapDivID ));
		rallyMap.setCenter( rallyMapCenter, rallyMapZoom );
		rallyMap.enableDoubleClickZoom();
		rallyMap.enableContinuousZoom();
		//rallyMap.addControl(new GSmallMapControl());
		rallyMap.addControl(new GLargeMapControl());
		rallyMap.addControl(new GMapTypeControl());
		rallyMap.addControl(new GScaleControl(), new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(150,10))) ;
		rallyMap.addControl(new GOverviewMapControl(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,10)));
        	rallyMap.addMapType(G_PHYSICAL_MAP);
		// a little extra from wms.js
        	rallyMap.addMapType(us_topo());
        	rallyMap.addMapType(us_nexrad());
	}

	function loadRallyMap() {
		rallyMapInitializeMap();
		for (var i in rallies) {
			rallyMap.addOverlay( createRallyMarker( i ) );
		}

		// start cycling through rally info windows
		// clicking on a icon will stop the cycleing
		changeRallyMarker();
	}

	// Creates a marker at the given point with the given number label
	function createRallyMarker( index ) {
		var rally = rallies[index];
		var marker = new GMarker( new GLatLng(rally.lat, rally.long), rally_icon );
		GEvent.addListener(marker, "mouseover", function() {
			var r = rallies[index];
			var iwHtml = "<div style='width:300px;'>";
			if( r.url.indexOf("http://www.weaselsspfld.com/") < 0 ) {
				iwHtml += "<img src='http://open.thumbshots.org/image.aspx?url="+r.url+"' style='float:left;width:120px;height:90px;margin:2px;'>";
			}
			iwHtml += "<a href='"+r.url+"' style='font-weight:bold;color:black;' target='_blank'>"+r.title+"</a>";
			iwHtml += "<p>"+r.description+"</p>";
			iwHtml += "</div>";
			marker.openInfoWindowHtml(iwHtml);
		});
		GEvent.addListener(marker, "click", function() {
			clearTimeout(rallyMapRotateTimer);
			rallyMapRotateTimer = setTimeout( "changeRallyMarker();", rallyMapRotateSpeed*4 );
		});

		rallies[index].marker = marker;
		return marker;
	}

	function changeRallyMarker() {
		var index = Math.floor(Math.random()*rallies.length)
		if( index == null )
			index = 0;
		var marker = rallies[index].marker;
		GEvent.trigger(marker,"mouseover");
		rallyMapRotateTimer = setTimeout( "changeRallyMarker();", rallyMapRotateSpeed );
	}

	/* disable javascript errors */
	//function noError(){return true;} 
	//window.onerror = noError;
