// Script for the expandable answers to the FAQs 
var expandedImg = new Image();
    expandedImg.src = ImagesFolder() + "plussign.png";
var collapsedImg = new Image();
    collapsedImg.src = ImagesFolder() + "minussign.png";

function ImagesFolder()
{
    // Get path of how page was loaded... full path from URL request
    // as either HTTP: or FILE: reference...  We need to look for
    var urlPath = document.location.href;

    // default the root length based on full www. domain reference
    var nRootLen = 17;
    urlPath = urlPath.toLowerCase();
    // look first for the AMS-TAC folder in the URL
    var nRoot   = urlPath.indexOf( "\\www.ams-tac.com\\" );
    if( nRoot < 0 )
        // look for unix-based forward slashes too
        nRoot = urlPath.indexOf( "/www.ams-tac.com/" );


    if( nRoot < 0 )
    {
        // not found, look for just the /ams-tac.com/
        nRoot   = urlPath.indexOf( "\\ams-tac.com\\" );

	if( nRoot < 0 )
	    // look for unix-based forward slashes too
            nRoot = urlPath.indexOf( "/ams-tac.com/" );


        // not Windows or Unix / Linux referenced.. just return the string
        if( nRoot < 0 )
            return "";

        // Found it without the "www.", change root length -4
        nRootLen = nRootLen - 4;
    }

        
    // Ok, we DO have a path, how many "/" or "\" are in the url for references
    // to how deep in the system the current document IS...
    urlPath = urlPath.substring( nRoot +nRootLen, urlPath.length );
    var cBackPath = "";
    for(i = 0; i < urlPath.length; i++ )
    {
        if( urlPath.substring( i, i+1 ) == "\\"
            || urlPath.substring( i,i+1 ) == "/" )
            cBackPath = cBackPath + "../";
    }
    return cBackPath + "images/";
}


function hideBlock( _blockID ) 
{
    var hideMe = document.getElementById( _blockID );
    if( hideMe != null )
        hideMe.style.display = "none";
}

function showBlock( _blockID ) 
{
    var showMe = document.getElementById( _blockID );
    if( showMe != null )
        showMe.style.display = "block";
}


function toggleItem( _imgID, _blockID ) 
{
    var itemImg = document.getElementById( _imgID );
    var itemView = document.getElementById( _blockID );
    if (itemView.style.display == "none") 
    {
        itemImg.src = collapsedImg.src;
        showBlock( _blockID );
    } 
    else 
    {
        itemImg.src = expandedImg.src;
        hideBlock( _blockID );
    }
}

// hideBlock notes1 through 49 are used to ID and label FAQ answers.
// hideBlock notes50 plus are used to ID and label left navigation
//     sections for Sofware, Hardware, Communications, and Show All.
function hideNotes() 
{
    hideBlock("notes1");
    hideBlock("notes2");
    hideBlock("notes3");
    hideBlock("notes4");
    hideBlock("notes5");
    hideBlock("notes6");
    hideBlock("notes7");
    hideBlock("notes8");
    hideBlock("notes9");
    hideBlock("notes10");
		hideBlock("notes11");
    hideBlock("notes12");
    hideBlock("notes13");
    hideBlock("notes14");
    hideBlock("notes15");
    hideBlock("notes16");
    hideBlock("notes17");
    hideBlock("notes18");
    hideBlock("notes19");
    hideBlock("notes20");	

    hideBlock("notes50");
    hideBlock("notes51");
    hideBlock("notes52");
    hideBlock("notes53");
	hideBlock("notes54");
	hideBlock("notes55");
}

//Mouseover script for the contact navigation button
function contactmouseOver()
{
    document.getElementById("contact").src = ImagesFolder() + "contactbutton_over.png";
}

function contactmouseOut()
{
    document.getElementById("contact").src = ImagesFolder() + "contactbutton_out.png";
}

// Mouseover script for the Home navigation button 
function homemouseOver()
{
    document.getElementById("home").src = ImagesFolder() + "homebutton_over.png";
}

function homemouseOut()
{
    document.getElementById("home").src = ImagesFolder() + "homebutton_out.png";
}

// Mouseover script for the AMS navigation button 
function amsmouseOver()
{
    document.getElementById("ams").src = ImagesFolder() + "amsbutton_over.png";
}
function amsmouseOut()
{
    document.getElementById("ams").src = ImagesFolder() + "amsbutton_out.png";
}

