// Copyright 1999 - 2002 by Ray Stott, Pop-up Images Script ver 2.0
// OK to use if this copyright is included
// Script is available at http://www.crays.com/jsc

// for Netscape 3+ and IE 4+
var priorPic = new Array()
var noPic = 0
var foundit = false

function openPopImg(picName, windowTitle, imageLayout, indexTiger, windowWidth, windowHeight){
 
  if (imageLayout == "-"){
  	windowWidth = ImageLongerSide
	windowHeight = ImageShorterSide	
	}
  if (imageLayout == "/"){
  	windowWidth = ImageShorterSide		
	windowHeight = ImageLongerSide
	}
	
  indexTigered = indexTiger
 
  var i = 0
  if(pic == picName && winOpen()){
    popImg.focus()
    }
  else{
    foundit = false
    for(i=0; i<=noPic; i++){
      if (priorPic[i] == picName)
        foundit = true 
      }
    pic = picName
    closePopImg()
    picTitle = windowTitle
    imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
    if(!foundit){
      priorPic[noPic++] = pic
      }
    popImg = openPopImgWin(imgWinName, windowWidth, windowHeight)
    }
  }
  
function openPopImgWin(imgWinName, windowWidth, windowHeight){
  var winFeatures = "toolbar=no,scrollbars=no,resizable=no,width=" + windowWidth + ",height=" + windowHeight
  if (indexTigered == "index"){
  	return window.open("includes/popup_window.htm", imgWinName, winFeatures)
	}
  else{
    return window.open("../includes/popup_window.htm", imgWinName, winFeatures)
	}
  }
  
function winOpen(){
  if(popImg != null){ 
    if(popImg.closed != true) return true; else return false
    }  
  else
    return false
  }