function validateEmail(){
  emailpat = /^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+$/;
  if(!emailpat.test(document.forms.emailForm.email.value)) {
    alert('Please enter a valid email address.');
    document.forms.emailForm.email.focus();
    document.forms.emailForm.email.select();
    return false;
  }
  return true;
}    

function includeHeader(title, page_id,height,width) {
if (typeof height == "undefined") height=384;
if (typeof width == "undefined") width=640;
if (typeof page_id == "undefined") page_id="undefined";
document.write('<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">');
document.write('<title>SavageMan Triathlon Festival</title>');
document.write('<script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>');
 switch (page_id) {
    case "bike_half_map": case "bike_intl_map": case "run_intl_map": case "run_half_map": case "swim_intl_map": case "swim_half_map":
    case "swim_intl": case "swim_half": case "bike_intl": case "bike_half": case "run_intl": case "run_half":
        document.write('<script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.3"></script>');
        document.write('<script type="text/javascript" src="scripts/bingmap.js"></script>');
        break;
    }
document.write('<script type="text/javascript" src="scripts/img_rotator.js"></script>');
document.write('<script type="text/javascript" src="scripts/csshorizontalmenu.js"></script>');
document.write('<link rel="stylesheet" type="text/css" href="css/csshorizontalmenu.css">');
document.write('<link rel="stylesheet" type="text/css" href="css/sm.css">');
document.write('\
<table align="center" style="background-color: rgb(255, 255, 204); width: 740px; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="0" cellspacing="0">\
  <tbody>\
  <tr><td align="center"><a href="index.htm"><img style="border:0px solid;" alt="" src="Images/main_banner.jpg"></a></td></tr>');
var iLen = String(page_id).length;  
if (String(page_id).substring(iLen, iLen - 3) != 'map') {
  document.write('\
  <tr>\
    <td>\
      <div class="horizontalcssmenu" style="position:absolute; z-index:100;background: url(Images/menu.gif); height:24px;">\
        <ul id="cssmenu1">\
          <li><a style="width: 178px; height: 24px;" href="index.htm">&nbsp;</a>\
          <ul>\
            <li><a style="width: 285px; text-align:center" href="index.htm"><span style="font-size: 14px;">SavageMan Triathlon Festival</span></a></li>\
            <li><a style="width: 285px; height=10px;"><span style="font-size: 1px;"><hr /></span></a></li>\
            <li><a style="width: 285px;" href="Athletes_Guide.html">2010 Athletes Guide</a></li>\
            <li><a style="width: 285px;" href="Timeline.html">2010 Schedule of Events</a></li>\
            <li><a style="width: 285px;" href="Shuttle.html">2010 Westernport Wall Shuttle Tickets</a></li>\
            <li><a style="width: 285px;" href="dinner_purchase.html">2010 CarboLoad Dinner Tickets</a></li>\
            <li><a style="width: 285px; height=10px;"><span style="font-size: 1px;"><hr /></span></a></li>\
            <li><a style="width: 285px;" href="Race_Venue.html">Race Venue</a></li>\
            <li><a style="width: 285px;" href="DCL_Activities.html">Garrett County & Deep Creek Lake Area</a></li>\
            <li><a style="width: 285px;" href="Directions.html">Getting There</a></li>\
            <li><a style="width: 285px;" href="Lodging.html">Lodging</a></li>\
            <li><a style="width: 285px;" href="Sponsors.html">SavageMan Sponsors</a></li>\
            <li><a style="width: 285px;" href="FAQ.html">FAQs</a></li>\
            <li><a style="width: 285px; height=10px;"><span style="font-size: 1px;"><hr /></span></a></li>\
            <li><a style="width: 285px;" href="ClubChallenge.html">Club Challenge Competition</a></li>\
            <li><a style="width: 285px;" href="Fundraising.html">Fundraising Premiums and Awards</a></li>\
            <li><a style="width: 285px;" href="Volunteers.html">Volunteer Information</a></li>\
            <li><a style="width: 285px; height=10px;"><span style="font-size: 1px;"><hr /></span></a></li>\
            <li><a style="width: 285px;" href="media_library.html">Search Athlete Photos and Videos</a></li>\
            <li><a style="width: 285px; height=10px;"><span style="font-size: 1px;"><hr /></span></a></li>\
            <li><a style="width: 285px;" href="jersey_purchase.html">SavageMan Bike Jerseys For Sale</a></li>\
            <li><a style="width: 285px; height=10px;"><span style="font-size: 1px;"><hr /></span></a></li>\
            <li><a style="width: 285px;" href="TriToWin_Events.html">About "TRI-TO-WIN" Events</a></li>\
            <li><a style="width: 285px;" href="http://www.melanomaresource.org" target="_blank">About Joanna M Nicolay<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Melanoma Foundation</a></li>\
            <li><a style="width: 285px; height=10px;"><span style="font-size: 1px;"><hr /></span></a></li>\
            <li><a style="width: 285px;" href="http://www.facebook.com/savagemantri" target="_blank">Be a Friend of SavageMan on Facebook</a></li>\
            <li><a style="width: 285px; border-bottom-width: 1px;" href="mailto:info@savagemantri.org">Contact Us</a></li>\
          </ul>\
        </li>\
        <li><a style="width: 155; height: 24px;" href="SavageMan_Half.html">&nbsp;</a>\
          <ul>\
            <li><a style="width: 220px; text-align:center" href="SavageMan_Half.html"><span style="font-size: 14px;">SavageMan 70.0 Triathlon</span><br>The World\'s Most Savage Triathlon</a></li>\
            <li><a style="width: 220px; height=10px;"><span style="font-size: 1px;"><hr /></span></a></li>\
            <li><a style="width: 220px;" href="Swim_Course.html">Swim Course</a></li>\
            <li><a style="width: 220px;" href="Bike_Course.html">Bike Course</a></li>\
            <li><a style="width: 220px;" href="Run_Course.html">Run Course</a></li>\
            <li><a style="width: 220px; height=10px;"><span style="font-size: 1px;"><hr /></span></a></li>\
            <li><a style="width: 220px;" href="Westernport_Wall.html">The Westernport Wall</a></li>\
            <li><a style="width: 220px;" href="Big_Savage.html">Big Savage Mountain</a></li>\
            <li><a style="width: 220px;" href="Miller.html">Killer Miller</a></li>\
            <li><a style="width: 220px; height=10px;"><span style="font-size: 1px;"><hr /></span></a></li>\
            <li><a style="width: 220px;" href="PrizeMoney.html">Prize Purse & Stage Prime, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Course Record Incentives</a></li>\
            <li><a style="width: 220px;" href="PrizeMoney.html">Hammer Nutrition Big Savage<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mountain Challenge</a></li>\
            <li><a style="width: 220px; height=10px;"><span style="font-size: 1px;"><hr /></span></a></li>\
            <li><a style="width: 220px; border-bottom-width: 1px;" href="Testimonials.html">What Athletes Are Saying<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;About the SavageMan 70.0</a></li>\
          </ul>\
        </li>\
        <li><a style="width: 154px; height: 24px;" href="SavageMan_Intl.html">&nbsp;</a>\
          <ul>\
            <li><a style="width: 220px; text-align:center" href="SavageMan_Intl.html"><span style="font-size: 14px;">SavageMan 30.0 Triathlon</span></a></li>\
            <li><a style="width: 220px; height=10px;"><span style="font-size: 1px;"><hr /></span></a></li>\
            <li><a style="width: 220px;" href="Swim_Course_Intl.html"> Swim Course</a></li>\
            <li><a style="width: 220px;" href="Bike_Course_Intl.html">Bike Course</a></li>\
            <li><a style="width: 220px; border-bottom-width: 1px;" href="Run_Course_Intl.html">Run Course</a></li>\
          </ul>\
        </li>\
        <li><a style="width: 106px; height: 24px;" href="Testimonials.html">&nbsp;</a>\
          <ul>\
            <li><a style="width: 250px;" href="media_library.html">Search Athlete Photos and Videos</a></li>\
            <li><a style="width: 250px;" href="Testimonials.html">Participant Testimonials</a></li>\
            <li><a style="width: 250px;" href="http://www.racevine.com/events/mchenry-md/savageman-triathlon-festival" target="_blank">Race Reports</a></li>\
            <li><a style="width: 250px; height=10px;"><span style="font-size: 1px;"><hr /></span></a></li>\
            <li><a style="width: 250px;" href="2009_Results.html">2009 SavageMan Results</a></li>\
            <li><a style="width: 250px;" href="2009_brick_winners.html">2009 "Brick In the Wall" Recipients</a></li>\
            <li><a style="width: 250px;" href="2009_video.html">2009 Westernport Wall Video</a></li>\
            <li><a style="width: 250px; height=10px;"><span style="font-size: 1px;"><hr /></span></a></li>\
            <li><a style="width: 250px;" href="2008_Results.html">2008 SavageMan Results</a></li>\
            <li><a style="width: 250px;" href="2008_brick_winners.html">2008 "Brick In the Wall" Recipients</a></li>\
            <li><a style="width: 250px;" href="2008_summary.html">2008 Race Summary</a></li>\
            <li><a style="width: 250px;" href="2008_video.html">2008 Westernport Wall Video</a></li>\
            <li><a style="width: 250px; height=10px;"><span style="font-size: 1px;"><hr /></span></a></li>\
            <li><a style="width: 250px;" href="2007_Results.html">2007 SavageMan Results</a></li>\
            <li><a style="width: 250px;" href="2007_brick_winners.html">2007 "Brick In the Wall" Recipients</a></li>\
            <li><a style="width: 250px;" href="2007_summary.html">2007 Race Summary</a></li>\
            <li><a style="width: 250px; border-bottom-width: 1px;" href="2007_video.html">2007 Westernport Wall Video</a></li>\
          </ul>\
        </li>\
        <li><a style="width: 86px; height: 24px;" href="http://www.melanomaresource.org" target="_blank">&nbsp;</a>\
          <ul>\
            <li><a style="width: 250px;" href="http://www.winthefight.org/frederickkidstri.htm" target="_blank">Frederick Kids Triathlon</a></li>\
            <li><a style="width: 250px;" href="http://www.winthefight.org/southcarrollsprint.htm" target="_blank">South Carroll Sprint Triathlon</a></li>\
            <li><a style="width: 250px; border-bottom-width: 1px;" href="http://www.winthefight.org/granfondo/index.htm" target="_blank">Garrett County Gran Fondo</a></li>\
          </ul>\
        </li>\
        <li><a style="width: 61px; height: 24px;" href="registration.html" target="_blank">&nbsp;</a>\
          <ul>\
            <li><a style="width: 285px;" href="registration.html" target="_blank">Register for 2010 SavageMan Triathlon</a></li>\
            <li><a style="width: 285px; height=10px;"><span style="font-size: 1px;"><hr /></span></a></li>\
            <li><a style="width: 285px; border-bottom-width: 1px;" href="Participants_2010.html" target="_blank">2010 Participant List</a></li>\
          </ul>\
        </li>\
      </ul>\
      </div>\
    </td></tr>\
    ');
    }
  document.write('\
    <tr><td>\
      <table style="text-align: left; width: 100%;" border="0" cellpadding="5" cellspacing="0">\
        <tbody>\
          <tr><td style="vertical-align: top;">\
            <div class="title"><br>' + title + '<br></div>\
            <table class="standardlight" style="text-align: left; width: 100%;" border="0" cellpadding="5" cellspacing="0">\
              <tbody>');
var bAbort=false;
switch (page_id) {
    case "bike_half_map":
    case "bike_intl_map":
    case "run_intl_map":
    case "run_half_map":
    case "swim_intl_map":
    case "swim_half_map":
    case "media":
        bAbort=true;
    case "home":
    case "home_intl":
    case "home_half":
    case "swim_intl":
    case "swim_half":
    case "bike_intl":
    case "bike_half":
    case "run_intl":
    case "run_half":
    case "wall":
    case "bsm":
    case "miller":
    case "clubs":
    case "volunteers":
    case "venue":
    case "testimonials":
    case "results_2007":
    case "results_2008":
    case "results_2009":
    case "lodging":
    {
      document.write('    <input type="hidden" id="page_id" value="' + page_id + '">');
      if (bAbort==false) {
          document.write('<tr><td style="text-align:center"><div style="width:' + width + 'px; height:' + height +'px; position:relative; margin-left: auto; margin-right: auto;">');      document.write('    <a href="javascript:tosrc()"><img id="r0" style="position:absolute; left:0; top:0; border-style: none;" width="' + width +'px" height="' + height +'px"></a>');
          document.write('    <img id="r1" style="position:absolute; left:0; bottom:0;">\
          <img id="r2" style="position:absolute; right:0; bottom:0;">\
          <img id="r3" style="position:absolute; right:0; top:0;">\
          <img id="r4" style="position:absolute; left:0; top:0;">\
          </div></td></tr>');
       }
      break;
     }
  }
}

