
function header()
{
  document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">');
  document.write(' <tr>');
  document.write('  <td valign="top" height="169px">');
  document.write('   <table width="100%">');
  document.write('    <tr>');
  document.write('     <td align="center">');
  document.write('      <img src="../images/header.jpg" border="1" width="600px" height="169px" alt="Merchants of Edinburgh Golf Club"/>');
  document.write('     </td>');
  document.write('    </tr>');
  document.write('   </table>');
  document.write('  </td>');
  document.write(' </tr>');
  document.write('</table>');
}

function megcMenu()
{
  document.write('<div style="padding:0px;margin:0px">');


  document.write('<table width="100%" border="0" cellpadding="0" cellspacing="0">');
  document.write('<tr>');
  document.write('<td width="100%" border="0" cellpadding="0" cellspacing="0">');


  document.write('            <table width="100%" border="0" cellpadding="0" cellspacing="0">');
  document.write('             <tr>');
  document.write('              <td class="statusBarLeft"><img src="../images/transparent_pixel.gif" border="0"/><td>');
  document.write('              <td class="statusBarMiddle" valign="middle" width="100%">');
  document.write('               <table width="100%" border="0" cellpadding="0" cellspacing="0">');
  document.write('                <tr>');
  document.write('                 <td class="topBar" width="100%">');
  document.write('                  <table width="100%" border="0" cellpadding="0" cellspacing="0">');
  document.write('                   <tr>');
  document.write('                    <td width="10px"/>');
  document.write('                    <td align="center"><font class="textBold">M.E.G.C.</font></td>');
  document.write('                    <td width="10px"/>');
  document.write('                   </tr>');
  document.write('                  </table>');
  document.write('                 </td>');
  document.write('                </tr>');
  document.write('               </table>');
  document.write('              </td>');
  document.write('              <td class="statusBarRight"><img src="../images/transparent_pixel.gif" border="0"/></td>');
  document.write('             </tr>');
  document.write('            </table>');

  document.write('</td>');
  document.write('</tr>');
  document.write('<tr>');
  document.write('<td height="3px"/>');
  document.write('</tr>');
  document.write('<tr>');
  document.write('<td width="100%">');



  document.write('          <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff">');

  document.write('           <tr>');
  document.write('            <td class="topLeftCorner"></td>');
  document.write('            <td class="middleLineTop"><img src="../images/transparent_pixel.gif" border="0"/></td>');
  document.write('            <td class="topRightCorner"></td>');
  document.write('           </tr>');


  document.write('           <tr>');
  document.write('            <td class="menuMiddleLeft"></td>');
  document.write('            <td>');
  document.write('             <table border="0" width="100%" cellpadding="0" cellspacing="0">');
  document.write('              <tr>');
  document.write('               <td height="1px"/>');
  document.write('              </tr>');
  document.write('              <tr>');
  document.write('               <td width="1px"/>');
  document.write('               <td class="blueBackground">');
  document.write('                <table border="0" width="100%" cellpadding="0" cellspacing="0">');
  document.write('                 <tr>');
  document.write('                  <td>');
  document.write('                   <a href="megc_home.php" class="menu">&nbsp;Home</a>');
  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td>');
  document.write('                   <a href="megc_catering.php" class="menu">&nbsp;Catering</a>');
  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td>');
  document.write('                   <a href="megc_history.php" class="menu">&nbsp;History</a>');
  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td>');
  document.write('                   <a href="megc_clubhouse.php" class="menu">&nbsp;Clubhouse</a>');
  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td>');
  document.write('                   <a href="megc_contact.php" class="menu">&nbsp;Contact Us</a>');
  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td>');
  document.write('                   <a href="megc_course.php" class="menu">&nbsp;Course</a>');
  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td>');
  document.write('                   <a href="megc_join.php" class="menu">&nbsp;Join the Club</a>');
  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td>');
  document.write('                   <a href="megc_links.php" class="menu">&nbsp;Links</a>');
  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td>');
  document.write('                   <a href="megc_location.php" class="menu">&nbsp;Location</a>');
  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td>');
  document.write('                   <a href="megc_competitions.php" class="menu">&nbsp;Open Competitions</a>');
  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td>');
  document.write('                   <a href="megc_policy.php" class="menu">&nbsp;Policy Documents</a>');
  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td>');
  document.write('                   <a href="megc_pro.php" class="menu">&nbsp;Professional Shop</a>');
  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td>');
  document.write('                   <a href="megc_visitor.php" class="menu">&nbsp;Visitor</a>');
  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td height="4px"/>');
  document.write('                 </tr>');
  document.write('                </table>');
  document.write('               </td>');
  document.write('               <td width="1px"/>');
  document.write('              </tr>');
  document.write('              <tr>');
  document.write('               <td height="1px"/>');
  document.write('              </tr>');
  document.write('             </table>');
  document.write('            </td>');
  document.write('            <td class="menuMiddleRight"></td>');
  document.write('           </tr>');
  document.write('           <tr>');
  document.write('            <td class="bottomLeftCorner"></td>');
  document.write('            <td class="middleLineBottom"></td>');
  document.write('            <td class="bottomRightCorner"></td>');
  document.write('           </tr>');
  document.write('          </table>');

  document.write('</td>');
  document.write('</tr>');
  document.write('</table>');

  document.write('         </div>');
}

