﻿var sDivName = 'FloatBlock';
//
// 	This function constantly moves a the specified div to be a certain number of 
//	pixels from the top of the screen.  This basically floats the element in the same
//	spot when the user scrolls.
//
function floatDiv() {
    nOffset = 0;
    eDiv = document.getElementById(sDivName);
    //eDiv.style.pixelTop = document.body.scrollTop;// + nOffset;
    eDiv.style.marginTop = document.body.scrollTop; // + nOffset;
}
if (document.getElementById(sDivName) != null) {
    window.onscroll = floatDiv;
}

/////
			function toggleMenu(sMenuName) {
				nLeftPostition = document.getElementById("LeftSide").offsetLeft;
				closeAllBut(sMenuName);
				eMenu = document.getElementById(sMenuName);
				if ( eMenu.style.display == "block" ) {
					eMenu.style.display = 'none';
					eInTheWay = document.getElementById("InTheWay");
					if ( eInTheWay != null ) {
						eInTheWay.style.visibility = 'visible';
					}
				} else {
					eInTheWay = document.getElementById("InTheWay");
					if ( eInTheWay != null ) {
						eInTheWay.style.visibility = 'hidden';
					}
					eMenu.style.display = 'block';
				}
			}
					
			function closeAllBut(sMenuName) {
				sMenus = "FormsMenu,ReportsMenu,HelpMenu";
				arFields = sMenus.split(",");
				for (field in arFields) {
					if (typeof arFields[field] != 'function' ) {
						if (arFields[field] != sMenuName) {
							eMenu = document.getElementById(arFields[field]);
							eMenu.style.display = 'none';
						}
					}
				}
				if ( sMenuName != "" ) {
					eInTheWay = document.getElementById("InTheWay");
					if ( eInTheWay != null ) {
						eInTheWay.style.visibility = 'visible';
					}
				}
			}
			
			document.onclick=closeAllBut;
