function menuEntry(levelOne, levelTwo, forwardURL, menuText)
	{
		bulletState = "0";

		menuClass = "leftnav";


		menuEntryHTML = "<table width=\"150\" cellspacing=0 cellpadding=0 border=0 SUMMARY=\"This table used for layout purposes only\">\n";
		menuEntryHTML += "<tr>\n\t<td width=20 valign=top>\n";
		
	
		
		if (levelA == levelOne ) {
			
			if (levelB == "0" ) {
				menuEntryHTML += "<img alt=\" \" name=b" + levelOne;
				menuEntryHTML += " src=\"" + rootDirectory + "images/tri_rt.gif\">\n";
			} else {
				menuEntryHTML += "<a href=\"" + rootDirectory + forwardURL + "\" title=\" \">";
				menuEntryHTML += "<img alt=\" \" border=0 name=b" + levelOne;
				menuEntryHTML += " src=\"" + rootDirectory + "images/tri_down.gif\"></a>\n";
				bulletState = "1";
			}
			
		} else {
		
			menuEntryHTML += "<a href=\"" + rootDirectory + forwardURL + "\" title=\" \">";
			menuEntryHTML += "<img alt=\" \" border=0 name=b" + levelOne;
			menuEntryHTML += " src=\"" + rootDirectory + "images/tri_up.gif\"></a>\n";
		
		}

		menuEntryHTML += "</td><td valign=top align=left width=130 class=" + menuClass + ">";
			
		if (levelA != levelOne || levelB > levelTwo) {

			menuEntryHTML += "<A HREF=\"" + rootDirectory + forwardURL + "\" ";
			menuEntryHTML += "ONMOUSEOVER=\"changeImages('b" + levelOne + "\', \'" + rootDirectory;

			if (bulletState == "1") {
				menuEntryHTML += "images/tri_down.gif\'\)\; return true\;\" ";
				} else {
				menuEntryHTML += "images/tri_down.gif\'\)\; return true\;\" ";
				}

			menuEntryHTML += "ONMOUSEOUT=\"changeImages(\'b" + levelOne + "\', \'" + rootDirectory;

			if (bulletState =="1") {
				menuEntryHTML += "images/tri_up.gif\'\)\; ";
				} else {
				menuEntryHTML += "images/tri_up.gif\'\)\; ";
				}
			menuEntryHTML += "return true\;\" class=" + menuClass + ">";
			
		}

		menuEntryHTML += menuText;

		if (levelA != levelOne || levelB > levelTwo) menuEntryHTML += "</A>";
		menuEntryHTML += "</td></tr>\n";
		menuEntryHTML += "</table>\n";
		
		//document.write(menuEntryHTML);
		//alert(menuEntryHTML);		
		fulltextHTML += menuEntryHTML;	
		
	}

//----------------------------------------------


function subMenuEntry(levelTwo, forwardURL, menuText)
	{

		thisClass = 'leftsubnav';

		
		if(is.ns4){
				
			thisClass = 'leftsubnavns4';
				
		}
			
		subMenuHTML = '<tr><td width=30 align=right valign=top class=' + thisClass + '>\&nbsp;\&nbsp;\&nbsp;\&\#0150;\&nbsp;</td><td width=120 class=' + thisClass + '>';
		
		if (levelB != levelTwo || levelC != 0) {
		
			subMenuHTML += '<A HREF="' + rootDirectory + forwardURL;

			subMenuHTML += '" class=' + thisClass + '>';

		}
	
		subMenuHTML += menuText;
		
		if (levelB != levelTwo) subMenuHTML += '\n</A>';
				
		subMenuHTML += '</td></tr>\n';
		
		fulltextHTML += subMenuHTML;
		
	}


//----------------------------------------------


