		var qString =top.location.search.substring(1).split('='); 
		var glbPid = qString[1];
		glbPid = eval(glbPid);
		//alert(typeof glbPid);
		if (typeof(glbPid) == 'undefined') {
			glbPid = 1;
		} else if ((glbPid > 50)  || (glbPid < 1)) {
			glbPid = 1;
		}

		//alert(glbPid);
		glbCurrentPhoto = 1
	
		// function to swap nav and button images on page.  the buSource variable is 
		// passed to check if the button being rolled over is the current photo in order for it to stay black.


		//alert(daSrcNum);
		  //create an array of all the photograph sources
		  // #image_loc# 
		
		  var arrPhotographSrc = new Array();
		  		arrPhotographSrc[0] = "images/spacer.gif"
				arrPhotographSrc[1] = "images/Connors-Kyoto-2006,2007-[06SM167].jpg"
				arrPhotographSrc[2] = "images/Connors-Tokyo-2006,2008-[06SM109].jpg"
				arrPhotographSrc[3] = "images/07SM-L005.2.jpg"
				arrPhotographSrc[4] = "images/Connors-Berlin-2005-[05SM082].jpg"
				arrPhotographSrc[5] = "images/Connors-Berlin-2005,2006-[05SM019].jpg"
				arrPhotographSrc[6] = "images/Connors-Beijing-2008-[08SM112].jpg"
				arrPhotographSrc[7] = "images/Connors-Aerial5[08SM-L005.3].jpg"
				arrPhotographSrc[8] = "images/Connors-Beirut-2007,2008-[07SM155].jpg"
				arrPhotographSrc[9] = "images/Connors-NewYorkCity-2004[04SM103].jpg"
				arrPhotographSrc[10] = "images/07SM-L006.3-NEG.jpg"
				arrPhotographSrc[11] = "images/Connors-Berlin-2005,2008-[05SM101].jpg"
				arrPhotographSrc[12] = "images/Connors-Beijing-2008,2009-[08SM062].jpg"
				arrPhotographSrc[13] = "images/Connors-Aerial1[08SM-L005.4].jpg"
				arrPhotographSrc[14] = "images/Connors-Nagasaki-2006-[06SM123].jpg"
				arrPhotographSrc[15] = "images/Connors-Damascus-2007,2008-[07SM091].jpg"
				arrPhotographSrc[16] = "images/Connors-Niigata-2006,2007-[06SM228].jpg"
				arrPhotographSrc[17] = "images/Connors-Aerial3[08SM-L006.1].jpg"
				arrPhotographSrc[18] = "images/Connors-Beirut-2007,2008-[07SM015].jpg"
				arrPhotographSrc[19] = "images/Connors-HongKong-2004-[04WN013].jpg"
				arrPhotographSrc[20] = "images/07SM-L007.3.jpg"
				arrPhotographSrc[21] = "images/Connors-Nagasaki-2006,2009-[06SM134].jpg"
				
				

				
				
		   var arrPhotoCaption = new Array();
				arrPhotoCaption[0] = "filler"
				arrPhotoCaption[1] = "Kyoto, 2006-2007"
				arrPhotoCaption[2] = "Tokyo, 2006-2008"
				arrPhotoCaption[3] = "Cave 4, 2007"
				arrPhotoCaption[4] = "Berlin, 2005"
				arrPhotoCaption[5] = "Berlin, 2005-2006"
				arrPhotoCaption[6] = "Beijing, 2008"
				arrPhotoCaption[7] = "Aerial 5, 2008"
				arrPhotoCaption[8] = "Beirut, 2007-2008"
				arrPhotoCaption[9] = "New York City, 2004"
				arrPhotoCaption[10] = "Negative Cave 1, 2007"
				arrPhotoCaption[11] = "Berlin, 2005-2008"
				arrPhotoCaption[12] = "Beijing, 2008-2009"
				arrPhotoCaption[13] = "Aerial 1, 2008"
				arrPhotoCaption[14] = "Nagasaki, 2006"
				arrPhotoCaption[15] = "Damascus, 2007-2008"
				arrPhotoCaption[16] = "Niigata, 2006-2007"
				arrPhotoCaption[17] = "Aerial 3, 2008"
				arrPhotoCaption[18] = "Beirut, 2007-2008"
				arrPhotoCaption[19] = "Hong Kong, 2004"
				arrPhotoCaption[20] = "Cave 2, 2007"
				arrPhotoCaption[21] = "Nagasaki, 2006-2009"
				
				
			 var arrPhotoNumber = new Array();
				arrPhotoNumber[0] = "filler"
				arrPhotoNumber[1] = "1"
				arrPhotoNumber[2] = "2"
				arrPhotoNumber[3] = "3"
				arrPhotoNumber[4] = "4"
				arrPhotoNumber[5] = "5"
				arrPhotoNumber[6] = "6"
				arrPhotoNumber[7] = "7"
				arrPhotoNumber[8] = "8"
				arrPhotoNumber[9] = "9"
				arrPhotoNumber[10] = "10"
				arrPhotoNumber[11] = "11"
				arrPhotoNumber[12] = "12"
				arrPhotoNumber[13] = "13"
				arrPhotoNumber[14] = "14"
				arrPhotoNumber[15] = "15"
				arrPhotoNumber[16] = "16"
				arrPhotoNumber[17] = "17"
				arrPhotoNumber[18] = "18"
				arrPhotoNumber[19] = "19"
				arrPhotoNumber[20] = "20"
				arrPhotoNumber[21] = "21"


				
		function photoSwap(daImage, daSrcNum){				
			var captionText;	
			var imageNumber;
			
		  var objStr,obj;	
		  // Check to make sure that images are supported in the DOM.
		  if(document.images){
		    // Check to see whether you are using a name, number, or object
		    if (typeof(daImage) == 'string') {
		      // This whole objStr is here solely to gain compatability
		      // with ie3 for the mac.
		      objStr = 'document.' + daImage;
		      obj = eval(objStr);
				
			//alert(daSrcNum);
				//check which button was pushed
				if (daSrcNum == 998) {
					intBackPhoto = glbCurrentPhoto - 1;
					if (intBackPhoto == 0) {
						intBackPhoto = 21
					}
					obj.src = preload_image_object[intBackPhoto].src;
					captionText = arrPhotoCaption[intBackPhoto];
					document.getElementById("imgDisplay_title").innerHTML=captionText;
					imageNumber = arrPhotoNumber [intBackPhoto];
					document.getElementById("imgDisplay_number").innerHTML=imageNumber;
					glbCurrentPhoto = intBackPhoto;
				} else if (daSrcNum == 999) {
					intForwardPhoto = glbCurrentPhoto + 1;
					if (intForwardPhoto == 22) {
						intForwardPhoto = 1
					}
		               //alert("go");
//          			obj.src = arrPhotographSrc[intForwardPhoto];
          			obj.src=preload_image_object[intForwardPhoto].src;
                    captionText = arrPhotoCaption[intForwardPhoto];
					document.getElementById("imgDisplay_title").innerHTML=captionText;
					imageNumber = arrPhotoNumber[intForwardPhoto];
					document.getElementById("imgDisplay_number").innerHTML=imageNumber;
					glbCurrentPhoto = intForwardPhoto;
				} else if (daSrcNum <= 100 ) {
		  
               		obj.src = preload_image_object[daSrcNum].src;
                    captionText = arrPhotoCaption[daSrcNum];
					document.getElementById("imgDisplay_title").innerHTML=captionText;
					imageNumber = arrPhotoNumber[daSrcNum];
					document.getElementById("imgDisplay_number").innerHTML=imageNumber;
					glbCurrentPhoto = daSrcNum;
				}
		    } else if ((typeof(daImage) == 'object') && daImage && daImage.src) {
		       
              daImage.src = preload_image_object[daSrcNum].src;
			  captionText = arrPhotoCaption[daSrcNum];
			  document.getElementById("imgDisplay_title").innerHTML=captionText;
			  imageNumber = arrPhotoNumber [daSrcNum];
			  document.getElementById("imgDisplay_number").innerHTML=imageNumber;
			  
		    }
		  }
		  
		}
		
		
		
