// ********************************************************************************************

// *********  common.js

// *********

// *********  Common javascript functions that are used by most of the web pages

// *********

// *********

// ********************************************************************************************

function formatDate()

//*************************************************************************************************

//**********                                                                           ************

//**********       Format a date in day, month, year format e.g. 27th September, 2009  ************

//**********                                                                           ************

//*************************************************************************************************

{

    var mydate=new Date() ;                 // Create a current date object

    var wkday = mydate.getDay() + 1 ;       // The day of the week.  The count starts at zero, so I am adding 1 to get it to the right number (Sunday = 1 etc..)

    var day   = mydate.getDate() ;          // The day of the month. ( Does not need 1 adding to it. )

    var month = mydate.getMonth() + 1 ;     // The mth count starts at zero, so I am adding 1 to get it to the right number (January = 1 etc.)

    var year  = mydate.getYear() ;          // Extract the year

    if (year < 1000) year+=1900 ;           // Correct the year for the right century

    var daym ;                              //  Variable in which we will add a suffix to the day of the month e.g. 31st, 4th, 2nd, 23rd etc.

    switch(day)

    {

      case 1:

      case 21:

      case 31:

        daym = day + "st"

        break;

      case 2:

      case 22:

        daym = day + "nd"

        break;

      case 3:

      case 23:

        daym = day + "rd"

        break;

      default:

        daym = day + "th"

        break;

    }

//  Create an array of week day names

    var dayarray   = new Array("No Day","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday") ;

//  Create an array of month names

    var montharray = new Array("No Month","January","February","March","April","May","June","July","August","September","October","November","December") ;

//  Format the date string for use on the web site banner

    var dateStr = dayarray[wkday] + ", " + montharray[month] + " " + daym + ", " + year  ;

//*************************************************************************************************

//  The code below overrides the normal date output with special dates in the calendar

//*************************************************************************************************

//    alert("Day : " + day + " Month : " + month) ;

//    if((day >= 4 && day <= 6)  && month==11 ) dateStr = "the Open Championship weekend, "  + year ;   // Just used for testing

//  Patron Saints Days

    if(day==1  && month==3 ) dateStr = "St David's Day, "    + year ;

    if(day==17 && month==3 ) dateStr = "St Patrick's Day, "  + year ;

    if(day==23 && month==4 ) dateStr = "St George's Day, "   + year ;

    if(day==30 && month==11) dateStr = "St Andrew's Day, "   + year ;

//  Fixed Yearly Events

    if(day==1  && month==1 ) dateStr = "New Years Day, " + year ;

    if(day==5  && month==1 ) dateStr = "the 12th night of Christmas, " + year ;

    if(day==14 && month==2)  dateStr = "St Valentines Day, " + year ;

    if(day==1  && month==4)  dateStr = "April Fools Day, " + year ;

    if(day==15 && month==9)  dateStr = "the Battle of Britain Day, " + year ;

    if(day==21 && month==10) dateStr = "Trafalgar Day, " + year ;

    if(day==31 && month==10) dateStr = "Halloween, " + year ;

    if(day==5  && month==11) dateStr = "Bonfire Night, " + year ;

    if(day==11 && month==11) dateStr = "Armistice Day, " + year ;

    if(day==24 && month==12) dateStr = "Christmas Eve, " + year ;

    if(day==25 && month==12) dateStr = "Christmas Day, " + year ;

    if(day==25 && month==12) dateStr = "Boxing Day, " + year ;

    if(day==31 && month==12) dateStr = "New Years Eve, " + year ;

//  Variable Major Lytham Green Drive Golf Club Events

//  Variable Yearly Events

    if(day==16 && month==2 && year==2011) dateStr = "Pancake Tuesday, " + year ;

    if(day==8 && month==3 && year==2011) dateStr = "Ash Wednesday, " + year ;

    if(day==9 && month==3 && year==2011) dateStr = "Good Friday, " + year ;

    if((day >=23  && day <=24) && month==4  && year==2010) dateStr = "Easter weekend, " + year ;

    if(day==25 && month==4 && year==2010) dateStr = "Easter Monday, " + year ;

    if(day==13 && month==11) dateStr = "Remembrance Day, " + year ;

//  Major Golf Event dates

    if((day >=7  && day <=10) && month==4  && year==2011) dateStr = "the Masters weekend, " + year ;

    if((day >=16 && day <=19) && month==6  && year==2011) dateStr = "the US Open weekend, " + year ;

    if((day >=14 && day <=17) && month==7  && year==2011) dateStr = "the Open Championship weekend, " + year ;

    if((day >=11 && day <=14) && month==8  && year==2011) dateStr = "the PGA Championship weekend, " + year ;

//    if((day >=1  && day <=3 ) && month==10 && year==2010) dateStr = "the Ryder Cup weekend, " + year ;

    return dateStr ;

}



