﻿// JScript File
   
    function getBrowser()
    {
        //alert("You are using " + navigator.userAgent);
        var userAgent = navigator.userAgent;
        
        if (userAgent.indexOf("MSIE") >= 0)
        {
            return "MSIE";
            //alert("You are using Microsoft Internet Explorer");
        }
        else if(userAgent.indexOf("Firefox") >= 0)
        {
            return "Firefox";
            //alert("You are using Firefox");
        }
        else if(userAgent.indexOf("Opera") >= 0)
        {
            //alert("You are using " + navigator.userAgent);
            return "Opera";
            //alert("You are using Opera");
        }
        else if(userAgent.indexOf("Chrome") >= 0)
        {
            //alert("You are using " + navigator.userAgent);
            return "Chrome";
            //alert("You are using Opera");
        }
        else
        {
            // Assuming Safari
            return "Unknown";
            //alert("You are using something other than Internet Explorer, Firefox, or Opera");
        }
    }
    function setContent()
    {
        var x = document.getElementById("testRow");
        var strTitle = new String("Fighting For Freedom!");
        var strText = new String("Now is the time for all good men to come to the aid of their country. Have you registered to vote yet? Now would be a good time to call your local county courthouse and set up a time to go register. Better yet, why don't you just go to the nearest postal office and see if they might be able to get you signed up for the voting process. The next election is coming up real soon and you wouldn't want to be left out of the privilege to make your voice be heard at the polls! A lot of great men and women gave time, energy, and even their lives to enable us the opportunity to choose those that will lead our country. There are even men and women fighting in our armed forces today that are giving up their freedom away from home to ensure that we can maintain our freedom here at home.");
         
        x.cells["testCol"].innerHTML = strTitle + "<p class='Text1'>" + strText + "</p>";
    }
    function processMenu(mnuName)
    {
        switch(mnuName)
        {
            case "Menu1":
                if (document.getElementById("img" + mnuName).className == "Menu1Off")
                {
                    document.getElementById("img" + mnuName).className = "Menu1On";
                    document.getElementById("imgUpMenu").className = "UpMenuOn";
                    document.getElementById("imgLowerBar").className = "LowerbarOn";
                    document.getElementById("divFooter").className = "FooterOn";
                    document.getElementById("imgTribute").style.display = "none";
                }
                else
                {
                    document.getElementById("img" + mnuName).className = "Menu1Off";
                    document.getElementById("imgUpMenu").className = "UpMenuOff";
                    document.getElementById("imgLowerBar").className = "LowerbarOff";
                    document.getElementById("divFooter").className = "FooterOff";
                    document.getElementById("imgTribute").style.display = "inline";
                }
                break;
            case "Menu2":
                break;
            case "Menu3":
                break;
        }
    }
    function setPosition()
    {
        //alert("setPosition");
        
        var tblLeft = document.getElementById("tblMain").offsetLeft;
        var tblTop = document.getElementById("tblMain").offsetTop;
        
        adjustDonateBtn(tblLeft, tblTop);
    }
    function displayPhoto(imgId, coordTop, coordLeft)
    {
        document.getElementById(imgId).style.display = "inline";
        document.getElementById(imgId).style.position = "relative";
        document.getElementById(imgId).style.top = coordTop;    //"-580px";
        document.getElementById(imgId).style.left = coordLeft;  //"-275px";
    }
    function hidePhoto(imgId)
    {
        if (imgId != "")
        {
            document.getElementById(imgId).style.display = "none";
        }
    }
    function adjustDonateBtn(posLeft, posTop)
    {
        // Adjust PayPal Donate button
        switch (getBrowser())
        {
            case "MSIE":
                document.getElementById("submit").style.left = (posLeft + 85) + "px";
                document.getElementById("submit").style.top = (posTop + -103) + "px";
                break;
            case "Firefox":
                document.getElementById("submit").style.left = (posLeft + 85) + "px";
                document.getElementById("submit").style.top = (posTop + -108) + "px";
                break;
            case "Opera":
                document.getElementById("submit").style.left = (posLeft + 85) + "px";
                document.getElementById("submit").style.top = (posTop + -103) + "px";
                break;
            case "Unknown": // Assuming Safari
                document.getElementById("submit").style.left = (posLeft + 45) + "px";
                document.getElementById("submit").style.top = (posTop + -50) + "px";
                //alert("Unknown");
                break;
        }
        
        //alert("posLeft=" + posLeft + "; posTop=" + posTop);
    }
    function lert(ctlName)
    {
        var pName = "p" + ctlName;
        var tdName = "td" + ctlName;
        var theName = pName.substr(1, pName.length - 2);
        var i;
        var n = ctlName.substr(ctlName.length - 1, 1);
        
        for (i=1; i < 5; i++)
        {
            if (i == n)
            {
                document.getElementById(pName).style.backgroundColor = "lightgrey";
                document.getElementById(tdName).style.display = "inline";
                document.getElementById(pName).style.fontStyle = "italic";
            }
            else
            {
                document.getElementById("p" + theName + i).style.backgroundColor = "transparent";
                document.getElementById("td" + theName + i).style.display = "none";
                document.getElementById("p" + theName + i).style.fontStyle = "normal";
            }
        }
    }
    function setUL(flag)
    {
        if (flag == "on")
        {
            document.getElementById("ancText").style.textDecoration = "underline";
            document.getElementById("ancText").style.cursor = "hand";
        }
        else
        {
            document.getElementById("ancText").style.textDecoration = "none";
            document.getElementById("ancText").style.cursor = "default";
        }
    }
    function setBack(flag, ctlName)
    {
//        if (flag == "ON")
//            document.getElementById(ctlName).style.backgroundColor = "lightgrey";
//        else
//            document.getElementById(ctlName).style.backgroundColor = "transparent";
    }

