
// function to display/hide the delp sections
function showHelp(item, button){
    var itm = document.getElementById(item);
    var btn = document.getElementById(button);
    if(itm.style.display == "none")
    {
        itm.style.display = "block";
        btn.src = "/images/helpBtn_on.gif";
    }
    else
    {
        itm.style.display = "none";
        btn.src = "/images/helpBtn.gif";
    }
}   

  //Warning message prior ending the session 
        function showSessionTimeOutMessage()
        {   
            document.getElementById("divSession1").className ='floatBox';            
            document.getElementById("__SESSION_STATUS").value = "1";
            setInterval("setSlidingDivPos('divSession1')",40);
        } 

        //Submit when ending the session
        function showSessionTimedOutMessage()
        {   
            document.getElementById("divSession1").className="floatBoxHide";
            document.getElementById("__SESSION_STATUS").value = "2";
            document.forms[0].submit();
        }          
        
         
        //Show sliding Div
        function setSlidingDivPos(id)
        {
            var topPos = '0px';
        	document.getElementById(id).style.top = topPos;
        	//Hide the controls underlying the div tag
        	if (document.getElementById(id).className == 'floatBox')
        	{
        	    hideInterferingElements(id)
        	}
        }

 //Clear the end session timeout
        function clearEndSessionTimeOut()
        {
            document.getElementById("__SESSION_STATUS").value = "";
            document.getElementById("divSession1").className="floatBoxHide";
            replaceHiddenElements('divSession1');
            window.clearTimeout(sessionTimedOutID);
        }
             
function setRollOver(item,img)
{
    if (item != null)
    {
        item.src = img;
    }
}

function ShowHideBuildingDetails( pInputField, pHideElement ){
        
    var _oInputControl = document.getElementById(pInputField);
    var _oLabelControl = null;
    if( _oInputControl ){
        var labelArrays = document.getElementsByTagName("LABEL");
        for(i=0;i<labelArrays.length;i++){
            if(labelArrays[i].htmlFor == _oInputControl.id) {            
                _oLabelControl = labelArrays[i];
                break;
            }
        }
        
        if( pHideElement ) {
            _oInputControl.style.display = "none";
            _oLabelControl.style.display = "none";
        } else {
            _oInputControl.style.display = "inline";
            _oLabelControl.style.display = "inline";
        }
    }
        
}

function ShowHideDiv( pDivName, pHideElement ){
        
    var _oDiv = document.getElementById(pDivName);
    if( _oDiv ){
        if( pHideElement ) {
            _oDiv.style.display = "none";
            _oDiv.style.display = "none";
        } else {
            _oDiv.style.display = "inline";
            _oDiv.style.display = "inline";
        }
    }
        
}
