function foot(addWarning){
var w=addWarning?'<br><a name="warn">Warning</a>: the drugs or drug combinations referred to here may be similar or related, but are not be the same ones and may not have the same pharmacological action as other substances described on the same page or in the same row.  Please refer to product monograph or to your doctor':'';
var f=document.getElementById('footer')
f.innerHTML='<img src="../image/input_text_bg.gif" width=768 height=1><center><small>Sources: <a href="http://www.nlm.nih.gov/pubs/factsheets/mesh.html">NLM 2007 Medical Subject Headings</a>, <a href="http://www.nlm.nih.gov/research/umls/umlsmain.html">NIH UMLS</a>, <a href="http://www.fda.gov/cder/">Drugs@FDA</a>, <a href="http://www.fda.gov/cder/aers/default.htm">FDA AERS</a> <small>original data copyright United States Government</small>'+w+'</small> </center>';
if (drugpage){
	document.body.className='drugbody'
	var t=getElementsByClassName(document, 'table', 'text')
	if (t) if(t[0]){
		t[0].className='tbl_pop_d'
		t[0].border=0
		t[0].cellSpacing=0

var tas = t[0].getElementsByTagName("a");
for (var i = 0; i < tas.length; i++) {
	tas[i].href=tas[i].href.replace("http://www.fda.gov/cder/foi", "http://www.accessdata.fda.gov/drugsatfda_docs").replace(/htm$/,"cfm");
}


	}
	if (t) if(t[1]){
		t[1].className='tbl_pop'
		t[1].border=0
		t[1].cellSpacing=0

		even=true;
		var trs = t[1].getElementsByTagName("tr");
		for (var i = 0; i < trs.length; i++) {
			trs[i].id=even?'even':'odd';
			even = !even;
		}
		trs[0].id='th';
	}



	document.getElementById('header').parentNode.padding=0
} else {
	var searchpage = (document.title.indexOf('(search)') > -1);
	document.getElementById('tree').frameBorder=0;
	trwidth()
	document.getElementById('first').onresize = trwidth;
	var t=getElementsByClassName(document, 'table', 'text')
	if (t) if(t[0]){
		t[0].className='tbl_content_details'
		t[0].border=0
		t[0].cellspacing=0

		var s=document.getElementById('second');  // s is the second (right) TD
		s.appendChild(t[0])
		if (!searchpage) {
			// insert rows with round corners
			var tbody = t[0].lastChild;
			var cols = tbody.firstChild.getElementsByTagName("td").length-2;
			tbody.insertBefore(newRow('top', cols), tbody.firstChild);
			if (tbody.firstChild.nextSibling.nextSibling){
				tbody.insertBefore(newRow('top',    cols), tbody.firstChild.nextSibling.nextSibling);
				tbody.insertBefore(newRow('mid',    cols), tbody.firstChild.nextSibling.nextSibling);
				tbody.firstChild.nextSibling.nextSibling.className='white'
				tbody.insertBefore(newRow('bottom', cols), tbody.firstChild.nextSibling.nextSibling);
				//t[1] is the little table with the title
				if (t[1]) {
					t[1].className='title';
				}
				s.insertBefore(t[1], s.firstChild);
			} else {
				tbody.appendChild(newRow('bottom', cols));
			}

			//t[2] is the optional table with the list of substances
			if (t[2]) {
				t[2].className='tbl_content_text';
				t[2].lastChild.firstChild.className="th";
				t[2].border=0;
				t[2].cellSpacing=0;
			}

		}
	}
}
}

function trwidth() { 
	var tr=document.getElementById('tree');
	tr.width = document.getElementById('first').offsetWidth;
}

var drugpage=false
function head(dName, instruct){
drugpage=!instruct
var w=(instruct)?' Click on the tree icon (&psi;) to see related concepts, click on the concept name to see the entries for that concept.  Double-click to look up a word':'';
var h=document.getElementById('header');
if (w){
	h.innerHTML='<div id="top_line" class="top_line"></div><a href="http://reference.md" class="home"><div class="top_bg"></div></a><table border="0" cellspacing="0" class="tbl_content"><tr><td id="first" valign="top" width="300"><div class="top_content_line"></div><div class="top_content_contact" align="center"><div class="look_up_align">encyclopedia of medical concepts<FORM NAME="f" action="/search.html" target="_top" class="look_up"><span id="look_up_text"><input type="text" ID=w name=w ondragenter="cursorToCopy()" ondrop="document.f.h.value=location.host;fnGetInfo()" ondragover="cursorToCopy()" value="'+dName+'"></span> <span id="look_up_submit"><input value="Look Up" type="submit" /></span></form></div></div></td><td id="second" valign="top" align="left">&nbsp;';
} else {
	h.innerHTML='<div class="look_up"><FORM NAME="f" action="/search.html" target="_top" class="look_up"><span id="look_up_text"><input type="text" ID=w name=w ondragenter="cursorToCopy()" ondrop="document.f.h.value=location.host;fnGetInfo()" ondragover="cursorToCopy()" value="'+dName+'"></span> <span id="look_up_submit"><input value="Look Up" type="submit" /></span></FORM></div>'
}
document.forms[0].onsubmit=function(e){return validate()};
}
function validate(e){
	document.forms['f'].w.value=document.forms['f'].w.value.replace(/^\s*/, '').replace(/\s*$/, '');
	if (document.forms['f'].w.value.length==0){alert('Type a word before pressing Look Up'); return false}
	document.f.submit();
	return false;
}
function AERS(){
if(document.getElementById('AERS'))document.getElementById('AERS').innerHTML='<small>Role codes: PS=Primary Suspect Drug; SS=Secondary Suspect Drug; C=Concomitant; I=Interacting<P>CAVEATS<P>These reports are summarized from from Q3 2006 AERS data. There are some important things to keep in mind when reviewing or analyzing AERS data:<P>For any given report, there is no certainty that a suspected drug caused the reaction. This is because physicians are encouraged to report suspected reactions; however, the event may have been related to the underlying disease being treated, or caused by some other drug being taken concurrently, or simply occurred by chance at that time.<P>Accumulated reports cannot be used to calculate incidence (occurrence rates) or to estimate drug risk. Comparisons between drugs cannot be made from these data.</small>';
}


function getElementsByClassName(oElm, strTagName, strClassName){
	var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	strClassName = strClassName.replace(/\-/g, "\\-");
	var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
	var oElement;
	for(var i=0; i<arrElements.length; i++){
	oElement = arrElements[i];
	if(oRegExp.test(oElement.className)){
	    arrReturnElements.push(oElement);
	}
	}
	return (arrReturnElements)
}


var th = document.createElement("TH");
function newRow(tb, cols){
	var row = document.createElement("TR")
	var td1 = th.cloneNode(true)
	var td2 = th.cloneNode(true)
	td1.id=tb+"_left"
	td2.id=tb+"_right"
	row.appendChild(td1);
	for(var i=0; i<cols-2; i++){
	row.appendChild(th.cloneNode(true));;
	}
	row.appendChild(td2);
	return row;
}

var GB_ANIMATION = true;
var GB_IMG_DIR = "/medical/greybox/";
var GB_overlay_click_close = true;