//ADDED BY BRUCE MICHELSEN

/*
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//HANDLES MULTIPLE ONLOAD SCRIPTS
//	http://javascript.about.com/library/scripts/blsafeonload.htm
//	This script provides a way for scripts to add multiple window.onload handlers without the scripts overwriting each other.  It works by first checking to see if any script has assigned a function to the window.onload handler, either by direct script assignment (window.onload=functionName) or in the BODY tag (<BODY onload="functionName()">).  It then saves the current handler to an array of functions and reassigns the window.onload function to the SafeOnload function which is responsible for executing each function stored in it's global function array. Add your own onload handler by calling:
//	SafeAddOnload(functionName)
//	where functionName is the name of a function that you have defined.
*/
// Browser Detection
isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
NS4 = (document.layers) ? true : false;
IEmac = ((document.all)&&(isMac)) ? true : false;
IE4plus = (document.all) ? true : false;
IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
IE6 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 6.")!=-1)) ? true : false;
ver4 = (NS4 || IE4plus) ? true : false;
NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1)?true:false;

IE5plus = IE5 || IE6;
IEMajor = 0;


if (IE4plus)
{
	var start = navigator.appVersion.indexOf("MSIE");
	var end = navigator.appVersion.indexOf(".",start);
	IEMajor = parseInt(navigator.appVersion.substring(start+5,end));
	IE5plus = (IEMajor>=5) ? true : false;
}

// Body onload utility (supports multiple onload functions)
var gSafeOnload = new Array();
function SafeAddOnload(f)
{
	if (IEmac && IE4)  // IE 4.5 blows out on testing window.onload
	{
		window.onload = SafeOnload;
		gSafeOnload[gSafeOnload.length] = f;
	}
	else if  (window.onload)
	{
		if (window.onload != SafeOnload)
		{
			gSafeOnload[0] = window.onload;
			window.onload = SafeOnload;
		}		
		gSafeOnload[gSafeOnload.length] = f;
	}
	else
		window.onload = f;
}
function SafeOnload()
{
	for (var i=0;i<gSafeOnload.length;i++)
		gSafeOnload[i]();
}
// Call the following with your function as the argument SafeAddOnload(yourfunctioname); [as in "SafeAddOnload(initiateMenus);"]

//++++++++++++++++++++++++++++++++++++++++++++++++
/*
var gSafeOnUnload = new Array(); 
function SafeAddOnUnload(f) 
{ 
	if (IEmac && IE4) // IE 4.5 blows out on testing window.onload 
	{ 
		window.onunload = SafeOnUnload; 
		gSafeOnUnload[gSafeOnUnload.length] = f; 
	}
		else if (window.onunload) 
		{ 
			if (window.onunload != SafeOnUnload) 
			{ 
			gSafeOnUnload[0] = window.onunload; 
			window.onunload = SafeOnUnload; 
			} 
			gSafeOnUnload[gSafeOnUnload.length] = f; 
		}
		else window.onunload = f; 
		} 
function SafeOnUnload() 
{ 
	for (var i=0;i<gSafeOnUnload.length;i++) 
		gSafeOnUnload[i](); 
	}
}
*/


/*
	* ADDED BY BRUCE MICHELSEN
	* HANDLES Rewrite when Netscape resized
*/
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
// Call the following: MM_reloadPage(true);

/*
	* ADDED BY BRUCE MICHELSEN
	* Displays date and copyright info in footer of page
*/
function footer()
{
			dateyear = new Date;
			document.write("Copyright &copy;" + dateyear.getFullYear() + ". ");
			document.write(citation + "<br>");
			document.write("This document was last modified on: " + document.lastModified +".")
}


/*
	* ADDED BY BRUCE MICHELSEN
	* From Previous GWAVA pages
*/
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*
	* ADDED BY BRUCE MICHELSEN
	* Reseller popup window
*/
function FindReseller()
{
	//javascript:window.open('../map/map.html','_blank','scrollbars=yes,width=725,height=600,top=10,left=10');
	javascript:window.open('http://map.gwava.com/map.html','_blank','scrollbars=yes,width=725,height=600,top=10,left=10');
}

/*
	* ADDED BY BRUCE MICHELSEN
	* Passed URL popup window
*/
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=700,height=450 ,left = 70,top = 100');");
}

