// JavaScript Document

function switchimage(newimg, oldimg) {
	var img = document.getElementById(oldimg);
	img.setAttribute('src', 'assets/images/' + newimg);
}


var min=10;
var max=18;
function increaseFontSize(divname) {
   var p = document.getElementById(divname);
   
      if(p.style.fontSize) {
         var s = parseInt(p.style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p.style.fontSize = s+"px"
   
}
function decreaseFontSize(divname) {
   var p = document.getElementById(divname);
      if(p.style.fontSize) {
         var s = parseInt(p.style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p.style.fontSize = s+"px"
   
}

function pop(url,sb,wd,ht) {
  if((wd == "max")||(wd > screen.availWidth)) { // use 'max' to enable full width based on screen resolution
    wd = (screen.availWidth)-2; // subtract 2 to avoid divide by zero error
  }
 
  if((ht == "max")||(ht > screen.availHeight)) { // use 'max' to enable full height based on screen resolution
    ht = (screen.availHeight)-40; // subtract 40 pixels to account for taskbar
  }
 
  day = new Date();
  id = day.getTime();
  
  var left = (screen.availWidth-wd)/2;
  var top = ((screen.availHeight-ht)/2);
  
  eval("page"+id+"=window.open(url,'"+id+"','scrollbars="+sb+",width="+wd+",height="+ht+",left="+left+",top="+top+"');");
}