function checkKeyHitIsEnter(e)

//*************************************************************************************************

//**********                                                                           ************

//**********         Check it was the enter key that was pressed                       ************

//**********                                                                           ************

//*************************************************************************************************

{

    var keyPressed;

    //Browser compatibility check

    if (document.all)

    {

        //  Browser used: Internet Explorer 6

        keyPressed = e.keyCode;

//        alert('handleKeystroke: IE property: keyCode');

    }

    else

    {

        //Browser used: Firefox

        keyPressed = e.which;

//        alert('handleKeystroke: FF property: which');

    }

    // 13 = ASCII code for Enter key

    if(keyPressed == 13)

    {

      return true ;

    }

    return ;

}



function showcourse(elmtId)

//*************************************************************************************************

//**********                                                                           ************

//**********                                                                           ************

//*************************************************************************************************

{

    // Get the object

   var elmt = document.getElementById(elmtId);

   document.getElementById('holephoto1' ).style.display="none" ;

   document.getElementById('holephoto2' ).style.display="none" ;

   document.getElementById('holephoto3' ).style.display="none" ;

   document.getElementById('greenphoto1').style.display="none" ;

   document.getElementById('greenphoto2').style.display="none" ;

   document.getElementById('greenphoto3').style.display="none" ;

   elmt.style.display="block" ;

}



function hide(elmtId)

//*************************************************************************************************

//**********                                                                           ************

//**********         Hide an element on the page                                       ************

//**********                                                                           ************

//*************************************************************************************************

{

    // Get the object

   var elmt = document.getElementById(elmtId);

      elmt.style.display="none" ;

//       document.getElementById(elmt).style.display="none" ;

}



function show(elmtId)

//*************************************************************************************************

//**********                                                                           ************

//**********         Show an element on a page                                         ************

//**********                                                                           ************

//*************************************************************************************************

{

    // Get the object

   var elmt = document.getElementById(elmtId);

      elmt.style.display="block" ;

//      document.getElementById(elmt).style.display="block" ;

}



function toggle(elmt)

//*************************************************************************************************

//**********                                                                           ************

//**********         Toggle the display of an element on a page                        ************

//**********                                                                           ************

//*************************************************************************************************

{

  if (!document.getElementById) return ;

  if (document.getElementById(elmt).style.display=="block")

      document.getElementById(elmt).style.display="none" ;

  else

      document.getElementById(elmt).style.display="block" ;

}



function toggleTextElmt(linkObj, elmtId)

//*************************************************************************************************

//**********                                                                           ************

//**********         Have a more/less link and toggle the display of a text element    ************

//**********         (The text elelement is normally a div)                            ************

//**********                                                                           ************

//*************************************************************************************************

