function $(elm) {
	return document.getElementById(elm);
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function largerText() {
	var body = document.getElementsByTagName("body")[0];
	var currentSize = parseInt(body.style.fontSize);
	
	if (!currentSize)
		currentSize = 10;
	
	if (currentSize < 20)
		body.style.fontSize = ++currentSize + "px";
}

function smallerText() {
	var body = document.getElementsByTagName("body")[0];
	var currentSize = parseInt(body.style.fontSize);

	if (currentSize > 10)
		body.style.fontSize = --currentSize + "px";
}

function largerTextBCNA() {
	var body = document.getElementsByTagName("body")[0];
	var currentSize = parseInt(body.style.fontSize);
	
	if (!currentSize)
		currentSize = 13;
	
	if (currentSize < 20)
		body.style.fontSize = ++currentSize + "px";
}

function smallerTextBCNA() {
	var body = document.getElementsByTagName("body")[0];
	var currentSize = parseInt(body.style.fontSize);

	if (currentSize > 13)
		body.style.fontSize = --currentSize + "px";
}


addLoadEvent(function() {
	$("text_resize_smaller").onclick = smallerText;
	$("text_resize_larger").onclick = largerText;
	$("text_resize_smaller_BCNA").onclick = smallerTextBCNA;
	$("text_resize_larger_BCNA").onclick = largerTextBCNA;
});
