// popup windows
/* obsolete for our purposes
var winScrollbars = "yes"
var winToolbar = "yes"
var winResizable = "yes"
var winLocation = "yes"
*/
var winStatus = "yes"

var imgWin;
var IwinWidth = "740"			// popup for image popup
var IwinHeight = "600"
var PwinWidth = "580"			// popup for print window
var PwinHeight = "520"
var EwinWidth = "550"			// popup for email window
var EwinHeight = "520"
var CwinWidth = "550"			// popup for cite window
var CwinHeight = "520"
var RwinWidth = "550"			// popup for references window
var RwinHeight = "520"
var oldDNBWidth = "800";		// popup for oldDNB window
var oldDNBHeight = "600";
var abbrHeight = "520";			// popup for abbreviation window
var abbrWidth =" 550";
var hHeight = "600";			// popup for help window
var hWidth ="750";
var CRwinWidth = "550"			// popup for credits window
var CRwinHeight = "520"


function imageWin(winURL) {
	imgWin = window.open(winURL,"imagepop","width="+IwinWidth+",height="+IwinHeight+",scrollbars=yes,resizable=yes,status="+winStatus);
	if (window.focus) {imgWin.focus()}
}

function printResultsWin(docsFound, winURL) {
  var confirmed = true;
  if (docsFound >= 300 && docsFound <= 1000) {
     confirmed = confirm('Printing prints the complete results list. Your results list contains more than 300 headwords. Continue?');
  }
  else if (docsFound > 1000) {
     confirmed = confirm('Printing prints the complete results list, but will not print more than 1000 headwords. Your results list contains more than 1000 headwords. Continue to print the first 1000 only?');
  }
  if (confirmed) {
     window.open(winURL,"","width="+PwinWidth+",height="+PwinHeight+",scrollbars=yes,toolbar=yes,menubar=yes,resizable=yes,location=no,status="+winStatus)
  }
}

function printWin(winURL) {
     window.open(winURL,"","width="+PwinWidth+",height="+PwinHeight+",scrollbars=yes,toolbar=yes,menubar=yes,resizable=yes,location=no,status="+winStatus)
}
function emailWin(winURL) {
  window.open(winURL,"","width="+EwinWidth+",height="+EwinHeight+",scrollbars=yes,toolbar=no,resizable=yes,location=no,status="+winStatus)
}

function emailResultsWin(num_sr, winURL) {
  window.open(winURL,"","width="+EwinWidth+",height="+EwinHeight+",scrollbars=yes,toolbar=no,resizable=yes,location=no,status="+winStatus)
}


function citeWin(winURL) {
  window.open(winURL,"","width="+CwinWidth+",height="+CwinHeight+",scrollbars=yes,toolbar=no,resizable=yes,location=no,status="+winStatus)
}

function refWin(winURL) {
  window.open(winURL,"","width="+RwinWidth+",height="+RwinHeight+",scrollbars=yes,toolbar=no,resizable=yes,location=no,status="+winStatus)
}

function oldDNBWin(winURL) {
  window.open(winURL,"","width="+oldDNBWidth+",height="+oldDNBHeight+",scrollbars=yes,toolbar=no,resizable=yes,location=no,status="+winStatus)
}

function abbrWin(winURL) {
  window.open(winURL,"","width="+abbrWidth+",height="+abbrHeight+",scrollbars=yes,toolbar=no,resizable=yes,location=no,status="+winStatus)
}

function helpWin(winURL) {
  window.open(winURL,"","width="+hWidth+",height="+hHeight+",scrollbars=yes,toolbar=no,resizable=yes,location=no,status="+winStatus)
}
function creditWin() {
  window.open("/public/credits.jsp","","width="+CRwinWidth+",height="+CRwinHeight+",scrollbars=yes,toolbar=no,resizable=yes,location=no,status="+winStatus)
}



function right(e) {
var msg = "Copyright image - all rights reserved";
if (navigator.appName == 'Netscape' && e.which == 3) {
alert(msg);
return false;
}
if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
alert(msg);
return false;
}
else return true;
}

function trap() 
  {
  if(document.images)
    {
    for(i=0;i<document.images.length;i++)
      {
      document.images[i].onmousedown = right;
      document.images[i].onmouseup = right;
      }
    }
  }