{

    // Get the object

   var elmtObj = document.getElementById(elmtId);

  // Check to see if the texObj is currently not on display, and do the appropriate action

  if(elmtObj.style.display == "none")

  {

    // Show the additional text item

    elmtObj.style.display = "block";

    // Change the text/img on the link and the tooltip

    linkObj.innerHTML = "Read less" ;

    linkObj.title = "Click here to collapse the text" ;

  }

  else

  {

    // Hide the additional text item

    elmtObj.style.display = "none";

    // Restore the initial text on the link and the tooltip

    linkObj.innerHTML = "Read more" ;

    linkObj.title="Click for more information" ;

  }

}



function toggleTextandLink(linkObj, elmtId, txtMore, txtLess)

//*************************************************************************************************

//**********                                                                           ************

//**********         Have a more/less link and toggle the display of a text element    ************

//**********         (The text elelement is normally a div)                            ************

//**********                                                                           ************

//*************************************************************************************************

{

  // Get the object

   var elmtObj = document.getElementById(elmtId);

 // Check to see if the texObj is currently not on display, and do the appropriate action

  if(elmtObj.style.display == "none")

  {

    // Show the additional text item

    elmtObj.style.display = "block";

    // Change the text/img on the link and the tooltip

    linkObj.innerHTML = txtLess ;

    linkObj.innerHTML = txtLess ;

    linkObj.title = "Click here to collapse the text" ;

  }

  else

  {

    // Hide the additional text item

    elmtObj.style.display = "none";

    // Restore the initial text on the link and the tooltip

    linkObj.innerHTML = txtMore;

    linkObj.title="Click for more information" ;

  }

}



function isVisible(elmt)

//*************************************************************************************************

//**********                                                                           ************

//**********         Check to see whether an HTML element is visible or not            ************

//**********                                                                           ************

//*************************************************************************************************

{

  // Get the object

   var elmtObj = document.getElementById(elmt);

  if(elmtObj.style.display == "none")

  {

//    alert("Not visible");

    return false ;

  }

  else

  {

//    alert("Visible");

    return true ;

  }

}



function insertPic(imgId, theSrc, theWidth, theHeight)

// ********************************************************************************************

// *********

// *********  Place an image into an image tag with an id and specify a size for the image (width and height)

// *********  If the images is greater than the MAX_WIDTH allowed the picture will be resized automatically (width and height)

// *********

// *********  Usage example :

// *********

// *********     <a href="javascript:insertPic('poster', 'images/social/summerball2011.jpg', '722', '1024') >Insert the image ...</a>

// *********

// *********     <img id="poster" />

// *********

// *********  Note: This is frequently used with the show() and hide() functions

// ********************************************************************************************

{

// Get the img element based on the id passed in

   var myImg = document.getElementById(imgId) ;

   var MAX_WIDTH = 635 ;

// Set the source image

   myImg.src    = theSrc ;

// Check the width of the imahe to see if it exceeds the maximum size

   if(theWidth > MAX_WIDTH)

   {

     var theRatio, maxHeight ;

     // Get the ratio of the image to the maximum width

     theRatio = (theWidth / MAX_WIDTH ) ;

     // Apply the ratio to the height and make it an integer

     maxHeight = Math.floor(theHeight/theRatio) ;

     // Now set the new width and height

     myImg.width  = MAX_WIDTH ;

     myImg.height = maxHeight ;

   }

   else

   {

     // Set the width and height

     myImg.width  = theWidth ;

     myImg.height = theHeight ;

   }

   return;

}



function clearDefaultText(elmt)

//*************************************************************************************************

//**********                                                                           ************

//**********         Clear or insert default text in an input field  e.g.              ************

//**********                                                                           ************

//**********         <input id="surname"                                               ************

//**********                name="surname"                                             ************

//**********                value="Your Surname"                                       ************

//**********                type="text" size="30"                                      ************

//**********                onfocus="javascript:clearDefaultText(this);"               ************

//**********                onblur="javascript:clearDefaultText(this);" />             ************

//**********                                                                           ************

//*************************************************************************************************

