   // declare function variables for slideshow //
	 
	 var exampleno = 0;
   var imgCt = examples.length - 1;
	 var textRequired;
	  
   /* chgExample moves the slideshow in the direction of the parameter and 
	    wraps around. 
			Direction can have a value -1 or 1                                   */
	
   function chgExample(direction) {
      if (document.images) {                  // does the browswer understand images ? //
	       exampleno = exampleno + direction                               
	       if (exampleno > imgCt) {
				     exampleno = 0
	       } 
				 if (exampleno < 0) {
				     exampleno = imgCt
	       } 
			}
			document.example.src=examples[exampleno] // tell the document that the source of the image is the entry in examples indexed by exampleno //
			document.example.height=heights[exampleno] // tell the document that the height of the image is the entry in heights indexed by exampleno //
	
			/* textRequired can have a value of true or false and indicates whether caption text is required with the slideshow and is initialised
			   on page load                                                                                                                         */
			
			if (textRequired) {
			    document.exampleForm.exampleText.value = captionText[exampleno] // tell the document that the title of the image is the entry in captionText indexed by exampleno //
      }
			     
   }
  
	/* seTextReq is called on page load to intialise textRequired which indicates whether caption text is required with the slideshow */
	
	function setTextReq (required) {
	
	   if (required) {
	       textRequired = true;
		 }
		 else {
	      textRequired = false;	    
	   }
	}
		 
	/* The following declarations and keyHit functions allow the slideshow to be controlled 
	   by the left and right arrow keys                                                     */
	 
	document.onkeydown = keyHit  // register the keyHit function as the one to handle the onkeydown event //

	var ltArrow;
	var rtArrow;
	var thisKey;
	
	/* If the user is running Netscape 4.x. call captureEvents and store the codes 
	   of the the Netscape version of the left and right arrow keys                */
		 
	if (document.layers) {
		document.captureEvents(Event.KEYDOWN);
		ltArrow = 28;
		rtArrow = 29;
	}

	/* Otherwise for other browers store their codes of the left and right arrow key */

	else {
		ltArrow = 37;
		rtArrow = 39;
	}
	
	/* The function keyHit handles the event when the keys are hit */
	
	function keyHit(evt) {
	
	  /* If the browser is Netscape evt.which will contain the code for the key */
		
		if (evt) {
			thisKey = evt.which;
		}
	  /* Otherwise the code for the key will be in window.event.keyCode */
	
		else {
			thisKey = window.event.keyCode;
		}
		
	  /* If the user presses the left arrow then go backwards through the slideshow.
		   If the user press the right arrow then go forwards. 
			 For any other key do nothing                                               */
			 
		if (thisKey == ltArrow) {
			chgExample(-1);
		}
		else if (thisKey == rtArrow) {
			chgExample(1);
		}
	}
	
	
  function click(e) {
    if (document.all) {
       if (event.button==2||event.button==3) {
          return false;
       }
    }

    if (document.layers) {
       if (e.which == 3) {
          return false;
       }
    }
  }

  if (document.layers) {
     document.captureEvents(Event.MOUSEDOWN);
  }

  document.onmousedown=click;






