// JavaScript Document
	var clientintervalid;
	
	function slideJump(page) {
    var $active = $('#scrollcontainer span.active');
		//var page = $(this).attr("pg");
	  var $next = $('#scrollbox'+page);

		if ( $next.length == 0) $next =  $('#scrollcontainer span:first'); 

		$(".scrollpage span").removeClass("pageactive");
		$(".scrollpage #page"+page).addClass("pageactive");

		$active.removeClass('active');	
		$next.css({opacity: 0.0});
		$next.addClass('active');
		$next.animate({opacity: 1.0}, 750);
	}
	
	function nextSlide() {
    var $active = $('#scrollcontainer span.active');
	  var $next = $active.next();
		
		if ( $next.length == 0) $next =  $('#scrollcontainer span:first'); 

		var page = $next.attr("pg");
		$(".scrollpage span").removeClass("pageactive");
		$(".scrollpage #page"+page).addClass("pageactive");

		$active.removeClass('active');	
		$next.css({opacity: 0.0});
		$next.addClass('active');
		$next.animate({opacity: 1.0}, 750);
	}

	function prevSlide() {
    var $active = $('#scrollcontainer span.active');
	  var $prev = $active.prev();
		
		if ( $prev.length == 0) $prev =  $('#scrollcontainer span:last'); 

		var page = $prev.attr("pg");
		$(".scrollpage span").removeClass("pageactive");
		$(".scrollpage #page"+page).addClass("pageactive");

		$active.removeClass('active');	
		$prev.css({opacity: 0.0});
		$prev.addClass('active');
		$prev.animate({opacity: 1.0}, 750);
	}

	$(function() {
			clientintervalid = setInterval( "nextSlide()", 9500 );
	});
	
$(document).ready(function(){

  $(".nextclientslide").click(function(){
		clearInterval(clientintervalid);		
		$("#lblautoscroll").fadeOut("normal");
		nextSlide();																 
  });


  $(".prevclientslide").click(function(){
		clearInterval(clientintervalid);																		 
		$("#lblautoscroll").fadeOut("normal");
		prevSlide();																 
  });
	
	$(".scrollpagejump").click(function(){
		clearInterval(clientintervalid);	
		$("#lblautoscroll").fadeOut("normal");
		var pagenum = $(this).attr("pg");
		slideJump(pagenum);																 
  });
																			

});