// JavaScript Document
// ********** Defining Area **********
/*
data=new Array()
data[0]=new Array("images/thumb11.jpg","Thumbnail SlideShow Created By ApacheJeff","images/thumb11.jpg")
data[1]=new Array("images/thumb12.jpg","Alt text for Image 2","images/thumb12.jpg")
data[2]=new Array("images/thumb13.jpg","Alt text for Image 3","images/thumb13.jpg")
data[3]=new Array("images/thumb14.jpg","Alt text for Image 4","images/thumb14.jpg")
data[4]=new Array("images/thumb15.jpg","Alt text for Image 5","images/thumb15.jpg")
data[5]=new Array("images/thumb16.jpg","Alt text for Image 6","images/thumb16.jpg")
data[6]=new Array("images/thumb17.jpg","Alt text for Image 7","images/thumb17.jpg")
*/
imgPlaces=5 // number of images visible
imgWidth=214 // width of the images
imgHeight=106 // height of the images
imgSpacer=2 // space between the images
container_Width=600	//  width of container
container_Height=106	// height of container
dir=0 // 0 = left, 1 = right
vis3Window=1 // 0 = Open a new window for links 0 = no 1 = yes
// ********** End Defining Area **********

moz=document.getElementById&&!document.all
step=1
timer=""
speed=35
nextPic=0
initPos=new Array()
nowDivPos=new Array()
function initVIS3(){
if(document.getElementById("Container")){
for(var i=0;i<imgPlaces+1;i++){ // create image holders
newImg=document.createElement("IMG")
newImg.setAttribute("id","pic_"+i)
newImg.setAttribute("src","")
newImg.style.position="absolute"
newImg.style.width=imgWidth+"px"
newImg.style.height=imgHeight+"px"
newImg.style.border=0
newImg.alt=""
newImg.i=i
//newImg.onclick=function(){vis3Win(data[this.i][2])}
document.getElementById("display_area").appendChild(newImg)
}
containerEL=document.getElementById("Container")
displayArea=document.getElementById("Display_area")
pic0=document.getElementById("pic_0")
containerBorder=(document.compatMode=="CSS1Compat"?0:parseInt(containerEL.style.borderWidth)*2)
containerWidth=((imgPlaces)*imgWidth)+((imgPlaces-1)*imgSpacer)
containerEL.style.width=container_Width;	//containerWidth+(!moz?containerBorder:"")+"px"
containerEL.style.height=container_Height;	//imgHeight+(!moz?containerBorder:"")+"px"
displayArea.style.height=containerWidth+"px"
displayArea.style.clip="rect(0,"+(containerWidth+"px")+","+(imgHeight+"px")+",0)" 
imgPos= -pic0.width
for(var i=0;i<imgPlaces+1;i++){
currentImage=document.getElementById("pic_"+i)
if(dir==0){imgPos+=(pic0.width)+imgSpacer} // if up
initPos[i]=imgPos
if(dir==0){currentImage.style.left=initPos[i]+"px"} // if up
if(dir==1){ // if down
document.getElementById("pic_"+[(imgPlaces-i)]).style.left=initPos[i]+"px"
imgPos+=(pic0.width)+imgSpacer
}
if(nextPic==data.length){nextPic=0}
currentImage.src=data[nextPic][0]
currentImage.alt=data[nextPic][1]
currentImage.i=nextPic
//currentImage.onclick=function(){vis3Win(data[this.i][2])}
nextPic++
}
scrollVIS3()
}
}

timer=""
function scrollVIS3(){
clearTimeout(timer)
for(var i=0;i<imgPlaces+1;i++){
currentImage=document.getElementById("pic_"+i)
nowDivPos[i]=parseInt(currentImage.style.left)
if(dir==0){nowDivPos[i]-=step}
if(dir==1){nowDivPos[i]+=step}
if(dir==0&&nowDivPos[i]<= -(pic0.width+imgSpacer) ||dir==1&&nowDivPos[i]>containerWidth){
if(dir==0){currentImage.style.left=containerWidth+imgSpacer+"px"}
if(dir==1){currentImage.style.left= -pic0.height-(imgSpacer*2)+"px"}
if(nextPic>data.length-1){nextPic=0}
currentImage.src=data[nextPic][0]
currentImage.alt=data[nextPic][1]
currentImage.i=nextPic
//currentImage.onclick=function(){vis3Win(data[this.i][2])}
nextPic++
}
else{
currentImage.style.left=nowDivPos[i]+"px"
}
}
timer=setTimeout("scrollVIS3()",speed)
}
function stopVIS3(){
clearTimeout(timer)
}

function vis3Win(loc){
if(loc==""){return}
if(vis3Window==0){
location=loc
}
else{
//window.open(loc)
newin=window.open(loc,'win1','left=430,top=340,width=300,height=300') // use for specific size and positioned window
newin.focus()
}
}

