//Specify the slide's content (don't delete <nobr> tag)
//Keep all content on ONE line, and backslash any single quotations (ie: that\'s great):

// convert all characters to lowercase to simplify testing
var agt=navigator.userAgent.toLowerCase();

// *** BROWSER VERSION ***
var is_gecko = (agt.indexOf('gecko') != -1);

////NO NEED TO EDIT BELOW THIS LINE////////////
//slidespeed=(document.all)? slidespeed : Math.max(1, slidespeed-1) //slow speed down by 1 for NS

slidespeed=(document.all)? slidespeed : Math.max(1, slidespeed) 

var copyspeed=slidespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById

if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+slidecontent+'</span>')

var actualwidth=''
var maxSlide=0;

function setSlideCounter() {
  if (iedom){
    actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
  }
  else if (document.layers){
    actualwidth=ns_slide.document.width
  }
  maxSlide=actualWidth/slidewidth;
}

var cross_slide, ns_slide;

function populate(){
if (iedom){
actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
cross_slide=document.getElementById? document.getElementById("ieslide") : document.all.ieslide
cross_slide.style.left=0+"px"
cross_slide.innerHTML=slidecontent
}
else if (document.layers){
ns_slide=document.ns_slide.document.ns_slide
ns_slide.left=parseInt(0)
ns_slide.document.write(slidecontent)
ns_slide.document.close()
actualwidth=ns_slide.document.width
}
}
/*
if (is_gecko){
lefttime=setInterval("scrollslide()",35)
lefttime=setInterval("scrollslide2()",35)
} else {
lefttime=setInterval("scrollslide()",20)
lefttime=setInterval("scrollslide2()",20)
}
}
*/

window.onload=populate


function scrollslide(direction) {
if (direction<0) { //left
  if (iedom){
    if (parseInt(actualwidth) + parseInt(cross_slide.style.left) - parseInt(slidespeed) > parseInt(slidewidth)) {
      cross_slide.style.left = parseInt(cross_slide.style.left) - parseInt(slidespeed) +"px";
    } else {
      cross_slide.style.left = parseInt(cross_slide.style.left) - (parseInt(actualwidth)+parseInt(cross_slide.style.left)- parseInt(slidewidth)) +"px";
    }
  }
  else if (document.layers){
    if (actualwidth + ns_slide.left - parseInt(slidespeed) > slidewidth) {
      ns_slide.left -= parseInt(slidespeed)
    } else {
      ns_slide.left -= actualwidth + ns_slide.left - slidewidth;
    }
  }
} else {
  if (iedom){
    if ( parseInt(cross_slide.style.left) + parseInt(slidespeed) < 0) {
      cross_slide.style.left = parseInt(cross_slide.style.left) + parseInt(slidespeed) +"px";
    } else {
      cross_slide.style.left = "0px";
    }
  }
  else if (document.layers){
    if ( ns_slide.left + parseInt(slidespeed) < 0) {
      ns_slide.left += parseInt(slidespeed);
    } else {
      ns_slide.left = "0px";
    }
  }
}
}

function scrollslide_bk(direction) {
if (direction<0) { //left
  if (iedom){
    if (parseInt(actualwidth) + parseInt(cross_slide.style.left) - parseInt(slidewidth) > parseInt(slidewidth)) {
      cross_slide.style.left = parseInt(cross_slide.style.left) - parseInt(slidewidth) +"px";
    } else {
      cross_slide.style.left = parseInt(cross_slide.style.left) - (parseInt(actualwidth)+parseInt(cross_slide.style.left)- parseInt(slidewidth)) +"px";
    }
  }
  else if (document.layers){
    if (ns_slide.left-slidewidth>0) {
      ns_slide.left -= slidewidth
    }
  }
} else {
  if (iedom){
    if ( parseInt(cross_slide.style.left) + parseInt(slidewidth) < 0) {
      cross_slide.style.left = parseInt(cross_slide.style.left) + parseInt(slidewidth) +"px";
    } else {
      cross_slide.style.left = "0px";
    }
  }
  else if (document.layers){
    if (ns_slide.left+slidewidth < actualwidth ) {
      ns_slide.left+=parseInt(slidewidth)
    }
  }
}
}

function animated_scrollslide(){
if (iedom){
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)+parseInt(actualwidth)+8+"px";
}
}
else if (document.layers){
if (ns_slide_bis.left>(actualwidth*(-1)+8))
ns_slide_bis.left-=copyspeed
else
ns_slide_bis.left=parseInt(slidewidth)+8
}
}

if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){
write('<div style="position:relative;width:'+slidewidth+';height:'+slideheight+';overflow:hidden">')
write('<div style="position:absolute;width:'+slidewidth+';height:'+slideheight+';background-color:'+slidebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=slidespeed">')
write('<div id="ieslide" style="position:absolute;left:0px;top:0px;width:'+3000+'px"></div>')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+slidewidth+' height='+slideheight+' name="ns_slide" bgColor='+slidebgcolor+'>')
write('<layer width='+3000+'name="ns_slide" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=slidespeed"></layer>')
write('</ilayer>')
}
document.write('</td></table>')
}
}
