var current_menu = "";
var menu_stuck = false;

var Service_Pay_H2H = 8;
var Service_Pay_Cap = 7;
var Service_Playoff = 32;

var Commissioner_Only = 0;
var Full_Control = 1;
var Waiver_Wire_Only = 2;
var Waiver_Wire_Then_Full_Control = 3;

var No_Duplicate_Players = 0;
var Not_In_Same_Conference = 1;
var Any_Player_Any_Team = 2;

var Total_Points_Standings = 1;
var Both_Standings = 2;

function openDraftWindow(LN, UID) 
{
   var now = new Date();
   var URL = "/cgi-bin/display_draft_page?LN=" + LN + "&UID=" + UID + "&X=" + now.getTime();
   var windowName = "draftWindow_" + UID
	  
   var draftwin = window.open(URL, windowName, 'toolbar=0,location=0,directories=0,menubar=0,status=1,scrollbars=0,resizable=1,width=825,height=700,top=10,left=50');
}

function openChatWindow(LN, UID) 
{
   var URL = "/php/live-chat.php?LN=" + LN + "&UID=" + UID ;
   var windowName = "chatWindow_" + UID
   var chatwin = window.open(URL, windowName, 'toolbar=0,location=0,directories=0,menubar=0,status=1,scrollbars=1,resizable=1,width=616,height=408,top=0,left=0');
}

function openTeamWindow(TN, LN, UID, TEAM, TAB) 
{
   var now = new Date();
   if (TEAM == 0)
   {
	   TEAM = TN;
   }
   var URL = "/cgi-bin/display_team_rosters?LN=" + LN + "&UID=" + UID + "&TN=" + TN + "&Team=" + TEAM + "&X=" + now.getTime()
   var teamwin = window.open(URL, 'teamWindow', 'toolbar=0,location=0,directories=0,menubar=0,status=1,scrollbars=1,resizable=1,width=750,height=600,top=100,left=0');
}

function openPlayerWindow(LN, PN, SEASON, TAB) 
{
   var now = new Date();
   var URL = "/cgi-bin/display_player_summary?LN=" + LN + "&Player=" + PN + "&X=" + now.getTime()

   if (SEASON) {
      if (SEASON > 0) URL += "&SEASON=" + SEASON
   }   
   if (TAB) URL += "&TAB=" + TAB

   var playerwin = window.open(URL, 'playerWindow', 'toolbar=0,location=0,directories=0,menubar=0,status=1,scrollbars=1,resizable=1,width=600,height=630,top=50,left=150');
}

function openNFLWindow(LN, UID, TEAM, SEASON) 
{
   var now = new Date();
   var URL = "/cgi-bin/nfl_results?LN=" + LN + "&UID=" + UID + "&NT=" + TEAM + "&Season=" + SEASON + "&X=" + now.getTime()

   var nflwin = window.open(URL, 'nflWindow', 'toolbar=0,location=0,directories=0,menubar=0,status=1,scrollbars=1,resizable=1,width=400,height=390,top=16,left=0');
}

function openFAQWindow(searchStr)
{

	var URL = "http://faq.rtsports.com/faq/index.php";

	if (searchStr != "") {
		//If the searchStr is an integer, assume it points to a particular 4 digit Solution_Id
		var regexInt = /^\-?[0-9]{1,10}$/;
		if (regexInt.test(searchStr) && searchStr.length==4 )
			args = "?solution_id=" + searchStr;
		else
			args = "?action=search&search=" + searchStr;

		URL += args;
	}

	var faqwin = window.open(URL, 'faqWindow', 'toolbar=0,location=0,directories=0,menubar=0,status=1,scrollbars=1,resizable=1,width=855,height=600,top=0,left=0');

}

function demoWin() {
   window.name="rtfs";
   window.open('http://www.rtsports.com/htm/demo.html','demo','width=700,height=400,toolbar=no,location=no,scrollbars=no,directories=no,resizable=no,menubar=no');
}