function membersLogin()
{
  document.write('<script language="javascript">');
  document.write('function getkey(e)');
  document.write('{');
  document.write('  if (window.event)');
  document.write('     return window.event.keyCode;');
  document.write('  else if (e)');
  document.write('          return e.which;');
  document.write('       else');
  document.write('          return null;');
  document.write('}');
  document.write('function toggleLoginButton(event)');
  document.write('{');
  document.write('   if ((loginForm.user_name.value!="") && (loginForm.user_password.value!=""))');
  document.write('   {');
  document.write('      var key=getkey(event);');
  document.write('      if (key==13) loginForm.submit();');
  document.write('      loginForm.loginButton.disabled=false;');
  document.write('   }');
  document.write('   else');
  document.write('      loginForm.loginButton.disabled=true;');
  document.write('}');
  document.write('</script>');
  document.write('<div style="padding:0px;margin:0px">');
  document.write('          <table border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff">');
  document.write('           <tr>');
  document.write('            <td width="3px" class="menuTopLeft"></td>');
  document.write('            <td width="150px" class="menuTopMiddle"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top" align="left"><img src="../images/gologin.gif" border="0"/></td><td><font class="textBold">Members Area</font></td></tr></table></td>');
  document.write('            <td width="3px" class="menuTopRight"></td>');
  document.write('           </tr>');
  document.write('           <tr>');
  document.write('            <td class="menuMiddleLeft"></td>');
  document.write('            <td>');
  document.write('             <table border="0" width="100%" cellpadding="0" cellspacing="0">');
  document.write('              <tr>');
  document.write('               <td height="1px"/>');
  document.write('              </tr>');
  document.write('              <tr>');
  document.write('               <td width="1px"/>');
  document.write('               <td class="blueBackground">');
  document.write('                <form name="loginForm" method="post" action="login_action.php" class="form">');
  document.write('                <table border="0" width="100%" cellpadding="0" cellspacing="0">');
  document.write('<tr><td height="4px"/></tr>');
  document.write('                 <tr>');
  document.write('                  <td class="textBold" align="right">');
  document.write('                   User:&nbsp;&nbsp;');
  document.write('                  </td>');
  document.write('                  <td>');
  document.write('                   <input type="text" name="user_name" size="8" maxlength="15" class="text" onkeyup="javascript:toggleLoginButton(event);"/>');
  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td class="textBold" align="right">');
  document.write('                   Password:&nbsp;&nbsp;');
  document.write('                  </td>');
  document.write('                  <td>');
  document.write('                   <input type="password" name="user_password" size="8" maxlength="8" class="text" onkeyup="javascript:toggleLoginButton(event);"/>');
  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td height="8px"/>');
  document.write('                 </tr>');


  document.write('                 <tr>');
  document.write('                  <td align="center" colspan="2" class="text10pt">');

  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td height="8px"/>');
  document.write('                 </tr>');


  document.write('                 <tr>');
  document.write('                  <td align="center" colspan="2">');
  document.write('                   <table border="0" cellpadding="0" cellspacing="0">');
  document.write('                    <tr>');
  document.write('                     <td/> ');
  document.write('                     <td align="center" width="138px">');
  document.write('                      <input type="button" name="loginButton" class="membersButton" value="Login" disabled="true" onclick="loginForm.submit();"/>');
  document.write('                     </td>');
  document.write('                     <td/>');
  document.write('                    </tr>');
  document.write('                   </table>');
  document.write('                  </td>');
  document.write('                 </tr>');
  document.write('                 <tr>');
  document.write('                  <td height="4px"/>');
  document.write('                 </tr>');
  document.write('                </table>');
  document.write('                </form>');
  document.write('               </td>');
  document.write('               <td width="1px"/>');
  document.write('              </tr>');
  document.write('              <tr>');
  document.write('               <td height="1px"/>');
  document.write('              </tr>');
  document.write('             </table>');
  document.write('            </td>');
  document.write('            <td class="menuMiddleRight"></td>');
  document.write('           </tr>');
  document.write('           <tr>');
  document.write('            <td class="menuBottomLeft"></td>');
  document.write('            <td class="menuBottomMiddle"></td>');
  document.write('            <td class="menuBottomRight"></td>');
  document.write('           </tr>');
  document.write('          </table>');
  document.write('         </div>');
}

