var actShots1 = new Array(" ",
"http://www.shadetreecanopies.com/HomePageGalleries/Patios/Patios.html",
"http://www.shadetreecanopies.com/HomePageGalleries/Decks/Decks.html",
"http://www.shadetreecanopies.com/HomePageGalleries/Pools/Pools.html",
"http://www.shadetreecanopies.com/HomePageGalleries/HotTubs/HotTubs.html",
"http://www.shadetreecanopies.com/HomePageGalleries/Commercial/Commercial.html",
"http://www.shadetreecanopies.com/HomePageGalleries/WoodAttached/WoodAttached.html",
"http://www.shadetreecanopies.com/HomePageGalleries/AluminumAttached/AluminumAttached.html",
"http://www.shadetreecanopies.com/HomePageGalleries/VinylAttached/VinylAttached.html",
"http://www.shadetreecanopies.com/HomePageGalleries/PergolaAttached/PergolaAttached.html",
"http://www.shadetreecanopies.com/HomePageGalleries/WoodFreeStanding/WoodFreeStanding.html",
"http://www.shadetreecanopies.com/HomePageGalleries/AluminumFreeStanding/AluminumFreeStanding.html",
"http://www.shadetreecanopies.com/HomePageGalleries/VinylFreeStanding/VinylFreeStanding.html",
"http://www.shadetreecanopies.com/HomePageGalleries/PergolaFreeStanding/PergolaFreeStanding.html");


var lastShot = 1;
var maxPics = 13;

	
function src_act(imgID,imgName,src_code) {

	if (NS6) { var XImg = document.getElementById(imgName)}
	else {
		if (NS4) {
			var XImg = eval( "document." + imgID + ".document.images[imgName]");
		}
		else {
			var XImg = eval( "document.all." + imgName );
		}
	}
	XImg.src=src_code;
}


function swapImage(sshotNum) {
	src_act('','daframe1',actShots1[sshotNum]);
}

function DisplayShot(shotNum) {
	swapImage(shotNum)
	if (NS4) {}
	else {
		var navName = "nav" + lastShot;
		changeColorPurp(navName);
		navName = "nav" + shotNum;
		changeColorRed(navName);
	}
	lastShot = shotNum
}

function Incr() {
	nextShot = lastShot + 1;
	if (nextShot > maxPics) {nextShot = 1}
	DisplayShot(nextShot);
}

function Decr() {
	nextShot = lastShot - 1;
	if (nextShot < 1) {nextShot = maxPics}
	DisplayShot(nextShot);
}

function changeColorRed (objName) {
	var visNavObj = getObj(objName);
	visNavObj.color = "#006600";
}

function changeColorPurp (objName) {
	var visNavObj = getObj(objName);
	visNavObj.color = "#99C299";
}

function visitShadeTree () {
	custwindow=open("http://www.shadetreecanopies.com","CustWindow1");
}

function setFrameSize(frameid)
{
	if (NS4||NS6) { 
		avail_width = innerWidth;
		avail_height = innerHeight;}
	else {
		avail_width = document.body.clientWidth;
		avail_height = document.body.clientHeight;}
	
	
	if (avail_width > 900) {frameWidth = 330 + ((avail_width - 900) * .30)}
	else	{frameWidth = 330}
	
	
	var el=document.getElementById(frameid)
	var frameHeight = 308/384
	frameHeight = frameHeight * frameWidth
	el.height=frameHeight;
	el.width=frameWidth;
}