 function prepareGallery(){
  if( document.getElementById &&
      document.getElementsByTagName ){
    if( document.getElementById( 'pictArea' ) ){
      var gallery = document.getElementById( 'pictArea' );
      var links = gallery.getElementsByTagName( 'a' );
      for( var i=0; i < links.length; i++ ){
        links[i].onclick = function(){
          return showPic(this);
        };
      }
    }
  }
}
 
 
 function popWin(winURL,winName,winType,winWidth,winHeight) {
 // valid winType are:
 // resizable, fixed, complete
 // call this function like this:
 // <a href="link.html" onclick="popWin(this.href,this.target,'complete','500','600');return false;" target="newwind">
 	if (winType == 'resizable') {
         features = 'resizable, scrollbars, width='+winWidth+',height='+winHeight;
     } else if (winType == 'fixed') {
         features = 'width='+winWidth+',height='+winHeight;
     } else if (winType == 'complete') {
         features = 'toolbar,menubar,scrollbars,resizable,location,width='+winWidth+',height='+winHeight;
     }
     var newWin = window.open(winURL,winName,features);
       newWin;
     newWin.focus();
       return true;
  }