// JavaScript Document

function activeItem(current){
 var elements = getElementsByClassName ("on");
 elements[0].setAttribute("class", "off")	
 current.parentNode.setAttribute("class", "on");
 if (navigator.userAgent.indexOf('MSIE') !=-1)
{
	elements[0].setAttribute("className", "off")	
	current.parentNode.setAttribute("className", "on");
}
	  
}
function getElementsByClassName(classname, node) {
  if(!node) node = document.getElementsByTagName("body")[0];
  var a = []; 
  var re = new RegExp('\\b' + classname + '\\b'); 
  var els = node.getElementsByTagName("*");
  for(var i=0,j=els.length; i<j; i++)
  if(re.test(els[i].className))a.push(els[i]);
  return a; 
}


var minSize=8;
var maxSize=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!=maxSize) {
         s += 1;
      }
      p[i].style.fontSize = s+"px";
   }
   var li = document.getElementsByTagName('li');
   for(j=0;j<li.length;j++) {
      if(li[j].style.fontSize) {
         var s = parseInt(li[j].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=maxSize) {
         s += 1;
      }
      li[j].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!=minSize) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px";
   }   
   var li = document.getElementsByTagName('li');
   for(j=0;j<li.length;j++) {
      if(li[j].style.fontSize) {
         var s = parseInt(li[j].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=minSize) {
         s -= 1;
      }
      li[j].style.fontSize = s+"px";
   } 
}

function setClassName(){
	var names=new Array("one","two","three", "four", "five", "six"); 	
	var randomnumber=Math.floor(Math.random()*6);
	document.body.className=names[randomnumber];
}