function LogOut()
{
   var date = new Date();
	date.setTime(date.getTime()-(86400*1000)); // yesterday
	document.cookie = "REALTIME=LoggedOut; path=/; domain=.rtsports.com;  expires=" + date.toGMTString() + ";"
	document.cookie = "RTFF=LoggedOut; path=/; domain=.rtsports.com;  expires=" + date.toGMTString() + ";"
	document.cookie = "RTFR=LoggedOut; path=/; domain=.rtsports.com;  expires=" + date.toGMTString() + ";"


   //
   //  This is old get rid of it soon
   //
	var prefixL = "RTFS_ID_";
	var prefixP = "RTFS_PID_";
	var ca = document.cookie.split(';');
	for(var i=0; i < ca.length; i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length); // trim the front of the string
		if (c.indexOf(prefixL) == 0 || c.indexOf(prefixP) == 0 ) { // is a league cookie or personal account cookie
         var name = c.split('=');
      	document.cookie = name[0] + "=LoggedOut; path=/; domain=.rtsports.com; expires=" + date.toGMTString() + ";"
      }
	}
	window.location = 'http://www.rtsports.com';
}



function showSubMenu(submenuName)
{

       if ( menu_stuck ) return;

	parentElement			= document.getElementById(submenuName + 'Parent');
	anchorElement			= document.getElementById(submenuName + 'Anchor');
	parentElement.className = "MainTabOn";
	anchorElement.className = "MainTabOn";
	

	if (current_menu != submenuName)
	{
		// First hide the old menu and display the new one.
		if (current_menu != "")
		{
			oldMenu                  = document.getElementById(current_menu);
			oldMenuParent            = document.getElementById(current_menu + 'Parent');
			oldMenuAnchor            = document.getElementById(current_menu + 'Anchor');
			oldMenu.style.visibility = 'hidden';
			oldMenuParent.className  = "MainTabOff";
			oldMenuAnchor.className  = "MainTabOff";
		}
		newMenu					 = document.getElementById(submenuName);
		newMenu.style.visibility = 'visible';
		current_menu			 = submenuName;
	}
}




function checkPlayer()
{
	if (document.mainForm.LASTFRAG.value.length == 0)
	{
		document.mainForm.LASTFRAG.select();
		alert("Please enter part or all of the player's last name.");
		return;
	}
	document.mainForm.submit();
}


function Pay_League(ServiceType)
{
   if (ServiceType == Service_Pay_H2H || ServiceType == Service_Pay_Cap) {
      return true;
   } else {
      return false;
   }
}

