////////////////////////////////////////////////////////////////////////////
///image switching functions////////////////////////////////////////////////

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

////////////////////////////////////////////////////////////////////////////
///image preloading/////////////////////////////////////////////////////////

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {

		nav_hm_welcome_over = newImage("./graphics/nav_hm_welcome_over.gif");
		nav_hm_foundation_over = newImage("./graphics/nav_hm_foundation_over.gif");
		nav_hm_project_over = newImage("./graphics/nav_hm_project_over.gif");
		nav_hm_donation_over = newImage("./graphics/nav_hm_donation_over.gif");
		nav_hm_thankyou_over = newImage("./graphics/nav_hm_thankyou_over.gif");
		nav_hm_contact_over = newImage("./graphics/nav_hm_contact_over.gif");

		nav_welcome_over = newImage("./graphics/nav_welcome_over.gif");
		nav_foundation_over = newImage("./graphics/nav_foundation_over.gif");
		nav_project_over = newImage("./graphics/nav_project_over.gif");
		nav_donation_over = newImage("./graphics/nav_donation_over.gif");
		nav_thankyou_over = newImage("./graphics/nav_thankyou_over.gif");
		nav_contact_over = newImage("./graphics/nav_contact_over.gif");
		
		subnav_siteplan_over = newImage("./graphics/subnav_siteplan_over.gif");
		subnav_community_over = newImage("./graphics/subnav_community_over.gif");
		subnav_units_over = newImage("./graphics/subnav_units_over.gif");
		subnav_memorial_over = newImage("./graphics/subnav_memorial_over.gif");
		subnav_sustainable_over = newImage("./graphics/subnav_sustainable_over.gif");
		
		pht_community_A = newImage("./graphics/pht_community_A.jpg");
		pht_community_B = newImage("./graphics/pht_community_B.jpg");
		pht_community_C = newImage("./graphics/pht_community_C.jpg");
		pht_community_D = newImage("./graphics/pht_community_D.jpg");
		pht_community_E = newImage("./graphics/pht_community_E.jpg");
		pht_community_F = newImage("./graphics/pht_community_F.jpg");
		pht_community_G = newImage("./graphics/pht_community_G.jpg");
		pht_community_H = newImage("./graphics/pht_community_H.jpg");
		pht_community_I = newImage("./graphics/pht_community_I.jpg");

		pht_units_A = newImage("./graphics/pht_units_A.jpg");
		pht_units_B = newImage("./graphics/pht_units_B.jpg");
		pht_units_C = newImage("./graphics/pht_units_C.jpg");
		pht_units_D = newImage("./graphics/pht_units_D.jpg");
		pht_units_E = newImage("./graphics/pht_units_E.jpg");
		pht_units_F = newImage("./graphics/pht_units_F.jpg");
		pht_units_G = newImage("./graphics/pht_units_G.jpg");
		pht_units_H = newImage("./graphics/pht_units_H.jpg");
		pht_units_I = newImage("./graphics/pht_units_I.jpg");
		
		preloadFlag = true;
	}
}

////////////////////////////////////////////////////////////////////////////
//function for css nn fix///////////////////////////////////////////////////

function WM_netscapeCssFix() {

  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()


var newwin;
function launchwin(winurl,winname,winfeatures)
{
       //This launches a new window and then
       //focuses it if window.focus() is supported.
       newwin = window.open(winurl,winname,winfeatures);
       if(javascript_version > 1.0)
       {
               //delay a bit here because IE4 encounters errors
               //when trying to focus a recently opened window
               setTimeout('newwin.focus();',250);
       }
}

//end of file///////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////