function extraMenu(id) {
	if(document.getElementById(id).style.display=='block') {
		document.getElementById(id).style.display='none';
	} else {
		if(document.getElementById("horiz_menu_1")) {
			document.getElementById("horiz_menu_1").style.display='none';
		}
		if(document.getElementById("horiz_menu_2")) {
			document.getElementById("horiz_menu_2").style.display='none';
		}
		if(document.getElementById("horiz_menu_3")) {
			document.getElementById("horiz_menu_3").style.display='none';
		}
		if(document.getElementById("horiz_menu_4")) {
			document.getElementById("horiz_menu_4").style.display='none';
		}
		if(document.getElementById("horiz_menu_5")) {
			document.getElementById("horiz_menu_5").style.display='none';
		}
		document.getElementById(id).style.display='block';
	}
}
function prov(id) {
	if(document.getElementById("prov_" + id).style.display == 'block') {
		document.getElementById("prov_" + id).style.display = 'none';
	} else {
		document.getElementById("prov_" + id).style.display = 'block';
	}
	document.getElementById("horiz_menu_2").style.width = '180px';
}
function goToLink(targ,selObj,restore){
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); 
	if (restore) selObj.selectedIndex=0; 
}
function toggleShortcuts() {
	$("#bb_shortcuts_more").toggle();
	$("#bb_bookmarks_more").hide();
}
function toggleBookmarks() {
	$("#bb_shortcuts_more").hide();
	$("#bb_bookmarks_more").toggle();
}
//Adjust panel height
$.fn.adjustPanel = function(){
    $(this).find("ul, .subpanel").css({ 'height' : 'auto'}); //Reset sub-panel and ul height

    var windowHeight = $(window).height(); //Get the height of the browser viewport
    var panelsub = $(this).find(".subpanel").height(); //Get the height of sub-panel
    var panelAdjust = windowHeight - 100; //Viewport height - 100px (Sets max height of sub-panel)
    var ulAdjust =  panelAdjust - 25; //Calculate ul size after adjusting sub-panel

    if ( panelsub > panelAdjust ) {	 //If sub-panel is taller than max height...
        $(this).find(".subpanel").css({ 'height' : panelAdjust }); //Adjust sub-panel to max height
        $(this).find("ul").css({ 'height' : panelAdjust}); ////Adjust subpanel ul to new size
    }
    else if { //If sub-panel is smaller than max height...
        $(this).find("ul").css({ 'height' : 'auto'}); //Set sub-panel ul to auto (default size)
    }
};

//Execute function on load
$("#chatpanel").adjustPanel(); //Run the adjustPanel function on #chatpanel
$("#alertpanel").adjustPanel(); //Run the adjustPanel function on #alertpanel

//Each time the viewport is adjusted/resized, execute the function
$(window).resize(function () {
    $("#chatpanel").adjustPanel();
    $("#alertpanel").adjustPanel();
});var min=8;
var max=18;
function increaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}
