// JavaScript Document

// Open a new window
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

// Test if the user is using a Mac
function isPPC() {
    if (navigator.appVersion.indexOf("PPC") != -1) return true;
    else return false;
}

<!--

// function switchDiv()
//  this function takes the id of a div
//  and calls the other functions required
//  to show that div
//
function switchDiv(div_id,display)
{
  var style_sheet = getStyleObject(div_id);
  if (style_sheet)
  {
    //hideAll();
    changeObjectVisibility(div_id,display);
  }
  else 
  {
    alert("sorry, this only works in browsers that do Dynamic HTML");
  }
}

// function hideAll()
//  hides a bunch of divs
//
function hideAll()
{
   changeObjectVisibility("ez","hidden");
   changeObjectVisibility("full","hidden");
   changeObjectVisibility("superduper","hidden");
}

// function getStyleObject(string) -> returns style object
//  given a string containing the id of an object
//  the function returns the stylesheet of that object
//  or false if it can't find a stylesheet.  Handles
//  cross-browser compatibility issues.
//
function getStyleObject(objectId) {
  // checkW3C DOM, then MSIE 4, then NN 4.
  //
  if(document.getElementById && document.getElementById(objectId)) {
	return document.getElementById(objectId).style;
   }
   else if (document.all && document.all(objectId)) {  
	return document.all(objectId).style;
   } 
   else if (document.layers && document.layers[objectId]) { 
	return document.layers[objectId];
   } else {
	return false;
   }
}

function changeObjectVisibility(objectId, newVisibility) {
    // first get a reference to the cross-browser style object 
    // and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	styleObject.display = newVisibility;
	return true;
    } else {
	// we couldn't find the object, so we can't change its visibility
	return false;
    }
}

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

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];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		navigation_adventure_over = newImage("images/navigation_adventure-over.gif");
		navigation_future_over = newImage("images/navigation_future-over.gif");
		navigation_lifestyle_over = newImage("images/navigation_lifestyle-over.gif");
		side_whoweare_over = newImage("images/side_whoweare-over.gif");
		side_whereweare_over = newImage("images/side_whereweare-over.gif");
		side_history_over = newImage("images/side_history-over.gif");
		side_environment_over = newImage("images/side_environment-over.gif");
		side_positions_over = newImage("images/side_positions-over.gif");
		side_career_over = newImage("images/side_career-over.gif");
		side_benefits_over = newImage("images/side_benefits-over.gif");
		side_housing_over = newImage("images/side_housing-over.gif");
		side_relocation_over = newImage("images/side_relocation-over.gif");
		side_ilife_over = newImage("images/side_ilife-over.gif");
		side_icommunity_over = newImage("images/side_icommunity-over.gif");
		side_culture_over = newImage("images/side_culture-over.gif");
		preloadFlag = true;
	}
}

function getQueryVar($variable) {

	var $query = document.location.search.substring(1);
	
	var $vars = $query.split("&");

	for (var $i = 0; $i < $vars.length; $i++) {

		$pair = $vars[$i].split("=");
		
			if ($pair[0] == $variable) {
				
				return $pair[1];	
			}
	}
}

-->
