    //style="OVERFLOW-Y: auto; OVERFLOW-X: hidden"    
    var isNS4 = ( document.layers ) ? true : false;
    var isIE4 = ( document.all && !document.getElementById ) ? true : false;
    var isIE5 = ( document.all && document.getElementById ) ? true : false;
    var isNS6 = ( !document.all && document.getElementById ) ? true : false;
    var isOpera = ( window.opera ) ? true : false;  
		
    function getControl( id ) 
    {
       var control = null;
       try 
       {
          if ( isNS4 ) 
          {
             control = document.layers[id];
          } 
          else if ( isIE4 ) 
          {
             control = document.all[id];
          } 
          else 
          { 
             control = document.getElementById(id);
          }
       }
       catch ( e ) 
       {
          control = null;
       }

       return control;
    }

    function onLoad()
    {
       //window.onresize = browserResizeEvent;
       //setDimensions();
       var current_parms = window.location.search.substring(1);
       if ( current_parms = "id=11" ) 
       {
       	  loadPastorAppreciationImages();
          currentImageIndex = 0;
          displayImage(currentImageIndex);
       }     
    }

    function browserResizeEvent(e)
    {
       if (!e) e = window.event;
       setDimensions();
       return true;
    }

    function setDimensions()
    {       
       var windowWidth =  window.innerWidth || document.body.offsetWidth;
       var windowHeight =  window.innerHeight || document.body.offsetHeight;
       var contentDiv = getControl("contentDiv");
       var marqueeTag = getControl("marqueeTag");
       var pageEditor = getControl("cePageEditor");       
       
       var w = windowWidth - 400;
       var h = windowHeight - 260;

       if ( w<250 ) w = 250;
       if ( h<50 ) h = 50;
       if ( w>1330 ) w = 1330;
       if ( h>1073 ) h = 1073;  

       /*       
       var w = windowWidth - 270;
       var h = windowHeight - 260;

       if ( w<250 ) w = 250;
       if ( h<50 ) h = 50;
       if ( w>1330 ) w = 1330;
       if ( h>773 ) h = 1073;  
       */
       
       //contentDiv.style.height = h + "px";            
       //contentDiv.style.width = w + "px";        

       var marqueeWidth = windowWidth - 190;
       if ( marqueeWidth>1575 ) marqueeWidth = 1575;
       marqueeTag.width = marqueeWidth;
       
       if ( pageEditor!=null )
       {          
          pageEditor.Width = w + "px";
          pageEditor.style.height = h + "px";       
          window.status = "Inside pageEditor block width = " + pageEditor.Width;
       }
    }
    
    currentImageIndex = -1;  
    imageArray = new Array(27);
  
    function loadPastorAppreciationImages()
    {
       imageArray[0] = "DSC_2475.JPG";
       imageArray[1] = "DSC_2476.JPG";
       imageArray[2] = "DSC_2477.JPG";
       imageArray[3] = "DSC_2479.JPG";
       imageArray[4] = "DSC_2480.JPG";
       imageArray[5] = "DSC_2482.JPG";
       imageArray[6] = "DSC_2485.JPG";
       imageArray[7] = "DSC_2486.JPG";
       imageArray[8] = "DSC_2487.JPG"
       imageArray[9] = "DSC_2488.JPG";
  
       imageArray[10] = "DSC_2489.JPG";
       imageArray[11] = "DSC_2490.JPG";
       imageArray[12] = "DSC_2492.JPG";
       imageArray[13] = "DSC_2493.JPG";
       imageArray[14] = "DSC_2494.JPG";
       imageArray[15] = "DSC_2495.JPG";
       imageArray[16] = "DSC_2498.JPG";
       imageArray[17] = "DSC_2500.JPG";
       imageArray[18] = "DSC_2501.JPG"
       imageArray[19] = "DSC_2504.JPG";

       imageArray[20] = "DSC_2506.JPG";
       imageArray[21] = "DSC_2510.JPG";
       imageArray[22] = "DSC_2511.JPG";
       imageArray[23] = "DSC_2512.JPG";
       imageArray[24] = "DSC_2513.JPG";
       imageArray[25] = "DSC_2514.JPG";
       imageArray[26] = "DSC_2517.JPG";
       imageArray[27] = "DSC_2518.JPG";
       imageArray[28] = "DSC_2520.JPG"
       imageArray[29] = "DSC_2521.JPG";

       imageArray[20] = "DSC_2528.JPG";
       imageArray[21] = "DSC_2532.JPG";
       imageArray[22] = "DSC_2536.JPG";
       imageArray[23] = "DSC_2542.JPG";
       imageArray[24] = "DSC_2545.JPG";
       imageArray[25] = "DSC_2547.JPG";
       imageArray[26] = "DSC_2549.JPG";

       for (i=0; i < 27; i++) 
       {
         var loadimage = new Image();
         loadimage.src = "/Uploads/PastorAppreciation/" + imageArray[i];
       }           		 
    }

    function displayImage(imageIndex) 
    {
      //document['imgSlideShow'].src = "/Uploads/PastorAppreciation/" + imageArray[imageIndex];
      var ctlImageSlideShow = getControl('imgSlideShow');
      if ( ctlImageSlideShow!=null ) ctlImageSlideShow.src = "/Uploads/PastorAppreciation/" + imageArray[imageIndex];
      
      var ctlImageNum = getControl('imageNum');
      if ( ctlImageNum!=null ) ctlImageNum.innerHTML = imageIndex + 1;
    }
  
    function slideShowStart()
    {
    	currentImageIndex = 0;
    	displayImage(currentImageIndex);
    }
    
    function slideShowEnd()
    {
    	currentImageIndex = 26;
    	displayImage(currentImageIndex);
    }
    
    function slideShowLeft()
    {
  	  if (currentImageIndex>0)
  	  {
  		  currentImageIndex = currentImageIndex - 1;  
  		  displayImage(currentImageIndex);		  
  	  }
    }
  
    function slideShowRight()
    {    	
 	    if (currentImageIndex<26)
  	  {  	  	 
  		  currentImageIndex = currentImageIndex + 1;  		   
  		  displayImage(currentImageIndex);  
      }  

    	//if (currentImageIndex == -1 ) 
    	//{    		 
    	//   loadPastorAppreciationImages();
    	//   currentImageIndex = 1;
    	//   displayImage(currentImageIndex);
    	//}   
    	//else
    	//{ 	
  	  //   if (currentImageIndex<26)
  	  //   {  	  	 
  		//      currentImageIndex = currentImageIndex + 1;  		   
  		//      displayImage(currentImageIndex);  
      //   }  
      //}        
    }  	

