function setFocus() {
  if ((navigator.userAgent.toLowerCase().indexOf("msie") < 0) || (parseInt(navigator.appVersion) >= 4)) {
    focus();
  }
}
function requireFrames(Url) {
	if (top.frames.length < 1) {
		top.location = Url;
	}
}
function breakFrames() {
  if (top.location != self.location) {
	  top.location = self.location
	}
}
function validateForm(myform) {
<!-- Check for required fields when Enter pressed or Submit clicked -->

<!-- Name Field is required -->
  if (email.mailFromName.value=="") {
    alert("Please provide your name for this message.");
    myform.mailFromName.focus();
    return false;
  }

<!-- Email Field is required -->
  if (email.mailFrom.value=="") {
    alert("Please provide your Email for this message.");
    myform.mailFrom.focus();
    return false;
  }

<!-- Subject Field is required -->
  if (email.mailSubject.value=="") {
    alert("Please provide a subject for this message.");
    myform.mailSubject.focus();
    return false;
  }

<!-- Subject Field is required -->
  if (email.mailBody.value=="") {
    alert("Please provide the text of your message.");
    myform.mailBody.focus();
    return false;
  }

  return true;
}

function setStyle(theCell, newClass){
  cells = theCell.parentNode.cells;
  for(i=0;i<cells.length;i++){
    if(newClass){
      cells[i].orgClass = cells[i].className;
      cells[i].className = newClass;
    } else {
      cells[i].className = cells[i].orgClass;
    }
  }
}
function navClick(url) {
	location.href = url;
}

function stopRKey(evt) {
  var evt  = (evt) ? evt : ((event) ? event : null);
  var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
  if ((evt.keyCode == 13) && (node.type=="text")) { return false; }
}
function resetTarget()
{
  aspnetForm.target='_self';
}
function writeMenu()
{
  var s1;
  s1 = "<ul>";
  s1 += "<li><a href=\"/index.html\">Home</a></li>";
  s1 += "<li><a href=\"/adc/index.html\">ADC Stuff</a></li>";
  s1 += "<li><a href=\"/calendar/index.html\">Calendar</a></li>";
  s1 += "<li><a href=\"http://huddle.mesavarsity.org\">Huddle</a></li>";
  s1 += "<li><a href=\"http://training.mesavarsity.org\">Training</a></li>";
  s1 += "<li><a href=\"http://ontarget.mesavarsity.org\">On-Target</a></li>";
  s1 += "<li><a href=\"http://rendezvous.mesavarsity.org\">Rendezvous</a></li>";
  s1 += "<li><a href=\"/forms.html\">Form & Publications</a></li>";
  s1 += "<li><a href=\"/links/index.html\">Other Links</a></li>";
  s1 += "</ul>";
  document.write(s1);
}

function writeNavBar()
{
  var s1;
  s1 = "<ul>";
  s1 += "<li><a href=\"/contact.html\">contact us</a></li>";
  s1 += "</ul>";

  document.write(s1);
 }

function writeSideBar()
{
  var s1;
  s1 = "<h1>Five Fields of Emphysis.</h1>";
  s1 += "<ul>";
  s1 += "<li>Advancement</li>";
  s1 += "<li>High-Adventure/Sports</li>";
  s1 += "<li>Service</li>";
  s1 += "<li>Special Progrms and Events</li>";
  s1 += "<li>Personal Development</li>";
  s1 += "</ul>";
  document.write(s1);
}  // writeSideBar

function writeFooter()
{
  var s1;
  var CurrentYear = new Date();
  CurrentYear = CurrentYear.getFullYear();
  s1 = "<div id=\"copyright\">";
  s1 += "For information about this website contact:&nbsp;";
  s1 += "<a href=\"mailto:mikeheaton@cox.net\">webmaster@mesavarsity.org</a><br />";
  s1 += "&copy;&nbsp;COPYRIGHT 2008-" + CurrentYear.toString() + " by Mesa District Varsity B.S.A. - All Rights Reserved.<br />";
  s1 += "All other trademarks are property of their respective holders.<br />";
  s1 += "Not an official site of the Boy Scouts of America";
  s1 += "</div>";
  document.write(s1);
}

