// page.js

//Google maps
var map = null;
var geocoder = null;
function showmap(a)
{
	if (a)
	{
	if ($('#map').css('display') == 'none') {
		$('#map').css('display','block');
		$('#maptab').attr('class','selected');
		$('#phototab').attr('class','');
		$('#photoviewer').css('display','none');
		if (geocoder) {
        geocoder.getLatLng(
          a,
          function(point) {
            if (!point) {
              //alert(a + " not found");
            } else {
              var marker = new GMarker(point);
              map.addOverlay(marker);
              map.setCenter(point, 14);
            }
          }
        );
      }
	}	
	else {
		$('#map').css('display','none');
		$('#maptab').attr('class','');
		$('#phototab').attr('class','selected');
		$('#photoviewer').css('display','block');
	}
	}
	else
	{
		$('#map').css('display','none');
		$('#maptab').attr('class','');
		$('#phototab').attr('class','selected');
		$('#photoviewer').css('display','block');
	}
}

function swap(obj,target,txt)
{
	if ($('#'+target + '> img')) { 
		$('#'+target + ' > img').attr('src',obj.src.replace('_b','_a'));
		$('#caption').text(txt);
	}
}

function showorhide(el)
{
	var d = ($('#'+el).css('display') == 'none') ? 'block' : 'none';
	$('#'+el).css('display',d);
}
function show(el)
{
	$('#'+el).css('display','block');
}
function hide(el)
{
	$('#'+el).css('display','none');
}

function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(43.8697,-95.6017), 13);
        map.addControl(new GSmallMapControl());
        geocoder = new GClientGeocoder();
      }
    }

