$('document').ready(function(){

 //Create Bike Tile PopOvers
	$('a.biketile').click(function(){
		// Get the viewport height and document size
		var viewHeight = self.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
		var docHeight = $('body').height();
		var docWidth = $('body').width();
		// Create the popover div and add to the container div
		var blackout = $('<div id="blackout"></div>');
		blackout.appendTo('body').css({'height': docHeight + "px", 'width': docWidth + "px"});
		var popOver = $('<div id="popover"></div>');
		popOver.appendTo('#container').css('top', viewHeight + 25 + 'px');
		// Grab the link URL, and load the page content into the popover
		var url = $(this).attr('href');
		popOver.load(url, null, function(){
			// Once the content is loaded, add a "close" button
			$(this).append('<a href="#" id="close" class="button">Close</a>');
			$('a#close').click(function(){
				popOver.remove();
				blackout.remove();
				return false;
				})
			});
		return false;  // Don't follow the link
	})
    
    $('div#featured').cycle({fx: 'scrollLeft', speed: 800, timeout: 8000});


});

