//run the lightbox code
//get List to fill Gallery
//ConstructGallery


xmlDoc=loadXMLDoc("XML/Store.xml"); //load XML file using the function in XMLCompatability.JS 

//Define your own array to hold the photo album images
//Syntax: ["path_to_thumbnail", "opt_image_title", "opt_destinationurl", "opt_linktarget"]
var x
x=xmlDoc.getElementsByTagName('PicLocation').length; //get number of images in folder
document.write('There are ')
document.write(x)
document.write(' Items for Sale. (This Is for Information Only, We as a Club are not responsible or liable for any transaction as a result of the advertisements shown below.)')
var myvacation=new Array() //declaire an array to store info from the xml file
var i=0;
while (i<=x-1)	// for each picture place into the array using the above syntax (not including opt_linktarget default is self)
{
myvacation[i]=[xmlDoc.getElementsByTagName("PicLocation")[i].childNodes[0].nodeValue, xmlDoc.getElementsByTagName("ProductTitle")[i].childNodes[0].nodeValue, xmlDoc.getElementsByTagName("PicLocation")[i].childNodes[0].nodeValue,xmlDoc.getElementsByTagName("Cost")[i].childNodes[0].nodeValue,xmlDoc.getElementsByTagName("Contact")[i].childNodes[0].nodeValue]
i=i+1
}
// alternative way of placing pics into the array
//myvacation[3]=["Pics/Gallery/Logo.GIF", "Our hotel", "http://www.gohawaii.com/"]
//myvacation[4]=["Pics/Gallery/Logo.GIF", "Our Computer", "http://www.google.com", "_new"]
//myvacation[5]=["Pics/Gallery/Logo.GIF", "Our house", "photo6-large.jpg"]
//myvacation[6]=["Pics/Gallery/Logo.GIF", "Our Friends", "http://www.ask.com"]
//myvacation[7]=["Pics/Gallery/Logo.GIF", "Our Friends", "http://www.ask.com"]
//myvacation[8]=["Pics/Gallery/Logo.GIF", "Our Friends", "http://www.ask.com"]
//myvacation[9]=["Pics/Gallery/Logo.GIF", "Our Friends", "http://www.ask.com"]
//myvacation[10]=["Pics/Gallery/Logo.GIF", "Our Friends", "http://www.ask.com"]

//initiate a photo gallery
//Syntax: new photogallery(imagearray, cols, rows, tablewidth, tableheight, opt_[paginatetext_prefix, paginatetext_linkprefix])
var thepics=new photogallery(myvacation, 4, 3, '800px', '500px')

//OPTIONAL: Run custom code when an image is clicked on, via "onselectphoto"
//DELETE everything below to disable
//Syntax: function(img, link){}, whereby img points to the image object of the image, and link, its link object, if defined
//thepics.onselectphoto=function(img, link){
//if (link!=null) //if this image is hyperlinked
//window.open(link.href, "", "width=800, height=600, status=1, resizable=1")
//return false //cancel default action when clicking on image, by returning false instead of true
//}