//Specifies image paths and optional image dimensions (for correct positioning). Set link to "" for no link:
var dynimages=new Array()
dynimages[0]=["images08/2P.jpg", 	"images08/large/2P.jpg",   580, 620]
dynimages[1]=["images08/BrWh.jpg", 	"images08/large/BrWh.jpg", 830, 520]
dynimages[2]=["images08/L.jpg", 	"images08/large/L.jpg", 580, 620]
dynimages[3]=["images08/GAP0.jpg", 	"images08/large/GAP0.jpg", 580, 620]
dynimages[4]=["images08/RedT.jpg", 	"images08/large/RedT.jpg", 820, 620]
dynimages[5]=["images08/09.jpg", 	"images08/large/09.jpg",   580, 620]
dynimages[6]=["images08/mia.jpg", 	"images08/large/mia.jpg", 580, 620]
dynimages[7]=["images08/06.jpg", 	"images08/large/06.jpg",   580, 620]
dynimages[8]=["images08/blackA.jpg", 	"images08/large/blackA.jpg", 830, 520]
dynimages[9]=["images08/3P.jpg", 	"images08/large/3P.jpg", 850, 570]
dynimages[10]=["images08/2Pred.jpg", 	"images08/large/2Pred.jpg", 580, 620]
dynimages[11]=["images08/GAP3t.jpg", 	"images08/large/GAP3t.jpg", 850, 570]
dynimages[12]=["images08/partI.jpg", 	"images08/large/partI.jpg", 580, 620]
dynimages[13]=["images08/IIplexi.jpg", 	"images08/large/IIplexi.jpg", 300, 620]
dynimages[14]=["images08/hip.jpg", 	"images08/large/hip.jpg", 580, 620]
dynimages[15]=["images08/NY_R08.jpg", 	"images08/large/NY_R08.jpg", 820, 620]
dynimages[16]=["images09/01_09.jpg", 	"images09/large/01_09.jpg",  580, 620]
dynimages[17]=["images09/2m.jpg", 	"images09/large/2m.jpg",  580, 620]
dynimages[18]=["images09/P01_09.jpg", 	"images09/large/P01_09.jpg", 830, 620]
dynimages[19]=["images08/white.jpg", 	"images08/large/white.jpg", 820, 620]
	

var titoli=new Array()
	titoli[0]="GAPscape   -   2 x (200 x 110 cm)";
	titoli[1]="GAPscape   -   (110 x 200 cm)";
	titoli[2]="GAPscape   -   plexiglas (50 x 50 cm)";
	titoli[3]="GAPscape   -   (110 x 200 cm)";
	titoli[4]="GAPscape   -   (110 x 200 cm)";
	titoli[5]="GAPscape   -   plexiglas (50 x 50 cm)";
	titoli[6]="GAPscape   -   (100 x 100 cm)";
	titoli[7]="GAPscape   -   plexiglas (50 x 50 cm)";
	titoli[8]="GAPscape   -   (110 x 200 cm)";
	titoli[9]="GAPscape   -   3 x (200 x 110 cm)";
	titoli[10]="GAPscape   -   2 x (200 x 110 cm)";
	titoli[11]="GAPscape   -   3 x (80 x 150 cm)";
	titoli[12]="GAPscape   -   (100 x 100 cm)";
	titoli[13]="GAPscape   -   plexiglas 2 x (100 x 20 cm)";
	titoli[14]="GAPscape   -   (100 x 100 cm)";
	titoli[15]="GAPscape   -   (110 x 200 cm)";
	titoli[16]="GAPscape   -   (100 x 100 cm)";
	titoli[17]="GAPscape   -   (200 x 200 cm)";
	titoli[18]="GAPscape   -   plexiglas (100 x 140 cm)";
	titoli[19]="GAPscape   -   plexiglas (90 x 140 cm)";





//Preload images ("yes" or "no"):
var preloadimg="no"

//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 title="click to enlarge" href="'+theimg[1]+'" rel="lightbox" onClick="return enlarge('
		imghtml+=" '"+theimg[1]+"' " 
		imghtml+=' ,event , '
		imghtml+=" 'center',"
		imghtml+=theimg[2]
		imghtml+=", "
		imghtml+=theimg[3]
		imghtml+=' )" target="_blank">'
	}
	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]) + '<br><font size="1" color="#666666">'+titoli[imgindex]+'</font>'
		if (imgobj.filters && window.createPopup)
			imgobj.filters[0].Play()
		return false
	}
}

function borderit(which,color)
{
	//if IE 4+ or NS 6+
	if (document.all||document.getElementById)
	{
		which.style.borderColor=color
	}
}



var ie=document.all
var ns6=document.getElementById&&!document.all

function ietruebody()
{
	return (document.compatMode && document.compatMode!="BackCompat" && !window.opera)? document.documentElement : document.body
}

function enlarge(which, e, position, imgwidth, imgheight)
{
	if (ie||ns6)
	{
		crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
		if (position=="center")
		{
			pgyoffset=ns6? parseInt(pageYOffset) : parseInt(ietruebody().scrollTop)
			horzpos=ns6? pageXOffset+window.innerWidth/2-imgwidth/2 : ietruebody().scrollLeft+ietruebody().clientWidth/2-imgwidth/2
			vertpos=ns6? pgyoffset+window.innerHeight/2-imgheight/2 : pgyoffset+ietruebody().clientHeight/2-imgheight/2
			if (window.opera && window.innerHeight) 	//compensate for Opera toolbar
				vertpos=pgyoffset+window.innerHeight/2-imgheight/2
			vertpos=Math.max(pgyoffset, vertpos)
		}
		else
		{
			var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX
			var vertpos=ns6? pageYOffset+e.clientY : ietruebody().scrollTop+event.clientY
		}
		crossobj.style.left=horzpos+"px"
		crossobj.style.top=vertpos+"px"

		crossobj.innerHTML='<div align="right" id="dragbar"><span id="closetext" onClick="closepreview()">Close</span> </div><img src="'+which+'">'
		crossobj.style.visibility="visible"
		return false
	}
	else //if NOT IE 4+ or NS 6+, simply display image in full browser window
		return true
}

function closepreview()
{
	crossobj.style.visibility="hidden"
}

function drag_drop(e)
{
	if (ie&&dragapproved)
	{
		crossobj.style.left=tempx+event.clientX-offsetx+"px"
		crossobj.style.top=tempy+event.clientY-offsety+"px"
	}
	else if (ns6&&dragapproved)
	{
		crossobj.style.left=tempx+e.clientX-offsetx+"px"
		crossobj.style.top=tempy+e.clientY-offsety+"px"
	}
	return false
}

function initializedrag(e)
{
	if (ie&&event.srcElement.id=="dragbar"||ns6&&e.target.id=="dragbar")
	{
		offsetx=ie? event.clientX : e.clientX
		offsety=ie? event.clientY : e.clientY

		tempx=parseInt(crossobj.style.left)
		tempy=parseInt(crossobj.style.top)

		dragapproved=true
		document.onmousemove=drag_drop
	}
}

document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")
