/***********************************************
* fcrc-mi20.com
* header, menu, footer and other functions
***********************************************/

// web header
function webheader0() {
  document.write("<div id='webNoPrint' style='text-align: center'>\n")
  document.write("<img style='vertical-align:middle' src='images/fclogobtrans.png' width='240' height='218' border='0'/>&nbsp;&nbsp;&nbsp\n")

  document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"360\" height=\"80\" id=\"chapterbanner\" align=\"middle\">")
  document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\"/>")
  document.write("<param name=\"allowFullScreen\" value=\"false\"/>")
  document.write("<param name=\"movie\" value=\"chapterbanner.swf\"/><param name=\"quality\" value=\"high\"/><param name=\"wmode\" value=\"transparent\"/><param name=\"bgcolor\" value=\"#000000\"/>")
  document.write("<embed src=\"chapterbanner.swf\" quality=\"high\" wmode=\"transparent\" bgcolor=\"#000000\" width=\"360\" height=\"80\" name=\"chapterbanner2\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"/>")
  document.write("</object>")
  document.write("<img style='vertical-align:middle' src='images/chap20patchtrans.png' width='200' height='213' border='0'/><br>\n")

  document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"896\" height=\"48\" id=\"fcrc20menu\" align=\"middle\">")
  document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />")
  document.write("<param name=\"allowFullScreen\" value=\"false\" />")
  document.write("<param name=\"movie\" value=\"fcrc20menu.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"bgcolor\" value=\"#990000\" />")
  document.write("<embed src=\"fcrc20menu.swf\" quality=\"high\" wmode=\"transparent\" bgcolor=\"#990000\" width=\"896\" height=\"48\" name=\"fcrc20menu\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />")
  document.write("</object>")
  document.write("</div><br>\n")
  document.write("<div id='webPrintOnly'><font class='pt12b'>Freedom Cruisers Riding Club - Michigan Chapter #20</font></div>\n")  
  }

// web header
function webheader() {
  document.write("<div id='webNoPrint' style='text-align: center'>\n")
  document.write("<table border=0 style='margin-left: auto; margin-right: auto; text-align: left;'>\n")
  document.write("<tr>\n")
  document.write("<td width='240'><img style='vertical-align:middle' src='images/fclogobtrans.png' width='240' height='218' border='0'/></td>\n")

  document.write("<td>\n")
  document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"360\" height=\"80\" id=\"chapterbanner\" align=\"middle\">")
  document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\"/>")
  document.write("<param name=\"allowFullScreen\" value=\"false\"/>")
  document.write("<param name=\"movie\" value=\"chapterbanner.swf\"/><param name=\"quality\" value=\"high\"/><param name=\"wmode\" value=\"transparent\"/><param name=\"bgcolor\" value=\"#000000\"/>")
  document.write("<embed src=\"chapterbanner.swf\" quality=\"high\" wmode=\"transparent\" bgcolor=\"#000000\" width=\"360\" height=\"80\" name=\"chapterbanner2\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"/>")
  document.write("</object>")
  
  document.write("</td>\n")
  document.write("<td width='240' align='center'><img style='vertical-align:middle' src='images/chap20patchtrans.png' width='200' height='213' border='0'/></td>\n")
  document.write("</tr>\n")
  document.write("</table>\n")

  if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
    document.write("<table width=500 border=1 cellpadding=8 cellspacing=0 align=center style='text-align:center; border-collapse: collapse'>\n")
    document.write("<tr>\n")
    document.write("<td colspan=4><font class='pt12b'>iPhone/iPad/iPod Menu</font></td>\n")
    document.write("</tr>\n")
    document.write("<tr>\n")
    document.write("<td width='125'><font class='pt12'><a href='default.html'>Home</a></font></td>\n")
    document.write("<td width='125'><font class='pt12'><a href='aboutus.html'>About Us</a></font></td>\n")
    document.write("<td width='125'><font class='pt12'><a href='photos.html'>Photos</a></font></td>\n")
    document.write("<td width='125'><font class='pt12'><a href='merchandise.html'>Merchandise</a></font></td>\n")
    document.write("</tr>\n")
    document.write("<tr>\n")
    document.write("<td><font class='pt12'><a href='forums.html'>Forums</a></font></td>\n")
    document.write("<td><font class='pt12'><a href='links.html'>Links</a></font></td>\n")
    document.write("<td><font class='pt12'><a href='contactus.html'>Contact Us</a></font></td>\n")
    document.write("<td><font class='pt12'><a href='memorial.html'>Memorial</a></font></td>\n")
    document.write("</tr>\n")
    document.write("<tr>\n")
    document.write("<td colspan=4><font class='pt12'><a href='http://www.my.calendars.net/fcrcmi20'>Calendar</a></font></td>\n")
    document.write("</tr>\n")
    document.write("<tr>\n")
    document.write("<td colspan=2><font class='pt12'><a href='http://forums.delphiforums.com/fcrc20/start'>Ch 20 Forum</a></font></td>\n")
    document.write("<td colspan=2><font class='pt12'><a href='http://forums.delphiforums.com/michiganfcrc/start'>Michigan State Forum</a></font></td>\n")
    document.write("</tr>\n")
    document.write("<tr>\n")
    document.write("<td colspan=4><font class='pt12'><a href='http://forums.delphiforums.com/fcrc1/start'>National Forum</a></font></td>\n")
    document.write("</tr>\n")
    document.write("</table>\n")
  } else {
    document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"896\" height=\"48\" id=\"fcrc20menu\" align=\"middle\">")
    document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />")
    document.write("<param name=\"allowFullScreen\" value=\"false\" />")
    document.write("<param name=\"movie\" value=\"fcrc20menu.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"bgcolor\" value=\"#990000\" />")
    document.write("<embed src=\"fcrc20menu.swf\" quality=\"high\" wmode=\"transparent\" bgcolor=\"#990000\" width=\"896\" height=\"48\" name=\"fcrc20menu\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />")
    document.write("</object>")
  } 

  document.write("</div><br>\n")
  document.write("<div id='webPrintOnly'><font class='pt12b'>Freedom Cruisers Riding Club - Michigan Chapter #20</font></div>\n")  
}