function contact()
{
  document.write('<div id="contactDiv">');
  document.write('          <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff">');
  document.write('           <tr>');
  document.write('            <td class="menuTopLeft"></td>');
  document.write('            <td class="menuTopMiddle" align="center"><font class="textBold">Contact</font></td>');
  document.write('            <td class="menuTopRight"></td>');
  document.write('           </tr>');
  document.write('           <tr>');
  document.write('            <td class="menuMiddleLeft"></td>');
  document.write('            <td class="blueBackground" align="center">');
  document.write('             <table border="0" cellpadding="0" cellspacing="0">');
  document.write('              <tr>');
  document.write('               <td class="textBold">Sec:</td><td class=rite2><span class="rite">+44 (0) 131 447 1219</span></td>');
  document.write('              </tr>');
  document.write('              <tr>');
  document.write('               <td class="textBold">Fax:</td><td class=rite2><span class="rite">+44 (0) 131 446 9833</span></td>');
  document.write('              </tr>');
  document.write('              <tr>');
  document.write('               <td class="textBold">Pro:</td><td class=rite2><span class="rite">+44 (0) 131 447 8709</span></td>');
  document.write('              </tr>');
  document.write('             </table>');
  document.write('            </td>');
  document.write('            <td class="menuMiddleRight"></td>');
  document.write('           </tr>');
  document.write('           <tr>');
  document.write('            <td class="menuBottomLeft"></td>');
  document.write('            <td class="menuBottomMiddle"><img src="../images/transparent_pixel.gif" border="0"/></td>');
  document.write('            <td class="menuBottomRight"></td>');
  document.write('           </tr>');
  document.write('          </table>');
  document.write('         </div>');
}

