<!--
//Determine Browser Version
bName = navigator.appName;
bVer = parseInt(navigator.appVersion);
if ((bName=="Netscape" && bVer >=3)) 
	br = "n3";
else
{
	if(bName == "Microsoft Internet Explorer" && bVer >=4)
		br="ie4"
	else
		br = "n2";
}
	
function SetupContact(website_description)
{
	document.write("<a href=\"mailto:info@heritagecommunityfdn.org?Subject="+website_description+" Web Site\" title=\"Contact us by Email\">Contact us by Email</a>");
}

//Function to open new windows
function openWin(URL, Width, Height)
{
	var nHeight = Height + 180;
	var nWidth = Width + 150;

	aWindow=window.open(URL,"PopUp","width="+nWidth+",height="+nHeight+",resizable=yes,scrollbars=yes,left=10,top=10");
	
	aWindow.focus();
	if(aWindow.opener == null)
	{
		aWindow.opener = window;
		aWindow.opener.name = "opener";
	}

}

function openSoilPopUp()
{

	winSoil=window.open("../inventory/soil_groupings_popup.html","SoilGroupings","width=500,height=300,left=200,top=150,resizeable=yes");

	winSoil.focus();
	if(winSoil.opener == null)
	{
		winSoil.opener = window;
		winSoil.opener.name = "opener";
	}
	
}

function openForestPopUp()
{

	winForest=window.open("../inventory/forest_regions_popup.html","ForestRegions","width=500,height=300,left=200,top=150,resizeable=yes");

	winForest.focus();
	if(winForest.opener == null)
	{
		winForest.opener = window;
		winForest.opener.name = "opener";
	}
	
}

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 reloadIt() {
  document.location = document.location;
}

function changeURL(winName, newURL) {
  win = window.open("", winName);
  win.location.href = newURL;
}

//Function for Dynamic Pop Ups
function DynaPop(szTitle,szImgSource,szDescription,nCopyrightNum,nWidth,nHeight)
{
	popTitle = szTitle;
	popSource = szImgSource;
	popDescription = szDescription;
	popCopyright = nCopyrightNum;
	popWidth=nWidth;
	popHeight=nHeight;

	if (popDescription == "description")
		popDescription = "";

	openDynamicWin("../PopUp_Dynamic.html",nWidth,nHeight);
}

//Create Dynamic Picture Object constructor!
function dynamicPicture(imgSource, altText, popUpSource, width, height,nCopyRight,description)
{
	this.imgSource = imgSource;
	this.altText = altText;
	this.popUpSource = popUpSource;
	this.height = height;
	this.width = width;
	this.copyRight = nCopyRight;
	if(description == "description" || description == null)
		this.description = "";
	else
		this.description = description;
}

//Function to open new windows
function openDynamicWin(URL, Width, Height)
{
	nHeight = Height + 260;
	nWidth = Width + 150;
					aWindow=window.open(URL,"PopUp","width="+nWidth+",height="+nHeight+",resizable=yes,scrollbars=yes,left=10,top=10");
	aWindow.resizeTo(nWidth, nHeight);

	if(aWindow.opener == null)
	{
		aWindow.opener = window;
		aWindow.opener.name = "opener";
	}
	aWindow.focus();
}

function glossary(bookmark)
{
	URL = 	'../glossary_pop.html#' + bookmark;	glossWindow=window.open(URL,"glossary","width=600,height=400,resizable=yes,scrollbars=yes,left=100,top=100");


	if(glossWindow.opener == null)
	{
		glossWindow.opener = window;
		glossWindow.opener.name = "opener";
	}
	glossWindow.focus();
}

//Andrew's Function to Open a New Window

function largewin(URLarg) {
    largeWindow = window.open(URLarg,"largewin","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=620,height=410");
    largeWindow.focus();
}

//Andrew's Function to Close a Frameset in a New Window

function closer(URLarg) {
    parent.close();
} 

//Tony's function to open encompass windows
function encompassPopUp(URL)
{

	winComp=window.open(URL,"encompass","width=600,height=500,left=200,top=150,resizeable=yes,scrollbars=yes");

	winComp.focus();
	if(winComp.opener == null)
	{
		winComp.opener = window;
		winComp.opener.name = "opener";
	}
	
}
