﻿//Use PIX resizer to resize pictures Thumbnails 104x78 Pics 600x450
//AGM Pictures++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function setvariables(selection){
if (selection=="picturesagm2009.html"){
maxpics=71;
cols=6;
//piclocation="lbpicsagm";
//thumblocation="lbthumbagm";

piclocation="lbpicsagm2009";
thumblocation="lbthumbsagm2009";

cellhalign="center"; //left center right justify
cellvalign="top"; //top middle baseline bottom
//thumbsizex=104;
//thumbsizey=78;
caption="HOSH Hash Run 183 - AGM 26 May 2009";
}
//Xmas 2007++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if (selection=="picturesxmas2007.html"){
maxpics=52;
cols=6;
piclocation="lbpicsxmas2007";
thumblocation="lbthumbsxmas2007";
cellhalign="center"; //left center right justify
cellvalign="top"; //top middle baseline bottom
//thumbsizex=104;
//thumbsizey=78;
caption="HOSH Hash Run 154 - Xmas Run 18 December 2007";
}
//Xmas 2008++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if (selection=="picturesxmas2008.html"){
maxpics=70;
cols=6;
piclocation="lbpicsxmas2008";
thumblocation="lbthumbsxmas2008";
cellhalign="center"; //left center right justify
cellvalign="middle"; //top middle baseline bottom
//thumbsizex=104;
//thumbsizey=78;
caption="HOSH Hash Run 178 - Xmas Run 16 December 2008";
}
//Oz Day 2009++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if (selection=="picturesozday2009.html"){
maxpics=42;
cols=6;
piclocation="lbpicsozdayrun2009";
thumblocation="lbthumbsozdayrun2009";
cellhalign="center"; //left center right justify
cellvalign="middle"; //top middle baseline bottom
//thumbsizex=104;
//thumbsizey=78;
caption="HOSH Hash Run 179 - Australia Day Run 20 January 2009";
}



//Vail Pictures++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if (selection=="index.html"){
maxpics=42;
cols=7;
piclocation="vailpics";
thumblocation="vailthumbs";
cellhalign="left"; //left center right justify
cellvalign="top"; //top middle baseline bottom
//thumbsizex=104;
//thumbsizey=78;
caption="Vail Pictures";
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
}
//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++
//alert("<img src=\""+thumblocation+"/"+i+".jpg\" />");
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>";



