
// JavaScript Document

<!--
// Jeff
//www.huntingground.freeserve.co.uk

var image = [
["fontpopup/00curlz.gif","Curlz"],//0
["fontpopup/01frisky.gif","Frisky"],//1
["fontpopup/02kids.gif","Kids"],//2
["fontpopup/03lumios.gif","Lumios"],//3
["fontpopup/04party.gif","Party"],//4
["fontpopup/05trots.gif","Trots"],//5
["fontpopup/06diznee.gif","Diznee"],//6
["fontpopup/07gigi.gif","Gigi"],//7
["fontpopup/08arial.gif","Arial"],//8
["fontpopup/09baker.gif","Baker"],//9
["fontpopup/10times.gif","Times New Roman"],//10
["fontpopup/11garamond.gif","Garamond"],//11
["fontpopup/12bible.gif","Bible"],//12
["fontpopup/13cooper.gif","Cooper"],//13
["fontpopup/14copperplate.gif","Copperplate"],//14
["fontpopup/15pompeii.gif","Pompeii"],//15
["fontpopup/16brashe.gif","font"],//16
["fontpopup/17neville.gif","font"],//17
["fontpopup/18papyrus.gif","font"],//18
["fontpopup/19budhand.gif","font"],//19
["fontpopup/20president.gif","font"],//20
["fontpopup/21pristina.gif","font"],//21
["fontpopup/22tempus.gif","font"],//22
["fontpopup/23tigerrag.gif","font"],//23
["fontpopup/24unicorn.gif","font"],//24
["fontpopup/25viner.gif","font"],//25
["fontpopup/26irezumi.gif","font"],//26
["fontpopup/27rage.gif","font"],//27
["fontpopup/28typewriter.gif","font"],//28
["fontpopup/29davinci.gif","font"],//29
["fontpopup/30arabia.gif","font"],//30
["fontpopup/31anglican.gif","font"],//31
["fontpopup/32antique.gif","font"],//32
["fontpopup/33cele.gif","font"],//33
["fontpopup/34freehand.gif","font"],//34
["fontpopup/35hingham.gif","font"],//35
["fontpopup/36blackletter.gif","font"],//36
["fontpopup/37morris.gif","font"],//37
["fontpopup/38oldenglish.gif","font"],//38
["fontpopup/39tolkien.gif","font"],//39
["fontpopup/40willow.gif","font"],//40
["fontpopup/41ringbearer.gif","font"],//41
["fontpopup/42charles.gif","font"],//42
["fontpopup/43bigtop.gif","font"],//43
["fontpopup/44tartan.gif","font"],//44
["fontpopup/45allure.gif","font"],//45
["fontpopup/46callig.gif","font"],//46
["fontpopup/47chancery.gif","font"],//47
["fontpopup/48dauphin.gif","font"],//48
["fontpopup/49french.gif","font"],//49
["fontpopup/50harr.gif","font"],//50
["fontpopup/51lucida.gif","font"],//51
["fontpopup/52signet.gif","font"],//52
["fontpopup/53vivaldi.gif","font"],//53
["fontpopup/54chaucer.gif","font"],//54
["fontpopup/55comm.gif","font"],//55
["fontpopup/56nuptial.gif","font"],//56
["fontpopup/57xxx.gif","font"],//57
["LAST ONE","LAST ONE"] //__// no comma at the end of last index
]

var startPicWidth=105 // thumbnail width
var startPicHeight=40 // thumbnail height
var stepNum=10 // number of steps to reach full size

var newImage=new Array() // preloaded images

aIndex=0
function loadImage(){ // preload images
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
}
}

window.onerror=chkError // if image selected but not loaded suppress error message // ?
function chkError(){ // ?
return true // ?
} // ?

function preInit(num){
if(newImage[num]==null){ // ?
alert("Image Still Loading, \nplease be patient...") // ?
} // ?
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="5px solid #203D3B"
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()",10)

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()",10)

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
}

//return "Left pos = "+elPosX+"px\n\nTop pos = "+elPosY+"px" // return totals
//return [elPosX,elPosY]
}

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