
/*
function startGallery() {
var myGallery = new gallery($('myGallery'), {
timed: true,
showArrows: true,
showCarousel: true,
embedLinks: true,
textShowCarousel: 'gallery'
});
}
*/
//window.addEvent('domready', startGallery);

//above throws error, run this only on pages with a gallery.


//body, initialize is throwing an error, run this only when we want to show the map.
function initialize() {
      var drangLL = new google.maps.LatLng(47.307916, -122.230445);
	  var drangLL2 = new google.maps.LatLng(47.3, -122.2);
      var centerLL = new google.maps.LatLng(47.3095, -122.228);
            var myOptions = {
        zoom: 15,
        center: centerLL,
        scrollwheel: false,
		disableDefaultUI: true,
        mapTypeId: google.maps.MapTypeId.ROADMAP
      };
      
      var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
      
      var contentString = '<span style="font-family: Helvetica, Arial;font-size: 80%">Auburn City Hall</span>';
      var infoWindow = new google.maps.InfoWindow({
        content: contentString });
        
		
		
		
		  //city hall
	var marker1 = new google.maps.Marker({
	position: new google.maps.LatLng(47.307916, -122.230445),
	map: map,
	icon: "http://vtiger.cybercoupons.com/wordpressADA/wp-content/themes/auburn-ADA-theme/images/City_icon-01.png",
	title:"Auburn City Hall"});
	google.maps.event.addListener(marker1, 'click', function(){infoWindow.setContent('<b>Auburn City Hall</b><br>25 West Main Street<br>Auburn WA, 98001<br><a href="http://www.auburnwa.gov" target="_new">View Page</a> | <a href="http://www.google.com/maps?source=uds&daddr=25 West Main Street Auburn, WA 98001&iwstate1=dir%3Ato" target="_new">Get Directions</a>');infoWindow.open(map, marker1);});
		
	var marker2 = new google.maps.Marker({
	position: new google.maps.LatLng(47.309369, -122.228962),
	map: map,
	icon: "http://vtiger.cybercoupons.com/wordpressADA/wp-content/themes/auburn-ADA-theme/images/hospital_icon-01.png",
	title:"Auburn Regional Medical Center"});
	google.maps.event.addListener(marker2, 'click', function(){infoWindow.setContent('<b>Auburn Regional Medical Center</b><br>202 North Division St.<br>Auburn WA, 98001<br><a href="http://www.auburnregional.com" target="_new">View Page</a> | <a href="http://www.google.com/maps?source=uds&daddr=202 North Division St. Auburn, WA 98001&iwstate1=dir%3Ato" target="_new">Get Directions</a>');infoWindow.open(map, marker2);});
		
		
	var marker3 = new google.maps.Marker({
	position: new google.maps.LatLng(47.31029, -122.229919),
	map: map,
	icon: "http://vtiger.cybercoupons.com/wordpressADA/wp-content/themes/auburn-ADA-theme/images/postoffice_icon-01.png",
	title:"Auburn Post Office"});
	google.maps.event.addListener(marker3, 'click', function(){infoWindow.setContent('<b>Auburn Post Office</b><br>202 North Division St.<br>Auburn WA, 98002<br><a href="http://usps.com" target="_new">View Page</a> | <a href="http://www.google.com/maps?source=uds&daddr=202 North Division St. Auburn, WA 98002&iwstate1=dir%3Ato" target="_new">Get Directions</a>');infoWindow.open(map, marker3);});
			
		
	var marker4 = new google.maps.Marker({
	position: new google.maps.LatLng(47.307492, -122.224633),
	map: map,
	icon: "http://vtiger.cybercoupons.com/wordpressADA/wp-content/themes/auburn-ADA-theme/images/police_icon-01.png",
	title:"Auburn Police Department"});
	google.maps.event.addListener(marker4, 'click', function(){infoWindow.setContent('<b>Auburn Police Department</b><br>340 E Main St #201<br>Auburn WA, 98001<br><a href="http://www.auburnwa.gov/emergency/police.asp" target="_new">View Page</a> | <a href="http://www.google.com/maps?source=uds&daddr=340 E Main St #201 Auburn, WA 98002&iwstate1=dir%3Ato" target="_new">Get Directions</a>');infoWindow.open(map, marker4);});
				
	var marker5 = new google.maps.Marker({
	position: new google.maps.LatLng(47.307195, -122.231026),
	map: map,
	icon: "http://vtiger.cybercoupons.com/wordpressADA/wp-content/themes/auburn-ADA-theme/images/train_icon-01.png",
	title:"Auburn Station"});
	google.maps.event.addListener(marker5, 'click', function(){infoWindow.setContent('<b>Auburn Station</b><br>23 A Street SW<br>Auburn WA, 98001<br><a href="http://www.soundtransit.org/Rider-Guide/Auburn-Station.xml" target="_new">View Page</a> | <a href="http://www.google.com/maps?source=uds&daddr=23 A Street SW Auburn, WA 98002&iwstate1=dir%3Ato" target="_new">Get Directions</a>');infoWindow.open(map, marker5);});
		
		
		
		/*
      var marker = new google.maps.Marker({
        position: drangLL, 
        map: map,
        //icon: "auburnicon.jpg",
        title:"What am I doing?"});
		*/
		
		
		/*
		var marker2 = new google.maps.Marker({
        position: new google.maps.LatLng(47.3, -122.2), 
        map: map,
        //icon: "auburnicon.jpg",
        title:"What am I doing?"});
		*/
        
      //google.maps.event.addListener(marker, 'click', function(){infoWindow.open(map, marker);});
    }
