﻿// JScript File

function hideShow(event, divID, optWidth){ 
    if (!event)event=window.event;   
    var obj=document.getElementById(divID);    
    if(obj.style.visibility=='hidden'){                
        obj.style.width = optWidth;        
        var x = event.clientX;
        var y = event.clientY;             
        var rightedge=iecompattest().clientWidth-(x+20);         
        if (rightedge<optWidth){
            //move the horizontal position of the menu to the left by it's width
            obj.style.left=iecompattest().scrollLeft+x-optWidth-10 + "px";            
        }else{
            //position the horizontal position of the menu where the mouse was clicked
            obj.style.left=iecompattest().scrollLeft+x+10+"px";
        }
        obj.style.visibility='visible';        
    }else{
        obj.style.visibility='hidden';
    }
}

function iecompattest(){
    return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body;
}
