var HHMIStoreBubble, HHMIStoreNavPop;

self.onerror = function() {
	return true;
}

if (document.images) {
order = new Image(112, 15);order.src = 'images/headpix/order.gif';
order_over = new Image(112, 15);order_over.src = 'images/headpix/order_over.gif';
account = new Image(112, 15);account.src = 'images/headpix/account.gif';
account_over = new Image(112, 15);account_over.src = 'images/headpix/account_over.gif';
help = new Image(112, 15);help.src = 'images/headpix/help.gif';
help_over = new Image(112, 15);help_over.src = 'images/headpix/help_over.gif';
feedback = new Image(112, 15);feedback.src = 'images/headpix/feedback.gif';
feedback_over = new Image(112, 15);feedback_over.src = 'images/headpix/feedback_over.gif';
}
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 ((HHMIStoreBubble != undefined) && (HHMIStoreBubble.close != undefined)) {
		if (HHMIStoreBubble.opener) {
			HHMIStoreBubble.opener.location = URL;
			HHMIStoreBubble.close();
		}
	}
}
*/

// function that will load the bubble with URL, opening the bubble if necessary (one bubble per page)
function loadBubble(URL) {
	HHMIStoreBubble = window.open(URL, 'bubble', 'toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=yes,width=340,height=350');			
	HHMIStoreBubble.focus();
}

// function that will load the glossary bubble with URL, opening the bubble if necessary (one bubble per page)
function loadGlossaryBubble(URL) {
	HHMIStoreBubble = window.open(URL, 'glossary', 'toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=no,width=340,height=350');			
	HHMIStoreBubble.focus();
}

// function that will load the glossary bubble with URL, opening the bubble if necessary (one bubble per page)
function loadKeyBubble(URL) {
	HHMIStoreBubble = window.open(URL, 'key', 'toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=no,width=360,height=350');			
	HHMIStoreBubble.focus();
}

// function that will load the bubble for the d120_1 pop-up with URL, opening the bubble if necessary (one bubble per page)
function loadD120Bubble(URL) {
	HHMIStoreBubble = window.open(URL, 'd120', 'toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=yes,width=425,height=450');			
	HHMIStoreBubble.focus();
}

// function that will load a larger bubble with URL, opening the bubble if necessary (one bubble per page)
function loadBigBubble(URL) {
	HHMIStoreBubble = window.open(URL, 'sidebar', 'toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=yes,width=500,height=450');			
	HHMIStoreBubble.focus();
}

// function that will load a larger bubble with URL, opening the bubble if necessary (one bubble per page)
function loadChartBubble(URL) {
	HHMIStoreBubble = window.open(URL, 'sidebar', 'toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=yes,width=575,height=475');			
	HHMIStoreBubble.focus();
}

// function that safely closes the bubble
function closeBubble() {
	if ((HHMIStoreBubble != undefined) && (HHMIStoreBubble.close != undefined)) {
		HHMIStoreBubble.close();
	}
}

// function that (re)opens a navpop with URL (one navpop per page)
function loadNavPop(URL) {
	HHMIStoreNavPop = window.open(URL, window.name+'navpop', 'toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=no,width=340,height=350');			
	HHMIStoreNavPop.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();
	}
}

