
/************************************¸Þ´º°ü·Ã½ºÅ©¸³Æ®_ÀÌÀºÇØ*********************************************************************/

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
 
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
 
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
 
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
 
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
 
function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
}
 
// IE6.0 ÀÏ °æ¿ì  Äü¸Ê È£Ãâ
function JsQuickMap() {
    var brVer = navigator.userAgent;
 
    if ( -1 != brVer.indexOf("MSIE 6.0") ) {
        window.open('/left_menu.html', '_search');
    } else {
        alert("ÇØ´ç ±â´ÉÀº Internet Explorer 6.0  ¿¡¼­¸¸ ÀÌ¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
    }
}
 
function JsNoticeChg(str) {
	    if (str == "notice1") {
	        notice1.style.display = "block";
	        notice2.style.display = "none";
	        document.getElementById('notice1_1').focus();
	    } else if (str == "notice2") {
	        notice1.style.display = "none";
	        notice2.style.display = "block";
	        document.getElementById('notice2_1').focus();
	    }
	}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}



function ShowFlash(url, width, height, wmode, id){
        document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9.0.28.0" width="' + width + '" height="' + height + '" id="'+ id +'" VIEWASTEXT style="z-index:0;">');
        document.write('<param name="allowScriptAccess" value="always" />');
        document.write('<param name="allowFullScreen" value="false" />');
        document.write('<param name="movie" value="' + url + '">');
        document.write('<param name="menu" value="false" />');
        document.write('<param name="quality" value="best" />');
		var mozillaVal = '';
		if (!wmode) {
			document.write('<param name="wmode" value="transparent" />');
			mozillaVal = ' wmode="transparent"';
		}
		else {
			document.write('<param name="wmode" value="window" />');
			mozillaVal = ' wmode="opaque"';
		}
        document.write('<param name="bgcolor" value="#ffffff" />');
        document.write('<param name="swLiveConnect" value="true" />');
        document.write('<embed src="' + url + '"menu="false" quality="best" '+ mozillaVal +' bgcolor="#ffffff" swLiveConnect="true" width="' + width + '" height="' + height + '" name="'+ id +'" id="'+ id +'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
        document.write('</object>');
		if (id) document.getElementById(id).focus();
}



function JsMenuView(id) {
		 
			var imgName;
			var re;
		 
			for(i=1 ; i<=6 ; i++) {
				imgName = "/2010/images/menu/mainmenu_0"+i+"_off.gif";
				re = "menu_"+i+"_img";
				document.getElementById(re).src = imgName;
				document.getElementById("submenu_"+i).style.display="none";
			}
		 
			imgName = "/2010/images/menu/mainmenu_0"+id+"_on.gif";
			document.getElementById("menu_"+id+"_img").src = imgName;
			if(document.getElementById("submenu_"+id)){
				document.getElementById("submenu_"+id).style.display="block";
			}
		}




/************************************¸Þ´º°ü·Ã½ºÅ©¸³Æ®³¡*********************************************************************/





















/* Flash */
function IE_HtmlRewrite(objParent) {
	if (window.ActiveXObject && objParent) {
		objParent.innerHTML = objParent.innerHTML;
	}
}

function imageOver(imgEl) {
	imgEl.src = imgEl.src.replace(".gif", "_on.gif");
}
function imageOut(imgEl) {
	imgEl.src = imgEl.src.replace("_on.gif", ".gif");
}
function menuOn(imgEl) {
	imgEl.src = imgEl.src.replace(".gif", "_on.gif");
}
function menuOut(imgEl) {
	imgEl.src = imgEl.src.replace("_on.gif", ".gif");
}
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", ".gif");
				} else {
					currentmenu.className = currentmenu.className.replace("on", "");
				}
			}

			this.targetEl.style.display = "block";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace(".gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}

/* Slide Content */
var currentContentPage = 1;
var contentElCount = 0;
var content_x = 0;
var slideContentTo = 0;
var contentWidth = 140;
var isImageBtn = false;

function initScrollContent(initCont) {
	cont = document.getElementById("slideContent").getElementsByTagName("div");

	for (i=0; i<cont.length; i++) {
		if (cont[i].className == "slideContent") {
			contentElCount++;
			cont[i].style.left = contentWidth * (contentElCount - 1) + "px";
		}
	}
	setSlideBtn();
}
function setSlideBtn() {
	if (parseInt(currentContentPage) == 1) {
		setPrevBtn("off");
		setNextBtn("on");
	} else if (parseInt(currentContentPage) == contentElCount) {
		setPrevBtn("on");
		setNextBtn("off");
	} else {
		setPrevBtn("on");
		setNextBtn("on");
	}
}
function setPrevBtn(condition) {
	var prevBtn = document.getElementById("prevBtn");

	if (condition == "on") {
		prevBtn.onclick = viewPrev;
		if (isImageBtn) prevBtn.src = prevBtn.src.replace("_off.gif", ".gif");
		prevBtn.className = "on";
	} else {
		prevBtn.onclick = "";
		if (isImageBtn) prevBtn.src = prevBtn.src.replace(".gif", "_off.gif");
		prevBtn.className = "off";
	}
}
function setNextBtn(condition) {
	var nextBtn = document.getElementById("nextBtn");

	if (condition == "on") {
		nextBtn.onclick = viewNext;
		if (isImageBtn) nextBtn.src = nextBtn.src.replace("_off.gif", ".gif");
		nextBtn.className = "on";
	} else {
		nextBtn.onclick = "";
		if (isImageBtn) nextBtn.src = nextBtn.src.replace(".gif", "_off.gif");
		nextBtn.className = "off";
	}
}
function viewPrev() {
	slideContentTo += contentWidth;
	currentContentPage = parseInt(currentContentPage) - 1;
	setSlideBtn();
	startScroll();
}
function viewNext() {
	slideContentTo -= contentWidth;
	currentContentPage = parseInt(currentContentPage) + 1;
	setSlideBtn();
	startScroll();
}
function startScroll() {
	setTimeout("slideContent()", 10);
}
function slideContent() {
	if (Math.abs(content_x - slideContentTo) > 1) {
		content_x += (slideContentTo - content_x) * .15;
		document.getElementById("slideContent").style.left = content_x + "px";
		startScroll();
	} else {
		content_x = slideContentTo;
		document.getElementById("slideContent").style.left = content_x + "px";
	}
}

function Rimg() {
	var imgList = ['/html/common/_images/main_visual_01.jpg','/html/common/_images/main_visual_02.jpg','/html/common/_images/main_visual_03.jpg'];
	var ry=Math.floor(Math.random()*imgList.length);
	document.write("<img src='"+imgList[ry]+"' alt='Green Korea! ÄèÀûÇÑ ³ì»ö°ø°£' />");
	document.getElementById("img").className = "bg"+ry ;
}

function initMoving(target) {
	if (!target)
		return false;

	var obj = target;
	obj.initTop = 530;
	obj.initLeft = 900;
	obj.bottomLimit = document.documentElement.scrollHeight;
	obj.topLimit = 130;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;
	obj.style.top = obj.top + "px";
	obj.style.left = obj.left + "px";

	obj.getTop = function() {
		if (document.documentElement.scrollTop) {
			return document.documentElement.scrollTop;
		} else if (window.pageYOffset) {
			return window.pageYOffset;
		} else {
			return 0;
		}
	}
	obj.getHeight = function() {
		if (self.innerHeight) {
			return self.innerHeight;
		} else if(document.documentElement.clientHeight) {
			return document.documentElement.clientHeight;
		} else {
			return 500;
		}
	}
	obj.move = setInterval(function() {
		pos = obj.getTop() + obj.getHeight() / 7;

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit
		if (pos < obj.topLimit)
			pos = obj.topLimit

		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 40)
}

function openClose(num) {
    if (num == '1') {
        document.getElementById('info-dt01').style.display = 'none';
        document.getElementById('info-dt02').style.display = 'block';
        document.getElementById('info-dt03').style.display = 'block';
        document.getElementById('info-dt04').style.display = 'block';
        document.getElementById('info-dd01').style.display = 'block';
        document.getElementById('info-dd02').style.display = 'none';
        document.getElementById('info-dd03').style.display = 'none';
        document.getElementById('info-dd04').style.display = 'none';
    } else if (num == '2') {
        document.getElementById('info-dt01').style.display = 'block';
        document.getElementById('info-dt02').style.display = 'none';
        document.getElementById('info-dt03').style.display = 'block';
        document.getElementById('info-dt04').style.display = 'block';
        document.getElementById('info-dd01').style.display = 'none';
        document.getElementById('info-dd02').style.display = 'block';
        document.getElementById('info-dd03').style.display = 'none';
        document.getElementById('info-dd04').style.display = 'none';
    } else if (num == '3') {
        document.getElementById('info-dt01').style.display = 'block';
        document.getElementById('info-dt02').style.display = 'block';
        document.getElementById('info-dt03').style.display = 'none';
        document.getElementById('info-dt04').style.display = 'block';
        document.getElementById('info-dd01').style.display = 'none';
        document.getElementById('info-dd02').style.display = 'none';
        document.getElementById('info-dd03').style.display = 'block';
        document.getElementById('info-dd04').style.display = 'none';
    } else if (num == '4') {
        document.getElementById('info-dt01').style.display = 'block';
        document.getElementById('info-dt02').style.display = 'block';
        document.getElementById('info-dt03').style.display = 'block';
        document.getElementById('info-dt04').style.display = 'none';
        document.getElementById('info-dd01').style.display = 'none';
        document.getElementById('info-dd02').style.display = 'none';
        document.getElementById('info-dd03').style.display = 'none';
        document.getElementById('info-dd04').style.display = 'block';
    }
}

function openClose2(num) {
    if (num == '1') {
        document.getElementById('info-div-1').style.display = 'block';
        document.getElementById('info-div-2').style.display = 'none';
        document.getElementById('info-div-3').style.display = 'none';
        document.getElementById('info-div-4').style.display = 'none';
    } else if (num == '2') {
        document.getElementById('info-div-1').style.display = 'none';
        document.getElementById('info-div-2').style.display = 'block';
        document.getElementById('info-div-3').style.display = 'none';
        document.getElementById('info-div-4').style.display = 'none';
    } else if (num == '3') {
        document.getElementById('info-div-1').style.display = 'none';
        document.getElementById('info-div-2').style.display = 'none';
        document.getElementById('info-div-3').style.display = 'block';
        document.getElementById('info-div-4').style.display = 'none';
    } else if (num == '4') {
        document.getElementById('info-div-1').style.display = 'none';
        document.getElementById('info-div-2').style.display = 'none';
        document.getElementById('info-div-3').style.display = 'none';
        document.getElementById('info-div-4').style.display = 'block';
    }
}

/* ·¹ÀÌ¾îº¸ÀÌ±â ¼û±â±â */
function layerShow(layerId) {
 document.getElementById(layerId).style.display = "block";
}
function layerHide(layerId) {
 document.getElementById(layerId).style.display = "none";
}

//¸ÞÀÎ ¹Ì´Ï°ø°¨ ·Ñ¸µ
function mainrollingminifeed(){
	var obj=document.getElementById('mini_tab');
	var moveobj=obj.getElementsByTagName('ul')[0];
	var banners=obj.getElementsByTagName('li');
	obj.style.width='255px';
	obj.style.height='56px';
	moveobj.style.marginTop='0px';
	moveobj.style.display='block';
	this.canimove=true;
	var temp,nowm,speed=50,onew=-19;

	var rolling=function(){
		nowm=parseInt(moveobj.style.marginTop);

		if(onew<nowm){
			setm(nowm+(Math.floor((onew-nowm)/speed)));
			moveobj.action=setTimeout(rolling,10);
		}else if(onew>nowm || onew==nowm){
			setm(0);
			items=moveobj.getElementsByTagName('li');
			temp=items[0].cloneNode(true);
			moveobj.removeChild(items[0]);
			moveobj.appendChild(temp);
			autorolling();
		}
	}

	var autorollingtime=3000;
	var autorollingtimer=0;
	var autorollingtimerid;
	var autorolling=function(){
		clearTimeout(autorollingtimerid);
		if(!mainrolling.canimove){
			autorollingtimer=0;
		}else{
			if(autorollingtime>autorollingtimer){
				autorollingtimer+=100;
				autorollingtimerid=setTimeout(autorolling,100);
			}else if(autorollingtime<=autorollingtimer){
				clearTimeout(autorollingtimerid);
				autorollingtimer=0;
				rolling();
			}
		}
	}
	this.restart=function(){
		autorolling();
	}

	var setm=function(newm){
		moveobj.style.marginTop=newm+'px';
	}

	obj.onmouseover=function(){
		mainrolling.canimove=false;
	}
	obj.onmouseout=function(){
		mainrolling.canimove=true;
		mainrolling.restart();
	}

	rolling();

}

function movieDisplay(id) {
    //alert(id);

    if (id == 'movie1') {
        document.getElementById('movie1').style.display = 'block';
        document.getElementById('movie2').style.display = 'none';
    } else {
        document.getElementById('movie1').style.display = 'none';
        document.getElementById('movie2').style.display = 'block';
    }
}

/**
 * ÀÌ½´»ç¾÷
 */
function businessTab(div_id) {
    document.getElementById('business-tab-1').style.display = 'none';
    document.getElementById('business-tab-2').style.display = 'none';
    document.getElementById('business-tab-3').style.display = 'none';

    document.getElementById(div_id).style.display = 'block';
}