{

    // If the default text is in the field, clear it

    if (elmt.defaultValue == elmt.value)

    {

      elmt.value = "" ;

      return true;

    }

    // If the field is blank replace the default text

    if (elmt.value == "")

    {

      elmt.value = elmt.defaultValue ;

      return true;

    }

}



function setTabs(tabGroup, tabId)

//******************************************************************************************************

//**********

//**********     Function to highlight the required tab in a tab group.  The tabs are a special <ul> class

//**********     of 'tabbed' which is a style that makes them look like tabs.

//**********

//**********     Usage :

//**********     --------

//**********     setTabs(tabGroup, tabId) ;

//**********        tabGroup  = the id of the <ul> container that holds the group of tabs  (must be a <ul>)

//**********        tabId     = the id of the <li> that you want to highlight              (must be a <li>)

//**********                    (all other tabs in the group will automatically be unhighlighted)

//**********

//**********     The <ul> must have a class of "tabbed".  Each <li> must have an id and an <a> within them

//**********

//**********     Example :

//**********     --------

//**********    <ul id="tabitems" class="tabbed" style="text-align:center">

//**********            <li id="1"><a href="javascript:setTabs('tabitems', '1'); id="current" >Instructions</a></li>

//**********            <li id="2"><a href="javascript:setTabs('tabitems', '2');" >Show Fairway View</a></li>

//**********            <li id="3"><a href="javascript:setTabs('tabitems', '3');" >Show Green View</a></li>

//**********    </ul>

//**********

//**********    Typically use in conjunction with  setTabViewss() function below

//**********

//******************************************************************************************************

{

  // Get the <ul> objectusing the id passed in

   var ulObj = document.getElementById(tabGroup);

  // Get an array of <li> items in the UL object

   var listObj = ulObj.getElementsByTagName('li');

//   alert("No of <li> elements = " + listObj.length);

   // loop through <li> list items

   for (i=0; i<listObj.length; i++)

   {

     // If the <li> item matches the Id passed in make it the current <li> item

     if (listObj[i].id == tabId)

     {

        // If this is the <li> to receive focus set it's id to current

        var focusTab = listObj[i].firstChild ;

        focusTab.id = "current" ;

     }

     else

     {

     // If the <li> item does not match the Id passed don't make it the current <li> item

        var unfocusTab = listObj[i].firstChild ;

        var nofocus = "nofocus" + i ;

        unfocusTab.id = nofocus ;

     }

   }

}



function setTabViews(viewsGroup, viewId)

//******************************************************************************************************

//**********

//**********     Function to make a specific div visible and hide all other divs in a group. There must

//**********     be a <div> container holding a collection of the divs you want to show and hide

//**********

//**********     Usage :

//**********     --------

//**********     setTabViews(viewsGroup, viewId) ;

//**********        viewsGroup = the id of the <div> container that holds the group of views (must be a <div>)

//**********        viewId     = the id of the <div> view that you want to make visible      (must be a <div>)

//**********                     (all others in the view group will automatically be hidden)

//**********

//**********     Example :

//**********     ---------

//**********    <a href="javascript:setTabViews('viewitems', 'instructions');"  >Instructions</a>

//**********    <a href="javascript:setTabViews('viewitems', 'holediagram');"  >Show Fairway View</a>

//**********    <a href="javascript:setTabViews('viewitems', 'greendiagram');" >Show Green View</a>

//**********

//**********    <div id="viewitems" class="tabViews">

//**********      <div id="instructions" class="align-center >  <!-- This will be shown initally (no class of hide) -->

//**********          Any mark up here....

//**********      </div>

//**********      <div id="holediagram" class="align-center hide >

//**********          Any mark up here....

//**********      </div>

//**********      <div id="greendiagram" class="align-center hide">

//**********          Any mark up here...

//**********      </div>

//**********    </div>  <!-- End of the 'viewitems' collection -->

