/*-----------------------------------------------------------
    Toggles tabs - Closes any open tabs, and then opens current tab
    Input:     1. The name of tab
        		2.The number of the current tab
				3.The number of tabs
    Output: none 
    ---------------------------------------------------------*/
function toggleTab(tabName,num,numelems) {
    for (var i=1;i<=numelems;i++){
            var temph = tabName+i;
            var h = $(temph);
            if (!h){
                var h = $(tabName+'Active');
                h.id = temph;
                h.removeClassName('active'); // remove any previous class name
                h.addClassName('hold'); // add 
            }
    }
    var h = $(tabName+num);
    if (h){
        h.id = tabName+'Active';
        h.removeClassName('hold'); // remove any previous class name
        h.addClassName('active'); // add 
    }
}