<!--


var image = [
["images/cove1-lg.jpg","The Cove House"],
["images/cove2-lg.jpg","The Cove House"],
["images/cove3-lg.jpg","The Cove House"],
["images/cove4-lg.jpg","The Cove House"],
["images/cove5-lg.jpg","The Cove House"],
["images/cove6-lg.jpg","The Cove House"],
["images/cove7-lg.jpg","The Cove House"],
["images/cove8-lg.jpg","The Cove House"],
["images/burma3-lg.jpg","Burma Road on Claytor Lake"],
["images/burma4-lg.jpg","Burma Road on Claytor Lake"],
["images/burma5-lg.jpg","Burma Road on Claytor Lake"],
["images/burma6-lg.jpg","Burma Road on Claytor Lake"],
["images/burma7-lg.jpg","Burma Road on Claytor Lake"],
["images/burma8-lg.jpg","Burma Road on Claytor Lake"],
["images/burma9-lg.jpg","Burma Road on Claytor Lake"],
["images/burma10-lg.jpg","Burma Road on Claytor Lake"]
// no comma at the end of last index
]

var startPicWidth=200 // thumbnail width
var startPicHeight=150 // thumbnail height
var stepNum=5 // number of steps to reach full size

var newImage=new Array() // preloaded images

aIndex=0
function loadImage(){
newImage[aIndex]=new Image() // create new image object
newImage[aIndex].onload=checkArray // check for next image
newImage[aIndex].src=image[aIndex][0] // assign image to new image object
}

function checkArray(){
aIndex++
if(aIndex!=image.length){
setTimeout("loadImage()",10)
}
}

var lastW=""
var lastH=""
var timer=""
var dir=0

function setThumbSize(){
loadImage()
for (i=0;i<=image.length-1;i++) {
document.getElementById("thumb"+i).width=startPicWidth
document.getElementById("thumb"+i).height=startPicHeight
}
}

function preInit(num){
Num=num
fullWidth=newImage[num].width // images full width
fullHeight=newImage[num].height // images full height

bigPic=document.getElementById("big_pic")
bigPic.src=newImage[num].src
bigPic.width=startPicWidth
bigPic.height=startPicHeight

getElPos(num)
bigPic.style.left=elPosX // document.getElementById("thumb"+num).offsetLeft
bigPic.style.top=elPosY // document.getElementById("thumb"+num).offsetTop

bigPic.alt=image[num][1]

bigPic.style.visibility="visible"
nowPicWidth=startPicWidth
nowPicHeight=startPicHeight
wStep=(fullWidth-startPicWidth)/stepNum
hStep=(fullHeight-startPicHeight)/stepNum

enlargePic()

}

moz=document.getElementById&&!document.all

function enlargePic(){
clearTimeout(timer)
bigPic.style.border="2px solid white"
if(!moz){
docWidth=document.body.clientWidth
}
else{
docWidth=window.innerWidth
}
thumbPosX=elPosX //document.getElementById("thumb"+Num).offsetLeft

if(thumbPosX+fullWidth>docWidth-10){
if(nowPicWidth<fullWidth){
nowPicWidth+=wStep
bigPic.width=nowPicWidth
newPos=parseInt(bigPic.style.left)-wStep
bigPic.style.left=newPos

dir=1
}
if(nowPicHeight<fullHeight){
nowPicHeight+=hStep
bigPic.height=nowPicHeight
}

}
else{
dir=0
if(nowPicWidth<fullWidth){
nowPicWidth+=wStep
bigPic.width=nowPicWidth
}

if(nowPicHeight<fullHeight){
nowPicHeight+=hStep
bigPic.height=nowPicHeight
}
}

if(document.getElementById("thumb"+Num).offsetTop+nowPicHeight>document.body.scrollTop+document.body.clientHeight){
window.scrollBy(0,hStep+1)
}

timer=setTimeout("enlargePic()",50)

if(nowPicHeight>=fullHeight){
clearTimeout(timer)
}
}

function shrinkPic(){
clearTimeout(timer)

if(dir==1){
if(nowPicWidth>startPicWidth){
nowPicWidth-=wStep
bigPic.width=nowPicWidth
newPos=parseInt(bigPic.style.left)+wStep
bigPic.style.left=newPos

dir=1
}
if(nowPicHeight>startPicHeight){
nowPicHeight-=hStep
bigPic.height=nowPicHeight
}

}
else{

if(nowPicWidth>startPicWidth){
nowPicWidth-=wStep
bigPic.width=nowPicWidth
}

if(nowPicHeight>startPicHeight){
nowPicHeight-=hStep
bigPic.height=nowPicHeight
}
}
timer=setTimeout("shrinkPic()",50)

if(nowPicWidth<=startPicWidth){
bigPic.style.visibility="hidden"
clearTimeout(timer)
}
}

function getElPos(n){
el=document.getElementById("thumb"+n)

elPosX = el.offsetLeft
elPosY = el.offsetTop
parentEl = el.offsetParent

while (parentEl != null){
elPosX += parentEl.offsetLeft
elPosY += parentEl.offsetTop
parentEl = parentEl.offsetParent
}

// add onload="setThumbSize()" to the opening BODY tag
}
// -->