﻿/*scrollStep=3;

timerLeft="";
timerRight="";

function toLeft(id){
  document.getElementById(id).scrollLeft=0;
}

function scrollDivLeft(id){

  clearTimeout(timerRight); 

  document.getElementById(id).scrollLeft+=scrollStep;

  timerRight=setTimeout("scrollDivLeft('"+id+"')",10);

}

function scrollDivRight(id){
  clearTimeout(timerLeft);
  document.getElementById(id).scrollLeft-=scrollStep;
  timerLeft=setTimeout("scrollDivRight('"+id+"')",10);
}

function toRight(id){
  document.getElementById(id).scrollLeft=document.getElementById(id).scrollWidth;
}

function stopMe(){
  clearTimeout(timerRight);
  clearTimeout(timerLeft);
}
*/
//Specify the slider's images
var finalslide='';
var slidespeed=3;
//Specify gap between each image (use HTML):


//Specify pixels gap between each slideshow rotation (use integer):
var slideshowgap=0;

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=slidespeed;
//leftrightslide='<nobr>'+leftrightslide+'</nobr>';
var iedom=document.all||document.getElementById;
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+leftrightslide+'</span>');
var actualwidth='';
var cross_slide, cross_slide2;

function fillup()
{
cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2;
cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3;
cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide;
actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth;
cross_slide2.style.left=actualwidth+slideshowgap+"px";
}

window.onload=fillup;

function slideleft()
{   
    if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+8))
    cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px";
    else  
    cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px";
    
    if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+8))
    cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px";
    else
    cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px";
}

function slideright()
{
    if (parseInt(cross_slide.style.left)<(actualwidth+8))
    cross_slide.style.left=parseInt(cross_slide.style.left)+copyspeed+"px";
    else
    cross_slide.style.left=parseInt(cross_slide2.style.left)+(actualwidth+slideshowgap)*(-1)+"px";

    if (parseInt(cross_slide2.style.left)<(actualwidth+8))
    cross_slide2.style.left=parseInt(cross_slide2.style.left)+copyspeed+"px";
    else
    cross_slide2.style.left=parseInt(cross_slide.style.left)+(actualwidth+slideshowgap)*(-1)+"px";
}

function moveleft()
{
    lefttime = setInterval("slideleft()",30);
}
function moveright()
{
    righttime = setInterval("slideright()",30);
}
function stopleftscroll()
{
    clearInterval(lefttime);
}
function stoprightscroll()
{
    clearInterval(righttime);
}

