/******************************************************************************
* Photo Album 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
******************************************************************************/

//Modified by JCReign to fix image pop-up's
var dimension="5x3" //Specify dimension of gallery (number of images shown), such as 4 images X 2 images

var popupsetting=[1, "width=680px, height=520px, scrollbars, resizable"] //Specify dimensions of popup window

//Specify images:
//galleryarray[x]=["path_to_image", "optional_title_attribute", "optional_text_description", "optional_link"]
var galleryarray=new Array()
galleryarray[0]=["picgallery/carshows/tnt06/tnt1small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt1big.jpg"]
galleryarray[1]=["picgallery/carshows/tnt06/tnt2small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt2big.jpg"]
galleryarray[2]=["picgallery/carshows/tnt06/tnt3small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt3big.jpg"]
galleryarray[3]=["picgallery/carshows/tnt06/tnt4small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt4big.jpg"]
galleryarray[4]=["picgallery/carshows/tnt06/tnt5small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt5big.jpg"]
galleryarray[5]=["picgallery/carshows/tnt06/tnt6small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt6big.jpg"]
galleryarray[6]=["picgallery/carshows/tnt06/tnt7small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt7big.jpg"]
galleryarray[7]=["picgallery/carshows/tnt06/tnt8small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt8big.jpg"]
galleryarray[8]=["picgallery/carshows/tnt06/tnt9small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt9big.jpg"]
galleryarray[9]=["picgallery/carshows/tnt06/tnt10small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt10big.jpg"]
galleryarray[10]=["picgallery/carshows/tnt06/tnt11small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt11big.jpg"]
galleryarray[11]=["picgallery/carshows/tnt06/tnt12small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt12big.jpg"]
galleryarray[12]=["picgallery/carshows/tnt06/tnt13small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt13big.jpg"]
galleryarray[13]=["picgallery/carshows/tnt06/tnt14small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt14big.jpg"]
galleryarray[14]=["picgallery/carshows/tnt06/tnt15small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt15big.jpg"]
galleryarray[15]=["picgallery/carshows/tnt06/tnt16small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt16big.jpg"]
galleryarray[16]=["picgallery/carshows/tnt06/tnt17small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt17big.jpg"]
galleryarray[17]=["picgallery/carshows/tnt06/tnt18small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt18big.jpg"]
galleryarray[18]=["picgallery/carshows/tnt06/tnt19small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt19big.jpg"]
galleryarray[19]=["picgallery/carshows/tnt06/tnt20small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt20big.jpg"]
galleryarray[20]=["picgallery/carshows/tnt06/tnt21small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt21big.jpg"]
galleryarray[21]=["picgallery/carshows/tnt06/tnt22small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt22big.jpg"]
galleryarray[22]=["picgallery/carshows/tnt06/tnt23small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt23big.jpg"]
galleryarray[23]=["picgallery/carshows/tnt06/tnt24small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt24big.jpg"]
galleryarray[24]=["picgallery/carshows/tnt06/tnt25small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt25big.jpg"]
galleryarray[25]=["picgallery/carshows/tnt06/tnt26small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt26big.jpg"]
galleryarray[26]=["picgallery/carshows/tnt06/tnt27small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt27big.jpg"]
galleryarray[27]=["picgallery/carshows/tnt06/tnt28small.jpg", "", "", "picgallery/carshows/tnt06/big/tnt28big.jpg"]

var href_target="_new" //Enter target attribute of links

var totalslots=dimension.split("x")[0]*dimension.split("x")[1]

function buildimage(i){
var tempcontainer=galleryarray[i][3]!=""? '<a href="'+galleryarray[i][3]+'" target="'+href_target+'" onClick="return popuplinkfunc(this)">' : ""
tempcontainer+='<img src="'+galleryarray[i][0]+'" border="1" title="'+galleryarray[i][1]+'">'
tempcontainer=galleryarray[i][3]!=""? tempcontainer+'</a>' : tempcontainer
tempcontainer=galleryarray[i][2]!=""? tempcontainer+'<br \/>'+galleryarray[i][2] : tempcontainer
return tempcontainer
}

function jumptopage(p){
var startpoint=(p-1)*totalslots
var y=1;
for (i=0; i<totalslots; i++){
document.getElementById("slide"+i).innerHTML=(typeof galleryarray[startpoint+i]!="undefined")? buildimage(startpoint+i) : ""
}
while(document.getElementById("navlink"+y)!=null){
document.getElementById("navlink"+y).className=""
y++
}
document.getElementById("navlink"+p).className="current"
}

var curimage=0
for (y=0; y<dimension.split("x")[1]; y++){
for (x=0; x<dimension.split("x")[0]; x++){
if (curimage<galleryarray.length)
document.write('<div id="slide'+curimage+'" class="slideshow">'+buildimage(curimage)+'</div>')
curimage++
}
document.write('<br style="clear: left" />')
}

function popuplinkfunc(imgsrc){
if (popupsetting[0]==1){
var popwin=open(imgsrc.href, "popwin", popupsetting[1])
popwin.focus()
return false
}
else
return true
}

