// JavaScript Document
$(document).ready(function(){
	$("#content-wrapper").css("overflow","hidden");
	$("body").attr("scroll", "no");
	$(".next").click(function(){moveSlide("next");});
	$(".prev").click(function(){moveSlide("prev");});
});

var slideCount = 0;
var maxMargin = (6 * 730) - $(window).width() + 340;

var maxSlide = 5;
slidesPerScreen = Math.floor(($(window).width() - 340) / 730);
if(slidesPerScreen > 1)  maxSlide -= (slidesPerScreen-1);

function moveSlide(direction)
{
	newCount = direction == "next" ? slideCount+1 : slideCount-1;
	if(newCount > maxSlide || newCount < 0) return;
	else slideCount = newCount;
	animateSlide();
}
function gotoSlide(newSlideCount)
{
	slideCount = newSlideCount;
	animateSlide();
}
function animateSlide()
{
	newMargin = ( -730*slideCount > -maxMargin ? -730*slideCount : -maxMargin );
	$("#inner-wrapper").animate({marginLeft : newMargin+"px"},1000);
}

function openWindow(address, width, height)
{
	newWindow = window.open(address, "newWindow", "width="+width+",height="+height+",left=100,top=100,scrollbars=yes");
	newWindow.focus();
	return false;
}
