﻿function setFontSize(fn,id){
	var obj=document.getElementById(id);
	var objs=obj.getElementsByTagName("*");
	var i,lh;
	lh=!fn?"":(fn*2)+"px"
	fn=!fn?"":fn+"px"
	obj.style.fontSize=fn
	obj.style.lineHeight=lh
    for(i=0;i<objs.length;i++){
	    objs[i].style.fontSize=fn
		objs[i].style.lineHeight=lh
	}
}

function setFontColor(fc,id){
	var obj=document.getElementById(id);
	var objs=obj.getElementsByTagName("*");
	var i;
	fc=!fc?"":fc
	if(obj.getAttribute("OldColor")==null || obj.getAttribute("OldColor")=="null" || obj.getAttribute("OldColor")==""){
	   obj.setAttribute("OldColor",obj.style.color)
	   obj.style.color=fc
	}
    for(i=0;i<objs.length;i++){
		if(objs[i].getAttribute("OldColor")==null  || objs[i].getAttribute("OldColor")=="null" || objs[i].getAttribute("OldColor")==""){
		   objs[i].setAttribute("OldColor",objs[i].style.color)
	       objs[i].style.color=fc
		}
	}
}

function resetFontColor(id){
	var obj=document.getElementById(id);
	var objs=obj.getElementsByTagName("*");
	var i;
	if(obj.getAttribute("OldColor")!=null && obj.getAttribute("OldColor")!="null" ){
	   obj.style.color=obj.getAttribute("OldColor")
	   obj.setAttribute("OldColor",null)
	}
    for(i=0;i<objs.length;i++){
		if(objs[i].getAttribute("OldColor")!=null && objs[i].getAttribute("OldColor")!="null" ){
	       objs[i].style.color=objs[i].getAttribute("OldColor")
		   objs[i].setAttribute("OldColor",null)
	    }
	}
}
