/* 
PHOTO GALLERY SCRIPT
custom javascript by Tony Wirebach of Echo Valley Graphics, Inc.
last revised 1-13-08

NOTES:
-Resize and Crop all THUMBNAILS to 100x75
	do not have the browsers resize images do the the quallity of output...

- LARGE PIX: 600 x 450
- LOCATED: images/gallery/
- SMALL PIX: 100 x 75
- LOCATED: images/gallery/sm/
- UPDATE ARRAYS TO NEW PHOTOS, 

TOPICS:
	[,"",""],
	
	*/


pgTopics = [
	[0,"","",""],
	[1,"Green-Built Project: Pocono Mountains Region PA","We&rsquo;re very proud to be part of this &ldquo;Green Built&rdquo; project. Environmentally-friendly materials and techniques used in construction on this site include: <ul>	<li>ICF (insulated concrete form) poured foundation walls</li>	<li>Sub-floor construction of I-joists <br />and OSB made with non-toxic glues</li>	<li>Douglas Fir timber from a certified-sustainable forest</li>	<li>Energy-efficient SIPs shell</li>	<li>Triple-glazed Loewen windows and patio door</li>	<li>Solatube&reg; highly-advanced tubular skylights <br />for greater natural lighting</li>	<li>Citrus-based, environmentally-safe Tung Oil finish</li>	<li>Bamboo flooring</li>	<li>Geothermal heating and cooling</li>	<li>Solar orientation to extract <br />the benefits of solar gain</li></ul>","gal1a_3"],
	[2,"Timber Frame: Appalachian Trail PA","","gal1_221"],
	[3,"Barn Restoration: Bucks County PA","","gal2_P1200029"],
	[4,"Glu-Lam Roof Beam System","","gal3_P1270044"],
	[5,"Integrating Logs and Reclaimed Timbers <br />into a New Timberframe","","gal4_P6010011"],
	[6,"Interiors of our Timberframe Homes","","gal5_P3080014"],
	[7,"Jobsite Views","","gal6_CIMG0193"],
	[8,"Timber Roof Truss","","gal7_CIMG0061"],
	[9,"Timber Shop Views","","gal8_P9090006"],
	[10,"Hybrid Construction","Heavy Timbers enhance the highly visible areas of any home. Interior or exterior: Decorative Timbers, Timber Trusses, Entranceways, etc.<ul><li>Mountain Home</li><li>Entrance Porch</li><li>Enhance / Add character to exterior</li><li>A place to sit & enjoy the landscaping / scenery</li><li>Standing Seam metal roofing supplied and installed by us</li><li>Condos</li><li>Timber Trusses  / Brackets</li><li>Enhance / Add character to exterior</li></ul>","gal9_CIMG5681"],
	[11,"Marthas Vineyard Island, Mass","<ul><li>Custom Home</li><li>Whole House Timberframe</li></ul>","leroux 085"],
	[12,"Family Room Addition, Spring Mountain / Montgomery County, Pa.","<ul><li>Family Rm Addition</li><li>General Contractor for entire project</li><li>Locally Harvested White Pine</li><li>Pine tongue and groove roof planking</li><li>R-26 SIP walls</li><li>R-39 SIP Roof</li><li>Standing Seam Metal Roofing</li><li>Andersen 400 series windows</li></ul>","PC180032"],
	[13,"Getaway and Pool Pavilions","<ul><li>Getaway Pavilion</li><li>Western Red Cedar</li><li>Pool Pavilions</li><li>Locally Harvested White Oak wall sections</li><li>Reclaimed Hemlock Roof Structure</li></ul>","CIMG6944"],
	[14,"Green Built SIP homes, Zieglerville, Pa","<ul><li>LEED CERTIFIED</li><li>Installed SIPs structures</li><li>Window and door installation</li><li>Interior wall framing / and shading trellises</li><li>Mill trimwork and stair components from on-site materials, and install</li></ul>","CIMG5292"],
	[15,"Long Island SIP Homes, Long Island, NY","","IMG_3637"],
	[16,"Pocono Mountains, PA - Getaway Home","<ul><li>ICF Walls</li><li>Poured Concrete floors w/ radiant heat</li><li>Douglas Fir Timber Roof Structure</li><li>Pre-finished tongue and groove planking</li><li>R-40 SIP Roof Enclosure</li></ul>","13"]
];

/*
	[,,""],
*/

