<!--

var bRightMouseClickingAllowed = false;
var gsImagesDirectory = "images/";
var giYear = new Date().getFullYear();

var gaSiteErrors = new Array();
    gaSiteErrors["CheckFormValidationImage"] = "You have entered an invalid value in the Security Measure field. Please type the text (no spaces) in the text box exactly as you see it in the image.";

DisableRightMouse();
//var iBrowserVersion = (Number(navigator.appVersion.split(";")[1].substr(6,3)));
var iBrowserVersion = (Number(navigator.userAgent.split(";")[1].substr(6,3)));
//alert(iBrowserVersion)

if((iBrowserVersion < 5.5) || (navigator.appName.indexOf("Microsoft") < 0))
{
  top.document.location.href = "wrongbrowser.html";
}

function ChangeImg(oImage, sState)
{
  var sImage = oImage.src
      sImage = sImage.substring(0, sImage.lastIndexOf("_")+1) + sState + ".jpg";
  
  oImage.src = sImage;
}

function GetElementById(sObjectID)
{
  var oReturnObject = document.getElementById(sObjectID);
  
  if(oReturnObject == null)
  {
    alert("ERROR: \"" + sObjectID + "\" does not exist on this screen.");
  }
  
  return oReturnObject;
}

function UpdateLayer(sLayerID, sLayerText)
{
  var oLayer = GetElementById(sLayerID);
  oLayer.innerHTML = sLayerText;
}

function GetHeader()
{
  var sHeaderText = "color:#0000FF;font-weight:bold;";
  var sTitle = "<table border='0' cellpadding='0' cellspacing='0' width='100%'>" +
               "<tr valign=\"top\" align='center'>" +
               "<td width='110px'><img src=\"" + gsImagesDirectory + "emblem.jpg\"></td>" +
               "<td><img src=\"" + gsImagesDirectory + "logo_mt_pleasant.jpg\"><br><img src=\"" + gsImagesDirectory + "logo_f&am.jpg\"><img src=\"" + gsImagesDirectory + "logo_pha.jpg\"><br><img src=\"" + gsImagesDirectory + "logo_mwugl.jpg\"></td>" +
               "<td width='110px'><img src=\"" + gsImagesDirectory + "emblem.jpg\"></td>" +
               "</tr></table>";
  
  return sTitle;
}

function GetFooter()
{
  var sFooterLinksNorm = "font-weight:bold;text-decoration:underline;";
  var sFooter = "<table border='0' cellpadding='0' cellspacing='2' width='100%'>" +
                "<tr valign=\"top\" height=\"1px\" align='center'><td>" +
                "<font class=\"cFooterText\">" + 
                "<a class='cFooterLinkedText' style='" + sFooterLinksNorm + "' onmouseover='ChangeStyle(this)'  onmouseout='ChangeStyle(this)' onclick='javascript:Navigation(0)'>Home</a> | " +
                "<a class='cFooterLinkedText' style='" + sFooterLinksNorm + "' onmouseover='ChangeStyle(this)'  onmouseout='ChangeStyle(this)' onclick='javascript:Navigation(7)'>Announcements</a> | " +
                "<a class='cFooterLinkedText' style='" + sFooterLinksNorm + "' onmouseover='ChangeStyle(this)'  onmouseout='ChangeStyle(this)' onclick='javascript:Navigation(1)'>Links</a> | " +
                "<a class='cFooterLinkedText' style='" + sFooterLinksNorm + "' onmouseover='ChangeStyle(this)'  onmouseout='ChangeStyle(this)' onclick='javascript:Navigation(2)'>Calendar</a> | " +
                "<a class='cFooterLinkedText' style='" + sFooterLinksNorm + "' onmouseover='ChangeStyle(this)'  onmouseout='ChangeStyle(this)' onclick='javascript:Navigation(5)'>Photo Library</a> | " +
                "<a class='cFooterLinkedText' style='" + sFooterLinksNorm + "' onmouseover='ChangeStyle(this)'  onmouseout='ChangeStyle(this)' onclick='javascript:Navigation(3)'>FAQs</a> | " +
                "<a class='cFooterLinkedText' style='" + sFooterLinksNorm + "' onmouseover='ChangeStyle(this)'  onmouseout='ChangeStyle(this)' onclick='javascript:GoToMembersOnly()'>Members Only</a> | " +
                "<a class='cFooterLinkedText' style='" + sFooterLinksNorm + "' onmouseover='ChangeStyle(this)'  onmouseout='ChangeStyle(this)' onclick='javascript:DoMailTo(\"spam_free_jbunts357pha*AT*verizon*DOT*net\", true)'>Contact Webmaster</a>" + /*| " +*/
                "</font><br>" +
                "<font class=\"cFooterText\">" +
                "&#169; 2005-" + giYear + " Mt. Pleasant Lodge #13, F&amp;AM PHA. All rights reserved." +
                "</font><br>" +
                "<font class=\"cFooterText\">" +
                "The opinions and pages of this site do not necessarily reflect the opinions, views, or policies of the The Most Worshipful Union Grand Lodge, Most<br>Ancient & Honorable Fraternity, Free and Accepted Masons, Prince Hall Affiliated, Florida, Belize, Central America, and St. Johns, U.S.V.I. Jurisdiction,<br>Incorporated, its Officers, Constituent Temples, and Members." +
                "</font>" +
                /*"<br><a href=\"http://www.compess.com/\" target=\"_blank\"><img src=\"" + gsImagesDirectory + "powered_by.jpg\" border=\"0\" alt=\"The CompEss Corporation\"></a>" +*/
                /*"<br><a href=\"http://www.compess.com/\" class=\"cPoweredByTag\" target=\"_blank\">Powered by: The CompEss Corporation</a>" +*/
                "</td></tr></table>";
  
  return sFooter;
}

