// hw.js
// last updated 04 June 2003 by SLY

// called from the HW Nav Stack
function hwNav() {
	var objStr,obj;
	var bulletSrc = '/kbase/images/bullets/bullet.gif';
	var arrowSrc = '/kbase/images/arrows/arrow_right.gif';
	if (document.images[hwSecId]) {
		tempImg = document.images[hwSecId];
		var iggy = tempImg.src;
		iggy=iggy.replace(/(^http.*\.ghc\.org(:99)?)/i,"");
		if(document.layers) {
			tempImg = '';
		}
		if(document.images) {
			if(iggy == bulletSrc) {
				tempImg.src = arrowSrc;
			} 
			else {
				tempImg.src = bulletSrc;
			}
		}
	}
}


//to open a new window for HW mm-doc or definition-topic, or Actionset Quiz or Symptom When-to-See documents
var defWindow='';
function hwPop(docId) {
	var baseUrl;
	var theUrl;
	if(docId == "multdisc"){
		theUrl="/kbase/multdisc.jhtml";
	}else{
		baseUrl="/kbase/popup.jhtml?docId=";
		theUrl=baseUrl+docId;
	}
	if (!defWindow.closed && defWindow.location) {
			defWindow.location.href = theUrl;
	}else{
		defWindow = window.open(theUrl,'HwWindow', 'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes,width=670,height=500,left=10,top=10');
	}	
	defWindow.focus();
}

//break a hw id into 4-character directory path (aa105361 >>> aa10/5361/aa105361.xml)
//function makeBigUrl(theId) {
//	var start = 0;
//	var dirs = new Array(Math.ceil(theId.length/4));
//	for(var i = 0; i < dirs.length; i++){dirs[i]=theId.substr(start,4);start+=4;}
//	var bigUrl=dirs.join('/')+"/"+theId+".xml";
//	return bigUrl;
//}

//to show/hide a div in a HW alert or ghc customization (ghCustom.xml)
function alertBig(divId) {
	if (document.getElementById(divId).style.display == "none") {
		document.getElementById(divId).style.display="block";
	} else { 
		document.getElementById(divId).style.display="none";
	}
}

function hideDiv(divId) {
	document.getElementById(divId).style.display="none";
}

