IE4 = (document.all) ? 1 : 0;
NS4 = (document.layers) ? 1 : 0;
timetoHidemenu=null;
var previousMenu;

menuItem1=new Array("");
hrefItem1=new Array("#")

menuItem2=new Array("Features of the plan:","Beneficiary", "Contribution", "Educational Assistance Payments&nbsp;&nbsp;","Accumulated Income Payments ","Transfers", "Plan Termination ");
hrefItem2=new Array("resp.asp#toc1","resp.asp#toc2","resp.asp#toc3","resp.asp#toc4","resp.asp#toc5","resp.asp#toc6","resp.asp#toc7")

menuItem3=new Array("Term Life Insurance", "permanent Life", "The Central Debate","Whole Life Accumulates Value","Universal Life Insurance ","Critical illness insurance ","Visitors to Canada Travel Medical Insurance&nbsp;&nbsp;","Principles & Beliefs");
hrefItem3=new Array("insurance.asp#toc1","insurance.asp#toc2","insurance.asp#toc3","insurance.asp#toc4","insurance.asp#toc5","insurance.asp#toc6","insurance.asp#toc7")

menuItem4=new Array("Critical Illness");
hrefItem4=new Array("#")

menuItem5=new Array("Mortgage Related Questions","Basic Features","Glossary", "What you need to know:");
hrefItem5=new Array("mortgage.html#toc1","mortgage.html#toc2","mortgage.html#toc3","mortgage.html#toc4")

menuItem6=new Array("Contact");
hrefItem6=new Array("#")
      
function HideMenuDemo()
{


	if(IE4){
		ien= eval("document.all.menusID.style");
		ien.visibility="hidden";
	}
	else
		{
		if(NS4)
			{
			ien=eval("document.menusID");
			ien.visibility="hidden";
			}
		else
			{

			document.getElementById("menusID").style.visibility = "hidden";
			}
		}
		
}


function ShowMenuDemo(menuAr,hrefAr, lt,wt)
{

if(timetoHidemenu != null)
	{
	clearTimeout(timetoHidemenu);
	}



if(IE4){
	

	CreateMenu(menuAr,hrefAr,lt,wt);
	ien= eval("document.all.menusID.style")
	ien.top=lt;

	ien.left=151;
	ien.visibility="visible";
       }
       else
	{
		if(NS4)
		{
		ien=eval("document.menusID");
		ien.visibility="hidden";
		CreateMenu(menuAr,hrefAr,lt,wt);
		ien=eval("document.menusID");
		ien.left=151;
		ien.top=lt;
		ien.visibility="visible";
		}
		else
		{
		CreateMenu(menuAr,hrefAr,lt,wt);
		document.getElementById("menusID").style.left=151;

		document.getElementById("menusID").style.top=lt;
		document.getElementById("menusID").style.visibility = "visible";
		}	
	}
	}

function clearTime()
{
	clearTimeout(timetoHidemenu);
}

function setNewTime()
{
	if(timetoHidemenu != null)
	{

	clearTimeout(timetoHidemenu);

	}
timetoHidemenu=setTimeout("HideMenuDemo()",2000);
}

function hideMenu()
{
	timetoHidemenu=setTimeout("HideMenuDemo()",2000);
}



function CreateMenu(menuItem,hrefItem,left,width)
{

txt=""
txt=txt + "<table border=0 cellspacing=0 cellpadding=0>"
txt=txt + "<tr>"
txt=txt + "<td width=1 bgcolor='#FFFFFF'><img src='images/blank.gif' width=1 height=1  border=0></td>"
txt=txt + "<td bgcolor=#FFFFFF><img src='images/blank.gif' width=" +width +" height=1  border=0></td>"

txt=txt + "<td width=1 bgcolor='#FFFFFF'><img src='images/blank.gifg' width=1 height=1  border=0></td>"
txt=txt + "</tr>"
txt1=""

for(i=0;i<menuItem.length;i++)
{
txt1=txt1 + "<tr>"
txt1=txt1 + "<td width=1 bgcolor='#FFFFFF'><img src='images/blank.gif' width=1 height=1  border=0></td>"


txt1=txt1 + "<td  class='menuText' bgcolor='#296BBF' valign=middle height=20>&nbsp;&nbsp;<a href=" + hrefItem[i] + " class='menuText' onmouseOut=setNewTime() onmouseOver=clearTime()><b>" + menuItem[i] + "</b></a></td>"


txt1=txt1 + "<td width=1 bgcolor='#FFFFFF'><img src='images/blank.gif' width=1 height=1  border=0></td>"
txt1=txt1 + "</tr>"
txt1=txt1 + "<tr bgcolor='#FFFFFF'>"
txt1=txt1 + "<td width=1 bgcolor='#FFFFFF'><img src='images/blank.gif' width=1 height=1  border=0></td>"
txt1=txt1 + "<td bgcolor=#FFFFFF><img src='images/blank.gif' width=" +width +" height=1  border=0></td>"
//document.write(txt1)
txt1=txt1 + "<td width=1 bgcolor='#FFFFFF'><img src='images/blank.gif' width=1 height=1  border=0></td>"
txt1=txt1 + "</tr>"


}

txt1=txt1 + "</table>"


if(IE4){
	

	document.all.menusID.innerHTML=txt+txt1;
       }
       else
	{
		if(NS4)
		{
		  document.menusID.document.open(); 
		  document.menusID.document.write(txt+txt1);
		  document.menusID.document.close(); 
		}
		else
		{document.getElementById("menusID").innerHTML=txt+txt1;
		}	
	}






return;
}