function includeFooter() {
document.write('\
            </tbody>\
          </table>\
        </td></tr>\
        </tbody>\
      </table>\
    </td></tr>\
  <tr style="background-color: rgb(203,219,43);">\
    <td>\
      <table style="text-align: left; width: 100%;" border="0" cellpadding="4" cellspacing="0">\
        <tbody>\
          <tr>\
            <td style="width:58%;"><span class="standard">Don\'t miss out on the latest news and updates on the SavageMan Triathlon.  Add your email to keep up-to-date!</span></td>\
            <td>\
              <form name="emailForm" method="post"; style="margin-bottom:0;">\
              <input type="text" name="email" value="enter your email here" style="width:100%;" class="standardlight">\
              <input type="button" name="task" class="standard" value="Subscribe to Updates" onClick=\'document.forms.emailForm.action="email_received.html"; if (validateEmail()==true) document.forms.emailForm.submit();\'>\
<input type="button" name="task" class="standard" value="Unsubscribe" onClick=\'document.forms.emailForm.action="email_removed.html"; if (validateEmail()==true) document.forms.emailForm.submit();\'></form>\
              </td>\
          </tr>\
        </tbody>\
      </table>\
    </td>\
  </tr>\
  <tr><td style="height: 44px;"><img style="border: 0px solid;" alt="" src="Images/footer.gif"></td></tr>\
</tbody>\
</table>\
<script type="text/javascript">\
  var pageTracker = _gat._getTracker("UA-3246780-1");\
  pageTracker._initData();\
  pageTracker._trackPageview();\
</script>\
');
}
