// Graphics To Preload if Needed \\
var img1 = new Image; img1.src = "images/nav-bg.gif" 
var img2 = new Image; img2.src = "images/nav-bg-On.gif"  

// Changing Font Size Live In Browser \\
var min = 12;
var max = 24;

function toggleBackground(toggleBoolean, divId){
	var theCurrDiv = document.getElementById(divId);
	if(toggleBoolean == 1){
		theCurrDiv.style.backgroundColor = "#F4F4F4";
		theCurrDiv.style.borderColor = "#ccc";
	}else{
		theCurrDiv.style.backgroundColor = "#fff";
		theCurrDiv.style.borderColor = "#fff";
	}
}

function increaseFontSize(divId) {
	var theCurrDiv = document.getElementById(divId);
	var p = theCurrDiv.getElementsByTagName('p');
	for(i=0;i<p.length;i++) {
		if(p[i].style.fontSize) {
			var s = parseInt(p[i].style.fontSize.replace("px",""));
			var lh = parseInt(p[i].style.lineHeight.replace("px",""));
		} else {
			var s = 12;
			var lh = 16;
		}
		if(s!=max) {
			s += 1;
			lh += 1;
		}
		p[i].style.fontSize = s+"px"
		p[i].style.lineHeight = lh+"px"
	}
}

function decreaseFontSize(divId) {
   var theCurrDiv = document.getElementById(divId);
	var p = theCurrDiv.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
         var lh = parseInt(p[i].style.lineHeight.replace("px",""));
      } else {
         var s = 12;
         var lh = 16;
      }
      if(s!=min) {
         s -= 1;
         lh -= 1;
      }
      p[i].style.fontSize = s+"px"
      p[i].style.lineHeight = lh+"px"
   }   
}