function topStatusBar(edinburgh,weather,secretary,howdidido,summerleague,sex)
{
  document.write('<table border="0" width="100%" cellpadding="0" cellspacing="0">');
  document.write('          <tr>');
  document.write('           <td width="100%" cellpadding="0" cellspacing="0" border="0">');
  document.write('            <table width="100%" border="0" cellpadding="0" cellspacing="0">');
  document.write('             <tr>');
  document.write('              <td class="statusBarLeft"><img src="../images/transparent_pixel.gif" border="0"/><td>');
  document.write('              <td class="statusBarMiddle" valign="middle" width="100%">');
  document.write('               <table width="100%" border="0" cellpadding="0" cellspacing="0">');
  document.write('                <tr>');
  document.write('                 <td class="topBar" width="100%">');
  document.write('                  <table width="100%" border="0" cellpadding="0" cellspacing="0">');
  document.write('                   <tr>');

  if (edinburgh)
  {
     document.write('                    <td width="10px"/>');
     document.write('                    <td width="80px" class="topBar">');
     document.write('                     <a href="#" onclick="javascript:viewEdinburgh();" class="headerLink">');
     document.write('                      <img src="../images/newWin.gif" border="0" alt="Edinburgh"/>&nbsp;Edinburgh');
     document.write('                     </a>');
     document.write('                    </td>');
  }

  if (weather)
  {
     document.write('                    <td width="10px"/>');
     document.write('                    <td width="80px" class="topBar">');
     document.write('                     <a href="#" onclick="javascript:viewWeather();" class="headerLink">');
     document.write('                      <img src="../images/clouds.gif" border="0" alt="Weather"/>&nbsp;Weather');
     document.write('                     </a>');
     document.write('                    </td>');
  }

  if (secretary)
  {
     document.write('                    <td width="10px"/>');
     document.write('                    <td width="120px" class="topBar">');
     document.write('                     <a href="mailto:admin@merchantsgolf.com" class="headerLink">');
     document.write('                      <img src="../images/mail.gif" border="0" alt="Email Secretary"/>&nbsp;Email Secretary');
     document.write('                     </a>');
     document.write('                    </td>');
  }

  if (howdidido)
  {
     document.write('<td width="10px"/>');
     document.write('               <td width="100px" class="topBar">');
     document.write('                <a href="#" onclick=javascript:viewHowDidIDo("'+sex+'"); class="headerLink" ');
     document.write('                              onmouseover=document.thumbImage.src="../images/thumbs_down.gif" ');
     document.write('                              onmouseout=document.thumbImage.src="../images/thumbs_up.gif">');
     document.write('                 <img name="thumbImage" src="../images/thumbs_up.gif" border="0" alt="HowDidIDo"/>&nbsp;HowDidIDo');
     document.write('                </a>');
     document.write('               </td>');
  }

  if (summerleague)
  { 
     document.write('               <td width="10px"/>');
     document.write('               <td width="130px" class="topBar">');
     document.write('                <a href="#" onclick="javascript:viewEdinburghSummerLeague();" class="headerLink">');
     document.write('                 <img src="../images/table.gif" border="0" alt="Edinburgh Summer League"/>&nbsp;Summer League');
     document.write('                </a>');
     document.write('               </td>');
  }

  document.write('                    <td width="10px"/>');
  document.write('                    <td class="dateTime">');
  document.write('                     <script language="javascript" type="text/javascript">outputDate();</script>');
  document.write('                     <span id="clock"></span>');
  document.write('                    </td>');
  document.write('                    <td width="10px"/>');
  document.write('                   </tr>');
  document.write('                  </table>');
  document.write('                 </td>             ');
  document.write('                </tr>   ');
  document.write('               </table>');
  document.write('              </td>');
  document.write('              <td class="statusBarRight"><img src="../images/transparent_pixel.gif" border="0"/></td>');
  document.write('             </tr>');
  document.write('            </table>');
  document.write('           </td>');
  document.write('          </tr>');
  document.write('         </table>      ');
}

function bottomStatusBar(gents,ladies)
{
  document.write('<table border="0" width="100%" cellpadding="0" cellspacing="0">');
  document.write('          <tr>');
  document.write('           <td width="100%" cellpadding="0" cellspacing="0" border="0">');
  document.write('          <table width="100%" border="0" cellpadding="0" cellspacing="0">');
  document.write('           <tr>');
  document.write('            <td class="bottomStatusBarLeft"><img src="../images/transparent_pixel.gif" border="0"/><td>');
  document.write('            <td class="bottomStatusBarMiddle" valign="middle" width="100%">');
  document.write('             <table width="100%" border="0" cellpadding="0" cellspacing="0">');
  document.write('              <tr>');
  document.write('               <td class="topBar" width="100%">');
  document.write('                <table border="0" cellpadding="0" cellspacing="0">');
  document.write('                 <tr>');
  document.write('                  <td class="topBar" width="100%">');
  document.write('                   <table width="100%" border="0" cellpadding="0" cellspacing="0">');
  document.write('                    <tr>');
  document.write('                     <td width="10px"/>');

  if (gents)
  {
     document.write('                     <td width="160px" class="topBar">');
     document.write('                        <a href="#" onclick="javascript:viewLothiansGolfAssociation();" class="headerLink">');
     document.write('                         <img src="../images/newWin.gif" border="0" alt="Lothians Golf Association"/>&nbsp;Lothians Golf Assoc.');
     document.write('                        </a>');
     document.write('                       </td>');
  }

  if (ladies)
  {
     document.write('                     <td width="190px" class="topBar">');
     document.write('                        <a href="#" onclick="javascript:viewMidlothianLadiesGolfAssociation();" class="headerLink">');
     document.write('                         <img src="../images/newWin.gif" border="0" alt="Midlothian Ladies Golf Association"/>&nbsp;Midlothian Ladies Golf Assoc.');
     document.write('                        </a>');
     document.write('                       </td>');
  }

  document.write('                       <td>&nbsp;</td>');
  document.write('                       <td width="10px"/>');
  document.write('                       <td width="140px" class="topBar">');
  document.write('                        <a href="#" onclick="javascript:viewScottishGolfUnion();" class="headerLink">');
  document.write('                         <img src="../images/newWin.gif" border="0" alt="Scottish Golf Union"/>&nbsp;Scottish Golf Union');
  document.write('                        </a>');
  document.write('                       </td>');
  document.write('                       <td>&nbsp;</td>');
  document.write('                       <td width="10px"/>');
  document.write('                       <td width="110px" class="topBar">');
  document.write('                        <a href="#" onclick="javascript:viewScottishGolf();" class="headerLink">');
  document.write('                         <img src="../images/newWin.gif" border="0" alt="Scottish Golf"/>&nbsp;Scottish Golf');
  document.write('                        </a>');
  document.write('                       </td>');
  document.write('                       <td>&nbsp;</td>');
  document.write('                       <td width="10px"/>');
  document.write('                       <td width="130px" class="topBar">');
  document.write('                        <a href="#" onclick="javascript:viewRandA();" class="headerLink">');
  document.write('                         <img src="../images/newWin.gif" border="0" alt="Royal and Ancient"/>&nbsp;Royal&nbsp;&amp;&nbsp;Ancient');
  document.write('                        </a>');
  document.write('                       </td>');
  document.write('                       <td>&nbsp;</td>');
  document.write('                       <td width="10px"/>');
  document.write('                      </tr>');
  document.write('                     </table>');
  document.write('                    </td>');
  document.write('                   </tr>   ');
  document.write('                  </table>');
  document.write('                 </td>         ');    
  document.write('                </tr>   ');
  document.write('               </table>');
  document.write('              </td>');
  document.write('              <td class="bottomStatusBarRight"><img src="../images/transparent_pixel.gif" border="0"/></td>');
  document.write('             </tr>');
  document.write('            </table>');
  document.write('           </td>');
  document.write('          </tr>');
  document.write('         </table> ');
}

