    var lmtId = new Array();
    lmtId[0] = null;
    lmtId[1] = null;    
    var lmStep = 8;    

    var objHeader = null;
    var objContent = null;            

    function lm_onTimerOn(tid, popupId, maxHeight)
    {
        if (document.getElementById)        
        {
            objP = document.getElementById(popupId);
            if (objP)
            {
                var h = parseFloat(objP.offsetHeight);
                               
                var s = lmStep;
                if ((h + s) > maxHeight)
                    s = maxHeight - h;
                                
                objP.style.height = (h + parseFloat(s)) + "px";
            }
            
            if (h + s >= maxHeight)
            {
                window.clearInterval(lmtId[tid]);
                lmtId[tid] = null;
            }
        }    
    }


    function lm_onTimerOff(tid, headerId, popupId, minHeight, normalHeight)
    {
        if (document.getElementById)        
        {
            objP = document.getElementById(popupId);
            if (objP)
            {
                var h = parseFloat(objP.offsetHeight);
                var s = lmStep;
                if ((h - s) < minHeight)
                    s = h - minHeight;
                                
                objP.style.height = (h - s) + "px";
                        
                if (h - s <= minHeight)
                {
                    window.clearInterval(lmtId[tid]);
                    lmtId[tid] = null;
                    objP.style.overflow = "auto";
                    objP.style.height = normalHeight + "px";
                    objP.style.display = "none";
                    

                    objH = document.getElementById(headerId);
                    if (objH)
                    {
                         objH.style.display = "block";                    
                    }
                    leftMenuDoOpen();
                }
            }
        }    
    }    


    function leftMenuOpen(objId)
    {           
        if (document.getElementById)        
        {
            objP = document.getElementById("leftMenu");
            
            if (objP)
            {            
                objHeader = null;
                objContent = null;            
                        
                var openNow = true;
	            var curChild = objP.firstChild;
	            //while (curChild != objP.lastChild && curChild != null)
	            while (curChild != null)
	            {	            
	                var headerHeight = 26;
	                var contentHeight = 0;
                    
                    if (curChild.id == objId + "Close")
                    {
                        objHeader = curChild;
                    }
                    
                    if (curChild.id == objId + "Open")
                    {
                        objContent = curChild;
                    }
                    else
                    {
                        if ((curChild.id) && (curChild.id != ""))                          
                        {
                            if ((curChild.id.substr(curChild.id.length-4, 4) == "Open") && (curChild.style.display != "none"))
                            {
                                oid = curChild.id.substr(0, curChild.id.length - 4);
                                if ((lmtId[1] == null)&&(lmtId[0] == null))
                                {
                                    lmtId[1] = window.setInterval("lm_onTimerOff(" + 1 + ", '" + oid + "Close" + "','" + oid + "Open" + "', " + headerHeight + ", " + curChild.offsetHeight + ")", 10);                        
                                    openNow = false;
                                }
                            }
                        }                        
                    }
                    	            
		            curChild = curChild.nextSibling;
	            }   
	            
            
	            if (openNow)
	                leftMenuDoOpen();
	                         
            }
        }   
    }
    
    
    function leftMenuDoOpen()
    {
        if ((lmtId[0] != null) || (lmtId[1] != null))
            return;
            
        if ((objHeader != null) && (objContent != null))
        {        
            headerHeight = objHeader.offsetHeight;  
            objHeader.style.display = "none"; 
                       
            objContent.style.height = headerHeight + "px";
            objContent.style.overflow = "scroll";
            objContent.style.visibility = "hidden";     
            objContent.style.display = "block";     
            contentHeight = objContent.scrollHeight;               
       
            objContent.style.overflow = "hidden";
            objContent.style.visibility = "visible";     

            lmtId[0] = window.setInterval("lm_onTimerOn(" + 0 + ",'" + objContent.id + "', " + contentHeight + ")", 10);
        } 
    }
    
    function leftMenuClose(objId)
    {
        if (document.getElementById)        
        {
            objP = document.getElementById("leftMenu");
            if (objP)
            {
                objHeader = null;
                objContent = null;            
                var objHeader_ = null;
                var objContent_ = null;
                            
	            var curChild = objP.firstChild;
	            while (curChild != null)	            
	            {	            
	                var headerHeight = 26;
                    if (curChild.id == objId + "Close")
                    {
                        objHeader_ = curChild;
                    }
                    
                    if (curChild.id == objId + "Open")
                    {
                        objContent_ = curChild;
                    }
		            curChild = curChild.nextSibling;
	            }

                if ((objHeader_ != null) && (objContent_ != null))
                {
                    if ((lmtId[1] == null)&&(lmtId[0] == null))
                    {
                        objContent_.style.overflow = "hidden";
                        contentHeight = objContent_.offsetHeight;
                                                                   
                        lmtId[1] = window.setInterval("lm_onTimerOff(" + 1 + ", '" + objId + "Close" + "','" + objContent_.id + "', " + headerHeight + ", " + contentHeight + ")", 10);                        
                    }
                }	           	           	                            
            }
        }     
        
    }
    














    var tId = new Array();
    var tId2 = new Array();
    var stepOn = 15;
    var stepOff = 300;    
    //var popupMaxHeight = 295;
    
    var activeTopMenuPopup = "";
	var objP;

    function popupOn(tid, obj, popupId, popupMaxHeight)
    {
    	if(popupMaxHeight == undefined) popupMaxHeight = 295;
		 if (activeTopMenuPopup != ""){
			activeTopMenuPopup.className = "mouseOutItem";
			objP.style.display = "none";
		 }
        obj.className = "pulldownItem";
        if (document.getElementById)        
        {
            objP = document.getElementById(popupId);
            if (objP)
            {                
                objP.style.display = "block";
                
                window.clearInterval(tId[tid]);                
                tId2[tid] = "0";
                tId[tid] = window.setInterval("onTimerOn(" + tid + ",'" + popupId + "', " + popupMaxHeight + ")", 10);                                
                objP.style.height="1px";
            }    
        }
    }
    
    function popupOff(tid, obj, popupId, popupMaxHeight)
    {        
    	if(popupMaxHeight == undefined) popupMaxHeight = 295;
        if (document.getElementById)        
        {       
            objP = document.getElementById(popupId);
            if (objP)
            {
                //window.clearInterval(tId[tid]);
                
                    
                activeTopMenuPopup = obj;
                
                tId2[tid] = "1";
                window.setTimeout("waitTimeoutOff(" + tid + ",'" + popupId + "'," + 0 + ", 0, " + popupMaxHeight + ")", 50);             
            }    
        }
        
    }
    
    
    function waitTimeoutOff(tid, popupId, pageId, minHeight, normalHeight)    
    {

        if (tId2[tid] == "1")
        {        
			if(activeTopMenuPopup != "")
				activeTopMenuPopup.className = "mouseOutItem";
            window.clearInterval(tId[tid]);
            tId[tid] = window.setInterval("onTimerOff(" + tid + ",'" + popupId + "'," + pageId + ", " + minHeight + ", " + normalHeight + ")", 10);
        }
        else
            window.setTimeout("waitTimeoutOff(" + tid + ",'" + popupId + "', " + pageId + ", " + minHeight + ", " + normalHeight + ")", 50);
            
    }
    
    
    
    function onTimerOn(tid, popupId, maxHeight)
    {
        if (document.getElementById)        
        {
            objP = document.getElementById(popupId);
            if (objP)
            {
                var h = parseFloat(objP.offsetHeight);
                
                var s = stepOn;
                if ((h + s) > maxHeight)
                    s = maxHeight - h;
                                
                objP.style.height = (h + parseFloat(s)) + "px";
            }
            
            if (h + s >= maxHeight)
                window.clearInterval(tId[tid]);
        }    
    }
    
    function onTimerOff(tid, popupId, pageId, minHeight, normalHeight)
    {
        if (document.getElementById)        
        {
            objP = document.getElementById(popupId);
            if (objP)
            {
                var h = parseFloat(objP.offsetHeight);
                var s = stepOff;
                if ((h - s) < minHeight)
                    s = h - minHeight;
                                
                objP.style.height = (h - s) + "px";
            }
            
            if (h - s <= minHeight)
            {
                window.clearInterval(tId[tid]);
                objP.style.height = normalHeight + "px";
                objP.style.display = "none";
                
                if (activeTopMenuPopup != "")
                {
                    activeTopMenuPopup.className = "mouseOutItem";
                    activeTopMenuPopup = "";
                }
                
                
                //document.getElementById("")
                
                //objP
                
                //pageId.className = "";
                
                //objP.id = "";
                
                /*
                if (document.body.id == pageId) 
                {
                    document.body.id = "";
                }
                */
            }
        }    
    }    
    
    function popupContentOn(tid)
    {
        tId2[tid] = "0";
    }
    
    function popupContentOff(tid)
    {
        tId2[tid] = "1";
    }
    
    