function MenuHeader(LN,UID,DateStr)
{
	//document.write('<!-- Top Banner table  -->')
	document.write('<table width=769 border=0 cellpadding=0 cellspacing=0>');
	document.write('<TR>');
	document.write('<TD ROWSPAN=3>');
	document.write('<a href="http://www.rtsports.com"><IMG SRC="http://www.rtsports.com/img/RTSports_logo.gif" WIDTH=139 HEIGHT=72 alt="RealTime Fantasy Sports" border=0></a></TD>');
	document.write('<TD BGCOLOR=#333333>');
	document.write('<IMG SRC="http://www.rtsports.com/img/top_circles1.gif" WIDTH=154 HEIGHT=18></TD>');
	document.write('<TD ALIGN=left VALIGN=top BGCOLOR=#333333>');
	document.write('   <table height=18 width=100% BORDER=0 CELLPADDING=0 CELLSPACING=0>');
	document.write('   <TR>');
	document.write('   <TD ID=TopCurrDate valign=middle class=date>' + DateStr + '</TD>');
	document.write('   <TD align=right valign=middle class=playerSearchText>');
	document.write('      <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>');
	document.write('      <FORM NAME="mainForm" METHOD=POST ACTION=/php/find-player.php>');
	document.write('      <INPUT TYPE=HIDDEN NAME=LN VALUE=' + LN + '>');
	document.write('      <INPUT TYPE=HIDDEN NAME=UID VALUE="' + UID + '">');
	document.write('      <TR>');
	document.write('      <TD valign=middle class=playerSearchText>player search:&nbsp;</TD>');
	document.write('      <TD valign=middle class="frmFieldPlayerSearch"><INPUT style="height:12px" type="text" class="frmFieldPlayerSearch" name="LASTFRAG" size=20>&nbsp;</TD>');
	document.write('      <TD valign=top><IMG SRC="http://www.rtsports.com/img/but_player_search.gif" WIDTH=48 HEIGHT=11 border=0 hspace=5 vspace=3 onClick="checkPlayer()"></TD></TR>');
	document.write('      </FORM>');
	document.write('      </table></TD>');
	document.write('   <TD align=right valign=bottom><IMG SRC="http://www.rtsports.com/img/topbar_curve.gif" WIDTH=10 HEIGHT=18></TD>');
	document.write('   </table>');
	document.write('</TD>');
	document.write('</TR>');
	document.write('<TR>');
	document.write('<TD BGCOLOR=#000000>');
	document.write('<IMG SRC="http://www.rtsports.com/img/top_circles2.gif" WIDTH=154 HEIGHT=16></TD>');
	document.write('<TD BGCOLOR=#000000>');
	document.write('<IMG SRC="http://www.rtsports.com/img/spacer.gif" WIDTH=476 HEIGHT=1></TD>');
	document.write('</TR>');
	document.write('<TR>');
	document.write('<TD COLSPAN=2 align=left valign=bottom>');
	//document.write('   <!-- Navigation Table -->');
	document.write('   <TABLE WIDTH=630 BORDER=0 CELLPADDING=0 CELLSPACING=0>');
	document.write('   <TR>');
	document.write('   <TD ROWSPAN=4 BGCOLOR=#336699>');
	document.write('   <IMG SRC="http://www.rtsports.com/img/nav_left.gif" WIDTH=7 HEIGHT=38></TD>');
	document.write('   <TD ROWSPAN=2 BGCOLOR=#336699>');
	document.write('   <IMG SRC="http://www.rtsports.com/img/nav_main_background.gif" WIDTH=1 HEIGHT=19></TD>');
	document.write('   <TD BGCOLOR=#336699>');
	document.write('   <IMG SRC="http://www.rtsports.com/img/spacer.gif" WIDTH=598 HEIGHT=1></TD>');
	document.write('   <TD ROWSPAN=4>');
	document.write('   <IMG SRC="http://www.rtsports.com/img/nav_right.gif" WIDTH=7 HEIGHT=38></TD>');
	document.write('   <TD ROWSPAN=4>');
	document.write('   <IMG SRC="http://www.rtsports.com/img/spacer.gif" WIDTH=17 HEIGHT=1></TD>');
	document.write('   </TR>');
	document.write('   <TR>');
	document.write('   <TD WIDTH=598 HEIGHT=18 ALIGN=left VALIGN=middle BGCOLOR=#336699 background="http://www.rtsports.com/img/nav_main_background2.gif">');
	document.write('      <TABLE BORDER=0 HEIGHT=18 CELLPADDING=0 CELLSPACING=0>');
	document.write('      <TR>');
}

function MenuTransition()
{
   document.write('</tr></table></td></tr>');
	document.write('<tr><td bgcolor=#336699><img src="http://www.rtsports.com/img/spacer.gif" width=1 height=1></td>');
	document.write('<td bgcolor=#336699><img src="http://www.rtsports.com/img/spacer.gif" width=598 height=1></td></tr>');
	document.write('<tr><td bgcolor=#000000><img src="http://www.rtsports.com/img/spacer.gif" width=1 height=18></td>')
	document.write('<td width=598 height=18 align=left valign=middle class=SubTabOff>')
}

