/****************************************************
* @version : 1.0
* @date : 2005.10.26
* @author : jun yoon tae
****************************************************/
function setCookie( name, value, expiredays )
{
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function font_getCookie( name )
{
    var nameOfCookie = name + "=";
    var x = 0;
	cookieFlg = document.cookie.indexOf(nameOfCookie);
    if (cookieFlg != -1) {

        while ( x <= document.cookie.length )
        {
                var y = (x+nameOfCookie.length);
                if ( document.cookie.substring( x, y ) == nameOfCookie ) {
                        if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                                endOfCookie = document.cookie.length;
                        return unescape( document.cookie.substring( y, endOfCookie ) );
                }
				
                x = document.cookie.indexOf( " ", x ) + 1;
				 if ( x == 0 )
                        break;
        }

        return "";
	}
	else{
	 return 15;
	}
}
function getFontCookie() { 
	var cookie = font_getCookie("getFontSize"); 
	if ( cookie == null ) 
		return 15; 
	if ( cookie.length ) 
		return cookie; 
	else 
		return 15; 
}
function diffFont(calcSize) {
	var news_content, lineHeight; 
	var news_content2
	
	try{

		news_content = document.getElementById("news_content"); //div id = news_content
	
		if (news_content != 'undefine')
		{
			if (calcSize > 0) { 
				if (txtSize <= 18) { 
					txtSize = txtSize + calcSize; 
					lineHeight = txtSize+Math.round(1.1*txtSize); 
					news_content.style.fontSize = txtSize + "px"; 
				} 
			} else { 
				if (txtSize > 12) { 
					txtSize = txtSize + calcSize; 
					lineHeight = txtSize+Math.round(1.1*txtSize); 
					news_content.style.fontSize = txtSize + "px"; 
					} 
			} 

		}else{
			alert("news_content is undefine");
		}
	}catch(e){
	
	}

	try{

		news_content2 = document.getElementById("news_content2"); //div id = news_content	
		if (news_content2 != 'undefine'){
			if (calcSize > 0) { 
				if (txtSize <= 18) { 
					txtSize = txtSize + calcSize; 
					lineHeight = txtSize+Math.round(1.1*txtSize); 
					news_content2.style.fontSize = txtSize + "px"; 
				} 
			} else { 
				if (txtSize > 12) { 
					txtSize = txtSize + calcSize; 
					lineHeight = txtSize+Math.round(1.1*txtSize); 
					news_content2.style.fontSize = txtSize + "px"; 
					} 
			} 
		}else{
			alert("news_content2 is undefine");
		}

	}catch(e){
	
	}

	var fontDate = new Date; 
	fontDate.setDate(fontDate.getDate()+1000); 
	setCookie("getFontSize", txtSize, 1)//fontDate); 
}
var txtSize = parseInt(getFontCookie());

// ÁÖ¾îÁø ¹üÀ§¾È¿¡ ¿øÇÏ´Â ¸¸Å­ ¼­·Î´Ù¸¥ ·£´ý »Ì±â

var callRanNumArr = new Array();
function callRanFun(Range,Some){
	var f = false;
	while(true)
	{
		f = false;
		var ranNo = Math.floor(Math.random()*Range);
		for(i=0;i<callRanNumArr.length;i++)
		{
			if(callRanNumArr[i] == ranNo) f = true;
		}
		if(!f) 
		{
			callRanNumArr[callRanNumArr.length] = ranNo;
		}
		if(callRanNumArr.length == Some) break;
	}
	//callRanNumArr = callRanNumArr.sort();
}

