myImages=[
<!-- scrolling picture, full size image, alternate text -->

["http://i51.photobucket.com/albums/f388/combatveterans/2009/Chapter%208/Chapter%208%20in%20Iraq/Iraq2009D.jpg", "http://i51.photobucket.com/albums/f388/combatveterans/2009/Chapter%208/Chapter%208%20in%20Iraq/Iraq2009D.jpg", "Chapter 8 in Iraq"],

["http://i51.photobucket.com/albums/f388/combatveterans/2008/National/10th%20Birthday%20Party/100_0537.jpg","http://i51.photobucket.com/albums/f388/combatveterans/2008/National/10th%20Birthday%20Party/100_0537.jpg","10th Birthday of CVI, Cake"],

["http://i51.photobucket.com/albums/f388/combatveterans/2008/National/10th%20Birthday%20Party/100_0538.jpg","http://i51.photobucket.com/albums/f388/combatveterans/2008/National/10th%20Birthday%20Party/100_0538.jpg","Tracker with the Cake"],

["http://i51.photobucket.com/albums/f388/combatveterans/2007/National/Attila's%20BBQ/032906037.jpg","http://i51.photobucket.com/albums/f388/combatveterans/2007/National/Attila's%20BBQ/032906037.jpg","2007 National at Attila's"],

["http://i51.photobucket.com/albums/f388/combatveterans/2008/Chapter%203/POWMIA%20Bike%20Raffle/100_0004.jpg","http://i51.photobucket.com/albums/f388/combatveterans/2008/Chapter%203/POWMIA%20Bike%20Raffle/100_0004.jpg","Chapter 3 POW/MIA Bike Raffle"],

["http://i51.photobucket.com/albums/f388/combatveterans/2007/Chapter%201/Chapter%201%20Memorial%20Day%20Ride%202007/044.jpg","http://i51.photobucket.com/albums/f388/combatveterans/2007/Chapter%201/Chapter%201%20Memorial%20Day%20Ride%202007/044.jpg","Memorial Day at the Fossil Pit"],

["http://i51.photobucket.com/albums/f388/combatveterans/2007/Chapter%201/Chapter%201%20Wild%20Hogs%20Ride/hograllytothemovies034.jpg","http://i51.photobucket.com/albums/f388/combatveterans/2007/Chapter%201/Chapter%201%20Wild%20Hogs%20Ride/hograllytothemovies034.jpg","Chapter 1 goes to see Wild Hogs"],

["http://i51.photobucket.com/albums/f388/combatveterans/2006/Chapter%201/SSGT%20Joey%20Kane%20Escort/image005.jpg","http://i51.photobucket.com/albums/f388/combatveterans/2006/Chapter%201/SSGT%20Joey%20Kane%20Escort/image005.jpg","SSGT Joey Kane funeral escort"],

["http://i51.photobucket.com/albums/f388/combatveterans/2006/Chapter%201/Soldier%20Down%20Ride/Solderdownrun23.jpg","http://i51.photobucket.com/albums/f388/combatveterans/2006/Chapter%201/Soldier%20Down%20Ride/Solderdownrun23.jpg","2006 Soldier Down Run"],

["http://i51.photobucket.com/albums/f388/combatveterans/2004/Chapter%205/Armed%20Forces%20Day%20Parade/P1010115.jpg","http://i51.photobucket.com/albums/f388/combatveterans/2004/Chapter%205/Armed%20Forces%20Day%20Parade/P1010115.jpg","Chapter 5 Armed Forces Day Parade, Bremerton"]



// no comma at the end of last index

]

dir=0 // 0 = left 1 = right
speed=3
imageSize=0 // % set to zero to use fixedWidth and fixedHeight values
fixedWidth=400// set a fixed width
fixedHeight=240// set a fixed height
spacerWidth=20 // space between images

popupLeft= 100 // pixels
popupTop= 100 // pixels

biggest=0
ieBorder=0
totalWidth=0
hs3Timer=null

preload=new Array()
for(var i=0;i<myImages.length;i++){
preload[i]=new Image()
preload[i].src=myImages[i][0]
}