function GetPopupFooter()
{
  var sFooterLinksNorm = "font-weight:bold;text-decoration:underline;";
  var sFooter = "<table border='0' cellpadding='0' cellspacing='2' width='100%'>" +
                "<tr valign=\"top\" height=\"1px\" align='center'><td>" +
                "<font class=\"cFooterText\">" +
                "&#169; 2005-" + giYear + " Mt. Pleasant Lodge #13, F&amp;AM PHA. All rights reserved." +
                "</font>" +
                "</td></tr></table>";
  
  return sFooter;
}

function ChangeStyle(oReceivedObject)
{
  var sTextDecoration = oReceivedObject.style.textDecoration;
  var aTextDecoration = new Array();
      aTextDecoration["underline"] = "none";
      aTextDecoration["none"] = "underline";
  
  oReceivedObject.style.textDecoration = aTextDecoration[sTextDecoration];
}

function DoMailTo(sEmailAddress, bReformat)
{
  var sReformatedEmailAddress = (bReformat) ? StringReplace(StringReplace(StringReplace(sEmailAddress, "*DOT*","."), "*AT*","@"), "spam_free_", "") : sEmailAddress ;
  var sLocation = "email_display.asp?EmailAddress=" + escape(sReformatedEmailAddress);
  var sEmailAddressWinSettings = "height=400px, width=667px, directories=no, location=no, " +
                                 "menubar=no, resizable=no, scrollbars=yes, status=no, toolbar=no";
  
  DoShowPopup(sLocation, sEmailAddressWinSettings, "Email Display", "Yes");
}

function DoShowPopup(sURL, sPopupWinSettings, sTitle, sPrintable)
{
  var sPopupFile = "popup_viewer.asp?File={0}&Title={1}&Printable={2}";
  var sLocation = StringFormat(sPopupFile, escape(sURL)+","+escape(sTitle)+","+sPrintable);
  
  window.open(sLocation, "", sPopupWinSettings);
}

function ShowPicture(sPictureLocation, sPicture)
{
  var sImageViewerWinSettings = "height=" + (screen.height-80) + "px, width=" + (screen.width-15) + "px, " +
                                "directories=no, location=no, menubar=no, resizable=no, " +
                                "scrollbars=yes, status=no, toolbar=no";
  var aPictureLocations = new Array();
      aPictureLocations["MembersPhotoAlbum"] = "photo_library/01-mt_pleasant_13_members/";

  var sLocation = "photo_library_album_viewer.asp?SearchDirectory=" + aPictureLocations[sPictureLocation] + "&Image=" + sPicture;
  
  window.open(sLocation, "", sImageViewerWinSettings);
}

function DoOrderListBy(sOrderBy, sOrderDirection)
{
  var sLocation = document.location.href;
  
  sLocation = sLocation.substring(0, sLocation.indexOf("?"));
  
  if(sOrderDirection == "Reorder")
  {
    sOrderDirection = (gsOrderDirection == "ASC") ? "DESC" : "ASC" ;
  }
  else
  {
    sOrderDirection = "ASC" ;
  }
  
  sLocation += "?OrderBy=" + sOrderBy + "&OrderDirection=" + sOrderDirection;
  
  document.location.href = sLocation;
}

function DisableRightMouse()
{
  InitMouseHandler();
}

function InitMouseHandler()
{
  document.oncontextmenu = ContextMenuHandler;
  document.onmousedown = MouseDownHandler;
}

function ContextMenuHandler()
{
  return bRightMouseClickingAllowed;
}

function MouseDownHandler(evt)
{
  if(!bRightMouseClickingAllowed)
  {
    var btncode = event.button;
    
    if (btncode == 2)
    {
      alert("Right mouse clicking is not allowed in this site.");
      event.cancelBubble = false;
      event.returnValue = false;
      return;
    }
    else
    {
      return;
    }
  }
  else
  {
    return;
  }
}

//-->