function displayArchive(page)
{
  document.write('          <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff">');
  document.write('           <tr>');
  document.write('            <td class="menuTopLeft"></td>');
  document.write('            <td class="menuTopMiddle" align="center"><font class="textBold">View Archive</font></td>');
  document.write('            <td class="menuTopRight"></td>');
  document.write('           </tr>');
  document.write('           <tr>');
  document.write('            <td class="menuMiddleLeft"></td>');
  document.write('            <td class="blueBackground" align="center" height="30px">');
  document.write('             <table border="0" cellpadding="0" cellspacing="0">');
  document.write('              <tr>');
  document.write('               <td>');
  document.write('               <form name="archiveForm" method="post" action="archive_action.php" class="form">');
  document.write('               <input type="hidden" name="page" value="'+page+'"/>');
  document.write('               <select name="archiveYear" class="text10pt">');
  document.write('                <option value=""></option>');
  document.write('                <option value="">Current</option>');
  document.write('                <option value="2008">2008</option>');
  document.write('                <option value="2009">2009</option>');
  document.write('               </select>');
  document.write('               </form>');
  document.write('               </td>');

  document.write('               <td width="5px"/>');
  document.write('               <td>');
  document.write('               <input type="button" value="Go" class="button45" onclick="archiveForm.submit();"/>');
  document.write('               </td>');
  
  document.write('              </tr>');
  document.write('             </table>');
  document.write('            </td>');
  document.write('            <td class="menuMiddleRight"></td>');
  document.write('           </tr>');
  document.write('           <tr>');
  document.write('            <td class="menuBottomLeft"></td>');
  document.write('            <td class="menuBottomMiddle"><img src="../images/transparent_pixel.gif" border="0"/></td>');
  document.write('            <td class="menuBottomRight"></td>');
  document.write('           </tr>');
  document.write('          </table>');
}

function friendlyPrint(name)
{ 
  var disp_setting="toolbar=no,location=no,directories=n,menubar=no,scrollbars=yes,width=650,height=600,left=100,top=25"; 
  var content_vlue=document.getElementById("data"+name).innerHTML; 
  var docprint    =window.open("","",disp_setting); 
         
  docprint.document.open();   
  docprint.document.write("<html><head><title>MEGC</title>"); 
  docprint.document.write('<link href="css/stylesheet.css" rel="stylesheet" type="text/css">');   
  docprint.document.write('</head><body onLoad="self.print();" class="tracetext">');     
  docprint.document.write(content_vlue);   
  docprint.document.write('</body></html>'); 
  docprint.document.close(); 
  docprint.focus();
}

function trim(value)
{
  return value.replace(/^\s+|\s+$/g,'');
}



     