function stepcss_fontSize(obj) {
  obj.style.fontSize="";

}

function stepup_fontSize(obj) {
  var objSize=obj.style.fontSize;
 
  switch (objSize) {
    case "xx-small": obj.style.fontSize="x-small";	break;
    case "x-small" : obj.style.fontSize="small";	break;
    case "small"   : obj.style.fontSize="medium";	break;
    case "medium"  : obj.style.fontSize="large";	break;
    case "large"   : obj.style.fontSize="large"; 	break;	// sets magnification upper limit
    case "12px"    : obj.style.fontSize="14px";		break;
    case "14px"    : obj.style.fontSize="16px";		break;
    case "16px"    : obj.style.fontSize="18px";		break;
    case "18px"    : obj.style.fontSize="20px";		break;
    case "20px"    : obj.style.fontSize="20px";		break;  // sets magnification upper limit
    default        : obj.style.fontSize="14px";		break;
  }
}

function stepdn_fontSize(obj) {
  var objSize=obj.style.fontSize;

  switch (objSize) {
    case "large"   : obj.style.fontSize="medium";	break;
    case "medium"  : obj.style.fontSize="small";	break;
    case "small"   : obj.style.fontSize="x-small";	break;
    case "x-small" : obj.style.fontSize="xx-small";	break;
    case "20px"    : obj.style.fontSize="18px";		break;
    case "18px"    : obj.style.fontSize="16px";		break;
    case "16px"    : obj.style.fontSize="14px";		break;
    case "14px"    : obj.style.fontSize="12px";		break;
  }
}

function step_fontSize(obj, step) {
  if (step=="up") {
    stepup_fontSize(obj);
  }
  else if (step=="dn") {
    stepdn_fontSize(obj);
  }
  else {
    stepcss_fontSize(obj);
  }
}

function txtsize(step) {
	var types=["p","li","td","a","div","h3","h2","h1"];
	
	for(var i in types){
		var type=types[i];
		var elements=document.getElementsByTagName(type);
		for(var j=0;j<elements.length;j++){
			var element=elements[j];
			step_fontSize(element,step);
		}
	}
}