function MenuFooter()
{
	document.write('</td></tr></table>');
	//document.write('<!-- End Navigation Table -->')
	document.write('</td></tr>');
	document.write('<tr><td colspan=3><img src="http://www.rtsports.com/img/top_border.gif" width=769 height=19></td></tr>');
	document.write('</table>');
	//document.write('<!-- End Top Banner table  -->')
}

function AddMenu(ID,Display)
{
   if (typeof Display == "undefined") Display = ID;
   document.write('<td><img src="http://www.rtsports.com/img/black_pixel.gif" width=1 height=18></td>');
   document.write('<td id="' + ID + 'Parent" class=MainTabOff onmouseover="showSubMenu(&quot;' + ID + '&quot;)">&nbsp;&nbsp;<a ID="' + ID + 'Anchor" href="javascript:stickSubMenu(&quot;' + ID + '&quot;)" class=MainTabOff nowrap>' + Display + ' </a>&nbsp;</td>');   
}

function AddSubMenu(ID,Links,Top)
{
   if (typeof Display == "undefined") Top = '55';   
	document.write('<div id=' + ID + ' style="position:absolute; top:' + Top + 'px; left:148px; width:598px; height:18px; visibility:hidden">');
	document.write('<table border=0 cellpadding=0 cellspacing=0>');
	document.write('<tr><td width=598 height=18 align=left valign=middle class=SubTabOff>&nbsp;&nbsp;');
   document.write(Links);
	document.write('</td></tr></table></div>');
}




