
//FUNCTION 1
//Open the photo viewer, the format argument defines whether to use potrait (0), Landscape (1) or General(2 / no param) 
//The second parameter defines which photo to use
function OpenViewer(Format, Value) 
{
	var myString1 = "window.open('viewer.html?";

	var myString2 = Value;
		
	var myString3a = "','PhotoViewer','width=300,height=500,resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,screenX=600,screenY=50,left=600,top=50')";
	var myString3b = "','PhotoViewer','width=500,height=365,resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,screenX=450,screenY=50,left=450,top=50')";
	var myString3c = "','PhotoViewer','width=800,height=650,resizable=no,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,screenX=100,screenY=100,left=100,top=50')";

	switch (Format)
	{
		case 0:
		eval( myString1 + myString2 + myString3a );
		break

		case 1:
		eval( myString1 + myString2 + myString3b );
		break

		case 2:
		eval( myString1 + myString2 + myString3c );
		break

		default:
		eval( myString1 + myString2 + myString3c );
	}
} 

//FUNCTION 2
//Capture the photo number and switch to that image before performing a document.write for the image tag
function OpenPicture()
{
	var PictureVar = location.search.substr(1).split("?");
	PictureID = parseInt(PictureVar);
	PictureSrc = "Photo Not Available";
	PictureAlt = "Photo Not Available";
	ImageString = "Photo Not Available";

	switch (PictureID)
	{
		case 1:
		PictureSrc = "./images/featured work/frasier and a special guest.jpg";
		PictureAlt = "Frasier sits at the coffee table for a glass of wine"
		break
	
		case 2:
		PictureSrc = "./images/featured work/frasier and the coffee table.jpg";
		PictureAlt = "Frasier does some business at the coffee table"
		break

		case 3:
		PictureSrc = "./images/custom furniture/charlies oak kitchen enlarge.jpg";
		PictureAlt = "Enlarged image"
		break

		case 4:
		PictureSrc = "./images/custom furniture/french country kitchen enlarge.jpg";
		PictureAlt = "Enlarged image"
		break

		case 5:
		PictureSrc = "./images/custom furniture/hummingbird kitchen enlarge.jpg";
		PictureAlt = "Enlarged image"
		break
		
		case 6:
		PictureSrc = "./images/custom furniture/distressed pirate chest enlarge.jpg";
		PictureAlt = "Enlarged image"
		break

		case 7:
		PictureSrc = "./images/custom furniture/black walnut entertainment center enlarge.jpg";
		PictureAlt = "Enlarged image"
		break

		case 8:
		PictureSrc = "./images/custom furniture/black walnut tv center enlarge.jpg";
		PictureAlt = "Enlarged image"
		break

		case 9:
		PictureSrc = "./images/custom furniture/victorian bed and set enlarge.jpg";
		PictureAlt = "Enlarged image"
		break
		
		case 10:
		PictureSrc = "./images/custom furniture/broken pediment cherry bed enlarge.jpg";
		PictureAlt = "Enlarged image"
		break

		case 11:
		PictureSrc = "./images/custom furniture/oak grape mantel enlarge.jpg";
		PictureAlt = "Enlarged image"
		break

		case 12:
		PictureSrc = "./images/custom furniture/natalie coles bedroom enlarge.jpg";
		PictureAlt = "Enlarged image"
		break

		case 13:
		PictureSrc = "./images/custom furniture/stefs hope chest enlarge.jpg";
		PictureAlt = "Enlarged image"
		break

		case 14:
		PictureSrc = "./images/custom furniture/writing desk enlarge.jpg";
		PictureAlt = "Enlarged image"
		break

		default:
		PictureSrc = "Photo Not Available"
		PictureAlt = "Photo Not Available"
	}

	ImageString = "<CENTER><!-- Image --><IMG SRC=\"" + PictureSrc + "\" ALT=\"" + PictureAlt + "\"></CENTER>"
	return ImageString;
}

//FUNCTION 3
//Wrapper method for image string calculation function (function 2) and document.write output
function PrintHTML()
{
	var myString = OpenPicture();
	document.write(myString);
}


