    var nav=navigator.appName;
    var version=parseInt(navigator.appVersion);
    var wHeight=window.innerHeight;
    var wWidth=window.innerWidth;
	var menuNumber=0;
	var currentMenu='aerial';
	var showingMenu='abstract';
	var newWindow="";

    if (version<5&&nav=='Netscape')
    {
      onResize=re;
    }


    function re(){
      if (wHeight!=window.innerHeight||wWidth!=window.innerWidth) { window.location.reload();}
    }

	
    //var photoArray='undefined';
    var photoCategory='undefined';
    var photoDirectory='undefined';
    var photoPrefix='undefined';
    var photoNumber=0;
    var currentPhoto=1;
    //var captionArray='';

	
  function popUpWindow(url, windowName, w, h, sb, rs) {
  
    var winprops = '';
	var rSize = 'no';
	var sBars = 'no';
	var hOffset = 40;
	if (rs) {rSize = 'yes'}
	if (sb) {sBars = 'yes'}
	
    if (screen.height < h+hOffset) {
	  h = screen.height-hOffset;
	  //rSize = 'yes';
	  sBars = 'yes';
    }
	  
	if (sBars=='yes') {w=w+20}
	
    var wLeft = (screen.width - w) / 2;
    var wTop = (screen.height - h - hOffset) / 2;
	
	winprops = 'width=' + w +
	           ',height=' + h +  
	           ',left=' + wLeft +  
	           ',top=' + wTop +   
	           ',scrollbars=' + sBars + 
	           ',toolbars=no' + 
	           ',resizable=' + rSize + 
	           ',location=no' + 
	           ',menubars=no';
			   
			   
    if (window.newWindow) {
      newWindow.close();
	}  
	
    newWindow=window.open(url,windowName,winprops);
	newWindow.focus();
  
  }
  	

    function findObj(nm){
      var o;
      d=document;
      if(d.getElementById) {
            o=d.getElementById(nm);
      } else {
            if (d.Layers) {
              o=d.Layers[nm];
            } else {
              o=d[nm];
            }
      }
      return o;
    }
	
	
	function showThing(thing,hide) {
  	  var o=findObj(thing);
	  if(hide) {
        if(o) { 
  	      if(o.style) {
  		    o=o.style;
			//o.visibility='hidden';
  		    o.position='absolute';
			o.left=-2000;
  		  } else {
  		    //o.visibility='hide';
  		    o.position='absolute';
			o.left=-2000;
  		  }
  	    }
	  } else {
        if(o) { 
  	      if(o.style) {
  		    o=o.style;
  		    o.position='relative';
			o.left=0;
			o.visibility='visible';
  		  } else {
  		    o.position='relative';
			o.left=0;
  		    o.visibility='show';
  		  }
  	    }
	  }	
	}
		
	
	function showCaption() {
	  //alert ('showCaption');
	  showThing(photoCategory + currentPhoto);  	  
	}
		
	
	function hideCaption() {
	  //alert ('hideCaption');
	  showThing(photoCategory + currentPhoto,1);  
	}
		
	
	function showHeader() {
	  //alert ('showHeader');
	  showThing(photoCategory + 'Head'); 	  
	}
		
	
	function hideHeader() {
	  //alert ('hideHeader');
	  showThing(photoCategory + 'Head',1);
	}


    function showMenu() {
	  //alert ('showMenu');
      var o=findObj('showTitle'+photoCategory);
      if(o) { 
	    if(o.style) {
		  o=o.style;
		  o.position='relative';
		  o.height=1;
		  o.width=1;
		  o.overflow='visible';
		  o.left=0;
		  o.visibility='visible';
		} else {
		  o.position='relative';
		  o.height=1;
		  o.width=1;
		  o.left=0;
		  o.visibility='show';
		}
	  }	  
	  changeMenuGraphic(currentMenu);
    }


    function hideMenu() {
	  //alert ('hideMenu');
		
	  showThing('showTitle'+photoCategory,1);
	  showThing('showTitleMenu'+photoCategory+currentMenu,1);
	  
	  if (photoCategory=='abstract') {
        currentMenu='aerial';
	  } else {
        currentMenu='abstract';
	  }	
	  
    }


    function autoChangeCategory(newCategory, leaveMenu) {	  
	  //alert ('autoChangeCategory ' + newCategory + ' ' + leaveMenu);
      frm=document.photoControl;
      var inp=frm.category.options;
      for (i=0; i<inp.length; i++) {
        if (inp[i].value.indexOf(newCategory)>-1) {
              frm.category.selectedIndex=i;
              i=inp.length;
              if (!leaveMenu) {hideMenu();}
              changeCategory();
        }
      }

    }


    function changeCategory(docTitle) {	
	  //alert ('changeCategory ' + docTitle);
	  hideCaption();
	  hideHeader();
	  hideMenu();
      frm=document.photoControl;
      photoCategory=frm.category.value.substring(5,frm.category.value.length);	  
      photoPrefix=frm.category.value.substring(2,5);
      photoNumber=frm.category.value.substring(0,2)*1;
      photoDirectory='./images/' + documentTitle + '/' + photoCategory + '/';
      currentPhoto=1;
      photoImage.src='s.gif';
      photoImage.src=photoDirectory+'01'+photoPrefix+'.jpg';
	  if (photoCategory=='create custom posters') {
    	ls=document.anchors;
        for (var i=0; i<ls.length;i++) {
    	  var l=ls[i];
    	  if (l.style) {
    	    if (l.name.indexOf('nav')>=0) {
    	      l.style.display='none';
    		} else if (l.name.indexOf('blank')>=0) {
    	      l.style.display='inline';
			}  
    	  }  
        }
	  } else {
    	ls=document.anchors;
        for (var i=0; i<ls.length;i++) {
    	  var l=ls[i];
    	  if (l.style) {
    	    if (l.name.indexOf('nav')>=0) {
    	      l.style.display='inline';
    		} else if (l.name.indexOf('blank')>=0) {
    	      l.style.display='none';
			}  
    	  }  
        }
        firstArrowImage.src='./images/firstArrow-firstPhoto.gif';
        firstArrowImage.alt='';
        lastArrowImage.src='./images/lastArrow.gif';
        lastArrowImage.alt='next photo';
        lastBarsImage.src='./images/lastBars.gif';
        firstBarsImage.src='./images/firstBars-firstPhoto.gif';
	  }	
      photoProgressImage.width=currentPhoto/(photoNumber*1)*346;
	  if (photoCategory=='abstract') {
	    menuNumber=0;
	  } else if (photoCategory=='aerial') {
	    menuNumber=1;
	  } else if (photoCategory=='animals') {
	    menuNumber=2;
	  } else if (photoCategory=='architecture') {
	    menuNumber=3;
	  } else if (photoCategory=='classic cars') {
	    menuNumber=4;
	  } else if (photoCategory=='landscapes') {
	    menuNumber=5;
	  } else if (photoCategory=='lighthouses') {
	    menuNumber=6;
	  } else if (photoCategory=='people') {
	    menuNumber=7;
	  } else if (photoCategory=='tourism') {
	    menuNumber=8;
	  } else if (photoCategory=='waterfalls') {
	    menuNumber=9;
	  } else if (photoCategory=='wooden boats') {
	    menuNumber=10;
	  } 
	  showingMenu=photoCategory;
	  showHeader();
	  showCaption();
	  if (documentTitle=='books') {
	    showMenu();
	  } else if (documentTitle=='posters') {
	    showMenu();	
	  } else if (documentTitle=='calendars') {
	    showMenu();	
	  } else if (documentTitle=='gallery') {
	    showMenu();	
	  }
    }


    function changePhoto(dir) {
	  //alert ('changePhoto ' + dir);
	  hideCaption();
      currentPhoto=currentPhoto+dir;
      if (currentPhoto==0) {
        currentPhoto=1;
      } else if (currentPhoto>photoNumber) {
        currentPhoto=photoNumber*1;
      } else {
        if (currentPhoto<10) {
              photoImage.src=photoDirectory+'0'+currentPhoto+photoPrefix+'.jpg';
            } else {
              photoImage.src=photoDirectory+currentPhoto+photoPrefix+'.jpg';
            }
            photoProgressImage.width=currentPhoto/(photoNumber*1)*346;
      }
      if (currentPhoto==2) {
        firstArrowImage.src='./images/firstArrow.gif';
        firstArrowImage.alt='previous photo';
        firstBarsImage.src='./images/firstBars.gif';
      } else if (currentPhoto==(photoNumber*1)-1) {
        lastArrowImage.src='./images/lastArrow.gif';
        lastArrowImage.alt='next photo';
        lastBarsImage.src='./images/lastBars.gif';
      } else if (currentPhoto==(photoNumber*1)) {
        lastArrowImage.alt='';
        lastBarsImage.src='./images/lastBars-lastPhoto.gif';
      } else if (currentPhoto==1) {
        firstArrowImage.alt='';
        firstBarsImage.src='./images/firstBars-firstPhoto.gif';
      }
	  showCaption();
    }


    function changePhotoIndex(dir) {
	  //alert ('changePhotoIndex ' + dir);
	  hideCaption();
      currentPhoto=currentPhoto+dir;
      if (currentPhoto==0) {
        currentPhoto=1;
      } else if (currentPhoto>photoNumber) {
        currentPhoto=photoNumber*1;
      } else {
        if (currentPhoto<10) {
              photoImage.src=photoDirectory+'0'+currentPhoto+photoPrefix+'.jpg';
            } else {
              photoImage.src=photoDirectory+currentPhoto+photoPrefix+'.jpg';
            }
            photoProgressImage.width=currentPhoto/(photoNumber*1)*346;
      }
      if (currentPhoto==2) {
        firstArrowImage.src='./images/firstArrow.gif';
        firstArrowImage.alt='previous photo';
        firstBarsImage.src='./images/firstBars.gif';
      } else if (currentPhoto==(photoNumber*1)-1) {
        lastArrowImage.src='./images/lastArrow.gif';
        lastArrowImage.alt='next photo';
        lastBarsImage.src='./images/lastBars.gif';
      } else if (currentPhoto==(photoNumber*1)) {
        lastArrowImage.alt='';
        lastBarsImage.src='./images/lastBars-lastPhoto.gif';
      } else if (currentPhoto==1) {
        firstArrowImage.alt='';
        firstBarsImage.src='./images/firstBars-firstPhoto.gif';
      }
	  showCaption();
    }
	
	
    function changeMenuGraphic(menuName) {
	  //alert ('changeMenuGraphic ' + menuName);
	  if (photoCategory=='abstract') {
	    showThing('showTitleMenuabstractaerial',1);
	  } else {
	    showThing('showTitleMenu'+photoCategory+'abstract',1);
	  }	
	  
	  showThing('showTitleMenu'+photoCategory+currentMenu,1);
	   
      var o=findObj('showTitleMenu'+photoCategory+menuName);
      if(o) { 
	    if(o.style) {
		  o=o.style; 
		  o.position='relative';
		  o.height=1;
		  o.width=1;
		  o.overflow='visible';
		  o.left=0;
		  o.visibility='visible';
		} else {
		  o.position='relative';
		  o.height=1;
		  o.width=1;
		  o.left=0;
		  o.visibility='show';
		}
	  } 
	  currentMenu=menuName;
    }
	
	
    function showOrderOn(tf) {
	  if (tf) {
	    orderingIconImage.src='./images/OrderButton_ON.jpg';
	  } else {
	    orderingIconImage.src='./images/OrderButton.jpg';
	  }		    	
    }
	
	
    function showContactOn(tf) {
	  if (tf) {
	    iconImage.src='./images/emailON.gif';
	  } else {
	    iconImage.src='./images/email.gif';
	  }		    	
    }


    function overArrow(o) {
      if (currentPhoto<photoNumber && o.src.indexOf('first')==-1) {
        o.src='./images/lastArrow-over.gif';
      } else if (currentPhoto>1 && o.src.indexOf('last')==-1) {
        o.src='./images/firstArrow-over.gif';
      }
    }


    function offArrow(o) {
      if (currentPhoto<photoNumber && o.src.indexOf('first')==-1) {
        o.src='./images/lastArrow.gif';
      } else if (currentPhoto==photoNumber && o.src.indexOf('first')==-1) {
        o.src='./images/lastArrow-lastPhoto.gif';
      } else if (currentPhoto>1 && o.src.indexOf('last')==-1) {
        o.src='./images/firstArrow.gif';
      } else if (currentPhoto==1 && o.src.indexOf('last')==-1) {
        o.src='./images/firstArrow-firstPhoto.gif';
      }
    }
	