// Image Rollover
function ChgImg(name,img){
	var imgUrl = "img/"
	name.src = imgUrl + img;
}

//iframe size °ü·Ã ½ºÅ©¸³Æ®
function iframeCheck(na) {
	eval("var PF = "+na+".document.body");
	var CF = document.all[na];
	CF.style.height = PF.scrollHeight + (PF.offsetHeight - PF.clientHeight);
	//CF.style.width = PF.scrollWidth + (PF.offsetWidth - PF.clientWidth);
}

// ÆË¾÷½ºÅ©¸³Æ®
   function MM_openBrWindow(theURL,winName,features) { //v2.0
   window.open(theURL,winName,features);
   }

function orangeHow(){
		var howPop = window.open('popup/popup_how.asp','how','scrollbars=Yes,width=568,height=650,top=50,left=50');
		howPop.focus();
	}

// <a href="javascript:orangeHow();"><img src="/image/banner01.gif" alt="¿À·»Áö°æ¸Å ¾î¶»°Ô ÇÏ³ª¿ä?"></a>

// Å¬¸¯ÇÏ¸é ÆîÃÄÁö´Â ¸Þ´º(family site)
var firstGoOpen = false;

function openDirectly()
{
    var o = document.getElementById("Directlydiv");
    var img = document.getElementById("goimage");
    var ch = o.style.visibility;
    if (ch=='hidden'){
		if(!firstGoOpen){
        	firstGoOpen = true;
		}
		o.style.visibility = "visible";
		img.className ="nhnAlphaLoader_up";
	}	else {	
		o.style.visibility = "hidden";
		img.className ="nhnAlphaLoader_down";
	}
}

//¸¶¿ì½º ¿À¹ö½Ã ·¹ÀÌ¾î ¶ç¿ì±â(Á¤Á¤ Å¬¸¯½Ã)
function showDiv(obj,event){
 var sm = document.getElementById(obj);
 
 x = event.clientX;
 y = event.clientY;

 
 with(sm.style)
 {
   display = 'block';
  left = x;
  top  = y;
 }
}
 
function hidDiv(obj){
 var sm = document.getElementById(obj);
 with(sm.style)
 {
   display = 'none';
 }
}

/* select box */
var flag = true;

function test() {

	if(flag == true) {
	var a = document.getElementById("goRelAll");

	a.style.display="none";
	
	flag = false;
	}else{

	var a = document.getElementById("goRelAll");

	a.style.display="";
	flag = true;
	}
}
/* faq */
if (document.getElementById){
	document.write('<style type="text/css">\n')
	document.write('.submenu{display: none;}\n')
	document.write('a:link,a:visited,a:active { text-decoration:none; color:#808889;}\n')
	document.write('a:hover                   { text-decoration:underline; color:#FF7700;}\n')
	document.write('</style>\n')
}

function SwitchMenu(obj){
		if(document.getElementById){
		var el = document.getElementById(obj);
		var ar = document.getElementById("maindiv").getElementsByTagName("div"); 
				if(el.style.display != "block"){
						for (var i=0; i<ar.length; i++){
								if (ar[i].className=="submenu") 
								ar[i].style.display = "none";
						}
						el.style.display = "block";
				}else{
						el.style.display = "none";
				}
		}
}
/* tab */
function Change(flag)
{			
	document.all.tb1.style.display="none";	
	document.all.tb2.style.display="none";		
	document.all.tb3.style.display="none";	
	document.all.tb4.style.display="none";	
	document.all.tb5.style.display="none";		
	document.all.tb6.style.display="none";	

	var b=eval("document.all.tb"+flag);		
	b.style.display="";
}
/* layer ¿­°í ´Ý°í(»èÁ¦¿¹Á¤) */
function init(a) {
      a.style.visibility = "visible";
 
}
 
var lastIdx=-1; 
function mouseAction(idx,how){
        if(lastIdx != -1 && lastIdx != idx){
                lastAction(idx,lastIdx,how);
        }
        
        curAction(idx,how);
        if(how==1){
                lastIdx=idx;
        }
} 
 
function curAction(idx,how){
        if(how==1){
                if(eval("win" + idx + ".style.pixelLeft < -10")){
                        eval("win" + idx + ".style.pixelLeft +=20");
                        setTimeout("curAction("+ idx +","+how+")",1);
                }
        }else{
                if(eval("win" + idx + ".style.pixelLeft > -180")){
                        eval("win" + idx + ".style.pixelLeft -=20");
                        setTimeout("curAction("+ idx +","+how+")",1);
 
                }
        }
}
 
function lastAction(idx,lastObj,how){
        if(how==1){
                if(eval("win" + lastObj + ".style.pixelLeft > -180")){
                        eval("win" + lastObj + ".style.pixelLeft -=20");
                        setTimeout("lastAction("+idx + ","+ lastObj +","+ how +")",1);
                }
        }else{
                if(eval("win" + idx + ".style.pixelLeft > -180")){
                        eval("win" + idx + ".style.pixelLeft -=20");
                        setTimeout("lastAction("+idx + ","+ lastObj +","+ how +")",1);
                }
 
        }
 
}
/* ½ºÅ©·Ñ µû¶ó ´Ù´Ï´Â top ¹öÆ° */
function initMoving(target, position, topLimit, btmLimit) {

	if (!target)
		return false;

	var obj = target;
	obj.initTop = position;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;

	if (typeof(window.pageYOffset) == "number") {
		obj.getTop = function() {
			return window.pageYOffset;
		}
	} else if (typeof(document.documentElement.scrollTop) == "number") {
		obj.getTop = function() {
			return document.documentElement.scrollTop;
		}
	} else {
		obj.getTop = function() {
			return 0;
		}
	}

	if (self.innerHeight) {
		obj.getHeight = function() {
			return self.innerHeight;
		}
	} else if(document.documentElement.clientHeight) {
		obj.getHeight = function() {
			return document.documentElement.clientHeight;
		}
	} else {
		obj.getHeight = function() {
			return 500;
		}
	}

	obj.move = setInterval(function() {
		if (obj.initTop > 0) {
			pos = obj.getTop() + obj.initTop;
		} else {
			pos = obj.getTop() + obj.getHeight() + obj.initTop;
			//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		}

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit;
		if (pos < obj.topLimit)
			pos = obj.topLimit;

		interval = obj.top - pos;
		obj.top = obj.top - interval / 10;
		obj.style.top = obj.top + "px";
	}, 30)
}

// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¾ÆÀÌµð, ¹è°æ»ö, º¯¼ö, À©µµ¿ì¸ðµå)
function flashWrite(url,w,h,id,bg,vars,win){
	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='FlashVars' value='"+vars+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";
	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);

}