//**********

//**********    Typically used in conjunction with  setTabs() function above

//**********

//******************************************************************************************************

{

  // Get the view container object

   var viewsContainer = document.getElementById(viewsGroup);

  // Get an array of div items in the div group object (these are the individual views)

   var divItems = viewsContainer.getElementsByTagName('div');

//   alert("No of div elements = " + divItems.length);

   // loop through div items

   for (i=0; i<divItems.length; i++)

   {

     // If the view object being parsed = the id of the view item passed in to the function

     if (divItems[i].id == viewId)

     {

        // If this is the view to be shown set it's style - display = "block" (visible)

         var viewPane = document.getElementById(divItems[i].id) ;

//       alert("Matched on " + viewPane.id) ;

         viewPane.style.display="block";

     }

     else

     {

        // If this is a pane NOT to be shown set it's style - display = "none" (hide)

         var hidePane = document.getElementById(divItems[i].id) ;

//       alert("Not matched on " + hidePane.id) ;

         hidePane.style.display="none";

     }

   }

}



function writeMbrStrapline()

//*************************************************************************************************

//**********                                                                           ************

//**********         Put the slogan under the header                                   ************

//**********                                                                           ************

//*************************************************************************************************

{



    if (!checkSecureToken())

    {

      return ;

    }



    document.write("<h2 id=\"slogan\"><span class=\"gray\">" + getSessionCookie('member') + "<\/span> welcome to the members area on <span class=\"gray\">" + formatDate() + "<\/span><\/h2>" ) ;

}



function writeMbrMenu()

//*************************************************************************************************

//**********                                                                           ************

//**********         Write the navigation menu for the member area                     ************

//**********                                                                           ************

//*************************************************************************************************

{

    document.write("                   <ul>");

    document.write("                               <li><a href=\"mbr-newspage.html\"   onmouseover=\"javascript:setTabViews('sub-menus', 'news-submenu');\">News &amp; Events<\/a><\/li>");

    document.write("                               <li><a href=\"mbr-theclub.html\"    onmouseover=\"javascript:setTabViews('sub-menus', '');\">Our Club<\/a><\/li>");

    document.write("                               <li><a href=\"mbr-members.html\"    onmouseover=\"javascript:setTabViews('sub-menus', 'member-submenu');\">Member Sections<\/a><\/li>");

    document.write("                               <li><a href=\"http:\/\/www.brsgolf.com/lytham/members_booking.php\" target=\"_blank\"   onmouseover=\"javascript:setTabViews('sub-menus', '');\">Online Booking<\/a><\/li>");
    
   	document.write("                               <li><a href=\"mbr-results.html\"    onmouseover=\"javascript:setTabViews('sub-menus', '');\">How Did I Do<\/a><\/li>");

    document.write("                               <li><a href=\"mbr-trophyroom.html\" onmouseover=\"javascript:setTabViews('sub-menus', '');\">Trophies<\/a><\/li>");

    document.write("                   <\/ul>");

    document.write("");

}



function writeMbrSubMenu()

//*************************************************************************************************

//**********                                                                           ************

//**********         Write the navigation sub menu for the member area                 ************

//**********                                                                           ************

//*************************************************************************************************

{

    document.write("        <div id=\"sub-menus\">");

    document.write("            <div id=\"news-submenu\" class=\"hide\" >");

    document.write("              <ul class=\"submenu\">");

    document.write("              	<li><a href=\"mbr-newspage.html\">Members Newspage<\/a><\/li>");

    document.write("              	<li><a href=\"mbr-calendars.html\">Social Event and Competition calendars<\/a><\/li>");

    document.write("              <\/ul>");

    document.write("            <\/div>");

    document.write("            <div id=\"member-submenu\" class=\"hide\" >");

    document.write("              <ul class=\"submenu\">");

    document.write("              	<li><a href=\"mbr-members.html\">Contact a Member<\/a><\/li>");

    document.write("              	<li><a href=\"mbr-gents.html\">Gents Section<\/a><\/li>");

    document.write("              	<li><a href=\"mbr-ladies.html\">Ladies Section<\/a><\/li>");

    document.write("              	<li><a href=\"mbr-juniors.html\">Juniors Section<\/a><\/li>");

    document.write("              	<li><a href=\"mbr-seniors.html\">Seniors Section<\/a><\/li>");

    document.write("              <\/ul>");

    document.write("            <\/div>");

    document.write("       <\/div>");

    document.write("");

}



