//Font Control V5.0

var defaultsize=12;
var min=11;
var max=14;
function resetFontSize() {
   var p = document.getElementsByTagName('div');
   for(i=0;i<p.length;i++) {      
      p[i].style.fontSize = defaultsize+"px";
   }
}
function changeFontColorq(col) {
   var p = document.getElementsByTagName('div');
   for(i=0;i<p.length;i++) {      
      p[i].style.color = "#"+col;
   }
   var p2 = document.getElementsByTagName('p');
   for(i=0;i<p2.length;i++) {      
      p2[i].style.color = "#"+col;
   }
   var p3 = document.getElementsByTagName('td');
   for(i=0;i<p3.length;i++) {      
      p3[i].style.color = "#"+col;
   }
   var p3 = document.getElementsByTagName('a');
   for(i=0;i<p3.length;i++) {      
      p3[i].style.color = "#"+col;
   }
}
function changeFontColor(id, val)
{
     var e = document.getElementById(id);
     if(!(e))
     {
          alert("This change is not possible!");
          return(false);
     }
     e.style.color = "#"+val;
}


function increaseFontSize() {
   var p = document.getElementsByTagName('div');
   for(i=0;i<p.length;i++) {
	  if(p[i].id == 'headerlink') {
		  continue;
   	  }
	  else {
	      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 p = document.getElementsByTagName('ul');
   
   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 p = document.getElementsByTagName('td');
   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 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('div');
   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 p = document.getElementsByTagName('li');
   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 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 p = document.getElementsByTagName('td');
   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"
   }   
}
//scroll
function Scroll(id,dis,pos){
	var obj=document.getElementById(id)
	obj.scrollTop=obj.scrollTop+dis;
	if (pos){obj.scrollTop=pos; }
	else {zxcTO=setTimeout( function(){ Scroll(id,dis); },10); }
}

function mainmenu() {
	$jQuery(" .menu ul ").css({display: "none"}); // Opera Fix
	$jQuery(" .menu li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(500);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}
