/* Rollover
Requires:
	object id to equal the base name of the image
	over state of image ends with _over
	images are gifs
*/

function roll(obj, over)
{
	if (!obj)
		return
	
	if (over)
		src = '/Templates/media/images/' + obj.id + '_over.gif'
	else
		src = '/Templates/media/images/' + obj.id + '.gif'
	
	obj.src = src;
}

var menu_timer = null
var menu = null
var menu_body = null
var menu_open_color = null
var menu_close_color = null

function menu_open(obj, open_color, close_color)
{
	menu_hold()
	menu_close()

	menu_open_color = open_color
	menu_close_color = close_color

	menu = obj
	menu_body = document.getElementById(obj.id + '_body')
	
	menu.style.backgroundColor = menu_open_color
	menu_body.style.display = 'block'
}

function menu_close()
{
	if (!menu && !menu_body)
		return 

	menu.style.backgroundColor = menu_close_color
	menu_body.style.display = 'none'
	
	menu = null
	menu_body = null
}

function menu_start_close()
{
	menu_timer = window.setTimeout(menu_close, 25)
}

function menu_hold()
{
	if (menu_timer)
	{
		window.clearTimeout(menu_timer)
		menu_timer = null
	}
}
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"
   }
   var li = document.getElementsByTagName('li');
        
   for(i=0;i<li.length;i++) {
      if(li[i].style.fontSize) {
         var s = parseInt(li[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s += 1;
      }
      li[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"
   }   
   var li = document.getElementsByTagName('li');
   for(i=0;i<li.length;i++) {
      if(li[i].style.fontSize) {
         var s = parseInt(li[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      li[i].style.fontSize = s+"px"
   } 
}
