<!--
// realised by apachejeff
// www.huntingground.freeserve.co.uk

// ********** User Defining Area **********

data=new Array()
data[0]=new Array("images/guesthouse.jpg" ,"Guesthouse","guesthouse.htm")
data[1]=new Array("images/m_4_small.jpg","The cottage","the_cottage.htm")
data[2]=new Array("images/beach_house.jpg","Beach House","beach_house.htm")
data[3]=new Array("images/chauncey1.jpg","Chauncey Garden","chauncey_garden.htm")
data[4]=new Array("images/mountain_view.jpg","Mountain View","mountain_view.htm")
data[5]=new Array("images/pruttons_place.jpg","Pruttons Place","pruttons_place.htm")

img_places=4 // number of images visible
img_width=90 // width of the images
img_height=67 // height of the images
img_spacer=4 // space between the images
rdm_img=0 // 0 = no 1 = yes show images at random
moz=document.getElementById&&!document.all

dir=0 // 0 = up 1 = down

border=0 // container border width
bordertype="ridge" // container border type
bordercolor="#afa684" // container border colour
borderbackground="#E2E6BF" // container background colour

css_positioning=0 // use CSS to position the display 0 = no 1 = yes
css_left=400 // used if css_positioning is selected
css_top=100 // used if css_positioning is selected

new_window=0 // 0 = Open a new window for links 0 = no 1 = yes

// ********** End User Defining Area **********

if(rdm_img==1){ // generate random images list

temp_array=new Array()
for(i=0;i<data.length;i++){ // create an array identical to data array
temp_array[i]=data[i]
}

rdm_array=new Array() // random images array
for(p=0;p<data.length;p++){ // create an array of randomly selected images
rndnum=Math.floor(Math.random()*(temp_array.length)) // select a random image from temp_array
rdm_array[p]=temp_array[rndnum] // put selected image in rdm_array
temp_array.splice(rndnum,1) // remove selected image from temp_array
}

}

step=1
nextpic=0
speed=30
next_right=""
initpos=new Array()
nowdivpos=new Array()

function create_thumbshow(){

if(css_positioning==0){ document.write("<div id=\"container\" style=\"position:relative; width:0px;height:0px; border:"+border+"px "+bordertype+" "+bordercolor+";background:"+borderbackground+"\">")
}
else{
document.write("<div id=\"container\" style=\"position:absolute; left:"+css_left+"px; top:"+css_top+"px; width:0px;height:0px; border:"+border+" "+bordertype+" "+bordercolor+";background:"+borderbackground+"\">")
}

document.write("<div id=\"display_area\" style=\"position:absolute; left:0; top:0; width:0px; height:0px; clip:rect(0,0,0,0)\" onmouseover=\"stopme()\" onmouseout=\"animate()\">")

for(i=0;i<img_places+1;i++){ // create image holders
document.write("<div id=\"div_"+[i]+"\" style=\"position:absolute\">")
document.write("<a id=\"loc_"+[i]+"\" href=\"\" onclick=\"newwin(this.location);return false\">")
document.write("<img src=\"\" id=\"pic_"+[i]+"\" width=\""+img_width+"\" height=\""+img_height+"\" alt=\"\" border=\"0\">")
document.write("</a>")
document.write("</div>")
}
document.write("</div>")
document.write("</div>")
}

function init_thumbshow(){
container_border=parseInt(document.getElementById("container").style.borderWidth)*2
container_height=((img_places)*img_height)+((img_places-1)*img_spacer)
document.getElementById("container").style.width=img_width+(!moz?container_border:"")
document.getElementById("container").style.height=container_height+(!moz?container_border:"")

displayarea=document.getElementById("display_area")
displayarea.style.height=container_height
displayarea.style.clip=(!moz?"rect(0,"+img_width+","+container_height+",0)":"rect(0,"+img_width+","+container_height+",0)")

img_pos= -document.getElementById("pic_0").height-border

for(i=0;i<img_places+1;i++){

if(dir==0){img_pos+=(document.getElementById("pic_0").height)+img_spacer} // if up

initpos[i]=img_pos
if(dir==0){document.getElementById("div_"+[i]).style.top=initpos[i]} // if up

if(dir==1){ // if down
document.getElementById("div_"+[(img_places-i)]).style.top=initpos[i]
img_pos+=(document.getElementById("pic_0").height)+img_spacer
}

if(nextpic==data.length){
nextpic=0
}

if(rdm_img==1){
document.getElementById("pic_"+[i]).src=rdm_array[nextpic][0]
document.getElementById("pic_"+[i]).alt=rdm_array[nextpic][1]
document.getElementById("loc_"+[i]).location=rdm_array[nextpic][2]
}
else{
document.getElementById("pic_"+[i]).src=data[nextpic][0]
document.getElementById("pic_"+[i]).alt=data[nextpic][1]
document.getElementById("loc_"+[i]).location=data[nextpic][2]
}
nextpic++
}

animate()
}

next_right=""
function animate(){
clearTimeout(next_right)
for(i=0;i<img_places+1;i++){
nowdivpos[i]=parseInt(document.getElementById("div_"+i).style.top)

if(dir==0){nowdivpos[i]-=step}
if(dir==1){nowdivpos[i]+=step}

if(dir==0&&nowdivpos[i]<= -(document.getElementById("pic_0").height+img_spacer) ||dir==1&&nowdivpos[i]>container_height){

if(dir==0){document.getElementById("div_"+[i]).style.top=container_height+img_spacer}
if(dir==1){document.getElementById("div_"+[i]).style.top= -document.getElementById("pic_0").height-(img_spacer*2)}

if(nextpic>data.length-1){
nextpic=0
}

if(rdm_img==1){
document.getElementById("pic_"+[i]).src=rdm_array[nextpic][0]
document.getElementById("pic_"+[i]).alt=rdm_array[nextpic][1]
document.getElementById("loc_"+[i]).location=rdm_array[nextpic][2]
}
else{
document.getElementById("pic_"+[i]).src=data[nextpic][0]
document.getElementById("pic_"+[i]).alt=data[nextpic][1]
document.getElementById("loc_"+[i]).location=data[nextpic][2]
}

nextpic++

}
else{
document.getElementById("div_"+[i]).style.top=nowdivpos[i]
}

}
next_right=setTimeout("animate()",speed)

}

function stopme(){
clearTimeout(next_right)
}

function newwin(loc){
if(loc==""){return}
if(new_window==0){
location=loc
}
else{
//window.open(loc)
window.open(loc,'','left=130,top=270,width=200,height=200') // use for specific size and positioned window
}
}

// add onload="init_thumbshow()" to the opening BODY tag

// -->

