/*
	Written by Patrick Mulligan
	Written on 11.3.2004
	File: di_left_nav.js
	Description: Contains the various functions responsible for creating the left navigation's
		dynamic features.
*/

// global variable to hold the sub-menu that is currently open.
var open_menu = -1;
// function to show the selected menu's sub-menu.
function show_menu( i )
{
	// if the menu open is not the menu selected.
	if( open_menu != i )
	{
		// if a sub-menu is already open.
		if( open_menu != -1 )
		{
			// function to close the previously opened menu.
			close_menu();
		}
		// variables to hold the navigation table, new rows and cells.
		var menu_t, menu_r, menu_c;
		// variable to hold the sub-menu items.
		var sub_menu;
		// variable to hold the row number to insert.
		var r_num;
		// hold the navigation table.
		menu_t = document.getElementById( "nav_table" );
		// switch the link selected.
		switch( i )
		{
			// publications.
			/*case 0:
				sub_menu = "<table width='100%' cellpadding='0' cellspacing='0' border='0'>"
				sub_menu += "<tr>";
				sub_menu += "<td width='100%' style='padding-bottom: 10px;'>";
				sub_menu += "<a href='http://www.directinvesting.com/m_onl_pub.cfm' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>Moneypaper</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				sub_menu += "<tr>";
				sub_menu += "<td style='padding-bottom: 10px;'>";
				sub_menu += "<a href='http://www.directinvesting.com/d_onl_pub.cfm' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>DirectInvesting</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				sub_menu += "<tr>";
				sub_menu += "<td style='padding-bottom: 10px;'>";
				sub_menu += "<a href='http://www.directinvesting.com/bargain_stocks_index.cfm' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>Bargain Basement</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				sub_menu += "<tr>";
				sub_menu += "<td style='padding-bottom: 10px;'>";
				sub_menu += "<a href='http://www.directinvesting.com/invest_index.cfm' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>Invest%</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				sub_menu += "<tr>";
				sub_menu += "<td style='padding-bottom: 10px;'>";
				sub_menu += "<a href='http://www.directinvesting.com/group_membership/index.cfm' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>DRIP Club Membership</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				
				sub_menu += "<tr>";
				sub_menu += "<td>";
				sub_menu += "<a href='http://www.moneypaper.com/15bestdrips.pdf' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>15 Best DRIPs</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				
				sub_menu += "</table>";
				// set the row number of the new row.
				r_num = 1;

				break;*/
// drip enrollment.
			case 0:
			// insert the HTML of the sub-menu.
				sub_menu = "<table width='100%' cellpadding='0' cellspacing='0' border='0'>"
				sub_menu += "<tr>";
				sub_menu += "<td style='padding-bottom: 10px;'>";
				sub_menu += "<a href='http://www.directinvesting.com/check_enrollment_status.cfm' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>Check Your Recent Order</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				
				sub_menu += "<tr>";
				sub_menu += "<td width='100%' style='padding-bottom: 10px;'>";
				sub_menu += "<a href='https://www.directinvesting.com/securefiles/static/drip_enrollment_order_s.cfm' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>Order Form</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				sub_menu += "<tr>";
				sub_menu += "<td style='padding-bottom: 10px;'>";
				sub_menu += "<a href='http://www.directinvesting.com/printableenrollmentform.cfm' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>Printable Order Form</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				sub_menu += "<tr>";
				sub_menu += "<td style='padding-bottom: 10px;'>";
				sub_menu += "<a href='https://www.directinvesting.com/giftsofstock_secure/order_form_gift.cfm' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>Gift Order Form</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";	
				sub_menu += "<tr>";
				sub_menu += "<td style='padding-bottom: 10px;'>";
				sub_menu += "<a href='http://www.directinvesting.com/moneypaper/download/w9.pdf' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>W9 Form</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";					
				sub_menu += "<tr>";
				sub_menu += "<td style='padding-bottom: 10px;'>";
				sub_menu += "<a href='http://www.directinvesting.com/advanced_drip_search.cfm' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>Prices &amp; Dates</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				sub_menu += "<tr>";
				sub_menu += "<td>";
				sub_menu += "<a href='http://www.directinvesting.com/about_temper.cfm' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>About Temper</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				sub_menu += "</table>";
				// set the row number of the new row.
				r_num = 1;
				break;
			// managing.
			case 1:
			// insert the HTML of the sub-menu.
				sub_menu = "<table width='100%' cellpadding='0' cellspacing='0' border='0'>"
				sub_menu += "<tr>";
				sub_menu += "<td width='100%' style='padding-bottom: 10px;'>";
				sub_menu += "<a href='https://www.directinvesting.com/securefiles/portfoliokeeper_com/' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>PortfolioKeeper</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				sub_menu += "<tr>";
				sub_menu += "<td style='padding-bottom: 10px;'>";
				sub_menu += "<a href='https://www.directinvesting.com/securefiles/portfoliokeeper_com/guidesite_search.cfm?page=Guidesite_search' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>Next Investment Date</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				sub_menu += "<tr>";
				sub_menu += "<td>";
				sub_menu += "<a href='https://www.directinvesting.com/securefiles/portfoliokeeper_com/port/portII/port_menu_ii.cfm?page=port/portII/port_menu_ii' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>Manage Portfolio</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				sub_menu += "</table>";
				// set the row number of the new row.
				r_num = 2;
				break;
			// mutual fund.
			case 2:
				// insert the HTML of the sub-menu.
				sub_menu = "<table width='100%' cellpadding='0' cellspacing='0' border='0'>"
				sub_menu += "<tr>";
				sub_menu += "<td width='100%' style='padding-bottom: 10px;'>";
				sub_menu += "<a href='http://www.directinvesting.com/mp63fund_transferpage.cfm' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>MP63 Fund (DRIPX)</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				sub_menu += "<tr>";
				sub_menu += "<td style='padding-bottom: 10px;'>";
				sub_menu += "<a href='http://www.mutualss.com/site/AccountAccess.asp?fund=MP63&CB=Cust' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>Account Information</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				sub_menu += "<tr>";
				sub_menu += "<td>";
				sub_menu += "<a href='http://www.directinvesting.com/mp63fund_transferpage2.cfm' style='color: white; font-weight: bold; font-size: 10px;' onmouseover=this.style.textDecoration='underline' onmouseout=this.style.textDecoration='none'>Open an Account</a>";
				sub_menu += "</td>";
				sub_menu += "</tr>";
				sub_menu += "</table>";
				// set the row number of the new row.
				r_num = 3;
				break;
		}
		// create the new row.
		menu_r = menu_t.insertRow( r_num );
		// set the attributes of the new row.
		menu_r.bgColor = "1268AE";
		// create the new cell.
		menu_c = menu_r.insertCell( 0 );
		// set the attributes of the new cell.
		menu_c.style.paddingTop = "5px";
		menu_c.style.paddingBottom = "15px";
		menu_c.style.paddingLeft = "15px";
		menu_c.align = "left";
		menu_c.innerHTML = sub_menu;
		// set the open menu to the current selection.
		open_menu = i;
	}
}
// function to close the previously opened menu.
function close_menu()
{
	// variable to hold the navigation table.
	var menu_t = document.getElementById( "nav_table" );
	// close the open sub-menu.
	menu_t.deleteRow( open_menu + 1 );
}