function displayMenu(LN, UID, loginTN, loginCN, 
                     viewWeek, curDateString, ServiceType, NOTUSED, 
					 globalLink1, globalURL1, globalLink2, globalURL2, 
					 Link1, URL1, Link2, URL2, 
					 Guest, Commissioner, setupComplete, viewPicks, 
					 StandingsBasis, duplicatePlayers, firstYear, playoffLeague, 
					 SLPrivs, transPrivs, useIR, currentFFLWeek, currentNFLWeek,
					 commissionerTrades, liveDraft, leagueFees, salaryCap, wwOrder, PFAdays, 
                useContracts, isDraftMasters, groupID)
{
	var first;
	var menu = '';
	var now = new Date();
	var URL_ID = "LN=" + LN + "&UID=" + UID + "&X=" + now.getTime();


   MenuHeader(LN,UID,curDateString);


   //
   // Put together the main menu
   //
	if ((Link1.length > 0 || Link2.length > 0 || globalLink1.length > 0 || globalLink2.length > 0) && !Guest) AddMenu('MyLinks','My Links');

   AddMenu('League');

	if (Commissioner) AddMenu('Commissioner');

   if (!Guest && (setupComplete || !Commissioner)) AddMenu('Team',(Commissioner ? 'Teams' : 'Team'));

	if (setupComplete) AddMenu('Reports');

   AddMenu('Talk');

   AddMenu('NFL');

	if (!Guest && viewPicks) AddMenu('Picks','NFL Picks');		
	
   AddMenu('RTSports');


   if (document.cookie.search(/REALTIME/) != -1)
   {
      document.write('      <TD><IMG SRC="http://www.rtsports.com/img/black_pixel.gif" WIDTH=1 HEIGHT=18></TD>');
      document.write('      <TD ID="MyAccountParentSpacer" class=MainTabOff></td>');
      document.write('      <TD ID="MyAccountParent" class=MainTabOff onmouseover="showSubMenu(&quot;MyAccount&quot;)"><div ID=MyAccountParentDisplay STYLE="visibility:hidden">&nbsp;&nbsp;<a ID="MyAccountAnchor" href="javascript:stickSubMenu(&quot;MyAccount&quot;)" class=MainTabOff>My Account</A>&nbsp;&nbsp;</div></td>');
   } else {
      document.write('      <TD><IMG SRC="http://www.rtsports.com/img/black_pixel.gif" WIDTH=1 HEIGHT=18></TD>');
   }


   MenuTransition();
	

	//
	//  My Link Submenu
	//
   menu = '';
	first = true;
	if (globalLink1.length > 0) {
		menu += (first ? '' : '  |  ') + '<a target="_blank" href="' + globalURL1 + '" class=SubTabOff>' + globalLink1 + '</A>'
		first = false;
	}
	if (globalLink2.length > 0) {
		menu += (first ? '' : '  |  ') + '<a target="_blank" href="' + globalURL2 + '" class=SubTabOff>' + globalLink2 + '</A>'
		first = false;
	}
	if (Link1.length > 0) {
		menu += (first ? '' : '  |  ') + '<a target="_blank" href="' + URL1 + '" class=SubTabOff>' + Link1 + '</A>'
		first = false;
	}
	if (Link2.length > 0) {
		menu += (first ? '' : '  |  ') + '<a target="_blank" href="' + URL2 + '" class=SubTabOff>' + Link2 + '</A>'
   }
   if (menu.length > 0) AddSubMenu('MyLinks',menu);


	//
	//  Commissioner Submenu
	//				   
   menu = '<a href="/cgi-bin/league_wizard?' + URL_ID + '&Page=1" class=SubTabOff>Manage League</A>';

	if (leagueFees && setupComplete)
		menu += ' | <a href="/cgi-bin/team_fees?' + URL_ID + '" class=SubTabOff>Fees</A>';

	if (wwOrder == 2 && setupComplete)
		menu += ' | <a href="/cgi-bin/setup_waiver_order?' + URL_ID + '" class=SubTabOff>Waiver Order</A>';

	if (wwOrder == 4 && setupComplete)
		menu += ' | <a href="/php/edit-waiver-cap.php?' + URL_ID + '" class=SubTabOff>Waiver Cap</A>';

	if (salaryCap && setupComplete)
		menu += ' | <a href="/php/edit-salary-cap-money.php?' + URL_ID + '" class=SubTabOff>Salary Cap</A>';

	if (PFAdays > 0 && setupComplete)
		menu += ' | <a href="/cgi-bin/protected_free_agents?' + URL_ID + '" class=SubTabOff>Prot FAs</A>';

	if (useContracts && setupComplete)
		menu += ' | <a href="/cgi-bin/player_contracts?' + URL_ID + '" class=SubTabOff>Contracts</A>';

	if (setupComplete)
		menu += ' | <a href="/cgi-bin/guest_access?' + URL_ID + '" class=SubTabOff>Guests</A>';

	menu += ' |  <a href="/cgi-bin/modify_commissioner_data?' + URL_ID + '" class=SubTabOff>Info</A>';

   AddSubMenu('Commissioner',menu);

	//
	//  League Submenu
	//
	menu = '<a href="/cgi-bin/welcome_page?' + URL_ID + '" class=SubTabOff>Home</A>';

	if (setupComplete) {

		menu += ' | <a href="/cgi-bin/' + (StandingsBasis == Total_Points_Standings ? 'leaderboard' : 'scoreboard') +
 			     '?TN=' + loginTN + "&" + URL_ID + "&Week=" + viewWeek + '" class=SubTabOff>Scoreboard</A>';

		menu += ' | <a href="/cgi-bin/' + (StandingsBasis == Total_Points_Standings ? 'display_team_standings' : 'display_standings') +
				  '?TN=' + loginTN + "&" + URL_ID + '" class=SubTabOff>Standings</A>';

      if (StandingsBasis == Both_Standings)
         menu += ' | <a href="/cgi-bin/display_team_standings?TN=' + loginTN + "&" + URL_ID + '" class=SubTabOff>Total Pts</A>';

      if (StandingsBasis == Total_Points_Standings) {
         menu += ' | <a href="/cgi-bin/display_points_results?' + URL_ID + '" class=SubTabOff>Weekly</A>';

         if (groupID > 0){
            menu += ' | <a href="/php/group-standings.php?TN=' + loginTN + "&" + URL_ID + '&GID=' + groupID + '" class=SubTabOff>Overall</A>';
         }

      } else {
			menu += ' | <a href="/cgi-bin/display_schedule?' + URL_ID + '" class=SubTabOff>Schedule</A>';
      }

		menu += ' | <a href="/cgi-bin/display_rules?' + URL_ID + '" class=SubTabOff>Rules</A>';
	}

	menu += ' | <a href="/php/view-league-news-article.php?' + URL_ID + '" class=SubTabOff>News</A>';

   if (!Pay_League(ServiceType) ) 
      menu += ' | <a href="/php/view-poll-results.php?' + URL_ID + '" class=SubTabOff>Polls</A>';

   if (duplicatePlayers != Any_Player_Any_Team && liveDraft)
      menu += ' | <a href="javascript:openDraftWindow(' + LN + ', &quot;' + UID + '&quot;)" class=SubTabOff>Draft</A>';

   if (firstYear <= 2007 && !playoffLeague && !Pay_League(ServiceType))
      menu += ' | <a href="/php/archives.php?' + URL_ID + '" class=SubTabOff>Archive</A>';

   if (!Guest && !Pay_League(ServiceType))
      menu +=  ' | <a href="/cgi-bin/service_payment?' + URL_ID + '" class=SubTabOff>Payment</A>';

   AddSubMenu('League',menu);
					

	//
	//  Team Submenu
	//
	menu = '<a href="javascript:openTeamWindow(' + loginTN + ", " + LN + ', &quot;' + UID + '&quot;,' + loginTN + ')" class=SubTabOff>Capsules</A>';

	if (setupComplete) {

		if (Commissioner || SLPrivs)
			menu += ' | <a href="/cgi-bin/starting_lineups?' + URL_ID + '" class=SubTabOff>Lineup' + (Commissioner ?  's' : '') + '</A>';

		if (Commissioner || transPrivs == Full_Control || transPrivs == Waiver_Wire_Then_Full_Control)
			menu += ' | <a href="/cgi-bin/modify_roster?' + URL_ID + '" class=SubTabOff>Add/Drop</A>';
		
		if (!Commissioner && transPrivs == Waiver_Wire_Only) {
         if (useIR) {
   			menu += ' | <a href="/cgi-bin/modify_roster?' + URL_ID + '" class=SubTabOff>Drop/IR</A>';
         } else {
   			menu += ' | <a href="/cgi-bin/modify_roster?' + URL_ID + '" class=SubTabOff>Drops</A>';
         }
      }

		if (transPrivs == Waiver_Wire_Then_Full_Control ||	transPrivs == Waiver_Wire_Only)
			menu += ' | <a href="/cgi-bin/waiver_wire_wish_list?' + URL_ID + '" class=SubTabOff>Waiver Wire</A>';

		if (duplicatePlayers != Any_Player_Any_Team && (Commissioner || !commissionerTrades))
			menu += ' | <a href="/cgi-bin/trades?' + URL_ID + '" class=SubTabOff>Trades</A>';

		if (duplicatePlayers != Any_Player_Any_Team && !commissionerTrades)
			menu += ' | <a href="/cgi-bin/trade_block?' + URL_ID + '" class=SubTabOff>Trade Block</A>';

		if (liveDraft)
		   menu += ' | <a href="/cgi-bin/draft_list?' + URL_ID + '" class=SubTabOff>Draft Cheatsheet' + (Commissioner ? 's' : '') + '</A>';
	}

    menu += ' | <a href="/php/owner-preferences.php?' + URL_ID + '" class=SubTabOff>Prefs</A>';
              
	menu += ' | <a href="/cgi-bin/modify_team?' + URL_ID + '" class=SubTabOff>' + 'Info</A>';

   AddSubMenu('Team',menu);


	//  
	//  Reports Submenu
	//
	menu = '<a href="/cgi-bin/display_rosters?TN=' + loginTN + '&' + URL_ID + '" class=SubTabOff>Rosters</A>';
   menu += ' | <a href="/cgi-bin/display_lineup_changes?' + URL_ID + '" class=SubTabOff>Lineup Changes</A>';
   menu += ' | <a href="/cgi-bin/display_transactions?' + URL_ID + '" class=SubTabOff>Transactions</A>';
   if (leagueFees)
	   menu += ' | <a href="/cgi-bin/display_league_fee_summary?' + URL_ID + '" class=SubTabOff>Fees</A>';

   if (duplicatePlayers != Any_Player_Any_Team && (transPrivs == Waiver_Wire_Only || transPrivs == Waiver_Wire_Then_Full_Control))
      menu += ' | <a href="/cgi-bin/display_waiver_order?' + URL_ID + '" class=SubTabOff>Waiver Wire</A>';

	menu += ' | <a href="/cgi-bin/display_top_players?' + URL_ID + '&TN=' + loginTN + '&Conf=' +
		          (Commissioner || duplicatePlayers != Not_In_Same_Conference ? '0' : loginCN) + '" class=SubTabOff>Top Players</A>';

   if (ServiceType != Service_Playoff) 
      menu += ' | <a href="/cgi-bin/fantasy_nfl_rank?' + URL_ID + '&TN=' + loginTN + '&Conf=' +
		          (Commissioner || duplicatePlayers != Not_In_Same_Conference ? '0' : loginCN) + '" class=SubTabOff>Fantasy Defenses</A>';
	
   AddSubMenu('Reports',menu);


	//
	//  Talk Submenu
	//
   menu = '<a href="/cgi-bin/message_board?' + URL_ID + '" class=SubTabOff>Message Board</A>';

   if (!Pay_League(ServiceType))
      menu += ' | <a href="/cgi-bin/commishs_notepad?' + URL_ID + '" class=SubTabOff>From Commish</A>';

   if (!Guest) {
      menu += ' | <a href="javascript:openChatWindow(' + LN + ', &quot;' + UID + '&quot;)" class=SubTabOff>RealTime Chat</A>';
      menu += ' | <a href="/php/send_email.php?' + URL_ID + '" class=SubTabOff>Send E-Mail</A>';
   }
   menu += ' | <a target=forums href=http://www.rtsports.com/forums class=SubTabOff>Forums</A>';
   AddSubMenu('Talk',menu);


	//
	//  NFL Picks Submenu
	//
   menu = '<a href="/cgi-bin/make_weekly_picks?' + URL_ID + '" class=SubTabOff>Make Picks</A>';
	menu += ' | <a href="/cgi-bin/weekly_picks_summary?' + URL_ID + '" class=SubTabOff>Results</A>';
   menu += ' | <a href="/cgi-bin/weekly_picks_standings?' + URL_ID + '" class=SubTabOff>Standings</A>';
   AddSubMenu('Picks',menu);


   //
	//  NFL Info Submenu
   //
   menu = '<a href="/php/nfl-content.php?' + URL_ID + '&ITEM=1" class=SubTabOff>News</A>';
   menu += ' | <a href="/php/nfl-content.php?' + URL_ID + '&ITEM=2&NFL_WEEK=' + currentNFLWeek + '" class=SubTabOff>Scores</A>';
	menu += ' | <a href="/php/nfl-content.php?' + URL_ID + '&ITEM=3" class=SubTabOff>Standings</A>';
   menu += ' | <a href="/php/nfl_schedules.php?' + URL_ID + '&NFL_WEEK=' + currentNFLWeek + '" class=SubTabOff>Schedules</A>';
   menu += ' | <a href="/php/nfl-content.php?' + URL_ID + '&ITEM=4" class=SubTabOff>Transactions</A>';
	menu += ' | <a href="/php/nfl-content.php?' + URL_ID + '&ITEM=7" class=SubTabOff>Depth Charts</A>';
	menu += ' | <a href="/cgi-bin/Injury_Report?' + URL_ID + '" class=SubTabOff>Injury Report</A>';
   if (duplicatePlayers == No_Duplicate_Players)
   {
		menu += ' | <a href="/cgi-bin/playertrack?TN=' + loginTN + "&" + URL_ID + "&FFL=" + viewWeek + '" class=SubTabOff>Player Track</A>';
   }
   AddSubMenu('NFL',menu);


	//
	//  RTSports Submenu
	//
	menu = '<a href="/php/merchandise.php?' + URL_ID + '" class=SubTabOff>Merchandise</A>';
   menu += ' | <a href="/php/alerts-archive.php?' + URL_ID + '" class=SubTabOff>Alerts</A>';
   menu += ' | <a href="javascript:openFAQWindow(' + "''" + ');" class=SubTabOff>FAQ</A>';
	menu += ' | <a href="/php/notes.php?' + URL_ID + '" class=SubTabOff>Notes From Us</A>';
   menu += ' | <a href="/php/support_request.php?' + URL_ID + '" class=SubTabOff>Contact Us</A>';
   AddSubMenu('RTSports',menu);


	//
	//  My Account Submenu
	//
	document.write('<div ID=MyAccount style="position:absolute; top:55px; left:148px; width:598px; height:18px;  visibility:hidden">');
	document.write('<table border=0 cellpadding=0 cellspacing=0>');
	document.write('<tr><td id="MyAccountSubmenuSpacer" height=18 align=left valign=middle class=SubTabOff></td>');
	document.write('<td id="MyAccountSubmenu" height=18 align=left valign=middle class=SubTabOff>');
   document.write('<a href="javascript:LogOut()" class=SubTabOff>Log Out</a>');
	document.write(' | <a href="/php/modify-personal-account.php" class=SubTabOff>My Info</a>');
	document.write(' | <a href="/php/fantasy-football.php" class=SubTabOff>Home</a>&nbsp;&nbsp;');
	document.write('</td></tr></table></div>');

   MenuFooter();

	UpdateMenu();
}


