$(document).ready(function() {

	// Function to run through the images and content in the highlights section of the home page

	$("#highlights ul li a").click( function(ev) {
		ev.preventDefault();
		$(".overview").fadeOut("fast");
		$("#highlights ul li").removeClass("active");
		$($(this).parent()).addClass("active");
		$("#highlights " + $(this).attr("href")).delay("fast").fadeIn("fast");
	});
	
	
	// Lightbox functionality on smaller images throughout the site
	
	$(".screenshots a").click( function(ev) {
		ev.preventDefault();
		$("#" + $(this).attr("title")).lightbox_me({
			centered: true
		});
	});
	
	
	// Demo links to load into iPhone window
	
	$("#technology .demos a").click( function(ev) {
		ev.preventDefault();
		$("#technology .demo iframe").attr("src",$(this).attr("href"));
	});
	
	
	// Stop loading <iframe> for Mac
	
	if ($.browser.mac()) {
		$("#technology .demo").html("These demos do not work on Mac OS browsers");
	}
	
});