function webheaderstore() {
  document.write("<div id='webNoPrint' style='text-align: center'>\n")
  document.write("<table border=0 style='margin-left: auto; margin-right: auto; text-align: left;'>\n")
  document.write("<tr>\n")
  document.write("<td width='240'><img style='vertical-align:middle' src='images/fclogobtrans.png' width='240' height='218' border='0'/></td>\n")
  document.write("<td>\n")

  if (window.location.search.substring(1)!="nws=1") {
    document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"360\" height=\"80\" id=\"chapterbanner\" align=\"middle\">")
    document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\"/>")
    document.write("<param name=\"allowFullScreen\" value=\"false\"/>")
    document.write("<param name=\"movie\" value=\"chapterbanner.swf\"/><param name=\"quality\" value=\"high\"/><param name=\"wmode\" value=\"transparent\"/><param name=\"bgcolor\" value=\"#000000\"/>")
    document.write("<embed src=\"chapterbanner.swf\" quality=\"high\" wmode=\"transparent\" bgcolor=\"#000000\" width=\"360\" height=\"80\" name=\"chapterbanner2\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"/>")
    document.write("</object>")
    document.write("<br>&nbsp;<br>\n")
  }

  document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"360\" height=\"80\" id=\"chapterbanner\" align=\"middle\">")
  document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\"/>")
  document.write("<param name=\"allowFullScreen\" value=\"false\"/>")
  document.write("<param name=\"movie\" value=\"storebanner.swf\"/><param name=\"quality\" value=\"high\"/><param name=\"wmode\" value=\"transparent\"/><param name=\"bgcolor\" value=\"#000000\"/>")
  document.write("<embed src=\"storebanner.swf\" quality=\"high\" wmode=\"transparent\" bgcolor=\"#000000\" width=\"360\" height=\"80\" name=\"chapterbanner2\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"/>")
  document.write("</object>")
  
  document.write("</td>\n")
  document.write("<td width='240'><img style='vertical-align:middle' src='images/fclogobtrans.png' width='240' height='218' border='0'/></td>\n")
  document.write("</tr>\n")
  document.write("</table>\n")

  if (window.location.search.substring(1)=="nws=1") {
    document.write("<div style='background: #000 url(\"images/menugrad.png\") repeat-x 0 0; text-align: left; height: 32px; padding: 0px 8px; margn:1em 0em'>\n");
    document.write("<p style='margin-top:2px; padding: 6px 0px;'><a class='nws' href='http://www.freedom-cruisers.org/index.asp'>Home</a></p>\n");
    document.write("</div>\n");
  }
  else {
    document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"896\" height=\"48\" id=\"fcrc20menu\" align=\"middle\">")
    document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />")
    document.write("<param name=\"allowFullScreen\" value=\"false\" />")
    document.write("<param name=\"movie\" value=\"fcrc20menu.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"bgcolor\" value=\"#990000\" />")
    document.write("<embed src=\"fcrc20menu.swf\" quality=\"high\" wmode=\"transparent\" bgcolor=\"#990000\" width=\"896\" height=\"48\" name=\"fcrc20menu\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />")
    document.write("</object>")
  }

  document.write("</div><br>\n")
  document.write("<div id='webPrintOnly'><font class='pt12b'>Freedom Cruisers Riding Club - Merchandise</font></div>\n")  
}


// page title
function pagetitle(stitle) {
  document.write("<div style='text-align: center'>\n")
  document.write("<span class='pt14b'><font color='red'>*</font><font color='white'>*</font><font color='blue'>*</font>&nbsp;&nbsp;\n")
  document.write("<font color='white'>"+stitle+"</font>\n")
  document.write("&nbsp;&nbsp;<font color='blue'>*</font><font color='white'>*</font><font color='red'>*</font></span>\n")
  document.write("</div><br>\n")
}


