var intMaxMenuHeight;
var timerMenuSlider = 0;



function highlightMenu(objCurrentMenu)
{
var arrTopMenuLinks = document.getElementById('topMenu').getElementsByTagName('a');

for (var intLoopMenuLinks = 0; intLoopMenuLinks < arrTopMenuLinks.length; intLoopMenuLinks++)
    {
    if (arrTopMenuLinks[intLoopMenuLinks].className != "topMenuOn")
        {
        if (arrTopMenuLinks[intLoopMenuLinks] == objCurrentMenu)
            {
            arrTopMenuLinks[intLoopMenuLinks].className = "topMenuSubOn";
            }
        else
            {
            arrTopMenuLinks[intLoopMenuLinks].className = "";
            }
        }
    }
}



function keepMenuHighlighted(intSubMenu)
{
var arrTopMenuLinks = document.getElementById('topMenu').getElementsByTagName('a');
highlightMenu(arrTopMenuLinks[intSubMenu]);
}



function slideMenu(strDivID)
{
hideSubMenus(strDivID);

switch(strDivID)
    {
    case "subMenu1":
    intMaxMenuHeight = 200;
    break;

    case "subMenu2":
    intMaxMenuHeight = 200;
    break;

    case "subMenu3":
    intMaxMenuHeight = 200;

    case "subMenu4":
    intMaxMenuHeight = 200;
    break;
    }

var objCurrentDiv = document.getElementById(strDivID);
objCurrentDiv.style.height = "0px";
objCurrentDiv.style.display = "block";

timerMenuSlider = setInterval("makeMoreVisible(1,'" + strDivID + "')", 10);
}


function hideSubMenus(strDivID)
{
highlightMenu('');
clearInterval(timerMenuSlider);
intCurrentMenuHeight = 0;

for (var intLoopSubMenus = 1; intLoopSubMenus <= intSubMenuCount; intLoopSubMenus++)
    {
    document.getElementById("subMenu" + intLoopSubMenus).style.display = "none";
    }

//document.getElementById("customDropDown").style.display = "none";
}


function makeMoreVisible(intSlideType, strDivID)
{
var objCurrentDiv = document.getElementById(strDivID);

if (intSlideType == 1)
    {
    if (parseInt(intCurrentMenuHeight) < intMaxMenuHeight)
        {
        intCurrentMenuHeight = parseInt(intCurrentMenuHeight) + 20;
        objCurrentDiv.style.height = intCurrentMenuHeight + "px";
        }
    else
        {
        clearInterval(timerMenuSlider);
        }
    }
}



function changeClass(strID, strClassNameOff, strClassNameOn)
{
var objObject = document.getElementById(strID);
objObject.className = (objObject.className == strClassNameOff) ? strClassNameOn : strClassNameOff;
}



function changeURL(strURL)
{
window.location = strURL;
}


function showDiv(strDivContentID)
{
var arrAllDivs = document.getElementsByTagName("div");

for (var intLoopDivs = 0; intLoopDivs < arrAllDivs.length; intLoopDivs++)
    {
    if (arrAllDivs[intLoopDivs].id.indexOf("divContent") != -1)
        {
        if (arrAllDivs[intLoopDivs].id != strDivContentID)
            {
            arrAllDivs[intLoopDivs].className = "hideDiv";
            }
        }
    }

document.getElementById(strDivContentID).className = "showDiv";
}


function doWebsiteBy(blnOnOff, strPath)
{
if (blnOnOff == 1)
    {
    document.getElementById("websiteByNames").className = "showDiv";
    document.getElementById("seraphimImg").src = strPath + "/images/seraphim1.gif";
    document.getElementById("demonDesignImg").src = strPath + "/images/demondesign1.gif";
    }
else
    {
    document.getElementById("websiteByNames").className = "hideDiv";
    document.getElementById("seraphimImg").src = strPath + "/images/seraphim.gif";
    document.getElementById("demonDesignImg").src = strPath + "/images/demondesign.gif";
    }
}


function showFAQ(intFAQ)
{
var arrAllDivs = document.getElementsByTagName("div");
var intCountDiv = 0;
var objCurrentFAQ;

for (var intLoopDivs = 0; intLoopDivs < arrAllDivs.length; intLoopDivs++)
    {
    if (arrAllDivs[intLoopDivs].id.indexOf("divFAQ") != -1)
        {
        intCountDiv++;

        objCurrentFAQ = document.getElementById("divFAQ" + intCountDiv);

        if (arrAllDivs[intLoopDivs].id == "divFAQ" + intFAQ)
            {
            objCurrentFAQ.className = (objCurrentFAQ.className == "showDiv") ? "hideDiv" : "showDiv";
            }
        else
            {
            objCurrentFAQ.className = "hideDiv";
            }
        }
    }
}
