var sliderwidth=800
var sliderheight=100
var sliderleft=0
var slidespeed=1
var slideshowgap=5
var slidebgcolor="#FFFFFF"

var leftrightslide=new Array()
for (p=0;p<pictures.length;p++){
leftrightslide[p]='<img src="'+pictures[p]+'">'
}
leftrightslide='<nobr>'+leftrightslide.join(" ")+'</nobr>'

var ie4=document.all
var dom=document.getElementById

if (ie4||dom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+leftrightslide+'</span>')

var speed=slidespeed
var actualwidth=''
var cross_slide, ns_slide
var slidersize='width:'+sliderwidth+'px;height:'+sliderheight+'px'

function fillup(){
if (ie4||dom){
cross_slide=dom? document.getElementById("test2") : document.all.test2
cross_slide2=dom? document.getElementById("test3") : document.all.test3
cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
actualwidth=ie4? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth
cross_slide2.style.left=actualwidth+slideshowgap+"px"
}
else if (document.layers){
ns_slide=document.ns_slidemenu.document.ns_slidemenu2
ns_slide2=document.ns_slidemenu.document.ns_slidemenu3
ns_slide.document.write(leftrightslide)
ns_slide.document.close()
actualwidth=ns_slide.document.width
ns_slide2.left=actualwidth+slideshowgap
ns_slide2.document.write(leftrightslide)
ns_slide2.document.close()
}
lefttime=setInterval("slideleft()",20)
}

function makecenter(){
if ((document.body)&&(document.body.clientWidth)) sliderleft=(document.body.clientWidth-sliderwidth)>>1
else if (document.width) sliderleft=(document.width-sliderwidth)>>1
if (sliderleft){
if (ie4||dom){
container0=dom? document.getElementById("test0") : document.all.test0
container1=dom? document.getElementById("test1") : document.all.test1
container0.style.left=sliderleft+'px'
container1.style.left=sliderleft+'px'
}
else {
container=document.ns_slidemenu
container.document.left=sliderleft
}
}
}

if ((document.body)&&(document.body.clientWidth)) sliderleft=(document.body.clientWidth-sliderwidth)>>1
else if (document.width) sliderleft=(document.width-sliderwidth)>>1
window.onload=fillup
window.onresize=makecenter

function slideleft(){
if (ie4||dom){
if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+speed))
cross_slide.style.left=parseInt(cross_slide.style.left)-speed+"px"
else
cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"

if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+speed))
cross_slide2.style.left=parseInt(cross_slide2.style.left)-speed+"px"
else
cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"

}
else if (document.layers){
if (ns_slide.left>(actualwidth*(-1)+speed))
ns_slide.left-=speed
else
ns_slide.left=ns_slide2.left+actualwidth+slideshowgap

if (ns_slide2.left>(actualwidth*(-1)+speed))
ns_slide2.left-=speed
else
ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
}
}

if (ie4||dom||document.layers){
with (document){
if (ie4||dom){
write('<div id="test0" style="position:relative;left:'+sliderleft+'px;'+slidersize+';overflow:hidden">')
write('<div id="test1" style="position:absolute;left:'+sliderleft+'px;'+slidersize+';background-color:'+slidebgcolor+'" onMouseover="speed=0" onMouseout="speed=slidespeed">')
write('<div id="test2" style="position:absolute;left:0px;top:0px"></div>')
write('<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>')
write('</div></div>')
}
else if (document.layers){
write('<ilayer name="ns_slidemenu" left='+sliderleft+' width='+sliderwidth+' height='+sliderheight+' bgColor='+slidebgcolor+'>')
write('<layer name="ns_slidemenu2" left=0 top=0 onMouseover="speed=0" onMouseout="speed=slidespeed"></layer>')
write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="speed=0" onMouseout="speed=slidespeed"></layer>')
write('</ilayer>')
}
}
}