// fcrc radio
function jsfcrcradio() {
  if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
    document.write("\n")
  } 
  else {
    document.write("<p style='text-align:center'><a class='pt10' href='javascript:OpenRadio();'>FCRC Chapter 20 Radio</a></p>\n")
  }
}


// fcrc Image Rotater
function jsfcrcimagerotater() {
  if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
    document.write("\n")
  } 
  else {
    document.write("<p style='text-align:center'>\n")
    document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='720' height='180' id='FCRC20ImageRotator' align='middle'>\n")
    document.write("<param name='allowScriptAccess' value='sameDomain' />\n")
    document.write("<param name='allowFullScreen' value='false' />\n")
    document.write("<param name='movie' value='FCRC20ImageRotator.swf' />\n")
    document.write("<param name='quality' value='high' />\n")
    document.write("<param name='wmode' value='transparent' />\n")
    document.write("<param name='bgcolor' value='#000000' />\n")
    document.write("<embed src='FCRC20ImageRotator.swf' quality='high' wmode='transparent' bgcolor='#000000' width='720' height='180' name='FCRC20ImageRotator' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\n")
    document.write("</object></p>\n")
    document.write("")
  }
}


// menu highlight
function hilite(imgname,imgobj) {
  document.getElementById(imgname).src = eval(imgobj + ".src");
}


// web footer
function webfooter() {
  document.write("<div style='text-align: center'>\n")
  document.write("<div id='webNoPrint'><img src='images/flagbanner.png' width='800' height='18' border='0'/><br></div>\n")  
  document.write("<div id='webPrintOnly'><hr width='50%'></div>\n")  
  document.write("<font class='pt08' color='yellow'>Copyright 2009-2012, FCRC Chapter 20</font>\n")
  document.write("</div\n")
}

// Email fixes
// ===========
/*
//presemail
function presemail() {
  var email = "president"
  var domain = "fcrc20.com"
  document.write ("<a href='"+"mail"+"to:"+email+"@"+domain + "'>"+email+"@"+domain + "</a>")
}

//vpemail
function vpemail() {
  var email = "vp"
  var domain = "fcrc20.com"
  document.write ("<a href='"+"mail"+"to:"+email+"@"+domain + "'>"+email+"@"+domain + "</a>")
}

//mbrdiremail
function mbrdiremail() {
  var email = "membershipdirector"
  var domain = "fcrc20.com"
  document.write ("<a href='"+"mail"+"to:"+email+"@"+domain + "'>"+email+"@"+domain + "</a>")
}

//treasureremail
function trsremail() {
  var email = "treasurer"
  var domain = "fcrc20.com"
  document.write ("<a href='"+"mail"+"to:"+email+"@"+domain + "'>"+email+"@"+domain + "</a>")
}

//webmstremail
function webmstremail() {
  var email = "webmaster"
  var domain = "fcrc20.com"
  document.write ("<a href='"+"mail"+"to:"+email+"@"+domain + "'>"+email+"@"+domain + "</a>")
}

//statepresemail
function statepresemail() {
  var email = "diamonddot55"
  var domain = "att.net"
  document.write ("<a href='"+"mail"+"to:"+email+"@"+domain + "'>"+email+"@"+domain + "</a>")
}
*/


// Returns the current system time as a string in hh:mm am/pm format.
function NowTime() {
  var now=new Date()
  var hours=now.getHours()
  var minutes=now.getMinutes()
  timeStr=""+((hours > 12) ? hours - 12 : hours)
  timeStr+=((minutes < 10) ? ":0" : ":") + minutes
  timeStr+=(hours >= 12) ? " PM" : " AM"
  return timeStr
}

//ReplaceAll
function replaceAll(txt, replace, with_this){
  return txt.replace(new RegExp(replace, 'g'),with_this);
}


// Get Full Date
function FullDate() {
  var now = new Date();
  var DayName = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
  var MthName = new Array("January", "February", "March", "April", "May", "June", "July", "August", 
                          "September", "October", "November", "December");
  return DayName[now.getDay()]+", "+MthName[now.getMonth()]+" "+now.getDate()+", "+now.getFullYear()
}


// Status Bar Text
function StatMsg(message) {
  window.status = message;
}


// Create Bookmark Link
function CreateBookmarkLink() {
  title = "FCRC - Michigan 20";
  url = "http://www.fcrc20.com";
  //url = "http://www.fcrc-mi20.com";
  if (window.sidebar) {
    // Mozilla Firefox Bookmark
    window.sidebar.addPanel(title, url,"");
  } else if(window.external) {
    // IE Favorite
    window.external.AddFavorite( url, title);
  }	else if(window.opera && window.print) {
    // Opera Hotlist
    return true;
  }
}

