﻿//Use PIX resizer to resize pictures Thumbnails 104x78 Pics 600x450
function setvariables(selection){
if (selection=="xmas2007.html"){
maxpics=77;
cols=5;
piclocation="lbpicsxmas2007";
thumblocation="lbthumbsxmas2007";
cellhalign="center"; //left center right justify
cellvalign="middle"; //top middle baseline bottom
//thumbsizex=104;
//thumbsizey=78;
caption="Bridges Hash Xmas Run - 6th December 2007";
}
if (selection=="xmas2008.html"){

maxpics=57;
cols=5;
piclocation="lbpicsxmas2008";
thumblocation="lbthumbsxmas2008";
cellhalign="center"; //left center right justify
cellvalign="middle"; //top middle baseline bottom
//thumbsizex=104;
//thumbsizey=78;
caption="Bridges Hash - AGM and 900th Run and Xmas Run <br> 11th December 2008";
}
if (selection=="bigwheel.html"){

maxpics=33;
cols=5;
piclocation="lbpicsbigwheel";
thumblocation="lbthumbsbigwheel";
cellhalign="center"; //left center right justify
cellvalign="middle"; //top middle baseline bottom
//thumbsizex=104;
//thumbsizey=78;
caption="The Big Wheel BBQ Run <br> 12th March  2009";
}

}
//get current page name to select variables settings
var sPath = window.location.pathname;
//var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);

//alert(sPage);

var varmaxpics; //Number of pics to show
var cols; //Number of columns
var caption;
var cell; //Builds up table details
var piclocation;// location of pics
var thumblocation; // Location of thumbnails
var cellhalign;
var cellvalign;
//var thumbsizex; //Width of thumbnail
//var thumbsizey; //height of thumbnail
setvariables(sPage)
var cc=0;
//top table for header label
var cell="<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td align=\"center\" width=\"415\" height=\"33\" background=\"images/tab1b.jpg\"><b>"+caption+"</b></td></tr></table>"
//cellspacing gives space between thumbnails
//cellpadding gives white border size
cell+="<table style=\"width: 1px\" cellspacing=\"5\" cellpadding=\"8\" bgcolor=\"#E9E3D5\">";
cell+="<tr>";
for (var i = 1; i <= maxpics; i++) {
cc++
cell+="<td bgcolor=\"#ffffff\" align=\""+cellhalign+"\" valign=\""+cellvalign+"\"><a href=\""+piclocation+"/"+i+".jpg\" rel=\"lightbox[roadtrip]\" title=\""+caption+"\"><img src=\""+thumblocation+"/"+i+".jpg\" /></a></td>"
if (cc==cols){
cc=0;
cell+="</tr>";
cell+="<tr>";
}
}
cell+="</tr>";
cell+="<tr>";
cell+="</table>";