function mainMenu(main, sub)
{
	//alert(main);
	//alert(sub);

	if(main == "1") {
		if (sub == "0")
		{
			top.location.href="/Kor/Amak/AmMain.aspx";
		} else if (sub == "1")
		{
			top.location.href="/Kor/Amak/AmGreetings.aspx";
		} else if (sub == "2")
		{
			top.location.href="/Kor/Amak/AmHistory.aspx";
		} else if (sub == "3")
		{
			top.location.href="/Kor/Amak/AmArticle.aspx";
		} else if (sub == "4")
		{
			top.location.href="/Kor/Amak/AmServices.aspx";
		} else if (sub == "5")
		{
			top.location.href="/Kor/Amak/AmOrganization.aspx";
		} else if (sub == "6")
		{
			top.location.href="/Kor/Amak/AmIdeology.aspx";
		} else if (sub == "7")
		{
			top.location.href="/Kor/Amak/AmChronology.aspx";
		} else if (sub == "8")
		{
			top.location.href="/Kor/Amak/AmContactUs.aspx";
		}
	} else if(main == "2") {
		if (sub == "0")
		{
			top.location.href="/Kor/Mem/MeMain.aspx";
		} else if (sub == "1")
		{
			top.location.href="/Kor/Mem/MeMemberSystemInfo.aspx";
		} else if (sub == "2")
		{
			top.location.href="/Kor/Mem/MeManagementPrinciple.aspx";
		} else if (sub == "3")
		{
			top.location.href="/Kor/Mem/MeMemberList.aspx";
		} else if (sub == "4")
		{
			top.location.href="/Kor/Mem/MeMemberOnSeq.aspx";
		} else if (sub == "5")
		{
			top.location.href="/Kor/Mem/MeMemberNews.aspx";
		} else if (sub == "6")
		{
			top.location.href="/Kor/Cus/CuVoiceLawList.aspx";
		} else if (sub == "7")
		{
			top.location.href="/Kor/Mem/MeFSSReport.aspx";
		}
	} else if(main == "3") {
		if (sub == "0")
		{
			top.location.href="/Kor/Info/InMain.aspx";
		} else if (sub == "1")
		{
			top.location.href="/Kor/Info/InTrustRule.aspx";
		} else if (sub == "2")
		{
			top.location.href="/Kor/Info/InProvision.aspx";
		} else if (sub == "3")
		{
			top.location.href="/Kor/Info/InResearchPds.aspx";
		} else if (sub == "4")
		{
			top.location.href="/Kor/Info/InPressPds.aspx";
		} else if (sub == "5")
		{
			top.location.href="/Kor/Info/InSeminarList.aspx";
		} else if (sub == "6")
		{
			top.location.href="/Kor/Info/InTaxList.aspx";
		}
	} else if(main == "4") {
		if (sub == "0")
		{
			top.location.href="/Kor/App/AppMain.aspx";
		} else if (sub == "1")
		{
			top.location.href="/Kor/App/AppTraining.aspx";
		} else if (sub == "2")
		{
			top.location.href="/Kor/App/AppSeminarQNA.aspx";
		} else if (sub == "3")
		{
			top.location.href="/Kor/App/AppRentalRoom.aspx";
		} else if (sub == "4")
		{
			top.location.href="/Kor/App/AppOpInfo.aspx";
		} else if (sub == "5")
		{
			top.location.href="/Kor/App/AppOpTestInfo.aspx";
		} else if (sub == "6")
		{
			top.location.href="/Kor/App/AppSalesExamInfo.aspx";
		} else if (sub == "7")
		{
			top.location.href="/Kor/App/AppBookBuyInfo.aspx";
		}
	} else if(main == "5") {
		if (sub == "0")
		{
			top.location.href="/Kor/Cus/CuMain.aspx";
		} else if (sub == "1")
		{
			top.location.href="/Kor/Cus/CuNotice.aspx";
		} else if (sub == "2")
		{
			top.location.href="/Kor/Cus/CuVoiceList.aspx";
		} else if (sub == "3")
		{
			top.location.href="/Kor/Cus/CuProposal.aspx";
		} else if (sub == "4")
		{
			top.location.href="/Kor/Cus/CuSiteGuide.aspx";
		} else if (sub == "5")
		{
			top.location.href="/Kor/Cus/CuRelationSite.aspx";
		} else if (sub == "6")
		{
			top.location.href="/Kor/Cus/CuCyberPoll.aspx";
		} else if (sub == "7")
		{
			top.location.href="/Kor/Cus/CuToPresident.aspx";
		} else if (sub == "8")
		{
			top.location.href="/Kor/Cus/CuFundAffairsInfo.aspx";
		}
	}	
	
}