function makeTopMenu() {

        if (levelA != "0") {
        	rootDirectory = "../";
        } else {
        	rootDirectory = "./";
        }


	topMenuTextHTML = "";

	topMenuTextHTML += '<TABLE WIDTH=490 BORDER=0 CELLPADDING=0 CELLSPACING=0 SUMMARY="This table used for layout purposes only">\n'
	topMenuTextHTML += '<TR>'
	topMenuTextHTML += '<TD WIDTH=10><IMG SRC="' + rootDirectory + 'images/spacer.gif" ALT=" " WIDTH=10 HEIGHT=40 BORDER=0></TD>'
	topMenuTextHTML += '<TD WIDTH=480 CLASS=stopnav>'
	topMenuTextHTML += '<A CLASS=stopnav HREF="' + rootDirectory + 'index.htm">Main</A>\n'
	topMenuTextHTML += '\t&nbsp;|&nbsp;\n'
	topMenuTextHTML += '\t<A HREF="http://www.nhlbi.nih.gov/" CLASS=stopnav>NHLBI Site</A>\n'
	topMenuTextHTML += '\t&nbsp;|&nbsp;\n'
	topMenuTextHTML += '\t<A HREF="http://www.nhlbi.nih.gov/health/public/heart/index.htm\#ami" CLASS=stopnav>Resources for Public \/ Patients</A>\n'
	topMenuTextHTML += '\t&nbsp;|&nbsp;\n'
	topMenuTextHTML += '\t<A HREF="http://www.nhlbi.nih.gov/health/prof/heart/index.htm\#mi" CLASS="stopnav">Resources for Professionals</A>\n'	
	topMenuTextHTML += '</TD>\n'
	topMenuTextHTML += '</TR>\n'
	topMenuTextHTML += '</TABLE>\n'

	//alert(topMenuTextHTML);

	document.write(topMenuTextHTML);
}

//----------------------------------------------


function makeFooterMenu() {

        if (levelA != "0") {
        	rootDirectory = "../";
        } else {
        	rootDirectory = "./";
        }

	if(is.ns4){
	
		style_def = '';
		
	} else {
	
		style_def = '';
	}
		
	bottomMenuTextHTML = "";

	bottomMenuTextHTML += '<TABLE WIDTH="640" BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=\"This table used for layout purposes only\">\n'
	bottomMenuTextHTML += '<TR>'
	bottomMenuTextHTML += '<TD WIDTH="640" ALIGN="CENTER">'
	if(is.ns4) bottomMenuTextHTML += '\t<A HREF="' + rootDirectory + 'index.htm" CLASS="nhlbifooter"' + style_def + '>&nbsp;</A>\n'
	bottomMenuTextHTML += '\t<A HREF="' + rootDirectory + 'index.htm" CLASS="nhlbifooter"' + style_def + '>Main</A>\n'
	bottomMenuTextHTML += '\t&nbsp;|&nbsp;\n'
	bottomMenuTextHTML += '\t<A HREF="' + rootDirectory + 'aha/aha.htm" CLASS="nhlbifooter"' + style_def + '>Heart Attacks</A>\n'
	bottomMenuTextHTML += '\t&nbsp;|&nbsp;\n'
	bottomMenuTextHTML += '\t<A HREF="' + rootDirectory + 'haws/haws.htm" CLASS="nhlbifooter"' + style_def + '>Heart Attack Warning Signs</A>\n'
	bottomMenuTextHTML += '\t&nbsp;|&nbsp;\n'
	bottomMenuTextHTML += '\t<A HREF="' + rootDirectory + 'saha/saha.htm" CLASS="nhlbifooter"' + style_def + '>Surviving a Heart Attack</A>\n'	
	bottomMenuTextHTML += '\t&nbsp;|&nbsp;\n'
	bottomMenuTextHTML += '\t<A HREF="' + rootDirectory + 'taha/taha.htm" CLASS="nhlbifooter"' + style_def + '>Testing for a Heart Attack</A><BR>\n'
	bottomMenuTextHTML += '\t\n'
	bottomMenuTextHTML += '\t<A HREF="' + rootDirectory + 'rhar/rhar.htm" CLASS="nhlbifooter"' + style_def + '>Reducing Heart Attack Risk</A>\n'
	bottomMenuTextHTML += '\t&nbsp;|&nbsp;\n'
	bottomMenuTextHTML += '\t<A HREF="' + rootDirectory + 'hdm/hdm.htm" CLASS="nhlbifooter"' + style_def + '>Heart Disease and Medications</A>\n'
	bottomMenuTextHTML += '\t&nbsp;|&nbsp;\n'
	bottomMenuTextHTML += '\t<A HREF="' + rootDirectory + 'faq/faq.htm" CLASS="nhlbifooter"' + style_def + '>Frequently Asked Questions</A>\n'
	bottomMenuTextHTML += '\t&nbsp;|&nbsp;\n'
	bottomMenuTextHTML += '\t<A HREF="' + rootDirectory + 'sitemap.htm" CLASS="nhlbifooter"' + style_def + '>Map</A><BR>\n'
	
	bottomMenuTextHTML += '\t<A HREF="http://www.nhlbi.nih.gov/about/privacy.htm" CLASS="nhlbifooter"' + style_def + '>NHLBI Privacy Statement</A>\n'
	bottomMenuTextHTML += '\t&nbsp;|&nbsp;\n'
	bottomMenuTextHTML += '\t<A HREF="http://www.nhlbi.nih.gov/" CLASS="nhlbifooter"' + style_def + '>NHLBI Home</A>\n'
	bottomMenuTextHTML += '\t&nbsp;|&nbsp;\n'
	bottomMenuTextHTML += '\t<A HREF="http://www.nhlbi.nih.gov/contact/index.htm" CLASS="nhlbifooter"' + style_def + '>Contact NHLBI</A><BR>\n'	
	
	bottomMenuTextHTML += '</TD>\n'
	bottomMenuTextHTML += '</TR>\n'
	bottomMenuTextHTML += '</TABLE>\n'


	document.write(bottomMenuTextHTML);
}