pgImages = [
	[,1,"gal1a_1"],
	[,1,"gal1a_2"],
	[,1,"gal1a_3"],
	[,1,"gal1a_4"],
	[,1,"gal1a_5"],
	[,1,"gal1a_6"],
	[,1,"gal1a_7"],
	[,1,"gal1a_8"],
	[,1,"IMG_6440webshot"],
	[,1,"IMG_6439webshot"],
	[,1,"IMG_6475webshot"],
	[,1,"IMG_6452webshot"],
	[,1,"IMG_6468webshot"],
	[,1,"IMG_6436webshot"],
	[,1,"CIMG1380"],
	[,1,"IMG_6430webshot"],
	[,1,"IMG_6472webshot"],
	[,1,"IMG_6427webshot"],
	[,1,"IMG_6454webshot"],
	[,1,"IMG_6442webshot"],
	[,2,"gal1_218"],
	//[,2,"gal1_219"],
	//[,2,"gal1_220"],
	[,2,"gal1_221"],
	//[,2,"gal1_222"],
	//[,2,"gal1_223"],
	//[,2,"gal1_224"],
	[,2,"gal1_CIMG1217"],
	[,2,"gal1_CIMG1233"],
	//[,2,"gal1_CIMG1424"],
	[,2,"gal1_CIMG1425"],
	//[,2,"gal1_CIMG1429"],
	[,2,"gal1_CIMG1436"],
	//[,3,'P8020014'],
	[,3,"gal2_P1200029"],
	[,3,"gal2_P1200031"],
	[,3,"gal2_P1200032"],
	//[,3,"gal2_P1250041"],
	[,3,"gal2_P1250044"],
	[,3,"gal2_P1250048"],
	[,3,"gal2_P1250039"],
	[,3,"gal2_P1290016"],
	[,3,"gal2_P1250046"],
	[,3,'50p_1250051'],
	//[,3,'CIMG0001'],
	//[,3,'CIMG0011'],
	[,3,'CIMG0003'],
	[,3,'CIMG0004'],
	[,3,'CIMG0012'],
	[,3,'CIMG0005'],
	[,3,'CIMG0013'],
	//[,3,'CIMG0002'],
	[,4,"gal3_P1270044"],
	//[,4,"gal3_P1270045"],
	[,4,"gal3_P1270049"],
	[,4,"gal3_PC010010"],
	[,4,"gal3_PC010006"],
	[,7,'DCFC0077'],
	[,7,'IMG_3615'],
	[,7,'IMG_3619'],
	[,7,'IMG_3624'],
	[,7,'DCFC0062'],
	[,7,'DCFC0014'],
	[,7,'IMG_3635'],
	[,7,'leroux 087'],
	[,7,'PA130002'],
	[,7,'CIMG3817'],
	[,7,'DCFC0072'],
	[,7,'DCFC0043'],
	[,7,'DCFC0085'],
	[,7,'CIMG3824'],
	[,7,'CIMG9953'],
	[,7,'P5300114'],
	//[,7,'DCFC0087'],
	[,7,'IMG_3637'],
	[,7,'DCFC0047'],
	[,7,'P1210004'],
	[,7,'cc5385_07_034'],
	[,7,'CIMG9951'],
	[,7,'IMG_3657'],
	[,7,'DCFC0069'],
	[,7,'CIMG9952'],
	[,7,'IMG_3640'],
	[,7,'IMG_3609'],
	[,7,'IMG_3562'],
	[,7,'CIMG3821'],
	[,7,'IMG_3673'],
	[,7,'CIMG3818'],
	[,7,'CIMG3825'],
	[,7,'IMG_3631'],
	//[,7,'DSC00265'],
	[,7,'DSC00266'],
	[,7,'IMG_3636'],
	[,7,'leroux 069'],
	[,7,'CIMG5930'],
	[,7,'P1010062'],
	[,7,'0589999-R1-038-17A'],
	[,5,"gal4_P6010010"],
	[,5,"gal4_P6010011"],
	[,6,"gal5_P3080014"],
	[,6,"gal5_P3080018"],
	[,6,"gal5_PC180037"],
	[,6,"gal5_P3080022"],
	[,7,"gal6_CIMG0193"],
	[,7,"gal6_CIMG1228"],
	[,7,"gal6_P1010038"],
	[,7,"gal6_P4280085"],
	[,7,"gal6_P4190002"],
	[,8,"gal7_CIMG0061"],
	//[,8,"gal7_CIMG1108"],
	[,8,"gal7_CIMG1110"],
	//[,8,"gal7_CIMG1111"],
	[,8,"gal7_P1010050"],
	[,4,'PB190001'],
	[,4,'CIMG0057'],
	[,4,'P1210004'],
	[,4,'PA250003'],
	[,4,'P1010056'],
	//[,4,'CIMG0061'],
	[,4,'P2090047'],
	[,4,'PB190014'],
	[,4,'CIMG0063'],
	[,4,'PB190010'],
	[,4,'CIMG0059'],
	[,4,'P1210001'],
	[,4,'PC220024'],
	[,9,"gal8_CIMG1644"],
	[,9,"gal8_P9090006"],
	[,9,"gal8_P2280012"],
	[,9,"gal8_P2280019"],
	[,9,"gal8_P9090002"],
	[,9,"gal9_CIMG5194"],
	[,9,"gal8_CIMG1443"],
	[,9,"gal8_CIMG1224"],
	[,10,"gal9_CIMG3826"],
	//[,10,"gal9_CIMG5194"],
	[,10,"gal9_CIMG5681"],
	[,10,"gal9_CIMG6359"],
	[,10,"gal9_CIMG6362"],
	[,10,"gal9_CIMG5673"],
	[,6,"P1010008"],
	[,8,"P1010008"],
	[,10,"P1010008"],
	[,10,'DCFC0102'],
	[,10,'DCFC0108'],
	[,10,'DCFC0111'],
	[,10,'DCFC0103'],
	[,10,'DCFC0116'],
	[,10,'DCFC0117'],
	[,10,'DCFC0114'],
	//[,10,'IMG_1950'],
	//[,10,'IMG_1947'],
	//[,10,'IMG_1948'],
	[,10,'IMG_1949'],
	[,10,'IMG_1952'],
	[,10,'IMG_1026'],
	[,11,"6"],
	[,11,"leroux 003"],
	//[,11,"leroux 069"],
	[,11,"leroux 074"],
	[,11,"leroux 085"],
	[,11,"CIMG1430"],
	[,11,"CIMG1415"],
	[,11,"CIMG1397"],
	[,11,"CIMG1402"],
	//[,11,"DCFC0048"],
	[,11,"DCFC0071"],
	[,11,'DSC_0125'],
	[,11,'DSC_0127'],
	[,11,'DSC_0177'],
	[,11,'DSC_0153'],
	[,11,'DSC_0126'],
	[,11,'DSC_0175'],
	[,11,'DSC_0171'],
	[,11,'DSC_0131'],
	//[,11,'DSC_0174'],
	[,11,'DSC_0133'],
	[,11,'DSC_0183'],
	[,11,'DSC_0179'],
	[,11,'DSC_0187'],
	[,12,'PC180026'],
	[,12,'P9240011'],
	[,12,'P9240006'],
	[,12,'P9240013'],
	[,12,'PB050030'],
	[,12,'PA130001'],
	[,12,'PC180032'],
	[,12,'P9240012'],
	[,12,'PA130002'],
	[,12,'P9230003'],
	[,12,'P9220002'],
	[,12,'P9240010'],
	[,13,'P8020014'],
	[,13,'P8020013'],
	[,13,'CIMG6943'],
	[,13,'CIMG6944'],
	[,13,'CIMG6940'],
	[,13,'CIMG6942'],
	[,13,'P8020020'],
	[,13,'P8020017'],
	[,13,'CIMG6946'],
	[,13,'Dimmitt Pavillion 005'],
	[,13,'Dimmitt Pavillion 002'],
	[,13,'Dimmitt Pavillion 003'],
	[,13,'Dimmitt Pavillion 001'],
	[,13,'Dimmitt Pavillion 004'],
	[,14,'CIMG5299'],
	[,14,'CIMG5298'],
	[,14,'CIMG5277'],
	[,14,'CIMG3790'],
	[,14,'CIMG5297'],
	[,14,'CIMG5296'],
	[,14,'CIMG5283'],
	[,14,'CIMG1685'],
	[,14,'CIMG3795'],
	[,14,'CIMG5292'],
	[,14,'CIMG5285'],
	[,14,'CIMG1868'],
	[,14,'CIMG5281'],
	[,14,'CIMG5295'],
	[,14,'CIMG5293'],
	[,14,'CIMG5278'],
	[,15,'DCFC0020'],
	//[,15,'DCFC0029'],
	[,15,'IMG_3634'],
	[,15,'DCFC0017'],
	[,15,'IMG_3637'],
	[,15,'DCFC0019'],
	[,15,'IMG_3636'],
	[,15,'IMG_3592'],
	[,15,'IMG_3638'],
	[,15,'DCFC0018'],
	[,15,'DCFC0031'],
	[,15,'IMG_3591'],
	[,15,'IMG_3635'],
	[,16,'1'],
	[,16,'7'],
	[,16,'9'],
	[,16,'12'],
	[,16,'13'],
	[,16,'14'],
	[,16,'18'],
	[,16,'15'],
	[,16,'16'],
	[,16,'19'],
	[,16,'20'],
	[,16,'22'],
	[,16,'DCFC0003'],
	[,16,'DCFC0011'],
	[,16,'DCFC0010'],
	[,16,'DCFC0001'],
	[,16,'DCFC0009'],
	[,16,'DCFC0008'],
	[,16,'DCFC0005'],
	[,16,'DCFC0006']
];

