

/***********************************************
* 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
***********************************************/

function PopupForm(url,name,width,height) {

	var titleBarHeight, windowBorderWidth
	titleBarHeight = 24
	windowBorderWidth = 4

	var screenWidth, screenHeight
	screenWidth = 800
	screenHeight = 600

	if (window.screen) {
		if (window.screen.availWidth) {
			// ok browser has the appropriate properties we need to centre it
			screenWidth = window.screen.availWidth
			screenHeight = window.screen.availHeight
		}
	}

	var windowWidth = windowBorderWidth + width + windowBorderWidth
	var windowHeight = titleBarHeight + height + windowBorderWidth

	var left = (screenWidth - windowWidth) / 2
	var top = (screenHeight - windowHeight) / 2

	window.open(url,name,'left='+left+',top='+top+',screenX='+left+',screenY='+top+',width='+width+',height='+height+',scrollbars=1,resizable=1,toolbar=0,location=0,directories=0,status=0,menubar=0,copyhistory=0')
}


//Specify image paths and optional link (set link to "" for no link):
var dynimages=new Array()
dynimages[0]=["images/web_crmw.gif", "javascript:PopupForm('http://www.crmworks.com.au','1',800,450)"]
dynimages[1]=["images/web_da.gif", "javascript:PopupForm('http://www.digitalacoustics.com','1',800,450)"]
dynimages[2]=["images/web_orca.gif", "javascript:PopupForm('http://www.orca.com','1',800,450)"]
dynimages[3]=["images/web_ldc.gif", "javascript:PopupForm('http://www.ldc.govt.nz','1',800,450)"]
dynimages[4]=["images/web_sched.gif", "javascript:PopupForm('http://www.scheduleus.com','1',800,450)"]
dynimages[5]=["images/web_xact.gif", "javascript:PopupForm('http://www.xactsoftware.co.nz','1',800,450)"]
dynimages[6]=["images/web_lfola.gif", "javascript:PopupForm('http://www.lfola.org','1',800,450)"]
dynimages[7]=["images/web_star.gif", "javascript:PopupForm('http://www.starstream.net','1',800,450)"]
dynimages[8]=["images/web_mat.gif", "javascript:PopupForm('http://www.matarangi.co.nz','1',800,450)"]
dynimages[9]=["images/web_inz.gif", "javascript:PopupForm('http://www.inzonetravel.com','1',800,450)"]
dynimages[10]=["images/web_blt.gif", "javascript:PopupForm('http://www.betterlifetoolkit.com','1',800,450)"]
dynimages[11]=["images/web_perm.gif", "javascript:PopupForm('http://www.permission.co.nz','1',800,450)"]

//Preload images ("yes" or "no"):
var preloadimg="yes"

//Set optional link target to be added to all images with a link:
var optlinktarget=""

//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 href="'+theimg[1]+'" target="'+optlinktarget+'">'
imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'">'
if (theimg[1]!="")
imghtml+='</a>'
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
}
}

