var oRel = '';
$(document).ready(function() {
	$("a.zoom").fancybox({
		'overlayOpacity' : 0.7,
		'overlayColor' : '#123'
	});
	
	if($('#callout1').length>0){
		var ocontent = $('#callout1').html().toLowerCase().replace("<br>","").replace("<br/>","").replace("<br />","");
		if(ocontent == ""){$('#callout1').remove();}
	}
	if($('#callout2').length>0){
		var ocontent2 = $('#callout2').html().toLowerCase().replace("<br>","").replace("<br/>","").replace("<br />","");
		if(ocontent2 == ""){$('#callout2').remove();}
	}
	$('#printedgreen #map a').click(function(){
		if(oRel != $(this).attr('rel')){
			oRel = $(this).attr('rel');
			
			$('.infosection').fadeOut(250);
			
			setTimeout(function() {
				$('#ajaxload').fadeIn(250);
				$('#map a').removeClass('selected');
				$('#printedgreen #map a[rel='+oRel+']').addClass('selected');
				
				$('#ajaxload').fadeOut(250,function(){
					$('.infosection[rel='+oRel+']').fadeIn(250);
				});
			}, 250);
		}
	});
	try{
		oRel = $('#printedgreen #map a:first').attr('rel');
		$('.infosection').fadeOut(250);
			
		setTimeout(function() {
			$('#ajaxload').fadeIn(250);
			$('#map a').removeClass('selected');
			$('#printedgreen #map a[rel='+oRel+']').addClass('selected');
			
			$('#ajaxload').fadeOut(250,function(){
				$('.infosection[rel='+oRel+']').fadeIn(250);
			});
		}, 250);
	}
	catch(err){}
});
function DoMapContent(oMap, oLattitude, oLongitude, oFriendlyPopup) {
    if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById('' + oMap + ''));
        var marker = new GMarker(new GLatLng(oLattitude, oLongitude));
        //var html = '<div style="width:175px; padding-right:10px;">' +
			'' + oFriendlyPopup + '' +
			'</div>';

        map.setCenter(new GLatLng(oLattitude, oLongitude), 13);
        map.addControl(new GSmallMapControl());
        map.addOverlay(marker);
        //marker.openInfoWindowHtml(html);
    } else {
    }
}
jQuery.preloadImages = function() {
    for (var i = 0; i < arguments.length; i++) {
        jQuery("<img>").attr("src", arguments[i]);
    }
}
