			function load() {
			  if (GBrowserIsCompatible()) {
			  //begin custom
				var map = new GMap2(document.getElementById("map"));
				map.addControl(new GSmallMapControl());
				//map.addControl(new GMapTypeControl());
				map.setCenter(new GLatLng(44.878316,-72.612462), 8);

				// Create a base icon for all of our markers that specifies the
				// shadow, icon dimensions, etc.
				var baseIcon = new GIcon();
				baseIcon.shadow = "";
				baseIcon.iconSize = new GSize(40, 36);
				baseIcon.iconAnchor = new GPoint(0, 0);
				baseIcon.infoWindowAnchor = new GPoint(0, 0);
				baseIcon.infoShadowAnchor = new GPoint(2, 2);

				// Creates a marker
				function createMarker(point, markup) {
				  var storeIcon = new GIcon(baseIcon);
				  storeIcon.image = "http://www.jaypeakskirentals.com/img/marker.gif";

				  // Set up our GMarkerOptions object
				  markerOptions = { icon:storeIcon };

				  var marker = new GMarker(point, markerOptions);

				  GEvent.addListener(marker, "click", function() {
					marker.openInfoWindowHtml(markup);
				  });
				  return marker;
				}

				// Add location
				var point = new GLatLng(44.878316,-72.612462);
				map.addOverlay(createMarker(point, "<strong>Jay Peak Ski Rentals</strong> Montgomery Center<br /><a href='http://maps.google.com/maps?f=d&saddr=Main+St%2FVT-118&daddr=&hl=en&geocode=FUPQrAId8QWs-w%3B&mra=mr&sll=44.878316,-72.612462&sspn=0.021743,0.038624&ie=UTF8&t=h&z=15'>Get Directions</a>&nbsp;"));

				//end of custom
			  }
			}

$(document).ready(function(){

 	$('#slideshow ul li img:hidden').load(function(){
		$(this).fadeIn(1000);
	});
	
	$('#preview').cycle({ 
		fx: 'scrollRight', 
		timeout: 8000, 
		delay:  2000,
		next: '#next',
		pause:   1 
	});
	
 	$('#preview-container').css('top', '575px');
	var showAds = function(){ 
		$('#preview-container').animate({top: '428px'}, 750); 
		$('#slideshow').not('.inner').children('ul').children('li:first').children('img').fadeOut(1000);
	} 
	window.setTimeout(showAds, 2000);
	
	//apply More Info to slides
	$('div.slide p a').append('<span class="more">More Info</span>');
	
	//apply scroll to top links
	$('#content div.rental:gt(0)').append('<p><a href="#top" class="scroll">Scroll to Top</a></p>');
	
	//lightbox
	//$('a.lightbox').lightBox();
	//$('a[@href$=\".jpg\"]').lightBox();
	//$('a[@href$=\".JPG\"]').lightBox();
	  
	//google maps
	if ($('#map').size() > 0) {
	load();
	} //end maps if
	
	$('div.directions').hide();
	$('a.directions').click(function(){
		$(this).parent('h3').next('div.directions').slideDown();
		return false;
	});

});
