
function stopError() {
      return true;
}

function windclose() {
 if (imgwin != null) imgwin.close()	
}	
window.onerror  = stopError;
window.onunload = windclose;   // set our unload exit 

var zwin = null
var purl = ""
var xalt = ""
var glim = ""
var imgwin = null
var picOf = ""
var pw    = null  // global image window

setTimeout("setUNLOAD()",5000)  // Geocities overrides our exit 
function setUNLOAD() {          // so, we sleep for 5 sec 
  window.onunload = windclose	// and set it again.
}	

function showpic(xobj) {
//showpic() invoked when user clicks a thumbnail
// save in global: purl : current img to be displayed
//                 glim : if at max/min 
	
  zwin = null
  xstr = xobj.src
  xalt = xobj.alt
  glim = ""
  
   
  n = xstr.indexOf('tn_')
  ystr = xstr.substring(n+3)
  
  qstr = 'images/' + ystr
  purl = qstr  // global current img to be displayed

   //detm if min or max   
   w = tnList[ystr]                         // current index
   if (w == 0)               glim = "atMin" // if at min save in global glim
   if (w == tnList.length-1) glim = "atMax" // if at max save 
   picOf = (w+1) + ' of ' + tnList.length 
  return 
}

function showit(xobj,halt,xlim) {
// Subroutine could be invoked from main page (thumbnails page)
// or from picture page (prev/next) 	


//    if  (navigator.appVersion.indexOf('MSIE') > -1)  
//      nop=1
//    else {
//     alert("You can not display the bigger image using this browser; \nUse MS Internet Explorer. Sorry.")
//     return
//     }
	
     if (xobj == null) {              // invoked from thumbnail page
        if (glim  != "") xlim = glim  // get limit from global  
        }
     else {                           // invoked from img page (next/prev)
       purl = xobj                    // url and 
       xalt = halt                    //   alt from parm
      }  	
 
                     // if window still open, do not reopen 
    if (pw == null || pw.closed)  //     netscape opens diff. window even if using same name   
       pw     = window.open("","imageWin","width=806,height=580,dependent='yes'")
       
    imgwin = pw
    d =pw.document
  
    d.open()
    d.write("<html><body topmargin=0 leftmargin=0 rightmargin=0>")
    
    d.write("<style>")
    d.write("a{text-decoration:none}")
    d.write("a:link{Color:black}")
    d.write("a:visited{Color:black}")
    d.write("a:hover")
    d.write("{color: '#ff6600'}")
    d.write("\n.verd8b{"+
            "font-family: verdana, courier new, courier, sans-serif;"+	
            "font-size:12px;"+	
            "color:#000000;"+
            "font-weight:normal;"+
            "background-color:#ffffff;}")
    d.write("\n.verd6b{"+
            "font-family: verdana, courier new, courier, sans-serif;"+	
            "font-size:10px;"+	
            "color:#000000;"+
            "font-weight:normal;"+
            "background-color:#ffffff;}")        
    d.write("</style>")
    d.write("<table width='100%' leftpadding=0 rightpadding=0 cellpadding=0 cellspacing=2>")
    d.write("<tr>")
    d.write("<td width=700 valign=top><font face=verdana size=1 color=green><b><em>")
    d.write(xalt+" &nbsp; &nbsp; &nbsp; &nbsp;")
    d.write("</b></em></td><td width=50 valign=top><center>")
    d.write("<font class=verd8b>")
    if (xlim != 'atMin'){ 
        d.write("<a href='javascript:opener.showNext("+'"'+purl+'","prev"'+")'>")
        d.write("<img border=0 src='images/ssPrev.gif' onmouseenter='this.src=\"images/ssPrev_1.gif\"' onmouseleave='this.src=\"images/ssPrev.gif\"'></a>")
        }
    else  // if at min make inactive 
      d.write("<img border=0 src='images/ssPrev_g.gif'>")
      
    d.write("&nbsp;")
    if (xlim != 'atMax') {
        d.write("<a href='javascript:opener.showNext("+'"'+purl+'","next"'+")'>")
        d.write("<img border=0 src='images/ssNext.gif' onmouseenter='this.src=\"images/ssNext_1.gif\"' onmouseleave='this.src=\"images/ssNext.gif\"'></a>")
        }
    else  // if at max make inactive 
     d.write("<img border=0 src='images/ssNext_g.gif'>")
     
    d.write("</td><td align=right valign=top width=50><font class=verd6b>"+picOf+"<br>")  
    d.write("<font class=verd8b><style>a:hover{color:blue}</style><a href='javascript:opener.focus()'><u>Return</u></a>")
    d.write("</td><td width=2>&nbsp;</td></tr><tr>")   
    d.write("<td width=800 colspan=4><Img src='"+purl+"' align=top border=0> ")
    
    d.write("</tr></table></BODY></html>")
    d.close()
    pw.focus()
}


function showNext(xurl,xdir) {
// Invoke from img page when user hits next/prev
// parm: xurl is current img; xdir is scroll direction "next" or "prev".
// See also imgList() on how global tnList() was initialized.	
	
  v = xurl.indexOf('/')
  xxurl = xurl.substring(v+1)       // current image 
  w  = tnList[xxurl]                // current index 
  n2 = w+1                          // assume 'next' scroll index 
  if (xdir == 'prev') n2 = w-1      // correct for 'prev' scroll index 
  nextImg = 'images/' + tnList[n2]  // img to be displayed  
  nextAlt = altList[n2]             //   and alt 
  
  if (n2 == tnList.length-1) xlim = 'atMax'  // image is max 
  else 
  if (n2 == 0)               xlim = 'atMin'  // image is min 
  else                       xlim = '' 
   
  picOf = (n2+1) + ' of ' + tnList.length  
  showit(nextImg,nextAlt,xlim)               // go write html 
}	

// The global array tnList will contain both the relative index and the 
// imgFilename , eg:
// tnList[i]                 = 'imgFilename.jpg'
// tnList['imgFilename.jpg'] = i 
altList = new Array()   // global alt list 
tnList  = new Array()   // global img list 

// Save img url and alt in globaled array; initialized at end of url of 
// thumbnails page.
function imgList() 
{
  z=0 
  for (var i=0; i<document.images.length; i++) // loop thru all img
      {      	
       xsrc = document.images[i].src           // img sourcename 
       v = xsrc.indexOf('tn_')   // save only this naming convension
       if (v > -1)
          {
          xstr = xsrc.substring(v+3)           // parse after the 'tn_' 
          tnList[z]    = xstr                  // save the img filename
          tnList[xstr] = z                     // save it's  relative index 
          altList[z] = document.images[i].alt  // save also the alt
          z++
          }//endif          
      }//endfor   
}

