﻿// JScript File

var curleft = 0; 
var curtop = 0;
var myDiv;
var Id;
// Navigation Array
var Navlinks = new Array(8);
Navlinks[0] = "0";
Navlinks[1] = "1";
Navlinks[2] = "2";
Navlinks[3] = "3";
Navlinks[4] = "4";
Navlinks[5] = "5";
Navlinks[6] = "6";
Navlinks[7] = "7";


function navOver(myId)
{
    myDiv = myId;
    Id = myDiv.replace(/nav/g,'');
    var overCell = document.getElementById(myId);
    document.getElementById(myId).className = "navTD_white";
    //document.getElementById(myId + "_link").className = "Navigation_Links_Over";
    if (Navlinks[Id].length != 0)
    {
        getCoordinates(overCell);
        UnhideAndposition(Id);
    }
}
function navOut(myId)
{
    document.getElementById(myId).className = "navTD";
    //document.getElementById(myId + "_link").className = "Navigation_Links";
    hide();
    w = 0;
    f = 0;
}
 function setDiv()
        {
            var content = document.getElementById('content');
            var bodycontainer = document.getElementById('bodycontainer');
            var contentHeight = content.offsetHeight;
            var bodycontainerHeight = bodycontainer.offsetHeight;
            if (bodycontainerHeight < contentHeight) 
            {
                bodycontainer.style.height = contentHeight + "px";
            } 
        }

//Get Coordinates of cell
function getCoordinates(overCell)
{
	if (overCell.offsetParent) 
	{
		curleft = overCell.offsetLeft;
		curtop = overCell.offsetTop;
		while (overCell = overCell.offsetParent) 
		{
			curleft += overCell.offsetLeft;
			curtop += overCell.offsetTop;
		}
	}
	return curleft, curtop;
}
//Unhide and position Div
function UnhideAndposition(Id)
{
    document.getElementById('dropdown').innerHTML = Navlinks[Id];
    document.getElementById('dropdown').style.left = curleft + 236 + "px";
    document.getElementById('dropdown').style.top = curtop - 1 + "px";
    document.getElementById('dropdown').style.display = "inline";
    growDiv();
}
//Hide Div
var i = 232;
function hide()
{
    document.getElementById('dropdown').style.display = "none";
}
//Keep DropMenu open
function keepopen()
{
    document.getElementById(myDiv).className = "navTD_white";
    //document.getElementById(myDiv + "_link").className = "Navigation_Links_Over";
    document.getElementById('dropdown').style.display = "inline";
}
// Hides on drop out
function hideall()
{
    document.getElementById(myDiv).className = "navTD";
    //document.getElementById(myDiv + "_link").className = "Navigation_Links";
    hide();
}
var w = 0;
var f = 0;
function growDiv()
{
    document.getElementById('dropdown').style.width = w + "px";
    if (navigator.appName.indexOf("Netscape")!=-1&&parseInt(navigator.appVersion)>=5)
    {
        document.getElementById('dropdown').style.MozOpacity = f/100;
    }
    else if (navigator.appName.indexOf("Microsoft")!=-1&&parseInt(navigator.appVersion)>=4)
    {
        document.getElementById('dropdown').style.filter = "alpha(opacity="+f+")";
    }
    w = w + 30;
    f = f + 17;
    if (w < 200)
    {
        my_timeout = setTimeout("growDiv();", 1);
    }
}

function AutoTab(current,to)
{
    if (current.getAttribute && 
      current.value.length==current.getAttribute("maxlength")) {
        to.focus() 
        }
}

function unHideDrop()
{
    document.getElementById('Drop').style.display = "inline";
}
function hideDrop()
{
    document.getElementById('Drop').style.display = "none";
}
function unHideDrop2()
{
    document.getElementById('Drop2').style.display = "inline";
}
function hideDrop2()
{
    document.getElementById('Drop2').style.display = "none";
}
function unHideDrop3()
{
    document.getElementById('Drop3').style.display = "inline";
}
function hideDrop3()
{
    document.getElementById('Drop3').style.display = "none";
}
function unHideDrop4()
{
    document.getElementById('Drop4').style.display = "inline";
}
function hideDrop4()
{
    document.getElementById('Drop4').style.display = "none";
}
function unHideDrop5()
{
    document.getElementById('Drop5').style.display = "inline";
}
function hideDrop5()
{
    document.getElementById('Drop5').style.display = "none";
}