
	/*
		Image Gallery by Jenna Hall
	*/
	var main_images=new Array();
	var curr_image=0;

	/*
	This function will load the images that reside on the server.
	param path: path to the images dir
	param args: each image file separated by a comma
	return false: so that the page does not load
	*/
	function loadImageSet(path, args, prjName, prjAddress, prjSQFt, prjDate, prjDesc) {

	    //reinitialize curr_image to 0
	    curr_image=0;
	    //reinitialize photo array
	    main_images = null;
	    main_images=new Array();

		//enable the image area and the buttons
		if(document.getElementById("photoarea").style.display == "none") {
			document.getElementById("photoarea").style.display = "inline";
			document.getElementById("photobuttons").style.display = "block";
			//make this inline so the arrow images on each side are on the same line
            document.getElementById("phototextabove").style.display = "inline";
			document.getElementById("photoAddresstext").style.display = "inline";
			document.getElementById("photoSQFttext").style.display = "inline";
			document.getElementById("photoDatetext").style.display = "inline";
			document.getElementById("photoDot").style.display = "inline";
			document.getElementById("photoDesctext").style.display = "inline";

		}

		//javascript image array
		var main_images_arr = args.split(",");
		var index = 0;
		while(index < main_images_arr.length) {
			main_images[index] = path + main_images_arr[index];
			index ++;

		}

		//set the image area to display the first image
		document.images.image_detail_row.src=main_images[0];


		//set the text below to display the project address, sq ft, and completion date

		//Firefox
		if ('string' == typeof document.getElementById("phototextabove").textContent) {
		    //set the text above area to display the project name
		    document.getElementById("phototextabove").textContent = prjName;

		    document.getElementById("photoAddresstext").textContent = prjAddress;
		    document.getElementById("photoSQFttext").textContent = prjSQFt;
		    document.getElementById("photoDatetext").textContent = prjDate;
		    document.getElementById("photoDesctext").textContent = prjDesc;

		//IE
		} else if ('string' == typeof document.getElementById("phototextabove").innerText) {
		    //set the text above area to display the project name
		    document.getElementById("phototextabove").innerText = prjName;

		    document.getElementById("photoAddresstext").innerText = prjAddress;
		    document.getElementById("photoSQFttext").innerText = prjSQFt;
		    document.getElementById("photoDatetext").innerText = prjDate;
		    document.getElementById("photoDesctext").innerText = prjDesc;
		}

		return false;
	}

	function shiftBackward(){

		if (curr_image>0) {
			window.status='';
			curr_image--;
			document.images.image_detail_row.src=main_images[curr_image];
		} else {
			document.images.image_detail_row.src=main_images[main_images.length-1];
			curr_image = main_images.length-1;
		}
	}

	function shiftForward(){

		if (curr_image<main_images.length-1) {
			curr_image++;
			document.images.image_detail_row.src=main_images[curr_image];
		} else {
			document.images.image_detail_row.src=main_images[0];
			curr_image = 0;
		}
	}

