﻿
var delay = 300;        
        
function SetClassNameTimeout2(e,on,off)
{

    
    //find out if the item is 'on', if so set the off on a  delay, otherwise do it now.
    //this prevents the panel from being displayed with no styling:
    var obj = document.getElementById(e);
    if (obj.className == on)
    {
        setTimeout("SetClassName('" + e + "','" + on + "','" + off + "');",delay);
    }
    else
    {
        obj.className = on; 
    }
    
}

function SetClassName(e,on,off)
{   
    var obj = document.getElementById(e);
    
    if (obj.className == on)
    {
        //was expanded, now collapsed:
        obj.className = off;
    }
    else
    {
       obj.className = on; 
    }            
}