//----------------------------------------------

function makeNavMenu(){

        if (levelA != "0") {
        	rootDirectory = "../";
        } else {
        	rootDirectory = "./";
        }

	fulltextHTML = "";


	// Heart Attacks Section
	
	menuEntry(1, 0, 'aha/aha.htm', 'Heart Attacks');
	if (levelA == "1") {
		fulltextHTML += "<table width=\"150\" border=0 cellpadding=0 cellspacing=0 SUMMARY=\"This table used for layout purposes only\">\n";
		subMenuEntry(1, 'aha/what.htm', 'What is a <BR>Heart Attack?');
		subMenuEntry(2, 'aha/who.htm', 'Who\'s at Risk');
		subMenuEntry(3, 'aha/damage.htm', 'Limiting Heart <BR>Muscle Damage');
		fulltextHTML += "</table>\n";
	}
	

	//Heart Attac Warning Signs Section
	
	menuEntry(2, 0, 'haws/haws.htm', 'Heart Attack<BR>Warning Signs');
	if (levelA == "2") {
		fulltextHTML += "<table width=\"150\" border=0 cellpadding=0 cellspacing=0 SUMMARY=\"This table used for layout purposes only\">\n";
		subMenuEntry(1, 'haws/women.htm', 'Women and<BR>Heart Attack');
		fulltextHTML += "</table>\n";
	}	
	
	// Surviving a Heart Attack Section
	
	menuEntry(3, 0, 'saha/saha.htm', 'Surviving a Heart<BR>Attack');
	if (levelA == "3") {
		fulltextHTML += "<table width=\"150\" border=0 cellpadding=0 cellspacing=0 SUMMARY=\"This table used for layout purposes only\">\n";
		subMenuEntry(1, 'saha/uncertain.htm', 'Uncertainty is Normal');
		subMenuEntry(2, 'saha/delay.htm', 'Delay Can Be Deadly');
		subMenuEntry(3, 'saha/call.htm', 'Call 9-1-1');
		subMenuEntry(4, 'saha/emp.htm', 'Emergency Medical Personnel');
		subMenuEntry(5, 'saha/plan.htm', 'Plan Ahead');		
		fulltextHTML += "</table>\n";
	}	
	

	// Testing for a Heart Attack Section
	
	menuEntry(4, 0, 'taha/taha.htm', 'Testing for a Heart<BR>Attack');
	
	
	// Reducing Heart Attack Risk Section
	
	menuEntry(5, 0, 'rhar/rhar.htm', 'Reducing Heart<BR>Attack Risk');
 	if (levelA == "5") {
		fulltextHTML += "<table width=\"150\" border=0 cellpadding=0 cellspacing=0 SUMMARY=\"This table used for layout purposes only\">\n";
		subMenuEntry(1, 'rhar/smoke.htm', 'Stop Smoking');
		subMenuEntry(2, 'rhar/lhbp.htm', 'Lower High Blood Pressure');
		subMenuEntry(3, 'rhar/lhbc.htm', 'Reduce High Blood Cholesterol');
		subMenuEntry(4, 'rhar/lew.htm', 'Aim for a Healthy Weight');
		subMenuEntry(5, 'rhar/bpa.htm', 'Be Physically Active Each Day');		
		subMenuEntry(6, 'rhar/md.htm', 'Manage Diabetes');				
		fulltextHTML += "</table>\n";
	}
	
       
        // Heart Disease Medications Section
        
        menuEntry(6, 0, 'hdm/hdm.htm', 'Heart Disease<BR>and Medications');
        
        
        // Frequently Asked Questions Section
	menuEntry(7, 0, 'faq/faq.htm', 'Frequently Asked Questions');	

	document.write(fulltextHTML);
	
	return;
}