var HHMIBubble, HHMINavPop;

var currentNavURL;



self.onerror = function() {

	return true;

}

function di(id,name){

  if (document.images) {document.images[id].src=eval(name+".src"); }

}



// function that displays status bar message



function dm(msgStr) {

  document.returnValue = false;

  if (document.images) { 

     window.status = msgStr;

     document.returnValue = true;

  }

}

var showMsg = navigator.userAgent != "Mozilla/4.0 (compatible; MSIE 4.0; Mac_PowerPC)";

function dmim(msgStr) {

  document.returnValue = false;

  if (showMsg) { 

    window.status = msgStr;

    document.returnValue = true;

  }

}



function setNav(navURL) {

	if (navURL != currentNavURL) {

		parent.nav.location.href=navURL;

	}

}



function setContent(contentURL) {

	parent.content.location.href=contentURL;

}



/*

// function that safely loads the main window with URL and closes the current bubble

function burstBubble(URL) {

	if ((HHMIBubble != undefined) && (HHMIBubble.close != undefined)) {

		if (HHMIBubble.opener) {

			HHMIBubble.opener.location = URL;

			HHMIBubble.close();

		}

	}

}

*/



// function that will load the bubble with URL, opening the bubble if necessary (one bubble per page)

function loadBubble(URL) {
   	self.name = "hhmiabout";
	HHMIBubble = window.open(URL, window.name+'bubble', 'toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=yes,width=468,height=560');			
	HHMIBubble.focus();


}

// function that will load the Image Popup with URL, opening the bubble if necessary (one bubble per page)

function loadImage(URL) {
   	self.name = "hhmiabout";
	HHMIBubble = window.open(URL, window.name+'bubble', 'toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=yes,width=485,height=560');			
	HHMIBubble.focus();


}

// function that will load the Quote Popup with URL, opening the bubble if necessary (one bubble per page)

function loadQuote(URL) {
   	self.name = "hhmiabout";
	HHMIBubble = window.open(URL, window.name+'bubble', 'toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=yes,width=520,height=560');			
	HHMIBubble.focus();


}

// function that will load the Timeline Popup with URL, opening the bubble if necessary (one bubble per page)

function loadTimeline(URL) {
   	self.name = "hhmiabout";
	HHMIBubble = window.open(URL, window.name+'bubble', 'toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=yes,width=715,height=630');			
	HHMIBubble.focus();


}

// function that will load the Tour Popup with URL, opening the bubble if necessary (one bubble per page)

function loadTour(URL) {
   	self.name = "hhmiabout";
	HHMIBubble = window.open(URL, window.name+'bubble', 'toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=no,width=705,height=520');			
	HHMIBubble.focus();


}



// function that safely closes the bubble

function closeBubble() {

	if ((HHMIBubble != undefined) && (HHMIBubble.close != undefined)) {

		HHMIBubble.close();

	}

}



// function that (re)opens a navpop with URL (one navpop per page)

function loadNavPop(URL) {

	HHMINavPop = window.open(URL, window.name+'navpop', 'toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=no,width=340,height=350');			

	HHMINavPop.focus();

}



// function that safely loads and focuses on the main window with URL

function loadMain(URL) {

	if (window.opener) {

		window.opener.location = URL;

		window.opener.focus();

	}

}


