﻿var c=0;
var t;
var numslides = 5;
var onslide = 1;
var width = 950;
var timeout = 6000;
var slidetime = 1000;
var stopslide = false;

function stopit()
{
	stopslide = true;
	clearTimeout(t); 
}
function startit()
{
	stopslide = false;
	t=setTimeout("slideshow()",timeout);
	
}

function confirmdelete(title)
{
	return confirm("Do you really wish to delete " + title + "?")
}


function slideright(width, timespan)
{
    $("#wrapper").animate({marginLeft: "-="+width+"px"}, timespan);
}
function slideleft(width, timespan)
{
    $("#wrapper").animate({marginLeft: "+="+width+"px"}, timespan);
}

function slideshow()
{
	if(!stopslide)
	{
	
		if(onslide >= numslides)
		{
			slideleft((width*(numslides-1)), 500 + (250*(numslides-1)));
			onslide = 1;
		}
		else
		{
			slideright(width, 1000);
			onslide++;
		}
		
		t=setTimeout("slideshow()",timeout);
	}
}


$(document).ready(function(){
	t=setTimeout("slideshow()",timeout);
/*
    $("a.right").click(function(){
        $("#wrapper").animate({
            marginLeft: "-=500px"
        }, 1000);
    });
 
    $("a.left").click(function(){
        $("#wrapper").animate({
            marginLeft: "+=500px"
        }, 1000);
    });*/
});
