var cookieTime = 0;
var fontSize = 12;
function plusPageFont(){
var targetLayer = document.getElementById("contentLayer");
if (fontSize < 23) {
objectFontCheck(document.getElementById("contentLayer"), true);
addCookie("fontSize",(fontSize + 1),"/",cookieTime);
fontSize++;
}
}
function minusPageFont(){
var targetLayer = document.getElementById("contentLayer");
if (fontSize > 9) {
objectFontCheck(document.getElementById("contentLayer"), false);
addCookie("fontSize",(fontSize - 1),"/",cookieTime);
fontSize--;
}
}
function objectFontCheck(ob, flag){
if(ob!=null && ob.innerHTML != ""){
if(ob.tagName != "!" && ob.tagName != null && ob.tagName != "SCRIPT"){
if(ob.style==null || ob.style.fontSize==null){
// style.fontSize가 지정되지 않는 테그 무시
}else{
if(flag){
upFont(ob);
}else{
downFont(ob);
}
if(ob.children!=null && ob.children.length > 0){
var index = 0;
while(index < ob.children.length){
objectFontCheck(ob.children[index], flag);
index++;
}
}
}
}
}
}
function upFont(ob){
if(ob.style.fontSize==null){
ob.style.fontSize = "12px";
}
if (fontSize < 23) {
ob.style.fontSize = (fontSize + 1) +"px";
}
}
function downFont(ob){
if(ob.style.fontSize==null){
ob.style.fontSize = "12px";
}
if (fontSize > 9) {
ob.style.fontSize = (fontSize - 1) +"px";
}
}
// 페이지 FONT 크기 초기화
// FONT 값 증가/감소의 쿠키에 존재하는 시간
cookieTime = 0;
// 기본 FONT 값
defaultFontSize = 12;
// 초기화 할 FONT 값
fontSize = 12;
if(getCookie("fontSize") != null && getCookie("fontSize") != ""){
defaultFontSize = parseInt(getCookie("fontSize"));
}
if(defaultFontSize != fontSize){
var i = 0;
if(defaultFontSize > fontSize){
while(fontSize < defaultFontSize){
plusPageFont();
}
}else if(defaultFontSize < fontSize){
while(fontSize > defaultFontSize){
minusPageFont();
}
}
}
bibaram