// BrowserCheck Object
// provides most commonly needed browser checking variables
// 19990326

// Copyright (C) 1999 Dan Steinman
// Distributed under the terms of the GNU Library General Public License
// Available at http://www.dansteinman.com/dynapi/

function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.v = parseInt(navigator.appVersion)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0)
	if (this.ie5) this.v = 5
	this.min = (this.ns||this.ie)
}

// automatically create the "is" object
is = new BrowserCheck()


function WM_netscapeCssFix() {
  /*
    Source: Webmonkey Code Library
    (http://www.hotwired.com/webmonkey/javascript/code_library/)

    Author: Taylor
    Author Email: taylor@wired.com
    Author URL: http://www.taylor.org/
    */

  // This part was inspired by Matthew_Baird@wayfarer.com
  // It gets around another unfortunate bug whereby Netscape 
  // fires a resize event when the scrollbars pop up. This 
  // checks to make sure that the window's available size 
  // has actually changed.
  if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}

function WM_netscapeCssFixCheckIn() {
  // This function checks to make sure the version of Netscape 
  // in use contains the bug; if so, it records the window's 
  // width and height and sets all resize events to be handled 
  // by the WM_netscapeCssFix() function.
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document.WM == 'undefined'){
      document.WM = new Object;
    }
    if (typeof document.WM.WM_scaleFont == 'undefined') {
      document.WM.WM_netscapeCssFix = new Object;
      document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
      document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
    }
    window.onresize = WM_netscapeCssFix;
  }
}

WM_netscapeCssFixCheckIn()


////////////////////////////////////////////////////////////
//	function setFocus()
////////////////////////////////////////////////////////////

//    Sets the focus of the cursor to a specific text box
//
//    Called by the onLoad event in the BODY tag
//		like this:
//	    onLoad="setFocus('formname','textboxname')"
//		where formname is the name of the form
//		and textboxname is the name of the text field in 
//		the form where you want the cursor focus to be
//
var formName
var focusTarget
function setFocus(formName,focusTarget) {
	 eval('document.' + formName + '.' + focusTarget + '.focus()')
}
	
//////////////////////////////////////////////////////////////
//  function popUp()
//////////////////////////////////////////////////////////////

//  	Opens a mini browser window 
//		Content is determined by the pageID, which is a URL

var newWindow
var pageID
function popUp(pageID){
	newWindow = window.open(pageID,"","scrollbars,resizable,height=400,width=320")
}

//////////////////////////////////////////////////////////////
//  function popUpBig()
//////////////////////////////////////////////////////////////

//  	Opens a mini browser window 
//		Content is determined by the pageID, which is a URL

var newWindow
var pageID
function popUpBig(pageID){
	newWindow = window.open(pageID,"","scrollbars,resizable,height=550,width=440")
}

//////////////////////////////////////////////////////////////
//  function popUpBigger()
//////////////////////////////////////////////////////////////

//  	Opens a mini browser window 
//		Content is determined by the photoId, which is a URL

var newWindow
var photoID
function popUpBigger(photoId){
	newWindow = window.open(photoId,"","scrollbars,height=600,width=600")
}

//////////////////////////////////////////////////////////////
//    function redirect()
//////////////////////////////////////////////////////////////
//	  This function assigns the target URL to the window
//    
//    Called by the onClick event of a button
//
var targetURL
function redirect(targetURL) {
	  location.assign(targetURL)
}

//////////////////////////////////////////////////////////////
//  function verisignSeal()
//////////////////////////////////////////////////////////////

//  	Opens a mini browser window 
//		displays the Secure Site seal
//		provided by Verisign

function verisignSeal(url) {
sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
self.name = "mainWin";
}