$(document).ready(function()
{
	var images = new Array();
	
	// used to check what slide we are on
	var count = 5;
	var check = 1;
	var slideTime = 5000;
	var path = "img/screenshots/screenshot";
	var ext = "_iphone.jpg";
	var slideId = "slideMan";
	
	var easing = "clip";//"drop";
	var option = {direction: "horizontal"};
	var speed = 750;
	
	// create our array of slide show images
	//var images = new Array();
	
	loadImages();
	
	function loadImages()
	{
		for(var i = 0; i < count; i++)
		{
			var temp = new Image();
			temp.src = path + (i+1) + ext;
			images.push(temp);
		}
		
		initShow();
	}
	
	function initShow()
	{
		$("#slideShowContainer").prepend("<div id='" + slideId + check + "' style='position:absolute;top:0;left:0;'><img src='" + path + check + ext + "'/></div>");
		
		startShow();
	}
	
	function startShow()
	{
		window.setInterval(function()
		{
			if (check == count)
			{
				check = 1;	
			}
			else
			{
				check++;
			}
			
			$("#slideShowContainer").prepend("<div id='" + slideId + check + "' style='position:absolute;top:0;left:0;'><img src='" + path + check + ext + "'/></div>");
			
			if (check == 1)
			{
				$("#" + slideId + count).hide(easing, option, speed);
			}
			else
			{
				$("#" + slideId + (check-1)).hide(easing, option, speed);
			}
			
			
			
		}, slideTime);
	}
	
	/*
	$("#prevSlideBtn").click(function(event)
	{
		// show the previous slide
		
	});
	
	$("#nextSlideBtn").click(function(event)
	{
		// show the next slide
	});
	*/
	
	
});

function showFaq()
{
	//alert('show the FAQ');
	$("#faq").fadeIn('slow');
}

function hideFaq()
{
	$("#faq").fadeOut('fast');	
}