function stickSubMenu(menuName) {
  var p_current_menu;
  if ( menu_stuck ) {
     menu_stuck = false;
     p_current_menu = current_menu;
     showSubMenu(menuName);
     if (p_current_menu != menuName) menu_stuck = true;
  }else
     menu_stuck = true;
  
  return;
}

function UpdateMenu() {

	var menu_width = 0;
	var sub_menu_width = 0;

    if (document.getElementById("MyLinksParent"))
		menu_width += document.getElementById("MyLinksParent").offsetWidth + 1;

    if (document.getElementById("CommissionerParent"))
		menu_width += document.getElementById("CommissionerParent").offsetWidth + 1;

	if (document.getElementById("LeagueParent"))
		menu_width += document.getElementById("LeagueParent").offsetWidth + 1;

	if (document.getElementById("TeamParent"))
		menu_width += document.getElementById("TeamParent").offsetWidth + 1;

	if (document.getElementById("ReportsParent"))
		menu_width += document.getElementById("ReportsParent").offsetWidth + 1;

	if (document.getElementById("TalkParent"))
		menu_width += document.getElementById("TalkParent").offsetWidth + 1;

	if (document.getElementById("NFLParent"))
		menu_width += document.getElementById("NFLParent").offsetWidth + 1;

	if (document.getElementById("PicksParent"))
		menu_width += document.getElementById("PicksParent").offsetWidth + 1;

	if (document.getElementById("RTSportsParent"))
		menu_width += document.getElementById("RTSportsParent").offsetWidth + 1;

	if (document.getElementById("MyAccountParent")) {
		menu_width += document.getElementById("MyAccountParent").offsetWidth + 1;
		spacer = 598 - menu_width;
		document.getElementById("MyAccountParentSpacer").width = spacer;
		document.getElementById("MyAccountParentDisplay").style.visibility = "visible";

		sub_menu_width = document.getElementById("MyAccountSubmenu").offsetWidth;
		spacer = 598 - sub_menu_width;
		document.getElementById("MyAccountSubmenuSpacer").width = spacer;
	}

}

 		