    function change () { 
  
       // get location into array
       arr = document.location.href.split('/');
       // store page name 
       pageName = arr[arr.length-1];
       
       for(j=1;j<arr.length;j++){
          arr[j] = arr[j-1]+'/'+arr[j];
       }

       // go through each link in document
       for(i=0;i<document.links.length;i++){
          var tmp = -1;
          // get class name of link
          clss = document.links[i].className;
          
//alert("link  in document = " + document.links[i].href);
// alert( "document.links[" + i + "].className = " + clss + "\nclss = " + clss);

          // get link into array
          arr1 = document.links[i].href.split('/');
          
          for(j=1;j<arr1.length;j++){
              arr1[j] = arr1[j-1]+'/'+arr1[j];
          }
   
          // always highlight link == location
          if( document.location.href == document.links[i].href ){
              document.links[i].style.color = "#000000";
              //alert(document.links[i].style.color);
              document.links[i].style.background = "#FFD08A";
          } 
       } 
       
       menuArr = ["resi","comm","list","art0"];
       prefix = pageName.split('_');
       for(i=0;i<4;i++){
       		target = document.getElementById(menuArr[i]);
       		if(prefix[0] == menuArr[i]){
       			target.style.display = "block";
				
				var tmpStr = String(i+"_0");
				targetLink = document.getElementById(tmpStr)
				contentChangeByClick(i,0,targetLink);
       		}
       		else{
       			target.style.display = "none";
       		}
       	} 
    }
    
    function contentChangeByClick(section,page,context){
		/////////////////////////////////////////////////
		// context passed as a string from image click //
		// but as an object reference otherwise        //
		/////////////////////////////////////////////////
		if(context.id == undefined){
			context = document.getElementById(context);
		}
		// make page a number just in case
		page = Number(page);
    	
		//alert("Changing content : "+section+" , "+typeof(page)+" , "+context.id+"\n");
    	
    	////////////////////////////////
		// reset menu highlight style //
    	////////////////////////////////
    	for(i=0;i<document.links.length;i++){
    		if(document.links[i].className == "submenulink"){
    			document.links[i].style.color = "#000000";
              		document.links[i].style.background = "#FFFFFF";
    		}
    	}
		/////////////////////////////
		// menu to highlight style //
    	/////////////////////////////
    	context.style.color = "#000000";
    	context.style.background = "#FFD08A";
    	
    	///////////////////////
    	// set image content //
    	///////////////////////
		currentSectionIndex = section;
		currentPageIndex = page;
		currentImageIndex = 0;
			///////////////////////////////////////////////
			// use test image to get around IE problems  //
			// and general latency (see functions below) //
			// and substitute default image for the no   // 
			// usual image icon                          //
			///////////////////////////////////////////////
    	if(page == 0){
			//alert("inside page == 0");
    		document.getElementById("thumbnailimages").style.display = "block";	
    		document.getElementById("bigimages").style.display = "none";
			
			/////////////////////////////////////////////////////////////////
			// need delay as IE can't thinks the thumbs DIV is not visible //
			/////////////////////////////////////////////////////////////////
			setTimeout("showThumbnails("+section+")",1000);
			
		}
    	else{
			//alert("inside page != 0");
    		document.getElementById("thumbnailimages").style.display = "none";	
    		document.getElementById("bigimages").style.display = "block";	


			////////////////////////////////////////////
			// reset test variables and run test when //
			// browser 'CLAIMS' the image has loaded  //
			////////////////////////////////////////////
			currentImage = "./images/"+imageNames[section][page][0]+".jpg";
			testCount = 0;
			delay = 1000;
			testImage = null;
			testImage = new Image();
			testImage.src = currentImage;
			testImage.onLoad = myHandlerOnLoad("bigImage");
    	}
    	
    	
    	//////////////////////
    	// set text content //
    	//////////////////////
    	textDiv = document.getElementById("front");
    	
    	newContent = name[section][page] + address[section][page] + textContent[section][page];
    	
    	textDiv.innerHTML = newContent;//name[section][page];
		
		
		//////////////////////////////////
		// show next and previous links //
		//////////////////////////////////
		var nextPrevHTML = "<a href='Javascript:Void(0)' onclick='nextPrevChange(-1)' class='nextprevlink'>&nbsp;previous&nbsp;</a><img src='./images/shim.gif' width='380' height='10' /><a href='Javascript:Void(0)' onclick='nextPrevChange(1)' class='nextprevlink'>&nbsp;next&nbsp;</a>";
		if(imageNames[section][page].length > 1){
			
			document.getElementById("nextPrev").innerHTML = nextPrevHTML;
		}
		else{
			document.getElementById("nextPrev").innerHTML = " ";
		}
		
		if(section == 3){
			if(page == 0){
				document.getElementById("bigpic_downabit").style.height = "500px";
				//alert("top = "+ document.getElementById("bigpic_downabit").style.height);	
			}
			else{
				document.getElementById("bigpic_downabit").style.height = "380px";	
				//alert(document.getElementById("bigpic_downabit").style.height);	
			}
		}
		/**/
    }
	

	
	function nextPrevChange(incr){
		currentImageIndex += incr;
		if(currentImageIndex < 0){
			currentImageIndex = Number(imageNames[currentSectionIndex][currentPageIndex].length - 1)
		}
		if(currentImageIndex > Number(imageNames[currentSectionIndex][currentPageIndex].length - 1)){
			currentImageIndex = 0;
		}
			currentImage = "./images/"+imageNames[currentSectionIndex][currentPageIndex][currentImageIndex]+".jpg";
			testCount = 0;
			testImage = null;
			testImage = new Image();
			testImage.src = currentImage;
			testImage.onLoad = myHandlerOnLoad("bigImage");
	}
	
	function showThumbnails(section){
			for(i=1;i<imageNames[section].length;i++){
				var tmpStr = String("thumbnailimages_"+Number(i-1));
				currentImage = "./images/"+imageNames[section][i][0]+"_th.jpg";
				//////////////////////////////////////////////
				// N.B. can't use myHandlerOnLoad functions //
				// as the thumbnails are too fast           //
				//////////////////////////////////////////////
				document.getElementById(tmpStr).src = currentImage;
				//alert(tmpStr+" : "+document.getElementById(tmpStr).src);

			}
		}
	//////////////////////////
	// test image variables //
	//////////////////////////
	var currentSectionIndex = 0;
	var currentPageIndex = 0;
	var currentImageIndex = 0;
	
	var defaultImage = "./images/default.jpg";
	var currentImage = "./images/default.jpg";
	var testImage = null;
	var testCount = 0;
	var newContent = null;
	
	var delay = 1000;
	
	//////////////////////////
	// test image functions //
	//////////////////////////
	function myHandlerOnLoad(imageId){
		//alert("LOADED testImage.width = "+testImage.width+", testCount = "+testCount+", tryAgain = "+tryAgain+", fileSize = "+testImage.fileSize);

		//////////////////////////////////////////////
		// testImage.width reported as 0 by Mozilla //
		//////////////////////////////////////////////
		if(testImage.width < 1 ){
			testCount++;
		}
		else{
			//////////////////////////////////////////
			// testImage.width reported as -1 by IE //
			//////////////////////////////////////////
			if(Number(testImage.fileSize) < 1){
				testCount++;
			}
			else{
				///////////////////////////////////////////////
				// image OK but need to force refresh for IE //
				// by setting .src more than once            //
				///////////////////////////////////////////////
				testCount--;
			}
			
		}
		myHandlerOnError0 (imageId);
	}
	 
	///////////////////////////////////
	// N.B. IE needs about 1 seconds //
	///////////////////////////////////
	function myHandlerOnError0 (imageId) {
		//alert("setTimeout called");
		error0Interval = setTimeout("tryImageAgain('"+imageId+"')",delay);
	}
	/////////////////////////////////////////////////////
	// function to set image depending on test results //
	/////////////////////////////////////////////////////
	function tryImageAgain (imageId){
		var tryAgain = null; 
		//////////////////////////////////////////////////////
		// need to try twice in case user is crazy clicking //
		// on the links                                     //
		//////////////////////////////////////////////////////
		if(testCount > 1){
			
			tryAgain = defaultImage;
		}
		else{
			tryAgain = currentImage;
		}
		
		if(testCount < 2 && testCount > -3){
			if(testCount == -2){
				delay = 2000;
			}
			document.getElementById(imageId).onLoad = myHandlerOnLoad(imageId);
			document.getElementById(imageId).src = tryAgain;
		}
		///////////////////////////////////////////////////////////
		// debugging write to innerHTML as alert gives too much  //
		// time and lets you think it is working when it isn't   //
		///////////////////////////////////////////////////////////
		//newContent = "tryImageAgain setTimeout fired  testImage.width = "+testImage.width+", testCount = "+testCount+", tryAgain = "+tryAgain+", fileSize = "+testImage.fileSize;
		//document.getElementById("front").innerHTML += "<p>"+newContent+"</p>";
		//newContent = ".";
		//document.getElementById("bigimages").innerHTML += newContent;
	}	
	