
var curImage = 1;
var curPatioImage = 1;
var curWalkWayIamge = 1;
var curTreeRingImage = 1;

/* --------------------------------------- EDGING FUNCTIONS!!! ---------------------------------------- */


function changeImage()
{
	if (curImage <= 11)
		curImage ++;
	document.images.edging.src = "/photos/edging/edge_" + curImage + ".jpg";
	
	if (curImage >= 12)
		curImage =0;
}


function swapImage(num)
{
	document.images.edging.src = "/photos/edging/edge_" + num + ".jpg";
}

function openImage (num)
{
	var screenWidth = screen.width;
	var screenHeight = screen.height;
	var propertyWidth = 840;
	var propertyHeight = 650;
	var winLeft = (screenWidth - propertyWidth)/2;
	var winTop = (screenHeight - propertyHeight)/2;
	
	propertyWindow = window.open(/*window.sizeToContent("<img src='/photos/edging/edge_" + num + ".jpg' height='480' width='640' />")*/ "/html/edging/edge_" + num + ".html"  , "Edging" , "left=" + winLeft + ",top=" + winTop + ",width=840, height=650");
	
	//"<img src='/photos/edging/edge_" + num + ".jpg' height='480' width='640' />"
}


function nextEdgePic()
{
	if (curImage < 24)
		curImage ++;
	else
		curImage = 1;
	displayPic(curImage, "edging", "edge");
}

function prevEdgePic()
{
	if (curImage > 1)
		curImage --;
	else
		curImage = 24;
	displayPic(curImage, "edging", "edge");
}



/* --------------------------------------- PATIO FUNCTIONS!!! ---------------------------------------- */

function swapPatioImage (num)
{
	document.images.patio.src = "/photos/patio/patio_" + num + ".jpg";
}

function openPatioImage (num)
{
	var screenWidth = screen.width;
	var screenHeight = screen.height;
	var propertyWidth = 840;
	var propertyHeight = 650;
	var winLeft = (screenWidth - propertyWidth)/2;
	var winTop = (screenHeight - propertyHeight)/2;
	
	propertyWindow = window.open(/*window.sizeToContent("<img src='/photos/edging/edge_" + num + ".jpg' height='480' width='640' />")*/ "/html/patio/patio_" + num + ".html"  , "Edging" , "left=" + winLeft + ",top=" + winTop + ",width=840, height=650");
	
	//"<img src='/photos/edging/edge_" + num + ".jpg' height='480' width='640' />"
}

function changePatioImage()
{
	curPatioImage ++;
	document.images.patio.src = "/photos/patio/patio_" + curPatioImage + ".jpg";
	if (curPatioImage >= 18)
		curPatioImage =0;
}

function nextPatioPic() 
{
	if (curPatioImage < 18)
		curPatioImage ++;
	else
		curPatioImage = 1;
	displayPic(curPatioImage, "patio", "patio");
}

function prevPatioPic()
{
	if (curPatioImage > 1)
		curPatioImage --;
	else
		curPatioImage = 18;
	displayPic(curPatioImage, "patio", "patio");
}

/* --------------------------------------- WALKWAY FUNCTIONS!!! ---------------------------------------- */


function nextWalkWayPic()
{
	if (curWalkWayIamge < 12)
		curWalkWayIamge ++;
	else
		curWalkWayIamge = 1;
	displayPic(curWalkWayIamge, "walkways", "walkway");
}

function prevWalkWayPic()
{
	if (curWalkWayIamge > 1)
		curWalkWayIamge --;
	else
		curWalkWayIamge = 12;
	displayPic(curWalkWayIamge, "walkways", "walkway");
}

function swapWalkWayImage(num)
{
	document.images.walkway.src = "/photos/walkways/walkway_" + num + ".jpg";
}

function openWalkWayImage (num)
{
	var screenWidth = screen.width;
	var screenHeight = screen.height;
	var propertyWidth = 840;
	var propertyHeight = 650;
	var winLeft = (screenWidth - propertyWidth)/2;
	var winTop = (screenHeight - propertyHeight)/2;
	
	propertyWindow = window.open("/html/walkways/walkway_" + num + ".html"  , "Walkway" , "left=" + winLeft + ",top=" + winTop + ",width=840, height=650");
}


/* --------------------------------------- TREE RINGS FUNCTIONS!!! ---------------------------------------- */

function nextTreeRingPic()
{
	if (curTreeRingImage < 6)
		curTreeRingImage ++;
	else
		curTreeRingImage = 1;
	displayPic(curTreeRingImage, "treeRings", "treeRing");
}

function prevTreeRingPic()
{
	if (curTreeRingImage > 1)
		curTreeRingImage --;
	else
		curTreeRingImage = 6;
	displayPic(curTreeRingImage, "treeRings", "treeRing");
}

function swapTreeRingImage(num)
{
	document.images.treeRing.src = "/photos/treeRings/treeRing_" + num + ".jpg";
}

function openTreeRingImage (num)
{
	var screenWidth = screen.width;
	var screenHeight = screen.height;
	var propertyWidth = 840;
	var propertyHeight = 640;
	var winLeft = (screenWidth - propertyWidth)/2;
	var winTop = (screenHeight - propertyHeight)/2;
	
	propertyWindow = window.open("/html/treeRings/treeRing_" + num + ".html"  , "Tree Rings" , "left=" + winLeft + ",top=" + winTop + ",width=840, height=650");
}

/* --------------------------------------- MISC FUNCTIONS!!! ---------------------------------------- */

function openFile (path)
{
	//width = parseInt(width);
	//height = parseInt(height);
	//document.write(path);
	var screenWidth = screen.width;
	var screenHeight = screen.height;
	var propertyWidth = 850;
	var propertyHeight = 650;
	var winLeft = (screenWidth - propertyWidth)/2;
	var winTop = (screenHeight - propertyHeight)/2;
	
	propertyWindow = window.open(path , "" , "left=" + winLeft + ",top=" + winTop + ",width=850, height=650");
}

function displayPic (num, pic, type) /*displayPic is used in conjunction with the next/prev buttons to shuffe pictures*/
{
	switch (pic)
	{
		case "edging":
			document.images.edging.src="/photos/" + pic + "/" + type + "_" + num + ".jpg";
			break;
		case "patio":
			document.images.patio.src="/photos/" + pic + "/" + type + "_" + num + ".jpg";
			break;
		case "walkways":
			document.images.walkway.src="/photos/" + pic + "/" + type + "_" + num + ".jpg";
			break;
		case "treeRings":
			document.images.treeRing.src="/photos/" + pic + "/" + type + "_" + num + ".jpg";
			break;
	}
}
