function changeImg(newVar) {
	defaultMc.setVariable("openContent", newVar);
}
function loginAction(mb_id) {
	defaultMc.setVariable("mb_id", mb_id);
}
function popup(popupURL) {
	defaultMc.setVariable("popupURL", popupURL);
}



var IE = false ;
var miniumHg = 50;
var oldHeightVar = 50;
var iframeMode = false;



function iframeFn (vsl, iLeft, iTop, iWidth, iHeigth) {
	document.all.contentView.style.display=vsl;
	document.all.contentView.style.marginLeft=iLeft;
	document.all.contentView.style.marginTop=iTop;
	document.all.contentView.style.width=iWidth;
	//document.all.contentView.style.height=0;
	if (vsl == "none") {
		contentView.location.href = "blank.asp";
		document.all.contentView.style.height=0;
		//alert("n");
		iframeMode = false;
	}
}

function iframeLnk (args) {
//	alert(args);
	document.all.contentView.style.height=0;
	contentView.location.href = args;
	iframeMode = true;
}
function popupFn (vsl, pLeft, pTop, pWidth, pHeigth) {
	document.all.contentPopup.style.display=vsl;
	document.all.contentPopup.style.marginLeft=pLeft;
	document.all.contentPopup.style.marginTop=pTop;
	document.all.contentPopup.style.width=pWidth;
	document.all.contentPopup.style.height=pHeigth;
	if (vsl == "none") {
		contentPopup.location.href = "blank.asp";
		document.all.contentPopup.style.height=0;
	}
}

function popupLnk (args) {
	document.all.contentPopup.style.height=0;
	contentPopup.location.href = args;
}

function historyBack() {
	defaultMc.setVariable("historyBack", "ok");
}


function newFlashHg(args) {
	document.all.defaultMc.style.height = args;
}

if (window.navigator.appName.indexOf("Explorer") !=-1) IE = true;

function getReSize() {
	try {
		var objFrame = document.getElementById("contentView");
		if(IE) objBody = contentView.document.body;
		else objBody = contentView.contentDocument.body;
//		if (iframeMode == true) {
			contentViewHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight); 
			if (contentViewHeight > miniumHg) {
				newHeightVar = contentViewHeight;
			} else {
				newHeightVar = miniumHg;
			}
			if (newHeightVar != oldHeightVar) {
				oldHeightVar = newHeightVar;
				objFrame.style.height = newHeightVar; // ÆäÀÌÁö ÇÁ·¹ÀÓH
				defaultMc.setVariable("iframeHg", newHeightVar);
			}
	//	}
	} 
	catch(e) {
	};
	setTimeout('getReSize()',1000);
} 
getReSize();


alpha_numeric = new String("0123456789abcdefghijklmnopqrstuvwxyz.")

function check_alphanumber(str)
{
        for(j = 0 ; j < str.length; j++)
        {
                rtn = is_alpha_numeric(str.charAt(j))
                if(rtn == false)
                {
                        return rtn;
                }
        }
        return rtn;
}

function is_alpha_numeric(cha1)
{
        for(i=0;i<alpha_numeric.length;i++)
        {
                if(alpha_numeric.charAt(i) == cha1)
                        return true;
        }
        return false;
}

function IsAlpha(c)
{
        if (c >= '0' && c <= '9')
                return 1;
        if (c >= 'a' && c <= 'z')
                return 1;
        if (c >= 'A' && c <= 'Z')
                return 1;
        else return 0;
}

var nIndexBackup = -1

function ShowLayer_comment(nIndex)
{
//	alert(document.getElementById('info_div').style.height);

	if (document.all["BBS1" + nIndex].style.display == "") {
		document.all["BBS1" + nIndex].style.display = "none";		
		nIndexBackup = -1;
		return;
	}
	
	if (nIndexBackup != -1) {
		document.all["BBS1" + nIndexBackup].style.display = "none";		
	}
	
	document.all["BBS1" + nIndex].style.display = "";
	nIndexBackup = nIndex
}


function setScroll(arg) {
    window.scrollBy(0,Number(arg)*-20);
}

function setCookie( name, value, expiredays ) 
{ 
    var todayDate = new Date(); 
    todayDate.setDate( todayDate.getDate() + expiredays ); 
    document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 

function getCookie( name ) 
{ 
    var nameOfCookie = name + "="; 
    var x = 0; 
    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 ""; 
} 

function closeIntro() 
{ 
	setCookie( "ki_intro", "done" , 3); 
}
