    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="";
	var currentReview="";
	if (!gReviews) {var gReviews='';}

	
	
  function popUpVWindow(url, windowName, width, height, video) {
    var winprops = '';
	var rSize = 'no';
	
	var sBars = 'yes';	
	
	if (video) {sBars='no'}	
	
    if (screen.height < height + 25) {
	  height = screen.height -25;
	  rSize = 'yes'
	  sBars = 'yes';
    }
	
	
    if (screen.width < width - 10) {
	  width = screen.width - 10;
	  rSize = 'yes'
	  sBars = 'yes';
    }
	  
    var wLeft = (screen.width - width) / 2;
    var wTop = (screen.height - height) / 2;
	
	winprops = 'width=' + width +
	           ',height=' + height +  
	           ',left=' + wLeft +  
	           ',top=' + wTop +   
	           ',scrollbars=' + sBars + 
	           ',toolbars=no' + 
	           ',resizable=' + rSize + 
	           ',location=no' + 
	           ',menubars=no';
  
    window.open(url,windowName,winprops);
  
  }
	
	
    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, s) {
  
    var winprops = '';
	var rSize = 'no';
	var sBars = 'no';
	var hOffset = 25;
	if (rs) {rSize = 'yes'}
	if (sb) {sBars = 'yes'}
	
    if (screen.height < h+hOffset || s) {
	  h = screen.height-hOffset;
	  rSize = 'yes';
	  sBars = 'yes';	  
	}
	  
	if (sBars=='yes') {w=w+20}
	
    var wLeft = (screen.width - w) / 2;
    var wTop = 5;
	
	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 lookUpPhoto(category,index) {
	  var photo='s.gif';
	  if (gAllPhotos.length >=1) {
	    for (var i=0;i<gAllPhotos.length;i++) {
		  if (gAllPhotos[i][0] == category) {
	        //alert('photo ' + index + ' ' + gAllPhotos[i][index]);
		    photo = gAllPhotos[i][index];
			break;
		  }
		}
	  }
	  return photo;
	}

	function lookUpPhotoNumber(category) {
	  var photoNum=0;
	  //alert('number ' + gAllPhotos.length);
	  if (gAllPhotos.length >=1) {
	    for (var i=0;i<gAllPhotos.length;i++) {
		  if (gAllPhotos[i][0] == category) {
		    photoNum = gAllPhotos[i].length - 1;
			break;
		  }
		}
	  }
	  return photoNum;
	}	

	
    function changeCategory(docTitle) {	
	  //alert ('changeCategory ' + docTitle);
	  hideCaption();
	  hideHeader();
	  hideMenu();
      frm=document.photoControl;
	  photoCategory=frm.category.value;
	  //alert(photoCategory);
	  photoNumber=lookUpPhotoNumber(photoCategory);
      photoDirectory='';
      currentPhoto=1;
      photoImage.src='s.gif';
	  photoImage.src=lookUpPhoto(photoCategory,currentPhoto);
	  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';
	  }	
	  updatePhotoProgressBar(currentPhoto);
	  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();	
	  }
	  showSpecial();  
    }
	
	function updatePhotoProgressBar(progress) {
      photoProgressImage.width=progress/(photoNumber*1)*346;
	}


    function changePhoto(dir) {
	  //alert ('changePhoto ' + dir);
	  hideCaption();
      currentPhoto=currentPhoto+dir;
      if (currentPhoto==0) {
        currentPhoto=1;
      } else if (currentPhoto>photoNumber) {
        currentPhoto=photoNumber*1;
      } else {
	    //var tmpPhoto='';
		//while (tmpPhoto=='s.gif' || tmpPhoto=='') {
	      tmpPhoto = lookUpPhoto(photoCategory,currentPhoto);
		//}
        photoImage.src=tmpPhoto;
        updatePhotoProgressBar(currentPhoto);
      }
      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();
	  showSpecial();
    }
	
	function showSpecial(sp) {
	  showThing('specialReview',1);
	  currentReview = '';
	  var txt = photoImage.src.substring(photoImage.src.lastIndexOf('/') + 1,photoImage.src.lastIndexOf('.'));
	  if (gReviews.indexOf(txt + ',') >=0) {
	    showThing('specialReview');
		currentReview = txt;
	  }  
	}


    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';
            }
			updatePhotoProgressBar(currentPhoto);
      }
      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';
      }
    }
	