/*-----------------------------------------------------------
    Toggles element's display value
    Input: any number of element id's
    Output: none 
    ---------------------------------------------------------*/
function toggleDisp() {
    for (var i=0;i<arguments.length;i++){
        var d = $(arguments[i]);
        if (d.style.display == 'none')
            d.style.display = 'block';
        else
            d.style.display = 'none';
    }
}
/*-----------------------------------------------------------
    Toggles tabs - Closes any open tabs, and then opens current tab
    Input:     1.The number of the current tab
                    2.The number of tabs
                    3.(optional)The number of the tab to leave open
                    4.(optional)Pass in true or false whether or not to animate the open/close of the tabs
    Output: none 
    ---------------------------------------------------------*/
function toggleTab(prefix,num,animate) {
    if ($(prefix+'_tabContent'+num).style.display == 'none'){
		var i = 1;
		
		while(i){
			var temph = prefix+'_tabHeader'+i;
			var h = $(temph);
			
			//alert(temph);
			
			if(!h){
				i = 0;
			}else{
				if(i == num){
					h.className = 'act';
					h.blur();
				}else{
					h.className = '';					
				}
				
				var tempc = prefix+'_tabContent'+i;
				var c = $(tempc);
				if(c.style.display != 'none'){
					if (animate || typeof animate == 'undefined')
						Effect.toggle(tempc,'blind',{duration:0.3, queue:{scope:'menus', limit: 3}});
					else
						toggleDisp(tempc);
				}
				i++;
				
			}            
		}
       
        var c = $(prefix+'_tabContent'+num);
        //c.style.marginTop = '2px';
        if (animate || typeof animate == 'undefined'){
            Effect.toggle(prefix+'_tabContent'+num,'blind',{duration:0.3, queue:{scope:'menus', position:'end', limit: 3}});
        }else{
            toggleDisp(prefix+'_tabContent'+num);
        }
    }
}