

	//ie ÀÏ°æ¿ì¸¸
if (window.ActiveXObject) {

	if (document.getElementById("font-size-bigger-main"))
	{
		f_set();
		zoomInOut('zoom', 'default');
		f_ie_main();

	}else
	{
		f_ie();
	}

}
else
{

	f_ff();

}

function f_ie(){
		document.getElementById("font-size-bigger").onclick = function () {
			zoomInOut('zoom', 'in')
			//zoom_it(1);
			return false;
		}
		document.getElementById("font-size-default").onclick = function () {
			zoomInOut('zoom', 'default')
			f_set();
			//window.location.reload();
			return false;
		}
		document.getElementById("font-size-smaller").onclick = function () {
			zoomInOut('zoom', 'out')
			//zoom_it(-1);
			return false;
		}

		f_setInit_ie();
		//f_setInit();

}

function f_ff(){

		document.getElementById("font-size-bigger").onclick = function () {
			 f_fontPlus() 
			//zoom_it(1);
			return false;
		}
		document.getElementById("font-size-default").onclick = function () {
			 f_set();
			 zoomInOut('zoom', 'default');
			//window.location.reload();
			return false;
		}
		document.getElementById("font-size-smaller").onclick = function () {
			f_fontMinus()
			//zoom_it(-1);
			return false;
		}

		f_setInit();
		f_setInit_ie();

}


function f_ie_main(){

		document.getElementById("font-size-bigger-main").onclick = function () {
			 f_fontPlus() 
			//zoom_it(1);
			return false;
		}
		document.getElementById("font-size-default-main").onclick = function () {
			 f_set()
			 zoomInOut('zoom', 'default');
			//window.location.reload();
			return false;
		}
		document.getElementById("font-size-smaller-main").onclick = function () {
			f_fontMinus()
			//zoom_it(-1);
			return false;
		}

		f_setInit();
		f_setInit_ie();

}

var fontSize = 12;

function tts_setCookie(key, value, term){
    var expire = new Date();
    expire.setDate( expire.getDate() + term );
    document.cookie = key + "=" + escape( value ) + "; path=/; expires=" + expire.toGMTString() + ";";
}


function tts_readCookie( str )
{
    var key = str + "=" ;
    var key_len = key.length ;
    var cookie_len = document.cookie.length;
    var i = 0;

    while (i < cookie_len )
    {
	var j = i + key_len;
	if ( document.cookie.substring( i, j ) == key )
	{
	    var cookie_end = document.cookie.indexOf(";",j);

	    if (cookie_end == -1)
	    {
		cookie_end = document.cookie.length;
	    }

	    return document.cookie.substring(j,cookie_end );
	}
	i++
    }
    return ""
}

function f_setInit(){
    if (tts_readCookie("fontSize").length == 0) {
	fontSize = 12;
	tts_setCookie("fontSize", 12, 1);
    } else {
	fontSize = tts_readCookie("fontSize");
    }
    f_setFace();
}

function f_set(){
	fontSize = 12;
	tts_setCookie("fontSize", 12, 1);
	f_setFace();
}
function f_setFace(){
    var objs_td		= new Array();
    var objs_th		= new Array();
    var	objs_a		= new Array();
    var	objs_span	= new Array();
    var objs_p		= new Array();
    var objs_div	= new Array();

    objs_td   = document.getElementsByTagName("td");
    objs_th   = document.getElementsByTagName("th");
    objs_a    = document.getElementsByTagName("a");
    objs_span = document.getElementsByTagName("span");
    objs_p    = document.getElementsByTagName("P");
    objs_div  = document.getElementsByTagName("DIV");

    for (i=0;i<objs_td.length;i++)
    {
	objs_td[i].style.fontSize=fontSize+'px';
    }
    for (i=0;i<objs_th.length;i++)
    {
	objs_th[i].style.fontSize=fontSize+'px';
    }
    for (i=0;i<objs_a.length;i++)
    {
	objs_a[i].style.fontSize=fontSize+'px';
    }
    for (i=0;i<objs_span.length;i++)
    {
	objs_span[i].style.fontSize=fontSize+'px';
    }
    for (i=0;i<objs_p.length;i++)
    {
	objs_p[i].style.fontSize=fontSize+'px';
    }
    for (i=0;i<objs_div.length;i++)
    {
	objs_div[i].style.fontSize=fontSize+'px';
    }
    tts_setCookie("fontSize", fontSize, 1);
}

function f_fontPlus() 
{
    if (fontSize < 20) 
    {
	fontSize = parseInt(fontSize) + 2;		
	f_setFace();
    }
}

function f_fontMinus() {
    if (fontSize > 11) {
	fontSize = parseInt(fontSize) - 2;		
	f_setFace();
    }
}




















var zoomRate = 5;
var maxRate = 200;
var minRate = 100;
var curRate = 100;


/* onload¿¡ ³Ö¾î¾ß ÇÒ ÇÔ¼ö */
function f_setInit_ie(){

    if(tts_readCookie("zoomVal") != null && tts_readCookie("zoomVal") != "")
    {
		curRate = tts_readCookie("zoomVal");
		if((curRate <=minRate)||(curRate>=maxRate))
		{
			curRate = 100;
		}

		tts_setCookie("zoomVal",curRate, 1);
		document.body.style.zoom = curRate + '%';
    }
    else
    {

		document.body.style.zoom = '100%';
		curRate = 100;
		tts_setCookie("zoomVal",100, 1);
    }
}


/* zoomInOut('zoom','in') -> È®´ë, zoomInOut('zoom','out') -> Ãà¼Ò */
function zoomInOut(contentid, how)
{

    if(tts_readCookie("zoomVal") != null && tts_readCookie("zoomVal") != "")
    {
		curRate = tts_readCookie("zoomVal");
    }

	if (how == "default")
	{
		document.body.style.zoom = '100%';
		curRate = 100;
		tts_setCookie("zoomVal",100, 1);
	}
	else
	{
	
		if (((how == "in")&&(curRate >= maxRate))||((how == "out") && (curRate <= minRate))) {
		return;   /* ¹üÀ§ ÃÊ°ú½Ã ¸®ÅÏÇÑ´Ù */
		}
		if (how == "in") {
		curRate = (-(-(curRate))) + (-(-(zoomRate)));
		document.body.style.zoom = curRate + '%';	/* È­¸é È®´ë */
		}
		else {
		curRate = (-(-(curRate))) - (-(-(zoomRate)));
		document.body.style.zoom = curRate + '%';	/* È­¸é Ãà¼Ò */
		}
		tts_setCookie("zoomVal",curRate, 1);
	}
}