function writeMbrFooter()

{

    document.write("    <div class=\"col float-left\">");

    document.write("       <h1>Links to National Golf Organisations<\/h1>");

    document.write("       <a href=\"http:\/\/www.randa.org\"              target=\"_blank\"><strong>The Royal &amp; Ancient<\/strong><\/a><br \/>");

    document.write("       <a href=\"http:\/\/www.congu.com\"              target=\"_blank\"><strong>Council of National Golf Unions<\/strong> - CONGU<\/a><br \/>");

    document.write("       <a href=\"http:\/\/www.englishgolfunion.org\"   target=\"_blank\"><strong>English Golf Union<\/strong><\/a><br \/>");

    document.write("       <a href=\"http:\/\/www.lgu.org\"                target=\"_blank\"><strong>Ladies Golf Union<\/strong><\/a><br \/>");

    document.write("       <a href=\"http:\/\/www.englishwomensgolf\"      target=\"_blank\"><strong>English Women’s Golf Association<\/strong><\/a><br \/>");

    document.write("    <\/div>");

    document.write("    <div class=\"col float-left\">");

    document.write("       <h1>North West Golf<\/h1>");

    document.write("       <a href=\"http:\/\/www.lancashiregolf.org\"     target=\"_blank\"><strong>Lancashire Golf Union<\/strong><\/a><br \/>");

    document.write("       <a href=\"http:\/\/www.llcga.org\"     target=\"_blank\"><strong>Lancashire Ladies County Golf Association<\/strong><\/a><br \/>");

    document.write("");

    document.write("       <a href=\"http:\/\/www.englandsgolfcoast.com\"  target=\"_blank\"><strong>Englands Golf Coast<\/strong> - North West Golf<\/a>");

    document.write("    <\/div>");

    document.write("    <div class=\"col2 float-right\">");

    document.write("       <h1>Credits<\/h1>");

    document.write("       <p>");

    document.write("         Copyright : <strong>Lytham Green Drive Golf Club, 2011<\/strong><br \/>");

    document.write("         Design by : <strong>LGDGC Web Design<\/strong>");

    document.write("       <\/p>");

    document.write("    <\/div>");

    document.write("");

}



function writeGnlStrapline()

//*************************************************************************************************

//**********                                                                           ************

//**********         Put the slogan under the header                                   ************

//**********                                                                           ************

//*************************************************************************************************

{

   document.write("<h2 id=\"slogan\">Welcome to the friendliest club on the Fylde Coast on <span class=\"gray\">" + formatDate() + "<\/span><\/h2>" ) ;

//   document.write("<h2 id=\"slogan\">Welcome to the friendliest club on the Fylde Coast<\/h2>") ;

}



function writeGnlMenu()

//*************************************************************************************************

//**********                                                                           ************

//**********         Write the navigation menu for the guest area                     ************

//**********                                                                           ************

//*************************************************************************************************