function updateImage()
{
//there is a bug here where the new date grows and grows and grows until the browser doesn't show the image any more.
//So we may want to save the BASE IMAGE SOURCE, then use this to append the new dates to instead of appending over and over again.
//alert( typeof cam1 );

//alert( typeof cam10 );



try{
if (typeof cam1=="undefined" && document.getElementById("cam1").value!=null)
{ cam1 = document.getElementById("cam1").value; }
}
catch(e){
return false;
}

try{
if (typeof cam2=="undefined" && document.getElementById("cam2").value!=null)
{ cam2 = document.getElementById("cam2").value; }
}
catch(e){
return false;
}

try{
if (typeof cam3=="undefined" && document.getElementById("cam3").value!=null)
{ cam3 = document.getElementById("cam3").value; }
}
catch(e){
return false;
}

try{
if (typeof cam4=="undefined" && document.getElementById("cam4").value!=null)
{ cam4 = document.getElementById("cam4").value; }
}
catch(e){
return false;
}

try{
if (typeof cam5=="undefined" && document.getElementById("cam5").value!=null)
{ cam5 = document.getElementById("cam5").value; }
}
catch(e){
return false;
}

try{
if (typeof cam6=="undefined" && document.getElementById("cam6").value!=null)
{ cam6 = document.getElementById("cam6").value; }
}
catch(e){
return false;
}

try{
if (typeof cam7=="undefined" && document.getElementById("cam7").value!=null)
{ cam7 = document.getElementById("cam7").value; }
}
catch(e){
return false;
}

try{
if (typeof cam8=="undefined" && document.getElementById("cam8").value!=null)
{ cam8 = document.getElementById("cam8").value; }
}
catch(e){
return false;
}

try{
if (typeof cam9=="undefined" && document.getElementById("cam9").value!=null)
{ cam9 = document.getElementById("cam9").value; }
}
catch(e){
return false;
}

try{
if (typeof cam10=="undefined" && document.getElementById("cam10").value!=null)
{ cam10 = document.getElementById("cam10").value; }
}
catch(e){
return false;
}

if (document.getElementById("cam1").value!=null){document.getElementById("cam1").src = cam1+"?"+new Date()}; 
if (document.getElementById("cam2").value!=null){document.getElementById("cam2").src = cam2+"?"+new Date()}; 
if (document.getElementById("cam3").value!=null){document.getElementById("cam3").src = cam3+"?"+new Date()}; 
if (document.getElementById("cam4").value!=null){document.getElementById("cam4").src = cam4+"?"+new Date()}; 
if (document.getElementById("cam5").value!=null){document.getElementById("cam5").src = cam5+"?"+new Date()}; 
if (document.getElementById("cam6").value!=null){document.getElementById("cam6").src = cam6+"?"+new Date()}; 
if (document.getElementById("cam7").value!=null){document.getElementById("cam7").src = cam7+"?"+new Date()}; 
if (document.getElementById("cam8").value!=null){document.getElementById("cam8").src = cam8+"?"+new Date()}; 
if (document.getElementById("cam9").value!=null){document.getElementById("cam9").src = cam9+"?"+new Date()}; 
if (document.getElementById("cam10").value!=null){document.getElementById("cam10").src = cam10+"?"+new Date()}; 
		//stacking the date on the end prevents image caching

    setTimeout(updateImage, 18000);
	//they update about every 30 seconds
}



