function startSlideShow(time, order, call)
{
var resetTime = time;
var timeout1 = $.timeout(time);
var timeout2 = $.timeout(time * 2);
var timeout3 = $.timeout(time * 3);

if (call == 'app')
{
timeout1.done(function () { $('.itemOne').click(); }); 
timeout2.done(function () { $('.itemTwo').click(); }); 
timeout3.done(function () { $('.itemThree').click(); resetThis(resetTime, 'dec', 'code'); });
}

if (order == 'asc' && call == 'code')
{
timeout1.done(function () { $('.itemTwo').click(); }); 
timeout2.done(function () { $('.itemThree').click(); resetThis(resetTime, 'dec', 'code'); });
}

if (order == 'dec' && call == 'code')
{
timeout1.done(function () { $('.itemTwo').click(); }); 
timeout2.done(function () { $('.itemOne').click(); resetThis(resetTime, 'asc', 'code'); }); 
}


 $('.stopSlideShow').click(function () {
timeout1.clear();
timeout2.clear(); 
timeout3.clear(); 
});

$(window).blur(function(){
timeout1.clear();
timeout2.clear(); 
timeout3.clear(); 
});

}

function resetThis(time, order, call)
{
startSlideShow(time, order, call);
}