{

    document.write("                   <ul>");


    document.write("                               <li><a href=\"indexOLD.html\"                      onmouseover=\"javascript:setTabViews('sub-menus', '_no-submenu');\" >Home<\/a><\/li>");

    document.write("                               <li><a href=\"index.html\"                      onmouseover=\"javascript:setTabViews('sub-menus', '_no-submenu');\" >Advert<\/a><\/li>");

    document.write("                               <li><a href=\"gnl-club-membership.html\"           onmouseover=\"javascript:setTabViews('sub-menus', 'club-submenu');\" >Our Club<\/a><\/li>");

//    document.write("                               <li><a href=\"gnl-club-ourclub.html\"           onmouseover=\"javascript:setTabViews('sub-menus', 'club-submenu');\" >Our Club<\/a><\/li>");

//    document.write("                               <li><a href=\"gnl-clubhouse-bar.html\"          onmouseover=\"javascript:setTabViews('sub-menus', 'clubhouse-submenu');\" >Clubhouse<\/a><\/li>");

    document.write("                               <li><a href=\"gnl-opens-entryforms.html\"       onmouseover=\"javascript:setTabViews('sub-menus', 'opens-submenu');\" >Open Competitions<\/a><\/li>");

    document.write("                               <li><a href=\"gnl-course-coursemap.html\"       onmouseover=\"javascript:setTabViews('sub-menus', 'course-submenu');\" >The Course<\/a><\/li>");

    document.write("                               <li><a href=\"gnl-proshop.html\"                onmouseover=\"javascript:setTabViews('sub-menus', '_no-submenu');\" >Pro\'s Shop<\/a><\/li>");

//    document.write("                               <li><a href=\"gnl-visitors-specialoffers.html\" onmouseover=\"javascript:setTabViews('sub-menus', 'visitors-submenu');\" >Visitor Information<\/a><\/li>");

    document.write("                               <li><a href=\"gnl-visitors-greenfees.html\" onmouseover=\"javascript:setTabViews('sub-menus', 'visitors-submenu');\" >Visitor Information<\/a><\/li>");

    document.write("                               <li><a href=\"gnl-the2012open.html\" 			onmouseover=\"javascript:setTabViews('sub-menus', '_no-submenu');\" >The Open<\/a><\/li>");

    document.write("                   <\/ul>");

    document.write("");

}



function writeGnlSubMenu()

//*************************************************************************************************

//**********                                                                           ************

//**********         Write the navigation sub menu for the guest area                 ************

//**********                                                                           ************

//*************************************************************************************************

{

    document.write("        <div id=\"sub-menus\">");

    document.write("            <div id=\"club-submenu\" class=\"hide\" >");

    document.write("              <ul class=\"submenu\">");

    document.write("                   <li><a href=\"gnl-club-membership.html\">Membership<\/a><\/li>");

//    document.write("                   <li><a href=\"gnl-club-ourclub.html\">Our Club<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-club-history.html\">History<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-club-location.html\">Location<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-club-dressrules.html\">Dress Rules<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-contactus.html\">Contact Details<\/a><\/li>");

    document.write("              <\/ul>");

    document.write("            <\/div>");

    document.write("            <div id=\"clubhouse-submenu\" class=\"hide\" >");

    document.write("              <ul class=\"submenu\">");

    document.write("                   <li><a href=\"gnl-clubhouse-bar.html\">The Bar<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-clubhouse-catering.html\">Catering<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-clubhouse-functionroom.html\">Function Room<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-clubhouse-bookfunction.html\">Book a Function<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-clubhouse-contactcaterers.html\">Contact Caterers<\/a><\/li>");

    document.write("              <\/ul>");

    document.write("            <\/div>");

    document.write("            <div id=\"opens-submenu\" class=\"hide\" >");

    document.write("              <ul class=\"submenu\">");
    
    document.write("                   <li><a href=\"http:\/\/www.brsgolf.com/lytham/visitor_home.php?course_id=1\" target=\"_blank\">Book Online<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-opens-entryforms.html\">Competition Entry Forms<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-opens-results.html\">Competition Results<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-contactus.html\">Contact Secretary<\/a><\/li>");

    document.write("              <\/ul>");

    document.write("            <\/div>");

    document.write("            <div id=\"course-submenu\" class=\"hide\" >");

    document.write("              <ul class=\"submenu\">");

    document.write("                   <li><a href=\"gnl-course-scorecard.html\">Scorecard<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-course-coursemap.html\">Course Map and Hole Guide<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-course-aerialview.html\">Aerial View<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-course-gallery.html\">Photo Gallery<\/a><\/li>");

    document.write("              <\/ul>");

    document.write("            <\/div>");

    document.write("            <div id=\"visitors-submenu\" class=\"hide\" >");

    document.write("              <ul class=\"submenu\">");

//    document.write("                   <li><a href=\"gnl-visitors-specialoffers.html\">Special Offers<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-visitors-greenfees.html\">Green Fees<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-visitors-societies.html\">Society Packages<\/a><\/li>");

    document.write("                   <li><a href=\"http:\/\/www.brsgolf.com/lytham/visitor_home.php?course_id=1\" target=\"_blank\">Book Online<\/a><\/li>");

    document.write("                   <li><a href=\"gnl-contactus.html\">Contact Secretary<\/a><\/li>");

    document.write("              <\/ul>");

    document.write("            <\/div>");

    document.write("            <div id=\"members-submenu\" class=\"hide\" >");

    document.write("              <ul class=\"submenu\">");

    document.write("                   <li><a href=\"#nourl\" onclick=\"javascript:toggleTextandLink(this, 'loginpanel', 'Log in to members area', 'Close member login');\">Log in to members area<\/a><\/li>");

    document.write("              <\/ul>");

    document.write("            <\/div>");

    document.write("       <\/div>  <!-- End of Sub Menus -->");

    document.write("");

}



