function changeFont(id,lid,family) {
	changeFontAction(id,lid,family);
	setCookie("newsFont",escape(family),365);
}
function changeFontAction(id,lid,family) {
	var target = $(id);
	target.style.fontFamily = family;
	var fontArr = $(lid).getElementsByTagName('A');
	for(var i=0,cnt=fontArr.length;i<cnt;++i) {
		if(family == getStyle(fontArr[i],"font-family")) fontArr[i].className = "on";
		else fontArr[i].className = "";
	}
	return true;
}
function changeSize(id,size) {
//	var realsize = parseInt(getStyle($(id),"font-size")) + size;
//	changeSizeAction(id,realsize);
	var realsize = parseInt(getStyle($(id),"font-size"));
	
	var realNoticeTD = $(id).getElementsByTagName("td");
	var realNoticeP = $(id).getElementsByTagName("p");
	
	if ( (realsize+ size) >= 13 && (realsize+ size) <= 20) {
		$(id).style.fontSize = new String(realsize + size)+"px";
		realsize = realsize + size;
		
		if(realNoticeTD) {
			if(realNoticeTD.length) {
				for(var i=0;i < realNoticeTD.length; i++) {
					realNoticeTD[i].style.fontSize =  new String(realsize + size)+"px";
				}
			}
		}
		
		if(realNoticeP) {
			if(realNoticeP.length) {
				for(var i=0;i < realNoticeP.length; i++) {
					realNoticeP[i].style.fontSize =  new String(realsize + size)+"px";
				}
			}
		}
		
	} else if ((realsize+ size) < 13) {
		alert("가장 작은 글꼴입니다");
		return;
	}  else if ((realsize+ size) > 20) {
		alert("가장 큰 글꼴입니다");
		return;		
	}

	setCookie("newsFontSize",escape(realsize),365);
}


function changeSizeAction(id,size) {
	if(size<=0) return;
	$(id).style.fontSize = size+"px";
}

function setCurFont(id,lid) {
	//document.title = getCookie("newsFont") + ", " + unescape(getCookie("newsFont"));
	var curFont = unescape(getCookie("newsFont"));
	if(!curFont || curFont == "false") curFont = "굴림,gulim";
	changeFontAction(id,lid,curFont);

	var curFontSize = unescape(getCookie("newsFontSize"));
	if(!isNaN(curFontSize) && curFontSize > 0) changeSizeAction(id,curFontSize);

}

function showLayer(id,isShow) {
	$(id).style.display = (isShow) ? "block" : "none";
}