/**
  JavaScript For Texas Thunder Cloggers Website
**/

/**
Under Construction Redirect
document.write ("<meta http-equiv='refresh' content='0;url=http://www.texasthundercloggers.org/thunder/construction.htm'>");  
**/

function menuMouseOver(btn) 
{
  btn.style.color 		= "#FFFFFF"
  btn.style.backgroundColor 	= "#C00000"
}

function menuMouseOut(btn) 
{
  btn.style.color 		= "#FFFFFF"
  btn.style.backgroundColor 	= "#000000"
}

function bioMouseOver(btn) 
{
  btn.style.color 		= "#FFFFFF"
  btn.style.backgroundColor 	= "#00008B"
}

function bioMouseOut(btn) 
{
  btn.style.color 		= "#FFFFFF"
  btn.style.backgroundColor 	= "#4682B4"
}

function getCurrentYear()
{
  var date = new Date();
  var year = date.getYear();
  document.write (year);
}

/**  Java changed with new version --- Firefox displays incorrect, IE correct
function getCurrentYear()
{
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
document.write (year);
}
***************************************************************************/

function getPageLastModifiedDate()
{
  document.write (document.lastModified.substring(0,10));
}

function buildAddr(user)
{
  var mailStr  = "";
  var userName = user;
  var dom      = "TexasThunderCloggers";
  var ext      = ".org";
  var userMail = "";
  var hover    = "Email ";

  if (userName.substring(0,9) == "Webmaster")
  {
    hover = hover + "the ";
  }
  
  if (userName == "Webmaster-Footer")
  {
    hover = hover + userName.substring(0,9);
    userMail = userName.substring(0,9) + "@" + dom + ext;
  }
  else
  {
    userMail = userName + "@" + dom + ext;
    hover    = hover + userName;
  }

  mailStr      = mailStr + "<a href='" + "m" + "a" + "i" + "l" + "t" + "o" + ":"; 
  mailStr      = mailStr + userMail + "' title='" + hover + "' >"; 

  if (userName == "Webmaster-Footer")
  {
    mailStr    = mailStr + userName.substring(0,9);
  }
  else
  {
    mailStr    = mailStr + userMail;
  }

  mailStr      = mailStr + "</a>";
  document.write (mailStr);
}

function backButton()
{
  document.write ("      <table cellpadding='0' cellspacing='20'>");
  document.write ("        <tr>");
  document.write ("          <td nowrap class='backButton'  align='center' title='Go Back' onclick='javascript:history.go(-1)'>&nbsp;Back&nbsp;</td>");
 document.write ("        </tr>");
  document.write ("      </table>");
}

