// hhmistore.js
// the pink model
// dhtml: nate@hfd.com

// popups are minor, restricted windows used for detailed description of one item.
// the idea behind a bubble is popup that closes itself when the user's interest changes.
//   for example, the bubble "pops" when the user clicks on a link in the bubble's parent window.
var HHMIStoreBubble, HHMIStoreNavPop;
// this is used to check for unnecessary refresh of the navigation frame.
var currentNavURL;

// set the navigation frame.
function setNav(navURL) {
	// check if it's not already loaded
	if (navURL != currentNavURL) {
		parent.nav.location.href=navURL;
	}
}

// set the content frame.
function setContent(contentURL) {
	parent.content.location.href=contentURL;
}

// load a bubble with the URL, open a bubble if necessary.
//   there is only one bubble per page.
function loadBubble(URL) {
	HHMIStoreBubble = window.open(URL, window.name+'bubble', 'toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=yes,width=340,height=350');			
	HHMIStoreBubble.focus();
}

// close the bubble safely.
function closeBubble() {
	if ((HHMIStoreBubble != undefined) && (HHMIStoreBubble.close != undefined)) {
		HHMIStoreBubble.close();
	}
}

// opens the navigation popup with the URL.
//   there is only 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=yes,width=340,height=350');			
	HHMIStoreNavPop.focus();
}

// load the main window with the URL safely.
//   then bring focus to the main window.
function loadMain(URL) {
	if (window.opener) {
		window.opener.location = URL;
		window.opener.focus();
	}
}

// untouched and proto-hfd javascript follows

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