function writeGnlFooter()

{

    document.write("    <div class=\"col float-left\">");

    document.write("       <h1>Links to National Golf Organisations<\/h1>");

    document.write("       <a href=\"http:\/\/www.randa.org\"              target=\"_blank\"><strong>The Royal &amp; Ancient<\/strong><\/a><br \/>");

    document.write("       <a href=\"http:\/\/www.congu.com\"              target=\"_blank\"><strong>Council of National Golf Unions<\/strong> - CONGU<\/a><br \/>");

    document.write("       <a href=\"http:\/\/www.englishgolfunion.org\"   target=\"_blank\"><strong>English Golf Union<\/strong><\/a><br \/>");

    document.write("       <a href=\"http:\/\/www.lgu.org\"                target=\"_blank\"><strong>Ladies Golf Union<\/strong><\/a><br \/>");

    document.write("       <a href=\"http:\/\/www.englishwomensgolf\"      target=\"_blank\"><strong>English Women’s Golf Association<\/strong><\/a><br \/>");

    document.write("    <\/div>");

    document.write("    <div class=\"col float-left\">");

    document.write("       <h1>North West Golf<\/h1>");

    document.write("       <a href=\"http:\/\/www.lancashiregolf.org\"     target=\"_blank\"><strong>Lancashire Golf Union<\/strong><\/a><br \/>");

    document.write("       <a href=\"http:\/\/www.llcga.org\"     target=\"_blank\"><strong>Lancashire Ladies County Golf Association<\/strong><\/a><br \/>");

    document.write("");

    document.write("       <a href=\"http:\/\/www.englandsgolfcoast.com\"  target=\"_blank\"><strong>Englands Golf Coast<\/strong> - North West Golf<\/a>");

    document.write("    <\/div>");

    document.write("    <div class=\"col2 float-right\">");

    document.write("       <h1>Credits<\/h1>");

    document.write("       <p>");

    document.write("         Copyright : <strong>Lytham Green Drive Golf Club, 2012<\/strong><br \/>");

    document.write("         Design by : <strong>LGDGC Web Design<\/strong>");

    document.write("       <\/p>");

    document.write("    <\/div>");

    document.write("");

}



function goto(theAnchor)

{

       window.location.href = "#" + theAnchor ;

}