function getThumbs(thumbNum)
	{
	var tN = thumbNum;
	var pg = '';
	document.write(pg);
	}

function showTopics()
	{
	var pg = "<table id=\"pgTopics2\"><tr>";
	var t = pgTopics.length;	
	for(var i=0;i<t;i++)
		{
		var a = pgTopics[i][1]; //TOPIC
		var b = pgTopics[i][3]; //IMAGE NAME
		if(i==0) { continue; }
			pg += "<td valign=\"top\">";
			pg += "<a href=\"photoGallery_"+i+".html\">";
			pg += "<img src=\"images/gallery/sm/"+b+".jpg\" border=0 /><br />";
			pg += a;
			pg += "</a></td>";
			if(i%4 == 0) { pg += "</tr><tr>"; }
			//if(i == 12) { pg += "<td> </td>"; }
		}
	pg += "</table>";
	document.write(pg);
	}

function showBig(imgName) 
	{
	m = "images/gallery/"+imgName+".jpg";
	document.images.bigPic.src=m;
	document.images.xPic.src="images/x.jpg";
	}

function hideMe()
	{
	document.images.bigPic.src="images/trans.gif";
	document.images.xPic.src="images/trans.gif";
	}
	

function showThumbs(num,cols)
		{
		var n = num;
		var n1 = n+1;
		var n2 = n-1;
		var g = cols;
		var c = pgTopics[n][1]; //TOPIC HEADING
		var d = pgTopics[n][2]; //TOPIC COPY (optional)
		pg = "";
	
	var max = (pgTopics.length-1);
	var t = pgImages.length;
	var picNum = 0;
	var rowNum = 1;
	var k = '';
	if(n!=1) { k += "&larr; <a href=\"photoGallery_"+n2+".html\">previous</a> | "; }
	k += "<a href=\"photoGallery.html\">back to main Photo Gallery Page</a>";
	if(n!=max) { k += " | <a href=\"photoGallery_"+n1+".html\">next</a> &rarr;"; }
	var ii = "Click on an image to enlarge it.<br />Click on the larger image to hide it.";
	//<!-- ENLARGEMENT PLACEHOLDER HERE -->
		pg += '<a href="javascript:hideMe()">';
		pg += '<img src="images/trans.gif" id="bigPic" border=0 alt="Photo Gallery - Click to Hide Image Enlargement" />';
		pg += '<img src="images/trans.gif" id="xPic" border=0 alt="click to hide" /></a>';
	pg += "<div style='width: 480px; height: 320px; overflow: scroll;'>";
	pg += "<table id=\"pgTopics3\"><tr>";
	pg += "</tr><tr><td  class=\"endPage2\" colspan=\""+g+"\"><center><h2>"+c+"</h2>"+ii+"</center></td></tr><tr>"; 
	for(var i=0;i<t;i++)
		{
		var a = pgImages[i][1]; //IMAGE COLLECTION
		var b = pgImages[i][2]; //IMAGE NAME
			if(a!=n) { continue; }
			else
			{
			picNum = picNum + 1 ;
			pg += "<td valign=\"top\">";
			pg += "<a href=\"javascript:showBig(\'"+b+"\')\">";
			pg += "<img src=\"images/gallery/sm/"+b+".jpg\" border=0 /></a>";
			pg += "</td>";
			if(picNum%g == 0) { pg += "</tr><tr>"; rowNum = rowNum + 1 ; }
			}
		}
	pg += "</table></div>";
	//if(d!='') { var w = 105*g; pg += "<tr><td width=\""+w+"\" colspan="+g+" style=\"text-align:left; padding: 5px 20 5px 0px;\">"+d+"</td></tr>";}
	if(d!='') {  pg +=  "<p>"+d+"</p>"; }
	//pg += "<tr><td colspan="+g+" style=\"font-size: 11px; color: #930; \">"+k+"</td></tr>";
	pg += "<p>"+k+"</p>";
	/*
	var h = "";
	if(rowNum>3) { pg += "</tr><tr><td  class=\"endPage2\" colspan=\""+g+"\"><center>"+h+"</center></td></tr></table>";  }
	else if(rowNum<=3) 
		{ 
			if(n==1) { pg += "</tr><tr><td  class=\"endPage2\" colspan=\""+g+"\"><center>"+h+"</center></td></tr></table>"; } 
			else { pg += "</tr></table>";  }
		}
	*/
	document.write(pg);
	}

	
