document.domain = 'liverpoolfc.tv';

var tmrHide = new Array();
var rgMenus = new Array();
if ( navigator.appName.toLowerCase().indexOf('explorer') != -1 && navigator.userAgent.toLowerCase().indexOf('mac') != -1 ) var undefined="undefined";
/******************************************************************
*  LFCMenu : The top-level menu object (news, mobile, etc.)       *
*                                                                 *
*  Parameters:                                                    *
*  name - The top level drop-down menu title                      *
*  x    - The x co-ordinate of this drop-down                     *
*         (0 being the left-most point of the horizontal menu-bar *
*  est  - Boolean representing whether this drop-down consists    *
*         of e-Season items                                       *
*                                                                 *
*  Functions:                                                     *
*  addItem - Adds an LFCMenuItem to the drop-down list            *
*  create  - Generates the HTML for this menu                     *
*  show    - Displays the drop-down list on-screen                *
*  hide    - Hides the drop-down list from view                   *
*                                                                 *
******************************************************************/
function LFCMenu(name,x, est)
{
  this.x=x;
  this.id = rgMenus.length;
  this.name = name;
  this.eSeason = (est == null ? false : est);
  this.items = new Array();
  this.activeMenu = false;
  this.activeItem = false;
  this.addItem = function()
  {
    this.items[this.items.length] = new LFCMenuItem(this,arguments[0],arguments[1],this.items.length,arguments[2]);
  };
  this.create = function()
  {
    document.writeln('<div id="'+this.name+'" style="position:absolute;visibility:hidden;height:1px;z-index:5">');
	if (this.eSeason == true){
    		document.writeln('<table style="border-top:solid 1px;border-right:solid 2px;border-left:solid 2px;border-bottom:solid 2px;border-color:#ffffff;background-image: url(/nc_images/general/estcbirdbak.gif)" cellspacing=0 cellpadding=2>\n');
	}else{
		document.writeln('<table style="border-top:solid 1px;border-right:solid 2px;border-left:solid 2px;border-bottom:solid 2px;border-color:#ffffff" cellspacing=0 cellpadding=2>\n');
	}
    for ( i = 0; i < this.items.length; i++ )
        document.writeln('<tr>'+this.items[i].getHTML()+'</tr>');
    document.writeln('</table>');
    document.writeln('</div>');
  };
  this.show = function()
  {
    if ( document.all )
    {
      table = document.all['menutable'];
      bar = document.all['menubar'];
      menu = document.all[this.name];
      tableLeft = table.offsetLeft;
      lmargin = 3;
    }
    else if ( document.getElementById )
    {
      table = document.getElementById('menutable');
      bar = document.getElementById('menubar');
      menu = document.getElementById(this.name);
      tableLeft = (window.innerWidth - table.width) / 2;
      lmargin = 11;
    }
    if ( this.eSeason == true )
      menu.style.left = (tableLeft+bar.offsetLeft+this.x-menu.offsetWidth-lmargin)+"px";
    else
      menu.style.left = (tableLeft+bar.offsetLeft+this.x-lmargin)+"px";
    menu.style.top = (table.offsetHeight-4)+"px";
    this.activeMenu = true;
    menu.style.visibility = 'visible';
    for ( i = 0; i < rgMenus.length; i++ )
    {
      if ( rgMenus[i].id != this.id )
        rgMenus[i].hide(true,true);
    }
  };
  this.hide = function(active,hideItems)
  {
    if ( document.all )
      menu = document.all[this.name];
    else if ( document.getElementById )
      menu = document.getElementById(this.name);
    
    if ( active == null )
    {
      this.activeMenu = false;
      if ( !tmrHide[this.id] )
        tmrHide[this.id] = setInterval(this.name+".hide(true)",500);
      return ;
    }
    if ( hideItems != null )
      this.activeItem == false;
    if ( this.activeMenu == false && this.activeItem == false )
    {
      menu.style.visibility = 'hidden';
      if ( tmrHide[this.id] )
      {
        clearInterval(tmrHide[this.id]);
        tmrHide[this.id] = null;
      }
      return ;
    }
    if ( !tmrHide[this.id] )
      tmrHide[this.id] = setInterval(this.name+".hide(true)",500);
  };
  rgMenus[rgMenus.length] = this;
}
/******************************************************************
*  LFCMenuItem : The links underneath each top-level menu         *
*                                                                 *
*  Parameters:                                                    *
*  owner  - The top-level menu to which this belongs              *
*  name   - The link title                                        *
*  url    - The URL for this item                                 *
*  pos    - The item's position within the drop-down list         *
*                                                                 *
*  Optional Parameters:                                           *
*  win    - If the link is to open in a new pop-up window this is *
*           the window's associated name                          *
*           If "_blank" is supplied, use default parameters,      *
*           unless some are supplied                              *
*  params - If the link is to open in a new pop-up window these   *
*           are the parameters for that window                    *
*                                                                 *
*  Functions:                                                     *
*  getHTML - Produces the HTML for this link                      *
*                                                                 *
******************************************************************/
function LFCMenuItem(owner,name, url, pos, win, params)
{
  this.owner = owner;
  this.name = name;
  this.url = url;
  this.pos = pos;
  this.css = "menu";
  this.win = win;
  this.params = params;
  if ( this.params == null )
  {
    if( this.name == "LFC TV ") 
      this.params = ",'width=772,height=680,scrollbars=no'";
    else if ( this.win == "_blank" )
      this.params = ",'menubar=yes,resizable=yes,scrollbars=yes,location=yes,status=yes,toolbar=yes'";
    else
      this.params = "";
  }
  if ( this.owner.eSeason )
  {
    this.css = "est";
    if ( this.win != "this" )
    {
      this.win = "console";
      this.params = ",'width=778,height=548,scrollbars=no'";
    }
  }
  if ( this.win == "this" )
    this.win = null;
  this.getHTML = function()
  {
    if ( this.win != null )
	{
      return '<td id="menu'+this.owner.id+'-'+this.pos+'" class="'+this.css+'Out" onMouseOver="this.className=\''+this.css+'Over\';'+this.owner.name+'.activeItem=true;" onMouseOut="this.className=\''+this.css+'Out\';'+this.owner.name+'.activeItem=false;" onMouseUp="window.open(\''+this.url+'\',\''+this.win+'\''+this.params+');"><div class="menuLink">'+this.name+'</div></td>\n';
	}
	  else if( this.name == "LFC TV")
	  {
      return '<td id="menu'+this.owner.id+'-'+this.pos+'" class="'+this.css+'Out" onMouseOver="this.className=\''+this.css+'Over\';'+this.owner.name+'.activeItem=true;" onMouseOut="this.className=\''+this.css+'Out\';'+this.owner.name+'.activeItem=false;" onMouseUp="window.open(\''+this.url+'\',\''+this.win+'\''+this.params+');"><div class="menuLink"><img src=/nimages/tv-navlogo-colour.jpg width=145 height=18></div></td>\n';
	  }
    else
      return '<td id="menu'+this.owner.id+'-'+this.pos+'" class="'+this.css+'Out" onMouseOver="this.className=\''+this.css+'Over\';'+this.owner.name+'.activeItem=true;" onMouseOut="this.className=\''+this.css+'Out\';'+this.owner.name+'.activeItem=false;" onMouseUp="location.href=\''+this.url+'\';"><div class="menuLink">'+this.name+'</div></td>\n';
  }
if ( this.win=="stats" ){
 this.params = ",'scrollbars=yes,width=660,height=655'";
    }
}
function initMenuBar()
{
  //document.writeln('<a href="javascript:;" onclick="window.open(\'/estc2/premium/index.php3?channel_id=8\',\'new\',\'width=778,height=548\');"><img id="estlink" src="/nimages/neseasonlink.gif" width=45 height=57 style="border:0px;position:absolute;text-align:right;z-index:12;visibility:hidden" align=left></a>');
  document.writeln('<a href="/eseason/"><img id="estlink" src="/nimages/neseasonlink.gif" width=45 height=57 style="border:0px;position:absolute;text-align:right;z-index:12;visibility:hidden" align=left></a>');
  menuNews = new LFCMenu("menuNews",2);
  menuNews.addItem("Latest News","/news/");
  menuNews.addItem("LFC TV ","/tv/?ncid=navtvmini010408", "_blank");
  menuNews.addItem("Features","/news/features/");
  menuNews.addItem("Celebrity Kop Club","/kopclub/");
  menuNews.addItem("LFC Media Watch","/mediawatch/");
  menuNews.addItem("LFC.tv Columns","/news/columns/");
  menuNews.addItem("SuperLeague Formula","/superleague/");
  menuNews.addItem("Views From The Kop","/news/kop_views/");
  menuNews.addItem("New Stadium","/newstadium/");
  menuNews.addItem("News Archive","/news/archivedirs/");
  menuNews.create();
  menuMatch = new LFCMenu("menuMatch",40);
  menuMatch.addItem("Fixtures &amp; Results","/match/season/");
  menuMatch.addItem("Last Match Stats","/match/last_match/");
  menuMatch.addItem("Final Whistle Report","/match/last_match/match_report/");
  menuMatch.addItem("Official Match Analysis","/match/last_match/match_analysis/");
  menuMatch.addItem("Official LFC Teamsheets","/match/teamsheets/","this");
  menuMatch.addItem("League Tables","/match/season/tables/");
  menuMatch.addItem("Next Match","/match/next/");
  menuMatch.addItem("Barclays Premier League Match Stats","http://stats.touch-line.com/welcome.asp?cust=1892&lang=0","stats");
  menuMatch.addItem("Audio Commentary","/match/acommentary/");
  menuMatch.addItem("Official Magazine &amp; Programme","http://www.merseyshop.com/liverpoolfc/", "_blank");
  menuMatch.addItem("Reserves","/match/reserves/");  
  menuMatch.create();
menuShop = new LFCMenu("menuShop",86);
menuShop.addItem("Official Online Store","http://store.liverpoolfc.tv/", "_blank");
menuShop.addItem("Official Club Stores","/shop/");
menuShop.addItem("Shop Top Ten","/news/shopten.htm?ncid=shnavhtop10");
menuShop.addItem("Official LFC Shirts","http://store.liverpoolfc.tv/products/footballkit?ncid=shnavshirts");
menuShop.addItem("Downloadable e-Catalogue","/catalogue/");
//menuShop.addItem("New Away Kit","/newawaykit/");
menuShop.addItem("Buy e-Season Ticket","/preview/?ncid=shnav-est-190308");
menuShop.addItem("Buy Mobile Services","/mobilezone/?ncid=shnav-mobile-190308");
menuShop.addItem("LFC Reverse Auction ","/mobilezone/index.php3?ncid=shnav-auctions-190308&page=reverse_auction");
menuShop.addItem("Club Credit Card","/creditcard");
menuShop.addItem("Getty Images","/gettyimages/", "_blank");
menuShop.addItem("Personalised Cards","http://www.print-fair.net/liverpool","_blank");
menuShop.addItem("e-Season Ticket Vouchers","/eseasonvoucher/?ncid=shnav-vouchers-190308");
menuShop.addItem("Become a Wholesale Partner","/retail/");
menuShop.addItem("LFC Savings Accounts","http://www.britannia.co.uk/lfc");
menuShop.addItem("LFC Mortgage","http://www.britannia.co.uk/lfc");
menuShop.create();
  menuBetting = new LFCMenu("menuBetting",124);
  menuBetting.addItem("Coming Soon","http://www.liverpoolfc.tv/news/drilldown/NC165757090914-1131.htm", "_blank");
  menuBetting.create();
  menuInteractive = new LFCMenu("menuInteractive",178);
  menuInteractive.addItem("Fantasy League","http://liverpoolfc.fantasyleague.com");
  menuInteractive.addItem("Message Boards","/interact/message/");
  menuInteractive.addItem("LFC Gadgets","/interact/gadgets/");
  menuInteractive.addItem("Games","/interact/games/");
  menuInteractive.addItem("Wallpapers","/interact/downloads/wallpapers/");
  menuInteractive.addItem("Fans Gallery","/interact/gallery/");
  menuInteractive.addItem("Screensavers","/interact/downloads/screensavers/");
  menuInteractive.addItem("Virtual Tours","/interact/virtualtour/");
  menuInteractive.addItem("Voting","/interact/results/");
  menuInteractive.addItem("Competitions","/interact/competitions/");
  //menuInteractive.addItem("Register To Win","/interact/competitions/register/");
  //menuInteractive.addItem("Songs to Learn and Sing","/interact/songs/");
  menuInteractive.addItem("Lucozade Sport Top Tips","/shop/lssa.htm");
  menuInteractive.create();
  menuMobile = new LFCMenu("menuMobile",249);
menuMobile.addItem("iPhone","/iphone");
menuMobile.addItem("LFC Mobile Zone","/mobilezone/index.php3?page=mobilezone");
menuMobile.addItem("Get Custom Shirt Wallpapers","/mobilezone/index.php3?page=shirt_wallpapers");
menuMobile.addItem("LFC Video","/mobilezone/index.php3?page=video");
//menuMobile.addItem("Get Realtones","/mobilezone/index.php3?page=realtones");
menuMobile.addItem("Get Ringtones","/mobilezone/index.php3?page=ringtones");
menuMobile.addItem("Get Wallpapers","/mobilezone/index.php3?page=wallpapers");
menuMobile.addItem("Get 3D Animations","/mobilezone/index.php3?page=crest_animations");
//menuMobile.addItem("Get 3D Animations Wallpapers","/mobilezone/index.php3?page=player_animations");
//menuMobile.addItem("Games","/mobilezone/index.php3?page=games");
menuMobile.addItem("Get Live Text Updates","/mobilezone/index.php3?page=news_alerts");
menuMobile.addItem("Get Ticket SMS Alerts","/mobilezone/index.php3?page=ticket_alerts");
menuMobile.addItem("Liverpoolfc.tv on the Go!","/mobilezone/index.php3?page=on_the_go");
menuMobile.addItem("LFC Reverse Auction","/mobilezone/index.php3?page=reverse_auction");
menuMobile.addItem("Player Downloads","/mobilezone/index.php3?page=player_downloads");
menuMobile.addItem("Mobile Bundles","/mobilezone/index.php3?page=mobile_bundles");
menuMobile.addItem("MOBILE SALE","/mobilezone/index.php3?page=january_sale");
menuMobile.addItem("Video Membership","/mobilezone/index.php3?page=vidmember");
//menuMobile.addItem("2 For 1 Offers","/mobilezone/index.php3?page=2for1-offer");
menuMobile.addItem("LFC Legends Mobile Phone","/legends-edition/?ncid=mobilezone_navlink_galentia_lfcphone");
  menuMobile.create();
  menuTicket = new LFCMenu("menuTicket",296);
  menuTicket.addItem("Latest Ticket News","/tickets/info.htm");
  menuTicket.addItem("How to Apply for Tickets","/tickets/howtoapply.htm");
  menuTicket.addItem("Online Ticket Sales","/tickets/onlinesales.htm");
  menuTicket.addItem("PTS Match Tickets","/ptsonline/index.htm");
  menuTicket.addItem("e-Season Match Tickets","/tickets/sales/estc_ballot_entry.htm");
  menuTicket.addItem("Members Ticket Exchange","/membership/exchange/");
  menuTicket.addItem("Dates of Sale","/tickets/home_games.htm");
  menuTicket.addItem("Season Tickets","/tickets/season.htm");
  menuTicket.addItem("Anfield Seating Plan","/tickets/stadiumplan.htm");
  menuTicket.addItem("Getting to Anfield","/tickets/anfield.htm");
  menuTicket.addItem("Accessibility","/tickets/access.htm");   
  menuTicket.addItem("Away Travel","/tickets/away/");
  menuTicket.addItem("European Away Packages","http://secure.thomascooksport.com/liverpool_european.php?ac=liveuro", "_blank");
  menuTicket.addItem("Reserves Match Travel","/tickets/away/reserves.htm");
  menuTicket.addItem("Hospitality","/tickets/hospitality.htm");
  menuTicket.addItem("Get Ticket SMS Alerts","/tickets/tix.htm");
  menuTicket.addItem("Ticket Office Terms and Conditions","/tickets/ticketterms.htm");
  menuTicket.create();
  menuTeam = new LFCMenu("menuTeam",346);
  menuTeam.addItem("1st Team Squad Profiles","/team/squad/");
  menuTeam.addItem("1st Team Squad Stats","/team/squad/stats/");
  //menuTeam.addItem("1st Team injuries and Suspensions ","/team/absence/");
  //menuTeam.addItem("1st Team Squad Ratings","/team/squad/rate/");
  menuTeam.addItem("Youth Profiles","/team/youth/");
  //menuTeam.addItem("Ladies Squad","/team/ladies/");
  menuTeam.addItem("Ladies Squad","http://www.liverpoolladiesfc.co.uk/", "_blank");
  menuTeam.addItem("The Academy","/team/academy/");
  menuTeam.addItem("Melwood","/team/melwood/");
  menuTeam.create();
  menuHistory = new LFCMenu("menuHistory",383);
  menuHistory.addItem("Tour and Museum","/club/tour.htm");
  menuHistory.addItem("LFC Story","/lfc_story/");
  menuHistory.addItem("Hillsborough","/lfc_story/memorial/");
  menuHistory.addItem("Heysel","/lfc_story/heysel/");
  menuHistory.addItem("Honours","/lfc_story/honours/");
  menuHistory.addItem("LFC Records","/lfc_story/records/");
  menuHistory.addItem("Kop Classics","/lfc_story/classics/");
  menuHistory.addItem("Quotes","/lfc_story/quotes.htm");
  //menuHistory.addItem("Results Archive","/history/archive/index.php3");
  menuHistory.addItem("Past Players &amp; Managers","/team/past_players/");
  menuHistory.create();
  menuClub = new LFCMenu("menuClub",427);
  menuClub.addItem("Official Membership","/membership/");
  menuClub.addItem("Association Of International Branches","/club/aib/");
  menuClub.addItem("Tour and Museum","/club/tour.htm");
  menuClub.addItem("Senior Club Personnel","/club/board.htm");
  menuClub.addItem("Sponsors","/club/sponsors.htm");
  menuClub.addItem("Club Charter","/club/charter.htm");
  menuClub.addItem("Annual Report","/club/report.htm");
  menuClub.addItem("Anti Racism","/club/antiracism.htm");
  menuClub.addItem("Anti Hooliganism","/club/antihooliganism.htm");
  menuClub.addItem("Meetings and Events at LFC","/club/banqueting.htm");
  menuClub.addItem("The Anfield Experience","/anfieldexperience");
  menuClub.addItem("Meetings and Conferences","/club/conferencing.htm");
  menuClub.addItem("Weddings","/club/weddings.htm");
  menuClub.addItem("Club Credit Card","/creditcard");
  menuClub.addItem("Public Relations","/club/pr.htm");
  menuClub.addItem("Development Association","/tickets/devassoc/");
  menuClub.addItem("LFC In the Community","/club/community.htm");
  menuClub.addItem("L'pool Disabled Supporters Assoc","/club/ldsa.htm");
  menuClub.addItem("Reduc@te","/reducate/new_reducate.htm");
  menuClub.addItem("HOLA","/reducate/");
  menuClub.addItem("Jobs at LFC","/club/lfcrecruitment/");
  menuClub.addItem("Soccer School","/club/soccerschool.htm");
  menuClub.addItem("HFSG","/club/hfsg.htm");
  menuClub.addItem("Healthy Stadia","/club/healthy.htm");
  menuClub.create();
  menuEST = new LFCMenu("menuEST",628, true);
  menuEST.addItem("Buy Now","http://www.liverpoolfc.tv/preview/","this");
  menuEST.addItem("e-Season Home","/eseason/", "this");
  menuEST.addItem("LFC TV","/eseason/LFC-TV", "this");
  menuEST.addItem("Live Match Coverage","/eseason/Live-Match-Coverage/", "this");
  menuEST.addItem("Premiership","/eseason/", "this");
  menuEST.addItem("Europe","/eseason/", "this");
  menuEST.addItem("Other Comps","/eseason/", "this");
  menuEST.addItem("News &amp; Interviews","/eseason/News-and-Interviews/08-09/", "this");
  menuEST.addItem("Reserves &amp; Youth","/eseason/Reserves-and-Youth/08-09/", "this");
  menuEST.addItem("History","/eseason/History/Post-2000/", "this");
  menuEST.addItem("Top 100 Players","/eseason/Players-who-shook-the-kop/", "this");
  menuEST.addItem("Days that shook the Kop","/eseason/100-days-that-shook-the-kop/", "this");
  menuEST.addItem("100 Premiership Goals","/eseason/100-Premiership-Goals/", "this");
  menuEST.addItem("100 Owen Goals","/eseason/100-Owen-Goals/", "this");

  //menuEST.addItem("LFC TV","/estc2/premium/index.php3?channel_id=15");
  //menuEST.addItem("Live Match Coverage","/estc2/premium/index.php3?channel_id=9");
  //menuEST.addItem("All Match Archive","/estc2/premium/index.php3?channel_id=10");
  //menuEST.addItem("Ch1: Premier League","/estc2/premium/index.php3?channel_id=1");
  //menuEST.addItem("Ch2: Europe","/estc2/premium/index.php3?channel_id=2");
  //menuEST.addItem("Ch3: Off The Pitch","/estc2/premium/index.php3?channel_id=3");
  //menuEST.addItem("Ch4: Features","/estc2/premium/index.php3?channel_id=4");
  //menuEST.addItem("Ch5: Retro","/estc2/premium/index.php3?channel_id=5");
  //menuEST.addItem("Ch6: Reserves and Youth","/estc2/premium/index.php3?channel_id=6");
  //menuEST.addItem("Ch7: The Fans","/estc2/premium/index.php3?channel_id=7");
  //menuEST.addItem("My Favourites","/estc2/premium/index.php3?channel_id=11");
  menuEST.addItem("e-Season Match Tickets","/tickets/sales/est_ballots.htm", "this");
  menuEST.addItem("e-Season Ticket Vouchers","/eseasonvoucher/","this");
  menuEST.create();
  positionEST();
}
function positionEST()
{
  if ( document.all )
  {
    table = document.all['menutable'];
    bar = document.all['menubar'];
    est = document.all['estlink'];
    est.style.left = (table.offsetLeft+610)+"px";
    //est.style.left = 774+"px";
  }
  else if ( document.getElementById )
  {
    table = document.getElementById('menutable');
    bar = document.getElementById('menubar');
    est = document.getElementById('estlink');
    est.style.left = (((window.innerWidth - 771) / 2)+510)+"px";
  }
  est.style.top = "118px";
  est.style.visibility = "visible";
}
