/******************************************************************************
* 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/featuredvehicles/86chevyblazer2wd/0481.jpg", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/0481.jpg"]
galleryarray[1]=["picgallery/featuredvehicles/86chevyblazer2wd/0519.jpg", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/0519.jpg"]
galleryarray[2]=["picgallery/featuredvehicles/86chevyblazer2wd/0520.jpg", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/0520.jpg"]
galleryarray[3]=["picgallery/featuredvehicles/86chevyblazer2wd/0521.jpg", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/0521.jpg"]
galleryarray[4]=["picgallery/featuredvehicles/86chevyblazer2wd/0522.jpg", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/0522.jpg"]
galleryarray[5]=["picgallery/featuredvehicles/86chevyblazer2wd/cb1SMALL.JPG", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/cb1Large.JPG"]
galleryarray[6]=["picgallery/featuredvehicles/86chevyblazer2wd/cb2SMALL.JPG", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/cb2Large.JPG"]
galleryarray[7]=["picgallery/featuredvehicles/86chevyblazer2wd/cb3SMALL.JPG", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/cb3Large.JPG"]
galleryarray[8]=["picgallery/featuredvehicles/86chevyblazer2wd/cb4SMALL.JPG", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/cb4Large.JPG"]
galleryarray[9]=["picgallery/featuredvehicles/86chevyblazer2wd/cb5SMALL.JPG", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/cb5Large.JPG"]
galleryarray[10]=["picgallery/featuredvehicles/86chevyblazer2wd/cb6SMALL.JPG", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/cb6Large.JPG"]
galleryarray[11]=["picgallery/featuredvehicles/86chevyblazer2wd/cb7SMALL.jpg", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/cb7Large.jpg"]
galleryarray[12]=["picgallery/featuredvehicles/86chevyblazer2wd/DSC00004.JPG", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/DSC00004.JPG"]
galleryarray[13]=["picgallery/featuredvehicles/86chevyblazer2wd/DSC00029.JPG", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/DSC00029.JPG"]
galleryarray[14]=["picgallery/featuredvehicles/86chevyblazer2wd/DSC00035.JPG", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/DSC00035.JPG"]
galleryarray[15]=["picgallery/featuredvehicles/86chevyblazer2wd/DSC00063.JPG", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/DSC00063.JPG"]
galleryarray[16]=["picgallery/featuredvehicles/86chevyblazer2wd/DSC00064.JPG", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/DSC00064.JPG"]
galleryarray[17]=["picgallery/featuredvehicles/86chevyblazer2wd/DSC_0177.JPG", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/DSC_0177.JPG"]
galleryarray[18]=["picgallery/featuredvehicles/86chevyblazer2wd/SIMG0013.JPG", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/SIMG0013.JPG"]
galleryarray[19]=["picgallery/featuredvehicles/86chevyblazer2wd/SIMG0014.JPG", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/SIMG0014.JPG"]
galleryarray[20]=["picgallery/featuredvehicles/86chevyblazer2wd/SIMG0015.JPG", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/SIMG0015.JPG"]
galleryarray[21]=["picgallery/featuredvehicles/86chevyblazer2wd/SIMG0024.JPG", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/SIMG0024.JPG"]
galleryarray[22]=["picgallery/featuredvehicles/86chevyblazer2wd/teamnutzchevyblazer2wd.jpg", "", "", "picgallery/featuredvehicles/86chevyblazer2wd/big/TeamNutzChevyBlazer2wd.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
}