function buildHeader()
{
  document.write ("<a name='top'></a>")
  window.status = "Welcome To The Official Site of The Texas Thunder Cloggers!";
  var screenWidth = screen.width-150;
  document.write ("<table cellpadding='0' cellspacing='0' width='100%'>");
  document.write ("  <tr'>");
  document.write ("    <td align='center'>");
  document.write ("      <table cellpadding='0' cellspacing='0'>");
  document.write ("        <tr>");
  document.write ("          <td align='center'>");
  document.write ("            <img src='includes/images/Texas Thunder Banner.jpg' height='100px' width='"); 
  document.write (                screenWidth); 
  document.write (                "'>");
  document.write ("          </td>");
  document.write ("        </tr>");
  document.write ("      </table>");
  document.write ("    </td>");
  document.write ("  </tr>");
  document.write ("</table>");

  document.write ("<table cellpadding='0' cellspacing='0' width='100%'>");
  document.write ("  <tr'>");
  document.write ("    <td align='center' vAlign='top'>");
  document.write ("      <table cellpadding='0' cellspacing='0'>");
  document.write ("        <tr>");
  document.write ("          <td nowrap class='menuButton' onmouseover='menuMouseOver(this)' onmouseout='menuMouseOut(this)' onclick=window.location.href='home.htm'>&nbsp;Home&nbsp;</td>");
  document.write ("          <td nowrap class='menuButton' onmouseover='menuMouseOver(this)' onmouseout='menuMouseOut(this)' onclick=window.location.href='about.htm'>&nbsp;About Us&nbsp;</td>");
  document.write ("          <td nowrap class='menuButton' onmouseover='menuMouseOver(this)' onmouseout='menuMouseOut(this)' onclick=window.location.href='shows.htm'>&nbsp;Performances&nbsp;</td>");
 document.write ("          <td nowrap class='menuButton' onmouseover='menuMouseOver(this)' onmouseout='menuMouseOut(this)' onclick=window.location.href='DanceNight.htm'>&nbsp;Dance Night&nbsp;</td>");
  document.write ("          <td nowrap class='menuButton' onmouseover='menuMouseOver(this)' onmouseout='menuMouseOut(this)' onclick=window.location.href='lessons.htm'>&nbsp;Lessons&nbsp;</td>");
  document.write ("          <td nowrap class='menuButton' onmouseover='menuMouseOver(this)' onmouseout='menuMouseOut(this)' onclick=window.location.href='instructors.htm'>&nbsp;Instructors&nbsp;</td>");
  document.write ("          <td nowrap class='menuButton' onmouseover='menuMouseOver(this)' onmouseout='menuMouseOut(this)' onclick=window.location.href='PhotoIndex.html'>&nbsp;Photos&nbsp;</td>");
  document.write ("          <td nowrap class='menuButton' onmouseover='menuMouseOver(this)' onmouseout='menuMouseOut(this)' onclick=window.location.href='links.htm'>&nbsp;Links&nbsp;</td>");
  document.write ("          <td nowrap class='menuButton' onmouseover='menuMouseOver(this)' onmouseout='menuMouseOut(this)' onclick=window.location.href='media.htm'>&nbsp;Videos&nbsp;</td>");
  document.write ("          <td nowrap class='menuButton' onmouseover='menuMouseOver(this)' onmouseout='menuMouseOut(this)' onclick=window.location.href='contact.htm'>&nbsp;Contact Us&nbsp;</td>");
  document.write ("        </tr>");
  document.write ("      </table>");
  document.write ("    </td>");
  document.write ("  </tr>");
  document.write ("</table>");
}

function openPageTable()
{
  document.write ("<table class='backDrop' cellpadding='10' cellspacing='0' height='70%' width='100%'>");
  document.write ("  <tr>");
}

function thunderRain()
{
  document.write ("    <embed src='includes/sounds/thunder.wav' hidden='true' playcount='2'></embed>");
  document.write ("    <embed src='includes/sounds/rain.wav' hidden='true' playcount='30'></embed>");
}

function windHowl()
{
  document.write ("    <embed src='includes/sounds/windHowl.wav' hidden='true' playcount='1'></embed>");
}

function closePageTable()
{
  document.write ("  </tr>");
  document.write ("</table>");
}

function buildFooter()
{
  document.write ("<table class='backDrop' width='100%'>")
  document.write ("  <tr>")
  document.write ("    <td>")
  document.write ("      <div class='copyright'>");
  document.write ("        &copy;");
  document.write ("        <script language='Javascript'>getCurrentYear();</script>");
  document.write ("        by Texas Thunder Cloggers.&nbsp;&nbsp;All rights reserved.");
  document.write ("        <br />");
//document.write ("        Last Modified on <script language='Javascript'>getPageLastModifiedDate();</script>");
  document.write ("        Contact the");
  document.write ("        <span class='mailToLink'>");
  document.write ("        <script language='JavaScript'");
  document.write ("                type='text/JavaScript'>");
  document.write ("                buildAddr('Webmaster-Footer');");
  document.write ("        </script>");
  document.write ("        </span>");
  document.write ("      </div>");
  document.write ("    </td>")
  document.write ("  </tr>")
  document.write ("</table>")
}

function buildAddr2(user)
{
  var mailStr  = "";
  var userName = user;
  var dom      = "Yahoo";
  var ext      = ".com";
  var userMail = "";
  var hover    = "Email ";

  mailStr      = mailStr + "<a href='" + "m" + "a" + "i" + "l" + "t" + "o" + ":"; 
  mailStr      = mailStr + userMail + "' title='" + hover + "' >"; 
  
  {
    mailStr    = mailStr + userMail;
  }

  mailStr      = mailStr + "</a>";
  document.write (mailStr);
}