function initHS3(){
scroll1=document.getElementById("scroller1")

for(var j=0;j<myImages.length;j++){
scroll1.innerHTML+='<img id="pic'+j+'" src="'+preload[j].src+'" alt="'+myImages[j][2]+'" title="'+myImages[j][2]+'" onclick="showBigPic('+j+')">'
if(imageSize!=0){ // use percentage size
newWidth=preload[j].width/100*imageSize
newHeight=preload[j].height/100*imageSize
}
else{ // use fixed size
newWidth=fixedWidth
newHeight=fixedHeight
}

document.getElementById("pic"+j).style.width=newWidth+"px"
document.getElementById("pic"+j).style.height=newHeight+"px"

if(document.getElementById("pic"+j).offsetHeight>biggest){
biggest=document.getElementById("pic"+j).offsetHeight
}

document.getElementById("pic"+j).style.marginLeft=spacerWidth+"px"

totalWidth+=document.getElementById("pic"+j).offsetWidth+spacerWidth

}

totalWidth+=1
for(var k=0;k<myImages.length;k++){ // vertically center images
document.getElementById("pic"+k).style.marginBottom = (biggest-document.getElementById("pic"+k).offsetHeight)/2+"px"
}

if(document.getElementById&&document.all){
ieBorder=parseInt(document.getElementById("scrollbox").style.borderTopWidth)*2
}

document.getElementById("scrollbox").style.height=biggest+ieBorder+"px"

scroll1.style.width=totalWidth+"px"

scroll2=document.getElementById("scroller2")
scroll2.innerHTML=scroll1.innerHTML
scroll2.style.left= (-scroll1.offsetWidth)+"px"
scroll2.style.top= -scroll1.offsetHeight+"px"
scroll2.style.width=totalWidth+"px"

if(dir==1){
speed= -speed
}

scrollHS3()
}


function scrollHS3(){
if(paused==1){return}
clearTimeout(hs3Timer)

scroll1Pos=parseInt(scroll1.style.left)
scroll2Pos=parseInt(scroll2.style.left)

scroll1Pos-=speed
scroll2Pos-=speed

scroll1.style.left=scroll1Pos+"px"
scroll2.style.left=scroll2Pos+"px"

hs3Timer=setTimeout("scrollHS3()",50)

if(dir==0){
if(scroll1Pos< -scroll1.offsetWidth){
scroll1.style.left=scroll1.offsetWidth+"px"
}

if(scroll2Pos< -scroll1.offsetWidth){
scroll2.style.left=scroll1.offsetWidth+"px"
}
}

if(dir==1){
if(scroll1Pos>parseInt(document.getElementById("scrollbox").style.width)){
scroll1.style.left=scroll2Pos+ (-scroll1.offsetWidth)+"px"
}

if(scroll2Pos>parseInt(document.getElementById("scrollbox").style.width)){
scroll2.style.left=scroll1Pos+ (-scroll2.offsetWidth)+"px"
}
}

}

st=null
function pause(){
clearTimeout(hs3Timer)
clearTimeout(st)
}

function reStartHS3(){
clearTimeout(st)
st=setTimeout("scrollHS3()",100)
}

paused=0
picWin=null

function showBigPic(p){

if(myImages[p][1]!=""){
paused=1

if(picWin&&picWin.open&&!picWin.closed){picWin.close()} // if picWin exists close it

if(myImages[p][1].indexOf("jpg")!=-1){
bigImg=new Image()
bigImg.src=myImages[p][1]

data="\n<center>\n<img src='"+bigImg.src+"'>\n</center>\n"
var winProps = "left= "+popupLeft+", top = "+popupTop+", width="+(bigImg.width+20)+", height="+(bigImg.height+20)+", scrollbars=no, toolbar=no, directories=no, menu bar=no, resizable=yes, status=no"
picWin=window.open("","win1",winProps)
picWin.document.write("<HTML>\n<HEAD>\n<TITLE></TITLE>\n")
picWin.document.write("</HEAD>\n")
picWin.document.write("<BODY bgcolor='black' topmargin=10px leftmargin=10>\n")
picWin.document.write("<div id=\"display\">"+data+"</div>")
picWin.document.write("\n</BODY>\n</HTML>")
}
else{
picWin=window.open(myImages[p][1])
}

}

}

window.onfocus=function(){
paused=0
scrollHS3()
}

onunload=function(){ // close the popup when leaving page
if(picWin&&picWin.open&&!picWin.closed){
picWin.close()
}
}


