// JavaScript Document
<!--
// jeff
// www.huntingground.freeserve.co.uk

is1hbArr=[

["images/pic01sm.jpg","images/pic01.jpg"],
["images/pic02sm.jpg","images/pic02.jpg"],
["images/pic03sm.jpg","images/pic03.jpg"],
["images/pic04sm.jpg","images/pic04.jpg"],
["images/pic05sm.jpg","images/pic05.jpg"],
["images/pic06sm.jpg","images/pic06.jpg"],
["images/pic01sm.jpg","images/pic01.jpg"],
["images/pic02sm.jpg","images/pic02.jpg"],
["images/pic03sm.jpg","images/pic03.jpg"],
["images/pic04sm.jpg","images/pic04.jpg"],
["images/pic05sm.jpg","images/pic05.jpg"],
["images/pic06sm.jpg","images/pic06.jpg"],
["images/pic01sm.jpg","images/pic01.jpg"]

]

dualFade=0 // 0 = fades in, 1 = fades out then in

imageSize=100 // % size the image is shown at, if set to zero the fixed width and heights are used
fixedWidth=75 // set a fixed width
fixedHeight=50 // set a fixed height
spacerWidth=0 // space between images

autoWidth=0 // 0 = no, 1 = yes, sets the width to the widest image size

defaultSpeed=10
maxSpeed=40

totalWidth=0
displayWidth=0
displayHeight=0
speed=defaultSpeed

preload=new Array()
for(var i=0;i<is1hbArr.length;i++){
preload[i]=new Image()
preload[i].src=is1hbArr[i][0]
}

function initHS1F(){
imgBox=document.getElementById("thumb_box") // element containing the images
imgNum=is1hbArr.length // number of images

if(document.getElementById&&document.all&&document.compatMode!="CSS1Compat"){
ieBorder=parseInt(document.getElementById("inner_box").style.borderWidth)*2
}
else{
ieBorder=0
}

for(var i=0;i<imgNum;i++){ // set image size

newImg=document.createElement("IMG")
newImg.setAttribute("src",is1hbArr[i][0])
newImg.setAttribute("id","pic"+i)
newImg.i=i
newImg.onclick=function(){initFade(this.i)}

newImg.onmouseover=function(){toggleOpac(this)}
newImg.onmouseout=function(){toggleOpac(this)}

if(imageSize!=0){ // use percentage size
newImg.style.width=preload[i].width/100*imageSize+"px"
newImg.style.height=preload[i].height/100*imageSize+"px"
}
else{ // use fixed size
newImg.style.width=fixedWidth+"px"
newImg.style.height=fixedHeight+"px"
}

imgBox.appendChild(newImg)

}

for(var i=0;i<imgNum;i++){
totalWidth+=(document.getElementById("pic"+i).offsetWidth)
document.getElementById("pic"+i).style.marginRight=spacerWidth+"px"

if(autoWidth==1){
if(document.getElementById("pic"+i).offsetWidth>displayWidth){
displayWidth=document.getElementById("pic"+i).offsetWidth
}

}
else{
//displayWidth=parseInt(document.getElementById("inner_box").style.width)
displayWidth=700
}


if(document.getElementById("pic"+i).offsetHeight>displayHeight){
displayHeight=document.getElementById("pic"+i).offsetHeight
}

}

for(var i=0;i<imgNum;i++){ // vertically center images
document.getElementById("pic"+i).style.marginBottom=(displayHeight-document.getElementById("pic"+i).height)/2+"px"
}

totalWidth=totalWidth+(imgNum*spacerWidth)

imgHolderWidth=displayWidth+ieBorder
document.getElementById("outer_box").style.width=imgHolderWidth+"px"
document.getElementById("inner_box").style.width=imgHolderWidth+"px"
imgBox.style.width=totalWidth+"px"

imgHolderHeight=displayHeight+ieBorder
document.getElementById("inner_box").style.height=imgHolderHeight+"px" 
document.getElementById("inner_box").style.clip="rect(0,"+(imgHolderWidth+"px")+","+(imgHolderHeight+"px")+",0)"

//start
document.getElementById("pic0").onclick();
}

leftTimer=""
function scrollHS1F(n){

clearTimeout(leftTimer)
imgBoxPos=parseInt(imgBox.style.left)
if(n==1){
imgBoxPos-=speed
}
else{
imgBoxPos+=speed
}

imgBox.style.left=imgBoxPos+"px"
leftTimer=setTimeout("scrollHS1F("+n+")",50)

if(n==1&&imgBoxPos< -(totalWidth-imgHolderWidth)+(spacerWidth-ieBorder)){
imgBox.style.left=-(totalWidth-imgHolderWidth)+spacerWidth-ieBorder+"px"
clearTimeout(leftTimer)
}

if(n==0&&imgBoxPos> 0-speed){
imgBox.style.left=0
clearTimeout(leftTimer)
}

}

function fast(){
speed=maxSpeed
}

function slow(){
speed=defaultSpeed
}

function pause(){
clearTimeout(leftTimer)
}

lastN=0
count=0
fading=0
fadeStep = 2
fadeSpeed=10
minFadeValue=0

function initFade(n){
count=n
if(lastN==n && n!=0||fading==1){return}

if(dualFade==0){fadeValue=0}
else{fadeValue=100}

picNum=n
lastN=n
fadePic()
}

function fadePic(){
displayEl=document.images["bigpic"]
fading=1
fadeValue -= fadeStep
fadeTimer=setTimeout("fadePic()",fadeSpeed)

if(displayEl.filters){displayEl.filters.alpha.opacity=fadeValue}
else{displayEl.style.MozOpacity=(fadeValue/100)-0.1}

if(fadeValue<minFadeValue){ // for fade out first
fadeValue=minFadeValue
fadeStep= -fadeStep
displayEl.src=is1hbArr[picNum][1]
if (picNum+1==is1hbArr.length)
	nextPicNum = 0;
else
	nextPicNum = picNum+1;
displayEl.onclick = function(){initFade(nextPicNum);};
displayEl.onmouseover = function(){this.style.cursor = 'pointer';}
displayEl.onmouseout = function(){this.style.cursor = 'auto';}
}


if(fadeValue>=100){ // fade in
fadeValue=100
fadeStep= -fadeStep
fading=0
clearTimeout(fadeTimer)
}
}

maxOpac=70
minOpac=100

function toggleOpac(obj){

if(obj.filters){

if(obj.filters.alpha.Opacity==minOpac){
obj.filters.alpha.Opacity=maxOpac}
else{obj.filters.alpha.Opacity=minOpac}

}
else{

if(obj.style.opacity == maxOpac/100){
obj.style.opacity = minOpac/100}
else{obj.style.opacity = maxOpac/100}

}

}

//add onload="initHS1F()" to the opening BODY tag

// -->
