//////////////////  CUSTOMIZE HERE ////////////////////////////////////
	
	var delay = 4; 				// Set delay in seconds
	
//////////////////  DONT EDIT BELOW HERE ////////////////////////////////////

$(document).ready(function() {
	var bannerWidth = $("#justBanner li:first-child img").width();
	var banners = $('#justBanner li').size(); 
	$('#justBanner').css('width', function(index) {
	  return banners * bannerWidth;
	});
	$('#justWindow').css('width', function(index) {
	  return bannerWidth;
	});
	$('#justWindow').css('height', function(index) {
	  return $("#justBanner li:first-child img").height();
	});
	$('#justBannerC').css('height', function(index) {
	  return $("#justBanner li:first-child img").height();
	});
	$("#justBanner").hide().show().delay(bdelay);
	var i = 1;
	var bdelay = delay*1000;
	function bannerScroll(n) {
		var margin = n*bannerWidth;
		$("#justBanner").animate({ 
				marginLeft: "-"+margin+"px"
			}, 1500 );	
	}
	function highlightBox(div, shown) {
		$(div).animate({
				opacity: shown
		});
	}
	function rotateBanner() {
		if(i < banners) {
				bannerScroll(i); //Trigger the paging and slider function
				n=i+1;
				i ++;
			} else {
				bannerScroll(0)
				i = 1;
			}
	}
	rotateSwitch = function(){
		play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds
			rotateBanner();
			}, bdelay);
	}
	rotateSwitch();
});
