// JavaScript Document

/***********************************************
* Image Thumbnail Viewer II script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Modification to code
/***********************************************
* Code added to enable text below image and a link
* Michele Mitchell
* January 2006
***********************************************/

//Specify image paths and optional link (set link to "" for no link):
var dynimages=new Array()
dynimages[0]=["images/web/screenshots/tinto.jpg", "http://www.tintoarchitecture.co.uk","Click to launch Tinto Website","Tinto"]
dynimages[1]=["images/web/screenshots/palace.jpg", "http://www.palacehotel.co.uk","Click to launch Palace Website","Palace Hotel"]
dynimages[2]=["images/web/screenshots/lochter.jpg", "http://www.lochter.co.uk","Click to launch Lochter Website","Lochter"]
dynimages[3]=["images/web/screenshots/buchan.jpg", "http://www.buchanbraes.co.uk","Click to launch Buchan Braes Website","Buchan Braes"]
dynimages[4]=["images/web/screenshots/atr.jpg", "http://www.atrgroup.co.uk","Click to launch ATR Group Website","ATR Website"]
dynimages[5]=["images/web/screenshots/marjandi.jpg", "http://www.marjandi.co.uk","Click to launch Marjandi Website","Marjandi"]
dynimages[6]=["images/web/screenshots/ipact.jpg", "http://www.ipact-int.com","Click to launch iPact Website","iPact Int"]
dynimages[7]=["images/web/screenshots/sonsub.jpg", "http://www.sonsub.com","Click to launch Sonsub Website","Sonsub"]
dynimages[8]=["images/web/screenshots/ahb.jpg", "http://www.aberdeen-harbour.co.uk","Click to launch Aberdeen Harbour Board Website","http://www.aberdeen-harbour.co.uk"]
dynimages[9]=["images/web/screenshots/capture.jpg", "http://www.captureimaging.co.uk/","Click to launch Capture Website","Capture Imaging Solutions"]
dynimages[10]=["images/web/screenshots/jc.jpg", "http://www.jamieson-carry.com", "Click to launch Jamieson and Carry Website","Jamieson and Carry Jewellery"]
dynimages[11]=["images/web/screenshots/standrews.jpg", "http://www.thestandrewsprize.com","Click to launch The St Andrews Prize Website","The St Andrews Prize for the Environment"]
dynimages[12]=["images/web/screenshots/oldmandg.gif", "http://www.mearns-gill.com/classic", "Click to launch Mearns and Gill Classic Website","Mearns and Gill Classic Website"]

//Preload images ("yes" or "no"):
var preloadimg="yes"

//Set optional link target to be added to all images with a link:
var optlinktarget="_blank"

//Set image border width
var imgborderwidth=0

//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)"

///////No need to edit beyond here/////

if (preloadimg=="yes"){
for (x=0; x<dynimages.length; x++){
var myimage=new Image()
myimage.src=dynimages[x][0]
}
}

function returnimgcode(theimg){
var imghtml=""
if (theimg[1]!="")
//imghtml='<a style="font-family:Arial, Helvetica, sans-serif; font-size:12px;"  href="'+theimg[1]+'" target="'+optlinktarget+'">'
///imghtml+='<table align="center"><tr><td style="font-family:Arial, Helvetica, sans-serif; font-size:12px;" align="center" >'
///imghtml+='<img src="'+theimg[0]+'" align="center" border="'+imgborderwidth+'" title="'+theimg[2]+'"></td></tr>'
///imghtml+='<tr><td style="font-family:Arial, Helvetica, sans-serif; font-size:12px;" align="center" > '+theimg[1]+'</td></tr></table>'


imghtml='<a style="font-family:Arial, Helvetica, sans-serif; font-size:12px;"  href="'+theimg[1]+'" target="'+optlinktarget+'">'
imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'" alt="'+theimg[3]+'">'
imghtml+='<table><tr><td><a href="'+theimg[1]+'" target="'+optlinktarget+'"> '+theimg[2]+'</a></td></tr></table>'

if (theimg[1]!="")
imghtml+=''
return imghtml
}

function modifyimage(loadarea, imgindex){
if (document.getElementById){
var imgobj=document.getElementById(loadarea)
if (imgobj.filters && window.createPopup){
imgobj.style.filter=filterstring
imgobj.filters[0].Apply()
}
imgobj.innerHTML=returnimgcode(dynimages[imgindex])
if (imgobj.filters && window.createPopup)
imgobj.filters[0].Play()
return false
}
}

